在现有项目上安装 Laravel
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25610958/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Installing laravel on existing project
提问by jjdr
I'm developing a laravel application and my computer die. Now I want to get my project from the repository (Bitbucket + Git) but thanks to the git ignore file, the vendor folder is missing. I can't do a composer install on my project because is not allowed (the directory should be empty). The structure of my project is the same as the laravel installation except that I renamed the public folder.
我正在开发一个 Laravel 应用程序,但我的电脑死机了。现在我想从存储库 (Bitbucket + Git) 中获取我的项目,但由于 git ignore 文件,供应商文件夹丢失。我不能在我的项目上安装 composer install 因为不允许(目录应该是空的)。我的项目结构与laravel安装相同,只是我重命名了公共文件夹。
I found this thread but did not solve my problem.
我找到了这个线程,但没有解决我的问题。
Integrating existing project by laravel framework?
I wanna know the best practice or way to do this and i don't think that copy and paste the folder of my project to a fresh install of larevel should be the way.
我想知道这样做的最佳实践或方法,我不认为将我的项目文件夹复制并粘贴到全新安装的 larevel 应该是方法。
Thanks.
谢谢。
回答by Antonio Carlos Ribeiro
Go to your www folder
转到您的 www 文件夹
cd /var/www
Git clone your application (not that here the directory must not exist):
Git 克隆你的应用程序(不是这里的目录不能存在):
git clone https://github.com/antonioribeiro/application
CD into the folder
光盘放入文件夹
cd application
Execute composer update (if you are in a development environment)
执行 composer update (如果你在开发环境中)
composer update
Or execute composer install (if you are in a production environment)
或者执行 composer install (如果你在生产环境中)
composer install
Note that for composer install or composer update, the folder may actually have files and even a vendor folder created, there is not such obstacle.
请注意,对于 composer install 或 composer update,文件夹实际上可能有文件,甚至创建了供应商文件夹,没有这样的障碍。