I'm trying to get Composer to install the 3.0.0 branch of a GitHub project (onelogin/php-saml). However, no matter what I try, it keeps trying to install the master branch version (2.12). Am I missing something? Below is my composer.json
{
"name": "munkireport/munkireport-php",
"description": "Reporting tool for munki",
"type": "project",
"license": "MIT",
"require-dev": {
"squizlabs/php_codesniffer": "^2.5"
},
"require": {
"php": ">=7.0.27",
"ext-dom": "*",
"guzzlehttp/guzzle": "~6.0",
"hautelook/phpass": "^1.1",
"illuminate/console": "~5.4",
"illuminate/database": "5.4.36",
"illuminate/filesystem": "~5.4",
"league/flysystem": "~1.0",
"rodneyrehm/plist": "^2.0",
"doctrine/dbal": "~2.5",
"defuse/php-encryption": "^2.1",
"onelogin/php-saml": "3.0.0-dev"
},
"suggest": {
"adldap2/adldap2": "^8.0 Required for AD authentication"
},
"autoload": {
"psr-4": {
"munkireport\\models\\": "app/models/",
"munkireport\\controller\\": "app/controllers",
"munkireport\\lib\\": "app/lib/munkireport"
}
},
"repositories": [
{
"type": "git",
"url": "https://github.com/onelogin/php-saml"
}
]
}
Output:
Using version ^2.12 for onelogin/php-saml
I was able to bypass this with the following command:
./composer require onelogin/php-saml:3.0.0.x-dev
Related
I've taken over an existing Drupal project, I've cloned the git repository of the project onto a development server, and ran composer install to install all project dependencies.
When I try to view the website in my browser, I see an error 500 and the apache error logs on the server are showing the following error;
[Mon Jan 14 11:38:41.246259 2019] [php7:error] [pid 1363] [client 80.229.235.74:52957] PHP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 73728 bytes) in /var/www/vhosts/agilit-e/6bc72c45/vendor/composer/ClassLoader.php on line 444
I've increased the available RAM on the server to 3GB, and I've edited my php.ini file to increase available memory to 2GB (confirmed via phpinfo()), but I'm still seeing this error.
Is there any reason why Composer requires so much memory? Here's a copy of my composer.json file for reference.
{
"name": "drupal-composer/drupal-project",
"description": "Project template for Drupal 8 projects with composer",
"type": "project",
"license": "GPL-2.0+",
"authors": [
{
"name": "",
"role": ""
}
],
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
},
{
"type": "package",
"package": {
"name": "harvesthq/chosen",
"version": "1.6.1",
"type": "drupal-library",
"dist": {
"url": "https://github.com/harvesthq/chosen/releases/download/v1.6.1/chosen_v1.6.1.zip",
"type": "zip"
},
"require": {
"composer/installers": "^1.2.0"
}
}
},
{
"type": "package",
"package": {
"name": "dinbror/blazy",
"version": "1.8.2",
"type": "drupal-library",
"dist": {
"url": "https://github.com/dinbror/blazy/archive/1.8.2.zip",
"type": "zip"
},
"require": {
"composer/installers": "^1.2.0"
}
}
},
{
"type": "vcs",
"url": "https://gitlab.com/leed-collective/capita-cs-base-theme.git"
},
{
"type": "vcs",
"url": "https://gitlab.com/leed-collective/capita-cs-admin-theme.git"
},
{
"type": "vcs",
"url": "https://gitlab.com/leed-collective/capita-cs-base-modules.git"
}
],
"require": {
"composer/installers": "^1.2",
"cweagans/composer-patches": "^1.6",
"dinbror/blazy": "^1.8",
"drupal-composer/drupal-scaffold": "^2.2",
"drupal/access_unpublished": "^1.0#alpha",
"drupal/admin_toolbar": "^1.19",
"drupal/allowed_formats": "^1.1",
"drupal/autocomplete_deluxe": "^1.0",
"drupal/better_exposed_filters": "^3.0",
"drupal/blazy": "^1.0",
"drupal/block_class": "^1.0",
"drupal/block_content_permissions": "^1.0",
"drupal/chosen": "^2.3",
"drupal/config_filter": "^1.0",
"drupal/config_ignore": "^2.1",
"drupal/config_split": "^1.2",
"drupal/console": "~1.0",
"drupal/core": "~8.5.8",
"drupal/ctools": "^3.0",
"drupal/default_content": "^1.0#alpha",
"drupal/devel": "^1.0",
"drupal/diff": "^1.0",
"drupal/draggableviews": "^1.0",
"drupal/easy_breadcrumb": "^1.6",
"drupal/entity_browser": "^1.0",
"drupal/entity_reference_revisions": "^1.3",
"drupal/eu_cookie_compliance": "^1.0",
"drupal/field_group": "^3.0",
"drupal/formblock": "^1.0",
"drupal/google_analytics": "^2.1",
"drupal/google_tag": "^1.0",
"drupal/honeypot": "^1.23",
"drupal/image_style_quality": "^1.3",
"drupal/image_widget_crop": "^2.0",
"drupal/inline_entity_form": "^1.0",
"drupal/ip2country": "^1.8",
"drupal/link_attributes": "^1.1",
"drupal/linkit": "^5.0",
"drupal/media_entity_document": "1.1",
"drupal/media_entity_image": "1.2",
"drupal/media_entity_video": "1.0-beta2",
"drupal/menu_block": "^1.4",
"drupal/menu_breadcrumb": "^1.3",
"drupal/metatag": "^1.3",
"drupal/migrate_plus": "^2.0",
"drupal/migrate_tools": "^2.0",
"drupal/paragraphs": "^1.1",
"drupal/pathauto": "^1.0",
"drupal/pathologic": "^1.0#alpha",
"drupal/rabbit_hole": "^1.0",
"drupal/recreate_block_content": "^2.0",
"drupal/redirect": "^1.0",
"drupal/restrict_ip": "^1.3",
"drupal/search_exclude": "^1.1",
"drupal/search_exclude_nid": "^1.2",
"drupal/signature": "dev-1.x#048ad876778b2e1ad5a3baaabd2210e1e1be7a1e",
"drupal/silent_contribute": "^1.1",
"drupal/simple_sitemap": "^2.7",
"drupal/smtp": "^1.0",
"drupal/social_media_links": "^2.4",
"drupal/styleguide": "^1.0",
"drupal/taxonomy_access_fix": "^2.5",
"drupal/token": "^1.0",
"drupal/token_filter": "^1.0",
"drupal/twig_tweak": "^1.8",
"drupal/username_enumeration_prevention": "^1.0",
"drupal/video_embed_field": "^1.5",
"drupal/video_embed_wistia": "^1.0",
"drupal/views_bulk_edit": "^1.0",
"drupal/views_bulk_operations": "^1.0",
"drupal/webform": "5.0-rc11",
"drush/drush": "~8.0",
"leed-collective/capita_base_theme": "master",
"leed-collective/capita_admin_theme": "master",
"leed-collective/capita-cs-base-modules": "master",
"geerlingguy/drupal-vm": "4.7.0",
"harvesthq/chosen": "^1.6",
"oomphinc/composer-installers-extender": "^1.1",
"webflo/drupal-finder": "^0.3.0",
"webmozart/path-util": "^2.3"
},
"require-dev": {
"behat/mink": "~1.7",
"behat/mink-goutte-driver": "~1.2",
"jcalderonzumba/gastonjs": "~1.0.2",
"jcalderonzumba/mink-phantomjs-driver": "~0.3.1",
"mikey179/vfsstream": "~1.2",
"phpunit/phpunit": ">=4.8.28 <5",
"symfony/css-selector": "~2.8"
},
"conflict": {
"drupal/drupal": "*"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"sort-packages": true
},
"scripts": {
"drupal-scaffold": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold",
"pre-install-cmd": [
"DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
],
"pre-update-cmd": [
"DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
],
"post-install-cmd": [
"DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
],
"post-update-cmd": [
"DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
]
},
"extra": {
"installer-types": [
"capita-module",
"capita-theme",
"capita-profile"
],
"installer-paths": {
"web/core": [
"type:drupal-core"
],
"web/libraries/{$name}": [
"type:drupal-library"
],
"web/modules/contrib/{$name}": [
"type:drupal-module"
],
"web/modules/capita_base/{$name}": [
"type:capita-module"
],
"web/profiles/contrib/{$name}": [
"type:drupal-profile"
],
"web/profiles/capita_base/{$name}": [
"type:capita-profile"
],
"web/themes/contrib/{$name}": [
"type:drupal-theme"
],
"web/themes/capita_base/{$name}": [
"type:capita-theme"
],
"drush/contrib/{$name}": [
"type:drupal-drush"
]
},
"patches": {
"drupal/core": {
"Fix issue of grouped filters using the array key id for the query rather than the term IDs": "https://www.drupal.org/files/issues/2049603-fixing-tid-in-exposed-group-filter-sql-query-in-views.patch"
},
"drupal/default_content": {
"Allow exporting all taxonomy terms for a given vocab": "https://www.drupal.org/files/issues/default_content-export-all-items-2786479-12.patch",
"Allow existing entities to be updated": "https://www.drupal.org/files/issues/2018-06-05/default_content-dont-reimport-existing-entities-2698425-102.patch",
"Allow manually importing content again, not just on install": "https://www.drupal.org/files/issues/default_content-allow_manual_imports-2640734-72.patch"
},
"drupal/field_group": {
"Tabs with invalid input are not focused": "https://www.drupal.org/files/issues/field-group-tab-focus-invalid-input.patch"
},
"drupal/linkit": {
"Linkit for Link field": "https://www.drupal.org/files/issues/2018-03-25/2712951-59.patch"
}
}
}
}
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.
I have created composer package, which composer.json is
{
"name": "xxxx/yyyyy",
"description": "xyz",
"license": "MIT",
"authors": [
{
"name": "xxx",
"email": "xx#ttt.com"
}
],
"version": "1.0.0",
"type": "package",
"minimum-stability": "dev",
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.3.*",
"tymon/jwt-auth": "0.5.*",
"dimsav/laravel-translatable": "^6.0",
"doctrine/dbal": "^2.5",
"felixkiss/uniquewith-validator": "2.*",
"owen-it/laravel-auditing": "^3.1",
"venturecraft/revisionable": "1.*",
"yadakhov/insert-on-duplicate-key": "^1.1"
},
"autoload": {
"psr-4": {
"XXX\\YYY\\" : "/src"
}
}
}
Now, when i install my
xxxx/yyyy
package, I need that composer install all required packages:
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.3.*",
"tymon/jwt-auth": "0.5.*",
"dimsav/laravel-translatable": "^6.0",
"doctrine/dbal": "^2.5",
"felixkiss/uniquewith-validator": "2.*",
"owen-it/laravel-auditing": "^3.1",
"venturecraft/revisionable": "1.*",
"yadakhov/insert-on-duplicate-key": "^1.1"
},
but it dont install it.
I try composer update, composer install. Can someone help?
Project Composer.json looks like
{
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0",
"xxxx/yyyy" : "1.0.0"
},
"repositories": [
{
"type": "package",
"package": {
"name": "xxxx/yyyy",
"version": "1.0.0",
"source": {
"url": "example.com",
"type": "git",
"reference": "master"
},
"autoload": {
"psr-4" : {
"XXX\\YYY\\" : "/src"
}
}
}
}
]
}
What I can do, that Composer automatically install all package required dependencies???? Thanks for advice.
Don't use the package repository type. When you use this, you have to copy all information that usually resides inside the composer.json file of the software you are referencing.
package repositories are for scenarios where you are unable to add a composer.json file to the origin of the software. You have full control over your package, so this does not apply.
Just add a repository link of type vcs with the URL to the repository, and Composer will figure out the rest by looking at the composer.json file inside the repository. It will detect the dependencies and install them.
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
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"
}
}