• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Config\Repository类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Illuminate\Contracts\Config\Repository的典型用法代码示例。如果您正苦于以下问题:PHP Repository类的具体用法?PHP Repository怎么用?PHP Repository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: fire

 /**
  * @return void
  */
 public function fire()
 {
     if (!$this->isDataSetted) {
         $this->setDataFromConsoling();
     }
     $this->config->set('database', ['fetch' => PDO::FETCH_OBJ, 'default' => $this->data->get('driver'), 'connections' => [], 'redis' => []]);
     switch ($this->data->get('driver')) {
         case 'mysql':
             $this->config->set('database.connections.mysql', ['driver' => 'mysql', 'host' => $this->data->get('database_host'), 'database' => $this->data->get('database'), 'username' => $this->data->get('database_username'), 'password' => $this->data->get('database_password'), 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => $this->data->get('database_prefix'), 'strict' => true, 'engine' => null]);
             break;
         case 'pgsql':
             $this->config->set('database.connections.pgsql', ['driver' => 'pgsql', 'host' => $this->data->get('database_host'), 'database' => $this->data->get('database'), 'username' => $this->data->get('database_username'), 'password' => $this->data->get('database_password'), 'charset' => 'utf8', 'prefix' => $this->data->get('database_prefix'), 'schema' => 'public', 'sslmode' => 'prefer']);
             break;
         case 'sqlite':
             $this->config->set('database.connections.sqlite', ['driver' => 'sqlite', 'database' => $this->container->storagePath() . DIRECTORY_SEPARATOR . 'bootstraps' . DIRECTORY_SEPARATOR . 'database.sqlite', 'prefix' => $this->data->get('database_prefix')]);
             touch($this->container->storagePath() . DIRECTORY_SEPARATOR . 'bootstraps' . DIRECTORY_SEPARATOR . 'database.sqlite');
             break;
     }
     $this->call('migrate', ['--force' => true, '--path' => str_replace(base_path() . DIRECTORY_SEPARATOR, '', database_path('migrations'))]);
     $this->call('passport:keys');
     $this->call('passport:client', ['--password' => true, '--name' => 'Notadd Administrator Client']);
     $setting = $this->container->make(SettingsRepository::class);
     $setting->set('site.name', $this->data->get('website'));
     $setting->set('setting.image.engine', 'webp');
     if ($this->data->get('image_engine', false)) {
     } else {
         $setting->set('setting.image.engine', 'normal');
     }
     $this->createAdministrationUser();
     $this->writingConfiguration();
     $this->call('key:generate');
     $this->info('Notadd Installed!');
 }
开发者ID:notadd,项目名称:framework,代码行数:36,代码来源:InstallCommand.php


示例2: handle

 /**
  * Handle the command.
  *
  * @param ModuleCollection $modules
  * @param Decorator        $decorator
  * @param Repository       $config
  * @param Container        $container
  * @param Request          $request
  * @param Search           $search
  * @return LengthAwarePaginator
  */
 public function handle(ModuleCollection $modules, Decorator $decorator, Repository $config, Container $container, Request $request, Search $search)
 {
     /* @var Query $query */
     $query = $search->index($this->criteria->option('index', 'default'));
     $constraint = $this->criteria->option('in');
     if (!empty($constraint) && is_string($constraint)) {
         $query = $query->search('stream', $constraint, ['required' => true]);
     }
     if (!empty($constraint) && is_array($constraint)) {
         /* @var Module $module */
         foreach ($modules->withConfig('search') as $module) {
             foreach ($config->get($module->getNamespace('search')) as $model => $definition) {
                 /* @var EntryInterface $model */
                 $model = $container->make($model);
                 $stream = $model->getStreamNamespace() . '.' . $model->getStreamSlug();
                 if (!in_array($stream, $constraint)) {
                     $query = $query->search('stream', $stream, ['required' => false, 'prohibited' => true]);
                 }
             }
         }
     }
     foreach ($this->criteria->getOperations() as $operation) {
         $query = call_user_func_array([$query, $operation['name']], $operation['arguments']);
     }
     $page = $request->get('page', 1);
     $perPage = $this->criteria->option('paginate', $this->criteria->option('limit', 15));
     $query->limit($perPage, ($page - 1) * $perPage);
     $collection = new SearchCollection(array_map(function ($result) use($decorator) {
         return $decorator->decorate(new SearchItem($result));
     }, $query->get()));
     return (new LengthAwarePaginator($collection, $query->count(), $perPage, $page))->setPath($request->path())->appends($request->all());
 }
开发者ID:Wol,项目名称:search-module,代码行数:43,代码来源:GetSearchResults.php


示例3: __construct

 /**
  * @param \Maknz\Slack\Client $client
  * @param Repository          $config
  */
 public function __construct(Client $client, Repository $config)
 {
     $this->config = $config->get('server-monitor.notifications.slack');
     $client->setDefaultUsername($this->config['username']);
     $client->setDefaultIcon($this->config['icon']);
     $this->client = $client;
 }
开发者ID:ericmakesstuff,项目名称:laravel-server-monitor,代码行数:11,代码来源:Slack.php


示例4: registerMenu

 public static function registerMenu(Dispatcher $events, Repository $config)
 {
     $events->listen(BuildingMenu::class, function (BuildingMenu $event) use($config) {
         $menu = $config->get('adminlte.menu');
         call_user_func_array([$event->menu, 'add'], $menu);
     });
 }
开发者ID:jeroennoten,项目名称:laravel-adminlte,代码行数:7,代码来源:ServiceProvider.php


示例5: createManager

 /**
  * @param Container        $container
  * @param ConfigRepository $config
  */
 protected function createManager(Container $container, ConfigRepository $config)
 {
     $fileManager = $container->make(FileManager::class);
     $imageManager = new ImageManager($fileManager);
     $this->configureManager($imageManager, $container, $config->get('imagemanager', []));
     return $imageManager;
 }
开发者ID:nordsoftware,项目名称:lumen-image-manager,代码行数:11,代码来源:ImageManagerServiceProvider.php


示例6: __construct

 public function __construct(Connection $connection, RepositoryContract $config)
 {
     $dbconfig = $config->get('database.connections.' . $connection->getName());
     $this->dsn = static::parseDSN($dbconfig);
     $this->username = $dbconfig['username'];
     $this->password = $dbconfig['password'];
 }
开发者ID:recca0120,项目名称:laravel-support,代码行数:7,代码来源:Backup.php


示例7: map

 /**
  * Map additional routes.
  *
  * @param Router     $router
  * @param Repository $config
  */
 public function map(Router $router, Repository $config)
 {
     $tag = $config->get('anomaly.module.posts::paths.tag');
     $module = $config->get('anomaly.module.posts::paths.module');
     $category = $config->get('anomaly.module.posts::paths.category');
     $permalink = $config->get('anomaly.module.posts::paths.route');
     /**
      * Map the RSS methods.
      */
     $router->any("{$module}/rss/category/{category}.xml", ['uses' => 'Anomaly\\PostsModule\\Http\\Controller\\RssController@category', 'streams::addon' => 'anomaly.module.posts']);
     $router->any("{$module}/rss/tag/{tag}.xml", ['uses' => 'Anomaly\\PostsModule\\Http\\Controller\\RssController@tag', 'streams::addon' => 'anomaly.module.posts']);
     $router->any("{$module}/rss.xml", ['uses' => 'Anomaly\\PostsModule\\Http\\Controller\\RssController@recent', 'streams::addon' => 'anomaly.module.posts']);
     /**
      * Map other public routes.
      * Mind the order. Routes are
      * handled first come first serve.
      */
     $router->any("{$module}/{type}", ['uses' => 'Anomaly\\PostsModule\\Http\\Controller\\TypesController@index', 'streams::addon' => 'anomaly.module.posts']);
     $router->any($module, ['uses' => 'Anomaly\\PostsModule\\Http\\Controller\\PostsController@index', 'streams::addon' => 'anomaly.module.posts']);
     $router->any("{$module}/preview/{id}", ['uses' => 'Anomaly\\PostsModule\\Http\\Controller\\PostsController@preview', 'streams::addon' => 'anomaly.module.posts']);
     $router->any("{$module}/{$tag}/{tag}", ['uses' => 'Anomaly\\PostsModule\\Http\\Controller\\TagsController@index', 'streams::addon' => 'anomaly.module.posts']);
     $router->any("{$module}/{$category}/{category}", ['uses' => 'Anomaly\\PostsModule\\Http\\Controller\\CategoriesController@index', 'streams::addon' => 'anomaly.module.posts']);
     $router->any("{$module}/archive/{year}/{month?}", ['uses' => 'Anomaly\\PostsModule\\Http\\Controller\\ArchiveController@index', 'streams::addon' => 'anomaly.module.posts']);
     $router->any("{$module}/{$permalink}", ['uses' => 'Anomaly\\PostsModule\\Http\\Controller\\PostsController@view', 'streams::addon' => 'anomaly.module.posts']);
 }
开发者ID:jacksun101,项目名称:posts-module,代码行数:31,代码来源:PostsModuleServiceProvider.php


示例8: __construct

 /**
  * @param \Illuminate\Contracts\Database\DatabaseManager $db
  * @param \Illuminate\Contracts\Config\Repository $config
  */
 public function __construct(DatabaseManager $db, Config $config = null)
 {
     $this->db = $db;
     if ($config) {
         $this->table = $config->get('database.migrations', $this->table);
     }
 }
开发者ID:jumilla,项目名称:laravel-versionia,代码行数:11,代码来源:Migrator.php


示例9:

 /**
  * @param Client $client
  * @param ConfigRepository $config
  * @param Log $log
  * @param BillValidator $validator
  */
 function __construct(Client $client, ConfigRepository $config, Log $log, BillValidator $validator)
 {
     $this->apiKey = $config->get('billplz.api_key');
     $this->client = $client;
     $this->log = $log;
     $this->validator = $validator;
 }
开发者ID:nasrulhazim,项目名称:Laravel5-billplz,代码行数:13,代码来源:Transport.php


示例10: __construct

 /**
  * Constructor
  *
  * @param Repository $config
  */
 public function __construct(Repository $config)
 {
     $this->config = $config;
     $this->mediaTypes = $this->config->get('files.media_types', ['audio' => ['audio/aac', 'audio/mp4', 'audio/mpeg', 'audio/ogg', 'audio/wav', 'audio/webm'], 'document' => ['text/plain', 'application/pdf', 'application/msword', 'application/vnd.ms-excel', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'], 'image' => ['image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/svg+xml'], 'video' => ['video/mp4', 'video/ogg', 'video/webm']]);
     $this->modelTypes = $this->config->get('files.model_types', ['audio' => 'Kenarkose\\Files\\Media\\Audio', 'document' => 'Kenarkose\\Files\\Media\\Document', 'image' => 'Kenarkose\\Files\\Media\\Image', 'video' => 'Kenarkose\\Files\\Media\\Video']);
     $this->defaultMediaModel = $this->config->get('files.media_model', 'Kenarkose\\Files\\Media\\Media');
 }
开发者ID:kenarkose,项目名称:files,代码行数:12,代码来源:ModelDeterminer.php


示例11: handle

 /**
  * Handle the command.
  *
  * @param Repository $config
  * @param Encrypter  $encrypter
  * @return string
  */
 public function handle(Repository $config, Encrypter $encrypter)
 {
     $email = $encrypter->encrypt($this->user->getEmail());
     $code = $encrypter->encrypt($this->user->getResetCode());
     $query = "?email={$email}&code={$code}&redirect={$this->redirect}";
     return $config->get('anomaly.module.users::paths.reset') . $query;
 }
开发者ID:AkibaTech,项目名称:users-module,代码行数:14,代码来源:GetResetPasswordPath.php


示例12: __construct

 public function __construct($options = [], Application $app = null, RepositoryContract $config = null, Dispatcher $dispatcher = null)
 {
     static::$options = $config !== null ? array_merge($options, $config->get('tracy')) : $options;
     TracyDebugger::$time = array_get($_SERVER, 'REQUEST_TIME_FLOAT', microtime(true));
     TracyDebugger::$maxDepth = array_get(static::$options, 'maxDepth');
     TracyDebugger::$maxLen = array_get(static::$options, 'maxLen');
     TracyDebugger::$showLocation = array_get(static::$options, 'showLocation');
     TracyDebugger::$strictMode = array_get(static::$options, 'strictMode');
     TracyDebugger::$editor = array_get(static::$options, 'editor');
     $bar = TracyDebugger::getBar();
     foreach (array_get(static::$options, 'panels') as $key => $enabled) {
         if ($enabled === true) {
             $class = '\\' . __NAMESPACE__ . '\\Panels\\' . ucfirst($key) . 'Panel';
             if (class_exists($class) === false) {
                 $class = $key;
             }
             $this->panels[$key] = new $class($app, static::$options);
             $bar->addPanel($this->panels[$key], $class);
         }
     }
     if ($dispatcher !== null) {
         $dispatcher->listen('kernel.handled', function ($request, $response) {
             return static::appendDebugbar($request, $response);
         });
     } else {
         TracyDebugger::enable();
     }
 }
开发者ID:dasim,项目名称:laravel-tracy,代码行数:28,代码来源:Debugger.php


示例13: fire

 /**
  * Execute the console command.
  *
  * @param ModuleCollection $modules
  * @param Repository       $config
  * @param Search           $search
  * @param Kernel           $console
  */
 public function fire(ModuleCollection $modules, Repository $config, Search $search, Kernel $console)
 {
     $stream = $this->argument('stream');
     if (!$stream) {
         $this->info('Destroying index');
         $console->call('search:destroy');
     } else {
         $this->info('Deleting ' . $stream);
         $search->search('stream', $stream)->delete();
     }
     /* @var Module $module */
     foreach ($modules->withConfig('search') as $module) {
         foreach ($config->get($module->getNamespace('search')) as $model => $search) {
             /* @var EntryModel $model */
             $model = new $model();
             if (!$stream || $stream == $model->getStreamNamespace() . '.' . $model->getStreamSlug()) {
                 $this->info('Rebuilding ' . $stream);
                 $this->output->progressStart($model->count());
                 foreach ($model->all() as $entry) {
                     $entry->save();
                     $this->output->progressAdvance();
                 }
                 $this->output->progressFinish();
             }
         }
     }
 }
开发者ID:visualturk,项目名称:search-module,代码行数:35,代码来源:Rebuild.php


示例14: guess

 /**
  * Guess the assignment names.
  *
  * @param Migration $migration
  */
 public function guess(Migration $migration)
 {
     /**
      * If we don't have any addon then
      * we can't automate anything.
      *
      * @var Addon $addon
      */
     if (!($addon = $migration->getAddon())) {
         return;
     }
     $stream = $migration->getStream();
     $stream = $this->streams->findBySlugAndNamespace(array_get($stream, 'slug'), array_get($stream, 'namespace'));
     if (!$stream) {
         return;
     }
     $locale = $this->config->get('app.fallback_locale');
     $assignments = $migration->getAssignments();
     foreach ($assignments as &$assignment) {
         foreach (['label', 'warning', 'instructions', 'placeholder'] as $key) {
             if (is_null(array_get($assignment, $locale . '.' . $key))) {
                 $assignment = array_add($assignment, $locale . '.' . $key, $addon->getNamespace('field.' . array_get($assignment, 'field') . '.' . $key . '.' . $stream->getSlug()));
             }
         }
     }
     $migration->setAssignments($assignments);
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:32,代码来源:TranslationGuesser.php


示例15: symbol

 /**
  * Return the currency symbol.
  *
  * @param null $currency
  * @return string
  */
 public function symbol($currency = null)
 {
     if (!$currency) {
         $currency = $this->config->get('streams::currencies.default');
     }
     return $this->config->get('streams::currencies.supported.' . strtoupper($currency) . '.symbol');
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:13,代码来源:Currency.php


示例16: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->config->get('app.debug', false)) {
         return $next($request);
     }
     if (!$request instanceof Request) {
         return $next($request);
     }
     $route = $request->route();
     if (!$route instanceof Route) {
         return $next($request);
     }
     $class = explode('@', $route->getActionName())[0];
     if (!is_subclass_of($class, HalApiControllerContract::class)) {
         return $next($request);
     }
     /** @var HalApiControllerContract $class */
     $cache = $class::getCache($this->cacheFactory);
     if ($request->isMethodSafe()) {
         $key = $this->generateKey($cache, $request);
         return $cache->persist($key, function () use($next, $request) {
             return $next($request);
         });
     }
     $cache->purge();
     foreach ($class::getRelatedCaches($this->cacheFactory) as $relatedCache) {
         $relatedCache->purge();
     }
     return $next($request);
 }
开发者ID:jarischaefer,项目名称:hal-api,代码行数:37,代码来源:HalApiCacheMiddleware.php


示例17: tagLinks

 /**
  * Return the tag links.
  *
  * @param array $attributes
  * @return string
  */
 public function tagLinks(array $attributes = [])
 {
     array_set($attributes, 'class', array_get($attributes, 'class', 'label label-default'));
     return array_map(function ($label) use($attributes) {
         return $this->html->link(implode('/', [$this->config->get('anomaly.module.posts::paths.module'), $this->config->get('anomaly.module.posts::paths.tag'), $label]), $label, $attributes);
     }, (array) $this->object->getTags());
 }
开发者ID:jacksun101,项目名称:posts-module,代码行数:13,代码来源:PostPresenter.php


示例18: guess

 /**
  * Guess the sections title.
  *
  * @param ControlPanelBuilder $builder
  */
 public function guess(ControlPanelBuilder $builder)
 {
     $sections = $builder->getSections();
     foreach ($sections as &$section) {
         // If title is set then skip it.
         if (isset($section['title'])) {
             continue;
         }
         $module = $this->modules->active();
         $title = $module->getNamespace('section.' . $section['slug'] . '.title');
         if (!isset($section['title']) && $this->translator->has($title)) {
             $section['title'] = $title;
         }
         $title = $module->getNamespace('addon.section.' . $section['slug']);
         if (!isset($section['title']) && $this->translator->has($title)) {
             $section['title'] = $title;
         }
         if (!isset($section['title']) && $this->config->get('streams::system.lazy_translations')) {
             $section['title'] = ucwords($this->string->humanize($section['slug']));
         }
         if (!isset($section['title'])) {
             $section['title'] = $title;
         }
     }
     $builder->setSections($sections);
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:31,代码来源:TitleGuesser.php


示例19: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure                 $next
  * @return void|mixed
  */
 public function handle(Request $request, Closure $next)
 {
     if (!$this->app->isDownForMaintenance()) {
         return $next($request);
     }
     if ($request->segment(1) == 'admin') {
         return $next($request);
     }
     if (in_array($request->getClientIp(), $this->config->get('streams::maintenance.ip_whitelist', []))) {
         return $next($request);
     }
     /* @var UserInterface $user */
     $user = $this->guard->user();
     if ($user && $user->isAdmin()) {
         return $next($request);
     }
     if ($user && $this->authorizer->authorize('streams::maintenance.access')) {
         return $next($request);
     }
     if (!$user && $this->config->get('streams::maintenance.auth')) {
         /* @var Response|null $response */
         $response = $this->guard->onceBasic();
         if (!$response) {
             return $next($request);
         }
         $response->setContent(view('streams::errors.401'));
         return $response;
     }
     abort(503);
 }
开发者ID:jacksun101,项目名称:streams-platform,代码行数:37,代码来源:CheckForMaintenanceMode.php


示例20: setWidth

 /**
  * Set Browser Width
  * @param int $width
  */
 public function setWidth($width)
 {
     if (is_null($width)) {
         $width = $this->config->get('screeenly.core.screenshot_width');
     }
     return $this->width = $width;
 }
开发者ID:MehmetNuri,项目名称:screeenly,代码行数:11,代码来源:AbstractClient.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Container\Container类代码示例发布时间:2022-05-23
下一篇:
PHP Cache\Repository类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap