ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 9622


Ignore:
Timestamp:
Dec 22, 2008, 2:17:31 PM (11 years ago)
Author:
ebihara
Message:

#3221:added sfOpenPNEApplicationConfiguration::registerZend() to register the Zend autoloader (c.f. The Definitive Guide to symfony - Chapter 17, The Jobeet Tutorial Day 16)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/lib/config/sfOpenPNEApplicationConfiguration.class.php

    r9609 r9622  
    1010abstract class sfOpenPNEApplicationConfiguration extends sfApplicationConfiguration
    1111{
     12  static protected $zendLoaded = false;
     13
    1214  public function initialize()
    1315  {
     
    240242    include($this->getConfigCache()->checkConfig('config/community_config.yml'));
    241243  }
     244
     245  static public function registerZend()
     246  {
     247    if (self::$zendLoaded)
     248    {
     249      return true;
     250    }
     251
     252    $DS = DIRECTORY_SEPARATOR;  // Alias
     253    $zendPath = sfConfig::get('sf_lib_dir').$DS.'vendor'.$DS.'Zend'.$DS;  // ##PROJECT_LIB_DIR##/vendor/Zend/
     254
     255    set_include_path($zendPath.PATH_SEPARATOR.get_include_path());
     256    require_once 'Loader.php';
     257    Zend_Loader::registerAutoLoad();
     258    self::$zendLoaded = true;
     259  }
    242260}
Note: See TracChangeset for help on using the changeset viewer.