@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function set(string $sName, $mValue) : Session |
51 | 51 | { |
52 | - $_SESSION[$sName] = $mValue; |
|
53 | - return $this; |
|
52 | + $_SESSION[$sName] = $mValue; |
|
53 | + return $this; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * @param string $sName name of the session |
85 | 85 | * @param string $sValue value of this sesion var |
86 | 86 | * @return \Venus\lib\Session |
87 | - */ |
|
87 | + */ |
|
88 | 88 | public function setFlashBag($sName, $sValue) |
89 | 89 | { |
90 | 90 | if (!isset($_SESSION['flashbag'])) { $_SESSION['flashbag'] = array(); } |
@@ -109,10 +109,10 @@ discard block |
||
109 | 109 | |
110 | 110 | $aParams = session_get_cookie_params(); |
111 | 111 | |
112 | - setcookie(session_name(), '', time() - 42000, |
|
113 | - $aParams["path"], $aParams["domain"], |
|
114 | - $aParams["secure"], $aParams["httponly"] |
|
115 | - ); |
|
112 | + setcookie(session_name(), '', time() - 42000, |
|
113 | + $aParams["path"], $aParams["domain"], |
|
114 | + $aParams["secure"], $aParams["httponly"] |
|
115 | + ); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | session_destroy(); |
@@ -39,7 +39,7 @@ |
||
39 | 39 | * the from of mail |
40 | 40 | * @access private |
41 | 41 | * @var string |
42 | - */ |
|
42 | + */ |
|
43 | 43 | private $_sFrom = "[email protected]"; |
44 | 44 | |
45 | 45 | /** |
@@ -30,13 +30,13 @@ discard block |
||
30 | 30 | */ |
31 | 31 | class Vendor |
32 | 32 | { |
33 | - /** |
|
34 | - * cache of the vendor available |
|
35 | - * |
|
36 | - * @access private |
|
37 | - * @var array |
|
38 | - */ |
|
39 | - private static $_aCache = null; |
|
33 | + /** |
|
34 | + * cache of the vendor available |
|
35 | + * |
|
36 | + * @access private |
|
37 | + * @var array |
|
38 | + */ |
|
39 | + private static $_aCache = null; |
|
40 | 40 | |
41 | 41 | /** |
42 | 42 | * constructor - factory |
@@ -54,31 +54,31 @@ discard block |
||
54 | 54 | |
55 | 55 | public static function getVendor(string $sVendorName, $mParam = null, $mParam2 = null) |
56 | 56 | { |
57 | - if ($sVendorName === 'Apollina\Template') { |
|
57 | + if ($sVendorName === 'Apollina\Template') { |
|
58 | 58 | |
59 | - $oApollina = new $sVendorName($mParam, str_replace('lib', '', __DIR__), |
|
60 | - str_replace('bundles'.DIRECTORY_SEPARATOR.'lib', CACHE_DIR, __DIR__), $mParam2); |
|
59 | + $oApollina = new $sVendorName($mParam, str_replace('lib', '', __DIR__), |
|
60 | + str_replace('bundles'.DIRECTORY_SEPARATOR.'lib', CACHE_DIR, __DIR__), $mParam2); |
|
61 | 61 | |
62 | - return $oApollina->addFunctionPath(__DIR__.DIRECTORY_SEPARATOR.'Functions', '\Venus\lib\Functions\\'); |
|
63 | - } |
|
64 | - else if ($sVendorName === 'Attila\Orm') { |
|
62 | + return $oApollina->addFunctionPath(__DIR__.DIRECTORY_SEPARATOR.'Functions', '\Venus\lib\Functions\\'); |
|
63 | + } |
|
64 | + else if ($sVendorName === 'Attila\Orm') { |
|
65 | 65 | |
66 | - $oDbConfig = Config::get('Db')->configuration; |
|
66 | + $oDbConfig = Config::get('Db')->configuration; |
|
67 | 67 | |
68 | - return new $sVendorName($oDbConfig->db, $oDbConfig->type, $oDbConfig->host, $oDbConfig->user, $oDbConfig->password, |
|
69 | - $oDbConfig->db); |
|
70 | - } |
|
71 | - else if (isset($mParam) && isset($mParam2)) { |
|
68 | + return new $sVendorName($oDbConfig->db, $oDbConfig->type, $oDbConfig->host, $oDbConfig->user, $oDbConfig->password, |
|
69 | + $oDbConfig->db); |
|
70 | + } |
|
71 | + else if (isset($mParam) && isset($mParam2)) { |
|
72 | 72 | |
73 | - return new $sVendorName($mParam, $mParam2); |
|
74 | - } |
|
75 | - else if (isset($mParam)) { |
|
73 | + return new $sVendorName($mParam, $mParam2); |
|
74 | + } |
|
75 | + else if (isset($mParam)) { |
|
76 | 76 | |
77 | - return new $sVendorName($mParam); |
|
78 | - } |
|
79 | - else { |
|
77 | + return new $sVendorName($mParam); |
|
78 | + } |
|
79 | + else { |
|
80 | 80 | |
81 | - return new $sVendorName; |
|
82 | - } |
|
81 | + return new $sVendorName; |
|
82 | + } |
|
83 | 83 | } |
84 | 84 | } |
@@ -30,41 +30,41 @@ |
||
30 | 30 | */ |
31 | 31 | class Type extends Common |
32 | 32 | { |
33 | - /** |
|
34 | - * type |
|
35 | - * @var type |
|
36 | - */ |
|
37 | - private $_sType = ''; |
|
33 | + /** |
|
34 | + * type |
|
35 | + * @var type |
|
36 | + */ |
|
37 | + private $_sType = ''; |
|
38 | 38 | |
39 | - /** |
|
40 | - * constructor |
|
41 | - * |
|
42 | - * @access public |
|
43 | - * @param string $sType type |
|
44 | - * @return Type |
|
45 | - */ |
|
46 | - public function __construct(string $sType) |
|
47 | - { |
|
48 | - $this->_sType = $sType; |
|
49 | - } |
|
39 | + /** |
|
40 | + * constructor |
|
41 | + * |
|
42 | + * @access public |
|
43 | + * @param string $sType type |
|
44 | + * @return Type |
|
45 | + */ |
|
46 | + public function __construct(string $sType) |
|
47 | + { |
|
48 | + $this->_sType = $sType; |
|
49 | + } |
|
50 | 50 | |
51 | - /** |
|
52 | - * validate the Type |
|
53 | - * |
|
54 | - * @access public |
|
55 | - * @param string $sValue |
|
56 | - * @return bool |
|
57 | - */ |
|
58 | - public function validate(string $sValue = null) : bool |
|
59 | - { |
|
60 | - if ($this->_sType == 'DateTime') { |
|
51 | + /** |
|
52 | + * validate the Type |
|
53 | + * |
|
54 | + * @access public |
|
55 | + * @param string $sValue |
|
56 | + * @return bool |
|
57 | + */ |
|
58 | + public function validate(string $sValue = null) : bool |
|
59 | + { |
|
60 | + if ($this->_sType == 'DateTime') { |
|
61 | 61 | |
62 | - if (preg_match('#^[0-9]{4}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}#', $sValue)) { |
|
62 | + if (preg_match('#^[0-9]{4}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}#', $sValue)) { |
|
63 | 63 | |
64 | - return true; |
|
65 | - } |
|
66 | - } |
|
64 | + return true; |
|
65 | + } |
|
66 | + } |
|
67 | 67 | |
68 | - return false; |
|
69 | - } |
|
68 | + return false; |
|
69 | + } |
|
70 | 70 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | } |
60 | 60 | else if (isset($this->_aDependencyInjectorContener[md5($sNameOfDi)])) { |
61 | 61 | |
62 | - return $this->_aDependencyInjectorContener[md5($sNameOfDi)]; |
|
62 | + return $this->_aDependencyInjectorContener[md5($sNameOfDi)]; |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | return false; |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function set(string $sNameOfDi, callable $cFunction, bool $bShared = false) : Di |
78 | 78 | { |
79 | - if ($bShared === true) { self::$_aSharedDependencyInjectorContener[md5($sNameOfDi)] = $cFunction; } |
|
80 | - else { $this->_aDependencyInjectorContener[md5($sNameOfDi)] = $cFunction; } |
|
79 | + if ($bShared === true) { self::$_aSharedDependencyInjectorContener[md5($sNameOfDi)] = $cFunction; } |
|
80 | + else { $this->_aDependencyInjectorContener[md5($sNameOfDi)] = $cFunction; } |
|
81 | 81 | return $this; |
82 | 82 | } |
83 | 83 | } |
@@ -7,11 +7,11 @@ |
||
7 | 7 | */ |
8 | 8 | interface LoggerAwareInterface |
9 | 9 | { |
10 | - /** |
|
11 | - * Sets a logger instance on the object |
|
12 | - * |
|
13 | - * @param LoggerInterface $logger |
|
14 | - * @return null |
|
15 | - */ |
|
16 | - public function setLogger(LoggerInterface $logger); |
|
10 | + /** |
|
11 | + * Sets a logger instance on the object |
|
12 | + * |
|
13 | + * @param LoggerInterface $logger |
|
14 | + * @return null |
|
15 | + */ |
|
16 | + public function setLogger(LoggerInterface $logger); |
|
17 | 17 | } |
@@ -35,31 +35,31 @@ |
||
35 | 35 | abstract class AbstractLogger implements LoggerInterface |
36 | 36 | { |
37 | 37 | /** |
38 | - * Logs with an arbitrary level. |
|
39 | - * |
|
40 | - * @param mixed $level |
|
41 | - * @param string $message |
|
42 | - * @param array $context |
|
43 | - * @return void |
|
44 | - */ |
|
45 | - public function log($level, $message, array $context = array()) |
|
46 | - { |
|
47 | - if (!isset($context['file'])) { $context['file'] = __FILE__; } |
|
48 | - if (!isset($context['line'])) { $context['line'] = __LINE__; } |
|
49 | - if ($level === null) { $level = LogLevel::INFO; } |
|
38 | + * Logs with an arbitrary level. |
|
39 | + * |
|
40 | + * @param mixed $level |
|
41 | + * @param string $message |
|
42 | + * @param array $context |
|
43 | + * @return void |
|
44 | + */ |
|
45 | + public function log($level, $message, array $context = array()) |
|
46 | + { |
|
47 | + if (!isset($context['file'])) { $context['file'] = __FILE__; } |
|
48 | + if (!isset($context['line'])) { $context['line'] = __LINE__; } |
|
49 | + if ($level === null) { $level = LogLevel::INFO; } |
|
50 | 50 | |
51 | - if (Debug::isDebug() === true) { |
|
51 | + if (Debug::isDebug() === true) { |
|
52 | 52 | |
53 | - if (Debug::getKindOfReportLog() === 'error_log' || Debug::getKindOfReportLog() === 'all') { |
|
53 | + if (Debug::getKindOfReportLog() === 'error_log' || Debug::getKindOfReportLog() === 'all') { |
|
54 | 54 | |
55 | - error_log($context['file'].'> (l.'.$context['line'].') '.$message); |
|
56 | - } |
|
57 | - if (Debug::getKindOfReportLog() === 'screen' || Debug::getKindOfReportLog() === 'all') { |
|
55 | + error_log($context['file'].'> (l.'.$context['line'].') '.$message); |
|
56 | + } |
|
57 | + if (Debug::getKindOfReportLog() === 'screen' || Debug::getKindOfReportLog() === 'all') { |
|
58 | 58 | |
59 | - echo '<table width="100%" style="background:orange;border:solid red 15px;"><tr><td style="color:black;padding:10px;font-size:18px;">'; |
|
60 | - echo $context['file'].'> (l.'.$context['line'].') '.$message.'<br/>'."\n"; |
|
61 | - echo '</td></tr></table>'; |
|
62 | - } |
|
63 | - } |
|
59 | + echo '<table width="100%" style="background:orange;border:solid red 15px;"><tr><td style="color:black;padding:10px;font-size:18px;">'; |
|
60 | + echo $context['file'].'> (l.'.$context['line'].') '.$message.'<br/>'."\n"; |
|
61 | + echo '</td></tr></table>'; |
|
62 | + } |
|
63 | + } |
|
64 | 64 | } |
65 | 65 | } |
@@ -118,10 +118,10 @@ |
||
118 | 118 | $aImageSizes = getimagesize($_FILES[$sFile]['tmp_name']); |
119 | 119 | |
120 | 120 | $fRatio = min($aImageSizes[0] / $this->_iWidth, $aImageSizes[1] / $this->_iHeight); |
121 | - $iHeight = $aImageSizes[1] / $fRatio; |
|
122 | - $iWidth = $aImageSizes[0] / $fRatio; |
|
123 | - $fY = ($iHeight - $this->_iHeight) / 2 * $fRatio; |
|
124 | - $fX = ($iWidth - $this->_iWidth) / 2 * $fRatio; |
|
121 | + $iHeight = $aImageSizes[1] / $fRatio; |
|
122 | + $iWidth = $aImageSizes[0] / $fRatio; |
|
123 | + $fY = ($iHeight - $this->_iHeight) / 2 * $fRatio; |
|
124 | + $fX = ($iWidth - $this->_iWidth) / 2 * $fRatio; |
|
125 | 125 | |
126 | 126 | $rNewImage = imagecreatefromjpeg($_FILES[$sFile]['tmp_name']); |
127 | 127 |
@@ -30,10 +30,10 @@ discard block |
||
30 | 30 | */ |
31 | 31 | class Less |
32 | 32 | { |
33 | - /** |
|
34 | - * @var string |
|
35 | - */ |
|
36 | - const LESS_WINDOWS = LESS_WINDOWS; |
|
33 | + /** |
|
34 | + * @var string |
|
35 | + */ |
|
36 | + const LESS_WINDOWS = LESS_WINDOWS; |
|
37 | 37 | |
38 | 38 | /** |
39 | 39 | * translate the content |
@@ -44,18 +44,18 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public static function toCss(string $sFile) |
46 | 46 | { |
47 | - if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { |
|
47 | + if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { |
|
48 | 48 | |
49 | - $sCmd = self::LESS_WINDOWS." ".$sFile." --watch"; |
|
50 | - $sContent = shell_exec($sCmd); |
|
51 | - } |
|
52 | - else { |
|
49 | + $sCmd = self::LESS_WINDOWS." ".$sFile." --watch"; |
|
50 | + $sContent = shell_exec($sCmd); |
|
51 | + } |
|
52 | + else { |
|
53 | 53 | |
54 | - $sCmd = "lessc ".$sFile." --no-color 2>&1"; |
|
55 | - $sContent = shell_exec($sCmd); |
|
56 | - } |
|
54 | + $sCmd = "lessc ".$sFile." --no-color 2>&1"; |
|
55 | + $sContent = shell_exec($sCmd); |
|
56 | + } |
|
57 | 57 | |
58 | - header("content-type:text/css"); |
|
59 | - echo $sContent; |
|
58 | + header("content-type:text/css"); |
|
59 | + echo $sContent; |
|
60 | 60 | } |
61 | 61 | } |