本文整理汇总了PHP中eZExtension::baseDirectory方法的典型用法代码示例。如果您正苦于以下问题:PHP eZExtension::baseDirectory方法的具体用法?PHP eZExtension::baseDirectory怎么用?PHP eZExtension::baseDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZExtension
的用法示例。
在下文中一共展示了eZExtension::baseDirectory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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'));
}
}
示例2: 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();
}
示例3: 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 );
}
}
示例4: 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;
}
示例5: sPdf2png
function sPdf2png()
{
$ini = eZINI::instance('spdf2png.ini');
$this->cacheEnabled = $ini->variable('CacheSettings', 'Cache') == 'enabled';
$this->debugEnabled = $ini->variable('DebugSettings', 'DebugPDF') == 'enabled';
$this->javaExec = $ini->variable('BinarySettings', 'JavaExecutable');
$this->cacheTTL = $ini->variable('CacheSettings', 'TTL');
$fileSep = eZSys::fileSeparator();
$this->fileSep = $fileSep;
$this->extensionDir = eZSys::rootDir() . $fileSep . eZExtension::baseDirectory() . $fileSep . 'pdf2png';
//$this->paradoxPDFExec = $this->pdf2pngExtensionDir.$fileSep.'bin'.$fileSep.'paradoxpdf.jar';
$this->tmpDir = eZSys::rootDir() . $fileSep . 'var' . $fileSep . 'cache' . $fileSep . 'public' . $fileSep . 'pdf2png';
}
示例6: executeHandlerFunction
static function executeHandlerFunction($functionName, $params)
{
$result = array();
$contentINI = eZINI::instance('content.ini');
foreach (array_unique($contentINI->variable('EditSettings', 'ExtensionDirectories')) as $extensionDirectory) {
$fileName = eZExtension::baseDirectory() . '/' . $extensionDirectory . '/content/' . $extensionDirectory . 'handler.php';
if (file_exists($fileName)) {
include_once $fileName;
$className = $extensionDirectory . 'Handler';
$inputHandler = new $className();
$functionResult = call_user_func_array(array($inputHandler, $functionName), $params);
$result[] = array('handler' => $className, 'function' => array('name' => $functionName, 'value' => $functionResult));
}
}
return $result;
}
示例7: searchPathArray
/**
* @deprecated 4.3 No longer used as we rely on ezpExtension & autoloads
* @return array list of directories used to search cluster file handlers for
*/
static function searchPathArray()
{
if (!isset($GLOBALS['eZClusterFileHandler_search_path_array'])) {
$fileINI = eZINI::instance('file.ini');
$searchPathArray = array('kernel/classes/clusterfilehandlers', 'kernel/private/classes/clusterfilehandlers');
if ($fileINI->hasVariable('ClusteringSettings', 'ExtensionDirectories')) {
$extensionDirectories = $fileINI->variable('ClusteringSettings', 'ExtensionDirectories');
$baseDirectory = eZExtension::baseDirectory();
foreach ($extensionDirectories as $extensionDirectory) {
$customSearchPath = $baseDirectory . '/' . $extensionDirectory . '/clusterfilehandlers';
if (file_exists($customSearchPath)) {
$searchPathArray[] = $customSearchPath;
}
}
}
$GLOBALS['eZClusterFileHandler_search_path_array'] = $searchPathArray;
}
return $GLOBALS['eZClusterFileHandler_search_path_array'];
}
示例8: initialize
protected static function initialize($force = false)
{
if (self::$initialized && !$force) {
return;
}
self::$originaltpls = array();
$knowndirs = array('design');
foreach ($knowndirs as $phpdir) {
self::$originaltpls = array_merge(self::$originaltpls, self::scanDirFortpls($phpdir, true));
}
self::$extensiontpls = array();
$extensionsdir = eZExtension::baseDirectory();
$ini = eZINI::instance('design.ini');
/// @todo take this from an ini too, to allow user to add more known php files dirs
foreach ($ini->variable('ExtensionSettings', 'DesignExtensions') as $extdir) {
self::$extensiontpls = array_merge(self::$extensiontpls, self::scanDirFortpls("{$extensionsdir}/{$extdir}/design", true));
}
self::$tpl = sysInfoTools::eZTemplateFactory();
self::$initialized = true;
}
示例9: findPathToSiteAccess
/**
* Returns path to site access
*
* @param string $siteAccess
* @return string|false Return path to siteacces or false if invalid
*/
static function findPathToSiteAccess($siteAccess)
{
$ini = eZINI::instance();
$siteAccessList = $ini->variable('SiteAccessSettings', 'AvailableSiteAccessList');
if (!in_array($siteAccess, $siteAccessList)) {
return false;
}
$currentPath = 'settings/siteaccess/' . $siteAccess;
if (file_exists($currentPath)) {
return $currentPath;
}
$activeExtensions = eZExtension::activeExtensions();
$baseDir = eZExtension::baseDirectory();
foreach ($activeExtensions as $extension) {
$currentPath = $baseDir . '/' . $extension . '/settings/siteaccess/' . $siteAccess;
if (file_exists($currentPath)) {
return $currentPath;
}
}
return 'settings/siteaccess/' . $siteAccess;
}
示例10: initialize
protected static function initialize($force = false)
{
if (self::$initialized && !$force) {
return;
}
self::$originalphps = array();
$knowndirs = array('autoload', 'bin', 'cronjobs', 'kernel', 'lib', 'update');
foreach ($knowndirs as $phpdir) {
self::$originalphps = array_merge(self::$originalphps, self::scanDirForphps($phpdir, true));
}
self::$extensionphps = array();
$extensionsdir = eZExtension::baseDirectory();
$ini = eZINI::instance('site.ini');
/// @todo take this from an ini too, to allow user to add more known php files dirs
foreach ($ini->variable('ExtensionSettings', 'ActiveExtensions') as $extdir) {
self::$extensionphps = array_merge(self::$extensionphps, self::scanDirForphps("{$extensionsdir}/{$extdir}", true));
}
$php = 'php';
exec($php . ' -v', $output);
if (count($output) && strpos($output[0], 'PHP') !== false) {
self::$php = $php;
}
self::$initialized = true;
}
示例11: foreach
if ($dataTypeName === null) {
$cli->output("Error: The option --datatype is required. Add --help for more information.");
}
$allowedDatatypes = eZDataType::allowedTypes();
if ($dataTypeName !== null and in_array($dataTypeName, $allowedDatatypes)) {
// Inserting data from the dba-data files of the datatypes
eZDataType::loadAndRegisterAllTypes();
$registeredDataTypes = eZDataType::registeredDataTypes();
if (isset($registeredDataTypes[$dataTypeName])) {
$dataType = $registeredDataTypes[$dataTypeName];
if ($dataType->importDBDataFromDBAFile()) {
$cli->output("The database is updated for the datatype: " . $cli->style('emphasize') . $dataType->DataTypeString . $cli->style('emphasize-end') . "\n" . 'dba-data is imported from the file: ' . $cli->style('emphasize') . $dataType->getDBAFilePath() . $cli->style('emphasize-end'));
} else {
$activeExtensions = eZExtension::activeExtensions();
$errorString = "Failed importing datatype related data into database: \n" . ' datatype - ' . $dataType->DataTypeString . ", \n" . ' checked dba-data file - ' . $dataType->getDBAFilePath(false);
foreach ($activeExtensions as $activeExtension) {
$fileName = eZExtension::baseDirectory() . '/' . $activeExtension . '/datatypes/' . $dataType->DataTypeString . '/' . $dataType->getDBAFileName();
$errorString .= "\n" . str_repeat(' ', 23) . ' - ' . $fileName;
if (file_exists($fileName)) {
$errorString .= " (found, but not successfully imported)";
}
}
$cli->error($errorString);
}
} else {
$cli->error("Error: The datatype " . $dataTypeName . " does not exist.");
}
} else {
$cli->error("Error: The datatype " . $dataTypeName . " is not registered.");
}
$script->shutdown();
示例12: createExtendedAttributeFilterSQLStrings
/**
* Creates a filter array from extended attribute filters
*
* The filter array includes tables, joins, columns and grouping information
*
* @param array $extendedAttributeFilter
* @return array
*/
static function createExtendedAttributeFilterSQLStrings(&$extendedAttributeFilter)
{
$filter = array('tables' => '', 'joins' => '', 'columns' => '', 'group_by' => '');
if ($extendedAttributeFilter and count($extendedAttributeFilter) > 1) {
$extendedAttributeFilterID = $extendedAttributeFilter['id'];
$extendedAttributeFilterParams = $extendedAttributeFilter['params'];
$filterINI = eZINI::instance('extendedattributefilter.ini');
if (!$filterINI->hasGroup($extendedAttributeFilterID)) {
eZDebug::writeError("Unable to find configuration for the extended attribute filter '{$extendedAttributeFilterID}', the filter will be ignored", __METHOD__);
return $filter;
}
$filterClassName = $filterINI->variable($extendedAttributeFilterID, 'ClassName');
$filterMethodName = $filterINI->variable($extendedAttributeFilterID, 'MethodName');
if ($filterINI->hasVariable($extendedAttributeFilterID, 'FileName')) {
$filterFile = $filterINI->variable($extendedAttributeFilterID, 'FileName');
if ($filterINI->hasVariable($extendedAttributeFilterID, 'ExtensionName')) {
$extensionName = $filterINI->variable($extendedAttributeFilterID, 'ExtensionName');
include_once eZExtension::baseDirectory() . "/{$extensionName}/{$filterFile}";
} else {
include_once $filterFile;
}
}
if (!class_exists($filterClassName, true)) {
eZDebug::writeError("Unable to find the PHP class '{$filterClassName}' associated with the extended attribute filter '{$extendedAttributeFilterID}', the filter will be ignored", __METHOD__);
return $filter;
}
$classObject = new $filterClassName();
$parameterArray = array($extendedAttributeFilterParams);
$sqlResult = call_user_func_array(array($classObject, $filterMethodName), $parameterArray);
$filter['tables'] = $sqlResult['tables'];
$filter['joins'] = $sqlResult['joins'];
$filter['columns'] = isset($sqlResult['columns']) ? $sqlResult['columns'] : '';
if (isset($sqlResult['group_by'])) {
$filter['group_by'] = $sqlResult['group_by'];
}
}
return $filter;
}
示例13: fetchNewsletterTypeList
function fetchNewsletterTypeList()
{
$extension = 'eznewsletter';
$base = eZExtension::baseDirectory();
$baseDir = "{$base}/{$extension}/classes/";
return array('result' => eZNewsletterType::fetchList());
}
示例14: findDesignBase
/**
* Find the location on design bases on the disk
*
* @param $ini an eZINI object
* @param $siteAccess Wether to use siteaccesses or not
* @return array The list of design bases
*/
private static function findDesignBase(eZINI $ini, $siteAccess = false)
{
if ($siteAccess) {
$ini = eZSiteAccess::getIni($siteAccess, 'site.ini');
$standardDesign = $ini->variable('DesignSettings', 'StandardDesign');
$siteDesign = $ini->variable('DesignSettings', 'SiteDesign');
} else {
$ini = eZINI::instance();
$standardDesign = eZTemplateDesignResource::designSetting('standard');
$siteDesign = eZTemplateDesignResource::designSetting('site');
}
$siteDesignList = $ini->variable('DesignSettings', 'AdditionalSiteDesignList');
array_unshift($siteDesignList, $siteDesign);
$siteDesignList[] = $standardDesign;
$siteDesignList = array_unique($siteDesignList);
$designBaseList = array();
$extensionDirectory = eZExtension::baseDirectory();
$designStartPath = eZTemplateDesignResource::designStartPath();
$extensions = eZTemplateDesignResource::designExtensions();
foreach ($siteDesignList as $design) {
foreach ($extensions as $extension) {
$path = "{$extensionDirectory}/{$extension}/{$designStartPath}/{$design}";
if (file_exists($path)) {
$designBaseList[] = $path;
}
}
$path = "{$designStartPath}/{$design}";
if (file_exists($path)) {
$designBaseList[] = $path;
}
}
return $designBaseList;
}
示例15: array
}
$result = $customActionModule->run($customActionViewName, array());
if (isset($result['content']) && $result['content']) {
return $result;
} else {
$module->setExitStatus($customActionModule->exitStatus());
$module->setRedirectURI($customActionModule->redirectURI());
return $result;
}
} else {
return $module->run($customActionUrl);
}
}
}
// look for custom content action handlers
$baseDirectory = eZExtension::baseDirectory();
$contentINI = eZINI::instance('content.ini');
$extensionDirectories = $contentINI->variable('ActionSettings', 'ExtensionDirectories');
foreach ($extensionDirectories as $extensionDirectory) {
$extensionPath = $baseDirectory . '/' . $extensionDirectory . '/actions/content_actionhandler.php';
if (file_exists($extensionPath)) {
include_once $extensionPath;
$actionFunction = $extensionDirectory . '_ContentActionHandler';
if (function_exists($actionFunction)) {
$actionResult = $actionFunction($module, $http, $objectID);
if ($actionResult) {
return $actionResult;
}
}
}
}