Squashed commit message
Some checks failed
Telegram Mini App Shop Builder / Compute version metadata (push) Has been cancelled
Telegram Mini App Shop Builder / Run Frontend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run Backend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run PHP_CodeSniffer (push) Has been cancelled
Telegram Mini App Shop Builder / Build module. (push) Has been cancelled
Telegram Mini App Shop Builder / release (push) Has been cancelled
Some checks failed
Telegram Mini App Shop Builder / Compute version metadata (push) Has been cancelled
Telegram Mini App Shop Builder / Run Frontend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run Backend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run PHP_CodeSniffer (push) Has been cancelled
Telegram Mini App Shop Builder / Build module. (push) Has been cancelled
Telegram Mini App Shop Builder / release (push) Has been cancelled
This commit is contained in:
37
scripts/ci/create-phar.php
Normal file
37
scripts/ci/create-phar.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
$sourcePath = $argv[1] ?? null;
|
||||
$pharFile = $argv[2] ?? null;
|
||||
|
||||
if (! $sourcePath) {
|
||||
throw new InvalidArgumentException('Source path must be provided');
|
||||
}
|
||||
|
||||
if (! $pharFile) {
|
||||
throw new InvalidArgumentException('Phar file must be provided');
|
||||
}
|
||||
|
||||
// Remove old file if exists
|
||||
if (file_exists($pharFile)) {
|
||||
unlink($pharFile);
|
||||
}
|
||||
|
||||
// Create new Phar archive
|
||||
$phar = new Phar($pharFile);
|
||||
|
||||
// Start buffering
|
||||
$phar->startBuffering();
|
||||
|
||||
// Add files from source directory
|
||||
|
||||
$phar->buildFromDirectory($sourcePath);
|
||||
|
||||
// (Optional) Set stub file — main entry point
|
||||
// $phar->setStub($phar->createDefaultStub('index.php'));
|
||||
|
||||
$phar->compressFiles(Phar::GZ);
|
||||
|
||||
// Stop buffering and write
|
||||
$phar->stopBuffering();
|
||||
|
||||
echo "Phar created: $pharFile\n";
|
||||
Reference in New Issue
Block a user