CakePHP 3 composer missing files - composer-php

I updated my CakePHP 3 project via composer. I use the cake app skeleton. After update, my app gave me error messages about deprecated session helper. I checked the cakephp/cakephp github repository and in /src/Controller folder there are files like ComponentRegistry.php what I do not have in my project.
I am confused. Why composer did not sync these?

You are using the development version of CakePHP 3.1. In such version, the Session helper was deprecated. I would recommend setting your project to only work with the stable releases.

Related

How to handle installed plugins via `composer.json` during update?

I have the problem that during a Shopware 6 update (e.g. 6.4.18.0 -> 6.4.19.0) the root composer.json changes.
Since it is possible to install plugins via composer require all the required plugins and installed plugins are missing after the update.
How do i handle that? What is the best-practice for this case?
How did you install shopware in the first place? When you install shopware over the webinstaller, then you should update over that way as well and changes in the composer.json will be overwritten by an update so you have to add those changes manually again.
If you set up your project using composer you should update by pulling the latest changes and if you have manual changes in the composer.json, those changes will be merged via git.
With the new symfony flex setup all of this should not be necessary anymore and your root composer.json should not be touched anymore during updates. The flex setup will be the default setup starting with 6.5 and also the webupdater will switch the existing installations to this setup.
You can follow this guide on how to switch to the new setup.

Adding laravel to an existing project that already runs with laravel on the web

Im very new to laravel and ive a project on a server that uses laravel.
How can i download this project and run laravel to it ? I managed to run laravel but it creates a whole new folder etc.
when i tried coppying the project folder to the laravel-created folder i got an error.
Download source code except vendor casus it's extra. Install php and composer. Then use a terminal(cmd in windows) and go to your project and run composer install. Wait till downloading packages complete. For running project type php artisan serve and your project is up. If your project had migrations and I think it has actually, run php artisan migrate before running serve command. Also check .env file in the root of project and change database credentials with your own. Depending on what dbms that project uses, you should install that DBMS too. Good luck
Taking reference to your comment:
i have the source code of a project that runs on laravel. Basicaly i am asking how can i run this source code localy on my pc
Good, that you have a project that runs on Laravel. You should probably consider to move your project to a central place, maybe Github, and from there create a proper workflow for development and further deployment to your (testing, production, ...) systems.
Even if you develop alone it would be a good practice to use git and Github - no, it is not the same
To come back to your original question:
How can i download this project and run laravel to it ? I managed to run laravel but it creates a whole new folder etc.
You don't need to install a new Laravel into an existing Laravel project. Just take the existing one.

Is there a safe way to upgrade the laravel version in Production

I have a Laravel 5.4 project (web application), it's a huge product. I want to add some well known packages like error logging and debugging. Is there any simple way to update the Laravel from 5.4 to 5.5 or 5.6 without affecting the things what was already done? How can I do this?
You should never upgrade your production environment directly without testing. It would be better to set up a staging environment and test the upgrade there. If you don't have any problems there, consider upgrading the production environment.
If you want to know all changes from older versions to newer versions, check the upgrade guides in order:
https://laravel.com/docs/5.5/upgrade
https://laravel.com/docs/5.6/upgrade
https://laravel.com/docs/5.7/upgrade

Upgrading laravel from 4.2 to 5.4

I have a large project running on Laravel 4.2 and now I would like to upgrade it to the latest release (5.4)
On the upgrading guide I can see the steps to upgrade from each release to the next one, but the 4.2 to 5.0 requires a fresh install. Hence the question: should I install 5.4 (and fix problems) or 5.0 (running each upgrade)?
I'm possibily using any Laravel functionality, and have organized repositories for my own custom methods; I also need to maintain the database. I need to upgrade because I would like to use event bradcasting with Laravel Echo.
Thanks
To those looking for an answer: update directly to latest version, then fix changes along the way.
Explanation:
At first I tried to upgrade version by version; it was a pain. Every single vendor had different packages for each version and that caused issues even before correcting the code. I couldn't start fixing my code because the installation requirements of the vendors were failing at a certain point of the upgrade process.
Upgrading directly to latest version requires the correction of many things, but at least those are only related to your code. In my case I had to remove Sentry (authentication), Laravel OAuth, and some others I don't remember in favor of some native packages which I hope will be maintained properly. The upside of this approach is that once you have all the packages you need installed you can work directly on your code... which is what you have to do anyway.

Laravel 5 package development clarity

Ive been reading a few articles on the net about package development but cant quite wrap my head around the basic setup. Ive written jQuery plugins with releases and published to Bower in the passed so maybe im just not understanding the difference with Laravel.
With jQuery plugin dev I would just exclude my dev required dependancies through bower.json to prevent a person pulling in my dependancies. It seems that with Laravel u create an un-tracked Laravel framework folder and put your package into the vendor folder and track only that with Git? So basically the Laravel project sitting outside of my vendor package is just some files on my PC? Surely I would want to track which version of Laravel the package was developed on?
OR should I create a "base" Laravel repository and create another repository inside the vendor folder so make sure I know which Laravel the package was built on?
Documentation and tutorials are very vague...
Your question looks a little bit confuse. I develop packages for Laravel and the following is a regular way:
Laravel manage its dependencias via composer, take a look into composer.json to get a clue how similiar is with bower.
In order to get yout package compatible with laravel's core you need to implement some interfaces in your package. This package also can manage dependencies via composer.
A package can be created as a repository in different version controls, like Github, BitBucket, Packagist, Cartalyst, private packages repositories, etc. By default laravel pull packages from Packagist, but into composer.json file you can specify another reposository as needed.
When you trigger composer update (this is an equivalent as bower update), this dependencies manager will pull all the packages and download them automatically in vendor/ directory.
How to code your package while testing with laravel? some people do the following, including me:
Install a laravel instance just for package development purpose.
Create a new project (your package project) inside of vendor/project-name following lavavel's package requirements.
Keep working your package from this project location. By this way the changes are reflecting instantly in laravel installation.
Don't forget to commit and push

Resources