@@ -123,6 +123,7 @@ |
||
| 123 | 123 | |
| 124 | 124 | /** |
| 125 | 125 | * Get the Human readable title of this project. |
| 126 | + * @return string |
|
| 126 | 127 | */ |
| 127 | 128 | public function getTitle() |
| 128 | 129 | { |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | $this->project_identified = true; |
| 158 | 158 | $this->existing_version = $this->project->getExistingVersion(); |
| 159 | 159 | $this->project_type = 'module'; |
| 160 | - $this->project_info['includes'] = array($this->name . '.module'); |
|
| 160 | + $this->project_info['includes'] = array($this->name.'.module'); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /** |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | |
| 197 | 197 | // Logging. |
| 198 | 198 | if (!$this->remote_hashed) { |
| 199 | - throw new \Exception('Could not hash remote project: ' . strip_tags($this->getTitle())); |
|
| 199 | + throw new \Exception('Could not hash remote project: '.strip_tags($this->getTitle())); |
|
| 200 | 200 | } |
| 201 | 201 | } |
| 202 | 202 | |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | |
| 231 | 231 | // Logging. |
| 232 | 232 | if (!$this->local_hashed) { |
| 233 | - throw new \Exception('Could not hash local project: ' . strip_tags($this->getTitle())); |
|
| 233 | + throw new \Exception('Could not hash local project: '.strip_tags($this->getTitle())); |
|
| 234 | 234 | } |
| 235 | 235 | } |
| 236 | 236 | |
@@ -125,7 +125,7 @@ |
||
| 125 | 125 | // Action. |
| 126 | 126 | $action = new Update(); |
| 127 | 127 | if ($use_cache) { |
| 128 | - $cache = new FilesystemCache(sys_get_temp_dir() . '/cerbere'); |
|
| 128 | + $cache = new FilesystemCache(sys_get_temp_dir().'/cerbere'); |
|
| 129 | 129 | $action->setCache($cache); |
| 130 | 130 | } |
| 131 | 131 | |
@@ -231,10 +231,10 @@ |
||
| 231 | 231 | $files = glob($pattern, $flags); |
| 232 | 232 | |
| 233 | 233 | if ($nested) { |
| 234 | - foreach (glob(dirname($pattern) . DIRECTORY_SEPARATOR . '*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir) { |
|
| 234 | + foreach (glob(dirname($pattern).DIRECTORY_SEPARATOR.'*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir) { |
|
| 235 | 235 | $files = array_merge( |
| 236 | 236 | $files, |
| 237 | - $this->getFilesFromPattern($dir . DIRECTORY_SEPARATOR . basename($pattern), $nested, $flags) |
|
| 237 | + $this->getFilesFromPattern($dir.DIRECTORY_SEPARATOR.basename($pattern), $nested, $flags) |
|
| 238 | 238 | ); |
| 239 | 239 | } |
| 240 | 240 | } |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | public function getLogLevelMapping($eventName) |
| 67 | 67 | { |
| 68 | 68 | if (!isset($this->logLevelMappings[$eventName])) { |
| 69 | - throw new \DomainException('Unknown event: ' . $eventName); |
|
| 69 | + throw new \DomainException('Unknown event: '.$eventName); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | return $this->logLevelMappings[$eventName]; |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | try { |
| 60 | 60 | $this->extractArchive($local_file, $destination); |
| 61 | 61 | } catch (\Exception $e) { |
| 62 | - echo $e->getMessage() . "\n"; |
|
| 62 | + echo $e->getMessage()."\n"; |
|
| 63 | 63 | |
| 64 | 64 | return false; |
| 65 | 65 | } |
@@ -90,8 +90,8 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | // Todo: use Symfony's cache objects |
| 92 | 92 | // Check the cache and download the file if needed. |
| 93 | - $cache_directory = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'hacked-cache'; |
|
| 94 | - $local = $cache_directory . DIRECTORY_SEPARATOR . basename($parsed_url['path']); |
|
| 93 | + $cache_directory = sys_get_temp_dir().DIRECTORY_SEPARATOR.'hacked-cache'; |
|
| 94 | + $local = $cache_directory.DIRECTORY_SEPARATOR.basename($parsed_url['path']); |
|
| 95 | 95 | |
| 96 | 96 | if (!file_exists($cache_directory)) { |
| 97 | 97 | @mkdir($cache_directory, 0775, true); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | public function computeHashes() |
| 55 | 55 | { |
| 56 | 56 | foreach ($this->files as $filename) { |
| 57 | - $this->files_hashes[$filename] = $this->hasher->hash($this->base_path . DIRECTORY_SEPARATOR . $filename); |
|
| 57 | + $this->files_hashes[$filename] = $this->hasher->hash($this->base_path.DIRECTORY_SEPARATOR.$filename); |
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | public function fileExists($file) |
| 67 | 67 | { |
| 68 | - return file_exists($this->base_path . DIRECTORY_SEPARATOR . $file); |
|
| 68 | + return file_exists($this->base_path.DIRECTORY_SEPARATOR.$file); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | $files = self::scanDirectory($this->base_path, '/.*/', $white_list); |
| 94 | 94 | |
| 95 | 95 | foreach ($files as $file) { |
| 96 | - $filename = str_replace($this->base_path . DIRECTORY_SEPARATOR, '', $file->filename); |
|
| 96 | + $filename = str_replace($this->base_path.DIRECTORY_SEPARATOR, '', $file->filename); |
|
| 97 | 97 | $this->files[] = $filename; |
| 98 | 98 | } |
| 99 | 99 | } |
@@ -126,11 +126,11 @@ discard block |
||
| 126 | 126 | if (is_dir($dir) && $handle = opendir($dir)) { |
| 127 | 127 | while (false !== ($file = readdir($handle))) { |
| 128 | 128 | if (!in_array($file, $nomask)) { |
| 129 | - if (is_dir($dir . DIRECTORY_SEPARATOR . $file) && $recurse) { |
|
| 129 | + if (is_dir($dir.DIRECTORY_SEPARATOR.$file) && $recurse) { |
|
| 130 | 130 | // Give priority to files in this folder by merging them in after any subdirectory files. |
| 131 | 131 | $files = array_merge( |
| 132 | 132 | self::scanDirectory( |
| 133 | - $dir . DIRECTORY_SEPARATOR . $file, |
|
| 133 | + $dir.DIRECTORY_SEPARATOR.$file, |
|
| 134 | 134 | $mask, |
| 135 | 135 | $nomask, |
| 136 | 136 | $callback, |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | ); |
| 144 | 144 | } elseif ($depth >= $min_depth && preg_match($mask, $file)) { |
| 145 | 145 | // Always use this match over anything already set in $files with the same $$key. |
| 146 | - $filename = $dir . DIRECTORY_SEPARATOR . $file; |
|
| 146 | + $filename = $dir.DIRECTORY_SEPARATOR.$file; |
|
| 147 | 147 | $basename = basename($file); |
| 148 | 148 | $name = substr($basename, 0, strrpos($basename, '.')); |
| 149 | 149 | $files[$$key] = new \stdClass(); |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | */ |
| 201 | 201 | public function getFileLocation($file) |
| 202 | 202 | { |
| 203 | - return $this->base_path . DIRECTORY_SEPARATOR . $file; |
|
| 203 | + return $this->base_path.DIRECTORY_SEPARATOR.$file; |
|
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | /** |
@@ -218,8 +218,8 @@ discard block |
||
| 218 | 218 | */ |
| 219 | 219 | public function isNotBinary($file) |
| 220 | 220 | { |
| 221 | - return is_readable($this->base_path . DIRECTORY_SEPARATOR . $file) |
|
| 222 | - && !self::isBinary($this->base_path . DIRECTORY_SEPARATOR . $file); |
|
| 221 | + return is_readable($this->base_path.DIRECTORY_SEPARATOR.$file) |
|
| 222 | + && !self::isBinary($this->base_path.DIRECTORY_SEPARATOR.$file); |
|
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | /** |
@@ -262,6 +262,6 @@ discard block |
||
| 262 | 262 | */ |
| 263 | 263 | public function isReadable($file) |
| 264 | 264 | { |
| 265 | - return is_readable($this->base_path . DIRECTORY_SEPARATOR . $file); |
|
| 265 | + return is_readable($this->base_path.DIRECTORY_SEPARATOR.$file); |
|
| 266 | 266 | } |
| 267 | 267 | } |
@@ -36,10 +36,10 @@ discard block |
||
| 36 | 36 | $namespace = get_class($this); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - $dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'hacked-cache'; |
|
| 39 | + $dir = sys_get_temp_dir().DIRECTORY_SEPARATOR.'hacked-cache'; |
|
| 40 | 40 | |
| 41 | 41 | if (!empty($namespace)) { |
| 42 | - $dir .= DIRECTORY_SEPARATOR . preg_replace('/[^0-9A-Z\-_]/i', '', $namespace); |
|
| 42 | + $dir .= DIRECTORY_SEPARATOR.preg_replace('/[^0-9A-Z\-_]/i', '', $namespace); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | // Build the destination folder tree if it doesn't already exists. |
@@ -60,14 +60,14 @@ discard block |
||
| 60 | 60 | $name = $this->project->getProject(); |
| 61 | 61 | $version = $this->project->getVersion(); |
| 62 | 62 | |
| 63 | - $dir = $this->getTempDirectory() . DIRECTORY_SEPARATOR . $type . DIRECTORY_SEPARATOR . $name; |
|
| 63 | + $dir = $this->getTempDirectory().DIRECTORY_SEPARATOR.$type.DIRECTORY_SEPARATOR.$name; |
|
| 64 | 64 | |
| 65 | 65 | // Build the destination folder tree if it doesn't already exists. |
| 66 | 66 | if (!is_dir($dir)) { |
| 67 | 67 | mkdir($dir, 0775, true); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - return $dir . DIRECTORY_SEPARATOR . $version; |
|
| 70 | + return $dir.DIRECTORY_SEPARATOR.$version; |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | /** |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | if ($entry == '.' || $entry == '..') { |
| 111 | 111 | continue; |
| 112 | 112 | } |
| 113 | - $entry_path = $path . DIRECTORY_SEPARATOR . $entry; |
|
| 113 | + $entry_path = $path.DIRECTORY_SEPARATOR.$entry; |
|
| 114 | 114 | $this->removeDir($entry_path); |
| 115 | 115 | } |
| 116 | 116 | |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | public function getDate() |
| 47 | 47 | { |
| 48 | 48 | if ($timestamp = $this->getDatestamp()) { |
| 49 | - return new \DateTime('@' . $timestamp); |
|
| 49 | + return new \DateTime('@'.$timestamp); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | return null; |
@@ -258,7 +258,7 @@ |
||
| 258 | 258 | return substr($path, 0, $position); |
| 259 | 259 | } |
| 260 | 260 | } elseif ($this->getProject() == 'drupal' && $this->getCore() == '7.x') { |
| 261 | - return dirname($this->getFilename()) . '/../..'; |
|
| 261 | + return dirname($this->getFilename()).'/../..'; |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | return dirname($this->getFilename()); |