Cant zend yükleyici sadece wamp altında sınıflarını yüklemek için olsun

3 Cevap php

I'm trying out the zend framework classes for the first time. I am interested in using some of the individual classes for now. Reading the documentation and some other q's here and in blogs I've tried three ways to load the classes

    //attempt 1 - using zend loader
require_once('library\Zend\Loader.php');
Zend_Loader::loadClass('Zend_Date');

    //attempt 2 - direct class load
require_once('library\Zend\Date.php');

    // attempt 3 - auto load
set_include_path('D:\wamp\www\testPages\zend_test\library\Zend' . PATH_SEPARATOR . get_include_path());
require_once 'Loader\Autoloader.php';


$date = new Zend_Date();

// Output of the desired date
print $date->get();

benim klasör yapısı:

  • zend_test(folder)
    -- testLoad.php (the above code lives there)
    -- library(folder)
    --- zend(doler)
    ---- (the zend libs and sub folders)

I get the following error messages: attempt 1

Warning: include(Zend\Date.php) [function.include]: failed to open stream: No such file or directory in D:\wamp\www\testPages\zend_test\library\Zend\Loader.php on line 83

Warning: include() [function.include]: Failed opening 'Zend\Date.php' for inclusion (include_path='.;C:\php5\pear') in D:\wamp\www\testPages\zend_test\library\Zend\Loader.php on line 83

Warning: require_once(Zend/Exception.php) [function.require-once]: failed to open stream: No such file or directory in D:\wamp\www\testPages\zend_test\library\Zend\Loader.php on line 87

Fatal error: require_once() [function.require]: Failed opening required 'Zend/Exception.php' (include_path='.;C:\php5\pear') in D:\wamp\www\testPages\zend_test\library\Zend\Loader.php on line 87

attempt2

Warning: require_once(Zend/Date/DateObject.php) [function.require-once]: failed to open stream: No such file or directory in D:\wamp\www\testPages\zend_test\library\Zend\Date.php on line 25

Fatal error: require_once() [function.require]: Failed opening required 'Zend/Date/DateObject.php' (include_path='.;C:\php5\pear') in D:\wamp\www\testPages\zend_test\library\Zend\Date.php on line 25

atempt3

Warning: require_once(Zend/Loader.php) [function.require-once]: failed to open stream: No such file or directory in D:\wamp\www\testPages\zend_test\library\Zend\Loader\Autoloader.php on line 24
Fatal error: require_once() [function.require]: Failed opening required 'Zend/Loader.php' (include_path='D:\wamp\www\testPages\zend_test\library\Zend;.;C:\php5\pear') in D:\wamp\www\testPages\zend_test\library\Zend\Loader\Autoloader.php on line 24

Ben bir şey eksik?

3 Cevap

Sizin yol okumalısınız şunlardır:

include_path='D:\wamp\www\testPages\zend_test\library;.;C:\php5\pear

O dahil yolunda Zend adlı bir klasörde arar Zend_Date içinde Date.php adında bir dosya ile, sınıf yüklemeye çalıştığında.

Lütfen yöntemlerin tümü 3 bu düzeltilmiş birlikte çalışması gerekir, ve ben girişimi 3 öneririz.

php.ini kaldırmak ";" hat include_pathdaki önce ve WAMP yeniden başlatın!

Bu da kullanılan yöntem 3 ve çalışma olsun ki:

set_include_path('D:/wamp/www/zendTest/library/');   
require_once 'Zend/Loader/Autoloader.php';

Zend_Loader::loadClass('Zend_Date'); //or whatever zen class