Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions .github/workflows/pull-request-cs-fixer.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,31 @@ on:
schedule:
- cron: '0 2 * * *'
jobs:
cs-fix:
name: PHP CS Fix on PHP${{ matrix.php }} ${{ matrix.swoole }}
runs-on: ubuntu-latest
strategy:
matrix:
os: [ ubuntu-latest ]
php: [ '8.1' ]
swoole: [ 'swoole' ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: php-cs-fixer
extensions: redis, pdo, pdo_mysql, bcmath, ${{ matrix.swoole }}
- name: Setup Packages
run: composer update -oW
- name: Check Composer Json
run: |
composer normalize --dry-run --no-update-lock
find ./src -name composer.json -exec composer normalize --dry-run --no-update-lock {} \;
- name: Run CS Fix
run: vendor/bin/php-cs-fixer fix src --dry-run --diff
tests:
name: Test on PHP${{ matrix.php-version }} Swoole-${{ matrix.sw-version }}
runs-on: "${{ matrix.os }}"
Expand Down
140 changes: 73 additions & 67 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,54 +1,13 @@
{
"name": "xmo/mine",
"license": "Apache-2.0",
"description": "mineAdmin核心组件",
"homepage": "http://www.mineadmin.com",
"license": "Apache-2.0",
"keywords": [
"MineAdmin",
"hyperf",
"hyperf-admin",
"Admin"
],
"autoload": {
"psr-4": {
"Mine\\": "src/mine-core/src",
"Xmo\\JWTAuth\\": "src/jwt-auth/src",
"Mine\\Office\\": "src/office/src",
"Mine\\Translatable\\": "src/translatable/src",
"Mine\\Helper\\": "src/mine-helpers/src",
"Mine\\Generator\\": "src/mine-generator/src",
"Mine\\AppStore\\": "src/AppStore/src",
"Mine\\AppStoreSdk\\": "src/AppStore/src",
"Mine\\NextCoreX\\": "src/next-core-x/src",
"Mine\\HttpServer\\": "src/HttpServer/src",
"Mine\\Crontab\\": "src/Crontab/src",
"Mine\\Support\\": "src/Support/src",
"Mine\\Module\\": "src/Module/src",
"Mine\\SecurityBundle\\": "src/SecurityBundle/src",
"Mine\\Security\\Http\\": "src/SecurityHttp/src",
"Mine\\Security\\Access\\": "src/SecurityAccess/src"
},
"files": [
"src/mine-helpers/src/functions.php",
"src/Support/src/functions.php"
]
},
"autoload-dev": {
"psr-4": {
"Mine\\Tests\\": "tests",
"Mine\\AppStore\\Tests\\": "src/AppStore/tests",
"Mine\\AppStoreSdk\\Tests\\": "src/AppStoreSdk/tests",
"Xmo\\MineCore\\Tests\\": "src/mine-core/tests",
"Mine\\NextCoreX\\Tests\\": "src/next-core-x/tests",
"Mine\\HttpServer\\Tests\\": "src/HttpServer/tests",
"Mine\\Crontab\\Tests\\": "src/Crontab/tests",
"Mine\\Support\\Tests\\": "src/Support/tests",
"Mine\\Module\\Tests\\": "src/Module/tests",
"Mine\\SecurityBundle\\Tests\\": "src/SecurityBundle/tests",
"Mine\\Security\\Http\\Tests\\": "src/SecurityHttp/tests",
"Mine\\Security\\Access\\Tests\\": "src/SecurityAccess/tests"
}
},
"authors": [
{
"name": "xmo",
Expand All @@ -61,21 +20,7 @@
"role": "Developer"
}
],
"replace": {
"xmo/mine": "*",
"xmo/mine-gateway": "*",
"xmo/jwt-auth": "*",
"xmo/mine-office": "*",
"xmo/mine-translatable": "*",
"xmo/mine-helpers": "*",
"xmo/mine-genertor": "*",
"mineadmin/app-store": "*",
"mine/next-core-x": "*",
"mineadmin/http-server": "*",
"mineadmin/security-bundle": "*",
"mineadmin/security-http": "*",
"mineadmin/module": "*"
},
"homepage": "http://www.mineadmin.com",
"require": {
"php": ">=8.1",
"ext-gd": "*",
Expand All @@ -86,10 +31,10 @@
"ext-redis": "*",
"ext-swoole": ">=5.0",
"ext-zip": "*",
"casbin/casbin": "^v3.21",
"casbin/casbin": "^3.21",
"doctrine/dbal": "^3.1",
"friendsofhyperf/encryption": "^3.1",
"friendsofhyperf/facade": "^v3.1",
"friendsofhyperf/facade": "^3.1",
"hyperf/amqp": "~3.1.0",
"hyperf/async-queue": "~3.1.0",
"hyperf/cache": "~3.1.0",
Expand Down Expand Up @@ -134,28 +79,89 @@
"symfony/var-exporter": "*",
"tangwei/apidocs": "^3.0",
"yurunsoft/phpmailer-swoole": "^1.0",
"zoujingli/ip2region": "2.0.*"
"zoujingli/ip2region": "~2.0.0"
},
"require-dev": {
"ergebnis/composer-normalize": "dev-main",
"friendsofphp/php-cs-fixer": "^3.0",
"hyperf/testing": "3.1.*",
"hyperf/testing": "~3.1.0",
"mockery/mockery": "^1.0",
"pestphp/pest": "2.x-dev",
"phpstan/phpstan": "^1.0",
"swoole/ide-helper": "dev-master"
},
"replace": {
"mine/next-core-x": "*",
"mineadmin/app-store": "*",
"mineadmin/http-server": "*",
"mineadmin/module": "*",
"mineadmin/security-bundle": "*",
"mineadmin/security-http": "*",
"xmo/jwt-auth": "*",
"xmo/mine": "*",
"xmo/mine-gateway": "*",
"xmo/mine-genertor": "*",
"xmo/mine-helpers": "*",
"xmo/mine-office": "*",
"xmo/mine-translatable": "*"
},
"minimum-stability": "dev",
"autoload": {
"psr-4": {
"Mine\\": "src/mine-core/src",
"Mine\\AppStoreSdk\\": "src/AppStore/src",
"Mine\\AppStore\\": "src/AppStore/src",
"Mine\\Crontab\\": "src/Crontab/src",
"Mine\\Generator\\": "src/mine-generator/src",
"Mine\\Helper\\": "src/mine-helpers/src",
"Mine\\HttpServer\\": "src/HttpServer/src",
"Mine\\Module\\": "src/Module/src",
"Mine\\NextCoreX\\": "src/next-core-x/src",
"Mine\\Office\\": "src/office/src",
"Mine\\SecurityBundle\\": "src/SecurityBundle/src",
"Mine\\Security\\Access\\": "src/SecurityAccess/src",
"Mine\\Security\\Http\\": "src/SecurityHttp/src",
"Mine\\Support\\": "src/Support/src",
"Mine\\Translatable\\": "src/translatable/src",
"Xmo\\JWTAuth\\": "src/jwt-auth/src"
},
"files": [
"src/mine-helpers/src/functions.php",
"src/Support/src/functions.php"
]
},
"autoload-dev": {
"psr-4": {
"Mine\\AppStoreSdk\\Tests\\": "src/AppStoreSdk/tests",
"Mine\\AppStore\\Tests\\": "src/AppStore/tests",
"Mine\\Crontab\\Tests\\": "src/Crontab/tests",
"Mine\\HttpServer\\Tests\\": "src/HttpServer/tests",
"Mine\\Module\\Tests\\": "src/Module/tests",
"Mine\\NextCoreX\\Tests\\": "src/next-core-x/tests",
"Mine\\SecurityBundle\\Tests\\": "src/SecurityBundle/tests",
"Mine\\Security\\Access\\Tests\\": "src/SecurityAccess/tests",
"Mine\\Security\\Http\\Tests\\": "src/SecurityHttp/tests",
"Mine\\Support\\Tests\\": "src/Support/tests",
"Mine\\Tests\\": "tests",
"Xmo\\MineCore\\Tests\\": "src/mine-core/tests"
}
},
"config": {
"optimize-autoloader": true,
"sort-packages": true,
"allow-plugins": {
"ergebnis/composer-normalize": true,
"pestphp/pest-plugin": true
}
},
"optimize-autoloader": true,
"sort-packages": true
},
"scripts": {
"cs-fix": "php-cs-fixer fix $1",
"test": "pest",
"analyse": "phpstan analyse --memory-limit 1000M -l 0 -c phpstan.neon ./src",
"coverage": "pest --coverage --coverage-clover tests/coverage.xml",
"analyse": "phpstan analyse --memory-limit 1000M -l 0 -c phpstan.neon ./src"
"cs-fix": "php-cs-fixer fix $1",
"json-fix": [
"@composer normalize --no-update-lock",
"find ./src -name composer.json -exec composer normalize --no-update-lock {} \\;"
],
"test": "pest"
}
}
22 changes: 11 additions & 11 deletions src/AppStore/composer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
{
"name": "mineadmin/app-store",
"description": "Mineadmin 2.0 AppStore Extension",
"type": "library",
"require": {
"hyperf/translation": "~3.1.0",
"nette/utils": "dev-master",
"ext-zip": "*"
},
"license": "MIT",
"autoload": {
"psr-4": {
"Mine\\AppStore\\": "src/"
}
},
"type": "library",
"authors": [
{
"name": "xmo",
Expand All @@ -25,6 +15,16 @@
"role": "Developer"
}
],
"require": {
"ext-zip": "*",
"hyperf/translation": "~3.1.0",
"nette/utils": "dev-master"
},
"autoload": {
"psr-4": {
"Mine\\AppStore\\": "src/"
}
},
"config": {
"allow-plugins": {
"pestphp/pest-plugin": true
Expand Down
6 changes: 3 additions & 3 deletions src/AppStore/src/Command/CreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ public function createMineJson(string $path, string $name, PluginTypeEnum $plugi
'psr-4' => [
$namespace . '\\' => 'src',
],
'installScript' => $namespace . '\\InstallScript',
'uninstallScript' => $namespace . '\\UninstallScript',
'config' => $namespace . '\\ConfigProvider',
'installScript' => $namespace . '\InstallScript',
'uninstallScript' => $namespace . '\UninstallScript',
'config' => $namespace . '\ConfigProvider',
];
}

Expand Down
4 changes: 2 additions & 2 deletions src/AppStore/src/Command/InitialCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public function __invoke(): int
}
$binFile = file_get_contents(BASE_PATH . '/bin/hyperf.php');
if (str_contains($binFile, 'Mine\AppStore\Plugin::init();')) {
$binFile = str_replace('Hyperf\Di\ClassLoader::init();', '\\Mine\\AppStore\\Plugin::init();
Hyperf\\Di\\ClassLoader::init();', $binFile);
$binFile = str_replace('Hyperf\Di\ClassLoader::init();', '\Mine\AppStore\Plugin::init();
Hyperf\Di\ClassLoader::init();', $binFile);
file_put_contents(BASE_PATH . '/bin/hyperf.php', $binFile);
$this->output->success('Plugin initialization code added successfully.');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Crontab/composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "mineadmin/crontab",
"description": "加强 Hyperf Crontab",
"type": "library",
"license": "MIT",
"type": "library",
"authors": [
{
"name": "x.mo",
Expand Down
8 changes: 4 additions & 4 deletions src/HttpServer/composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "mineadmin/http-server",
"description": "加强 Hyperf 原生 HttpServer",
"type": "library",
"license": "MIT",
"type": "library",
"authors": [
{
"name": "X.mo",
Expand All @@ -15,11 +15,11 @@
],
"require": {
"php": ">=8.1",
"hyperf/http-message": "^3.1",
"hyperf/http-server": "^3.1",
"hyperf/translation": "^3.1",
"hyperf/validation": "^3.1",
"hyperf/http-message": "^3.1",
"ramsey/uuid": "^4.7",
"hyperf/translation": "^3.1"
"ramsey/uuid": "^4.7"
},
"autoload": {
"psr-4": {
Expand Down
13 changes: 8 additions & 5 deletions src/Module/composer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"name": "mineadmin/module",
"description": "基于 MineAdmin 的模块化开发组件",
"type": "library",
"license": "MIT",
"keywords": ["Hyperf","Module"],
"type": "library",
"keywords": [
"Hyperf",
"Module"
],
"authors": [
{
"name": "xmo",
Expand All @@ -18,10 +21,10 @@
],
"require": {
"php": ">=8.1",
"mineadmin/http-server": "2.0.x-dev",
"hyperf/migration-generator": "^3.1",
"symfony/yaml": "*",
"hyperf/validation": "^3.1"
"hyperf/validation": "^3.1",
"mineadmin/http-server": "2.0.x-dev",
"symfony/yaml": "*"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/Module/src/Command/Creater/CreateModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function handle()
if (! empty($prefix) && preg_match(sprintf('/%s_%s[_a-zA-Z0-9]+/i', $prefix, $module), $tmp)) {
$tableList[] = $tmp;
}
if (preg_match(sprintf('/%s(\\b|_[a-zA-Z0-9]+)/i', $module), $tmp)) {
if (preg_match(sprintf('/%s(\b|_[a-zA-Z0-9]+)/i', $module), $tmp)) {
$tableList[] = $tmp;
}
}
Expand Down
Loading