Create constant CORE_PATH and rework project loaders
This commit is contained in:
@@ -30,7 +30,7 @@ class HRCCommand extends Command
|
|||||||
|
|
||||||
private function prepareInput()
|
private function prepareInput()
|
||||||
{
|
{
|
||||||
$source_file = base_path() . '/../temp/' . $this->argument('source');
|
$source_file = CORE_PATH . '/temp/' . $this->argument('source');
|
||||||
$data = parse_ini_file($source_file);
|
$data = parse_ini_file($source_file);
|
||||||
|
|
||||||
if(isset($data['raw_result'])) {
|
if(isset($data['raw_result'])) {
|
||||||
@@ -42,7 +42,7 @@ class HRCCommand extends Command
|
|||||||
|
|
||||||
private function prepareOutput()
|
private function prepareOutput()
|
||||||
{
|
{
|
||||||
$source_file = base_path() . '/../temp/' . $this->argument('source');
|
$source_file = CORE_PATH . '/temp/' . $this->argument('source');
|
||||||
$data = parse_ini_file($source_file);
|
$data = parse_ini_file($source_file);
|
||||||
|
|
||||||
if(isset($data['raw_result'])) {
|
if(isset($data['raw_result'])) {
|
||||||
@@ -54,7 +54,7 @@ class HRCCommand extends Command
|
|||||||
|
|
||||||
public function save($result)
|
public function save($result)
|
||||||
{
|
{
|
||||||
$result_file = base_path() . '/../temp/' . $this->argument('result');
|
$result_file = CORE_PATH . '/temp/' . $this->argument('result');
|
||||||
file_put_contents($result_file, json_encode($result));
|
file_put_contents($result_file, json_encode($result));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class Kernel extends ConsoleKernel
|
|||||||
|
|
||||||
public function getCommands()
|
public function getCommands()
|
||||||
{
|
{
|
||||||
$commands_path = base_path() . '/../../../commands';
|
$commands_path = CORE_PATH . '/commands';
|
||||||
$files = array_diff(scandir($commands_path), array('.', '..'));
|
$files = array_diff(scandir($commands_path), array('.', '..'));
|
||||||
|
|
||||||
$classes = [];
|
$classes = [];
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
|
|
||||||
public function boot()
|
public function boot()
|
||||||
{
|
{
|
||||||
$migrations_path = base_path() . '/../database/migrations';
|
$migrations_path = CORE_PATH . '/database/migrations';
|
||||||
$default_path = database_path('migrations');
|
$default_path = database_path('migrations');
|
||||||
|
|
||||||
$this->loadMigrationsFrom([
|
$this->loadMigrationsFrom([
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once __DIR__.'/../../../vendor/autoload.php';
|
define('CORE_PATH', __DIR__.'/../../../..');
|
||||||
|
|
||||||
|
require_once CORE_PATH . '/vendor/autoload.php';
|
||||||
|
|
||||||
(new Laravel\Lumen\Bootstrap\LoadEnvironmentVariables(
|
(new Laravel\Lumen\Bootstrap\LoadEnvironmentVariables(
|
||||||
dirname(__DIR__) . '/../../../'
|
CORE_PATH . '/'
|
||||||
))->bootstrap();
|
))->bootstrap();
|
||||||
|
|
||||||
date_default_timezone_set(env('APP_TIMEZONE', 'UTC'));
|
date_default_timezone_set(env('APP_TIMEZONE', 'UTC'));
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
*/
|
*/
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
$seeders_path = base_path() . '/../../../database/seeders';
|
$seeders_path = CORE_PATH . '/database/seeders';
|
||||||
|
|
||||||
if(file_exists($seeders_path)) {
|
if(file_exists($seeders_path)) {
|
||||||
$files = array_diff(scandir($seeders_path), array('.', '..'));
|
$files = array_diff(scandir($seeders_path), array('.', '..'));
|
||||||
|
|||||||
Reference in New Issue
Block a user