if ($include !== null) { $exclude = null; } // get the list of Objects to include in this client generate $additional = $item->get("additional"); // get the list of Objects to ignore $ignore = $item->get("ignore"); // get the list of Plugins to include in this client generate $pluginList = explode(',', $item->get("plugins")); // include the plugins requested for this package foreach ($pluginList as $plugin) { $pluginName = trim($plugin); if (!$pluginName) { continue; } KalturaPluginManager::addPlugin($pluginName); } // create the API schema to be used by the generator $reflectionClass = new ReflectionClass($generator); $fromXml = $reflectionClass->isSubclassOf("ClientGeneratorFromXml"); $fromPhp = $reflectionClass->isSubclassOf("ClientGeneratorFromPhp"); // if it's an XML schema based generator - if ($fromXml) { KalturaLog::info("Using XmlSchemaGenerator to generate the api schema"); if ($useReadySchema == null || $useReadySchema == '') { KalturaLog::info("Using code introspection to generate XML schema"); $xmlGenerator = new XmlClientGenerator(); $xmlGenerator->setIncludeOrExcludeList($include, $exclude, $excludePaths); $xmlGenerator->setIgnoreList($ignore); $xmlGenerator->setAdditionalList($additional); $xmlGenerator->generate();
// --------------------------------------------------------------------------- $xsltFilePath = ''; //TODO: change to valid xslt file path $metadataProfileId = null; //TODO: change to a valid metadata profile id // --------------------------------------------------------------------------- if (!$xsltFilePath) { die('ERROR - Missing parameter [$xsltFilePath]' . PHP_EOL); } if (!$metadataProfileId) { die('ERROR - Missing parameter [$metadataProfileId]' . PHP_EOL); } if (!file_exists($xsltFilePath)) { die('ERROR - Cannot find file at [' . $xsltFilePath . ']' . PHP_EOL); } require_once dirname(__FILE__) . '/../bootstrap.php'; require_once dirname(__FILE__) . '/../../api_v3/bootstrap.php'; KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "metadata", "*")); KAutoloader::setClassMapFilePath(kConf::get("cache_root_path") . '/scripts/' . basename(__FILE__) . '.cache'); KAutoloader::register(); KalturaPluginManager::addPlugin('MetadataPlugin'); $dbMetadataProfile = MetadataProfilePeer::retrieveById($metadataProfileId); if (!$dbMetadataProfile) { die('ERROR - Cannot find metadata profile with id [' . $metadataProfileId . ']' . PHP_EOL); } $dbMetadataProfile->incrementXsltVersion(); $dbMetadataProfile->save(); $key = $dbMetadataProfile->getSyncKey(MetadataProfile::FILE_SYNC_METADATA_XSLT); kFileSyncUtils::moveFromFile($xsltFilePath, $key, true, true); echo 'Done' . PHP_EOL;
<?php require_once __DIR__ . '/../../../../alpha/scripts/bootstrap.php'; if ($argc != 4) { echo "Arguments missing." . PHP_EOL . PHP_EOL; echo 'Usage: php ' . __FILE__ . ' {partner id} {edgecast account number} {api token}' . PHP_EOL; die; } $partnerId = $argv[1]; $accountNumber = $argv[2]; $apiToken = $argv[3]; KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "edgecast", "*")); KAutoloader::setClassMapFilePath(KALTURA_ROOT_PATH . '/cache/scripts/' . basename(__FILE__) . '.cache'); KAutoloader::register(); KalturaPluginManager::addPlugin('EdgeCastPlugin'); $partner = PartnerPeer::retrieveByPK($partnerId); if (!$partner) { die("No partner with ID [{$partnerId}]." . PHP_EOL); } $edgeCastParams = new kEdgeCastParams(); $edgeCastParams->setAccountNumber($accountNumber); $edgeCastParams->setApiToken($apiToken); EdgeCastPlugin::setEdgeCastParams($partner, $edgeCastParams); $partner->save(); echo "Done.";