PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, January 7, 2022

[FIXED] Trying to install PEAR extension with composer

 January 07, 2022     composer-php, pear     No comments   

Issue

I'm converting an old project (with old dependencies) to manage it's dependencies using composer. The site uses PEAR's Text_Password. I read that it is possible to install dependencies with composer adding (something like) the following to composer.json:

"repositories": [
    {
        "type": "pear",
        "url": "http://pear.php.net"
    }
],
"require": {
    ...
    "pear-pear/Text_Password": "*"
},

..but I get the error:

$ composer update
Loading composer repositories with package information
Initializing PEAR repository http://pear.php.net
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package pear-pear/text_password 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://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Is it possible to install PEAR libraries with Composer? I notice on packagist there is a collection of PEAR libraries but I couldn't see Text_Password - https://packagist.org/packages/pear/

There is also a github repo for Text_Password but I thought maybe installing direct from PEAR was better? - https://github.com/pear/Text_Password

Anyway how can I install this package with composer?


Solution

Here you go:

{
    "type": "project",
    "repositories": [
        {
            "type": "pear",
            "url": "http://pear.php.net"
        }
    ],
    "require": {
        "pear-pear.php.net/Text_Password": "*"
    }
}

Note: The PEAR repository has been removed from Composer 2.0



Answered By - Jens A. Koch
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing