• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP eZExtension类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: initialize

    function initialize()
    {
        $ini = eZINI::instance( 'xmlinstaller.ini' );
        $extensionDirectoryList = array_unique( $ini->variable( 'XMLInstallerSettings', 'ExtensionDirectories' ) );
        $handlerList = array_unique( $ini->variable( 'XMLInstallerSettings', 'XMLInstallerHandler' ) );

        foreach( $extensionDirectoryList as $extensionDirectory )
        {
            $handler = reset( $handlerList );
            do
            {
                $fileName = eZExtension::baseDirectory() . '/' . $extensionDirectory . '/xmlinstallerhandler/' . $handler . '.php';
                if ( file_exists( $fileName ) )
                {
                    include_once( $fileName );
                    $className = $handler;
                    $info = call_user_func(array($className, 'handlerInfo'));
                    if ( array_key_exists( 'XMLName', $info ) && array_key_exists( 'Info', $info ) )
                    {
                        $this->HandlerList[$info['XMLName']] = array( 'Info' => $info['Info'],
                                                                      'File' => $fileName,
                                                                      'Class' => $className );
                    }
                    unset($handlerList[key($handlerList)]);
                    $handler = current( $handlerList );
                }
                else
                {
                    $handler = next( $handlerList );
                }
            } while ( $handler );
        }
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:33,代码来源:ezxmlinstallerhandlermanager.php


示例2: getHandler

    /**
     * Returns an ajaxuploader handler instance from the ezjscore function
     * arguments.
     *
     * @param array $args the arguments of the ezjscore ajax function
     * @return ezpAjaxUploaderHandlerInterface
     *
     * @throws InvalidArgumentException if the handler cannot be instanciated
     */
    private static function getHandler( array $args )
    {
        if ( !isset( $args[0] ) )
        {
            throw new InvalidArgumentException(
                ezpI18n::tr(
                    'extension/ezjscore/ajaxuploader',
                    'Unable to find the identifier of ajax upload handler'
                )
            );
        }

        $http = eZHTTPTool::instance();
        $handlerData = $http->postVariable( 'AjaxUploadHandlerData', array() );

        $handlerOptions = new ezpExtensionOptions();
        $handlerOptions->iniFile = 'ezjscore.ini';
        $handlerOptions->iniSection = 'AjaxUploader';
        $handlerOptions->iniVariable = 'AjaxUploadHandler';
        $handlerOptions->handlerIndex = $args[0];
        $handlerOptions->handlerParams = $handlerData;

        $handler = eZExtension::getHandlerClass( $handlerOptions );

        if ( !$handler instanceof ezpAjaxUploaderHandlerInterface )
        {
            throw new InvalidArgumentException(
                ezpI18n::tr(
                    'extension/ezjscore/ajaxuploader',
                    'Unable to load the ajax upload handler'
                )
            );
        }
        return $handler;
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:44,代码来源:ezjscserverfunctionsajaxuploader.php


示例3: runPreRoutingFilters

    public function runPreRoutingFilters( ezcMvcRequest $request )
    {
        $prefixFilterOptions = new ezpExtensionOptions();
        $prefixFilterOptions->iniFile = 'rest.ini';
        $prefixFilterOptions->iniSection = 'System';
        $prefixFilterOptions->iniVariable = 'PrefixFilterClass';
        $prefixFilterOptions->handlerParams = array( $request, $this->apiPrefix );

        $prefixFilter = eZExtension::getHandlerClass( $prefixFilterOptions );
        $prefixFilter->filter();
        // We call this method here, so that implementors won't have to remember
        // adding this call to their own filter() implementation.
        $prefixFilter->filterRequestUri();

        try
        {
            $this->runCustomFilters( self::FILTER_TYPE_PREROUTING, array( 'request' => $request ) );
        }
        catch ( Exception $e )
        {
            $request->variables['exception'] = $e;
            $request->uri = $this->apiPrefix . '/fatal';
            return new ezcMvcInternalRedirect( $request );
        }
    }
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:25,代码来源:mvc_configuration.php


示例4: __construct

    /**
     * Constructor.
     *
     * $filePath File path. If specified, file metadata is fetched in the constructor.
     */
    function __construct( $filePath = false )
    {
        $filePath = eZDBFileHandler::cleanPath( $filePath );
        eZDebugSetting::writeDebug( 'kernel-clustering', "db::ctor( '$filePath' )" );

        if ( self::$dbbackend === null )
        {
            $optionArray = array( 'iniFile'     => 'file.ini',
                                  'iniSection'  => 'ClusteringSettings',
                                  'iniVariable' => 'DBBackend' );

            $options = new ezpExtensionOptions( $optionArray );

            self::$dbbackend = eZExtension::getHandlerClass( $options );
            self::$dbbackend->_connect( false );

            // connection failed
            if( self::$dbbackend->db === false )
                throw new eZClusterHandlerDBNoConnectionException( self::$dbbackend->dbparams['host'], self::$dbbackend->dbparams['user'], self::$dbbackend->dbparams['pass'] );
        }

        $this->filePath = $filePath;

        if ( !isset( $GLOBALS['eZDBFileHandler_Settings'] ) )
        {
            $fileINI = eZINI::instance( 'file.ini' );
            $GLOBALS['eZDBFileHandler_Settings']['NonExistantStaleCacheHandling'] = $fileINI->variable( "ClusteringSettings", "NonExistantStaleCacheHandling" );
            unset( $fileINI );
        }
        $this->nonExistantStaleCacheHandling = $GLOBALS['eZDBFileHandler_Settings']['NonExistantStaleCacheHandling'];
        $this->filePermissionMask = octdec( eZINI::instance()->variable( 'FileSettings', 'StorageFilePermissions' ) );
    }
开发者ID:nottavi,项目名称:ezpublish,代码行数:37,代码来源:ezdbfilehandler.php


示例5: __construct

    /**
     * Constructor
     *
     * If provided with $filePath, will use this file for further operations.
     * If not given, the file* methods must be used instead
     *
     * @param string $filePath Path of the file to handle
     *
     * @throws eZDBNoConnectionException DB connection failed
     */
    function __construct( $filePath = false )
    {
        if ( self::$nonExistantStaleCacheHandling === null )
        {
            $fileINI = eZINI::instance( 'file.ini' );
            self::$nonExistantStaleCacheHandling = $fileINI->variable( "ClusteringSettings", "NonExistantStaleCacheHandling" );
            unset( $fileINI );
        }

        // DB Backend init
        if ( self::$dbbackend === null )
        {
            self::$dbbackend = eZExtension::getHandlerClass(
                new ezpExtensionOptions(
                    array( 'iniFile'     => 'file.ini',
                           'iniSection'  => 'eZDFSClusteringSettings',
                           'iniVariable' => 'DBBackend' ) ) );
            self::$dbbackend->_connect( false );
        }

        if ( $filePath !== false )
        {
            $filePath = eZDBFileHandler::cleanPath( $filePath );
            eZDebugSetting::writeDebug( 'kernel-clustering', "dfs::ctor( '$filePath' )" );
        }
        else
        {
            eZDebugSetting::writeDebug( 'kernel-clustering', "dfs::ctor()" );
        }

        $this->filePath = $filePath;
    }
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:42,代码来源:ezdfsfilehandler.php


示例6: testComplexReordering

 public function testComplexReordering()
 {
     self::setExtensions( array( 'ezfind', 'ezflow', 'ezgmaplocation', 'ezjscore', 'ezmultiupload', 'ezoe', 'ezwebin', 'ezwt' ) );
     $this->assertSame(
         array( 'ezfind', 'ezflow', 'ezgmaplocation', 'ezjscore', 'ezmultiupload', 'ezoe', 'ezwebin', 'ezwt' ),
         eZExtension::activeExtensions() );
 }
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:7,代码来源:ezextension_no_ordering_test.php


示例7: gather

 static function gather()
 {
     $contentTypes = array('Objects (including users)' => array('table' => 'ezcontentobject'), 'Users' => array('table' => 'ezuser'), 'Nodes' => array('table' => 'ezcontentobject_tree'), 'Content Classes' => array('table' => 'ezcontentclass'), 'Information Collections' => array('table' => 'ezinfocollection'), 'Pending notification events' => array('table' => 'eznotificationevent', 'wherecondition' => 'status = 0'), 'Objects pending indexation' => array('table' => 'ezpending_actions', 'wherecondition' => "action = 'index_object'"), 'Binary files (content)' => array('table' => 'ezbinaryfile'), 'Image files (content)' => array('table' => 'ezimagefile'), 'Media files (content)' => array('table' => 'ezmedia'), 'Maximum children per node' => array('sql' => 'SELECT MAX(tot) AS NUM FROM ( SELECT count(*) AS tot FROM ezcontentobject_tree GROUP BY parent_node_id ) nodes'), 'Maximum nodes per object' => array('sql' => 'SELECT MAX(tot) AS NUM FROM ( SELECT count(*) AS tot FROM ezcontentobject_tree GROUP BY contentobject_id ) nodes'), 'Maximum incoming relations to an object' => array('sql' => 'SELECT MAX(tot) AS NUM FROM ( SELECT count(*) AS tot FROM ezcontentobject_link GROUP BY to_contentobject_id ) links', 'nvl' => 0), 'Maximum outgoing relations from an object' => array('sql' => 'SELECT MAX(tot) AS NUM FROM ( SELECT count(*) AS tot FROM ezcontentobject_link GROUP BY from_contentobject_id ) links', 'nvl' => 0));
     $db = eZDB::instance();
     $contentList = array();
     foreach ($contentTypes as $key => $desc) {
         if (isset($desc['table'])) {
             $sql = 'SELECT COUNT(*) AS NUM FROM ' . $desc['table'];
             if (@$desc['wherecondition']) {
                 $sql .= ' WHERE ' . $desc['wherecondition'];
             }
         } else {
             $sql = $desc['sql'];
         }
         $count = $db->arrayQuery($sql);
         $contentList[$key] = $count[0]['NUM'] === null ? $desc['nvl'] : $count[0]['NUM'];
     }
     if (in_array('ezfind', eZExtension::activeExtensions())) {
         $ini = eZINI::instance('solr.ini');
         $ezfindpingurl = $ini->variable('SolrBase', 'SearchServerURI') . "/admin/stats.jsp";
         $data = eZHTTPTool::getDataByURL($ezfindpingurl, false);
         //var_dump( $data );
         if (preg_match('#<stat +name="numDocs" ?>([^<]+)</stat>#', $data, $matches)) {
             $contentList['Documents in SOLR'] = trim($matches[1]);
         } else {
             $contentList['Documents in SOLR'] = 'Unknown';
         }
     }
     return $contentList;
 }
开发者ID:gggeek,项目名称:ggsysinfo,代码行数:30,代码来源:contentstatsgatherer.php


示例8: instance

 /**
  * Returns a shared instance of the eZShopAccountHandler class
  * as defined in shopaccount.ini[HandlerSettings]Repositories
  * and ExtensionRepositories.
  *
  * @return eZDefaultShopAccountHandler Or similar clases.
  */
 static function instance()
 {
     $accountHandler = null;
     if ( eZExtension::findExtensionType( array( 'ini-name' => 'shopaccount.ini',
                                                 'repository-group' => 'HandlerSettings',
                                                 'repository-variable' => 'Repositories',
                                                 'extension-group' => 'HandlerSettings',
                                                 'extension-variable' => 'ExtensionRepositories',
                                                 'type-group' => 'AccountSettings',
                                                 'type-variable' => 'Handler',
                                                 'alias-group' => 'AccountSettings',
                                                 'alias-variable' => 'Alias',
                                                 'subdir' => 'shopaccounthandlers',
                                                 'type-directory' => false,
                                                 'extension-subdir' => 'shopaccounthandlers',
                                                 'suffix-name' => 'shopaccounthandler.php' ),
                                          $out ) )
     {
         $filePath = $out['found-file-path'];
         include_once( $filePath );
         $class = $out['type'] . 'ShopAccountHandler';
         $accountHandler = new $class( );
     }
     else
     {
         $accountHandler = new eZDefaultShopAccountHandler();
     }
     return $accountHandler;
 }
开发者ID:nottavi,项目名称:ezpublish,代码行数:36,代码来源:ezshopaccounthandler.php


示例9: register

 /**
  * Register ezote/Autoloader::autoload as autoloader
  */
 public static function register($extensionDir = false)
 {
     if (!static::$registered) {
         static::$extensionDir = $extensionDir ?: \eZExtension::baseDirectory();
         static::$registered = spl_autoload_register(array(new self(), 'autoload'));
     }
 }
开发者ID:keyteqlabs,项目名称:ezote,代码行数:10,代码来源:Autoloader.php


示例10: loadHandler

 static function loadHandler($directories, $handlerString)
 {
     $foundHandler = false;
     $includeFile = '';
     $baseDirectory = eZExtension::baseDirectory();
     $notificationINI = eZINI::instance('notification.ini');
     $repositoryDirectories = $notificationINI->variable('NotificationEventHandlerSettings', 'RepositoryDirectories');
     $extensionDirectories = $notificationINI->variable('NotificationEventHandlerSettings', 'ExtensionDirectories');
     foreach ($extensionDirectories as $extensionDirectory) {
         $extensionPath = "{$baseDirectory}/{$extensionDirectory}/notification/handler/";
         if (file_exists($extensionPath)) {
             $repositoryDirectories[] = $extensionPath;
         }
     }
     foreach ($repositoryDirectories as $repositoryDirectory) {
         $repositoryDirectory = trim($repositoryDirectory, '/');
         $includeFile = "{$repositoryDirectory}/{$handlerString}/{$handlerString}handler.php";
         if (file_exists($includeFile)) {
             $foundHandler = true;
             break;
         }
     }
     if (!$foundHandler) {
         eZDebug::writeError("Notification handler does not exist: {$handlerString}", __METHOD__);
         return false;
     }
     include_once $includeFile;
     $className = $handlerString . "handler";
     return new $className();
 }
开发者ID:nfrp,项目名称:ezpublish,代码行数:30,代码来源:eznotificationeventfilter.php


示例11: instance

 /**
  * Returns a new instance of the eZUser class pr $protocol.
  *
  * @param string $protocol If not set to 'standard' (default), then the code will look
  *        for handler first in kernel/classes/datatypes/ezuser/, then according to
  *        site.ini[UserSettings]ExtensionDirectory settings
  * @return eZUser
  */
 static function instance($protocol = "standard")
 {
     $triedFiles = array();
     if ($protocol == "standard") {
         $impl = new eZUser(0);
         return $impl;
     } else {
         $ezuserFile = 'kernel/classes/datatypes/ezuser/ez' . strtolower($protocol) . 'user.php';
         $triedFiles[] = $ezuserFile;
         if (file_exists($ezuserFile)) {
             include_once $ezuserFile;
             $className = 'eZ' . $protocol . 'User';
             $impl = new $className();
             return $impl;
         } else {
             $ini = eZINI::instance();
             $extensionDirectories = $ini->variable('UserSettings', 'ExtensionDirectory');
             $directoryList = eZExtension::expandedPathList($extensionDirectories, 'login_handler');
             foreach ($directoryList as $directory) {
                 $userFile = $directory . '/ez' . strtolower($protocol) . 'user.php';
                 $triedFiles[] = $userFile;
                 if (file_exists($userFile)) {
                     include_once $userFile;
                     $className = 'eZ' . $protocol . 'User';
                     $impl = new $className();
                     return $impl;
                 }
             }
         }
     }
     // if no one appropriate instance was found
     eZDebug::writeWarning("Unable to find user login handler '{$protocol}', searched for these files: " . implode(', ', $triedFiles), __METHOD__);
     $impl = null;
     return $impl;
 }
开发者ID:patrickallaert,项目名称:ezpublish-legacy-php7,代码行数:43,代码来源:ezuserloginhandler.php


示例12: checkRecurrenceCondition

 function checkRecurrenceCondition($newsletter)
 {
     if (!$newsletter->attribute('recurrence_condition')) {
         return true;
     }
     if (0 < count($this->conditionExtensions)) {
         foreach ($this->conditionExtensions as $conditionExtension) {
             // TODO: Extend to ask multiple condition extensions to allow more complex checks
             $siteINI = eZINI::instance();
             $siteINI->loadCache();
             $extensionDirectory = $siteINI->variable('ExtensionSettings', 'ExtensionDirectory');
             $extensionDirectories = eZDir::findSubItems($extensionDirectory);
             $directoryList = eZExtension::expandedPathList($extensionDirectories, 'condition_handler');
             foreach ($directoryList as $directory) {
                 $handlerFile = $directory . '/' . strtolower($conditionExtension) . 'handler.php';
                 // we only check one extension for now
                 if ($conditionExtension === $newsletter->attribute('recurrence_condition') && file_exists($handlerFile)) {
                     include_once $handlerFile;
                     $className = $conditionExtension . 'Handler';
                     if (class_exists($className)) {
                         $impl = new $className();
                         // Ask if condition is fullfilled
                         return $impl->checkCondition($newsletter);
                     } else {
                         eZDebug::writeError("Class {$className} not found. Unable to verify recurrence condition. Blocked recurrence.");
                         return false;
                     }
                 }
             }
         }
     }
     // If we have a condition but no match we prevent the sendout
     eZDebug::writeError("Newsletter recurrence condition '" . $newsletter->attribute('recurrence_condition') . "' extension not found ");
     return false;
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:35,代码来源:ezrecurrence.php


示例13: get

 function get($oid)
 {
     $oidroot = $this->oidRoot();
     $oidroot = $oidroot[0];
     switch (preg_replace('/\\.0$/', '', $oid)) {
         case $oidroot . '1.1':
             if (in_array('ezfind', eZExtension::activeExtensions())) {
                 $ini = eZINI::instance('solr.ini');
                 $data = eZHTTPTool::getDataByURL($ini->variable('SolrBase', 'SearchServerURI') . "/admin/ping", false);
                 if (stripos($data, '<str name="status">OK</str>') !== false) {
                     $status = 1;
                 } else {
                     $status = 0;
                 }
             } else {
                 $status = -1;
             }
             return array('oid' => $oid, 'type' => eZSNMPd::TYPE_INTEGER, 'value' => $status);
         case $oidroot . '1.2':
             if (in_array('ezfind', eZExtension::activeExtensions())) {
                 $ini = eZINI::instance('solr.ini');
                 $data = eZHTTPTool::getDataByURL($ini->variable('SolrBase', 'SearchServerURI') . "/admin/stats.jsp", false);
                 if (preg_match('#<stat +name="numDocs" +>[ \\t\\r\\n]*(\\d+)[ \\t\\r\\n]*</stat>#', $data, $status)) {
                     $status = $status[1];
                 } else {
                     $status = -2;
                 }
             } else {
                 $status = -1;
             }
             return array('oid' => $oid, 'type' => eZSNMPd::TYPE_INTEGER, 'value' => $status);
     }
     return self::NO_SUCH_OID;
 }
开发者ID:gggeek,项目名称:ezsnmpd,代码行数:34,代码来源:ezsnmpdezfindhandler.php


示例14: __construct

 /**
  * Constructor
  *
  * If provided with $filePath, will use this file for further operations.
  * If not given, the file* methods must be used instead
  *
  * @param string $filePath Path of the file to handle
  *
  * @throws eZDBNoConnectionException DB connection failed
  */
 function __construct($filePath = false)
 {
     if (self::$nonExistantStaleCacheHandling === null) {
         $fileINI = eZINI::instance('file.ini');
         self::$nonExistantStaleCacheHandling = $fileINI->variable("ClusteringSettings", "NonExistantStaleCacheHandling");
         unset($fileINI);
     }
     // DB Backend init
     if (self::$dbbackend === null) {
         self::$dbbackend = eZExtension::getHandlerClass(new ezpExtensionOptions(array('iniFile' => 'file.ini', 'iniSection' => 'eZDFSClusteringSettings', 'iniVariable' => 'DBBackend')));
         self::$dbbackend->_connect(false);
         $fileINI = eZINI::instance('file.ini');
         if ($fileINI->variable('ClusterEventsSettings', 'ClusterEvents') === 'enabled' && self::$dbbackend instanceof eZClusterEventNotifier) {
             $listener = eZExtension::getHandlerClass(new ezpExtensionOptions(array('iniFile' => 'file.ini', 'iniSection' => 'ClusterEventsSettings', 'iniVariable' => 'Listener', 'handlerParams' => array(new eZClusterEventLoggerEzdebug()))));
             if ($listener instanceof eZClusterEventListener) {
                 self::$dbbackend->registerListener($listener);
                 $listener->initialize();
             }
         }
     }
     if ($filePath !== false) {
         $filePath = self::cleanPath($filePath);
         eZDebugSetting::writeDebug('kernel-clustering', "dfs::ctor( '{$filePath}' )");
     } else {
         eZDebugSetting::writeDebug('kernel-clustering', "dfs::ctor()");
     }
     $this->filePath = $filePath;
 }
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:38,代码来源:ezdfsfilehandler.php


示例15: getUserHash

 /**
  * Gets an instance of the StaticCacheHandler and ask it for the user hash.
  * 
  * @return string
  */
 static function getUserHash()
 {
     $optionArray = array('iniFile' => 'site.ini', 'iniSection' => 'ContentSettings', 'iniVariable' => 'StaticCacheHandler');
     $options = new ezpExtensionOptions($optionArray);
     $staticCacheHandler = eZExtension::getHandlerClass($options);
     return $staticCacheHandler->getUserHash();
 }
开发者ID:yannschepens,项目名称:mugo_varnish,代码行数:12,代码来源:MugoVarnishEvents.php


示例16: updateBlockPoolByBlockID

 /**
  * Update block pool for block with given $blockID
  *
  * @static
  * @param string $blockID
  * @param integer $publishedBeforeOrAt
  * @return integer
  */
 public static function updateBlockPoolByBlockID($block, $publishedBeforeOrAt = false)
 {
     $db = eZDB::instance();
     $blockINI = eZINI::instance('block.ini');
     if (!$publishedBeforeOrAt) {
         $publishedBeforeOrAt = time();
     }
     if (!$blockINI->hasVariable($block['block_type'], 'FetchClass')) {
         // Pure manual block, nothing is going to be fetched, but we need to update last_update as it is used for rotations
         if ($block['rotation_type'] != self::ROTATION_NONE) {
             $db->query("UPDATE ezm_block SET last_update={$publishedBeforeOrAt} WHERE id='" . $block['id'] . "'");
         }
         return 0;
     }
     $fetchClassOptions = new ezpExtensionOptions();
     $fetchClassOptions->iniFile = 'block.ini';
     $fetchClassOptions->iniSection = $block['block_type'];
     $fetchClassOptions->iniVariable = 'FetchClass';
     $fetchInstance = eZExtension::getHandlerClass($fetchClassOptions);
     if (!$fetchInstance instanceof eZFlowFetchInterface) {
         eZDebug::writeWarning("Can't create an instance of the {$fetchClass} class", "eZFlowOperations::updateBlockPoolByBlockID('" . $block['id'] . "')");
         return false;
     }
     $fetchFixedParameters = array();
     if ($blockINI->hasVariable($block['block_type'], 'FetchFixedParameters')) {
         $fetchFixedParameters = $blockINI->variable($block['block_type'], 'FetchFixedParameters');
     }
     $fetchParameters = unserialize($block['fetch_params']);
     if (!is_array($fetchParameters)) {
         // take care of blocks existing in db where ini definition changed
         eZDebug::writeWarning("Found existing block which has no necessary parameters serialized in the db (block needs updating)", "eZFlowOperations::updateBlockPoolByBlockID('" . $block['id'] . "')");
         $fetchParameters = array();
     }
     $parameters = array_merge($fetchFixedParameters, $fetchParameters);
     $newItems = array();
     foreach ($fetchInstance->fetch($parameters, $block['last_update'], $publishedBeforeOrAt) as $item) {
         $newItems[] = array('blockID' => $block['id'], 'objectID' => $item['object_id'], 'nodeID' => $item['node_id'], 'priority' => 0, 'timestamp' => $item['ts_publication']);
     }
     $itemsToRemove = 0;
     if (isset($parameters['Limit'])) {
         $count = $db->arrayQuery("SELECT count(*) as count FROM ezm_pool WHERE block_id='" . $block['id'] . "'");
         $itemsToRemove = (int) $count[0]['count'] + count($newItems) - (int) $parameters['Limit'];
     }
     if (!empty($newItems) || $itemsToRemove > 0) {
         $db->begin();
         if ($itemsToRemove > 0) {
             $db->query("DELETE FROM ezm_pool WHERE block_id='" . $block['id'] . "' ORDER BY ts_publication ASC LIMIT " . $itemsToRemove);
         }
         if (!empty($newItems)) {
             eZFlowPool::insertItems($newItems);
         }
         $db->query("UPDATE ezm_block SET last_update={$publishedBeforeOrAt} WHERE id='" . $block['id'] . "'");
         $db->commit();
     }
     return count($newItems);
 }
开发者ID:kuborgh,项目名称:ezflow-ls-extension,代码行数:64,代码来源:ezflowoperations.php


示例17: operator

 /**
  Executes the needed operator(s).
  Checks operator names, and calls the appropriate functions.
 */
 function modify($tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters)
 {
     switch ($operatorName) {
         case 'eZDebug':
             $operatorValue = $this->eZdebug($operatorValue, $namedParameters['debuglvl'], $namedParameters['label']);
             break;
         case 'objDebug':
             $operatorValue = $this->objdebug($operatorValue, $namedParameters['show_values'] == 'show', $namedParameters['level']);
             break;
         case 'objInspect':
             require_once 'kernel/common/template.php';
             $tpl = templateInit();
             $tpl->setVariable('counter', self::$inspectcounter);
             $exts = eZExtension::activeExtensions();
             $wstransport = '';
             if (in_array('ezjscore', $exts)) {
                 $wstransport = 'ezjscore';
             } else {
                 if (in_array('ggwebservices', $exts)) {
                     $wstransport = 'ggwebservices';
                 }
             }
             $tpl->setVariable('transport', $wstransport);
             if (class_exists('ezPOInspector')) {
                 $tpl->setVariable('value', json_encode(ezPOInspector::objInspect($operatorValue)));
                 $tpl->setVariable('error', false);
             } else {
                 $tpl->setVariable('value', null);
                 $tpl->setVariable('error', "Cannot inspect value: extension ezpersistentobject_inspector most likely missing");
             }
             $tpl->setVariable('sort_attributes', $namedParameters['sort_attributes']);
             $tpl->setVariable('send_to_debug', $namedParameters['send_to_debug']);
             $operatorValue = $tpl->fetch('design:ezdebug/objinspect.tpl');
             if ($namedParameters['send_to_debug']) {
                 // send div to debug output via a debug msg
                 $tpl = templateInit();
                 $tpl->setVariable('counter', self::$inspectcounter);
                 eZDebug::writeDebug($tpl->fetch('design:ezdebug/objinspectdebugoutput.tpl'), 'objInspect ' . self::$inspectcounter);
             }
             self::$inspectcounter++;
             break;
         case 'addTimingPoint':
             eZDebug::addTimingPoint($namedParameters['label']);
             $operatorValue = '';
             break;
         case 'numQueries':
             $operatorValue = $this->numqueries($namedParameters['cluster']);
             break;
         case 'getDefinedVars':
             $operatorValue = $this->getDefinedVars($tpl, $namedParameters['namespace'], $rootNamespace, $currentNamespace);
             break;
     }
 }
开发者ID:gggeek,项目名称:ezdebug,代码行数:57,代码来源:ezdebugoperators.php


示例18: create

    static function create( $handlerName = false )
    {
        $shopINI = eZINI::instance( 'shop.ini' );
        if ( $handlerName === false)
        {
           if ( $shopINI->hasVariable( 'ExchangeRatesSettings', 'ExchangeRatesUpdateHandler' ) )
               $handlerName = $shopINI->variable( 'ExchangeRatesSettings', 'ExchangeRatesUpdateHandler' );
        }

        $handlerName = strtolower( $handlerName );

        $dirList = array();
        $repositoryDirectories = $shopINI->variable( 'ExchangeRatesSettings', 'RepositoryDirectories' );
        $extensionDirectories = $shopINI->variable( 'ExchangeRatesSettings', 'ExtensionDirectories' );

        $baseDirectory = eZExtension::baseDirectory();
        foreach ( $extensionDirectories as $extensionDirectory )
        {
            if ( !empty( $extensionDirectory ) )
                $dirList[] = $baseDirectory . '/' . $extensionDirectory . '/exchangeratehandlers';
        }

        foreach ( $repositoryDirectories as $repositoryDirectory )
        {
            if ( !empty( $repositoryDirectory ) )
                $dirList[] = $repositoryDirectory;
        }

        $foundHandler = false;
        foreach ( $dirList as $dir )
        {
            $includeFile = "$dir/$handlerName/{$handlerName}handler.php";

            if ( file_exists( $includeFile ) )
            {
                $foundHandler = true;
                break;
            }
        }

        if ( !$foundHandler )
        {
            eZDebug::writeError( "Exchange rates update handler '$handlerName' not found, " .
                                   "searched in these directories: " .
                                   implode( ', ', $dirList ),
                                 'eZExchangeRatesUpdateHandler::create' );
            return false;
        }

        require_once( $includeFile );
        $className = $handlerName . 'handler';
        return new $className;
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:53,代码来源:ezexchangeratesupdatehandler.php


示例19: getRouteFilter

 /**
  * Returns the currently configured class for handling Route security.
  *
  * @static
  * @throws ezpRestRouteSecurityFilterNotFoundException
  * @return ezpRestRouteFilterInterface
  */
 public static function getRouteFilter()
 {
     $opt = new ezpExtensionOptions();
     $opt->iniFile = 'rest.ini';
     $opt->iniSection = 'RouteSettings';
     $opt->iniVariable = 'RouteSettingImpl';
     $routeSecurityFilterInstance = eZExtension::getHandlerClass($opt);
     if (!$routeSecurityFilterInstance instanceof self) {
         throw new ezpRestRouteSecurityFilterNotFoundException();
     }
     return $routeSecurityFilterInstance;
 }
开发者ID:nfrp,项目名称:ezpublish,代码行数:19,代码来源:route_filter.php


示例20: unload

 /**
  * Unloads an extension by removing it from ActiveExtensions setting,
  * clearing extensions cache and remove ini dir (not extension siteaccess)
  *
  * @param string $extension Extension name to unload
  * @return bool True on success, false if not loaded
  */
 public static function unload($extension)
 {
     $ini = eZINI::instance();
     $activeExtensions = $ini->variable('ExtensionSettings', 'ActiveExtensions');
     if (!in_array($extension, $activeExtensions, true)) {
         return false;
     }
     $ini->setVariable('ExtensionSettings', 'ActiveExtensions', array_diff($activeExtensions, array($extension)));
     $ini->removeOverrideDir('extension:' . $extension);
     eZExtension::clearActiveExtensionsMemoryCache();
     return true;
 }
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:19,代码来源:ezpextensionhelper.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP eZFile类代码示例发布时间:2022-05-23
下一篇:
PHP eZExpiryHandler类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap