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


PHP Application::bind方法代码示例

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


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

示例1: handle

 /**
  * Handle a request.
  *
  * @param SyfmonyRequest $request
  * @param int $type
  * @param bool $catch
  * @return Response
  */
 public function handle(SyfmonyRequest $request, $type = self::MASTER_REQUEST, $catch = true)
 {
     $request = Request::createFromBase($request);
     $request->enableHttpMethodParameterOverride();
     $this->app->bind('request', $request);
     return $this->httpKernel->handle($request);
 }
开发者ID:codeception,项目名称:base,代码行数:15,代码来源:Laravel5.php

示例2: setUp

 /**
  * Setup the test.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->app = new Application();
     $this->app->bind('config', function () {
         return new Repository(['inliner' => ['paths' => ['stylesheets' => ['some/path/n/stuff']], 'options' => ['cleanup' => false, 'use_inline_styles_block' => false, 'strip_original_tags' => false, 'exclude_media_queries' => false]]]);
     });
 }
开发者ID:MarkVaughn,项目名称:illuminated,代码行数:11,代码来源:InlinerServiceProviderTest.php

示例3: applyBindings

 /**
  * Apply the registered Laravel service container bindings.
  */
 private function applyBindings()
 {
     foreach ($this->bindings as $abstract => $binding) {
         list($concrete, $shared) = $binding;
         $this->app->bind($abstract, $concrete, $shared);
     }
 }
开发者ID:solutionDrive,项目名称:Codeception,代码行数:10,代码来源:Laravel5.php

示例4: getApplication

 protected function getApplication($customConfig = [])
 {
     $app = new Application();
     $app->instance('path', __DIR__);
     $app['env'] = 'production';
     $app['path.config'] = $this->root . '/config';
     // Filesystem
     $files = m::mock('Illuminate\\Filesystem\\Filesystem');
     $app['files'] = $files;
     // View
     // $finder = m::mock('Illuminate\View\ViewFinderInterface');
     // $finder->shouldReceive('addExtension');
     // $app['view'] = new Factory(
     // new EngineResolver(),
     // $finder,
     // m::mock('Illuminate\Events\Dispatcher')
     // );
     // $config_data = include $config_file;
     // Config
     $app['config'] = new Repository([]);
     $app->bind('\\Illuminate\\Config\\Repository', function () use($app) {
         return $app['config'];
     });
     return $app;
 }
开发者ID:tureki,项目名称:rrs,代码行数:25,代码来源:Base.php

示例5: getEnvironmentSetUp

 /**
  * Define environment setup.
  *
  * @param  \Illuminate\Foundation\Application  $app
  * @return void
  */
 protected function getEnvironmentSetUp($app)
 {
     $app->bind('Tokenly\\XCPDClient\\Client', function () {
         $client = m::mock('Tokenly\\XCPDClient\\Client');
         $client->shouldReceive('get_asset_info')->with(['assets' => ['LTBCOIN']])->andReturn([$this->sampleLTBCoinAssetInfo()]);
         return $client;
     });
 }
开发者ID:tokenly,项目名称:counterparty-asset-info-cache,代码行数:14,代码来源:CacheTest.php

示例6: it_composes_a_view_using_each_view_composer

 /** @test */
 public function it_composes_a_view_using_each_view_composer()
 {
     $view = 'view.test';
     $this->app->bind('Coderabbi\\Virtuoso\\Tests\\ComposerStub', function () {
         $composer = new ComposerStub();
         $this->composers[] = $composer;
         return $composer;
     });
     $compositeComposer = new CompositeComposerStub($this->app);
     $compositeComposer->setComposers(['Coderabbi\\Virtuoso\\Tests\\ComposerStub', 'Coderabbi\\Virtuoso\\Tests\\ComposerStub']);
     $compositeComposer->compose($view);
     // Should create two composers
     $this->assertEquals(2, count($this->composers));
     // Each composer should compose $view
     foreach ($this->composers as $composer) {
         $this->assertEquals($view, $composer->composedView);
     }
 }
开发者ID:coderabbi,项目名称:virtuoso,代码行数:19,代码来源:CompositeComposerTest.php

示例7: getEnvironmentSetUp

 /**
  * Define environment setup.
  *
  * @param  \Illuminate\Foundation\Application  $app
  * @return void
  */
 protected function getEnvironmentSetUp($app)
 {
     $app->bind('Tokenly\\XCPDClient\\Client', function () {
         $connection_string = getenv('XCPD_CONNECTION_STRING');
         $rpc_user = getenv('XCPD_RPC_USER');
         $rpc_password = getenv('XCPD_RPC_PASSWORD');
         $client = new \Tokenly\XCPDClient\Client($connection_string, $rpc_user, $rpc_password);
         return $client;
     });
 }
开发者ID:tokenly,项目名称:counterparty-asset-info-cache,代码行数:16,代码来源:CacheIntegrationTest.php

示例8: getEnvironmentSetUp

 /**
  * Define environment setup.
  *
  * @param  \Illuminate\Foundation\Application  $app
  * @return void
  */
 protected function getEnvironmentSetUp($app)
 {
     // Setup default database to use sqlite :memory:
     $app['config']->set('database.default', 'testbench');
     $app['config']->set('database.connections.testbench', ['driver' => 'sqlite', 'database' => ':memory:', 'prefix' => '']);
     // Bind the stub tracker
     $app->bind(StubTracker::class, function ($app) {
         return new StubTracker($app, $app['events'], $app['config']);
     });
     $app[StubTracker::class]->registerRoute($app['router']);
     parent::getEnvironmentSetUp($app);
 }
开发者ID:boxedcode,项目名称:laravel-url-tracking,代码行数:18,代码来源:AbstractTestCase.php

示例9: getEnvironmentSetUp

 /**
  * Define environment setup.
  *
  * @param  \Illuminate\Foundation\Application  $app
  *
  * @return void
  */
 protected function getEnvironmentSetUp($app)
 {
     // Set Testing Configuration
     $app['config']->set('database.default', 'testbench');
     $app['config']->set('database.connections.testbench', ['driver' => 'sqlite', 'database' => __DIR__ . '/_data/database.sqlite', 'prefix' => '']);
     $app['config']->set('mail.pretend', true);
     $app['config']->set('mail.from', ['from' => 'noreply@example.com', 'name' => null]);
     // Temporary Repository Bindings
     // Bind the Transaction Repository
     $app->bind('SRLabs\\Groundwork\\Repositories\\Transactions\\TransactionRepositoryInterface', function ($app) {
         return new EloquentTransactionRepository(new Transaction(), $app->make('cache.store'), $app->make('events'), $app->make('log'));
     });
 }
开发者ID:srlabs,项目名称:groundwork,代码行数:20,代码来源:GroundworkTestCase.php

示例10: bind

 /**
  * Register a binding with the container.
  *
  * @param string|array $abstract
  * @param \Closure|string|null $concrete
  * @param bool $shared
  * @return void 
  * @static 
  */
 public static function bind($abstract, $concrete = null, $shared = false)
 {
     //Method inherited from \Illuminate\Container\Container
     \Illuminate\Foundation\Application::bind($abstract, $concrete, $shared);
 }
开发者ID:satriashp,项目名称:tour,代码行数:14,代码来源:_ide_helper.php

示例11: bindClasses

 /**
  * @param Application $app
  */
 protected function bindClasses($app)
 {
     $app->bind(TagVersionManagerInterface::class, TagVersionManager::class);
     $app->bind(TagVersionStorageInterface::class, function () use($app) {
         return new PlainRedisTagVersionStorage($app['redis'], 'test_connection', 'tag_test');
     });
     $app->bind(SerializerInterface::class, GenericSerializer::class);
     $app->bind(CoderManagerInterface::class, GenericCoderManager::class);
 }
开发者ID:fhteam,项目名称:laravel-cache-redis-extended,代码行数:12,代码来源:TestBase.php

示例12: getEnvironmentSetUp

 /**
  * Define environment setup.
  *
  * @param  \Illuminate\Foundation\Application  $app
  * @return void
  */
 protected function getEnvironmentSetUp($app)
 {
     $app->bind('Reloquent\\Contracts\\ReloquentClientContract', function ($app) {
         return new Reloquent\Test\ReloquentClientMock();
     });
 }
开发者ID:johnnymn,项目名称:reloquent,代码行数:12,代码来源:ReloquentModelTest.php

示例13: bindings

 /**
  * @param \Illuminate\Foundation\Application $app
  * @return mixed
  */
 public function bindings(\Illuminate\Foundation\Application $app)
 {
     $app->bind('CoandaCMS\\Coanda\\Pages\\Repositories\\PageRepositoryInterface', 'CoandaCMS\\Coanda\\Pages\\Repositories\\Eloquent\\EloquentPageRepository');
 }
开发者ID:coandacms,项目名称:coanda-core,代码行数:8,代码来源:PagesModuleProvider.php

示例14: bindings

 /**
  * @param Application $app
  * @return mixed
  */
 public function bindings(Application $app)
 {
     $app->bind('CoandaCMS\\Coanda\\Media\\Repositories\\MediaRepositoryInterface', 'CoandaCMS\\Coanda\\Media\\Repositories\\Eloquent\\EloquentMediaRepository');
 }
开发者ID:coandacms,项目名称:coanda-core,代码行数:8,代码来源:MediaModuleProvider.php

示例15: resolveApplication

 /**
  * Resolve application implementation.
  *
  * @return \Illuminate\Foundation\Application
  */
 protected function resolveApplication()
 {
     $app = new Application($this->getBasePath());
     $app->bind('Illuminate\\Foundation\\Bootstrap\\LoadConfiguration', 'Orchestra\\Testbench\\Bootstrap\\LoadConfiguration');
     return $app;
 }
开发者ID:diegopan,项目名称:testbench,代码行数:11,代码来源:ApplicationTrait.php


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