1: <?php
2: /**
3: * Pinoco: makes existing static web site dynamic transparently.
4: * Copyright 2010-2012, Hisateru Tanaka <tanakahisateru@gmail.com>
5: *
6: * Licensed under The MIT License
7: * Redistributions of files must retain the above copyright notice.
8: *
9: * PHP Version 5
10: *
11: * @author Hisateru Tanaka <tanakahisateru@gmail.com>
12: * @copyright Copyright 2010-2012, Hisateru Tanaka <tanakahisateru@gmail.com>
13: * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
14: * @package Pinoco
15: *
16: * @filesource
17: */
18:
19: if (!function_exists('__pinoco_autoload_impl')) {
20: /**
21: * SPL autoload implementation for Pinoco libs
22: *
23: * @param string $class
24: * @return void
25: */
26: function __pinoco_autoload_impl($class)
27: {
28: if ($class === 'Pinoco') {
29: require_once dirname(dirname(__FILE__)) . '/Pinoco.php';
30: }
31: elseif (substr($class, 0, 7) === 'Pinoco_') {
32: require_once dirname(__FILE__) . '/' . strtr(substr($class, 7), "_", "/") . '.php';
33: }
34: }
35: if (!@in_array('__pinoco_autoload_impl', spl_autoload_functions())) {
36: spl_autoload_register('__pinoco_autoload_impl');
37: }
38: }
39:
40: