@@ -70,7 +70,7 @@ |
||
| 70 | 70 | return; |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - load_user_plugins( $_SESSION["uid"]); |
|
| 73 | + load_user_plugins($_SESSION["uid"]); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | $method = strtolower($_REQUEST["op"]); |
@@ -1,9 +1,9 @@ discard block |
||
| 1 | 1 | #!/usr/bin/env php |
| 2 | 2 | <?php |
| 3 | -set_include_path(dirname(__FILE__) .DIRECTORY_SEPARATOR."include" . PATH_SEPARATOR . |
|
| 3 | +set_include_path(dirname(__FILE__).DIRECTORY_SEPARATOR."include".PATH_SEPARATOR. |
|
| 4 | 4 | get_include_path()); |
| 5 | 5 | |
| 6 | -declare(ticks = 1); |
|
| 6 | +declare(ticks=1); |
|
| 7 | 7 | chdir(dirname(__FILE__)); |
| 8 | 8 | |
| 9 | 9 | define('DISABLE_SESSIONS', true); |
@@ -93,9 +93,9 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | function shutdown($caller_pid) { |
| 95 | 95 | if ($caller_pid == posix_getpid()) { |
| 96 | - if (file_exists(LOCK_DIRECTORY . "/update_daemon.lock")) { |
|
| 96 | + if (file_exists(LOCK_DIRECTORY."/update_daemon.lock")) { |
|
| 97 | 97 | Debug::log("removing lockfile (master)..."); |
| 98 | - unlink(LOCK_DIRECTORY . "/update_daemon.lock"); |
|
| 98 | + unlink(LOCK_DIRECTORY."/update_daemon.lock"); |
|
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | 101 | } |
@@ -103,9 +103,9 @@ discard block |
||
| 103 | 103 | function task_shutdown() { |
| 104 | 104 | $pid = posix_getpid(); |
| 105 | 105 | |
| 106 | - if (file_exists(LOCK_DIRECTORY . "/update_daemon-$pid.lock")) { |
|
| 106 | + if (file_exists(LOCK_DIRECTORY."/update_daemon-$pid.lock")) { |
|
| 107 | 107 | Debug::log("removing lockfile ($pid)..."); |
| 108 | - unlink(LOCK_DIRECTORY . "/update_daemon-$pid.lock"); |
|
| 108 | + unlink(LOCK_DIRECTORY."/update_daemon-$pid.lock"); |
|
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | |
@@ -134,15 +134,15 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | $options = getopt("", $longopts); |
| 136 | 136 | |
| 137 | -if (isset($options["help"]) ) { |
|
| 137 | +if (isset($options["help"])) { |
|
| 138 | 138 | print "Tiny Tiny RSS update daemon.\n\n"; |
| 139 | 139 | print "Options:\n"; |
| 140 | 140 | print " --log FILE - log messages to FILE\n"; |
| 141 | 141 | print " --log-level N - log verbosity level\n"; |
| 142 | 142 | print " --tasks N - amount of update tasks to spawn\n"; |
| 143 | - print " default: " . MAX_JOBS . "\n"; |
|
| 143 | + print " default: ".MAX_JOBS."\n"; |
|
| 144 | 144 | print " --interval N - task spawn interval\n"; |
| 145 | - print " default: " . SPAWN_INTERVAL . " seconds.\n"; |
|
| 145 | + print " default: ".SPAWN_INTERVAL." seconds.\n"; |
|
| 146 | 146 | print " --quiet - don't output messages to stdout\n"; |
| 147 | 147 | return; |
| 148 | 148 | } |
@@ -150,13 +150,13 @@ discard block |
||
| 150 | 150 | Debug::set_enabled(true); |
| 151 | 151 | |
| 152 | 152 | if (isset($options["log-level"])) { |
| 153 | - Debug::set_loglevel((int)$options["log-level"]); |
|
| 153 | + Debug::set_loglevel((int) $options["log-level"]); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | if (isset($options["log"])) { |
| 157 | 157 | Debug::set_quiet(isset($options['quiet'])); |
| 158 | 158 | Debug::set_logfile($options["log"]); |
| 159 | - Debug::log("Logging to " . $options["log"]); |
|
| 159 | + Debug::log("Logging to ".$options["log"]); |
|
| 160 | 160 | } else { |
| 161 | 161 | if (isset($options['quiet'])) { |
| 162 | 162 | Debug::set_loglevel(Debug::$LOG_DISABLED); |
@@ -164,14 +164,14 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | if (isset($options["tasks"])) { |
| 167 | - Debug::log("Set to spawn " . $options["tasks"] . " children."); |
|
| 167 | + Debug::log("Set to spawn ".$options["tasks"]." children."); |
|
| 168 | 168 | $max_jobs = $options["tasks"]; |
| 169 | 169 | } else { |
| 170 | 170 | $max_jobs = MAX_JOBS; |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | if (isset($options["interval"])) { |
| 174 | - Debug::log("Spawn interval: " . $options["interval"] . " seconds."); |
|
| 174 | + Debug::log("Spawn interval: ".$options["interval"]." seconds."); |
|
| 175 | 175 | $spawn_interval = $options["interval"]; |
| 176 | 176 | } else { |
| 177 | 177 | $spawn_interval = SPAWN_INTERVAL; |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | |
| 247 | 247 | $my_pid = posix_getpid(); |
| 248 | 248 | |
| 249 | - passthru(PHP_EXECUTABLE . " update.php --daemon-loop $quiet $log --task $j --pidlock $my_pid"); |
|
| 249 | + passthru(PHP_EXECUTABLE." update.php --daemon-loop $quiet $log --task $j --pidlock $my_pid"); |
|
| 250 | 250 | |
| 251 | 251 | sleep(1); |
| 252 | 252 | |
@@ -135,17 +135,17 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | function pdo_connect($host, $user, $pass, $db, $type, $port = false) { |
| 137 | 137 | |
| 138 | - $db_port = $port ? ';port=' . $port : ''; |
|
| 139 | - $db_host = $host ? ';host=' . $host : ''; |
|
| 138 | + $db_port = $port ? ';port='.$port : ''; |
|
| 139 | + $db_host = $host ? ';host='.$host : ''; |
|
| 140 | 140 | |
| 141 | 141 | try { |
| 142 | - $pdo = new PDO($type . ':dbname=' . $db . $db_host . $db_port, |
|
| 142 | + $pdo = new PDO($type.':dbname='.$db.$db_host.$db_port, |
|
| 143 | 143 | $user, |
| 144 | 144 | $pass); |
| 145 | 145 | |
| 146 | 146 | return $pdo; |
| 147 | 147 | } catch (Exception $e) { |
| 148 | - print "<div class='alert alert-danger'>" . $e->getMessage() . "</div>"; |
|
| 148 | + print "<div class='alert alert-danger'>".$e->getMessage()."</div>"; |
|
| 149 | 149 | return null; |
| 150 | 150 | } |
| 151 | 151 | } |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | |
| 440 | 440 | if (!$res) { |
| 441 | 441 | print_notice("Query: $line"); |
| 442 | - print_error("Error: " . implode(", ", $pdo->errorInfo())); |
|
| 442 | + print_error("Error: ".implode(", ", $pdo->errorInfo())); |
|
| 443 | 443 | } |
| 444 | 444 | } |
| 445 | 445 | } |