Skip to content

Commit

Permalink
edit js compiled
Browse files Browse the repository at this point in the history
removed index_dev.php reference from composer and add some lines in mautic-setup.sh to change configurations of environment file

fix mautic-setup.sh

remove part url with index_dev.php

remove index_dev.php from scafford folder

remove dev comments
remove reference in htaccess root and scaffold folder
copy index.php from root to scaffold folder

It was created  parameter environment handler in Core Bundle

Remove dump and add comments

fix reference array type

coping index.php in root folder to index.php in scaffold folder

refactor index
add boostrap.php
copy index to scaffold

remove .env from gitgnore and ad .env.test
change getenv() to $_SERVER to get right value
change name of env.dist to correct name
and removing environment.php
remove class enviroment helper
  • Loading branch information
lenonleite committed Apr 17, 2023
1 parent 1cffd57 commit ca11e97
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
21 changes: 16 additions & 5 deletions bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,27 @@ use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\ErrorHandler\Debug;

$input = new ArgvInput();
$env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'prod');
$debug = '0' !== getenv('SYMFONY_DEBUG') && !$input->hasParameterOption(['--no-debug', '']) && 'prod' !== $env;

if ($debug) {
Debug::enable();
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();
}
}
$output = (false !== $input->getParameterOption(['--no-interaction', '-n'])) ? new ConsoleDatetimeOutput() : null;

$kernel = new AppKernel($env, $debug);
$kernel = new AppKernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$application = new Application($kernel);
$application->setName('Mautic');
$application->setVersion($kernel->getVersion().' - app/'.$kernel->getEnvironment().($kernel->isDebug() ? '/debug' : ''));
Expand Down
4 changes: 0 additions & 4 deletions config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
(new Dotenv(false))->loadEnv(dirname(__DIR__).'/.env');
}

// Fix for hosts that do not have date.timezone set, it will be reset based on users settings
date_default_timezone_set('UTC');
define('MAUTIC_ROOT_DIR', __DIR__);

$_SERVER += $_ENV;
$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev';
$_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_DEBUG'];
Expand Down
5 changes: 5 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<?php

define('MAUTIC_ROOT_DIR', __DIR__);

// Fix for hosts that do not have date.timezone set, it will be reset based on users settings
date_default_timezone_set('UTC');

require 'config/bootstrap.php';

use Mautic\CoreBundle\ErrorHandler\ErrorHandler;
Expand Down

0 comments on commit ca11e97

Please # to comment.