本文整理汇总了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);
}
示例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;
}
示例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';
}
示例4: getFacadeAccessor
/**
* Retrieve Illuminage from the Container
*
* @return string
*/
public static function getFacadeAccessor()
{
if (!static::$app) {
static::$app = IlluminageServiceProvider::make();
}
return 'illuminage';
}
示例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;
}
示例6: instance
/**
* Get the Application Instance
* @return Kernel
*/
public static function instance()
{
if (!static::$app instanceof Kernel) {
static::$app = new Kernel();
}
return static::$app;
}
示例7: __construct
/**
* Create a new CabinetUpload instance.
*/
public function __construct(array $attributes = array())
{
parent::__construct($attributes);
if (!static::$app) {
static::$app = app();
}
}
示例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';
}
示例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;
}
示例10: app
/**
* @return SeviceLocator
*/
public static function app()
{
if (empty(static::$app)) {
static::$app = new SeviceLocator(static::$config);
}
return static::$app;
}
示例11: getSlimApp
public static function getSlimApp()
{
if (!isset(static::$app)) {
static::$app = $GLOBALS['app'];
}
return static::$app;
}
示例12: getFacadeAccessor
/**
* Get the registered component.
*
* @return string
*/
protected static function getFacadeAccessor()
{
if (!static::$app) {
static::$app = FormerServiceProvider::make();
}
return 'former';
}
示例13: __construct
/**
* App constructor
*/
public function __construct()
{
if (empty(static::$app)) {
static::$app = $this;
}
$this->setTimezone()->setErrorHandler()->addRegistry()->factory();
}
示例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();
}
}
示例15: app
/**
* Returns singleton app.
*/
public function app()
{
if (!isset(static::$app)) {
static::$app = new static();
}
return static::$app;
}