I am developing a website using Laravel 5.1 and i need to have a shopping cart set up, i am trying to install Omnipay for this, i have selected three gateways i will be using: Paypal, Stripe and PayU.
My require under composer.json looks like this:
"require": {
...
"ignited/laravel-omnipay": "2.*",
"omnipay/paypal": "*",
"omnipay/stripe": "*",
"omnipay/payu": "*"
},
And i am getting error on the payu part alone, this is the error:
The requested package omnipay/payu * is satisfiable by omnipay/payu[dev-master, 2.0.x-dev] but these conflict with your requirements or minimum-stability.
I read on another post that specifying "prefer-stable": true, and "minimum-stability": "dev" into the config part of the composer.json would fix the issue but its not working for me, any tips?
Solved it by adding "prefer-stable": true, "minimum-stability": "dev" under the config part of the composer.json, NOT inside it, as i stated in the post.
Like so:
...
"config": {
"preferred-install": "dist"
},
"prefer-stable": true,
"minimum-stability": "dev"
...
Related
I have forked a repository to make some changes in it. Here is my repo
https://github.com/vinsaj9/scrypt
and it has tags too. It is linked with packagist
https://packagist.org/packages/vinsaj9/scrypt
Now, I am getting following error
"The requested package vinsaj9/scrypt could not be found in any
version, there may be a typo in the package name"
when I am trying to pull it through this composer setting
{
"name": "test/test",
"description": "test",
"type": "project",
"version": "0.0.1",
"license": "OSL-3.0",
"require": {
"vinsaj9/scrypt": "*"
},
"minimum-stability": "dev",
"prefer-stable": true
}
As Hakre mentioned in his comment to my question. After uploading package to https://packagist.org/ you need to wait for some hours. In my case it was not updated even after 4 hours and reason could be that I was keep making changes in the repo, creating new releases and tags in the process of debugging my problem.
I have old 5.5 version laravel project file
when I run it , its ui not work
I think that need update . right?
I dont like laravel 8 blade template vue
How can I update to laravel 8 without losing functionality in project
here is composer file
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.0.0",
"coingate/coingate-php": "^2.0",
"fideloper/proxy": "~3.3",
"hesto/multi-auth": "^2.0",
"intervention/image": "^2.4",
"laravel/framework": "5.5.*",
"laravel/tinker": "~1.0",
"nwidart/laravel-modules": "^2.7",
"stripe/stripe-php": "^6.0"
},
"require-dev": {
"filp/whoops": "~2.0",
"fzaninotto/faker": "~1.4",
"mockery/mockery": "~1.0",
"phpunit/phpunit": "~6.0",
"symfony/thanks": "^1.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/",
"Modules\\": "Modules/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
},
"files" :["app/Http/helpers/helpers.php"]
},
"extra": {
"laravel": {
"dont-discover": [
]
}
},
"scripts": {
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
}
}
laravel new version are more complex not simple as before
I like laravel but not like frequent updating new version
their UI depend on vue.js intentionally
According to my experience I upgraded from laravel 7.2 to laravel 8
Check upgrade
You have to check all dependencies required in version 8. As I remembered in version 5 routes are in app folder but in new version routes sre in root folder so you will face many problem.
There is more different b/w laravel8 into laravel5. Even folder structure are different so.
If you developed your projects then develop from scratch.
Download a fresh laravel without any package
check dependencies and all packages mentioned in your old projects composer.json and composer.lock . Don't forget to check package.json if exists
Now mention all the packages (with upgraded version by comparing using link ) in your new projects composer.json file .
composer update
Now you have to check if your projects can run in upgraded version.
5. Copy vendor folder composer.json file and composer.lock and bootstrap folder
6. Now php artisan serve
7. If your projects running smoothly then go further
8. Copy your routes.php from app folder of old project to routes/web.php new projects
9. Copy all view from old projects to new projects
10. Copy all your models and all your controllers
11. Now add "files" :["app/Http/helpers/helpers.php"] lines in composer.json
12.now composer dump-autoload
Then run your server if runs well then your code can work on version 8 environment.
don't forgot to check all folder from app and config folder if you find any extra file just copt it p.
Now here is an problem with your admin panel or login panel if you have otp or another extra feature do it from scratch.
here is no commands to upgrade from version 5 to version 8.
I have had tried to upgrade a project from 5.6 to 8, and outcome in summary: don't bother.
Syntaxes are different (e.g., routes). Folder structure is same, and about this
'UI depend on vue.js intentionally', you can just not use those files and make new. Yes by default they are now using tailwind, but just delete the file and make your own UI, in any framework you want. Or just use blades.
As the other comment also mentioned, you're better off creating a new Laravel 8 project and then importing modules 1-by-1 and change codes if necessary. In all fairness you'll be doing the same work if you try to upgrade from 5.6 to 8 but with more hassle.
i have this in composer.json and i am trying to undersntad which file it is pulling. its tinipng magento extension code
i can understand that its requesting version greater than 1.5 and here in github i can see version 1.5.2 but github link how it is added. its not just github.com/tinify/tinify
https://github.com/tinify/tinify-php/releases/tag/1.5.2
so magento is pulling require field from some other place or some link in require field ??
"minimum-stability": "alpha",
"require": {
"php": ">=5.5.0",
"ext-curl": "*",
"ext-json": "*",
"tinify/tinify": ">=1.5"
},
i am sorry. coposer documentation is right place.
this question all answers are in https://getcomposer.org/doc/03-cli.md
got the answer
After todays update of composer dependencies (with composer update command) my Yii2 application became broken - It throws Unknown Method – yii\base\UnknownMethodException: Calling unknown method: yii\web\UrlManager::addRules()
After inspecting vendor/yiisoft/yii2/web/UrlManager.php file I found that there is no method addRule.
And the whole entire class UrlManager is different from the class in the repository.
My composer.json:
"minimum-stability": "dev",
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": "*",
"yiisoft/yii2-bootstrap": "*",
"yiisoft/yii2-swiftmailer": "*",
"yiisoft/yii2-gii": "2.0.0-beta",
"claudejanz/yii2-mygii": "*",
"kartik-v/yii2-grid": "dev-master",
"kartik-v/yii2-builder": "dev-master",
"2amigos/yii2-switch-widget": "*",
"yiisoft/yii2-jui": "*",
"DsXack/yii2-underscore": "*",
"2amigos/yii2-editable-widget": "*",
"warrence/yii2-kartikgii": "*"
},
"require-dev": {
"yiisoft/yii2-codeception": "*",
"yiisoft/yii2-debug": "*"
},
I think they have changed the way some libraries are loaded through composer.
To solve it:
Add to composer.json
"extra": {
"asset-installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
}
and run:
# php composer.phar global require "fxp/composer-asset-plugin:1.0.*#dev"
# php composer.phar update --dev
More info: Issue on Github and Issue on Github
Full credit to: #githubjeka and #SonicGD
Here is an explaination of why this happened:
I think this is again the composer dependency resolver doing unexpected things:
you require yiisoft/yii2 in your composer.json but do not have the composer asset plugin installed.
then the dependency resolver does not find packages with vendor bower-asset so it looks for other versions of yiisoft/yii2 that do not have conflict
The result is to install the beta version of yii2 to be installed
The correct solution as already mentioned is to install the composer-asset-plugin:
php composer.phar global require "fxp/composer-asset-plugin:1.0.*#dev"
It seems the update went totally wrong, since the files are different from the ones on github - several functions missing.
What i had to do to get "rid" of this error:
Copy the code from the repository in your local files:
https://github.com/yiisoft/yii2/blob/master/framework/web/UrlManager.php
https://raw.githubusercontent.com/yiisoft/yii2/master/framework/helpers/BaseHtml.php
This solved it for the moment for me.
Like ricardgf says, read this:
https://github.com/yiisoft/yii2/blob/master/docs/guide/start-installation.md
then run:
composer.phar global require "fxp/composer-asset-plugin:1.0.*#dev"
and
composer.phar update --prefer-source --no-interaction
ok I solved the problem installing yii2 in this way :
composer global require "fxp/composer-asset-plugin:1.0.*#dev"
composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic basic
Try to update your composer.json into following way:
"require": {
"yiisoft/yii2": "*"
},
in project directory, write this command-
php composer.phar update
I have been working on a project using Symfony 2.1 on my local machine. I have uploaded it to my server but when I try and install the vendor bundles using Composer, I'm getting a lot of dependency errors. Presumably this is something to do with the latest version of Symfony just being released and my composer.json file not specifying exact version numbers.
Is there any way I can quickly display the version numbers of everything on my local machine?
Here is my composer.json file (which worked fine until a few days ago):
{
"name": "symfony/framework-standard-edition",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.1.*",
"doctrine/orm": ">=2.2.3,<2.4-dev",
"doctrine/doctrine-bundle": "1.0.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.1.*",
"symfony/swiftmailer-bundle": "2.1.*",
"symfony/monolog-bundle": "2.1.*",
"sensio/distribution-bundle": "2.1.*",
"sensio/framework-extra-bundle": "2.1.*",
"sensio/generator-bundle": "2.1.*",
"jms/security-extra-bundle": "1.2.*",
"jms/di-extra-bundle": "1.1.*",
"sonata-project/admin-bundle": "*",
"sonata-project/cache-bundle": "dev-master",
"sonata-project/doctrine-orm-admin-bundle": "dev-master",
"stof/doctrine-extensions-bundle": "1.1.x-dev",
"sonata-project/user-bundle": "dev-master",
"sonata-project/easy-extends-bundle": "dev-master",
"friendsofsymfony/user-bundle": "2.0.x-dev",
"friendsofsymfony/jsrouting-bundle": "*",
"liip/imagine-bundle": "*",
"simplethings/form-extra-bundle": "dev-master",
"antimattr/google-bundle": "dev-master",
"doctrine/doctrine-fixtures-bundle": "dev-master",
"genemu/form-bundle": "2.1.*",
"behat/behat": "2.4.*#stable",
"behat/mink": "1.4.*#stable",
"behat/symfony2-extension": "*#stable",
"behat/mink-extension": "*#stable",
"behat/mink-selenium2-driver": "*#stable",
"behat/mink-browserkit-driver": "*",
"liip/functional-test-bundle": "dev-master"
},
"scripts": {
"post-install-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
},
"minimum-stability": "dev",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web"
},
"config": {
"bin-dir": "bin/"
}
}
You can run composer show -i (short for --installed).
In the latest version just use composer show.
The -i options has been deprecated.
You can also use the global instalation of composer: composer global show
To list the globally installed composer packages:
composer global show -i
List installed dependencies:
Flat: composer show -i
Tree: composer show -i -t
-i short for --installed.
-t short for --tree.
ref: https://getcomposer.org/doc/03-cli.md#show
If you only want to check version for only one, you can do
composer show -- twig/twig
Note that only installed packages are shown by default now, and installed option is now deprecated.
The behaviour of this command as been modified so you don't have to pass the -i option:
[10:19:05] coil#coil:~/workspace/api$ composer show -i
You are using the deprecated option "installed".
Only installed packages are shown by default now.
The --all option can be used to show all packages.
Ivan's answer above is good:
composer global show -i
Added info: if you get a message somewhat like:
Composer could not find a composer.json file in ~/.composer
...you might have no packages installed yet. If so, you can ignore the next part of the message containing:
... please create a composer.json file ...
...as once you install a package the message will go away.
With composer-runtime-api 2.0+ there is a new InstalledVersions class with some static methods to see things programmatically.
For example:
// To list all packages (`string[]`)
\Composer\InstalledVersions::getInstalledPackages();
// To list every details of every packages
\Composer\InstalledVersions::getAllRawData();
More information: https://getcomposer.org/doc/07-runtime.md#installed-versions
If you want to install Symfony2.2, you can see the complete change in your composer.json on the Symfony blog.
Just update your file according to that and run composer update after that. That will install all new dependencies and Symfony2.2 on your project.
If you don't want to update to Symfony2.2, but have dependency errors, you should post these, so we can help you further.
Is there a way to get it via $event->getComposer()->getRepositoryManager()->getAllPackages()