Skip to content

Commit

Permalink
Added bin/ in tracked files, README update for install.
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienTouze committed Mar 12, 2019
1 parent 686f344 commit 09fb5f2
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 6 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
38 changes: 38 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env php
<?php

use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;

set_time_limit(0);

require dirname(__DIR__).'/vendor/autoload.php';

if (!class_exists(Application::class)) {
throw new RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
}

$input = new ArgvInput();
if (null !== $env = $input->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);
19 changes: 19 additions & 0 deletions bin/phpunit
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php

if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit')) {
echo "Unable to find the `simple-phpunit` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
exit(1);
}

if (false === getenv('SYMFONY_PHPUNIT_VERSION')) {
putenv('SYMFONY_PHPUNIT_VERSION=6.5');
}
if (false === getenv('SYMFONY_PHPUNIT_REMOVE')) {
putenv('SYMFONY_PHPUNIT_REMOVE=');
}
if (false === getenv('SYMFONY_PHPUNIT_DIR')) {
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
}

require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit';
23 changes: 21 additions & 2 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,36 @@
## Requirements

PHP7.2
php7.2-xml
php7.2-zip
php7.2-pgsql
PostGreSQL >=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.

Other requirements are in composer.json and packages.json (for PHP and js) managed by [composer](https://getcomposer.org/) and [yarn](https://yarnpkg.com/)

## 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.
Expand All @@ -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


0 comments on commit 09fb5f2

Please sign in to comment.