本文整理汇总了PHP中myContentStorage::getFSContentRootPath方法的典型用法代码示例。如果您正苦于以下问题:PHP myContentStorage::getFSContentRootPath方法的具体用法?PHP myContentStorage::getFSContentRootPath怎么用?PHP myContentStorage::getFSContentRootPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类myContentStorage
的用法示例。
在下文中一共展示了myContentStorage::getFSContentRootPath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: 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);
}
示例3: 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 !
}
示例4: 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;
}
示例5: 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 . '\\..*/';
}
示例6: 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);
}
示例7: 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);
}
示例8: 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;
}
示例9: 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);
}
示例10: 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);
}
示例11: serveUpdateAction
/**
* Serve update file
*
* @action serveUpdate
* @param string $os
* @param string $version
* @return file
* @throws CaptureSpaceErrors::NO_UPDATE_IS_AVAILABLE
*/
public function serveUpdateAction($os, $version)
{
$filename = kCaptureSpaceVersionManager::getUpdateFile($os, $version);
if (!$filename) {
throw new KalturaAPIException(CaptureSpaceErrors::NO_UPDATE_IS_AVAILABLE, $version, $os);
}
$actualFilePath = myContentStorage::getFSContentRootPath() . "/content/third_party/capturespace/{$filename}";
if (!file_exists($actualFilePath)) {
throw new KalturaAPIException(CaptureSpaceErrors::NO_UPDATE_IS_AVAILABLE, $version, $os);
}
$mimeType = kFile::mimeType($actualFilePath);
header("Content-Disposition: attachment; filename=\"{$filename}\"");
return $this->dumpFile($actualFilePath, $mimeType);
}
示例12: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
$filename = $this->getP('filename');
// strip the filename from invalid characters
$token = $this->getKsUniqueString();
// $res = myUploadUtils::uploadFileByToken ( $_FILES['Filedata'] , $token , $filename );
$origFilename = $_FILES['Filedata']['name'];
$parts = pathinfo($origFilename);
$extension = "flv";
// always flv ! //strtolower($parts['extension']);
$extra_id = null;
$file_alias = $token . '_' . $filename;
// add the file extension after the "." character
$fullPath = myContentStorage::getFSContentRootPath() . "content/webcam/my_recorded_stream_" . $file_alias . ($extra_id ? "_" . $extra_id : "") . "." . $extension;
myContentStorage::fullMkdir($fullPath);
move_uploaded_file($_FILES['Filedata']['tmp_name'], $fullPath);
chmod($fullPath, 0777);
$res = array("token" => $token, "filename" => $filename, "origFilename" => $origFilename);
// should upload the file with the token as the prefix
$this->addMsg("result_ok", $res);
}
示例13: executeCropProvider
function executeCropProvider($source_file, $target_file, $width, $height, $crop_type, $bgcolor, $force_jpeg)
{
$content_path = myContentStorage::getFSContentRootPath();
list($sourcewidth, $sourceheight, $type, $attr, $thumbail_image) = myFileConverter::createImageByFile($target_file);
$wordpress_placeholder_image_path = $content_path . "content/templates/wordpress/wordpress_comment_player_placeholder.gif";
list($placeholder_width, $placeholder_height, $type, $attr, $place_holder_image) = myFileConverter::createImageByFile($wordpress_placeholder_image_path);
$wordpress_placeholder_image_path = $content_path . "content/templates/wordpress/wordpress_comment_play_overlay.png";
list($overlay_width, $overlay_height, $type, $attr, $play_overlay_image) = myFileConverter::createImageByFile($wordpress_placeholder_image_path);
$width = 240;
$height = 180;
$im = imagecreatetruecolor($placeholder_width, $placeholder_height);
imagecopy($im, $place_holder_image, 0, 0, 0, 0, $placeholder_width, $placeholder_height);
//imagecopyresampled($im, $thumbail_image, 5, 30, 0, 0, $width, $height, $width, $height);
// copy with opacity change
imagecopymerge($im, $thumbail_image, 5 + ($width - $sourcewidth) / 2, 30 + ($height - $sourceheight) / 2, 0, 0, $sourcewidth, $sourceheight, 50);
imagecopy($im, $play_overlay_image, ($placeholder_width - $overlay_width) / 2, ($placeholder_height - $overlay_height) / 2, 0, 0, $overlay_width, $overlay_height);
imagedestroy($place_holder_image);
imagedestroy($thumbail_image);
imagedestroy($play_overlay_image);
imagejpeg($im, $target_file, 90);
imagedestroy($im);
}
示例14: executeCropProvider
function executeCropProvider($source_file, $target_file, $width, $height, $crop_type, $bgcolor, $force_jpeg)
{
$content_path = myContentStorage::getFSContentRootPath();
list($sourcewidth, $sourceheight, $type, $attr, $thumbail_image) = myFileConverter::createImageByFile($target_file);
if ($width == 400 && $height == 300) {
$wordpress_placeholder_image_path = $content_path . "content/templates/wordpress/wordpress_large_player_placeholder.jpg";
list($sourcewidth, $sourceheight, $type, $attr, $place_holder_image) = myFileConverter::createImageByFile($wordpress_placeholder_image_path);
imagecopyresampled($place_holder_image, $thumbail_image, 6, 36, 0, 0, $width, $height, $width, $height);
} elseif ($width == 400 && $height == 225) {
$wordpress_placeholder_image_path = $content_path . "content/templates/wordpress/wordpress_large_wide_screen_player_placeholder.jpg";
list($sourcewidth, $sourceheight, $type, $attr, $place_holder_image) = myFileConverter::createImageByFile($wordpress_placeholder_image_path);
imagecopyresampled($place_holder_image, $thumbail_image, 6, 36, 0, 0, $width, $height, $width, $height);
} else {
$width = 240;
$height = 180;
$wordpress_placeholder_image_path = $content_path . "content/templates/wordpress/wordpress_small_player_placeholder.jpg";
list($sourcewidth, $sourceheight, $type, $attr, $place_holder_image) = myFileConverter::createImageByFile($wordpress_placeholder_image_path);
imagecopyresampled($place_holder_image, $thumbail_image, 6, 28, 0, 0, $width, $height, $width, $height);
}
imagedestroy($thumbail_image);
imagejpeg($place_holder_image, $target_file, 90);
imagedestroy($place_holder_image);
}
示例15: executeImpl
/**
* Executes index action
*/
protected function executeImpl(kshow $kshow)
{
$this->xml_content = "";
$kshow_id = $this->kshow_id;
if ($kshow_id == NULL || $kshow_id == 0) {
return sfView::SUCCESS;
}
$metadata_creator = new myKshowMetadataCreator();
$this->show_metadata = $metadata_creator->createMetadata($kshow_id);
// $kshow = kshowPeer:retrieveByPK( $kshow_id );
$entry = entryPeer::retrieveByPK($kshow->getShowEntryId());
// TODO - this should never happen
if ($entry == NULL) {
// there is no show entry for this show !
$entry = $kshow->createEntry(entry::ENTRY_MEDIA_TYPE_SHOW, $kshow->getProducerId());
}
$content_path = myContentStorage::getFSContentRootPath();
$file_path = $content_path . $entry->getDataPath();
// check to see if the content of the file changed
$current_metadata = kFile::getFileContent($file_path);
$comp_result = strcmp($this->show_metadata, $current_metadata);
if ($comp_result != 0) {
$ext = pathinfo($file_path, PATHINFO_EXTENSION);
if ($ext != "xml") {
// this is for the first time - override the template path by setting the data to NULL
$entry->setData(NULL);
$file_path = pathinfo($file_path, PATHINFO_DIRNAME) . "/" . kFile::getFileNameNoExtension($file_path) . ".xml";
}
// this will increment the name if needed
$entry->setData($file_path);
$file_path = $content_path . $entry->getDataPath();
$entry->save();
kFile::fullMkdir($file_path);
kFile::setFileContent($file_path, $this->show_metadata);
$this->xml_content = $this->show_metadata;
}
}