Accidentally removed vendor folder in laravel project - php

I was working with a laravel project and, accidentally, removed vendor folder.
What should I do? Create a new project and copy it or download it anywhere else?
I had no additional composer dependencies installed.

Just run composer install after cding into the Laravel project's directory.

The Vendor folder is created by running composer install. It contains only the packages which you have asked composer to track in the composer.json file. If you have a composer.phar file in the root of your application run php composer.phar install.
https://getcomposer.org/doc/00-intro.md is probably your best source for additional information.

Related

Laravel composer.json fully istallation

Is there any way to install laravel from only composer.json file by using
composer install
command. If i just copy composer.json from existing project it creates only vendor directory, but not app, database, etc.
I just want to load all laravel core files, project file structure and my custom package by using install command of composer.
Can someone help me with this?
You can install laravel with the command composer create-project --prefer-dist laravel/laravel <project_name> if you only want to use composer, this command is mandatory since it creates the directories you want.
See the documentation
I don't think you can.
Create a new laravel project or clone an old project from git. Then replace/update the composer.json, then run composer update, if its a new project or composer install, if you cloned a repo
I didn't find solution for this, maybe it's impossible.
So, i just create my package and manually copy my custom composer.json to project.

setting up composer installed in another project folder for a new project folder

I wish to start a new symfony project,I want to use composer for the added advantages, but am having using the installed composer in my new project folder. The composer already installed came with Acquia dev desktop. when I run 'php composer.phar' in my new project folder I get this error "Could not open input file: composer.phar"
Double check where your composer.phar file is located.
If it has been installed into your old project's folder, simply copy it to the new folder.
If it has been installed globally (i.e: it is not in your old project's folder), then make sure you are using the right command, you might need to simply do composer install instead of php composer.phar

PHP, Composer, PHP dependency manager

I am starting a new PHP project, and I wanted to pull some php components such as "nesbot/carbon" using composer. But when I create a composer.json file and try to run composer install command, it downloads other files from my previous projects that I don's want.
Even when I try to run "composer install" with out having a composer.json file in an empty folder, it downloads some previous dependencies from caches. I didn't get that from where it's reading composer.json. Am stuck in the middle of project.
How can I create a fresh project with composer?
To create a fresh project with composer, run
$ composer init
in the root directory of that project.
For reference, see https://getcomposer.org/doc/03-cli.md#init.

Installing laravel on existing project

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.
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.
Thanks.
Go to your www folder
cd /var/www
Git clone your application (not that here the directory must not exist):
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
Or execute composer install (if you are in a production environment)
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.

fuelphp Composer is not installed. Please run "php composer.phar update" in the root to install Composer

I am trying to install fuelphp.
And getting the error as
Composer is not installed. Please run "php composer.phar update" in the root to install Composer
In my xampp/php directory I run a command
php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"
But once i run php composer.phar install composer could not find a composer.json in e:\xampp\php
How can i resolve and run fuelphp successfully can anyone help.
As of 1.7.1, we no longer supply the composer.phar file in the zip. It only has a limited shelf life (30 days before it starts complaining).
Instead we suggest you install composer yourself, either locally (specific for this fuelphp installation) or globally so you only have to install it once for all your projects.
Composer is a tool for dependency management in PHP, like npm for Node.js, bundler for ruby, and others.
It reads a file called composer.json with the dependent libraries your project needs and, finally, installs (downloads) them for you.
Fuelphp can be installed using composer, but there are several packages.
So, you need to create the composer.json with all needed fuelphp packages. Open notepad, save a file with the name composer.json (be sure to save it with ".json" extension) and put this content:
{
"require": {
"fuelphp/upload": "2.0.1",
"fuelphp/event": "0.2.1",
(...)
}
}
Note you need to insert at "(...)" the others fuelphp packages and the needed versions. You can check them all at https://packagist.org/ (type fuelphp at search). Packagist is the main Composer repository.
More information about Composer at this link.
Let me know if you need more information about it.
If you are running FuelPHP 1.7, the download comes with all Composer files you need. You need to run php composer.phar install in the root directory of FuelPHP (the same directory that contains the public folder and the fuel folder.
As long as you have v1.7 (I'm not sure if earlier versions contain the files), that directory will contain composer.json and composer.phar.
In folder fuelphp-1.7 (latest), there are two files: composer.phar and composer.json you need to cd into that folder and run:
php composer.phar install
If you don't have php in your path, you should do something like:
e:\xampp\bin\php\php5.4.16\php.exe composer.phar install
Use the full path to your php.exe. Remember your current working directory should be fuelphp folder where composer.phar and composer.json are.

Categories