本文整理汇总了PHP中eZFile::getContents方法的典型用法代码示例。如果您正苦于以下问题:PHP eZFile::getContents方法的具体用法?PHP eZFile::getContents怎么用?PHP eZFile::getContents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZFile
的用法示例。
在下文中一共展示了eZFile::getContents方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createOODOMElement
/**
* Create OO document element.
*
* @param DOMDocument Owner DOMDocument
* @param eZContentObjectTreeNode eZContentObjectTreeNode object.
*
* @return DOMElement NameList DOMDocument, example:
*
* <OODocument base64Encoded="1" filename="My article.odt">
* <![CDATA[ ad lkøjsdaølfhadsø fiuancfivn søgsbdnvsahfø ]]>
* </OODocument>
*/
protected function createOODOMElement(DOMDocument $domDocument, eZContentObjectTreeNode $node)
{
$ooDocumentElement = $domDocument->createElement('OODocument');
$fileName = eZOOConverter::objectToOO($node->attribute('node_id'));
if (is_array($fileName)) {
throw new Exception('Could not generate OO document, ID: ' . $node->attribute('node_id') . ', Description: ' . $fileName[0]);
}
// Add odt document to DOMElement
$ooDocumentElement->setAttribute('base64Encoded', '1');
$ooDocumentElement->setAttribute('filename', $node->attribute('name') . '.odt');
$ooDocumentElement->appendChild($domDocument->createCDATASection(base64_encode(eZFile::getContents($fileName))));
unlink($fileName);
return $ooDocumentElement;
}
示例2: array
if (file_exists(eZSys::wwwDir() . $Filename)) {
$fileAttachments[] = array(eZSys::wwwDir() . $Filename, $OriginalFilename, $FileType);
}
}
}
}
}
if (count($fileAttachments) != 0) {
$mime_boundary = "==Multipart_Boundary_" . md5(time());
//Plain Text part of Message
$message = "--{$mime_boundary}\n" . "Content-Type: text/html; " . eZTextCodec::internalCharset() . "\n" . "Content-Transfer-Encoding: 8bit\n\n";
//Form Result
$message .= $templateResult;
//Attachment(s) part of message
foreach ($fileAttachments as $attacharray) {
$filedata = chunk_split(base64_encode(eZFile::getContents($attacharray[0])));
$message .= "\n\n\n--{$mime_boundary}\n" . "Content-Type: " . $attacharray[2] . ";\n" . " name=\"" . $attacharray[1] . "\"\n" . "Content-Transfer-Encoding: base64\n" . "Content-Disposition: inline;\n" . " filename=\"" . $attacharray[1] . "\"\n\n" . $filedata . "\n";
}
$message .= "--{$mime_boundary}--\n\n\n";
$templateResult = $message;
$mail->setContentType("multipart/mixed;boundary={$mime_boundary}", false, false, false);
}
//END ENHANCED BINARY EXTENSION MAIL CODE ADDITION
$mail->setBody($templateResult);
$mailResult = eZMailTransport::send($mail);
}
$icMap = array();
if ($http->hasSessionVariable('InformationCollectionMap')) {
$icMap = $http->sessionVariable('InformationCollectionMap');
}
$icMap[$object->attribute('id')] = $collection->attribute('id');
示例3: DateTime
$cli->output('Cannot find the cluster identifier for site access "'.$siteAccess['name'].'"');
$date = new DateTime();
$cli->output($date->format("Y-m-d H:i:s")." - END");
$script->shutdown(1);
}
$clusterIdentifier = key($clusterMapping);
// Get JSON config
if ( !SolrSafeOperatorHelper::featureIsActive('Seo') )
{
$script->shutdown(0);
}
$cli->output('Export config to JSON for "'.$clusterIdentifier.'"');
$fileName = 'config.json';
$filePath = 'extension/ezoscar/bin/php/seo/';
$config = json_decode(eZFile::getContents($filePath.$fileName), true);
// Check SEO results
$db = MMDB::instance();
$result = $db->arrayQuery('SELECT COUNT(1) AS seo_count FROM mm_seo WHERE cluster_identifier = "'.$clusterIdentifier.'"');
if($result[0]['seo_count'] == 0)
{
$cli->output('No SEO data for '.$clusterIdentifier);
$date = new DateTime();
$cli->output($date->format("Y-m-d H:i:s")." - END");
$script->shutdown(1);
}
if ( !isset($config["publishersIds"]) )
$config["publishersIds"] = array();