Example #1
0
 /**
  * Read the config file, only ini type implemented
  *
  * @todo Implement XML and PHP config files
  * @return void
  */
 function readConfig()
 {
     global $siteTypes;
     if (!file_exists(CONFIGPATH . $this->_configFile)) {
         die('Unable to find ' . $this->_configFile . ' file, please check your application configuration');
     }
     $ext = PPI_Helper::getFileExtension($this->_configFile);
     $sHostname = getHTTPHostname();
     $siteType = array_key_exists($sHostname, $siteTypes) ? $siteTypes[$sHostname] : 'development';
     switch ($ext) {
         case 'ini':
             $this->_oConfig = new PPI_Config_Ini(parse_ini_file(CONFIGPATH . $this->_configFile, true), $siteType);
             break;
         case 'xml':
             die('Trying to load a xml config file but no parser yet created.');
             break;
         case 'php':
             die('Trying to load a php config file but no parser yet created.');
             break;
     }
 }
Example #2
0
function getSiteType()
{
    global $siteTypes;
    $sHostName = getHTTPHostname();
    foreach ($siteTypes as $key => $val) {
        if ($key == $sHostName) {
            return $val;
        }
    }
    return 'unknown';
}