Skip to content

Commit

Permalink
Add randomlib
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasReschke committed Aug 26, 2014
1 parent 57245d2 commit 82d02dd
Show file tree
Hide file tree
Showing 71 changed files with 4,525 additions and 104 deletions.
2 changes: 1 addition & 1 deletion autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

require_once __DIR__ . '/composer' . '/autoload_real.php';

return ComposerAutoloaderInit13b97aa84a057d92d3230cb06c2e80e4::getLoader();
return ComposerAutoloaderInitf72f3ba725222a1af3d7e9738989ccc8::getLoader();
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"phpmailer/phpmailer": "v5.2.8",
"phpseclib/phpseclib": "*",
"rackspace/php-opencloud": "v1.9.2",
"james-heinrich/getid3": "dev-master"
"james-heinrich/getid3": "dev-master",
"ircmaxell/random-lib": "v1.0.0"
}
}

99 changes: 78 additions & 21 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 9 additions & 38 deletions composer/ClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,6 @@ public function add($prefix, $paths, $prepend = false)
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-0 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
Expand Down Expand Up @@ -204,13 +202,10 @@ public function set($prefix, $paths)
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
*/
public function setPsr4($prefix, $paths)
{
public function setPsr4($prefix, $paths) {
if (!$prefix) {
$this->fallbackDirsPsr4 = (array) $paths;
} else {
Expand Down Expand Up @@ -271,7 +266,7 @@ public function unregister()
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
includeFile($file);
include $file;

return true;
}
Expand All @@ -296,25 +291,8 @@ public function findFile($class)
return $this->classMap[$class];
}

$file = $this->findFileWithExtension($class, '.php');

// Search for Hack files if we are running on HHVM
if ($file === null && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}

if ($file === null) {
// Remember that this class does not exist.
return $this->classMap[$class] = false;
}

return $file;
}

private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . '.php';

$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
Expand Down Expand Up @@ -343,7 +321,7 @@ private function findFileWithExtension($class, $ext)
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
} else {
// PEAR-like class name
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . '.php';
}

if (isset($this->prefixesPsr0[$first])) {
Expand All @@ -369,15 +347,8 @@ private function findFileWithExtension($class, $ext)
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
}
}

/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*/
function includeFile($file)
{
include $file;
// Remember that this class does not exist.
return $this->classMap[$class] = false;
}
}
2 changes: 2 additions & 0 deletions composer/autoload_namespaces.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
'System' => array($vendorDir . '/phpseclib/phpseclib/phpseclib'),
'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'),
'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'),
'SecurityLib' => array($vendorDir . '/ircmaxell/security-lib/lib'),
'Sabre\\VObject' => array($vendorDir . '/sabre/vobject/lib'),
'Sabre\\HTTP' => array($vendorDir . '/sabre/dav/lib'),
'Sabre\\DAVACL' => array($vendorDir . '/sabre/dav/lib'),
'Sabre\\DAV' => array($vendorDir . '/sabre/dav/lib'),
'Sabre\\CardDAV' => array($vendorDir . '/sabre/dav/lib'),
'Sabre\\CalDAV' => array($vendorDir . '/sabre/dav/lib'),
'RandomLib' => array($vendorDir . '/ircmaxell/random-lib/lib'),
'OpenCloud' => array($vendorDir . '/rackspace/php-opencloud/lib', $vendorDir . '/rackspace/php-opencloud/tests'),
'Net' => array($vendorDir . '/phpseclib/phpseclib/phpseclib'),
'Math' => array($vendorDir . '/phpseclib/phpseclib/phpseclib'),
Expand Down
16 changes: 7 additions & 9 deletions composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit13b97aa84a057d92d3230cb06c2e80e4
class ComposerAutoloaderInitf72f3ba725222a1af3d7e9738989ccc8
{
private static $loader;

Expand All @@ -19,9 +19,12 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInit13b97aa84a057d92d3230cb06c2e80e4', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitf72f3ba725222a1af3d7e9738989ccc8', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit13b97aa84a057d92d3230cb06c2e80e4', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitf72f3ba725222a1af3d7e9738989ccc8', 'loadClassLoader'));

$vendorDir = dirname(__DIR__);
$baseDir = $vendorDir;

$includePaths = require __DIR__ . '/include_paths.php';
array_push($includePaths, get_include_path());
Expand All @@ -46,14 +49,9 @@ public static function getLoader()

$includeFiles = require __DIR__ . '/autoload_files.php';
foreach ($includeFiles as $file) {
composerRequire13b97aa84a057d92d3230cb06c2e80e4($file);
require $file;
}

return $loader;
}
}

function composerRequire13b97aa84a057d92d3230cb06c2e80e4($file)
{
require $file;
}
Loading

0 comments on commit 82d02dd

Please sign in to comment.