改名
This commit is contained in:
@@ -38,6 +38,17 @@ class Application extends BaseApplication
|
|||||||
public $id = 'uniqueId';
|
public $id = 'uniqueId';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Application constructor.
|
||||||
|
* @param array $config
|
||||||
|
*/
|
||||||
|
public function __construct(array $config = [])
|
||||||
|
{
|
||||||
|
$this->scanning();
|
||||||
|
parent::__construct($config);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws ConfigException
|
* @throws ConfigException
|
||||||
* @throws NotFindClassException
|
* @throws NotFindClassException
|
||||||
@@ -109,6 +120,17 @@ class Application extends BaseApplication
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private function scanning()
|
||||||
|
{
|
||||||
|
$this->debug('start scanning...');
|
||||||
|
loadByDir(__DIR__ . '/../');
|
||||||
|
$this->debug('scanning end...');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $className
|
* @param $className
|
||||||
* @param null $abstracts
|
* @param null $abstracts
|
||||||
|
|||||||
@@ -32,6 +32,27 @@ if (!function_exists('make')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!function_exists('loadByDir')) {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $path
|
||||||
|
*/
|
||||||
|
function loadByDir($path)
|
||||||
|
{
|
||||||
|
$path = rtrim($path, '/');
|
||||||
|
foreach (glob($path . '/*') as $value) {
|
||||||
|
if (is_dir($value)) {
|
||||||
|
loadByDir($value);
|
||||||
|
}else{
|
||||||
|
include_once "$value";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user