Compare commits
5 Commits
release-0.
...
release-0.
| Author | SHA1 | Date | |
|---|---|---|---|
| e84c1eba42 | |||
| b93efc9878 | |||
| 9697654594 | |||
| 5121f78cea | |||
| dbc1252bef |
@@ -16,8 +16,8 @@ class RippingCluster_LogEntry extends SihnonFramework_LogEntry {
|
|||||||
static::$types['job_id'] = 'int';
|
static::$types['job_id'] = 'int';
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function __construct($level, $category, $ctime, $pid, $file, $line, $message, $job_id) {
|
protected function __construct($level, $category, $ctime, $hostname, $progname, $pid, $file, $line, $message, $job_id) {
|
||||||
parent::__construct($level, $category, $ctime, $pid, $file, $line, $message);
|
parent::__construct($level, $category, $ctime, $hostname, $progname, $pid, $file, $line, $message);
|
||||||
|
|
||||||
$this->job_id = $job_id;
|
$this->job_id = $job_id;
|
||||||
}
|
}
|
||||||
@@ -27,6 +27,8 @@ class RippingCluster_LogEntry extends SihnonFramework_LogEntry {
|
|||||||
$row['level'],
|
$row['level'],
|
||||||
$row['category'],
|
$row['category'],
|
||||||
$row['ctime'],
|
$row['ctime'],
|
||||||
|
$row['hostname'],
|
||||||
|
$row['progname'],
|
||||||
$row['pid'],
|
$row['pid'],
|
||||||
$row['file'],
|
$row['file'],
|
||||||
$row['line'],
|
$row['line'],
|
||||||
@@ -40,8 +42,8 @@ class RippingCluster_LogEntry extends SihnonFramework_LogEntry {
|
|||||||
$this->level,
|
$this->level,
|
||||||
$this->category,
|
$this->category,
|
||||||
$this->ctime,
|
$this->ctime,
|
||||||
static::$hostname,
|
$this->hostname,
|
||||||
static::$progname,
|
$this->progname,
|
||||||
$this->pid,
|
$this->pid,
|
||||||
$this->file,
|
$this->file,
|
||||||
$this->line,
|
$this->line,
|
||||||
@@ -56,7 +58,7 @@ class RippingCluster_LogEntry extends SihnonFramework_LogEntry {
|
|||||||
|
|
||||||
protected static function log($logger, $severity, $job_id, $message, $category = SihnonFramework_Log::CATEGORY_DEFAULT) {
|
protected static function log($logger, $severity, $job_id, $message, $category = SihnonFramework_Log::CATEGORY_DEFAULT) {
|
||||||
$backtrace = debug_backtrace(false);
|
$backtrace = debug_backtrace(false);
|
||||||
$entry = new self($severity, $category, time(), getmypid(), $backtrace[1]['file'], $backtrace[1]['line'], $message, $job_id);
|
$entry = new self($severity, $category, time(), static::$localHostname, static::$localProgname, getmypid(), $backtrace[1]['file'], $backtrace[1]['line'], $message, $job_id);
|
||||||
|
|
||||||
$logger->log($entry);
|
$logger->log($entry);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,19 +16,22 @@ class RippingCluster_Main extends SihnonFramework_Main {
|
|||||||
|
|
||||||
$this->request = new RippingCluster_RequestParser($request_string);
|
$this->request = new RippingCluster_RequestParser($request_string);
|
||||||
|
|
||||||
if (HBC_File == 'index') {
|
switch (HBC_File) {
|
||||||
$this->smarty = new Smarty();
|
case 'index': {
|
||||||
$this->smarty->template_dir = './source/templates';
|
$this->smarty = new Smarty();
|
||||||
$this->smarty->compile_dir = './tmp/templates';
|
$this->smarty->template_dir = './source/templates';
|
||||||
$this->smarty->cache_dir = './tmp/cache';
|
$this->smarty->compile_dir = './tmp/templates';
|
||||||
$this->smarty->config_dir = './config';
|
$this->smarty->cache_dir = './tmp/cache';
|
||||||
|
$this->smarty->config_dir = './config';
|
||||||
|
|
||||||
$this->smarty->registerPlugin('modifier', 'formatDuration', array('RippingCluster_Main', 'formatDuration'));
|
$this->smarty->registerPlugin('modifier', 'formatDuration', array('RippingCluster_Main', 'formatDuration'));
|
||||||
|
|
||||||
$this->smarty->assign('version', '0.1');
|
$this->smarty->assign('version', '0.1');
|
||||||
$this->smarty->assign('messages', array());
|
$this->smarty->assign('messages', array());
|
||||||
|
|
||||||
|
$this->smarty->assign('base_uri', $this->base_uri);
|
||||||
|
} break;
|
||||||
|
|
||||||
$this->smarty->assign('base_uri', $this->base_uri);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ require '_inc.php';
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$main = RippingCluster_Main::instance();
|
$main = RippingCluster_Main::instance();
|
||||||
|
RippingCluster_LogEntry::setLocalProgname('webui');
|
||||||
$smarty = $main->smarty();
|
$smarty = $main->smarty();
|
||||||
|
|
||||||
$page = new RippingCluster_Page($smarty, $main->request());
|
$page = new RippingCluster_Page($smarty, $main->request());
|
||||||
|
|||||||
@@ -2,7 +2,17 @@
|
|||||||
|
|
||||||
define('HBC_File', 'worker');
|
define('HBC_File', 'worker');
|
||||||
|
|
||||||
require_once '/etc/ripping-cluster/config.php';
|
$options = array();
|
||||||
|
if (isset($_SERVER['argv'])) {
|
||||||
|
$options = getopt('c:', array('config:'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($options['config'])) {
|
||||||
|
require_once $options['config'];
|
||||||
|
} else {
|
||||||
|
require_once '/etc/ripping-cluster/config.php';
|
||||||
|
}
|
||||||
|
|
||||||
require_once(SihnonFramework_Lib . 'SihnonFramework/Main.class.php');
|
require_once(SihnonFramework_Lib . 'SihnonFramework/Main.class.php');
|
||||||
require_once 'Net/Gearman/Worker.php';
|
require_once 'Net/Gearman/Worker.php';
|
||||||
|
|
||||||
@@ -16,6 +26,7 @@ try {
|
|||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
|
||||||
$main = RippingCluster_Main::instance();
|
$main = RippingCluster_Main::instance();
|
||||||
|
RippingCluster_LogEntry::setLocalProgname('ripping-cluster-worker');
|
||||||
$smarty = $main->smarty();
|
$smarty = $main->smarty();
|
||||||
|
|
||||||
$worker = new RippingCluster_Worker();
|
$worker = new RippingCluster_Worker();
|
||||||
|
|||||||
Reference in New Issue
Block a user