當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FileManager::mkdir方法代碼示例

本文整理匯總了PHP中Includes\Utils\FileManager::mkdir方法的典型用法代碼示例。如果您正苦於以下問題:PHP FileManager::mkdir方法的具體用法?PHP FileManager::mkdir怎麽用?PHP FileManager::mkdir使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Includes\Utils\FileManager的用法示例。


在下文中一共展示了FileManager::mkdir方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: deleteAllFiles

 /**
  * Delete all files
  *
  * @return void
  */
 public function deleteAllFiles()
 {
     $dir = \Includes\Utils\FileManager::getRealPath(LC_DIR_VAR . $this->getOptions()->dir);
     if (!\Includes\Utils\FileManager::isExists($dir)) {
         \Includes\Utils\FileManager::mkdir($dir);
     }
     $list = glob($dir . LC_DS . '*');
     if ($list) {
         foreach ($list as $path) {
             if (is_file($path)) {
                 \Includes\Utils\FileManager::deleteFile($path);
             } else {
                 \Includes\Utils\FileManager::unlinkRecursive($path);
             }
         }
     }
 }
開發者ID:kirkbauer2,項目名稱:kirkxc,代碼行數:22,代碼來源:Importer.php

示例2: writeDataToFile

 /**
  * Write data from request into a file
  *
  * @param \PEAR2\HTTP\Request\Response $response Response to get data
  *
  * @return string
  */
 protected function writeDataToFile(\PEAR2\HTTP\Request\Response $response)
 {
     if (!\Includes\Utils\FileManager::isDir(LC_DIR_TMP)) {
         \Includes\Utils\FileManager::mkdir(LC_DIR_TMP);
     }
     if (!\Includes\Utils\FileManager::isDirWriteable(LC_DIR_TMP)) {
         \Includes\ErrorHandler::fireError('Directory "' . LC_DIR_TMP . '" is not writeable');
     }
     $path = \Includes\Utils\FileManager::getUniquePath(LC_DIR_TMP, uniqid() . '.' . \Includes\Utils\PHARManager::getExtension() ?: 'tar');
     return isset($response->body) && \Includes\Utils\FileManager::write($path, $response->body) ? $path : null;
 }
開發者ID:kingsj,項目名稱:core,代碼行數:18,代碼來源:Marketplace.php

示例3: initializeWrite

 /**
  * Initialize write 
  * 
  * @return void
  */
 protected function initializeWrite()
 {
     if (!\Includes\Utils\FileManager::isExists(LC_DIR_DATA)) {
         \Includes\Utils\FileManager::mkdir(LC_DIR_DATA);
         if (!\Includes\Utils\FileManager::isExists(LC_DIR_DATA)) {
             \XLite\Logger::getInstance()->log('The directory ' . LC_DIR_DATA . ' can not be created.' . ' Check the permissions to create directories.', LOG_ERR);
         }
     }
     $this->fileIndex = null;
     $this->emptyFile = true;
 }
開發者ID:kingsj,項目名稱:core,代碼行數:16,代碼來源:SitemapGenerator.php

示例4: copyResource

 /**
  * Copy resource
  *
  * @param \XLite\Model\Base\Storage $storage      Storage
  * @param string                    $subdirectory Subdirectory
  *
  * @return boolean
  */
 protected function copyResource(\XLite\Model\Base\Storage $storage, $subdirectory)
 {
     $dir = LC_DIR_VAR . $this->generator->getOptions()->dir . LC_DS . $subdirectory;
     if (!\Includes\Utils\FileManager::isExists($dir)) {
         \Includes\Utils\FileManager::mkdir($dir);
     }
     $name = basename($storage->getPath());
     return \Includes\Utils\FileManager::write($dir . LC_DS . $name, $storage->getBody()) ? $subdirectory . LC_DS . $name : false;
 }
開發者ID:kirkbauer2,項目名稱:kirkxc,代碼行數:17,代碼來源:AStep.php

示例5: download

 /**
  * Download pack
  *
  * @param \XLite\Core\Pack\APack $pack     Files to pack
  * @param boolean                $compress Flag OPTIONAL
  *  
  * @return void
  */
 protected static function download(\XLite\Core\Pack\APack $pack, $compress = true)
 {
     if (!\Includes\Utils\FileManager::isDir(LC_DIR_TMP)) {
         \Includes\Utils\FileManager::mkdir(LC_DIR_TMP);
     }
     if (!\Includes\Utils\FileManager::isDirWriteable(LC_DIR_TMP)) {
         \Includes\ErrorHandler::fireError('Directory "' . LC_DIR_TMP . '" is not writeable');
     }
     $path = LC_DIR_TMP . $pack->getName() . '.tar';
     $phar = static::pack($path, $pack->getDirectoryIterator(), $pack->getMetadata(), $compress);
     header('Content-Type: application/force-download');
     header('Content-Disposition: attachment; filename="' . basename($path) . '"');
     header('Content-Length: ' . filesize($path));
     echo \Includes\Utils\FileManager::read($path);
     \Includes\Utils\FileManager::deleteFile($path);
     exit(0);
 }
開發者ID:kingsj,項目名稱:core,代碼行數:25,代碼來源:PHARManager.php


注:本文中的Includes\Utils\FileManager::mkdir方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。