Skip to content

Selol/autoload-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

autoload-sample

php sample using autoload

install components

composer install

enjoy autoload

php index.php
./vendor/bin/phpunit

add more third-party packages

composer require monolog/monolog
composer require guzzlehttp/guzzle

add more custom path

  1. open composer.json
  2. edit like this
    {
        "autoload": {
            "psr-4": {
                "MyCompany\\MyApp\\": "app/"
                "MyCompany\\MyNewApp\\": "new_app/" // add this for class
            },
            "files": [
                "app/Support/helpers.php"  // for funtion
            ]
        }
    }
    
  3. run this command
    composer dump-autoload
    

for more composer info, check https://packagist.org/

About

php sample using autoload

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages