update cakephp3 with composer leads to missing dependencies - cakephp

i want to update my cakephp 3.5 to 3.6 and i used composer
composer require --update-with-dependencies "cakephp/cakephp:3.6"
but e.g. dependency 'dotenv' is missing (it is not contained in my current local installation). dotenv has also no entry in composer. Do i have to update an composer.json manually?

Related

How do I install my forked React modules into Symfony 4?

I'm trying install a React module into my Symfony 4 project. I already have the React entry point setup and running with webpack encore, and now I want to add a module to the React app.
The React module has a github and can be installed through npm, but how do I install it into Symfony? How do I deal with the webpack.config.js and package.json files in the package, since Symfony has its own for these files.
I have compared the webpack.config.js and it seems like the Symfony one can override the other one, since it already covers React entry point and babel setup. What do I do?
Another problem I have is that the original module was outdated, so I forked the project to my repository, updated it and filed a pull request. But since the PR is still pending, I wanted to install my fork for now, what do I need to do?
NPM supports installing dependencies directly from github (or other git host) https://docs.npmjs.com/cli/install so executing npm install github:<githubname>/<githubrepo>[#<commit-ish>] should work fine from the package.json directory.
The React module has a github and can be installed through npm, but how do I install it into Symfony? How do I deal with the webpack.config.js and package.json files in the package, since Symfony has its own for these files.
I'm not familiar with Symfony, does it manage your NPM dependencies after install? If so you will have to determine how to accomplish the npm install via Symfony.
Another problem I have is that the original module was outdated, so I forked the project to my repository, updated it and filed a pull request. But since the PR is still pending, I wanted to install my fork for now, what do I need to do?
As per above, just specify your git path until your PR is pulled, then update package.json to the original repo

angular directory structure not getting created in IntelliJ

I am following steps in IntelliJ to support Angular.
https://www.jetbrains.com/help/idea/2017.1/using-angular.html#install_angular_cli
In Generating an Angular application stub using Angular CLI section, I have to specify some package_name for Angular CLI field while setting up the project. What should be the value of package_name? I keep getting the following message but the angular directory structure doesn't get created.
"C:\Program Files\nodejs\node.exe" C:...\AppData\Roaming\npm\node_modules\angular-cli\bin\ng new angularIntelliJ8 --dir=.
As a forewarning, we are moving the CLI npm package to "#angular/cli" with the next release,
which will only support Node 6.9 and greater. This package will be officially deprecated
shortly after.
To disable this warning use "ng set --global warnings.packageDeprecation=false".
Directory '.' already exists.
Done
I have specified the path as C:\Users\Manu\AppData\Roaming\npm\node_modules\angular-cli
I notice that if I run ng new angularIntelliJ8 on cmd then the angular directory structure gets created. But doing where ng shows the following path for ng
>where ng
C:\..\AppData\Roaming\npm\ng
C:\..\AppData\Roaming\npm\ng.cmd
If I use above paths in Angular CLI, I get error that IntelliJ couldn't find bin/ng
Also, if I run '"C:\Program Files\nodejs\node.exe" C:\Users\Manu\AppData\Roaming\npm\node_modules\angular-cli\bin\ng new angularIntelliJ10' on cmd terminal manually (without --dir=.), the structure gets created.
Am I specifying wrong path for Angular CLI?
Please update angular-cli to the most recent version (see Updating Angular CLI for instructions). Both the package name/location and CLI interface have changed since beta 28, and IDEA 2017.1.* only supports new cli versions.
Once you have a new cli package installed, specify C:\Users\Manu\AppData\Roaming\npm\node_modules\#angular\cli as a package name in New Project wizard

How to update to the latest CakePHP 3.3.3 and bug fixes through composer

Recently I have reported a bugfix for Cakephp and the team has fixed the bug and merged it back to the cakephp repo (version 3.3.3). I wonder how to get the version of CakePhp.
In my application folder I run composer update and this is what is set into my composer.json file:
"require": {
"php": ">=5.5.9",
"cakephp/cakephp": "~3.3",
"mobiledetect/mobiledetectlib": "2.*",
"cakephp/migrations": "~1.0",
"cakephp/plugin-installer": "*",
"dereuromark/cakephp-ajax": "dev-master"
},
I can see in composer that the available versions are 3.3.1 and below. But is there any way that I can get those bug fixes from repo. Or is it fine if I downoad the file and upload it to my src/cake application folder.
Any help please
Assuming you have composer installed globally, you can update the CakePHP to the latest version by running the following in terminal when in the project folder, the same directory composer.json lives in:
composer update
If you are having trouble with updating it can sometimes be caused by composer being out of date, update it regularly with the following in terminal:
composer self-update
3.3.3 have not been releaset at this time so I guess you want to be up to date with the latest bugfixes that have not been released to a stable version
If you can't wait till 3.3.3 then the manual explains how to keep up to date with the latest changes. Just put in your composer.json:
"require": {
"cakephp/cakephp": "dev-master"
}
and run composer update
Be aware that is not recommended, as your application can break when the next major version is being released. Additionally composer does not cache development branches, so it slows down consecutive composer installs/updates.

CakePHP Resque composer install error

I have installed CakePHP via Composer with the following command
composer create-project --prefer-dist cakephp/app my_app_name
as mentioned in CakePHP documentation.
I need the kamisama/cake-resque plugin, but when i use composer require kamisama/cake-resque, I am getting the following errors
Using version ^4.1 for kamisama/cake-resque
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
> Cake\Composer\Installer\PluginInstaller::postAutoloadDump
Script Cake\Composer\Installer\PluginInstaller::postAutoloadDump
handling the post-autoload-dump event terminated with an exception
Installation failed, reverting ./composer.json to its original content.
[RuntimeException]
Unable to get primary namespace for package kamisama/cake-resque.
Ensure you have added proper 'autoload' section to your plugin's
config as stated in README on https://github.com/cakephp/plugin-installer
require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--] [<packages>]...

Uninstall one package from composer without updating everything else

I have a project that uses Composer. I want to remove a package (in my case Aspect Mock).
I remove the dependency from composer.json and delete all the vendor packages manually. Then I run php composer.phar install. It says
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
I do not want this warning, so I run php composer.phar update and it updates all my packages in composer.lock (which we have in SCM).
I do not want that either (I only want to remove one package) so instead of running composer update, I manually remove all references to the removable package in composer.lock. Composer install still gives me this warning.
How can I delete a package installed by composer without updating everything else, and without introducing warnings into my workflow?
Updating just the lock file: composer update --lock
Removing a package, deleting their files, updating the lock file all in one command without dealing with naked JSON data: composer remove vendor/package or composer remove --dev vendor/package - just the opposite of require.
composer remove vendor/package is the command you are looking for. It removes the package from composer.json as well as deleting it from the vendor folder.
You can read about its options at https://getcomposer.org/doc/03-cli.md#remove

Resources