diff --git a/.gitignore b/.gitignore index 40c2261e..79e259b1 100644 --- a/.gitignore +++ b/.gitignore @@ -17,10 +17,6 @@ /.web-server-pid ###< symfony/web-server-bundle ### -### Symfony binaries -/bin/console -/bin/phpunit - ### PHPStorm IDE specific files .idea/workspace.xml .idea/usage.statistics.xml diff --git a/bin/console b/bin/console new file mode 100755 index 00000000..52fd3989 --- /dev/null +++ b/bin/console @@ -0,0 +1,38 @@ +#!/usr/bin/env php +getParameterOption(['--env', '-e'], null, true)) { + putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env); +} + +if ($input->hasParameterOption('--no-debug', true)) { + putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0'); +} + +require dirname(__DIR__).'/config/bootstrap.php'; + +if ($_SERVER['APP_DEBUG']) { + umask(0000); + + if (class_exists(Debug::class)) { + Debug::enable(); + } +} + +$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']); +$application = new Application($kernel); +$application->run($input); diff --git a/bin/phpunit b/bin/phpunit new file mode 100755 index 00000000..cd7e32e7 --- /dev/null +++ b/bin/phpunit @@ -0,0 +1,19 @@ +#!/usr/bin/env php +=9.4 (because of use of JSONB), used 10.6 (dev, change in `config/packages/doctrine.yaml` if required) For testes SQLite and php_sqlite are required. @@ -10,16 +13,26 @@ Other requirements are in composer.json and packages.json (for PHP and js) manag ## Install +Install on server uses specific user `ppr` and suppose to clone from local repository in `/var/repo/1`, adapt to your needs +(to install on a developer computer you should only need to stat with `composet intall`). +A PostGre database should be created with a user for the application, after the installation you may need to change the parameters in the `.env` file. ```(bash) -$ git clone +$ cd /var/www/ +$ git clone /var/repo/1 app/ppr +$ chown -R ppr:www-data app-ppr/ +$ su ppr $ composer install $ yarn install $ bin/console doctrine:migration:migrate ``` -### Test configuration +**Current project application specific note** : a `ciblage` user has been created on the server with rights on `rapportage` DB. +`.env.local` file is addited with **prod** env and DB user/password. + + +### Test environement configuration For tests only it is required to create a `var/data` folder where the sqlite database for tests will be intanciated. @@ -28,3 +41,9 @@ For tests only it is required to create a `var/data` folder where the sqlite dat ## Conventions Regarding coding style, if you use PHPStorm it will automatically follow the coding rules in `.idea/codeStyle/codeStyleConfig.xml`. + +## ToDos + +* add instructions to import initial form data + +