I am looking how to upgrade the framework Symfony 2.8 to 3.4 without internet.
Can I configure the composer.json to upgrade Symfony from a local repository?
My development environment doesn't have access to internet.
If you have symfony code locally - as well as any other vendor code - you can configure composer in order to update from local source
"repositories": [
{
"type": "vcs",
"url" : "/path/to/local/sf/code"
}
],
Please remember to get rid of this as soon as you're ready to retrieve the vendor from the internet.
Related
I've just started work on a .Net 6 WPF desktop application (actually migration of a 4.x solution), and I've noticed that installing VS2022 has also installed .Net v6.0.6. (For consistency I'm also specifying this version when building the solution on our Azure DevOps server).
At some point I want to create an installer (InnoSetup) to send out to customers, and I'd like this to warn the user if the relevant .Net Desktop Runtime SDK is not installed. But which version(s) should I be looking for? Does it have to be specifically v6.0.6, or >=6.0.6, or 6.x? (and thinking further ahead, what if the PC had .Net7 or 8, but not 6 - will .Net6 apps run against these later versions?).
If it's relevant to the question, the <assemblyname>.runtimeconfig.json file looks like this:
{
"runtimeOptions": {
"tfm": "net6.0",
"frameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "6.0.0"
},
{
"name": "Microsoft.WindowsDesktop.App",
"version": "6.0.0"
}
],
"configProperties": {
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false
}
}
}
I am looking how to upgrade the framework Symfony 2.8 to 3.4 using local directory.
My development environment doesn't have access to internet.
I've followed https://getcomposer.org/doc/05-repositories.md#path
I download Symfony 3.4 and deposit it in the same directory as Synfony 2.8
Frameworks
Symfony-2.8
Symfony-3.4
Then I configured the composer.json file (symfony 2.8) like this :
"repositories": [
{
"type": "path",
"url" : "/frameworks/symfony3-4"
}
],
"require": {
"/frameworks/symfony3-4": "*"
},
When I try the update :
Composer update
I have this error :
Problem 1
- The requested package ../symfony3-4 could not be found in any version, there
may be a typo in the package name.
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.
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Do you have any suggestion to do it ?
use "symfony/symfony": "^3.0" in your require statement
I am a new developer working with ASP.NET 5 (ASP.NET Core). In VS2015 I created a new class library project targeting .NET Platform 5.4 (dotnet5.4), and added the AutoMapper NuGet package, version 4.2.0.
I am getting the following errors, basically for all the System packages:
3>C:\Users\Andrew\OneDrive\Development\Visual Studio\APT\src\Fideles.Service\project.json : .NET Platform 5.4 error NU1001: The dependency fx/Microsoft.CSharp could not be resolved.
3>C:\Users\Andrew\OneDrive\Development\Visual Studio\APT\src\Fideles.Service\project.json : .NET Platform 5.4 error NU1001: The dependency fx/System.Collections could not be resolved.
3>C:\Users\Andrew\OneDrive\Development\Visual Studio\APT\src\Fideles.Service\project.json : .NET Platform 5.4 error NU1001: The dependency fx/System.Collections.Concurrent could not be resolved.
But I think according to the NuGet package description it should be supported:
https://www.nuget.org/packages/AutoMapper/
As you can see from the screenshot these packages seem to be referenced twice; once correctly and once incorrectly with an fx/ prefix:
This is my project.json:
{
"version": "1.0.0-*",
"description": "Fideles.Services Class Library",
"authors": [ "Andrew" ],
"tags": [ "" ],
"projectUrl": "",
"licenseUrl": "",
"frameworks": {
"dotnet5.4": {
"dependencies": {
"Microsoft.CSharp": "4.0.1-beta-*",
"System.Collections": "4.0.11-beta-*",
"System.Linq": "4.0.1-beta-*",
"System.Runtime": "4.0.21-beta-*",
"System.Threading": "4.0.11-beta-*"
}
}
},
"dependencies": {
"AutoMapper": "4.2.0",
"Fideles.Common": "1.0.0-*",
"Fideles.Data": "1.0.0-*"
}
}
Any ideas? Thank you!
The issue is that dotnet5.4 isn't supported by AutoMapper 4.2.0. Depending on what you're targeting it may be possible to change dotnet5.4 to something else (dnxcore50 for example).
I have the same issue on a number of my own libraries and I'm waiting for netstandard to take care of all this.
If you don't mind interrupting your Visual Studio workflow you can get your application to build by doing the following.
Make sure you have the new dotnet CLI installed
(https://dotnet.github.io/getting-started/)
Run dotnet restore from the command line in your project folder
This sorted out the the build errors. I then deleted my lock files and ran Clean and Rebuild on the solution for good measure.
I'm trying to upgrade from Symfony 2.8 to Symfony 3, but I cannot update it from Composer.
I get this error :
hellogerard/jobby dev-master requires symfony/process ^2.7 -> satisfiable by symfony/process[v2.7.0 ... blabla bla v2.8.2]
When I look the composer.json file of this library I need, I see this :
"require": {
(...)
"symfony/process": "^2.7"
},
You can find the composer file of Jobby here : https://github.com/jobbyphp/jobby/blob/master/composer.json
The problem is that in Symfony 3, the symfony/process version is 3.0, and because of the "^2.7" on Jobby's composer.json, I cannot get it. I know that there is no backwards compatibilities problems with symfony/process, so how can I do to fix / ignore that problem ?
Regards
Create your own fork and make a pull request on the base repository.
If there is no BC-break using the requested package with symfony/process:3.0,
just change the package version from ^2.7 to ^3.0 or >=2.7 in your fork's composer.json.
EDIT
Then, tell composer to use your fork for installations, like this :
"repositories": [
{
"type": "vcs",
"url": "https://github.com/yourusername/jobby"
}
],
"require": {
"hellogerard/jobby": "dev-master"
}
See VCS Repositories documentation
I already have running project which is in Symfony 2.0.10. But now I need to upgrade it to Symfony 2.3.I know there is need to change some code to compitable with latest version.Is there any command to upgrade? Or what is the exact procedure to upgrade? Is there any document available?.
Edit:
I put symfony 2.3 composer.json file and while doing php composer.phar update I got this error.
Problem 1
- symfony/symfony v2.3.1 requires symfony/icu >=1.0,<2.0 -> no matching package found.
- symfony/symfony v2.3.0 requires symfony/icu >=1.0,<2.0 -> no matching package found.
- Installation request for symfony/symfony 2.3.* -> satisfiable by symfony/symfony[v2.3.0, v2.3.1].
Edit 2:
First I got this error:
[InvalidArgumentException]
The dist file "app/config/parameters.yml.dist" does not exist. Check your dist-file config or create it.
so I created parameters.yml.dist file.
Now I'm getting
PHP Fatal error: Class 'Symfony\Component\ClassLoader\UniversalClassLoader' not found in /var/www/git/sample/app/autoload.php on line 6
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap handling the post-update-cmd event terminated with an exception
[RuntimeException]
An error occurred when generating the bootstrap file.
Upgrade information
Read the upgrade guides in symfony/symfony github repository:
Upgrade 2.1
Upgrade 2.2
Upgrade 2.3
Upgrade 2.4
Upgrade 2.5
Upgrade 2.6
Upgrade 2.7
Upgrade 3.0
There are also changelogs in the repository:
CHANGELOG-2.2
CHANGELOG-2.3
Backup your project!
Upgrading with composer
Get composer and put the symfony 2.3 standard edition's composer.json into your project root.
Now run composer update with your project's patch as working directory.
-> You will face some exceptions due to breaking changes exceptions. Google will help resolve those :)
Personal experience
In my legacy projects the most noticeable bc break from 2.0 to 2.1 was this one related to the form-builder because I had to update every form.
Before ( 2.0 )
use Symfony\Component\Form\FormBuilder;
public function buildForm(FormBuilder $builder, array $options)
After ( 2.1+ )
use Symfony\Component\Form\FormBuilderInterface;
public function buildForm(FormBuilderInterface $builder, array $options)
Upgrading is in general simple, as you only have to update the version constraints in your composer.json according to the standard distribution and issuing
php composer.phar update
But 2.3 has some backwards compatibility breaks. So read carefully every upgrade document for necessary code changes.
from 2.0 to 2.1
from 2.1 to 2.2
from 2.2 to 2.3