Example #1
0
 public function __construct()
 {
     $this->config = Config::getInstance();
     $this->str = new Str();
     $this->file = new File();
     $this->httpRequest = new Http();
     $this->browser = new Browser();
     $this->registry = Registry::getInstance();
     /**
      * @internal The "_checkLicense" method cannot be declare more than one time. The "Kernel.class.php" file is included many times in the software, so we need to check that with a constant.
      */
     if (!defined('PH7_CHECKED_LIC')) {
         define('PH7_CHECKED_LIC', 1);
         // OK, now we have checked the license key
         $this->_checkLicense();
     }
     //** Temporary code. In the near future, pH7CMS will be usable without mod_rewrite
     if (!Server::isRewriteMod()) {
         $sModRewriteMsg = t('<span style="font-weight:bold;color:red"><a href="%0%">pH7CMS</a> requires Apache "mod_rewrite".</span><br /> Please install it so that pH7CMS can works.<br /> Click <a href="%1%" target="_blank">here</a> if you want to get more information on how to install the rewrite module.<br /><br /> After doing this, please <a href="%2%">retry</a>.', self::SOFTWARE_WEBSITE, 'http://software.hizup.com/doc/en/how-to-install-rewrite-module', PH7_URL_ROOT);
         Page::message($sModRewriteMsg);
     }
     //*/
 }
 // For All environment
 Import::file(PH7_PATH_APP . 'configs/environment/all.env');
 // Specific to the current environment
 Import::file(PH7_PATH_APP . 'configs/environment/' . Config::getInstance()->values['application']['environment'] . '.env');
 // Loading Class ~/protected/app/includes/classes/*
 Import::pH7App('includes.classes.Loader.Autoloader');
 App\Includes\Classes\Loader\Autoloader::getInstance()->init();
 // Loading Debug class
 Import::pH7FwkClass('Error.Debug');
 // Loading String Class
 Import::pH7FwkClass('Str.Str');
 /* Structure/General.class.php functions are not currently used */
 // Import::pH7FwkClass('Structure.General');
 /*** End Loading Files ***/
 //** Temporary code. In the near future, pH7CMS will be usable without mod_rewrite
 if (!Server::isRewriteMod()) {
     $sMsg = '<p class="warning"><a href="' . Framework\Core\Kernel::SOFTWARE_WEBSITE . '">pH7CMS</a> requires Apache "mod_rewrite".</p>
     <p>Please install it so that pH7CMS can works.<br /> Click <a href="http://ph7cms.com/doc/en/how-to-install-rewrite-module" target="_blank">here</a> if you want to get more information on how to install the rewrite module.<br /><br />
     After doing this, please <a href="' . PH7_URL_ROOT . '">retry</a>.</p>';
     echo html_body("Apache's mod_rewrite is required", $sMsg);
     exit;
 }
 //*/
 // Enable client browser cache
 (new Browser())->cache();
 // Starting zlib-compressed output
 /*
   This "zlib output compression" compressthe pages.
   This allows you to save your bandwidth and faster download of your pages.
   WARNING: this function consumes CPU resources on your server.
   So you can if you want to remove this function.