Advertisement
GWibisono

echo. echo saya keluar ngak?

Sep 11th, 2016
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.21 KB | None | 0 0
  1. <?php
  2.       define('ENVIRONMENT', 'development');
  3.  
  4. switch (ENVIRONMENT)
  5. {
  6.     case 'development':
  7.         error_reporting(-1);
  8.         ini_set('display_errors', 1);
  9.     break;
  10.  
  11.     case 'testing':
  12.     case 'production':
  13.         ini_set('display_errors', 0);
  14.         if (version_compare(PHP_VERSION, '5.3', '>='))
  15.         {
  16.             error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
  17.         }
  18.         else
  19.         {
  20.             error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE);
  21.         }
  22.     break;
  23.  
  24.     default:
  25.         header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
  26.         echo 'The application environment is not set correctly.';
  27.         exit(1); // EXIT_ERROR
  28. }
  29. echo "<br/>type :". ENVIRONMENT;
  30.  
  31.     $system_path = 'system';
  32.  
  33. /*
  34.  *---------------------------------------------------------------
  35.  * APPLICATION FOLDER NAME
  36.  *---------------------------------------------------------------
  37.  *
  38.  * If you want this front controller to use a different "application"
  39.  * folder than the default one you can set its name here. The folder
  40.  * can also be renamed or relocated anywhere on your server. If
  41.  * you do, use a full server path. For more info please see the user guide:
  42.  * http://codeigniter.com/user_guide/general/managing_apps.html
  43.  *
  44.  * NO TRAILING SLASH!
  45.  */
  46.     $application_folder = 'application';
  47.  
  48. /*
  49.  *---------------------------------------------------------------
  50.  * VIEW FOLDER NAME
  51.  *---------------------------------------------------------------
  52.  *
  53.  * If you want to move the view folder out of the application
  54.  * folder set the path to the folder here. The folder can be renamed
  55.  * and relocated anywhere on your server. If blank, it will default
  56.  * to the standard location inside your application folder. If you
  57.  * do move this, use the full server path to this folder.
  58.  *
  59.  * NO TRAILING SLASH!
  60.  */
  61.     $view_folder = '';
  62.  
  63.  
  64. /*
  65.  * --------------------------------------------------------------------
  66.  * DEFAULT CONTROLLER
  67.  * --------------------------------------------------------------------
  68.  *
  69.  * Normally you will set your default controller in the routes.php file.
  70.  * You can, however, force a custom routing by hard-coding a
  71.  * specific controller class/function here. For most applications, you
  72.  * WILL NOT set your routing here, but it's an option for those
  73.  * special instances where you might want to override the standard
  74.  * routing in a specific front controller that shares a common CI installation.
  75.  *
  76.  * IMPORTANT: If you set the routing here, NO OTHER controller will be
  77.  * callable. In essence, this preference limits your application to ONE
  78.  * specific controller. Leave the function name blank if you need
  79.  * to call functions dynamically via the URI.
  80.  *
  81.  * Un-comment the $routing array below to use this feature
  82.  */
  83.     // The directory name, relative to the "controllers" folder.  Leave blank
  84.     // if your controller is not in a sub-folder within the "controllers" folder
  85.     // $routing['directory'] = '';
  86.  
  87.     // The controller class file name.  Example:  mycontroller
  88.     // $routing['controller'] = '';
  89.  
  90.     // The controller function you wish to be called.
  91.     // $routing['function'] = '';
  92.  
  93.  
  94. /*
  95.  * -------------------------------------------------------------------
  96.  *  CUSTOM CONFIG VALUES
  97.  * -------------------------------------------------------------------
  98.  *
  99.  * The $assign_to_config array below will be passed dynamically to the
  100.  * config class when initialized. This allows you to set custom config
  101.  * items or override any default config values found in the config.php file.
  102.  * This can be handy as it permits you to share one application between
  103.  * multiple front controller files, with each file containing different
  104.  * config values.
  105.  *
  106.  * Un-comment the $assign_to_config array below to use this feature
  107.  */
  108.     // $assign_to_config['name_of_config_item'] = 'value of config item';
  109.  
  110.     if( ! ini_get('date.timezone') )
  111.     {
  112.        date_default_timezone_set('Asia/Jakarta');
  113.     }
  114.  
  115. // --------------------------------------------------------------------
  116. // END OF USER CONFIGURABLE SETTINGS.  DO NOT EDIT BELOW THIS LINE
  117. // --------------------------------------------------------------------
  118.  
  119. /*
  120.  * ---------------------------------------------------------------
  121.  *  Resolve the system path for increased reliability
  122.  * ---------------------------------------------------------------
  123.  */
  124.  
  125.     // Set the current directory correctly for CLI requests
  126.     if (defined('STDIN'))
  127.     {
  128.         chdir(dirname(__FILE__));
  129.     }
  130.  
  131.     if (($_temp = realpath($system_path)) !== FALSE)
  132.     {
  133.         $system_path = $_temp.'/';
  134.     }
  135.     else
  136.     {
  137.         // Ensure there's a trailing slash
  138.         $system_path = rtrim($system_path, '/').'/';
  139.     }
  140.  
  141.     // Is the system path correct?
  142.     if ( ! is_dir($system_path))
  143.     {
  144.         header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
  145.         echo 'Your system folder path does not appear to be set correctly. Please open the following file and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME);
  146.         exit(3); // EXIT_CONFIG
  147.     }
  148.  
  149. /*
  150.  * -------------------------------------------------------------------
  151.  *  Now that we know the path, set the main path constants
  152.  * -------------------------------------------------------------------
  153.  */
  154.     // The name of THIS file
  155.     define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
  156.  
  157.     // Path to the system folder
  158.     define('BASEPATH', str_replace('\\', '/', $system_path));
  159.  
  160.     // Path to the front controller (this file)
  161.     define('FCPATH', str_replace(SELF, '', __FILE__));
  162.  
  163.     // Name of the "system folder"
  164.     define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
  165.  
  166.     // The path to the "application" folder
  167.     if (is_dir($application_folder))
  168.     {
  169.         if (($_temp = realpath($application_folder)) !== FALSE)
  170.         {
  171.             $application_folder = $_temp;
  172.         }
  173.  
  174.         define('APPPATH', $application_folder.DIRECTORY_SEPARATOR);
  175.     }
  176.     else
  177.     {
  178.         if ( ! is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR))
  179.         {
  180.             header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
  181.             echo 'Your application folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
  182.             exit(3); // EXIT_CONFIG
  183.         }
  184.  
  185.         define('APPPATH', BASEPATH.$application_folder.DIRECTORY_SEPARATOR);
  186.     }
  187.  
  188.     // The path to the "views" folder
  189.     if ( ! is_dir($view_folder))
  190.     {
  191.         if ( ! empty($view_folder) && is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR))
  192.         {
  193.             $view_folder = APPPATH.$view_folder;
  194.         }
  195.         elseif ( ! is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR))
  196.         {
  197.             header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
  198.             echo 'Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
  199.             exit(3); // EXIT_CONFIG
  200.         }
  201.         else
  202.         {
  203.             $view_folder = APPPATH.'views';
  204.         }
  205.     }
  206.  
  207.     if (($_temp = realpath($view_folder)) !== FALSE)
  208.     {
  209.         $view_folder = $_temp.DIRECTORY_SEPARATOR;
  210.     }
  211.     else
  212.     {
  213.         $view_folder = rtrim($view_folder, '/\\').DIRECTORY_SEPARATOR;
  214.     }
  215.  
  216.     define('VIEWPATH', $view_folder);
  217.  
  218. /*
  219.  * --------------------------------------------------------------------
  220.  * LOAD THE BOOTSTRAP FILE
  221.  * --------------------------------------------------------------------
  222.  *
  223.  * And away we go...
  224.  */
  225. echo "<br/>run : CI";
  226. require_once BASEPATH.'core/CodeIgniter.php';
  227.  
  228. /* End of file index.php */
  229. /* Location: ./index.php */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement