1

I have a library that don't uses namespaces but uses only static methods, how could I make it available throughout the application? I'm using Symfony 3.2

Marco
  • 2,757
  • 1
  • 19
  • 24

1 Answers1

5

This can be done in your composer.json file for autoloading:

"autoload": {
    "files": ["/path/to/my/file/with/functions.php"]
}

Read more: https://codingexplained.com/coding/php/composer-autoloading-third-party-libraries-without-namespaces

Don't forget to run composer dump-autoload to rebuild the cached autoloader.

Jeremy Harris
  • 24,318
  • 13
  • 79
  • 133