當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。