@@ -59,8 +59,8 @@ |
||
| 59 | 59 | return array($address); |
| 60 | 60 | } |
| 61 | 61 | $ret = array(); |
| 62 | - $ret[0] = trim(substr($address, $pos+1), '>'); |
|
| 63 | - $ret[1] = substr($address, 0, $pos-1); |
|
| 62 | + $ret[0] = trim(substr($address, $pos + 1), '>'); |
|
| 63 | + $ret[1] = substr($address, 0, $pos - 1); |
|
| 64 | 64 | return $ret; |
| 65 | 65 | } |
| 66 | 66 | |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | |
| 63 | 63 | public function gc($maxlifetime) |
| 64 | 64 | { |
| 65 | - $date = date("Y-m-d H:i:s", time()-$maxlifetime); |
|
| 65 | + $date = date("Y-m-d H:i:s", time() - $maxlifetime); |
|
| 66 | 66 | $filter = new \Flipside\Data\Filter("sessionLastAccess lt $date"); |
| 67 | 67 | return $this->dataTable->delete($filter); |
| 68 | 68 | } |
@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | use \Psr\Http\Message\ServerRequestInterface as Request; |
| 5 | 5 | use \Psr\Http\Message\ResponseInterface as Response; |
| 6 | 6 | |
| 7 | -require __DIR__ . '/../vendor/autoload.php'; |
|
| 8 | -require_once(__DIR__ . '/../static.js_css.php'); |
|
| 7 | +require __DIR__.'/../vendor/autoload.php'; |
|
| 8 | +require_once(__DIR__.'/../static.js_css.php'); |
|
| 9 | 9 | |
| 10 | 10 | class WebPage |
| 11 | 11 | { |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | public function __construct($title) |
| 18 | 18 | { |
| 19 | - \Sentry\init(['dsn' => 'https://[email protected]/4283882' ]); |
|
| 19 | + \Sentry\init(['dsn' => 'https://[email protected]/4283882']); |
|
| 20 | 20 | $this->settings = \Flipside\Settings::getInstance(); |
| 21 | 21 | $this->loader = new \Twig\Loader\FilesystemLoader(dirname(__FILE__).'/../templates'); |
| 22 | 22 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | $this->content['css'] = array($uri); |
| 113 | 113 | return; |
| 114 | 114 | } |
| 115 | - array_push($this->content['css'],$uri); |
|
| 115 | + array_push($this->content['css'], $uri); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $this->content['js'] = array($uri); |
| 128 | 128 | return; |
| 129 | 129 | } |
| 130 | - array_push($this->content['js'],$uri); |
|
| 130 | + array_push($this->content['js'], $uri); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | /** |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | { |
| 181 | 181 | $data['menu'] = $submenu; |
| 182 | 182 | } |
| 183 | - $this->content['header']['right'] = array($name => $data)+$this->content['header']['right']; |
|
| 183 | + $this->content['header']['right'] = array($name => $data) + $this->content['header']['right']; |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | /** Notification that is green for success */ |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | $settings = array("settings"=>["determineRouteBeforeAppMiddleware"=>true, 'displayErrorDetails'=> true]); |
| 12 | 12 | parent::__construct($settings); |
| 13 | 13 | $c = $this->getContainer(); |
| 14 | - $c['errorHandler'] = function($c) { return new WebErrorHandler();}; |
|
| 14 | + $c['errorHandler'] = function($c) { return new WebErrorHandler(); }; |
|
| 15 | 15 | $this->add(new AuthMiddleware()); |
| 16 | 16 | $this->add(new ODataMiddleware()); |
| 17 | 17 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | public function registerAPI($uri, $api) |
| 25 | 25 | { |
| 26 | - $group = $this->group($uri, function() use($api){$api->setup($this);}); |
|
| 26 | + $group = $this->group($uri, function() use($api){$api->setup($this); }); |
|
| 27 | 27 | $group->add(new \Flipside\Http\Rest\SerializationMiddleware()); |
| 28 | 28 | $group->add(new \Flipside\Http\Rest\CORSMiddleware($this->getContainer())); |
| 29 | 29 | } |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | $stmt = $this->pdo->query($sql); |
| 255 | 255 | if($stmt === false) |
| 256 | 256 | { |
| 257 | - if (php_sapi_name() !== "cli") { |
|
| 257 | + if(php_sapi_name() !== "cli") { |
|
| 258 | 258 | error_log('DB query failed. '.print_r($this->pdo->errorInfo(), true)); |
| 259 | 259 | } |
| 260 | 260 | return false; |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | $sql = "INSERT INTO `$tablename` ($cols) VALUES ($set);"; |
| 305 | 305 | if($this->pdo->exec($sql) === false) |
| 306 | 306 | { |
| 307 | - if (php_sapi_name() !== "cli") { |
|
| 307 | + if(php_sapi_name() !== "cli") { |
|
| 308 | 308 | error_log('DB query failed. '.print_r($this->pdo->errorInfo(), true)); |
| 309 | 309 | } |
| 310 | 310 | return false; |
@@ -131,7 +131,7 @@ |
||
| 131 | 131 | private function hashLDAPPassword($password, $salt) |
| 132 | 132 | { |
| 133 | 133 | $shaHashed = sha1($password.$salt); |
| 134 | - $packed = pack("H*",$shaHashed); |
|
| 134 | + $packed = pack("H*", $shaHashed); |
|
| 135 | 135 | $encoded = base64_encode($packed.$salt); |
| 136 | 136 | return "{SSHA}".$encoded; |
| 137 | 137 | } |
@@ -8,22 +8,22 @@ discard block |
||
| 8 | 8 | * @copyright Copyright (c) 2015, Austin Artistic Reconstruction |
| 9 | 9 | * @license http://www.apache.org/licenses/ Apache 2.0 License |
| 10 | 10 | */ |
| 11 | -if(file_exists(__DIR__ . '/vendor/autoload.php')) |
|
| 11 | +if(file_exists(__DIR__.'/vendor/autoload.php')) |
|
| 12 | 12 | { |
| 13 | - require(__DIR__ . '/vendor/autoload.php'); |
|
| 13 | + require(__DIR__.'/vendor/autoload.php'); |
|
| 14 | 14 | } |
| 15 | -set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__); |
|
| 16 | -spl_autoload_register(function ($class) { |
|
| 15 | +set_include_path(get_include_path().PATH_SEPARATOR.__DIR__); |
|
| 16 | +spl_autoload_register(function($class) { |
|
| 17 | 17 | |
| 18 | 18 | // project-specific namespace prefix |
| 19 | 19 | $prefix = 'Flipside\\'; |
| 20 | 20 | |
| 21 | 21 | // base directory for the namespace prefix |
| 22 | - $base_dir = __DIR__ . '/'; |
|
| 22 | + $base_dir = __DIR__.'/'; |
|
| 23 | 23 | |
| 24 | 24 | // does the class use the namespace prefix? |
| 25 | 25 | $len = strlen($prefix); |
| 26 | - if (strncmp($prefix, $class, $len) !== 0) { |
|
| 26 | + if(strncmp($prefix, $class, $len) !== 0) { |
|
| 27 | 27 | // no, move to the next registered autoloader |
| 28 | 28 | return; |
| 29 | 29 | } |
@@ -34,10 +34,10 @@ discard block |
||
| 34 | 34 | // replace the namespace prefix with the base directory, replace namespace |
| 35 | 35 | // separators with directory separators in the relative class name, append |
| 36 | 36 | // with .php |
| 37 | - $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; |
|
| 37 | + $file = $base_dir.str_replace('\\', '/', $relative_class).'.php'; |
|
| 38 | 38 | |
| 39 | 39 | // if the file exists, require it |
| 40 | - if (file_exists($file)) { |
|
| 40 | + if(file_exists($file)) { |
|
| 41 | 41 | require $file; |
| 42 | 42 | } |
| 43 | 43 | }); |