CircleCi build failed on Yii2 application - composer-php

is the first time i use circleCi (and Yii2), and i am facing a problem related to composer:
here you can see the build
As you can see composer can't find the package for php >= 5.4.0. So the build fails.
cebe/markdown 1.0.1 requires php >=5.4.0 -> no matching package found.
what i can do here? i searched on the web without success.
Thanks and Regards

Based on a message from circleCi site:
We didn't find a circle.yml for this build. You can specify deployment or override our inferred test steps from a circle.yml checked in to your repo's root directory.
I created a circle.yml file and added the following configuration
machine:
php:
version: 5.5.11
And my composer.json looks like this (default for yii2 advanced template):
{
"name": "yiisoft/yii2-app-advanced",
"description": "Yii 2 Advanced Application Template",
"keywords": ["yii2", "framework", "advanced", "application template"],
"homepage": "http://www.yiiframework.com/",
"type": "project",
"license": "BSD-3-Clause",
"support": {
"issues": "https://github.com/yiisoft/yii2/issues?state=open",
"forum": "http://www.yiiframework.com/forum/",
"wiki": "http://www.yiiframework.com/wiki/",
"irc": "irc://irc.freenode.net/yii",
"source": "https://github.com/yiisoft/yii2"
},
"minimum-stability": "stable",
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": "*",
"yiisoft/yii2-bootstrap": "*",
"yiisoft/yii2-swiftmailer": "*"
},
"require-dev": {
"yiisoft/yii2-codeception": "*",
"yiisoft/yii2-debug": "*",
"yiisoft/yii2-gii": "*",
"yiisoft/yii2-faker": "*"
},
"config": {
"process-timeout": 1800
},
"extra": {
"asset-installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
}
}
after that, builds executed successfully
Thanks

Related

satis composer package not found

I'm trying to create custom composer packages in order use/update some custom wordpress plugins across all my projects.
I decided on using satis, following this article: https://getcomposer.org/doc/articles/handling-private-packages-with-satis.md
I've installed satis, and successfully generated the webview and deployed it. It shows the two composer packages (git repositories) that were linked with satis.
Problem
When I create a new project and include my custom composer package in my package.json, running composer update returns an error.
Error
composer update
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 namespace/test 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.
- It's a private package and you forgot to add a custom repository to find it
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
My package composer.json file:
{
"name": "name",
"type": "project",
"license": "MIT",
"description": "desc",
"authors": [],
"keywords": ["bedrock", "wp"],
"config": {
"preferred-install": "dist"
},
"repositories": [
{
"type": "composer",
"url": "https://wpackagist.org"
},
{
"type": "composer",
"url": "https://packages.namespace.tld"
}
],
"require": {
"php": ">=5.6",
"composer/installers": "^1.4",
"vlucas/phpdotenv": "^2.0.1",
"johnpbloch/wordpress": "^5.0.2",
"oscarotero/env": "^1.1.0",
"roots/wp-password-bcrypt": "1.0.0",
"roots/wp-config": "1.0.0",
"wpackagist-plugin/contact-form-7": "*",
"namespace/test": "*"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.0.2",
"roave/security-advisories": "dev-master"
},
"extra": {
"installer-paths": {
"www/app/mu-plugins/{$name}/": ["type:wordpress-muplugin"],
"www/app/plugins/{$name}/": ["type:wordpress-plugin"],
"www/app/themes/{$name}/": ["type:wordpress-theme"]
},
"wordpress-install-dir": "www/wp"
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"test": [
"phpcs"
]
}
}

phpspreadsheet composer not installing

I am running composer locally to generate the necessary files that I will then deploy separately to server. Therefore I am running:
composer require phpoffice/phpspreadsheet --ignore-platform-reqs
However, it is failing:
Problem 1
- The requested package phpoffice/phpspreadsheet No version set (parsed as 1.0.0) is satisfiable by phpoffice/phpspreadsheet[No version set (parsed as 1.0.0)] but these conflict with your requirements or minimum-stability.
I am not familiar with composer. I have tried the solution suggested here https://github.com/google/google-api-php-client/issues/971 by adding "phpoffice/phpspreadsheet":"^1.0" to the composer.json, but that didn't work. I have also tried setting the minimum stability to dev with no luck.
Can someone help?
Edit with more info***
I have PHP 7.2 installed, full .json is the same as available from https://github.com/PHPOffice/PhpSpreadsheet
Here:
{
"name": "phpoffice/phpspreadsheet",
"description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
"keywords": ["PHP", "OpenXML", "Excel", "xlsx", "xls", "ods", "gnumeric", "spreadsheet"],
"homepage": "https://github.com/PHPOffice/PhpSpreadsheet",
"type": "library",
"license": "LGPL-2.1-or-later",
"authors": [
{
"name": "Maarten Balliauw",
"homepage": "http://blog.maartenballiauw.be"
},
{
"name": "Mark Baker",
"homepage": "http://markbakeruk.net"
},
{
"name": "Franck Lefevre",
"homepage": "http://rootslabs.net"
},
{
"name": "Erik Tilt"
}
],
"scripts": {
"check": [
"php-cs-fixer fix --ansi --dry-run --diff",
"phpcs --report-width=200 --report-summary --report-full samples/ src/ tests/ --ignore=samples/Header.php --standard=PSR2 -n",
"phpunit --color=always"
],
"fix": [
"php-cs-fixer fix --ansi"
]
},
"require": {
"php": "^5.6|^7.0",
"ext-ctype": "*",
"ext-dom": "*",
"ext-gd": "*",
"ext-iconv": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-SimpleXML": "*",
"ext-xml": "*",
"ext-xmlreader": "*",
"ext-xmlwriter": "*",
"ext-zip": "*",
"ext-zlib": "*",
"psr/simple-cache": "^1.0"
},
"require-dev": {
"tecnickcom/tcpdf": "^6.2",
"squizlabs/php_codesniffer": "^2.7",
"phpunit/phpunit": "^5.7",
"dompdf/dompdf": "^0.8.0",
"mpdf/mpdf": "^7.0.0",
"jpgraph/jpgraph": "^4.0",
"friendsofphp/php-cs-fixer": "#stable"
},
"suggest": {
"mpdf/mpdf": "Option for rendering PDF with PDF Writer",
"dompdf/dompdf": "Option for rendering PDF with PDF Writer",
"tecnick.com/tcpdf": "Option for rendering PDF with PDF Writer",
"jpgraph/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers"
},
"autoload": {
"psr-4": {
"PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet"
}
},
"autoload-dev": {
"psr-4": {
"PhpOffice\\PhpSpreadsheetTests\\": "tests/PhpSpreadsheetTests"
}
}
}
OK, so this answer is for anyone else finding this as a newby to composer:
I assumed that composer would access the local files that I had already downloaded from GIT to configure everything. So I was running the composer command from in the library source directory.
This is not how it works. You need to run the composer command from within your project directory, it will pull the files over the internet and 'install' them in your project directory structure.

Loading a composer package through a Github fork

I forked a library on Github and now want to load my fork into the project without adding the forked library into packagist. I get the following error after adding the repository and require to my composer.json:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package cnizzardini/ssl-certificate 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.
Here is my full composer.json
{
"name": "cakephp/app",
"description": "CakePHP skeleton app",
"homepage": "http://cakephp.org",
"type": "project",
"license": "MIT",
"require": {
"php": ">=5.5.9",
"cakephp/cakephp": "~3.4",
"mobiledetect/mobiledetectlib": "2.*",
"cakephp/migrations": "~1.0",
"cakephp/plugin-installer": "*",
"guzzlehttp/guzzle": "^6.2",
"donatj/phpuseragentparser": "^0.7.0",
"cnizzardini/ssl-certificate": "dev-master"
},
"require-dev": {
"psy/psysh": "#stable",
"cakephp/debug_kit": "~3.2",
"cakephp/bake": "~1.1",
"phpunit/phpunit": "^5.5"
},
"suggest": {
"phpunit/phpunit": "Allows automated tests to be run without system-wide install.",
"cakephp/cakephp-codesniffer": "Allows to check the code against the coding standards used in CakePHP."
},
"autoload": {
"psr-4": {
"App\\": "src",
"Api\\": "./plugins/Api/src",
"Channel\\": "./plugins/Channel/src",
"System\\": "./plugins/System/src",
"Admin\\": "./plugins/Admin/src"
}
},
"autoload-dev": {
"psr-4": {
"App\\Test\\": "tests",
"Cake\\Test\\": "./vendor/cakephp/cakephp/tests",
"Api\\Test\\": "./plugins/Api/tests",
"Channel\\Test\\": "./plugins/Channel/tests",
"System\\Test\\": "./plugins/System/tests",
"Admin\\Test\\": "./plugins/Admin/tests"
}
},
"scripts": {
"post-install-cmd": "App\\Console\\Installer::postInstall",
"post-create-project-cmd": "App\\Console\\Installer::postInstall",
"post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/cnizzardini/ssl-certificate.git"
}
],
"minimum-stability": "stable",
"prefer-stable": true
}
I have tried adding https://github.com/cnizzardini/ssl-certificate with and without the .git. I have also tried setting minimum-stability to dev and prefer-stable to false.
Nothing works :-(
The composer.json file on your fork still calls the package "spatie/ssl-certificate", so that's the name of the package you need to require.
This should work:
{
...
"require": {
...
"spatie/ssl-certificate": "dev-master"
},
...
"repositories": [
{
"type": "vcs",
"url": "https://github.com/cnizzardini/ssl-certificate.git"
}
],
...
}
If it doesn't, you can rename the package on your own fork by changing the name property in its composer.json file:
{
"name": "cnizzardini/ssl-certificate",
"description": "A class to easily query the properties of an ssl certificate ",
...
}

Composer cannot find path repo - Laravel spark

So, Laravel spark isn't letting me connect to the github any more and it's causing me to be unable to push to heroku and completely halting my work. I tried placing the spark code in a folder and then making the code path repository. However, when I run composer update it still tries to fetch the code from the same github location. Seems like it isn't finding the repo.
I have tried tons of path variations and placing the code in various locations. Here is the section from the composer:
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"laravel/spark":"*",
....
"repositories": [
{
"type": "path",
"url": "vendor/laravel/spark"
},
{
"type": "composer",
"url": "https://spark-satis.laravel.com"
}
],
And, in the package composer ...
"name": "laravel/spark",
"description": "Laravel Spark provides scaffolding for Laravel SaaS applications.",
"keywords": ["laravel", "stripe", "billing", "scaffolding", "saas"],
"license": "MIT",
"authors": [
{
"name": "Taylor Otwell",
"email": "taylorotwell#gmail.com"
}
],
"require": {
"php": ">=5.5.9",
"erusev/parsedown": "~1.0",
"firebase/php-jwt": "~3.0",
"guzzlehttp/guzzle": "~6.0",
"ramsey/uuid": "^3.1",
"intervention/image": "^2.3"
},
"require-dev": {
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.0",
"mpociot/vat-calculator": "^1.6"
},
"autoload": {
"psr-4": {
"Laravel\\Spark\\": "src/"
}
},
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
}
},
"minimum-stability": "dev"
Is there something that I am missing to ensure that composer uses the path repo instead of looking at github?
Push laravel/spark code to your own git repo, than inside composer.json use
"repositories": [
{
"type": "vcs",
"url": "https://path to your repo"
}
],
and run composer require laravel/spark, It should take the code from your repo
Since laravel/spark is not free anymore and cannot be installed or updated with composer
You have to purchase license version to use it.
https://spark.laravel.com/licenses

Composer Installation in windows Error

Tried to install composer in windows through command line. Downloaded composer.phar. Placed it in C/wamp/www/s/ folder. During installation got this error.
[RuntimeException]
Error Output: make: *** No rule to make target `compile-json'. Stop.
What should I do now..?
This is my composer.json
{
"name": "aws/aws-sdk-php",
"homepage": "http://aws.amazon.com/sdkforphp",
"description": "AWS SDK for PHP - Use Amazon Web Services in your PHP project",
"keywords": ["aws","amazon","sdk","s3","ec2","dynamodb","cloud","glacier"],
"type": "library",
"license": "Apache-2.0",
"authors": [
{
"name": "Amazon Web Services",
"homepage": "http://aws.amazon.com"
}
],
"support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"issues": "https://github.com/aws/aws-sdk-php/issues"
},
"require": {
"php": ">=5.5",
"guzzlehttp/guzzle": ">=5.3|~6.0.1|~6.1",
"guzzlehttp/guzzle":"~4.0",
"guzzlehttp/psr7": "~1.0",
"guzzlehttp/promises": "~1.0",
"mtdowling/jmespath.php": "~2.2"
},
"require-dev": {
"ext-openssl": "*",
"ext-pcre": "*",
"ext-spl": "*",
"ext-json": "*",
"ext-dom": "*",
"ext-simplexml": "*",
"phpunit/phpunit": "~4.0",
"behat/behat": "~3.0",
"doctrine/cache": "~1.4",
"aws/aws-php-sns-message-validator": "~1.0"
},
"suggest": {
"ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages",
"ext-curl": "To send requests using cURL",
"doctrine/cache": "To use the DoctrineCacheAdapter"
},
"autoload": {
"psr-4": {
"Aws\\": "src/"
},
"files": ["src/functions.php"]
},
"autoload-dev": {
"psr-4": {
"Aws\\Test\\": "tests/"
}
},
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
}
},
"scripts": {
"post-autoload-dump": [
"make compile-json"
]
}
}
Thank you for posting your composer.json file.
The error comes from the following invalid entry:
"scripts": {
"post-autoload-dump": [
"make compile-json"
]
}
The make command will not work on Windows.
I suggest to simply remove this part of the file and try again.
(Its not clear to me, which of your project dependencies needs an additional make step and why you added it. Anyway this composer.json seems to be identical to https://github.com/aws/aws-sdk-php/blob/master/composer.json . If you want to contribute to this project ask them how to build on Windows :)
If you simply want to fetch the aws-sdk-php package.
Follow their installation guide: http://docs.aws.amazon.com/aws-sdk-php/v3/guide/getting-started/installation.html
Use php composer.phar require aws/aws-sdk-php on the CLI.
Or add aws/aws-sdk-php to your require section and then run composer install, like so:
{
"require": {
"aws/aws-sdk-php": "^3.3"
}
}

Resources