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


PHP Bundle::names方法代码示例

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


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

示例1: outstanding

 /**
  * Resolve all of the outstanding migrations for a bundle.
  *
  * @param  string  $bundle
  * @return array
  */
 public function outstanding($bundle = null)
 {
     $migrations = array();
     // If no bundle was given to the command, we'll grab every bundle for
     // the application, including the "application" bundle, which is not
     // returned by "all" method on the Bundle class.
     if (is_null($bundle)) {
         $bundles = array_merge(Bundle::names(), array('application'));
     } else {
         $bundles = array($bundle);
     }
     foreach ($bundles as $bundle) {
         // First we need to grab all of the migrations that have already
         // run for this bundle, as well as all of the migration files
         // for the bundle. Once we have these, we can determine which
         // migrations are still outstanding.
         $ran = $this->database->ran($bundle);
         $files = $this->migrations($bundle);
         // To find outstanding migrations, we will simply iterate over
         // the migration files and add the files that do not exist in
         // the array of ran migrations to the outstanding array.
         foreach ($files as $key => $name) {
             if (!in_array($name, $ran)) {
                 $migrations[] = compact('bundle', 'name');
             }
         }
     }
     return $this->resolve($migrations);
 }
开发者ID:gilyaev,项目名称:framework-bench,代码行数:35,代码来源:resolver.php

示例2: bundle

 /**
  * Generate documentation for a given bundles.  If no bundles are provided
  * documentation will be generated for all registered bundles.
  * 
  * @param  array  $bundles
  * @return void
  */
 public function bundle(array $bundles = array())
 {
     // If no bundles are provided documentation will be generated for all
     // registered bundles.
     if (count($bundles) === 0) {
         $bundles = Bundle::names();
     }
     // Remove any bundles that have not been registered, and give a
     // warning for each one we come across.
     $bundles = array_filter($bundles, function ($name) {
         if (!Bundle::exists($name)) {
             if ($name == DEFAULT_BUNDLE) {
                 return true;
             }
             echo "Bundle [{$name}] is not registered.", PHP_EOL;
             return false;
         }
         return true;
     });
     // If there are no registered bundles then exit with a message
     if (count($bundles) === 0) {
         echo PHP_EOL, "Please register your bundles and try again.", PHP_EOL;
         return;
     }
     // Get the options
     $options = $this->config(array_map(array('Bundle', 'path'), $bundles));
     // Run ApiGen
     $this->apigen($options);
 }
开发者ID:reith2004,项目名称:components,代码行数:36,代码来源:make.php

示例3: bundle

 /**
  * Run the tests for a given bundle.
  *
  * @param  array  $bundles
  * @return void
  */
 public function bundle($bundles = array())
 {
     if (count($bundles) == 0) {
         $bundles = Bundle::names();
     }
     foreach ($bundles as $bundle) {
         // To run PHPUnit for the application, bundles, and the framework
         // from one task, we'll dynamically stub PHPUnit.xml files via
         // the task and point the test suite to the correct directory
         // based on what was requested.
         if (is_dir($path = Bundle::path($bundle) . 'tests')) {
             $this->stub($path);
             $this->test();
         }
     }
 }
开发者ID:perryhau,项目名称:Laravel-1,代码行数:22,代码来源:runner.php

示例4: find

 /**
  * Find a route by the route's assigned name.
  *
  * @param  string  $name
  * @return array
  */
 public static function find($name)
 {
     if (isset(static::$names[$name])) {
         return static::$names[$name];
     }
     // If no route names have been found at all, we will assume no reverse
     // routing has been done, and we will load the routes file for all of
     // the bundles that are installed for the application.
     if (count(static::$names) == 0) {
         foreach (Bundle::names() as $bundle) {
             Bundle::routes($bundle);
         }
     }
     // To find a named route, we will iterate through every route defined
     // for the application. We will cache the routes by name so we can
     // load them very quickly the next time.
     foreach (static::routes() as $method => $routes) {
         foreach ($routes as $key => $value) {
             if (isset($value['as']) and $value['as'] === $name) {
                 return static::$names[$name] = array($key => $value);
             }
         }
     }
 }
开发者ID:shawon922,项目名称:LaravelBackboneTodoMVC,代码行数:30,代码来源:router.php

示例5: publish

 /**
  * Publish bundle assets to the public directory.
  *
  * @param  array  $bundles
  * @return void
  */
 public function publish($bundles)
 {
     if (count($bundles) == 0) {
         $bundles = Bundle::names();
     }
     array_walk($bundles, array(IoC::resolve('bundle.publisher'), 'publish'));
 }
开发者ID:richthegeek,项目名称:laravel,代码行数:13,代码来源:bundler.php

示例6: find

 public static function find($name)
 {
     if (isset(static::$names[$name])) {
         return static::$names[$name];
     }
     if (count(static::$names) == 0) {
         foreach (Bundle::names() as $bundle) {
             Bundle::routes($bundle);
         }
     }
     foreach (static::routes() as $method => $routes) {
         foreach ($routes as $key => $value) {
             if (isset($value['as']) and $value['as'] === $name) {
                 return static::$names[$name] = array($key => $value);
             }
         }
     }
 }
开发者ID:laravelbook,项目名称:framework3,代码行数:18,代码来源:laravel_lite.php


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