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


PHP FactoryDefault::__construct方法代码示例

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


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

示例1: __construct

 public function __construct()
 {
     parent::__construct();
     $this->setShared(Services::REQUEST, new \PhalconRest\Http\Request());
     $this->setShared(Services::RESPONSE, new \PhalconRest\Http\Response());
     $this->setShared(Services::AUTH_MANAGER, new \PhalconRest\Auth\Manager());
     $this->setShared(Services::FRACTAL_MANAGER, function () {
         $className = '\\League\\Fractal\\Manager';
         if (!class_exists($className)) {
             throw new Exception(ErrorCodes::GEN_SYSTEM, '\\League\\Fractal\\Manager was requested, but class could not be found');
         }
         return new $className();
     });
     $this->setShared(Services::TOKEN_PARSER, function () {
         return new \PhalconRest\Auth\TokenParser\JWT('this_should_be_changed');
     });
     $this->setShared(Services::API_SERVICE, function () {
         return new \PhalconRest\Api\Service();
     });
     $this->setShared(Services::QUERY, function () {
         return new \PhalconRest\Data\Query();
     });
     $this->setShared(Services::PHQL_QUERY_PARSER, function () {
         return new \PhalconRest\Data\Query\Parser\Phql();
     });
     $this->setShared(Services::URL_QUERY_PARSER, function () {
         return new \PhalconRest\Data\Query\Parser\Url();
     });
 }
开发者ID:k0l1br1,项目名称:phalcon-rest,代码行数:29,代码来源:FactoryDefault.php

示例2: __construct

 public function __construct(array $entireAppConfig)
 {
     parent::__construct();
     $this->set('config', new Config($entireAppConfig), true);
     $this->setEventsManager();
     $this->set('dispatcher', new Dispatcher($this), true);
     $this->set('view', new View());
 }
开发者ID:tmquang6805,项目名称:phalex,代码行数:8,代码来源:Di.php

示例3: __construct

 /**
  * Phalcon\Di\FactoryDefault constructor
  */
 public function __construct(\swoole_http_request $swooleRequest, \swoole_http_response $swooleResponse)
 {
     parent::__construct();
     $request = new Request();
     $response = new Response();
     $request->setSwooleRequest($swooleRequest);
     $response->setSwooleResponse($swooleResponse);
     $this->setShared('request', $request);
     $this->setShared('response', $response);
     $this->_services['cookies'] = new Service('cookies', Cookies::class, true);
     $this->_services['session'] = new Service('session', SessionAdapter::class, true);
 }
开发者ID:HessianZ,项目名称:phalcon-swoole,代码行数:15,代码来源:Di.php

示例4: __construct

 /**
  * Construct all of the dependencies for the API
  */
 public function __construct()
 {
     parent::__construct();
     $this->setShared('request', function () {
         return new PhrestRequest();
     });
     $this->setShared('oauth2', function () {
         return false;
     });
     $this->setShared('router', function () {
         return new Router();
     });
 }
开发者ID:phrest,项目名称:api,代码行数:16,代码来源:PhrestDI.php

示例5: __construct

 /**
  * Application constructor.
  * @param null $basePath
  */
 public function __construct($basePath = null)
 {
     // INIT Phalcon's DI
     parent::__construct();
     //
     $this->registerBaseServices();
     //
     $this->registerCoreServices();
     if ($basePath) {
         $this->setBasePath($basePath);
     }
     $this->boot();
     $this->init();
 }
开发者ID:xueron,项目名称:pails,代码行数:18,代码来源:Container.php

示例6: __construct

 public function __construct($config, $paths, $module)
 {
     parent::__construct();
     $this->config = $config;
     $this->paths = $paths;
     $this->module = $module;
     $class = new ReflectionClass($this);
     $methods = $class->getMethods(ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED);
     foreach ($methods as $method) {
         $methodName = $method->getName();
         if (static::SHARED_PREFIX == substr($methodName, 0, 8)) {
             $sharedName = lcfirst(substr($methodName, static::SHARED_PREFIX_LENGTH));
             $this->setShared($sharedName, $method->getClosure($this));
         }
     }
 }
开发者ID:panlatent,项目名称:swilab,代码行数:16,代码来源:FactoryDefault.php

示例7: __construct

 /**
  * \Phalcon\DI\FactoryDefault\CLI constructor
  */
 public function __construct()
 {
     //@note It might be better if CLI directly extends DI,
     //since everything new from FactoryDefault gets overwritten
     parent::__construct();
     $services = array();
     /* Routing */
     $services['router'] = new Service('router', 'Phalcon\\CLI\\Router');
     $services['dispatcher'] = new Service('dispatcher', 'Phalcon\\CLI\\Dispatcher');
     /* ORM */
     $services['modelsManager'] = new Service('modelsManager', 'Phalcon\\Mvc\\Model\\Manager');
     $services['modelsMetadata'] = new Service('modelsMetadata', 'Phalcon\\Mvc\\Model\\Metadata\\Memory');
     /* Filter/Escaper */
     $services['filter'] = new Service('filter', 'Phalcon\\Filter', true);
     $services['escaper'] = new Service('escaper', 'Phalcon\\Escaper', true);
     /* Other */
     $services['annotations'] = new Service('annotations', 'Phalcon\\Annotations\\Adapter\\Memory', true);
     $services['security'] = new Service('security', 'Phalcon\\Security', true);
     /* Managers */
     $services['eventsManager'] = new Service('eventsManager', 'Phalcon\\Events\\Manager', true);
     $services['transactionManager'] = new Service('transactionManager', 'Phalcon\\Mvc\\Model\\Transaction\\Manager');
     //Update array
     $this->_services = $services;
 }
开发者ID:aisuhua,项目名称:phalcon-php,代码行数:27,代码来源:CLI.php

示例8: __construct

 public function __construct()
 {
     parent::__construct();
 }
开发者ID:aciden,项目名称:generator,代码行数:4,代码来源:Config.php


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