Skip to content

Commit

Permalink
移除路径助手函数
Browse files Browse the repository at this point in the history
  • Loading branch information
yunwuxin committed Jul 9, 2019
1 parent 41333ab commit 06b8e28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 84 deletions.
7 changes: 2 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "topthink/think-helper",
"description": "The ThinkPHP5 Helper Package",
"description": "The ThinkPHP6 Helper Package",
"license": "Apache-2.0",
"authors": [
{
Expand All @@ -16,8 +16,5 @@
"src/helper.php"
]
},
"minimum-stability": "dev",
"require": {
"topthink/framework": "^6.0"
}
"minimum-stability": "dev"
}
80 changes: 1 addition & 79 deletions src/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,84 +80,6 @@ function throw_unless($condition, $exception, ...$parameters)
}
}

if (!function_exists('app_path')) {
/**
* 获取当前应用目录
*
* @param string $path
* @return string
*/
function app_path($path = '')
{
return app()->getAppPath() . ($path ? $path . DIRECTORY_SEPARATOR : $path);
}
}

if (!function_exists('base_path')) {
/**
* 获取应用基础目录
*
* @param string $path
* @return string
*/
function base_path($path = '')
{
return app()->getBasePath() . ($path ? $path . DIRECTORY_SEPARATOR : $path);
}
}

if (!function_exists('config_path')) {
/**
* 获取应用配置目录
*
* @param string $path
* @return string
*/
function config_path($path = '')
{
return app()->getConfigPath() . ($path ? $path . DIRECTORY_SEPARATOR : $path);
}
}

if (!function_exists('public_path')) {
/**
* 获取web根目录
*
* @param string $path
* @return string
*/
function public_path($path = '')
{
return app()->getRootPath() . ($path ? ltrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR : $path);
}
}

if (!function_exists('runtime_path')) {
/**
* 获取web根目录
*
* @param string $path
* @return string
*/
function runtime_path($path = '')
{
return app()->getRuntimePath() . ($path ? $path . DIRECTORY_SEPARATOR : $path);
}
}

if (!function_exists('root_path')) {
/**
* 获取项目根目录
*
* @param string $path
* @return string
*/
function root_path($path = '')
{
return app()->getRootPath() . ($path ? $path . DIRECTORY_SEPARATOR : $path);
}
}

if (!function_exists('tap')) {
/**
* 对一个值调用给定的闭包,然后返回该值
Expand Down Expand Up @@ -326,4 +248,4 @@ function data_set(&$target, $key, $value, $overwrite = true)

return $target;
}
}
}

0 comments on commit 06b8e28

Please sign in to comment.