コード例 #1
0
ファイル: extrasetup.php プロジェクト: pear2/console_color
<?php

/**
 * extrasetup.php for PEAR2_Console_Color.
 * 
 * PHP version 5.3
 *
 * @category Console
 * @package  PEAR2_Console_Color
 * @author   Vasil Rangelov <*****@*****.**>
 * @license  http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
 * @version  GIT: $Id$
 * @link     http://pear2.php.net/PEAR2_Console_Color
 */
$extrafiles = array();
$phpDir = Pyrus\Config::current()->php_dir;
$packages = array('PEAR2/Autoload');
$oldCwd = getcwd();
chdir($phpDir);
foreach ($packages as $pkg) {
    if (is_dir($pkg)) {
        foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($pkg, RecursiveDirectoryIterator::UNIX_PATHS | RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::LEAVES_ONLY) as $path) {
            $extrafiles['src/' . $path->getPathname()] = $path->getRealPath();
        }
    }
    if (is_file($pkg . '.php')) {
        $extrafiles['src/' . $pkg . '.php'] = $phpDir . DIRECTORY_SEPARATOR . $pkg . '.php';
    }
}
chdir($oldCwd);
コード例 #2
0
 * easily build complex command line interfaces.
 *
 * PHP version 5
 *
 * LICENSE: This source file is subject to the MIT license that is available
 * through the world-wide-web at the following URI:
 * http://opensource.org/licenses/mit-license.php
 *
 * @category  Console 
 * @package   PEAR2_Console_CommandLine
 * @author    David JEAN LOUIS <*****@*****.**>
 * @copyright 2007-2009 David JEAN LOUIS
 * @license   http://opensource.org/licenses/mit-license.php MIT License 
 * @version   GIT: $Id$
 * @link      http://pear2.php.net/PEAR2_Console_CommandLine
 */
$packages = array('pear2.php.net' => array('PEAR2_Autoload'));
$extrafiles = array();
$config = Pyrus\Config::current();
$registry = $config->registry;
$phpDir = $config->php_dir;
foreach ($packages as $channel => $channelPackages) {
    foreach ($channelPackages as $package) {
        foreach ($registry->toPackage($package, $channel)->installcontents as $file => $info) {
            if (strpos($file, 'php/') === 0) {
                $filename = substr($file, 4);
                $extrafiles['src/' . $filename] = realpath($phpDir . DIRECTORY_SEPARATOR . $filename);
            }
        }
    }
}
コード例 #3
0
/**
 * extrasetup.php for PEAR2_Net_RouterOS.
 * 
 * PHP version 5.3
 * 
 * @category  Net
 * @package   PEAR2_Net_RouterOS
 * @author    Vasil Rangelov <*****@*****.**>
 * @copyright 2011 Vasil Rangelov
 * @license   http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
 * @version   GIT: $Id$
 * @link      http://pear2.php.net/PEAR2_Net_RouterOS
 */
$extrafiles = array();
$phpDir = Pyrus\Config::current()->php_dir;
$packages = array('PEAR2/Autoload', 'PEAR2/Cache/SHM', 'PEAR2/Console/CommandLine', 'PEAR2/Console/Color', 'PEAR2/Net/Transmitter');
//Quick&dirty workaround for Console_CommandLine's xmlschema.rng file.
$extrafiles['data/pear2.php.net/PEAR2_Console_CommandLine/xmlschema.rng'] = Pyrus\Config::current()->data_dir . DIRECTORY_SEPARATOR . 'pear2.php.net/PEAR2_Console_CommandLine/xmlschema.rng';
$oldCwd = getcwd();
chdir($phpDir);
foreach ($packages as $pkg) {
    if (is_dir($pkg)) {
        foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($pkg, RecursiveDirectoryIterator::UNIX_PATHS | RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::LEAVES_ONLY) as $path) {
            $extrafiles['src/' . $path->getPathname()] = $path->getRealPath();
        }
    }
    if (is_file($pkg . '.php')) {
        $extrafiles['src/' . $pkg . '.php'] = $phpDir . DIRECTORY_SEPARATOR . $pkg . '.php';
    }
}
chdir($oldCwd);