Skip to content

Commit

Permalink
Symfony 3.4 directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
alanhartless committed Oct 25, 2019
1 parent 31e7880 commit 679f724
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 22 deletions.
23 changes: 18 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,34 @@

/app/cache/*
!/app/cache/.gitkeep

/app/config/local*.php
/app/config/config_local.php
/app/config/paths_local.php
/var/cache/*
!/var/cache/.gitkeep

/app/logs/*
!/app/logs/.gitkeep
/var/logs/*
!/var/logs/.gitkeep

/app/Resources/SensioGeneratorBundle
/app/spool/*
!/app/spool/.gitkeep
/var/spool/*
!/var/spool/.gitkeep

/var/tmp/*
!/var/tmp/.gitkeep

/app/Resources/SensioGeneratorBundle

/app/config/local*.php
/app/config/config_local.php
/app/config/paths_local.php

/vendor/*
!/vendor/.htaccess

/bin/*
!/bin/console

/bundles
/node_modules
/build/coverage
Expand Down
20 changes: 14 additions & 6 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ class AppKernel extends Kernel
*
* @const integer
*/
const MAJOR_VERSION = 2;
const MAJOR_VERSION = 3;

/**
* Minor version number.
*
* @const integer
*/
const MINOR_VERSION = 16;
const MINOR_VERSION = 0;

/**
* Patch version number.
Expand All @@ -51,7 +51,7 @@ class AppKernel extends Kernel
*
* @const string
*/
const EXTRA_VERSION = '-dev';
const EXTRA_VERSION = '-alpha';

/**
* @var array
Expand Down Expand Up @@ -158,7 +158,7 @@ public function registerBundles()
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
new FOS\OAuthServerBundle\FOSOAuthServerBundle(),
new Bazinga\OAuthServerBundle\BazingaOAuthServerBundle(),
//new Bazinga\OAuthServerBundle\BazingaOAuthServerBundle(),
new FOS\RestBundle\FOSRestBundle(),
new JMS\SerializerBundle\JMSSerializerBundle(),
new Oneup\UploaderBundle\OneupUploaderBundle(),
Expand Down Expand Up @@ -375,6 +375,14 @@ public function getDatabaseConnection($params = [])
}
}

/**
* @return string
*/
public function getRootDir()
{
return __DIR__;
}

/**
* {@inheritdoc}
*
Expand All @@ -388,7 +396,7 @@ public function getCacheDir()

return str_replace('%kernel.root_dir%', $this->getRootDir(), $parameters['cache_path'].$envFolder);
} else {
return parent::getCacheDir();
return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
}
}

Expand All @@ -403,7 +411,7 @@ public function getLogDir()
if (isset($parameters['log_path'])) {
return str_replace('%kernel.root_dir%', $this->getRootDir(), $parameters['log_path']);
} else {
return parent::getLogDir();
return dirname(__DIR__).'/var/logs';
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class RestrictionHelperTest extends TypeTestCase
'mailer_auth_mode' => null,
'mailer_amazon_region' => 'email-smtp.us-east-1.amazonaws.com',
'mailer_spool_type' => 'memory',
'mailer_spool_path' => '%kernel.root_dir%/spool',
'mailer_spool_path' => '%kernel.root_dir%/var/spool',
'mailer_spool_msg_limit' => null,
'mailer_spool_time_limit' => null,
'mailer_spool_recover_timeout' => 900,
Expand Down
2 changes: 1 addition & 1 deletion app/bundles/ConfigBundle/Tests/Mapper/ConfigMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ConfigMapperTest extends \PHPUnit_Framework_TestCase
'mailer_auth_mode' => null,
'mailer_amazon_region' => 'email-smtp.us-east-1.amazonaws.com',
'mailer_spool_type' => 'memory',
'mailer_spool_path' => '%kernel.root_dir%/spool',
'mailer_spool_path' => '%kernel.root_dir%/var/spool',
'mailer_spool_msg_limit' => null,
'mailer_spool_time_limit' => null,
'mailer_spool_recover_timeout' => 900,
Expand Down
6 changes: 3 additions & 3 deletions app/bundles/CoreBundle/Config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -1010,10 +1010,10 @@
'parameters' => [
'site_url' => '',
'webroot' => '',
'cache_path' => '%kernel.root_dir%/cache',
'log_path' => '%kernel.root_dir%/logs',
'cache_path' => '%kernel.root_dir%/var/cache',
'log_path' => '%kernel.root_dir%/var/logs',
'image_path' => 'media/images',
'tmp_path' => '%kernel.root_dir%/cache',
'tmp_path' => '%kernel.root_dir%/var/tmp',
'theme' => 'Mauve',
'theme_import_allowed_extensions' => ['json', 'twig', 'css', 'js', 'htm', 'html', 'txt', 'jpg', 'jpeg', 'png', 'gif'],
'db_driver' => 'pdo_mysql',
Expand Down
2 changes: 1 addition & 1 deletion app/bundles/EmailBundle/Config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@
'mailer_amazon_region' => 'email-smtp.us-east-1.amazonaws.com',
'mailer_custom_headers' => [],
'mailer_spool_type' => 'memory', //memory = immediate; file = queue
'mailer_spool_path' => '%kernel.root_dir%/spool',
'mailer_spool_path' => '%kernel.root_dir%/var/spool',
'mailer_spool_msg_limit' => null,
'mailer_spool_time_limit' => null,
'mailer_spool_recover_timeout' => 900,
Expand Down
4 changes: 2 additions & 2 deletions app/bundles/InstallBundle/Configurator/Step/CheckStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ class CheckStep implements StepInterface
*
* @var string
*/
public $cache_path = '%kernel.root_dir%/cache';
public $cache_path = '%kernel.root_dir%/var/cache';

/**
* Absolute path to log directory.
*
* @var string
*/
public $log_path = '%kernel.root_dir%/logs';
public $log_path = '%kernel.root_dir%/var/logs';

/**
* Set the domain URL for use in getting the absolute URL for cli/cronjob generated URLs.
Expand Down
2 changes: 1 addition & 1 deletion app/bundles/InstallBundle/Configurator/Step/EmailStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class EmailStep implements StepInterface
*
* @var string
*/
public $mailer_spool_path = '%kernel.root_dir%/spool';
public $mailer_spool_path = '%kernel.root_dir%/var/spool';

/**
* @param Session $session
Expand Down
4 changes: 2 additions & 2 deletions app/console → bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ defined('IN_MAUTIC_CONSOLE') or define('IN_MAUTIC_CONSOLE', 1);

define('MAUTIC_ROOT_DIR', realpath(__DIR__.'/..'));

require_once __DIR__.'/autoload.php';
require_once __DIR__.'/AppKernel.php';
require_once __DIR__.'/../app/autoload.php';
require_once __DIR__.'/../app/AppKernel.php';

use Mautic\CoreBundle\Console\Output\ConsoleDatetimeOutput;
use Symfony\Bundle\FrameworkBundle\Console\Application;
Expand Down
1 change: 1 addition & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Symfony\Component\ClassLoader\ApcClassLoader;

$loader = require_once __DIR__.'/app/autoload.php';
//include_once __DIR__.'/var/bootstrap.php.cache';

/*
* Use APC for autoloading to improve performance. Change 'sf2' to a unique prefix
Expand Down
1 change: 1 addition & 0 deletions var/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deny from all
Empty file added var/cache/.gitkeep
Empty file.
Empty file added var/logs/.gitkeep
Empty file.
Empty file added var/spool/.gitkeep
Empty file.
Empty file added var/tmp/.gitkeep
Empty file.

0 comments on commit 679f724

Please # to comment.