控制台应用,yzncms本身基于tp5.1框架,里面的队列用不了,bug,坑
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Sitemap.php 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. // | 网站地图插件
  13. // +----------------------------------------------------------------------
  14. namespace addons\sitemap;
  15. use app\common\library\Menu;
  16. use think\Addons;
  17. class Sitemap extends Addons
  18. {
  19. //后台菜单
  20. protected $menu = [
  21. [
  22. "name" => "sitemap",
  23. "title" => "网站地图",
  24. 'sublist' => [
  25. ['name' => 'sitemap/index', 'title' => '查看/提交'],
  26. ],
  27. ],
  28. ];
  29. /**
  30. * 插件安装方法
  31. * @return bool
  32. */
  33. public function install()
  34. {
  35. Menu::create($this->menu);
  36. return true;
  37. }
  38. /**
  39. * 插件卸载方法
  40. * @return bool
  41. */
  42. public function uninstall()
  43. {
  44. Menu::delete("sitemap");
  45. return true;
  46. }
  47. /**
  48. * 插件启用方法
  49. * @return bool
  50. */
  51. public function enable()
  52. {
  53. Menu::enable("sitemap");
  54. return true;
  55. }
  56. /**
  57. * 插件禁用方法
  58. * @return bool
  59. */
  60. public function disable()
  61. {
  62. Menu::disable("sitemap");
  63. return true;
  64. }
  65. /**
  66. * 插件升级方法
  67. */
  68. public function upgrade()
  69. {
  70. Menu::upgrade('sitemap', $this->menu);
  71. }
  72. }