@@ -54,21 +54,21 @@ discard block |
||
| 54 | 54 | * @return Collection |
| 55 | 55 | */ |
| 56 | 56 | protected function compile(CommandContextInterface $commandContext) { |
| 57 | - $this->logFile = storage_path('logs/async/' . (string) round(microtime(true) * 1000) . |
|
| 58 | - mt_rand(1, 10000) . '.log'); |
|
| 57 | + $this->logFile = storage_path('logs/async/'.(string) round(microtime(true) * 1000). |
|
| 58 | + mt_rand(1, 10000).'.log'); |
|
| 59 | 59 | |
| 60 | 60 | $memoryLimit = config('satis.memory_limit'); |
| 61 | 61 | $buildVerbosity = config('satis.build_verbosity'); |
| 62 | 62 | |
| 63 | 63 | $chunks = new Collection([ |
| 64 | - 'php' . ($memoryLimit !== null ? ' -dmemory_limit=' . $memoryLimit : ''), |
|
| 64 | + 'php'.($memoryLimit !== null ? ' -dmemory_limit='.$memoryLimit : ''), |
|
| 65 | 65 | sprintf($this->executable, DIRECTORY_SEPARATOR), |
| 66 | - $this->command . ($buildVerbosity !== null ? ' -' . $buildVerbosity : ''), |
|
| 66 | + $this->command.($buildVerbosity !== null ? ' -'.$buildVerbosity : ''), |
|
| 67 | 67 | $this->configPath, |
| 68 | 68 | $this->buildDirectory |
| 69 | 69 | ]); |
| 70 | 70 | |
| 71 | - if($this->item !== null) { |
|
| 71 | + if ($this->item !== null) { |
|
| 72 | 72 | $chunks->push($this->item); |
| 73 | 73 | } |
| 74 | 74 | |
@@ -82,10 +82,10 @@ discard block |
||
| 82 | 82 | $chunks->push($commandContext->getSendMailOnError($email, $message)); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - foreach(['http', 'https'] as $protocol) { |
|
| 85 | + foreach (['http', 'https'] as $protocol) { |
|
| 86 | 86 | $proxy = $this->proxySettings->get($protocol); |
| 87 | - if($proxy !== null) { |
|
| 88 | - $chunks->prepend(strtoupper($protocol) . '_PROXY=' . $proxy); |
|
| 87 | + if ($proxy !== null) { |
|
| 88 | + $chunks->prepend(strtoupper($protocol).'_PROXY='.$proxy); |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $logger = $commandContext->getLogger(); |
| 120 | 120 | |
| 121 | 121 | $logger->info(str_repeat('=', 30)); |
| 122 | - $logger->info('Running command => ' . PHP_EOL . $commandChunks->implode(' ')); |
|
| 122 | + $logger->info('Running command => '.PHP_EOL.$commandChunks->implode(' ')); |
|
| 123 | 123 | |
| 124 | 124 | chdir($this->directory); |
| 125 | 125 | |
@@ -127,10 +127,10 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | chdir($this->currentDirectory); |
| 129 | 129 | |
| 130 | - if($commandContext instanceof SyncCommand) { |
|
| 131 | - $logger->info('Command output => ' . implode(PHP_EOL, $output)); |
|
| 130 | + if ($commandContext instanceof SyncCommand) { |
|
| 131 | + $logger->info('Command output => '.implode(PHP_EOL, $output)); |
|
| 132 | 132 | } else { |
| 133 | - $logger->notice('Command output can be found in "' . $this->logFile . '".'); |
|
| 133 | + $logger->notice('Command output can be found in "'.$this->logFile.'".'); |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | $this->setCommandOutput($output); |
@@ -176,12 +176,12 @@ discard block |
||
| 176 | 176 | * @param string $item |
| 177 | 177 | */ |
| 178 | 178 | public function setItem($item) { |
| 179 | - if($item === null) { |
|
| 179 | + if ($item === null) { |
|
| 180 | 180 | return; |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - if(preg_match(Repository::REGEX, $item)) { |
|
| 184 | - $this->item = '--repository-url ' . escapeshellarg($item); |
|
| 183 | + if (preg_match(Repository::REGEX, $item)) { |
|
| 184 | + $this->item = '--repository-url '.escapeshellarg($item); |
|
| 185 | 185 | } else { |
| 186 | 186 | $this->item = escapeshellarg($item); |
| 187 | 187 | } |
@@ -216,8 +216,8 @@ discard block |
||
| 216 | 216 | public function run($asyncMode = true) { |
| 217 | 217 | # -- force sync |
| 218 | 218 | #if(true) { |
| 219 | - if($asyncMode === false || $this->isWindows() === true) { |
|
| 220 | - if($this->isWindows() === true) { |
|
| 219 | + if ($asyncMode === false || $this->isWindows() === true) { |
|
| 220 | + if ($this->isWindows() === true) { |
|
| 221 | 221 | $this->getLogger() |
| 222 | 222 | ->warn('OS does not support async mode, forcing sync.'); |
| 223 | 223 | } |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | |
| 240 | 240 | $result = $this->exec(new SyncCommand()); |
| 241 | 241 | |
| 242 | - if($result !== 0) { |
|
| 242 | + if ($result !== 0) { |
|
| 243 | 243 | throw new PackageBuildFailedException('Package build failed. Check build log for details.'); |
| 244 | 244 | } |
| 245 | 245 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | $homepage = $publicConfig->getHomepage(); |
| 42 | 42 | |
| 43 | - $publicConfig->setHomepage(rtrim($homepage, '/') . '/' . config('satis.public_repository')) |
|
| 43 | + $publicConfig->setHomepage(rtrim($homepage, '/').'/'.config('satis.public_repository')) |
|
| 44 | 44 | ->setRequireAll(false) |
| 45 | 45 | ->setRepositories(new RepositoryCollection([$repository])); |
| 46 | 46 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | $homepage = $privateConfig->getHomepage(); |
| 63 | 63 | |
| 64 | - $privateConfig->setHomepage(rtrim($homepage, '/') . '/' . config('satis.private_repository')) |
|
| 64 | + $privateConfig->setHomepage(rtrim($homepage, '/').'/'.config('satis.private_repository')) |
|
| 65 | 65 | ->setRequireAll(true) |
| 66 | 66 | ->setProviders(true) |
| 67 | 67 | ->setProvidersHistorySize(10) |
@@ -15,62 +15,62 @@ discard block |
||
| 15 | 15 | * @author Lukas Homza <[email protected]> |
| 16 | 16 | */ |
| 17 | 17 | class Config { |
| 18 | - /** |
|
| 19 | - * @Type("string") |
|
| 20 | - */ |
|
| 21 | - private $name; |
|
| 22 | - |
|
| 23 | - /** |
|
| 24 | - * @Type("string") |
|
| 25 | - */ |
|
| 26 | - private $homepage; |
|
| 27 | - |
|
| 28 | - /** |
|
| 29 | - * @Type("App\Satis\Collections\RepositoryCollection<App\Satis\Model\Repository>") |
|
| 30 | - */ |
|
| 31 | - private $repositories; |
|
| 32 | - |
|
| 33 | - /** |
|
| 34 | - * @Type("App\Satis\Collections\PackageCollection<App\Satis\Model\Package>") |
|
| 35 | - * @SerializedName("require") |
|
| 36 | - */ |
|
| 37 | - private $packages; |
|
| 38 | - |
|
| 39 | - /** |
|
| 40 | - * @Type("boolean") |
|
| 41 | - * @SerializedName("require-all") |
|
| 42 | - */ |
|
| 43 | - private $requireAll; |
|
| 44 | - |
|
| 45 | - /** |
|
| 46 | - * @Type("boolean") |
|
| 47 | - * @SerializedName("providers") |
|
| 48 | - */ |
|
| 49 | - private $providers; |
|
| 50 | - |
|
| 51 | - /** |
|
| 52 | - * @Type("int") |
|
| 53 | - * @SerializedName("providers-history-size") |
|
| 54 | - */ |
|
| 55 | - private $providersHistorySize; |
|
| 56 | - |
|
| 57 | - /** |
|
| 58 | - * @Type("boolean") |
|
| 59 | - * @SerializedName("require-dependencies") |
|
| 60 | - */ |
|
| 61 | - private $requireDependencies; |
|
| 62 | - |
|
| 63 | - /** |
|
| 64 | - * @Type("boolean") |
|
| 65 | - * @SerializedName("require-dev-dependencies") |
|
| 66 | - */ |
|
| 67 | - private $requireDevDependencies; |
|
| 68 | - |
|
| 69 | - /** |
|
| 70 | - * @var Archive |
|
| 71 | - * @Type("App\Satis\Model\Archive") |
|
| 72 | - */ |
|
| 73 | - private $archive; |
|
| 18 | + /** |
|
| 19 | + * @Type("string") |
|
| 20 | + */ |
|
| 21 | + private $name; |
|
| 22 | + |
|
| 23 | + /** |
|
| 24 | + * @Type("string") |
|
| 25 | + */ |
|
| 26 | + private $homepage; |
|
| 27 | + |
|
| 28 | + /** |
|
| 29 | + * @Type("App\Satis\Collections\RepositoryCollection<App\Satis\Model\Repository>") |
|
| 30 | + */ |
|
| 31 | + private $repositories; |
|
| 32 | + |
|
| 33 | + /** |
|
| 34 | + * @Type("App\Satis\Collections\PackageCollection<App\Satis\Model\Package>") |
|
| 35 | + * @SerializedName("require") |
|
| 36 | + */ |
|
| 37 | + private $packages; |
|
| 38 | + |
|
| 39 | + /** |
|
| 40 | + * @Type("boolean") |
|
| 41 | + * @SerializedName("require-all") |
|
| 42 | + */ |
|
| 43 | + private $requireAll; |
|
| 44 | + |
|
| 45 | + /** |
|
| 46 | + * @Type("boolean") |
|
| 47 | + * @SerializedName("providers") |
|
| 48 | + */ |
|
| 49 | + private $providers; |
|
| 50 | + |
|
| 51 | + /** |
|
| 52 | + * @Type("int") |
|
| 53 | + * @SerializedName("providers-history-size") |
|
| 54 | + */ |
|
| 55 | + private $providersHistorySize; |
|
| 56 | + |
|
| 57 | + /** |
|
| 58 | + * @Type("boolean") |
|
| 59 | + * @SerializedName("require-dependencies") |
|
| 60 | + */ |
|
| 61 | + private $requireDependencies; |
|
| 62 | + |
|
| 63 | + /** |
|
| 64 | + * @Type("boolean") |
|
| 65 | + * @SerializedName("require-dev-dependencies") |
|
| 66 | + */ |
|
| 67 | + private $requireDevDependencies; |
|
| 68 | + |
|
| 69 | + /** |
|
| 70 | + * @var Archive |
|
| 71 | + * @Type("App\Satis\Model\Archive") |
|
| 72 | + */ |
|
| 73 | + private $archive; |
|
| 74 | 74 | |
| 75 | 75 | /** |
| 76 | 76 | * @Type("string") |
@@ -78,165 +78,165 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | private $twigTemplate; |
| 80 | 80 | |
| 81 | - /** |
|
| 82 | - * Constructor |
|
| 83 | - */ |
|
| 84 | - public function __construct() { |
|
| 85 | - $this->repositories = []; |
|
| 86 | - $this->packages = []; |
|
| 87 | - $this->requireAll = false; |
|
| 88 | - $this->requireDependencies = true; |
|
| 89 | - $this->requireDevDependencies = false; |
|
| 90 | - } |
|
| 91 | - |
|
| 92 | - /** |
|
| 93 | - * Get name |
|
| 94 | - * |
|
| 95 | - * @return string $name |
|
| 96 | - */ |
|
| 97 | - public function getName() { |
|
| 98 | - return $this->name; |
|
| 99 | - } |
|
| 100 | - |
|
| 101 | - /** |
|
| 102 | - * Get homepage |
|
| 103 | - * |
|
| 104 | - * @return string $homepage |
|
| 105 | - */ |
|
| 106 | - public function getHomepage() { |
|
| 107 | - return $this->homepage; |
|
| 108 | - } |
|
| 109 | - |
|
| 110 | - /** |
|
| 111 | - * @param string $homepage |
|
| 112 | - * @return $this |
|
| 113 | - */ |
|
| 114 | - public function setHomepage($homepage) { |
|
| 115 | - $this->homepage = $homepage; |
|
| 116 | - |
|
| 117 | - return $this; |
|
| 118 | - } |
|
| 119 | - |
|
| 120 | - /** |
|
| 121 | - * Get repositories |
|
| 122 | - * |
|
| 123 | - * @return RepositoryCollection<Repository> |
|
| 124 | - */ |
|
| 125 | - public function getRepositories() { |
|
| 126 | - return $this->repositories; |
|
| 127 | - } |
|
| 128 | - |
|
| 129 | - /** |
|
| 130 | - * Set repositories |
|
| 131 | - * |
|
| 132 | - * @param RepositoryCollection $repositories |
|
| 133 | - * |
|
| 134 | - * @return static |
|
| 135 | - */ |
|
| 136 | - public function setRepositories(RepositoryCollection $repositories) { |
|
| 137 | - $this->repositories = $repositories; |
|
| 138 | - |
|
| 139 | - return $this; |
|
| 140 | - } |
|
| 141 | - |
|
| 142 | - /** |
|
| 143 | - * @param Archive $archive |
|
| 144 | - */ |
|
| 145 | - public function setArchive(Archive $archive = null) { |
|
| 146 | - $this->archive = $archive; |
|
| 147 | - } |
|
| 148 | - |
|
| 149 | - /** |
|
| 150 | - * @return Archive |
|
| 151 | - */ |
|
| 152 | - public function getArchive() { |
|
| 153 | - return $this->archive; |
|
| 154 | - } |
|
| 155 | - |
|
| 156 | - /** |
|
| 157 | - * Get packages |
|
| 158 | - * |
|
| 159 | - * @return PackageCollection<Package> |
|
| 160 | - */ |
|
| 161 | - public function getPackages() { |
|
| 162 | - return $this->packages; |
|
| 163 | - } |
|
| 164 | - |
|
| 165 | - /** |
|
| 166 | - * @param PackageCollection $packages |
|
| 167 | - * @return $this |
|
| 168 | - */ |
|
| 169 | - public function setPackages(PackageCollection $packages) { |
|
| 170 | - $this->packages = $packages; |
|
| 171 | - |
|
| 172 | - return $this; |
|
| 173 | - } |
|
| 174 | - |
|
| 175 | - /** |
|
| 176 | - * @return boolean |
|
| 177 | - */ |
|
| 178 | - public function getRequireDevDependencies() { |
|
| 179 | - return $this->requireDevDependencies; |
|
| 180 | - } |
|
| 181 | - |
|
| 182 | - /** |
|
| 183 | - * @param boolean $requireDevDependencies |
|
| 184 | - * @return Config |
|
| 185 | - */ |
|
| 186 | - public function setRequireDevDependencies($requireDevDependencies) { |
|
| 187 | - $this->requireDevDependencies = $requireDevDependencies; |
|
| 188 | - |
|
| 189 | - return $this; |
|
| 190 | - } |
|
| 191 | - |
|
| 192 | - /** |
|
| 193 | - * @return boolean |
|
| 194 | - */ |
|
| 195 | - public function getRequireAll() { |
|
| 196 | - return $this->requireAll; |
|
| 197 | - } |
|
| 198 | - |
|
| 199 | - /** |
|
| 200 | - * @param boolean $requireAll |
|
| 201 | - * @return $this |
|
| 202 | - */ |
|
| 203 | - public function setRequireAll($requireAll) { |
|
| 204 | - $this->requireAll = $requireAll; |
|
| 205 | - |
|
| 206 | - return $this; |
|
| 207 | - } |
|
| 208 | - |
|
| 209 | - /** |
|
| 210 | - * @return boolean |
|
| 211 | - */ |
|
| 212 | - public function getProviders() { |
|
| 213 | - return $this->providers; |
|
| 214 | - } |
|
| 215 | - |
|
| 216 | - /** |
|
| 217 | - * @param boolean $providers |
|
| 218 | - * @return $this |
|
| 219 | - */ |
|
| 220 | - public function setProviders($providers) { |
|
| 221 | - $this->providers = $providers; |
|
| 222 | - return $this; |
|
| 223 | - } |
|
| 224 | - |
|
| 225 | - /** |
|
| 226 | - * @return int |
|
| 227 | - */ |
|
| 228 | - public function getProvidersHistorySize() { |
|
| 229 | - return $this->providersHistorySize; |
|
| 230 | - } |
|
| 231 | - |
|
| 232 | - /** |
|
| 233 | - * @param int $providersHistorySize |
|
| 234 | - * @return $this |
|
| 235 | - */ |
|
| 236 | - public function setProvidersHistorySize($providersHistorySize) { |
|
| 237 | - $this->providersHistorySize = $providersHistorySize; |
|
| 238 | - return $this; |
|
| 239 | - } |
|
| 81 | + /** |
|
| 82 | + * Constructor |
|
| 83 | + */ |
|
| 84 | + public function __construct() { |
|
| 85 | + $this->repositories = []; |
|
| 86 | + $this->packages = []; |
|
| 87 | + $this->requireAll = false; |
|
| 88 | + $this->requireDependencies = true; |
|
| 89 | + $this->requireDevDependencies = false; |
|
| 90 | + } |
|
| 91 | + |
|
| 92 | + /** |
|
| 93 | + * Get name |
|
| 94 | + * |
|
| 95 | + * @return string $name |
|
| 96 | + */ |
|
| 97 | + public function getName() { |
|
| 98 | + return $this->name; |
|
| 99 | + } |
|
| 100 | + |
|
| 101 | + /** |
|
| 102 | + * Get homepage |
|
| 103 | + * |
|
| 104 | + * @return string $homepage |
|
| 105 | + */ |
|
| 106 | + public function getHomepage() { |
|
| 107 | + return $this->homepage; |
|
| 108 | + } |
|
| 109 | + |
|
| 110 | + /** |
|
| 111 | + * @param string $homepage |
|
| 112 | + * @return $this |
|
| 113 | + */ |
|
| 114 | + public function setHomepage($homepage) { |
|
| 115 | + $this->homepage = $homepage; |
|
| 116 | + |
|
| 117 | + return $this; |
|
| 118 | + } |
|
| 119 | + |
|
| 120 | + /** |
|
| 121 | + * Get repositories |
|
| 122 | + * |
|
| 123 | + * @return RepositoryCollection<Repository> |
|
| 124 | + */ |
|
| 125 | + public function getRepositories() { |
|
| 126 | + return $this->repositories; |
|
| 127 | + } |
|
| 128 | + |
|
| 129 | + /** |
|
| 130 | + * Set repositories |
|
| 131 | + * |
|
| 132 | + * @param RepositoryCollection $repositories |
|
| 133 | + * |
|
| 134 | + * @return static |
|
| 135 | + */ |
|
| 136 | + public function setRepositories(RepositoryCollection $repositories) { |
|
| 137 | + $this->repositories = $repositories; |
|
| 138 | + |
|
| 139 | + return $this; |
|
| 140 | + } |
|
| 141 | + |
|
| 142 | + /** |
|
| 143 | + * @param Archive $archive |
|
| 144 | + */ |
|
| 145 | + public function setArchive(Archive $archive = null) { |
|
| 146 | + $this->archive = $archive; |
|
| 147 | + } |
|
| 148 | + |
|
| 149 | + /** |
|
| 150 | + * @return Archive |
|
| 151 | + */ |
|
| 152 | + public function getArchive() { |
|
| 153 | + return $this->archive; |
|
| 154 | + } |
|
| 155 | + |
|
| 156 | + /** |
|
| 157 | + * Get packages |
|
| 158 | + * |
|
| 159 | + * @return PackageCollection<Package> |
|
| 160 | + */ |
|
| 161 | + public function getPackages() { |
|
| 162 | + return $this->packages; |
|
| 163 | + } |
|
| 164 | + |
|
| 165 | + /** |
|
| 166 | + * @param PackageCollection $packages |
|
| 167 | + * @return $this |
|
| 168 | + */ |
|
| 169 | + public function setPackages(PackageCollection $packages) { |
|
| 170 | + $this->packages = $packages; |
|
| 171 | + |
|
| 172 | + return $this; |
|
| 173 | + } |
|
| 174 | + |
|
| 175 | + /** |
|
| 176 | + * @return boolean |
|
| 177 | + */ |
|
| 178 | + public function getRequireDevDependencies() { |
|
| 179 | + return $this->requireDevDependencies; |
|
| 180 | + } |
|
| 181 | + |
|
| 182 | + /** |
|
| 183 | + * @param boolean $requireDevDependencies |
|
| 184 | + * @return Config |
|
| 185 | + */ |
|
| 186 | + public function setRequireDevDependencies($requireDevDependencies) { |
|
| 187 | + $this->requireDevDependencies = $requireDevDependencies; |
|
| 188 | + |
|
| 189 | + return $this; |
|
| 190 | + } |
|
| 191 | + |
|
| 192 | + /** |
|
| 193 | + * @return boolean |
|
| 194 | + */ |
|
| 195 | + public function getRequireAll() { |
|
| 196 | + return $this->requireAll; |
|
| 197 | + } |
|
| 198 | + |
|
| 199 | + /** |
|
| 200 | + * @param boolean $requireAll |
|
| 201 | + * @return $this |
|
| 202 | + */ |
|
| 203 | + public function setRequireAll($requireAll) { |
|
| 204 | + $this->requireAll = $requireAll; |
|
| 205 | + |
|
| 206 | + return $this; |
|
| 207 | + } |
|
| 208 | + |
|
| 209 | + /** |
|
| 210 | + * @return boolean |
|
| 211 | + */ |
|
| 212 | + public function getProviders() { |
|
| 213 | + return $this->providers; |
|
| 214 | + } |
|
| 215 | + |
|
| 216 | + /** |
|
| 217 | + * @param boolean $providers |
|
| 218 | + * @return $this |
|
| 219 | + */ |
|
| 220 | + public function setProviders($providers) { |
|
| 221 | + $this->providers = $providers; |
|
| 222 | + return $this; |
|
| 223 | + } |
|
| 224 | + |
|
| 225 | + /** |
|
| 226 | + * @return int |
|
| 227 | + */ |
|
| 228 | + public function getProvidersHistorySize() { |
|
| 229 | + return $this->providersHistorySize; |
|
| 230 | + } |
|
| 231 | + |
|
| 232 | + /** |
|
| 233 | + * @param int $providersHistorySize |
|
| 234 | + * @return $this |
|
| 235 | + */ |
|
| 236 | + public function setProvidersHistorySize($providersHistorySize) { |
|
| 237 | + $this->providersHistorySize = $providersHistorySize; |
|
| 238 | + return $this; |
|
| 239 | + } |
|
| 240 | 240 | |
| 241 | 241 | /** |
| 242 | 242 | * @return string |