2012-04-30 22:58:08 +02:00
|
|
|
<?php
|
|
|
|
/**
|
2016-07-11 11:58:15 +02:00
|
|
|
* PrivateBin
|
2012-04-30 22:58:08 +02:00
|
|
|
*
|
|
|
|
* a zero-knowledge paste bin
|
|
|
|
*
|
2016-07-11 11:58:15 +02:00
|
|
|
* @link https://github.com/PrivateBin/PrivateBin
|
2012-04-30 22:58:08 +02:00
|
|
|
* @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
|
2016-07-19 13:56:52 +02:00
|
|
|
* @license https://www.opensource.org/licenses/zlib-license.php The zlib/libpng License
|
2015-11-09 21:39:42 +01:00
|
|
|
* @version 0.22
|
2012-04-30 22:58:08 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
spl_autoload_register('auto::loader');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* auto
|
|
|
|
*
|
|
|
|
* provides autoloading functionality
|
|
|
|
*/
|
|
|
|
class auto
|
|
|
|
{
|
|
|
|
/**
|
2016-07-06 14:12:14 +02:00
|
|
|
* includes file for given class name
|
2012-04-30 22:58:08 +02:00
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @static
|
2016-07-06 14:12:14 +02:00
|
|
|
* @param string $class_name
|
2012-04-30 22:58:08 +02:00
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public static function loader($class_name)
|
|
|
|
{
|
2012-08-26 00:49:11 +02:00
|
|
|
$filename = PATH . 'lib/' . str_replace('_', '/', $class_name) . '.php';
|
|
|
|
if(is_readable($filename)) {
|
|
|
|
return include $filename;
|
|
|
|
}
|
|
|
|
return false;
|
2012-04-30 22:58:08 +02:00
|
|
|
}
|
|
|
|
}
|