Skip to content

Commit 2a4cc61

Browse files
author
jwarnier
committed
replace double-quotes with single-quotes whenever appropriate
1 parent 772fc1c commit 2a4cc61

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

server/server.php

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
*/
3030

31-
require("lib/config.inc.php");
32-
require("lib/app.inc.php");
31+
require('lib/config.inc.php');
32+
require('lib/app.inc.php');
3333

3434
set_time_limit(0);
3535
ini_set('error_reporting','E_ALL & ~E_NOTICE');
@@ -53,52 +53,52 @@
5353
//* Load the server configuration
5454
if($app->dbmaster->connect()) {
5555
// get the dalaog_id of the last performed record
56-
$server_db_record = $app->dbmaster->queryOneRecord("SELECT * FROM server WHERE server_id = ".$conf["server_id"]);
56+
$server_db_record = $app->dbmaster->queryOneRecord("SELECT * FROM server WHERE server_id = ".$conf['server_id']);
5757
$conf['last_datalog_id'] = (int)$server_db_record['updated'];
58-
$conf["mirror_server_id"] = (int)$server_db_record['mirror_server_id'];
58+
$conf['mirror_server_id'] = (int)$server_db_record['mirror_server_id'];
5959
// Load the ini_parser
6060
$app->uses('ini_parser');
6161
// Get server configuration
62-
$conf["serverconfig"] = $app->ini_parser->parse_ini_string(stripslashes($server_db_record["config"]));
62+
$conf['serverconfig'] = $app->ini_parser->parse_ini_string(stripslashes($server_db_record['config']));
6363
// Set the loglevel
64-
$conf["log_priority"] = intval($conf["serverconfig"]["server"]["loglevel"]);
64+
$conf['log_priority'] = intval($conf['serverconfig']['server']['loglevel']);
6565

6666
unset($server_db_record);
6767
}
6868

6969

7070
// Check whether another instance of this script is already running
71-
if(is_file($conf["temppath"].$conf["fs_div"].".ispconfig_lock")){
71+
if(is_file($conf['temppath'].$conf['fs_div'].'.ispconfig_lock')){
7272
clearstatcache();
7373
for($i=0;$i<120;$i++){ // Wait max. 1200 sec, then retry
74-
if(is_file($conf["temppath"].$conf["fs_div"].".ispconfig_lock")){
74+
if(is_file($conf['temppath'].$conf['fs_div'].'.ispconfig_lock')){
7575
exec("ps aux | grep '/usr/local/ispconfig/server/[s]erver.php' | wc -l", $check);
7676
if(intval($check[0]) > 1) { // 1 because this is 2nd instance!
77-
$app->log("There is already an instance of server.php running. Exiting.", LOGLEVEL_DEBUG);
77+
$app->log('There is already an instance of server.php running. Exiting.', LOGLEVEL_DEBUG);
7878
exit;
7979
}
80-
$app->log("There is already a lockfile set. Waiting another 10 seconds...", LOGLEVEL_DEBUG);
80+
$app->log('There is already a lockfile set. Waiting another 10 seconds...', LOGLEVEL_DEBUG);
8181
sleep(10);
8282
clearstatcache();
8383
}
8484
}
8585
}
8686

8787
// Set Lockfile
88-
@touch($conf["temppath"].$conf["fs_div"].".ispconfig_lock");
89-
$app->log("Set Lock: ".$conf["temppath"].$conf["fs_div"].".ispconfig_lock", LOGLEVEL_DEBUG);
88+
@touch($conf['temppath'].$conf['fs_div'].'.ispconfig_lock');
89+
$app->log('Set Lock: '.$conf['temppath'].$conf['fs_div'].'.ispconfig_lock', LOGLEVEL_DEBUG);
9090

9191

9292
if($app->db->connect() && $app->dbmaster->connect()) {
9393

9494
// Check if there is anything to update
95-
if($conf["mirror_server_id"] > 0) {
96-
$tmp_rec = $app->dbmaster->queryOneRecord("SELECT count(server_id) as number from sys_datalog WHERE datalog_id > ".$conf['last_datalog_id']." AND (server_id = ".$conf["server_id"]." OR server_id = ".$conf["mirror_server_id"]." OR server_id = 0)");
95+
if($conf['mirror_server_id'] > 0) {
96+
$tmp_rec = $app->dbmaster->queryOneRecord("SELECT count(server_id) as number from sys_datalog WHERE datalog_id > ".$conf['last_datalog_id']." AND (server_id = ".$conf['server_id']." OR server_id = ".$conf['mirror_server_id']." OR server_id = 0)");
9797
} else {
98-
$tmp_rec = $app->dbmaster->queryOneRecord("SELECT count(server_id) as number from sys_datalog WHERE datalog_id > ".$conf['last_datalog_id']." AND (server_id = ".$conf["server_id"]." OR server_id = 0)");
98+
$tmp_rec = $app->dbmaster->queryOneRecord("SELECT count(server_id) as number from sys_datalog WHERE datalog_id > ".$conf['last_datalog_id']." AND (server_id = ".$conf['server_id']." OR server_id = 0)");
9999
}
100100

101-
$tmp_num_records = $tmp_rec["number"];
101+
$tmp_num_records = $tmp_rec['number'];
102102
unset($tmp_rec);
103103

104104
if($tmp_num_records > 0) {
@@ -109,14 +109,14 @@
109109
$app->log("Found $tmp_num_records changes, starting update process.", LOGLEVEL_DEBUG);
110110
// Load required base-classes
111111
$app->uses('modules,plugins,file,services');
112-
// Load the modules that are im the mods-enabled folder
112+
// Load the modules that are in the mods-enabled folder
113113
$app->modules->loadModules('all');
114114
// Load the plugins that are in the plugins-enabled folder
115115
$app->plugins->loadPlugins('all');
116-
// Go trough the sys_datalog table and call the processing functions
117-
// in the modules that are hooked on to the table actions
116+
// Go through the sys_datalog table and call the processing functions
117+
// from the modules that are hooked on to the table actions
118118
$app->modules->processDatalog();
119-
// Restart services that need to be restarted after configuration
119+
// Restart services that need to after configuration
120120
$app->services->processDelayedActions();
121121
} else {
122122
/*
@@ -133,15 +133,15 @@
133133
}
134134
} else {
135135
if(!$app->db->connect()) {
136-
$app->log("Unable to connect to local server.".$app->db->errorMessage,LOGLEVEL_WARN);
136+
$app->log('Unable to connect to local server.'.$app->db->errorMessage,LOGLEVEL_WARN);
137137
} else {
138-
$app->log("Unable to connect to master server.".$app->dbmaster->errorMessage,LOGLEVEL_WARN);
138+
$app->log('Unable to connect to master server.'.$app->dbmaster->errorMessage,LOGLEVEL_WARN);
139139
}
140140
}
141141

142142
// Remove lock
143-
@unlink($conf["temppath"].$conf["fs_div"].".ispconfig_lock");
144-
$app->log("Remove Lock: ".$conf["temppath"].$conf["fs_div"].".ispconfig_lock",LOGLEVEL_DEBUG);
143+
@unlink($conf['temppath'].$conf['fs_div'].'.ispconfig_lock');
144+
$app->log('Remove Lock: '.$conf['temppath'].$conf['fs_div'].'.ispconfig_lock',LOGLEVEL_DEBUG);
145145

146146

147147
die("finished.\n");

0 commit comments

Comments
 (0)