Generate PHP code in which the classes used are in the same
file would be "faster" than having them "scattered" by
directories?
Theoretically performing a single file decreases access to the disk, which does not need to search for several other files.
But worrying about this can be an early optimization, because when using the OpCache
, which comes by default from the PHP 5.5+
, but deactivated, a cache of the files in memory is made and the I/O neck dies there.
I get the impression that every time I execute the command
dump-autoload to generate the autoload of the classes via
bootstrap/Compiled.php file is created.
Composer does not generate the file compiled.php
when executing dump-autoload
, this command only generates the autoloaders of the briefcase vendor\composer
from what is configured in composer.json
of the project.
You must be confusing this file with the php artisan otimize
of Laravel, who uses a library to generate this automatically compiled file to join framework classes, file that can bring more trouble than help.
In short: don’t worry about it. In production environments enable PHP Opcache and be happy.
More about Opcache you can read hereen.
The archive
compiled.php
can slow down the application ? Because when installing Laravel 5 you are asked to delete the file. Once installed, you should upgrade to the Latest Packages. First, remove{directory}/vendor/compiled.php
file then change your Current directory to{directory}
and Issue Composer update command.– Diego Souza
@Zooboomafoo in this case is asked to delete this file because the source class will be different from the one in Compiled. It is usually already deleted, but sometimes some problem may occur.
– gmsantos
Related: http://answall.com/q/15005/250
– Bruno Augusto