如何避免在 laravel 4 中使用 php composer dump-autoload? [英] How to avoid using php composer dump-autoload with laravel 4?

查看:17
本文介绍了如何避免在 laravel 4 中使用 php composer dump-autoload?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将我的项目上传到网络主机上,并使用 ftp 来编辑我的代码.问题是我使用 eloquent 为我的数据库添加了模型,为了让它工作,我必须下载我的项目,然后运行 ​​php composer dump-autoload 然后重新上传.否则找不到它的说类......一直这样做只是很重.还有其他解决方案吗?我的虚拟主机没有 ssh 或任何东西可以连接到服务器.我也不能使用 rsync 之类的东西.也许我应该使用 laravel4 以外的其他框架来避免使用 composer?

I have uploaded my project on a web host and I use ftp to edit my code. The problem is that I added models using eloquent for my database and to get it work I have to download my project dans run php composer dump-autoload then re-upload. Otherwise its say class not found ... Doing this all the time is just heavy. Is there any other solution? My webhost does not have ssh or any thing to connect to the server. Neither I can use rsync like stuff. Maybe I should use an other framework than laravel4 to avoid using composer?

推荐答案

在您的情况下,您应该将所需的自动加载目录添加到/app/start/global.php 下的 ClassLoader::addDirectories 数组中.Laravel 提供了多种方法来完成同一件事,具体取决于您的个人需求.

In your case, you should add your needed autoload directory to the ClassLoader::addDirectories array under /app/start/global.php. Laravel gives multiple ways to accomplish the same thing depending on your personal needs.

这篇关于如何避免在 laravel 4 中使用 php composer dump-autoload?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆