├── .github └── workflows │ └── proxy.yml ├── .gitignore ├── README.md ├── build └── .gitignore ├── composer.json ├── composer.lock ├── images ├── 1.jpg ├── 2.png ├── 3.png └── 4.png ├── main.php └── src ├── biz-skeleton └── composer.json └── swow-skeleton └── composer.json /.github/workflows/proxy.yml: -------------------------------------------------------------------------------- 1 | name: Push Proxies to Coding from Packagist 2 | 3 | on: 4 | push: 5 | pull_request: 6 | workflow_dispatch: 7 | # schedule: 8 | # - cron: '*/15 * * * *' 9 | 10 | env: 11 | CODING_URL: ${{ secrets.CODING_URL }} 12 | CODING_LOGIN: ${{ secrets.CODING_LOGIN }} 13 | CODING_PASSWORD: ${{ secrets.CODING_PASSWORD }} 14 | 15 | jobs: 16 | run: 17 | name: Push Proxies to Coding from Packagist 18 | runs-on: "ubuntu-latest" 19 | steps: 20 | - name: Checkout code 21 | uses: actions/checkout@v3 22 | - name: Setup PHP 23 | uses: shivammathur/setup-php@v2 24 | with: 25 | php-version: '8.1' 26 | coverage: none 27 | - name: Pull Composer 28 | run: | 29 | cd src/biz-skeleton 30 | composer update -oW --ignore-platform-reqs 31 | cd ../swow-skeleton 32 | composer update -oW --ignore-platform-reqs 33 | - name: Build Composer 34 | run: | 35 | composer install -o 36 | php main.php 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | vendor 3 | build 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Composer 代理 2 | 3 | 用于解决国内 `Composer` 源,不全、慢等问题。 4 | 5 | Coding 推出了 Composer 的制品库,但其有一系列BUG,暂时使用起来并不方便,所以,本仓库基于 Github Actions 和 Coding Composer 制品库,来解决以上问题。 6 | 7 | ## 使用指南 8 | 9 | 1. 在 [Coding](https://coding.net) 注册账号,创建项目组(需要支持制品管理) 10 | 2. 创建制品仓库,选择 Composer 11 | 3. 仓库设置 - 代理设置 12 | 13 | ![](./images/1.jpg) 14 | 15 | 4. 修改版本覆盖策略 16 | 17 | ![](./images/2.png) 18 | 19 | 5. 点击操作指引,生成个人令牌 20 | 21 | ![](./images/3.png) 22 | 23 | 将以下两个数据保存下来 24 | 25 | ``` 26 | login xxx 27 | password xxx 28 | ``` 29 | 30 | 6. 分别将上述两个数据,存储到 Secrets 中,命名为 31 | 32 | ``` 33 | CODING_LOGIN 34 | CODING_PASSWORD 35 | ``` 36 | 37 | 7. 复制远端地址,将其存储到 Secrets 中。 38 | 39 | ![](./images/4.png) 40 | 41 | 比如,我的 URL 为以下链接 42 | 43 | ```php 44 | CODING_URL="https://hyperf-cloud-composer.pkg.coding.net/limingxinleo/proxy" 45 | ``` 46 | 47 | 8. 最后一步只需要配置对应的代理接口 48 | 49 | ```json 50 | { 51 | "repositories": { 52 | "proxy": { 53 | "type": "composer", 54 | "url": "https://hyperf-cloud-composer.pkg.coding.net/limingxinleo/proxy", 55 | "only": [ 56 | "hyperf/*" 57 | ] 58 | } 59 | } 60 | } 61 | ``` 62 | 63 | -------------------------------------------------------------------------------- /build/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "symfony/finder": "^6.2", 4 | "guzzlehttp/guzzle": "^7.5" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "fd08676a177a991cef5794607d3bb424", 8 | "packages": [ 9 | { 10 | "name": "guzzlehttp/guzzle", 11 | "version": "7.8.1", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/guzzle/guzzle.git", 15 | "reference": "41042bc7ab002487b876a0683fc8dce04ddce104" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/guzzle/guzzle/zipball/41042bc7ab002487b876a0683fc8dce04ddce104", 20 | "reference": "41042bc7ab002487b876a0683fc8dce04ddce104", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "ext-json": "*", 25 | "guzzlehttp/promises": "^1.5.3 || ^2.0.1", 26 | "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", 27 | "php": "^7.2.5 || ^8.0", 28 | "psr/http-client": "^1.0", 29 | "symfony/deprecation-contracts": "^2.2 || ^3.0" 30 | }, 31 | "provide": { 32 | "psr/http-client-implementation": "1.0" 33 | }, 34 | "require-dev": { 35 | "bamarni/composer-bin-plugin": "^1.8.2", 36 | "ext-curl": "*", 37 | "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", 38 | "php-http/message-factory": "^1.1", 39 | "phpunit/phpunit": "^8.5.36 || ^9.6.15", 40 | "psr/log": "^1.1 || ^2.0 || ^3.0" 41 | }, 42 | "suggest": { 43 | "ext-curl": "Required for CURL handler support", 44 | "ext-intl": "Required for Internationalized Domain Name (IDN) support", 45 | "psr/log": "Required for using the Log middleware" 46 | }, 47 | "type": "library", 48 | "extra": { 49 | "bamarni-bin": { 50 | "bin-links": true, 51 | "forward-command": false 52 | } 53 | }, 54 | "autoload": { 55 | "files": [ 56 | "src/functions_include.php" 57 | ], 58 | "psr-4": { 59 | "GuzzleHttp\\": "src/" 60 | } 61 | }, 62 | "notification-url": "https://packagist.org/downloads/", 63 | "license": [ 64 | "MIT" 65 | ], 66 | "authors": [ 67 | { 68 | "name": "Graham Campbell", 69 | "email": "hello@gjcampbell.co.uk", 70 | "homepage": "https://github.com/GrahamCampbell" 71 | }, 72 | { 73 | "name": "Michael Dowling", 74 | "email": "mtdowling@gmail.com", 75 | "homepage": "https://github.com/mtdowling" 76 | }, 77 | { 78 | "name": "Jeremy Lindblom", 79 | "email": "jeremeamia@gmail.com", 80 | "homepage": "https://github.com/jeremeamia" 81 | }, 82 | { 83 | "name": "George Mponos", 84 | "email": "gmponos@gmail.com", 85 | "homepage": "https://github.com/gmponos" 86 | }, 87 | { 88 | "name": "Tobias Nyholm", 89 | "email": "tobias.nyholm@gmail.com", 90 | "homepage": "https://github.com/Nyholm" 91 | }, 92 | { 93 | "name": "Márk Sági-Kazár", 94 | "email": "mark.sagikazar@gmail.com", 95 | "homepage": "https://github.com/sagikazarmark" 96 | }, 97 | { 98 | "name": "Tobias Schultze", 99 | "email": "webmaster@tubo-world.de", 100 | "homepage": "https://github.com/Tobion" 101 | } 102 | ], 103 | "description": "Guzzle is a PHP HTTP client library", 104 | "keywords": [ 105 | "client", 106 | "curl", 107 | "framework", 108 | "http", 109 | "http client", 110 | "psr-18", 111 | "psr-7", 112 | "rest", 113 | "web service" 114 | ], 115 | "support": { 116 | "issues": "https://github.com/guzzle/guzzle/issues", 117 | "source": "https://github.com/guzzle/guzzle/tree/7.8.1" 118 | }, 119 | "funding": [ 120 | { 121 | "url": "https://github.com/GrahamCampbell", 122 | "type": "github" 123 | }, 124 | { 125 | "url": "https://github.com/Nyholm", 126 | "type": "github" 127 | }, 128 | { 129 | "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", 130 | "type": "tidelift" 131 | } 132 | ], 133 | "time": "2023-12-03T20:35:24+00:00" 134 | }, 135 | { 136 | "name": "guzzlehttp/promises", 137 | "version": "2.0.2", 138 | "source": { 139 | "type": "git", 140 | "url": "https://github.com/guzzle/promises.git", 141 | "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223" 142 | }, 143 | "dist": { 144 | "type": "zip", 145 | "url": "https://api.github.com/repos/guzzle/promises/zipball/bbff78d96034045e58e13dedd6ad91b5d1253223", 146 | "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223", 147 | "shasum": "" 148 | }, 149 | "require": { 150 | "php": "^7.2.5 || ^8.0" 151 | }, 152 | "require-dev": { 153 | "bamarni/composer-bin-plugin": "^1.8.2", 154 | "phpunit/phpunit": "^8.5.36 || ^9.6.15" 155 | }, 156 | "type": "library", 157 | "extra": { 158 | "bamarni-bin": { 159 | "bin-links": true, 160 | "forward-command": false 161 | } 162 | }, 163 | "autoload": { 164 | "psr-4": { 165 | "GuzzleHttp\\Promise\\": "src/" 166 | } 167 | }, 168 | "notification-url": "https://packagist.org/downloads/", 169 | "license": [ 170 | "MIT" 171 | ], 172 | "authors": [ 173 | { 174 | "name": "Graham Campbell", 175 | "email": "hello@gjcampbell.co.uk", 176 | "homepage": "https://github.com/GrahamCampbell" 177 | }, 178 | { 179 | "name": "Michael Dowling", 180 | "email": "mtdowling@gmail.com", 181 | "homepage": "https://github.com/mtdowling" 182 | }, 183 | { 184 | "name": "Tobias Nyholm", 185 | "email": "tobias.nyholm@gmail.com", 186 | "homepage": "https://github.com/Nyholm" 187 | }, 188 | { 189 | "name": "Tobias Schultze", 190 | "email": "webmaster@tubo-world.de", 191 | "homepage": "https://github.com/Tobion" 192 | } 193 | ], 194 | "description": "Guzzle promises library", 195 | "keywords": [ 196 | "promise" 197 | ], 198 | "support": { 199 | "issues": "https://github.com/guzzle/promises/issues", 200 | "source": "https://github.com/guzzle/promises/tree/2.0.2" 201 | }, 202 | "funding": [ 203 | { 204 | "url": "https://github.com/GrahamCampbell", 205 | "type": "github" 206 | }, 207 | { 208 | "url": "https://github.com/Nyholm", 209 | "type": "github" 210 | }, 211 | { 212 | "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", 213 | "type": "tidelift" 214 | } 215 | ], 216 | "time": "2023-12-03T20:19:20+00:00" 217 | }, 218 | { 219 | "name": "guzzlehttp/psr7", 220 | "version": "2.6.2", 221 | "source": { 222 | "type": "git", 223 | "url": "https://github.com/guzzle/psr7.git", 224 | "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221" 225 | }, 226 | "dist": { 227 | "type": "zip", 228 | "url": "https://api.github.com/repos/guzzle/psr7/zipball/45b30f99ac27b5ca93cb4831afe16285f57b8221", 229 | "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221", 230 | "shasum": "" 231 | }, 232 | "require": { 233 | "php": "^7.2.5 || ^8.0", 234 | "psr/http-factory": "^1.0", 235 | "psr/http-message": "^1.1 || ^2.0", 236 | "ralouphie/getallheaders": "^3.0" 237 | }, 238 | "provide": { 239 | "psr/http-factory-implementation": "1.0", 240 | "psr/http-message-implementation": "1.0" 241 | }, 242 | "require-dev": { 243 | "bamarni/composer-bin-plugin": "^1.8.2", 244 | "http-interop/http-factory-tests": "^0.9", 245 | "phpunit/phpunit": "^8.5.36 || ^9.6.15" 246 | }, 247 | "suggest": { 248 | "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" 249 | }, 250 | "type": "library", 251 | "extra": { 252 | "bamarni-bin": { 253 | "bin-links": true, 254 | "forward-command": false 255 | } 256 | }, 257 | "autoload": { 258 | "psr-4": { 259 | "GuzzleHttp\\Psr7\\": "src/" 260 | } 261 | }, 262 | "notification-url": "https://packagist.org/downloads/", 263 | "license": [ 264 | "MIT" 265 | ], 266 | "authors": [ 267 | { 268 | "name": "Graham Campbell", 269 | "email": "hello@gjcampbell.co.uk", 270 | "homepage": "https://github.com/GrahamCampbell" 271 | }, 272 | { 273 | "name": "Michael Dowling", 274 | "email": "mtdowling@gmail.com", 275 | "homepage": "https://github.com/mtdowling" 276 | }, 277 | { 278 | "name": "George Mponos", 279 | "email": "gmponos@gmail.com", 280 | "homepage": "https://github.com/gmponos" 281 | }, 282 | { 283 | "name": "Tobias Nyholm", 284 | "email": "tobias.nyholm@gmail.com", 285 | "homepage": "https://github.com/Nyholm" 286 | }, 287 | { 288 | "name": "Márk Sági-Kazár", 289 | "email": "mark.sagikazar@gmail.com", 290 | "homepage": "https://github.com/sagikazarmark" 291 | }, 292 | { 293 | "name": "Tobias Schultze", 294 | "email": "webmaster@tubo-world.de", 295 | "homepage": "https://github.com/Tobion" 296 | }, 297 | { 298 | "name": "Márk Sági-Kazár", 299 | "email": "mark.sagikazar@gmail.com", 300 | "homepage": "https://sagikazarmark.hu" 301 | } 302 | ], 303 | "description": "PSR-7 message implementation that also provides common utility methods", 304 | "keywords": [ 305 | "http", 306 | "message", 307 | "psr-7", 308 | "request", 309 | "response", 310 | "stream", 311 | "uri", 312 | "url" 313 | ], 314 | "support": { 315 | "issues": "https://github.com/guzzle/psr7/issues", 316 | "source": "https://github.com/guzzle/psr7/tree/2.6.2" 317 | }, 318 | "funding": [ 319 | { 320 | "url": "https://github.com/GrahamCampbell", 321 | "type": "github" 322 | }, 323 | { 324 | "url": "https://github.com/Nyholm", 325 | "type": "github" 326 | }, 327 | { 328 | "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", 329 | "type": "tidelift" 330 | } 331 | ], 332 | "time": "2023-12-03T20:05:35+00:00" 333 | }, 334 | { 335 | "name": "psr/http-client", 336 | "version": "1.0.3", 337 | "source": { 338 | "type": "git", 339 | "url": "https://github.com/php-fig/http-client.git", 340 | "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" 341 | }, 342 | "dist": { 343 | "type": "zip", 344 | "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", 345 | "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", 346 | "shasum": "" 347 | }, 348 | "require": { 349 | "php": "^7.0 || ^8.0", 350 | "psr/http-message": "^1.0 || ^2.0" 351 | }, 352 | "type": "library", 353 | "extra": { 354 | "branch-alias": { 355 | "dev-master": "1.0.x-dev" 356 | } 357 | }, 358 | "autoload": { 359 | "psr-4": { 360 | "Psr\\Http\\Client\\": "src/" 361 | } 362 | }, 363 | "notification-url": "https://packagist.org/downloads/", 364 | "license": [ 365 | "MIT" 366 | ], 367 | "authors": [ 368 | { 369 | "name": "PHP-FIG", 370 | "homepage": "https://www.php-fig.org/" 371 | } 372 | ], 373 | "description": "Common interface for HTTP clients", 374 | "homepage": "https://github.com/php-fig/http-client", 375 | "keywords": [ 376 | "http", 377 | "http-client", 378 | "psr", 379 | "psr-18" 380 | ], 381 | "support": { 382 | "source": "https://github.com/php-fig/http-client" 383 | }, 384 | "time": "2023-09-23T14:17:50+00:00" 385 | }, 386 | { 387 | "name": "psr/http-factory", 388 | "version": "1.0.2", 389 | "source": { 390 | "type": "git", 391 | "url": "https://github.com/php-fig/http-factory.git", 392 | "reference": "e616d01114759c4c489f93b099585439f795fe35" 393 | }, 394 | "dist": { 395 | "type": "zip", 396 | "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", 397 | "reference": "e616d01114759c4c489f93b099585439f795fe35", 398 | "shasum": "" 399 | }, 400 | "require": { 401 | "php": ">=7.0.0", 402 | "psr/http-message": "^1.0 || ^2.0" 403 | }, 404 | "type": "library", 405 | "extra": { 406 | "branch-alias": { 407 | "dev-master": "1.0.x-dev" 408 | } 409 | }, 410 | "autoload": { 411 | "psr-4": { 412 | "Psr\\Http\\Message\\": "src/" 413 | } 414 | }, 415 | "notification-url": "https://packagist.org/downloads/", 416 | "license": [ 417 | "MIT" 418 | ], 419 | "authors": [ 420 | { 421 | "name": "PHP-FIG", 422 | "homepage": "https://www.php-fig.org/" 423 | } 424 | ], 425 | "description": "Common interfaces for PSR-7 HTTP message factories", 426 | "keywords": [ 427 | "factory", 428 | "http", 429 | "message", 430 | "psr", 431 | "psr-17", 432 | "psr-7", 433 | "request", 434 | "response" 435 | ], 436 | "support": { 437 | "source": "https://github.com/php-fig/http-factory/tree/1.0.2" 438 | }, 439 | "time": "2023-04-10T20:10:41+00:00" 440 | }, 441 | { 442 | "name": "psr/http-message", 443 | "version": "2.0", 444 | "source": { 445 | "type": "git", 446 | "url": "https://github.com/php-fig/http-message.git", 447 | "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" 448 | }, 449 | "dist": { 450 | "type": "zip", 451 | "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", 452 | "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", 453 | "shasum": "" 454 | }, 455 | "require": { 456 | "php": "^7.2 || ^8.0" 457 | }, 458 | "type": "library", 459 | "extra": { 460 | "branch-alias": { 461 | "dev-master": "2.0.x-dev" 462 | } 463 | }, 464 | "autoload": { 465 | "psr-4": { 466 | "Psr\\Http\\Message\\": "src/" 467 | } 468 | }, 469 | "notification-url": "https://packagist.org/downloads/", 470 | "license": [ 471 | "MIT" 472 | ], 473 | "authors": [ 474 | { 475 | "name": "PHP-FIG", 476 | "homepage": "https://www.php-fig.org/" 477 | } 478 | ], 479 | "description": "Common interface for HTTP messages", 480 | "homepage": "https://github.com/php-fig/http-message", 481 | "keywords": [ 482 | "http", 483 | "http-message", 484 | "psr", 485 | "psr-7", 486 | "request", 487 | "response" 488 | ], 489 | "support": { 490 | "source": "https://github.com/php-fig/http-message/tree/2.0" 491 | }, 492 | "time": "2023-04-04T09:54:51+00:00" 493 | }, 494 | { 495 | "name": "ralouphie/getallheaders", 496 | "version": "3.0.3", 497 | "source": { 498 | "type": "git", 499 | "url": "https://github.com/ralouphie/getallheaders.git", 500 | "reference": "120b605dfeb996808c31b6477290a714d356e822" 501 | }, 502 | "dist": { 503 | "type": "zip", 504 | "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", 505 | "reference": "120b605dfeb996808c31b6477290a714d356e822", 506 | "shasum": "" 507 | }, 508 | "require": { 509 | "php": ">=5.6" 510 | }, 511 | "require-dev": { 512 | "php-coveralls/php-coveralls": "^2.1", 513 | "phpunit/phpunit": "^5 || ^6.5" 514 | }, 515 | "type": "library", 516 | "autoload": { 517 | "files": [ 518 | "src/getallheaders.php" 519 | ] 520 | }, 521 | "notification-url": "https://packagist.org/downloads/", 522 | "license": [ 523 | "MIT" 524 | ], 525 | "authors": [ 526 | { 527 | "name": "Ralph Khattar", 528 | "email": "ralph.khattar@gmail.com" 529 | } 530 | ], 531 | "description": "A polyfill for getallheaders.", 532 | "support": { 533 | "issues": "https://github.com/ralouphie/getallheaders/issues", 534 | "source": "https://github.com/ralouphie/getallheaders/tree/develop" 535 | }, 536 | "time": "2019-03-08T08:55:37+00:00" 537 | }, 538 | { 539 | "name": "symfony/deprecation-contracts", 540 | "version": "v3.4.0", 541 | "source": { 542 | "type": "git", 543 | "url": "https://github.com/symfony/deprecation-contracts.git", 544 | "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" 545 | }, 546 | "dist": { 547 | "type": "zip", 548 | "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", 549 | "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", 550 | "shasum": "" 551 | }, 552 | "require": { 553 | "php": ">=8.1" 554 | }, 555 | "type": "library", 556 | "extra": { 557 | "branch-alias": { 558 | "dev-main": "3.4-dev" 559 | }, 560 | "thanks": { 561 | "name": "symfony/contracts", 562 | "url": "https://github.com/symfony/contracts" 563 | } 564 | }, 565 | "autoload": { 566 | "files": [ 567 | "function.php" 568 | ] 569 | }, 570 | "notification-url": "https://packagist.org/downloads/", 571 | "license": [ 572 | "MIT" 573 | ], 574 | "authors": [ 575 | { 576 | "name": "Nicolas Grekas", 577 | "email": "p@tchwork.com" 578 | }, 579 | { 580 | "name": "Symfony Community", 581 | "homepage": "https://symfony.com/contributors" 582 | } 583 | ], 584 | "description": "A generic function and convention to trigger deprecation notices", 585 | "homepage": "https://symfony.com", 586 | "support": { 587 | "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0" 588 | }, 589 | "funding": [ 590 | { 591 | "url": "https://symfony.com/sponsor", 592 | "type": "custom" 593 | }, 594 | { 595 | "url": "https://github.com/fabpot", 596 | "type": "github" 597 | }, 598 | { 599 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 600 | "type": "tidelift" 601 | } 602 | ], 603 | "time": "2023-05-23T14:45:45+00:00" 604 | }, 605 | { 606 | "name": "symfony/finder", 607 | "version": "v6.4.0", 608 | "source": { 609 | "type": "git", 610 | "url": "https://github.com/symfony/finder.git", 611 | "reference": "11d736e97f116ac375a81f96e662911a34cd50ce" 612 | }, 613 | "dist": { 614 | "type": "zip", 615 | "url": "https://api.github.com/repos/symfony/finder/zipball/11d736e97f116ac375a81f96e662911a34cd50ce", 616 | "reference": "11d736e97f116ac375a81f96e662911a34cd50ce", 617 | "shasum": "" 618 | }, 619 | "require": { 620 | "php": ">=8.1" 621 | }, 622 | "require-dev": { 623 | "symfony/filesystem": "^6.0|^7.0" 624 | }, 625 | "type": "library", 626 | "autoload": { 627 | "psr-4": { 628 | "Symfony\\Component\\Finder\\": "" 629 | }, 630 | "exclude-from-classmap": [ 631 | "/Tests/" 632 | ] 633 | }, 634 | "notification-url": "https://packagist.org/downloads/", 635 | "license": [ 636 | "MIT" 637 | ], 638 | "authors": [ 639 | { 640 | "name": "Fabien Potencier", 641 | "email": "fabien@symfony.com" 642 | }, 643 | { 644 | "name": "Symfony Community", 645 | "homepage": "https://symfony.com/contributors" 646 | } 647 | ], 648 | "description": "Finds files and directories via an intuitive fluent interface", 649 | "homepage": "https://symfony.com", 650 | "support": { 651 | "source": "https://github.com/symfony/finder/tree/v6.4.0" 652 | }, 653 | "funding": [ 654 | { 655 | "url": "https://symfony.com/sponsor", 656 | "type": "custom" 657 | }, 658 | { 659 | "url": "https://github.com/fabpot", 660 | "type": "github" 661 | }, 662 | { 663 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 664 | "type": "tidelift" 665 | } 666 | ], 667 | "time": "2023-10-31T17:30:12+00:00" 668 | } 669 | ], 670 | "packages-dev": [], 671 | "aliases": [], 672 | "minimum-stability": "stable", 673 | "stability-flags": [], 674 | "prefer-stable": false, 675 | "prefer-lowest": false, 676 | "platform": [], 677 | "platform-dev": [], 678 | "plugin-api-version": "2.6.0" 679 | } 680 | -------------------------------------------------------------------------------- /images/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limingxinleo/composer-proxy/3ce73b81bed62315f7a552d49b6a31c3a268e5f0/images/1.jpg -------------------------------------------------------------------------------- /images/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limingxinleo/composer-proxy/3ce73b81bed62315f7a552d49b6a31c3a268e5f0/images/2.png -------------------------------------------------------------------------------- /images/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limingxinleo/composer-proxy/3ce73b81bed62315f7a552d49b6a31c3a268e5f0/images/3.png -------------------------------------------------------------------------------- /images/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limingxinleo/composer-proxy/3ce73b81bed62315f7a552d49b6a31c3a268e5f0/images/4.png -------------------------------------------------------------------------------- /main.php: -------------------------------------------------------------------------------- 1 | in(__DIR__ . '/src') 9 | ->path('/^[\w-]+\/composer\.lock/'); 10 | 11 | $url = getenv("CODING_URL"); 12 | $login = getenv("CODING_LOGIN"); 13 | $password = getenv("CODING_PASSWORD"); 14 | 15 | foreach ($finder as $value) { 16 | $json = json_decode( 17 | file_get_contents($value->getPathname()), 18 | true 19 | ); 20 | 21 | $packages = $json['packages'] ?? []; 22 | foreach ($packages as $package) { 23 | $name = $package['name'] ?? null; 24 | $version = $package['version'] ?? null; 25 | $packageUrl = $package['dist']['url'] ?? null; 26 | 27 | if ($name && $version && $packageUrl) { 28 | $dir = dirname($name); 29 | $realDir = dirname($value->getRealPath()) . '/vendor/' . $name; 30 | @mkdir(__DIR__ . '/build/' . $dir, 0777, true); 31 | 32 | $build = __DIR__ . '/build/' . $name . '.zip'; 33 | $cmd = "cd {$realDir} && zip -r {$build} ."; 34 | @exec($cmd); 35 | 36 | $cmd = "cd build && curl -T {$name}.zip -u {$login}:{$password} {$url}?version={$version}"; 37 | @exec($cmd); 38 | 39 | // $client = new \GuzzleHttp\Client([ 40 | // 'http_errors' => false, 41 | // ]); 42 | // 43 | // $res = $client->put("{$url}?version={$version}", [ 44 | // 'auth' => [$login, $password], 45 | // 'multipart' => [ 46 | // [ 47 | // 'name' => $name, 48 | // 'contents' => fopen("build/{$name}.zip", 'r') 49 | // ] 50 | // ] 51 | // ]); 52 | // 53 | // var_dump($res->getStatusCode()); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/biz-skeleton/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "php": ">=8.1", 4 | "ext-json": "*", 5 | "ext-openssl": "*", 6 | "ext-pdo": "*", 7 | "ext-pdo_mysql": "*", 8 | "ext-redis": "*", 9 | "ext-swoole": ">=5.0", 10 | "hyperf/async-queue": "3.1.*", 11 | "hyperf/cache": "3.1.*", 12 | "hyperf/command": "3.1.*", 13 | "hyperf/config": "3.1.*", 14 | "hyperf/constants": "3.1.*", 15 | "hyperf/context": "3.1.*", 16 | "hyperf/contract": "3.1.*", 17 | "hyperf/coroutine": "3.1.*", 18 | "hyperf/database": "3.1.*", 19 | "hyperf/db-connection": "3.1.*", 20 | "hyperf/di": "3.1.*", 21 | "hyperf/dispatcher": "3.1.*", 22 | "hyperf/engine": "^2.0", 23 | "hyperf/event": "3.1.*", 24 | "hyperf/exception-handler": "3.1.*", 25 | "hyperf/framework": "3.1.*", 26 | "hyperf/guzzle": "3.1.*", 27 | "hyperf/http-server": "3.1.*", 28 | "hyperf/logger": "3.1.*", 29 | "hyperf/model-cache": "3.1.*", 30 | "hyperf/pool": "3.1.*", 31 | "hyperf/process": "3.1.*", 32 | "hyperf/redis": "3.1.*", 33 | "hyperf/rpc-log-listener": "^1.0", 34 | "hyperf/rpc-multiplex": "3.1.*", 35 | "hyperf/server": "3.1.*", 36 | "hyperf/utils": "3.1.*", 37 | "hyperf/watcher": " 3.1.*", 38 | "limingxinleo/hyperf-utils": "^3.6", 39 | "limingxinleo/redis-collection": "^1.7" 40 | }, 41 | "minimum-stability": "dev", 42 | "prefer-stable": true, 43 | "config": { 44 | "optimize-autoloader": true, 45 | "sort-packages": true 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/swow-skeleton/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hyperf/swow-skeleton", 3 | "type": "project", 4 | "keywords": [ 5 | "php", 6 | "swow", 7 | "framework", 8 | "hyperf", 9 | "microservice", 10 | "middleware" 11 | ], 12 | "description": "A coroutine framework that focuses on hyperspeed and flexible, specifically use for build microservices and middlewares.", 13 | "license": "MIT", 14 | "require": { 15 | "php": ">=8.0", 16 | "hyperf/cache": "3.1.*", 17 | "hyperf/command": "3.1.*", 18 | "hyperf/config": "3.1.*", 19 | "hyperf/constants": "3.1.*", 20 | "hyperf/contract": "3.1.*", 21 | "hyperf/db-connection": "3.1.*", 22 | "hyperf/di": "3.1.*", 23 | "hyperf/dispatcher": "3.1.*", 24 | "hyperf/engine-swow": "^2.1", 25 | "hyperf/event": "3.1.*", 26 | "hyperf/exception-handler": "3.1.*", 27 | "hyperf/framework": "3.1.*", 28 | "hyperf/guzzle": "3.1.*", 29 | "hyperf/http-server": "3.1.*", 30 | "hyperf/logger": "3.1.*", 31 | "hyperf/process": "3.1.*", 32 | "hyperf/phar": "3.1.*", 33 | "hyperf/utils": "3.1.*" 34 | }, 35 | "require-dev": { 36 | "friendsofphp/php-cs-fixer": "^3.0", 37 | "hyperf/devtool": "3.1.*", 38 | "hyperf/testing": "3.1.*", 39 | "mockery/mockery": "^1.0", 40 | "phpstan/phpstan": "^1.0" 41 | }, 42 | "suggest": { 43 | "ext-openssl": "Required to use HTTPS.", 44 | "ext-json": "Required to use JSON.", 45 | "ext-pdo": "Required to use MySQL Client.", 46 | "ext-pdo_mysql": "Required to use MySQL Client.", 47 | "ext-redis": "Required to use Redis Client." 48 | }, 49 | "autoload": { 50 | "psr-4": { 51 | "App\\": "app/" 52 | } 53 | }, 54 | "autoload-dev": { 55 | "psr-4": { 56 | "HyperfTest\\": "test/" 57 | } 58 | }, 59 | "minimum-stability": "dev", 60 | "prefer-stable": true, 61 | "config": { 62 | "optimize-autoloader": true, 63 | "sort-packages": true 64 | }, 65 | "extra": [], 66 | "scripts": { 67 | "post-root-package-install": [ 68 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 69 | ], 70 | "post-autoload-dump": [ 71 | "@php -r \"if(PHP_OS_FAMILY === 'Windows') shell_exec('del /f /s /q runtime\\container && rmdir runtime\\container'); else shell_exec('rm -rf runtime/container');\" " 72 | ], 73 | "analyse": "@php vendor/bin/phpstan analyse --memory-limit 512M -l 0 -c phpstan.neon ./app ./config", 74 | "cs-fix": "@php vendor/bin/php-cs-fixer fix $1", 75 | "start": "@php bin/hyperf.php start", 76 | "test": "@php vendor/bin/phpunit -c phpunit.xml --colors=always", 77 | "rector": "rector process --clear-cache" 78 | } 79 | } 80 | --------------------------------------------------------------------------------