Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 39 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand All @@ -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`)

Expand Down Expand Up @@ -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
Expand All @@ -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`.
Expand Down Expand Up @@ -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.
2 changes: 1 addition & 1 deletion config/autoload/local.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

declare(strict_types=1);

$baseUrl = 'http://localhost:8080';
$baseUrl = 'http://dotkernel.local';

$databases = [
'default' => [
Expand Down