diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2c7477c..1768785 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,69 +1,56 @@ # GithHub Actions Workflow generated with Ghygen -# Original configuration: https://ghygen.hi-folks.dev?code=bb85a1693f8aa341b4c92d07cea283be +# Original configuration: http://gh-actions-yaml-generator.test?code=c8d53a9318c7a2b641f80d605f104de5 name: Test Laravel Package on: - push: - branches: - - main - - master - - develop - - features/** - - feature/** + push: + branches: + - master + - develop + - features/** jobs: - laravel-tests: - runs-on: ubuntu-latest - - strategy: - matrix: - operating-system: [ubuntu-latest] - php-versions: [ '8.0','7.4','7.3' ] - dependency-stability: [ prefer-stable ] - - name: P${{ matrix.php-versions }} - L${{ matrix.laravel }} - ${{ matrix.dependency-stability }} - ${{ matrix.operating-system}} - - steps: - - uses: actions/checkout@v2 - - name: Install PHP versions - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - - name: Get Composer Cache Directory 2 - id: composer-cache - run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" - - uses: actions/cache@v2 - id: actions-cache - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - name: Install Dependencies - run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist - - - - - - name: Show dir - run: pwd - - name: PHP Version - run: php --version - - - name: Execute tests (Unit and Feature tests) via PHPUnit - # Set environment - env: - SESSION_DRIVER: array - - run: vendor/bin/phpunit --testdox - - - name: Execute Code Sniffer via phpcs - run: | - vendor/bin/phpcs --standard=PSR12 src - - name: Execute Code Static Generator via phpstan - run: | - vendor/bin/phpstan analyse src -c ./vendor/nunomaduro/larastan/extension.neon --level=4 --no-progress - + laravel-tests: + runs-on: ubuntu-latest + + strategy: + matrix: + operating-system: [ubuntu-latest] + php-versions: [ '8.0','7.4','7.3' ] + dependency-stability: [ prefer-stable ] + + name: P${{ matrix.php-versions }} - L${{ matrix.laravel }} - ${{ matrix.dependency-stability }} - ${{ matrix.operating-system}} + + steps: + - uses: actions/checkout@v2 + - name: Install PHP versions + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + - name: Install Dependencies + if: steps.vendor-cache.outputs.cache-hit != 'true' + run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + + + - name: Show dir + run: pwd + - name: PHP Version + run: php --version + +# Code quality + - name: Execute tests (Unit and Feature tests) via PHPUnit +# Set environment + env: + SESSION_DRIVER: array + + run: vendor/bin/phpunit --testdox + + - name: Execute Code Sniffer via phpcs + run: | + vendor/bin/phpcs --standard=PSR12 src + + - name: Execute Code Static Analysis (PHP Stan + Larastan) + run: | + vendor/bin/phpstan analyse src -c ./vendor/nunomaduro/larastan/extension.neon --level=4 --no-progress diff --git a/CHANGELOG.md b/CHANGELOG.md index 75d5768..8874062 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,12 @@ # Changelog +## 0.2.4 - 2021-04-18 +### Add +- In runtime information, added upload_max_filesize and post_max_size from php configuration ( thanks to @yogendra-revanna ) ## 0.2.3 - 2021-04-10 ### Add - Check DEBUG and ENV configuration for production (if production avoid having debug on); -- Check Storage Links and sohw the user a waring if some directory links are missing +- Check Storage Links and show the user a waring if some directory links are missing ### Change - improve tests and checks script for Workflows diff --git a/src/Lens/Traits/RuntimeLens.php b/src/Lens/Traits/RuntimeLens.php index 11df9f9..f4fa198 100644 --- a/src/Lens/Traits/RuntimeLens.php +++ b/src/Lens/Traits/RuntimeLens.php @@ -26,6 +26,20 @@ private function appCaller($results, $functions) } } + private function getIniValues($results) + { + $labels = [ + "post_max_size", + "upload_max_filesize", + ]; + foreach ($labels as $label) { + $results->add( + $label, + ini_get($label) + ); + } + } + public function getRuntimeConfigs() { $results = new ResultLens(); @@ -33,6 +47,7 @@ public function getRuntimeConfigs() "PHP Version", phpversion() ); + $this->getIniValues($results); $results->add( "Current Directory", getcwd() diff --git a/tests/ConsistencyTest.php b/tests/ConsistencyTest.php index 2b07d71..9fae2d9 100644 --- a/tests/ConsistencyTest.php +++ b/tests/ConsistencyTest.php @@ -47,7 +47,7 @@ public function test_runtimeconfig_array() $l = new LaraLens(); $a = $l->getRuntimeConfigs(); $this->assertIsArray($a->toArray()); - $this->assertCount(20, $a->toArray()); + $this->assertCount(22, $a->toArray()); } /** @test */ public function test_database_array()