0
我將Zend框架1.12這是我必須把這個腳本每個路由之前採取庫庫時的一個問題:與Zend的路徑問題1.12
require_once Zend_Registry::get('lib_dir')."....
有辦法使它更容易?,因爲很多文件要修改。問候和感謝提前!
我的結構如下:
>Auth
>application
>configs
>controllers
>forms
>models
>views
>Bootstrap.php
>docs
>library
>lib
>Google
>Auth
>Cache
>Client.php
......
在我的 'UserController的' 我有以下幾點:
require_once(__DIR__.'/lib/Google/Client.php');
Zend_Loader_Autoloader::getInstance();
$client_id = '1255128545685269859856666.apps.googleusercontent.com';
$client_secret = 'sadFGHDMsdfgh-42552';
$redirect_uri = 'http://localhost/auth/public/user/login';
$client = new Google_Client();
$client->setApplicationName("Procesos");
$client->setClientId($client_id);
$client->setClientSecret($client_secret);
$client->setRedirectUri($redirect_uri);
$client->addScope("https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile"); /* Datos Gmail y Google+ */
在我 '的bootstrap.php' 我有以下幾點:
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initAutoload() {
$loader = Zend_Loader_Autoloader::getInstance();
$loader->registerNamespace('lib_');
}
}
Application.ini
includePaths.library = APPLICATION_PATH "/../library"
autoloaderNamespaces[] = "lib_"
你能解釋一下你的項目結構嗎?你用你引用的那一行來編輯哪些文件? –
Hello @Thomas,感謝您的快速回復,您可以查看我的更新... – user3680708