当前位置: 首页>>代码示例>>PHP>>正文


PHP Loader::loadClass方法代码示例

本文整理汇总了PHP中Loader::loadClass方法的典型用法代码示例。如果您正苦于以下问题:PHP Loader::loadClass方法的具体用法?PHP Loader::loadClass怎么用?PHP Loader::loadClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Loader的用法示例。


在下文中一共展示了Loader::loadClass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 public function init()
 {
     $this->oAuth = new Module_Auth();
     if ($iSessionTimeout = $this->oLithium->getConfig('General.Session_timeout')) {
         $this->oAuth->setTimeout($iSessionTimeout);
     }
     // load xajax lib
     Loader::loadClass('Library_Xajax', 'LXajax');
     $this->oXajax = new LXajax();
     $this->oXajax->registerXajaxFunctions($this);
     // if xajax call end executing rest of code
     if ($this->isAjaxCall()) {
         parent::init();
         return;
     }
     // sprawdzanie czy uzytkownik niezalogowany
     if (!$this->isUserAllowed() && $this->getName() != "Login") {
         $this->redirect('/login');
         return;
     }
     parent::init();
     $this->mTemplate->headers = $this->oXajax->getJavascript();
     $this->mTemplate->menu = $this->getMenu();
     $this->mTemplate->aResources = [];
 }
开发者ID:maxwroc,项目名称:PHP,代码行数:25,代码来源:BaseController-maksymc-surf.php

示例2: __construct

 public function __construct()
 {
     //ucitana SimpleImage klasa iz foldera classes
     parent::__construct();
     Loader::loadClass("SimpleImage");
     Loader::loadModel($this, "users");
     $this->loginModule = new loginController();
 }
开发者ID:tigar-bilderski,项目名称:repozaframework,代码行数:8,代码来源:dashboardController.php

示例3: testLoadClass

 public function testLoadClass()
 {
     $exists1 = Loader::loadClass('\\JooS\\VarSpace');
     $this->assertTrue($exists1);
     $exists2 = Loader::loadClass('JooS_Exception_Class_Not_Exists');
     $this->assertFalse($exists2);
     $exists3 = Loader::loadClass('PHPUnit_Framework_TestCase');
     $this->assertTrue($exists3);
 }
开发者ID:covex-nn,项目名称:joos,代码行数:9,代码来源:LoaderTest.php

示例4: testLoadClass

 /**
  * @covers Xmf\Loader::loadClass
  */
 public function testLoadClass()
 {
     $x = Loader::loadClass(__CLASS__);
     $this->assertSame(true, $x);
     $x = Loader::loadClass('Xmf\\DebugTest');
     $this->assertSame(true, $x);
     $x = Loader::loadClass('thisClassdoesntexists');
     $this->assertSame(false, $x);
 }
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:12,代码来源:LoaderTest.php

示例5: prepare

 public function prepare(&$groups)
 {
     if (!self::$filter) {
         $filter = array('__META__' => array('module' => 'TimeIt'));
         $items = $this->getItems($groups);
         // load the categories system
         if (!($class = Loader::loadClass('CategoryRegistryUtil'))) {
             z_exit('Unable to load class [CategoryRegistryUtil] ...');
         }
         $properties = CategoryRegistryUtil::getRegisteredModuleCategories('TimeIt', 'TimeIt_events');
         foreach ($properties as $prop => $catid) {
             $filter[$prop] = $items;
         }
         self::$filter = DBUtil::generateCategoryFilterWhere('TimeIt_events', false, $filter);
     }
 }
开发者ID:planetenkiller,项目名称:TimeIt,代码行数:16,代码来源:notin.php

示例6: init

 public function init()
 {
     // load xajax lib
     Loader::loadClass('Library_Xajax', 'LXajax');
     //$this->oXajax = new LXajax();
     $this->oXajax = new LXajax(null, null, array('debug' => true));
     $this->oXajax->registerXajaxFunctions($this);
     // if xajax call end executing rest of code
     if ($this->oXajax->isAjaxCall()) {
         parent::init();
         // prevent from sending master view
         $this->mTemplate = null;
         return;
     }
     parent::init();
     $this->mTemplate->headers = $this->oXajax->getJavascript();
 }
开发者ID:maxwroc,项目名称:PHP,代码行数:17,代码来源:BaseController.php

示例7: mediashare_editapi_addAlbum

/**
 * Add/edit albums
 */
function mediashare_editapi_addAlbum(&$args)
{
    $dom = ZLanguage::getModuleDomain('mediashare');
    // Check basic access (but don't do fine grained Mediashare access check)
    if (!SecurityUtil::checkPermission('mediashare::', '::', ACCESS_EDIT)) {
        return LogUtil::registerPermissionError();
    }
    // Set defaults
    // FIXME: what if not logged in - how about 'owner' ???
    if (!isset($args['ownerId'])) {
        $args['ownerId'] = pnUserGetVar('uid');
    }
    if (!isset($args['template']) || empty($args['template'])) {
        // Include null test
        $args['template'] = pnModGetVar('mediashare', 'defaultAlbumTemplate', 'Standard');
    }
    // Parse extapp URL and add extapp data
    if (!mediashare_editapi_extappLocateApp($args)) {
        return false;
    }
    Loader::loadClass('RandomUtil');
    $album = array('ownerId' => (int) $args['ownerId'], 'createdDate' => DateUtil::getDatetime(), 'title' => $args['title'], 'keywords' => $args['keywords'], 'summary' => $args['summary'], 'description' => $args['description'], 'template' => $args['template'], 'parentAlbumId' => (int) $args['parentAlbumId'], 'thumbnailSize' => (int) pnModGetVar('mediashare', 'thumbnailSize'), 'viewKey' => RandomUtil::getInteger(100000000, 999999999, true) * 10000 + RandomUtil::getInteger(1, 9999), 'extappURL' => $args['extappURL'], 'extappData' => $args['extappData']);
    $album = DBUtil::insertObject($album, 'mediashare_albums', 'id');
    if ($album === false) {
        return LogUtil::registerError(__f('Error in %1$s: %2$s.', array('editapi.addAlbum', 'Could not add the new album.'), $dom));
    }
    if (!pnModAPIFunc('mediashare', 'edit', 'updateNestedSetValues')) {
        return false;
    }
    if (!pnModAPIFunc('mediashare', 'edit', 'setDefaultAccess', array('albumId' => $album['id']))) {
        return false;
    }
    pnModCallHooks('item', 'create', "album-{$album['id']}", array('module' => 'mediashare', 'albumId' => $album['id']));
    if (!pnModAPIFunc('mediashare', 'edit', 'updateKeywords', array('itemId' => $album['id'], 'type' => 'album', 'keywords' => $args['keywords']))) {
        return false;
    }
    if (!pnModAPIFunc('mediashare', 'edit', 'fetchExternalImages', array('albumId' => $album['id']))) {
        return false;
    }
    return $album['id'];
}
开发者ID:ro0f,项目名称:Mediashare,代码行数:44,代码来源:pneditapi.php

示例8: __construct

<?php

/**
 * Модуль видео. Поиск видео по YT, по собственной базе. Вывод, добавление, комментирование файлов.
 * @author Тимур 22.09.10 <gtimur666@gmail.com>
 * @version 1.0
 */
//require_once "engine/libs/mysql/MySQLConnector.php";
Loader::loadClass('engine/libs/video/Zend/Loader.php');
Loader::loadClass("engine/libs/mysql/MySQLConnector.php");
class VideoThing extends MySQLConnector
{
    /**
     * Количество файлов на странице.
     * @var integer
     */
    const FILES_COUNT = 5;
    /**
     * Консртуктор. Выполняется подключение базового класса YT.
     */
    function __construct()
    {
        $rootdir = $_SERVER["DOCUMENT_ROOT"];
        substr($rootdir, -1) == "/" ? $rootdir : ($rootdir = $rootdir . "/");
        $clientLibraryPath = 'engine/libs/video';
        $oldPath = set_include_path($rootdir . $clientLibraryPath);
        Zend_Loader::loadClass('Zend_Gdata_YouTube');
        parent::__construct();
        $string = "CREATE TABLE IF NOT EXISTS `Videos` (\n\t\t\t  `id` int(11) NOT NULL,\n\t\t\t  `videoID` varchar(255) DEFAULT NULL,\n\t\t\t  `title` varchar(255) DEFAULT NULL,\n\t\t\t  `comment` varchar(500) DEFAULT NULL,\n\t\t\t  `user` int(11) NOT NULL,\n\t\t\t  `sqrty` int(11) DEFAULT NULL,\n\t\t\t  `sq_list` varchar(1000) NOT NULL,\n\t\t\t  PRIMARY KEY (`id`)\n\t\t\t) ENGINE=MyISAM DEFAULT CHARSET=cp1251 ;";
        $this->_sql->query($string);
    }
开发者ID:EntityFX,项目名称:QuikiJAR,代码行数:31,代码来源:Video.php

示例9: myOrUserVideos

<?php

//require_once '../../engine/modules/user/UserRegister.php';
require_once '../../engine/kernel/classLoader.php';
//это в любом случае на первом месте само собой
/*
 * было так
 * require_once "../../engine/libs/mysql/MySQLConnector.php";
 * а стало так
 * Loader::loadClass("engine/libs/mysql/MySQLConnector.php");
 */
//Loader::loadClass("engine/modules/user/UserFull.php");
Loader::loadClass("engine/libs/mysql/MySQLConnector.php");
Loader::loadClass("engine/modules/video/Video.php");
Loader::loadClass("config/databaseConsts.php");
switch ($_POST["type"]) {
    case "add":
        die(add2my($_POST));
        break;
    case "del":
        die(delVideo($_POST));
        break;
    default:
        break;
}
function myOrUserVideos($postParams, $getParams, $siteParams)
{
    /*$user=new User();
    		$visitor = $user->id;*/
    //$userocheg=new UserFull();
    $userocheg->id;
开发者ID:EntityFX,项目名称:QuikiJAR,代码行数:31,代码来源:init.php

示例10: __construct

 public function __construct()
 {
     Loader::loadClass("Navigation");
 }
开发者ID:tigar-bilderski,项目名称:repozaframework,代码行数:4,代码来源:frontendController.php

示例11: modify

 /**
  * modify block settings
  *
  * @author       The Zikula Development Team
  * @param        array       $blockinfo     a blockinfo structure
  * @return       output      the bock form
  */
 public function modify($blockinfo)
 {
     // Get current content
     $vars = BlockUtil::varsFromContent($blockinfo['content']);
     // Defaults
     if (!isset($vars['hourfrom'])) {
         $vars['hourfrom'] = -1;
     }
     if (!isset($vars['hourto'])) {
         $vars['hourto'] = -1;
     }
     if (!isset($vars['monfrom'])) {
         $vars['monfrom'] = -1;
     }
     if (!isset($vars['monto'])) {
         $vars['monto'] = -1;
     }
     if (!isset($vars['mdayfrom'])) {
         $vars['mdayfrom'] = -1;
     }
     if (!isset($vars['mdayto'])) {
         $vars['mdayto'] = -1;
     }
     if (!isset($vars['wdayfrom'])) {
         $vars['wdayfrom'] = -1;
     }
     if (!isset($vars['wdayto'])) {
         $vars['wdayto'] = -1;
     }
     if (!isset($vars['cache_time'])) {
         $vars['cache_time'] = 120;
     }
     if (!isset($vars['cache_dir'])) {
         $vars['cache_dir'] = 'any_cache';
     }
     if (!isset($vars['ballooncolor'])) {
         $vars['ballooncolor'] = 'grey';
     }
     $ballooncolor = $vars['ballooncolor'];
     $this->view->assign('balloonselected' . $ballooncolor, 'selected="selected"');
     if (!isset($vars['enablefacebookshare'])) {
         $vars['enablefacebookshare'] = false;
     }
     // Create output object
     $this->view->caching = false;
     // Select categories only if enabled for the module
     $enablecategorization = ModUtil::getVar($this->name, 'enablecategorization');
     if ($enablecategorization) {
         // load the categories system
         if (!Loader::loadClass('CategoryRegistryUtil')) {
             return LogUtil::registerError(__f('Error! Could not load [%s] class.'), 'CategoryRegistryUtil');
         }
         // Get the registrered categories for the module
         $catregistry = CategoryRegistryUtil::getRegisteredModuleCategories($this->name, 'quotes');
         $this->view->assign('catregistry', $catregistry);
     }
     $this->view->assign('enablecategorization', $enablecategorization);
     $this->view->assign($vars);
     // assign the block vars
     if (!isset($vars['category']) || !is_array($vars['category'])) {
         $vars['category'] = array();
     }
     $this->view->assign('category', $vars['category']);
     $this->view->assign('hours', range(0, 23));
     $this->view->assign('months', range(1, 12));
     $this->view->assign('wdays', range(1, 7));
     $this->view->assign('mdays', range(1, 31));
     // return the output
     return $this->view->fetch('quotes_block_quote_modify.tpl');
 }
开发者ID:nmpetkov,项目名称:Quotes,代码行数:77,代码来源:Quote.php

示例12: realpath

<?php

require_once "Loader.php";
require_once 'Router.php';
include_once realpath("controllers/baseController.php");
include_once realpath("models/baseModel.php");
Loader::loadClass('Session');
Loader::loadClass('Cookie');
Session::start();
//Loader::loadClass('Cookie');
//Cookie::set('interval', "100", "1", "/", false, false);
//Cookie::set('intervalDrugi', "100", "1", "/", false, false);
//$cookie = Cookie::get("interval");
//var_dump($cookie);
//$del = Cookie::delete("intervalDrugi");
//var_dump($del);
/**
 * $_GET['rt'] automatski setova u .htaccess fajlu regularnim izrazom
 */
$route = new Router($_GET['rt']);
$controller = $route->getController();
$method = $route->getMethod();
$params = $route->getParams();
Loader::loadController($controller, $method, $params);
开发者ID:tigar-bilderski,项目名称:repozaframework,代码行数:24,代码来源:init.php

示例13: list

$request = Request::current();
list($res, $priv, $crl) = explode('/', $mod_path);
$result = array('success' => false);
$testRes = $res;
$testPriv = $priv;
//初始化action
if (empty($res)) {
    $res = 'home';
}
if (empty($priv)) {
    $priv = 'index';
}
isset($g_timer) && $g_timer->setMarker('dust.main start check role');
isset($g_timer) && $g_timer->setMarker('dust.main over checked');
$ctl_class = !empty($crl) ? ucfirst($res) . '_' . ucfirst($priv) . '_' . ucfirst($crl) : ucfirst($res) . '_' . ucfirst($priv);
Loader::loadClass($ctl_class);
if (($_SERVER['REQUEST_URI'] == '/' && (empty($testRes) && empty($testPriv)) || strpos($_SERVER['REQUEST_URI'], ".")) && class_exists($ctl_class, false)) {
    $ctl_obj = new $ctl_class();
    isset($g_timer) && $g_timer->setMarker('dust.main class instanced');
    // TODO: cache process
    $cached = checkCached($res, $priv, $crl, $request->format);
    if (is_array($cached) && isset($cached['life']) && isset($cached['cache_key'])) {
        $cache_life = $cached['life'];
        $cache_key = $cached['cache_key'];
    } else {
        $cache_life = intval($cached);
        $cache_key = sprintf("huitong_www_ac_%u_%s", crc32($_SERVER['REQUEST_URI']), $request->format);
    }
    if (!$request->isPost() && $cache_life > 0) {
        $cache = Cache_Memcache::getInstance();
        $result = $cache->get($cache_key);
开发者ID:ahmatjan,项目名称:Scene-Editor-for-mobile,代码行数:31,代码来源:index.php

示例14: modify

 /**
  * modify block settings
  *
  * @author       The Zikula Development Team
  * @param        array       $blockinfo     a blockinfo structure
  * @return       output      the bock form
  */
 public function modify($blockinfo)
 {
     // Get current content
     $vars = BlockUtil::varsFromContent($blockinfo['content']);
     // Defaults
     if (!isset($vars['cache_time'])) {
         $vars['cache_time'] = 600;
     }
     if (!isset($vars['cache_dir'])) {
         $vars['cache_dir'] = 'any_cache';
     }
     if (!isset($vars['enablefacebookshare'])) {
         $vars['enablefacebookshare'] = false;
     }
     // Create output object
     $this->view->caching = false;
     # Admin output changes often, we do not want caching
     // Select categories only if enabled for the module
     $enablecategorization = ModUtil::getVar($this->name, 'enablecategorization');
     if ($enablecategorization) {
         // load the categories system
         if (!Loader::loadClass('CategoryRegistryUtil')) {
             return LogUtil::registerError(__f('Error! Could not load [%s] class.'), 'CategoryRegistryUtil');
         }
         // Get the registrered categories for the module
         $catregistry = CategoryRegistryUtil::getRegisteredModuleCategories($this->name, 'ephem');
         $this->view->assign('catregistry', $catregistry);
     }
     $this->view->assign('enablecategorization', $enablecategorization);
     $this->view->assign($vars);
     // assign the block vars
     if (!isset($vars['category']) || !is_array($vars['category'])) {
         $vars['category'] = array();
     }
     $this->view->assign('category', $vars['category']);
     // return the output
     return $this->view->fetch('ephemerides_block_ephemeride_modify.tpl');
 }
开发者ID:nmpetkov,项目名称:Ephemerides,代码行数:45,代码来源:Ephemeride.php

示例15: _feeds_createdefaultcategory

    /**
     * create placeholder for categories
     */
    private function _feeds_createdefaultcategory($regpath = '/__SYSTEM__/Modules/Global')
    {
        // load necessary classes
        Loader::loadClass('CategoryUtil');
        Loader::loadClassFromModule('Categories', 'Category');
        Loader::loadClassFromModule('Categories', 'CategoryRegistry');

        // get the language code
        $lang = ZLanguage::getLanguageCode();
        $dom  = ZLanguage::getModuleDomain('Feeds');

        // get the category path for which we're going to insert our place holder category
        $rootcat = CategoryUtil::getCategoryByPath('/__SYSTEM__/Modules');
        $fCat    = CategoryUtil::getCategoryByPath('/__SYSTEM__/Modules/Feeds');

        if (!$fCat) {
            // create placeholder for all the module categories
            $cat = new Categories_DBObject_Category();
            $cat->setDataField('parent_id', $rootcat['id']);
            $cat->setDataField('name', 'Feeds');
            $cat->setDataField('display_name', array($lang => __('Feeds', $dom)));
            $cat->setDataField('display_desc', array($lang => __('Feed Reader.', $dom)));
            if (!$cat->validate('admin')) {
                return false;
            }
            $cat->insert();
            $cat->update();
        }

        // get the category path for which the feeds will be classified
        $rootcat = CategoryUtil::getCategoryByPath($regpath);
        if ($rootcat) {
            // create an entry in the categories registry
            $registry = new Categories_DBObject_Registry();
            $registry->setDataField('modname', 'Feeds');
            $registry->setDataField('table', 'feeds');
            $registry->setDataField('property', 'Main');
            $registry->setDataField('category_id', $rootcat['id']);
            $registry->insert();
        } else {
            return false;
        }

        return true;
    }
开发者ID:projectesIF,项目名称:Sirius,代码行数:48,代码来源:Installer.php


注:本文中的Loader::loadClass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。