Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ajout du linting pour une grosse partie des fichiers PHP et ajout de l'accès public des événements #23

Merged
merged 11 commits into from
Nov 3, 2018
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
25 changes: 25 additions & 0 deletions .env.travis
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
APP_NAME="Portail des Assos"
APP_ENV=develop
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
APP_ASSO=simde

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=portail
DB_USERNAME=root
DB_PASSWORD=""

BROADCAST_DRIVER=log
CACHE_DRIVER=redis
SESSION_DRIVER=database
SESSION_LIFETIME=120
QUEUE_DRIVER=redis

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
language: php

services:
- mysql
- redis-server

php:
- 7.1.3

before_script:
- cp .env.travis .env
- mysql -e 'CREATE DATABASE portail;'
- composer self-update
- composer install --no-interaction
- php artisan key:generate
- php artisan migrate:fresh --seed
- npm -g i npm
- npm i
- npm run prod
- php artisan quick:clear

script:
- php artisan quick:test
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Nouvelle API du [Portail des Assos](https://assos.utc.fr), construite avec [Lara
+ Suppression du cache : `php artisan quick:clear`
+ Création de la clé : `php artisan key:generate`
+ Création des tables et des données : `php artisan migrate:fresh --seed`
+ Installation des dépendances JS : `npm install` (très long)
+ Compilation de l'application frontend : `npm run dev` (assez long)
+ Installation des dépendances JS : `npm install --production` (assez long)
+ Compilation de l'application frontend : `npm run prod` (assez long)

- Lancer l'application via :
+ Artisan : `php artisan serve` et aller sur http://localhost:8000
Expand All @@ -34,6 +34,26 @@ Nouvelle API du [Portail des Assos](https://assos.utc.fr), construite avec [Lara
- Ça part !


## Mettre à jour

- Lancer `php artisan quick:update`
- Lancer `npm run prod` ou `npm run watch`
- Tout est bon

## Développement
### Lancer en développement

- Lancer `npm install` (assez long)
- Lancer `npm run watch`
- Enjoy


### Développer

- Respecter le linter imposé pour le PHP mais aussi pour le JS
- Commenter en français
- Lancer `php artisan quick:test` pour vérifier que tout est bon avant de push son code


## Documentation

Expand Down
94 changes: 49 additions & 45 deletions app/Console/Commands/Clear.php
Original file line number Diff line number Diff line change
@@ -1,54 +1,58 @@
<?php
/**
* Fichier générant la commande quick:clear.
* Efface le cache de l'application.
*
* @author Alexandre Brasseur <abrasseur.pro@gmail.com>
* @author Samy Nastuzzi <samy@nastuzzi.fr>
*
* @copyright Copyright (c) 2018, SiMDE-UTC
* @license GNU GPL-3.0
*/

namespace App\Console\Commands;

use Illuminate\Console\Command;

class Clear extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'quick:clear';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Clear all compiled and cached resources';

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}

/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
shell_exec('composer dump-autoload');

$this->call('view:clear');
$this->call('route:clear');
$this->call('config:clear');
$this->call('auth:clear-resets');
$this->call('cache:clear');
$this->call('clear-compiled');
$this->call('clear');

$this->call('config:cache');
$this->call('route:cache');
$this->call('view:cache');
}
/**
* @var string
*/
protected $signature = 'quick:clear';

/**
* @var string
*/
protected $description = 'Clear all compiled and cached resources';

/**
* @return void
*/
public function __construct()
{
parent::__construct();
}

/**
* Exécution de la commande.
*
* @return mixed
*/
public function handle()
{
shell_exec('composer dump-autoload');

$this->call('view:clear');
$this->call('route:clear');
$this->call('config:clear');
$this->call('auth:clear-resets');
$this->call('cache:clear');
$this->call('clear-compiled');
$this->call('clear');

$this->call('config:cache');
$this->call('route:cache');
$this->call('view:cache');
}
}
Loading