本文整理汇总了PHP中myContentStorage类的典型用法代码示例。如果您正苦于以下问题:PHP myContentStorage类的具体用法?PHP myContentStorage怎么用?PHP myContentStorage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了myContentStorage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toObject
public function toObject($object_to_fill = null, $props_to_skip = array())
{
$this->validateForUsage($object_to_fill, $props_to_skip);
if (!$object_to_fill) {
$object_to_fill = new kLocalFileResource();
}
$content = myContentStorage::getFSContentRootPath();
$entryFullPaths = array('flv' => "{$content}/content/webcam/{$this->token}.flv", 'f4v' => "{$content}/content/webcam/{$this->token}.f4v", 'mp4' => "{$content}/content/webcam/{$this->token}.f4v.mp4");
foreach ($entryFullPaths as $type => $entryFullPath) {
if (file_exists($entryFullPath)) {
if ($type == 'flv') {
$entryFixedFullPath = $entryFullPath . '.fixed.flv';
KalturaLog::debug("Fix webcam full path from [{$entryFullPath}] to [{$entryFixedFullPath}]");
myFlvStaticHandler::fixRed5WebcamFlv($entryFullPath, $entryFixedFullPath);
$entryNewFullPath = $entryFullPath . '.clipped.flv';
KalturaLog::debug("Clip webcam full path from [{$entryFixedFullPath}] to [{$entryNewFullPath}]");
myFlvStaticHandler::clipToNewFile($entryFixedFullPath, $entryNewFullPath, 0, 0);
$entryFullPath = $entryNewFullPath;
if (!file_exists($entryFullPath)) {
throw new KalturaAPIException(KalturaErrors::RECORDED_WEBCAM_FILE_NOT_FOUND);
}
}
$object_to_fill->setSourceType(KalturaSourceType::WEBCAM);
$object_to_fill->setLocalFilePath($entryFullPath);
return $object_to_fill;
}
}
throw new KalturaAPIException(KalturaErrors::RECORDED_WEBCAM_FILE_NOT_FOUND);
}
示例2: execute
/**
* Will forward to the regular swf player according to the widget_id
*/
public function execute()
{
$ui_conf_id = $this->getRequestParameter("ui_conf_id");
$uiConf = uiConfPeer::retrieveByPK($ui_conf_id);
if (!$uiConf) {
die;
}
$partner_id = $uiConf->getPartnerId();
$subp_id = $uiConf->getSubpId();
$host = myPartnerUtils::getHost($partner_id);
$ui_conf_swf_url = $uiConf->getSwfUrl();
if (!$ui_conf_swf_url) {
$ui_conf_swf_url = "/swf/simpleeditor.swf";
}
if (kString::beginsWith($ui_conf_swf_url, "http")) {
$swf_url = $ui_conf_swf_url;
// absolute URL
} else {
$use_cdn = $uiConf->getUseCdn();
$cdn_host = $use_cdn ? myPartnerUtils::getCdnHost($partner_id) : myPartnerUtils::getHost($partner_id);
$swf_url = $cdn_host . myPartnerUtils::getUrlForPartner($partner_id, $subp_id) . $ui_conf_swf_url;
// relative to the current host
}
// handle buggy case for backward compatiblity
$partner_host = $host;
if ($partner_host == "http://www.kaltura.com") {
$partner_host = 1;
}
// otherwise the kse will build a flawed url with [[IMPORT]]
$params = "contentUrl=" . urlencode($swf_url) . "&host=" . str_replace("http://", "", str_replace("https://", "", $partner_host)) . "&cdnHost=" . str_replace("http://", "", str_replace("https://", "", myPartnerUtils::getCdnHost($partner_id))) . "&uiConfId=" . $ui_conf_id . "&disableurlhashing=" . kConf::get('disable_url_hashing');
$wrapper_swf = myContentStorage::getFSFlashRootPath() . "/flexwrapper/" . kConf::get('editors_flex_wrapper_version') . "/FlexWrapper.swf";
$this->redirect($host . myPartnerUtils::getUrlForPartner($partner_id, $subp_id) . "{$wrapper_swf}?{$params}");
}
示例3: execute
/**
* Will forward to the regular swf player according to the widget_id
*/
public function execute()
{
$ui_conf_id = $this->getRequestParameter("ui_conf_id");
$uiConf = uiConfPeer::retrieveByPK($ui_conf_id);
if (!$uiConf) {
die;
}
$partner_id = $uiConf->getPartnerId();
$subp_id = $uiConf->getSubpId();
if (!$subp_id) {
$subp_id = 0;
}
$host = myPartnerUtils::getHost($partner_id);
$ui_conf_swf_url = $uiConf->getSwfUrl();
if (!$ui_conf_swf_url) {
$ui_conf_swf_url = "/swf/ContributionWizard.swf";
}
if (kString::beginsWith($ui_conf_swf_url, "http")) {
$swf_url = $ui_conf_swf_url;
// absolute URL
} else {
$use_cdn = $uiConf->getUseCdn();
$cdn_host = $use_cdn ? myPartnerUtils::getCdnHost($partner_id) : myPartnerUtils::getHost($partner_id);
$swf_url = $cdn_host . myPartnerUtils::getUrlForPartner($partner_id, $subp_id) . $ui_conf_swf_url;
// relative to the current host
}
$params = "contentUrl=" . urlencode($swf_url) . "&host=" . str_replace("http://", "", str_replace("https://", "", $host)) . "&cdnHost=" . str_replace("http://", "", str_replace("https://", "", myPartnerUtils::getCdnHost($partner_id))) . "&uiConfId=" . $ui_conf_id;
$wrapper_swf = myContentStorage::getFSFlashRootPath() . "/flexwrapper/" . kConf::get('kcw_flex_wrapper_version') . "/FlexWrapper.swf";
$this->redirect($host . myPartnerUtils::getUrlForPartner($partner_id, $subp_id) . "{$wrapper_swf}?{$params}");
}
示例4: addParseCaptionAssetJob
/**
* @param CaptionAsset $captionAsset
* @param BatchJob $parentJob
* @throws kCoreException FILE_NOT_FOUND
* @return BatchJob
*/
public function addParseCaptionAssetJob(CaptionAsset $captionAsset, BatchJob $parentJob = null)
{
$syncKey = $captionAsset->getSyncKey(asset::FILE_SYNC_ASSET_SUB_TYPE_ASSET);
$fileSync = kFileSyncUtils::getReadyInternalFileSyncForKey($syncKey);
if (!$fileSync) {
if (!PermissionPeer::isValidForPartner(CaptionPermissionName::IMPORT_REMOTE_CAPTION_FOR_INDEXING, $captionAsset->getPartnerId())) {
throw new kCoreException("File sync not found: {$syncKey}", kCoreException::FILE_NOT_FOUND);
}
$fileSync = kFileSyncUtils::getReadyExternalFileSyncForKey($syncKey);
if (!$fileSync) {
throw new kCoreException("File sync not found: {$syncKey}", kCoreException::FILE_NOT_FOUND);
}
$fullPath = myContentStorage::getFSUploadsPath() . '/' . $captionAsset->getId() . '.tmp';
if (!kFile::downloadUrlToFile($fileSync->getExternalUrl($captionAsset->getEntryId()), $fullPath)) {
throw new kCoreException("File sync not found: {$syncKey}", kCoreException::FILE_NOT_FOUND);
}
kFileSyncUtils::moveFromFile($fullPath, $syncKey, true, false, true);
}
$jobData = new kParseCaptionAssetJobData();
$jobData->setCaptionAssetId($captionAsset->getId());
$batchJob = null;
if ($parentJob) {
$batchJob = $parentJob->createChild();
} else {
$batchJob = new BatchJob();
$batchJob->setEntryId($captionAsset->getEntryId());
$batchJob->setPartnerId($captionAsset->getPartnerId());
}
return kJobsManager::addJob($batchJob, $jobData, CaptionSearchPlugin::getBatchJobTypeCoreValue(CaptionSearchBatchJobType::PARSE_CAPTION_ASSET));
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:36,代码来源:kCaptionSearchFlowManager.php
示例5: execute
public function execute()
{
$this->forceSystemAuthentication();
$this->basePath = "/content/dynamic/";
$dynamicRoot = myContentStorage::getFSContentRootPath() . $this->basePath;
if ($this->getRequest()->getMethod() == sfRequest::POST) {
$origFilename = basename($_FILES['Filedata']['name']);
$fullPath = $dynamicRoot . $origFilename;
move_uploaded_file($_FILES['Filedata']['tmp_name'], $fullPath);
chmod($fullPath, 0777);
return $this->renderText("ok");
} else {
if ($this->getRequest()->getMethod() == sfRequest::DELETE) {
$filename = basename($_REQUEST['fileName']);
kFile::deleteFile($dynamicRoot . $filename);
return $this->renderText("ok");
}
}
$this->files = kFile::dirListExtended($dynamicRoot, false);
$this->extraHead = <<<EOT
\t\t<style type="text/css">
\t\t\ttable{ font-size:1.2em; width:100%; margin:40px 0 0 0; }
\t\t\ttable thead{ font-size:1.4em; }
\t\t\t\ttable thead td{ border-bottom:1px solid #444; margin-bottom:20px; }
\t\t\ttable tbody td{ padding:2px 0; color:#ccc; }
\t\t\t\ttable tbody td b{ font-weight:normal; cursor:default; }
\t\t\t\ttable tbody td span.btn{ margin-right:12px;}
\t\t\tdiv#helper{ display:none; position:absolute; left:0; width:250px; }
\t\t\tdiv#helper img{ float:right; max-width:250px; }
\t\t</style>
EOT;
}
示例6: executeImpl
/**
* Executes addComment action, which returns a form enabling the insertion of a comment
* The request may include 1 fields: entry id.
*/
protected function executeImpl(kshow $kshow, entry &$entry)
{
$version = @$_REQUEST["version"];
// it's a path on the disk
if (kString::beginsWith($version, ".")) {
// someone is trying to hack in the system
return sfView::ERROR;
}
// in case we're making a roughcut out of a regular invite, we start from scratch
if ($entry->getMediaType() != entry::ENTRY_MEDIA_TYPE_SHOW || $entry->getDataPath($version) === null) {
$this->xml_content = "<xml></xml>";
return;
}
// fetch content of file from disk - it should hold the XML
$file_name = myContentStorage::getFSContentRootPath() . "/" . $entry->getDataPath($version);
//echo "[$file_name]";
if (kString::endsWith($file_name, "xml")) {
if (file_exists($file_name)) {
$this->xml_content = kFile::getFileContent($file_name);
// echo "[" . $this->xml_content . "]" ;
} else {
$this->xml_content = "<xml></xml>";
}
myMetadataUtils::updateEntryForPending($entry, $version, $this->xml_content);
} else {
return sfView::ERROR;
}
// this is NOT an xml file we are looking for !
}
示例7: execute
/**
* Will investigate a single entry
*/
public function execute()
{
$this->forceSystemAuthentication();
myDbHelper::$use_alternative_con = null;
//myDbHelper::DB_HELPER_CONN_PROPEL2;
$status_list = $this->getP("status");
$mode = $this->getP("mode");
if ($mode == "old") {
$preconvert = glob(myContentStorage::getFSContentRootPath() . "/content/preconvert/data/*");
$preconvert_indicators = glob(myContentStorage::getFSContentRootPath() . "/content/preconvert/files/*");
// indicators or inproc
} else {
$preconvert = glob(myContentStorage::getFSContentRootPath() . "/content/new_preconvert/*");
$preconvert_indicators = glob(myContentStorage::getFSContentRootPath() . "/new_content/preconvert/*.in*");
// indicators or inproc
}
$indicators = array();
foreach ($preconvert_indicators as $file) {
$file = pathinfo($file, PATHINFO_BASENAME);
$name = substr($file, 0, strpos($file, "."));
$indicators[$name] = $name;
}
$entry_ids = array();
foreach ($preconvert as $file) {
$file = pathinfo($file, PATHINFO_BASENAME);
$name = substr($file, 0, strpos($file, "."));
if (!isset($indicators[$name])) {
$entry_ids[] = $name;
// only those that don't have indicators
}
}
$ids_str = "'" . implode("','", $entry_ids) . "'";
echo "<html><body style='font-family:arial; font-size:12px;'>";
echo "preconvert files: [" . count($preconvert) . "]<br>";
echo "preconvert indicators : [" . count($preconvert_indicators) . "] [" . count($indicators) . "]<br>";
echo "entry_ids: [" . count($entry_ids) . "]<br>";
if (count($entry_ids)) {
if (!$status_list) {
$status_list = "1";
}
$connection = Propel::getConnection();
$query = "SELECT id,partner_id,status,created_at FROM entry WHERE status IN ({$status_list}) AND id IN ({$ids_str}) ORDER BY created_at ASC ";
echo "query: {$query}<br>";
$statement = $connection->prepareStatement($query);
$resultset = $statement->executeQuery();
echo "<table cellpadding=2 cellspacing=0 border=1 style='font-family:arial; font-size:12px;'>";
echo "<tr><td>partner_id</td><td>id</td><td>status</td><td>created_at</td></tr>";
$real_count = 0;
while ($resultset->next()) {
echo "<tr>" . "<td>" . $resultset->getInt('partner_id') . "</td>" . "<td>" . $resultset->getString('id') . "</td>" . "<td>" . $resultset->getInt('status') . "</td>" . "<td>" . $resultset->get('created_at') . "</td>" . "</tr>";
$real_count++;
}
echo "</table>";
echo "count [{$real_count}]";
$resultset->close();
}
echo "</body></html>";
die;
}
示例8: generateFilePathArr
public function generateFilePathArr($sub_type, $version = null)
{
static::validateFileSyncSubType($sub_type);
if ($sub_type == self::FILE_SYNC_ENTRY_SUB_TYPE_LIVE_PRIMARY || $sub_type == self::FILE_SYNC_ENTRY_SUB_TYPE_LIVE_SECONDARY) {
$res = myContentStorage::getGeneralEntityPath('entry/data', $this->getIntId(), $this->getId(), $sub_type);
return array(myContentStorage::getFSContentRootPath(), $res);
}
return parent::generateFilePathArr($sub_type, $version);
}
示例9: execute
/**
* Will forward to the regular swf player according to the widget_id
*/
public function execute()
{
$ui_conf_id = $this->getRequestParameter("ui_conf_id");
$preloader_path = myContentStorage::getFSContentRootPath() . "/content" . myContentStorage::getFSUiconfRootPath() . "/preloader_{$ui_conf_id}.swf";
if (!file_exists($preloader_path)) {
$preloader_path = myContentStorage::getFSContentRootPath() . "/content" . myContentStorage::getFSUiconfRootPath() . "/preloader_2.swf";
}
kFile::dumpFile($preloader_path);
}
示例10: myFileIndicator
public function myFileIndicator($file_name)
{
if (!self::$s_indicator_path) {
self::$s_indicator_path = myContentStorage::getFSContentRootPath() . "/indicators/";
kFile::fullMkdir(self::$s_indicator_path . "dummy.txt");
}
$this->file_name = $file_name;
$this->pattern = "/" . $this->file_name . '\\..*/';
}
示例11: execute
public function execute()
{
$this->forceSystemAuthentication();
$kshow_id = @$_REQUEST["kshow_id"];
$this->kshow_id = $kshow_id;
$this->kshow = NULL;
$entry_id = @$_REQUEST["entry_id"];
$this->entry_id = $entry_id;
$this->entry = NULL;
$this->message = "";
if (!empty($kshow_id)) {
$this->kshow = kshowPeer::retrieveByPK($kshow_id);
if (!$this->kshow) {
$this->message = "Cannot find kshow [{$kshow_id}]";
} else {
$this->entry = $this->kshow->getShowEntry();
}
} elseif (!empty($kshow_id)) {
$this->entry = entryPeer::retrieveByPK($entry_id);
if (!$this->entry) {
$this->message = "Cannot find entry [{$entry_id}]";
} else {
$this->kshow = $this->{$this}->entry->getKshow();
}
}
if ($this->kshow) {
$this->metadata = $this->kshow->getMetadata();
} else {
$this->metadata = "";
}
$pending_str = $this->getP("pending");
$remove_pending = $this->getP("remove_pending");
if ($this->metadata && ($remove_pending || $pending_str)) {
if ($remove_pending) {
$pending_str = "";
}
$xml_doc = new DOMDocument();
$xml_doc->loadXML($this->metadata);
$metadata = kXml::getFirstElement($xml_doc, "MetaData");
$should_save = kXml::setChildElement($xml_doc, $metadata, "Pending", $pending_str, true);
if ($remove_pending) {
$should_save = kXml::setChildElement($xml_doc, $metadata, "LastPendingTimeStamp", "", true);
}
if ($should_save) {
$fixed_content = $xml_doc->saveXML();
$content_dir = myContentStorage::getFSContentRootPath();
$file_name = realpath($content_dir . $this->entry->getDataPath());
$res = file_put_contents($file_name, $fixed_content);
// sync - NOTOK
$this->metadata = $fixed_content;
}
}
$this->pending = $pending_str;
$this->kshow_id = $kshow_id;
$this->entry_id = $entry_id;
}
示例12: toObject
public function toObject($object_to_fill = null, $props_to_skip = array())
{
if (!$object_to_fill) {
$object_to_fill = new kLocalFileResource();
}
file_put_contents($fname = tempnam(myContentStorage::getFSUploadsPath(), "KFR"), $this->content);
$object_to_fill->setLocalFilePath($fname);
$object_to_fill->setSourceType(entry::ENTRY_MEDIA_SOURCE_TEXT);
return parent::toObject($object_to_fill, $props_to_skip);
}
示例13: generateFilePathArr
public function generateFilePathArr($sub_type, $version = null)
{
self::validateFileSyncSubType($sub_type);
if (!$version) {
$version = $this->getFileSyncVersion($sub_type);
}
$dir = intval($this->getId() / 1000000) . '/' . intval($this->getId() / 1000) % 1000;
$path = "/content/distribution/profile/{$dir}/" . $this->generateFileName($sub_type, $version);
return array(myContentStorage::getFSContentRootPath(), $path);
}
示例14: execute
/**
* Will forward to the regular swf player according to the widget_id
*/
public function execute()
{
$ui_conf_id = $this->getRequestParameter("ui_conf_id");
if (!is_numeric($ui_conf_id)) {
throw new Exception("Illegal Input was supplied");
}
$preloader_path = myContentStorage::getFSContentRootPath() . "/content" . myContentStorage::getFSUiconfRootPath() . "/preloader_{$ui_conf_id}.swf";
if (!file_exists($preloader_path)) {
$preloader_path = myContentStorage::getFSContentRootPath() . "/content" . myContentStorage::getFSUiconfRootPath() . "/preloader_2.swf";
}
kFileUtils::dumpFile($preloader_path);
}
示例15: execute
public function execute()
{
// Prevent the page fron being embeded in an iframe
header('X-Frame-Options: DENY');
// Check if user already logged in and redirect to kmc2
if ($this->getRequest()->getCookie('kmcks')) {
$this->redirect('kmc/kmc2');
}
if (infraRequestUtils::getProtocol() != infraRequestUtils::PROTOCOL_HTTPS && kConf::get('kmc_secured_login')) {
$url = 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
header('Location:' . $url);
die;
}
$this->www_host = kConf::get('www_host');
$https_enabled = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443 ? true : false;
$this->securedLogin = kConf::get('kmc_secured_login') || $https_enabled ? true : false;
$swfUrl = $this->securedLogin ? 'https://' : 'http://';
$swfUrl .= $this->www_host . myContentStorage::getFSFlashRootPath();
$swfUrl .= '/kmc/login/' . kConf::get('kmc_login_version') . '/login.swf';
$this->swfUrl = $swfUrl;
$this->partner_id = $this->getRequestParameter("partner_id");
$this->logoUrl = null;
if ($this->partner_id) {
$partner = PartnerPeer::retrieveByPK($this->partner_id);
if ($partner) {
$this->logoUrl = kmcUtils::getWhitelabelData($partner, 'logo_url');
}
}
$this->beta = $this->getRequestParameter("beta");
//prevent script injections - allow only base64_encode chars , which is used when creating A new hash key
$passHashparam = $this->getRequestParameter("setpasshashkey");
if ($passHashparam && !preg_match(self::BASE64_ENCODE_CHARS_REGEX, $passHashparam)) {
KExternalErrors::dieError(KExternalErrors::INVALID_HASH);
}
$this->setPassHashKey = $passHashparam;
$this->hashKeyErrorCode = null;
$this->displayErrorFromServer = false;
if ($this->setPassHashKey) {
try {
$loginData = UserLoginDataPeer::isHashKeyValid($this->setPassHashKey);
$partnerId = $loginData->getConfigPartnerId();
$partner = PartnerPeer::retrieveByPK($partnerId);
if ($partner && $partner->getPasswordStructureValidations()) {
$this->displayErrorFromServer = true;
}
} catch (kCoreException $e) {
$this->hashKeyErrorCode = $e->getCode();
}
}
sfView::SUCCESS;
}