当前位置: 首页>>代码示例>>PHP>>正文


PHP FileUtil::getDataDirectory方法代码示例

本文整理汇总了PHP中FileUtil::getDataDirectory方法的典型用法代码示例。如果您正苦于以下问题:PHP FileUtil::getDataDirectory方法的具体用法?PHP FileUtil::getDataDirectory怎么用?PHP FileUtil::getDataDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FileUtil的用法示例。


在下文中一共展示了FileUtil::getDataDirectory方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createUploadDir

    private function createUploadDir()
    {
        $uploadDirectory = \FileUtil::getDataDirectory() . '/cmfcmf-media-module/media';
        if (!is_dir($uploadDirectory)) {
            mkdir($uploadDirectory, 0777, true);
        }
        $htaccess = <<<TXT
deny from all
<FilesMatch "(?i)\\.(css|js|rss|png|gif|jpg|jpeg|psd|svg|txt|rtf|xml|pdf|sdt|odt|doc|docx|pps|ppt|pptx|xls|xlsx|mp3|wav|wma|avi|flv|mov|mp4|rm|vob|wmv|gz|rar|tar.gz|zip|ogg|webm)\$">
order allow,deny
allow from all
</FilesMatch>
TXT;
        file_put_contents($uploadDirectory . '/.htaccess', $htaccess);
    }
开发者ID:shefik,项目名称:MediaModule,代码行数:15,代码来源:MediaModuleInstaller.php

示例2: uninstall

 /**
  * Uninstall Reviews.
  *
  * @return boolean True on success, false otherwise.
  */
 public function uninstall()
 {
     // delete stored object workflows
     $result = Zikula_Workflow_Util::deleteWorkflowsForModule($this->getName());
     if ($result === false) {
         return LogUtil::registerError($this->__f('An error was encountered while removing stored object workflows for the %s extension.', array($this->getName())));
     }
     try {
         DoctrineHelper::dropSchema($this->entityManager, $this->listEntityClasses());
     } catch (\Exception $e) {
         if (System::isDevelopmentMode()) {
             return LogUtil::registerError($this->__('Doctrine Exception: ') . $e->getMessage());
         }
         return LogUtil::registerError($this->__f('An error was encountered while dropping tables for the %s extension.', array($this->name)));
     }
     // unregister persistent event handlers
     EventUtil::unregisterPersistentModuleHandlers($this->name);
     // unregister hook subscriber bundles
     HookUtil::unregisterSubscriberBundles($this->version->getHookSubscriberBundles());
     // remove all module vars
     $this->delVars();
     // remove category registry entries
     ModUtil::dbInfoLoad('Categories');
     DBUtil::deleteWhere('categories_registry', 'modname = \'' . $this->name . '\'');
     // remove all thumbnails
     $manager = $this->getServiceManager()->getService('systemplugin.imagine.manager');
     $manager->setModule($this->name);
     $manager->cleanupModuleThumbs();
     // remind user about upload folders not being deleted
     $uploadPath = FileUtil::getDataDirectory() . '/' . $this->name . '/';
     LogUtil::registerStatus($this->__f('The upload directories at [%s] can be removed manually.', $uploadPath));
     // uninstallation successful
     return true;
 }
开发者ID:rmaiwald,项目名称:Reviews,代码行数:39,代码来源:Installer.php

示例3: getPathToUploadTo

 public function getPathToUploadTo($defaultPath)
 {
     unset($defaultPath);
     return \FileUtil::getDataDirectory() . '/cmfcmf-media-module/watermarks';
 }
开发者ID:shefik,项目名称:MediaModule,代码行数:5,代码来源:ImageWatermarkEntity.php

示例4: getFileBaseFolder

 /**
  * Retrieve the base path for given object type and upload field combination.
  *
  * @param string  $objectType   Name of treated entity type.
  * @param string  $fieldName    Name of upload field.
  * @param boolean $ignoreCreate Whether to ignore the creation of upload folders on demand or not.
  *
  * @return mixed Output.
  * @throws Exception if invalid object type is given.
  */
 public function getFileBaseFolder($objectType, $fieldName, $ignoreCreate = false)
 {
     if (!in_array($objectType, $this->getObjectTypes())) {
         throw new Exception('Error! Invalid object type received.');
     }
     $basePath = FileUtil::getDataDirectory() . '/Reviews/';
     switch ($objectType) {
         case 'review':
             $basePath .= 'reviews/coverupload/';
             break;
     }
     $result = DataUtil::formatForOS($basePath);
     if (substr($result, -1, 1) != '/') {
         // reappend the removed slash
         $result .= '/';
     }
     if (!is_dir($result) && !$ignoreCreate) {
         $this->checkAndCreateAllUploadFolders();
     }
     return $result;
 }
开发者ID:rmaiwald,项目名称:Reviews,代码行数:31,代码来源:Controller.php

示例5: getFileBaseFolder

 /**
  * Retrieve the base path for given object type and upload field combination.
  *
  * @param string $objectType Name of treated entity type.
  * @param string $fieldName  Name of upload field.
  * @param array  $args       Additional arguments.
  *
  * @return mixed Output.
  */
 public static function getFileBaseFolder($objectType, $fieldName)
 {
     if (!in_array($objectType, self::getObjectTypes())) {
         $objectType = self::getDefaultObjectType();
     }
     $basePath = FileUtil::getDataDirectory() . '/MUBoard/';
     switch ($objectType) {
         case 'posting':
             $basePath .= 'postings/';
             switch ($fieldName) {
                 case 'firstImage':
                     $basePath .= 'firstimage/';
                     break;
                 case 'secondImage':
                     $basePath .= 'secondimage/';
                     break;
                 case 'thirdImage':
                     $basePath .= 'thirdimage/';
                     break;
                 case 'firstFile':
                     $basePath .= 'firstfile/';
                     break;
                 case 'secondFile':
                     $basePath .= 'secondfile/';
                     break;
                 case 'thirdFile':
                     $basePath .= 'thirdfile/';
                     break;
             }
             break;
         case 'rank':
             $basePath .= 'ranks/uploadimage/';
             break;
     }
     return $basePath;
 }
开发者ID:rmaiwald,项目名称:MUBoard,代码行数:45,代码来源:Controller.php

示例6: getUploadRootDir

 public function getUploadRootDir()
 {
     return \FileUtil::getDataDirectory() . '/kmgallery/media';
 }
开发者ID:Kaik,项目名称:KaikMediaGallery,代码行数:4,代码来源:AbstractUploadableEntity.php


注:本文中的FileUtil::getDataDirectory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。