当前位置: 首页>>代码示例>>PHP>>正文


PHP kPluginableEnumsManager::getPlugin方法代码示例

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


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

示例1: contributeToConvertJobData

 /**
  * 
  * Allow plugin to set additional information on ConvertJobData object
  * 
  * @param string $conversionEngineId
  * @param kConvertJobData $convertData
  */
 private static function contributeToConvertJobData($conversionEngineId, kConvertJobData &$convertData)
 {
     $plugin = kPluginableEnumsManager::getPlugin($conversionEngineId);
     if ($plugin && $plugin instanceof IKalturaBatchJobDataContributor) {
         KalturaLog::log("Setting additional data by plugin");
         $convertData = $plugin->contributeToConvertJobData(BatchJobType::CONVERT, $conversionEngineId, $convertData);
     }
 }
开发者ID:ace3535,项目名称:server,代码行数:15,代码来源:kJobsManager.php

示例2: getSchemaPath

    /**
     * @param KalturaSchemaType $type  
     * @return string filePath 
     */
    public static function getSchemaPath($type)
    {
        $cacheXsdFile = kConf::get("cache_root_path") . "/{$type}.xsd";
        if (file_exists($cacheXsdFile)) {
            return realpath($cacheXsdFile);
        }
        $xsdFile = fopen($cacheXsdFile, 'w');
        $elementsXSD = '';
        $baseXsdElement = new SimpleXMLElement('<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"/>');
        if ($type == SchemaType::SYNDICATION) {
            $baseXsdElement = new SimpleXMLElement(file_get_contents(kConf::get("syndication_core_xsd_path")));
        } else {
            $plugin = kPluginableEnumsManager::getPlugin($type);
            if ($plugin instanceof IKalturaSchemaDefiner) {
                KalturaLog::debug("Found plugin [" . get_class($plugin) . "]");
                $baseXsdElement = $plugin->getPluginSchema($type);
            }
        }
        if (!$baseXsdElement instanceof SimpleXMLElement) {
            $baseXsdElement = new SimpleXMLElement('<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"/>');
        }
        $version = '1.0';
        if ($baseXsdElement['version']) {
            $version = $baseXsdElement['version'];
        }
        fwrite($xsdFile, "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" version=\"{$version}\">");
        foreach ($baseXsdElement->children('http://www.w3.org/2001/XMLSchema') as $element) {
            /* @var $element SimpleXMLElement */
            $xsd = $element->asXML();
            $elementsXSD .= $xsd;
            fwrite($xsdFile, '
	' . $xsd);
        }
        $schemaContributors = KalturaPluginManager::getPluginInstances('IKalturaSchemaContributor');
        foreach ($schemaContributors as $key => $schemaContributor) {
            /* @var $schemaContributor IKalturaSchemaContributor */
            $elements = $schemaContributor->contributeToSchema($type);
            if ($elements) {
                $elementsXSD .= $elements;
                fwrite($xsdFile, $elements);
            }
        }
        fwrite($xsdFile, '
	<!-- Kaltura enum types -->
	');
        $enumClasses = array();
        $matches = null;
        if (preg_match_all('/type="(Kaltura[^"]+)"/', $elementsXSD, $matches)) {
            $enumClasses = $matches[1];
        }
        $enumTypes = array();
        foreach ($enumClasses as $class) {
            $classTypeReflector = KalturaTypeReflectorCacher::get($class);
            if ($classTypeReflector) {
                self::loadClassRecursively($classTypeReflector, $enumTypes);
            }
        }
        foreach ($enumTypes as $class => $classTypeReflector) {
            if (!is_subclass_of($class, 'KalturaEnum') && !is_subclass_of($class, 'KalturaStringEnum')) {
                // class must be enum
                continue;
            }
            $xsdType = 'int';
            if ($classTypeReflector->isStringEnum()) {
                $xsdType = 'string';
            }
            $xsd = '
	<xs:simpleType name="' . $class . '">
		<xs:annotation><xs:documentation>http://' . kConf::get('www_host') . '/api_v3/testmeDoc/index.php?object=' . $class . '</xs:documentation></xs:annotation>
		<xs:restriction base="xs:' . $xsdType . '">';
            $contants = $classTypeReflector->getConstants();
            foreach ($contants as $contant) {
                $xsd .= '
			<xs:enumeration value="' . $contant->getDefaultValue() . '"><xs:annotation><xs:documentation>' . $contant->getName() . '</xs:documentation></xs:annotation></xs:enumeration>';
            }
            $xsd .= '
		</xs:restriction>
	</xs:simpleType>
			';
            fwrite($xsdFile, $xsd);
        }
        fwrite($xsdFile, '
</xs:schema>');
        fclose($xsdFile);
        return realpath($cacheXsdFile);
    }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:90,代码来源:SchemaService.php

示例3: getCuePointTypeToClone

 /**
  * @param entry $entry
  * @return array
  */
 private static function getCuePointTypeToClone($entry)
 {
     $listOfEnumIds = array();
     $cue_point_plugin_map = kPluginableEnumsManager::getCoreMap('CuePointType');
     foreach ($cue_point_plugin_map as $dynamic_enum_id => $plugin_name) {
         $plugin = kPluginableEnumsManager::getPlugin($plugin_name);
         if ($plugin::shouldCloneByProperty($entry) == true) {
             $listOfEnumIds[] = $dynamic_enum_id;
         }
     }
     return $listOfEnumIds;
 }
开发者ID:wzur,项目名称:server,代码行数:16,代码来源:kCuePointManager.php


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