-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(symfony4-php72) WIP: upgrade symfony 3.3 to 4.x
Author: nicolas-grevin <[email protected]>
- Loading branch information
nicolas
committed
Dec 29, 2017
1 parent
3b116a6
commit 268a536
Showing
75 changed files
with
17,761 additions
and
2,321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# APP | ||
APP_DIR=/var/www/symfony | ||
SYMFONY_ENV=dev | ||
APP_ENV=dev | ||
APP_SECRET=93174013057b1e458ff58ae5f158a0f1 | ||
|
||
# DOCKER | ||
LOGS_DIR=/docker/logs | ||
|
@@ -25,3 +26,15 @@ SMTP_TRANSPORT= | |
|
||
#REDIS | ||
REDIS_DSN= | ||
|
||
###> snc/redis-bundle ### | ||
# passwords that contain special characters (@, %, :, +) must be urlencoded | ||
REDIS_URL=redis://localhost | ||
###< snc/redis-bundle ### | ||
|
||
###> doctrine/doctrine-bundle ### | ||
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url | ||
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db" | ||
# Configure your db driver and server_version in config/packages/doctrine.yaml | ||
DATABASE_URL=mysql://db_user:[email protected]:3306/db_name | ||
###< doctrine/doctrine-bundle ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
app: | ||
resource: AppBundle\Controller\AppController | ||
resource: '@AppBundle/Controller/AppController.php' | ||
type: annotation | ||
prefix: / | ||
|
||
api: | ||
type: rest | ||
resource: AppBundle\Controller\ApiController | ||
resource: '@AppBundle/Controller/ApiController.php' | ||
prefix: /api |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,39 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
use App\Kernel; | ||
use Symfony\Bundle\FrameworkBundle\Console\Application; | ||
use Symfony\Component\Console\Input\ArgvInput; | ||
use Symfony\Component\Debug\Debug; | ||
|
||
// if you don't want to setup permissions the proper way, just uncomment the following PHP line | ||
// read https://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup | ||
// for more information | ||
//umask(0000); | ||
use Symfony\Component\Dotenv\Dotenv; | ||
|
||
set_time_limit(0); | ||
|
||
/** @var Composer\Autoload\ClassLoader $loader */ | ||
$loader = require __DIR__.'/../vendor/autoload.php'; | ||
require __DIR__ . '/../vendor/autoload.php'; | ||
|
||
if (!class_exists(Application::class)) { | ||
throw new \RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.'); | ||
} | ||
|
||
if (!isset($_SERVER['APP_ENV'])) { | ||
if (!class_exists(Dotenv::class)) { | ||
throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.'); | ||
} | ||
(new Dotenv())->load(__DIR__ . '/../.env'); | ||
} | ||
|
||
$input = new ArgvInput(); | ||
$env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev'); | ||
$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(['--no-debug', '']) && $env !== 'prod'; | ||
$env = $input->getParameterOption(['--env', '-e'], $_SERVER['APP_ENV'] ?? 'dev'); | ||
$debug = ($_SERVER['APP_DEBUG'] ?? ('prod' !== $env)) && !$input->hasParameterOption(['--no-debug', '']); | ||
|
||
if ($debug) { | ||
Debug::enable(); | ||
umask(0000); | ||
|
||
if (class_exists(Debug::class)) { | ||
Debug::enable(); | ||
} | ||
} | ||
|
||
$kernel = new AppKernel($env, $debug); | ||
$kernel = new Kernel($env, $debug); | ||
$application = new Application($kernel); | ||
$application->run($input); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit')) { | ||
echo "Unable to find the `simple-phpunit` script in `vendor/symfony/phpunit-bridge/bin/`.\n"; | ||
exit(1); | ||
} | ||
if (false === getenv('SYMFONY_PHPUNIT_REMOVE')) { | ||
putenv('SYMFONY_PHPUNIT_REMOVE=symfony/yaml'); | ||
} | ||
if (false === getenv('SYMFONY_PHPUNIT_VERSION')) { | ||
putenv('SYMFONY_PHPUNIT_VERSION=6.5'); | ||
} | ||
if (false === getenv('SYMFONY_PHPUNIT_DIR')) { | ||
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit'); | ||
} | ||
|
||
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit'; |
Oops, something went wrong.