How can I update Lumen via composer? - queue

I'm developping a web app using Lumen. I followed the instructions from the doc, installing laravel/lumen-installer via Composer, then doing lumen new myApp to get it properly installed (it was in April 2015).
While working on queues, the method "onQueue" was (and still is) not found... I presume I have an old version of the package "Illuminate/queue" (or what else?). Checking on packagist, Lumen is now in v5.1.5 (https://packagist.org/packages/laravel/lumen-framework) and the one I'm using is v5.0.4. So I did an update with composer :
composer update laravel/lumen-framework
But I get the v5.0.10, not the 5.1.4. Why so?
I checked that issue: https://github.com/dingo/api/issues/447 but in my composer.json, I have:
"config": {
"preferred-install": "dist"
}
So what is the problem? How can I get the last version of Lumen? Moreover, how can I get the onQueue method (updating only the package "Illuminate/queue")?
Thanks in advance
UPDATE, as asked in comments below, this is my initial composer.json (just not to miss anything):
{
"require": {
"laravel/lumen-installer": "~1.0"
}
}
and myApp composer.json:
{
"name": "laravel/lumen",
"description": "The Laravel Lumen Framework.",
"keywords": ["framework", "laravel", "lumen"],
"license": "MIT",
"type": "project",
"require": {
"laravel/lumen-framework": "5.0.*",
"vlucas/phpdotenv": "~1.0",
"illuminate/mail": "~5.0",
"imagine/imagine": "^0.6.2",
"league/csv": "^7.1",
"gregwar/captcha": "^1.1",
"neitanod/forceutf8": "^1.4",
"predis/predis": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"autoload": {
"psr-4": {
"App\\": "app/",
}
},
"autoload-dev": {
"classmap": [
"tests/"
]
},
"config": {
"preferred-install": "dist"
}
}

You have to update your composer.json
"require": {
"php": ">=5.5.9",
"laravel/lumen-framework": "5.1.*",
"vlucas/phpdotenv": "~1.0"
},

Related

I have plugin built in craft cms3, I want to use same plugin in craft cms4

I have simply copy and paste plugin( plugin name is websitetoolbox) folder to craft cms4's vendor folder. And modify root composer.json like below.
{
"require": {
"craftcms/cms": "^4.2.0.2",
"swishdigital/template-selector": "^1.0",
"vlucas/phpdotenv": "^5.4.0",
"websitetoolbox/websitetoolboxforum": "1.4.0"
},
"require-dev": {
"yiisoft/yii2-shell": "^2.0.3"
},
"autoload": {
"psr-4": {
"modules\\": "modules/"
}
},
"config": {
"allow-plugins": {
"craftcms/plugin-installer": true,
"yiisoft/yii2-composer": true
},
"sort-packages": true,
"optimize-autoloader": true,
"platform": {
"php": "8.0.2"
}
},
"scripts": {
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
]
},
"minimum-stability": "dev",
"prefer-stable": true
}
When I run command composer update it gives below error
Problem 1
- Root composer.json requires websitetoolbox/websitetoolboxforum 1.4.0, found websitetoolbox/websitetoolboxforum[dev-master, 1.0.0, 1.3.0] but it does not match the constraint.
The line:
"websitetoolbox/websitetoolboxforum": "1.4.0"
Should probably be:
"websitetoolbox/websitetoolboxforum": "1.3.0"
I'm no expert on semantic versioning, but it seems a bit odd that you have a higher version number? Could it be a typo on your end? Cause if another dependency requires this version you might be in trouble.

Add github repository to my composer project

I like to create a new composer project. I will include code, that is not on packagist. It is a github repository. Concretely I like to include this release.
https://github.com/joomla/joomla-cms/releases/tag/4.0.0-alpha12
I expected with this composer.json to fetch the release 4.0.0-alpha12:
{
"name": "vendor/my_joomla_website",
"description": "Testing to install joomla with extensions via composer",
"type": "project",
"license": "GNU",
"authors": [
{
"name": "vendor",
"email": "myemail"
}
],
"repositories": [
{
"type": "git",
"url": "https://github.com/joomla/joomla-cms.git"
}
],
"require": {
"joomla/joomla-cms": "dev-4.0-dev#4.0.0-alpha12"
}
}
But the command comoser install did not run to the end. This is my message
composer install
Loading composer repositories with package information
[Symfony\Component\Process\Exception\ProcessTimedOutException]
The process "git clone --mirror 'https://github.com/joomla/joomla-cms.git' '/home/astrid/.composer/cache/vcs/htt
ps---github.com-joomla-joomla-cms.git/'" exceeded the timeout of 300 seconds.
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...
In the end I have a vendor directory in my project folder. The content of the github repository is not there.
What do I have to do if I want to add code - hosted on github - to my Composer project?
Update
I just changed my composer.json to
{
"name": "astrid/my_joomla_website",
"description": "Testing to install joomla with extensions via composer",
"type": "project",
"license": "GNU",
"authors": [
{
"name": "vendor",
"email": "myemail"
}
],
"repositories": [
{
"type": "package",
"package": {
"name": "joomla/joomla-cms",
"version": "4.0.0-alpha12",
"source": {
"type": "git",
"url": "git://github.com/joomla/joomla-cms.git",
"reference": "4.0-dev"
},
"dist": {
"url": "https://github.com/joomla/joomla-cms/releases/download/4.0.0-alpha12/Joomla_4.0.0-alpha12-Alpha-Full_Package.zip",
"type": "zip"
}
}
}
],
"require": {
"joomla/joomla-cms": "dev-4.0-dev#4.0.0-alpha12"
}
}
Now I get this error.
composer install
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 joomla/joomla-cms dev-4.0-dev#4.0.0-alpha12 exists as joomla/joomla-cms[4.0.0-alpha12] but these are rejected by your constraint.
What am I doing wrong? I haven't assigned any dependencies or restrictions yet.
I'm not sure what exactly causes your "rejected by your constraint" exception, but I'm guessing it's because you're using the branch#ref version requirement which the docs say isn't actively supported. I think you could rather just use the 4.0.0-alpha12 tag since a tag isn't tied to a branch.
To fix your first issue, change your repository type to vcs (or github). Composer will detect the the repository is a Github repository and will then use the Github API to fetch the correct version of the package. The joomla-cms repository looks really big so it will probably take longer than the allowed 300 seconds to clone.
"repositories": [
{
"type": "vcs",
"url": "https://github.com/joomla/joomla-cms.git"
}
]
For your second issue, set your version to 4.0.0-alpha12:
"require": {
"joomla/joomla-cms": "4.0.0-alpha12"
}
The 4.0.0-alpha12 version of joomla-cms requires a dev version of joomla/application (joomla/application[2.0.x-dev]) so you would have to set your package's minimum stability to dev:
"minimum-stability": "dev",

Mopa Bootstrap bundle failing to install

I get this error while trying to install the Mopa bootstrap bundle through command line:
"C:\ProgramData\ComposerSetup\bin\composer.bat" require
mopa/bootstrap-bundle ^3.0
Error:
installation failed reverting ./composer.json to its original content
mopa
require [--dev] [--prefer-source] [--prefer-dist] [--no-progress]
[--no-suggest] [--no-update] [--no-scripts] [--update-no-dev]
[--update-with-dependencies] [--ignore-platform-reqs]
[--prefer-stable] [--prefer-lowest] [--sort-packages]
[-o|--optimize-autoloader] [-a|--classmap-authoritative]
[--apcu-autoloader] [--] []...
Im lost since I`m not getting any explanation of what failed.
So listen here, I have a solution for you. As I see that you are working with composer I'll teach you how to do it.
First you must change your "composer.json" file in your project, adding in "require" section:
"require": {
...
"mopa/bootstrap-bundle": "*",
"twbs/bootstrap": "*",
"knplabs/knp-menu-bundle": "*"
}
(NOTE: "knplabs/knp-menu-bundle": "*" is recommended to put as well when you use twbs).
And then add this repository in the json:
"repositories": [
{
"type": "package",
"package": {
"version": "2.2.1",
"name": "twitter/bootstrap",
"source": {
"url": "https://github.com/twitter/bootstrap.git",
"type": "git",
"reference": "master"
},
"dist": {
"url": "https://github.com/twitter/bootstrap/zipball/master",
"type": "zip"
}
}
}
]
Save and finally, you should execute your composer update(dev) command.
Hope it works!

Could not find package * at any version for your minimum-stability (stable). Check the package spelling or your min imum-stability

I have pushed my project to this address:
https://github.com/mojtabagithub/jdf-library.
But when I run this:
composer require rayvarzshiraz/jdf .
which is it's command to require, I get this error:
Could not find package rayvarzshiraz/jdf at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability.
This is my composer.json file :
{
"name": "rayvarzshiraz/jdf",
"minimum-stability": "stable",
"description": "A module for jdf persian calender library",
"keywords": [
"jdf",
"persian",
"calender",
"symfony"
],
"type": "library",
"authors": [
{
"name": "Mojtaba Dehdari",
"email": "mojtabadehdari#gmail.com",
"homepage": "http://jdf.scr.ir/"
}
],
"support": {
"email": "mojtabadehdari#gmail.com"
},
"require": {
},
"autoload": {
"files": ["lib/autoload.php"]
}
}
You must create a release in your GitHub repository.
For it, create a tag:
git tag -tag_name-
Then send the tag:
git push origin master -tag_name-
or
Go to your github repository and click in "releases" (this link https://github.com/mojtabagithub/jdf-library/releases) and follow the instructions.
Finally, update the packlist.org package

Composer create-project always fails with the project I created

I have this project on Github and Packagist:
https://github.com/gitraffa/framework
https://packagist.org/packages/gitraffa/framework
I want to use this as a deploy app, so, when I need to start a new project I just go to the cmd and type composer create-project gitraffa/framework --prefer-distand it should automatically create the folder and inser the files. But it isn't working(I always get something saying that a stable version could not be found). Am I doing something wrong or can't this be done?
Here is my composer.json file:
{
"name": "gitraffa/framework",
"description": "A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast!",
"homepage": "http://rafaelmsantos.com/",
"license": "GPL-3.0",
"authors": [
{
"name": "Rafael Santos",
"email": "dev.rafael#mail.com",
"homepage": "http://rafaelmsantos.com"
}
],
"require": {
"php": ">=5.3.6",
"psr/log": "~1.0"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/gitraffa/framework"
}
],
"extra": {
"branch-alias": {
"dev-master": "1.0.0"
}
}
}
Composer by default installs only tagged versions (last stable that meets condition).
The error message can be fixed by:
using #dev tag, like: composer create-project gitraffa/framework:#dev --prefer-dist
tagging your package