1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
_ide_helper.php
|
||||
.php_cs.cache
|
||||
.phpstorm.meta.php
|
||||
/vendor
|
||||
node_modules/
|
||||
|
||||
37
.php_cs
Normal file
37
.php_cs
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
$finder = PhpCsFixer\Finder::create()
|
||||
->in('app')
|
||||
->in('config');
|
||||
|
||||
return PhpCsFixer\Config::create()
|
||||
->setHideProgress(true)
|
||||
->setUsingCache(false)
|
||||
->setRiskyAllowed(true)
|
||||
->setRules([
|
||||
'@PSR2' => true,
|
||||
'strict_param' => true,
|
||||
'no_php4_constructor' => true,
|
||||
'no_extra_blank_lines' => true,
|
||||
'no_superfluous_elseif' => true,
|
||||
'single_line_comment_style' => false,
|
||||
'simple_to_complex_string_variable' => true,
|
||||
'array_syntax' => [
|
||||
'syntax' => 'short',
|
||||
],
|
||||
'binary_operator_spaces' => [
|
||||
'align_double_arrow' => true,
|
||||
],
|
||||
/*
|
||||
'blank_line_before_statement' => [
|
||||
'statements' => [
|
||||
'declare',
|
||||
'for',
|
||||
'return',
|
||||
'throw',
|
||||
'try',
|
||||
],
|
||||
],
|
||||
*/
|
||||
])
|
||||
->setFinder($finder);
|
||||
@@ -31,6 +31,7 @@ install:
|
||||
- composer install --dev --no-interaction --verbose
|
||||
|
||||
script:
|
||||
- vendor/bin/php-cs-fixer fix --config=.php_cs -v --dry-run --diff --using-cache=no
|
||||
- php artisan database:create --reset
|
||||
- php artisan migrate:refresh --seed
|
||||
- cp .travis/phpunit.travis.xml phpunit.xml
|
||||
|
||||
@@ -61,12 +61,15 @@ if [ "$TRAVIS" = "true" ]; then
|
||||
.dpl
|
||||
.eslintignore
|
||||
.eslintrc
|
||||
.php_cs
|
||||
.php_cs.cache
|
||||
.phpstorm.meta.php
|
||||
.styleci.yml
|
||||
env.php
|
||||
config.php
|
||||
docker-compose.yml
|
||||
Makefile
|
||||
phpcs.xml
|
||||
phpunit.xml
|
||||
phpvms.iml
|
||||
Procfile
|
||||
|
||||
@@ -22,6 +22,14 @@
|
||||
<listener class="NunoMaduro\Collision\Adapters\Phpunit\Listener"/>
|
||||
</listeners>
|
||||
<php>
|
||||
<env name="APP_ENV" value="test"/>
|
||||
<env name="APP_KEY" value="base64:ve66Z5Kt/zTN3p++0zOPu854PHfZkwJE5VuoFAlzHtI="/>
|
||||
<env name="APP_DEBUG" value="true"/>
|
||||
<env name="APP_LOG_LEVEL" value="debug"/>
|
||||
<env name="DB_CONNECTION" value="memory"/>
|
||||
<env name="CACHE_DRIVER" value="array"/>
|
||||
<env name="SESSION_DRIVER" value="array"/>
|
||||
<env name="QUEUE_DRIVER" value="sync"/>
|
||||
<ini name="error_reporting" value="E_ALL"/>
|
||||
<ini name="display_errors" value="On"/>
|
||||
<ini name="display_startup_errors" value="On"/>
|
||||
|
||||
4
Makefile
4
Makefile
@@ -68,6 +68,10 @@ test:
|
||||
#php artisan database:create --reset
|
||||
vendor/bin/phpunit --debug --verbose
|
||||
|
||||
.PHONY: phpcs
|
||||
phpcs:
|
||||
@vendor/bin/php-cs-fixer fix --config=.php_cs -v --diff --dry-run
|
||||
|
||||
.PHONY:
|
||||
phpstan:
|
||||
vendor/bin/phpstan analyse -c phpstan.neon -v --level 2 app
|
||||
|
||||
@@ -40,6 +40,7 @@ A full development environment can be brought up using Docker:
|
||||
```bash
|
||||
composer install
|
||||
npm install
|
||||
docker-compose build
|
||||
docker-compose up
|
||||
```
|
||||
|
||||
|
||||
@@ -36,11 +36,11 @@ class ImportCsv extends Command
|
||||
$type = $this->argument('type');
|
||||
$file = $this->argument('file');
|
||||
|
||||
if (\in_array($type, ['flight', 'flights'])) {
|
||||
if (\in_array($type, ['flight', 'flights'], true)) {
|
||||
$status = $this->importer->importFlights($file);
|
||||
} elseif ($type === 'aircraft') {
|
||||
$status = $this->importer->importAircraft($file);
|
||||
} elseif (\in_array($type, ['airport', 'airports'])) {
|
||||
} elseif (\in_array($type, ['airport', 'airports'], true)) {
|
||||
$status = $this->importer->importAirports($file);
|
||||
} elseif ($type === 'subfleet') {
|
||||
$status = $this->importer->importSubfleets($file);
|
||||
|
||||
@@ -419,7 +419,8 @@ class Importer
|
||||
['icao' => $row->icao,
|
||||
'subfleet_id' => $subfleet->id,
|
||||
'active' => $row->enabled,
|
||||
]);
|
||||
]
|
||||
);
|
||||
|
||||
$this->addMapping('aircraft', $row->id, $aircraft->id);
|
||||
|
||||
@@ -682,14 +683,22 @@ class Importer
|
||||
// Decide which state they will be in accordance with v7
|
||||
if ($state === $phpvms_classic_states['ACTIVE']) {
|
||||
return UserState::ACTIVE;
|
||||
} elseif ($state === $phpvms_classic_states['INACTIVE']) {
|
||||
}
|
||||
|
||||
if ($state === $phpvms_classic_states['INACTIVE']) {
|
||||
// TODO: Make an inactive state?
|
||||
return UserState::REJECTED;
|
||||
} elseif ($state === $phpvms_classic_states['BANNED']) {
|
||||
}
|
||||
|
||||
if ($state === $phpvms_classic_states['BANNED']) {
|
||||
return UserState::SUSPENDED;
|
||||
} elseif ($state === $phpvms_classic_states['ON_LEAVE']) {
|
||||
}
|
||||
|
||||
if ($state === $phpvms_classic_states['ON_LEAVE']) {
|
||||
return UserState::ON_LEAVE;
|
||||
}
|
||||
|
||||
$this->error('Unknown status: '.$state);
|
||||
return UserState::ACTIVE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,9 @@ class BidExists extends HttpException
|
||||
parent::__construct(
|
||||
409,
|
||||
'A bid already exists for this flight',
|
||||
$previous, $headers, $code
|
||||
$previous,
|
||||
$headers,
|
||||
$code
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Log;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
/**
|
||||
@@ -134,7 +135,7 @@ class Handler extends ExceptionHandler
|
||||
*
|
||||
* @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
protected function renderHttpException(HttpException $e)
|
||||
protected function renderHttpException(HttpExceptionInterface $e)
|
||||
{
|
||||
$status = $e->getStatusCode();
|
||||
view()->replaceNamespace('errors', [
|
||||
|
||||
@@ -28,7 +28,8 @@ class InternalError extends ValidationException
|
||||
$validator = Validator::make([], []);
|
||||
$validator->errors()->add(
|
||||
$field ?? static::FIELD,
|
||||
$message ?? static::MESSAGE);
|
||||
$message ?? static::MESSAGE
|
||||
);
|
||||
|
||||
parent::__construct($validator);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,9 @@ class PirepCancelled extends HttpException
|
||||
parent::__construct(
|
||||
400,
|
||||
'PIREP has been cancelled, updates are not allowed',
|
||||
$previous, $headers, $code
|
||||
$previous,
|
||||
$headers,
|
||||
$code
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,7 +232,9 @@ class AircraftController extends Controller
|
||||
if ($request->isMethod('post')) {
|
||||
ImportRequest::validate($request);
|
||||
$path = Storage::putFileAs(
|
||||
'import', $request->file('csv_file'), 'import_aircraft.csv'
|
||||
'import',
|
||||
$request->file('csv_file'),
|
||||
'import_aircraft.csv'
|
||||
);
|
||||
|
||||
$path = storage_path('app/'.$path);
|
||||
|
||||
@@ -229,7 +229,9 @@ class AirportController extends Controller
|
||||
if ($request->isMethod('post')) {
|
||||
ImportRequest::validate($request);
|
||||
$path = Storage::putFileAs(
|
||||
'import', $request->file('csv_file'), 'import_airports.csv'
|
||||
'import',
|
||||
$request->file('csv_file'),
|
||||
'import_airports.csv'
|
||||
);
|
||||
|
||||
$path = storage_path('app/'.$path);
|
||||
|
||||
@@ -229,7 +229,9 @@ class ExpenseController extends Controller
|
||||
if ($request->isMethod('post')) {
|
||||
ImportRequest::validate($request);
|
||||
$path = Storage::putFileAs(
|
||||
'import', $request->file('csv_file'), 'import_expenses.csv'
|
||||
'import',
|
||||
$request->file('csv_file'),
|
||||
'import_expenses.csv'
|
||||
);
|
||||
|
||||
$path = storage_path('app/'.$path);
|
||||
|
||||
@@ -204,7 +204,9 @@ class FareController extends Controller
|
||||
if ($request->isMethod('post')) {
|
||||
ImportRequest::validate($request);
|
||||
$path = Storage::putFileAs(
|
||||
'import', $request->file('csv_file'), 'import_fares.csv'
|
||||
'import',
|
||||
$request->file('csv_file'),
|
||||
'import_fares.csv'
|
||||
);
|
||||
|
||||
$path = storage_path('app/'.$path);
|
||||
|
||||
@@ -285,7 +285,8 @@ class FlightController extends Controller
|
||||
|
||||
$input['flight_time'] = Time::init(
|
||||
$input['minutes'],
|
||||
$input['hours'])->getMinutes();
|
||||
$input['hours']
|
||||
)->getMinutes();
|
||||
|
||||
$input['active'] = get_truth_state($input['active']);
|
||||
|
||||
@@ -355,7 +356,9 @@ class FlightController extends Controller
|
||||
|
||||
if ($request->isMethod('post')) {
|
||||
$path = Storage::putFileAs(
|
||||
'import', $request->file('csv_file'), 'import_flights.csv'
|
||||
'import',
|
||||
$request->file('csv_file'),
|
||||
'import_flights.csv'
|
||||
);
|
||||
|
||||
$path = storage_path('app/'.$path);
|
||||
|
||||
@@ -365,7 +365,8 @@ class PirepController extends Controller
|
||||
// Fix the time
|
||||
$attrs['flight_time'] = Time::init(
|
||||
$attrs['minutes'],
|
||||
$attrs['hours'])->getMinutes();
|
||||
$attrs['hours']
|
||||
)->getMinutes();
|
||||
|
||||
$pirep = $this->pirepRepo->update($attrs, $id);
|
||||
|
||||
|
||||
@@ -304,7 +304,9 @@ class SubfleetController extends Controller
|
||||
ImportRequest::validate($request);
|
||||
|
||||
$path = Storage::putFileAs(
|
||||
'import', $request->file('csv_file'), 'import_subfleets.csv'
|
||||
'import',
|
||||
$request->file('csv_file'),
|
||||
'import_subfleets.csv'
|
||||
);
|
||||
|
||||
$path = storage_path('app/'.$path);
|
||||
|
||||
@@ -59,9 +59,13 @@ class LoginController extends Controller
|
||||
// Redirect to one of the error pages
|
||||
if ($user->state === UserState::PENDING) {
|
||||
return view('auth.pending');
|
||||
} elseif ($user->state === UserState::REJECTED) {
|
||||
}
|
||||
|
||||
if ($user->state === UserState::REJECTED) {
|
||||
return view('auth.rejected');
|
||||
} elseif ($user->state === UserState::SUSPENDED) {
|
||||
}
|
||||
|
||||
if ($user->state === UserState::SUSPENDED) {
|
||||
return view('auth.suspended');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,8 @@ class ResetPasswordController extends Controller
|
||||
*/
|
||||
public function showResetForm(Request $request, $token = null)
|
||||
{
|
||||
return view('auth.passwords.reset',
|
||||
return view(
|
||||
'auth.passwords.reset',
|
||||
['token' => $token, 'email' => $request->email]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -406,7 +406,8 @@ class PirepController extends Controller
|
||||
// Fix the time
|
||||
$attrs['flight_time'] = Time::init(
|
||||
$attrs['minutes'],
|
||||
$attrs['hours'])->getMinutes();
|
||||
$attrs['hours']
|
||||
)->getMinutes();
|
||||
|
||||
$pirep = $this->pirepRepo->update($attrs, $id);
|
||||
|
||||
|
||||
@@ -108,8 +108,10 @@ class NotificationEvents extends Listener
|
||||
|
||||
if ($event->old_state === UserState::PENDING) {
|
||||
if ($event->user->state === UserState::ACTIVE) {
|
||||
$email = new \App\Mail\UserRegistered($event->user,
|
||||
'Your registration has been accepted!');
|
||||
$email = new \App\Mail\UserRegistered(
|
||||
$event->user,
|
||||
'Your registration has been accepted!'
|
||||
);
|
||||
} elseif ($event->user->state === UserState::REJECTED) {
|
||||
$email = new \App\Mail\UserRejected($event->user);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,8 @@ class Acars extends Model
|
||||
{
|
||||
if ($value instanceof Distance) {
|
||||
$this->attributes['distance'] = $value->toUnit(
|
||||
config('phpvms.internal_units.distance'));
|
||||
config('phpvms.internal_units.distance')
|
||||
);
|
||||
} else {
|
||||
$this->attributes['distance'] = $value;
|
||||
}
|
||||
|
||||
@@ -76,15 +76,19 @@ Route::group([
|
||||
Route::resource('subfleets', 'SubfleetController');
|
||||
|
||||
Route::resource('users', 'UserController');
|
||||
Route::get('users/{id}/regen_apikey',
|
||||
'UserController@regen_apikey')->name('users.regen_apikey');
|
||||
Route::get(
|
||||
'users/{id}/regen_apikey',
|
||||
'UserController@regen_apikey'
|
||||
)->name('users.regen_apikey');
|
||||
|
||||
// defaults
|
||||
Route::get('', ['uses' => 'DashboardController@index']);
|
||||
Route::get('/', ['uses' => 'DashboardController@index']);
|
||||
|
||||
Route::get('dashboard', ['uses' => 'DashboardController@index', 'name' => 'dashboard']);
|
||||
Route::match(['get', 'post', 'delete'],
|
||||
'dashboard/news', ['uses' => 'DashboardController@news'])
|
||||
->name('dashboard.news');
|
||||
Route::match(
|
||||
['get', 'post', 'delete'],
|
||||
'dashboard/news',
|
||||
['uses' => 'DashboardController@news']
|
||||
)->name('dashboard.news');
|
||||
});
|
||||
|
||||
@@ -30,6 +30,7 @@ class ExportService extends Service
|
||||
{
|
||||
$writer = Writer::createFromPath($path, 'w+');
|
||||
CharsetConverter::addTo($writer, 'utf-8', 'iso-8859-15');
|
||||
|
||||
return $writer;
|
||||
}
|
||||
|
||||
@@ -77,8 +78,7 @@ class ExportService extends Service
|
||||
*/
|
||||
public function exportAircraft($aircraft)
|
||||
{
|
||||
$exporter = new AircraftExporter();
|
||||
return $this->runExport($aircraft, $exporter);
|
||||
return $this->runExport($aircraft, new AircraftExporter());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -92,8 +92,7 @@ class ExportService extends Service
|
||||
*/
|
||||
public function exportAirports($airports)
|
||||
{
|
||||
$exporter = new AirportExporter();
|
||||
return $this->runExport($airports, $exporter);
|
||||
return $this->runExport($airports, new AirportExporter());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,8 +106,7 @@ class ExportService extends Service
|
||||
*/
|
||||
public function exportExpenses($expenses)
|
||||
{
|
||||
$exporter = new ExpenseExporter();
|
||||
return $this->runExport($expenses, $exporter);
|
||||
return $this->runExport($expenses, new ExpenseExporter());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -122,8 +120,7 @@ class ExportService extends Service
|
||||
*/
|
||||
public function exportFares($fares)
|
||||
{
|
||||
$exporter = new FareExporter();
|
||||
return $this->runExport($fares, $exporter);
|
||||
return $this->runExport($fares, new FareExporter());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -137,8 +134,7 @@ class ExportService extends Service
|
||||
*/
|
||||
public function exportFlights($flights)
|
||||
{
|
||||
$exporter = new FlightExporter();
|
||||
return $this->runExport($flights, $exporter);
|
||||
return $this->runExport($flights, new FlightExporter());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -152,7 +148,6 @@ class ExportService extends Service
|
||||
*/
|
||||
public function exportSubfleets($subfleets)
|
||||
{
|
||||
$exporter = new SubfleetExporter();
|
||||
return $this->runExport($subfleets, $exporter);
|
||||
return $this->runExport($subfleets, new SubfleetExporter());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +113,9 @@ class GeoService extends Service
|
||||
|
||||
if ($size === 0) {
|
||||
continue;
|
||||
} elseif ($size === 1) {
|
||||
}
|
||||
|
||||
if ($size === 1) {
|
||||
$point = $points[0];
|
||||
Log::debug('name: '.$point->id.' - '.$point->lat.'x'.$point->lon);
|
||||
$coords[] = $point;
|
||||
@@ -306,7 +308,8 @@ class GeoService extends Service
|
||||
$flight->dpt_airport->icao,
|
||||
$flight->arr_airport->icao,
|
||||
[$flight->dpt_airport->lat, $flight->dpt_airport->lon],
|
||||
$flight->route);
|
||||
$flight->route
|
||||
);
|
||||
|
||||
// lat, lon needs to be reversed for GeoJSON
|
||||
foreach ($all_route_points as $point) {
|
||||
|
||||
@@ -276,23 +276,28 @@ class PirepService extends Service
|
||||
if ($pirep->state === PirepState::PENDING) {
|
||||
if ($new_state === PirepState::ACCEPTED) {
|
||||
return $this->accept($pirep);
|
||||
} elseif ($new_state === PirepState::REJECTED) {
|
||||
}
|
||||
|
||||
if ($new_state === PirepState::REJECTED) {
|
||||
return $this->reject($pirep);
|
||||
}
|
||||
|
||||
return $pirep;
|
||||
} /*
|
||||
}
|
||||
|
||||
/*
|
||||
* Move from a ACCEPTED to REJECTED status
|
||||
*/
|
||||
elseif ($pirep->state === PirepState::ACCEPTED) {
|
||||
if ($pirep->state === PirepState::ACCEPTED) {
|
||||
$pirep = $this->reject($pirep);
|
||||
|
||||
return $pirep;
|
||||
} /*
|
||||
}
|
||||
|
||||
/*
|
||||
* Move from REJECTED to ACCEPTED
|
||||
*/
|
||||
elseif ($pirep->state === PirepState::REJECTED) {
|
||||
if ($pirep->state === PirepState::REJECTED) {
|
||||
$pirep = $this->accept($pirep);
|
||||
|
||||
return $pirep;
|
||||
}
|
||||
|
||||
|
||||
@@ -625,7 +625,6 @@ class Metar implements \ArrayAccess
|
||||
$minute = (int) $found[3];
|
||||
|
||||
if ($this->result['observed_date'] === null) {
|
||||
|
||||
// Take one month, if the observed day is greater than the current day
|
||||
if ($day > date('j')) {
|
||||
$month = date('n') - 1;
|
||||
|
||||
@@ -7,58 +7,62 @@
|
||||
"minimum-stability": "stable",
|
||||
"homepage": "http://www.phpvms.net",
|
||||
"require": {
|
||||
"php": ">=7.1",
|
||||
"php": ">=7.2",
|
||||
"ext-calendar": "*",
|
||||
"ext-json": "*",
|
||||
"ext-mbstring": "*",
|
||||
"ext-pdo": "*",
|
||||
"composer/composer": "1.8.x",
|
||||
"composer/semver": "1.4.x",
|
||||
"akaunting/money": "1.0.x",
|
||||
"anhskohbo/no-captcha": "3.0.x",
|
||||
"arrilot/laravel-widgets": "3.13.x",
|
||||
"composer/composer": "1.8.*",
|
||||
"composer/semver": "1.4.*",
|
||||
"akaunting/money": "1.0.*",
|
||||
"anhskohbo/no-captcha": "3.0.*",
|
||||
"appstract/laravel-opcache": "^2.0",
|
||||
"arrilot/laravel-widgets": "3.13.*",
|
||||
"fzaninotto/faker": "^1.8",
|
||||
"guzzlehttp/guzzle": "6.3.x",
|
||||
"hashids/hashids": "2.0.x",
|
||||
"igaster/laravel-theme": "2.0.x",
|
||||
"intervention/image": "2.4.x",
|
||||
"irazasyed/laravel-gamp": "1.3.x",
|
||||
"jackiedo/timezonelist": "5.x",
|
||||
"jmikola/geojson": "1.0.x",
|
||||
"joshbrw/laravel-module-installer": "0.1.x",
|
||||
"laracasts/flash": "3.0.x",
|
||||
"laravel/framework": "5.7.x",
|
||||
"laravelcollective/html": "5.7.x",
|
||||
"league/csv": "9.2.x",
|
||||
"league/geotools": "0.8.x",
|
||||
"league/iso3166": "2.1.x",
|
||||
"guzzlehttp/guzzle": "6.3.*",
|
||||
"hashids/hashids": "2.0.*",
|
||||
"igaster/laravel-theme": "2.0.*",
|
||||
"intervention/image": "2.4.*",
|
||||
"irazasyed/laravel-gamp": "1.3.*",
|
||||
"jackiedo/timezonelist": "5.*",
|
||||
"jmikola/geojson": "1.0.*",
|
||||
"joshbrw/laravel-module-installer": "0.1.*",
|
||||
"laracasts/flash": "3.0.*",
|
||||
"laravel/framework": "5.8.*",
|
||||
"laravel/helpers": "^1.0",
|
||||
"laravelcollective/html": "^5.8",
|
||||
"league/csv": "9.2.*",
|
||||
"league/geotools": "0.8.*",
|
||||
"league/iso3166": "2.1.*",
|
||||
"markrogoyski/math-php": "^0.38.0",
|
||||
"myclabs/deep-copy": "1.8.x",
|
||||
"nabeel/vacentral": "1.x",
|
||||
"nwidart/laravel-modules": "3.3.x",
|
||||
"php-units-of-measure/php-units-of-measure": "2.1.x",
|
||||
"pragmarx/version": "0.2.x",
|
||||
"prettus/l5-repository": "2.6.x",
|
||||
"santigarcor/laratrust": "5.0.x",
|
||||
"sebastiaanluca/laravel-helpers": "1.0.x",
|
||||
"spatie/laravel-pjax": "1.3.x",
|
||||
"myclabs/deep-copy": "1.8.*",
|
||||
"nabeel/vacentral": "1.*",
|
||||
"nwidart/laravel-modules": "5.*",
|
||||
"php-units-of-measure/php-units-of-measure": "2.1.*",
|
||||
"pragmarx/version": "0.2.*",
|
||||
"predis/predis": "^1.1",
|
||||
"prettus/l5-repository": "2.6.*",
|
||||
"santigarcor/laratrust": "5.2.*",
|
||||
"sebastiaanluca/laravel-helpers": "3.*",
|
||||
"spatie/laravel-pjax": "1.3.*",
|
||||
"symfony/polyfill-iconv": "^1.11",
|
||||
"theiconic/php-ga-measurement-protocol": "2.7.x",
|
||||
"tivie/php-os-detector": "1.1.x",
|
||||
"toin0u/geotools-laravel": "1.0.x",
|
||||
"vierbergenlars/php-semver": "3.0.x",
|
||||
"waavi/sanitizer": "1.0.x",
|
||||
"webpatser/laravel-uuid": "3.x"
|
||||
"theiconic/php-ga-measurement-protocol": "2.7.*",
|
||||
"tivie/php-os-detector": "1.1.*",
|
||||
"toin0u/geotools-laravel": "1.0.*",
|
||||
"vierbergenlars/php-semver": "3.0.*",
|
||||
"waavi/sanitizer": "1.0.*",
|
||||
"webpatser/laravel-uuid": "3.*"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "7.5.x",
|
||||
"barryvdh/laravel-ide-helper": "^2.0",
|
||||
"barryvdh/laravel-debugbar": "^3.0",
|
||||
"mockery/mockery": "0.9.*",
|
||||
"filp/whoops": "~2.0",
|
||||
"barryvdh/laravel-ide-helper": "^2.0",
|
||||
"bpocallaghan/generators": "5.0.1",
|
||||
"codedungeon/phpunit-result-printer": "^0.13.0",
|
||||
"filp/whoops": "~2.0",
|
||||
"mockery/mockery": "0.9.*",
|
||||
"nunomaduro/collision": "^2.0",
|
||||
"codedungeon/phpunit-result-printer": "^0.13.0"
|
||||
"phpunit/phpunit": "7.5.*",
|
||||
"squizlabs/php_codesniffer": "3.*"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
|
||||
1655
composer.lock
generated
1655
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -67,7 +67,6 @@ return [
|
||||
Collective\Html\HtmlServiceProvider::class,
|
||||
Laracasts\Flash\FlashServiceProvider::class,
|
||||
Prettus\Repository\Providers\RepositoryServiceProvider::class,
|
||||
SebastiaanLuca\Helpers\Methods\GlobalHelpersServiceProvider::class,
|
||||
SebastiaanLuca\Helpers\Collections\CollectionMacrosServiceProvider::class,
|
||||
Toin0u\Geotools\GeotoolsServiceProvider::class,
|
||||
Jackiedo\Timezonelist\TimezonelistServiceProvider::class,
|
||||
|
||||
@@ -24,8 +24,6 @@ return [
|
||||
],
|
||||
|
||||
'stores' => [
|
||||
|
||||
'apc' => ['driver' => 'apc'],
|
||||
'array' => ['driver' => 'array'],
|
||||
'database' => [
|
||||
'driver' => 'database',
|
||||
@@ -61,6 +59,5 @@ return [
|
||||
'driver' => 'redis',
|
||||
'connection' => 'default',
|
||||
],
|
||||
|
||||
],
|
||||
];
|
||||
|
||||
@@ -27,7 +27,27 @@ return [
|
||||
| Defines if Laratrust will use Laravel's Cache to cache the roles and permissions.
|
||||
|
|
||||
*/
|
||||
'use_cache' => true,
|
||||
'cache' => [
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Use cache in the package
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Defines if Laratrust will use Laravel's Cache to cache the roles and permissions.
|
||||
| NOTE: Currently the database check does not use cache.
|
||||
|
|
||||
*/
|
||||
'enabled' => true,
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Time to store in cache Laratrust's roles and permissions.
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Determines the time in SECONDS to store Laratrust's roles and permissions in the cache.
|
||||
|
|
||||
*/
|
||||
'expiration_time' => 3600,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
18
config/opcache.php
Normal file
18
config/opcache.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'url' => env('OPCACHE_URL', config('app.url')),
|
||||
'verify_ssl' => true,
|
||||
'headers' => [],
|
||||
'directories' => [
|
||||
base_path('app'),
|
||||
base_path('bootstrap'),
|
||||
base_path('public'),
|
||||
base_path('resources/lang'),
|
||||
base_path('routes'),
|
||||
base_path('storage/framework/views'),
|
||||
base_path('vendor/appstract'),
|
||||
base_path('vendor/composer'),
|
||||
base_path('vendor/laravel/framework'),
|
||||
],
|
||||
];
|
||||
@@ -10,15 +10,15 @@ return [
|
||||
|--------------------------------------------------------------------------
|
||||
| Define available themes. Format:
|
||||
|
|
||||
| 'theme-name' => [
|
||||
| 'extends' => 'theme-to-extend', // optional
|
||||
| 'views-path' => 'path-to-views', // defaults to: resources/views/theme-name
|
||||
| 'asset-path' => 'path-to-assets', // defaults to: public/theme-name
|
||||
| 'theme-name' => [
|
||||
| 'extends' => 'theme-to-extend', // optional
|
||||
| 'views-path' => 'path-to-views', // defaults to: resources/views/theme-name
|
||||
| 'asset-path' => 'path-to-assets', // defaults to: public/theme-name
|
||||
|
|
||||
| // You can add your own custom keys
|
||||
| // Use Theme::getSetting('key') & Theme::setSetting('key', 'value') to access them
|
||||
| 'key' => 'value',
|
||||
| ],
|
||||
| // You can add your own custom keys
|
||||
| // Use Theme::getSetting('key') & Theme::setSetting('key', 'value') to access them
|
||||
| 'key' => 'value',
|
||||
| ],
|
||||
|
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -29,37 +29,37 @@ return [
|
||||
'extends' => 'false',
|
||||
],
|
||||
|
||||
// Add your themes here. These settings will override theme.json settings defined for each theme
|
||||
// Add your themes here. These settings will override theme.json settings defined for each theme
|
||||
|
||||
/*
|
||||
|---------------------------[ Example Structure ]--------------------------
|
||||
|
|
||||
| // Full theme Syntax:
|
||||
| // Full theme Syntax:
|
||||
|
|
||||
| 'example1' => [
|
||||
| 'extends' => null, // doesn't extend any theme
|
||||
| 'views-path' => example, // = resources/views/example_theme
|
||||
| 'asset-path' => example, // = public/example_theme
|
||||
| ],
|
||||
| 'example1' => [
|
||||
| 'extends' => null, // doesn't extend any theme
|
||||
| 'views-path' => example, // = resources/views/example_theme
|
||||
| 'asset-path' => example, // = public/example_theme
|
||||
| ],
|
||||
|
|
||||
| // Use all Defaults:
|
||||
| // Use all Defaults:
|
||||
|
|
||||
| 'example2', // Assets =\public\example2, Views =\resources\views\example2
|
||||
| // Note that if you use all default values, you can omit declaration completely.
|
||||
| // i.e. defaults will be used when you call Theme::set('undefined-theme')
|
||||
| 'example2', // Assets =\public\example2, Views =\resources\views\example2
|
||||
| // Note that if you use all default values, you can omit declaration completely.
|
||||
| // i.e. defaults will be used when you call Theme::set('undefined-theme')
|
||||
|
|
||||
|
|
||||
| // This theme shares the views with example2 but defines its own assets in \public\example3
|
||||
| // This theme shares the views with example2 but defines its own assets in \public\example3
|
||||
|
|
||||
| 'example3' => [
|
||||
| 'views-path' => 'example',
|
||||
| ],
|
||||
| 'example3' => [
|
||||
| 'views-path' => 'example',
|
||||
| ],
|
||||
|
|
||||
| // This theme extends example1 and may override SOME views\assets in its own paths
|
||||
| // This theme extends example1 and may override SOME views\assets in its own paths
|
||||
|
|
||||
| 'example4' => [
|
||||
| 'extends' => 'example1',
|
||||
| ],
|
||||
| 'example4' => [
|
||||
| 'extends' => 'example1',
|
||||
| ],
|
||||
|
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -7,22 +7,23 @@ services:
|
||||
context: ./docker/php
|
||||
environment:
|
||||
DB_HOST: mysql
|
||||
REDIS_HOST: redis
|
||||
volumes:
|
||||
- ./:/var/www
|
||||
- ./docker/php/www.conf:/usr/local/etc/php-fpm.d/www.conf
|
||||
depends_on:
|
||||
- nginx
|
||||
- mysql
|
||||
- redis
|
||||
|
||||
nginx:
|
||||
image: nginx:1.13.8
|
||||
command: /bin/bash -c "exec nginx -g 'daemon off;'"
|
||||
image: nginx:1.15.12-alpine
|
||||
command: /bin/sh -c "exec nginx -g 'daemon off;'"
|
||||
volumes:
|
||||
- ./:/var/www
|
||||
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
|
||||
ports:
|
||||
- 80:80
|
||||
depends_on:
|
||||
- app
|
||||
|
||||
mysql:
|
||||
image: mysql:5.7.26
|
||||
@@ -37,6 +38,9 @@ services:
|
||||
ports:
|
||||
- 3306:3306
|
||||
|
||||
redis:
|
||||
image: redis:5.0.4-alpine
|
||||
|
||||
# Use this to tail the logs so it's just all in a single window
|
||||
logs:
|
||||
image: busybox
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
FROM php:7.3-fpm
|
||||
FROM php:7.3-fpm-alpine
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y libgmp-dev
|
||||
#RUN apt-get update
|
||||
#RUN apt-get install -y libgmp-dev
|
||||
RUN apk add gmp-dev
|
||||
|
||||
# Copy any config files in
|
||||
COPY ext-opcache.ini $PHP_INI_DIR/conf.d/
|
||||
|
||||
RUN ln -sf /dev/stderr /var/log/fpm-error.log
|
||||
|
||||
RUN docker-php-ext-install \
|
||||
mysqli \
|
||||
pdo \
|
||||
pdo_mysql \
|
||||
gmp
|
||||
gmp \
|
||||
opcache
|
||||
|
||||
8
docker/php/ext-opcache.ini
Normal file
8
docker/php/ext-opcache.ini
Normal file
@@ -0,0 +1,8 @@
|
||||
[opcache]
|
||||
opcache.enable = 1
|
||||
opcache.memory_consumption = 128
|
||||
opcache.interned_strings_buffer = 8
|
||||
opcache.max_accelerated_files = 4000
|
||||
opcache.revalidate_freq = 60
|
||||
opcache.fast_shutdown = 1
|
||||
opcache.enable_cli = 1
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
return [
|
||||
'php' => [
|
||||
'version' => '7.1.3'
|
||||
'version' => '7.2'
|
||||
],
|
||||
|
||||
'extensions' => [
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</whitelist>
|
||||
</filter>
|
||||
<php>
|
||||
<env name="APP_ENV" value="testing"/>
|
||||
<env name="APP_ENV" value="test"/>
|
||||
<env name="APP_KEY" value="base64:ve66Z5Kt/zTN3p++0zOPu854PHfZkwJE5VuoFAlzHtI="/>
|
||||
<env name="APP_DEBUG" value="true"/>
|
||||
<env name="APP_LOG_LEVEL" value="debug"/>
|
||||
|
||||
@@ -11,7 +11,7 @@ class AcarsTest extends TestCase
|
||||
{
|
||||
protected $settingsRepo;
|
||||
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->addData('base');
|
||||
|
||||
@@ -9,7 +9,7 @@ use App\Services\FareService;
|
||||
*/
|
||||
class ApiTest extends TestCase
|
||||
{
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->addData('base');
|
||||
|
||||
@@ -7,7 +7,7 @@ class AwardsTest extends TestCase
|
||||
private $awardSvc;
|
||||
private $pirepSvc;
|
||||
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->awardSvc = app(\App\Services\AwardService::class);
|
||||
|
||||
@@ -21,7 +21,7 @@ class FinanceTest extends TestCase
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->addData('base');
|
||||
|
||||
@@ -12,7 +12,7 @@ class FlightTest extends TestCase
|
||||
protected $flightSvc;
|
||||
protected $settingsRepo;
|
||||
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->addData('base');
|
||||
|
||||
@@ -12,7 +12,7 @@ class ImporterTest extends TestCase
|
||||
private $importSvc;
|
||||
private $fareSvc;
|
||||
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->importBaseClass = new \App\Interfaces\ImportExport();
|
||||
|
||||
@@ -4,10 +4,6 @@ use App\Support\Math;
|
||||
|
||||
class MathTest extends TestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test adding/subtracting a percentage
|
||||
*/
|
||||
|
||||
@@ -10,9 +10,9 @@ class MetarTest extends TestCase
|
||||
{
|
||||
private $settingsRepo;
|
||||
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp(); // TODO: Change the autogenerated stub
|
||||
parent::setUp();
|
||||
$this->settingsRepo = app(SettingRepository::class);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@ class PIREPTest extends TestCase
|
||||
protected $pirepSvc;
|
||||
protected $settingsRepo;
|
||||
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp(); // TODO: Change the autogenerated stub
|
||||
parent::setUp();
|
||||
$this->addData('base');
|
||||
|
||||
$this->pirepSvc = app('App\Services\PirepService');
|
||||
|
||||
@@ -6,7 +6,7 @@ class SubfleetTest extends TestCase
|
||||
protected $ac_svc;
|
||||
protected $ICAO = 'B777';
|
||||
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->addData('base');
|
||||
|
||||
@@ -19,7 +19,7 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
|
||||
|
||||
protected $app;
|
||||
protected $baseUrl = 'http://localhost';
|
||||
protected $connectionsToTransact = ['testing'];
|
||||
protected $connectionsToTransact = ['test'];
|
||||
|
||||
protected $user;
|
||||
|
||||
@@ -30,13 +30,18 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
public function setUp()
|
||||
public function setUp() : void
|
||||
{
|
||||
parent::setUp();
|
||||
Artisan::call('database:create', ['--reset' => true]);
|
||||
Artisan::call('migrate:refresh', ['--env' => 'unittest']);
|
||||
}
|
||||
|
||||
public function tearDown() : void
|
||||
{
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the application. Required to be implemented
|
||||
*
|
||||
|
||||
@@ -8,7 +8,7 @@ class UserTest extends TestCase
|
||||
protected $settingsRepo;
|
||||
protected $userSvc;
|
||||
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->userSvc = app(UserService::class);
|
||||
|
||||
@@ -4,10 +4,6 @@ use App\Facades\Utils;
|
||||
|
||||
class UtilsTest extends TestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function testDates()
|
||||
{
|
||||
$carbon = new \Carbon\Carbon('2018-04-28T12:55:40Z');
|
||||
|
||||
Reference in New Issue
Block a user