Eğer yukarıda belirtildiği gibi Zend eklentisini etkinleştirme yapmak istediğiniz ZF sınıflar dahil alakalı değildir. ZF indirin ve bir yerde henüz mevcut değil eğer public_html
klasörü içinde istediğiniz yere yükleyin. set_include_path()
ve gidin kullanın! Aşağıdaki örnek kod:
<?php
// Define relative path to ZendFramework in public_html
define('ZF_PATH', '/../../../lib/php/zendframework');
// Define path to application directory
defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
// Define real path to ZendFramework if it's not yet included in include_path
if(!strpos(get_include_path(), 'zendframework'))
define('ZF_REAL_PATH', realpath(APPLICATION_PATH . ZF_PATH));
else define('ZF_REAL_PATH', '');
// Updating include_path
set_include_path(implode(PATH_SEPARATOR, array(ZF_REAL_PATH, get_include_path(),)));
// Done! the rest of the code might be unnecessary in your case.
require 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
$application->bootstrap()->run();
Bu yolu eklemek için bir dizin ekleme durum için biraz karmaşık görünebilir ama ZF uygulamalar kullanmak en yaygın yolu, sanırım.