- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在尝试包含一个指向 autoload.php 的路径
vendor/autoload.php
试图访问它的文件在
public/this-file.php
我将路径设置为 require_once '../vendor/autoload.php';
但它只是抛出错误 -
Warning: require_once(../vendor/autoload.php): failed to open stream: No such file or directory
Fatal error: require_once(): Failed opening required '../vendor/autoload.php' (include_path='.:/opt/php55/lib/php')
laravel 是否提供短代码来访问供应商文件中的文件
最佳答案
你不需要在 Laravel 应用程序中要求 autoload.php
,它已经被要求了。您可以在 composer.json
文件中添加更多包,或者在命令行中执行 composer require
,它应该可以工作。
bootstrap/autoload.php
中需要它,如果你不相信我的话。 ;)
/*
|--------------------------------------------------------------------- -----
| Register The Composer Auto Loader
|------------------------------------------------------------------------- -
|
| Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any our classes "manually". Feels great to relax.
|
*/
require __DIR__.'/../vendor/autoload.php';
如果由于某种原因不是,请尝试 composer dump-autoload
,它修复了 Laravel 中的许多“需要”的问题,尤其是在使用播种器和诸如此类的东西时。 p>
关于php - Laravel 5 如何包含 autoload.php,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32575659/
Kernel#autoload 和 Module#autoload 有什么区别?每个使用的上下文是什么? 最佳答案 正如标准文档中这些方法的源代码所示, Kernel#autoload 电话 Modu
我对 Laravel 4 和 Composer 还是很陌生。当我做 Laravel 4 教程时,我无法理解这两个命令之间的区别; php artisan dump-autoload 和 compose
search() 上的倒数第二项path 是(总是?)一个名为 Autoloads 的环境.关于这个话题,我能找到的只是 R language definition 第 26 页上的一句话。 (PDF
package My::Win32::Console; use warnings; use strict; use parent qw( Win32::Console ); sub new {
我的 MVC 结构如下: - web -- Classes --- Loader.php -- Core --- Controller.php --- Model.ph
本文实例分析了Yii2中YiiBase自动加载类、引用文件的方法。分享给大家供大家参考,具体如下: 在Yii2中这个函数是用来加载类的,没有直接引用文件的相关实现。但是这个也可以用来引用文件。
我是 PHP 自动加载的新手,在我的最新项目中需要 Horde_Text_Diff。我正在使用 Horde_Autoloader 来自动加载所需的文件,但是,我没有正确使用它。据我所知,互联网上没有一
我正在将 Symfonys Autoloader 用于具有以下文件夹/类结构的项目: App +- Package1 | +- Package2 +- Class1.php | - Interfa
我目前正在用 PHP 对我的框架进行编程(主要是出于教育原因,也是一种打发时间的方式)。我编写了一个自动加载器,它会自动扫描目录树并检测其中的所有类,并按以下格式创建一个数组: Array(
我有一个非常有趣的困境。我正在开发 CVS 存储库的 Perl 脚本接口(interface),并创建了 Perl 对象来表示 Modules , Paths , 和 Files .由于Modules
我被困在一个非常基本的问题上: 我正在尝试使用 Laravel,我使用 Composer 安装在我的 Windows 7 上。当我尝试使用 Wamp 在本地访问我的网站时,出现错误: Warning:
我目前正在开发一个需要从其父目录访问类的 Laravel 项目。 Composer .json > PSR-4: "psr-4": { ... "ModuleA
我将下面的代码作为一个自动加载类,但是看起来 clean 方法根本不起作用,它总是退回到 dirty 方法。 我是否错误地使用了 spl_autoload?如果是这样,正确(更好)的方法是什么?这是低
我正在学习 fat free 框架,但我遇到了一个问题。 我试用了 F3 Autoloader 并得到了这个: Internal Server Error Fatal error: Class 'Ga
我正在运行一个 Silex 小应用程序。试图让某种结构继续下去。 这是我的composer.json: { "require": { "silex/silex": "~1.3"
Kernel#autoload记录如下: Registers filename to be loaded (using Kernel::require) the first time that mod
我一直在使用 AUTOLOAD 在 Perl 中创建我的访问器,但我遇到了这种困惑(我已经搜索过 google 和 perldoc)。 我有这个代码: package Class; sub new {
我正在使用 CodeIgniter 4 的最新“master”分支 我有一个要自动加载的库。实际上,我希望拥有“一个”index.php(具有元数据、基本 html 结构等),通过它我可以通过我的"t
我们可以使用Autoloader跟踪是否已从 S3 存储桶加载的文件。我关于 Autoloader 的问题:有没有办法读取 Autoloader 数据库以获取已加载文件的列表? 我可以在 AWS Gl
单步执行供应商提供的库,一个调用是AUTOLOAD'ed,由UNIVERSAL::can() 捕获的coderef,然后调用该coderef。我相信调用是通过 DynaLoader 从已编译的库调用例
我是一名优秀的程序员,十分优秀!