本文整理汇总了PHP中Zend_Loader_Autoloader::registerNamespace方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Loader_Autoloader::registerNamespace方法的具体用法?PHP Zend_Loader_Autoloader::registerNamespace怎么用?PHP Zend_Loader_Autoloader::registerNamespace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Loader_Autoloader
的用法示例。
在下文中一共展示了Zend_Loader_Autoloader::registerNamespace方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
protected function setUp()
{
$this->classLoader = Zend_Loader_Autoloader::getInstance();
$this->classLoader->registerNamespace('Doctrine_');
if (!class_exists('Doctrine_Manager')) {
$this->markTestSkipped('Doctrine 1.2.x installation not found in include_path');
}
// create in memory connection
Doctrine_Manager::connection("sqlite::memory:", 'doctrine');
}
示例2: setUp
protected function setUp()
{
$this->classLoader = Zend_Loader_Autoloader::getInstance();
$this->classLoader->registerNamespace('Doctrine_');
if (!class_exists('Doctrine_Manager')) {
$this->markTestSkipped('Doctrine 1.2.x installation not found in include_path');
}
// create in memory connection
Doctrine_Manager::connection("sqlite::memory:", 'doctrine');
// create tables for account model
Doctrine_Core::createTablesFromModels(dirname(__FILE__) . "/_files/models/");
}
示例3: __construct
/**
* Constructor
*
* Initialize application. Potentially initializes include_paths, PHP
* settings, and bootstrap class.
*
* @param string $environment
* @param string|array|Zend_Config $options String path to configuration file, or array/Zend_Config of configuration options
* @param bool $suppressNotFoundWarnings Should warnings be suppressed when a file is not found during autoloading?
* @throws Zend_Application_Exception When invalid options are provided
* @return void
*/
public function __construct($environment, $options = null, $suppressNotFoundWarnings = null)
{
$this->_environment = (string) $environment;
require_once 'Zend/Loader/Autoloader.php';
$this->_autoloader = Zend_Loader_Autoloader::getInstance();
// instancja autoloader'a
$this->_autoloader->suppressNotFoundWarnings($suppressNotFoundWarnings);
//
$this->_autoloader->registerNamespace('Common_');
//
if (null !== $options) {
if (is_string($options)) {
$options = $this->_loadConfig($options);
} elseif ($options instanceof Zend_Config) {
$options = $options->toArray();
} elseif (!is_array($options)) {
throw new Zend_Application_Exception('Invalid options provided; must be location of config file,' . ' a config object, or an array');
}
$this->setOptions($options);
}
}