function run_conversion($params) { global $run_conversion, $calendar_source, $calendar_target, $calendar_startdate; # $calendar_source - ex: "Calendar:Main Page/Team Calendar" # $calendar_target - ex: "Supprot Team" # $calendar_startdate - ex: "1/1/2009" - any standard date would work as php auto detects the date # $run_conversion: (careful, this WILL create duplicates... run only ONCE! # true - run conversion and update database # false (default) - only display pages found - trial run if (isset($calendar_source) && isset($calendar_target) && isset($calendar_startdate)) { $conversion = new conversion($run_conversion); return $conversion->convert($calendar_source, $calendar_target, $calendar_startdate); } return false; }
/** * Adds an object to the instance pool. * * Propel keeps cached copies of objects in an instance pool when they are retrieved * from the database. In some cases -- especially when you override doSelect*() * methods in your stub classes -- you may need to explicitly add objects * to the cache in order to ensure that the same objects are always returned by doSelect*() * and retrieveByPK*() calls. * * @param conversion $value A conversion object. * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). */ public static function addInstanceToPool(conversion $obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if ($key === null) { $key = (string) $obj->getId(); } // if key === null self::$instances[$key] = $obj; } }
/** * Adds an object to the instance pool. * * Propel keeps cached copies of objects in an instance pool when they are retrieved * from the database. In some cases -- especially when you override doSelect*() * methods in your stub classes -- you may need to explicitly add objects * to the cache in order to ensure that the same objects are always returned by doSelect*() * and retrieveByPK*() calls. * * @param conversion $value A conversion object. * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). */ public static function addInstanceToPool(conversion $obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if ($key === null) { $key = (string) $obj->getId(); } if (isset(self::$instances[$key]) || count(self::$instances) < kConf::get('max_num_instances_in_pool')) { self::$instances[$key] = $obj; kMemoryManager::registerPeer('conversionPeer'); } } }
protected function createConversionInDb($entry_id, $full_file_name, $conv_cmd = null) { try { $conversion = new conversion(); $entry_id = self::getEntryIdFromFileName($full_file_name); $conversion->setEntryId($entry_id); $conversion->setInFileName($full_file_name); $conversion->setInFileExt(pathinfo($full_file_name, PATHINFO_EXTENSION)); $conversion->setInFileSize(filesize($full_file_name)); $conversion->setStatus(conversion::CONVERSION_STATUS_PRECONVERT); if ($conv_cmd) { // TODO - find a better way to serialize the params ! $conversion->setConversionParams(print_r($conv_cmd->conversion_params_list, true)); } $conversion->save(); } catch (Exception $ex) { // Do NOT fail the actual conversion KalturaLog::debug("Problem reporting conversion details to DB (part I) " . $ex->getTraceAsString()); } }