12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- namespace app\admin\controller\api;
- use library\command\Sync as UpdateLogic;
- use library\Controller;
- class Update extends Controller
- {
-
- protected $baseUri = 'https://framework.thinkadmin.top';
-
- public function tree()
- {
- $this->success('获取当前文件列表成功!', UpdateLogic::build());
- }
-
- public function read($encode)
- {
- $file = env('root_path') . decode($encode);
- if (!file_exists($file)) $this->error('获取文件内容失败!');
- $this->success('获取文件内容成功!', [
- 'format' => 'base64',
- 'content' => base64_encode(file_get_contents($file)),
- ]);
- }
- }
|