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


PHP static::default方法代码示例

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


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

示例1: getDefault

 /**
  * Returns the default logger.
  * 
  * @return LoggerInterface
  */
 public static function getDefault()
 {
     if (empty(static::$default)) {
         static::$default = new NullLogger();
     }
     return static::$default;
 }
开发者ID:rafsalvioni,项目名称:zeus-log,代码行数:12,代码来源:Logger.php

示例2: getCurrent

 /**
  * Returns the instance of default service container
  *
  * @return Services default service container
  */
 public static function getCurrent()
 {
     if (static::$default === null) {
         static::$default = new Services();
     }
     return static::$default;
 }
开发者ID:eserozvataf,项目名称:scabbia2-services,代码行数:12,代码来源:Services.php

示例3: getDefaultLanguage

 /**
  * @return Language
  */
 public static function getDefaultLanguage()
 {
     if (static::$default === null) {
         static::$default = Language::find()->where(['is_default' => 1])->one();
     }
     return static::$default;
 }
开发者ID:tolik505,项目名称:bl,代码行数:10,代码来源:LanguageHelper.php

示例4: let

 function let(ConfigFactoryInterface $configFactory, GeneratorConfigInterface $config)
 {
     static::$default = __DIR__ . "/../../../fixtures";
     static::$config = array('model' => $config);
     $this->beConstructedWith($configFactory);
     $config->generator()->willReturn('Here is the generator');
     $configFactory->create(getcwd(), static::$default, 'json')->willReturn(static::$config);
 }
开发者ID:codesleeve,项目名称:generator,代码行数:8,代码来源:GeneratorFactorySpec.php

示例5: getCurrent

 /**
  * Returns the instance of default formatter
  *
  * @return FormatterInterface default formatter
  */
 public static function getCurrent()
 {
     if (static::$default === null) {
         if (PHP_SAPI === "cli") {
             static::$default = new ConsoleFormatter();
         } else {
             static::$default = new HtmlFormatter();
         }
     }
     return static::$default;
 }
开发者ID:eserozvataf,项目名称:scabbia2-formatters,代码行数:16,代码来源:Formatters.php

示例6: getDefault

 public static function getDefault()
 {
     if (static::$default === null) {
         if (!(static::$default = Language::find()->where(['is_default' => 1])->andWhere(['is_active' => 1])->one())) {
             if (!(static::$default = Language::find()->where(['is_active' => 1])->orderBy('id asc')->one())) {
                 static::$default = new Language();
             }
         }
     }
     return static::$default;
 }
开发者ID:quyettvq,项目名称:luspel,代码行数:11,代码来源:Language.php

示例7: getDefault

 /**
  * @return ListDevises
  */
 public static function getDefault()
 {
     if (is_null(static::$default)) {
         /* @var $doctrine \Doctrine\Bundle\DoctrineBundle\Registry */
         $doctrine = \AppKernel::getStaticContainer()->get('doctrine');
         /* @var $em \Doctrine\ORM\EntityManager */
         $em = $doctrine->getManager();
         static::$default = $em->getRepository('ApplicationSonataClientBundle:ListDevises')->findOneByAlias(static::Device);
     }
     return static::$default;
 }
开发者ID:defan-marunchak,项目名称:eurotax,代码行数:14,代码来源:ListDevises.php

示例8: getDefault

 /**
  * Get default locale
  *
  * @return mixed
  */
 public function getDefault()
 {
     if (null === static::$default) {
         foreach ($this->fetchAll() as $item) {
             if ($item->isDefault()) {
                 static::$default = $item;
                 break;
             }
         }
     }
     return static::$default;
 }
开发者ID:adminarchitect,项目名称:localizer,代码行数:17,代码来源:Provider.php

示例9: __construct

 /**
  * Sets vars by grabbing Cli options
  */
 public function __construct()
 {
     // load config
     \Config::load('migrations', true);
     // get Cli options
     $modules = \Cli::option('modules');
     $packages = \Cli::option('packages');
     $default = \Cli::option('default');
     $all = \Cli::option('all');
     if ($all) {
         $modules = true;
         $packages = true;
         $default = true;
     }
     // if modules option set
     if (!empty($modules)) {
         // if true - get all modules
         if ($modules === true) {
             // loop through module paths
             foreach (\Config::get('module_paths') as $path) {
                 // get all modules that have files in the migration folder
                 foreach (glob($path . '*/') as $m) {
                     if (count(glob($m . \Config::get('migrations.folder') . '/*.php'))) {
                         static::$modules[] = basename($m);
                     }
                 }
             }
         } else {
             static::$modules = explode(',', $modules);
         }
     }
     // if packages option set
     if (!empty($packages)) {
         // if true - get all packages
         if ($packages === true) {
             // get all packages that have files in the migration folder
             foreach (glob(PKGPATH . '*/') as $p) {
                 if (count(glob($p . \Config::get('migrations.folder') . '/*.php'))) {
                     static::$packages[] = basename($p);
                 }
             }
         } else {
             static::$packages = explode(',', $packages);
         }
     }
     if ((!empty($packages) or !empty($modules)) and empty($default)) {
         static::$default = false;
     }
     // set count
     static::$module_count = count(static::$modules);
     static::$package_count = count(static::$packages);
 }
开发者ID:reganhimself,项目名称:KeeleProgrammers,代码行数:55,代码来源:migrate.php

示例10: __construct

 public function __construct($pathname, $namespace = '')
 {
     if (!static::$default) {
         static::$default = $this;
     }
     if (!is_array($config = $this->loadFile($pathname))) {
         throw new Exception("Unable to parse configuration file: {$pathname}");
     }
     if ('' == $namespace) {
         $this->values = array_merge($this->values, $config);
     } else {
         $this->values[$namespace] = $config;
     }
 }
开发者ID:panlatent,项目名称:aurora,代码行数:14,代码来源:FIleConfig.php

示例11: _init

 /**
  * Only load the configuration once
  *
  * @static
  * @access  public
  */
 public static function _init()
 {
     Config::load('hybrid', 'hybrid');
     static::$default = Config::get('hybrid.currency.default', static::$default);
 }
开发者ID:EdgeCommerce,项目名称:edgecommerce,代码行数:11,代码来源:currency.php

示例12: setView

 /**
  * Set the template name
  *
  * @param  string  $view
  */
 public function setView($view)
 {
     static::$default = $view;
 }
开发者ID:ultimateprogramer,项目名称:cms,代码行数:9,代码来源:breadcrumb.php

示例13: __construct

 /**
  * sets the properties by grabbing Cli options
  */
 public function __construct()
 {
     // load config
     \Config::load('migrations', true);
     // get Cli options
     $modules = \Cli::option('modules', \Cli::option('m'));
     $packages = \Cli::option('packages', \Cli::option('p'));
     $default = \Cli::option('default');
     $all = \Cli::option('all');
     if ($all) {
         $modules = true;
         $packages = true;
         $default = true;
     }
     // if modules option set
     if (!empty($modules)) {
         // if true - get all modules
         if ($modules === true) {
             // loop through module paths
             foreach (\Config::get('module_paths') as $path) {
                 // get all modules that have files in the migration folder
                 foreach (new \GlobIterator(realpath($path) . DS . '*') as $m) {
                     if (count(new \GlobIterator($m->getPathname() . rtrim(DS . \Config::get('migrations.folder'), '\\/') . DS . '*.php'))) {
                         static::$modules[] = $m->getBasename();
                     }
                 }
             }
         } else {
             static::$modules = explode(',', $modules);
         }
     }
     // if packages option set
     if (!empty($packages)) {
         // if true - get all packages
         if ($packages === true) {
             // get all packages that have files in the migration folder
             foreach (\Config::get('package_paths', array(PKGPATH)) as $path) {
                 // get all modules that have files in the migration folder
                 foreach (new \GlobIterator(realpath($path) . DS . '*') as $p) {
                     if (count(new \GlobIterator($p->getPathname() . rtrim(DS . \Config::get('migrations.folder'), '\\/') . DS . '*.php'))) {
                         static::$packages[] = $p->getBasename();
                     }
                 }
             }
         } else {
             static::$packages = explode(',', $packages);
         }
     }
     // if packages or modules are specified, and the app isn't, disable app migrations
     if ((!empty($packages) or !empty($modules)) and empty($default)) {
         static::$default = false;
     }
     // set the module and package count
     static::$module_count = count(static::$modules);
     static::$package_count = count(static::$packages);
 }
开发者ID:marietta-adachi,项目名称:website,代码行数:59,代码来源:migrate.php

示例14: _init

 /**
  * Class init.
  */
 public static function _init()
 {
     \Config::load('cart', true);
     static::$default = \Config::get('cart.default');
 }
开发者ID:naldu,项目名称:fuel-cart,代码行数:8,代码来源:cart.php

示例15: setDefault

 public static function setDefault($type)
 {
     static::$default = $type;
 }
开发者ID:robier,项目名称:router,代码行数:4,代码来源:URL.php


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