├── .github └── workflows │ └── test-phpunit.yml ├── .gitignore ├── .php-cs-fixer.dist.php ├── README.md ├── README_zh-TW.md ├── build └── .gitkeep ├── composer.json ├── dev ├── .gitignore ├── LICENSE ├── README.md ├── README_ZH-TW.md ├── app │ ├── .htaccess │ ├── Common.php │ ├── Config │ │ ├── App.php │ │ ├── Autoload.php │ │ ├── Boot │ │ │ ├── development.php │ │ │ ├── production.php │ │ │ └── testing.php │ │ ├── CURLRequest.php │ │ ├── Cache.php │ │ ├── Constants.php │ │ ├── ContentSecurityPolicy.php │ │ ├── Cookie.php │ │ ├── Database.php │ │ ├── DocTypes.php │ │ ├── Email.php │ │ ├── Encryption.php │ │ ├── Events.php │ │ ├── Exceptions.php │ │ ├── Feature.php │ │ ├── Filters.php │ │ ├── ForeignCharacters.php │ │ ├── Format.php │ │ ├── Generators.php │ │ ├── Honeypot.php │ │ ├── Images.php │ │ ├── Kint.php │ │ ├── Logger.php │ │ ├── Migrations.php │ │ ├── Mimes.php │ │ ├── Modules.php │ │ ├── Pager.php │ │ ├── Paths.php │ │ ├── Publisher.php │ │ ├── Routes.php │ │ ├── Security.php │ │ ├── Services.php │ │ ├── Toolbar.php │ │ ├── UserAgents.php │ │ ├── Validation.php │ │ └── View.php │ ├── Controllers │ │ ├── BaseController.php │ │ ├── BasicTest.php │ │ ├── FileUploadTest.php │ │ ├── Home.php │ │ ├── SessionTest.php │ │ └── TestRest.php │ ├── Database │ │ ├── Migrations │ │ │ └── .gitkeep │ │ └── Seeds │ │ │ └── .gitkeep │ ├── Filters │ │ └── .gitkeep │ ├── Helpers │ │ └── .gitkeep │ ├── Language │ │ ├── .gitkeep │ │ └── en │ │ │ └── Validation.php │ ├── Libraries │ │ └── .gitkeep │ ├── Models │ │ └── .gitkeep │ ├── ThirdParty │ │ └── .gitkeep │ ├── Views │ │ ├── errors │ │ │ ├── cli │ │ │ │ ├── error_404.php │ │ │ │ ├── error_exception.php │ │ │ │ └── production.php │ │ │ └── html │ │ │ │ ├── debug.css │ │ │ │ ├── debug.js │ │ │ │ ├── error_404.php │ │ │ │ ├── error_exception.php │ │ │ │ └── production.php │ │ └── welcome_message.php │ └── index.html ├── builds ├── composer.json ├── composer.lock ├── env ├── phpunit.xml.dist ├── public │ ├── .htaccess │ ├── favicon.ico │ ├── index.php │ └── robots.txt ├── spark ├── tests │ ├── README.md │ ├── _support │ │ ├── Database │ │ │ ├── Migrations │ │ │ │ └── 2020-02-22-222222_example_migration.php │ │ │ └── Seeds │ │ │ │ └── ExampleSeeder.php │ │ ├── Libraries │ │ │ └── ConfigReader.php │ │ └── Models │ │ │ └── ExampleModel.php │ ├── bootstrap.php │ └── codeigniter4Roadrunner │ │ ├── RequestBridgeTest.php │ │ ├── UploadedFileBridgeTest.php │ │ └── httpTest │ │ ├── BasicTest.php │ │ ├── FileUploadTest.php │ │ ├── RestTest.php │ │ ├── SessionTest.php │ │ └── testFiles │ │ ├── upload1.text │ │ └── upload2.text └── writable │ ├── .htaccess │ ├── cache │ └── index.html │ ├── logs │ └── index.html │ ├── session │ └── index.html │ └── uploads │ └── index.html ├── rector.php └── src ├── Commands ├── InitLibrary.php └── file │ ├── .rr.yaml │ └── psr-worker.php ├── Debug ├── Exceptions.php └── Toolbar.php ├── HandleDBConnection.php ├── RequestHandler.php ├── ResponseBridge.php ├── UploadedFile.php ├── UploadedFileBridge.php └── UriBridge.php /.github/workflows/test-phpunit.yml: -------------------------------------------------------------------------------- 1 | name: PHPUnit 2 | 3 | on: 4 | push: 5 | branches: 6 | - dev 7 | paths: 8 | - 'src/**' 9 | - 'test/**' 10 | - composer.json 11 | - '**.php' 12 | - .github/workflows/test-phpunit.yml 13 | pull_request: 14 | branches: 15 | - dev 16 | paths: 17 | - 'src/**' 18 | - 'test/**' 19 | - composer.json 20 | - '**.php' 21 | - .github/workflows/test-phpunit.yml 22 | 23 | jobs: 24 | 25 | tests: 26 | runs-on: ubuntu-18.04 27 | if: "!contains(github.event.head_commit.message, '[ci skip]')" 28 | name: PHP ${{ matrix.php-ver }} 29 | 30 | strategy: 31 | fail-fast: false 32 | matrix: 33 | php-ver: ['7.3','7.4'] 34 | 35 | steps: 36 | - name: Checkout 37 | uses: actions/checkout@v2 38 | 39 | - name: Setup PHP, with composer and extensions 40 | run: | 41 | sudo add-apt-repository ppa:ondrej/php -y 42 | sudo apt update -y 43 | sudo apt-get install php${{ matrix.php-ver }} 44 | sudo apt install php-pear php${{ matrix.php-ver }}-curl php${{ matrix.php-ver }}-dev php${{ matrix.php-ver }}-mbstring php${{ matrix.php-ver }}-zip php${{ matrix.php-ver }}-mysql php${{ matrix.php-ver }}-xml php${{ matrix.php-ver }}-fpm php${{ matrix.php-ver }}-intl -y 45 | sudo apt-get update -y 46 | sudo apt-get install -y php-xdebug 47 | sudo curl -s https://getcomposer.org/installer | php 48 | sudo mv composer.phar /usr/local/bin/composer 49 | 50 | - name: Install dependencies 51 | working-directory: ./test 52 | run: | 53 | composer update 54 | env: 55 | COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} 56 | 57 | - name: Init roadrunner server 58 | working-directory: ./test 59 | run: | 60 | sudo ./vendor/bin/rr get 61 | cp ../src/Commands/file/psr-worker.php psr-worker.php 62 | sudo ./rr serve -v -d & 63 | 64 | - name: Test with PHPUnit 65 | working-directory: ./test 66 | run: script -e -c "vendor/bin/phpunit -v" 67 | env: 68 | TERM: xterm-256color -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | vendor/ 3 | .idea/ 4 | composer.lock 5 | .php-cs-fixer.cache 6 | -------------------------------------------------------------------------------- /.php-cs-fixer.dist.php: -------------------------------------------------------------------------------- 1 | files() 9 | ->in([ 10 | __DIR__ . '/src/', 11 | // __DIR__ . '/tests/', 12 | __DIR__ . '/dev/app/', 13 | __DIR__ . '/dev/tests/', 14 | ]) 15 | ->exclude('build') 16 | ->append([__FILE__]); 17 | 18 | $overrides = []; 19 | 20 | $options = [ 21 | 'finder' => $finder, 22 | 'cacheFile' => 'build/.php-cs-fixer.cache', 23 | ]; 24 | 25 | return Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects(); 26 | -------------------------------------------------------------------------------- /README_zh-TW.md: -------------------------------------------------------------------------------- 1 | # Codeigniter4-Roadrunner 2 | 3 |
4 |
5 |