phpDocumentor pond
[ class tree: pond ] [ index: pond ] [ all elements ]

Source for file _class5.funcs.php

Documentation is available at _class5.funcs.php

  1. <?php
  2. /**
  3.  * Function for handling Classes in PHP 5.
  4.  *
  5.  * In PHP4, _class4.funcs.php should be used instead.
  6.  *
  7.  * This file is part of Quam Plures - {@link http://quamplures.net/}
  8.  * See also {@link https://launchpad.net/quam-plures}.
  9.  *
  10.  * @copyright (c) 2009 - 2011 by the Quam Plures developers - {@link http://quamplures.net/}
  11.  * @copyright (c)2009 by Francois PLANQUE - {@link http://fplanque.net/}
  12.  *  Parts of this file are copyright (c)2009 by Daniel HAHLER - {@link http://daniel.hahler.de/}.
  13.  *
  14.  *  {@internal License choice
  15.  *  - If you have received this file as part of a package, please find the license.txt file in
  16.  *    the same folder or the closest folder above for complete license terms.
  17.  *  - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
  18.  *    then you must choose one of the following licenses before using the file:
  19.  *    - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
  20.  *    - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
  21.  *  }}}
  22.  *
  23.  *  {@internal Open Source relicensing agreement:
  24.  *  Daniel HAHLER grants Francois PLANQUE the right to license
  25.  *  Daniel HAHLER's contributions to this file and the b2evolution project
  26.  *  under any OSI approved OSS license (http://www.opensource.org/licenses/).
  27.  *  }}}
  28.  *
  29.  * @author blueyed: Daniel HAHLER.
  30.  *
  31.  * @package pond
  32.  */
  33. if!defined('QP_MAIN_INIT') ) die'Please, do not access this page directly.' );
  34.  
  35.  
  36. /**
  37.  * Autoload the required .class.php file when a class is accessed but not defined yet.
  38.  * This gets hooked into spl_autoload_register (preferred) or called through __autoload.
  39.  * Requires PHP5.
  40.  */
  41. function evocms_autoload_class$classname )
  42. {
  43.     static $map_class_path;
  44.  
  45.     /*
  46.     List generated with (executed in ./blogs):
  47.     for i in $(find . -name \*.class.php -o -name \*.widget.php); do echo "'$(basename $i .php | tr '[:upper:'] '[:lower:'] | sed 's/.widget$/_widget/; s/.class$//; s/^_//; s/^collsettings$/collectionsettings/; s/^itemlist$/itemlist2/; s/^widget$/componentwidget/; s/^uiwidget$/widget/')' => $(echo $i|sed "s~^./qp_inc/~\$inc_path.'~;s~^./qp_view_admin/~\$admintemplates_path.'/~")',"; done
  48.     */
  49.     ifisset($map_class_path) )
  50.     {
  51.         global $inc_path$admintemplates_path;
  52.         $_map_class_path array(
  53.             /* SPECIAL: several classes in one file. */
  54.             'table' => $inc_path.'_core/ui/_uiwidget.class.php',
  55.             'log_noop' => $inc_path.'_core/model/_log.class.php',
  56.             'zip_file' => $inc_path.'_ext/_zip_archives.php',
  57.             'potfile' => $inc_path.'locales/_pofile.class.php',
  58.             /* SPECIAL END */
  59.  
  60.             /* AUTOGENERATED LIST: */
  61.             'commentlist' => $inc_path.'comments/model/_commentlist.class.php',
  62.             'comment' => $inc_path.'comments/model/_comment.class.php',
  63.             'template' => $inc_path.'templates/model/_template.class.php',
  64.             'templatecache' => $inc_path.'templates/model/_templatecache.class.php',
  65.             'iconlegend' => $inc_path.'_core/ui/_iconlegend.class.php',
  66.             'form' => $inc_path.'_core/ui/forms/_form.class.php',
  67.             'resultsel' => $inc_path.'_core/ui/results/_resultsel.class.php',
  68.             'results' => $inc_path.'_core/ui/results/_results.class.php',
  69.             'widget' => $inc_path.'_core/ui/_uiwidget.class.php',
  70.             'pagecache' => $inc_path.'_core/model/_pagecache.class.php',
  71.             'dataobjectcache' => $inc_path.'_core/model/dataobjects/_dataobjectcache.class.php',
  72.             'dataobjectlist' => $inc_path.'_core/model/dataobjects/_dataobjectlist.class.php',
  73.             'dataobjectlist2' => $inc_path.'_core/model/dataobjects/_dataobjectlist2.class.php',
  74.             'dataobject' => $inc_path.'_core/model/dataobjects/_dataobject.class.php',
  75.             'timer' => $inc_path.'_core/model/_timer.class.php',
  76.             'log' => $inc_path.'_core/model/_log.class.php',
  77.             'sql' => $inc_path.'_core/model/db/_sql.class.php',
  78.             'db' => $inc_path.'_core/model/db/_db.class.php',
  79.             'filetype' => $inc_path.'files/model/_filetype.class.php',
  80.             'filetypecache' => $inc_path.'files/model/_filetypecache.class.php',
  81.             'filerootcache' => $inc_path.'files/model/_filerootcache.class.php',
  82.             'file' => $inc_path.'files/model/_file.class.php',
  83.             'filecache' => $inc_path.'files/model/_filecache.class.php',
  84.             'filelist' => $inc_path.'files/model/_filelist.class.php',
  85.             'fileroot' => $inc_path.'files/model/_fileroot.class.php',
  86.             'widgetcache' => $inc_path.'widgets/model/_widgetcache.class.php',
  87.             'componentwidget' => $inc_path.'widgets/model/_widget.class.php',
  88.             'session' => $inc_path.'sessions/model/_session.class.php',
  89.             'hitlist' => $inc_path.'sessions/model/_hitlist.class.php',
  90.             'hit' => $inc_path.'sessions/model/_hit.class.php',
  91.             'goal' => $inc_path.'sessions/model/_goal.class.php',
  92.             'idna_convert' => $inc_path.'_ext/idna/_idna_convert.class.php',
  93.             'item' => $inc_path.'items/model/_item.class.php',
  94.             'itemlistlight' => $inc_path.'items/model/_itemlistlight.class.php',
  95.             'itemlight' => $inc_path.'items/model/_itemlight.class.php',
  96.             'link' => $inc_path.'items/model/_link.class.php',
  97.             'itemlist2' => $inc_path.'items/model/_itemlist.class.php',
  98.             'itemtype' => $inc_path.'items/model/_itemtype.class.php',
  99.             'itemquery' => $inc_path.'items/model/_itemquery.class.php',
  100.             'linkcache' => $inc_path.'items/model/_linkcache.class.php',
  101.             'itemtypecache' => $inc_path.'items/model/_itemtypecache.class.php',
  102.             'itemcache' => $inc_path.'items/model/_itemcache.class.php',
  103.             'group' => $inc_path.'users/model/_group.class.php',
  104.             'usercache' => $inc_path.'users/model/_usercache.class.php',
  105.             'user' => $inc_path.'users/model/_user.class.php',
  106.             'usersettings' => $inc_path.'users/model/_usersettings.class.php',
  107.             'genericorderedcache' => $inc_path.'generic/model/_genericorderedcache.class.php',
  108.             'genericordered' => $inc_path.'generic/model/_genericordered.class.php',
  109.             'genericcategory' => $inc_path.'generic/model/_genericcategory.class.php',
  110.             'genericcategorycache' => $inc_path.'generic/model/_genericcategorycache.class.php',
  111.             'genericelement' => $inc_path.'generic/model/_genericelement.class.php',
  112.             'genericcache' => $inc_path.'generic/model/_genericcache.class.php',
  113.             'xhtml_validator' => $inc_path.'xhtml_validator/_xhtml_validator.class.php',
  114.             'pofile' => $inc_path.'locales/_pofile.class.php',
  115.             'plugins' => $inc_path.'plugins/model/_plugins.class.php',
  116.             'plugins_admin' => $inc_path.'plugins/model/_plugins_admin.class.php',
  117.             'pluginsettings' => $inc_path.'plugins/model/_pluginsettings.class.php',
  118.             'pluginusersettings' => $inc_path.'plugins/model/_pluginusersettings.class.php',
  119.             'plugins_admin_no_db' => $inc_path.'plugins/model/_plugins_admin_no_db.class.php',
  120.             'plugin' => $inc_path.'plugins/_plugin.class.php',
  121.             'cronjob' => $inc_path.'cron/model/_cronjob.class.php',
  122.             'generalsettings' => $inc_path.'settings/model/_generalsettings.class.php',
  123.             'abstractsettings' => $inc_path.'settings/model/_abstractsettings.class.php',
  124.             'blogcache' => $inc_path.'collections/model/_blogcache.class.php',
  125.             'collectionsettings' => $inc_path.'collections/model/_collsettings.class.php',
  126.             'blog' => $inc_path.'collections/model/_blog.class.php',
  127.             'chaptercache' => $inc_path.'chapters/model/_chaptercache.class.php',
  128.             'chapter' => $inc_path.'chapters/model/_chapter.class.php',
  129.             'adminui_general' => $admintemplates_path.'/_adminUI_general.class.php',
  130.             'adminui' => $admintemplates_path.'/wind/_adminUI.class.php',
  131.             'menu' => $inc_path.'_core/ui/_menu.class.php',
  132.             'rfc822_addresses_class' => $inc_path.'_ext/mime_parser/rfc822_addresses.php',
  133.             'mime_parser_class' => $inc_path.'_ext/mime_parser/mime_parser.php',
  134.             /* AUTOGENERATED LIST END */
  135.         );
  136.         $map_class_path $_map_class_path;
  137.     }
  138.  
  139.     $classname strtolower($classname);
  140.     ifisset($map_class_path[$classname]) )
  141.     {
  142.         require_once $map_class_path[$classname];
  143.     }
  144. }
  145.  
  146.  
  147. /*
  148.  * Use spl_autoload_register mechanism, if available (PHP>=5.1.2).
  149.  * This way, several autoload functions can be used.
  150.  */
  151. iffunction_exists('spl_autoload_register') )
  152. {
  153.     // spl_autoload_register( 'var_dump' );
  154.     spl_autoload_register'evocms_autoload_class' );
  155. }
  156. else
  157. {
  158.     // PHP<5.1.2: Use the fallback method.
  159.     function __autoload$classname )
  160.     {
  161.         return evocms_autoload_class($classname);
  162.     }
  163. }
  164.  
  165.  
  166. /**
  167.  * Load class file. No-op for PHP5, uses __autoload().
  168.  */
  169. function load_class$class_path )
  170. {
  171.     return true;
  172. }
  173.  
  174.  
  175. ?>