Проблема Zend Framework с автозагрузчиком - PullRequest
0 голосов
/ 03 марта 2010

это все в index.php

/* Define site root */
defined('DOCUMENT_ROOT') ? null : define('DOCUMENT_ROOT',realpath(dirname(__FILE__)));
defined('SITE_ROOT') ? null : define('SITE_ROOT',realpath(dirname(DOCUMENT_ROOT.'../')));


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


$includePath[] = '.';
$includePath[] = SITE_ROOT . '/library';
$includePath[] = get_include_path();
$includePath = implode(PATH_SEPARATOR,$includePath);
set_include_path($includePath);

require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance();

 /* Adding action helpers path */
 Zend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH . '/controllers/helpers','Helper');

 $application->bootstrap()
    ->run();

Получение этой ошибки и многое другое с неправильными путями к связанным помощникам ZF, что не так?

/ * Настройка пути и префикса декораторов для формы и ее элементов / $ form-> addElementPrefixPath ('Form', SITE_ROOT. '/ library / form / decorators', 'decorator'); // префикс, путь, тип / Настройка дополнительных валидаторов * / $ form-> addElementPrefixPath ('Form', SITE_ROOT. '/ library / form / validators', 'validate'); // prefi, path, type

 [2] fopen(/var/www/vhosts/blabla.com/httpdocs/application/controllers/helpers/ViewRenderer.php) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory 
  in file: /var/www/vhosts/blabla.com/httpdocs/library/Zend/Loader.php 
  on line: 165 
  [2] fopen(/var/www/vhosts/blabla.com/httpdocs/library/form/validators/NotEmpty.php) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory 
  in file: /var/www/vhosts/blabla.com/httpdocs/library/Zend/Loader.php 
  on line: 165 
  [2] fopen(/var/www/vhosts/blabla.com/httpdocs/library/form/validators/InArray.php) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory 
  in file: /var/www/vhosts/blabla.com/httpdocs/library/Zend/Loader.php 
  on line: 165 
  [2] fopen(/var/www/vhosts/blabla.com/httpdocs/library/form/validators/NotEmpty.php) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory 
  in file: /var/www/vhosts/blabla.com/httpdocs/library/Zend/Loader.php 
  on line: 165 
  [2] fopen(/var/www/vhosts/blabla.com/httpdocs/library/form/validators/InArray.php) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory 
  in file: /var/www/vhosts/blabla.com/httpdocs/library/Zend/Loader.php 
  on line: 165 
  [2] fopen(/var/www/vhosts/blabla.com/httpdocs/library/form/validators/InArray.php) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory 
  in file: /var/www/vhosts/blabla.com/httpdocs/library/Zend/Loader.php 
  on line: 165 
  [2] fopen(/var/www/vhosts/blabla.com/httpdocs/library/form/validators/NotEmpty.php) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory 
  in file: /var/www/vhosts/blabla.com/httpdocs/library/Zend/Loader.php 
  on line: 165 
  [2] fopen(/var/www/vhosts/blabla.com/httpdocs/library/form/validators/NotEmpty.php) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory 
  in file: /var/www/vhosts/blabla.com/httpdocs/library/Zend/Loader.php 
  on line: 165 
  [2] fopen(/var/www/vhosts/blabla.com/httpdocs/library/form/validators/InArray.php) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory 
  in file: /var/www/vhosts/blabla.com/httpdocs/library/Zend/Loader.php 
  on line: 165 
  [2] fopen(/var/www/vhosts/blabla.com/httpdocs/library/form/validators/NotEmpty.php) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory 
  in file: /var/www/vhosts/blabla.com/httpdocs/library/Zend/Loader.php 
  on line: 165 
  [2] fopen(/var/www/vhosts/blabla.com/httpdocs/library/form/validators/NotEmpty.php) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory 
  in file: /var/www/vhosts/blabla.com/httpdocs/library/Zend/Loader.php 
  on line: 165 

Комплектация с валидаторами ZF находится здесь:

library / Zend / Validate / InArray.php, например

Что не так с автозагрузчиком?

1 Ответ

1 голос
/ 04 марта 2010

Удалите realpath из defines и отладьте пути, которые вы определили правильно.

Это кажется зашитым:

realpath(dirname(DOCUMENT_ROOT.'../'));

не должно быть:

realpath(dirname(dirname(DOCUMENT_ROOT)')));

или:

realpath(dirname(('/../'.DOCUMENT_ROOT)'));

Кроме того, дважды проверьте права доступа к файлу.

...