Php version overridden by "config.platform.php" - magento

I'm trying to upgrade an application (magento) but I can't proceed as per the following error
your PHP version (7.0.22) overriden by "config.platform.php" version (7.0.2) doesnt satisfy requirements.
However there is not a config->platform setting in my composer.json. Viceversa, if I specify it or I add ignore-platform-reqs,s it works.
Tried to search also for the 7.0.2 or platform string over all the project but I can't see any can affect composer.
Any idea where the setting can be found?

You have to update your php version on the composer.json
"config": {
"platform": {
"php": "7.2"
}
},

Related

Laravel 6 can not found vendor class from the fast-tuned package that was released for the Laravel 5

I am trying to use Firebird 3.0 from Laravel 6.0 and I am following https://firebirdsql.org/file/documentation/reference_manuals/fbdevgd-en/html/fbdevgd30-php-Laravel-crt-project.html where the package https://github.com/sim1984/laravel-firebird is suggested. Unfortunately, this package is intended for Laravel 5.7 (or maybe it has not been published in composer repositories) that is why I received the following message while I was trying to install this package:
[InvalidArgumentException]
Could not find a matching version of package sim1984/laravel-firebird. Check the package spelling, your version con
straint and that the package is available in a stability which matches your minimum-stability (dev).
So, I had this great ide to to fine tune this package that is why I forked it as https://github.com/alex153490/laravel-firebird, I changed the version requirements in its composer.json. I hope that there is not other work to be done to ensure the compatibility with Laravel 6. After that I added this git repository in the composer.json of my Laravel project:
"repositories": [
{
"type": "package",
"package": {
"name": "alex153490/laravel-firebird",
"version": "master",
"source": {
"url": "https://github.com/alex153490/laravel-firebird.git",
"type": "git",
"reference": "master"
}
}
}
]
Now the package was installed OK. I have created one model file in my Laravel project and I added the import
use Firebird\Eloquent\Model;
as was suggested by the original description of the original package.
But now I started to receive error
Symfony\Component\Debug\Exception\FatalThrowableError
Class 'Firebird\Eloquent\Model' not found
while trying to call this model class from the simple rest API controller of my project.
Why is this class not found error - the package was installed without error, the package sits inside the vendor folder of my project and all seems to be OK. I have checked the possible issues from the checklist https://dev.to/dechamp/php---how-to-fix-class--not-found-error-1gp9 , including I regenerated the autoload file for my project, but of no help.
What did I do wrong? Why it is so hard to make class visible from my package inside the vendor directory?
p.s. when I tried to use suggested Laravel-Firebird packages for Laravel 6 (https://packagist.org/packages/harrygulliford/laravel-firebird or https://github.com/KKSzymanowski/laravel-6-firebird) I always got the exception event for the most basic select statement:
Illuminate\Database\QueryException
SQLSTATE[HY000]: General error: -901 Dynamic SQL Error SQL error code = -901 feature is not supported (SQL: select * from "MY_TABLE")
It seems to me that the authors of the package has just provided data for the Firebird-specific grammar (includind the statements for the system data), but their ignored that Firebird can have some features missing for use from Laravel.

What file contains the Laravel version info?

I'm looking at cloning a project from Github, but the readme.md file doesn't include what version of Laravel it's built on.
How can I see what version it is, without pulling it down and running php artisan -v?
Is there a specific file in a directory that contains it? (I'm guessing it's where the artisan command looks?)
The constant VERSION in Illuminate/Foundation/Application.php tells you what version they are running.
class Application extends Container implements ApplicationContract, HttpKernelInterface
{
/**
* The Laravel framework version.
*
* #var string
*/
const VERSION = '5.6.26';
If the project is using Composer, check for the laravel/framework requirement in the require rule in composer.json.
{
"require": {
"laravel/framework": "5.6.*"
}
}

Composer only finds latest version (tag) of Gitlab hosted package

I have created a package with some annotated tags for versioning (1.0.0, 1.0.1, 1.1.0 and 2.0.0). This package lives on own hosting (so not via Packagist)
When trying to require the package, composer only finds the 2.0.0 version and fails on any other version requirement.
Composer.php file of project using package
{
"name": "projectname",
"description": "Description.",
"keywords": ["keys"],
"license": "Licence",
"type": "project",
"require": {
...
"space/package-name": "~1.0" // Also tried 1.0.0, 1.0.*, ~1.0#dev - only 2.0.0 works
}
"repositories": [
...
{
"type": "git",
"url": "git#gitlab.com:space/package-name.git" // Make sure package is found on specific hosting
}
],
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
}
On running composer show "space/package-name" I get versions: * 2.0.0. So upon update, composer produces the following error:
The requested package space/package-name ~1.0 exists as name/package-
name[2.0.0, dev-master] but these are rejected by your constraint.
It looks like composer is no able to find any other version than the latest, any way of fixing this?
Things already checked:
The package does not contain a version in the composer.json (that might conflict with the git tag)
Used tags are annotated tags and are pushed to the repo.
Updates:
Might be a Gitlab - Composer issue, see this comment.
Gitlab doesn't always provide tag info when Composer tries to read the repo.
Solution: also add version info in composer.json:
{
"name": "package/name",
"version": "1.0.0",
...
}
This will be readable by composer. Careful: Git tags must match versioning info in composer.json! (might cause errors otherwise)

Setting up alias for master branch in composer

I am trying to package a module for use with composer. I have a valid composer file and I am able to install it with composer, but only when I specify that it should use dev releases (via the "#dev" version directive or minimum stability dev). I am having trouble packaging my repo so that it is seen as a master release.
I found a composer document about aliases that seems to be made for my case, but I cant get it working. Heres the relevant portion of my composer.json:
"extra": {
"branch-alias": {
"dev-master": "1.0"
}
}
Also for reference heres the require from my main projects composer file:
"require": {
"misterglass/kohana-twig" : "1.*"
},
And the actual error from composer is:
Problem 1
- The requested package misterglass/kohana-twig 1.* could not be found.
According to some helpful people on the #composer IRC channel, aliases are just to associate different versions to each other, and not to assign stability.
In order to for composer to consider it stable, you need to add a tag, which you can do on the command line or by creating a release in github.

Install ElasticBundle in Symfony2.1

I am using Symfony 2.1 for my project. In my project elasticsearch will be used for my search engine. I found that Elastica is a greate PHP client for elasticsearch. ElasticBundle is a wrapper of Elastica for symfony2.0 . I follow the step by step offical doc https://github.com/Exercise/FOQElasticaBundle#readme . But It seems like the doc is outdated. I think it was for symfony2. I try to intergrate with symfony2.1 without success. Your help is highly appreciated.
I did like that, add line:
//composer.json
...
"require": {
...
"exercise/elastica-bundle": "dev-master",
}
...
Then I run php composer.phar update. And then add line:
//app/AppKernel.php
...
new FOQ\ElasticaBundle\FOQElasticaBundle(),
...

Resources