From 779b1a1cc28533bafd7eff6db2a505ae922cb8c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=97=E4=B8=9E?= Date: Tue, 12 Feb 2019 13:46:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 6 +++++ composer.json | 39 +++++++++++++++++++++++++++++++ phpunit.xml | 24 +++++++++++++++++++ src/Config.php | 57 ++++++++++++++++++++++++++++++++++++++++++++++ src/build/Base.php | 37 ++++++++++++++++++++++++++++++ src/helper.php | 0 6 files changed, 163 insertions(+) create mode 100644 composer.json create mode 100644 phpunit.xml create mode 100644 src/Config.php create mode 100644 src/build/Base.php create mode 100644 src/helper.php diff --git a/.gitignore b/.gitignore index e69de29..9fcd5ec 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,6 @@ +.idea +.DS_Store +/vendor +composer.lock +/attachment +/tests \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..8f80876 --- /dev/null +++ b/composer.json @@ -0,0 +1,39 @@ +{ + "name": "nancheng/pfinal-config", + "authors": [ + { + "name": "南丞", + "email": "Lampxiezi@163.com", + "homepage": "http://friday-go.cc/" + } + ], + "homepage": "https://github.com/Neroxiezi/pfinal-config", + "license": "MIT", + "keywords": [ + "pfinal", + "南丞", + "Q哥", + "php-config", + "config", + "pfinal-config" + ], + "require": { + "php": ">=5.4.0" + }, + "autoload": { + "psr-4": { + "pf\\config\\": "src/" + }, + "files": [ + "src/helper.php" + ] + }, + "autoload-dev": { + "psr-4": { + "tests\\": "tests" + } + }, + "require-dev": { + "phpunit/phpunit": "6.2" + } +} diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..3668533 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,24 @@ + + + + + ./tests + + + + + ./app + + + + + + \ No newline at end of file diff --git a/src/Config.php b/src/Config.php new file mode 100644 index 0000000..458c38a --- /dev/null +++ b/src/Config.php @@ -0,0 +1,57 @@ +_/___.' >'"". + * | | : `- \`.;`\ _ /`;.`/ - ` : | | + * \ \ `-. \_ __\ /__ _/ .-` / / + * ========`-.____`-.___\_____/___.-`____.-'======== + * `=---=' + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + * 佛祖保佑 永无BUG 永不修改 + * + */ + +namespace pf\config; + +use pf\config\build\Base; + +class Config +{ + protected static $link = null; + + public function __call($method, $params) + { + return call_user_func_array([self::single(), $method], $params); + } + + public static function single() + { + if (is_null(self::$link)) { + self::$link = new Base(); + } + return self::$link; + } + + public static function __callStatic($name, $arguments) + { + return call_user_func_array([self::single(), $name], $arguments); + } +} \ No newline at end of file diff --git a/src/build/Base.php b/src/build/Base.php new file mode 100644 index 0000000..5419d56 --- /dev/null +++ b/src/build/Base.php @@ -0,0 +1,37 @@ +_/___.' >'"". + * | | : `- \`.;`\ _ /`;.`/ - ` : | | + * \ \ `-. \_ __\ /__ _/ .-` / / + * ========`-.____`-.___\_____/___.-`____.-'======== + * `=---=' + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + * 佛祖保佑 永无BUG 永不修改 + * + */ + +namespace pf\config\build; + +class Base +{ + +} diff --git a/src/helper.php b/src/helper.php new file mode 100644 index 0000000..e69de29