本文整理汇总了PHP中FileMaker::makeDirectory方法的典型用法代码示例。如果您正苦于以下问题:PHP FileMaker::makeDirectory方法的具体用法?PHP FileMaker::makeDirectory怎么用?PHP FileMaker::makeDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileMaker
的用法示例。
在下文中一共展示了FileMaker::makeDirectory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Unpack
public function Unpack()
{
global $varChecker;
$path = $varChecker->getValue('path');
$zipper = new Zipper();
if ($zipper->IsZipFile($path)) {
$fmaker = new FileMaker();
$filename = substr($path, strrpos($path, '/') + 1);
$folderpath = str_replace($filename, '', $path);
$folderpath = $folderpath . 'resources/';
$fmaker->makeDirectory($folderpath, true);
$files = $zipper->Decompress($path, $folderpath);
$processedFiles = $this->saveFiles($files, $folderpath);
$savedFiles = $processedFiles['saved'];
$errorfiles = $processedFiles['error'];
} else {
//create files array with just one file
}
if (count($savedFiles) > 0) {
$result = array('success' => 'resourcesuploaded', 'files' => $savedFiles, 'errorfiles' => $errorfiles, 'folder' => $folderpath, 'rawcount' => count($files));
} else {
$result = array('error' => 'resourcesfailed', 'files' => $savedFiles, 'errorfiles' => $errorfiles, 'folder' => $folderpath, 'rawcount' => count($files));
}
return $result;
}
示例2: createStaticSpotFile
private function createStaticSpotFile($site, $spot, $tplSpotId)
{
$staticspotPath = 'cache/templates/' . $site->getId() . '/staticspots/';
$filename = $spot->systemName() . '_' . $tplSpotId . '.php';
if (!is_dir($staticspotPath)) {
$fm = new FileMaker();
$fm->makeDirectory($staticspotPath);
}
$filepath = $staticspotPath . $filename;
$fm = new FileMaker();
$fm->makeFile($filepath, $spot->getContent());
$serverpath = 'dynamic/includes';
$uploader = new FTPUploader($site);
$uploader->upload($serverpath, $filepath, $filename);
return $this->serverSideInclude($serverpath . $filename);
}
示例3: savetemplate
public function savetemplate()
{
global $varChecker;
$template = $this->dRep->getTemplate($varChecker->getValue('id'), false);
if ($varChecker->getValue('name') != '') {
$name = $varChecker->getValue('name');
} else {
throw new DataException('nonatemplateme', array('templatename'));
}
if ($varChecker->getValue('folderId') == 0) {
throw new DataException('noResourceFolder', array('resourcefilefields'));
}
$resourceFolder = $this->dRep->getFolder($varChecker->getValue('folderId'));
if ($resourceFolder->getId() == 'new') {
throw new DataException('folderNotExist');
}
//we have the temporary template created, now we need to make it propper
$spots = $template->getSpots();
$postedSpots = $varChecker->getValue('spots');
$count = 0;
$newSpots = array();
foreach ($postedSpots as $index => $postedSpot) {
$postedSpotArray = explode('-', $postedSpot);
if (count($postedSpotArray) != 3) {
throw new DataException('errorSaveSpot');
}
$tplSpotId = $postedSpotArray[0];
$spotId = $postedSpotArray[1];
$spotName = $postedSpotArray[2];
if ($spotId == 'new' || $spotId == 0) {
throw new DataException('allspotsneedtype');
}
if (isset($spots[$tplSpotId])) {
//this spot exists from before - check if it has changed
$spot = $spots[$tplSpotId];
if ($spot->getId() != $spotId) {
$configs = $spot->getConfigValues();
$order = $spot->order();
$tplSpotId = $spot->getTplSpotId();
$spot = $this->dRep->getSpot($spotId);
$spot->setProperties(array('order' => $order, 'tplSpotId' => $tplSpotId, 'configs' => $configs));
}
} else {
$spot = $this->dRep->getSpot(array('spotId' => $spotId));
}
$spotName = $spot->getConfigvalue('name');
if ($spotName !== false) {
$spot->setConfigvalue($spotName, $spotName);
}
$order = array('order' => $index);
$spot->setProperties($order);
$newSpots[$tplSpotId] = $spot;
$count++;
}
$vars = array('name' => $name, 'spots' => $newSpots, 'folder' => $resourceFolder);
if (!is_object($template->getSite())) {
$vars['site'] = $varChecker->getValue('siteId');
} else {
if ($template->getSite()->getId() != $varChecker->getValue('siteId')) {
$fm = new FileMaker();
if (!is_dir('cache/templates/' . $varChecker->getValue('siteId'))) {
$fm->makeDirectory('cache/templates/' . $varChecker->getValue('siteId'));
}
$oldPath = 'cache/templates/' . $template->getSite()->getId() . '/' . $template->getFilename();
$newPath = 'cache/templates/' . $varChecker->getValue('siteId') . '/' . $template->getFilename();
$fm->moveFile($oldPath, $newPath);
$vars['site'] = $varChecker->getValue('siteId');
}
}
$template->setProperties($vars);
$template = $this->dRep->saveTemplate($template);
echo json_encode(array('success' => 'tpl_saved', 'id' => $template->getId()));
}
示例4: createFolder
private function createFolder($path)
{
$fm = new FileMaker();
$fm->makeDirectory($path);
}