打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
zend 入口文件配置
<?php
error_reporting(E_ALL|E_STRICT);
date_default_timezone_set('Asia/Shanghai');

// Define path to application directory
defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));

// Define application environment
defined('APPLICATION_ENV')
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../library'),
    realpath(APPLICATION_PATH . '/../models'),
    get_include_path(),
)));
require_once "Zend/Loader/Autoloader.php";
Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true);
$registry = Zend_Registry::getInstance();
//$config=new Zend_Config_Ini('../application/config/config.ini',null, true);
$config=new Zend_Config_Ini('../application/config/config.ini','general');
Zend_Registry::set('config',$config);
$db=Zend_Db::factory($config->db);
Zend_Db_Table::setDefaultAdapter($db);
//$dbAdapter=Zend_Db::factory($config->general->db->adapter,$config->general->db->config->toArray());
//$dbAdapter->query('SET names gbk');
//Zend_Db_Table::setDefaultAdapter($dbAdapter);
//Zend_Registry::set('dbAdapter',$dbAdapter);

$view = new Zend_View();
$view->setScriptPath('./application/views/scripts/');
$registry['view'] = $view;
require_once 'Zend/Application.php';

$frontController =Zend_Controller_Front::getInstance();
$frontController->setBaseUrl('/')
//->setParam('noViewRenderer', true)
//->setParam('useDefaultControllerAlways', true)
->setControllerDirectory('../application/controllers')
->throwExceptions(true)
->dispatch();
// Create application, bootstrap, and run
//$application = new Zend_Application(
//    APPLICATION_ENV,
 //   APPLICATION_PATH . '/configs/application.ini'
//);
//$application->bootstrap()
 //           ->run();
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Zend
zf连接两个数据库。。。数据库读写分开
Zend_Amf + flex 数据库连接教程
Windows下XDebug 手工配置与使用说明
服务器
Reference Guide
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服