Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
aossant
Gestion_L2_Equipe_41
Commits
b0d82df8
Commit
b0d82df8
authored
Mar 21, 2021
by
aossant
Browse files
[global]Correction erreur
parent
93c54055
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
NeoToon/.env
View file @
b0d82df8
# In all environments, the following files are loaded if they exist,
# the latter taking precedence over the former:
#
# * .env contains default values for the environment variables needed by the app
# * .env.local uncommitted file with local overrides
# * .env.$APP_ENV committed environment-specific defaults
# * .env.$APP_ENV.local uncommitted environment-specific overrides
#
# Real environment variables win over .env files.
#
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
#
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=e68a00beea417f37c923365655f692be
###< symfony/framework-bundle ###
# In all environments, the following files are loaded if they exist,
# the latter taking precedence over the former:
#
# * .env contains default values for the environment variables needed by the app
# * .env.local uncommitted file with local overrides
# * .env.$APP_ENV committed environment-specific defaults
# * .env.$APP_ENV.local uncommitted environment-specific overrides
#
# Real environment variables win over .env files.
#
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
#
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=e68a00beea417f37c923365655f692be
###< symfony/framework-bundle ###
NeoToon/.gitignore
View file @
b0d82df8
###> symfony/framework-bundle ###
/var
/vendor
/.env.local
/.env.local.php
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/var/
/vendor/
###< symfony/framework-bundle ###
###> symfony/framework-bundle ###
/var
/vendor
/.env.local
/.env.local.php
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/var/
/vendor/
###< symfony/framework-bundle ###
NeoToon/bin/console
View file @
b0d82df8
#!/usr/bin/env php
<?php
use
App\Kernel
;
use
Symfony\Bundle\FrameworkBundle\Console\Application
;
use
Symfony\Component\Console\Input\ArgvInput
;
use
Symfony\Component\Dotenv\Dotenv
;
use
Symfony\Component\ErrorHandler\Debug
;
if
(
!
in_array
(
PHP_SAPI
,
[
'cli'
,
'phpdbg'
,
'embed'
],
true
))
{
echo
'Warning: The console should be invoked via the CLI version of PHP, not the '
.
PHP_SAPI
.
' SAPI'
.
PHP_EOL
;
}
set_time_limit
(
0
);
require
dirname
(
__DIR__
)
.
'/vendor/autoload.php'
;
if
(
!
class_exists
(
Application
::
class
)
||
!
class_exists
(
Dotenv
::
class
))
{
throw
new
LogicException
(
'You need to add "symfony/framework-bundle" and "symfony/dotenv" as Composer dependencies.'
);
}
$input
=
new
ArgvInput
();
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'
);
}
(
new
Dotenv
())
->
bootEnv
(
dirname
(
__DIR__
)
.
'/.env'
);
if
(
$_SERVER
[
'APP_DEBUG'
])
{
umask
(
0000
);
if
(
class_exists
(
Debug
::
class
))
{
Debug
::
enable
();
}
}
$kernel
=
new
Kernel
(
$_SERVER
[
'APP_ENV'
],
(
bool
)
$_SERVER
[
'APP_DEBUG'
]);
$application
=
new
Application
(
$kernel
);
$application
->
run
(
$input
);
#!/usr/bin/env php
<?php
use
App\Kernel
;
use
Symfony\Bundle\FrameworkBundle\Console\Application
;
use
Symfony\Component\Console\Input\ArgvInput
;
use
Symfony\Component\Dotenv\Dotenv
;
use
Symfony\Component\ErrorHandler\Debug
;
if
(
!
in_array
(
PHP_SAPI
,
[
'cli'
,
'phpdbg'
,
'embed'
],
true
))
{
echo
'Warning: The console should be invoked via the CLI version of PHP, not the '
.
PHP_SAPI
.
' SAPI'
.
PHP_EOL
;
}
set_time_limit
(
0
);
require
dirname
(
__DIR__
)
.
'/vendor/autoload.php'
;
if
(
!
class_exists
(
Application
::
class
)
||
!
class_exists
(
Dotenv
::
class
))
{
throw
new
LogicException
(
'You need to add "symfony/framework-bundle" and "symfony/dotenv" as Composer dependencies.'
);
}
$input
=
new
ArgvInput
();
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'
);
}
(
new
Dotenv
())
->
bootEnv
(
dirname
(
__DIR__
)
.
'/.env'
);
if
(
$_SERVER
[
'APP_DEBUG'
])
{
umask
(
0000
);
if
(
class_exists
(
Debug
::
class
))
{
Debug
::
enable
();
}
}
$kernel
=
new
Kernel
(
$_SERVER
[
'APP_ENV'
],
(
bool
)
$_SERVER
[
'APP_DEBUG'
]);
$application
=
new
Application
(
$kernel
);
$application
->
run
(
$input
);
NeoToon/composer.json
View file @
b0d82df8
{
"type"
:
"project"
,
"license"
:
"proprietary"
,
"minimum-stability"
:
"dev"
,
"prefer-stable"
:
true
,
"require"
:
{
"php"
:
">=7.2.5"
,
"ext-ctype"
:
"*"
,
"ext-iconv"
:
"*"
,
"symfony/console"
:
"5.2.*"
,
"symfony/dotenv"
:
"5.2.*"
,
"symfony/flex"
:
"^1.3.1"
,
"symfony/framework-bundle"
:
"5.2.*"
,
"symfony/yaml"
:
"5.2.*"
},
"require-dev"
:
{
},
"config"
:
{
"optimize-autoloader"
:
true
,
"preferred-install"
:
{
"*"
:
"dist"
},
"sort-packages"
:
true
},
"autoload"
:
{
"psr-4"
:
{
"App\\"
:
"src/"
}
},
"autoload-dev"
:
{
"psr-4"
:
{
"App\\Tests\\"
:
"tests/"
}
},
"replace"
:
{
"symfony/polyfill-ctype"
:
"*"
,
"symfony/polyfill-iconv"
:
"*"
,
"symfony/polyfill-php72"
:
"*"
},
"scripts"
:
{
"auto-scripts"
:
{
"cache:clear"
:
"symfony-cmd"
,
"assets:install %PUBLIC_DIR%"
:
"symfony-cmd"
},
"post-install-cmd"
:
[
"@auto-scripts"
],
"post-update-cmd"
:
[
"@auto-scripts"
]
},
"conflict"
:
{
"symfony/symfony"
:
"*"
},
"extra"
:
{
"symfony"
:
{
"allow-contrib"
:
false
,
"require"
:
"5.2.*"
}
}
}
{
"type"
:
"project"
,
"license"
:
"proprietary"
,
"minimum-stability"
:
"dev"
,
"prefer-stable"
:
true
,
"require"
:
{
"php"
:
">=7.2.5"
,
"ext-ctype"
:
"*"
,
"ext-iconv"
:
"*"
,
"symfony/console"
:
"5.2.*"
,
"symfony/dotenv"
:
"5.2.*"
,
"symfony/flex"
:
"^1.3.1"
,
"symfony/framework-bundle"
:
"5.2.*"
,
"symfony/yaml"
:
"5.2.*"
},
"require-dev"
:
{
},
"config"
:
{
"optimize-autoloader"
:
true
,
"preferred-install"
:
{
"*"
:
"dist"
},
"sort-packages"
:
true
},
"autoload"
:
{
"psr-4"
:
{
"App\\"
:
"src/"
}
},
"autoload-dev"
:
{
"psr-4"
:
{
"App\\Tests\\"
:
"tests/"
}
},
"replace"
:
{
"symfony/polyfill-ctype"
:
"*"
,
"symfony/polyfill-iconv"
:
"*"
,
"symfony/polyfill-php72"
:
"*"
},
"scripts"
:
{
"auto-scripts"
:
{
"cache:clear"
:
"symfony-cmd"
,
"assets:install %PUBLIC_DIR%"
:
"symfony-cmd"
},
"post-install-cmd"
:
[
"@auto-scripts"
],
"post-update-cmd"
:
[
"@auto-scripts"
]
},
"conflict"
:
{
"symfony/symfony"
:
"*"
},
"extra"
:
{
"symfony"
:
{
"allow-contrib"
:
false
,
"require"
:
"5.2.*"
}
}
}
NeoToon/composer.lock
View file @
b0d82df8
This diff is collapsed.
Click to expand it.
NeoToon/config/bundles.php
View file @
b0d82df8
<?php
return
[
Symfony\Bundle\FrameworkBundle\FrameworkBundle
::
class
=>
[
'all'
=>
true
],
];
<?php
return
[
Symfony\Bundle\FrameworkBundle\FrameworkBundle
::
class
=>
[
'all'
=>
true
],
];
NeoToon/config/packages/cache.yaml
View file @
b0d82df8
framework
:
cache
:
# Unique name of your app: used to compute stable namespaces for cache keys.
#prefix_seed: your_vendor_name/app_name
# The "app" cache stores to the filesystem by default.
# The data in this cache should persist between deploys.
# Other options include:
# Redis
#app: cache.adapter.redis
#default_redis_provider: redis://localhost
# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
#app: cache.adapter.apcu
# Namespaced pools use the above "app" backend by default
#pools:
#my.dedicated.cache: null
framework
:
cache
:
# Unique name of your app: used to compute stable namespaces for cache keys.
#prefix_seed: your_vendor_name/app_name
# The "app" cache stores to the filesystem by default.
# The data in this cache should persist between deploys.
# Other options include:
# Redis
#app: cache.adapter.redis
#default_redis_provider: redis://localhost
# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
#app: cache.adapter.apcu
# Namespaced pools use the above "app" backend by default
#pools:
#my.dedicated.cache: null
NeoToon/config/packages/framework.yaml
View file @
b0d82df8
# see https://symfony.com/doc/current/reference/configuration/framework.html
framework
:
secret
:
'
%env(APP_SECRET)%'
#csrf_protection: true
#http_method_override: true
# Enables session support. Note that the session will ONLY be started if you read or write from it.
# Remove or comment this section to explicitly disable session support.
session
:
handler_id
:
null
cookie_secure
:
auto
cookie_samesite
:
lax
#esi: true
#fragments: true
php_errors
:
log
:
true
# see https://symfony.com/doc/current/reference/configuration/framework.html
framework
:
secret
:
'
%env(APP_SECRET)%'
#csrf_protection: true
#http_method_override: true
# Enables session support. Note that the session will ONLY be started if you read or write from it.
# Remove or comment this section to explicitly disable session support.
session
:
handler_id
:
null
cookie_secure
:
auto
cookie_samesite
:
lax
#esi: true
#fragments: true
php_errors
:
log
:
true
NeoToon/config/packages/prod/routing.yaml
View file @
b0d82df8
framework
:
router
:
strict_requirements
:
null
framework
:
router
:
strict_requirements
:
null
NeoToon/config/packages/routing.yaml
View file @
b0d82df8
framework
:
router
:
utf8
:
true
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
#default_uri: http://localhost
framework
:
router
:
utf8
:
true
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
#default_uri: http://localhost
NeoToon/config/packages/test/framework.yaml
View file @
b0d82df8
framework
:
test
:
true
session
:
storage_id
:
session.storage.mock_file
framework
:
test
:
true
session
:
storage_id
:
session.storage.mock_file
NeoToon/config/preload.php
View file @
b0d82df8
<?php
if
(
file_exists
(
dirname
(
__DIR__
)
.
'/var/cache/prod/App_KernelProdContainer.preload.php'
))
{
require
dirname
(
__DIR__
)
.
'/var/cache/prod/App_KernelProdContainer.preload.php'
;
}
<?php
if
(
file_exists
(
dirname
(
__DIR__
)
.
'/var/cache/prod/App_KernelProdContainer.preload.php'
))
{
require
dirname
(
__DIR__
)
.
'/var/cache/prod/App_KernelProdContainer.preload.php'
;
}
NeoToon/config/routes.yaml
View file @
b0d82df8
#index:
# path: /
# controller: App\Controller\DefaultController::index
#index:
# path: /
# controller: App\Controller\DefaultController::index
NeoToon/config/routes/dev/framework.yaml
View file @
b0d82df8
_errors
:
resource
:
'
@FrameworkBundle/Resources/config/routing/errors.xml'
prefix
:
/_error
_errors
:
resource
:
'
@FrameworkBundle/Resources/config/routing/errors.xml'
prefix
:
/_error
NeoToon/config/services.yaml
View file @
b0d82df8
# This file is the entry point to configure your own services.
# Files in the packages/ subdirectory configure your dependencies.
# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters
:
services
:
# default configuration for services in *this* file
_defaults
:
autowire
:
true
# Automatically injects dependencies in your services.
autoconfigure
:
true
# Automatically registers your services as commands, event subscribers, etc.
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
App\
:
resource
:
'
../src/'
exclude
:
-
'
../src/DependencyInjection/'
-
'
../src/Entity/'
-
'
../src/Kernel.php'
-
'
../src/Tests/'
# controllers are imported separately to make sure services can be injected
# as action arguments even if you don't extend any base controller class
App\Controller\
:
resource
:
'
../src/Controller/'
tags
:
[
'
controller.service_arguments'
]
# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones
# This file is the entry point to configure your own services.
# Files in the packages/ subdirectory configure your dependencies.
# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters
:
services
:
# default configuration for services in *this* file
_defaults
:
autowire
:
true
# Automatically injects dependencies in your services.
autoconfigure
:
true
# Automatically registers your services as commands, event subscribers, etc.
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
App\
:
resource
:
'
../src/'
exclude
:
-
'
../src/DependencyInjection/'
-
'
../src/Entity/'
-
'
../src/Kernel.php'
-
'
../src/Tests/'
# controllers are imported separately to make sure services can be injected
# as action arguments even if you don't extend any base controller class
App\Controller\
:
resource
:
'
../src/Controller/'
tags
:
[
'
controller.service_arguments'
]
# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones
NeoToon/public/index.php
View file @
b0d82df8
<?php
use
App\Kernel
;
use
Symfony\Component\Dotenv\Dotenv
;
use
Symfony\Component\ErrorHandler\Debug
;
use
Symfony\Component\HttpFoundation\Request
;
require
dirname
(
__DIR__
)
.
'/vendor/autoload.php'
;
(
new
Dotenv
())
->
bootEnv
(
dirname
(
__DIR__
)
.
'/.env'
);
if
(
$_SERVER
[
'APP_DEBUG'
])
{
umask
(
0000
);
Debug
::
enable
();
}
$kernel
=
new
Kernel
(
$_SERVER
[
'APP_ENV'
],
(
bool
)
$_SERVER
[
'APP_DEBUG'
]);
$request
=
Request
::
createFromGlobals
();
$response
=
$kernel
->
handle
(
$request
);
$response
->
send
();
$kernel
->
terminate
(
$request
,
$response
);
<?php
use
App\Kernel
;
use
Symfony\Component\Dotenv\Dotenv
;
use
Symfony\Component\ErrorHandler\Debug
;
use
Symfony\Component\HttpFoundation\Request
;
require
dirname
(
__DIR__
)
.
'/vendor/autoload.php'
;
(
new
Dotenv
())
->
bootEnv
(
dirname
(
__DIR__
)
.
'/.env'
);
if
(
$_SERVER
[
'APP_DEBUG'
])
{
umask
(
0000
);
Debug
::
enable
();
}
$kernel
=
new
Kernel
(
$_SERVER
[
'APP_ENV'
],
(
bool
)
$_SERVER
[
'APP_DEBUG'
]);
$request
=
Request
::
createFromGlobals
();
$response
=
$kernel
->
handle
(
$request
);
$response
->
send
();
$kernel
->
terminate
(
$request
,
$response
);
NeoToon/src/Kernel.php
View file @
b0d82df8
<?php
namespace
App
;
use
Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait
;
use
Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator
;
use
Symfony\Component\HttpKernel\Kernel
as
BaseKernel
;
use
Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator
;
class
Kernel
extends
BaseKernel
{
use
MicroKernelTrait
;
protected
function
configureContainer
(
ContainerConfigurator
$container
):
void
{
$container
->
import
(
'../config/{packages}/*.yaml'
);
$container
->
import
(
'../config/{packages}/'
.
$this
->
environment
.
'/*.yaml'
);
if
(
is_file
(
\
dirname
(
__DIR__
)
.
'/config/services.yaml'
))
{
$container
->
import
(
'../config/services.yaml'
);
$container
->
import
(
'../config/{services}_'
.
$this
->
environment
.
'.yaml'
);
}
elseif
(
is_file
(
$path
=
\
dirname
(
__DIR__
)
.
'/config/services.php'
))
{
(
require
$path
)(
$container
->
withPath
(
$path
),
$this
);
}
}
protected
function
configureRoutes
(
RoutingConfigurator
$routes
):
void
{
$routes
->
import
(
'../config/{routes}/'
.
$this
->
environment
.
'/*.yaml'
);
$routes
->
import
(
'../config/{routes}/*.yaml'
);
if
(
is_file
(
\
dirname
(
__DIR__
)
.
'/config/routes.yaml'
))
{
$routes
->
import
(
'../config/routes.yaml'
);
}
elseif
(
is_file
(
$path
=
\
dirname
(
__DIR__
)
.
'/config/routes.php'
))
{
(
require
$path
)(
$routes
->
withPath
(
$path
),
$this
);
}
}
}
<?php
namespace
App
;
use
Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait
;
use
Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator
;
use
Symfony\Component\HttpKernel\Kernel
as
BaseKernel
;
use
Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator
;
class
Kernel
extends
BaseKernel
{
use
MicroKernelTrait
;
protected
function
configureContainer
(
ContainerConfigurator
$container
):
void
{
$container
->
import
(
'../config/{packages}/*.yaml'
);
$container
->
import
(
'../config/{packages}/'
.
$this
->
environment
.
'/*.yaml'
);
if
(
is_file
(
\
dirname
(
__DIR__
)
.
'/config/services.yaml'
))
{
$container
->
import
(
'../config/services.yaml'
);
$container
->
import
(
'../config/{services}_'
.
$this
->
environment
.
'.yaml'
);
}
elseif
(
is_file
(
$path
=
\
dirname
(
__DIR__
)
.
'/config/services.php'
))
{
(
require
$path
)(
$container
->
withPath
(
$path
),
$this
);
}
}
protected
function
configureRoutes
(
RoutingConfigurator
$routes
):
void
{
$routes
->
import
(
'../config/{routes}/'
.
$this
->
environment
.
'/*.yaml'
);
$routes
->
import
(
'../config/{routes}/*.yaml'
);
if
(
is_file
(
\
dirname
(
__DIR__
)
.
'/config/routes.yaml'
))
{
$routes
->
import
(
'../config/routes.yaml'
);
}
elseif
(
is_file
(
$path
=
\
dirname
(
__DIR__
)
.
'/config/routes.php'
))
{
(
require
$path
)(
$routes
->
withPath
(
$path
),
$this
);
}
}
}
NeoToon/symfony.lock
View file @
b0d82df8