本文整理汇总了PHP中eZExtension::expandedPathList方法的典型用法代码示例。如果您正苦于以下问题:PHP eZExtension::expandedPathList方法的具体用法?PHP eZExtension::expandedPathList怎么用?PHP eZExtension::expandedPathList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZExtension
的用法示例。
在下文中一共展示了eZExtension::expandedPathList方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: initializeIncludes
function initializeIncludes()
{
// If we have this global variable we shouldn't do any processing
if (!empty($GLOBALS['eZSimpleTagsInit'])) {
return;
}
$GLOBALS['eZSimpleTagsInit'] = true;
$ini = eZINI::instance('template.ini');
$extensions = $ini->variable('SimpleTagsOperator', 'Extensions');
$pathList = eZExtension::expandedPathList($extensions, 'simpletags');
$includeList = $ini->variable('SimpleTagsOperator', 'IncludeList');
foreach ($includeList as $includeFile) {
foreach ($pathList as $path) {
$file = $path . '/' . $includeFile;
if (file_exists($file)) {
include_once $file;
}
}
}
}
示例4: getEngine
static function getEngine()
{
// Get instance if already created.
$instanceName = "eZSearchPlugin_" . $GLOBALS["eZCurrentAccess"]["name"];
if ( isset( $GLOBALS[$instanceName] ) )
{
return $GLOBALS[$instanceName];
}
$ini = eZINI::instance();
$searchEngineString = 'ezsearch';
if ( $ini->hasVariable( 'SearchSettings', 'SearchEngine' ) == true )
{
$searchEngineString = $ini->variable( 'SearchSettings', 'SearchEngine' );
}
$directoryList = array();
if ( $ini->hasVariable( 'SearchSettings', 'ExtensionDirectories' ) )
{
$extensionDirectories = $ini->variable( 'SearchSettings', 'ExtensionDirectories' );
if ( is_array( $extensionDirectories ) )
{
$directoryList = eZExtension::expandedPathList( $extensionDirectories, 'search/plugins' );
}
}
$kernelDir = array( 'kernel/search/plugins' );
$directoryList = array_merge( $kernelDir, $directoryList );
foreach( $directoryList as $directory )
{
$searchEngineFile = implode( '/', array( $directory, strtolower( $searchEngineString ), strtolower( $searchEngineString ) ) ) . '.php';
if ( file_exists( $searchEngineFile ) )
{
eZDebugSetting::writeDebug( 'kernel-search-ezsearch', 'Loading search engine from ' . $searchEngineFile, 'eZSearch::getEngine' );
include_once( $searchEngineFile );
$GLOBALS[$instanceName] = new $searchEngineString();
return $GLOBALS[$instanceName];
}
}
eZDebug::writeDebug( 'Unable to find the search engine:' . $searchEngineString, 'eZSearch' );
eZDebug::writeDebug( 'Tried paths: ' . implode( ', ', $directoryList ), 'eZSearch' );
return false;
}
示例5: array_merge
}
if ($siteAccessChangeMessage) {
$cli->output($siteAccessChangeMessage);
} else {
$cli->output("Using siteaccess {$siteaccess} for cronjob");
}
if ($cronPart) {
$cli->output("Running cronjob part '{$cronPart}'");
}
$db = eZDB::instance();
$db->setIsSQLOutputEnabled($showSQL);
$ini = eZINI::instance('cronjob.ini');
$scriptDirectories = $ini->variable('CronjobSettings', 'ScriptDirectories');
/* Include extension directories */
$extensionDirectories = $ini->variable('CronjobSettings', 'ExtensionDirectories');
$scriptDirectories = array_merge($scriptDirectories, eZExtension::expandedPathList($extensionDirectories, 'cronjobs'));
if ($listCronjobs) {
foreach ($ini->groups() as $block => $blockValues) {
if (strpos($block, 'Cronjob') !== false) {
$cli->output($cli->endLineString());
$cli->output("{$block}:");
foreach ($blockValues['Scripts'] as $fileName) {
$fileExists = false;
foreach ($scriptDirectories as $scriptDirectory) {
$filePath = $scriptDirectory . "/" . $fileName;
if (file_exists($filePath)) {
$fileExists = true;
$cli->output("{$cli->goToColumn(4)} {$filePath}");
}
}
if (!$fileExists) {
示例6: loadTransformationFiles
function loadTransformationFiles($currentCharset, $transformationGroup)
{
$ini = eZINI::instance('transform.ini');
$repositoryList = array($ini->variable('Transformation', 'Repository'));
$files = $ini->variable('Transformation', 'Files');
$extensions = $ini->variable('Transformation', 'Extensions');
$repositoryList = array_merge($repositoryList, eZExtension::expandedPathList($extensions, 'transformations'));
// Check if the current charset maps to a unicode group
// If it does it can trigger loading of additional files
$unicodeGroups = array();
$charsets = $ini->variable('Transformation', 'Charsets');
foreach ($charsets as $entry) {
list($charset, $group) = explode(';', $entry, 2);
$charset = eZCharsetInfo::realCharsetCode($charset);
if ($charset == $currentCharset) {
if (!in_array($group, $unicodeGroups)) {
$unicodeGroups[] = $group;
}
}
}
// If we are using transformation groups then add that as
// a unicode group. This causes it load transformation files
// specific to that group.
if ($transformationGroup !== false) {
$unicodeGroups[] = $transformationGroup;
}
// Add any extra files from the unicode groups
foreach ($unicodeGroups as $unicodeGroup) {
if ($ini->hasGroup($unicodeGroup)) {
$files = array_merge($files, $ini->variable($unicodeGroup, 'Files'));
$extensions = $ini->variable($unicodeGroup, 'Extensions');
$repositoryList = array_merge($repositoryList, eZExtension::expandedPathList($extensions, 'transformations'));
}
}
foreach ($files as $file) {
// Only load files that are not currently loaded
if ($this->isTranformationLoaded($file)) {
continue;
}
foreach ($repositoryList as $repository) {
$trFile = $repository . '/' . $file;
if (file_exists($trFile)) {
$this->parseTransformationFile($trFile, $file);
}
}
}
}
示例7: instance
/**
* Returns a shared instance of the eZUser class pr $id value.
* If user can not be fetched, then anonymous user is returned and
* a warning trown, if anonymous user can not be fetched, then NoUser
* is returned and another warning is thrown.
*
* @param int|false $id On false: Gets current user id from session
* or from {@link eZUser::anonymousId()} if not set.
* @return eZUser
*/
static function instance($id = false)
{
if (!empty($GLOBALS["eZUserGlobalInstance_{$id}"])) {
return $GLOBALS["eZUserGlobalInstance_{$id}"];
}
$userId = $id;
$currentUser = null;
$http = eZHTTPTool::instance();
$anonymousUserID = self::anonymousId();
$sessionHasStarted = eZSession::hasStarted();
// If not specified get the current user
if ($userId === false) {
if ($sessionHasStarted) {
$userId = $http->sessionVariable('eZUserLoggedInID');
if (!is_numeric($userId)) {
$userId = $anonymousUserID;
eZSession::setUserID($userId);
$http->setSessionVariable('eZUserLoggedInID', $userId);
}
} else {
$userId = $anonymousUserID;
eZSession::setUserID($userId);
}
}
// Check user cache (this effectivly fetches user from cache)
// user not found if !isset( isset( $userCache['info'][$userId] ) )
$userCache = self::getUserCacheByUserId($userId);
if (isset($userCache['info'][$userId])) {
$userArray = $userCache['info'][$userId];
if (is_numeric($userArray['contentobject_id'])) {
$currentUser = new eZUser($userArray);
$currentUser->setUserCache($userCache);
}
}
$ini = eZINI::instance();
// Check if:
// - the user has not logged out,
// - the user is not logged in,
// - and if a automatic single sign on plugin is enabled.
if (!self::$userHasLoggedOut and is_object($currentUser) and !$currentUser->isLoggedIn()) {
$ssoHandlerArray = $ini->variable('UserSettings', 'SingleSignOnHandlerArray');
if (!empty($ssoHandlerArray)) {
$ssoUser = false;
foreach ($ssoHandlerArray as $ssoHandler) {
// Load handler
$handlerFile = 'kernel/classes/ssohandlers/ez' . strtolower($ssoHandler) . 'ssohandler.php';
if (file_exists($handlerFile)) {
include_once $handlerFile;
$className = 'eZ' . $ssoHandler . 'SSOHandler';
$impl = new $className();
$ssoUser = $impl->handleSSOLogin();
} else {
$extensionDirectories = $ini->variable('UserSettings', 'ExtensionDirectory');
$directoryList = eZExtension::expandedPathList($extensionDirectories, 'sso_handler');
foreach ($directoryList as $directory) {
$handlerFile = $directory . '/ez' . strtolower($ssoHandler) . 'ssohandler.php';
if (file_exists($handlerFile)) {
include_once $handlerFile;
$className = 'eZ' . $ssoHandler . 'SSOHandler';
$impl = new $className();
$ssoUser = $impl->handleSSOLogin();
}
}
}
}
// If a user was found via SSO, then use it
if ($ssoUser !== false) {
$currentUser = $ssoUser;
$userId = $currentUser->attribute('contentobject_id');
$userInfo = array();
$userInfo[$userId] = array('contentobject_id' => $userId, 'login' => $currentUser->attribute('login'), 'email' => $currentUser->attribute('email'), 'password_hash' => $currentUser->attribute('password_hash'), 'password_hash_type' => $currentUser->attribute('password_hash_type'));
eZSession::setUserID($userId);
$http->setSessionVariable('eZUserLoggedInID', $userId);
eZUser::updateLastVisit($userId);
eZUser::setCurrentlyLoggedInUser($currentUser, $userId);
eZHTTPTool::redirect(eZSys::wwwDir() . eZSys::indexFile(false) . eZSys::requestURI(), array(), 302);
eZExecution::cleanExit();
}
}
}
if ($userId != $anonymousUserID) {
$sessionInactivityTimeout = $ini->variable('Session', 'ActivityTimeout');
if (!isset($GLOBALS['eZSessionIdleTime'])) {
eZUser::updateLastVisit($userId);
} else {
$sessionIdle = $GLOBALS['eZSessionIdleTime'];
if ($sessionIdle > $sessionInactivityTimeout) {
eZUser::updateLastVisit($userId);
}
}
//.........这里部分代码省略.........
示例8: modify
/**
* @param $tpl eZTemplate
* @param $operatorName array
* @param $operatorParameters array
* @param $rootNamespace string
* @param $currentNamespace string
* @param $operatorValue mixed
* @param $namedParameters array
*
* @return mixed
*/
function modify(&$tpl, &$operatorName, &$operatorParameters, &$rootNamespace, &$currentNamespace, &$operatorValue, &$namedParameters)
{
$ini = eZINI::instance('ocoperatorscollection.ini');
$appini = eZINI::instance('app.ini');
switch ($operatorName) {
case 'related_attribute_objects':
$object = $operatorValue;
$identifier = $namedParameters['identifier'];
$dataMap = $object instanceof eZContentObject || $object instanceof eZContentObjectTreeNode ? $object->attribute('data_map') : array();
$data = array();
if (isset($dataMap[$identifier])) {
$ids = $dataMap[$identifier] instanceof eZContentObjectAttribute ? explode('-', $dataMap[$identifier]->toString()) : array();
if (!empty($ids)) {
$data = eZContentObject::fetchList(true, array("id" => array($ids)));
}
}
$operatorValue = $data;
break;
case 'smart_override':
$identifier = $namedParameters['identifier'];
$view = $namedParameters['view'];
$node = $operatorValue;
$operatorValue = $this->findSmartTemplate($identifier, $view, $node);
break;
case 'parse_link_href':
$href = $operatorValue;
$hrefParts = explode(':', $href);
$hrefFirst = array_shift($hrefParts);
if (!in_array($hrefFirst, array('http', 'https', 'file', 'mailto', 'ftp'))) {
if (!empty($hrefFirst)) {
$nodeID = eZURLAliasML::fetchNodeIDByPath('/' . $hrefFirst);
if ($nodeID) {
$contentNode = eZContentObjectTreeNode::fetch($nodeID);
if ($contentNode instanceof eZContentObjectTreeNode) {
$keyArray = array(array('node', $contentNode->attribute('node_id')), array('object', $contentNode->attribute('contentobject_id')), array('class_identifier', $contentNode->attribute('class_identifier')), array('class_group', $contentNode->attribute('object')->attribute('content_class')->attribute('match_ingroup_id_list')));
$tpl = new eZTemplate();
$ini = eZINI::instance();
$autoLoadPathList = $ini->variable('TemplateSettings', 'AutoloadPathList');
$extensionAutoloadPath = $ini->variable('TemplateSettings', 'ExtensionAutoloadPath');
$extensionPathList = eZExtension::expandedPathList($extensionAutoloadPath, 'autoloads/');
$autoLoadPathList = array_unique(array_merge($autoLoadPathList, $extensionPathList));
$tpl->setAutoloadPathList($autoLoadPathList);
$tpl->autoload();
$tpl->setVariable('node', $contentNode);
$tpl->setVariable('object', $contentNode->attribute('object'));
$tpl->setVariable('original_href', $href);
$res = new eZTemplateDesignResource();
$res->setKeys($keyArray);
$tpl->registerResource($res);
$result = trim($tpl->fetch('design:link/href.tpl'));
if (!empty($result)) {
$href = $result;
}
}
}
}
}
return $operatorValue = $href;
break;
case 'gmap_static_image':
try {
$cacheFileNames = array();
//@todo
$operatorValue = OCOperatorsCollectionsTools::gmapStaticImage($namedParameters['parameters'], $namedParameters['attribute'], $cacheFileNames);
} catch (Exception $e) {
eZDebug::writeError($e->getMessage(), 'gmap_static_image');
}
break;
case 'fa_class_icon':
$faIconIni = eZINI::instance('fa_icons.ini');
$node = $operatorValue;
$data = $namedParameters['fallback'] != '' ? $namedParameters['fallback'] : $faIconIni->variable('ClassIcons', '_fallback');
if ($node instanceof eZContentObjectTreeNode) {
if ($faIconIni->hasVariable('ClassIcons', $node->attribute('class_identifier'))) {
$data = $faIconIni->variable('ClassIcons', $node->attribute('class_identifier'));
}
}
$operatorValue = $data;
break;
case 'fa_object_icon':
$faIconIni = eZINI::instance('fa_icons.ini');
$object = $operatorValue;
$data = $namedParameters['fallback'] != '' ? $namedParameters['fallback'] : '';
if ($object instanceof eZContentObject) {
if ($faIconIni->hasVariable('ObjectIcons', $object->attribute('id'))) {
$data = $faIconIni->variable('ObjectIcons', $object->attribute('id'));
}
} else {
if ($faIconIni->hasVariable('ObjectIcons', $node)) {
//.........这里部分代码省略.........