├── .gitignore ├── DCO.txt ├── application ├── .htaccess ├── cache │ ├── .htaccess │ └── index.html ├── config │ ├── autoload.php │ ├── config.php │ ├── constants.php │ ├── database.php │ ├── doctypes.php │ ├── foreign_chars.php │ ├── hooks.php │ ├── index.html │ ├── memcached.php │ ├── migration.php │ ├── mimes.php │ ├── profiler.php │ ├── routes.php │ ├── smileys.php │ └── user_agents.php ├── controllers │ ├── Welcome.php │ └── index.html ├── core │ └── index.html ├── helpers │ └── index.html ├── hooks │ └── index.html ├── index.html ├── language │ ├── english │ │ └── index.html │ └── index.html ├── libraries │ └── index.html ├── logs │ └── index.html ├── models │ └── index.html ├── third_party │ └── index.html └── views │ ├── errors │ ├── cli │ │ ├── error_404.php │ │ ├── error_db.php │ │ ├── error_exception.php │ │ ├── error_general.php │ │ ├── error_php.php │ │ └── index.html │ ├── html │ │ ├── error_404.php │ │ ├── error_db.php │ │ ├── error_exception.php │ │ ├── error_general.php │ │ ├── error_php.php │ │ └── index.html │ └── index.html │ ├── index.html │ └── welcome_message.php ├── composer.json ├── contributing.md ├── index.php ├── license.txt ├── readme.rst ├── system ├── .htaccess ├── core │ ├── Benchmark.php │ ├── CodeIgniter.php │ ├── Common.php │ ├── Config.php │ ├── Controller.php │ ├── Exceptions.php │ ├── Hooks.php │ ├── Input.php │ ├── Lang.php │ ├── Loader.php │ ├── Log.php │ ├── Model.php │ ├── Output.php │ ├── Router.php │ ├── Security.php │ ├── URI.php │ ├── Utf8.php │ ├── compat │ │ ├── hash.php │ │ ├── index.html │ │ ├── mbstring.php │ │ ├── password.php │ │ └── standard.php │ └── index.html ├── database │ ├── DB.php │ ├── DB_cache.php │ ├── DB_driver.php │ ├── DB_forge.php │ ├── DB_query_builder.php │ ├── DB_result.php │ ├── DB_utility.php │ ├── drivers │ │ ├── cubrid │ │ │ ├── cubrid_driver.php │ │ │ ├── cubrid_forge.php │ │ │ ├── cubrid_result.php │ │ │ ├── cubrid_utility.php │ │ │ └── index.html │ │ ├── ibase │ │ │ ├── ibase_driver.php │ │ │ ├── ibase_forge.php │ │ │ ├── ibase_result.php │ │ │ ├── ibase_utility.php │ │ │ └── index.html │ │ ├── index.html │ │ ├── mssql │ │ │ ├── index.html │ │ │ ├── mssql_driver.php │ │ │ ├── mssql_forge.php │ │ │ ├── mssql_result.php │ │ │ └── mssql_utility.php │ │ ├── mysql │ │ │ ├── index.html │ │ │ ├── mysql_driver.php │ │ │ ├── mysql_forge.php │ │ │ ├── mysql_result.php │ │ │ └── mysql_utility.php │ │ ├── mysqli │ │ │ ├── index.html │ │ │ ├── mysqli_driver.php │ │ │ ├── mysqli_forge.php │ │ │ ├── mysqli_result.php │ │ │ └── mysqli_utility.php │ │ ├── oci8 │ │ │ ├── index.html │ │ │ ├── oci8_driver.php │ │ │ ├── oci8_forge.php │ │ │ ├── oci8_result.php │ │ │ └── oci8_utility.php │ │ ├── odbc │ │ │ ├── index.html │ │ │ ├── odbc_driver.php │ │ │ ├── odbc_forge.php │ │ │ ├── odbc_result.php │ │ │ └── odbc_utility.php │ │ ├── pdo │ │ │ ├── index.html │ │ │ ├── pdo_driver.php │ │ │ ├── pdo_forge.php │ │ │ ├── pdo_result.php │ │ │ ├── pdo_utility.php │ │ │ └── subdrivers │ │ │ │ ├── index.html │ │ │ │ ├── pdo_4d_driver.php │ │ │ │ ├── pdo_4d_forge.php │ │ │ │ ├── pdo_cubrid_driver.php │ │ │ │ ├── pdo_cubrid_forge.php │ │ │ │ ├── pdo_dblib_driver.php │ │ │ │ ├── pdo_dblib_forge.php │ │ │ │ ├── pdo_firebird_driver.php │ │ │ │ ├── pdo_firebird_forge.php │ │ │ │ ├── pdo_ibm_driver.php │ │ │ │ ├── pdo_ibm_forge.php │ │ │ │ ├── pdo_informix_driver.php │ │ │ │ ├── pdo_informix_forge.php │ │ │ │ ├── pdo_mysql_driver.php │ │ │ │ ├── pdo_mysql_forge.php │ │ │ │ ├── pdo_oci_driver.php │ │ │ │ ├── pdo_oci_forge.php │ │ │ │ ├── pdo_odbc_driver.php │ │ │ │ ├── pdo_odbc_forge.php │ │ │ │ ├── pdo_pgsql_driver.php │ │ │ │ ├── pdo_pgsql_forge.php │ │ │ │ ├── pdo_sqlite_driver.php │ │ │ │ ├── pdo_sqlite_forge.php │ │ │ │ ├── pdo_sqlsrv_driver.php │ │ │ │ └── pdo_sqlsrv_forge.php │ │ ├── postgre │ │ │ ├── index.html │ │ │ ├── postgre_driver.php │ │ │ ├── postgre_forge.php │ │ │ ├── postgre_result.php │ │ │ └── postgre_utility.php │ │ ├── sqlite │ │ │ ├── index.html │ │ │ ├── sqlite_driver.php │ │ │ ├── sqlite_forge.php │ │ │ ├── sqlite_result.php │ │ │ └── sqlite_utility.php │ │ ├── sqlite3 │ │ │ ├── index.html │ │ │ ├── sqlite3_driver.php │ │ │ ├── sqlite3_forge.php │ │ │ ├── sqlite3_result.php │ │ │ └── sqlite3_utility.php │ │ └── sqlsrv │ │ │ ├── index.html │ │ │ ├── sqlsrv_driver.php │ │ │ ├── sqlsrv_forge.php │ │ │ ├── sqlsrv_result.php │ │ │ └── sqlsrv_utility.php │ └── index.html ├── fonts │ ├── index.html │ └── texb.ttf ├── helpers │ ├── array_helper.php │ ├── captcha_helper.php │ ├── cookie_helper.php │ ├── date_helper.php │ ├── directory_helper.php │ ├── download_helper.php │ ├── email_helper.php │ ├── file_helper.php │ ├── form_helper.php │ ├── html_helper.php │ ├── index.html │ ├── inflector_helper.php │ ├── language_helper.php │ ├── number_helper.php │ ├── path_helper.php │ ├── security_helper.php │ ├── smiley_helper.php │ ├── string_helper.php │ ├── text_helper.php │ ├── typography_helper.php │ ├── url_helper.php │ └── xml_helper.php ├── index.html ├── language │ ├── english │ │ ├── calendar_lang.php │ │ ├── date_lang.php │ │ ├── db_lang.php │ │ ├── email_lang.php │ │ ├── form_validation_lang.php │ │ ├── ftp_lang.php │ │ ├── imglib_lang.php │ │ ├── index.html │ │ ├── migration_lang.php │ │ ├── number_lang.php │ │ ├── pagination_lang.php │ │ ├── profiler_lang.php │ │ ├── unit_test_lang.php │ │ └── upload_lang.php │ └── index.html └── libraries │ ├── Cache │ ├── Cache.php │ ├── drivers │ │ ├── Cache_apc.php │ │ ├── Cache_dummy.php │ │ ├── Cache_file.php │ │ ├── Cache_memcached.php │ │ ├── Cache_redis.php │ │ ├── Cache_wincache.php │ │ └── index.html │ └── index.html │ ├── Calendar.php │ ├── Cart.php │ ├── Driver.php │ ├── Email.php │ ├── Encrypt.php │ ├── Encryption.php │ ├── Form_validation.php │ ├── Ftp.php │ ├── Image_lib.php │ ├── Javascript.php │ ├── Javascript │ ├── Jquery.php │ └── index.html │ ├── Migration.php │ ├── Pagination.php │ ├── Parser.php │ ├── Profiler.php │ ├── Session │ ├── Session.php │ ├── SessionHandlerInterface.php │ ├── Session_driver.php │ ├── drivers │ │ ├── Session_database_driver.php │ │ ├── Session_files_driver.php │ │ ├── Session_memcached_driver.php │ │ ├── Session_redis_driver.php │ │ └── index.html │ └── index.html │ ├── Table.php │ ├── Trackback.php │ ├── Typography.php │ ├── Unit_test.php │ ├── Upload.php │ ├── User_agent.php │ ├── Xmlrpc.php │ ├── Xmlrpcs.php │ ├── Zip.php │ └── index.html ├── tests ├── Bootstrap.php ├── README.md ├── mocks │ ├── autoloader.php │ ├── ci_testcase.php │ ├── ci_testconfig.php │ ├── core │ │ ├── common.php │ │ ├── input.php │ │ ├── security.php │ │ ├── uri.php │ │ └── utf8.php │ ├── database │ │ ├── ci_test.sqlite │ │ ├── config │ │ │ ├── mysql.php │ │ │ ├── mysqli.php │ │ │ ├── pdo │ │ │ │ ├── mysql.php │ │ │ │ ├── pgsql.php │ │ │ │ └── sqlite.php │ │ │ ├── pgsql.php │ │ │ └── sqlite.php │ │ ├── db.php │ │ ├── db │ │ │ └── driver.php │ │ ├── drivers │ │ │ ├── mysql.php │ │ │ ├── mysqli.php │ │ │ ├── pdo.php │ │ │ ├── postgre.php │ │ │ └── sqlite.php │ │ └── schema │ │ │ └── skeleton.php │ ├── libraries │ │ ├── driver.php │ │ ├── encrypt.php │ │ ├── encryption.php │ │ ├── session.php │ │ └── table.php │ └── uploads │ │ └── ci_logo.gif └── phpunit.xml └── user_guide_src ├── Makefile ├── README.rst ├── cilexer ├── README ├── cilexer │ ├── __init__.py │ └── cilexer.py └── setup.py └── source ├── DCO.rst ├── _themes └── sphinx_rtd_theme │ ├── LICENSE │ ├── __init__.py │ ├── breadcrumbs.html │ ├── footer.html │ ├── layout.html │ ├── layout_old.html │ ├── pulldown.html │ ├── search.html │ ├── searchbox.html │ ├── static │ ├── css │ │ ├── badge_only.css │ │ ├── citheme.css │ │ └── theme.css │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ └── fontawesome-webfont.woff │ └── js │ │ ├── oldtheme.js │ │ └── theme.js │ ├── theme.conf │ └── versions.html ├── changelog.rst ├── conf.py ├── contributing └── index.rst ├── database ├── caching.rst ├── call_function.rst ├── configuration.rst ├── connecting.rst ├── db_driver_reference.rst ├── examples.rst ├── forge.rst ├── helpers.rst ├── index.rst ├── metadata.rst ├── queries.rst ├── query_builder.rst ├── results.rst ├── transactions.rst └── utilities.rst ├── documentation ├── ELDocs.tmbundle.zip └── index.rst ├── general ├── alternative_php.rst ├── ancillary_classes.rst ├── autoloader.rst ├── caching.rst ├── cli.rst ├── common_functions.rst ├── compatibility_functions.rst ├── controllers.rst ├── core_classes.rst ├── creating_drivers.rst ├── creating_libraries.rst ├── credits.rst ├── drivers.rst ├── environments.rst ├── errors.rst ├── helpers.rst ├── hooks.rst ├── index.rst ├── libraries.rst ├── managing_apps.rst ├── models.rst ├── profiling.rst ├── requirements.rst ├── reserved_names.rst ├── routing.rst ├── security.rst ├── styleguide.rst ├── urls.rst ├── views.rst └── welcome.rst ├── helpers ├── array_helper.rst ├── captcha_helper.rst ├── cookie_helper.rst ├── date_helper.rst ├── directory_helper.rst ├── download_helper.rst ├── email_helper.rst ├── file_helper.rst ├── form_helper.rst ├── html_helper.rst ├── index.rst ├── inflector_helper.rst ├── language_helper.rst ├── number_helper.rst ├── path_helper.rst ├── security_helper.rst ├── smiley_helper.rst ├── string_helper.rst ├── text_helper.rst ├── typography_helper.rst ├── url_helper.rst └── xml_helper.rst ├── images ├── appflowchart.gif ├── arrow.gif ├── ci-icon.ico ├── ci_logo.jpg ├── ci_logo_flame.jpg ├── file.gif ├── folder.gif └── smile.gif ├── index.rst ├── installation ├── downloads.rst ├── index.rst ├── troubleshooting.rst ├── upgrade_120.rst ├── upgrade_130.rst ├── upgrade_131.rst ├── upgrade_132.rst ├── upgrade_133.rst ├── upgrade_140.rst ├── upgrade_141.rst ├── upgrade_150.rst ├── upgrade_152.rst ├── upgrade_153.rst ├── upgrade_154.rst ├── upgrade_160.rst ├── upgrade_161.rst ├── upgrade_162.rst ├── upgrade_163.rst ├── upgrade_170.rst ├── upgrade_171.rst ├── upgrade_172.rst ├── upgrade_200.rst ├── upgrade_201.rst ├── upgrade_202.rst ├── upgrade_203.rst ├── upgrade_210.rst ├── upgrade_211.rst ├── upgrade_212.rst ├── upgrade_213.rst ├── upgrade_214.rst ├── upgrade_220.rst ├── upgrade_221.rst ├── upgrade_222.rst ├── upgrade_223.rst ├── upgrade_300.rst ├── upgrade_301.rst ├── upgrade_302.rst ├── upgrade_310.rst ├── upgrade_b11.rst └── upgrading.rst ├── libraries ├── benchmark.rst ├── caching.rst ├── calendar.rst ├── cart.rst ├── config.rst ├── email.rst ├── encrypt.rst ├── encryption.rst ├── file_uploading.rst ├── form_validation.rst ├── ftp.rst ├── image_lib.rst ├── index.rst ├── input.rst ├── javascript.rst ├── language.rst ├── loader.rst ├── migration.rst ├── output.rst ├── pagination.rst ├── parser.rst ├── security.rst ├── sessions.rst ├── table.rst ├── trackback.rst ├── typography.rst ├── unit_testing.rst ├── uri.rst ├── user_agent.rst ├── xmlrpc.rst └── zip.rst ├── license.rst ├── overview ├── appflow.rst ├── at_a_glance.rst ├── features.rst ├── getting_started.rst ├── goals.rst ├── index.rst └── mvc.rst └── tutorial ├── conclusion.rst ├── create_news_items.rst ├── index.rst ├── news_section.rst └── static_pages.rst /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | application/cache/* 4 | !application/cache/index.html 5 | !application/cache/.htaccess 6 | 7 | application/logs/* 8 | !application/logs/index.html 9 | !application/logs/.htaccess 10 | 11 | user_guide_src/build/* 12 | user_guide_src/cilexer/build/* 13 | user_guide_src/cilexer/dist/* 14 | user_guide_src/cilexer/pycilexer.egg-info/* 15 | /vendor/ 16 | 17 | # IDE Files 18 | #------------------------- 19 | /nbproject/ 20 | .idea/* 21 | 22 | ## Sublime Text cache files 23 | *.tmlanguage.cache 24 | *.tmPreferences.cache 25 | *.stTheme.cache 26 | *.sublime-workspace 27 | *.sublime-project 28 | -------------------------------------------------------------------------------- /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/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Require all denied 3 | 4 | 5 | Deny from all 6 | -------------------------------------------------------------------------------- /application/cache/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Require all denied 3 | 4 | 5 | Deny from all 6 | -------------------------------------------------------------------------------- /application/cache/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /application/config/hooks.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/config/memcached.php: -------------------------------------------------------------------------------- 1 | array( 15 | 'hostname' => '127.0.0.1', 16 | 'port' => '11211', 17 | 'weight' => '1', 18 | ), 19 | ); 20 | -------------------------------------------------------------------------------- /application/config/profiler.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 | -------------------------------------------------------------------------------- /application/controllers/Welcome.php: -------------------------------------------------------------------------------- 1 | 19 | * @see http://codeigniter.com/user_guide/general/urls.html 20 | */ 21 | public function index() 22 | { 23 | $this->load->view('welcome_message'); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /application/controllers/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/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/language/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/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/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/cli/error_404.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 | -------------------------------------------------------------------------------- /application/views/errors/cli/error_general.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/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/error_404.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 404 Page Not Found 8 | 57 | 58 | 59 |
60 |

61 | 62 |
63 | 64 | -------------------------------------------------------------------------------- /application/views/errors/html/error_db.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | Database Error 8 | 57 | 58 | 59 |
60 |

61 | 62 |
63 | 64 | -------------------------------------------------------------------------------- /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 |
-------------------------------------------------------------------------------- /application/views/errors/html/error_general.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | Error 8 | 57 | 58 | 59 |
60 |

61 | 62 |
63 | 64 | -------------------------------------------------------------------------------- /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 |
-------------------------------------------------------------------------------- /application/views/errors/html/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 | -------------------------------------------------------------------------------- /application/views/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/views/welcome_message.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | Welcome to CodeIgniter 8 | 9 | 67 | 68 | 69 | 70 |
71 |

Welcome to CodeIgniter!

72 | 73 |
74 |

The page you are looking at is being generated dynamically by CodeIgniter.

75 | 76 |

If you would like to edit this page you'll find it located at:

77 | application/views/welcome_message.php 78 | 79 |

The corresponding controller for this page is found at:

80 | application/controllers/Welcome.php 81 | 82 |

If you are exploring CodeIgniter for the very first time, you should start by reading the User Guide.

83 |
84 | 85 | 86 |
87 | 88 | 89 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "The CodeIgniter framework", 3 | "name": "codeigniter/framework", 4 | "type": "project", 5 | "homepage": "http://codeigniter.com", 6 | "license": "MIT", 7 | "support": { 8 | "forum": "http://forum.codeigniter.com/", 9 | "wiki": "https://github.com/bcit-ci/CodeIgniter/wiki", 10 | "irc": "irc://irc.freenode.net/codeigniter", 11 | "source": "https://github.com/bcit-ci/CodeIgniter" 12 | }, 13 | "require": { 14 | "php": ">=5.2.4" 15 | }, 16 | "require-dev": { 17 | "mikey179/vfsStream": "1.1.*" 18 | } 19 | } -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 - 2015, British Columbia Institute of Technology 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. -------------------------------------------------------------------------------- /readme.rst: -------------------------------------------------------------------------------- 1 | ################### 2 | CodeIgniter 简介 3 | ################### 4 | 5 | CodeIgniter is an Application Development Framework - a toolkit - for people 6 | who build web sites using PHP. Its goal is to enable you to develop projects 7 | much faster than you could if you were writing code from scratch, by providing 8 | a rich set of libraries for commonly needed tasks, as well as a simple 9 | interface and logical structure to access these libraries. CodeIgniter lets 10 | you creatively focus on your project by minimizing the amount of code needed 11 | for a given task. 12 | 13 | ******************* 14 | 版本发布信息 15 | ******************* 16 | 17 | This repo contains in-development code for future releases. To download the 18 | latest stable release please visit the `下载 CodeIgniter `_ page. 19 | 20 | ************************** 21 | 变更记录 22 | ************************** 23 | 24 | You can find a list of all changes for each release in the `用户手册 - 变更记录 `_. 25 | 26 | ******************* 27 | 服务器要求 28 | ******************* 29 | 30 | PHP version 5.4 or newer is recommended. 31 | 32 | It should work on 5.2.4 as well, but we strongly advise you NOT to run 33 | such old versions of PHP, because of potential security and performance 34 | issues, as well as missing features. 35 | 36 | ************ 37 | 安装 38 | ************ 39 | 40 | 请阅读用户手册的 `安装说明 `_ 。 41 | 42 | *********** 43 | 许可协议 44 | *********** 45 | 46 | Please see the `license 47 | agreement `_. 48 | 49 | ************ 50 | 其他资源 51 | ************ 52 | 53 | - `中文手册 `_ 54 | - `中文语言包 `_ 55 | - `中文论坛 `_ 56 | - `英文 Wiki `_ 57 | - `中文 IRC `_ 58 | 59 | 报告安全问题请发邮件到 `安全问题邮箱(英文) `_ 或 `中文支持邮箱 `_,谢谢。 60 | 61 | *************** 62 | 鸣谢 63 | *************** 64 | 65 | The CodeIgniter team would like to thank EllisLab, all the 66 | contributors to the CodeIgniter project and you, the CodeIgniter user. 67 | -------------------------------------------------------------------------------- /system/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Require all denied 3 | 4 | 5 | Deny from all 6 | -------------------------------------------------------------------------------- /system/core/compat/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/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/ibase_utility.php: -------------------------------------------------------------------------------- 1 | db->hostname, $this->db->username, $this->db->password)) 58 | { 59 | $res = ibase_backup($service, $this->db->database, $filename.'.fbk'); 60 | 61 | // Close the service connection 62 | ibase_service_detach($service); 63 | return $res; 64 | } 65 | 66 | return FALSE; 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /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/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/oci8/oci8_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsupported_feature'); 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /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/odbc/odbc_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsupported_feature'); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /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/pdo/pdo_forge.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsupported_feature'); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /system/database/drivers/pdo/subdrivers/pdo_odbc_forge.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

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

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/sqlite/sqlite_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsupported_feature'); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /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/database/drivers/sqlite3/sqlite3_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsupported_feature'); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /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/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/fonts/texb.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeIgniter-Chinese/CodeIgniter/53810d048cd51f5d647bdbf30f9a9284af9d4769/system/fonts/texb.ttf -------------------------------------------------------------------------------- /system/helpers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/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/language/english/migration_lang.php: -------------------------------------------------------------------------------- 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/libraries/Cache/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

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

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/libraries/Session/SessionHandlerInterface.php: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /system/libraries/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/mocks/ci_testconfig.php: -------------------------------------------------------------------------------- 1 | config[$key]) ? $this->config[$key] : FALSE; 12 | } 13 | 14 | public function load($file, $arg2 = FALSE, $arg3 = FALSE) 15 | { 16 | $this->loaded[] = $file; 17 | return TRUE; 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /tests/mocks/core/input.php: -------------------------------------------------------------------------------- 1 | _allow_get_array = (config_item('allow_get_array') === TRUE); 15 | $this->_enable_xss = (config_item('global_xss_filtering') === TRUE); 16 | $this->_enable_csrf = (config_item('csrf_protection') === TRUE); 17 | 18 | // Assign Security and Utf8 classes 19 | $this->security = $security; 20 | $this->uni = $utf8; 21 | 22 | // Sanitize global arrays 23 | $this->_sanitize_globals(); 24 | } 25 | 26 | public function fetch_from_array($array, $index = '', $xss_clean = FALSE) 27 | { 28 | return parent::_fetch_from_array($array, $index, $xss_clean); 29 | } 30 | 31 | /** 32 | * Lie about being a CLI request 33 | * 34 | * We take advantage of this in libraries/Session_test 35 | */ 36 | public function is_cli_request() 37 | { 38 | return FALSE; 39 | } 40 | 41 | public function __set($name, $value) 42 | { 43 | if ($name === 'ip_address') 44 | { 45 | $this->ip_address = $value; 46 | } 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /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/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/core/utf8.php: -------------------------------------------------------------------------------- 1 | array( 7 | 'dsn' => '', 8 | 'hostname' => 'localhost', 9 | 'username' => 'travis', 10 | 'password' => '', 11 | 'database' => 'ci_test', 12 | 'dbdriver' => 'mysql' 13 | ), 14 | 15 | // Database configuration with failover 16 | 'mysql_failover' => array( 17 | 'dsn' => '', 18 | 'hostname' => 'localhost', 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' => 'localhost', 27 | 'username' => 'travis', 28 | 'password' => '', 29 | 'database' => 'ci_test', 30 | 'dbdriver' => 'mysql', 31 | ) 32 | ) 33 | ) 34 | ); -------------------------------------------------------------------------------- /tests/mocks/database/config/mysqli.php: -------------------------------------------------------------------------------- 1 | array( 7 | 'dsn' => '', 8 | 'hostname' => 'localhost', 9 | 'username' => 'travis', 10 | 'password' => '', 11 | 'database' => 'ci_test', 12 | 'dbdriver' => 'mysqli' 13 | ), 14 | 15 | // Database configuration with failover 16 | 'mysqli_failover' => array( 17 | 'dsn' => '', 18 | 'hostname' => 'localhost', 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' => 'localhost', 27 | 'username' => 'travis', 28 | 'password' => '', 29 | 'database' => 'ci_test', 30 | 'dbdriver' => 'mysqli', 31 | ) 32 | ) 33 | ) 34 | ); -------------------------------------------------------------------------------- /tests/mocks/database/config/pdo/mysql.php: -------------------------------------------------------------------------------- 1 | array( 7 | 'dsn' => 'mysql:host=localhost;dbname=ci_test', 8 | 'hostname' => 'localhost', 9 | 'username' => 'travis', 10 | 'password' => '', 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' => 'localhost', 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=localhost;dbname=ci_test', 28 | 'hostname' => 'localhost', 29 | 'username' => 'travis', 30 | 'password' => '', 31 | 'database' => 'ci_test', 32 | 'dbdriver' => 'pdo', 33 | 'subdriver' => 'mysql' 34 | ) 35 | ) 36 | ) 37 | ); -------------------------------------------------------------------------------- /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' => '', 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' => '', 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/database/config/pgsql.php: -------------------------------------------------------------------------------- 1 | array( 7 | 'dsn' => '', 8 | 'hostname' => 'localhost', 9 | 'username' => 'postgres', 10 | 'password' => '', 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' => '', 29 | 'database' => 'ci_test', 30 | 'dbdriver' => 'postgre', 31 | ) 32 | ) 33 | ) 34 | ); -------------------------------------------------------------------------------- /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/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 {} -------------------------------------------------------------------------------- /tests/mocks/database/drivers/mysql.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 | } -------------------------------------------------------------------------------- /tests/mocks/libraries/encrypt.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/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 {} -------------------------------------------------------------------------------- /tests/mocks/libraries/table.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 13 | 14 | ./codeigniter/core 15 | ./codeigniter/helpers 16 | ./codeigniter/libraries 17 | 18 | 19 | 20 | 21 | PEAR_INSTALL_DIR 22 | PHP_LIBDIR 23 | ../vendor 24 | 25 | 26 | -------------------------------------------------------------------------------- /user_guide_src/cilexer/README: -------------------------------------------------------------------------------- 1 | To install the CodeIgniter Lexer to Pygments, run: 2 | 3 | sudo python setup.py install 4 | 5 | Confirm with 6 | 7 | pygmentize -L 8 | 9 | 10 | You should see in the lexer output: 11 | 12 | * ci, codeigniter: 13 | CodeIgniter (filenames *.html, *.css, *.php, *.xml, *.static) 14 | 15 | You will need to run setup.py and install the cilexer package anytime after cilexer/cilexer.py is updated 16 | 17 | NOTE: Depending on how you installed Sphinx and Pygments, 18 | you may be installing to the wrong version. 19 | If you need to install to a different version of python 20 | specify its path when using setup.py, e.g.: 21 | 22 | sudo /usr/bin/python2.5 setup.py install -------------------------------------------------------------------------------- /user_guide_src/cilexer/cilexer/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /user_guide_src/cilexer/cilexer/cilexer.py: -------------------------------------------------------------------------------- 1 | # CodeIgniter 2 | # http://codeigniter.com 3 | # 4 | # An open source application development framework for PHP 5 | # 6 | # This content is released under the MIT License (MIT) 7 | # 8 | # Copyright (c) 2014 - 2015, British Columbia Institute of Technology 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a copy 11 | # of this software and associated documentation files (the "Software"), to deal 12 | # in the Software without restriction, including without limitation the rights 13 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | # copies of the Software, and to permit persons to whom the Software is 15 | # furnished to do so, subject to the following conditions: 16 | # 17 | # The above copyright notice and this permission notice shall be included in 18 | # all copies or substantial portions of the Software. 19 | # 20 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 26 | # THE SOFTWARE. 27 | # 28 | # Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) 29 | # Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) 30 | # 31 | # http://opensource.org/licenses/MIT MIT License 32 | 33 | import re 34 | import copy 35 | 36 | from pygments.lexer import DelegatingLexer 37 | from pygments.lexers.web import PhpLexer, HtmlLexer 38 | 39 | __all__ = ['CodeIgniterLexer'] 40 | 41 | 42 | class CodeIgniterLexer(DelegatingLexer): 43 | """ 44 | Handles HTML, PHP, JavaScript, and CSS is highlighted 45 | PHP is highlighted with the "startline" option 46 | """ 47 | 48 | name = 'CodeIgniter' 49 | aliases = ['ci', 'codeigniter'] 50 | filenames = ['*.html', '*.css', '*.php', '*.xml', '*.static'] 51 | mimetypes = ['text/html', 'application/xhtml+xml'] 52 | 53 | def __init__(self, **options): 54 | super(CodeIgniterLexer, self).__init__(HtmlLexer, 55 | PhpLexer, 56 | startinline=True) 57 | -------------------------------------------------------------------------------- /user_guide_src/cilexer/setup.py: -------------------------------------------------------------------------------- 1 | """ 2 | Install and setup CodeIgniter highlighting for Pygments. 3 | """ 4 | 5 | from setuptools import setup 6 | 7 | entry_points = """ 8 | [pygments.lexers] 9 | cilexer = cilexer.cilexer:CodeIgniterLexer 10 | """ 11 | 12 | setup( 13 | name='pycilexer', 14 | version='0.1', 15 | description=__doc__, 16 | author="EllisLab, Inc.", 17 | packages=['cilexer'], 18 | install_requires=( 19 | 'sphinx >= 1.0.7', 20 | 'sphinxcontrib-phpdomain >= 0.1.3-1' 21 | ), 22 | entry_points=entry_points 23 | ) 24 | -------------------------------------------------------------------------------- /user_guide_src/source/DCO.rst: -------------------------------------------------------------------------------- 1 | ##################################### 2 | Developer's Certificate of Origin 1.1 3 | ##################################### 4 | 5 | By making a contribution to this project, I certify that: 6 | 7 | (1) The contribution was created in whole or in part by me and I 8 | have the right to submit it under the open source license 9 | indicated in the file; or 10 | 11 | (2) The contribution is based upon previous work that, to the best 12 | of my knowledge, is covered under an appropriate open source 13 | license and I have the right under that license to submit that 14 | work with modifications, whether created in whole or in part 15 | by me, under the same open source license (unless I am 16 | permitted to submit under a different license), as indicated 17 | in the file; or 18 | 19 | (3) The contribution was provided directly to me by some other 20 | person who certified (1), (2) or (3) and I have not modified 21 | it. 22 | 23 | (4) I understand and agree that this project and the contribution 24 | are public and that a record of the contribution (including all 25 | personal information I submit with it, including my sign-off) is 26 | maintained indefinitely and may be redistributed consistent with 27 | this project or the open source license(s) involved. 28 | -------------------------------------------------------------------------------- /user_guide_src/source/_themes/sphinx_rtd_theme/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Dave Snider 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /user_guide_src/source/_themes/sphinx_rtd_theme/__init__.py: -------------------------------------------------------------------------------- 1 | """Sphinx ReadTheDocs theme. 2 | 3 | From https://github.com/ryan-roemer/sphinx-bootstrap-theme. 4 | 5 | """ 6 | import os 7 | 8 | VERSION = (0, 1, 5) 9 | 10 | __version__ = ".".join(str(v) for v in VERSION) 11 | __version_full__ = __version__ 12 | 13 | 14 | def get_html_theme_path(): 15 | """Return list of HTML theme paths.""" 16 | cur_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) 17 | return cur_dir 18 | -------------------------------------------------------------------------------- /user_guide_src/source/_themes/sphinx_rtd_theme/breadcrumbs.html: -------------------------------------------------------------------------------- 1 |
2 | 21 |
22 |
23 | -------------------------------------------------------------------------------- /user_guide_src/source/_themes/sphinx_rtd_theme/footer.html: -------------------------------------------------------------------------------- 1 |
2 | {% if next or prev %} 3 | 11 | {% endif %} 12 | 13 |
14 | 15 |
16 |

17 | {%- if show_copyright %} 18 | {%- if hasdoc('copyright') %} 19 | {% trans path=pathto('copyright'), copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %} 20 | {%- else %} 21 | {% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %} 22 | {%- endif %} 23 | {%- endif %} 24 | 25 | {%- if last_updated %} 26 | {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %} 27 | {%- endif %} 28 |

29 |
30 | 31 | {% trans %}Built with Sphinx using a theme provided by Read the Docs{% endtrans %}. 32 | 33 |
34 | -------------------------------------------------------------------------------- /user_guide_src/source/_themes/sphinx_rtd_theme/search.html: -------------------------------------------------------------------------------- 1 | {# 2 | basic/search.html 3 | ~~~~~~~~~~~~~~~~~ 4 | 5 | Template for the search page. 6 | 7 | :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. 8 | :license: BSD, see LICENSE for details. 9 | #} 10 | {%- extends "layout.html" %} 11 | {% set title = _('Search') %} 12 | {% set script_files = script_files + ['_static/searchtools.js'] %} 13 | {% block footer %} 14 | 17 | {# this is used when loading the search index using $.ajax fails, 18 | such as on Chrome for documents on localhost #} 19 | 20 | {{ super() }} 21 | {% endblock %} 22 | {% block body %} 23 | 31 | 32 | {% if search_performed %} 33 |

{{ _('Search Results') }}

34 | {% if not search_results %} 35 |

{{ _('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.') }}

36 | {% endif %} 37 | {% endif %} 38 |
39 | {% if search_results %} 40 |
    41 | {% for href, caption, context in search_results %} 42 |
  • 43 | {{ caption }} 44 |

    {{ context|e }}

    45 |
  • 46 | {% endfor %} 47 |
48 | {% endif %} 49 |
50 | {% endblock %} 51 | -------------------------------------------------------------------------------- /user_guide_src/source/_themes/sphinx_rtd_theme/searchbox.html: -------------------------------------------------------------------------------- 1 | {%- if builder != 'singlehtml' %} 2 |
3 |
4 | 5 | 6 | 7 |
8 |
9 | {%- endif %} 10 | -------------------------------------------------------------------------------- /user_guide_src/source/_themes/sphinx_rtd_theme/static/css/citheme.css: -------------------------------------------------------------------------------- 1 | @import 'theme.css'; 2 | 3 | .highlighted { 4 | padding: 0px !important; 5 | font-weight: inherit !important; 6 | background-color: #f1d40f !important; 7 | } 8 | 9 | #nav { 10 | background-color: #494949; 11 | margin: 0; 12 | padding: 0; 13 | display: none; 14 | } 15 | 16 | #nav2 { 17 | background: url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAARgAA/+4ADkFkb2JlAGTAAAAAAf/bAIQABAMDAwMDBAMDBAYEAwQGBwUEBAUHCAYGBwYGCAoICQkJCQgKCgwMDAwMCgwMDQ0MDBERERERFBQUFBQUFBQUFAEEBQUIBwgPCgoPFA4ODhQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8AAEQgAMgAzAwERAAIRAQMRAf/EAFkAAQADAQAAAAAAAAAAAAAAAAABBQcIAQEAAAAAAAAAAAAAAAAAAAAAEAABAgYDAAAAAAAAAAAAAAAAAVERAtMEFJRVBxgRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AMRAAAAAAAA7a87dZcCu3e1wHnbrLgV272uA87dZcCu3e1wHnbrLgV272uA87dZcCu3e1wHnbrLgV272uA87dZcCu3e1wN/wJGAYEjAMCRgGBIwDAkYBgSMAwJGAsoIwCCMAgjAIIwCCMAgjAIIwEgAAAAAAAAAAAAAAAAAAAAAAAH//2Q==) repeat-x scroll left top transparent; 18 | margin: 0; 19 | padding: 0 310px 0 0; 20 | text-align: right; 21 | display: none; 22 | } 23 | 24 | #nav_inner { 25 | background-color: transparent; 26 | font-family: Lucida Grande,Verdana,Geneva,sans-serif; 27 | font-size: 11px; 28 | margin: 0; 29 | padding: 8px 12px 0 20px; 30 | } 31 | 32 | div#pulldown-menu { 33 | -moz-column-count: 5; 34 | -moz-column-gap: 20px; 35 | -webkit-column-count: 5; 36 | -webkit-column-gap: 20px; 37 | column-count: 5; 38 | column-gap: 20px; 39 | -webkit-column-rule: 1px groove #b8b8b8; 40 | -moz-column-rule: 1px groove #b8b8b8; 41 | column-rule: 1px groove #b8b8b8; 42 | } 43 | 44 | #pulldown-menu > ul { 45 | padding-top: 10px; 46 | padding-bottom: 10px; 47 | -webkit-column-break-inside: avoid; /*Chrome, Safari*/ 48 | display: table; /*Firefox*/ 49 | break-inside: avoid; /*IE 10+ theoretically*/ 50 | } 51 | 52 | #pulldown-menu ul li.toctree-l2 { 53 | font-size: 0.82em; 54 | margin-left: 20px; 55 | list-style-image: url(data:image/gif;base64,R0lGODlhCwAJALMJAO7u7uTk5PLy8unp6fb29t7e3vj4+Li4uIWFheTk5AAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAkALAAAAAALAAkAAAQoMJ1JqTQ4Z3SI98jHCWSJkByArCyiHkMsIzEX3DeCc0Xv+4hEa5iIAAA7); 56 | } 57 | 58 | #pulldown-menu ul li.toctree-l1 a { 59 | color: #ffffff; 60 | text-decoration: none; 61 | font-size: 12px; 62 | font-family: "Roboto Slab","ff-tisa-web-pro","Georgia",Arial,sans-serif; 63 | font-weight: 700; 64 | } 65 | 66 | #pulldown-menu ul li.toctree-l2 a { 67 | text-decoration: none; 68 | font-size: 11px; 69 | line-height: 1.4em; 70 | font-weight: 300; 71 | font-family: Lucida Grande,Verdana,Geneva,sans-serif; 72 | color: #aaaaaa; 73 | } -------------------------------------------------------------------------------- /user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeIgniter-Chinese/CodeIgniter/53810d048cd51f5d647bdbf30f9a9284af9d4769/user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeIgniter-Chinese/CodeIgniter/53810d048cd51f5d647bdbf30f9a9284af9d4769/user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeIgniter-Chinese/CodeIgniter/53810d048cd51f5d647bdbf30f9a9284af9d4769/user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeIgniter-Chinese/CodeIgniter/53810d048cd51f5d647bdbf30f9a9284af9d4769/user_guide_src/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /user_guide_src/source/_themes/sphinx_rtd_theme/static/js/oldtheme.js: -------------------------------------------------------------------------------- 1 | $( document ).ready(function() { 2 | // Shift nav in mobile when clicking the menu. 3 | $(document).on('click', "[data-toggle='wy-nav-top']", function() { 4 | $("[data-toggle='wy-nav-shift']").toggleClass("shift"); 5 | $("[data-toggle='rst-versions']").toggleClass("shift"); 6 | }); 7 | // Close menu when you click a link. 8 | $(document).on('click', ".wy-menu-vertical .current ul li a", function() { 9 | $("[data-toggle='wy-nav-shift']").removeClass("shift"); 10 | $("[data-toggle='rst-versions']").toggleClass("shift"); 11 | }); 12 | $(document).on('click', "[data-toggle='rst-current-version']", function() { 13 | $("[data-toggle='rst-versions']").toggleClass("shift-up"); 14 | }); 15 | // Make tables responsive 16 | $("table.docutils:not(.field-list)").wrap("
"); 17 | }); 18 | 19 | window.SphinxRtdTheme = (function (jquery) { 20 | var stickyNav = (function () { 21 | var navBar, 22 | win, 23 | stickyNavCssClass = 'stickynav', 24 | applyStickNav = function () { 25 | if (navBar.height() <= win.height()) { 26 | navBar.addClass(stickyNavCssClass); 27 | } else { 28 | navBar.removeClass(stickyNavCssClass); 29 | } 30 | }, 31 | enable = function () { 32 | applyStickNav(); 33 | win.on('resize', applyStickNav); 34 | }, 35 | init = function () { 36 | navBar = jquery('nav.wy-nav-side:first'); 37 | win = jquery(window); 38 | }; 39 | jquery(init); 40 | return { 41 | enable : enable 42 | }; 43 | }()); 44 | return { 45 | StickyNav : stickyNav 46 | }; 47 | }($)); 48 | -------------------------------------------------------------------------------- /user_guide_src/source/_themes/sphinx_rtd_theme/theme.conf: -------------------------------------------------------------------------------- 1 | [theme] 2 | inherit = basic 3 | stylesheet = css/citheme.css 4 | 5 | [options] 6 | typekit_id = hiw1hhg 7 | analytics_id = 8 | sticky_navigation = False 9 | -------------------------------------------------------------------------------- /user_guide_src/source/_themes/sphinx_rtd_theme/versions.html: -------------------------------------------------------------------------------- 1 | {% if READTHEDOCS %} 2 | {# Add rst-badge after rst-versions for small badge style. #} 3 |
4 | 5 | Read the Docs 6 | v: {{ current_version }} 7 | 8 | 9 |
10 |
11 |
Versions
12 | {% for slug, url in versions %} 13 |
{{ slug }}
14 | {% endfor %} 15 |
16 |
17 |
Downloads
18 | {% for type, url in downloads %} 19 |
{{ type }}
20 | {% endfor %} 21 |
22 |
23 |
On Read the Docs
24 |
25 | Project Home 26 |
27 |
28 | Builds 29 |
30 |
31 |
32 | Free document hosting provided by Read the Docs. 33 | 34 |
35 |
36 | {% endif %} 37 | 38 | -------------------------------------------------------------------------------- /user_guide_src/source/database/call_function.rst: -------------------------------------------------------------------------------- 1 | ##################### 2 | Custom Function Calls 3 | ##################### 4 | 5 | $this->db->call_function(); 6 | ============================ 7 | 8 | This function enables you to call PHP database functions that are not 9 | natively included in CodeIgniter, in a platform independent manner. For 10 | example, let's say you want to call the mysql_get_client_info() 11 | function, which is **not** natively supported by CodeIgniter. You could 12 | do so like this:: 13 | 14 | $this->db->call_function('get_client_info'); 15 | 16 | You must supply the name of the function, **without** the mysql\_ 17 | prefix, in the first parameter. The prefix is added automatically based 18 | on which database driver is currently being used. This permits you to 19 | run the same function on different database platforms. Obviously not all 20 | function calls are identical between platforms, so there are limits to 21 | how useful this function can be in terms of portability. 22 | 23 | Any parameters needed by the function you are calling will be added to 24 | the second parameter. 25 | 26 | :: 27 | 28 | $this->db->call_function('some_function', $param1, $param2, etc..); 29 | 30 | Often, you will either need to supply a database connection ID or a 31 | database result ID. The connection ID can be accessed using:: 32 | 33 | $this->db->conn_id; 34 | 35 | The result ID can be accessed from within your result object, like this:: 36 | 37 | $query = $this->db->query("SOME QUERY"); 38 | 39 | $query->result_id; -------------------------------------------------------------------------------- /user_guide_src/source/database/index.rst: -------------------------------------------------------------------------------- 1 | ################## 2 | Database Reference 3 | ################## 4 | 5 | CodeIgniter comes with a full-featured and very fast abstracted database 6 | class that supports both traditional structures and Query Builder 7 | patterns. The database functions offer clear, simple syntax. 8 | 9 | .. toctree:: 10 | :titlesonly: 11 | 12 | Quick Start: Usage Examples 13 | Database Configuration 14 | Connecting to a Database 15 | Running Queries 16 | Generating Query Results 17 | Query Helper Functions 18 | Query Builder Class 19 | Transactions 20 | Getting MetaData 21 | Custom Function Calls 22 | Query Caching 23 | Database Manipulation with Database Forge 24 | Database Utilities Class 25 | Database Driver Reference -------------------------------------------------------------------------------- /user_guide_src/source/documentation/ELDocs.tmbundle.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeIgniter-Chinese/CodeIgniter/53810d048cd51f5d647bdbf30f9a9284af9d4769/user_guide_src/source/documentation/ELDocs.tmbundle.zip -------------------------------------------------------------------------------- /user_guide_src/source/general/ancillary_classes.rst: -------------------------------------------------------------------------------- 1 | ########################## 2 | Creating Ancillary Classes 3 | ########################## 4 | 5 | In some cases you may want to develop classes that exist apart from your 6 | controllers but have the ability to utilize all of CodeIgniter's 7 | resources. This is easily possible as you'll see. 8 | 9 | get_instance() 10 | ============== 11 | 12 | .. php:function:: get_instance() 13 | 14 | :returns: Reference to your controller's instance 15 | :rtype: CI_Controller 16 | 17 | **Any class that you instantiate within your controller methods can 18 | access CodeIgniter's native resources** simply by using the 19 | ``get_instance()`` function. This function returns the main 20 | CodeIgniter object. 21 | 22 | Normally, to call any of the available CodeIgniter methods requires 23 | you to use the ``$this`` construct:: 24 | 25 | $this->load->helper('url'); 26 | $this->load->library('session'); 27 | $this->config->item('base_url'); 28 | // etc. 29 | 30 | ``$this``, however, only works within your controllers, your models, 31 | or your views. If you would like to use CodeIgniter's classes from 32 | within your own custom classes you can do so as follows: 33 | 34 | First, assign the CodeIgniter object to a variable:: 35 | 36 | $CI =& get_instance(); 37 | 38 | Once you've assigned the object to a variable, you'll use that variable 39 | *instead* of ``$this``:: 40 | 41 | $CI =& get_instance(); 42 | 43 | $CI->load->helper('url'); 44 | $CI->load->library('session'); 45 | $CI->config->item('base_url'); 46 | // etc. 47 | 48 | If you'll be using ``get_instance()`` inside another class, then it would 49 | be better if you assign it to a property. This way, you won't need to call 50 | ``get_instance()`` in every single method. 51 | 52 | Example:: 53 | 54 | class Example { 55 | 56 | protected $CI; 57 | 58 | // We'll use a constructor, as you can't directly call a function 59 | // from a property definition. 60 | public function __construct() 61 | { 62 | // Assign the CodeIgniter super-object 63 | $this->CI =& get_instance(); 64 | } 65 | 66 | public function foo() 67 | { 68 | $this->CI->load->helper('url'); 69 | redirect(); 70 | } 71 | 72 | public function bar() 73 | { 74 | $this->CI->config->item('base_url'); 75 | } 76 | } 77 | 78 | In the above example, both methods ``foo()`` and ``bar()`` will work 79 | after you instantiate the Example class, without the need to call 80 | ``get_instance()`` in each of them. 81 | -------------------------------------------------------------------------------- /user_guide_src/source/general/autoloader.rst: -------------------------------------------------------------------------------- 1 | ###################### 2 | Auto-loading Resources 3 | ###################### 4 | 5 | CodeIgniter comes with an "Auto-load" feature that permits libraries, 6 | helpers, and models to be initialized automatically every time the 7 | system runs. If you need certain resources globally throughout your 8 | application you should consider auto-loading them for convenience. 9 | 10 | The following items can be loaded automatically: 11 | 12 | - Classes found in the *libraries/* directory 13 | - Helper files found in the *helpers/* directory 14 | - Custom config files found in the *config/* directory 15 | - Language files found in the *system/language/* directory 16 | - Models found in the *models/* folder 17 | 18 | To autoload resources, open the **application/config/autoload.php** 19 | file and add the item you want loaded to the autoload array. You'll 20 | find instructions in that file corresponding to each type of item. 21 | 22 | .. note:: Do not include the file extension (.php) when adding items to 23 | the autoload array. 24 | 25 | Additionally, if you want CodeIgniter to use a `Composer `_ 26 | auto-loader, just set ``$config['composer_autoload']`` to ``TRUE`` or 27 | a custom path in **application/config/config.php**. -------------------------------------------------------------------------------- /user_guide_src/source/general/cli.rst: -------------------------------------------------------------------------------- 1 | ################### 2 | Running via the CLI 3 | ################### 4 | 5 | As well as calling an applications :doc:`Controllers <./controllers>` 6 | via the URL in a browser they can also be loaded via the command-line 7 | interface (CLI). 8 | 9 | .. contents:: Page Contents 10 | 11 | What is the CLI? 12 | ================ 13 | 14 | The command-line interface is a text-based method of interacting with 15 | computers. For more information, check the `Wikipedia 16 | article `_. 17 | 18 | Why run via the command-line? 19 | ============================= 20 | 21 | There are many reasons for running CodeIgniter from the command-line, 22 | but they are not always obvious. 23 | 24 | - Run your cron-jobs without needing to use *wget* or *curl* 25 | - Make your cron-jobs inaccessible from being loaded in the URL by 26 | checking the return value of :php:func:`is_cli()`. 27 | - Make interactive "tasks" that can do things like set permissions, 28 | prune cache folders, run backups, etc. 29 | - Integrate with other applications in other languages. For example, a 30 | random C++ script could call one command and run code in your models! 31 | 32 | Let's try it: Hello World! 33 | ========================== 34 | 35 | Let's create a simple controller so you can see it in action. Using your 36 | text editor, create a file called Tools.php, and put the following code 37 | in it:: 38 | 39 | "cmd" 55 | in Windows and navigate to our CodeIgniter project. 56 | 57 | .. code-block:: bash 58 | 59 | $ cd /path/to/project; 60 | $ php index.php tools message 61 | 62 | If you did it right, you should see *Hello World!* printed. 63 | 64 | .. code-block:: bash 65 | 66 | $ php index.php tools message "John Smith" 67 | 68 | Here we are passing it a argument in the same way that URL parameters 69 | work. "John Smith" is passed as a argument and output is:: 70 | 71 | Hello John Smith! 72 | 73 | That's it! 74 | ========== 75 | 76 | That, in a nutshell, is all there is to know about controllers on the 77 | command line. Remember that this is just a normal controller, so routing 78 | and ``_remap()`` works fine. -------------------------------------------------------------------------------- /user_guide_src/source/general/creating_drivers.rst: -------------------------------------------------------------------------------- 1 | ################ 2 | Creating Drivers 3 | ################ 4 | 5 | Driver Directory and File Structure 6 | =================================== 7 | 8 | Sample driver directory and file structure layout: 9 | 10 | - /application/libraries/Driver_name 11 | 12 | - Driver_name.php 13 | - drivers 14 | 15 | - Driver_name_subclass_1.php 16 | - Driver_name_subclass_2.php 17 | - Driver_name_subclass_3.php 18 | 19 | .. note:: In order to maintain compatibility on case-sensitive 20 | file systems, the Driver_name directory must be 21 | named in the format returned by ``ucfirst()``. 22 | 23 | .. note:: The Driver library's architecture is such that 24 | the subclasses don't extend and therefore don't inherit 25 | properties or methods of the main driver. -------------------------------------------------------------------------------- /user_guide_src/source/general/credits.rst: -------------------------------------------------------------------------------- 1 | ####### 2 | Credits 3 | ####### 4 | 5 | CodeIgniter was originally developed by `Rick Ellis `_ 6 | (CEO of `EllisLab, Inc. `_). The framework was written for 7 | performance in the real world, with many of the class libraries, helpers, and 8 | sub-systems borrowed from the code-base of `ExpressionEngine 9 | `_. 10 | 11 | It was, for years, developed and maintained by EllisLab, the ExpressionEngine 12 | Development Team and a group of community members called the Reactor Team. 13 | 14 | In 2014, CodeIgniter was acquired by the `British Columbia Institute of Technology 15 | `_ and was then officially announced as a community-maintained 16 | project. 17 | 18 | Bleeding edge development is spearheaded by the handpicked contributors 19 | of the Reactor Team. 20 | 21 | A hat tip goes to Ruby on Rails for inspiring us to create a PHP framework, and 22 | for bringing frameworks into the general consciousness of the web community. -------------------------------------------------------------------------------- /user_guide_src/source/general/drivers.rst: -------------------------------------------------------------------------------- 1 | ######################### 2 | Using CodeIgniter Drivers 3 | ######################### 4 | 5 | Drivers are a special type of Library that has a parent class and any 6 | number of potential child classes. Child classes have access to the 7 | parent class, but not their siblings. Drivers provide an elegant syntax 8 | in your :doc:`controllers ` for libraries that benefit 9 | from or require being broken down into discrete classes. 10 | 11 | Drivers are found in the *system/libraries/* directory, in their own 12 | sub-directory which is identically named to the parent library class. 13 | Also inside that directory is a subdirectory named drivers, which 14 | contains all of the possible child class files. 15 | 16 | To use a driver you will initialize it within a controller using the 17 | following initialization method:: 18 | 19 | $this->load->driver('class_name'); 20 | 21 | Where class name is the name of the driver class you want to invoke. For 22 | example, to load a driver named "Some_parent" you would do this:: 23 | 24 | $this->load->driver('some_parent'); 25 | 26 | Methods of that class can then be invoked with:: 27 | 28 | $this->some_parent->some_method(); 29 | 30 | The child classes, the drivers themselves, can then be called directly 31 | through the parent class, without initializing them:: 32 | 33 | $this->some_parent->child_one->some_method(); 34 | $this->some_parent->child_two->another_method(); 35 | 36 | Creating Your Own Drivers 37 | ========================= 38 | 39 | Please read the section of the user guide that discusses how to :doc:`create 40 | your own drivers `. -------------------------------------------------------------------------------- /user_guide_src/source/general/environments.rst: -------------------------------------------------------------------------------- 1 | ############################## 2 | Handling Multiple Environments 3 | ############################## 4 | 5 | Developers often desire different system behavior depending on whether 6 | an application is running in a development or production environment. 7 | For example, verbose error output is something that would be useful 8 | while developing an application, but it may also pose a security issue 9 | when "live". 10 | 11 | The ENVIRONMENT Constant 12 | ======================== 13 | 14 | By default, CodeIgniter comes with the environment constant set to use 15 | the value provided in ``$_SERVER['CI_ENV']``, otherwise defaults to 16 | 'development'. At the top of index.php, you will see:: 17 | 18 | define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development'); 19 | 20 | This server variable can be set in your .htaccess file, or Apache 21 | config using `SetEnv `_. 22 | Alternative methods are available for nginx and other servers, or you can 23 | remove this logic entirely and set the constant based on the server's IP address. 24 | 25 | In addition to affecting some basic framework behavior (see the next 26 | section), you may use this constant in your own development to 27 | differentiate between which environment you are running in. 28 | 29 | Effects On Default Framework Behavior 30 | ===================================== 31 | 32 | There are some places in the CodeIgniter system where the ENVIRONMENT 33 | constant is used. This section describes how default framework behavior 34 | is affected. 35 | 36 | Error Reporting 37 | --------------- 38 | 39 | Setting the ENVIRONMENT constant to a value of 'development' will cause 40 | all PHP errors to be rendered to the browser when they occur. 41 | Conversely, setting the constant to 'production' will disable all error 42 | output. Disabling error reporting in production is a :doc:`good security 43 | practice `. 44 | 45 | Configuration Files 46 | ------------------- 47 | 48 | Optionally, you can have CodeIgniter load environment-specific 49 | configuration files. This may be useful for managing things like 50 | differing API keys across multiple environments. This is described in 51 | more detail in the environment section of the :doc:`Config Class 52 | <../libraries/config>` documentation. -------------------------------------------------------------------------------- /user_guide_src/source/general/index.rst: -------------------------------------------------------------------------------- 1 | ############## 2 | General Topics 3 | ############## 4 | 5 | .. toctree:: 6 | :titlesonly: 7 | 8 | urls 9 | controllers 10 | reserved_names 11 | views 12 | models 13 | Helpers 14 | libraries 15 | creating_libraries 16 | drivers 17 | creating_drivers 18 | core_classes 19 | ancillary_classes 20 | hooks 21 | autoloader 22 | common_functions 23 | compatibility_functions 24 | routing 25 | errors 26 | Caching 27 | profiling 28 | cli 29 | managing_apps 30 | environments 31 | alternative_php 32 | security 33 | PHP Style Guide -------------------------------------------------------------------------------- /user_guide_src/source/general/libraries.rst: -------------------------------------------------------------------------------- 1 | ########################### 2 | Using CodeIgniter Libraries 3 | ########################### 4 | 5 | All of the available libraries are located in your *system/libraries/* 6 | directory. In most cases, to use one of these classes involves initializing 7 | it within a :doc:`controller ` using the following 8 | initialization method:: 9 | 10 | $this->load->library('class_name'); 11 | 12 | Where 'class_name' is the name of the class you want to invoke. For 13 | example, to load the :doc:`Form Validation Library 14 | <../libraries/form_validation>` you would do this:: 15 | 16 | $this->load->library('form_validation'); 17 | 18 | Once initialized you can use it as indicated in the user guide page 19 | corresponding to that class. 20 | 21 | Additionally, multiple libraries can be loaded at the same time by 22 | passing an array of libraries to the load method. 23 | 24 | Example:: 25 | 26 | $this->load->library(array('email', 'table')); 27 | 28 | Creating Your Own Libraries 29 | =========================== 30 | 31 | Please read the section of the user guide that discusses how to 32 | :doc:`create your own libraries `. -------------------------------------------------------------------------------- /user_guide_src/source/general/managing_apps.rst: -------------------------------------------------------------------------------- 1 | ########################## 2 | Managing your Applications 3 | ########################## 4 | 5 | By default it is assumed that you only intend to use CodeIgniter to 6 | manage one application, which you will build in your *application/* 7 | directory. It is possible, however, to have multiple sets of 8 | applications that share a single CodeIgniter installation, or even to 9 | rename or relocate your application directory. 10 | 11 | Renaming the Application Directory 12 | ================================== 13 | 14 | If you would like to rename your application directory you may do so 15 | as long as you open your main index.php file and set its name using 16 | the ``$application_folder`` variable:: 17 | 18 | $application_folder = 'application'; 19 | 20 | Relocating your Application Directory 21 | ===================================== 22 | 23 | It is possible to move your application directory to a different 24 | location on your server than your web root. To do so open 25 | your main index.php and set a *full server path* in the 26 | ``$application_folder`` variable:: 27 | 28 | $application_folder = '/path/to/your/application'; 29 | 30 | Running Multiple Applications with one CodeIgniter Installation 31 | =============================================================== 32 | 33 | If you would like to share a common CodeIgniter installation to manage 34 | several different applications simply put all of the directories located 35 | inside your application directory into their own sub-directory. 36 | 37 | For example, let's say you want to create two applications, named "foo" 38 | and "bar". You could structure your application directories like this:: 39 | 40 | applications/foo/ 41 | applications/foo/config/ 42 | applications/foo/controllers/ 43 | applications/foo/libraries/ 44 | applications/foo/models/ 45 | applications/foo/views/ 46 | applications/bar/ 47 | applications/bar/config/ 48 | applications/bar/controllers/ 49 | applications/bar/libraries/ 50 | applications/bar/models/ 51 | applications/bar/views/ 52 | 53 | To select a particular application for use requires that you open your 54 | main index.php file and set the ``$application_folder`` variable. For 55 | example, to select the "foo" application for use you would do this:: 56 | 57 | $application_folder = 'applications/foo'; 58 | 59 | .. note:: Each of your applications will need its own index.php file 60 | which calls the desired application. The index.php file can be named 61 | anything you want. -------------------------------------------------------------------------------- /user_guide_src/source/general/requirements.rst: -------------------------------------------------------------------------------- 1 | ################### 2 | Server Requirements 3 | ################### 4 | 5 | `PHP `_ version 5.4 or newer is recommended. 6 | 7 | It should work on 5.2.4 as well, but we strongly advise you NOT to run 8 | such old versions of PHP, because of potential security and performance 9 | issues, as well as missing features. 10 | 11 | A database is required for most web application programming. 12 | Currently supported databases are: 13 | 14 | - MySQL (5.1+) via the *mysql* (deprecated), *mysqli* and *pdo* drivers 15 | - Oracle via the *oci8* and *pdo* drivers 16 | - PostgreSQL via the *postgre* and *pdo* drivers 17 | - MS SQL via the *mssql*, *sqlsrv* (version 2005 and above only) and *pdo* drivers 18 | - SQLite via the *sqlite* (version 2), *sqlite3* (version 3) and *pdo* drivers 19 | - CUBRID via the *cubrid* and *pdo* drivers 20 | - Interbase/Firebird via the *ibase* and *pdo* drivers 21 | - ODBC via the *odbc* and *pdo* drivers (you should know that ODBC is actually an abstraction layer) -------------------------------------------------------------------------------- /user_guide_src/source/general/reserved_names.rst: -------------------------------------------------------------------------------- 1 | ############## 2 | Reserved Names 3 | ############## 4 | 5 | In order to help out, CodeIgniter uses a series of function, method, 6 | class and variable names in its operation. Because of this, some names 7 | cannot be used by a developer. Following is a list of reserved names 8 | that cannot be used. 9 | 10 | Controller names 11 | ---------------- 12 | 13 | Since your controller classes will extend the main application 14 | controller you must be careful not to name your methods identically to 15 | the ones used by that class, otherwise your local methods will 16 | override them. The following is a list of reserved names. Do not name 17 | your controller any of these: 18 | 19 | - CI_Controller 20 | - Default 21 | - index 22 | 23 | Functions 24 | --------- 25 | 26 | - :php:func:`is_php()` 27 | - :php:func:`is_really_writable()` 28 | - ``load_class()`` 29 | - ``is_loaded()`` 30 | - ``get_config()`` 31 | - :php:func:`config_item()` 32 | - :php:func:`show_error()` 33 | - :php:func:`show_404()` 34 | - :php:func:`log_message()` 35 | - :php:func:`set_status_header()` 36 | - :php:func:`get_mimes()` 37 | - :php:func:`html_escape()` 38 | - :php:func:`remove_invisible_characters()` 39 | - :php:func:`is_https()` 40 | - :php:func:`function_usable()` 41 | - :php:func:`get_instance()` 42 | - ``_error_handler()`` 43 | - ``_exception_handler()`` 44 | - ``_stringify_attributes()`` 45 | 46 | Variables 47 | --------- 48 | 49 | - ``$config`` 50 | - ``$db`` 51 | - ``$lang`` 52 | 53 | Constants 54 | --------- 55 | 56 | - ENVIRONMENT 57 | - FCPATH 58 | - SELF 59 | - BASEPATH 60 | - APPPATH 61 | - VIEWPATH 62 | - CI_VERSION 63 | - MB_ENABLED 64 | - ICONV_ENABLED 65 | - UTF8_ENABLED 66 | - FILE_READ_MODE 67 | - FILE_WRITE_MODE 68 | - DIR_READ_MODE 69 | - DIR_WRITE_MODE 70 | - FOPEN_READ 71 | - FOPEN_READ_WRITE 72 | - FOPEN_WRITE_CREATE_DESTRUCTIVE 73 | - FOPEN_READ_WRITE_CREATE_DESTRUCTIVE 74 | - FOPEN_WRITE_CREATE 75 | - FOPEN_READ_WRITE_CREATE 76 | - FOPEN_WRITE_CREATE_STRICT 77 | - FOPEN_READ_WRITE_CREATE_STRICT 78 | - SHOW_DEBUG_BACKTRACE 79 | - EXIT_SUCCESS 80 | - EXIT_ERROR 81 | - EXIT_CONFIG 82 | - EXIT_UNKNOWN_FILE 83 | - EXIT_UNKNOWN_CLASS 84 | - EXIT_UNKNOWN_METHOD 85 | - EXIT_USER_INPUT 86 | - EXIT_DATABASE 87 | - EXIT__AUTO_MIN 88 | - EXIT__AUTO_MAX -------------------------------------------------------------------------------- /user_guide_src/source/general/welcome.rst: -------------------------------------------------------------------------------- 1 | ###################### 2 | Welcome to CodeIgniter 3 | ###################### 4 | 5 | CodeIgniter is an Application Development Framework - a toolkit - for 6 | people who build web sites using PHP. Its goal is to enable you to 7 | develop projects much faster than you could if you were writing code 8 | from scratch, by providing a rich set of libraries for commonly needed 9 | tasks, as well as a simple interface and logical structure to access 10 | these libraries. CodeIgniter lets you creatively focus on your project 11 | by minimizing the amount of code needed for a given task. 12 | 13 | *********************** 14 | Who is CodeIgniter For? 15 | *********************** 16 | 17 | CodeIgniter is right for you if: 18 | 19 | - You want a framework with a small footprint. 20 | - You need exceptional performance. 21 | - You need broad compatibility with standard hosting accounts that run 22 | a variety of PHP versions and configurations. 23 | - You want a framework that requires nearly zero configuration. 24 | - You want a framework that does not require you to use the command 25 | line. 26 | - You want a framework that does not require you to adhere to 27 | restrictive coding rules. 28 | - You are not interested in large-scale monolithic libraries like PEAR. 29 | - You do not want to be forced to learn a templating language (although 30 | a template parser is optionally available if you desire one). 31 | - You eschew complexity, favoring simple solutions. 32 | - You need clear, thorough documentation. -------------------------------------------------------------------------------- /user_guide_src/source/helpers/directory_helper.rst: -------------------------------------------------------------------------------- 1 | ################ 2 | Directory Helper 3 | ################ 4 | 5 | The Directory Helper file contains functions that assist in working with 6 | directories. 7 | 8 | .. contents:: 9 | :local: 10 | 11 | .. raw:: html 12 | 13 |
14 | 15 | Loading this Helper 16 | =================== 17 | 18 | This helper is loaded using the following code: 19 | 20 | :: 21 | 22 | $this->load->helper('directory'); 23 | 24 | Available Functions 25 | =================== 26 | 27 | The following functions are available: 28 | 29 | 30 | .. php:function:: directory_map($source_dir[, $directory_depth = 0[, $hidden = FALSE]]) 31 | 32 | :param string $source_dir: Path to the source directory 33 | :param int $directory_depth: Depth of directories to traverse (0 = fully recursive, 1 = current dir, etc) 34 | :param bool $hidden: Whether to include hidden directories 35 | :returns: An array of files 36 | :rtype: array 37 | 38 | Examples:: 39 | 40 | $map = directory_map('./mydirectory/'); 41 | 42 | .. note:: Paths are almost always relative to your main index.php file. 43 | 44 | 45 | Sub-folders contained within the directory will be mapped as well. If 46 | you wish to control the recursion depth, you can do so using the second 47 | parameter (integer). A depth of 1 will only map the top level directory:: 48 | 49 | $map = directory_map('./mydirectory/', 1); 50 | 51 | By default, hidden files will not be included in the returned array. To 52 | override this behavior, you may set a third parameter to true (boolean):: 53 | 54 | $map = directory_map('./mydirectory/', FALSE, TRUE); 55 | 56 | Each folder name will be an array index, while its contained files will 57 | be numerically indexed. Here is an example of a typical array:: 58 | 59 | Array ( 60 | [libraries] => Array 61 | ( 62 | [0] => benchmark.html 63 | [1] => config.html 64 | ["database/"] => Array 65 | ( 66 | [0] => query_builder.html 67 | [1] => binds.html 68 | [2] => configuration.html 69 | [3] => connecting.html 70 | [4] => examples.html 71 | [5] => fields.html 72 | [6] => index.html 73 | [7] => queries.html 74 | ) 75 | [2] => email.html 76 | [3] => file_uploading.html 77 | [4] => image_lib.html 78 | [5] => input.html 79 | [6] => language.html 80 | [7] => loader.html 81 | [8] => pagination.html 82 | [9] => uri.html 83 | ) -------------------------------------------------------------------------------- /user_guide_src/source/helpers/download_helper.rst: -------------------------------------------------------------------------------- 1 | ############### 2 | Download Helper 3 | ############### 4 | 5 | The Download Helper lets you download data to your desktop. 6 | 7 | .. contents:: 8 | :local: 9 | 10 | .. raw:: html 11 | 12 |
13 | 14 | Loading this Helper 15 | =================== 16 | 17 | This helper is loaded using the following code:: 18 | 19 | $this->load->helper('download'); 20 | 21 | Available Functions 22 | =================== 23 | 24 | The following functions are available: 25 | 26 | 27 | .. php:function:: force_download([$filename = ''[, $data = ''[, $set_mime = FALSE]]]) 28 | 29 | :param string $filename: Filename 30 | :param mixed $data: File contents 31 | :param bool $set_mime: Whether to try to send the actual MIME type 32 | :rtype: void 33 | 34 | Generates server headers which force data to be downloaded to your 35 | desktop. Useful with file downloads. The first parameter is the **name 36 | you want the downloaded file to be named**, the second parameter is the 37 | file data. 38 | 39 | If you set the second parameter to NULL and ``$filename`` is an existing, readable 40 | file path, then its content will be read instead. 41 | 42 | If you set the third parameter to boolean TRUE, then the actual file MIME type 43 | (based on the filename extension) will be sent, so that if your browser has a 44 | handler for that type - it can use it. 45 | 46 | Example:: 47 | 48 | $data = 'Here is some text!'; 49 | $name = 'mytext.txt'; 50 | force_download($name, $data); 51 | 52 | If you want to download an existing file from your server you'll need to 53 | do the following:: 54 | 55 | // Contents of photo.jpg will be automatically read 56 | force_download('/path/to/photo.jpg', NULL); -------------------------------------------------------------------------------- /user_guide_src/source/helpers/email_helper.rst: -------------------------------------------------------------------------------- 1 | ############ 2 | Email Helper 3 | ############ 4 | 5 | The Email Helper provides some assistive functions for working with 6 | Email. For a more robust email solution, see CodeIgniter's :doc:`Email 7 | Class <../libraries/email>`. 8 | 9 | .. important:: The Email helper is DEPRECATED and is currently 10 | only kept for backwards compatibility. 11 | 12 | .. contents:: 13 | :local: 14 | 15 | .. raw:: html 16 | 17 |
18 | 19 | Loading this Helper 20 | =================== 21 | 22 | This helper is loaded using the following code:: 23 | 24 | $this->load->helper('email'); 25 | 26 | Available Functions 27 | =================== 28 | 29 | The following functions are available: 30 | 31 | 32 | .. php:function:: valid_email($email) 33 | 34 | :param string $email: E-mail address 35 | :returns: TRUE if a valid email is supplied, FALSE otherwise 36 | :rtype: bool 37 | 38 | Checks if the input is a correctly formatted e-mail address. Note that is 39 | doesn't actually prove that the address will be able recieve mail, but 40 | simply that it is a validly formed address. 41 | 42 | Example:: 43 | 44 | if (valid_email('email@somesite.com')) 45 | { 46 | echo 'email is valid'; 47 | } 48 | else 49 | { 50 | echo 'email is not valid'; 51 | } 52 | 53 | .. note:: All that this function does is to use PHP's native ``filter_var()``:: 54 | 55 | (bool) filter_var($email, FILTER_VALIDATE_EMAIL); 56 | 57 | .. php:function:: send_email($recipient, $subject, $message) 58 | 59 | :param string $recipient: E-mail address 60 | :param string $subject: Mail subject 61 | :param string $message: Message body 62 | :returns: TRUE if the mail was successfully sent, FALSE in case of an error 63 | :rtype: bool 64 | 65 | Sends an email using PHP's native `mail() `_ 66 | function. 67 | 68 | .. note:: All that this function does is to use PHP's native ``mail`` 69 | 70 | :: 71 | 72 | mail($recipient, $subject, $message); 73 | 74 | For a more robust email solution, see CodeIgniter's :doc:`Email Library 75 | <../libraries/email>`. -------------------------------------------------------------------------------- /user_guide_src/source/helpers/index.rst: -------------------------------------------------------------------------------- 1 | ####### 2 | Helpers 3 | ####### 4 | 5 | .. toctree:: 6 | :glob: 7 | :titlesonly: 8 | 9 | * -------------------------------------------------------------------------------- /user_guide_src/source/helpers/inflector_helper.rst: -------------------------------------------------------------------------------- 1 | ################ 2 | Inflector Helper 3 | ################ 4 | 5 | The Inflector Helper file contains functions that permits you to change 6 | words to plural, singular, camel case, etc. 7 | 8 | .. contents:: 9 | :local: 10 | 11 | .. raw:: html 12 | 13 |
14 | 15 | Loading this Helper 16 | =================== 17 | 18 | This helper is loaded using the following code:: 19 | 20 | $this->load->helper('inflector'); 21 | 22 | Available Functions 23 | =================== 24 | 25 | The following functions are available: 26 | 27 | 28 | .. php:function:: singular($str) 29 | 30 | :param string $str: Input string 31 | :returns: A singular word 32 | :rtype: string 33 | 34 | Changes a plural word to singular. Example:: 35 | 36 | echo singular('dogs'); // Prints 'dog' 37 | 38 | .. php:function:: plural($str) 39 | 40 | :param string $str: Input string 41 | :returns: A plular word 42 | :rtype: string 43 | 44 | Changes a singular word to plural. Example:: 45 | 46 | echo plural('dog'); // Prints 'dogs' 47 | 48 | .. php:function:: camelize($str) 49 | 50 | :param string $str: Input string 51 | :returns: Camelized string 52 | :rtype: string 53 | 54 | Changes a string of words separated by spaces or underscores to camel 55 | case. Example:: 56 | 57 | echo camelize('my_dog_spot'); // Prints 'myDogSpot' 58 | 59 | .. php:function:: underscore($str) 60 | 61 | :param string $str: Input string 62 | :returns: String containing underscores instead of spaces 63 | :rtype: string 64 | 65 | Takes multiple words separated by spaces and underscores them. 66 | Example:: 67 | 68 | echo underscore('my dog spot'); // Prints 'my_dog_spot' 69 | 70 | .. php:function:: humanize($str[, $separator = '_']) 71 | 72 | :param string $str: Input string 73 | :param string $separator: Input separator 74 | :returns: Humanized string 75 | :rtype: string 76 | 77 | Takes multiple words separated by underscores and adds spaces between 78 | them. Each word is capitalized. 79 | 80 | Example:: 81 | 82 | echo humanize('my_dog_spot'); // Prints 'My Dog Spot' 83 | 84 | To use dashes instead of underscores:: 85 | 86 | echo humanize('my-dog-spot', '-'); // Prints 'My Dog Spot' 87 | 88 | .. php:function:: is_countable($word) 89 | 90 | :param string $word: Input string 91 | :returns: TRUE if the word is countable or FALSE if not 92 | :rtype: bool 93 | 94 | Checks if the given word has a plural version. Example:: 95 | 96 | is_countable('equipment'); // Returns FALSE -------------------------------------------------------------------------------- /user_guide_src/source/helpers/language_helper.rst: -------------------------------------------------------------------------------- 1 | ############### 2 | Language Helper 3 | ############### 4 | 5 | The Language Helper file contains functions that assist in working with 6 | language files. 7 | 8 | .. contents:: 9 | :local: 10 | 11 | .. raw:: html 12 | 13 |
14 | 15 | Loading this Helper 16 | =================== 17 | 18 | This helper is loaded using the following code:: 19 | 20 | $this->load->helper('language'); 21 | 22 | Available Functions 23 | =================== 24 | 25 | The following functions are available: 26 | 27 | 28 | .. php:function:: lang($line[, $for = ''[, $attributes = array()]]) 29 | 30 | :param string $line: Language line key 31 | :param string $for: HTML "for" attribute (ID of the element we're creating a label for) 32 | :param array $attributes: Any additional HTML attributes 33 | :returns: HTML-formatted language line label 34 | :rtype: string 35 | 36 | This function returns a line of text from a loaded language file with 37 | simplified syntax that may be more desirable for view files than 38 | ``CI_Lang::line()``. 39 | 40 | Example:: 41 | 42 | echo lang('language_key', 'form_item_id', array('class' => 'myClass')); 43 | // Outputs: -------------------------------------------------------------------------------- /user_guide_src/source/helpers/number_helper.rst: -------------------------------------------------------------------------------- 1 | ############# 2 | Number Helper 3 | ############# 4 | 5 | The Number Helper file contains functions that help you work with 6 | numeric data. 7 | 8 | .. contents:: 9 | :local: 10 | 11 | .. raw:: html 12 | 13 |
14 | 15 | Loading this Helper 16 | =================== 17 | 18 | This helper is loaded using the following code:: 19 | 20 | $this->load->helper('number'); 21 | 22 | Available Functions 23 | =================== 24 | 25 | The following functions are available: 26 | 27 | 28 | .. php:function:: byte_format($num[, $precision = 1]) 29 | 30 | :param mixed $num: Number of bytes 31 | :param int $precision: Floating point precision 32 | :returns: Formatted data size string 33 | :rtype: string 34 | 35 | Formats numbers as bytes, based on size, and adds the appropriate 36 | suffix. Examples:: 37 | 38 | echo byte_format(456); // Returns 456 Bytes 39 | echo byte_format(4567); // Returns 4.5 KB 40 | echo byte_format(45678); // Returns 44.6 KB 41 | echo byte_format(456789); // Returns 447.8 KB 42 | echo byte_format(3456789); // Returns 3.3 MB 43 | echo byte_format(12345678912345); // Returns 1.8 GB 44 | echo byte_format(123456789123456789); // Returns 11,228.3 TB 45 | 46 | An optional second parameter allows you to set the precision of the 47 | result:: 48 | 49 | echo byte_format(45678, 2); // Returns 44.61 KB 50 | 51 | .. note:: The text generated by this function is found in the following 52 | language file: *language//number_lang.php* -------------------------------------------------------------------------------- /user_guide_src/source/helpers/path_helper.rst: -------------------------------------------------------------------------------- 1 | ########### 2 | Path Helper 3 | ########### 4 | 5 | The Path Helper file contains functions that permits you to work with 6 | file paths on the server. 7 | 8 | .. contents:: 9 | :local: 10 | 11 | .. raw:: html 12 | 13 |
14 | 15 | Loading this Helper 16 | =================== 17 | 18 | This helper is loaded using the following code:: 19 | 20 | $this->load->helper('path'); 21 | 22 | Available Functions 23 | =================== 24 | 25 | The following functions are available: 26 | 27 | 28 | .. php:function:: set_realpath($path[, $check_existance = FALSE]) 29 | 30 | :param string $path: Path 31 | :param bool $check_existance: Whether to check if the path actually exists 32 | :returns: An absolute path 33 | :rtype: string 34 | 35 | This function will return a server path without symbolic links or 36 | relative directory structures. An optional second argument will 37 | cause an error to be triggered if the path cannot be resolved. 38 | 39 | Examples:: 40 | 41 | $file = '/etc/php5/apache2/php.ini'; 42 | echo set_realpath($file); // Prints '/etc/php5/apache2/php.ini' 43 | 44 | $non_existent_file = '/path/to/non-exist-file.txt'; 45 | echo set_realpath($non_existent_file, TRUE); // Shows an error, as the path cannot be resolved 46 | echo set_realpath($non_existent_file, FALSE); // Prints '/path/to/non-exist-file.txt' 47 | 48 | $directory = '/etc/php5'; 49 | echo set_realpath($directory); // Prints '/etc/php5/' 50 | 51 | $non_existent_directory = '/path/to/nowhere'; 52 | echo set_realpath($non_existent_directory, TRUE); // Shows an error, as the path cannot be resolved 53 | echo set_realpath($non_existent_directory, FALSE); // Prints '/path/to/nowhere' -------------------------------------------------------------------------------- /user_guide_src/source/helpers/typography_helper.rst: -------------------------------------------------------------------------------- 1 | ################# 2 | Typography Helper 3 | ################# 4 | 5 | The Typography Helper file contains functions that help your format text 6 | in semantically relevant ways. 7 | 8 | .. contents:: 9 | :local: 10 | 11 | .. raw:: html 12 | 13 |
14 | 15 | Loading this Helper 16 | =================== 17 | 18 | This helper is loaded using the following code:: 19 | 20 | $this->load->helper('typography'); 21 | 22 | Available Functions 23 | =================== 24 | 25 | The following functions are available: 26 | 27 | 28 | .. php:function:: auto_typography($str[, $reduce_linebreaks = FALSE]) 29 | 30 | :param string $str: Input string 31 | :param bool $reduce_linebreaks: Whether to reduce multiple instances of double newlines to two 32 | :returns: HTML-formatted typography-safe string 33 | :rtype: string 34 | 35 | Formats text so that it is semantically and typographically correct 36 | HTML. 37 | 38 | This function is an alias for ``CI_Typography::auto_typography``. 39 | For more info, please see the :doc:`Typography Library 40 | <../libraries/typography>` documentation. 41 | 42 | Usage example:: 43 | 44 | $string = auto_typography($string); 45 | 46 | .. note:: Typographic formatting can be processor intensive, particularly if 47 | you have a lot of content being formatted. If you choose to use this 48 | function you may want to consider `caching <../general/caching>` your 49 | pages. 50 | 51 | 52 | .. php:function:: nl2br_except_pre($str) 53 | 54 | :param string $str: Input string 55 | :returns: String with HTML-formatted line breaks 56 | :rtype: string 57 | 58 | Converts newlines to
tags unless they appear within
 tags.
59 | 	This function is identical to the native PHP ``nl2br()`` function,
60 | 	except that it ignores 
 tags.
61 | 
62 | 	Usage example::
63 | 
64 | 		$string = nl2br_except_pre($string);
65 | 
66 | .. php:function:: entity_decode($str, $charset = NULL)
67 | 
68 | 	:param	string	$str: Input string
69 | 	:param	string	$charset: Character set
70 | 	:returns:	String with decoded HTML entities
71 | 	:rtype:	string
72 | 
73 | 	This function is an alias for ``CI_Security::entity_decode()``.
74 | 	Fore more info, please see the :doc:`Security Library
75 | 	<../libraries/security>` documentation.


--------------------------------------------------------------------------------
/user_guide_src/source/helpers/xml_helper.rst:
--------------------------------------------------------------------------------
 1 | ##########
 2 | XML Helper
 3 | ##########
 4 | 
 5 | The XML Helper file contains functions that assist in working with XML
 6 | data.
 7 | 
 8 | .. contents::
 9 |   :local:
10 | 
11 | .. raw:: html
12 | 
13 |   
14 | 15 | Loading this Helper 16 | =================== 17 | 18 | This helper is loaded using the following code 19 | 20 | :: 21 | 22 | $this->load->helper('xml'); 23 | 24 | Available Functions 25 | =================== 26 | 27 | The following functions are available: 28 | 29 | .. php:function:: xml_convert($str[, $protect_all = FALSE]) 30 | 31 | :param string $str: the text string to convert 32 | :param bool $protect_all: Whether to protect all content that looks like a potential entity instead of just numbered entities, e.g. &foo; 33 | :returns: XML-converted string 34 | :rtype: string 35 | 36 | Takes a string as input and converts the following reserved XML 37 | characters to entities: 38 | 39 | - Ampersands: & 40 | - Less than and greater than characters: < > 41 | - Single and double quotes: ' " 42 | - Dashes: - 43 | 44 | This function ignores ampersands if they are part of existing numbered 45 | character entities, e.g. {. Example:: 46 | 47 | $string = '

Here is a paragraph & an entity ({).

'; 48 | $string = xml_convert($string); 49 | echo $string; 50 | 51 | outputs: 52 | 53 | .. code-block:: html 54 | 55 | <p>Here is a paragraph & an entity ({).</p> -------------------------------------------------------------------------------- /user_guide_src/source/images/appflowchart.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeIgniter-Chinese/CodeIgniter/53810d048cd51f5d647bdbf30f9a9284af9d4769/user_guide_src/source/images/appflowchart.gif -------------------------------------------------------------------------------- /user_guide_src/source/images/arrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeIgniter-Chinese/CodeIgniter/53810d048cd51f5d647bdbf30f9a9284af9d4769/user_guide_src/source/images/arrow.gif -------------------------------------------------------------------------------- /user_guide_src/source/images/ci-icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeIgniter-Chinese/CodeIgniter/53810d048cd51f5d647bdbf30f9a9284af9d4769/user_guide_src/source/images/ci-icon.ico -------------------------------------------------------------------------------- /user_guide_src/source/images/ci_logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeIgniter-Chinese/CodeIgniter/53810d048cd51f5d647bdbf30f9a9284af9d4769/user_guide_src/source/images/ci_logo.jpg -------------------------------------------------------------------------------- /user_guide_src/source/images/ci_logo_flame.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeIgniter-Chinese/CodeIgniter/53810d048cd51f5d647bdbf30f9a9284af9d4769/user_guide_src/source/images/ci_logo_flame.jpg -------------------------------------------------------------------------------- /user_guide_src/source/images/file.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeIgniter-Chinese/CodeIgniter/53810d048cd51f5d647bdbf30f9a9284af9d4769/user_guide_src/source/images/file.gif -------------------------------------------------------------------------------- /user_guide_src/source/images/folder.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeIgniter-Chinese/CodeIgniter/53810d048cd51f5d647bdbf30f9a9284af9d4769/user_guide_src/source/images/folder.gif -------------------------------------------------------------------------------- /user_guide_src/source/images/smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeIgniter-Chinese/CodeIgniter/53810d048cd51f5d647bdbf30f9a9284af9d4769/user_guide_src/source/images/smile.gif -------------------------------------------------------------------------------- /user_guide_src/source/index.rst: -------------------------------------------------------------------------------- 1 | ###################### 2 | CodeIgniter User Guide 3 | ###################### 4 | 5 | - :doc:`License Agreement ` 6 | - :doc:`Change Log ` 7 | 8 | .. contents:: 9 | :local: 10 | :depth: 2 11 | 12 | ******* 13 | Welcome 14 | ******* 15 | 16 | .. toctree:: 17 | :titlesonly: 18 | 19 | general/welcome 20 | 21 | ********** 22 | Basic Info 23 | ********** 24 | 25 | - :doc:`general/requirements` 26 | - :doc:`general/credits` 27 | 28 | ************ 29 | Installation 30 | ************ 31 | .. toctree:: 32 | :includehidden: 33 | :maxdepth: 2 34 | :titlesonly: 35 | 36 | installation/index 37 | 38 | ************ 39 | Introduction 40 | ************ 41 | 42 | .. toctree:: 43 | :titlesonly: 44 | 45 | overview/index 46 | 47 | ******** 48 | Tutorial 49 | ******** 50 | 51 | .. toctree:: 52 | :includehidden: 53 | :titlesonly: 54 | 55 | tutorial/index 56 | 57 | *************************** 58 | Contributing to CodeIgniter 59 | *************************** 60 | 61 | .. toctree:: 62 | :glob: 63 | :titlesonly: 64 | 65 | contributing/index 66 | 67 | ************** 68 | General Topics 69 | ************** 70 | 71 | .. toctree:: 72 | :glob: 73 | :titlesonly: 74 | 75 | general/index 76 | 77 | ***************** 78 | Library Reference 79 | ***************** 80 | 81 | .. toctree:: 82 | :glob: 83 | :titlesonly: 84 | 85 | libraries/index 86 | 87 | ****************** 88 | Database Reference 89 | ****************** 90 | 91 | .. toctree:: 92 | :glob: 93 | :titlesonly: 94 | 95 | database/index 96 | 97 | **************** 98 | Helper Reference 99 | **************** 100 | 101 | .. toctree:: 102 | :glob: 103 | :titlesonly: 104 | 105 | helpers/index 106 | 107 | .. toctree:: 108 | :glob: 109 | :titlesonly: 110 | :hidden: 111 | 112 | * 113 | overview/index 114 | general/requirements 115 | general/welcome 116 | installation/index 117 | general/index 118 | libraries/index 119 | helpers/index 120 | database/index 121 | tutorial/index 122 | general/credits 123 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/downloads.rst: -------------------------------------------------------------------------------- 1 | ####################### 2 | Downloading CodeIgniter 3 | ####################### 4 | 5 | - `CodeIgniter v3.1.0-dev (Current version) `_ 6 | - `CodeIgniter v3.0.1 `_ 7 | - `CodeIgniter v3.0.0 `_ 8 | - `CodeIgniter v2.2.3 `_ 9 | - `CodeIgniter v2.2.2 `_ 10 | - `CodeIgniter v2.2.1 `_ 11 | - `CodeIgniter v2.2.0 `_ 12 | - `CodeIgniter v2.1.4 `_ 13 | - `CodeIgniter v2.1.3 `_ 14 | - `CodeIgniter v2.1.2 `_ 15 | - `CodeIgniter v2.1.1 `_ 16 | - `CodeIgniter v2.1.0 `_ 17 | 18 | ****** 19 | GitHub 20 | ****** 21 | 22 | `Git `_ is a distributed version control system. 23 | 24 | Public Git access is available at `GitHub `_. 25 | Please note that while every effort is made to keep this code base 26 | functional, we cannot guarantee the functionality of code taken from 27 | the develop branch. 28 | 29 | Beginning with version 2.0.3, stable versions are also available via `GitHub Releases `_. -------------------------------------------------------------------------------- /user_guide_src/source/installation/index.rst: -------------------------------------------------------------------------------- 1 | ######################### 2 | Installation Instructions 3 | ######################### 4 | 5 | CodeIgniter is installed in four steps: 6 | 7 | #. Unzip the package. 8 | #. Upload the CodeIgniter folders and files to your server. Normally the 9 | index.php file will be at your root. 10 | #. Open the application/config/config.php file with a text editor and 11 | set your base URL. If you intend to use encryption or sessions, set 12 | your encryption key. 13 | #. If you intend to use a database, open the 14 | application/config/database.php file with a text editor and set your 15 | database settings. 16 | 17 | If you wish to increase security by hiding the location of your 18 | CodeIgniter files you can rename the system and application folders to 19 | something more private. If you do rename them, you must open your main 20 | index.php file and set the $system_path and $application_folder 21 | variables at the top of the file with the new name you've chosen. 22 | 23 | For the best security, both the system and any application folders 24 | should be placed above web root so that they are not directly accessible 25 | via a browser. By default, .htaccess files are included in each folder 26 | to help prevent direct access, but it is best to remove them from public 27 | access entirely in case the web server configuration changes or doesn't 28 | abide by the .htaccess. 29 | 30 | If you would like to keep your views public it is also possible to move 31 | the views folder out of your application folder. 32 | 33 | After moving them, open your main index.php file and set the 34 | $system_path, $application_folder and $view_folder variables, 35 | preferably with a full path, e.g. '/www/MyUser/system'. 36 | 37 | One additional measure to take in production environments is to disable 38 | PHP error reporting and any other development-only functionality. In 39 | CodeIgniter, this can be done by setting the ENVIRONMENT constant, which 40 | is more fully described on the :doc:`security 41 | page <../general/security>`. 42 | 43 | That's it! 44 | 45 | If you're new to CodeIgniter, please read the :doc:`Getting 46 | Started <../overview/getting_started>` section of the User Guide 47 | to begin learning how to build dynamic PHP applications. Enjoy! 48 | 49 | .. toctree:: 50 | :hidden: 51 | :titlesonly: 52 | 53 | downloads 54 | self 55 | upgrading 56 | troubleshooting 57 | 58 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/troubleshooting.rst: -------------------------------------------------------------------------------- 1 | ############### 2 | Troubleshooting 3 | ############### 4 | 5 | If you find that no matter what you put in your URL only your default 6 | page is loading, it might be that your server does not support the 7 | REQUEST_URI variable needed to serve search-engine friendly URLs. As a 8 | first step, open your application/config/config.php file and look for 9 | the URI Protocol information. It will recommend that you try a couple 10 | alternate settings. If it still doesn't work after you've tried this 11 | you'll need to force CodeIgniter to add a question mark to your URLs. To 12 | do this open your **application/config/config.php** file and change this:: 13 | 14 | $config['index_page'] = "index.php"; 15 | 16 | To this:: 17 | 18 | $config['index_page'] = "index.php?"; 19 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_120.rst: -------------------------------------------------------------------------------- 1 | #################################### 2 | Upgrading From Beta 1.0 to Final 1.2 3 | #################################### 4 | 5 | To upgrade to Version 1.2 please replace the following directories with 6 | the new versions: 7 | 8 | .. note:: If you have any custom developed files in these folders please 9 | make copies of them first. 10 | 11 | - drivers 12 | - helpers 13 | - init 14 | - language 15 | - libraries 16 | - plugins 17 | - scaffolding 18 | 19 | Please also replace your local copy of the user guide with the new 20 | version. 21 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_131.rst: -------------------------------------------------------------------------------- 1 | ########################### 2 | Upgrading from 1.3 to 1.3.1 3 | ########################### 4 | 5 | .. note:: The instructions on this page assume you are running version 6 | 1.3. If you have not upgraded to that version please do so first. 7 | 8 | Before performing an update you should take your site offline by 9 | replacing the index.php file with a static one. 10 | 11 | Step 1: Update your CodeIgniter files 12 | ===================================== 13 | 14 | Replace the following directories in your "system" folder with the new 15 | versions: 16 | 17 | .. note:: If you have any custom developed files in these folders please 18 | make copies of them first. 19 | 20 | - drivers 21 | - init/init_unit_test.php (new for 1.3.1) 22 | - language/ 23 | - libraries 24 | - scaffolding 25 | 26 | Step 2: Update your user guide 27 | ============================== 28 | 29 | Please also replace your local copy of the user guide with the new 30 | version. 31 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_132.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.3.1 to 1.3.2 3 | ############################# 4 | 5 | .. note:: The instructions on this page assume you are running version 6 | 1.3.1. If you have not upgraded to that version please do so first. 7 | 8 | Before performing an update you should take your site offline by 9 | replacing the index.php file with a static one. 10 | 11 | Step 1: Update your CodeIgniter files 12 | ===================================== 13 | 14 | Replace the following directories in your "system" folder with the new 15 | versions: 16 | 17 | .. note:: If you have any custom developed files in these folders please 18 | make copies of them first. 19 | 20 | - drivers 21 | - init 22 | - libraries 23 | 24 | Step 2: Update your user guide 25 | ============================== 26 | 27 | Please also replace your local copy of the user guide with the new 28 | version. 29 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_133.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.3.2 to 1.3.3 3 | ############################# 4 | 5 | .. note:: The instructions on this page assume you are running version 6 | 1.3.2. If you have not upgraded to that version please do so first. 7 | 8 | Before performing an update you should take your site offline by 9 | replacing the index.php file with a static one. 10 | 11 | Step 1: Update your CodeIgniter files 12 | ===================================== 13 | 14 | Replace the following directories in your "system" folder with the new 15 | versions: 16 | 17 | .. note:: If you have any custom developed files in these folders please 18 | make copies of them first. 19 | 20 | - codeigniter 21 | - drivers 22 | - helpers 23 | - init 24 | - libraries 25 | 26 | Step 2: Update your Models 27 | ========================== 28 | 29 | If you are **NOT** using CodeIgniter's 30 | :doc:`Models <../general/models>` feature disregard this step. 31 | 32 | As of version 1.3.3, CodeIgniter does **not** connect automatically to 33 | your database when a model is loaded. This allows you greater 34 | flexibility in determining which databases you would like used with your 35 | models. If your application is not connecting to your database prior to 36 | a model being loaded you will have to update your code. There are 37 | several options for connecting, :doc:`as described 38 | here <../general/models>`. 39 | 40 | Step 3: Update your user guide 41 | ============================== 42 | 43 | Please also replace your local copy of the user guide with the new 44 | version. 45 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_140.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.3.3 to 1.4.0 3 | ############################# 4 | 5 | .. note:: The instructions on this page assume you are running version 6 | 1.3.3. If you have not upgraded to that version please do so first. 7 | 8 | Before performing an update you should take your site offline by 9 | replacing the index.php file with a static one. 10 | 11 | Step 1: Update your CodeIgniter files 12 | ===================================== 13 | 14 | Replace the following directories in your "system" folder with the new 15 | versions: 16 | 17 | .. note:: If you have any custom developed files in these folders please 18 | make copies of them first. 19 | 20 | - application/config/**hooks.php** 21 | - application/config/**mimes.php** 22 | - codeigniter 23 | - drivers 24 | - helpers 25 | - init 26 | - language 27 | - libraries 28 | - scaffolding 29 | 30 | Step 2: Update your config.php file 31 | =================================== 32 | 33 | Open your application/config/config.php file and add these new items:: 34 | 35 | 36 | 37 | /* 38 | |-------------------------------------------------------------------------- 39 | | Enable/Disable System Hooks 40 | |-------------------------------------------------------------------------- 41 | | 42 | | If you would like to use the "hooks" feature you must enable it by 43 | | setting this variable to TRUE (boolean). See the user guide for details. 44 | | 45 | */ 46 | $config['enable_hooks'] = FALSE; 47 | 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | Allowed URL Characters 52 | |-------------------------------------------------------------------------- 53 | | 54 | | This lets you specify which characters are permitted within your URLs. 55 | | When someone tries to submit a URL with disallowed characters they will 56 | | get a warning message. 57 | | 58 | | As a security measure you are STRONGLY encouraged to restrict URLs to 59 | | as few characters as possible. By default only these are allowed: a-z 0-9~%.:_- 60 | | 61 | | Leave blank to allow all characters -- but only if you are insane. 62 | | 63 | | DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!! 64 | | 65 | */ 66 | $config['permitted_uri_chars'] = 'a-z 0-9~%.:_-'; 67 | 68 | Step 3: Update your user guide 69 | ============================== 70 | 71 | Please also replace your local copy of the user guide with the new 72 | version. 73 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_141.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.4.0 to 1.4.1 3 | ############################# 4 | 5 | .. note:: The instructions on this page assume you are running version 6 | 1.4.0. If you have not upgraded to that version please do so first. 7 | 8 | Before performing an update you should take your site offline by 9 | replacing the index.php file with a static one. 10 | 11 | Step 1: Update your CodeIgniter files 12 | ===================================== 13 | 14 | Replace the following directories in your "system" folder with the new 15 | versions: 16 | 17 | .. note:: If you have any custom developed files in these folders please 18 | make copies of them first. 19 | 20 | - codeigniter 21 | - drivers 22 | - helpers 23 | - libraries 24 | 25 | Step 2: Update your config.php file 26 | =================================== 27 | 28 | Open your application/config/config.php file and add this new item:: 29 | 30 | 31 | 32 | /* 33 | |-------------------------------------------------------------------------- 34 | | Output Compression 35 | |-------------------------------------------------------------------------- 36 | | 37 | | Enables Gzip output compression for faster page loads. When enabled, 38 | | the output class will test whether your server supports Gzip. 39 | | Even if it does, however, not all browsers support compression 40 | | so enable only if you are reasonably sure your visitors can handle it. 41 | | 42 | | VERY IMPORTANT: If you are getting a blank page when compression is enabled it 43 | | means you are prematurely outputting something to your browser. It could 44 | | even be a line of whitespace at the end of one of your scripts. For 45 | | compression to work, nothing can be sent before the output buffer is called 46 | | by the output class. Do not "echo" any values with compression enabled. 47 | | 48 | */ 49 | $config['compress_output'] = FALSE; 50 | 51 | Step 3: Rename an Autoload Item 52 | =============================== 53 | 54 | Open the following file: application/config/autoload.php 55 | 56 | Find this array item:: 57 | 58 | $autoload['core'] = array(); 59 | 60 | And rename it to this:: 61 | 62 | $autoload['libraries'] = array(); 63 | 64 | This change was made to improve clarity since some users were not sure 65 | that their own libraries could be auto-loaded. 66 | 67 | Step 4: Update your user guide 68 | ============================== 69 | 70 | Please also replace your local copy of the user guide with the new 71 | version. 72 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_152.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.5.0 to 1.5.2 3 | ############################# 4 | 5 | .. note:: The instructions on this page assume you are running version 6 | 1.5.0 or 1.5.1. If you have not upgraded to that version please do so 7 | first. 8 | 9 | Before performing an update you should take your site offline by 10 | replacing the index.php file with a static one. 11 | 12 | Step 1: Update your CodeIgniter files 13 | ===================================== 14 | 15 | Replace these files and directories in your "system" folder with the new 16 | versions: 17 | 18 | - system/helpers/download_helper.php 19 | - system/helpers/form_helper.php 20 | - system/libraries/Table.php 21 | - system/libraries/User_agent.php 22 | - system/libraries/Exceptions.php 23 | - system/libraries/Input.php 24 | - system/libraries/Router.php 25 | - system/libraries/Loader.php 26 | - system/libraries/Image_lib.php 27 | - system/language/english/unit_test_lang.php 28 | - system/database/DB_active_rec.php 29 | - system/database/drivers/mysqli/mysqli_driver.php 30 | - codeigniter/ 31 | 32 | .. note:: If you have any custom developed files in these folders please 33 | make copies of them first. 34 | 35 | Step 2: Update your user guide 36 | ============================== 37 | 38 | Please also replace your local copy of the user guide with the new 39 | version. 40 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_153.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.5.2 to 1.5.3 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace these files and directories in your "system" folder with the new 12 | versions: 13 | 14 | - system/database/drivers 15 | - system/helpers 16 | - system/libraries/Input.php 17 | - system/libraries/Loader.php 18 | - system/libraries/Profiler.php 19 | - system/libraries/Table.php 20 | 21 | .. note:: If you have any custom developed files in these folders please 22 | make copies of them first. 23 | 24 | Step 2: Update your user guide 25 | ============================== 26 | 27 | Please also replace your local copy of the user guide with the new 28 | version. 29 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_154.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.5.3 to 1.5.4 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace these files and directories in your "system" folder with the new 12 | versions: 13 | 14 | - application/config/mimes.php 15 | - system/codeigniter 16 | - system/database 17 | - system/helpers 18 | - system/libraries 19 | - system/plugins 20 | 21 | .. note:: If you have any custom developed files in these folders please 22 | make copies of them first. 23 | 24 | Step 2: Add charset to your config.php 25 | ====================================== 26 | 27 | Add the following to application/config/config.php 28 | 29 | :: 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Default Character Set 34 | |-------------------------------------------------------------------------- 35 | | 36 | | This determines which character set is used by default in various methods 37 | | that require a character set to be provided. 38 | | 39 | */ 40 | $config['charset'] = "UTF-8"; 41 | 42 | Step 3: Autoloading language files 43 | ================================== 44 | 45 | If you want to autoload any language files, add this line to 46 | application/config/autoload.php 47 | 48 | :: 49 | 50 | $autoload['language'] = array(); 51 | 52 | Step 4: Update your user guide 53 | ============================== 54 | 55 | Please also replace your local copy of the user guide with the new 56 | version. 57 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_160.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.5.4 to 1.6.0 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace these files and directories in your "system" folder with the new 12 | versions: 13 | 14 | - system/codeigniter 15 | - system/database 16 | - system/helpers 17 | - system/libraries 18 | - system/plugins 19 | - system/language 20 | 21 | .. note:: If you have any custom developed files in these folders please 22 | make copies of them first. 23 | 24 | Step 2: Add time_to_update to your config.php 25 | =============================================== 26 | 27 | Add the following to application/config/config.php with the other 28 | session configuration options 29 | 30 | :: 31 | 32 | $config['sess_time_to_update'] = 300; 33 | 34 | 35 | Step 3: Add $autoload['model'] 36 | ============================== 37 | 38 | Add the following to application/config/autoload.php 39 | 40 | :: 41 | 42 | /* 43 | | ------------------------------------------------------------------- 44 | | Auto-load Model files 45 | | ------------------------------------------------------------------- 46 | | Prototype: 47 | | 48 | | $autoload['model'] = array('my_model'); 49 | | 50 | */ 51 | 52 | $autoload['model'] = array(); 53 | 54 | 55 | Step 4: Add to your database.php 56 | ================================ 57 | 58 | Make the following changes to your application/config/database.php file: 59 | 60 | Add the following variable above the database configuration options, 61 | with $active_group 62 | 63 | :: 64 | 65 | $active_record = TRUE; 66 | 67 | 68 | Remove the following from your database configuration options 69 | 70 | :: 71 | 72 | $db['default']['active_r'] = TRUE; 73 | 74 | 75 | Add the following to your database configuration options 76 | 77 | :: 78 | 79 | $db['default']['char_set'] = "utf8"; 80 | $db['default']['dbcollat'] = "utf8_general_ci"; 81 | 82 | 83 | Step 5: Update your user guide 84 | ============================== 85 | 86 | Please also replace your local copy of the user guide with the new 87 | version. 88 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_161.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.6.0 to 1.6.1 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace these files and directories in your "system" folder with the new 12 | versions: 13 | 14 | - system/codeigniter 15 | - system/database 16 | - system/helpers 17 | - system/language 18 | - system/libraries 19 | 20 | .. note:: If you have any custom developed files in these folders please 21 | make copies of them first. 22 | 23 | Step 2: Update your user guide 24 | ============================== 25 | 26 | Please also replace your local copy of the user guide with the new 27 | version. 28 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_162.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.6.1 to 1.6.2 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace these files and directories in your "system" folder with the new 12 | versions: 13 | 14 | - system/codeigniter 15 | - system/database 16 | - system/helpers 17 | - system/language 18 | - system/libraries 19 | 20 | .. note:: If you have any custom developed files in these folders please 21 | make copies of them first. 22 | 23 | Step 2: Encryption Key 24 | ====================== 25 | 26 | If you are using sessions, open up application/config/config.php and 27 | verify you've set an encryption key. 28 | 29 | Step 3: Constants File 30 | ====================== 31 | 32 | Copy /application/config/constants.php to your installation, and modify 33 | if necessary. 34 | 35 | Step 4: Mimes File 36 | ================== 37 | 38 | Replace /application/config/mimes.php with the dowloaded version. If 39 | you've added custom mime types, you'll need to re-add them. 40 | 41 | Step 5: Update your user guide 42 | ============================== 43 | 44 | Please also replace your local copy of the user guide with the new 45 | version. 46 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_163.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.6.2 to 1.6.3 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace these files and directories in your "system" folder with the new 12 | versions: 13 | 14 | - system/codeigniter 15 | - system/database 16 | - system/helpers 17 | - system/language 18 | - system/libraries 19 | 20 | .. note:: If you have any custom developed files in these folders please 21 | make copies of them first. 22 | 23 | Step 2: Update your user guide 24 | ============================== 25 | 26 | Please also replace your local copy of the user guide with the new 27 | version. 28 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_170.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.6.3 to 1.7.0 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace these files and directories in your "system" folder with the new 12 | versions: 13 | 14 | - system/codeigniter 15 | - system/database 16 | - system/helpers 17 | - system/language 18 | - system/libraries 19 | 20 | .. note:: If you have any custom developed files in these folders please 21 | make copies of them first. 22 | 23 | Step 2: Update your Session Table 24 | ================================= 25 | 26 | If you are using the Session class in your application, AND if you are 27 | storing session data to a database, you must add a new column named 28 | user_data to your session table. Here is an example of what this column 29 | might look like for MySQL:: 30 | 31 | user_data text NOT NULL 32 | 33 | To add this column you will run a query similar to this:: 34 | 35 | ALTER TABLE `ci_sessions` ADD `user_data` text NOT NULL 36 | 37 | You'll find more information regarding the new Session functionality in 38 | the :doc:`Session class <../libraries/sessions>` page. 39 | 40 | Step 3: Update your Validation Syntax 41 | ===================================== 42 | 43 | This is an **optional**, but recommended step, for people currently 44 | using the Validation class. CI 1.7 introduces a new :doc:`Form Validation 45 | class <../libraries/form_validation>`, which deprecates the old 46 | Validation library. We have left the old one in place so that existing 47 | applications that use it will not break, but you are encouraged to 48 | migrate to the new version as soon as possible. Please read the user 49 | guide carefully as the new library works a little differently, and has 50 | several new features. 51 | 52 | Step 4: Update your user guide 53 | ============================== 54 | 55 | Please replace your local copy of the user guide with the new version, 56 | including the image files. 57 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_171.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.7.0 to 1.7.1 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace these files and directories in your "system" folder with the new 12 | versions: 13 | 14 | - system/codeigniter 15 | - system/database 16 | - system/helpers 17 | - system/language 18 | - system/libraries 19 | 20 | .. note:: If you have any custom developed files in these folders please 21 | make copies of them first. 22 | 23 | Step 2: Update your user guide 24 | ============================== 25 | 26 | Please replace your local copy of the user guide with the new version, 27 | including the image files. 28 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_172.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.7.1 to 1.7.2 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace these files and directories in your "system" folder with the new 12 | versions: 13 | 14 | - system/codeigniter 15 | - system/database 16 | - system/helpers 17 | - system/language 18 | - system/libraries 19 | - index.php 20 | 21 | .. note:: If you have any custom developed files in these folders please 22 | make copies of them first. 23 | 24 | Step 2: Remove header() from 404 error template 25 | =============================================== 26 | 27 | If you are using header() in your 404 error template, such as the case 28 | with the default error_404.php template shown below, remove that line 29 | of code. 30 | 31 | :: 32 | 33 | 34 | 35 | 404 status headers are now properly handled in the show_404() method 36 | itself. 37 | 38 | Step 3: Confirm your system_path 39 | ================================= 40 | 41 | In your updated index.php file, confirm that the $system_path variable 42 | is set to your application's system folder. 43 | 44 | Step 4: Update your user guide 45 | ============================== 46 | 47 | Please replace your local copy of the user guide with the new version, 48 | including the image files. 49 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_201.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 2.0.0 to 2.0.1 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your "system" folder and replace 12 | your index.php file. If any modifications were made to your index.php 13 | they will need to be made fresh in this new one. 14 | 15 | .. note:: If you have any custom developed files in these folders please 16 | make copies of them first. 17 | 18 | Step 2: Replace config/mimes.php 19 | ================================ 20 | 21 | This config file has been updated to contain more mime types, please 22 | copy it to application/config/mimes.php. 23 | 24 | Step 3: Check for forms posting to default controller 25 | ===================================================== 26 | 27 | The default behavior for form_open() when called with no parameters 28 | used to be to post to the default controller, but it will now just leave 29 | an empty action="" meaning the form will submit to the current URL. If 30 | submitting to the default controller was the expected behavior it will 31 | need to be changed from:: 32 | 33 | echo form_open(); //
34 | 35 | to use either a / or base_url():: 36 | 37 | echo form_open('/'); // 38 | echo form_open(base_url()); // 39 | 40 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_202.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 2.0.1 to 2.0.2 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your "system" folder and replace 12 | your index.php file. If any modifications were made to your index.php 13 | they will need to be made fresh in this new one. 14 | 15 | .. note:: If you have any custom developed files in these folders please 16 | make copies of them first. 17 | 18 | Step 2: Remove loading calls for the Security Library 19 | ===================================================== 20 | 21 | Security has been moved to the core and is now always loaded 22 | automatically. Make sure you remove any loading calls as they will 23 | result in PHP errors. 24 | 25 | Step 3: Move MY_Security 26 | ========================= 27 | 28 | If you are overriding or extending the Security library, you will need 29 | to move it to application/core. 30 | 31 | csrf_token_name and csrf_hash have changed to protected class 32 | properties. Please use security->get_csrf_hash() and 33 | security->get_csrf_token_name() to access those values. 34 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_203.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 2.0.2 to 2.0.3 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your "system" folder and replace 12 | your index.php file. If any modifications were made to your index.php 13 | they will need to be made fresh in this new one. 14 | 15 | .. note:: If you have any custom developed files in these folders please 16 | make copies of them first. 17 | 18 | Step 2: Update your main index.php file 19 | ======================================= 20 | 21 | If you are running a stock index.php file simply replace your version 22 | with the new one. 23 | 24 | If your index.php file has internal modifications, please add your 25 | modifications to the new file and use it. 26 | 27 | Step 3: Replace config/user_agents.php 28 | ======================================= 29 | 30 | This config file has been updated to contain more user agent types, 31 | please copy it to application/config/user_agents.php. 32 | 33 | Step 4: Change references of the EXT constant to ".php" 34 | ======================================================= 35 | 36 | .. note:: The EXT Constant has been marked as deprecated, but has not 37 | been removed from the application. You are encouraged to make the 38 | changes sooner rather than later. 39 | 40 | Step 5: Remove APPPATH.'third_party' from autoload.php 41 | ======================================================= 42 | 43 | Open application/config/autoload.php, and look for the following:: 44 | 45 | $autoload['packages'] = array(APPPATH.'third_party'); 46 | 47 | If you have not chosen to load any additional packages, that line can be 48 | changed to:: 49 | 50 | $autoload['packages'] = array(); 51 | 52 | Which should provide for nominal performance gains if not autoloading 53 | packages. 54 | 55 | Update Sessions Database Tables 56 | =============================== 57 | 58 | If you are using database sessions with the CI Session Library, please 59 | update your ci_sessions database table as follows:: 60 | 61 | CREATE INDEX last_activity_idx ON ci_sessions(last_activity); 62 | ALTER TABLE ci_sessions MODIFY user_agent VARCHAR(120); 63 | 64 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_210.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 2.0.3 to 2.1.0 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your "system" folder. 12 | 13 | .. note:: If you have any custom developed files in these folders please 14 | make copies of them first. 15 | 16 | Step 2: Replace config/user_agents.php 17 | ====================================== 18 | 19 | This config file has been updated to contain more user agent types, 20 | please copy it to _application/config/user_agents.php*. 21 | 22 | Step 3: Update your user guide 23 | ============================== 24 | 25 | Please also replace your local copy of the user guide with the new 26 | version. -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_211.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 2.1.0 to 2.1.1 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your "system" folder. 12 | 13 | .. note:: If you have any custom developed files in these folders please 14 | make copies of them first. 15 | 16 | Step 2: Replace config/mimes.php 17 | ================================ 18 | 19 | This config file has been updated to contain more user mime-types, please copy 20 | it to _application/config/mimes.php*. 21 | 22 | Step 3: Update your IP address tables 23 | ===================================== 24 | 25 | This upgrade adds support for IPv6 IP addresses. In order to store them, you need 26 | to enlarge your ip_address columns to 45 characters. For example, CodeIgniter's 27 | session table will need to change 28 | 29 | :: 30 | 31 | ALTER TABLE ci_sessions CHANGE ip_address ip_address varchar(45) default '0' NOT NULL -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_212.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 2.1.1 to 2.1.2 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your "system" folder. 12 | 13 | .. note:: If you have any custom developed files in these folders please 14 | make copies of them first. 15 | 16 | Step 2: Update your user guide 17 | ============================== 18 | 19 | Please also replace your local copy of the user guide with the new 20 | version. -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_213.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 2.1.2 to 2.1.3 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your "system" folder. 12 | 13 | .. note:: If you have any custom developed files in these folders please 14 | make copies of them first. 15 | 16 | Step 2: Update your user guide 17 | ============================== 18 | 19 | Please also replace your local copy of the user guide with the new 20 | version. -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_214.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 2.1.3 to 2.1.4 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your "system" folder. 12 | 13 | .. note:: If you have any custom developed files in these folders please 14 | make copies of them first. -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_220.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 2.1.4 to 2.2.x 3 | ############################# 4 | 5 | .. note:: The :doc:`Encrypt Class ` now requires the 6 | Mcrypt extension. If you were previously using the Encrypt Class 7 | without Mcrypt, then this is a breaking change. You must install 8 | the Mcrypt extension in order to upgrade. For information on 9 | installing Mcrypt please see the PHP `documentation 10 | `. 11 | 12 | Before performing an update you should take your site offline by 13 | replacing the index.php file with a static one. 14 | 15 | Step 1: Update your CodeIgniter files 16 | ===================================== 17 | 18 | Replace all files and directories in your "system" folder. 19 | 20 | .. note:: If you have any custom developed files in these folders please 21 | make copies of them first. -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_221.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 2.2.0 to 2.2.1 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your "system" folder. 12 | 13 | .. note:: If you have any custom developed files in these folders please 14 | make copies of them first. -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_222.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 2.2.1 to 2.2.2 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your "system" folder. 12 | 13 | .. note:: If you have any custom developed files in these folders please 14 | make copies of them first. -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_223.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 2.2.2 to 2.2.3 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your "system" folder. 12 | 13 | .. note:: If you have any custom developed files in these folders please 14 | make copies of them first. -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_301.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 3.0.0 to 3.0.1 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your *system/* directory. 12 | 13 | .. note:: If you have any custom developed files in these directories, 14 | please make copies of them first. 15 | 16 | Step 2: Update your CLI error templates 17 | ======================================= 18 | 19 | Replace all files under your *application/views/errors/cli/* directory. 20 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_302.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 3.0.1 to 3.0.2 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your *system/* directory. 12 | 13 | .. note:: If you have any custom developed files in these directories, 14 | please make copies of them first. 15 | 16 | Step 2: Update your application/config/constants.php file 17 | ========================================================= 18 | 19 | The *application/config/constants.php* file has been updated to check 20 | if constants aren't already defined before doing that, making it easier 21 | to add an environment-specific configuration. 22 | 23 | .. note:: If you've made modifications to this file, please make a 24 | backup first and cross-check the differences first. -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_310.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 3.0.x to 3.1.x 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your *system/* directory. 12 | 13 | .. note:: If you have any custom developed files in these directories, 14 | please make copies of them first. 15 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrade_b11.rst: -------------------------------------------------------------------------------- 1 | ################################### 2 | Upgrading From Beta 1.0 to Beta 1.1 3 | ################################### 4 | 5 | To upgrade to Beta 1.1 please perform the following steps: 6 | 7 | Step 1: Replace your index file 8 | =============================== 9 | 10 | Replace your main index.php file with the new index.php file. Note: If 11 | you have renamed your "system" folder you will need to edit this info in 12 | the new file. 13 | 14 | Step 2: Relocate your config folder 15 | =================================== 16 | 17 | This version of CodeIgniter now permits multiple sets of "applications" 18 | to all share a common set of backend files. In order to enable each 19 | application to have its own configuration values, the config directory 20 | must now reside inside of your application folder, so please move it 21 | there. 22 | 23 | Step 3: Replace directories 24 | =========================== 25 | 26 | Replace the following directories with the new versions: 27 | 28 | - drivers 29 | - helpers 30 | - init 31 | - libraries 32 | - scaffolding 33 | 34 | Step 4: Add the calendar language file 35 | ====================================== 36 | 37 | There is a new language file corresponding to the new calendaring class 38 | which must be added to your language folder. Add the following item to 39 | your version: language/english/calendar_lang.php 40 | 41 | Step 5: Edit your config file 42 | ============================= 43 | 44 | The original application/config/config.php file has a typo in it Open 45 | the file and look for the items related to cookies:: 46 | 47 | $conf['cookie_prefix'] = ""; 48 | $conf['cookie_domain'] = ""; 49 | $conf['cookie_path'] = "/"; 50 | 51 | Change the array name from $conf to $config, like this:: 52 | 53 | $config['cookie_prefix'] = ""; 54 | $config['cookie_domain'] = ""; 55 | $config['cookie_path'] = "/"; 56 | 57 | Lastly, add the following new item to the config file (and edit the 58 | option if needed):: 59 | 60 | 61 | /* 62 | |------------------------------------------------ 63 | | URI PROTOCOL 64 | |------------------------------------------------ 65 | | 66 | | This item determines which server global 67 | | should be used to retrieve the URI string. The 68 | | default setting of "auto" works for most servers. 69 | | If your links do not seem to work, try one of 70 | | the other delicious flavors: 71 | | 72 | | 'auto' Default - auto detects 73 | | 'path_info' Uses the PATH_INFO 74 | | 'query_string' Uses the QUERY_STRING 75 | */ 76 | 77 | $config['uri_protocol'] = "auto"; 78 | 79 | -------------------------------------------------------------------------------- /user_guide_src/source/installation/upgrading.rst: -------------------------------------------------------------------------------- 1 | ################################# 2 | Upgrading From a Previous Version 3 | ################################# 4 | 5 | Please read the upgrade notes corresponding to the version you are 6 | upgrading from. 7 | 8 | .. toctree:: 9 | :titlesonly: 10 | 11 | Upgrading from 3.0.x to 3.1.x 12 | Upgrading from 3.0.1 to 3.0.2 13 | Upgrading from 3.0.0 to 3.0.1 14 | Upgrading from 2.2.x to 3.0.x 15 | Upgrading from 2.2.2 to 2.2.3 16 | Upgrading from 2.2.1 to 2.2.2 17 | Upgrading from 2.2.0 to 2.2.1 18 | Upgrading from 2.1.4 to 2.2.x 19 | Upgrading from 2.1.3 to 2.1.4 20 | Upgrading from 2.1.2 to 2.1.3 21 | Upgrading from 2.1.1 to 2.1.2 22 | Upgrading from 2.1.0 to 2.1.1 23 | Upgrading from 2.0.3 to 2.1.0 24 | Upgrading from 2.0.2 to 2.0.3 25 | Upgrading from 2.0.1 to 2.0.2 26 | Upgrading from 2.0 to 2.0.1 27 | Upgrading from 1.7.2 to 2.0 28 | Upgrading from 1.7.1 to 1.7.2 29 | Upgrading from 1.7.0 to 1.7.1 30 | Upgrading from 1.6.3 to 1.7.0 31 | Upgrading from 1.6.2 to 1.6.3 32 | Upgrading from 1.6.1 to 1.6.2 33 | Upgrading from 1.6.0 to 1.6.1 34 | Upgrading from 1.5.4 to 1.6.0 35 | Upgrading from 1.5.3 to 1.5.4 36 | Upgrading from 1.5.2 to 1.5.3 37 | Upgrading from 1.5.0 or 1.5.1 to 1.5.2 38 | Upgrading from 1.4.1 to 1.5.0 39 | Upgrading from 1.4.0 to 1.4.1 40 | Upgrading from 1.3.3 to 1.4.0 41 | Upgrading from 1.3.2 to 1.3.3 42 | Upgrading from 1.3.1 to 1.3.2 43 | Upgrading from 1.3 to 1.3.1 44 | Upgrading from 1.2 to 1.3 45 | Upgrading from 1.1 to 1.2 46 | Upgrading from Beta 1.0 to Beta 1.1 47 | -------------------------------------------------------------------------------- /user_guide_src/source/libraries/index.rst: -------------------------------------------------------------------------------- 1 | ######### 2 | Libraries 3 | ######### 4 | 5 | .. toctree:: 6 | :glob: 7 | :titlesonly: 8 | 9 | * -------------------------------------------------------------------------------- /user_guide_src/source/license.rst: -------------------------------------------------------------------------------- 1 | ##################### 2 | The MIT License (MIT) 3 | ##################### 4 | 5 | Copyright (c) 2014 - 2015, British Columbia Institute of Technology 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. -------------------------------------------------------------------------------- /user_guide_src/source/overview/appflow.rst: -------------------------------------------------------------------------------- 1 | ###################### 2 | Application Flow Chart 3 | ###################### 4 | 5 | The following graphic illustrates how data flows throughout the system: 6 | 7 | |CodeIgniter application flow| 8 | 9 | #. The index.php serves as the front controller, initializing the base 10 | resources needed to run CodeIgniter. 11 | #. The Router examines the HTTP request to determine what should be done 12 | with it. 13 | #. If a cache file exists, it is sent directly to the browser, bypassing 14 | the normal system execution. 15 | #. Security. Before the application controller is loaded, the HTTP 16 | request and any user submitted data is filtered for security. 17 | #. The Controller loads the model, core libraries, helpers, and any 18 | other resources needed to process the specific request. 19 | #. The finalized View is rendered then sent to the web browser to be 20 | seen. If caching is enabled, the view is cached first so that on 21 | subsequent requests it can be served. 22 | 23 | .. |CodeIgniter application flow| image:: ../images/appflowchart.gif 24 | -------------------------------------------------------------------------------- /user_guide_src/source/overview/features.rst: -------------------------------------------------------------------------------- 1 | #################### 2 | CodeIgniter Features 3 | #################### 4 | 5 | Features in and of themselves are a very poor way to judge an 6 | application since they tell you nothing about the user experience, or 7 | how intuitively or intelligently it is designed. Features don't reveal 8 | anything about the quality of the code, or the performance, or the 9 | attention to detail, or security practices. The only way to really judge 10 | an app is to try it and get to know the code. 11 | :doc:`Installing <../installation/index>` CodeIgniter is child's play so 12 | we encourage you to do just that. In the mean time here's a list of 13 | CodeIgniter's main features. 14 | 15 | - Model-View-Controller Based System 16 | - Extremely Light Weight 17 | - Full Featured database classes with support for several platforms. 18 | - Query Builder Database Support 19 | - Form and Data Validation 20 | - Security and XSS Filtering 21 | - Session Management 22 | - Email Sending Class. Supports Attachments, HTML/Text email, multiple 23 | protocols (sendmail, SMTP, and Mail) and more. 24 | - Image Manipulation Library (cropping, resizing, rotating, etc.). 25 | Supports GD, ImageMagick, and NetPBM 26 | - File Uploading Class 27 | - FTP Class 28 | - Localization 29 | - Pagination 30 | - Data Encryption 31 | - Benchmarking 32 | - Full Page Caching 33 | - Error Logging 34 | - Application Profiling 35 | - Calendaring Class 36 | - User Agent Class 37 | - Zip Encoding Class 38 | - Template Engine Class 39 | - Trackback Class 40 | - XML-RPC Library 41 | - Unit Testing Class 42 | - Search-engine Friendly URLs 43 | - Flexible URI Routing 44 | - Support for Hooks and Class Extensions 45 | - Large library of "helper" functions 46 | 47 | -------------------------------------------------------------------------------- /user_guide_src/source/overview/getting_started.rst: -------------------------------------------------------------------------------- 1 | ################################ 2 | Getting Started With CodeIgniter 3 | ################################ 4 | 5 | Any software application requires some effort to learn. We've done our 6 | best to minimize the learning curve while making the process as 7 | enjoyable as possible. 8 | 9 | The first step is to :doc:`install <../installation/index>` 10 | CodeIgniter, then read all the topics in the **Introduction** section of 11 | the Table of Contents. 12 | 13 | Next, read each of the **General Topics** pages in order. Each topic 14 | builds on the previous one, and includes code examples that you are 15 | encouraged to try. 16 | 17 | Once you understand the basics you'll be ready to explore the **Class 18 | Reference** and **Helper Reference** pages to learn to utilize the 19 | native libraries and helper files. 20 | 21 | Feel free to take advantage of our `Community 22 | Forums `_ if you have questions or 23 | problems, and our `Wiki `_ to see code 24 | examples posted by other users. 25 | -------------------------------------------------------------------------------- /user_guide_src/source/overview/goals.rst: -------------------------------------------------------------------------------- 1 | ############################## 2 | Design and Architectural Goals 3 | ############################## 4 | 5 | Our goal for CodeIgniter is maximum performance, capability, and 6 | flexibility in the smallest, lightest possible package. 7 | 8 | To meet this goal we are committed to benchmarking, re-factoring, and 9 | simplifying at every step of the development process, rejecting anything 10 | that doesn't further the stated objective. 11 | 12 | From a technical and architectural standpoint, CodeIgniter was created 13 | with the following objectives: 14 | 15 | - **Dynamic Instantiation.** In CodeIgniter, components are loaded and 16 | routines executed only when requested, rather than globally. No 17 | assumptions are made by the system regarding what may be needed 18 | beyond the minimal core resources, so the system is very light-weight 19 | by default. The events, as triggered by the HTTP request, and the 20 | controllers and views you design will determine what is invoked. 21 | - **Loose Coupling.** Coupling is the degree to which components of a 22 | system rely on each other. The less components depend on each other 23 | the more reusable and flexible the system becomes. Our goal was a 24 | very loosely coupled system. 25 | - **Component Singularity.** Singularity is the degree to which 26 | components have a narrowly focused purpose. In CodeIgniter, each 27 | class and its functions are highly autonomous in order to allow 28 | maximum usefulness. 29 | 30 | CodeIgniter is a dynamically instantiated, loosely coupled system with 31 | high component singularity. It strives for simplicity, flexibility, and 32 | high performance in a small footprint package. 33 | -------------------------------------------------------------------------------- /user_guide_src/source/overview/index.rst: -------------------------------------------------------------------------------- 1 | #################### 2 | CodeIgniter Overview 3 | #################### 4 | 5 | The following pages describe the broad concepts behind CodeIgniter: 6 | 7 | .. toctree:: 8 | :titlesonly: 9 | 10 | Getting Started 11 | CodeIgniter at a Glance 12 | Supported Features 13 | Application Flow Chart 14 | Model-View-Controller 15 | Architectural Goals -------------------------------------------------------------------------------- /user_guide_src/source/overview/mvc.rst: -------------------------------------------------------------------------------- 1 | ##################### 2 | Model-View-Controller 3 | ##################### 4 | 5 | CodeIgniter is based on the Model-View-Controller development pattern. 6 | MVC is a software approach that separates application logic from 7 | presentation. In practice, it permits your web pages to contain minimal 8 | scripting since the presentation is separate from the PHP scripting. 9 | 10 | - The **Model** represents your data structures. Typically your model 11 | classes will contain functions that help you retrieve, insert, and 12 | update information in your database. 13 | - The **View** is the information that is being presented to a user. A 14 | View will normally be a web page, but in CodeIgniter, a view can also 15 | be a page fragment like a header or footer. It can also be an RSS 16 | page, or any other type of "page". 17 | - The **Controller** serves as an *intermediary* between the Model, the 18 | View, and any other resources needed to process the HTTP request and 19 | generate a web page. 20 | 21 | CodeIgniter has a fairly loose approach to MVC since Models are not 22 | required. If you don't need the added separation, or find that 23 | maintaining models requires more complexity than you want, you can 24 | ignore them and build your application minimally using Controllers and 25 | Views. CodeIgniter also enables you to incorporate your own existing 26 | scripts, or even develop core libraries for the system, enabling you to 27 | work in a way that makes the most sense to you. 28 | -------------------------------------------------------------------------------- /user_guide_src/source/tutorial/conclusion.rst: -------------------------------------------------------------------------------- 1 | ########## 2 | Conclusion 3 | ########## 4 | 5 | This tutorial did not cover all of the things you might expect of a 6 | full-fledged content management system, but it introduced you to the 7 | more important topics of routing, writing controllers, and models. We 8 | hope this tutorial gave you an insight into some of CodeIgniter's basic 9 | design patterns, which you can expand upon. 10 | 11 | Now that you've completed this tutorial, we recommend you check out the 12 | rest of the documentation. CodeIgniter is often praised because of its 13 | comprehensive documentation. Use this to your advantage and read the 14 | "Introduction" and "General Topics" sections thoroughly. You should read 15 | the class and helper references when needed. 16 | 17 | Every intermediate PHP programmer should be able to get the hang of 18 | CodeIgniter within a few days. 19 | 20 | If you still have questions about the framework or your own CodeIgniter 21 | code, you can: 22 | 23 | - Check out our `forums `_ 24 | - Visit our `IRC chatroom `_ 25 | - Explore the `Wiki `_ 26 | 27 | -------------------------------------------------------------------------------- /user_guide_src/source/tutorial/index.rst: -------------------------------------------------------------------------------- 1 | ######## 2 | Tutorial 3 | ######## 4 | 5 | This tutorial is intended to introduce you to the CodeIgniter framework 6 | and the basic principles of MVC architecture. It will show you how a 7 | basic CodeIgniter application is constructed in step-by-step fashion. 8 | 9 | In this tutorial, you will be creating a **basic news application**. You 10 | will begin by writing the code that can load static pages. Next, you 11 | will create a news section that reads news items from a database. 12 | Finally, you'll add a form to create news items in the database. 13 | 14 | This tutorial will primarily focus on: 15 | 16 | - Model-View-Controller basics 17 | - Routing basics 18 | - Form validation 19 | - Performing basic database queries using "Query Builder" 20 | 21 | The entire tutorial is split up over several pages, each explaining a 22 | small part of the functionality of the CodeIgniter framework. You'll go 23 | through the following pages: 24 | 25 | - Introduction, this page, which gives you an overview of what to 26 | expect. 27 | - :doc:`Static pages `, which will teach you the basics 28 | of controllers, views and routing. 29 | - :doc:`News section `, where you'll start using models 30 | and will be doing some basic database operations. 31 | - :doc:`Create news items `, which will introduce 32 | more advanced database operations and form validation. 33 | - :doc:`Conclusion `, which will give you some pointers on 34 | further reading and other resources. 35 | 36 | Enjoy your exploration of the CodeIgniter framework. 37 | 38 | .. toctree:: 39 | :glob: 40 | :hidden: 41 | :titlesonly: 42 | 43 | static_pages 44 | news_section 45 | create_news_items 46 | conclusion --------------------------------------------------------------------------------