您好,登錄后才能下訂單哦!
index.php 在CI的解壓目錄下的,和system文件夾并列 <?php //定義ENVIRONMENT,system_path,application_folder //根據(jù)system_path,application_folder,定義常量BASEPATH,APPPATH,SELF, EXT, FCPATH,SYSDIR *--------------------------------------------------------------- * APPLICATION ENVIRONMENT *--------------------------------------------------------------- * * You can load different configurations depending on your * current environment. Setting the environment also influences * things like logging and error reporting. * * This can be set to anything, but default usage is: * * development * testing * production * * NOTE: If you change these, also change the error_reporting() code below * */ //ENVIRONMENT 決定是否報(bào)錯 define('ENVIRONMENT', 'development'); /* *--------------------------------------------------------------- * ERROR REPORTING *--------------------------------------------------------------- * * Different environments will require different levels of error reporting. * By default development will show errors but testing and live will hide them. */ if (defined('ENVIRONMENT')) { switch (ENVIRONMENT) { case 'development': //E_ALL :所有錯誤都報(bào) error_reporting(E_ALL); break; case 'testing': case 'production': error_reporting(0); break; default: exit('The application environment is not set correctly.'); } } //system文件夾的名字,誰沒事兒改它啊 /* *--------------------------------------------------------------- * SYSTEM FOLDER NAME *--------------------------------------------------------------- * * This variable must contain the name of your "system" folder. * Include the path if the folder is not in the same directory * as this file. * */ $system_path = 'system'; //尋找哪個文件夾里的controller // 沒有后斜杠?。?/* *--------------------------------------------------------------- * APPLICATION FOLDER NAME *--------------------------------------------------------------- * * If you want this front controller to use a different "application" * folder then the default one you can set its name here. The folder * can also be renamed or relocated anywhere on your server. If * you do, use a full server path. For more info please see the user guide: * http://codeigniter.com/user_guide/general/managing_apps.html * * NO TRAILING SLASH! * */ $application_folder = 'application/mysjjy'; //system/core/router.php /* * -------------------------------------------------------------------- * DEFAULT CONTROLLER * -------------------------------------------------------------------- * * Normally you will set your default controller in the routes.php file. * You can, however, force a custom routing by hard-coding a * specific controller class/function here. For most applications, you * WILL NOT set your routing here, but it's an option for those * special instances where you might want to override the standard * routing in a specific front controller that shares a common CI installation. * * IMPORTANT: If you set the routing here, NO OTHER controller will be * callable. In essence, this preference limits your application to ONE * specific controller. Leave the function name blank if you need * to call functions dynamically via the URI. * * Un-comment the $routing array below to use this feature * */ // The directory name, relative to the "controllers" folder. Leave blank // if your controller is not in a sub-folder within the "controllers" folder // $routing['directory'] = ''; // The controller class file name. Example: Mycontroller // $routing['controller'] = ''; // The controller function you wish to be called. // $routing['function'] = ''; /* * ------------------------------------------------------------------- * CUSTOM CONFIG VALUES * ------------------------------------------------------------------- * * The $assign_to_config array below will be passed dynamically to the * config class when initialized. This allows you to set custom config * items or override any default config values found in the config.php file. * This can be handy as it permits you to share one application between * multiple front controller files, with each file containing different * config values. * * Un-comment the $assign_to_config array below to use this feature * */ // $assign_to_config['name_of_config_item'] = 'value of config item'; // -------------------------------------------------------------------- // END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE // -------------------------------------------------------------------- /* * --------------------------------------------------------------- * Resolve the system path for increased reliability * --------------------------------------------------------------- */ // Set the current directory correctly for CLI requests if (defined('STDIN')) { chdir(dirname(__FILE__)); } if (realpath($system_path) !== FALSE) { $system_path = realpath($system_path).'/'; } //確保system的末端帶有/ // ensure there's a trailing slash $system_path = rtrim($system_path, '/').'/'; //如果system path不是一個dir,報(bào)錯! // Is the system path correct? if ( ! is_dir($system_path)) { exit("Your system folder path does not appear to be set correctly. Please open the following file and correct this: ".pathinfo(__FILE__, PATHINFO_BASENAME)); } /* * ------------------------------------------------------------------- * Now that we know the path, set the main path constants * ------------------------------------------------------------------- */ //pathinfo 路徑分解 //SELF index.php // The name of THIS file define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME)); //擴(kuò)展名 // The PHP file extension // this global constant is deprecated. define('EXT', '.php'); //定義BASEPATH 為system_path // Path to the system folder define('BASEPATH', str_replace("\\", "/", $system_path)); //將index.php去掉 // Path to the front controller (this file) define('FCPATH', str_replace(SELF, '', __FILE__)); // Name of the "system folder" define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/')); //定義APPPATH 為$application_folder.'/' // The path to the "application" folder //is_dir($filename) 如果 filename 是一個相對路徑,則按照當(dāng)前工作目錄檢查其相對路徑 //即index.php所在目錄下沒有application_folder,就找system下有沒有,定義為APPPATH if (is_dir($application_folder)) { define('APPPATH', $application_folder.'/'); } else { if ( ! is_dir(BASEPATH.$application_folder.'/')) { exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF); } define('APPPATH', BASEPATH.$application_folder.'/'); } /* * -------------------------------------------------------------------- * LOAD THE BOOTSTRAP FILE * -------------------------------------------------------------------- * * And away we go... * */ //引用system/core/CodeIgniter.php require_once BASEPATH.'core/CodeIgniter.php'; /* End of file index.php */ /* Location: ./index.php */
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。