当前位置: 首页>>代码示例>>PHP>>正文


PHP Repository::package方法代码示例

本文整理汇总了PHP中Illuminate\Config\Repository::package方法的典型用法代码示例。如果您正苦于以下问题:PHP Repository::package方法的具体用法?PHP Repository::package怎么用?PHP Repository::package使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Config\Repository的用法示例。


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

示例1: __construct

 /**
  * Creates new instance of Image Manager
  *
  * @param \Illuminate\Config\Repository $config
  */
 public function __construct(\Illuminate\Config\Repository $config = null)
 {
     // create configurator
     if (is_a($config, '\\Illuminate\\Config\\Repository')) {
         $this->config = $config;
     } else {
         $config_path = __DIR__ . '/../../config';
         $env = 'production';
         $file = new Filesystem();
         $loader = new FileLoader($file, $config_path);
         $this->config = new Config($loader, $env);
         $this->config->package('intervention/image', $config_path, 'image');
     }
 }
开发者ID:RHoKAustralia,项目名称:onaroll21_backend,代码行数:19,代码来源:ImageManager.php

示例2: getApplication

 public function getApplication()
 {
     $app = new Application();
     $app->instance('path', __DIR__);
     $app['path.storage'] = __DIR__ . '/storage';
     // Monolog
     $log = m::mock('Illuminate\\Log\\Writer');
     $log->shouldReceive('getMonolog')->andReturn(m::mock('Monolog\\Logger'));
     $app['log'] = $log;
     // Config
     $config = new Repository(m::mock('Illuminate\\Config\\LoaderInterface'), 'production');
     $config->getLoader()->shouldReceive('addNamespace')->with('laravel-sentry', __DIR__);
     $config->getLoader()->shouldReceive('cascadePackage')->andReturnUsing(function ($env, $package, $group, $items) {
         return $items;
     });
     $config->getLoader()->shouldReceive('exists')->with('environments', 'laravel-sentry')->andReturn(false);
     $config->getLoader()->shouldReceive('exists')->with('dsn', 'laravel-sentry')->andReturn(false);
     $config->getLoader()->shouldReceive('exists')->with('level', 'laravel-sentry')->andReturn(false);
     $config->getLoader()->shouldReceive('load')->with('production', 'config', 'laravel-sentry')->andReturn(array('environments' => array('prod', 'production'), 'dsn' => '', 'level' => 'error'));
     $config->package('foo/laravel-sentry', __DIR__);
     $app['config'] = $config;
     // Env
     $app['env'] = 'production';
     return $app;
 }
开发者ID:rcrowe,项目名称:laravel-sentry,代码行数:25,代码来源:ProviderTest.php

示例3: registerModule

 /**
  * Register a module
  */
 public function registerModule($module)
 {
     // Register the module as a package
     $this->config->package('app/' . $module, str_finish($this->modulesDirectory, '/') . $module . '/config');
     // Add routes
     $routes = str_finish($this->modulesDirectory, '/') . $module . '/routes.php';
     if ($this->filesystem->exists($routes)) {
         $this->filesystem->getRequire($routes);
     }
     // Run module boot
     $boot = str_finish($this->modulesDirectory, '/') . $module . '/boot.php';
     if ($this->filesystem->exists($boot)) {
         $this->filesystem->getRequire($boot);
     }
 }
开发者ID:terbium,项目名称:modularity,代码行数:18,代码来源:Modularity.php

示例4: getLoader

 private function getLoader()
 {
     // Mock application
     $functions = array('functions' => array('array_get', 'fooBar' => function () {
         return 'FOOBAR';
     }));
     $filters = array('filters' => array('camel_case', 'snakeCase' => function () {
         return 'snakeCASE';
     }));
     $app = new Application();
     $app->instance('path', __DIR__);
     $config = new Repository(m::mock('Illuminate\\Config\\LoaderInterface'), 'production');
     $config->getLoader()->shouldReceive('addNamespace')->with('twigbridge', __DIR__);
     $config->getLoader()->shouldReceive('cascadePackage')->andReturnUsing(function ($env, $package, $group, $items) {
         return $items;
     });
     $config->getLoader()->shouldReceive('exists')->with('functions', 'twigbridge')->andReturn(false);
     $config->getLoader()->shouldReceive('exists')->with('filters', 'twigbridge')->andReturn(false);
     $config->getLoader()->shouldReceive('load')->with('production', 'config', 'twigbridge')->andReturn(array_merge($functions, $filters));
     $config->package('foo/twigbridge', __DIR__);
     $app['config'] = $config;
     // Get instance of HelperLoader
     return new HelperLoader($app, new Twig_Environment());
 }
开发者ID:tatu-carreta,项目名称:mariasanti_v2,代码行数:24,代码来源:HelperLoaderTest.php

示例5: package

 /**
  * Register a package for cascading configuration.
  *
  * @param string $package
  * @param string $hint
  * @param string $namespace
  * @return void 
  * @static 
  */
 public static function package($package, $hint, $namespace = null)
 {
     \Illuminate\Config\Repository::package($package, $hint, $namespace);
 }
开发者ID:nmkr,项目名称:basic-starter,代码行数:13,代码来源:_ide_helper.php

示例6: registerConfigRepository

 /**
  * Register config repository
  */
 public function registerConfigRepository()
 {
     $this->getContainer()->bindIf('config', function () {
         $dir = __DIR__ . '/../../config';
         $config = new Repository(new FileLoader($this->getFilesystem(), $dir), 'development');
         $config->package('anomaly/lexicon', $dir);
         return $config;
     }, true);
 }
开发者ID:visualturk,项目名称:lexicon,代码行数:12,代码来源:Foundation.php

示例7: getApplication

 public function getApplication(array $twig_options = array(), array $paths = array(), array $hints = array())
 {
     $app = new Application();
     $app->instance('path', __DIR__);
     $app['path.storage'] = __DIR__ . '/storage';
     $finder = m::mock('Illuminate\\View\\ViewFinderInterface');
     $finder->shouldReceive('getPaths')->andReturn($paths);
     $finder->shouldReceive('getHints')->andReturn($hints);
     $app['view'] = new Environment(m::mock('Illuminate\\View\\Engines\\EngineResolver'), $finder, m::mock('Illuminate\\Events\\Dispatcher'));
     $config = new Repository(m::mock('Illuminate\\Config\\LoaderInterface'), 'production');
     $twig_options or $twig_options = array('egg' => 'fried');
     $config->getLoader()->shouldReceive('addNamespace')->with('twigbridge', __DIR__);
     $config->getLoader()->shouldReceive('cascadePackage')->andReturnUsing(function ($env, $package, $group, $items) {
         return $items;
     });
     $config->getLoader()->shouldReceive('exists')->with('extension', 'twigbridge')->andReturn(false);
     $config->getLoader()->shouldReceive('exists')->with('extensions', 'twigbridge')->andReturn(false);
     $config->getLoader()->shouldReceive('exists')->with('delimiters', 'twigbridge')->andReturn(false);
     $config->getLoader()->shouldReceive('exists')->with('twig', 'twigbridge')->andReturn(false);
     $config->getLoader()->shouldReceive('load')->with('production', 'config', 'twigbridge')->andReturn(array('extension' => 'twig', 'twig' => $twig_options, 'extensions' => array('TwigBridge\\Extensions\\Html')));
     $config->package('foo/twigbridge', __DIR__);
     $app['config'] = $config;
     return $app;
 }
开发者ID:tatu-carreta,项目名称:mariasanti_v2,代码行数:24,代码来源:TwigBridgeTest.php

示例8: __construct

 /**
  * constructor
  */
 private function __construct()
 {
     $hint = realpath(__DIR__ . '/../config');
     $this->config = new Repository(new FileLoader(new Filesystem(), $hint), 'test');
     $this->config->package('eviweb/laravel4-workbench', $hint, 'workbench');
 }
开发者ID:eviweb,项目名称:laravel4-workbench,代码行数:9,代码来源:ConfigStub.php

示例9: package

 /**
  * Register a package for cascading configuration.
  *
  * @param  string  $package
  * @param  string  $hint
  * @param  string  $namespace
  * @return void
  */
 public function package($package, $hint, $namespace = null)
 {
     parent::package($package, $hint, $namespace);
     $namespaceAppPath = app_path() . '/config/' . str_replace('.', '/', $namespace);
     $this->appRepository->package($package, $namespaceAppPath, $namespace);
 }
开发者ID:tamboer,项目名称:LaravelOctober,代码行数:14,代码来源:Repository.php

示例10: registerConfigNamespace

 /**
  * Register Config Namespace
  *
  * Adds a namespace to the 'Config' instance for use with the double colon.
  *
  * @return void
  */
 protected function registerConfigNamespace()
 {
     $this->configManager->package(strtolower($this->name), $this->directory, strtolower($this->name));
     $this->configManager->addNamespace(strtolower($this->name), $this->directory . '/config');
 }
开发者ID:suitetea,项目名称:modularlaravel,代码行数:12,代码来源:BaseModule.php

示例11: testAddHandlerEnabled

 public function testAddHandlerEnabled()
 {
     $app = new Application();
     // Monolog
     $log = m::mock('Illuminate\\Log\\Writer');
     $monolog = m::mock('Monolog\\Logger');
     $monolog->shouldReceive('pushHandler')->once();
     $log->shouldReceive('getMonolog')->andReturn($monolog);
     $app['log'] = $log;
     // Config
     $config = new Repository(m::mock('Illuminate\\Config\\LoaderInterface'), 'production');
     $config->getLoader()->shouldReceive('addNamespace')->with('laravel-sentry', __DIR__);
     $config->getLoader()->shouldReceive('cascadePackage')->andReturnUsing(function ($env, $package, $group, $items) {
         return $items;
     });
     $config->getLoader()->shouldReceive('exists')->with('environments', 'laravel-sentry')->andReturn(false);
     $config->getLoader()->shouldReceive('exists')->with('dsn', 'laravel-sentry')->andReturn(false);
     $config->getLoader()->shouldReceive('exists')->with('level', 'laravel-sentry')->andReturn(false);
     $config->getLoader()->shouldReceive('load')->with('production', 'config', 'laravel-sentry')->andReturn(array('environments' => array('prod', 'production'), 'dsn' => 'http://example.com', 'level' => 'error'));
     $config->package('foo/laravel-sentry', __DIR__);
     $app['config'] = $config;
     $app['env'] = 'production';
     $log = new Log($app);
     // Raven
     $raven = m::mock('Raven_Client');
     $raven->shouldReceive('getFoo')->andReturn('BAR');
     $log->setRaven($raven);
     $log->addHandler();
 }
开发者ID:rcrowe,项目名称:laravel-sentry,代码行数:29,代码来源:LogTest.php

示例12: getLoader

 private function getLoader()
 {
     // Mock application
     $aliases = array('aliases' => array('Auth' => 'Illuminate\\Support\\Facades\\Auth', 'Lookup' => 'TwigBridgeTests\\Fixtures\\Extension\\Lookup'));
     $shortcuts = array('alias_shortcuts' => array('URL' => 'URL_TO', 'logged_in' => 'auth_check'));
     $app = new Application();
     $app->instance('path', __DIR__);
     $config = new Repository(m::mock('Illuminate\\Config\\LoaderInterface'), 'production');
     $config->getLoader()->shouldReceive('load')->once()->with('production', 'app', null)->andReturn($aliases);
     $config->getLoader()->shouldReceive('addNamespace')->with('twigbridge', __DIR__);
     $config->getLoader()->shouldReceive('cascadePackage')->andReturnUsing(function ($env, $package, $group, $items) {
         return $items;
     });
     $config->getLoader()->shouldReceive('exists')->once()->with('alias_shortcuts', 'twigbridge')->andReturn(false);
     $config->getLoader()->shouldReceive('load')->once()->with('production', 'config', 'twigbridge')->andReturn($shortcuts);
     $config->package('foo/twigbridge', __DIR__);
     $app['config'] = $config;
     // Get instance of AliasLoader
     return new AliasLoader($app, new Twig_Environment());
 }
开发者ID:tatu-carreta,项目名称:mariasanti_v2,代码行数:20,代码来源:AliasLoaderTest.php


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