diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d4012a..71b5bab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,8 +66,8 @@ jobs: with: php-version: ${{ matrix.php }} - run: composer install --no-dev - - run: docker run -d -v "$PWD":/home/frugal php:${{ matrix.php }}-fpm - - run: docker run -d -p 80:80 --link $(docker ps -qn1):php -v "$PWD":/home/frugal -v "$PWD"/examples/nginx/nginx.conf:/etc/nginx/conf.d/default.conf nginx:stable-alpine + - run: docker run -d -v "$PWD":/home/framework-x php:${{ matrix.php }}-fpm + - run: docker run -d -p 80:80 --link $(docker ps -qn1):php -v "$PWD":/home/framework-x -v "$PWD"/examples/nginx/nginx.conf:/etc/nginx/conf.d/default.conf nginx:stable-alpine - run: bash tests/await.sh http://localhost - run: bash tests/acceptance.sh http://localhost @@ -88,7 +88,7 @@ jobs: with: php-version: ${{ matrix.php }} - run: composer install --no-dev - - run: docker run -d -p 80:80 -v "$PWD":/home/frugal php:${{ matrix.php }}-apache sh -c "rmdir /var/www/html;ln -s /home/frugal/examples/apache /var/www/html;ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled; apache2-foreground" + - run: docker run -d -p 80:80 -v "$PWD":/home/framework-x php:${{ matrix.php }}-apache sh -c "rmdir /var/www/html;ln -s /home/framework-x/examples/apache /var/www/html;ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled; apache2-foreground" - run: bash tests/await.sh http://localhost - run: bash tests/acceptance.sh http://localhost diff --git a/README.md b/README.md index 042ae05..a9b58d7 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,8 @@ -# Frugal +# Framework X -[![CI status](https://github.com/clue/frugalphp-incubator/workflows/CI/badge.svg)](https://github.com/clue/frugalphp-incubator/actions) +[![CI status](https://github.com/clue-access/framework-x/workflows/CI/badge.svg)](https://github.com/clue-access/framework-x/actions) -Lightweight microframework for fast, event-driven and async-first web applications, built on top of ReactPHP. - -[…] - -> TODO: Introduction text, start with the why. List some noticeable features. - Take a look at https://ninenines.eu/docs/en/cowboy/2.6/guide/modern_web/ +Framework X – the simple and fast micro framework for building reactive web applications that run anywhere. * [Quickstart](#quickstart) * [Documentation](#documentation) @@ -20,26 +15,21 @@ First manually change your `composer.json` to include these lines: ```json { - …, "repositories": [ { "type": "vcs", - "url": "https://github.com/clue-engineering/frugal" + "url": "https://github.com/clue-access/framework-x" } ] } ``` -> TODO: Change package name and register on Packagist. - -Simply install FrugalPHP: +Simply install Framework X: ```bash -$ composer require clue/frugal:dev-main +$ composer require clue/framework-x:dev-main ``` -> TODO: Tagged release. - Once everything is installed, you can now use this example to get started with a new `app.php` file: @@ -49,7 +39,7 @@ a new `app.php` file: require __DIR__ . '/../vendor/autoload.php'; $loop = React\EventLoop\Factory::create(); -$app = new Frugal\App($loop); +$app = new FrameworkX\App($loop); $app->get('/', function () { return new React\Http\Message\Response( diff --git a/composer.json b/composer.json index b73ee20..83113af 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,8 @@ { - "name": "clue/frugal", - "description": "Lightweight microframework for fast, event-driven and async-first web applications, built on top of ReactPHP.", - "keywords": ["microframework", "web", "event-driven", "async", "ReactPHP"], - "homepage": "https://github.com/clue/frugalphp-incubator", + "name": "clue/framework-x", + "description": "Framework X – the simple and fast micro framework for building reactive web applications that run anywhere.", + "keywords": ["microframework", "micro", "framework", "web", "http", "event-driven", "async", "ReactPHP"], + "homepage": "https://framework-x.clue.engineering/", "license": "MIT", "authors": [ { @@ -21,12 +21,12 @@ }, "autoload": { "psr-4": { - "Frugal\\": "src/" + "FrameworkX\\": "src/" } }, "autoload-dev": { "psr-4": { - "Frugal\\Tests\\": "tests/" + "FrameworkX\\Tests\\": "tests/" } } } diff --git a/docs/api/app.md b/docs/api/app.md index 9a4826d..f9159b9 100644 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -12,7 +12,7 @@ to do its magic, hence you have to create it like this: require __DIR__ . '/vendor/autoload.php'; $loop = React\EventLoop\Factory::create(); -$app = πŸš€πŸš€πŸš€\App($loop); +$app = FrameworkX\App($loop); // Register routes here, see routing… @@ -30,7 +30,7 @@ $loop->run(); > > require __DIR__ . '/vendor/autoload.php'; > -> $app = πŸš€πŸš€πŸš€\App(); +> $app = FrameworkX\App(); > > // Register routes here, see routing… > diff --git a/docs/api/middleware.md b/docs/api/middleware.md index e7a4b53..fc0bc8a 100644 --- a/docs/api/middleware.md +++ b/docs/api/middleware.md @@ -75,7 +75,7 @@ use Acme\Todo\AdminMiddleware; use Acme\Todo\UserController; $loop = React\EventLoop\Factory::create(); -$app = new πŸš€πŸš€πŸš€\App($loop, new AdminMiddleware()); +$app = new FrameworkX\App($loop, new AdminMiddleware()); $app->get('/user', new UserController()); diff --git a/docs/best-practices/controllers.md b/docs/best-practices/controllers.md index 25e8167..3f506dd 100644 --- a/docs/best-practices/controllers.md +++ b/docs/best-practices/controllers.md @@ -14,7 +14,7 @@ To get started, let's take a look at the following simple closure definitions: require __DIR__ . '/vendor/autoload.php'; $loop = React\EventLoop\Factory::create(); -$app = new Frugal\App($loop); +$app = new FrameworkX\App($loop); $app->get('/', function () { return new React\Http\Message\Response( @@ -50,7 +50,7 @@ definition into three even simpler files: require __DIR__ . '/vendor/autoload.php'; $loop = React\EventLoop\Factory::create(); -$app = new Frugal\App($loop); +$app = new FrameworkX\App($loop); $app->get('/', new Acme\Todo\HelloController()); $app->get('/users/{name}', new Acme\Todo\UserController()); diff --git a/docs/getting-started/quickstart.md b/docs/getting-started/quickstart.md index 0b2455f..18da90b 100644 --- a/docs/getting-started/quickstart.md +++ b/docs/getting-started/quickstart.md @@ -23,7 +23,7 @@ You can use this example to get started by creating a new `app.php` file in your require __DIR__ . '/vendor/autoload.php'; $loop = React\EventLoop\Factory::create(); -$app = new Frugal\App($loop); +$app = new FrameworkX\App($loop); $app->get('/', function () { return new React\Http\Message\Response( @@ -57,7 +57,7 @@ Next, we need to install X and its dependencies to actually run this project. > "repositories": [ > { > "type": "vcs", -> "url": "https://github.com/clue-engineering/frugal" +> "url": "https://github.com/clue-access/framework-x" > } > ] > } @@ -79,7 +79,7 @@ Thanks to [Composer](https://getcomposer.org/), this installation only requires In your project directory, simply run the following command: ```bash -$ composer require clue/frugal:dev-main +$ composer require clue/framework-x:-main ``` This isn't NPM, so this should only take a moment or two. diff --git a/examples/index.php b/examples/index.php index ef3013a..072a6e5 100644 --- a/examples/index.php +++ b/examples/index.php @@ -7,7 +7,7 @@ require __DIR__ . '/../vendor/autoload.php'; $loop = Factory::create(); -$app = new Frugal\App($loop); +$app = new FrameworkX\App($loop); $app->get('/', function () { return new React\Http\Message\Response( @@ -101,8 +101,8 @@ //$app->cgi('/adminer.php', __DIR__ . '/adminer.php'); -$app->get('/LICENSE', new Frugal\FilesystemHandler(dirname(__DIR__) . '/LICENSE')); -$app->get('/source/{path:.*}', new Frugal\FilesystemHandler(dirname(__DIR__))); +$app->get('/LICENSE', new FrameworkX\FilesystemHandler(dirname(__DIR__) . '/LICENSE')); +$app->get('/source/{path:.*}', new FrameworkX\FilesystemHandler(dirname(__DIR__))); $app->redirect('/source', '/source/'); $app->any('/method', function (ServerRequestInterface $request) { diff --git a/examples/nginx/nginx.conf b/examples/nginx/nginx.conf index 175e7ee..bb50a8d 100644 --- a/examples/nginx/nginx.conf +++ b/examples/nginx/nginx.conf @@ -1,5 +1,5 @@ server { - root /home/frugal/examples/nginx/public; + root /home/framework-x/examples/nginx/public; index index.php index.html; location / { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 34e3137..a7580a3 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -7,7 +7,7 @@ colors="true" cacheResult="false"> - + ./tests/ diff --git a/phpunit.xml.legacy b/phpunit.xml.legacy index 87a7364..cb0fd89 100644 --- a/phpunit.xml.legacy +++ b/phpunit.xml.legacy @@ -6,7 +6,7 @@ bootstrap="vendor/autoload.php" colors="true"> - + ./tests/ diff --git a/src/App.php b/src/App.php index b39bbd3..3b97847 100644 --- a/src/App.php +++ b/src/App.php @@ -1,6 +1,6 @@ assertInstanceOf(ResponseInterface::class, $response); $this->assertEquals(500, $response->getStatusCode()); $this->assertEquals('text/html', $response->getHeaderLine('Content-Type')); - $this->assertEquals("500 (Internal Server Error): Frugal\Tests\Stub\InvalidHandlerStub (InvalidHandlerStub.php:$line) returned invalid value (null)\n", (string) $response->getBody()); + $this->assertEquals("500 (Internal Server Error): FrameworkX\Tests\Stub\InvalidHandlerStub (InvalidHandlerStub.php:$line) returned invalid value (null)\n", (string) $response->getBody()); } public function testHandleRequestWithDispatcherWithRouteFoundReturnsInternalServerErrorResponseWhenClassMethodHandlerReturnsStringValue() @@ -737,7 +737,7 @@ public function testHandleRequestWithDispatcherWithRouteFoundReturnsInternalServ $this->assertInstanceOf(ResponseInterface::class, $response); $this->assertEquals(500, $response->getStatusCode()); $this->assertEquals('text/html', $response->getHeaderLine('Content-Type')); - $this->assertEquals("500 (Internal Server Error): Frugal\Tests\Stub\InvalidHandlerStub::index() (InvalidHandlerStub.php:$line) returned invalid value (null)\n", (string) $response->getBody()); + $this->assertEquals("500 (Internal Server Error): FrameworkX\Tests\Stub\InvalidHandlerStub::index() (InvalidHandlerStub.php:$line) returned invalid value (null)\n", (string) $response->getBody()); } public function testHandleRequestWithDispatcherWithRouteFoundReturnsInternalServerErrorResponseWhenStaticClassMethodHandlerReturnsStringValue() @@ -762,7 +762,7 @@ public function testHandleRequestWithDispatcherWithRouteFoundReturnsInternalServ $this->assertInstanceOf(ResponseInterface::class, $response); $this->assertEquals(500, $response->getStatusCode()); $this->assertEquals('text/html', $response->getHeaderLine('Content-Type')); - $this->assertEquals("500 (Internal Server Error): Frugal\Tests\Stub\InvalidHandlerStub::static() (InvalidHandlerStub.php:$line) returned invalid value (null)\n", (string) $response->getBody()); + $this->assertEquals("500 (Internal Server Error): FrameworkX\Tests\Stub\InvalidHandlerStub::static() (InvalidHandlerStub.php:$line) returned invalid value (null)\n", (string) $response->getBody()); } public function testHandleRequestWithDispatcherWithRouteFoundReturnsInternalServerErrorResponseWhenGlobalFunctionHandlerReturnsStringValue() diff --git a/tests/FilesystemHandlerTest.php b/tests/FilesystemHandlerTest.php index 6cd207c..e0b816a 100644 --- a/tests/FilesystemHandlerTest.php +++ b/tests/FilesystemHandlerTest.php @@ -1,8 +1,8 @@