add "generate email templates" action after BB install.

display_errors turned off. When DI tries to start new session and prints notice of already started session. Then JS call does not get 'ok' message and installation's "finish" step is not reached despite successful install.
This commit is contained in:
Vaidas Lungis committed 2015-01-23 16:48:22 +02:00
1 parent a1251d7385
commit c4e413dcc9
1 file changed
+12 -10
+12 -10
View File
@@ -2,7 +2,7 @@
date_default_timezone_set('UTC');
error_reporting(E_ALL);
ini_set('display_errors', 1);
ini_set('display_errors', 0);
ini_set('display_startup_errors', 1);
ini_set('log_errors', '1');
ini_set('error_log', dirname(__FILE__) . '/php_error.log');
@@ -32,15 +32,6 @@ set_include_path(implode(PATH_SEPARATOR, array(
BB_PATH_LIBRARY,
get_include_path(),
)));
spl_autoload_register('bb_autoloader');
function bb_autoloader($className)
{
if(strpos($className, '_') !== false) {
$className = str_replace('_', DIRECTORY_SEPARATOR, $className);
}
require_once $className.'.php';
}
require BB_PATH_VENDOR . '/autoload.php';
@@ -113,6 +104,7 @@ final class Box_Installer
}
$this->makeInstall($this->session);
$this->generateEmailTemplates();
session_destroy();
print 'ok';
} catch(Exception $e) {
@@ -446,6 +438,16 @@ final class Box_Installer
throw new Exception('License Key is not valid');
}
}
private function generateEmailTemplates()
{
define('BB_PATH_MODS', BB_PATH_ROOT . '/bb-modules');
$emailService = new \Box\Mod\Email\Service();
$di = $di = include BB_PATH_ROOT . '/bb-di.php';
$emailService->setDi($di);
return $emailService->templateBatchGenerate();
}
}
$action = isset($_GET['a']) ? $_GET['a'] : 'index';