Skip to content

Commit

Permalink
移除app/storage目录
Browse files Browse the repository at this point in the history
  • Loading branch information
weichaoduo committed Nov 24, 2020
1 parent d497a69 commit 432e4e6
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ script:
- chmod +x $TRAVIS_BUILD_DIR/travis/install-nginx.sh
- $TRAVIS_BUILD_DIR/travis/install-nginx.sh
- chown -R $(whoami):$(whoami) $TRAVIS_BUILD_DIR/app/storage
- chmod +x $TRAVIS_BUILD_DIR/app/storage
- chmod +x $TRAVIS_BUILD_DIR/storage
- curl "http://masterlab.ci:8888/framework/feature/getPhpIni?data_type=json"
- cat /tmp/error.log
- touch $TRAVIS_BUILD_DIR/app/storage/tmp/10000.png
- touch $TRAVIS_BUILD_DIR/storage/tmp/10000.png
- php app/public/test_mysql.php
- cd app/test
- sudo chmod +x $TRAVIS_BUILD_DIR
Expand Down
6 changes: 1 addition & 5 deletions app/classes/UploadLogic.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct($issueId = null)
}

/**
* 统一的上传处理逻辑,根据文件类型上传至 app/storage/attachment 下
* 统一的上传处理逻辑,根据文件类型上传至 /storage/attachment 下
* @param string $fieldName
* @param string $fileType
* @param string $uuid
Expand All @@ -42,18 +42,14 @@ public function __construct($issueId = null)
*/
public function move($fieldName, $fileType, $uuid = '', $originName = '', $originFileSize = 0, $tmpIssueId = '')
{

$settings = Settings::getInstance()->attachment();
//文件保存目录路径
$savePath = $settings['attachment_dir'];
//最大文件大小
$max_size = $settings['attachment_size'];

//文件保存目录URL
$saveUrl = ATTACHMENT_URL;

$relatePath = '';

//定义允许上传的文件扩展名
$extArr = array(
'project_image' => array('jpg', 'jpeg', 'png', 'gif'),
Expand Down
1 change: 0 additions & 1 deletion app/ctrl/admin/LogOperating.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

use main\app\classes\LogOperatingLogic;
use main\app\classes\PermissionGlobal;
use main\app\classes\SlowLogLogic;
use main\app\classes\UserAuth;
use main\app\ctrl\BaseAdminCtrl;
use main\app\model\LogOperatingModel;
Expand Down
2 changes: 1 addition & 1 deletion app/globals.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function bindAppConfig($envVarArr)
$appStatus = $envVarArr['APP_STATUS'];

// 加载主配置文件 config.yml @todo 使用yaml扩展函数将更高效
$cacheYamlConfigFile = APP_PATH . 'storage/cache/config.' . $appStatus . '.yaml.php';
$cacheYamlConfigFile = PRE_APP_PATH . 'storage/cache/config.' . $appStatus . '.yaml.php';
if ($cacheYamlConfig && file_exists($cacheYamlConfigFile)) {
include $cacheYamlConfigFile;
if (isset($_yaml_config) && !empty($_yaml_config)) {
Expand Down
1 change: 0 additions & 1 deletion app/model/DbModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ public function commit()
return $this->db->commit();
}


/**
* 执行更新性的SQL语句 ,返回受修改或删除 SQL语句影响的行数。如果没有受影响的行,则返回 0。失败返回false
* @param string $sql
Expand Down
2 changes: 1 addition & 1 deletion app/view/twig/admin/system/system_backup_data.twig
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<p>由于数据会比较复杂,可能会延迟一段时间才能完成。</p>
<hr>
<p>你可以通过备份将MasterLab数据转移到不同的数据库或其他MasterLab实例。备份文件保存在服务器上</p>
<p>备份路径为 masterlab/app/storage/backup 请确保该路径有写入权限</p>
<p>备份路径为 masterlab/storage/backup 请确保该路径有写入权限</p>
</div>
<form action="" accept-charset="UTF-8" method="post">
<input name="utf8" type="hidden" value="">
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"phpoffice/phpspreadsheet": "1.9.0",
"twig/twig": "v2.12.2",
"adldap2/adldap2": "10.2",
"doctrine/dbal": "^2.10",
"doctrine/dbal": "2.10",
"doctrine/event-manager":"1.1.0",
"doctrine/inflector":"1.3.1",
"symfony/event-dispatcher": "4.4.6",
Expand All @@ -27,9 +27,9 @@
"ext-pdo": "*",
"ext-curl": "*",
"ext-redis": "*",
"lcobucci/jwt": "^3.3",
"lasserafn/php-initial-avatar-generator": "^4.1",
"dragonmantank/cron-expression": "^3.0"
"lcobucci/jwt": "3.3",
"lasserafn/php-initial-avatar-generator": "4.1",
"dragonmantank/cron-expression": "3.0"
},
"require-dev": {
"phpunit/phpunit": "7.0",
Expand Down
4 changes: 2 additions & 2 deletions lib/SlowLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class SlowLog
* @param string $storagePath
* @return SlowLog
*/
public static function getInstance($storagePath = APP_PATH.'storage/log/slow/sql')
public static function getInstance($storagePath = STORAGE_PATH.'log/slow/sql')
{
$index = md5($storagePath);
if (!isset(self::$instance[$index]) || !is_object(self::$instance[$index])) {
Expand All @@ -24,7 +24,7 @@ public static function getInstance($storagePath = APP_PATH.'storage/log/slow/sql
return self::$instance[$index];
}

public function __construct($storagePath = APP_PATH.'storage/log/slow/sql')
public function __construct($storagePath = STORAGE_PATH.'log/slow/sql')
{
$this->pattern = new Pattern();
$this->storage_path = $storagePath;
Expand Down
1 change: 1 addition & 0 deletions public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
$hornetConfig = new \stdClass();
$hornetConfig->currentApp = APP_NAME;
$hornetConfig->appPath = APP_PATH;
$hornetConfig->storagePath = STORAGE_PATH;
$hornetConfig->appStatus = APP_STATUS;
$hornetConfig->enableTrace = ENABLE_TRACE;
$hornetConfig->enableXhprof = ENABLE_XHPROF;
Expand Down

0 comments on commit 432e4e6

Please sign in to comment.