Advertisement
GWibisono

index.php di CI

Apr 16th, 2012
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.55 KB | None | 0 0
  1. <?php
  2. /*biarkan valuenya*/
  3.     define('ENVIRONMENT', 'development');
  4. if (defined('ENVIRONMENT'))
  5. {
  6.     switch (ENVIRONMENT)
  7.     {
  8.         case 'development':
  9.             error_reporting(E_ALL);
  10.         break;
  11.    
  12.         case 'testing':
  13.         case 'production':
  14.             error_reporting(0);
  15.         break;
  16.  
  17.         default:
  18.             exit('The application environment is not set correctly.');
  19.     }
  20. }
  21.  
  22. /* Yang di ubah */
  23. $system_path = 'ci';
  24. $application_folder = 'jkeren';
  25.  
  26.     if (defined('STDIN'))
  27.     {
  28.         chdir(dirname(__FILE__));
  29.     }
  30.  
  31.     if (realpath($system_path) !== FALSE)
  32.     {
  33.         $system_path = realpath($system_path).'/';
  34.     }
  35.  
  36.     $system_path = rtrim($system_path, '/').'/';
  37.  
  38.     if ( ! is_dir($system_path))
  39.     {
  40.         exit("Your system folder path does not appear to be set correctly.
  41. Please open the following file and correct this: ".pathinfo(__FILE__, PATHINFO_BASENAME));
  42.     }
  43.  
  44.     define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
  45.  
  46.     define('EXT', '.php');
  47.  
  48.     define('BASEPATH', str_replace("\\", "/", $system_path));
  49.  
  50.     define('FCPATH', str_replace(SELF, '', __FILE__));
  51.  
  52.     define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
  53.  
  54.     if (is_dir($application_folder))
  55.     {
  56.         define('APPPATH', $application_folder.'/');
  57.     }
  58.     else
  59.     {
  60.         if ( ! is_dir(BASEPATH.$application_folder.'/'))
  61.         {
  62.             exit("Your application folder path does not appear to be set correctly.
  63. Please open the following file and correct this: ".SELF);
  64.         }
  65.  
  66.         define('APPPATH', BASEPATH.$application_folder.'/');
  67.     }
  68.  
  69. require_once BASEPATH.'core/CodeIgniter.php';
  70.  
  71. /* End of file index.php */
  72. /* Location: ./index.php */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement