Skip to content

Commit 079178b

Browse files
committed
Minor updates
1 parent 1b981eb commit 079178b

File tree

4 files changed

+23
-14
lines changed

4 files changed

+23
-14
lines changed

lib/common.class.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,6 +1206,8 @@ function hsvToHex($h, $s, $v)
12061206

12071207
function logAction($action_type, $details = '')
12081208
{
1209+
if (!isModuleInstalled('actions_log')) return;
1210+
12091211
global $session;
12101212
$rec = array();
12111213
$rec['ADDED'] = date('Y-m-d H:i:s');

lib/errors.class.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,13 @@ function majordomoExceptionHandler($e)
106106
$url = $_SERVER['REQUEST_URI'];
107107
} else {
108108
$url = 'commandline';
109+
global $argv;
110+
if (isset($argv[0])) {
111+
$url .= ': ' . implode(' ', $argv);
112+
}
109113
}
110114
$message = $url . "\nPHP exception: " . $e->getMessage() . " in " . $e->getFile() . " on line " . $e->getLine() . "\nBacktrace: " . $e->getTraceAsString();
111-
DebMes($message,'php_exceptions');
115+
DebMes($message, 'php_exceptions');
112116
majordomoSaveError($message, 'exceptions');
113117
return true;
114118
}
@@ -121,13 +125,17 @@ function majordomoErrorHandler($errno, $errmsg, $filename, $linenum)
121125
$url = $_SERVER['REQUEST_URI'];
122126
} else {
123127
$url = 'commandline';
128+
global $argv;
129+
if (isset($argv[0])) {
130+
$url .= ': ' . implode(' ', $argv);
131+
}
124132
}
125133

126134
$message = $url . "\nPHP error level $errno in $filename (line $linenum): " . $errmsg;
127135
if ($errno == E_WARNING) {
128-
//DebMes($message, 'php_warning');
136+
DebMes($message, 'php_warnings');
129137
} else {
130-
DebMes($message, 'php_error');
138+
DebMes($message, 'php_errors');
131139
}
132140
majordomoSaveError($message, 'errors', $filename);
133141
}

lib/general.class.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,3 +727,12 @@ function CreateDir($dirPath)
727727
if (!is_dir($dirPath))
728728
@mkdir($dirPath, 0777);
729729
}
730+
731+
function isModuleInstalled($module_name) {
732+
$flag_filename = ROOT . 'cms/modules_installed/'.$module_name.'.installed';
733+
if (file_exists($flag_filename)) {
734+
return true;
735+
} else {
736+
return false;
737+
}
738+
}

lib/module.class.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -331,18 +331,8 @@ public function saveParentParams()
331331
*/
332332
public function checkInstalled()
333333
{
334-
335-
$flag_filename = ROOT . 'cms/modules_installed/' . $this->name . '.installed';
336-
if (!file_exists($flag_filename)) {
334+
if (!isModuleInstalled($this->name)) {
337335
$this->install();
338-
} else {
339-
/*
340-
$sqlQuery = "SELECT ID FROM project_modules WHERE NAME = '" . $this->name . "'";
341-
$rec = SQLSelectOne($sqlQuery);
342-
if (!isset($rec["ID"])) {
343-
$this->install();
344-
}
345-
*/
346336
}
347337
}
348338

0 commit comments

Comments
 (0)