当前位置: 首页>>代码示例>>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;未经允许,请勿转载。