HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/marisrental/boldt.tech/readme.md
# KMS 5.8
KMS is the closed source content management system from Komma B.V.
Based on Laravel 5.8.

## General setup
* Make sure you've installed the following pre-requisites on you computer
    * PHP >= 7.1.3
    * OpenSSL PHP Extension
    * PDO PHP Extension
    * Mbstring PHP Extension
    * Tokenizer PHP Extension
    * XML PHP Extension
    * Ctype PHP Extension
    * JSON PHP Extension
    * BCMath PHP Extension
    * MySQL 5.5 or higher
    * [node package manager](https://nodejs.org/en/download/) 
    * [Composer](https://getcomposer.org/download/)
* Make sure you have a MySQL database, and if you are developing locally a second one.    
    * Make sure that the database encoding is set to: ```UTF-8 Unicode (utf8mb4)```
    * Make sure that the database collation is set to: ```Default (utf8mb4_general_ci)```
* Run the following commands in the root of the project:
  * ```composer install``` To install the laravel framework and related packages (see composer.json). After installation composer will automatically generate a .env file if one isn't present, will make artisan generate new app key and make artisan run the migrate script.
  * ```npm install``` To install the development / and some frontend packages
  * ```npm run dev``` To transpile sass, javascripts, copy assets
* Setup a cron job to make sure housekeeping, mail processing, catalog indexing etc is done:
  ```* * * * * php /path-to-your-project/artisan schedule:run >> /dev/null 2>&1```
* Rename env.example and env.testing.example respectively to  .env and .env.testing. And configure them as needed.
* Run the migrations and seeds. Look further in the manual to the Migrations and seeds chapter to discover how.

### Migrations and seeds
There is a kms part and a shop part. Both have their own way of running migrations and seeds. Outlined as below.

#### KMS
Run the following commands setup the database for kms:
```
php artisan migrate
php artisan db:seed
```

To rollback the database setup run:
```
php artisan migrate:rollback
```

#### SHOP
To setup the shop database, you must first run the kms commands, and then the shop commands.
```
php artisan shop:migrate
php artisan shop:seed
```

To rollback the database setup run:
```
php artisan shop:rolback
```

And then you can rollback the kms database setup if you like.


## Development notes
### Environments
the APP_ENV variable in .env must contain a specific value. One of these all in lower case: local, testing, development, production.

#### local
The environment that one should use when developing on its own computer.

#### testing
The environment that test software automatically uses. See for example phpunit.xml and
phpunit.dusk.xml.

#### development
The environment that one must used on komma.pro staging servers.

#### production
The environment that should be used when the system is live and being used for customers.

### Running tests
#### Testing kms
Before testing you must make sure that your webserver is using the test database, defined in env.testing. To do so using the
built in webserver you must run: ```php artisan serve --env=testing```

Use the following command to test kms (unit, browser, benchmarks):
```
php artisan kms:test
```
use ```php artisan help kms:test``` to open the help documentation. The signature of the test command is:
```php artisan shop:tests [<flavor>] --env=testing [--noprep] [--<filterOrGroup>] [<filterOrGroupValue>]```.

If you specify the optional arguments you can choose to run only the browser tests for example. Or a specific test suite.

If you open the test files you'll notice the @group statements in the comments. These enable you to run only the tests that are
marked with the same value of the @group statement like this: ```php artisan kms:test phpunit --group groupname```

Before the tests are ran, the database defined in .env.testing, is truncated and re-seeded to ensure best results in a predicatable environement.
To disable this behaviour you and add the --noprep option. It will then leave the database like it is.

#### Testing shop
Make sure you have set the .env value for IS_SHOP to true. And make sure you've ran all shop migrations and seeds
Use the following command to test the shop (unit, browser, benchmark):
```php artisan shop:test```
The signature of the test command is the same as the kms test command.

#### Preparation
Before tests are run, some preparation is done. This means that that the database is truncated and all migrations are ran before testing really starts.
If you are testing and you don't want the preparation to be executed you can add the ```--noprep``` option to the command.