当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Registry::setClassName方法代码示例

本文整理汇总了PHP中Zend_Registry::setClassName方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Registry::setClassName方法的具体用法?PHP Zend_Registry::setClassName怎么用?PHP Zend_Registry::setClassName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Registry的用法示例。


在下文中一共展示了Zend_Registry::setClassName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: minimalBootstrap

 public static function minimalBootstrap()
 {
     if (!defined('VENDOR_PATH')) {
         define('VENDOR_PATH', 'vendor');
     }
     if (VENDOR_PATH == '../vendor') {
         $kwfPath = '..';
     } else {
         $kwfPath = VENDOR_PATH . '/koala-framework/koala-framework';
     }
     if (!defined('KWF_PATH')) {
         define('KWF_PATH', $kwfPath);
     }
     //reset include path, don't use anything from php.ini
     set_include_path('.' . PATH_SEPARATOR . $kwfPath . PATH_SEPARATOR . self::_getZendPath());
     require_once $kwfPath . '/Kwf/Loader.php';
     Kwf_Loader::registerAutoload();
     Zend_Registry::setClassName('Kwf_Registry');
     $configSection = call_user_func(array(Kwf_Setup::$configClass, 'getDefaultConfigSection'));
     Kwf_Setup::$configSection = $configSection;
     error_reporting(E_ALL ^ E_STRICT);
     class_exists('Kwf_Trl');
     //trigger autoload
     umask(00);
     //nicht 002 weil wwwrun und kwcms in unterschiedlichen gruppen
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:26,代码来源:Setup.php

示例2: setup

 public static function setup()
 {
     require_once KWF_PATH . '/Kwf/Loader.php';
     require_once KWF_PATH . '/Kwf/Setup.php';
     Kwf_Loader::registerAutoload();
     date_default_timezone_set('Europe/Berlin');
     mb_internal_encoding('UTF-8');
     Zend_Registry::setClassName('Kwf_Registry');
     // auskommentiert, da main() sowieso nicht aufgerufen wird
     //         require_once KWF_PATH.'/tests/TestConfiguration.php';
     require_once 'PHPUnit/Framework/TestSuite.php';
     require_once 'PHPUnit/TextUI/TestRunner.php';
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:13,代码来源:Test.php

示例3: testRegistryExceptionClassNotFound

 public function testRegistryExceptionClassNotFound()
 {
     try {
         $registry = @Zend_Registry::setClassName('classdoesnotexist');
         $this->fail('Expected exception, because we cannot initialize the registry using a non-existent class.');
     } catch (Zend_Exception $e) {
         $this->assertRegExp('/file .* does not exist or .*/i', $e->getMessage());
     }
 }
开发者ID:jsnshrmn,项目名称:Suma,代码行数:9,代码来源:RegistryTest.php

示例4: initRegistry

 /**
  * Initialize the registry. Invoking this method more than once will generate an exception.
  *
  * @param mixed $registry - Either a name of the registry class (Zend_Registry, or a subclass)
  *                          or an instance of Zend_Registry (or subclass)
  * @return Zend_Registry
  *
  * @deprecated Since 0.9.0 -- Use Zend_Registry::setClassName() instead.
  */
 public static function initRegistry($registry = 'Zend_Registry')
 {
     trigger_error(__CLASS__ . "::" . __FUNCTION__ . " deprecated since 0.9.0, use Zend_Registry::setClassName() instead");
     require_once 'Zend/Registry.php';
     Zend_Registry::setClassName($registry);
     return Zend_Registry::getInstance();
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:16,代码来源:Zend.php

示例5: testRegistryExceptionClassNotFound

 public function testRegistryExceptionClassNotFound()
 {
     try {
         $registry = Zend_Registry::setClassName('classdoesnotexist');
         $this->fail('Expected exception, because we cannot initialize the registry using a non-existent class.');
     } catch (Zend_Exception $e) {
         $this->assertTrue(is_array($e->includeErrors));
         $this->assertEquals(2, count($e->includeErrors));
         $this->assertRegExp('/failed to open stream: No such file/i', $e->includeErrors[0]->errstr);
         $this->assertRegExp('/Failed opening \'classdoesnotexist\.php\'/i', $e->includeErrors[1]->errstr);
     }
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:12,代码来源:RegistryTest.php

示例6: testRegistryExceptionClassNotFound

 public function testRegistryExceptionClassNotFound()
 {
     try {
         $registry = Zend_Registry::setClassName('classdoesnotexist');
         $this->fail('Expected exception, because we cannot initialize the registry using a non-existent class.');
     } catch (Zend_Exception $e) {
         $this->assertContains('File "classdoesnotexist.php" was not found', $e->getMessage());
     }
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:9,代码来源:RegistryTest.php

示例7: offsetExists

                                $v = Kwf_Trl::getInstance();
                                $this->offsetSet('trl', $v);
                                return $v;
                            }
                        }
                    }
                }
            }
        }
        return parent::offsetGet($index);
    }
    public function offsetExists($index)
    {
        if (in_array($index, array('db', 'config', 'dao', 'acl', 'userModel', 'trl'))) {
            return true;
        }
        return parent::offsetExists($index);
    }
    public function offsetUnset($index)
    {
        if (in_array($index, array('db', 'dao', 'userModel'))) {
            if (!parent::offsetExists($index)) {
                //not yet set, ignore
                return;
            }
        }
        return parent::offsetUnset($index);
    }
}
Zend_Registry::setClassName('Kwf_Registry');
开发者ID:koala-framework,项目名称:koala-framework,代码行数:30,代码来源:Registry.php

示例8: setClassName

 /**
  * Set the class name to use for the default registry instance.
  * Does not affect the currently initialized instance, it only applies
  * for the next time you instantiate.
  *
  * @param string $registryClassName
  * @return void
  * @throws Zend_Exception if the registry is initialized or if the
  *   class name is not valid.
  */
 public static function setClassName($registryClassName = 'Engine_Registry')
 {
     if (self::$_registry !== null) {
         // require_once 'Zend/Exception.php';
         throw new Zend_Exception('Registry is already initialized');
     }
     if (!is_string($registryClassName)) {
         // require_once 'Zend/Exception.php';
         throw new Zend_Exception("Argument is not a class name");
     }
     /**
      * @see Zend_Loader
      */
     if (!class_exists($registryClassName)) {
         Engine_Loader::loadClass($registryClassName);
     }
     parent::setClassName($registryClassName);
     self::$_registryClassName = $registryClassName;
 }
开发者ID:febryantosulistyo,项目名称:ClassicSocial,代码行数:29,代码来源:Registry.php


注:本文中的Zend_Registry::setClassName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。