@@ -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 | } |
@@ -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 | }); |
@@ -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 | } |
@@ -39,7 +39,7 @@ |
||
39 | 39 | throw new \Exception('Unimplemented'); |
40 | 40 | } |
41 | 41 | |
42 | - public function quote(string $string, int $type = \PDO::PARAM_STR): string|false |
|
42 | + public function quote(string $string, int $type = \PDO::PARAM_STR): string | false |
|
43 | 43 | { |
44 | 44 | throw new \Exception('Unimplemented'); |
45 | 45 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $this->var2 = $rest; |
97 | 97 | if($this->op === 'in') |
98 | 98 | { |
99 | - $this->var2 = explode(",",trim($rest, " ()")); |
|
99 | + $this->var2 = explode(",", trim($rest, " ()")); |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | { |
116 | 116 | $array[$i] = $dataset->quote($this->var2[$i]); |
117 | 117 | } |
118 | - return $this->var1.' IN ('.implode(',',$array).')'; |
|
118 | + return $this->var1.' IN ('.implode(',', $array).')'; |
|
119 | 119 | default: |
120 | 120 | return $this->var1.$this->op.$this->var2; |
121 | 121 | break; |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | return true; |
29 | 29 | } |
30 | 30 | |
31 | - public function read($id): string|false |
|
31 | + public function read($id): string | false |
|
32 | 32 | { |
33 | 33 | $filter = new \Flipside\Data\Filter("sessionId eq '$id'"); |
34 | 34 | $data = $this->dataTable->read($filter, array('sessionData')); |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | return $this->dataTable->delete($filter); |
61 | 61 | } |
62 | 62 | |
63 | - public function gc($maxlifetime): int|false |
|
63 | + public function gc($maxlifetime): int | false |
|
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 | } |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | $stmt = $this->pdo->query($sql); |
261 | 261 | if($stmt === false) |
262 | 262 | { |
263 | - if (php_sapi_name() !== "cli") { |
|
263 | + if(php_sapi_name() !== "cli") { |
|
264 | 264 | error_log('DB query failed. '.print_r($this->pdo->errorInfo(), true)); |
265 | 265 | } |
266 | 266 | return false; |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | $sql = "INSERT INTO `$tablename` ($cols) VALUES ($set);"; |
311 | 311 | if($this->pdo->exec($sql) === false) |
312 | 312 | { |
313 | - if (php_sapi_name() !== "cli") { |
|
313 | + if(php_sapi_name() !== "cli") { |
|
314 | 314 | error_log('DB query failed. '.print_r($this->pdo->errorInfo(), true)); |
315 | 315 | } |
316 | 316 | return false; |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | return $this->pdo->errorInfo(); |
368 | 368 | } |
369 | 369 | |
370 | - public function quote(string $string, int $type = \PDO::PARAM_STR): string|false |
|
370 | + public function quote(string $string, int $type = \PDO::PARAM_STR): string | false |
|
371 | 371 | { |
372 | 372 | return $this->pdo->quote($string, $type); |
373 | 373 | } |