コード例 #1
0
<?php

/*
|--------------------------------------------------------------------------
| Register AutoLoader
|--------------------------------------------------------------------------
| Vafpress Framework has separated app and core directories, developers can
| put their extension code and configuration at app folder, as everything
| inside app will be loaded first and will override class with the same
| name with core classes.
*/
VP_AutoLoader::add_namespaces(VP_NAMESPACE);
VP_AutoLoader::add_directories(VP_CLASSES_DIR, VP_NAMESPACE);
VP_AutoLoader::register();
class VP_AutoLoader
{
    /**
     * Indicates if VP_AutoLoader has been registered.
     * 
     * @var boolean
     */
    protected static $registered = false;
    /**
     * The registered directories
     * 
     * @var array
     */
    protected static $directories = array();
    /**
     * THe registered namespaces
     * 
コード例 #2
0
ファイル: SilverWp.php プロジェクト: silversite/silverwp
 /**
  *
  * Add some extra fields class and fixes for VP
  *
  * @access private
  */
 private function vpFix()
 {
     \VP_AutoLoader::remove_directories(VP_CLASSES_DIR, VP_NAMESPACE);
     $classes = SILVERWP_LIBS_PATH . 'ssvafpress/classes/';
     \VP_AutoLoader::add_directories($classes, VP_NAMESPACE);
     \VP_AutoLoader::add_directories(VP_CLASSES_DIR, VP_NAMESPACE);
     \VP_AutoLoader::register();
     $vp = \VP_FileSystem::instance();
     $vp->remove_directories('views');
     $views = SILVERWP_LIBS_PATH . 'ssvafpress/views';
     $vp->add_directories('views', $views);
     $vp->add_directories('views', ABSPATH . 'Views');
     $vp->add_directories('views', VP_VIEWS_DIR);
     FileSystem::getInstance()->addDirectory('ssvp_views', $views);
 }