0
Filing cabinet:
<?php
use Symfony\Component\HttpFoundation\Request;
/** @var \Composer\Autoload\ClassLoader $loader */
$loader = require __DIR__.'/../vendor/autoload.php';
if (PHP_VERSION_ID < 70000) {
include_once __DIR__.'/../var/bootstrap.php.cache';
}
$kernel = new AppKernel('prod', false);
if (PHP_VERSION_ID < 70000) {
$kernel->loadClassCache();
}
//$kernel = new AppCache($kernel);
// When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter
//Request::enableHttpMethodParameterOverride();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
Description:
I want to replace the line with the following content:
$kernel = new AppKernel('dev', true);
Rather than:
$kernel = new AppKernel('prod', false);
Main file.yml:
I’m trying to do this, but it doesn’t work:
- name: Change to Symfony development enviroment for reflect the changes directly on the vagrant box
replace: dest=/vagrant/symfony-standard/web/app.php regexp='$kernel = new AppKernel('prod', false);' replace='$kernel = new AppKernel('dev', true);' backup=yes
Terminal:
TASK [symfony-standard : Change to Symfony development enviroment for reflect the changes directly on the vagrant box] ***
task path: /vagrant/playbooks/roles/symfony-standard/tasks/main.yml:49
ok: [default] => {"changed": false, "msg": ""}
The estate
dest
ofreplace
is not documented. Are you sure it’sdest
and notpath
?– Woss
We found another solution @Andersoncarloswoss
– Giancarlo Abel Giulian