优化catchConsole代码
This commit is contained in:
31
extend/catcher/library/Composer.php
Normal file
31
extend/catcher/library/Composer.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CatchAdmin [Just Like ~ ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: JaguarJack [ njphper@gmail.com ]
|
||||
// +----------------------------------------------------------------------
|
||||
namespace catcher\library;
|
||||
|
||||
use catcher\facade\FileSystem;
|
||||
|
||||
class Composer
|
||||
{
|
||||
public function psr4Autoload()
|
||||
{
|
||||
return $this->composerContent()['autoload']['psr-4'];
|
||||
}
|
||||
|
||||
protected function composerContent()
|
||||
{
|
||||
return \json_decode(FileSystem::get($this->composerJsonPath()), true);
|
||||
}
|
||||
|
||||
protected function composerJsonPath()
|
||||
{
|
||||
return root_path() . 'composer.json';
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user