init
This commit is contained in:
@@ -1,17 +1,37 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\home\controller;
|
||||
|
||||
class Index
|
||||
use app\home\BaseController;
|
||||
use storage\StorageCore;
|
||||
use think\facade\View;
|
||||
|
||||
class Index extends BaseController
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$arrConfig = config();
|
||||
echo '<pre>';
|
||||
print_r($arrConfig);
|
||||
echo '</pre>';
|
||||
// exit;
|
||||
return '您好!这是一个[home]示例应用';
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
public function test()
|
||||
{
|
||||
|
||||
$strNovelKey = "novels/12/chapters/3001.txt";
|
||||
$StorageCore = StorageCore::getInstance();
|
||||
|
||||
// $content = '我是一个大傻逼';
|
||||
|
||||
$content = file_get_contents('123.txt');
|
||||
|
||||
if ($StorageCore->has($strNovelKey)) {
|
||||
// $MinIO->update($strNovelKey, $content); // 更新已有文件
|
||||
} else {
|
||||
$StorageCore->write($strNovelKey, $content); // 创建新文件
|
||||
}
|
||||
|
||||
echo $StorageCore->read($strNovelKey);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
17
code/app/home/controller/Novel.php
Normal file
17
code/app/home/controller/Novel.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\home\controller;
|
||||
|
||||
use app\home\BaseController;
|
||||
use storage\StorageCore;
|
||||
use think\facade\View;
|
||||
|
||||
class Novel extends BaseController
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return View::fetch();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user