PhpExtensions::install PHP Метод

install() публичный статический Метод

Install extension by given name.
public static install ( string $name ) : void
$name string The name of the extension to install.
Результат void
    public static function install($name)
    {
        if (!method_exists('PhpExtensions', $method = "_{$name}")) {
            return;
        }
        printf("=> installing (%s)\n", $name);
        static::$method();
        printf("=> installed (%s)\n", $name);
    }

Usage Example

/*
 * This file is part of the Stash package.
 *
 * (c) Robert Hafner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
/**
 * Install PHP extensions for Travis CI.
 *
 * @author Victor Berchet <*****@*****.**>
 */
$installer = new PhpExtensions();
$installer->install('apc');
$installer->install('memcache');
$installer->install('memcached');
class PhpExtensions
{
    protected $extensions;
    protected $phpVersion;
    protected $iniPath;
    public function __construct()
    {
        $this->phpVersion = phpversion();
        $this->iniPath = php_ini_loaded_file();
        $this->extensions = array('memcache' => array('url' => 'http://pecl.php.net/get/memcache-2.2.6.tgz', 'php_version' => array(), 'cfg' => array('--enable-memcache'), 'ini' => array('extension=memcache.so')), 'memcached' => array('url' => 'http://pecl.php.net/get/memcached-1.0.2.tgz', 'php_version' => array(array('<', '5.4')), 'cfg' => array(), 'ini' => array('extension=memcached.so')), 'apc' => array('url' => 'http://pecl.php.net/get/APC-3.1.9.tgz', 'php_version' => array(array('<', '5.4')), 'cfg' => array(), 'ini' => array('extension=apc.so', 'apc.enabled=1', 'apc.enable_cli=1', 'apc.max_file_size=1')), 'xcache' => array('url' => 'http://xcache.lighttpd.net/pub/Releases/1.2.2/xcache-1.2.2.tar.gz', 'php_version' => array(array('<', '5')), 'cfg' => array('--enable-xcache'), 'ini' => array('extension=xcache.so', 'xcache.admin.enable_auth=0', 'xcache.var_size=1M', 'xcache.cacher=false')));
    }
    public function install($name)
    {
All Usage Examples Of PhpExtensions::install