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

网站不备案有什么影响wordpress文章到微信二维码

网站不备案有什么影响,wordpress文章到微信二维码,德语网站制作,招聘网找工作使用 Laravel5.5 开发一个自动交割的项目#xff0c;把使用到的开源扩展包及特性整理起来#xff0c;以供后续使用。一、安装IDE提示工具Laravel IDE Helper 是一个极其好用的代码提示及补全工具#xff0c;可以给编写代码带来极大的便利。1、安装# 如果只想在开发环境安装请…使用 Laravel5.5 开发一个自动交割的项目把使用到的开源扩展包及特性整理起来以供后续使用。一、安装IDE提示工具Laravel IDE Helper 是一个极其好用的代码提示及补全工具可以给编写代码带来极大的便利。1、安装# 如果只想在开发环境安装请加上 --devcomposer require barryvdh/laravel-ide-helper安装 doctrine/dbal 「请装上它在为模型注释字段的时候必须用到它」# 如果只想在开发环境安装请加上 --devcomposer require doctrine/dbal: ~2.3三个常用命令php artisan ide-helper:generate - 为 Facades 生成注释php artisan ide-helper:models - 为数据模型生成注释php artisan ide-helper:meta - 生成 PhpStorm Meta file二、Monolog日志包日志的重要程度不言而喻, 不管是在开发过程中, 还是部署到生产环境后, 都是经常使用的.随着 psr-3 的出现, 终于统一了 php 中日志的风格.但是, 好用的记录日志系统, 也很重要.monolog 是我遇到的最好的日志系统.而且, laravel 中也是用的 monolog。安装composer require monolog/monolog用法use Monolog\Logger;use Monolog\Handler\StreamHandler;// create a log channel$log new Logger(name);$log-pushHandler(new StreamHandler(path/to/your.log, Logger::WARNING));// $logger-pushHandler(new StreamHandler(storage_path() . /logs/spider.log));// add records to the log$log-warning(Foo);$log-error(Bar);三、抓包工具Guzzle 是一个十分强大的php的模拟HTTP client的第三方库可以通过composer安装Goutte 是一个用来解析HTML文档的第三方库可以通过composer安装安装composer require fabpot/gouttecomposer require guzzlehttp/guzzle创建命令php artisan make:command Spider命令参数// concurrency为并发数 keyWords为查询关键词protected $signature command:spider {concurrency} {keyWords*};实战namespace App\Console\Commands;use Goutte\Client as GoutteClient;use GuzzleHttp\Client as GuzzleClient;use GuzzleHttp\Pool;use Illuminate\Console\Command;use Monolog\Logger;use Monolog\Handler\StreamHandler;class Spider extends Command{private $totalPageCount;private $counter 1;private $concurrency 7; // 同时并发抓取private $logger null;private $urls [https://www.feixiaohao.com/currencies/bitcoin/, // BTChttps://www.feixiaohao.com/currencies/decred/, // DCR];/*** The name and signature of the console command.** var string*/protected $signature test:spider-request; //concurrency为并发数 keyWords为查询关键词/*** The console command description.** var string*/protected $description php spider;/*** Create a new command instance.** return void*/public function __construct(){parent::__construct();}/*** Execute the console command.** return mixed*/public function handle(){// 实例化一个日志实例, 参数是 channel name$logger new Logger(spider);$logger-pushHandler(new StreamHandler(storage_path() . /logs/spider.log));$this-totalPageCount count($this-urls);$guzzleClent new GuzzleClient();$client new GoutteClient();$client-setClient($guzzleClent);$request function ($total) use ($client){foreach ($this-urls as $url){yield function () use($client, $url){return $client-request(GET,$url);};}};// DOC http://docs.guzzlephp.org/en/stable/quickstart.html?highlightpool// /Users/kaiyiwang/Code/digcoin/vendor/symfony/dom-crawler/Crawler.php$pool new Pool($guzzleClent,$request($this-totalPageCount), [concurrency $this-concurrency,fulfilled function ($response, $index) use ($logger){$res $response-html();// print_r($res);$logger-info($res);$this-info(请求第 $index 个请求连接 . $this-urls[$index]);$this-countedAndCheckEnded();},rejected function ($reason, $index){$this-error(rejected );$this-error(rejected reason: . $reason );$this-countedAndCheckEnded();},]);// 开始发送请求$promise $pool-promise();$promise-wait();}public function countedAndCheckEnded(){if ($this-counter $this-totalPageCount){$this-counter;return;}$this-info(请求结束);}// 运行命令php artisan test:spider-request} php artisan test:spider-request四、定时任务CRON是一个守护进程它驻留在你的linux服务器中大部分时间都没有唤醒但是每一分钟它都会睁开双眼看看是否运行任何给定的任务你使用crontab文件与该守护进程通信在大多数常见的设置文件可以位于/etc/crontabcrontab文件可能看起来像这样0 0 1 * * /home/full-backup0 0 * * * /home/partial-backup30 5 10 * * /home/check-subscriptions1.添加系统定时任务在laravel中添加定时任务很简单首先在系统crontab 添加一个artisan的定时任务每分钟执行一次。 crontab -e// /home/vagrant/Code/digcoin/ laravel项目在服务器的地址* * * * * php /home/vagrant/Code/digcoin/artisan schedule:run /dev/null 212.项目中添加定时命令在 App\Console\Kernel 类的 schedule 方法中定义预定的命令protected function schedule(Schedule $schedule){// $schedule-command(inspire)// -hourly();// php artisan test:spider-request, 每十分钟调用一次$schedule-command(test:spider-request)-everyFifteenMinutes()-withoutOverlapping();}添加好了之后我们可以直接使用这个命令测试定时任务是否可以执行 php /home/vagrant/Code/digcoin/artisan test:spider-requestOK只需要简单的两步便可实现laravel的定时任务添加。
http://www.zqtcl.cn/news/750273/

相关文章:

  • 中铁建设集团门户网登录网站自己可以建设环保公益网站吗
  • 国内电子商务网站有哪些网站升级中html
  • 影响网站加载速度顺德做网站那家好
  • 如何备份网站的百度怎样建立网站
  • 如何建立网站视频教程湖北seo关键词排名优化软件
  • 南宁网站建设推荐q479185700顶上新公司网站建设流程
  • 石家庄城乡建设局网站四川网络营销
  • 网站更换名称需要重新备案吗赣州章贡区二手房出售信息
  • 浙江恒元建设网站wordpress 主题 英文
  • 甘肃网站建设推广做暧昧免费视频大全网站
  • 科技公司网站系统个人网站模板大全
  • 建网站源码建站详解做加油机公司网站
  • 北海做网站有哪家网站布局策划案
  • 做app网站的软件有哪些内容吗本地网站建设公司
  • 做服装团购有哪些网站有哪些网页端二维码在哪里
  • 石材网站建设方案科室建设网站
  • 梧州住房和建设局网站网站目录文件
  • 有没有做生鲜配送的网站wordpress调用摘要
  • 建设社团网站的可行性分析沈阳网站建设企业
  • 青岛知名网站建设公司优化大师有必要花钱吗
  • pc网站做app京东海淀区
  • 效果好的网站建设公萝岗企业网站建设
  • wordpress个人展示网站6新西兰网站后缀
  • 为什么自己做的网站别人打不开三门峡市湖滨区建设局网站
  • 长春网长春网站建设络推广工程建设国家标准网站
  • 微网站开发 mui框架网站备案幕布拍照是什么
  • 北京天通苑 做网站西安百度网站建设
  • 辽阳建设网站学校 网站 建设 目的
  • 建设电影网站赚钱公司简介模板免费word简易
  • 响应式网站设计的主页自己做装修效果图app软件