0
我正在做一個簡單的網站,必須使用一些數據庫中的表和執行一些web服務任務。沒什麼複雜。我已經從我的根文件夾中的其他項目中獲取配置,並將它們粘貼到配置和引導文件中。該應用程序INI如下:配置錯誤Zend Framework 1.12 application.ini
[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
phpSettings.date.timezone = "Europe/Rome"
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
includePaths.library = APPLICATION_PATH "/../library"
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
;connessione al db
resources.db.adapter = pdo_mssql
resources.db.params.host = "IP"
resources.db.params.username = USER
resources.db.params.password = PWD
resources.db.params.dbname = NAME
resources.db.isDefaultTableAdapter = true
resources.db.params.pdoType = dblib
[staging : production]
[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1
;resources.db.adapter = pdo_mssql
我的引導文件如下:
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
public function _initAutoloader(){
Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true);
}
public function _initDb(){
$resource = $this->getPluginResource("db");
$db = $resource->getDbAdapter();
$db->setFetchMode(Zend_Db::FETCH_OBJ);
Zend_Db_Table_Abstract::setDefaultAdapter($db);
Zend_Registry::set("db", $db);
}
}
在我的控制器中我做以下操作(這是當我沒有連接到數據庫工作):
class IndexController extends Zend_Controller_Action
{
public function init()
{
$access_token=$this->getFrontController()->getRequest()->getHeader('Authorization');
if(isset($access_token)){
$access_token = str_replace ("Bearer ", "", $access_token);
$db=Zend_Registry::get("db");
$token= $db->fetchRow("SELECT * FROM dbo.wsoauth2 WHERE atoken='".$access_token."'");
if($token!=false){
//Perform the action required to enter the right app
$link= $db->fetchRow("SELECT * FROM dbo.wsapp WHERE appid='".$token->app_id);
header("Authorization: Bearer ".$access_token);
header("Location: ".$this->getFrontController()->getBaseUrl()."/webservice");
} else {
//Let the other stuff from the controller take place
}
}
}
public function indexAction()
{
$appid = $this->getRequest()->getParam('appid');
$this->view->appid= $appid;
}
}
後嗯,這長碼貼我有錯誤,以顯示給你,這deosn't任何意義,我,但我想象,我是sissing的東西(我不使用Zend框架來來往往米多的時間,所以很明顯,我是):
Fatal error: Uncaught exception 'Zend_Config_Exception' with message 'Section 'development' cannot be found in /usr/local/zend/apache2/htdocs/project/application/configs/application.ini'
一節「發展」是在第一代碼粘貼到您的眼前。所以我很困惑。誰能幫忙?