Ejemplo n.º 1
0
 /** Logger */
 public function buildLogger()
 {
     Hmv_Log::$output_log_level = $this->container->get('config')->logger->output_log_level;
     Hmv_Log::$separate_log_flag = $this->container->get('config')->logger->separate_log_flag;
     Hmv_Log::$log_dir_path = $this->container->get('config')->logger->log_dir_path;
     return Hmv_Log::getLogger();
 }
Ejemplo n.º 2
0
}
try {
    require_once APP_PATH . '/public/SplClassLoader.php';
    $classLoader = new SplClassLoader('Hmv', APP_PATH . '/../vendor/Hmv4');
    $classLoader->setNamespaceSeparator('_');
    $classLoader->register();
    $classLoader = new SplClassLoader('Tasks', APP_PATH . '/src');
    $classLoader->setNamespaceSeparator('_');
    $classLoader->register();
    $classLoader = new SplClassLoader(null, APP_PATH . '/../vendor');
    $classLoader->setNamespaceSeparator('_');
    $classLoader->register();
    $configPath = dirname(__FILE__) . '/../config/config.' . BATCH_EXEC_ENVIRONMENT . '.php';
    $config = @(include $configPath);
    if ($config === false) {
        throw new Exception('config load error: "' . $configPath . '" file is not found.');
    }
    // PSR-0に則りきれないのでここで強制的にrequire_onceしてしまう
    require_once APP_PATH . '/../vendor/Qdmail/qdmail.php';
    require_once APP_PATH . '/../vendor/Qdmail/qdsmtp.php';
    require_once APP_PATH . '/../vendor/Amazon/S3.php';
    include APP_PATH . '/config/services.php';
    $runner = new Teamlab_Batch_Task_Runner($di);
    $runner->run();
} catch (Exception $e) {
    /** @var Hmv_Mail $mailer */
    $mailer = $di->get('mailer');
    Hmv_Log::error($e->getMessage());
    Hmv_Log::error($e->getTraceAsString());
    echo $e->getMessage();
}