PHP代码:
<?php
error_reporting(E_ALL|E_STRICT);
date_default_timezone_set ('Asia/Shanghai');
set_include_path(".".PATH_SEPARATOR."./library".PATH_SEPARATOR."./application/models/".PATH_SEPARATOR.get_include_path());
include "Zend/Loader.php";
//Zend_Loader::loadClass("Zend_Controller_Front");
Zend_Loader::registerAutoload();
$config = new Zend_Config_Ini('./application/config.ini','default');
Zend_Session::start();
$testSpace = new Zend_Session_Namespace('testSpace');
$testSpace->a = "aaaaaaaaaa";
$registry = Zend_Registry::getInstance();
$registry->set('config',$config);
$db = Zend_Db::factory($config->db);
Zend_Db_Table::setDefaultAdapter($db);
$smtpconfig = $config->smtp->params->toArray();
$smtpconfig = array('auth' => 'login',
'username' => 'xxx@xxx.net',
'password' => 'xxxxxxxxxxxx');
//var_dump($smtpconfig);
//$tr = new Zend_Mail_Transport_Smtp('smtp.togglethink.com',$config->smtp->toArray());
$tr = new Zend_Mail_Transport_Smtp('smtp.togglethink.com',$smtpconfig);
Zend_Mail::setDefaultTransport($tr);
$frontOption = array(
'lifetime' => true,
'debug_header' => true,
'regexps' => array(
'^/$' => array('cache' => true),
'^/index/' => array('cache' => true,'cache_with_post_variables' => true,'make_id_with_post_variables' => true)
)
);
$backendOptions = array('cache_dir' => '/cache/');
$cache = Zend_Cache::factory('Page','File',$frontOption,$backendOptions);
$cache->start();
$frontController = Zend_Controller_Front::getInstance();
$frontController->setControllerDirectory("./application/controllers");
Zend_Layout::startMvc(array('layoutPath'=>'./application/layouts'));
//$x = new Zend_Controller_Request_Abstract();
//$x->getActionName()
$frontController->throwExceptions(true);
$frontController->dispatch();
?>
PHP代码:
$frontOption = array(
'lifetime' => true,
'debug_header' => true,
'regexps' => array(
'^/index/' => array('cache' => true,
'cache_with_get_variables' => true,
'cache_with_post_variables' => true,
'cache_with_session_variables' => true,
'cache_with_files_variables' => true,
'cache_with_cookie_variables' => true,
)
)
);

