Skip to content

Commit 14bfb41

Browse files
committed
v3 base
1 parent f6c818d commit 14bfb41

File tree

179 files changed

+19432
-585
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+19432
-585
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Tests
22

33
on:
44
pull_request:
5-
branches: [ "main" ]
5+
branches: [ "main", "v3" ]
66
types: [ opened, synchronize, reopened ]
77
paths:
88
- 'src/**'

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.idea
2-
runtime/
3-
docker/libraries/
4-
docker/extensions/
5-
docker/source/
2+
/runtime/
3+
/docker/libraries/
4+
/docker/extensions/
5+
/docker/source/
66

77
# Vendor files
88
/vendor/**

bin/spc

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
#!/usr/bin/env php
22
<?php
33

4-
use SPC\ConsoleApplication;
5-
use SPC\exception\ExceptionHandler;
6-
7-
// Load custom php if exists
8-
if (PHP_OS_FAMILY !== 'Windows' && PHP_BINARY !== (__DIR__ . '/php') && file_exists(__DIR__ . '/php') && is_executable(__DIR__ . '/php')) {
9-
pcntl_exec(__DIR__ . '/php', $argv);
10-
}
4+
use StaticPHP\ConsoleApplication;
5+
use StaticPHP\Exception\ExceptionHandler;
6+
use StaticPHP\Exception\SPCException;
117

128
if (file_exists(dirname(__DIR__) . '/vendor/autoload.php')) {
139
// Current: ./bin (git/project mode)
@@ -17,19 +13,18 @@ if (file_exists(dirname(__DIR__) . '/vendor/autoload.php')) {
1713
require_once dirname(__DIR__, 3) . '/autoload.php';
1814
}
1915

20-
// 防止 Micro 打包状态下不支持中文的显示(虽然这个项目目前好像没输出过中文?)
21-
if (PHP_OS_FAMILY === 'Windows' && Phar::running()) {
22-
exec('CHCP 65001');
23-
}
24-
2516
// Print deprecation notice on PHP < 8.4, use red and highlight background
2617
if (PHP_VERSION_ID < 80400) {
2718
echo "\e[43mDeprecation Notice: PHP < 8.4 is deprecated, please upgrade your PHP version.\e[0m\n";
2819
}
2920

3021
try {
3122
(new ConsoleApplication())->run();
32-
} catch (Exception $e) {
33-
ExceptionHandler::getInstance()->handle($e);
23+
} catch (SPCException $e) {
24+
ExceptionHandler::handleSPCException($e);
25+
exit(1);
26+
} catch (\Throwable $e) {
27+
ExceptionHandler::handleDefaultException($e);
3428
exit(1);
3529
}
30+

bin/spc-debug

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
3+
# This script runs the 'spc' command with Xdebug enabled for debugging purposes.
4+
php -d xdebug.mode=debug -d xdebug.client_host=127.0.0.1 -d xdebug.client_port=9003 -d xdebug.start_with_request=yes "$(dirname "$0")/../bin/spc" "$@"

composer.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99
}
1010
],
1111
"require": {
12-
"php": ">= 8.3",
12+
"php": ">=8.4",
1313
"ext-mbstring": "*",
1414
"ext-zlib": "*",
15-
"laravel/prompts": "^0.1.12",
15+
"laravel/prompts": "~0.1",
16+
"php-di/php-di": "^7.1",
1617
"symfony/console": "^5.4 || ^6 || ^7",
1718
"symfony/process": "^7.2",
1819
"symfony/yaml": "^7.2",
19-
"zhamao/logger": "^1.1.3"
20+
"zhamao/logger": "^1.1.4"
2021
},
2122
"require-dev": {
2223
"captainhook/captainhook-phar": "^5.23",
@@ -28,7 +29,9 @@
2829
},
2930
"autoload": {
3031
"psr-4": {
31-
"SPC\\": "src/SPC"
32+
"SPC\\": "src/SPC",
33+
"StaticPHP\\": "src/StaticPHP",
34+
"Package\\": "src/Package"
3235
},
3336
"files": [
3437
"src/globals/defines.php",

0 commit comments

Comments
 (0)