当前位置: 首页 > news >正文

做网站的费用如何写分录灌云县建设局网站

做网站的费用如何写分录,灌云县建设局网站,cloudflare wordpress,有什么wordpress一、原理描述 hyperf中#xff0c;不难发现比如自定义控制器中获取参数#xff0c;hyperf.php中容器获取#xff0c;传入的都是接口#xff0c;而不是实体类。 这是因为框架中的配置文件有设置对应抽象类的子类#xff0c;框架加载的时候将其作为数组#xff0c;使用的…一、原理描述 hyperf中不难发现比如自定义控制器中获取参数hyperf.php中容器获取传入的都是接口而不是实体类。 这是因为框架中的配置文件有设置对应抽象类的子类框架加载的时候将其作为数组使用的时候通过数组对应子类。 实现这个功能就需要composer autoload 代理即生成的composer.lock文件再处理。但是需要其余对应的composer拉取的程序在composer.json中设置对应数据。 例如 //vendor\hyperf\http-server\composer.json extra: {branch-alias: {dev-master: 2.2-dev},hyperf: {config: Hyperf\\HttpServer\\ConfigProvider}} //vendor\hyperf\db-connection\composer.jsonextra: {branch-alias: {dev-master: 2.2-dev},hyperf: {config: Hyperf\\DbConnection\\ConfigProvider}} #vendor/hyperf/http-server/src/ConfigProvider.php namespace Hyperf\HttpServer;use Hyperf\HttpServer\Contract\RequestInterface; use Hyperf\HttpServer\Contract\ResponseInterface; use Psr\Http\Message\ServerRequestInterface;class ConfigProvider {public function __invoke(): array{return [dependencies [RequestInterface::class Request::class,ServerRequestInterface::class Request::class,ResponseInterface::class Response::class,],annotations [scan [paths [__DIR__,],],],];} }#vendor\hyperf\db-connection\src\ConfigProvider.php namespace Hyperf\DbConnection;use Hyperf\Database\Commands\Migrations\FreshCommand; use Hyperf\Database\Commands\Migrations\GenMigrateCommand; use Hyperf\Database\Commands\Migrations\InstallCommand; use Hyperf\Database\Commands\Migrations\MigrateCommand; use Hyperf\Database\Commands\Migrations\RefreshCommand; use Hyperf\Database\Commands\Migrations\ResetCommand; use Hyperf\Database\Commands\Migrations\RollbackCommand; use Hyperf\Database\Commands\Migrations\StatusCommand; use Hyperf\Database\Commands\ModelCommand; use Hyperf\Database\Commands\Seeders\GenSeederCommand; use Hyperf\Database\Commands\Seeders\SeedCommand; use Hyperf\Database\ConnectionResolverInterface; use Hyperf\Database\Connectors\ConnectionFactory; use Hyperf\Database\Connectors\MySqlConnector; use Hyperf\Database\Migrations\MigrationRepositoryInterface; use Hyperf\DbConnection\Listener\RegisterConnectionResolverListener; use Hyperf\DbConnection\Pool\PoolFactory;class ConfigProvider {public function __invoke(): array{return [dependencies [PoolFactory::class PoolFactory::class,ConnectionFactory::class ConnectionFactory::class,ConnectionResolverInterface::class ConnectionResolver::class,db.connector.mysql MySqlConnector::class,MigrationRepositoryInterface::class DatabaseMigrationRepositoryFactory::class,],commands [ModelCommand::class,GenMigrateCommand::class,InstallCommand::class,MigrateCommand::class,FreshCommand::class,RefreshCommand::class,ResetCommand::class,RollbackCommand::class,StatusCommand::class,GenSeederCommand::class,SeedCommand::class,],listeners [RegisterConnectionResolverListener::class,],annotations [scan [paths [__DIR__,],],],publish [[id config,description The config for database.,source __DIR__ . /../publish/databases.php,destination BASE_PATH . /config/autoload/databases.php,],[id query-listener,description The listener of database to record log.,source __DIR__ . /../publish/DbQueryExecutedListener.php,destination BASE_PATH . /app/Listener/DbQueryExecutedListener.php,],],];} }以bin/hyperf.php为例,加载autoload.php文件执行Hyperf\Di\ClassLoader::init()设置执行 $application-run();输出命令。 1.1 Hyperf\Di\ClassLoader::init() Hyperf\Di\ClassLoader::init() 加载配置文件、composer.lock并合并数据。 主要使用Composer::getMergedExtra(hyperf)[config]就是composer.lock中extra中的hyperf中config值。 根据config中的值调用其__invoke()获取数组并设置。 在上述过程中涉及ProviderConfig::load();运行会对ProviderConfig::$providerConfigs数据进行初始化。 ProviderConfig::load()获取的值中包括每个composer拉取的程序中ConfigProvider.php文件中的内容当然也就包括commands。 ProviderConfig::load()在之后也会被使用。 ClassLoader::init()会调用其构造函数打印ClassLoader构造中的$config ScanConfig::instance($configDir);结果可以看到类内的成员变量包括cacheable、configDir、paths、collectors、ignoreAnnotations、globalImports、dependencies、classMap。 就bin/hyperf.php而言此时并没有使用配置中的commands数据。 1.2 /config/container.php hyperf.php中随后加载/config/container.php。 container.php中通过$container new Container((new DefinitionSourceFactory(true))());调用DefinitionSourceFactory的构造和__invoke()方法。 DefinitionSourceFactory::__invoke()中通过ProviderConfig::load();加载配置获取配置中的dependencies数组最后返回key和object对应的数组。 container.php文件最后返回 Hyperf\Di\Container类其构造参数的为DefinitionSourceFactory::__invoke()返回的数组。 Hyperf\Di\Container构造方法中会设置$this-definitionSource和$this-resolvedEntries。 1.3 $container-get() $application对象通过$application $container-get(Hyperf\Contract\ApplicationInterface::class);获取。调用$container-get()会先判断Container::resolvedEntries是否有数据有则返回否则使用Container::make()使用Container::definitionSource创建数据。最后返回对应的实体类。 即为$application $container-get(Hyperf\Contract\ApplicationInterface::class);返回ApplicationFactory类ApplicationFactory构造最后返回Symfony\Component\Console\Application类。 Hyperf\Contract\ApplicationInterface::__invoke()会先执行。其中运行Application::__construct(),设置默认值比如默认命令为“list”。__invoke()还会将commands数据添加到Symfony\Component\Console\Application中。 1.4 Application::run() 调用 $application-run();就是调用Symfony\Component\Console\Application::run()。 对于配置文件中commands的处理、console的使用也是在Application::run()方法中。 Application::run()调用Application::doRun()。 doRun()中执行默认的命令“list”运行Symfony\Component\Console\Command\ListCommand::execute(),其中运行DescriptorHelper::__construct()。 ListCommand::execute()通过DescriptorHelper::describe()运行TextDescriptor(默认)的父类Descriptor::describe()。 Descriptor::describe()中通过其子类实现的describeApplication()方法,获取项目中的commands(配置中的commands),这里即为TextDescriptor::describeApplication()。 TextDescriptor::describeApplication()中通过调用 ConsoleOutput-write()输出内容。 每个命令的execute()方法通过其父类Symfony\Component\Console\Command:run()调用。 dorun()中调用doRunCommand()这其中会调用Command:run()。 二、原理总结
http://www.pierceye.com/news/222844/

相关文章:

  • 梅州正规的免费建站微信应用开发公司
  • 百度做网站教程网站建设与维护ppt
  • 化妆品网站建设方案做咩有D网站响网吧上不了
  • 网站 迁移房地产销售基础知识大全
  • 门户网站建设汇报材料网站开发与制作中期报告
  • 网站建设可以自己弄吗知乎做网站必须要服务器吗
  • 怎么制作自己的小程序专业seo整站优化
  • 做网站是干什么用的苏宁易购网站上的营销页面
  • 浪网站制作网站开发是无形资产
  • 做阿里巴巴网站可以贷款吗seo如何快速排名百度首页
  • 公司做网站都咨询哪些问题网站平台建设视频教学
  • 西安电子商务网站建设网站里面的链接怎么做
  • 郑州陆港开发建设有限公司网站58招商加盟项目
  • 徐州高端网站建设个人网站设计首页界面
  • 山西企业建站系统平台关键词 优化 网站
  • 地板网站建设方案有什么做美食的网站
  • 网站建设丶金手指专业网站幻灯片 字段
  • 网站开发技术总结干完房产中介整个人废了
  • iis建站安装wordpress对网站建设的评价语
  • 网站开发网站建设公司二手房网
  • 72建站网如何建设一个药材网站做网站的费用 可以抵扣吗
  • 四川通信建设工程有限公司网站做企业网站需要服务器么
  • 福田建网站费用烟台招远网站建设
  • 上海网站开发建设电话丹东市做网站
  • 外贸网站 免费模板 使用 zencart做新闻类网站
  • 呼和浩特网站推广大德通网站建设
  • 携程旅行网站建设上海城市建设大学网站
  • 360网站收录做网站设计用什么软件
  • 微信html5模板网站最新网站建设软件有哪些
  • 芝麻开门网站建设无极电影网怎样下载电影