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


PHP LogUtil类代码示例

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


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

示例1: display

 public function display($blockinfo)
 {
     // security check
     $this->throwForbiddenUnless(SecurityUtil::checkPermission('Content:menublock:', "{$blockinfo['title']}::", ACCESS_READ), LogUtil::getErrorMsgPermission());
     // Break out options from our content field
     $vars = BlockUtil::varsFromContent($blockinfo['content']);
     // --- Setting of the Defaults
     if (!isset($vars['usecaching'])) {
         $vars['usecaching'] = false;
     }
     if (!isset($vars['root'])) {
         $vars['root'] = 0;
     }
     $this->view->setCacheId($blockinfo['bid']);
     $this->view->setCaching($vars['usecaching']);
     if (!$vars['usecaching'] || $vars['usecaching'] && !$this->view->is_cached('block/menu.tpl')) {
         $options = array('orderBy' => 'setLeft', 'makeTree' => true, 'filter' => array());
         if ($vars['root'] > 0) {
             $options['filter']['superParentId'] = $vars['root'];
         }
         // checkInMenu, checkActive is done implicitely
         $options['filter']['checkInMenu'] = true;
         $pages = ModUtil::apiFunc('Content', 'Page', 'getPages', $options);
         if ($pages === false) {
             return false;
         }
         $this->view->assign('subPages', $pages);
     }
     $blockinfo['content'] = $this->view->fetch('block/menu.tpl');
     return BlockUtil::themeBlock($blockinfo);
 }
开发者ID:robbrandt,项目名称:Content,代码行数:31,代码来源:Menu.php

示例2: __destruct

 function __destruct()
 {
     if ($this->fp != null) {
         fclose($this->fp);
         LogUtil::$logger = null;
     }
 }
开发者ID:puregamexyz,项目名称:bitdesign.github.io,代码行数:7,代码来源:LogUtil.php

示例3: smarty_function_secauthaction

/**
 * Example:
 * {secauthaction comp="Stories::" inst=".*" level="ACCESS_ADMIN" assign="auth"}
 *
 * true/false will be returned.
 *
 * This file is a plugin for Zikula_View, the Zikula implementation of Smarty
 * @param        array       $params      All attributes passed to this function from the template
 * @param        object      &$smarty     Reference to the Smarty object
 * @return       boolean     authorized?
 */
function smarty_function_secauthaction($params, &$smarty)
{
    LogUtil::log(__f('Warning! Template plugin {%1$s} is deprecated, please use {%2$s} instead.', array('secauthaction', 'checkpermission')), E_USER_DEPRECATED);

    $assign = isset($params['assign']) ? $params['assign'] : null;
    $comp   = isset($params['comp'])   ? $params['comp']   : null;
    $inst   = isset($params['inst'])   ? $params['inst']   : null;
    $level  = isset($params['level'])  ? $params['level']  : null;

    if (!$comp) {
        $smarty->trigger_error(__f('Error! in %1$s: the %2$s parameter must be specified.', array('smarty_function_secauthaction', 'comp')));
        return false;
    }

    if (!$inst) {
        $smarty->trigger_error(__f('Error! in %1$s: the %2$s parameter must be specified.', array('smarty_function_secauthaction', 'inst')));
        return false;
    }

    if (!$level) {
        $smarty->trigger_error(__f('Error! in %1$s: the %2$s parameter must be specified.', array('smarty_function_secauthaction', 'level')));
        return false;
    }

    $result = SecurityUtil::checkPermission($comp, $inst, constant($level));

    if ($assign) {
        $smarty->assign($assign, $result);
    } else {
        return $result;
    }
}
开发者ID:,项目名称:,代码行数:43,代码来源:

示例4: Install

    public function Install() {
        // Checks if module IWmain is installed. If not returns error
        $modid = ModUtil::getIdFromName('IWmain');
        $modinfo = ModUtil::getInfo($modid);

        if ($modinfo['state'] != 3) {
            return LogUtil::registerError($this->__('Module IWmain is needed. You have to install the IWmain module before installing it.'));
        }

        // Check if the version needed is correct
        $versionNeeded = '2.0';
        if (!ModUtil::func('IWmain', 'admin', 'checkVersion', array('version' => $versionNeeded))) {
            return false;
        }

        // create module tables
        $tables = array('IWstats', 'IWstats_summary');
        foreach ($tables as $table) {
            if (!DBUtil::createTable($table)) {
                return false;
            }
        }

        // create several indexes for IWstats table
        $table = DBUtil::getTables();
        $c = $table['IWstats_column'];
        if (!DBUtil::createIndex($c['moduleid'], 'IWstats', 'moduleid')) {
            return false;
        }
        if (!DBUtil::createIndex($c['uid'], 'IWstats', 'uid')) {
            return false;
        }
        if (!DBUtil::createIndex($c['ip'], 'IWstats', 'ip')) {
            return false;
        }
        if (!DBUtil::createIndex($c['ipForward'], 'IWstats', 'ipForward')) {
            return false;
        }
        if (!DBUtil::createIndex($c['ipClient'], 'IWstats', 'ipClient')) {
            return false;
        }
        if (!DBUtil::createIndex($c['userAgent'], 'IWstats', 'userAgent')) {
            return false;
        }
        if (!DBUtil::createIndex($c['isadmin'], 'IWstats', 'isadmin')) {
            return false;
        }

        // Set up config variables
        $this->setVar('skippedIps', '')
                ->setVar('modulesSkipped', '')
                ->setVar('deleteFromDays', 90)
                ->setVar('keepDays', 90);

        // create the system init hook
        EventUtil::registerPersistentModuleHandler('IWstats', 'core.postinit', array('IWstats_Listeners', 'coreinit'));

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

示例5: initialize

 public function initialize(Zikula_Form_View $view)
 {
     $this->pageId = FormUtil::getPassedValue('pid', isset($this->args['pid']) ? $this->args['pid'] : null);
     $offset = (int) FormUtil::getPassedValue('offset');
     if ((bool) $this->getVar('inheritPermissions', false) === true) {
         if (!ModUtil::apiFunc('Content', 'page', 'checkPermissionForPageInheritance', array('pageId' => $this->pageId, 'level' => ACCESS_EDIT))) {
             throw new Zikula_Exception_Forbidden(LogUtil::getErrorMsgPermission());
         }
     } else {
         if (!SecurityUtil::checkPermission('Content:page:', $this->pageId . '::', ACCESS_EDIT)) {
             throw new Zikula_Exception_Forbidden(LogUtil::getErrorMsgPermission());
         }
     }
     $page = ModUtil::apiFunc('Content', 'Page', 'getPage', array('id' => $this->pageId, 'editing' => false, 'filter' => array('checkActive' => false), 'enableEscape' => true, 'translate' => false, 'includeContent' => false, 'includeCategories' => false));
     if ($page === false) {
         return $this->view->registerError(null);
     }
     $versionscnt = ModUtil::apiFunc('Content', 'History', 'getPageVersionsCount', array('pageId' => $this->pageId));
     $versions = ModUtil::apiFunc('Content', 'History', 'getPageVersions', array('pageId' => $this->pageId, 'offset' => $offset));
     if ($versions === false) {
         return $this->view->registerError(null);
     }
     $this->view->assign('page', $page);
     $this->view->assign('versions', $versions);
     Content_Util::contentAddAccess($this->view, $this->pageId);
     // Assign the values for the smarty plugin to produce a pager
     $this->view->assign('numitems', $versionscnt);
     PageUtil::setVar('title', $this->__("Page history") . ' : ' . $page['title']);
     if (!$this->view->isPostBack() && FormUtil::getPassedValue('back', 0)) {
         $this->backref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null;
     }
     return true;
 }
开发者ID:robbrandt,项目名称:Content,代码行数:33,代码来源:HistoryContent.php

示例6: forcedPasswordChangeListener

    /**
     * Vetos (denies) a login attempt, and forces the user to change his password.
     *
     * This handler is triggered by the 'user.login.veto' event.  It vetos (denies) a
     * login attempt if the users's account record is flagged to force the user to change
     * his password maintained by the Users module. If the user does not maintain a
     * password on his Users account (e.g., he registered with and logs in with a Google
     * Account or an OpenID, and never established a Users password), then this handler
     * will not trigger a change of password.
     *
     * @param Zikula_Event $event The event that triggered this handler.
     *
     * @return void
     */
    public static function forcedPasswordChangeListener(Zikula_Event $event)
    {
        $userObj = $event->getSubject();

        $userMustChangePassword = UserUtil::getVar('_Users_mustChangePassword', $userObj['uid'], false);

        if ($userMustChangePassword && ($userObj['pass'] != Users_Constant::PWD_NO_USERS_AUTHENTICATION)) {
            $event->stop();
            $event->setData(array(
                'redirect_func'  => array(
                    'modname'   => self::$modname,
                    'type'      => 'user',
                    'func'      => 'changePassword',
                    'args'      => array(
                        'login'     => true,
                    ),
                    'session'   => array(
                        'var'       => 'Users_Controller_User_changePassword',
                        'namespace' => 'Zikula_Users',
                    )
                ),
            ));

            LogUtil::registerError(__("Your log-in request was not completed. You must change your web site account's password first."));
        }
    }
开发者ID:projectesIF,项目名称:Sirius,代码行数:40,代码来源:ForcedPasswordChange.php

示例7: uninstall

    /**
     * Desinstal·lació del mòdul Cataleg
     * 
     * @return bool true si ha anat tot bé, false en qualsevol altre cas.
     */
    public function uninstall()
    {
        if (!SecurityUtil::checkPermission('Cataleg::', '::', ACCESS_ADMIN)) {
            return LogUtil::registerPermissionError();
        }
        // Esborrar taules del mòdul          
        if (!DBUtil::dropTable('cataleg')||
            !DBUtil::dropTable('cataleg_eixos')||
            !DBUtil::dropTable('cataleg_prioritats')||
            !DBUtil::dropTable('cataleg_unitatsImplicades')||
            !DBUtil::dropTable('cataleg_subprioritats')|| 
            !DBUtil::dropTable('cataleg_activitats')||               
            !DBUtil::dropTable('cataleg_activitatsZona')||   
            !DBUtil::dropTable('cataleg_unitats')||
            !DBUtil::dropTable('cataleg_responsables')||
            !DBUtil::dropTable('cataleg_contactes')||
            !DBUtil::dropTable('cataleg_auxiliar')||
            !DBUtil::dropTable('cataleg_centresActivitat')||
	    !DBUtil::dropTable('cataleg_centres')||
            !DBUtil::dropTable('cataleg_gestioActivitatDefaults')||
            !DBUtil::dropTable('cataleg_importTaules')||
            !DBUtil::dropTable('cataleg_importAssign')||
            !DBUtil::dropTable('cataleg_gtafEntities')||
            !DBUtil::dropTable('cataleg_gtafGroups')
            ) 
        return false;
        //Esborrar variables del mòdul
        $this->delVars();
        // unregister hook handlers
        HookUtil::unregisterSubscriberBundles($this->version->getHookSubscriberBundles());
        return true;
    }
开发者ID:projectesIF,项目名称:Sirius,代码行数:37,代码来源:Installer.php

示例8: install

    public function install() {
        if (!SecurityUtil::checkPermission('IWdocmanager::', '::', ACCESS_ADMIN)) {
            return LogUtil::registerPermissionError();
        }
        // Checks if module IWmain is installed. If not returns error
        if (!ModUtil::available('IWmain')) {
            return LogUtil::registerError(__('Module IWmain is required. You have to install the IWmain module previously to install it.'));
        }

        // Check if the version needed is correct
        $versionNeeded = '3.0.0';
        if (!ModUtil::func('IWmain', 'admin', 'checkVersion', array('version' => $versionNeeded))) {
            return false;
        }

        if (!DBUtil::createTable('IWdocmanager'))
            return false;
        if (!DBUtil::createTable('IWdocmanager_categories'))
            return false;

        //Create indexes
        $table = DBUtil::getTables();
        $c = $table['IWdocmanager_column'];
        DBUtil::createIndex($c['author'], 'IWdocmanager', 'author');
        DBUtil::createIndex($c['categoryId'], 'IWdocmanager', 'categoryId');

        //Create module vars
        $this->setVar('documentsFolder', 'documents')
                ->setVar('notifyMail', '')
                ->setVar('editTime', '45')
                ->setVar('deleteTime', '20');

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

示例9: install

 public function install()
 {
     \DoctrineHelper::createSchema($this->entityManager, static::getEntities());
     $this->createLicenses();
     $temporaryUploadCollection = new CollectionEntity();
     $temporaryUploadCollection->setTitle($this->__('Temporary Upload Collection'))->setDescription($this->__('This collection is needed as temporary storage for uploaded files. Do not edit or delete!'));
     $this->entityManager->persist($temporaryUploadCollection);
     $exampleCollection = new CollectionEntity();
     $exampleCollection->setTitle($this->__('Example collection'))->setDescription($this->__('Edit or delete this example collection'));
     $this->entityManager->persist($exampleCollection);
     $this->entityManager->flush();
     if ($temporaryUploadCollection->getId() != CollectionEntity::TEMPORARY_UPLOAD_COLLECTION_ID) {
         \LogUtil::registerError($this->__('The id of the generated "temporary upload collection" must be 1, but has a different value. This should not have happened. Please report this error.'));
     }
     \HookUtil::registerProviderBundles($this->version->getHookProviderBundles());
     \HookUtil::registerSubscriberBundles($this->version->getHookSubscriberBundles());
     $this->setVar('descriptionEscapingStrategyForCollection', 'text');
     $this->setVar('descriptionEscapingStrategyForMedia', 'text');
     $this->setVar('defaultCollectionTemplate', 'cards');
     $this->setVar('slugEditable', true);
     $this->setVar('lastNewVersionCheck', 0);
     $this->setVar('newVersionAvailable', false);
     $this->createUploadDir();
     return true;
 }
开发者ID:shefik,项目名称:MediaModule,代码行数:25,代码来源:MediaModuleInstaller.php

示例10: preDispatch

 /**
  * Ensure we are in an interactive session.
  *
  * @return void
  */
 public function preDispatch()
 {
     $this->throwForbiddenUnless(\SecurityUtil::checkPermission($this->getName() . '::', '::', \ACCESS_ADMIN), \LogUtil::getErrorMsgPermission());
     $session = $this->request->getSession();
     $check = (bool) ($session->get('interactive_init') || $session->get('interactive_upgrade') || $session->get('interactive_remove'));
     $this->throwForbiddenUnless($check, $this->__('This doesnt appear to be an interactive session.'));
 }
开发者ID:rtznprmpftl,项目名称:Zikulacore,代码行数:12,代码来源:AbstractInteractiveInstaller.php

示例11: Reviews_operation_update

/**
 * Update operation.
 * @param object $entity The treated object.
 * @param array  $params Additional arguments.
 *
 * @return bool False on failure or true if everything worked well.
 */
function Reviews_operation_update(&$entity, $params)
{
    $dom = ZLanguage::getModuleDomain('Reviews');
    // initialise the result flag
    $result = false;
    $objectType = $entity['_objectType'];
    $currentState = $entity['workflowState'];
    // get attributes read from the workflow
    if (isset($params['nextstate']) && !empty($params['nextstate'])) {
        // assign value to the data object
        $entity['workflowState'] = $params['nextstate'];
        if ($params['nextstate'] == 'archived') {
            // bypass validator (for example an end date could have lost it's "value in future")
            $entity['_bypassValidation'] = true;
        }
    }
    // get entity manager
    $serviceManager = ServiceUtil::getManager();
    $entityManager = $serviceManager->getService('doctrine.entitymanager');
    // save entity data
    try {
        //$this->entityManager->transactional(function($entityManager) {
        $entityManager->persist($entity);
        $entityManager->flush();
        //});
        $result = true;
    } catch (\Exception $e) {
        LogUtil::registerError($e->getMessage());
    }
    // return result of this operation
    return $result;
}
开发者ID:rmaiwald,项目名称:Reviews,代码行数:39,代码来源:function.update.php

示例12: smarty_function_modishooked

/**
 * Zikula_View function to check for the availability of a module
 *
 * This function calls ModUtil::isHooked to determine if two Zikula modules are
 * hooked together. True is returned if the modules are hooked, false otherwise.
 * The result can also be assigned to a template variable.
 *
 * Available parameters:
 *   - tmodname:  The well-known name of the hook module
 *   - smodname:  The well-known name of the calling module
 *   - assign:    The name of a variable to which the results are assigned
 *
 * Examples
 *   {modishooked tmodname='Ratings' smodname='News'}
 *
 *   {modishooked tmodname='bar' smodname='foo' assign='barishookedtofoo'}
 *   {if $barishookedtofoo}.....{/if}
 *
 * @param array       $params All attributes passed to this function from the template.
 * @param Zikula_View $view   Reference to the Zikula_View object.
 *
 * @see    function.modishooked.php::smarty_function_modishooked()
 *
 * @return boolean True if the module is available; false otherwise.
 */
function smarty_function_modishooked($params, $view)
{
    LogUtil::log(__f('Warning! Template plugin {%1$s} is deprecated.', array('modishooked')), E_USER_DEPRECATED);

    $assign   = isset($params['assign'])   ? $params['assign']   : null;
    $smodname = isset($params['smodname']) ? $params['smodname'] : null;
    $tmodname = isset($params['tmodname']) ? $params['tmodname'] : null;

    if (!$tmodname) {
        $view->trigger_error(__f('Error! in %1$s: the %2$s parameter must be specified.', array('modishooked', 'tmodname')));
        return false;
    }

    if (!$smodname) {
        $view->trigger_error(__f('Error! in %1$s: the %2$s parameter must be specified.', array('modishooked', 'smodname')));
        return false;
    }

    $result = ModUtil::isHooked($tmodname, $smodname);

    if ($assign) {
        $view->assign($params['assign'], $result);
    } else {
        return $result;
    }
}
开发者ID:,项目名称:,代码行数:51,代码来源:

示例13: updateMemcache

 function updateMemcache()
 {
     // ignore_user_abort();
     //set_time_limit(0);
     //$interval=3600; //(seconds)
     require_once 'model/Feed.php';
     require_once 'lib/BitMemCache.php';
     require_once 'lib/RssReader.php';
     $feed = new Feed();
     $feeds = $feed->getFeeds();
     $logger = LogUtil::getLogger();
     //do{
     include "config/site.php";
     foreach ($feeds as $feed) {
         $url = $feed['url'];
         $mem = new BitMemCache();
         $reader = new RssReader();
         $rss = $reader->fetch($url);
         if (!$rss) {
         } else {
             if ($mem->init()) {
                 $mem->set($url, json_encode($rss));
                 $logger->info("update memcache {$url}");
             }
         }
     }
     //  sleep($interval);
     //}while($memcache);
 }
开发者ID:puregamexyz,项目名称:bitdesign.github.io,代码行数:29,代码来源:BitTimer.php

示例14: smarty_function_configgetvar

/**
 * Obtain and display a configuration variable from the Zikula system.
 *
 * Available attributes:
 *  - name      (string)    The name of the configuration variable to obtain
 *  - html      (bool)      If set, the output is prepared for display by
 *                          DataUtil::formatForDisplayHTML instead of
 *                          DataUtil::formatForDisplay
 *  - assign    (string)    the name of a template variable to assign the
 *                          output to, instead of returning it to the template. (optional)
 *
 * <i>Note that if the the result is assigned to a template variable, it is not
 * prepared for display by either DataUtil::formatForDisplayHTML or
 * DataUtil::formatForDisplay. If it is to be displayed, the safetext
 * modifier should be used.</i>
 *
 * Examples:
 *
 * <samp><p>Welcome to {configgetvar name='sitename'}!</p></samp>
 *
 * <samp>{configgetvar name='sitename' assign='thename'}</samp><br>
 * <samp><p>Welcome to {$thename|safetext}!</p></samp>
 *
 * @param array       $params All attributes passed to this function from the template.
 * @param Zikula_View $view   Reference to the {@link Zikula_View} object.
 *
 * @return mixed The value of the configuration variable.
 */
function smarty_function_configgetvar($params, $view)
{
    LogUtil::log(__f('Warning! Template plugin {%1$s} is deprecated.', array('configgetvar')), E_USER_DEPRECATED);

    $name      = isset($params['name'])    ? $params['name']    : null;
    $default   = isset($params['default']) ? $params['default'] : null;
    $html      = isset($params['html'])    ? $params['html']    : null;
    $assign    = isset($params['assign'])  ? $params['assign']  : null;

    if (!$name) {
        $view->trigger_error(__f('Error! in %1$s: the %2$s parameter must be specified.', array('configgetvar', 'name')));
        return false;
    }

    $result = System::getVar($name, $default);

    if ($assign) {
        $view->assign($assign, $result);
    } else {
        if (is_bool($html) && $html) {
            return DataUtil::formatForDisplayHTML($result);
        } else {
            return DataUtil::formatForDisplay($result);
        }
    }
}
开发者ID:,项目名称:,代码行数:54,代码来源:

示例15: display

 /**
  * display items for a day
  *
  * @param $args array Arguments array.
  *
  * @return string html string
  */
 public function display($args)
 {
     $eid = FormUtil::getPassedValue('eid', isset($args['eid']) ? $args['eid'] : null, 'REQUEST');
     $objectid = FormUtil::getPassedValue('objectid', isset($args['objectid']) ? $args['objectid'] : null, 'REQUEST');
     if (!empty($objectid)) {
         $eid = $objectid;
     }
     if (!isset($args['eid']) and !empty($eid)) {
         $args['eid'] = $eid;
     }
     // Chek permissions
     $this->throwForbiddenUnless(SecurityUtil::checkPermission('Ephemerides::', '::', ACCESS_READ), LogUtil::getErrorMsgPermission());
     // check if the contents are cached.
     $template = 'ephemerides_user_display.tpl';
     if ($this->view->is_cached($template)) {
         return $this->view->fetch($template);
     }
     // get items
     if (isset($args['eid']) and $args['eid'] > 0) {
         $items = ModUtil::apiFunc($this->name, 'user', 'getall', $args);
     } else {
         $items = ModUtil::apiFunc($this->name, 'user', 'gettoday', $args);
     }
     $this->view->assign('items', $items);
     return $this->view->fetch($template);
 }
开发者ID:nmpetkov,项目名称:Ephemerides,代码行数:33,代码来源:User.php


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