@@ -220,7 +220,7 @@ |
||
| 220 | 220 | * @param mixed $context It optionally contains an array of every variable |
| 221 | 221 | * that existed in the scope the error was triggered in. |
| 222 | 222 | * |
| 223 | - * @return bool |
|
| 223 | + * @return boolean|null |
|
| 224 | 224 | */ |
| 225 | 225 | function pmf_error_handler($level, $message, $filename, $line, $context) |
| 226 | 226 | { |
@@ -53,18 +53,18 @@ discard block |
||
| 53 | 53 | /** |
| 54 | 54 | * The directory where the translations reside |
| 55 | 55 | */ |
| 56 | -define('PMF_LANGUAGE_DIR', dirname(__DIR__) . '/lang'); |
|
| 56 | +define('PMF_LANGUAGE_DIR', dirname(__DIR__).'/lang'); |
|
| 57 | 57 | |
| 58 | 58 | // |
| 59 | 59 | // Setting up PSR-0 autoloader for Symfony Components |
| 60 | 60 | // |
| 61 | -require PMF_INCLUDE_DIR . '/libs/Symfony/Component/ClassLoader/UniversalClassLoader.php'; |
|
| 61 | +require PMF_INCLUDE_DIR.'/libs/Symfony/Component/ClassLoader/UniversalClassLoader.php'; |
|
| 62 | 62 | |
| 63 | 63 | $loader = new UniversalClassLoader(); |
| 64 | 64 | $loader->registerNamespace('PMF', PMF_INCLUDE_DIR); |
| 65 | -$loader->registerNamespace('Symfony', PMF_INCLUDE_DIR . '/libs'); |
|
| 65 | +$loader->registerNamespace('Symfony', PMF_INCLUDE_DIR.'/libs'); |
|
| 66 | 66 | $loader->registerPrefix('PMF_', PMF_INCLUDE_DIR); |
| 67 | -$loader->registerPrefix('Twig_', PMF_INCLUDE_DIR . '/libs'); |
|
| 67 | +$loader->registerPrefix('Twig_', PMF_INCLUDE_DIR.'/libs'); |
|
| 68 | 68 | $loader->register(); |
| 69 | 69 | |
| 70 | 70 | // |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $i++; |
| 81 | 81 | } |
| 82 | 82 | if (!$foundCurrPath) { |
| 83 | - ini_set('include_path', '.' . PATH_SEPARATOR . ini_get('include_path')); |
|
| 83 | + ini_set('include_path', '.'.PATH_SEPARATOR.ini_get('include_path')); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | // |
@@ -93,16 +93,16 @@ discard block |
||
| 93 | 93 | // |
| 94 | 94 | // Check if multisite/multisite.php exist for Multisite support |
| 95 | 95 | // |
| 96 | -if (file_exists(__DIR__ . '/../multisite/multisite.php') && 'cli' !== PHP_SAPI) { |
|
| 97 | - require __DIR__ . '/../multisite/multisite.php'; |
|
| 96 | +if (file_exists(__DIR__.'/../multisite/multisite.php') && 'cli' !== PHP_SAPI) { |
|
| 97 | + require __DIR__.'/../multisite/multisite.php'; |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | // |
| 101 | 101 | // Read configuration and constants |
| 102 | 102 | // |
| 103 | -if (! defined('PMF_MULTI_INSTANCE_CONFIG_DIR')) { |
|
| 103 | +if (!defined('PMF_MULTI_INSTANCE_CONFIG_DIR')) { |
|
| 104 | 104 | // Single instance configuration |
| 105 | - define('PMF_CONFIG_DIR', dirname(__DIR__) . '/config'); |
|
| 105 | + define('PMF_CONFIG_DIR', dirname(__DIR__).'/config'); |
|
| 106 | 106 | } else { |
| 107 | 107 | // Multi instance configuration |
| 108 | 108 | define('PMF_CONFIG_DIR', PMF_MULTI_INSTANCE_CONFIG_DIR); |
@@ -112,17 +112,17 @@ discard block |
||
| 112 | 112 | // Check if config/database.php exist -> if not, redirect to installer |
| 113 | 113 | // |
| 114 | 114 | |
| 115 | -if (!file_exists(PMF_CONFIG_DIR . '/database.php') && !file_exists(PMF_ROOT_DIR . '/inc/data.php')) { |
|
| 115 | +if (!file_exists(PMF_CONFIG_DIR.'/database.php') && !file_exists(PMF_ROOT_DIR.'/inc/data.php')) { |
|
| 116 | 116 | RedirectResponse::create('setup/index.php')->send(); |
| 117 | 117 | exit(); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | -if (file_exists(PMF_ROOT_DIR . '/inc/data.php')) { |
|
| 121 | - require PMF_ROOT_DIR . '/inc/data.php'; |
|
| 120 | +if (file_exists(PMF_ROOT_DIR.'/inc/data.php')) { |
|
| 121 | + require PMF_ROOT_DIR.'/inc/data.php'; |
|
| 122 | 122 | } else { |
| 123 | - require PMF_CONFIG_DIR . '/database.php'; |
|
| 123 | + require PMF_CONFIG_DIR.'/database.php'; |
|
| 124 | 124 | } |
| 125 | -require PMF_CONFIG_DIR . '/constants.php'; |
|
| 125 | +require PMF_CONFIG_DIR.'/constants.php'; |
|
| 126 | 126 | |
| 127 | 127 | // |
| 128 | 128 | // Set the error handler to our pmf_error_handler() function |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | // We always need a valid session! |
| 152 | 152 | // |
| 153 | 153 | ini_set('session.use_only_cookies', 1); // Avoid any PHP version to move sessions on URLs |
| 154 | -ini_set('session.auto_start', 0); // Prevent error to use session_start() if it's active in php.ini |
|
| 154 | +ini_set('session.auto_start', 0); // Prevent error to use session_start() if it's active in php.ini |
|
| 155 | 155 | ini_set('session.use_trans_sid', 0); |
| 156 | 156 | ini_set('url_rewriter.tags', ''); |
| 157 | 157 | |
@@ -164,9 +164,9 @@ discard block |
||
| 164 | 164 | // |
| 165 | 165 | // Connect to LDAP server, when LDAP support is enabled |
| 166 | 166 | // |
| 167 | -if ($faqConfig->get('security.ldapSupport') && file_exists(PMF_CONFIG_DIR . '/ldap.php') && extension_loaded('ldap')) { |
|
| 168 | - require PMF_CONFIG_DIR . '/constants_ldap.php'; |
|
| 169 | - require PMF_CONFIG_DIR . '/ldap.php'; |
|
| 167 | +if ($faqConfig->get('security.ldapSupport') && file_exists(PMF_CONFIG_DIR.'/ldap.php') && extension_loaded('ldap')) { |
|
| 168 | + require PMF_CONFIG_DIR.'/constants_ldap.php'; |
|
| 169 | + require PMF_CONFIG_DIR.'/ldap.php'; |
|
| 170 | 170 | $faqConfig->setLdapConfig($PMF_LDAP); |
| 171 | 171 | } else { |
| 172 | 172 | $ldap = null; |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | define('PMF_ATTACHMENTS_DIR', $confAttachmentsPath); |
| 182 | 182 | } else { |
| 183 | 183 | // otherwise build the absolute path |
| 184 | - $tmp = dirname(__DIR__) . DIRECTORY_SEPARATOR . $confAttachmentsPath; |
|
| 184 | + $tmp = dirname(__DIR__).DIRECTORY_SEPARATOR.$confAttachmentsPath; |
|
| 185 | 185 | |
| 186 | 186 | // Check that nobody is traversing |
| 187 | 187 | if (0 === strpos((string)$tmp, dirname(__DIR__))) { |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | // |
| 195 | 195 | // Fix if phpMyFAQ is running behind a proxy server |
| 196 | 196 | // |
| 197 | -if (! isset($_SERVER['HTTP_HOST'])) { |
|
| 197 | +if (!isset($_SERVER['HTTP_HOST'])) { |
|
| 198 | 198 | if (isset($_SERVER['HTTP_X_FORWARDED_SERVER'])) { |
| 199 | 199 | $_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_SERVER']; |
| 200 | 200 | } else { |
@@ -205,14 +205,14 @@ discard block |
||
| 205 | 205 | // |
| 206 | 206 | // Fix undefined server variables in Windows IIS & CGI mode |
| 207 | 207 | // |
| 208 | -if (! isset($_SERVER['SCRIPT_NAME'])) { |
|
| 209 | - if(isset($_SERVER['SCRIPT_FILENAME'])) { |
|
| 208 | +if (!isset($_SERVER['SCRIPT_NAME'])) { |
|
| 209 | + if (isset($_SERVER['SCRIPT_FILENAME'])) { |
|
| 210 | 210 | $_SERVER['SCRIPT_NAME'] = $_SERVER['SCRIPT_FILENAME']; |
| 211 | - } elseif(isset($_SERVER['PATH_TRANSLATED'])) { |
|
| 211 | + } elseif (isset($_SERVER['PATH_TRANSLATED'])) { |
|
| 212 | 212 | $_SERVER['SCRIPT_NAME'] = $_SERVER['PATH_TRANSLATED']; |
| 213 | - } elseif(isset($_SERVER['PATH_INFO'])) { |
|
| 213 | + } elseif (isset($_SERVER['PATH_INFO'])) { |
|
| 214 | 214 | $_SERVER['SCRIPT_NAME'] = $_SERVER['PATH_INFO']; |
| 215 | - } elseif(isset($_SERVER['SCRIPT_URL'])) { |
|
| 215 | + } elseif (isset($_SERVER['SCRIPT_URL'])) { |
|
| 216 | 216 | $_SERVER['SCRIPT_NAME'] = $_SERVER['SCRIPT_URL']; |
| 217 | 217 | } |
| 218 | 218 | } |
@@ -433,7 +433,7 @@ |
||
| 433 | 433 | /** |
| 434 | 434 | * Validate attached file with the real hash |
| 435 | 435 | * |
| 436 | - * @return boolean |
|
| 436 | + * @return boolean|null |
|
| 437 | 437 | */ |
| 438 | 438 | public function validate() |
| 439 | 439 | { |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | * |
| 132 | 132 | * @return PMF_Attachment_Abstract |
| 133 | 133 | */ |
| 134 | - public function __construct ($id = null) |
|
| 134 | + public function __construct($id = null) |
|
| 135 | 135 | { |
| 136 | 136 | $this->db = PMF_Db::getInstance(); |
| 137 | 137 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | * |
| 149 | 149 | * @return string |
| 150 | 150 | */ |
| 151 | - public function buildUrl ($forHTML = true) |
|
| 151 | + public function buildUrl($forHTML = true) |
|
| 152 | 152 | { |
| 153 | 153 | $amp = true == $forHTML ? '&' : '&'; |
| 154 | 154 | |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | * |
| 164 | 164 | * @return void |
| 165 | 165 | */ |
| 166 | - public function setKey ($key, $default = true) |
|
| 166 | + public function setKey($key, $default = true) |
|
| 167 | 167 | { |
| 168 | 168 | $this->key = $key; |
| 169 | 169 | $this->encrypted = null !== $key; |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | * Not default means the key was set explicitly |
| 173 | 173 | * for this attachment, so lets hash it |
| 174 | 174 | */ |
| 175 | - if($this->encrypted && !$default) { |
|
| 175 | + if ($this->encrypted && !$default) { |
|
| 176 | 176 | $this->passwordHash = sha1($key); |
| 177 | 177 | } |
| 178 | 178 | } |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | * |
| 185 | 185 | * @return null |
| 186 | 186 | */ |
| 187 | - public function setRecordId ($id) |
|
| 187 | + public function setRecordId($id) |
|
| 188 | 188 | { |
| 189 | 189 | $this->recordId = $id; |
| 190 | 190 | } |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | * |
| 197 | 197 | * @return null |
| 198 | 198 | */ |
| 199 | - public function setRecordLang ($lang) |
|
| 199 | + public function setRecordLang($lang) |
|
| 200 | 200 | { |
| 201 | 201 | $this->recordLang = $lang; |
| 202 | 202 | } |
@@ -370,18 +370,18 @@ discard block |
||
| 370 | 370 | */ |
| 371 | 371 | protected function mkVirtualHash() |
| 372 | 372 | { |
| 373 | - if($this->encrypted) { |
|
| 374 | - if(null === $this->id || null === $this->recordId || |
|
| 373 | + if ($this->encrypted) { |
|
| 374 | + if (null === $this->id || null === $this->recordId || |
|
| 375 | 375 | null === $this->realHash || null === $this->filename || |
| 376 | 376 | null === $this->key) { |
| 377 | - throw new PMF_Attachment_Exception('All of id, ' . |
|
| 378 | - 'recordId, hash, filename, ' . |
|
| 379 | - 'key is needed to generate ' . |
|
| 377 | + throw new PMF_Attachment_Exception('All of id, '. |
|
| 378 | + 'recordId, hash, filename, '. |
|
| 379 | + 'key is needed to generate '. |
|
| 380 | 380 | 'fs hash for encrypted files'); |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | - $src = $this->id . $this->recordId . $this->realHash . |
|
| 384 | - $this->filename . $this->key; |
|
| 383 | + $src = $this->id.$this->recordId.$this->realHash. |
|
| 384 | + $this->filename.$this->key; |
|
| 385 | 385 | $this->virtualHash = md5($src); |
| 386 | 386 | } else { |
| 387 | 387 | $this->virtualHash = $this->realHash; |
@@ -375,9 +375,9 @@ |
||
| 375 | 375 | null === $this->realHash || null === $this->filename || |
| 376 | 376 | null === $this->key) { |
| 377 | 377 | throw new PMF_Attachment_Exception('All of id, ' . |
| 378 | - 'recordId, hash, filename, ' . |
|
| 379 | - 'key is needed to generate ' . |
|
| 380 | - 'fs hash for encrypted files'); |
|
| 378 | + 'recordId, hash, filename, ' . |
|
| 379 | + 'key is needed to generate ' . |
|
| 380 | + 'fs hash for encrypted files'); |
|
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | $src = $this->id . $this->recordId . $this->realHash . |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | /** |
| 50 | 50 | * Delete attachment |
| 51 | 51 | * |
| 52 | - * @return boolean |
|
| 52 | + * @return boolean|null |
|
| 53 | 53 | */ |
| 54 | 54 | function delete() |
| 55 | 55 | { |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | /** |
| 60 | 60 | * Save current attachment to the appropriate storage |
| 61 | 61 | * |
| 62 | - * @return boolean |
|
| 62 | + * @return boolean|null |
|
| 63 | 63 | */ |
| 64 | 64 | public function save() |
| 65 | 65 | { |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | * |
| 41 | 41 | * @param int $id attachment id |
| 42 | 42 | */ |
| 43 | - public function __construct ($id = null) |
|
| 43 | + public function __construct($id = null) |
|
| 44 | 44 | { |
| 45 | 45 | // TODO implement this |
| 46 | 46 | throw new PMF_Attachment_Exception('The database attachment storage type is not yet implemented'); |
@@ -108,7 +108,7 @@ |
||
| 108 | 108 | * @param PMF_Configuration $config |
| 109 | 109 | * @param integer $recordId ID of the record |
| 110 | 110 | * |
| 111 | - * @return array |
|
| 111 | + * @return integer|null |
|
| 112 | 112 | */ |
| 113 | 113 | public static function fetchByRecordId(PMF_Configuration $config, $recordId) |
| 114 | 114 | { |
@@ -51,9 +51,9 @@ |
||
| 51 | 51 | protected $aes; |
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | - * @param $filepath |
|
| 55 | - * @param $mode |
|
| 56 | - * @param $key |
|
| 54 | + * @param string $filepath |
|
| 55 | + * @param string $mode |
|
| 56 | + * @param string $key |
|
| 57 | 57 | * |
| 58 | 58 | * @return PMF_Attachment_Filesystem_File_Encrypted |
| 59 | 59 | */ |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | $chunk = ''; |
| 76 | 76 | $chunkDelimLen = strlen(self::chunkDelimiter); |
| 77 | 77 | |
| 78 | - while(!$readEnd && !$this->eof()) { |
|
| 78 | + while (!$readEnd && !$this->eof()) { |
|
| 79 | 79 | $chunk .= fread($this->handle, 1); |
| 80 | 80 | $readEnd = self::chunkDelimiter == substr($chunk, -$chunkDelimLen); |
| 81 | 81 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | public function putChunk($chunk) |
| 101 | 101 | { |
| 102 | - $content = $this->aes->encrypt($chunk) . self::chunkDelimiter; |
|
| 102 | + $content = $this->aes->encrypt($chunk).self::chunkDelimiter; |
|
| 103 | 103 | |
| 104 | 104 | return fwrite($this->handle, $content); |
| 105 | 105 | } |
@@ -111,14 +111,14 @@ discard block |
||
| 111 | 111 | { |
| 112 | 112 | $retval = false; |
| 113 | 113 | |
| 114 | - if(is_string($target)) { |
|
| 114 | + if (is_string($target)) { |
|
| 115 | 115 | $target = new PMF_Attachment_Filesystem_File_Vanilla($target, self::MODE_WRITE); |
| 116 | 116 | } else { |
| 117 | 117 | $target->setMode(self::MODE_WRITE); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - if($target->isOk()) { |
|
| 121 | - while(!$this->eof()) { |
|
| 120 | + if ($target->isOk()) { |
|
| 121 | + while (!$this->eof()) { |
|
| 122 | 122 | $target->putChunk($this->getChunk()); |
| 123 | 123 | } |
| 124 | 124 | |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | /** |
| 92 | - * @param $dir |
|
| 92 | + * @param boolean $dir |
|
| 93 | 93 | * @return array |
| 94 | 94 | */ |
| 95 | 95 | protected function getOldFileList($dir) |
@@ -101,14 +101,14 @@ discard block |
||
| 101 | 101 | $records = $faq->faqRecords; |
| 102 | 102 | |
| 103 | 103 | reset($records); |
| 104 | - while(list(,$record) = each($records)) { |
|
| 104 | + while (list(,$record) = each($records)) { |
|
| 105 | 105 | |
| 106 | 106 | $recordDir = "$dir/$record[id]"; |
| 107 | - if(file_exists($recordDir) && is_dir($recordDir)) { |
|
| 107 | + if (file_exists($recordDir) && is_dir($recordDir)) { |
|
| 108 | 108 | |
| 109 | 109 | $list[$record['id']]['files'] = array(); |
| 110 | - foreach(new DirectoryIterator($recordDir) as $entry) { |
|
| 111 | - if(!$entry->isDot() && $entry->isFile()) { |
|
| 110 | + foreach (new DirectoryIterator($recordDir) as $entry) { |
|
| 111 | + if (!$entry->isDot() && $entry->isFile()) { |
|
| 112 | 112 | $list[$record['id']]['files'][] = "$recordDir/{$entry->getFilename()}"; |
| 113 | 113 | } |
| 114 | 114 | } |
@@ -129,20 +129,20 @@ discard block |
||
| 129 | 129 | { |
| 130 | 130 | $list = $this->getOldFileList(PMF_ATTACHMENTS_DIR); |
| 131 | 131 | |
| 132 | - foreach($list as $recordId => $item) { |
|
| 132 | + foreach ($list as $recordId => $item) { |
|
| 133 | 133 | $recordLang = $item['lang']; |
| 134 | - foreach($item['files'] as $file) { |
|
| 134 | + foreach ($item['files'] as $file) { |
|
| 135 | 135 | $att = PMF_Attachment_Factory::create(); |
| 136 | 136 | $att->setRecordId($recordId); |
| 137 | 137 | $att->setRecordLang($recordLang); |
| 138 | 138 | |
| 139 | - if(!$att->save($file)) { |
|
| 139 | + if (!$att->save($file)) { |
|
| 140 | 140 | $this->error[] = "File $file couldn't be migrated"; |
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - $recordDir = PMF_ATTACHMENTS_DIR . "/$recordId"; |
|
| 145 | - if(!@rmdir(PMF_ATTACHMENTS_DIR . "/$file")) { |
|
| 144 | + $recordDir = PMF_ATTACHMENTS_DIR."/$recordId"; |
|
| 145 | + if (!@rmdir(PMF_ATTACHMENTS_DIR."/$file")) { |
|
| 146 | 146 | $this->warning[] = "Couldn't remove dir $recordDir after migration"; |
| 147 | 147 | } |
| 148 | 148 | } |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | */ |
| 159 | 159 | public function doMigrate($migrationType, $options) |
| 160 | 160 | { |
| 161 | - switch($migrationType) { |
|
| 161 | + switch ($migrationType) { |
|
| 162 | 162 | case PMF_Attachment_Migration::MIGRATION_TYPE1: |
| 163 | 163 | |
| 164 | 164 | PMF_Attachment_Factory::init(PMF_Attachment::STORAGE_TYPE_FILESYSTEM, |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | /** |
| 174 | 174 | * Awaiting new default key here |
| 175 | 175 | */ |
| 176 | - if(isset($options['defaultKey']) && !empty($options['defaultKey'])) { |
|
| 176 | + if (isset($options['defaultKey']) && !empty($options['defaultKey'])) { |
|
| 177 | 177 | PMF_Attachment_Factory::init(PMF_Attachment::STORAGE_TYPE_FILESYSTEM, |
| 178 | 178 | $options['defaultKey'], |
| 179 | 179 | true); |
@@ -159,8 +159,8 @@ discard block |
||
| 159 | 159 | case self::MIGRATION_TYPE1: |
| 160 | 160 | |
| 161 | 161 | PMF_Attachment_Factory::init(PMF_Attachment::STORAGE_TYPE_FILESYSTEM, |
| 162 | - '', |
|
| 163 | - false); |
|
| 162 | + '', |
|
| 163 | + false); |
|
| 164 | 164 | $this->migrateFromOldFormatToFs(); |
| 165 | 165 | // FIXME should attachment settings update be triggered here? |
| 166 | 166 | |
@@ -172,8 +172,8 @@ discard block |
||
| 172 | 172 | */ |
| 173 | 173 | if (isset($options['defaultKey']) && !empty($options['defaultKey'])) { |
| 174 | 174 | PMF_Attachment_Factory::init(PMF_Attachment::STORAGE_TYPE_FILESYSTEM, |
| 175 | - $options['defaultKey'], |
|
| 176 | - true); |
|
| 175 | + $options['defaultKey'], |
|
| 176 | + true); |
|
| 177 | 177 | $this->migrateFromOldFormatToFs(); |
| 178 | 178 | } else { |
| 179 | 179 | $this->error[] = 'Default key required to be set for this option'; |
@@ -114,7 +114,7 @@ |
||
| 114 | 114 | * |
| 115 | 115 | * @param string $login Loginname |
| 116 | 116 | * @param array $optionalData Optional data |
| 117 | - * @return integer |
|
| 117 | + * @return boolean |
|
| 118 | 118 | */ |
| 119 | 119 | public function checkLogin($login, Array $optionalData = null) |
| 120 | 120 | { |
@@ -108,7 +108,7 @@ |
||
| 108 | 108 | * @param string $login Loginname |
| 109 | 109 | * @param string $pass Password |
| 110 | 110 | * @return boolean |
| 111 | - */ |
|
| 111 | + */ |
|
| 112 | 112 | public function changePassword($login, $pass) |
| 113 | 113 | { |
| 114 | 114 | $change = sprintf(" |
@@ -126,7 +126,7 @@ |
||
| 126 | 126 | /** |
| 127 | 127 | * Returns date formatted according to user defined format |
| 128 | 128 | * |
| 129 | - * @param string $date |
|
| 129 | + * @param string $unformattedDate |
|
| 130 | 130 | * @return string |
| 131 | 131 | */ |
| 132 | 132 | public function format($unformattedDate) |
@@ -14,7 +14,6 @@ |
||
| 14 | 14 | * @author Matteo Scaramuccia <[email protected]> |
| 15 | 15 | * @copyright 2009-2016 phpMyFAQ Team |
| 16 | 16 | * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
| 17 | - |
|
| 18 | 17 | * @link http://www.phpmyfaq.de |
| 19 | 18 | * @since 2009-09-24 |
| 20 | 19 | */ |
@@ -68,10 +68,10 @@ discard block |
||
| 68 | 68 | { |
| 69 | 69 | if ($pmfFormat) { |
| 70 | 70 | $dateString = strtotime( |
| 71 | - substr($date, 0, 4) . '-' . |
|
| 72 | - substr($date, 4, 2) . '-' . |
|
| 73 | - substr($date, 6, 2) . ' ' . |
|
| 74 | - substr($date, 8, 2) . ':' . |
|
| 71 | + substr($date, 0, 4).'-'. |
|
| 72 | + substr($date, 4, 2).'-'. |
|
| 73 | + substr($date, 6, 2).' '. |
|
| 74 | + substr($date, 8, 2).':'. |
|
| 75 | 75 | substr($date, 10, 2) |
| 76 | 76 | ); |
| 77 | 77 | } else { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $rfc822TZ = 'GMT'; |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - return self::createIsoDate($date, DATE_RFC822, $pmfFormat) . ' ' . $rfc822TZ; |
|
| 100 | + return self::createIsoDate($date, DATE_RFC822, $pmfFormat).' '.$rfc822TZ; |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /** |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $iso8601TZD = 'Z'; |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - return self::createIsoDate($date, DATE_ISO8601, $pmfFormat) . $iso8601TZD; |
|
| 121 | + return self::createIsoDate($date, DATE_ISO8601, $pmfFormat).$iso8601TZD; |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | * @param string $query |
| 60 | 60 | * @param string $table |
| 61 | 61 | * |
| 62 | - * @return array |
|
| 62 | + * @return string[] |
|
| 63 | 63 | */ |
| 64 | 64 | public function buildInsertQueries($query, $table) |
| 65 | 65 | { |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function __construct(PMF_Configuration $config) |
| 52 | 52 | { |
| 53 | - $this->_config = $config; |
|
| 53 | + $this->_config = $config; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | - $ret[] = "INSERT INTO " . $table . " (" . implode(",", $p1) . ") VALUES (" . implode(",", $p2) . ");"; |
|
| 88 | + $ret[] = "INSERT INTO ".$table." (".implode(",", $p1).") VALUES (".implode(",", $p2).");"; |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | return $ret; |
@@ -134,11 +134,11 @@ discard block |
||
| 134 | 134 | $return = $query; |
| 135 | 135 | $matches = array(); |
| 136 | 136 | |
| 137 | - PMF_String::preg_match_all("/^" . $startPattern . "\s+(\w+)(\s+|$)/i", $query, $matches); |
|
| 137 | + PMF_String::preg_match_all("/^".$startPattern."\s+(\w+)(\s+|$)/i", $query, $matches); |
|
| 138 | 138 | |
| 139 | 139 | if (isset($matches[1][0])) { |
| 140 | 140 | $oldTableFullName = $matches[1][0]; |
| 141 | - $newTableFullName = $newValue . PMF_String::substr($oldTableFullName, PMF_String::strlen($oldValue)); |
|
| 141 | + $newTableFullName = $newValue.PMF_String::substr($oldTableFullName, PMF_String::strlen($oldValue)); |
|
| 142 | 142 | $return = str_replace($oldTableFullName, $newTableFullName, $query); |
| 143 | 143 | } |
| 144 | 144 | |