├── system ├── fonts │ ├── texb.ttf │ └── index.html ├── .htaccess ├── index.html ├── core │ ├── index.html │ ├── compat │ │ ├── index.html │ │ └── standard.php │ ├── Model.php │ └── Controller.php ├── database │ ├── index.html │ └── drivers │ │ ├── index.html │ │ ├── cubrid │ │ ├── index.html │ │ └── cubrid_utility.php │ │ ├── ibase │ │ ├── index.html │ │ └── ibase_utility.php │ │ ├── mssql │ │ ├── index.html │ │ └── mssql_utility.php │ │ ├── mysql │ │ └── index.html │ │ ├── mysqli │ │ └── index.html │ │ ├── oci8 │ │ ├── index.html │ │ └── oci8_utility.php │ │ ├── odbc │ │ ├── index.html │ │ ├── odbc_utility.php │ │ └── odbc_forge.php │ │ ├── pdo │ │ ├── index.html │ │ ├── subdrivers │ │ │ ├── index.html │ │ │ └── pdo_odbc_forge.php │ │ ├── pdo_forge.php │ │ └── pdo_utility.php │ │ ├── sqlsrv │ │ ├── index.html │ │ └── sqlsrv_utility.php │ │ ├── postgre │ │ ├── index.html │ │ └── postgre_utility.php │ │ └── sqlite3 │ │ ├── index.html │ │ └── sqlite3_utility.php ├── helpers │ ├── index.html │ ├── language_helper.php │ ├── email_helper.php │ ├── path_helper.php │ ├── xml_helper.php │ ├── number_helper.php │ ├── typography_helper.php │ ├── security_helper.php │ ├── directory_helper.php │ ├── array_helper.php │ └── cookie_helper.php ├── language │ ├── index.html │ └── english │ │ ├── index.html │ │ ├── number_lang.php │ │ ├── pagination_lang.php │ │ ├── migration_lang.php │ │ ├── unit_test_lang.php │ │ ├── profiler_lang.php │ │ ├── ftp_lang.php │ │ ├── calendar_lang.php │ │ ├── upload_lang.php │ │ ├── email_lang.php │ │ ├── imglib_lang.php │ │ └── db_lang.php └── libraries │ ├── index.html │ ├── Cache │ ├── index.html │ └── drivers │ │ └── index.html │ └── Session │ ├── index.html │ ├── drivers │ └── index.html │ ├── SessionUpdateTimestampHandlerInterface.php │ ├── CI_Session_driver_interface.php │ ├── OldSessionWrapper.php │ └── PHP8SessionWrapper.php ├── tests ├── mocks │ ├── uploads │ │ └── ci_logo.gif │ ├── database │ │ ├── drivers │ │ │ ├── pdo.php │ │ │ ├── mysql.php │ │ │ ├── mysqli.php │ │ │ ├── sqlite.php │ │ │ └── postgre.php │ │ ├── config │ │ │ ├── mysql.php │ │ │ ├── mysqli.php │ │ │ ├── pgsql.php │ │ │ ├── sqlite.php │ │ │ └── pdo │ │ │ │ ├── mysql.php │ │ │ │ ├── pgsql.php │ │ │ │ └── sqlite.php │ │ ├── db │ │ │ └── driver.php │ │ └── db.php │ ├── libraries │ │ ├── table.php │ │ ├── driver.php │ │ ├── encryption.php │ │ └── session.php │ ├── ci_testconfig.php │ ├── core │ │ ├── uri.php │ │ ├── security.php │ │ └── common.php │ └── autoloader.php ├── phpunit.xml └── Bootstrap.php ├── application ├── .htaccess ├── views │ ├── errors │ │ ├── cli │ │ │ ├── error_404.php │ │ │ ├── error_general.php │ │ │ ├── error_db.php │ │ │ ├── index.html │ │ │ ├── error_php.php │ │ │ └── error_exception.php │ │ ├── index.html │ │ └── html │ │ │ ├── index.html │ │ │ ├── error_php.php │ │ │ ├── error_exception.php │ │ │ ├── error_db.php │ │ │ ├── error_general.php │ │ │ └── error_404.php │ └── index.html ├── index.html ├── cache │ └── index.html ├── config │ ├── index.html │ ├── hooks.php │ ├── profiler.php │ ├── memcached.php │ ├── routes.php │ ├── doctypes.php │ ├── foreign_chars.php │ ├── migration.php │ ├── constants.php │ ├── database.php │ └── autoload.php ├── core │ └── index.html ├── helpers │ └── index.html ├── hooks │ └── index.html ├── language │ ├── index.html │ └── english │ │ └── index.html ├── logs │ └── index.html ├── models │ └── index.html ├── controllers │ ├── index.html │ └── Welcome.php ├── libraries │ └── index.html └── third_party │ └── index.html ├── .editorconfig ├── .gitignore ├── composer.json ├── license.txt ├── DCO.txt └── readme.rst /system/fonts/texb.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocketarc/codeigniter/HEAD/system/fonts/texb.ttf -------------------------------------------------------------------------------- /tests/mocks/uploads/ci_logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocketarc/codeigniter/HEAD/tests/mocks/uploads/ci_logo.gif -------------------------------------------------------------------------------- /system/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Require all denied 3 | 4 | 5 | Deny from all 6 | -------------------------------------------------------------------------------- /application/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Require all denied 3 | 4 | 5 | Deny from all 6 | -------------------------------------------------------------------------------- /application/views/errors/cli/error_404.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/core/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/fonts/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/helpers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/language/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/cache/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/config/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/core/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/helpers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/hooks/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/language/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/logs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/models/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/views/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/core/compat/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/libraries/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/controllers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/libraries/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/third_party/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/views/errors/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/language/english/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/libraries/Cache/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/libraries/Session/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/language/english/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/views/errors/cli/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/views/errors/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/cubrid/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/ibase/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/mssql/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/mysql/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/mysqli/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/oci8/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/odbc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/pdo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/sqlsrv/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/libraries/Cache/drivers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/postgre/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/sqlite3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/libraries/Session/drivers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/pdo/subdrivers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # top-most EditorConfig file 2 | root = true 3 | 4 | # Unix-style newlines with a newline ending every file 5 | [*] 6 | end_of_line = lf 7 | insert_final_newline = true 8 | 9 | # Matches multiple files with brace expansion notation 10 | # Set default charset 11 | [*] 12 | charset = utf-8 13 | 14 | # Tab indentation (no size specified) 15 | indent_style = tab 16 | -------------------------------------------------------------------------------- /tests/mocks/database/drivers/pdo.php: -------------------------------------------------------------------------------- 1 | config[$key]) ? $this->config[$key] : FALSE; 12 | } 13 | 14 | public function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) 15 | { 16 | $this->loaded[] = $file; 17 | return TRUE; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /tests/mocks/libraries/driver.php: -------------------------------------------------------------------------------- 1 | valid_drivers; 15 | } 16 | 17 | $this->valid_drivers = (array) $drivers; 18 | } 19 | 20 | /** 21 | * Get library name 22 | */ 23 | public function get_name() 24 | { 25 | return $this->lib_name; 26 | } 27 | } -------------------------------------------------------------------------------- /application/config/profiler.php: -------------------------------------------------------------------------------- 1 | array( 15 | 'hostname' => '127.0.0.1', 16 | 'port' => '11211', 17 | 'weight' => '1', 18 | ), 19 | ); 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | application/cache/* 4 | !application/cache/index.html 5 | 6 | application/logs/* 7 | !application/logs/index.html 8 | 9 | !application/*/.htaccess 10 | 11 | composer.lock 12 | tests/mocks/database/ci_test.sqlite 13 | 14 | user_guide_src/build/* 15 | user_guide_src/cilexer/build/* 16 | user_guide_src/cilexer/dist/* 17 | user_guide_src/cilexer/pycilexer.egg-info/* 18 | /vendor/ 19 | 20 | # IDE Files 21 | #------------------------- 22 | /nbproject/ 23 | .idea/* 24 | 25 | ## Sublime Text cache files 26 | *.tmlanguage.cache 27 | *.tmPreferences.cache 28 | *.stTheme.cache 29 | *.sublime-workspace 30 | *.sublime-project 31 | /tests/tests/ 32 | /tests/results/ 33 | -------------------------------------------------------------------------------- /application/views/errors/cli/error_php.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | A PHP Error was encountered 4 | 5 | Severity: 6 | Message: 7 | Filename: 8 | Line Number: 9 | 10 | 11 | 12 | Backtrace: 13 | 14 | 15 | File: 16 | Line: 17 | Function: 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /application/controllers/Welcome.php: -------------------------------------------------------------------------------- 1 | 19 | * @see https://codeigniter.com/userguide3/general/urls.html 20 | */ 21 | public function index() 22 | { 23 | $this->load->view('welcome_message'); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | 15 | ./codeigniter/core 16 | ./codeigniter/helpers 17 | ./codeigniter/libraries 18 | 19 | 20 | 21 | 22 | ../system/ 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /tests/mocks/database/config/mysql.php: -------------------------------------------------------------------------------- 1 | array( 7 | 'dsn' => '', 8 | 'hostname' => '127.0.0.1', 9 | 'username' => 'travis', 10 | 'password' => 'travis', 11 | 'database' => 'ci_test', 12 | 'dbdriver' => 'mysql' 13 | ), 14 | 15 | // Database configuration with failover 16 | 'mysql_failover' => array( 17 | 'dsn' => '', 18 | 'hostname' => '127.0.0.1', 19 | 'username' => 'not_travis', 20 | 'password' => 'wrong password', 21 | 'database' => 'not_ci_test', 22 | 'dbdriver' => 'mysql', 23 | 'failover' => array( 24 | array( 25 | 'dsn' => '', 26 | 'hostname' => '127.0.0.1', 27 | 'username' => 'travis', 28 | 'password' => 'travis', 29 | 'database' => 'ci_test', 30 | 'dbdriver' => 'mysql', 31 | ) 32 | ) 33 | ) 34 | ); -------------------------------------------------------------------------------- /tests/mocks/database/config/mysqli.php: -------------------------------------------------------------------------------- 1 | array( 7 | 'dsn' => '', 8 | 'hostname' => '127.0.0.1', 9 | 'username' => 'travis', 10 | 'password' => 'travis', 11 | 'database' => 'ci_test', 12 | 'dbdriver' => 'mysqli' 13 | ), 14 | 15 | // Database configuration with failover 16 | 'mysqli_failover' => array( 17 | 'dsn' => '', 18 | 'hostname' => '127.0.0.1', 19 | 'username' => 'not_travis', 20 | 'password' => 'wrong password', 21 | 'database' => 'not_ci_test', 22 | 'dbdriver' => 'mysqli', 23 | 'failover' => array( 24 | array( 25 | 'dsn' => '', 26 | 'hostname' => '127.0.0.1', 27 | 'username' => 'travis', 28 | 'password' => 'travis', 29 | 'database' => 'ci_test', 30 | 'dbdriver' => 'mysqli', 31 | ) 32 | ) 33 | ) 34 | ); -------------------------------------------------------------------------------- /tests/mocks/core/uri.php: -------------------------------------------------------------------------------- 1 | ci_core_class('cfg'); 9 | 10 | // set predictable config values 11 | $test->ci_set_config(array( 12 | 'index_page' => 'index.php', 13 | 'base_url' => 'http://example.com/', 14 | 'subclass_prefix' => 'MY_', 15 | 'enable_query_strings' => FALSE, 16 | 'permitted_uri_chars' => 'a-z 0-9~%.:_\-' 17 | )); 18 | 19 | $this->config = new $cls; 20 | 21 | if ($this->config->item('enable_query_strings') !== TRUE OR is_cli()) 22 | { 23 | $this->_permitted_uri_chars = $this->config->item('permitted_uri_chars'); 24 | } 25 | } 26 | 27 | public function _set_permitted_uri_chars($value) 28 | { 29 | $this->_permitted_uri_chars = $value; 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /tests/mocks/database/config/pgsql.php: -------------------------------------------------------------------------------- 1 | array( 7 | 'dsn' => '', 8 | 'hostname' => 'localhost', 9 | 'username' => 'postgres', 10 | 'password' => 'postgres', 11 | 'database' => 'ci_test', 12 | 'dbdriver' => 'postgre' 13 | ), 14 | 15 | // Database configuration with failover 16 | 'pgsql_failover' => array( 17 | 'dsn' => '', 18 | 'hostname' => 'localhost', 19 | 'username' => 'not_travis', 20 | 'password' => 'wrong password', 21 | 'database' => 'not_ci_test', 22 | 'dbdriver' => 'postgre', 23 | 'failover' => array( 24 | array( 25 | 'dsn' => '', 26 | 'hostname' => 'localhost', 27 | 'username' => 'postgres', 28 | 'password' => 'postgres', 29 | 'database' => 'ci_test', 30 | 'dbdriver' => 'postgre', 31 | ) 32 | ) 33 | ) 34 | ); -------------------------------------------------------------------------------- /application/views/errors/cli/error_exception.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | An uncaught Exception was encountered 4 | 5 | Type: 6 | Message: 7 | Filename: getFile(), "\n"; ?> 8 | Line Number: getLine(); ?> 9 | 10 | 11 | 12 | Backtrace: 13 | getTrace() as $error): ?> 14 | 15 | File: 16 | Line: 17 | Function: 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /tests/mocks/database/config/sqlite.php: -------------------------------------------------------------------------------- 1 | array( 7 | 'dsn' => '', 8 | 'hostname' => 'localhost', 9 | 'username' => 'sqlite', 10 | 'password' => 'sqlite', 11 | 'database' => realpath(__DIR__.'/..').'/ci_test.sqlite', 12 | 'dbdriver' => 'sqlite3' 13 | ), 14 | 15 | // Database configuration with failover 16 | 'sqlite_failover' => array( 17 | 'dsn' => '', 18 | 'hostname' => 'localhost', 19 | 'username' => 'sqlite', 20 | 'password' => 'sqlite', 21 | 'database' => '../not_exists.sqlite', 22 | 'dbdriver' => 'sqlite3', 23 | 'failover' => array( 24 | array( 25 | 'dsn' => '', 26 | 'hostname' => 'localhost', 27 | 'username' => 'sqlite', 28 | 'password' => 'sqlite', 29 | 'database' => realpath(__DIR__.'/..').'/ci_test.sqlite', 30 | 'dbdriver' => 'sqlite3' 31 | ) 32 | ) 33 | ) 34 | ); -------------------------------------------------------------------------------- /tests/mocks/libraries/encryption.php: -------------------------------------------------------------------------------- 1 | _get_params($params); 13 | } 14 | 15 | // -------------------------------------------------------------------- 16 | 17 | /** 18 | * get_key() 19 | * 20 | * Allows checking for key changes. 21 | */ 22 | public function get_key() 23 | { 24 | return $this->_key; 25 | } 26 | 27 | // -------------------------------------------------------------------- 28 | 29 | /** 30 | * __driver_get_handle() 31 | * 32 | * Allows checking for _mcrypt_get_handle(), _openssl_get_handle() 33 | */ 34 | public function __driver_get_handle($driver, $cipher, $mode) 35 | { 36 | return $this->{'_'.$driver.'_get_handle'}($cipher, $mode); 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /tests/mocks/database/config/pdo/mysql.php: -------------------------------------------------------------------------------- 1 | array( 7 | 'dsn' => 'mysql:host=127.0.0.1;dbname=ci_test', 8 | 'hostname' => '127.0.0.1', 9 | 'username' => 'travis', 10 | 'password' => 'travis', 11 | 'database' => 'ci_test', 12 | 'dbdriver' => 'pdo', 13 | 'subdriver' => 'mysql' 14 | ), 15 | 16 | // Database configuration with failover 17 | 'pdo/mysql_failover' => array( 18 | 'dsn' => '', 19 | 'hostname' => '127.0.0.1', 20 | 'username' => 'not_travis', 21 | 'password' => 'wrong password', 22 | 'database' => 'not_ci_test', 23 | 'dbdriver' => 'pdo', 24 | 'subdriver' => 'mysql', 25 | 'failover' => array( 26 | array( 27 | 'dsn' => 'mysql:host=127.0.0.1;dbname=ci_test', 28 | 'hostname' => '127.0.0.1', 29 | 'username' => 'travis', 30 | 'password' => 'travis', 31 | 'database' => 'ci_test', 32 | 'dbdriver' => 'pdo', 33 | 'subdriver' => 'mysql' 34 | ) 35 | ) 36 | ) 37 | ); -------------------------------------------------------------------------------- /application/views/errors/html/error_php.php: -------------------------------------------------------------------------------- 1 | 4 | 5 |
6 | 7 |

A PHP Error was encountered

8 | 9 |

Severity:

10 |

Message:

11 |

Filename:

12 |

Line Number:

13 | 14 | 15 | 16 |

Backtrace:

17 | 18 | 19 | 20 | 21 |

22 | File:
23 | Line:
24 | Function: 25 |

26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
34 | -------------------------------------------------------------------------------- /tests/mocks/libraries/session.php: -------------------------------------------------------------------------------- 1 | _flashdata_sweep(); 13 | $this->_flashdata_mark(); 14 | $this->_tempdata_sweep(); 15 | } 16 | } 17 | 18 | /** 19 | * Mock cookie driver to overload cookie setting 20 | */ 21 | class Mock_Libraries_Session_cookie extends CI_Session_cookie { 22 | /** 23 | * Overload _setcookie to manage $_COOKIE values, since actual cookies can't be set in unit testing 24 | */ 25 | protected function _setcookie($name, $value = '', $expire = 0, $path = '', $domain = '', $secure = FALSE, $httponly = FALSE) 26 | { 27 | if (empty($value) OR $expire <= time()) 28 | { 29 | unset($_COOKIE[$name]); 30 | } 31 | else 32 | { 33 | $_COOKIE[$name] = $value; 34 | } 35 | } 36 | } 37 | 38 | class Mock_Libraries_Session_native extends CI_Session_native {} -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "The CodeIgniter framework", 3 | "name": "pocketarc/codeigniter", 4 | "type": "project", 5 | "homepage": "https://github.com/pocketarc/codeigniter", 6 | "license": "MIT", 7 | "support": { 8 | "source": "https://github.com/pocketarc/codeigniter" 9 | }, 10 | "require": { 11 | "php": ">=5.4.8" 12 | }, 13 | "suggest": { 14 | "paragonie/random_compat": "Provides better randomness in PHP 5.x" 15 | }, 16 | "scripts": { 17 | "test:coverage": [ 18 | "@putenv XDEBUG_MODE=coverage", 19 | "phpunit --color=always --coverage-text --configuration tests/travis/sqlite.phpunit.xml" 20 | ], 21 | "post-install-cmd": [ 22 | "sed -i s/name{0}/name[0]/ vendor/mikey179/vfsstream/src/main/php/org/bovigo/vfs/vfsStream.php" 23 | ], 24 | "post-update-cmd": [ 25 | "sed -i s/name{0}/name[0]/ vendor/mikey179/vfsstream/src/main/php/org/bovigo/vfs/vfsStream.php" 26 | ] 27 | }, 28 | "require-dev": { 29 | "mikey179/vfsstream": "1.6.*", 30 | "phpunit/phpunit": "4.* || 5.* || 9.*" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /tests/mocks/database/config/pdo/pgsql.php: -------------------------------------------------------------------------------- 1 | array( 7 | 'dsn' => 'pgsql:host=localhost;port=5432;dbname=ci_test;', 8 | 'hostname' => 'localhost', 9 | 'username' => 'postgres', 10 | 'password' => 'postgres', 11 | 'database' => 'ci_test', 12 | 'dbdriver' => 'pdo', 13 | 'subdriver' => 'pgsql' 14 | ), 15 | 16 | // Database configuration with failover 17 | 'pdo/pgsql_failover' => array( 18 | 'dsn' => '', 19 | 'hostname' => 'localhost', 20 | 'username' => 'not_travis', 21 | 'password' => 'wrong password', 22 | 'database' => 'not_ci_test', 23 | 'dbdriver' => 'pdo', 24 | 'subdriver' => 'pgsql', 25 | 'failover' => array( 26 | array( 27 | 'dsn' => 'pgsql:host=localhost;port=5432;dbname=ci_test;', 28 | 'hostname' => 'localhost', 29 | 'username' => 'postgres', 30 | 'password' => 'postgres', 31 | 'database' => 'ci_test', 32 | 'dbdriver' => 'pdo', 33 | 'subdriver' => 'pgsql' 34 | ) 35 | ) 36 | ) 37 | ); -------------------------------------------------------------------------------- /tests/mocks/database/config/pdo/sqlite.php: -------------------------------------------------------------------------------- 1 | array( 7 | 'dsn' => 'sqlite:/'.realpath(__DIR__.'/../..').'/ci_test.sqlite', 8 | 'hostname' => 'localhost', 9 | 'username' => 'sqlite', 10 | 'password' => 'sqlite', 11 | 'database' => 'sqlite', 12 | 'dbdriver' => 'pdo', 13 | 'subdriver' => 'sqlite' 14 | ), 15 | 16 | // Database configuration with failover 17 | 'pdo/sqlite_failover' => array( 18 | 'dsn' => 'sqlite:not_exists.sqlite', 19 | 'hostname' => 'localhost', 20 | 'username' => 'sqlite', 21 | 'password' => 'sqlite', 22 | 'database' => 'sqlite', 23 | 'dbdriver' => 'pdo', 24 | 'subdriver' => 'sqlite', 25 | 'failover' => array( 26 | array( 27 | 'dsn' => 'sqlite:/'.realpath(__DIR__.'/../..').'/ci_test.sqlite', 28 | 'hostname' => 'localhost', 29 | 'username' => 'sqlite', 30 | 'password' => 'sqlite', 31 | 'database' => 'sqlite', 32 | 'dbdriver' => 'pdo', 33 | 'subdriver' => 'sqlite' 34 | ) 35 | ) 36 | ) 37 | ); -------------------------------------------------------------------------------- /tests/mocks/core/security.php: -------------------------------------------------------------------------------- 1 | {'_'.$property}) ? $this->{'_'.$property} : NULL; 17 | } 18 | 19 | public function remove_evil_attributes($str, $is_image) 20 | { 21 | return $this->_remove_evil_attributes($str, $is_image); 22 | } 23 | 24 | // Override inaccessible protected method 25 | public function __call($method, $params) 26 | { 27 | if (is_callable(array($this, '_'.$method))) 28 | { 29 | return call_user_func_array(array($this, '_'.$method), $params); 30 | } 31 | 32 | throw new BadMethodCallException('Method '.$method.' was not found'); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /tests/mocks/database/db/driver.php: -------------------------------------------------------------------------------- 1 | ci_db_driver = new $driver_class($config); 22 | } 23 | } 24 | 25 | /** 26 | * Overloading method, emulate the actual driver method (multiple inheritance workaround) 27 | */ 28 | public function __call($method, $arguments) 29 | { 30 | if ( ! is_callable(array($this->ci_db_driver, $method))) 31 | { 32 | throw new BadMethodCallException($method. ' not exists or not implemented'); 33 | } 34 | 35 | return call_user_func_array(array($this->ci_db_driver, $method), $arguments); 36 | } 37 | 38 | } 39 | 40 | class CI_DB extends CI_DB_query_builder {} -------------------------------------------------------------------------------- /application/views/errors/html/error_exception.php: -------------------------------------------------------------------------------- 1 | 4 | 5 |
6 | 7 |

An uncaught Exception was encountered

8 | 9 |

Type:

10 |

Message:

11 |

Filename: getFile(); ?>

12 |

Line Number: getLine(); ?>

13 | 14 | 15 | 16 |

Backtrace:

17 | getTrace() as $error): ?> 18 | 19 | 20 | 21 |

22 | File:
23 | Line:
24 | Function: 25 |

26 | 27 | 28 | 29 | 30 | 31 | 32 |
33 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2019 - 2022, CodeIgniter Foundation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /DCO.txt: -------------------------------------------------------------------------------- 1 | Developer's Certificate of Origin 1.1 2 | 3 | By making a contribution to this project, I certify that: 4 | 5 | (1) The contribution was created in whole or in part by me and I 6 | have the right to submit it under the open source license 7 | indicated in the file; or 8 | 9 | (2) The contribution is based upon previous work that, to the best 10 | of my knowledge, is covered under an appropriate open source 11 | license and I have the right under that license to submit that 12 | work with modifications, whether created in whole or in part 13 | by me, under the same open source license (unless I am 14 | permitted to submit under a different license), as indicated 15 | in the file; or 16 | 17 | (3) The contribution was provided directly to me by some other 18 | person who certified (1), (2) or (3) and I have not modified 19 | it. 20 | 21 | (4) I understand and agree that this project and the contribution 22 | are public and that a record of the contribution (including all 23 | personal information I submit with it, including my sign-off) is 24 | maintained indefinitely and may be redistributed consistent with 25 | this project or the open source license(s) involved. 26 | -------------------------------------------------------------------------------- /application/views/errors/html/error_db.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | Database Error 8 | 78 | 79 | 80 |
81 |

82 |
83 | 84 |
85 |
86 | 87 | 88 | -------------------------------------------------------------------------------- /application/views/errors/html/error_general.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | Error 8 | 78 | 79 | 80 |
81 |

82 |
83 | 84 |
85 |
86 | 87 | 88 | -------------------------------------------------------------------------------- /application/views/errors/html/error_404.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 404 Page Not Found 8 | 78 | 79 | 80 |
81 |

82 |
83 | 84 |
85 |
86 | 87 | 88 | -------------------------------------------------------------------------------- /system/language/english/number_lang.php: -------------------------------------------------------------------------------- 1 | my_controller/index 50 | | my-controller/my-method -> my_controller/my_method 51 | */ 52 | $route['default_controller'] = 'welcome'; 53 | $route['404_override'] = ''; 54 | $route['translate_uri_dashes'] = FALSE; 55 | -------------------------------------------------------------------------------- /system/libraries/Session/SessionUpdateTimestampHandlerInterface.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsupported_feature'); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /application/config/doctypes.php: -------------------------------------------------------------------------------- 1 | '', 6 | 'xhtml1-strict' => '', 7 | 'xhtml1-trans' => '', 8 | 'xhtml1-frame' => '', 9 | 'xhtml-basic11' => '', 10 | 'html5' => '', 11 | 'html4-strict' => '', 12 | 'html4-trans' => '', 13 | 'html4-frame' => '', 14 | 'mathml1' => '', 15 | 'mathml2' => '', 16 | 'svg10' => '', 17 | 'svg11' => '', 18 | 'svg11-basic' => '', 19 | 'svg11-tiny' => '', 20 | 'xhtml-math-svg-xh' => '', 21 | 'xhtml-math-svg-sh' => '', 22 | 'xhtml-rdfa-1' => '', 23 | 'xhtml-rdfa-2' => '' 24 | ); 25 | -------------------------------------------------------------------------------- /system/database/drivers/pdo/pdo_forge.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsupported_feature'); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /system/database/drivers/odbc/odbc_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsupported_feature'); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /system/database/drivers/oci8/oci8_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsupported_feature'); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /system/database/drivers/pdo/subdrivers/pdo_odbc_forge.php: -------------------------------------------------------------------------------- 1 | db->hostname, $this->db->username, $this->db->password)) 59 | { 60 | $res = ibase_backup($service, $this->db->database, $filename.'.fbk'); 61 | 62 | // Close the service connection 63 | ibase_service_detach($service); 64 | return $res; 65 | } 66 | 67 | return FALSE; 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /system/language/english/unit_test_lang.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsupported_feature'); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /system/database/drivers/sqlsrv/sqlsrv_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsupported_feature'); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /system/core/Model.php: -------------------------------------------------------------------------------- 1 | $key; 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /system/database/drivers/postgre/postgre_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsupported_feature'); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /system/helpers/language_helper.php: -------------------------------------------------------------------------------- 1 | lang->line($line); 68 | 69 | if ($for !== '') 70 | { 71 | $line = ''; 72 | } 73 | 74 | return $line; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /system/database/drivers/odbc/odbc_forge.php: -------------------------------------------------------------------------------- 1 | db->data_cache['db_names'])) 58 | { 59 | return $this->db->data_cache['db_names']; 60 | } 61 | 62 | return $this->db->data_cache['db_names'] = cubrid_list_dbs($this->db->conn_id); 63 | } 64 | 65 | // -------------------------------------------------------------------- 66 | 67 | /** 68 | * CUBRID Export 69 | * 70 | * @param array Preferences 71 | * @return mixed 72 | */ 73 | protected function _backup($params = array()) 74 | { 75 | // No SQL based support in CUBRID as of version 8.4.0. Database or 76 | // table backup can be performed using CUBRID Manager 77 | // database administration tool. 78 | return $this->db->display_error('db_unsupported_feature'); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /system/language/english/profiler_lang.php: -------------------------------------------------------------------------------- 1 | =')) { 6 | error_reporting(E_ALL); 7 | } else { 8 | error_reporting(E_ALL | E_STRICT); 9 | } 10 | 11 | $dir = realpath(dirname(__FILE__)); 12 | 13 | // Path constants 14 | defined('PROJECT_BASE') OR define('PROJECT_BASE', realpath($dir.'/../').'/'); 15 | defined('SYSTEM_PATH') OR define('SYSTEM_PATH', PROJECT_BASE.'system/'); 16 | 17 | // Get vfsStream either via PEAR or composer 18 | foreach (explode(PATH_SEPARATOR, get_include_path()) as $path) 19 | { 20 | if (file_exists($path.DIRECTORY_SEPARATOR.'vfsStream/vfsStream.php')) 21 | { 22 | require_once 'vfsStream/vfsStream.php'; 23 | break; 24 | } 25 | } 26 | 27 | if ( ! class_exists('vfsStream') && file_exists(PROJECT_BASE.'vendor/autoload.php')) 28 | { 29 | include_once PROJECT_BASE.'vendor/autoload.php'; 30 | class_alias('org\bovigo\vfs\vfsStream', 'vfsStream'); 31 | class_alias('org\bovigo\vfs\vfsStreamDirectory', 'vfsStreamDirectory'); 32 | class_alias('org\bovigo\vfs\vfsStreamWrapper', 'vfsStreamWrapper'); 33 | } 34 | 35 | // Define CI path constants to VFS (filesystem setup in CI_TestCase::setUp) 36 | defined('BASEPATH') OR define('BASEPATH', vfsStream::url('system/')); 37 | defined('APPPATH') OR define('APPPATH', vfsStream::url('application/')); 38 | defined('VIEWPATH') OR define('VIEWPATH', APPPATH.'views/'); 39 | defined('ENVIRONMENT') OR define('ENVIRONMENT', 'development'); 40 | 41 | // Set localhost "remote" IP 42 | isset($_SERVER['REMOTE_ADDR']) OR $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; 43 | 44 | // Prep our test environment 45 | include_once $dir.'/mocks/core/common.php'; 46 | include_once SYSTEM_PATH.'core/Common.php'; 47 | 48 | ini_set('default_charset', 'UTF-8'); 49 | 50 | if (extension_loaded('mbstring')) 51 | { 52 | defined('MB_ENABLED') OR define('MB_ENABLED', TRUE); 53 | @ini_set('mbstring.internal_encoding', 'UTF-8'); 54 | mb_substitute_character('none'); 55 | } 56 | else 57 | { 58 | defined('MB_ENABLED') OR define('MB_ENABLED', FALSE); 59 | } 60 | 61 | if (extension_loaded('iconv')) 62 | { 63 | defined('ICONV_ENABLED') OR define('ICONV_ENABLED', TRUE); 64 | @ini_set('iconv.internal_encoding', 'UTF-8'); 65 | } 66 | else 67 | { 68 | defined('ICONV_ENABLED') OR define('ICONV_ENABLED', FALSE); 69 | } 70 | 71 | is_php('5.6') && ini_set('php.internal_encoding', 'UTF-8'); 72 | 73 | if (is_php('7.0')) 74 | { 75 | $test_case_code = file_get_contents(PROJECT_BASE.'vendor/phpunit/phpunit/src/Framework/TestCase.php'); 76 | $test_case_code = preg_replace('/^\s+((?:protected|public)(?: static)? function \w+\(\)): void/m', '$1', $test_case_code); 77 | file_put_contents(PROJECT_BASE.'vendor/phpunit/phpunit/src/Framework/TestCase.php', $test_case_code); 78 | } 79 | 80 | include_once SYSTEM_PATH.'core/compat/mbstring.php'; 81 | include_once SYSTEM_PATH.'core/compat/hash.php'; 82 | include_once SYSTEM_PATH.'core/compat/password.php'; 83 | include_once SYSTEM_PATH.'core/compat/standard.php'; 84 | 85 | include_once $dir.'/mocks/autoloader.php'; 86 | spl_autoload_register('autoload'); 87 | 88 | unset($dir); 89 | -------------------------------------------------------------------------------- /system/helpers/email_helper.php: -------------------------------------------------------------------------------- 1 | driver = $driver; 57 | } 58 | 59 | public function open($save_path, $name) 60 | { 61 | return $this->driver->open($save_path, $name); 62 | } 63 | 64 | public function close() 65 | { 66 | return $this->driver->close(); 67 | } 68 | 69 | public function read($id) 70 | { 71 | return $this->driver->read($id); 72 | } 73 | 74 | public function write($id, $data) 75 | { 76 | return $this->driver->write($id, $data); 77 | } 78 | 79 | public function destroy($id) 80 | { 81 | return $this->driver->destroy($id); 82 | } 83 | 84 | public function gc($maxlifetime) 85 | { 86 | return $this->driver->gc($maxlifetime); 87 | } 88 | 89 | public function updateTimestamp($id, $data) 90 | { 91 | return $this->driver->updateTimestamp($id, $data); 92 | } 93 | 94 | public function validateId($id) 95 | { 96 | return $this->driver->validateId($id); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /application/config/foreign_chars.php: -------------------------------------------------------------------------------- 1 | 'ae', 14 | '/ö|œ/' => 'oe', 15 | '/ü/' => 'ue', 16 | '/Ä/' => 'Ae', 17 | '/Ü/' => 'Ue', 18 | '/Ö/' => 'Oe', 19 | '/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ|Α|Ά|Ả|Ạ|Ầ|Ẫ|Ẩ|Ậ|Ằ|Ắ|Ẵ|Ẳ|Ặ|А/' => 'A', 20 | '/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª|α|ά|ả|ạ|ầ|ấ|ẫ|ẩ|ậ|ằ|ắ|ẵ|ẳ|ặ|а/' => 'a', 21 | '/Б/' => 'B', 22 | '/б/' => 'b', 23 | '/Ç|Ć|Ĉ|Ċ|Č/' => 'C', 24 | '/ç|ć|ĉ|ċ|č/' => 'c', 25 | '/Д|Δ/' => 'D', 26 | '/д|δ/' => 'd', 27 | '/Ð|Ď|Đ/' => 'Dj', 28 | '/ð|ď|đ/' => 'dj', 29 | '/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě|Ε|Έ|Ẽ|Ẻ|Ẹ|Ề|Ế|Ễ|Ể|Ệ|Е|Э/' => 'E', 30 | '/è|é|ê|ë|ē|ĕ|ė|ę|ě|έ|ε|ẽ|ẻ|ẹ|ề|ế|ễ|ể|ệ|е|э/' => 'e', 31 | '/Ф/' => 'F', 32 | '/ф/' => 'f', 33 | '/Ĝ|Ğ|Ġ|Ģ|Γ|Г|Ґ/' => 'G', 34 | '/ĝ|ğ|ġ|ģ|γ|г|ґ/' => 'g', 35 | '/Ĥ|Ħ/' => 'H', 36 | '/ĥ|ħ/' => 'h', 37 | '/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ|Η|Ή|Ί|Ι|Ϊ|Ỉ|Ị|И|Ы/' => 'I', 38 | '/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı|η|ή|ί|ι|ϊ|ỉ|ị|и|ы|ї/' => 'i', 39 | '/Ĵ/' => 'J', 40 | '/ĵ/' => 'j', 41 | '/Θ/' => 'TH', 42 | '/θ/' => 'th', 43 | '/Ķ|Κ|К/' => 'K', 44 | '/ķ|κ|к/' => 'k', 45 | '/Ĺ|Ļ|Ľ|Ŀ|Ł|Λ|Л/' => 'L', 46 | '/ĺ|ļ|ľ|ŀ|ł|λ|л/' => 'l', 47 | '/М/' => 'M', 48 | '/м/' => 'm', 49 | '/Ñ|Ń|Ņ|Ň|Ν|Н/' => 'N', 50 | '/ñ|ń|ņ|ň|ʼn|ν|н/' => 'n', 51 | '/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ|Ο|Ό|Ω|Ώ|Ỏ|Ọ|Ồ|Ố|Ỗ|Ổ|Ộ|Ờ|Ớ|Ỡ|Ở|Ợ|О/' => 'O', 52 | '/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º|ο|ό|ω|ώ|ỏ|ọ|ồ|ố|ỗ|ổ|ộ|ờ|ớ|ỡ|ở|ợ|о/' => 'o', 53 | '/П/' => 'P', 54 | '/п/' => 'p', 55 | '/Ŕ|Ŗ|Ř|Ρ|Р/' => 'R', 56 | '/ŕ|ŗ|ř|ρ|р/' => 'r', 57 | '/Ś|Ŝ|Ş|Ș|Š|Σ|С/' => 'S', 58 | '/ś|ŝ|ş|ș|š|ſ|σ|ς|с/' => 's', 59 | '/Ț|Ţ|Ť|Ŧ|Τ|Т/' => 'T', 60 | '/ț|ţ|ť|ŧ|τ|т/' => 't', 61 | '/Þ|þ/' => 'th', 62 | '/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ|Ũ|Ủ|Ụ|Ừ|Ứ|Ữ|Ử|Ự|У/' => 'U', 63 | '/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ|υ|ύ|ϋ|ủ|ụ|ừ|ứ|ữ|ử|ự|у/' => 'u', 64 | '/Ƴ|Ɏ|Ỵ|Ẏ|Ӳ|Ӯ|Ў|Ý|Ÿ|Ŷ|Υ|Ύ|Ϋ|Ỳ|Ỹ|Ỷ|Ỵ|Й/' => 'Y', 65 | '/ẙ|ʏ|ƴ|ɏ|ỵ|ẏ|ӳ|ӯ|ў|ý|ÿ|ŷ|ỳ|ỹ|ỷ|ỵ|й/' => 'y', 66 | '/В/' => 'V', 67 | '/в/' => 'v', 68 | '/Ŵ/' => 'W', 69 | '/ŵ/' => 'w', 70 | '/Φ/' => 'F', 71 | '/φ/' => 'f', 72 | '/Χ/' => 'CH', 73 | '/χ/' => 'ch', 74 | '/Ź|Ż|Ž|Ζ|З/' => 'Z', 75 | '/ź|ż|ž|ζ|з/' => 'z', 76 | '/Æ|Ǽ/' => 'AE', 77 | '/ß/' => 'ss', 78 | '/IJ/' => 'IJ', 79 | '/ij/' => 'ij', 80 | '/Œ/' => 'OE', 81 | '/ƒ/' => 'f', 82 | '/Ξ/' => 'KS', 83 | '/ξ/' => 'ks', 84 | '/Π/' => 'P', 85 | '/π/' => 'p', 86 | '/Β/' => 'V', 87 | '/β/' => 'v', 88 | '/Μ/' => 'M', 89 | '/μ/' => 'm', 90 | '/Ψ/' => 'PS', 91 | '/ψ/' => 'ps', 92 | '/Ё/' => 'Yo', 93 | '/ё/' => 'yo', 94 | '/Є/' => 'Ye', 95 | '/є/' => 'ye', 96 | '/Ї/' => 'Yi', 97 | '/Ж/' => 'Zh', 98 | '/ж/' => 'zh', 99 | '/Х/' => 'Kh', 100 | '/х/' => 'kh', 101 | '/Ц/' => 'Ts', 102 | '/ц/' => 'ts', 103 | '/Ч/' => 'Ch', 104 | '/ч/' => 'ch', 105 | '/Ш/' => 'Sh', 106 | '/ш/' => 'sh', 107 | '/Щ/' => 'Shch', 108 | '/щ/' => 'shch', 109 | '/Ъ|ъ|Ь|ь/' => '', 110 | '/Ю/' => 'Yu', 111 | '/ю/' => 'yu', 112 | '/Я/' => 'Ya', 113 | '/я/' => 'ya' 114 | ); 115 | -------------------------------------------------------------------------------- /system/helpers/path_helper.php: -------------------------------------------------------------------------------- 1 | ', '"', "'", '-'), 77 | array('&', '<', '>', '"', ''', '-'), 78 | $str 79 | ); 80 | 81 | // Decode the temp markers back to entities 82 | $str = preg_replace('/'.$temp.'(\d+);/', '&#\\1;', $str); 83 | 84 | if ($protect_all === TRUE) 85 | { 86 | return preg_replace('/'.$temp.'(\w+);/', '&\\1;', $str); 87 | } 88 | 89 | return $str; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /application/config/migration.php: -------------------------------------------------------------------------------- 1 | migration->current() this is the version that schema will 69 | | be upgraded / downgraded to. 70 | | 71 | */ 72 | $config['migration_version'] = 0; 73 | 74 | /* 75 | |-------------------------------------------------------------------------- 76 | | Migrations Path 77 | |-------------------------------------------------------------------------- 78 | | 79 | | Path to your migrations folder. 80 | | Typically, it will be within your application path. 81 | | Also, writing permission is required within the migrations path. 82 | | 83 | */ 84 | $config['migration_path'] = APPPATH.'migrations/'; 85 | -------------------------------------------------------------------------------- /system/language/english/calendar_lang.php: -------------------------------------------------------------------------------- 1 | lang->load('number'); 66 | 67 | if ($num >= 1000000000000) 68 | { 69 | $num = round($num / 1099511627776, $precision); 70 | $unit = $CI->lang->line('terabyte_abbr'); 71 | } 72 | elseif ($num >= 1000000000) 73 | { 74 | $num = round($num / 1073741824, $precision); 75 | $unit = $CI->lang->line('gigabyte_abbr'); 76 | } 77 | elseif ($num >= 1000000) 78 | { 79 | $num = round($num / 1048576, $precision); 80 | $unit = $CI->lang->line('megabyte_abbr'); 81 | } 82 | elseif ($num >= 1000) 83 | { 84 | $num = round($num / 1024, $precision); 85 | $unit = $CI->lang->line('kilobyte_abbr'); 86 | } 87 | else 88 | { 89 | $unit = $CI->lang->line('bytes'); 90 | return number_format($num).' '.$unit; 91 | } 92 | 93 | return number_format($num, $precision).' '.$unit; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /system/libraries/Session/PHP8SessionWrapper.php: -------------------------------------------------------------------------------- 1 | driver = $driver; 57 | } 58 | 59 | public function open(string $save_path, string $name): bool 60 | { 61 | return $this->driver->open($save_path, $name); 62 | } 63 | 64 | public function close(): bool 65 | { 66 | return $this->driver->close(); 67 | } 68 | 69 | #[\ReturnTypeWillChange] 70 | public function read(string $id): mixed 71 | { 72 | return $this->driver->read($id); 73 | } 74 | 75 | public function write(string $id, string $data): bool 76 | { 77 | return $this->driver->write($id, $data); 78 | } 79 | 80 | public function destroy(string $id): bool 81 | { 82 | return $this->driver->destroy($id); 83 | } 84 | 85 | #[\ReturnTypeWillChange] 86 | public function gc(int $maxlifetime): mixed 87 | { 88 | return $this->driver->gc($maxlifetime); 89 | } 90 | 91 | public function updateTimestamp(string $id, string$data): bool 92 | { 93 | return $this->driver->updateTimestamp($id, $data); 94 | } 95 | 96 | public function validateId(string $id): bool 97 | { 98 | return $this->driver->validateId($id); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /system/language/english/upload_lang.php: -------------------------------------------------------------------------------- 1 | $class) 83 | { 84 | $this->$var =& load_class($class); 85 | } 86 | 87 | $this->load =& load_class('Loader', 'core'); 88 | $this->load->initialize(); 89 | log_message('info', 'Controller Class Initialized'); 90 | } 91 | 92 | // -------------------------------------------------------------------- 93 | 94 | /** 95 | * Get the CI singleton 96 | * 97 | * @static 98 | * @return object 99 | */ 100 | public static function &get_instance() 101 | { 102 | return self::$instance; 103 | } 104 | 105 | } 106 | -------------------------------------------------------------------------------- /tests/mocks/core/common.php: -------------------------------------------------------------------------------- 1 | ci_instance(); 11 | return $test; 12 | } 13 | } 14 | 15 | // -------------------------------------------------------------------- 16 | 17 | if ( ! function_exists('get_config')) 18 | { 19 | function &get_config() 20 | { 21 | $test = CI_TestCase::instance(); 22 | $config = $test->ci_get_config(); 23 | return $config; 24 | } 25 | } 26 | 27 | if ( ! function_exists('config_item')) 28 | { 29 | function config_item($item) 30 | { 31 | $config =& get_config(); 32 | 33 | if ( ! isset($config[$item])) 34 | { 35 | return NULL; 36 | } 37 | 38 | return $config[$item]; 39 | } 40 | } 41 | 42 | if ( ! function_exists('get_mimes')) 43 | { 44 | /** 45 | * Returns the MIME types array from config/mimes.php 46 | * 47 | * @return array 48 | */ 49 | function &get_mimes() 50 | { 51 | static $_mimes = array(); 52 | 53 | if (empty($_mimes)) 54 | { 55 | $path = realpath(PROJECT_BASE.'application/config/mimes.php'); 56 | if (is_file($path)) 57 | { 58 | $_mimes = include($path); 59 | } 60 | } 61 | 62 | return $_mimes; 63 | } 64 | } 65 | 66 | // -------------------------------------------------------------------- 67 | 68 | /* 69 | if ( ! function_exists('load_class')) 70 | { 71 | function load_class($class, $directory = 'libraries', $prefix = 'CI_') 72 | { 73 | if ($directory !== 'core' OR $prefix !== 'CI_') 74 | { 75 | throw new Exception('Not Implemented: Non-core load_class()'); 76 | } 77 | 78 | $test = CI_TestCase::instance(); 79 | 80 | $obj =& $test->ci_core_class($class); 81 | 82 | if (is_string($obj)) 83 | { 84 | throw new Exception('Bad Isolation: Use ci_set_core_class to set '.$class); 85 | } 86 | 87 | return $obj; 88 | } 89 | } 90 | */ 91 | 92 | // Clean up error messages 93 | // -------------------------------------------------------------------- 94 | 95 | if ( ! function_exists('show_error')) 96 | { 97 | function show_error($message, $status_code = 500, $heading = 'An Error Was Encountered') 98 | { 99 | throw new RuntimeException('CI Error: '.$message); 100 | } 101 | } 102 | 103 | if ( ! function_exists('show_404')) 104 | { 105 | function show_404($page = '', $log_error = TRUE) 106 | { 107 | throw new RuntimeException('CI Error: 404'); 108 | } 109 | } 110 | 111 | if ( ! function_exists('_exception_handler')) 112 | { 113 | function _exception_handler($severity, $message, $filepath, $line) 114 | { 115 | throw new RuntimeException('CI Exception: '.$message.' | '.$filepath.' | '.$line); 116 | } 117 | } 118 | 119 | // We assume a few things about our environment ... 120 | // -------------------------------------------------------------------- 121 | if ( ! function_exists('is_loaded')) 122 | { 123 | function &is_loaded() 124 | { 125 | $loaded = array(); 126 | return $loaded; 127 | } 128 | } 129 | 130 | if ( ! function_exists('log_message')) 131 | { 132 | function log_message($level, $message) 133 | { 134 | return TRUE; 135 | } 136 | } 137 | 138 | if ( ! function_exists('set_status_header')) 139 | { 140 | function set_status_header($code = 200, $text = '') 141 | { 142 | return TRUE; 143 | } 144 | } 145 | 146 | if ( ! function_exists('is_cli')) 147 | { 148 | // In order to test HTTP functionality, we need to lie about this 149 | function is_cli() 150 | { 151 | return FALSE; 152 | } 153 | } -------------------------------------------------------------------------------- /readme.rst: -------------------------------------------------------------------------------- 1 | ######################## 2 | What is this repository? 3 | ######################## 4 | 5 | This is a fork of CodeIgniter 3, with the goal of keeping it up to date with modern PHP versions. There is no intention to add new features or change the way CI3 works. This is purely a maintenance fork. 6 | 7 | **PHP Compatibility:** 8 | 9 | - ✅ PHP 5.4 - 8.1 (as per original CI3 support) 10 | - ✅ PHP 8.2 11 | - ✅ PHP 8.3 12 | - ✅ PHP 8.4 13 | - ✅ PHP 8.5 (and beyond as they are released) 14 | 15 | The original CodeIgniter 3.x branch is no longer maintained, and has not been updated to work with PHP 8.2, or any newer version. This fork is intended to fill that gap. 16 | 17 | If the original CodeIgniter 3.x branch is updated to work with PHP 8.2+, and starts to be maintained again, this fork might be retired. 18 | 19 | ******************** 20 | Maintenance Policy 21 | ******************** 22 | 23 | This fork commits to: 24 | 25 | - Maintaining compatibility with each new PHP version while still supporting PHP 5.4+ 26 | - Applying critical security fixes 27 | - Keeping changes minimal to preserve CI3 behavior 28 | - Reverting unnecessary breaking changes in CodeIgniter 3.2.0-dev 29 | - Running the full CI3 test suite on PHP 8.2+ 30 | 31 | This fork does NOT: 32 | 33 | - Add new features 34 | - Change existing CI3 behavior 35 | - Provide commercial support 36 | - Make migration to CI4 any harder (or easier) 37 | 38 | **************** 39 | Issues and Pulls 40 | **************** 41 | 42 | Issues and Pull Requests are welcome, but please note that this is a maintenance fork. New features will not be accepted. If you have a new feature you would like to see in CodeIgniter, please submit it to the original CodeIgniter 3.x branch. 43 | 44 | ******************* 45 | Server Requirements 46 | ******************* 47 | 48 | PHP version 5.4 or newer, same as the original CI3 requirements. 49 | 50 | ************ 51 | Installation 52 | ************ 53 | 54 | You can install this fork using Composer: 55 | 56 | .. code-block:: bash 57 | 58 | composer require pocketarc/codeigniter 59 | 60 | After installation, you need to point CodeIgniter to the new system directory. In your `index.php` file, update the `$system_path` variable: 61 | 62 | .. code-block:: php 63 | 64 | $system_path = 'vendor/pocketarc/codeigniter/system'; 65 | 66 | **Alternative Installation (Manual)** 67 | 68 | If you prefer the traditional approach of replacing the system directory: 69 | 70 | 1. Download this repository 71 | 2. Replace your existing `system/` directory with the one from this fork 72 | 3. No changes to `index.php` are needed with this method 73 | 74 | **Note:** The Composer method makes future updates easier with `composer update`, while the manual method requires downloading and replacing the system directory each time. 75 | 76 | **Upgrading from Original CI3** 77 | 78 | ⚠️ **Important:** This fork is based on the unreleased CodeIgniter 3.2.0-dev version, not the stable 3.1.13. If you're upgrading from CI 3.1.x, please read the upgrade guide for any changes that may affect your application. 79 | 80 | **Please review the upgrade guide:** `upgrade_320.rst `_ 81 | 82 | Steps to upgrade: 83 | 84 | 1. Review the upgrade guide for breaking changes between 3.1.x and 3.2.0 85 | 2. Install via Composer as shown above 86 | 3. Update the `$system_path` in your `index.php` 87 | 4. Apply any necessary changes from the upgrade guide to your application 88 | 5. Your existing `application/` directory remains mostly unchanged (except for items noted in the upgrade guide) 89 | 6. Test thoroughly with your PHP version (especially if using PHP 8.2+) 90 | -------------------------------------------------------------------------------- /system/language/english/email_lang.php: -------------------------------------------------------------------------------- 1 | load->library('typography'); 65 | return $CI->typography->nl2br_except_pre($str); 66 | } 67 | } 68 | 69 | // ------------------------------------------------------------------------ 70 | 71 | if ( ! function_exists('auto_typography')) 72 | { 73 | /** 74 | * Auto Typography Wrapper Function 75 | * 76 | * @param string $str 77 | * @param bool $reduce_linebreaks = FALSE whether to reduce multiple instances of double newlines to two 78 | * @return string 79 | */ 80 | function auto_typography($str, $reduce_linebreaks = FALSE) 81 | { 82 | $CI =& get_instance(); 83 | $CI->load->library('typography'); 84 | return $CI->typography->auto_typography($str, $reduce_linebreaks); 85 | } 86 | } 87 | 88 | // -------------------------------------------------------------------- 89 | 90 | if ( ! function_exists('entity_decode')) 91 | { 92 | /** 93 | * HTML Entities Decode 94 | * 95 | * This function is a replacement for html_entity_decode() 96 | * 97 | * @param string 98 | * @param string 99 | * @return string 100 | */ 101 | function entity_decode($str, $charset = NULL) 102 | { 103 | return get_instance()->security->entity_decode($str, $charset); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /system/helpers/security_helper.php: -------------------------------------------------------------------------------- 1 | security->xss_clean($str, $is_image); 65 | } 66 | } 67 | 68 | // ------------------------------------------------------------------------ 69 | 70 | if ( ! function_exists('sanitize_filename')) 71 | { 72 | /** 73 | * Sanitize Filename 74 | * 75 | * @param string 76 | * @return string 77 | */ 78 | function sanitize_filename($filename) 79 | { 80 | return get_instance()->security->sanitize_filename($filename); 81 | } 82 | } 83 | 84 | // ------------------------------------------------------------------------ 85 | 86 | if ( ! function_exists('strip_image_tags')) 87 | { 88 | /** 89 | * Strip Image Tags 90 | * 91 | * @param string 92 | * @return string 93 | */ 94 | function strip_image_tags($str) 95 | { 96 | return get_instance()->security->strip_image_tags($str); 97 | } 98 | } 99 | 100 | // ------------------------------------------------------------------------ 101 | 102 | if ( ! function_exists('encode_php_tags')) 103 | { 104 | /** 105 | * Convert PHP tags to entities 106 | * 107 | * @param string 108 | * @return string 109 | */ 110 | function encode_php_tags($str) 111 | { 112 | return str_replace(array(''), array('<?', '?>'), $str); 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /system/helpers/directory_helper.php: -------------------------------------------------------------------------------- 1 | 0) && is_dir($source_dir.$file)) 87 | { 88 | $filedata[$file] = directory_map($source_dir.$file, $new_depth, $hidden); 89 | } 90 | else 91 | { 92 | $filedata[] = $file; 93 | } 94 | } 95 | 96 | closedir($fp); 97 | return $filedata; 98 | } 99 | 100 | return FALSE; 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /system/language/english/imglib_lang.php: -------------------------------------------------------------------------------- 1 | config = $config; 29 | } 30 | 31 | /** 32 | * Build DSN connection string for DB driver instantiate process 33 | * 34 | * @param string Group name 35 | * @return string DSN Connection string 36 | */ 37 | public function set_dsn($group = 'default') 38 | { 39 | if ( ! isset($this->config[$group])) 40 | { 41 | throw new InvalidArgumentException('Group '.$group.' not exists'); 42 | } 43 | 44 | self::$dbdriver = $this->config[$group]['dbdriver']; 45 | if (isset($this->config[$group]['subdriver'])) 46 | { 47 | self::$subdriver = $this->config[$group]['subdriver']; 48 | } 49 | 50 | $params = array( 51 | 'dbprefix' => '', 52 | 'pconnect' => FALSE, 53 | 'db_debug' => FALSE, 54 | 'cache_on' => FALSE, 55 | 'cachedir' => '', 56 | 'char_set' => 'utf8', 57 | 'dbcollat' => 'utf8_general_ci', 58 | 'swap_pre' => '', 59 | 'stricton' => FALSE 60 | ); 61 | 62 | $config = array_merge($this->config[$group], $params); 63 | $dsnstring = empty($config['dsn']) ? FALSE : $config['dsn']; 64 | $subdriver = empty($config['subdriver']) ? FALSE: $config['subdriver']; 65 | $failover = empty($config['failover']) ? FALSE : $config['failover']; 66 | 67 | $dsn = $config['dbdriver'].'://'.$config['username'].':'.$config['password'] 68 | .'@'.$config['hostname'].'/'.$config['database']; 69 | 70 | // Build the parameter 71 | $other_params = array_slice($config, 6); 72 | if ($dsnstring) $other_params['dsn'] = $dsnstring; 73 | if ($subdriver) $other_params['subdriver'] = $subdriver; 74 | if ($failover) $other_params['failover'] = $failover; 75 | 76 | return $dsn.'?'.http_build_query($other_params); 77 | } 78 | 79 | /** 80 | * Return a database config array 81 | * 82 | * @see ./config 83 | * @param string Driver based configuration 84 | * @return array 85 | */ 86 | public static function config($driver) 87 | { 88 | $dir = realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR; 89 | return include($dir.'config'.DIRECTORY_SEPARATOR.$driver.'.php'); 90 | } 91 | 92 | /** 93 | * Main DB method wrapper 94 | * 95 | * @param string Group or DSN string 96 | * @param bool 97 | * @return object 98 | */ 99 | public static function DB($group, $query_builder = FALSE) 100 | { 101 | // Create dummy driver and builder files to "load" - the mocks have 102 | // already triggered autoloading of the real files 103 | $case = CI_TestCase::instance(); 104 | $driver = self::$dbdriver; 105 | $subdriver = self::$subdriver; 106 | $case->ci_vfs_create(array( 107 | 'DB_driver.php' => '', 108 | 'DB_result.php' => '', 109 | 'DB_forge.php' => '', 110 | 'DB_query_builder.php' => '' 111 | ), '', $case->ci_base_root, 'database'); 112 | if (file_exists(SYSTEM_PATH.'database/drivers/'.$driver.'/'.$driver.'_driver.php')) 113 | { 114 | $case->ci_vfs_create(array( 115 | $driver.'_driver.php' => '', 116 | $driver.'_result.php' => '', 117 | $driver.'_forge.php' => '' 118 | ), '', $case->ci_base_root, 'database/drivers/'.$driver); 119 | } 120 | if ($subdriver) 121 | { 122 | $case->ci_vfs_create(array( 123 | $driver.'_'.$subdriver.'_driver.php' => '', 124 | $driver.'_'.$subdriver.'_forge.php' => '' 125 | ), '', $case->ci_base_root, 'database/drivers/'.$driver.'/subdrivers'); 126 | } 127 | 128 | include_once(SYSTEM_PATH.'database/DB.php'); 129 | 130 | try 131 | { 132 | $db = DB($group, $query_builder); 133 | } 134 | catch (Exception $e) 135 | { 136 | throw new RuntimeException($e->getMessage()); 137 | } 138 | 139 | return $db; 140 | } 141 | 142 | } -------------------------------------------------------------------------------- /system/helpers/cookie_helper.php: -------------------------------------------------------------------------------- 1 | input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure, $httponly, $samesite); 75 | } 76 | } 77 | 78 | // -------------------------------------------------------------------- 79 | 80 | if ( ! function_exists('get_cookie')) 81 | { 82 | /** 83 | * Fetch an item from the COOKIE array 84 | * 85 | * @param string 86 | * @param bool 87 | * @return mixed 88 | */ 89 | function get_cookie($index, $xss_clean = FALSE) 90 | { 91 | $prefix = isset($_COOKIE[$index]) ? '' : config_item('cookie_prefix'); 92 | return get_instance()->input->cookie($prefix.$index, $xss_clean); 93 | } 94 | } 95 | 96 | // -------------------------------------------------------------------- 97 | 98 | if ( ! function_exists('delete_cookie')) 99 | { 100 | /** 101 | * Delete a COOKIE 102 | * 103 | * @param mixed 104 | * @param string the cookie domain. Usually: .yourdomain.com 105 | * @param string the cookie path 106 | * @param string the cookie prefix 107 | * @return void 108 | */ 109 | function delete_cookie($name, $domain = '', $path = '/', $prefix = '') 110 | { 111 | set_cookie($name, '', '', $domain, $path, $prefix); 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /system/core/compat/standard.php: -------------------------------------------------------------------------------- 1 | db->last_query() and profiling of DB queries. 62 | | When you run a query, with this setting set to TRUE (default), 63 | | CodeIgniter will store the SQL statement for debugging purposes. 64 | | However, this may cause high memory usage, especially if you run 65 | | a lot of SQL queries ... disable this to avoid that problem. 66 | | 67 | | The $active_group variable lets you choose which connection group to 68 | | make active. By default there is only one group (the 'default' group). 69 | */ 70 | $active_group = 'default'; 71 | $db['default'] = array( 72 | 'dsn' => '', 73 | 'hostname' => 'localhost', 74 | 'username' => '', 75 | 'password' => '', 76 | 'database' => '', 77 | 'dbdriver' => 'mysqli', 78 | 'dbprefix' => '', 79 | 'pconnect' => FALSE, 80 | 'db_debug' => (ENVIRONMENT !== 'production'), 81 | 'cache_on' => FALSE, 82 | 'cachedir' => '', 83 | 'char_set' => 'utf8', 84 | 'dbcollat' => 'utf8_general_ci', 85 | 'swap_pre' => '', 86 | 'encrypt' => FALSE, 87 | 'compress' => FALSE, 88 | 'stricton' => FALSE, 89 | 'failover' => array(), 90 | 'save_queries' => TRUE 91 | ); 92 | -------------------------------------------------------------------------------- /application/config/autoload.php: -------------------------------------------------------------------------------- 1 | 'ua'); 60 | */ 61 | $autoload['libraries'] = array(); 62 | 63 | /* 64 | | ------------------------------------------------------------------- 65 | | Auto-load Drivers 66 | | ------------------------------------------------------------------- 67 | | These classes are located in system/libraries/ or in your 68 | | application/libraries/ directory, but are also placed inside their 69 | | own subdirectory and they extend the CI_Driver_Library class. They 70 | | offer multiple interchangeable driver options. 71 | | 72 | | Prototype: 73 | | 74 | | $autoload['drivers'] = array('cache'); 75 | | 76 | | You can also supply an alternative property name to be assigned in 77 | | the controller: 78 | | 79 | | $autoload['drivers'] = array('cache' => 'cch'); 80 | | 81 | */ 82 | $autoload['drivers'] = array(); 83 | 84 | /* 85 | | ------------------------------------------------------------------- 86 | | Auto-load Helper Files 87 | | ------------------------------------------------------------------- 88 | | Prototype: 89 | | 90 | | $autoload['helper'] = array('url', 'file'); 91 | */ 92 | $autoload['helper'] = array(); 93 | 94 | /* 95 | | ------------------------------------------------------------------- 96 | | Auto-load Config files 97 | | ------------------------------------------------------------------- 98 | | Prototype: 99 | | 100 | | $autoload['config'] = array('config1', 'config2'); 101 | | 102 | | NOTE: This item is intended for use ONLY if you have created custom 103 | | config files. Otherwise, leave it blank. 104 | | 105 | */ 106 | $autoload['config'] = array(); 107 | 108 | /* 109 | | ------------------------------------------------------------------- 110 | | Auto-load Language files 111 | | ------------------------------------------------------------------- 112 | | Prototype: 113 | | 114 | | $autoload['language'] = array('lang1', 'lang2'); 115 | | 116 | | NOTE: Do not include the "_lang" part of your file. For example 117 | | "codeigniter_lang.php" would be referenced as array('codeigniter'); 118 | | 119 | */ 120 | $autoload['language'] = array(); 121 | 122 | /* 123 | | ------------------------------------------------------------------- 124 | | Auto-load Models 125 | | ------------------------------------------------------------------- 126 | | Prototype: 127 | | 128 | | $autoload['model'] = array('first_model', 'second_model'); 129 | | 130 | | You can also supply an alternative model name to be assigned 131 | | in the controller: 132 | | 133 | | $autoload['model'] = array('first_model' => 'first'); 134 | */ 135 | $autoload['model'] = array(); 136 | --------------------------------------------------------------------------------