public function Infra_InfraLoader(Zend_Config $config = null) { $infaFolder = null; $pluginsFolder = null; $cachePath = null; if ($config) { if (isset($config->cachePath)) { $cachePath = $config->cachePath; } if (isset($config->infaFolder)) { $infaFolder = $config->infaFolder; } if (isset($config->pluginsFolder)) { $pluginsFolder = $config->pluginsFolder; } } if (!$infaFolder) { $infaFolder = realpath(dirname(__FILE__) . '/../../infra/'); } if (!$pluginsFolder) { $pluginsFolder = realpath(dirname(__FILE__) . '/../../plugins/'); } if (!$cachePath) { $cachePath = kEnvironment::get("cache_root_path") . '/infra/classMap.cache'; } require_once $infaFolder . DIRECTORY_SEPARATOR . 'KAutoloader.php'; require_once $infaFolder . DIRECTORY_SEPARATOR . 'kEnvironment.php'; KAutoloader::setClassPath(array($infaFolder . DIRECTORY_SEPARATOR . '*')); KAutoloader::addClassPath(KAutoloader::buildPath($pluginsFolder, '*')); KAutoloader::setClassMapFilePath($cachePath); KAutoloader::register(); }
/** * @param string $type * @return KalturaTypeReflector */ static function get($type) { if (!self::$_enabled) { return new KalturaTypeReflector($type); } if (!array_key_exists($type, self::$_loadedTypeReflectors)) { $cachedDir = KAutoloader::buildPath(kConf::get("cache_root_path"), "api_v3", "typeReflector"); if (!is_dir($cachedDir)) { mkdir($cachedDir); chmod($cachedDir, 0755); } $cachedFilePath = $cachedDir . DIRECTORY_SEPARATOR . $type . ".cache"; $typeReflector = null; if (file_exists($cachedFilePath)) { $cachedData = file_get_contents($cachedFilePath); $typeReflector = unserialize($cachedData); } if (!$typeReflector) { $typeReflector = new KalturaTypeReflector($type); $cachedData = serialize($typeReflector); $bytesWritten = kFile::safeFilePutContents($cachedFilePath, $cachedData); if (!$bytesWritten) { $folderPermission = substr(decoct(fileperms(dirname($cachedFilePath))), 2); error_log("Kaltura type reflector could not be saved to path [{$cachedFilePath}] type [{$type}] folder permisisons [{$folderPermission}]"); } } self::$_loadedTypeReflectors[$type] = $typeReflector; } return self::$_loadedTypeReflectors[$type]; }
public function Infra_InfraLoader() { $infaDir = realpath(dirname(__FILE__) . '/../../infra/'); $pluginsDir = realpath(dirname(__FILE__) . '/../../plugins/'); require_once $infaDir . DIRECTORY_SEPARATOR . 'bootstrap_base.php'; require_once $infaDir . DIRECTORY_SEPARATOR . 'KAutoloader.php'; KAutoloader::setClassPath(array($infaDir . DIRECTORY_SEPARATOR . '*')); KAutoloader::addClassPath(KAutoloader::buildPath($pluginsDir, '*')); KAutoloader::setClassMapFilePath(kConf::get("cache_root_path") . '/admin/classMap.cache'); KAutoloader::register(); }
/** * @param string $type * @return KalturaTypeReflector */ static function get($type) { if (!self::$_enabled) { return new KalturaTypeReflector($type); } if (!array_key_exists($type, self::$_loadedTypeReflectors)) { $cachedDir = KAutoloader::buildPath(kConf::get("cache_root_path"), "api_v3", "typeReflector"); if (!is_dir($cachedDir)) { mkdir($cachedDir); } $cachedFilePath = $cachedDir . DIRECTORY_SEPARATOR . $type . ".cache"; if (file_exists($cachedFilePath)) { $cachedData = file_get_contents($cachedFilePath); $typeReflector = unserialize($cachedData); } else { $typeReflector = new KalturaTypeReflector($type); $cachedData = serialize($typeReflector); file_put_contents($cachedFilePath, $cachedData); } self::$_loadedTypeReflectors[$type] = $typeReflector; } return self::$_loadedTypeReflectors[$type]; }
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "infra" . DIRECTORY_SEPARATOR . "bootstrap_base.php"; define("KALTURA_TESTS_PATH", KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . "tests"); require_once KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . 'infra' . DIRECTORY_SEPARATOR . 'kConf.php'; // Autoloader require_once KALTURA_INFRA_PATH . DIRECTORY_SEPARATOR . "KAutoloader.php"; KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "phpseclib", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "infra", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_TESTS_PATH, "base", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_TESTS_PATH, "lib", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_TESTS_PATH, "api", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_TESTS_PATH, "common", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_TESTS_PATH, "unitTests", "*")); set_include_path(get_include_path() . PATH_SEPARATOR . KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "phpseclib")); //$paths = explode(PATH_SEPARATOR, get_include_path()); //foreach($paths as $path) // KAutoloader::addClassPath(KAutoloader::buildPath($path, "*")); KAutoloader::setClassMapFilePath(kConf::get("cache_root_path") . '/tests/classMap.cache'); //KAutoloader::dumpExtra(); KAutoloader::register(); // Timezone $timeZone = kConf::get("date_default_timezone"); $isTimeZone = substr_count($timeZone, '@') == 0; //no @ in a real time zone if ($isTimeZone) { date_default_timezone_set($timeZone); } // America/New_York // Logger
<?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.";
<?php error_reporting(E_ALL); ini_set("memory_limit", "128M"); define('SF_ROOT_DIR', realpath(dirname(__FILE__) . '/../../alpha/')); define('SF_APP', 'kaltura'); define('SF_ENVIRONMENT', 'batch'); define('SF_DEBUG', true); require_once SF_ROOT_DIR . '/../infra/bootstrap_base.php'; require_once KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR . "infra" . DIRECTORY_SEPARATOR . "bootstrap_base.php"; require_once KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . 'infra' . DIRECTORY_SEPARATOR . 'kConf.php'; // Autoloader require_once KALTURA_INFRA_PATH . DIRECTORY_SEPARATOR . "KAutoloader.php"; KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "alpha", "lib", "*")); // needed for testmeDoc KAutoloader::setClassMapFilePath(kConf::get("cache_root_path") . '/scripts/' . basename(__FILE__) . '.cache'); KAutoloader::register(); $dbConf = kConf::getDB(); DbManager::setConfig($dbConf); DbManager::initialize(); if ($argc == 3) { $flavor_param_id = $argv[1]; $conversion_profile_id = $argv[2]; } else { die('usage: php ' . $_SERVER['SCRIPT_NAME'] . " [flavor_param_id] [conversion profile id]" . PHP_EOL); } $conversion_flavor = flavorParamsConversionProfilePeer::retrieveByFlavorParamsAndConversionProfile($flavor_param_id, $conversion_profile_id); if (!$conversion_flavor) { die('no such flavor param id and conversion profile id.' . PHP_EOL); }
/** * * Used to initialize the ui conf deployment like a bootstarp fiel * @param unknown_type $conf_file_path */ public static function init($conf_file_path) { require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "infra" . DIRECTORY_SEPARATOR . "bootstrap_base.php"; require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "infra" . DIRECTORY_SEPARATOR . "kConf.php"; define("KALTURA_API_PATH", KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . "api_v3"); // Autoloader require_once KALTURA_INFRA_PATH . DIRECTORY_SEPARATOR . "KAutoloader.php"; KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_API_PATH, "lib", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_API_PATH, "services", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "alpha", "plugins", "*")); // needed for testmeDoc KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "generator")); // needed for testmeDoc KAutoloader::setClassMapFilePath(kConf::get("cache_root_path") . '/deploy/' . basename(__FILE__) . '.cache'); //KAutoloader::dumpExtra(); KAutoloader::register(); $dbConf = kConf::getDB(); DbManager::setConfig($dbConf); DbManager::initialize(); date_default_timezone_set(kConf::get("date_default_timezone")); // try // { $confObj = new Zend_Config_Ini($conf_file_path); // } // catch(Exception $ex) // { // echo 'Exiting on ERROR: '.$ex->getMessage().PHP_EOL; // exit(1); // } return $confObj; }
* in case this script is run to change display in search values for specific partner, * remember that the sphinx needs to be synchronized to the DB. * after running this script (makePartnerEntriesPublic __PARTNER_ID__), * pleas run the updatePartnerEntries2Sphinx.php script (updatePartnerEntries2Sphinx __PARTNER_ID__), * in order to allow sphinx DB full synchronization with respect to __PARTNER_ID */ ini_set("memory_limit", "256M"); define('SF_ROOT_DIR', realpath(dirname(__FILE__) . '/../../alpha/')); define('SF_APP', 'kaltura'); define('SF_ENVIRONMENT', 'batch'); define('SF_DEBUG', true); require_once SF_ROOT_DIR . DIRECTORY_SEPARATOR . 'apps' . DIRECTORY_SEPARATOR . SF_APP . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.php'; require_once SF_ROOT_DIR . '/../infra/bootstrap_base.php'; require_once KALTURA_INFRA_PATH . DIRECTORY_SEPARATOR . "KAutoloader.php"; KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "api_v3", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "batch", "mediaInfoParser", "*")); KAutoloader::setClassMapFilePath('./logs/classMap.cache'); KAutoloader::register(); error_reporting(E_ALL); $dbConf = kConf::getDB(); DbManager::setConfig($dbConf); DbManager::initialize(); if (count($argv) !== 2) { die('pleas provide partner id as input' . PHP_EOL . 'to run script: ' . basename(__FILE__) . ' X' . PHP_EOL . 'whereas X is partner id' . PHP_EOL); } $partner_id = @$argv[1]; $partner = PartnerPeer::retrieveByPK($partner_id); if (!$partner) { die('no such partner.' . PHP_EOL); } $partner->setAppearInSearch(mySearchUtils::DISPLAY_IN_SEARCH_KALTURA_NETWORK);
/************************************************** * DON'T TOUCH THE FOLLOWING CODE ***************************************************/ error_reporting(E_ALL); chdir(dirname(__FILE__)); require_once realpath(dirname(__FILE__)) . '/../../../alpha/config/sfrootdir.php'; define('SF_APP', 'kaltura'); define('SF_ENVIRONMENT', 'prod'); define('SF_DEBUG', false); define('MODULES', SF_ROOT_DIR . DIRECTORY_SEPARATOR . 'apps' . DIRECTORY_SEPARATOR . SF_APP . DIRECTORY_SEPARATOR . "modules" . DIRECTORY_SEPARATOR); require_once SF_ROOT_DIR . DIRECTORY_SEPARATOR . 'apps' . DIRECTORY_SEPARATOR . SF_APP . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.php'; define('ROOT_DIR', realpath(dirname(__FILE__) . '/../../../')); require_once ROOT_DIR . '/infra/bootstrap_base.php'; require_once ROOT_DIR . '/infra/KAutoloader.php'; KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "document", "*")); KAutoloader::setClassMapFilePath('../../cache/classMap.cache'); KAutoloader::register(); date_default_timezone_set(kConf::get("date_default_timezone")); // America/New_York KalturaLog::setLogger(new KalturaStdoutLogger()); DbManager::setConfig(kConf::getDB()); DbManager::initialize(); $flavorParams = null; if ($flavorParamsId) { $flavorParams = flavorParamsPeer::retrieveByPK($flavorParamsId); if (!$flavorParams instanceof SwfFlavorParams) { echo "Flavor params id [{$flavorParamsId}] is not SWF flavor params\n"; exit; } $flavorParams->setVersion($flavorParams->getVersion() + 1);
* limitations under the License. * * Modified by Akvelon Inc. * 2014-06-30 * http://www.akvelon.com/contact-us */ /** * * @package Scheduler */ require_once "../infra/bootstrap_base.php"; require_once KALTURA_ROOT_PATH . '/infra/kConf.php'; require_once KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'; define("KALTURA_BATCH_PATH", KALTURA_ROOT_PATH . "/batch"); // Autoloader - override the autoloader defaults require_once KALTURA_INFRA_PATH . "/KAutoloader.php"; KAutoloader::setClassPath(array(KAutoloader::buildPath(KALTURA_ROOT_PATH, "infra", "*"), KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "PHPMailer", "*"), KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "phpseclib", "*"), KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "*"), KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*"), KAutoloader::buildPath(KALTURA_ROOT_PATH, "alpha", "*"), KAutoloader::buildPath(KALTURA_BATCH_PATH, "*"))); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "*", "batch", "*")); KAutoloader::setIncludePath(array(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "ZendFramework", "library"))); KAutoloader::setClassMapFilePath(kConf::get("cache_root_path") . '/batch/classMap.cache'); KAutoloader::register(); set_include_path(get_include_path() . PATH_SEPARATOR . KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "phpseclib")); set_include_path(get_include_path() . PATH_SEPARATOR . KAutoloader::buildPath(KALTURA_ROOT_PATH, "alpha", "apps", "kaltura", "lib")); // Logger $loggerConfigPath = KALTURA_ROOT_PATH . "/configurations/logger.ini"; try { $config = new Zend_Config_Ini($loggerConfigPath); KalturaLog::initLog($config->batch); KalturaLog::setContext("BATCH"); } catch (Zend_Config_Exception $ex) { }
function init($conf_file_path) { $conf = parse_ini_file($conf_file_path, true); require_once $conf['statics']['infra_path'] . DIRECTORY_SEPARATOR . "bootstrap_base.php"; require_once KALTURA_INFRA_PATH . DIRECTORY_SEPARATOR . "KAutoloader.php"; KAutoloader::setIncludePath(array(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "ZendFramework", "library"))); KAutoloader::register(); $confObj = new Zend_Config_Ini('config.ini'); return $confObj; }
<?php require_once "../../bootstrap.php"; KalturaLog::setContext("TESTME"); $type = $_GET["type"]; $bench_start = microtime(true); KalturaLog::INFO(">------- api_v3 testme type [{$type}]-------"); function toArrayRecursive(KalturaPropertyInfo $propInfo) { return $propInfo->toArray(true); } $subClasses = array(); try { KalturaTypeReflector::setClassInheritMapPath(KAutoloader::buildPath(kConf::get("cache_root_path"), "api_v3", "KalturaClassInheritMap.cache")); if (!KalturaTypeReflector::hasClassInheritMapCache()) { $config = new Zend_Config_Ini("../../config/testme.ini"); $indexConfig = $config->get('testme'); $include = $indexConfig->get("include"); $exclude = $indexConfig->get("exclude"); $excludePaths = $indexConfig->get("excludepaths"); $additional = $indexConfig->get("additional"); $clientGenerator = new DummyForDocsClientGenerator(); $clientGenerator->setIncludeOrExcludeList($include, $exclude, $excludePaths); $clientGenerator->setAdditionalList($additional); $clientGenerator->load(); $objects = $clientGenerator->getTypes(); KalturaTypeReflector::setClassMap(array_keys($objects)); } $subClassesNames = KalturaTypeReflector::getSubClasses($type); foreach ($subClassesNames as $subClassName) { $subClass = new KalturaPropertyInfo($subClassName);
<?php set_time_limit(0); ini_set("memory_limit", "2048M"); define('ROOT_DIR', realpath(dirname(__FILE__) . '/../')); require_once ROOT_DIR . '/alpha/config/kConf.php'; require_once ROOT_DIR . '/infra/bootstrap_base.php'; require_once ROOT_DIR . '/infra/KAutoloader.php'; KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "api_v3", "lib", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "admin_console", "lib", "Kaltura", "*")); KAutoloader::setClassMapFilePath(kConf::get("cache_root_path") . '/deploy/classMap.cache'); KAutoloader::register(); date_default_timezone_set(kConf::get("date_default_timezone")); // America/New_York KalturaLog::setLogger(new KalturaStdoutLogger()); DbManager::setConfig(kConf::getDB()); DbManager::initialize();
require_once KALTURA_API_PATH . DIRECTORY_SEPARATOR . 'VERSION.php'; //defines KALTURA_API_VERSION require_once KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . 'infra' . DIRECTORY_SEPARATOR . 'kConf.php'; require_once KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'; // Autoloader require_once KALTURA_INFRA_PATH . DIRECTORY_SEPARATOR . "KAutoloader.php"; KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_API_PATH, "lib", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_API_PATH, "services", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "alpha", "plugins", "*")); // needed for testmeDoc KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "generator")); // needed for testmeDoc KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "infra", "utils", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "infra", "thumbnailMaker", "*")); KAutoloader::setClassMapFilePath(kConf::get("cache_root_path") . '/api_v3/classMap.cache'); //KAutoloader::dumpExtra(); KAutoloader::register(); // Timezone date_default_timezone_set(kConf::get("date_default_timezone")); // America/New_York // Logger $loggerConfigPath = realpath(KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . "configurations" . DIRECTORY_SEPARATOR . "logger.ini"); try { $config = new Zend_Config_Ini($loggerConfigPath); $api_v3 = $config->api_v3; KalturaLog::initLog($api_v3); } catch (Zend_Config_Exception $ex) { $config = null; }
<?php require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "bootstrap.php"; ini_set("memory_limit", "512M"); error_reporting(E_ALL); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "ZendFramework", "*")); KAutoloader::register(); $code = array(); $options = getopt('iu:p:h:P:ds', array('ignore', 'user:'******'password:'******'host:', 'port:', 'database-only:', 'scripts-only:')); $ignoreErrors = false; $skipDB = false; $skipScripts = false; if (isset($options['i']) || isset($options['ignore'])) { $ignoreErrors = true; } if (isset($options['d']) || isset($options['database-only'])) { $skipScripts = true; } if (isset($options['s']) || isset($options['scripts-only'])) { $skipDB = true; } $params = array(); if (isset($options['u'])) { $params['user'] = $options['u']; } if (isset($options['user'])) { $params['user'] = $options['user']; } if (isset($options['p'])) { $params['password'] = $options['p']; }
public static function init($conf_file_path) { require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "infra" . DIRECTORY_SEPARATOR . "bootstrap_base.php"; require_once SF_ROOT_DIR . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'kConf.php'; define("KALTURA_API_PATH", KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . "api_v3"); // Autoloader require_once KALTURA_INFRA_PATH . DIRECTORY_SEPARATOR . "KAutoloader.php"; KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_API_PATH, "lib", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_API_PATH, "services", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "alpha", "plugins", "*")); // needed for testmeDoc KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "generator")); // needed for testmeDoc KAutoloader::setClassMapFilePath(kConf::get("cache_root_path") . '/deploy/classMap.cache'); //KAutoloader::dumpExtra(); KAutoloader::register(); $dbConf = kConf::getDB(); DbManager::setConfig($dbConf); DbManager::initialize(); $conf = parse_ini_file($conf_file_path, true); $confObj = new Zend_Config_Ini($conf_file_path); return $confObj; }
<?php /** * * @package Scheduler */ chdir(__DIR__); define('KALTURA_ROOT_PATH', realpath(__DIR__ . '/../')); require_once KALTURA_ROOT_PATH . '/alpha/config/kConf.php'; define("KALTURA_BATCH_PATH", KALTURA_ROOT_PATH . "/batch"); // Autoloader - override the autoloader defaults require_once KALTURA_ROOT_PATH . "/infra/KAutoloader.php"; KAutoloader::setClassPath(array(KAutoloader::buildPath(KALTURA_ROOT_PATH, "infra", "*"), KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "*"), KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "*"), KAutoloader::buildPath(KALTURA_BATCH_PATH, "*"))); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "*", "batch", "*")); KAutoloader::setIncludePath(array(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "ZendFramework", "library"))); KAutoloader::setClassMapFilePath(kEnvironment::get("cache_root_path") . '/batch/classMap.cache'); KAutoloader::addExcludePath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "aws", "*")); // Do not load AWS files KAutoloader::addExcludePath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "HTMLPurifier", "*")); // Do not load HTMLPurifier files KAutoloader::register(); // Logger $loggerConfigPath = KALTURA_ROOT_PATH . "/configurations/logger.ini"; try { $config = new Zend_Config_Ini($loggerConfigPath); KalturaLog::initLog($config->batch); KalturaLog::setContext("BATCH"); } catch (Zend_Config_Exception $ex) { }
<?php // AWS SDK PHP Client Library require_once KAutoloader::buildPath(KALTURA_ROOT_PATH, 'vendor', 'aws', 'aws-autoloader.php'); use Aws\S3\S3Client; use Aws\S3\Exception\S3Exception; use Aws\S3\Enum\CannedAcl; /** * Extends the 'kFileTransferMgr' class & implements a file transfer manager using the Amazon S3 protocol with Authentication Version 4. * For additional comments please look at the 'kFileTransferMgr' class. * * @package infra * @subpackage Storage */ class s3Mgr extends kFileTransferMgr { private $s3; protected $filesAcl = CannedAcl::PRIVATE_ACCESS; protected $s3Region = ''; // instances of this class should be created usign the 'getInstance' of the 'kFileTransferMgr' class protected function __construct(array $options = null) { parent::__construct($options); if ($options && isset($options['filesAcl'])) { $this->filesAcl = $options['filesAcl']; } if ($options && isset($options['s3Region'])) { $this->s3Region = $options['s3Region']; } // do nothing $this->connection_id = 1;
<?php require_once ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "bootstrap.php"; KalturaLog::setContext("CLIENTS"); KalturaLog::debug(__FILE__ . " start"); $requestedName = isset($_GET["name"]) ? $_GET['name'] : null; if (!$requestedName) { die("File not found"); } $generatorOutputPath = KAutoloader::buildPath(KALTURA_ROOT_PATH, "generator", "output"); $generatorConfigPath = KAutoloader::buildPath(KALTURA_ROOT_PATH, "generator", "config.ini"); $config = new Zend_Config_Ini($generatorConfigPath); foreach ($config as $name => $item) { if ($name === $requestedName && $item->get("public-download")) { $fileName = $name . ".tar.gz"; $outputFilePath = KAutoloader::buildPath($generatorOutputPath, $fileName); $outputFilePath = realpath($outputFilePath); header("Content-disposition: attachment; filename={$fileName}"); kFile::dumpFile($outputFilePath, "application/gzip"); die; } } die("File not found"); KalturaLog::debug(__FILE__ . " end");
<?php ini_set("memory_limit", "256M"); define('ROOT_DIR', realpath(dirname(__FILE__) . '/../../')); require_once ROOT_DIR . '/infra/bootstrap_base.php'; require_once ROOT_DIR . '/infra/KAutoloader.php'; KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*")); KAutoloader::setClassMapFilePath('../cache/classMap.cache'); KAutoloader::register(); error_reporting(E_ALL); KalturaLog::setLogger(new KalturaStdoutLogger()); $dbConf = array('datasources' => array('default' => 'propel', 'propel' => array('adapter' => 'mysql', 'connection' => array('classname' => 'KalturaPDO', 'phptype' => 'mysql', 'database' => 'kaltura', 'hostspec' => '192.168.192.4', 'user' => 'kaltura', 'password' => 'kaltura', 'dsn' => 'mysql:host=192.168.192.4;dbname=kaltura;user=kaltura;password=kaltura;')), 'propel2' => array('adapter' => 'mysql', 'connection' => array('classname' => 'KalturaPDO', 'phptype' => 'mysql', 'database' => 'kaltura', 'hostspec' => '192.168.192.4', 'user' => 'kaltura_read', 'password' => 'kaltura_read', 'dsn' => 'mysql:host=192.168.192.4;dbname=kaltura;user=kaltura_read;password=kaltura_read;')), 'propel3' => array('adapter' => 'mysql', 'connection' => array('classname' => 'KalturaPDO', 'phptype' => 'mysql', 'database' => 'kaltura', 'hostspec' => '192.168.192.4', 'user' => 'kaltura_read', 'password' => 'kaltura_read', 'dsn' => 'mysql:host=192.168.192.4;dbname=kaltura;user=kaltura_read;password=kaltura_read;'))), 'log' => array('ident' => 'kaltura', 'level' => '7')); //$dbConf = kConf::getDB(); DbManager::setConfig($dbConf); DbManager::initialize(); $entryIds = array("0_dborm9lg", "0_imoflf6p", "0_3wm9a6t5", "0_cic44kil", "0_t4yew63l", "0_j1w2l0uo", "0_hmfl6yqm", "0_j4ciu5i8", "0_9exkfida", "0_t8i28aed", "0_mfzy6fk8", "0_8iy78nc9", "0_k8ymic7i", "0_kebpfp7z", "0_f4wb8f7o", "0_21hgvyre", "0_yc4frw3n", "0_xcrrzimo", "0_ttu09fn8", "0_nv77ncna", "0_dx18o48f", "0_ssuzmxjb", "0_7o9752ad", "0_pdzuunaa", "0_tymuie23", "0_vt8j64df", "0_dn3be3s1", "0_1naibde2", "0_0215mb05", "0_l1qu67u2", "0_0qpt6fbl", "0_o9xrvyv3", "0_rjlbesk0", "0_0riz850n", "8ix7p4nf6s", "0_3bpvujdf", "0_ddhyy406", "0_jdzti6gj", "g940g7miui", "0_o6m9rxsx", "0_qbujfju1", "s5qjpsjdnq", "s1m3dg09dw", "4tl281rhe8", "0_r6ehikfb", "0_s1ymi20f", "0_c087s9fw", "0_0jxtpm3o", "0_bi1oond7", "0_26xr3ht9", "0_tt5bc5xi", "0_3vxvcx0c", "0_336gw1eq", "0_a7nnunh6", "0_bs3jytlv", "0_r5abi3sz", "0_107z8t15", "0_5y5jlxga", "8z8ejn2c05", "0_ls0qsskt", "scs2tb20nc", "kuag5odijy", "c3o8gn8zoy", "0_pjmp0pk5", "0_qepjemqa", "0_phw09gy2", "0_byhgfhm2", "0_cgdx8az5", "0_jyfskrz1", "0_taz94tkf", "0_tpg7dxfz", "0_jdnikam7", "0_faxgi5zh", "0_8q6agy4v", "0_za7d1dlv", "0_9rq9j3ue", "0_90x6alrf", "0_sgj0jpbp", "0_dzqp2hve", "0_2vo8i3zm", "0_pbj0mewb", "0_ecjqlvcx", "0_qwx5tnnh", "0_csow76ak", "0_ippmvqxb", "0_5haayn3s", "0_scx59ihb", "0_e3c218nb", "0_tsokmp6i", "0_6ffche90", "0_qo5oa2aa", "0_grjmi99x", "0_c43tio3q", "0_wdp2nukp", "0_im7bqzvs", "0_8znu0fzn", "0_r88o5k28", "0_lm0ctgv4", "0_861czc6n", "0_fxybu3tb", "0_dl09yagk", "fgh8g7uc4c", "0_3ruyl4so", "0_uz9wwbi0", "0_i0wm8ylp", "0_gj2hfml9", "0_k5fttrmg", "0_ucqrdlm7", "0_semkx9jy", "0_js9xbszt", "0_oho170pf", "kzawobh3ty", "0_a2ph89tt", "irp1nztkts", "66r541rpjs", "0_lrrvlb7w", "0_0k002875", "0_vx5hb6jn", "0_l4liidjf", "0_g3nzwjdz", "0_uqxgy01f", "0_ugw90c4t", "0_tf1dd91a", "0_30eeu66b", "mov5ips91k", "6ir3dui0d0", "0_opitrvgr", "0_oc5vhd33", "0_plefn9cl", "0_0stl9gvz", "0_vth1aakn", "0_eyqbhsq9", "0_52na77mr", "0_7yi05auv", "0_dh11mjm2", "0_4evhzdbl", "dz727fptf0", "0_xqncw5pv", "0_2rl97bry", "0_x8uxq77g", "0_9784h9p5", "0_hwhdajmr", "0_fuqs22j4", "4la8ruega0", "0_zoq8xc3k", "0_beiaainf", "0_v0agxi9k", "umuobsfqos", "sfmrr36r5c", "0_63sprljk", "0_ktgi5sdv", "0_j5w9grsg", "0_z4rvq5m3", "sns6g8rp40", "0_szhtu39v", "wkwm07e2mw", "0_3mp68oqn", "0_un7q4ujm", "0_k9yu4jt2", "h2a4caf7nk", "fvjac6zlmk", "36ko97bsy4", "0_6pqen4pp", "gmvioznyq0", "gkiq0jsp90", "q6ojro0zhg", "0_fwectuev", "0_n04gvx36", "0_5aot3gzv", "p21ippxs70", "ncrww3l4j4", "q3fucnyueo", "58bjik2zbc", "3ck2qf1rnk", "dk2957a76g", "heo5zst99c", "ri5waxv6hs", "gtthmlm78s", "yzcgjotw0o", "6o4z2tp314", "0_d90mqlli", "qfnu55tt7k", "ybugoe78ai", "6h1pb6f3to", "1k9vxhvpk0", "2lvaw1odvm", "2i8t6vxyuo", "3nkrks76w4", "0_xjdcym4v", "0_ez86zub3", "0_xjnit0g7", "0_njp5gk8s", "dfoymlus6t"); $sizeFile = fopen('size.csv', 'a'); $entries = entryPeer::retrieveByPKs($entryIds); foreach ($entries as $entry) { $size = myEntryUtils::calcStorageSize($entry); fputcsv($sizeFile, array($size, $entry->getId())); } fclose($sizeFile); echo 'Done';
<?php chdir(__DIR__); define("KALTURA_ROOT_PATH", realpath(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR)); require_once KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . "alpha" . DIRECTORY_SEPARATOR . "config" . DIRECTORY_SEPARATOR . "kConf.php"; define("KALTURA_API_PATH", KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . "api_v3"); define("KALTURA_PLUGIN_PATH", KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . "plugins"); require_once KALTURA_API_PATH . DIRECTORY_SEPARATOR . 'VERSION.php'; //defines KALTURA_API_VERSION // Autoloader require_once KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . "infra" . DIRECTORY_SEPARATOR . "KAutoloader.php"; KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_API_PATH, "lib", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_API_PATH, "services", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "generator")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_PLUGIN_PATH, "*")); KAutoloader::setClassMapFilePath(kConf::get("cache_root_path") . '/generator/classMap.cache'); KAutoloader::register(); // Timezone date_default_timezone_set(kConf::get("date_default_timezone")); // America/New_York // Logger kLoggerCache::InitLogger('generator');
<?php require_once __DIR__ . "/../../bootstrap.php"; KalturaLog::setContext("CLIENTS"); KalturaLog::debug(__FILE__ . " start"); $generatorPath = KAutoloader::buildPath(KALTURA_ROOT_PATH, "generator"); $generatorOutputPath = KAutoloader::buildPath(KALTURA_ROOT_PATH, "generator", "output"); $generatorConfigPath = KAutoloader::buildPath(KALTURA_ROOT_PATH, "generator", "config.ini"); $config = new Zend_Config_Ini($generatorConfigPath); ?> <ul> <?php foreach ($config as $name => $item) { if (!$item->get("public-download")) { continue; } $outputFilePath = KAutoloader::buildPath($generatorOutputPath, $name . ".tar.gz"); $outputFileRealPath = realpath($outputFilePath); if ($outputFileRealPath) { print '<li>'; print '<a href="download.php?name=' . $name . '"> Download ' . $name . '</a>'; print '</li>'; } } ?> </ul> <?php KalturaLog::debug(__FILE__ . " end");
<?php define('KALTURA_ROOT_PATH', realpath(dirname(__FILE__) . '/../../../../..')); require_once KALTURA_ROOT_PATH . '/infra/KAutoloader.php'; define("KALTURA_API_PATH", KALTURA_ROOT_PATH . "/api_v3"); require_once KALTURA_ROOT_PATH . '/alpha/config/kConf.php'; // Autoloader require_once KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . "infra" . DIRECTORY_SEPARATOR . "KAutoloader.php"; KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_API_PATH, "lib", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_API_PATH, "services", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "alpha", "plugins", "*")); // needed for testmeDoc KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "generator")); // needed for testmeDoc KAutoloader::setClassMapFilePath(kConf::get("cache_root_path") . '/plugins/' . basename(__FILE__) . '.cache'); //KAutoloader::dumpExtra(); KAutoloader::register(); // Timezone date_default_timezone_set(kConf::get("date_default_timezone")); // America/New_York error_reporting(E_ALL); KalturaLog::setLogger(new KalturaStdoutLogger()); $dbConf = kConf::getDB(); DbManager::setConfig($dbConf); DbManager::initialize(); kCurrentContext::$ps_vesion = 'ps3'; $entryId = '0_bs1fapzx'; /*$matches = null; if (preg_match ( "/x0y.*.err/" , '/pub/in/x0y.title.err' , $matches))
function init($conf_file_path, $infra_path) { $conf = parse_ini_file($conf_file_path, true); require_once KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . "infra" . DIRECTORY_SEPARATOR . "KAutoloader.php"; KAutoloader::setIncludePath(array(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "ZendFramework", "library"))); KAutoloader::register(); $confObj = new Zend_Config_Ini($conf_file_path); return $confObj; }
<?php if ($argc != 2) { echo "Arguments missing.\n\n"; echo "Usage: php removePartnerEntries.php {partner id}\n"; exit; } $partnerId = $argv[1]; set_time_limit(0); ini_set("memory_limit", "1024M"); define('ROOT_DIR', realpath(dirname(__FILE__) . '/../../')); require_once ROOT_DIR . '/infra/bootstrap_base.php'; require_once ROOT_DIR . '/infra/KAutoloader.php'; KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "metadata", "*")); KAutoloader::setClassMapFilePath('../cache/classMap.cache'); KAutoloader::register(); error_reporting(E_ALL); KalturaLog::setLogger(new KalturaStdoutLogger()); $typesToDelete = array(entryType::DATA, entryType::DOCUMENT); $dbConf = kConf::getDB(); DbManager::setConfig($dbConf); DbManager::initialize(); $c = new Criteria(); $c->add(entryPeer::PARTNER_ID, $partnerId); $c->add(entryPeer::TYPE, $typesToDelete, Criteria::IN); $entries = entryPeer::doSelect($c); foreach ($entries as $entry) { KalturaLog::debug("Deletes entry [" . $entry->getId() . "]"); myEntryUtils::deleteEntry($entry, $partnerId); }
<?php error_reporting(E_ALL); require_once dirname(__FILE__) . '/../../scripts/bootstrap.php'; KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "limelight", "*")); //KAutoloader::setClassMapFilePath(KALTURA_ROOT_PATH.'/cache/scripts/limelight/classMap.cache'); KAutoloader::setClassMapFilePath(KALTURA_ROOT_PATH . '/cache/scripts/' . basename(__FILE__) . '.cache'); KAutoloader::register(); $partnerId = 101; $partner = PartnerPeer::retrieveByPK($partnerId); if (!$partner) { die("No such partner with id [{$partnerId}]"); } //$limeLightLiveParams = LimeLightPlugin::getLimeLightLiveParams($partner); //$defaultLiveSourceType = $partner->getDefaultLiveStreamEntrySourceType(); //$liveStreamEnabled = $partner->getLiveStreamEnabled(); //$customData = unserialize($partner->getCustomData()); //$customData = $partner->getCustomDataObj(); $ST = $partner->getDefaultLiveStreamEntrySourceType(); $apiVal = kPluginableEnumsManager::coreToApi('EntrySourceType', $ST); //$entryId = '0_y3sxhrol'; //$entry = entryPeer::retrieveByPK($entryId); //$purl = $entry->getPrimaryBroadcastingUrl(); //$surl = $entry->getSecondaryBroadcastingUrl(); //$primary = $limeLightLiveParams->getLimeLightLivePrimaryBroadcastingURL(); var_dump($ST);
<?php /** * * @package Scheduler */ chdir(__DIR__); define('KALTURA_ROOT_PATH', realpath(__DIR__ . '/../')); require_once KALTURA_ROOT_PATH . '/alpha/config/kConf.php'; define("KALTURA_BATCH_PATH", KALTURA_ROOT_PATH . "/batch"); // Autoloader - override the autoloader defaults require_once KALTURA_ROOT_PATH . "/infra/KAutoloader.php"; KAutoloader::setClassPath(array(KAutoloader::buildPath(KALTURA_ROOT_PATH, "infra", "*"), KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "*"), KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "*"), KAutoloader::buildPath(KALTURA_BATCH_PATH, "*"))); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "*", "batch", "*")); KAutoloader::setIncludePath(array(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "ZendFramework", "library"))); KAutoloader::setClassMapFilePath(kEnvironment::get("cache_root_path") . '/batch/classMap.cache'); KAutoloader::register(); // Logger $loggerConfigPath = KALTURA_ROOT_PATH . "/configurations/logger.ini"; try { $config = new Zend_Config_Ini($loggerConfigPath); KalturaLog::initLog($config->batch_scheduler); KalturaLog::setContext("BATCH"); } catch (Zend_Config_Exception $ex) { }
error_reporting(E_ALL); ini_set("memory_limit", "128M"); define('SF_ROOT_DIR', realpath(dirname(__FILE__) . '/../../alpha/')); define('SF_APP', 'kaltura'); define('SF_ENVIRONMENT', 'batch'); define('SF_DEBUG', true); require_once SF_ROOT_DIR . '/../infra/bootstrap_base.php'; require_once KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR . "infra" . DIRECTORY_SEPARATOR . "bootstrap_base.php"; require_once KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . 'infra' . DIRECTORY_SEPARATOR . 'kConf.php'; // Autoloader require_once KALTURA_INFRA_PATH . DIRECTORY_SEPARATOR . "KAutoloader.php"; KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*")); KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "alpha", "lib", "*")); // needed for testmeDoc KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "content_distribution", "*")); // needed for testmeDoc KAutoloader::setClassMapFilePath(kConf::get("cache_root_path") . '/scripts/' . basename(__FILE__) . '.cache'); KAutoloader::register(); $dbConf = kConf::getDB(); DbManager::setConfig($dbConf); DbManager::initialize(); if ($argc == 3) { $flavor_param_id = $argv[1]; $conversion_profile_id = $argv[2]; } else { die('usage: php ' . $_SERVER['SCRIPT_NAME'] . " [flavor_param_id] [conversion profile id]" . PHP_EOL); } $conversion_flavor = flavorParamsConversionProfilePeer::retrieveByFlavorParamsAndConversionProfile($flavor_param_id, $conversion_profile_id); if (!$conversion_flavor) { die('no such flavor param id and conversion profile id.' . PHP_EOL);