1

ハローグッドピープル!!

「モジュラーアプローチ」フォルダー構造を使用する Zend Framework 1.11.12 (1.10.8 からアップグレード) に基づく Web アプリケーション (このタイプの最初の) がありますapplication/modules。Doctrine 1.2.4を使用しました

またlibrary、2:CKEditorPGRFilemanager. 管理パネルから画像フォルダーにファイルをアップロードするための pgrfile マネージャー。ここにグローバルに私のファイル構造があります。

/application
    /configs
        application.ini
        routes.ini
    /layouts
        /scripts
            /partials
                  *.all_the_partials_files.phtml
            *.all_the_layouts.phtml
    /modules
         all_the_module_folders
    Boostrap.php
/logs
/library
    /Zend
    /Doctrine
    /SwiftMailer
    /Abra //where all my classes reside
        /Model
            User.php
            Role.php
            other_doctrine_entities_class
/public
    /javascript
    /css
    /images
        .htaccess // added an htaccess file here
    /fonts
    `/ckeditor`
        a_lot_of_files_including_php_files
        other_folders
        /plugins
            other_folders
            `/pgrfilemanager`
                /php
                    auth.php
                myconfig.php
                other_folders_and_files_including_php
    index.php
    .htaccess

このサイトを開発していた時点では、Zend_Acl を使用していなかったので/public/ckeditor/plugins/pgrfilemanager/php/auth.php、pgrfilemanager にはデフォルトの認証機能が付属していたため、session_start() はしばらくの間正常に機能していました。しかし、Zend_Acl の使用を開始すると、ファイルから呼び出されたClass __PHP_Incomplete_Class has no unserializer Arrayときに例外が発生するなどの問題が発生します。私は当初、私が使用していなかったという事実によるものだと思っていましたが、どうやらここで説明されているこの事実によるものだっ たようです (間違っている場合は訂正してください) session_start()~~/auth.phpZend_Session

それの使い方?読んでくれてありがとう

4

1 に答える 1

1

この問題の回避策を見つけたので、共有したいと思いました。より良い見通しが得られるかもしれません。

セッションがセッションに保存されているオブジェクトの定義を知る必要があることを意味する ために、Class __PHP_Incomplete_Class has no unserializer Arrayどの形式にするかをセッションが行うため、これに対する答えは明らかです。unserialize

ファイル構造に基づいて、認証ファイルを作成しました。myauth.phpこの/public/ckeditor/puglins/pgrfilemanager/userfilesパスを参照します。pgr/userdir

$path = realpath("../../../../library");
set_include_path(get_include_path() . PATH_SEPARATOR . $path);

require "Zend/Loader/Autoloader.php";

require_once 'Doctrine/Doctrine.php';
spl_autoload_register(array("Doctrine", "autoload"), true);
$loader = Zend_Loader_Autoloader::getInstance();
$loader->registerNamespace(array("Abra_"));
/*$p seem to be empty throwing error on Zend_Config_Ini but returns the config anyway.I never figured out
*/
$p = realpath("./../../../../application/configs/application.ini"); 
try {
    //     $config = parse_ini_file($p, "production");
    $config = new Zend_Config_Ini($p, "production");
    $conn = Doctrine_Manager::connection($config->doctrine->dsn);
    $user = new Abra_Model_User();
    $role = new Abra_Model_Role();
    $auth = Zend_Auth::getInstance();
    if(!$auth->hasIdentity()|| !in_array($auth->getIdentity()->Role->name,  array("superadmin","administrator")) ){
        die("Not authenticated");
    }
} catch (Exception $ex) {
*/
$p = realpath("./../../../../application/configs/application.ini"); 
try {
    //     $config = parse_ini_file($p, "production");
    $config = new Zend_Config_Ini($p, "production");
    $conn = Doctrine_Manager::connection($config->doctrine->dsn);
    $user = new Abra_Model_User();
    $role = new Abra_Model_Role();
    $auth = Zend_Auth::getInstance();
    if(!$auth->hasIdentity()|| !in_array($auth->getIdentity()->Role->name,  array("superadmin","administrator")) ){
        die("Not authenticated");
    }
} catch (Exception $ex) {

}

}

pgr/php/folders.phppgr/php/files.php私は含めました

$path = realpath("../../../../library");
set_include_path(get_include_path() . PATH_SEPARATOR . $path);

頂点で。次に、以下に示すように含めpgr/userfiles/myauth.phpましpgr/myconfig

include_once dirname(__FILE__) . '/userfiles/myauth.php';

これが誰かを助けることを願っています。ありがとう

于 2012-08-21T07:03:35.487 に答える