2012-04-30 20:58:08 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* ZeroBin
|
|
|
|
*
|
|
|
|
* a zero-knowledge paste bin
|
|
|
|
*
|
|
|
|
* @link http://sebsauvage.net/wiki/doku.php?id=php:zerobin
|
|
|
|
* @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
|
|
|
|
* @license http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License
|
2015-09-03 20:22:59 +00:00
|
|
|
* @version 0.20
|
2012-04-30 20:58:08 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
spl_autoload_register('auto::loader');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* auto
|
|
|
|
*
|
|
|
|
* provides autoloading functionality
|
|
|
|
*/
|
|
|
|
class auto
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* strips slashes deeply
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @static
|
|
|
|
* @param mixed $value
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public static function loader($class_name)
|
|
|
|
{
|
2012-08-25 22:49:11 +00:00
|
|
|
$filename = PATH . 'lib/' . str_replace('_', '/', $class_name) . '.php';
|
|
|
|
if(is_readable($filename)) {
|
|
|
|
return include $filename;
|
|
|
|
}
|
|
|
|
return false;
|
2012-04-30 20:58:08 +00:00
|
|
|
}
|
|
|
|
}
|