/**
  * @access private
  * @return void
  */
 private function ajaxRouter($sMod = null)
 {
     \PH7\Framework\File\Import::pH7FwkClass('Ajax.Ajax');
     // Option for Content Type
     if ($this->oHttpRequest->getExists('option')) {
         if ($this->oHttpRequest->get('option') == 'plain') {
             header('Content-Type: text/plain; charset=utf-8');
         }
     }
     if (!empty($sMod)) {
         // For module only!
         $this->_pathInitialize();
         $sFolder = $this->oUri->fragment(4) && preg_match('#^[\\w]+$#', $this->oUri->fragment(4)) ? PH7_DS . $this->oUri->fragment(4) : '';
         if (is_file($sMod . 'assets/ajax/' . $this->oUri->fragment(3) . $sFolder . 'Ajax.php')) {
             include_once $sMod . 'assets/ajax/' . $this->oUri->fragment(3) . $sFolder . 'Ajax.php';
         } else {
             $this->notFound('Error while loading the library of module ajax<br />File: ' . $sMod . 'assets' . PH7_DS . 'ajax' . PH7_DS . $this->oUri->fragment(3) . $sFolder . 'Ajax.php does not exist', 1);
         }
     } else {
         // For all scripts of the pH7 DatingCms
         $sFolder = $this->oUri->fragment(3) && preg_match('#^[\\w]+$#', $this->oUri->fragment(3)) ? PH7_DS . $this->oUri->fragment(3) : '';
         if (is_file(PH7_PATH_SYS . 'core/assets/ajax/' . $this->oUri->fragment(2) . $sFolder . 'CoreAjax.php')) {
             include_once PH7_PATH_SYS . 'core/assets/ajax/' . $this->oUri->fragment(2) . $sFolder . 'CoreAjax.php';
         } else {
             $this->notFound('Error while loading the library of ajax<br />File: ' . PH7_PATH_SYS . 'core' . PH7_DS . 'assets' . PH7_DS . 'ajax' . PH7_DS . $this->oUri->fragment(2) . $sFolder . 'CoreAjax.php does not exist', 1);
         }
     }
 }
Exemplo n.º 2
0
 }
 // Loading Framework Classes
 require PH7_PATH_FRAMEWORK . 'Loader/Autoloader.php';
 Framework\Loader\Autoloader::getInstance()->init();
 /** Loading configuration files environments **/
 // 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
Exemplo n.º 3
0
 /**
  * @access private
  * @return void
  */
 private function ajaxRouter($sMod = null)
 {
     \PH7\Framework\File\Import::pH7FwkClass('Ajax.Ajax');
     // Option for Content Type
     if ($this->oHttpRequest->getExists('option')) {
         if ($this->oHttpRequest->get('option') == 'plain') {
             header('Content-Type: text/plain; charset=utf-8');
         }
     }
     if (!empty($sMod)) {
         // For module only!
         /***** SHORTCUTS PATH THE MODULE *****/
         $this->oRegistry->path_module_controllers = $this->oRegistry->path_module . PH7_CTRL;
         $this->oRegistry->path_module_models = $this->oRegistry->path_module . PH7_MODELS;
         $this->oRegistry->path_module_views = $this->oRegistry->path_module . PH7_VIEWS;
         $this->oRegistry->path_module_forms = $this->oRegistry->path_module . PH7_FORMS;
         $this->oRegistry->path_module_inc = $this->oRegistry->path_module . PH7_INC;
         $this->oRegistry->path_module_config = $this->oRegistry->path_module . PH7_CONFIG;
         $this->oRegistry->path_module_lang = $this->oRegistry->path_module . PH7_LANG;
         $sFolder = $this->oUri->fragment(4) && preg_match('#^[\\w]+$#', $this->oUri->fragment(4)) ? PH7_DS . $this->oUri->fragment(4) : '';
         if (is_file($sMod . 'assets/ajax/' . $this->oUri->fragment(3) . $sFolder . 'Ajax.php')) {
             include_once $sMod . 'assets/ajax/' . $this->oUri->fragment(3) . $sFolder . 'Ajax.php';
         } else {
             $this->notFound('Error while loading the library of module ajax<br />File: ' . $sMod . 'assets' . PH7_DS . 'ajax' . PH7_DS . $this->oUri->fragment(3) . $sFolder . 'Ajax.php does not exist', 1);
         }
     } else {
         // For all scripts of the pH7 DatingCms
         $sFolder = $this->oUri->fragment(3) && preg_match('#^[\\w]+$#', $this->oUri->fragment(3)) ? PH7_DS . $this->oUri->fragment(3) : '';
         if (is_file(PH7_PATH_SYS . 'core/assets/ajax/' . $this->oUri->fragment(2) . $sFolder . 'CoreAjax.php')) {
             include_once PH7_PATH_SYS . 'core/assets/ajax/' . $this->oUri->fragment(2) . $sFolder . 'CoreAjax.php';
         } else {
             $this->notFound('Error while loading the library of ajax<br />File: ' . PH7_PATH_SYS . 'core' . PH7_DS . 'assets' . PH7_DS . 'ajax' . PH7_DS . $this->oUri->fragment(2) . $sFolder . 'CoreAjax.php does not exist', 1);
         }
     }
 }