Skip to content

Commit 76fadcd

Browse files
committed
Revert "Release v7.5.11"
This reverts commit 4487612.
1 parent 4324b15 commit 76fadcd

File tree

5 files changed

+104
-1
lines changed

5 files changed

+104
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
deployer.phar
12
.phpunit.result.cache
23
docker-compose.override.yml
34
.php-cs-fixer.cache

bin/build

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,97 @@
55
* For the full copyright and license information, please view the LICENSE
66
* file that was distributed with this source code.
77
*/
8+
if (ini_get('phar.readonly') === '1') {
9+
throw new \Exception('Writing to phar files is disabled. Change your `php.ini` or append `-d phar.readonly=false` to the shebang, if supported by your `env` executable.');
10+
}
811

9-
echo "Do nothing.\n";
12+
define('__ROOT__', realpath(__DIR__ . '/..'));
13+
chdir(__ROOT__);
14+
15+
$opt = getopt('v:', ['nozip']);
16+
17+
$version = $opt['v'] ?? null;
18+
if (empty($version)) {
19+
echo "Please, specify version as \"-v8.0.0\".\n";
20+
exit(1);
21+
}
22+
if (!preg_match('/^\d+\.\d+\.\d+(\-\w+(\.\d+)?)?$/', $version)) {
23+
echo "Version must be \"7.0.0-beta.42\". Got \"$version\".\n";
24+
exit(1);
25+
}
26+
27+
$pharName = "deployer.phar";
28+
$pharFile = __ROOT__ . '/' . $pharName;
29+
if (file_exists($pharFile)) {
30+
unlink($pharFile);
31+
}
32+
33+
$ignore = [
34+
'.anton',
35+
'.git',
36+
'Tests',
37+
'tests',
38+
'deploy.php',
39+
'.php-cs-fixer.dist.php',
40+
];
41+
42+
$phar = new \Phar($pharFile, 0, $pharName);
43+
$phar->setSignatureAlgorithm(\Phar::SHA1);
44+
$phar->startBuffering();
45+
$iterator = new RecursiveDirectoryIterator(__ROOT__, FilesystemIterator::SKIP_DOTS);
46+
$iterator = new RecursiveCallbackFilterIterator($iterator, function (SplFileInfo $fileInfo) use ($ignore) {
47+
return !in_array($fileInfo->getBasename(), $ignore, true);
48+
});
49+
$iterator = new RecursiveIteratorIterator($iterator);
50+
$iterator = new CallbackFilterIterator($iterator, function (SplFileInfo $fileInfo) {
51+
//'bash', 'fish', 'zsh' is a completion templates
52+
return in_array($fileInfo->getExtension(), ['php', 'exe', 'bash', 'fish', 'zsh'], true);
53+
});
54+
55+
foreach ($iterator as $fileInfo) {
56+
$file = str_replace(__ROOT__, '', $fileInfo->getRealPath());
57+
echo "+ " . $file . "\n";
58+
$phar->addFile($fileInfo->getRealPath(), $file);
59+
60+
if (!array_key_exists('nozip', $opt)) {
61+
$phar[$file]->compress(Phar::GZ);
62+
63+
if (!$phar[$file]->isCompressed()) {
64+
echo "Could not compress File: $file\n";
65+
}
66+
}
67+
}
68+
69+
// Add schema.json
70+
echo "+ /src/schema.json\n";
71+
$phar->addFile(realpath(__DIR__ . '/../src/schema.json'), '/src/schema.json');
72+
73+
// Add Caddyfile
74+
echo "+ /recipe/provision/Caddyfile\n";
75+
$phar->addFile(realpath(__DIR__ . '/../recipe/provision/Caddyfile'), '/recipe/provision/Caddyfile');
76+
77+
// Add 404.html
78+
echo "+ /recipe/provision/404.html\n";
79+
$phar->addFile(realpath(__DIR__ . '/../recipe/provision/404.html'), '/recipe/provision/404.html');
80+
81+
// Add bin/dep file
82+
echo "+ /bin/dep\n";
83+
$depContent = file_get_contents(__ROOT__ . '/bin/dep');
84+
$depContent = str_replace("#!/usr/bin/env php\n", '', $depContent);
85+
$depContent = str_replace('__FILE__', 'str_replace("phar://", "", Phar::running())', $depContent);
86+
$depContent = preg_replace("/run\('.+?'/", "run('$version'", $depContent);
87+
$phar->addFromString('bin/dep', $depContent);
88+
89+
$phar->setStub(
90+
<<<STUB
91+
#!/usr/bin/env php
92+
<?php
93+
Phar::mapPhar('{$pharName}');
94+
require 'phar://{$pharName}/bin/dep';
95+
__HALT_COMPILER();
96+
STUB
97+
);
98+
$phar->stopBuffering();
99+
unset($phar);
100+
101+
echo "$pharName was created successfully.\n";

bin/dep

-773 KB
Binary file not shown.

composer.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@
2020
"url": "https://github.com/sponsors/antonmedv"
2121
}
2222
],
23+
"autoload": {
24+
"psr-4": {
25+
"Deployer\\": "src/"
26+
},
27+
"files": [
28+
"vendor/autoload.php",
29+
"src/Support/helpers.php",
30+
"src/functions.php"
31+
]
32+
},
2333
"scripts": {
2434
"test": "pest",
2535
"test:e2e": "pest --config tests/e2e/phpunit-e2e.xml",

deployer.phar

-776 KB
Binary file not shown.

0 commit comments

Comments
 (0)