I have cloned a project written in Yii2. There are some extensions in vendor folder which I want to remove them from project. How can I do this? I am sure they are installed using composer because they are noted in composer.lock file.
If you just want to remove packages from the vendor folder you can use composer command:
composer remove package/name
If you want to remove calls to these packages in the project you need to do this manually.
You can delete the line with the name of the package from the composer.json and make in command line composer update
Related
I have a CakePHP 3.8 project hosted on github: https://github.com/paultrimor/pecunia
I can successfully clone the project, run composer install & configure app.php to have the application run.
However; the installation does not create a /bin directory, meaning that I cannot use the Console/Shell.
I am looking to install the Console on an existing CakePHP project
I receive the following message when I win composer install and `composer create-project --prefer-source``
> App\Console\Installer::postInstall
Set Folder Permissions ? (Default to Y) [Y,n]? n
Updated Security.salt value in config/app.php
> App\Console\Installer::postInstall
Set Folder Permissions ? (Default to Y) [Y,n]? n
No Security.salt placeholder to replace.
The first command replaces the "SALT" string to an actual hash in app.php; But, the second command tries to do the same thing, which it cannot.
Any pointers are appreciated. Thanks.
I think you already solved it looking at your repo, but the bin/ folder should be part of your repository. It will not be created with a composer install or composer update command.
If you create a new project using composer create-project cakephp/app --prefer-dist the bin/ executables will be placed. If you don't explicitly ignore it in .gitignore it will be available to all developers.
Step 1 : check PHP Version
php -v
Step 2: Install Composer
step 3: create a new CakePHP application using composer.
composer create-project --prefer-dist cakephp/app projectname
while installing it asking permission for folder just give yes
Set Folder Permissions ? (Default to Y) [Y,n]? Y
it will work.
I am installing external dependencies using composer update command. The following is the section of the composer.json file in c:\xampp\htdocs\myproject\vendor\laravel\framework\ directory.
"require": {
"laravelcollective/html": "~5.0",
"matriphe/imageupload": "5.1.*"
"illuminate/html": "5.0.*#dev"
},
I am getting the following results after running the composer update command:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Writing lock file
Generating autoload files
I have also tried to create another require array in the composer.json and added the packages I want to install with no success.
The composer update command could not install any unstalled dependency using the composer update command. Even composer self-update did not solve the problem.
Kindly assist me, I have been stuck here for some days now trying all I would do but without success.
I am changing the composer.json under the following directory: c:\xampp\htdocs\myproject\vendor\laravel\framework\ Is this ok?
Don't change any files inside the vendor directory, they are managed by Composer. To install further packages use the composer.json in your project's directory.
And use composer install to install new packages as composer update will update already installed packages to newer versions (if available) too.
composer self-update just updates Composer itself.
You missed column after "matriphe/imageupload": "5.1.*", try to change it:
"require": {
"laravelcollective/html": "~5.0",
"matriphe/imageupload": "5.1.*",
"illuminate/html": "5.0.*#dev"
}
I know there's another thread but it's about 0.4.2 to 0.5 and there's a quickstart for 0.5.
What I want to do is install the latest version of ghost because there are some great features in the newer versions.
Source: https://ghost.org/forum/installation/16533-resolved-upgrading-ghost-0-5-to-0-5-2-on-openshift/
Thanks fuzzmz.
Set up a new installation using: rhc app create test nodejs-0.10 mysql-5.1 --env NODE_ENV=production --from-code https://github.com/openshift-quickstart/openshift-ghost-mysql-quickstart.git
Go to URL/ghost and setup the admin user.
Download latest Ghost archive.
Extract archive.
cd to the test folder.
delete index.js and package.json.
delete the core folder.
delete the content/themes/casper folder.
copy index.js, package.json, the core and content/themes/casper folders from where you extracted the archive to the test folder (the git repo created when I created the OpenShift app).
modify the new package.json (the one in the test folder) with "main": "index.js" instead of "main": "./core/index".
git add --all.
git commit -am "update to ghost v0.5.2"
git push origin master
I went with the similar issue and solved it.
Follow this guide to update your ghost version.
Download the latest version of Ghost from Ghost.org
Extract the zip file to a temporary location
Delete existing index.js and package.json then copy new index.js and package.json files to the same directory.
Next, delete the old "core" directory completely, and then put the new core directory in its place.
For releases which include update to Casper (the default theme), delete the old content/themes/casper directory and put the new one its place.
Finally open "package.json" and change "main": "./core/index" to "main": "index"
That's the tricky part that not mentioned on the official guide. It works fine :)
Run npm install --production
Finally, Restart Ghost so that the changes take effect
I am trying to install mink/behat on windows machine using composer by following the help given on behat page. http://docs.behat.org/cookbook/behat_and_mink.html.
But when I run
php composer.phar install
then I get the error
But I have composer.json(exactly same as described in behat page) file in mentioned directory. Can someone please guide me how can I install it. Thanks
Composer installs packages on project-base. I don't think you have a PHP project inside C:\Windows\system32...
Navigate to your project by using cd (change dir) and be sure the composer.phar file is automatically loaded in every directory (see this answer).
Then create a composer.json file in which you put the things that is stated in the docs.
After that run composer install (or php composer.phar install, depends on which install method you used).
Is there a way to update just one bundle without updating every bundle in your deps file? I am currently using "php vendors install" to install all vendor bundles and am not aware of any commands that will update just one bundle at a time.
1) Just open your deps file (./deps)
2) Remove all bundles except the one you want to update and save the deps file
3) Let's run the command: php bin/vendors update
It will update the bundle.
4) Go back in your deps file and rewrite all the previous removed bundle lines !
Cheers !
Short version:
The "best way" to do this depends on your setup. If you've run "php bin/vendors update" before, then it would probably be best to remove the line for the bundle you want to update from your deps.lock file, then run "php bin/vendors install" from your base symfony folder.
Long version:
I think some clarification of what the various vendor commands do is in order.
1) php bin/vendors install
This command downloads (if necessary) and installs vendor bundle source files into symfony/vendor. This command will first look at deps.lock to see what git commits/versions are listed there, then it will look at your deps file to see what versions are listed there. If no version is specified in either for a certain bundle, it will download the most recent version of the bundle code for that bundle. If a version is found, it will download and install that version of the vendor bundle code.
This command will not put anything in deps.lock.
2) php bin/vendors install --reinstall
This command does the same thing as php bin/vendors install, except it will always download the code before installing it into symfony/vendor.
This command will not put anything in deps.lock.
3) php bin/vendors update
This command will ignore deps.lock, and will download (if necessary) and install the versions of bundle code listed in the deps file into symfony/vendor.
After it is done downloading and installing code, it will put the git commit id / version of the downloaded code for each bundle into your deps.lock file. That way, when you go to run one of the install commands listed above, the version of code that is downloaded won't change unless you remove the related line from the deps.lock file or if your run the update command again.
The idea behind the deps.lock file is that it prevents you from accidentally upgrading your bundles to a more recent bug non-working version of the 3rd party bundle code. Symfony and it's bundles are under constant development, so changes (even if they're not bugs) happen pretty frequently and will break your code. You'll probably want to get your versions locked down in deps.lock as soon as possible and only update when you feel like going out of your way to do so.
Once you've locked down your bundle versions in deps.lock, you'll just need to remove the related line from your deps.lock file the run one of the install commands to update a specific bundle, like I said in the short answer above. If you then want to lock that code down to the version you just installed, you'll want to add a line to deps.lock yourself, or remove everything from deps and run php bin/vendor update like the answer above indicates.