示例#1
0
/**
 * Possible autoloader to initialize.
 */
use PEAR2\Autoload;
chdir(__DIR__);
$autoloader = stream_resolve_include_path('../vendor/autoload.php');
if (false !== $autoloader) {
    include_once $autoloader;
} else {
    $autoloader = stream_resolve_include_path('PEAR2/Autoload.php');
    if (false !== $autoloader) {
        include_once $autoloader;
        Autoload::initialize(realpath('../src'));
        Autoload::initialize(realpath('../../Net_Transmitter.git/src'));
        Autoload::initialize(realpath('../../Cache_SHM.git/src'));
    } else {
        die('No recognized autoloader is available.');
    }
}
unset($autoloader);
$defineConstants = !defined('ROS_NAMESPACE');
if ($defineConstants) {
    define('ROS_NAMESPACE', __NAMESPACE__);
}
/**
 * Resolves a hostname to an IP address.
 * 
 * Resolves a hostname to an IP address. Used instead of gethostbyname() in
 * order to enable resolutions to IPv6 hosts.
 * 
示例#2
0
        include_once $autoloader;
    } else {
        //The composer autoloader, when this package is a dependency.
        $autoloader = stream_resolve_include_path((false === ($vendorDir = getenv('COMPOSER_VENDOR_DIR')) ? '../../..' : $vendorDir) . '/autoload.php');
        unset($vendorDir);
        if (false !== $autoloader) {
            include_once $autoloader;
        } else {
            //PEAR2_Autoload, most probably installed globally.
            $autoloader = stream_resolve_include_path('PEAR2/Autoload.php');
            if (false !== $autoloader) {
                include_once $autoloader;
                Autoload::initialize(realpath('../src'));
                Autoload::initialize(realpath('../../Net_Transmitter.git/src'));
                Autoload::initialize(realpath('../../Console_Color.git/src'));
                Autoload::initialize(realpath('../../Console_CommandLine.git/src'));
            } else {
                fwrite(STDERR, <<<HEREDOC
No recognized autoloader is available.
Please install this package with Pyrus, PEAR or Composer.
Alternatively, install PEAR2_Autoload, and/or add it to your include_path.
HEREDOC
);
                chdir($cwd);
                exit(10);
            }
        }
    }
    chdir($cwd);
    unset($autoloader, $cwd);
}
/**
 * @desc oh no, it uses PHPUnit, deal with it ;-)
 * @ignore
 */
require_once 'PHPUnit/Autoload.php';
/**
 * @desc $topLevel Root dir.
 */
$topLevel = __DIR__ . '/../../../../..';
/**
 * @ignore
 */
require_once $topLevel . '/../Pyrus/vendor/php/PEAR2/Exception.php';
require_once $topLevel . '/../Pyrus/vendor/php/PEAR2/Autoload.php';
\PEAR2\Autoload::initialize($topLevel . '/src');
use Pyrus\Developer\PackageFile;
use Pyrus\Developer\PackageFile\Commands;
/**
 * A test case to cover the codemess.
 */
class PEAR2SkeletonTestCase extends \PHPUnit_Framework_TestCase
{
    protected $base;
    protected $packageName = 'PEAR2_Foo';
    protected function setUp()
    {
        $this->base = __DIR__ . '/package-test';
        @mkdir($this->base);
        chdir($this->base);
    }
示例#4
0
/**
 * bootstrap.php for PEAR2_Console_Color.
 * 
 * PHP version 5.3
 *
 * @category Console
 * @package  PEAR2_Console_Color
 * @author   Vasil Rangelov <*****@*****.**>
 * @license  http://www.opensource.org/licenses/bsd-license.php New BSD License
 * @version  GIT: $Id$
 * @link     http://pear2.php.net/PEAR2_Console_Color
 */
/**
 * Possible autoloader to initialize.
 */
use PEAR2\Autoload;
chdir(__DIR__);
$autoloader = stream_resolve_include_path('../vendor/autoload.php');
if (false !== $autoloader) {
    include_once $autoloader;
} else {
    $autoloader = stream_resolve_include_path('PEAR2/Autoload.php');
    if (false !== $autoloader) {
        include_once $autoloader;
        Autoload::initialize(realpath('../src'));
    } else {
        fwrite(STDERR, 'No recognized autoloader is available.');
        exit(1);
    }
}
unset($autoloader);