Laravel 5.0 Documentation
5. Architecture Foundations i. Service Providers i. Introduction ii. Basic Provider Example iii. Registering Providers iv. Deferred Providers ii. Service Container i. Introduction ii. Basic Usage Interfaces To Implementations iv. Contextual Binding v. Tagging vi. Practical Applications vii. Container Events iii. Contracts i. Introduction ii. Why Contracts? iii. Contract Reference iv. How To Facade Class Reference v. Request Lifecycle i. Introduction ii. Lifecycle Overview iii. Focus On Service Providers vi. Application Structure i. Introduction ii. The Root Directory iii. The App Directory0 码力 | 242 页 | 1.44 MB | 1 年前3
Learning LaravelBinding an Instance 166 Binding a Singleton to the Service Container 166 Introduction 167 Using the Service Container as a Dependency Injection Container 167 Chapter 57: Socialite 168 Examples 168 Installation Create a new Eloquent model class make:policy Create a new policy class make:provider Create a new service provider class make:request Create a new form request class make:seeder Create a new seeder class will be available in all views under the name $shareddata. View::share is typically called in a service provider, or perhaps in the constructor of a controller, so the data will be shared in views returned0 码力 | 216 页 | 1.58 MB | 1 年前3
CakePHP Cookbook Documentation 5.xfunction getTypeName() has been dropped. Use PHP’s get_debug_type() instead. The dependency on league/container was updated to 4.x. This will require the addition of typehints to your ServiceProvider implementations version 4.4.0: The ServerRequest is available via DI. So you can get it from container or use it as a dependency for your service. Some of the duties ServerRequest performs include: Processing the GET, address. Trusting Proxy Headers If your application is behind a load balancer or running on a cloud service, you will often get the load balancer host, port and scheme in your requests. Often load balancers0 码力 | 1080 页 | 939.39 KB | 1 年前3
CakePHP Cookbook 4.x
calling this process Experimental Features. Core Experimental support for a Dependency Injection container was added. Console ConsoleIo::comment() was added. This method formats text with a blue foreground and IntegrationTestCaseTrait. This method enables services injected with the Dependency Injection container to be replaced with mock or stub objects. View Context classes now include the comment, null, CakePHP’s dependency on league/container was bumped to ^4.1.1. While the DI container is marked as experimental, this upgrade could require you to upgrade your service provider definitions. Database0 码力 | 1249 页 | 1.04 MB | 1 年前3
Falcon v1.0.0 Documentationcom/racker/falcon] Resources An Unladen Web Framework [http://blog.kgriffs.com/2013/07/02/python-fast-web-service- framework.html] The Definitive Introduction to Falcon [https://speakerdeck.com/cabrera/the-definitive- with a middleware app. For example: import my_restful_service import some_middleware app = some_middleware.DoSomethingFancy(my_restful_service.api) See also the WSGI middleware example [http://legacy framework for building RESTful services and app backends with Python. Falcon works with any WSGI container that is compliant with PEP-3333, and works great with Python 2.6, Python 2.7, Python 3.3, Python0 码力 | 249 页 | 406.22 KB | 1 年前3
Falcon v0.2.0 Documentationcom/racker/falcon] Resources An Unladen Web Framework [http://blog.kgriffs.com/2013/07/02/python-fast-web-service- framework.html] The Definitive Introduction to Falcon [https://speakerdeck.com/cabrera/the-definitive- with a middleware app. For example: import my_restful_service import some_middleware app = some_middleware.DoSomethingFancy(my_restful_service.api) See also the WSGI middleware example [http://legacy framework for building RESTful services and app backends with Python. Falcon works with any WSGI container that is compliant with PEP-3333, and works great with Python 2.6, Python 2.7, Python 3.3, Python0 码力 | 188 页 | 358.44 KB | 1 年前3
Laravel 6.0 中文文档文档区块示例,注意到 @param 属性前面 有两个空格,参数类型前有两个空格,最后是参数名称,也有两个空 格: /** * Register a binding with the container. * * @param string|array $abstract * @param \Closure|string|null $concrete * @param bool $shared Laravel 中文学习资源:https://xueyuanjun.com 126 $this->app->extend(Service::class, function($service) { return new DecoratedService($service); }); 解析 make 方法 有很多方式可以从容器中解析对象,首先,你可以使用 make 方法, 该方法接收你想要解析的类名或接口名作为参数: 服务容器在每一次解析对象时都会触发一个事件,可以使 用 resolving 方法监听该事件: $this->app->resolving(function ($object, $app) { // Called when container resolves object of any typ e... }); $this->app->resolving(HelpSpot\API::class, function ($api0 码力 | 1442 页 | 14.66 MB | 1 年前3
CakePHP Cookbook 4.x
process Experimental Features. Core • Experimental support for a /development/dependency-injection container was added. Console • ConsoleIo::comment() was added. This method formats text with a blue foreground IntegrationTestCaseTrait. This method enables services injected with the /development/dependency-injection container to be replaced with mock or stub objects. View • Context classes now include the comment, null • CakePHP’s dependency on league/container was bumped to ^4.1.1. While the DI container is marked as experimental, this upgrade could require you to upgrade your service provider definitions. Database0 码力 | 967 页 | 2.88 MB | 1 年前3
Laravel 5.6 中文文档额外代码装饰或配置该服务。extend 方法接收一个闭包来返回修改后的服 务: $this->app->extend(Service::class, function($service) { return new DecoratedService($service); }); 解析 make 方法 有很多方式可以从容器中解析对象,首先,你可以使用 make 方法,该方法接收你想要解析的类名或接口名作为参数: $app) { // Called when container resolves object of any type... }); $this->app->resolving(HelpSpot\API::class, function ($api, $app) { // Called when container resolves objects of type "HelpSpot\API" PSR-11 容器接口来获取 Laravel 容器的实例: use Psr\Container\ContainerInterface; Route::get('/', function (ContainerInterface $container) { $service = $container->get('Service'); // }); 注:如果绑定到容器的唯一标识有冲突调用0 码力 | 377 页 | 14.56 MB | 1 年前3
CakePHP Cookbook Documentation 5.xgetTypeName() has been dropped. Use PHP’s get_debug_type() instead. • The dependency on league/container was updated to 4.x. This will require the addition of typehints to your ServiceProvider implementations version 4.4.0: The ServerRequest is available via DI. So you can get it from container or use it as a dependency for your service. Some of the duties ServerRequest performs include: • Processing the GET 5.x Trusting Proxy Headers If your application is behind a load balancer or running on a cloud service, you will often get the load balancer host, port and scheme in your requests. Often load balancers0 码力 | 848 页 | 2.53 MB | 1 年前3
共 77 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8













