mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02:48 +08:00
修正composer安装,完善console模式
This commit is contained in:
@@ -71,12 +71,14 @@ www WEB部署目录(或者子目录)
|
|||||||
│ ├─mode 应用模式目录
|
│ ├─mode 应用模式目录
|
||||||
│ ├─tpl 系统模板目录
|
│ ├─tpl 系统模板目录
|
||||||
│ ├─tests 单元测试文件目录
|
│ ├─tests 单元测试文件目录
|
||||||
│ ├─vendor 第三方类库目录
|
|
||||||
│ ├─base.php 基础定义文件
|
│ ├─base.php 基础定义文件
|
||||||
│ ├─convention.php 框架惯例配置文件
|
│ ├─convention.php 框架惯例配置文件
|
||||||
│ ├─helper.php 助手函数文件
|
│ ├─helper.php 助手函数文件
|
||||||
│ ├─phpunit.xml phpunit配置文件
|
│ ├─phpunit.xml phpunit配置文件
|
||||||
│ └─start.php 框架入口文件
|
│ └─start.php 框架入口文件
|
||||||
|
│
|
||||||
|
├─extend 扩展类库目录
|
||||||
|
├─vendor 第三方类库目录(Composer依赖库)
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
> router.php用于php自带webserver支持,可用于快速测试
|
> router.php用于php自带webserver支持,可用于快速测试
|
||||||
|
|||||||
8
base.php
8
base.php
@@ -17,20 +17,20 @@ define('THINK_VERSION', '5.0.0 RC2');
|
|||||||
// 系统常量
|
// 系统常量
|
||||||
defined('DS') or define('DS', DIRECTORY_SEPARATOR);
|
defined('DS') or define('DS', DIRECTORY_SEPARATOR);
|
||||||
defined('THINK_PATH') or define('THINK_PATH', dirname(__FILE__) . DS);
|
defined('THINK_PATH') or define('THINK_PATH', dirname(__FILE__) . DS);
|
||||||
|
defined('APP_PATH') or define('APP_PATH', dirname($_SERVER['SCRIPT_FILENAME']) . DS);
|
||||||
|
defined('ROOT_PATH') or define('ROOT_PATH', dirname(APP_PATH) . DS);
|
||||||
defined('LIB_PATH') or define('LIB_PATH', THINK_PATH . 'library' . DS);
|
defined('LIB_PATH') or define('LIB_PATH', THINK_PATH . 'library' . DS);
|
||||||
defined('EXTEND_PATH') or define('EXTEND_PATH', THINK_PATH . 'extend' . DS);
|
defined('EXTEND_PATH') or define('EXTEND_PATH', ROOT_PATH . 'extend' . DS);
|
||||||
defined('MODE_PATH') or define('MODE_PATH', THINK_PATH . 'mode' . DS); // 系统应用模式目录
|
defined('MODE_PATH') or define('MODE_PATH', THINK_PATH . 'mode' . DS); // 系统应用模式目录
|
||||||
defined('CORE_PATH') or define('CORE_PATH', LIB_PATH . 'think' . DS);
|
defined('CORE_PATH') or define('CORE_PATH', LIB_PATH . 'think' . DS);
|
||||||
defined('TRAIT_PATH') or define('TRAIT_PATH', LIB_PATH . 'traits' . DS);
|
defined('TRAIT_PATH') or define('TRAIT_PATH', LIB_PATH . 'traits' . DS);
|
||||||
defined('APP_PATH') or define('APP_PATH', dirname($_SERVER['SCRIPT_FILENAME']) . DS);
|
|
||||||
defined('ROOT_PATH') or define('ROOT_PATH', dirname(APP_PATH) . DS);
|
|
||||||
defined('APP_NAMESPACE') or define('APP_NAMESPACE', 'app');
|
defined('APP_NAMESPACE') or define('APP_NAMESPACE', 'app');
|
||||||
defined('COMMON_MODULE') or define('COMMON_MODULE', 'common');
|
defined('COMMON_MODULE') or define('COMMON_MODULE', 'common');
|
||||||
defined('RUNTIME_PATH') or define('RUNTIME_PATH', ROOT_PATH . 'runtime' . DS);
|
defined('RUNTIME_PATH') or define('RUNTIME_PATH', ROOT_PATH . 'runtime' . DS);
|
||||||
defined('LOG_PATH') or define('LOG_PATH', RUNTIME_PATH . 'log' . DS);
|
defined('LOG_PATH') or define('LOG_PATH', RUNTIME_PATH . 'log' . DS);
|
||||||
defined('CACHE_PATH') or define('CACHE_PATH', RUNTIME_PATH . 'cache' . DS);
|
defined('CACHE_PATH') or define('CACHE_PATH', RUNTIME_PATH . 'cache' . DS);
|
||||||
defined('TEMP_PATH') or define('TEMP_PATH', RUNTIME_PATH . 'temp' . DS);
|
defined('TEMP_PATH') or define('TEMP_PATH', RUNTIME_PATH . 'temp' . DS);
|
||||||
defined('VENDOR_PATH') or define('VENDOR_PATH', THINK_PATH . 'vendor' . DS);
|
defined('VENDOR_PATH') or define('VENDOR_PATH', ROOT_PATH . 'vendor' . DS);
|
||||||
defined('EXT') or define('EXT', '.php');
|
defined('EXT') or define('EXT', '.php');
|
||||||
defined('MODEL_LAYER') or define('MODEL_LAYER', 'model');
|
defined('MODEL_LAYER') or define('MODEL_LAYER', 'model');
|
||||||
defined('VIEW_LAYER') or define('VIEW_LAYER', 'view');
|
defined('VIEW_LAYER') or define('VIEW_LAYER', 'view');
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "topthink/framework",
|
"name": "topthink/framework",
|
||||||
"description": "the new thinkphp framework",
|
"description": "the new thinkphp framework",
|
||||||
"type": "thinkphp-framework",
|
"type": "think-framework",
|
||||||
"keywords": ["framework", "thinkphp", "ORM"],
|
"keywords": [
|
||||||
|
"framework",
|
||||||
|
"thinkphp",
|
||||||
|
"ORM"
|
||||||
|
],
|
||||||
"homepage": "http://thinkphp.cn/",
|
"homepage": "http://thinkphp.cn/",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"authors": [
|
"authors": [
|
||||||
@@ -12,7 +16,8 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.4.0"
|
"php": ">=5.4.0",
|
||||||
|
"topthink/think-installer": "*"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"johnkary/phpunit-speedtrap": "^1.0",
|
"johnkary/phpunit-speedtrap": "^1.0",
|
||||||
@@ -21,5 +26,6 @@
|
|||||||
"phpunit/phpunit": "4.8.*",
|
"phpunit/phpunit": "4.8.*",
|
||||||
"sebastian/phpcpd": "*",
|
"sebastian/phpcpd": "*",
|
||||||
"squizlabs/php_codesniffer": "2.*"
|
"squizlabs/php_codesniffer": "2.*"
|
||||||
}
|
},
|
||||||
|
"minimum-stability": "dev"
|
||||||
}
|
}
|
||||||
|
|||||||
2
extend/.gitignore
vendored
2
extend/.gitignore
vendored
@@ -1,2 +0,0 @@
|
|||||||
*
|
|
||||||
!.gitignore
|
|
||||||
@@ -23,7 +23,8 @@ return [
|
|||||||
],
|
],
|
||||||
// 别名定义
|
// 别名定义
|
||||||
'alias' => [
|
'alias' => [
|
||||||
'think\Error' => MODE_PATH . 'console/Error' . EXT,
|
'think\App' => MODE_PATH . 'console/App' . EXT,
|
||||||
|
'think\Error' => MODE_PATH . 'console/Error' . EXT
|
||||||
],
|
],
|
||||||
// 配置文件
|
// 配置文件
|
||||||
'config' => [
|
'config' => [
|
||||||
|
|||||||
43
mode/console/App.php
Normal file
43
mode/console/App.php
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Copyright (c) 2006-2015 http://thinkphp.cn All rights reserved.
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Author: yunwuxin <448901948@qq.com>
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace think;
|
||||||
|
|
||||||
|
|
||||||
|
use think\Console;
|
||||||
|
|
||||||
|
class App
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 执行应用程序
|
||||||
|
* @access public
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public static function run()
|
||||||
|
{
|
||||||
|
// 实例化console
|
||||||
|
$console = new Console('Think Console', '0.1');
|
||||||
|
// 读取指令集
|
||||||
|
if (is_file(APP_PATH . 'command' . EXT)) {
|
||||||
|
$commands = include APP_PATH . 'command' . EXT;
|
||||||
|
if (is_array($commands)) {
|
||||||
|
foreach ($commands as $command) {
|
||||||
|
if (class_exists($command) && is_subclass_of($command, "\\think\\console\\command\\Command")) {
|
||||||
|
// 注册指令
|
||||||
|
$console->add(new $command());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 运行
|
||||||
|
$console->run();
|
||||||
|
}
|
||||||
|
}
|
||||||
2
vendor/.gitignore
vendored
2
vendor/.gitignore
vendored
@@ -1,2 +0,0 @@
|
|||||||
*
|
|
||||||
!.gitignore
|
|
||||||
Reference in New Issue
Block a user