I have a Symfony 4 project and am trying to install this package for working with AWS DynamoDB.
When I run composer require oasis/dynamodb-odm I get an error saying oasis/dynamodb-odm v0.5.3 requires symfony/console ^3.2 -> no matching package found. Attempting to run composer require symfony/console:^3.2 also results in the "Could not find package..." error.
As I am using Symfony 4, composer commands are intercepted by Symfony Flex and some extra stuff happens. Interestingly, there is a Flex recipe for symfony/console:3.3 but not 3.2 which I imagine might be the problem.
My understanding of the caret is that it should allow minor version bumps, so I wonder why console v3.3 is not installed instead.
I would like to use this package, and there aren't many DynamoDB PHP offerings out there, so how can I resolve this issue?
if you checkout the composer.json file of the package, you can see the following
"require" : {
"php" : ">=5.6",
"doctrine/annotations": "^1.4",
"oasis/aws-wrappers" : "^2.10",
"oasis/logging" : "^1.0",
"doctrine/common" : "^2.7",
"symfony/console" : "^3.2",
"symfony/finder" : "^3.2"
},
meaning it is compatible with symfony3 only.
Probably you can fork the repo and try changing the version numbers and test it. If it works you can install it.
Related
I have a Project https://github.com/javedbaloch4/Laravel-Booking developed in Laravel 5.6 now I want to upgrade it to Laravel 6. What are the steps can I directly update to 6 or first goto 5.7, 5.8 and then.
Please can guide the steps here for a quickly upgrade Thanks.
Step 1 : Remove the followings from your composer.json file
"laravelcollective/html": "^5.4.0",
"yajra/laravel-datatables-oracle": "^8.4"
Step 2 : Replace this line
"laravel/framework": "5.6.*",
To this
"laravel/framework": "^6.0",
Step 3 : Run Following commands in order
composer require laravel/helpers
composer require laravelcollective/html
composer require yajra/laravel-datatables-oracle
composer require yajra/laravel-datatables-buttons
composer require yajra/laravel-datatables-html
composer require yajra/laravel-datatables-fractal
composer require yajra/laravel-datatables-editor
composer update
composer dumpa
Key Point to notice and understand is whenever you want to upgrade
make sure all the packages you're using have compatibility with correct versions of laravel and php. Check and follow the repo. on git to get notified if any new upgrades are there.
That's It, You're Good to go.
The official framework documentation tells you exactly how to upgrade:
https://laravel.com/docs/5.7/upgrade
https://laravel.com/docs/5.8/upgrade
https://laravel.com/docs/6.x/upgrade
https://laravel.com/docs/7.x/upgrade
You can also use https://laravelshift.com if you need any automatized solution.
When I use composer to install packages in my project I am only able to do so if I update my json file manually.
For example, if I run the following command in Git-Bash in my project directory (which contains my composer.phar and composer.json file):
php composer.phar require php-di/slim-bridge
It returns the following error:
[Invalid Argument Exception]
Could not find package
php-di\slim-bridge at any version for your minimum-stability (stable).
Check the package spelling or your minimum stability.
However, if i were to just update my json file to the following (example I've provided contains multiple packages I am using in my project):
{
"require": {
"slim/slim": "^3.0",
"slim/twig-view": "^2.1",
"illuminate/database": "^5.2",
"respect/validation": "^1.0",
"slim/csrf": "^0.6",
"slim/flash": "^0.1",
"phpmailer/phpmailer": "^5.2",
"php-di/slim-bridge":"^1.0"
},
"autoload":{
"psr-4": {
"App\\": "app"
}
}
}
... And I run the command: $ php.composer.phar update
Everything installs to project correctly.
What is going on that I am not able to install packages using the require method thus making me resort to manually updating my json file each time?
Since I am using windows, I used the windows installer for composer rather than install through command line and I got this working correctly. Much much easier now since I don't have to update my JSON files manually.
recently I've started one project and want to use elasticsearch. But when I want to install guzzle for PHP via composer, I get folowing error. I have no idea what is this error.
My composer required packages are:
"require":{
"yiisoft/yii":"1.1.14",
"2amigos/yiiwheels":"1.0.3",
"clevertech/yii-booster": "4.0.1",
"drmabuse/yii-bootstrap-3-module": "dev-master",
"guzzle/guzzle": "3.9.0",
"elasticsearch/elasticsearch": "1.2.2"
},
my PHP Version 5.4.7
my composer.json file
I had no problem installing all the packages from your requirements in one go.
If the problem persists, try to delete the vendor folder and the composer.lock file and run composer update again.
I downloaded and setup an Sonata's Sonata-Sandbox Bundle for Symfony2. I'm using Symfony 2.2.2. It's a good package and contains mostly used packages installed.
After installation I decided not to use SonataPageBundle that's included in package because it overrides all my Bundle's but unable to remove it.
I tried to remove it from composer.json and tried a php composer.phar update but no luck, update is always failing because of the dependency other libraries.
Actually, I need SonataAdminBundle with Media library on any version of Symfony 2.x. I found other solutions to install Symfony 2 + SonataAdminBundle + etc but they are also failing on different version support in composer.json and could't make a successful installation manually.
I'm on Mac 10.8 and BitNapi MAMP Stack 5.4.15-0 with PHP 5.3
Are there any better ways to install these extensions to Symfony 2?
Yes, you can use composer to install only the Sonata bundles you need. Here's mine, which is about as short as it gets for Sonata using Doctrine:
"require": {
"sonata-project/admin-bundle": "dev-master",
"sonata-project/doctrine-orm-admin-bundle": "dev-master",
"sonata-project/user-bundle": "dev-master",
"sonata-project/media-bundle": "dev-master"
}
If you haven't actually started coding anything, you might want to start a new project because removing PageBundle is slightly tedious and reinstalling using this guide is simple and basically three simple steps:
Install composer:
curl -s https://getcomposer.org/installer | php
Download Symfony2:
php composer.phar create-project symfony/framework-standard-edition /path/to/webroot/Symfony 2.3.0
Then you can add the bundles you need in composer.json and run
php composer.phar update
I need to install Zend_XmlRpc module into my Symfony 2.1 application.
I tried the obvious way using composer.json dependencies:
"require": {
...
"zendframework/zend-xmlrpc": "dev-master"
},
I got the following problems:
- Installation request for zendframework/zend-xmlrpc dev-master -> satisfiable by zendframework/zend-xmlrpc dev-master.
- zendframework/zend-xmlrpc dev-master requires zendframework/zend-http dev-master -> no matching package found.
I'have added the package requirements from the https://packagist.org/packages/zendframework/zend-xmlrpc
"zendframework/zend-http": "dev-master",
"zendframework/zend-math": "dev-master",
"zendframework/zend-server": "dev-master",
"zendframework/zend-stdlib": "dev-master",
"zendframework/zend-xmlrpc": "dev-master"
But now I've got more problems as each of this package has it's own requirements.
My issue is that I have browsed all these requirements and in the end I am ending with installing the "whole" framework.
I get the http package, the loader package, event manager, which I am pretty sure symfony already got them.
Isn't there a way to integrate only the XMLRPC package and maybe bridge the functioanlity with the already existing one from Symfony components?
And if there isn't any solution, how can I force composer to auto install recursively all the required dependencies, as there are many of them, and is weird work to add them manually.
I don't see any reason for use the unstable version of the package.
Instead add
"require": {
...
"zendframework/zend-xmlrpc": "2.1.*"
},