當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。