diff --git a/README.md b/README.md index e028b6dd..b4f6e824 100644 --- a/README.md +++ b/README.md @@ -67,9 +67,7 @@ To enable an extension, remove the semicolon (;) in front of it. The advantage of using this command is that it runs through the whole installation process. Run the following command: -```bash -$ composer create-project dotkernel/frontend -s dev dk -``` + composer create-project dotkernel/frontend -s dev dk The above command downloads the `frontend` package, then downloads and installs the `dependencies`. @@ -95,14 +93,11 @@ Type `y` here, and hit `enter` This method requires more manual input, but it ensures that the default branch is installed, even if it is not released. Run the following command: -```bash -$ git clone https://github.com/dotkernel/frontend.git . -``` + git clone https://github.com/dotkernel/frontend.git . -The dependencies have to be installed separately, by running this command -```bash -$ composer install -``` +The dependencies have to be installed separately, by running this command: + + composer install Just like for `II Installing DotKernel frontend using composer` (see above), the setup asks for configuration settings regarding injections (type `0` and hit `enter`) and a confirmation to use this setting for other packages (type `y` and hit `enter`) @@ -190,11 +185,17 @@ Seeding the database is done with the help of our custom package ``dotkernel/dot An example of a fixtures class is ``data/doctrine/fixtures/RoleLoader.php`` -Running ``php bin/doctrine fixtures:list`` will list all the available fixtures, by order of execution. +To list all the available fixtures, by order of execution, run: + + php bin/doctrine fixtures:list + +To execute all fixtures, run: -To execute all fixtures run : ``php bin/doctrine fixtures:execute``. + php bin/doctrine fixtures:execute -To execute a specific fixtures run : ``php bin/doctrine fixtures:execute --class=RoleLoader`` +To execute a specific fixtures, run: + + php bin/doctrine fixtures:execute --class=RoleLoader Fixtures can and should be ordered to ensure database consistency, more on ordering fixtures can be found here : https://www.doctrine-project.org/projects/doctrine-data-fixtures/en/latest/how-to/fixture-ordering.html#fixture-ordering @@ -204,9 +205,9 @@ https://www.doctrine-project.org/projects/doctrine-data-fixtures/en/latest/how-t - If you use `composer create-project`, the project will go into development mode automatically after installing. The development mode status can be checked and toggled by using these composer commands ```bash -$ composer development-status -$ composer development-enable -$ composer development-disable +composer development-status +composer development-enable +composer development-disable ``` - If not already done on installation, remove the `.dist` extension from `config/autoload/development.global.php.dist`. @@ -397,31 +398,32 @@ To apply the translations - then the js file needs `translateText("translateText")` -## Testing (Running) - -Note: **Do not enable dev mode in production** - -- Run the following command in your project's directory to start PHPs built-in server: +## Running the application +We recommend running your applications in WSL: +* make sure you have [WSL](https://github.com/dotkernel/development/blob/main/wsl/README.md) installed on your system +* currently we provide 2 distro implementations: [AlmaLinux9](https://github.com/dotkernel/development/blob/main/wsl/os/almalinux9/README.md) and [Ubuntu20](https://github.com/dotkernel/development/blob/main/wsl/os/ubuntu20/README.md) +* install the application in a virtualhost as recommended by the chosen distro +* set `$baseUrl` in **config/autoload/local.php** to the address of the virtualhost +* run the application by opening the virtualhost address in your browser -```bash -$ php -S 0.0.0.0:8080 -t public -``` - -> Running command `composer serve` will do the exact same, but the above is faster. +You should see the `DotKernel Frontend` welcome page. -`0.0.0.0` means that the server is open to all incoming connections -`127.0.0.1` means that the server can only be accessed locally (localhost only) -`8080` the port on which the server is started (the listening port for the server) **NOTE:** -If you are still getting exceptions or errors regarding some missing services, try running the following command +- If you are getting exceptions or errors regarding some missing services, try running the following command: -```php -php bin/clear-config-cache.php -``` + php bin/clear-config-cache.php > If `config-cache.php` is present that config will be loaded regardless of the `ConfigAggregator::ENABLE_CACHE` in `config/autoload/mezzio.global.php` - -- Open a web browser and visit `http://localhost:8080/` - -You should see the `DotKernel Frontend` welcome page. +- **Development only**: `session.cookie_secure` does not work locally so make sure you modify your `local.php`, as per the following: +```php +# other code + +return [ + # other configurations... + 'session_config' => [ + 'cookie_secure' => false, + ], +]; +``` +Do not change this in `local.php.dist` as well because this value should remain `true` on production. diff --git a/config/autoload/local.php.dist b/config/autoload/local.php.dist index c729b80d..01cbb0a9 100644 --- a/config/autoload/local.php.dist +++ b/config/autoload/local.php.dist @@ -9,7 +9,7 @@ declare(strict_types=1); -$baseUrl = 'http://localhost:8080'; +$baseUrl = 'http://dotkernel.local'; $databases = [ 'default' => [