define('_DOCUMENT_ROOT_PATH', $_SERVER['DOCUMENT_ROOT']); define('_SERVER_NAME', $_SERVER['SERVER_NAME']); $defaultControllerPath = 'application/modules/default/controllers/'; //error_reporting(E_ALL^E_WARNING); date_default_timezone_set('Europe/Kiev'); set_include_path( '/home/fmstudio/lib'.PATH_SEPARATOR .'library'.PATH_SEPARATOR .'application/modules/admin/models/'.PATH_SEPARATOR .$defaultControllerPath.PATH_SEPARATOR .'application/modules/default/models/'.PATH_SEPARATOR .get_include_path() ); // register standard Zend Autoloader require_once('Zend/Loader/Autoloader.php'); $loader = Zend_Loader_Autoloader::getInstance(); $loader->registerNamespace(array('FM_','Form_')); // load configuration $config_general = new Zend_Config_Ini('application/config/config.ini', 'general'); $registry = Zend_Registry::getInstance(); $registry->set('config', $config_general); $registry->set('checkAdmin', FALSE);//default module // ZEND CACHE $frontendOptions = array( 'lifetime' => $config_general->cache->lifetime ); $backendOptions = array( 'cache_dir' => $config_general->cache->path ); $cache = Zend_Cache::factory('Page', $config_general->cache->adapter, $frontendOptions, $backendOptions); if($config_general->cache->enabled){ $cache->start(md5($_SERVER['REQUEST_URI'])); } Zend_Registry::set('cache', $cache); // setup database $dbConfig = $config_general->db->config->toArray(); $dbConfig['driver_options'] = array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES ' . $config_general->db->config->charset); $db = Zend_Db::factory($config_general->db->adapter, $dbConfig); $registry->set('db', $db); Zend_Db_Table::setDefaultAdapter($db); //routing $router = new Zend_Controller_Router_Rewrite(); $router->removeDefaultRoutes(); Zend_Loader::loadClass('FM_Routes'); $router->addRoute('fmRouting', FM_Routes::makeRouting()); //set locale $avaLang = explode(':', $config_general->avalible->lang); $avaLocale = explode(':', $config_general->avalible->locale); $avaSize = count($avaLang); for($i=0; $i<$avaSize; $i++){ if($avaLang[$i] == FM_Routes::getLanguage()){ Zend_Registry::set('baseLocale', $avaLocale[$i]); break; } } //setup view Parts and ConfigDB Zend_Loader::loadClass('FM_Vp'); FM_Vp::getInstance(); //setup config translate Zend_Loader::loadClass('FM_Translate'); if($registry->get('checkAdmin')){ FM_Translate::getInstance('admin'); }else{ FM_Translate::getInstance('default'); } Zend_Loader::loadClass('FM_Config'); $fmconfig = new FM_Config(); Zend_Registry::set('FM_Config', $fmconfig->getAllConfigArray(FM_Routes::getLanguage(),TRUE)); // setup controller $frontController = Zend_Controller_Front::getInstance(); //ZFDEBUG if($config_general->zfdebug){ //if($config_general->exceptions){ $options = array( 'plugins' => array('Variables', 'Html', 'Database' => array('adapter' => array('standard' => $db)), 'File' => array('base_path' => '/home/alexander/public_html/fm.cms/www'), 'Memory', 'Time', 'Registry', // 'Cache' => array('backend' => $cache->getBackend()), 'Exception') ); Zend_Loader::loadClass('ZFDebug_Controller_Plugin_Debug_Plugin_Interface'); Zend_Loader::loadClass('ZFDebug_Controller_Plugin_Debug_Plugin'); Zend_Loader::loadClass('ZFDebug_Controller_Plugin_Debug'); $debug = new ZFDebug_Controller_Plugin_Debug($options); $frontController = Zend_Controller_Front::getInstance(); $frontController->registerPlugin($debug); } $frontController->throwExceptions($config_general->exceptions); $frontController->setControllerDirectory(array( 'default' => $defaultControllerPath, 'admin' => 'application/modules/admin/controllers' )); $frontController->setRouter($router); Zend_Layout::startMvc(); Zend_Loader::loadClass('FM_Plugin_Layout'); $frontController->registerPlugin(new FM_Plugin_Layout()); Zend_Registry::set('baseLang', FM_Routes::getBaseUrl()); Zend_Loader::loadClass('FM_Ecommerce_Uniqid'); $uniqidObj = new FM_Ecommerce_Uniqid(); $uniqid = $uniqidObj->getUniqid(); Zend_Registry::set('uniqId', $uniqid); // run! $frontController->dispatch(); function dump($param, $exit = TRUE) { echo '
';
    print_r($param);
    if ($exit) {
        exit;
    }
}