src/CustomBundle/Biz/Common/CustomSystemInitializer.php
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
namespace CustomBundle\Biz\Common;
class CustomSystemInitializer
{
protected $biz;
protected $output;
public function __construct($biz, $output)
{
$this->biz = $biz;
$this->output = $output;
}
public function init()
{
// $this->output->write(' 初始化定制的数据 ');
// $this->initData();
// $this->initJob();
// $this->output->writeln(' ...<info>成功</info>');
}
private function initData()
{
$db = $this->biz['db'];
}
private function initJob()
{
$source = 'Custom';
$jobMap = array(
'jobName' => array(
'expression' => '* * * * *',
'class' => 'tta',
),
);
$defaultJob = array(
'pool' => 'default',
'source' => $source,
'args' => array(),
);
foreach ($jobMap as $key => $job) {
$count = $this->getSchedulerService()->countJobs(array('name' => $key, 'source' => $source));
if (0 == $count) {
$job = array_merge($defaultJob, $job);
$job['name'] = $key;
$this->getSchedulerService()->register($job);
}
}
}
private function getSettingService()
{
return $this->biz->service('System:SettingService');
}
private function getSchedulerService()
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。