當前位置: 首頁>>代碼示例>>PHP>>正文


PHP eZExtension::findExtensionType方法代碼示例

本文整理匯總了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;
 }
開發者ID:nottavi,項目名稱:ezpublish,代碼行數:36,代碼來源:ezshopaccounthandler.php

示例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;
 }
開發者ID:robinmuilwijk,項目名稱:ezpublish,代碼行數:44,代碼來源:ezimageanalyzer.php

示例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;
    }
開發者ID:robinmuilwijk,項目名稱:ezpublish,代碼行數:49,代碼來源:ezbinaryfile.php


注:本文中的eZExtension::findExtensionType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。