本文整理汇总了PHP中Vtiger_Functions::initStorageFileDirectory方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Functions::initStorageFileDirectory方法的具体用法?PHP Vtiger_Functions::initStorageFileDirectory怎么用?PHP Vtiger_Functions::initStorageFileDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Functions
的用法示例。
在下文中一共展示了Vtiger_Functions::initStorageFileDirectory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: decideFilePath
/**
* This function is used to decide the File Storage Path in where we will upload the file in the server.
* return string $filepath - filepath inwhere the file should be stored in the server will be return
*/
function decideFilePath()
{
return Vtiger_Functions::initStorageFileDirectory();
}
示例2: _SaveAttachmentFile
function _SaveAttachmentFile($attachid, $filename, $filecontent)
{
require_once 'modules/OSSMail/MailAttachmentMIME.php';
$adb = PearDatabase::getInstance();
$dirname = Vtiger_Functions::initStorageFileDirectory('OSSMailView');
if (!is_dir($dirname)) {
mkdir($dirname);
}
$filename = str_replace(' ', '-', $filename);
$filename = str_replace(':', '-', $filename);
$filename = str_replace('/', '-', $filename);
$saveasfile = "{$dirname}{$attachid}" . "_{$filename}";
if (!file_exists($saveasfile)) {
$fh = fopen($saveasfile, 'wb');
fwrite($fh, $filecontent);
fclose($fh);
}
$mimetype = MailAttachmentMIME::detect($saveasfile);
$adb->pquery("INSERT INTO vtiger_attachments SET attachmentsid=?, name=?, description=?, type=?, path=?", array($attachid, $filename, $description, $mimetype, $dirname));
return true;
}
示例3: decideFilePath
/**
* This function is used to decide the File Storage Path in where we will upload the file in the server.
* return string $filepath - filepath inwhere the file should be stored in the server will be return
*/
function decideFilePath($module = false)
{
return Vtiger_Functions::initStorageFileDirectory($module);
}