Skip to content

Instantly share code, notes, and snippets.

@whatthejeff
Created March 8, 2013 06:02
Show Gist options
  • Save whatthejeff/5114513 to your computer and use it in GitHub Desktop.
Save whatthejeff/5114513 to your computer and use it in GitHub Desktop.
Autoloading PEAR packages with composer.
{
"require": {
"pear-pear/pear": "1.9.4",
"pear-pear/Mail_Mime": "1.8.7"
},
"repositories": [
{
"type": "pear",
"url": "http://pear.php.net"
}
]
}
<?php
require 'vendor/autoload.php';
var_dump(class_exists('Mail_mime') && class_exists('Mail_mimePart'));
@whatthejeff
Copy link
Author

$ composer install
Loading composer repositories with package information
Initializing PEAR repository http://pear.php.net
Installing dependencies
  - Installing pear-pear.php.net/xml_util (1.2.1)
    Downloading: 100%         
  - Installing pear-pear.php.net/console_getopt (1.3.1)
    Downloading: 100%         
  - Installing pear-pear.php.net/structures_graph (1.0.4)
    Downloading: 100%         
  - Installing pear-pear.php.net/archive_tar (1.3.11)
    Downloading: 100%         
  - Installing pear-pear.php.net/pear (1.9.4)
    Downloading: 100%         
  - Installing pear-pear.php.net/mail_mime (1.8.7)
    Downloading: 100%         
Writing lock file
Generating autoload files

$ php test.php 
bool(true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment