<? PHP
// Error_reporting (e_all &~ E_notice );
// Error_reporting (e_all | e_starict); // set PHP
And returns the current error level.
Ini_set (
"Display_errors ",
"On"
);
// Set whether to enable debug mode
Date_default_timezone_set (
'Prc'
);
// Set the default time zone of all date/time functions in the script
Set_include_path (
'.'
. Path_separator.
'./Library'
. Path_separator.
'./Application/models /'
);
//. Path_separator. './application/common /');
Include
"Zend/loader. php ";
// Import Zend framework
Loader
Include
"Zend/view. php ";
Zend_loader ::Loadclass(
'Zend _ controller_front'
);
// Load the named class
Zend_loader ::Loadclass(
'Zend _ db_table'
);
Session_start ();
// $ Frontendoptions = array (
//'Lifetime' => 7200, // Set the cache data life cycle (2 hours)
//& Apos; automaticserialization & apos; = & apos; true & apos; // Sets whether the cached data can be serialized.
//); // Define the array of frontend settings
// $ Backendoptions = array (
//'Cachedir' => './' // Set the path for storing cached data files (current directory)
//); // Define the backend settings Array
// // Obtain a front-end
// $ Cache = zend_cache: Factory ('core', 'file', $ frontendoptions, $ backendoptions );
If
(!
Isset
($ _ Session ['adapter ']) {
Zend_loader ::Loadclass(
'Zend _ registry'
);
Zend_loader ::Loadclass(
'Zend _ config_ini'
);
//
Load configuration
$ Config =
New
Zend_config_ini (
'./Application/config. ini ',
'Sip'
);
$ Registry = zend_registry ::Getinstance();
$ Registry->Set(
'Config', $ config );
$ Globals ["pagesize"]
= $ Config-> DB-> config-> pagesize;
$ Adapter = $ config-> DB-> adapter;
$ _ Session ['adapter ']
= $ Adapter;
$ Configarray = $ config-> DB-> config-> toarray
();
$ _ Session ['configarray']
= $ Configarray;
$ _ Session ["pagesize"]
= $ Globals ["pagesize"];
}
Else
{
$ Adapter = $ _ session ['adapter '];
$ Configarray =
$ _ Session['Configarray'];
$ Globals ["pagesize"]
= $ _ Session ["pagesize"];
}
Zend_loader ::Loadclass(
'Zend _ db'
);
$ Db = zend_db ::Factory($ Adapter, $ configarray );
Zend_db_table ::Setdefaadapter Adapter($ DB );
Zend_controller_front ::Run('./Application/controllers'
);
?>