[更新]更新目录结构,去除public目录,方便虚拟主机部署项目
@ -1,6 +1,6 @@
|
|||||||
:: Composer 安装更新脚本
|
:: Composer 安装更新脚本
|
||||||
@title Composer Install
|
@title Composer Install
|
||||||
@rmdir /s/q vendor thinkphp
|
@rmdir /s/q vendor thinkphp composer.lock
|
||||||
@echo ========= 下载并安装插件 =========
|
@echo ========= 下载并安装插件 =========
|
||||||
@composer update --profile --prefer-dist --optimize-autoloader
|
@composer update --profile --prefer-dist --optimize-autoloader
|
||||||
@echo ========= 压缩并发布插件 =========
|
@echo ========= 压缩并发布插件 =========
|
||||||
|
@ -63,7 +63,7 @@ class Plugs extends BasicAdmin {
|
|||||||
public function upload() {
|
public function upload() {
|
||||||
if ($this->request->isPost()) {
|
if ($this->request->isPost()) {
|
||||||
$md5s = str_split($this->request->post('md5'), 16);
|
$md5s = str_split($this->request->post('md5'), 16);
|
||||||
if (($info = $this->request->file('file')->move('upload' . DS . $md5s[0], $md5s[1], true))) {
|
if (($info = $this->request->file('file')->move('static' . DS . 'upload' . DS . $md5s[0], $md5s[1], true))) {
|
||||||
$filename = join('/', $md5s) . '.' . $info->getExtension();
|
$filename = join('/', $md5s) . '.' . $info->getExtension();
|
||||||
$site_url = FileService::getFileUrl($filename, 'local');
|
$site_url = FileService::getFileUrl($filename, 'local');
|
||||||
if ($site_url) {
|
if ($site_url) {
|
||||||
|
@ -119,7 +119,7 @@ class FileService {
|
|||||||
if ('' != $root) {
|
if ('' != $root) {
|
||||||
$root = '/' . ltrim($root, '/');
|
$root = '/' . ltrim($root, '/');
|
||||||
}
|
}
|
||||||
return ($request->isSsl() ? 'https' : 'http') . '://' . $request->host() . "{$root}/upload/";
|
return ($request->isSsl() ? 'https' : 'http') . '://' . $request->host() . "{$root}/static/upload/";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -139,7 +139,7 @@ class FileService {
|
|||||||
static public function hasFile($filename, $storage = null) {
|
static public function hasFile($filename, $storage = null) {
|
||||||
switch (empty($storage) ? sysconf('storage_type') : $storage) {
|
switch (empty($storage) ? sysconf('storage_type') : $storage) {
|
||||||
case 'local':
|
case 'local':
|
||||||
return file_exists(ROOT_PATH . 'public/upload/' . $filename);
|
return file_exists(ROOT_PATH . 'static/upload/' . $filename);
|
||||||
case 'qiniu':
|
case 'qiniu':
|
||||||
$auth = new Auth(sysconf('storage_qiniu_access_key'), sysconf('storage_qiniu_secret_key'));
|
$auth = new Auth(sysconf('storage_qiniu_access_key'), sysconf('storage_qiniu_secret_key'));
|
||||||
$bucketMgr = new BucketManager($auth);
|
$bucketMgr = new BucketManager($auth);
|
||||||
@ -158,7 +158,7 @@ class FileService {
|
|||||||
static public function readFile($filename, $storage = null) {
|
static public function readFile($filename, $storage = null) {
|
||||||
switch (empty($storage) ? sysconf('storage_type') : $storage) {
|
switch (empty($storage) ? sysconf('storage_type') : $storage) {
|
||||||
case 'local':
|
case 'local':
|
||||||
$filepath = ROOT_PATH . 'public/upload/' . $filename;
|
$filepath = ROOT_PATH . 'static/upload/' . $filename;
|
||||||
if (file_exists($filepath)) {
|
if (file_exists($filepath)) {
|
||||||
return file_get_contents($filepath);
|
return file_get_contents($filepath);
|
||||||
}
|
}
|
||||||
@ -193,7 +193,7 @@ class FileService {
|
|||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
static public function local($filename, $bodycontent) {
|
static public function local($filename, $bodycontent) {
|
||||||
$filepath = ROOT_PATH . 'public/upload/' . $filename;
|
$filepath = ROOT_PATH . 'static/upload/' . $filename;
|
||||||
try {
|
try {
|
||||||
!file_exists(dirname($filepath)) && mkdir(dirname($filepath), '0755', true);
|
!file_exists(dirname($filepath)) && mkdir(dirname($filepath), '0755', true);
|
||||||
if (file_put_contents($filepath, $bodycontent)) {
|
if (file_put_contents($filepath, $bodycontent)) {
|
||||||
|
@ -14,7 +14,12 @@
|
|||||||
|
|
||||||
/* SESSION会话名称 */
|
/* SESSION会话名称 */
|
||||||
session_name(md5(__FILE__));
|
session_name(md5(__FILE__));
|
||||||
|
|
||||||
/* 定义应用目录 */
|
/* 定义应用目录 */
|
||||||
define('APP_PATH', dirname(__DIR__) . '/application/');
|
define('APP_PATH', __DIR__ . '/application/');
|
||||||
|
|
||||||
|
/* 定义Runtime运行目录 */
|
||||||
|
define('RUNTIME_PATH', __DIR__ . '/static/~runtime/');
|
||||||
|
|
||||||
/* 加载框架引导文件 */
|
/* 加载框架引导文件 */
|
||||||
require dirname(__DIR__) . '/thinkphp/start.php';
|
require __DIR__ . '/thinkphp/start.php';
|
@ -1 +0,0 @@
|
|||||||
jEBPQR2mtMH4lwUJ
|
|
Before Width: | Height: | Size: 1.1 KiB |
@ -1,2 +0,0 @@
|
|||||||
User-agent: *
|
|
||||||
Disallow:
|
|
@ -1,19 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Think.Admin
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | 版权所有 2014~2017 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | 官方网站: http://think.ctolog.com
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | 开源协议 ( https://mit-license.org )
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | github开源项目:https://github.com/zoujingli/Think.Admin
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
|
|
||||||
if (is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["REQUEST_URI"])) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
require __DIR__ . "/index.php";
|
|
||||||
}
|
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 106 KiB |
Before Width: | Height: | Size: 314 B After Width: | Height: | Size: 314 B |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 701 B After Width: | Height: | Size: 701 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |