控制台应用,yzncms本身基于tp5.1框架,里面的队列用不了,bug,坑
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Yzncms [ 御宅男工作室 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2018 http://yzncms.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: 御宅男 <530765310@qq.com>
  10. // +----------------------------------------------------------------------
  11. // +----------------------------------------------------------------------
  12. // | API文档插件
  13. // +----------------------------------------------------------------------
  14. namespace addons\apidoc;
  15. use think\Addons;
  16. class Apidoc extends Addons
  17. {
  18. //安装
  19. public function install()
  20. {
  21. //复制配置文件
  22. $route_file = ADDON_PATH . str_replace("/", DS, "apidoc/install/apidoc.php");
  23. copy($route_file, ROOT_PATH . 'config' . DS . 'apidoc.php');
  24. return true;
  25. }
  26. //卸载
  27. public function uninstall()
  28. {
  29. //删除配置文件
  30. if (file_exists(ROOT_PATH . 'config' . DS . 'apidoc.php')) {
  31. unlink(ROOT_PATH . 'config' . DS . 'apidoc.php');
  32. }
  33. return true;
  34. }
  35. /**
  36. * 添加命名空间
  37. */
  38. public function appInit()
  39. {
  40. /*Route::group('apidoc', function () {
  41. Route::rule('', 'index/apidoc/Index');
  42. Route::rule('config', 'index/apidoc/getConfig');
  43. Route::rule('data', 'index/apidoc/getList');
  44. Route::rule('auth', 'index/apidoc/verifyAuth');
  45. });*/
  46. }
  47. }