@@ -46,7 +46,7 @@ |
||
46 | 46 | $filename = implode(".", $filename); |
47 | 47 | $image->path = $dir . '/' . $filename; |
48 | 48 | $image->save(); |
49 | - } |
|
49 | + } |
|
50 | 50 | |
51 | 51 | public function getRandomFrame() |
52 | 52 | { |
@@ -11,15 +11,15 @@ |
||
11 | 11 | |
12 | 12 | $command = []; |
13 | 13 | $command[] = '/usr/bin/ffmpeg'; |
14 | - $command[] = "-i ".escapeshellarg($this->path); |
|
14 | + $command[] = "-i " . escapeshellarg($this->path); |
|
15 | 15 | foreach ($params as $key => $value) { |
16 | - $command[] = "-$key ".escapeshellarg($value); |
|
16 | + $command[] = "-$key " . escapeshellarg($value); |
|
17 | 17 | } |
18 | 18 | |
19 | - $path = dirname($this->path) .DIRECTORY_SEPARATOR. pathinfo($this->path, PATHINFO_FILENAME) . '.' . strtolower($params['f']); |
|
19 | + $path = dirname($this->path) . DIRECTORY_SEPARATOR . pathinfo($this->path, PATHINFO_FILENAME) . '.' . strtolower($params['f']); |
|
20 | 20 | $command[] = $path; |
21 | 21 | |
22 | - $command = implode(" ", $command) . " && chmod 777 $path".($removeOriginal ? " && rm $this->path" : ""); |
|
22 | + $command = implode(" ", $command) . " && chmod 777 $path" . ($removeOriginal ? " && rm $this->path" : ""); |
|
23 | 23 | |
24 | 24 | $process = new Process($command); |
25 | 25 | $process->start(); |
@@ -90,13 +90,13 @@ |
||
90 | 90 | public function save() { |
91 | 91 | $expire = $this->getExpire(); |
92 | 92 | if (!$expire) { |
93 | - $timer = $this->getExpireTimer() ? $this->getExpireTimer() : 3*60*60; |
|
93 | + $timer = $this->getExpireTimer() ? $this->getExpireTimer() : 3 * 60 * 60; |
|
94 | 94 | $expire = time() + $timer; |
95 | 95 | |
96 | 96 | } |
97 | 97 | $domain = ($this->getDomain() != 'localhost') ? $this->getDomain() : false; |
98 | 98 | |
99 | - return setcookie ( |
|
99 | + return setcookie( |
|
100 | 100 | $this->getName(), |
101 | 101 | $this->getValue(), |
102 | 102 | $expire, |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | /** |
16 | 16 | * @return Cookie |
17 | - */ |
|
17 | + */ |
|
18 | 18 | public function newCookie() { |
19 | 19 | $cookie = new Cookie(); |
20 | 20 | $defaults = $this->getDefaults(); |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | return $this->_defaults; |
49 | 49 | } |
50 | 50 | |
51 | - /** |
|
52 | - * Singleton |
|
53 | - * |
|
54 | - * @return self |
|
55 | - */ |
|
51 | + /** |
|
52 | + * Singleton |
|
53 | + * |
|
54 | + * @return self |
|
55 | + */ |
|
56 | 56 | public static function instance() { |
57 | 57 | if (!self::$instance instanceof self) { |
58 | 58 | self::$instance = new self; |
@@ -26,7 +26,7 @@ |
||
26 | 26 | $this->_defaults = array( |
27 | 27 | 'path' => '/', |
28 | 28 | 'domain' => $_SERVER['SERVER_NAME'], |
29 | - 'expireTimer' => 6 * 60 *60, |
|
29 | + 'expireTimer' => 6 * 60 * 60, |
|
30 | 30 | ); |
31 | 31 | } |
32 | 32 |
@@ -323,7 +323,7 @@ |
||
323 | 323 | header("HTTP/1.1 301 Moved Permanently"); |
324 | 324 | break; |
325 | 325 | } |
326 | - header("Location: ".$url); |
|
326 | + header("Location: " . $url); |
|
327 | 327 | exit(); |
328 | 328 | } |
329 | 329 | } |
@@ -13,29 +13,29 @@ |
||
13 | 13 | $this->setBasePath(MODULES_PATH . Request::instance()->getModuleName() . '/views/'); |
14 | 14 | } |
15 | 15 | |
16 | - public function output($view, $name) |
|
17 | - { |
|
18 | - header("Content-type: application/vnd.ms-excel"); |
|
19 | - header("Content-Disposition: attachment; filename=\"$name\""); |
|
20 | - header("Cache-Control: private, max-age=1, pre-check=1", true); |
|
21 | - header("Pragma: none", true); |
|
22 | - |
|
23 | - echo $this->load($view); |
|
24 | - exit(); |
|
25 | - } |
|
26 | - |
|
27 | - /** |
|
28 | - * Singleton |
|
29 | - * |
|
30 | - * @return self |
|
31 | - */ |
|
32 | - public static function instance() |
|
33 | - { |
|
34 | - static $instance; |
|
35 | - if (!($instance instanceof self)) { |
|
36 | - $instance = new self(); |
|
37 | - } |
|
38 | - return $instance; |
|
39 | - } |
|
16 | + public function output($view, $name) |
|
17 | + { |
|
18 | + header("Content-type: application/vnd.ms-excel"); |
|
19 | + header("Content-Disposition: attachment; filename=\"$name\""); |
|
20 | + header("Cache-Control: private, max-age=1, pre-check=1", true); |
|
21 | + header("Pragma: none", true); |
|
22 | + |
|
23 | + echo $this->load($view); |
|
24 | + exit(); |
|
25 | + } |
|
26 | + |
|
27 | + /** |
|
28 | + * Singleton |
|
29 | + * |
|
30 | + * @return self |
|
31 | + */ |
|
32 | + public static function instance() |
|
33 | + { |
|
34 | + static $instance; |
|
35 | + if (!($instance instanceof self)) { |
|
36 | + $instance = new self(); |
|
37 | + } |
|
38 | + return $instance; |
|
39 | + } |
|
40 | 40 | |
41 | 41 | } |
@@ -7,24 +7,24 @@ |
||
7 | 7 | class XML extends View |
8 | 8 | { |
9 | 9 | |
10 | - public function load($view = false, $variables = array(), $return = false) |
|
11 | - { |
|
12 | - header('Content-type: text/xml'); |
|
13 | - return parent::load($view, $variables, $return); |
|
14 | - } |
|
10 | + public function load($view = false, $variables = array(), $return = false) |
|
11 | + { |
|
12 | + header('Content-type: text/xml'); |
|
13 | + return parent::load($view, $variables, $return); |
|
14 | + } |
|
15 | 15 | |
16 | - /** |
|
17 | - * Singleton |
|
18 | - * |
|
19 | - * @return self |
|
20 | - */ |
|
21 | - public static function instance() |
|
22 | - { |
|
23 | - static $instance; |
|
24 | - if (!($instance instanceof self)) { |
|
25 | - $instance = new self(); |
|
26 | - } |
|
27 | - return $instance; |
|
28 | - } |
|
16 | + /** |
|
17 | + * Singleton |
|
18 | + * |
|
19 | + * @return self |
|
20 | + */ |
|
21 | + public static function instance() |
|
22 | + { |
|
23 | + static $instance; |
|
24 | + if (!($instance instanceof self)) { |
|
25 | + $instance = new self(); |
|
26 | + } |
|
27 | + return $instance; |
|
28 | + } |
|
29 | 29 | |
30 | 30 | } |
@@ -3,32 +3,32 @@ discard block |
||
3 | 3 | class Nip_Service_Google_Charts_Chart |
4 | 4 | { |
5 | 5 | |
6 | - protected $_service; |
|
6 | + protected $_service; |
|
7 | 7 | protected $_params = []; |
8 | 8 | |
9 | - public function __toString() |
|
10 | - { |
|
11 | - return $this->render(); |
|
12 | - } |
|
9 | + public function __toString() |
|
10 | + { |
|
11 | + return $this->render(); |
|
12 | + } |
|
13 | 13 | |
14 | - public function render() |
|
15 | - { |
|
16 | - return '<img src="'.$this->getService()->getURL().'?'.http_build_query($this->getParams()).'" alt="" />'; |
|
17 | - } |
|
14 | + public function render() |
|
15 | + { |
|
16 | + return '<img src="'.$this->getService()->getURL().'?'.http_build_query($this->getParams()).'" alt="" />'; |
|
17 | + } |
|
18 | 18 | |
19 | - /** |
|
20 | - * @return Nip_Service_Google_Charts |
|
21 | - */ |
|
22 | - public function getService() |
|
23 | - { |
|
24 | - return $this->_service; |
|
25 | - } |
|
19 | + /** |
|
20 | + * @return Nip_Service_Google_Charts |
|
21 | + */ |
|
22 | + public function getService() |
|
23 | + { |
|
24 | + return $this->_service; |
|
25 | + } |
|
26 | 26 | |
27 | - public function setService($service) |
|
28 | - { |
|
29 | - $this->_service = $service; |
|
30 | - return $this; |
|
31 | - } |
|
27 | + public function setService($service) |
|
28 | + { |
|
29 | + $this->_service = $service; |
|
30 | + return $this; |
|
31 | + } |
|
32 | 32 | |
33 | 33 | public function getParams() |
34 | 34 | { |
@@ -46,20 +46,20 @@ discard block |
||
46 | 46 | return $this; |
47 | 47 | } |
48 | 48 | |
49 | - public function setSize($size) |
|
50 | - { |
|
51 | - $this->setParam("chs", $size); |
|
52 | - return $this; |
|
53 | - } |
|
49 | + public function setSize($size) |
|
50 | + { |
|
51 | + $this->setParam("chs", $size); |
|
52 | + return $this; |
|
53 | + } |
|
54 | 54 | |
55 | - public function setParam($name, $value) |
|
56 | - { |
|
57 | - $this->_params[$name] = $value; |
|
58 | - return $this; |
|
59 | - } |
|
55 | + public function setParam($name, $value) |
|
56 | + { |
|
57 | + $this->_params[$name] = $value; |
|
58 | + return $this; |
|
59 | + } |
|
60 | 60 | |
61 | - public function getParam($name) |
|
62 | - { |
|
63 | - return $this->_params[$name]; |
|
64 | - } |
|
61 | + public function getParam($name) |
|
62 | + { |
|
63 | + return $this->_params[$name]; |
|
64 | + } |
|
65 | 65 | } |
66 | 66 | \ No newline at end of file |
@@ -13,7 +13,7 @@ |
||
13 | 13 | |
14 | 14 | public function render() |
15 | 15 | { |
16 | - return '<img src="'.$this->getService()->getURL().'?'.http_build_query($this->getParams()).'" alt="" />'; |
|
16 | + return '<img src="' . $this->getService()->getURL() . '?' . http_build_query($this->getParams()) . '" alt="" />'; |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | /** |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public function addPrefix($prefix, $baseDir) |
21 | 21 | { |
22 | - $prefix = trim($prefix, '\\').'\\'; |
|
23 | - $baseDir = rtrim($baseDir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; |
|
22 | + $prefix = trim($prefix, '\\') . '\\'; |
|
23 | + $baseDir = rtrim($baseDir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; |
|
24 | 24 | $this->prefixes[] = [$prefix, $baseDir]; |
25 | 25 | } |
26 | 26 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | foreach ($this->prefixes as list($currentPrefix, $currentBaseDir)) { |
45 | 45 | if (0 === strpos($class, $currentPrefix)) { |
46 | 46 | $classWithoutPrefix = substr($class, strlen($currentPrefix)); |
47 | - $file = $currentBaseDir.str_replace('\\', DIRECTORY_SEPARATOR, $classWithoutPrefix).'.php'; |
|
47 | + $file = $currentBaseDir . str_replace('\\', DIRECTORY_SEPARATOR, $classWithoutPrefix) . '.php'; |
|
48 | 48 | if (file_exists($file)) { |
49 | 49 | return $file; |
50 | 50 | } |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | */ |
18 | 18 | public static function dump($dirs, $file) |
19 | 19 | { |
20 | - $dirs = (array)$dirs; |
|
20 | + $dirs = (array) $dirs; |
|
21 | 21 | $maps = []; |
22 | 22 | foreach ($dirs as $dir) { |
23 | 23 | $maps = array_merge($maps, static::createMap($dir)); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | break; |
117 | 117 | } |
118 | 118 | } |
119 | - $classes[] = ltrim($namespace.$class, '\\'); |
|
119 | + $classes[] = ltrim($namespace . $class, '\\'); |
|
120 | 120 | break; |
121 | 121 | default: |
122 | 122 | break; |