本文整理汇总了PHP中eZExtension::findExtensionType方法的典型用法代码示例。如果您正苦于以下问题:PHP eZExtension::findExtensionType方法的具体用法?PHP eZExtension::findExtensionType怎么用?PHP eZExtension::findExtensionType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZExtension
的用法示例。
在下文中一共展示了eZExtension::findExtensionType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: create
static function create( $analyzerName )
{
$analyzerData = eZImageAnalyzer::analyzerData();
if ( !isset( $analyzerData['handlers'][$analyzerName] ) )
{
if ( eZExtension::findExtensionType( array( 'ini-name' => 'image.ini',
'repository-group' => 'AnalyzerSettings',
'repository-variable' => 'RepositoryList',
'extension-group' => 'AnalyzerSettings',
'extension-variable' => 'ExtensionList',
'extension-subdir' => 'imageanalyzer',
'alias-group' => 'AnalyzerSettings',
'alias-variable' => 'ImageAnalyzerAlias',
'suffix-name' => 'imageanalyzer.php',
'type-directory' => false,
'type' => $analyzerName ),
$result ) )
{
$filepath = $result['found-file-path'];
include_once( $filepath );
$className = $result['type'] . 'imageanalyzer';
$analyzerData['handlers'][$analyzerName] = array( 'classname' => $className,
'filepath' => $filepath );
}
else
{
eZDebug::writeWarning( "Could not locate Image Analyzer for $analyzerName", __METHOD__ );
}
}
if ( isset( $analyzerData['handlers'][$analyzerName] ) )
{
$analyzer = $analyzerData['handlers'][$analyzerName];
$className = $analyzer['classname'];
if ( class_exists( $className ) )
{
return new $className();
}
else
{
eZDebug::writeWarning( "The Image Analyzer class $className was not found, cannot create analyzer", __METHOD__ );
}
}
return false;
}
示例3: metaData
function metaData()
{
$metaData = "";
$binaryINI = eZINI::instance( 'binaryfile.ini' );
$handlerSettings = $binaryINI->variable( 'HandlerSettings', 'MetaDataExtractor' );
if ( isset( $handlerSettings[$this->MimeType] ) )
{
// Check if plugin exists
if ( eZExtension::findExtensionType( array( 'ini-name' => 'binaryfile.ini',
'repository-group' => 'HandlerSettings',
'repository-variable' => 'Repositories',
'extension-group' => 'HandlerSettings',
'extension-variable' => 'ExtensionRepositories',
'type-directory' => false,
'type' => $handlerSettings[$this->MimeType],
'subdir' => 'plugins',
'extension-subdir' => 'plugins',
'suffix-name' => 'parser.php' ),
$out ) )
{
$filePath = $out['found-file-path'];
include_once( $filePath );
$class = $handlerSettings[$this->MimeType] . 'Parser';
$parserObject = new $class( );
$fileInfo = $this->storedFileInfo();
$file = eZClusterFileHandler::instance( $fileInfo['filepath'] );
if ( $file->exists() )
{
$fetchedFilePath = $file->fetchUnique();
$metaData = $parserObject->parseFile( $fetchedFilePath );
$file->fileDeleteLocal( $fetchedFilePath );
}
}
else
{
eZDebug::writeWarning( "Plugin for $this->MimeType was not found", 'eZBinaryFile' );
}
}
else
{
eZDebug::writeWarning( "Mimetype $this->MimeType not supported for indexing", 'eZBinaryFile' );
}
return $metaData;
}