php中laravel框架自带命令的实现方法

  介绍

这篇文章主要介绍了php中laravel框架自带命令的实现方法,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获、下面让小编带着大家一起了解一下。

python有哪些常用库

python常用的库:1. requesuts; 2. scrapy; 3.枕头;4.扭曲;5. numpy; 6. matplotlib; 7. pygama; 8. ipyhton等。

<强> 1,作为服务提供者,加载到程序中。

//,配置/app.php 中。
  & # 39;提供者# 39;,=祝辞,(
  ,,,//,这个便是laravel自带的艺人命令提供者
  ,,,照亮\ \供应商基础\ ArtisanServiceProvider::类,
  )

<强> 2,然后找到上下命令入口

/* *
  ,* Register 从而命令。
  ,*
  ,* @return 空白
  ,*/protected  function  registerUpCommand ()
  {
  ,,,这美元→程序→单例(& # 39;command.up& # 39;,, function  (), {
  ,,,,,,,return  new  UpCommand;
  ,,,});
  }

<强> 3,DownCommand实现

 class  DownCommand  extends 命令
  {
  ,,,/* *
  ,,,,*,从而console  command 名字。
  ,,,,
  ,,,,*,@var 字符串
  ,,,*/,,,protected  name 美元;=,& # 39;下来# 39;;
  ,
  ,,,/* *
  ,,,,*,从而console  command 描述。
  ,,,,
  ,,,,*,@var 字符串
  ,,,*/,,,protected  description 美元;=,& # 39;Put 从而application  into  maintenance 模式# 39;;
  ,
  ,,,/* *
  ,,,,*,Execute 从而console 命令。
  ,,,,
  ,,,,*,@return 空白
  ,,,*/,,,public  function 火()
  ,,,{
  ,,,,,,,//,关键点:,在当前存储目录/framework 下面创建一个,下来文件
  ,,,,,,,联系($ this→laravel→storagePath() # 39;公司/框架/下来# 39;);
  ,
  ,,,,,,,这个→美元评论(& # 39;Application  is 你拷贝maintenance 模式# 39;公司);
  ,,,}
  }
  ,
  ,//,触摸(),函数php文档解释/* *
  ,* Sets  access 以及modification  time  of 文件
  ,* @link  http://php.net/manual/en/function.touch.php
  ,* @param  string  filename 美元;& lt; p>
  ,*,name  of 从而file  being 感动。
  ,* & lt;/p>
  ,* @param  int  time 美元;(可选),& lt; p>
  ,*,touch 时间只If  time  is  not 提供,
  ,*,current  system  time  is 使用。
  ,* & lt;/p>
  ,* @param  int  atime 美元;(可选),& lt; p>
  ,* If 现在,,,access  time  of 从而given  filename  is  set 
  ,*,value  of  atime又是;否则,it  is  set 
  ,*。
  ,* & lt;/p>
  ,* @return  bool  true 提醒success 或是false 提醒失败。
  ,* @since  4.0
  ,* @since  5.0
  ,*/function  touch (文件名,美元,美元time =, null,, atime 美元;=,null), {} 

感谢你能够认真阅读完这篇文章,希望小编分享的“php中laravel框架自带命令的实现方法”这篇文章对大家有帮助,同时也希望大家多多支持,关注行业资讯频道,更多相关知识等着你来学习!

php中laravel框架自带命令的实现方法