在 类 上调用没有命名空间的静态方法
Call static method on classes without namspaces
我有一个不使用名称空间但仅使用静态方法的库,我如何才能使其在整个应用程序中可用?我正在使用 Symfony 3.2
这可以在您的 composer.json
自动加载文件中完成:
"autoload": {
"files": ["/path/to/my/file/with/functions.php"]
}
阅读更多:https://codingexplained.com/coding/php/composer-autoloading-third-party-libraries-without-namespaces
不要忘记 运行 composer dump-autoload
重建缓存的自动加载器。
我有一个不使用名称空间但仅使用静态方法的库,我如何才能使其在整个应用程序中可用?我正在使用 Symfony 3.2
这可以在您的 composer.json
自动加载文件中完成:
"autoload": {
"files": ["/path/to/my/file/with/functions.php"]
}
阅读更多:https://codingexplained.com/coding/php/composer-autoloading-third-party-libraries-without-namespaces
不要忘记 运行 composer dump-autoload
重建缓存的自动加载器。