Should I replace dependencies when upgrading Laravel (e.g. from 5.8 to 6)? - laravel-upgrade

I am working on upgrading Laravel from 5.8 to 6.
I have read the documentation https://laravel.com/docs/6.x/upgrade and many similar (mostly summary of documentation) online.
I have updated required versions for the packages that exist both on 5.8 and 6 installation:
"require": {
"php": "^7.2.5",
"fideloper/proxy": "^4.4",
"laravel/framework": "^6.20",
"laravel/tinker": "^2.5"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fakerphp/faker": "^1.9.1",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^8.5.8"
},
This is ok but these two packages don't exist in Laravel 6 composer.json
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
While there is one new package
"facade/ignition": "^1.16.15",
So I think, what I should do is to erase two packages in the old version and add the package in the new version, right?
Should I always do like this, I mean when I'm upgrading from 6 to 7 or 7 to 8 also?
Is it possible that I have any problem deleting packages in the previous versions?

Related

How to Fix Cakephp 4 Composer Install Error

Having issues installing all packages for cakephp 4.0 via Composer. Running a fresh wamp server install on Windows with PHP 7.4.0
Here is composer output. Using the command found in the cakephp docs.
www/> composer create-project --prefer-dist cakephp/app:^4.0 myapp
Installing cakephp/app (4.0.0)
- Installing cakephp/app (4.0.0): Loading from cache
Created project in kollectit
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package cakephp/bake ^4.0 exists as cakephp/bake[0.1.0, 0.1.10, 1.0.0, 1.0.1, 1.0.10, 1.0.11, 1.0.12, 1.0.13, 1.0.14, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.0.9, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.10.0, 1.10.1, 1.11.0, 1.11.1, 1.11.2, 1.12.0, 1.2.0, 1.2.1, 1.2.10, 1.2.11, 1.2.12, 1.2.13, 1.2.14, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.2.6, 1.2.7, 1.2.8, 1.2.9, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.5.6, 1.5.7, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.8.0, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.9.5, 1.9.6, 1.x-dev, 2.0.0, 2.0.1, 2.0.2, 2.0.3, dev-3.next, dev-dereuromark-patch-1, dev-fix-old-alias, dev-master, dev-twigview-5] but these are rejected by your constraint.
Problem 2
- Installation request for cakephp/migrations 3.0.0-beta1 -> satisfiable by cakephp/migrations[3.0.0-beta1].
- cakephp/migrations 3.0.0-beta1 requires robmorgan/phinx 0.11.x-dev -> no matching package found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
- It's a private package and you forgot to add a custom repository to find it
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
The base cakephp installation is there in the /myapp folder, but wondering on the errors and if they are needed (if so how to resolve? )
Here is the composer.json that is created:
{
"name": "cakephp/app",
"description": "CakePHP skeleton app",
"homepage": "https://cakephp.org",
"type": "project",
"license": "MIT",
"require": {
"php": ">=7.2",
"cakephp/cakephp": "^4.0",
"cakephp/migrations": "3.0.0-beta1",
"cakephp/plugin-installer": "^1.0",
"mobiledetect/mobiledetectlib": "2.*"
},
"require-dev": {
"cakephp/bake": "^4.0",
"cakephp/cakephp-codesniffer": "dev-next",
"cakephp/debug_kit": "^4.0",
"josegonzalez/dotenv": "3.*",
"phpunit/phpunit": "^8.0",
"psy/psysh": "#stable"
},
"suggest": {
"markstory/asset_compress": "An asset compression plugin which provides file concatenation and a flexible filter system for preprocessing and minification.",
"dereuromark/cakephp-ide-helper": "After baking your code, this keeps your annotations in sync with the code evolving from there on for maximum IDE and PHPStan/Psalm compatibility."
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Test\\": "tests/",
"Cake\\Test\\": "vendor/cakephp/cakephp/tests/"
}
},
"scripts": {
"post-install-cmd": "App\\Console\\Installer::postInstall",
"post-create-project-cmd": "App\\Console\\Installer::postInstall",
"post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump",
"check": [
"#test",
"#cs-check"
],
"cs-check": "phpcs --colors -p --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/",
"cs-fix": "phpcbf --colors --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/",
"stan": "phpstan analyse src/",
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan-shim:^0.11 && mv composer.backup composer.json",
"test": "phpunit --colors=always"
},
"prefer-stable": true,
"config": {
"sort-packages": true
},
"minimum-stability": "dev"
}
Thanks!
You need to install the latest app template (4.0.2 currently), there have been some fixes around this.
The problem is that you are using ^ on the Windows command line, where the caret character is an escape character, ie it's not being passed to composer, which will only receive cakephp/app:4.0, which means that it will install 4.0.0.
Simple fix, enclose the package argument in double quotes:
composer create-project --prefer-dist "cakephp/app:^4.0" myapp
or do not specify a version constraint at all, which will automatically give you the latest stable version:
composer create-project --prefer-dist cakephp/app myapp

awsmobile configure -> Error: The header content contains invalid characters

Followed below steps:
I have created IAM user, where that user is attached to a Group and that Group has a policy set as AdministratorAccess.
I have configured awsmobile, using awsmobile configure, pasted creds from IAM user created above. Changed the region to us-east-2
While executing awsmobile init, I'm getting an error as below that contains us-east-1 as a region, but why.
backend awsmobile project creation error
{ NetworkingError: The header content contains invalid characters
at validateHeader (_http_outgoing.js:494:11)
at ClientRequest.setHeader (_http_outgoing.js:498:3)
at new ClientRequest (_http_client.js:173:14)
at Object.request (http.js:38:10)
at Object.request (https.js:239:15)
at features.constructor.handleRequest (C:\Users\manus\AppData\Roaming\npm\node_modules\awsmobile-cli\node_modules\aws-sdk\lib\http\node.js:42:23)
at executeSend (C:\Users\manus\AppData\Roaming\npm\node_modules\awsmobile-cli\node_modules\aws-sdk\lib\event_listeners.js:304:29)
at Request.SEND (C:\Users\manus\AppData\Roaming\npm\node_modules\awsmobile-cli\node_modules\aws-sdk\lib\event_listeners.js:318:9)
at Request.callListeners (C:\Users\manus\AppData\Roaming\npm\node_modules\awsmobile-cli\node_modules\aws-sdk\lib\sequential_executor.js:101:18)
at Request.emit (C:\Users\manus\AppData\Roaming\npm\node_modules\awsmobile-cli\node_modules\aws-sdk\lib\sequential_executor.js:77:10)
message: 'The header content contains invalid characters',
code: 'NetworkingError',
region: 'us-east-1',
hostname: 'mobile.us-east-1.amazonaws.com',
retryable: true,
time: 2018-04-28T15:26:56.753Z
Below is package.json file:
"dependencies": {
"amazon-cognito-identity-js": "^2.0.3",
"aws-amplify": "^0.3.3",
"aws-amplify-react": "^0.1.43",
"aws-sdk": "^2.228.1",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-scripts": "1.1.4"
},
Node.js version: 8.11.1
awsmobile version: 1.1.1
npm version: 6.0.0
yarn version: 1.6.0
OS: Windows 10 VSCode: 1.22.2
Github Issue
It's working fine now.
I disabled firewall and copied creds using chrome developer tool and it worked. Then I re-enabled the firewall and tried again and it still worked. I thought problem was that I was copying the creds from AWS console itself, but then I tried to create a new user and copied from AWS console instead of chrome developer tool, and it also worked i.e everything is working now.
I also tried to create a new project by following https://github.com/aws-samples/aws-mobile-react-sample#getstarted and it also went well.
So, I can't recreate it now. Not sure what was the issue.

Liferay npm-react-portlet reference error, module is not defined

So, I am developing React portlet for Liferay 7.0 CE. I have used blade command ( straight from the Liferay react template)
blade create -t npm-react-portlet -p fi.liferay.react.portlet -c ReactMain TestProject
Blade creates project as it should. After creation I changed to newly created project and ran
./gradlew build --stacktrace
First time build prints
npm WARN deprecated babel-preset-es2015#6.24.1: 🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
And after that
Execution failed for task ':npmRunBuild'. > Process command '<pathToProject>/build/node/bin/node'' finished with non-zero exit value 1
-> Build failed.
When running again gradle build, build passes
When deploying to Liferay portal, browser console prints
ReferenceError: module is not defined[Learn More]
combo:1:1
Error: Load timeout for modules: TestProject#1.0.0
Stack trace:
require/</</s<#http://localhost:8080/o/frontend-js-web/everything.jsp?browserId=firefox&themeId=classic_WAR_classictheme&colorSchemeId=01&minifierType=js&minifierBundleId=javascript.everything.files&languageId=en_US&b=7004&t=1521557570840:288:322
I am using npm version 5.6.0 and Node version 9.8.0 . Blade CLI version is 2.3.1.201711201552
Operating system is MacOs High Sierra Version 10.13.3
I have tried with new portal and with Google Chrome and Mozilla firefox
It caused by the upgrade of liferay npm build tools.
It will be fixed after the new release of blade cli.
And you can also fix it by change your package.json file like the following:
{
"dependencies": {
"react": "15.6.2",
"react-dom": "15.6.2"
},
"devDependencies": {
"babel-cli": "6.26.0",
"babel-preset-es2015": "6.24.1",
"babel-preset-liferay-project": "1.6.1",
"babel-preset-react": "6.24.1",
"liferay-npm-bundler": "1.6.1",
"liferay-npm-bundler-preset-react": "1.6.1"
},
"main": "js/index.js",
"name": "npm-react-portlet70",
"scripts": {
"build": "babel --source-maps -d build/resources/main/META-INF/resources src/main/resources/META-INF/resources && liferay-npm-bundler"
},
"version": "1.0.0"
}
Hope that can fix your problem.

How do i install fos-user-bundle "#2.0" alongside with Sonata-user-bundle?

I'm new to symfony framework
I installed FOSUserBundle "#2.0" and SonataAdminBundle
they are both working fine
now i wanted to install SonataUserBundle to manage my users
but in the downloading process [via composer] he said that SonataUserBundle is only compatible with FOSUserBundle "*1.3"
what SonataUserBundle accomplish ?
How can i install it with fos-user-bundle "#2.0"
For now SonataUserBundle doesn't support FOSUserBundle "2.0".
But there is alternative brunch - add_support_for_fos_user2.
You can plug it by this line:
composer require sonata-project/user-bundle dev-add_support_for_fos_user2
NOTE:
This bundle requires PHP >= 7.0 version.
Point it out in composer.json file (for example v. 7.1.0):
"config": {
"platform": {
"php": "7.1.0"
}
},

Sonata User Bundle + Symfony 3.x

I use Symfony 3.0.6, Sontata Admin Bundle 3.0.0 and the Doctrine ORM Admin Bundle on dev-master. The user bundle doesnt work even with dev-master. Is there a solution for Symfony 3.x yet?
Your requirements could not be resolved to an installable set of
packages.
Problem 1
- Conclusion: remove symfony/symfony v3.0.6
- Conclusion: don't install symfony/symfony v3.0.6
- Conclusion: don't install symfony/symfony v3.0.5
- Conclusion: don't install symfony/symfony v3.0.4
- Conclusion: don't install symfony/symfony v3.0.3
- Installation request for sonata-project/user-bundle dev-master ->
satisfiable by sonata-project/user-bundle[dev-master].
- Conclusion: don't install symfony/symfony v3.0.2
- Conclusion: don't install symfony/symfony v3.0.1
- sonata-project/user-bundle dev-master requires symfony/form ^2.3 ->
satisfiable by symfony/form[.....
The SonataUserBundle just released a 3.0.0 version 3 days ago, but does not seem to be compatible with SF3 yet, given the composer.json file:
{
"name": "sonata-project/user-bundle",
"require": {
"php": "^5.3 || ^7.0",
"symfony/http-foundation": "^2.3",
"symfony/form": "^2.3",
"symfony/security": "^2.3",
"symfony/console": "^2.3",
},
[...]
}
I am afraid we will have to wait a little bit longer.
Some issues were posted about it on the official repository:
https://github.com/sonata-project/SonataUserBundle/issues/724
The author's answer:
SF 3.0 is not supported because FOSUser 1.x does not support it.
FOSUser 2.x is not stable and is not supported by our bundle right now.
For the complete story, there were plans to release a SF3 compatible version of the FOSUserBundle on december 2015, but no news about that one has came since...
https://github.com/FriendsOfSymfony/FOSUserBundle/pull/1990
Let's wait & see!

Resources