update
This commit is contained in:
32
module/Application/src/Command/BasicCommand.php
Normal file
32
module/Application/src/Command/BasicCommand.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @author:llbjj
|
||||
* @DateTime:2022/5/9 14:31
|
||||
* @Description:
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Application\Command;
|
||||
|
||||
use Interop\Container\Containerinterface;
|
||||
use Application\Common\Container;
|
||||
use Application\Service\Extension\Laminas;
|
||||
|
||||
class BasicCommand extends \Symfony\Component\Console\Command\Command
|
||||
{
|
||||
protected $container;
|
||||
public function __construct(Containerinterface $container)
|
||||
{
|
||||
parent::__construct(null);
|
||||
$this->container = $container;
|
||||
if(empty(Laminas::$serviceManager)) {
|
||||
Laminas::initialize($this->container->get('Application'));
|
||||
}
|
||||
date_default_timezone_set('Asia/Chongqing');
|
||||
}
|
||||
|
||||
public function LocalService(){
|
||||
return new Container($this->container);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user