Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 659788993f
Fetching contributors…

Cannot retrieve contributors at this time

47 lines (44 sloc) 1.102 kb
<?php
/**
* ~~summary~~
*
* ~~description~~
*
* PHP version 5
*
* @category Net
* @package PEAR2_Net_Transmitter
* @author Vasil Rangelov <boen.robot@gmail.com>
* @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_Transmitter
*/
/**
* The namespace declaration.
*/
namespace PEAR2\Net\Transmitter;
/**
* Loads a specified class.
*
* Loads a specified class from the namespace.
*
* @param string $class The classname (with namespace) to load.
*
* @return void
*/
function autoload($class)
{
$namespace = __NAMESPACE__ . '\\';
if (strpos($class, $namespace) === 0) {
$path = __DIR__ . DIRECTORY_SEPARATOR .
strtr(
substr($class, strlen($namespace)), '\\', DIRECTORY_SEPARATOR
) . '.php';
$file = realpath($path);
if (is_string($file) && strpos($file, __DIR__) === 0) {
include_once $file;
}
}
}
spl_autoload_register(__NAMESPACE__ . '\autoload', true);
Jump to Line
Something went wrong with that request. Please try again.