Skip to content

Commit

Permalink
build: Remove unused extensions requirements and packages (#1151)
Browse files Browse the repository at this point in the history
Closes #1118.

Depends on #1146.
  • Loading branch information
theofidry authored Nov 5, 2023
1 parent 23acf7a commit b4a141c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 83 deletions.
3 changes: 0 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"ext-iconv": "*",
"ext-mbstring": "*",
"ext-phar": "*",
"ext-sodium": "*",
"composer-plugin-api": "^2.2",
"amphp/parallel-functions": "^1.1",
"composer/semver": "^3.3.2",
Expand All @@ -33,7 +32,6 @@
"laravel/serializable-closure": "^1.2.2",
"nikic/iter": "^2.2",
"nikic/php-parser": "^4.15.2",
"paragonie/constant_time_encoding": "^2.6",
"phpdocumentor/reflection-docblock": "^5.3",
"phpdocumentor/type-resolver": "^1.7",
"psr/log": "^3.0",
Expand Down Expand Up @@ -61,7 +59,6 @@
"webmozarts/strict-phpunit": "^7.6"
},
"replace": {
"paragonie/sodium_compat": "*",
"symfony/polyfill-php80": "*",
"symfony/polyfill-php81": "*"
},
Expand Down
84 changes: 8 additions & 76 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Console/Command/Extract.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
use KevinGH\Box\Phar\InvalidPhar;
use KevinGH\Box\Phar\PharFactory;
use KevinGH\Box\Phar\PharMeta;
use ParagonIE\ConstantTime\Hex;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Question\ConfirmationQuestion;
use Throwable;
use function bin2hex;
use function file_exists;
use function KevinGH\Box\check_php_settings;
use function realpath;
Expand Down Expand Up @@ -188,7 +188,7 @@ private static function generateAlias(string $file): string
{
$extension = self::getExtension($file);

return Hex::encode(random_bytes(16)).$extension;
return bin2hex(random_bytes(16)).$extension;
}

private static function getExtension(string $file): string
Expand Down
4 changes: 2 additions & 2 deletions src/Phar/PharInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
use Fidry\FileSystem\FS;
use KevinGH\Box\Console\Command\Extract;
use OutOfBoundsException;
use ParagonIE\ConstantTime\Hex;
use Phar;
use RuntimeException;
use Symfony\Component\Filesystem\Path;
Expand All @@ -55,6 +54,7 @@
use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\PhpExecutableFinder;
use Symfony\Component\Process\Process;
use function bin2hex;
use function file_exists;
use function getenv;
use function is_readable;
Expand Down Expand Up @@ -280,7 +280,7 @@ private static function initAlgorithms(): void
private static function initStubFileName(): void
{
if (!isset(self::$stubfile)) {
self::$stubfile = Hex::encode(random_bytes(12)).'.pharstub';
self::$stubfile = bin2hex(random_bytes(12)).'.pharstub';
}
}

Expand Down

0 comments on commit b4a141c

Please sign in to comment.