Shell/Bash: composer autoload dump Example

By

Shell/Bash Example: This is the "composer autoload dump" Example. compiled from many sources on the internet by SimpleTutorials.org

composer autoload dump

composer dump-autoload

composer autoload dump

composer dump-autoload

composer autoload

require __DIR__ . '/vendor/autoload.php';

$log = new Monolog\Logger('name');
$log->pushHandler(new Monolog\Handler\StreamHandler('app.log', Monolog\Logger::WARNING));
$log->addWarning('Foo');

composer dump autoload without terminal

2 Solutions are there :

Solution 1 : if composer is installed on the server then :
=============
You dont need shell access. Artisan includes a dump-autoload function. You can 
just it via a PHP call within your app:

Route::get('/updateapp', function()
{
    \Artisan::call('dump-autoload');
    echo 'dump-autoload complete';
});
----------------------------------------------------------
Solution 2 : 
============
Run composer dump-autoload locally. Then, in your hosting site, you can update 
two files, autoload_classmap.php and autoload_static.php, manually in 
vendor/composer folder. I prefer to copy and paste the added classes from 
local to the hosting server.

composer update

php composer.phar update

composer autoload dump

composer dump-autoload


* Summary: This "composer autoload dump" Shell/Bash Example is compiled from the internet. If you have any questions, please leave a comment. Thank you!

Others