本文整理汇总了PHP中Bundle::started方法的典型用法代码示例。如果您正苦于以下问题:PHP Bundle::started方法的具体用法?PHP Bundle::started怎么用?PHP Bundle::started使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bundle
的用法示例。
在下文中一共展示了Bundle::started方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
/**
* Destroy the testing environment.
*/
public function tearDown()
{
Bundle::$started = array();
Bundle::$routed = array();
Router::$names = array();
Router::$routes = array();
}
示例2: overrideHTMLki
function overrideHTMLki($path, $overrides)
{
$override = function () use($path, $overrides) {
$overrides = arrize($overrides, 'ns');
if (!empty($overrides['ns'])) {
$overrides += array('compiledHeader' => "<?namespace {$overrides['ns']}?>\n", 'evalPrefix' => "namespace {$overrides['ns']};\n");
}
\overrideHTMLki($path, $overrides);
};
if (\Bundle::started('htmlki')) {
$override();
} else {
\Event::listen('laravel.started: htmlki', $override);
}
}
示例3: load
/**
* Load the file corresponding to a given class.
*
* This method is registerd in the bootstrap file as an SPL auto-loader.
*
* @param string $class
* @return void
*/
public static function load($class)
{
// First, we will check to see if the class has been aliased. If it has,
// we will register the alias, which may cause the auto-loader to be
// called again for the "real" class name.
if (isset(static::$aliases[$class])) {
class_alias(static::$aliases[$class], $class);
} elseif (isset(static::$mappings[$class])) {
require static::$mappings[$class];
}
// If the class namespace is mapped to a directory, we will load the
// class using the PSR-0 standards from that directory; however, we
// will trim off the beginning of the namespace to account for
// the root of the mapped directory.
if (!is_null($info = static::namespaced($class))) {
$class = substr($class, strlen($info['namespace']));
return static::load_psr($class, $info['directory']);
} elseif (($slash = strpos($class, '\\')) !== false) {
$namespace = substr($class, 0, $slash);
// If the class is namespaced to an existing bundle and the bundle has
// not been started, we will start the bundle and attempt to load the
// class file again. If that fails, an error will be thrown by PHP.
//
// This allows bundle classes to be loaded by the auto-loader before
// their class mappings have actually been registered; however, it
// is up to the bundle developer to namespace their classes to
// match the name of their bundle.
if (Bundle::exists($namespace) and !Bundle::started($namespace)) {
Bundle::start(strtolower($namespace));
static::load($class);
}
}
// If the class is not maped and is not part of a bundle or a mapped
// namespace, we'll make a last ditch effort to load the class via
// the PSR-0 from one of the registered directories.
static::load_psr($class);
}
示例4: testStartActivated
/**
* Test if the activated bundle above is started.
*
* @return null
*/
public function testStartActivated()
{
$this->assertFalse(count(iBundle::register()) <= 0);
$this->assertTrue(Bundle::started('docs'));
}
示例5: testStartedMethodIndicatesIfBundleIsStarted
/**
* Test the Bundle::started method.
*
* @group laravel
*/
public function testStartedMethodIndicatesIfBundleIsStarted()
{
Bundle::register('dummy');
Bundle::start('dummy');
$this->assertTrue(Bundle::started('dummy'));
}