示例#1
0
文件: Hades.php 项目: tronsha/hades
 /**
  *
  */
 public function __construct()
 {
     session_start();
     $this->session = session_id();
     $this->config = Cerberus::loadConfig();
     $this->db = new Db($this->config['db']);
     $this->db->connect();
     $this->action = new Action(null, $this->db);
     $this->translate = new Translate();
     $this->translate->setLanguage('de');
     $this->translate->loadTranslationFile('frontend');
 }
示例#2
0
    $console = Cerberus::getConsole();
    foreach ($output as $line) {
        if ($line === 'FAILURES!') {
            $console->writeln('<error>' . $line . '</error>');
        } else {
            $console->writeln($line);
        }
    }
    end($output);
    if (prev($output) === 'FAILURES!') {
        exit;
    }
    unset($output);
    chdir(__DIR__);
}
$config = Cerberus::loadConfig();
if ($config['bot']['autostart']) {
    $db = new Db($config['db']);
    $db->connect();
    $bots = $db->getActiveBotList();
    $botCount = 0;
    if ($bots) {
        exec('ps -e | grep php', $output);
        $pidList = [];
        foreach ($output as $line) {
            $data = explode(' ', trim(preg_replace('/[ ]+/', ' ', $line)));
            if ($data[3] === 'php') {
                $pidList[] = $data[0];
            }
        }
        foreach ($bots as $bot) {