當前位置: 首頁>>代碼示例>>PHP>>正文


PHP static::app方法代碼示例

本文整理匯總了PHP中static::app方法的典型用法代碼示例。如果您正苦於以下問題:PHP static::app方法的具體用法?PHP static::app怎麽用?PHP static::app使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在static的用法示例。


在下文中一共展示了static::app方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: init

 /** 
  * Main function for initialize this class.
  * @param \Slim\Slim
  */
 public static function init()
 {
     date_default_timezone_set(static::config()->timezone);
     static::$db = static::config()->db;
     static::$user = new \ptejada\uFlex\User();
     static::$app = new \Slim\Slim();
     static::$mail = new \PHPMailer();
     static::$assets = new \Assets();
     static::$user->config->database->host = static::config()->db['server'];
     static::$user->config->database->user = static::config()->db['username'];
     static::$user->config->database->password = static::config()->db['password'];
     static::$user->config->database->name = static::config()->db['database_name'];
     static::$user->start();
     require 'app/config/mail.php';
     static::$mail->isSMTP();
     static::$mail->Host = $mail['Host'];
     static::$mail->SMTPAuth = $mail['SMTPAuth'];
     static::$mail->Username = $mail['Username'];
     static::$mail->Password = $mail['Password'];
     static::$mail->SMTPSecure = $mail['SMTPSecure'];
     static::$mail->Port = $mail['Port'];
     static::$mail->From = $mail['From'];
     static::$mail->FromName = $mail['FromName'];
     static::$mail->isHTML(true);
 }
開發者ID:mgilangjanuar,項目名稱:slimedoo,代碼行數:29,代碼來源:App.php

示例2: app

 /**
  * @return App Return a single instance of App
  */
 public static function app()
 {
     if (static::$app === null) {
         static::$app = new App(static::$configFile);
     }
     return static::$app;
 }
開發者ID:sinaru,項目名稱:lp-test,代碼行數:10,代碼來源:main.php

示例3: getFacadeAccessor

 /**
  * Get the registered name of the component.
  *
  * @return string
  */
 protected static function getFacadeAccessor()
 {
     if (!static::$app) {
         static::$app = TruckerServiceProvider::make();
     }
     return 'trucker.model';
 }
開發者ID:summer11123,項目名稱:trucker,代碼行數:12,代碼來源:Trucker.php

示例4: getFacadeAccessor

 /**
  * Retrieve Illuminage from the Container
  *
  * @return string
  */
 public static function getFacadeAccessor()
 {
     if (!static::$app) {
         static::$app = IlluminageServiceProvider::make();
     }
     return 'illuminage';
 }
開發者ID:anahkiasen,項目名稱:illuminage,代碼行數:12,代碼來源:Illuminage.php

示例5: getInstance

 /**
  * @param Config $config
  *
  * @return Application
  */
 public static function getInstance(Config $config)
 {
     if (static::$app === null) {
         static::$app = new static($config);
     }
     return static::$app;
 }
開發者ID:Oxyaction,項目名稱:salary-calendar,代碼行數:12,代碼來源:Application.php

示例6: instance

 /**
  * Get the Application Instance
  * @return Kernel
  */
 public static function instance()
 {
     if (!static::$app instanceof Kernel) {
         static::$app = new Kernel();
     }
     return static::$app;
 }
開發者ID:joshbrw,項目名稱:rss.manager,代碼行數:11,代碼來源:Kernel.php

示例7: __construct

 /**
  * Create a new CabinetUpload instance.
  */
 public function __construct(array $attributes = array())
 {
     parent::__construct($attributes);
     if (!static::$app) {
         static::$app = app();
     }
 }
開發者ID:andrewelkins,項目名稱:cabinet,代碼行數:10,代碼來源:CabinetUpload.php

示例8: getFacadeAccessor

 /**
  * Get the registered name of the component.
  *
  * @return string
  */
 protected static function getFacadeAccessor()
 {
     if (!static::$app) {
         static::$app = AcetoneServiceProvider::make();
     }
     return 'acetone.acetone';
 }
開發者ID:anahkiasen,項目名稱:acetone,代碼行數:12,代碼來源:Acetone.php

示例9: getFacadeAccessor

 /**
  * Get the registered name of the component.
  *
  * @return string
  */
 protected static function getFacadeAccessor()
 {
     if (!static::$app) {
         static::$app = RocketeerServiceProvider::make();
     }
     return static::$accessor;
 }
開發者ID:denji,項目名稱:rocketeer,代碼行數:12,代碼來源:StandaloneFacade.php

示例10: app

 /**
  * @return SeviceLocator
  */
 public static function app()
 {
     if (empty(static::$app)) {
         static::$app = new SeviceLocator(static::$config);
     }
     return static::$app;
 }
開發者ID:visionp,項目名稱:TestFramework,代碼行數:10,代碼來源:Application.php

示例11: getSlimApp

 public static function getSlimApp()
 {
     if (!isset(static::$app)) {
         static::$app = $GLOBALS['app'];
     }
     return static::$app;
 }
開發者ID:joshjim27,項目名稱:jobsglobal-api,代碼行數:7,代碼來源:Factory.php

示例12: getFacadeAccessor

 /**
  * Get the registered component.
  *
  * @return string
  */
 protected static function getFacadeAccessor()
 {
     if (!static::$app) {
         static::$app = FormerServiceProvider::make();
     }
     return 'former';
 }
開發者ID:autocar,項目名稱:former,代碼行數:12,代碼來源:Former.php

示例13: __construct

 /**
  * App constructor
  */
 public function __construct()
 {
     if (empty(static::$app)) {
         static::$app = $this;
     }
     $this->setTimezone()->setErrorHandler()->addRegistry()->factory();
 }
開發者ID:Emericanec,項目名稱:avenue,代碼行數:10,代碼來源:App.php

示例14: __construct

 /**
  * Create a new Notification instance.
  *
  * @param Twig_Template $template The Twig template object to use to create this notification.
  * @todo Allow other content sources (string, database, etc)
  */
 public function __construct($template)
 {
     $this->template = $template;
     if (!static::$app) {
         static::$app = UserFrosting::getInstance();
     }
 }
開發者ID:Odinthewanderer,項目名稱:UserFrosting,代碼行數:13,代碼來源:Notification.php

示例15: app

 /**
  * Returns singleton app.
  */
 public function app()
 {
     if (!isset(static::$app)) {
         static::$app = new static();
     }
     return static::$app;
 }
開發者ID:artfulrobot,項目名稱:styler,代碼行數:10,代碼來源:index.php


注:本文中的static::app方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。