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


PHP Repository::setEventDispatcher方法代碼示例

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


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

示例1: repository

 /**
  * Create a new cache repository with the given implementation.
  *
  * @param  \Illuminate\Contracts\Cache\Store  $store
  * @return \Illuminate\Cache\Repository
  */
 public function repository(Store $store)
 {
     $repository = new Repository($store);
     if ($this->app->bound('Illuminate\\Contracts\\Events\\Dispatcher')) {
         $repository->setEventDispatcher($this->app['Illuminate\\Contracts\\Events\\Dispatcher']);
     }
     return $repository;
 }
開發者ID:davidhemphill,項目名稱:framework,代碼行數:14,代碼來源:CacheManager.php

示例2: setEventDispatcher

 /**
  * Set the event dispatcher instance.
  *
  * @param \Illuminate\Contracts\Events\Dispatcher $events
  * @return void 
  * @static 
  */
 public static function setEventDispatcher($events)
 {
     \Illuminate\Cache\Repository::setEventDispatcher($events);
 }
開發者ID:satriashp,項目名稱:tour,代碼行數:11,代碼來源:_ide_helper.php

示例3: ConfigRepository

if (file_exists($configFile = __DIR__ . '/../config.php')) {
    $app->instance('flarum.config', include $configFile);
}
date_default_timezone_set('UTC');
$app->instance('config', $config = new ConfigRepository(['view' => ['paths' => [realpath(base_path('resources/views'))], 'compiled' => realpath(storage_path() . '/framework/views')], 'mail' => ['driver' => 'mail'], 'cache' => ['default' => 'file', 'stores' => ['file' => ['driver' => 'file', 'path' => storage_path() . '/framework/cache']], 'prefix' => 'flarum'], 'filesystems' => ['default' => 'local', 'cloud' => 's3', 'disks' => ['flarum-avatars' => ['driver' => 'local', 'root' => public_path('assets/avatars')]]]]));
$logger = new Monolog\Logger($app->environment());
$logPath = $app->storagePath() . '/logs/flarum.log';
$handler = new \Monolog\Handler\StreamHandler($logPath, Monolog\Logger::DEBUG);
$handler->setFormatter(new \Monolog\Formatter\LineFormatter(null, null, true, true));
$logger->pushHandler($handler);
$app->instance('log', $logger);
$app->alias('log', 'Psr\\Log\\LoggerInterface');
$app->singleton('cache', function ($app) {
    $store = new FileStore(new Filesystem(), storage_path('framework/cache'));
    $repository = new Repository($store);
    $repository->setEventDispatcher($app->make('events'));
    return $repository;
});
$app->alias('cache', 'Illuminate\\Contracts\\Cache\\Repository');
$serviceProviders = ['Flarum\\Core\\DatabaseServiceProvider', 'Flarum\\Core\\Settings\\SettingsServiceProvider', 'Flarum\\Locale\\LocaleServiceProvider', 'Illuminate\\Bus\\BusServiceProvider', 'Illuminate\\Filesystem\\FilesystemServiceProvider', 'Illuminate\\Hashing\\HashServiceProvider', 'Illuminate\\Mail\\MailServiceProvider', 'Illuminate\\View\\ViewServiceProvider', 'Illuminate\\Events\\EventServiceProvider', 'Illuminate\\Validation\\ValidationServiceProvider'];
foreach ($serviceProviders as $provider) {
    $app->register(new $provider($app));
}
if (Core::isInstalled()) {
    $settings = $app->make('Flarum\\Core\\Settings\\SettingsRepository');
    $app->register(new \Flarum\Core\CoreServiceProvider($app));
    $config->set('mail.driver', Core::config('mail_driver'));
    $config->set('mail.host', Core::config('mail_host'));
    $config->set('mail.port', Core::config('mail_port'));
    $config->set('mail.from.address', Core::config('mail_from'));
    $config->set('mail.from.name', Core::config('forum_title'));
開發者ID:noname007,項目名稱:flarum,代碼行數:31,代碼來源:bootstrap.php


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