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


PHP FileHandler::makeDir方法代码示例

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


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

示例1: getPoint

 /**
  * @brief Get the points
  */
 function getPoint($member_srl, $from_db = false)
 {
     $member_srl = abs($member_srl);
     // Get from instance memory
     if (!$from_db && $this->pointList[$member_srl]) {
         return $this->pointList[$member_srl];
     }
     // Get from file cache
     $path = sprintf(_XE_PATH_ . 'files/member_extra_info/point/%s', getNumberingPath($member_srl));
     $cache_filename = sprintf('%s%d.cache.txt', $path, $member_srl);
     if (!$from_db && file_exists($cache_filename)) {
         return $this->pointList[$member_srl] = trim(FileHandler::readFile($cache_filename));
     }
     // Get from the DB
     $args = new stdClass();
     $args->member_srl = $member_srl;
     $output = executeQuery('point.getPoint', $args);
     if (isset($output->data->member_srl)) {
         $point = (int) $output->data->point;
         $this->pointList[$member_srl] = $point;
         if (!is_dir($path)) {
             FileHandler::makeDir($path);
         }
         FileHandler::writeFile($cache_filename, $point);
         return $point;
     }
     return 0;
 }
开发者ID:kimkucheol,项目名称:xe-core,代码行数:31,代码来源:point.model.php

示例2: moduleInstall

 /**
  * @brief 설치시 추가 작업이 필요할시 구현
  **/
 function moduleInstall()
 {
     // action forward에 등록 (관리자 모드에서 사용하기 위함)
     $oModuleController =& getController('module');
     // 첨부파일의 기본 설정 저장
     $config->allowed_filesize = '2';
     $config->allowed_attach_size = '2';
     $config->allowed_filetypes = '*.*';
     $oModuleController->insertModuleConfig('file', $config);
     // file 모듈에서 사용할 디렉토리 생성
     FileHandler::makeDir('./files/attach/images');
     FileHandler::makeDir('./files/attach/binaries');
     // 2007. 10. 17 글/댓글의 입력/수정/삭제에 대한 trigger 등록
     $oModuleController->insertTrigger('document.insertDocument', 'file', 'controller', 'triggerCheckAttached', 'before');
     $oModuleController->insertTrigger('document.insertDocument', 'file', 'controller', 'triggerAttachFiles', 'after');
     $oModuleController->insertTrigger('document.updateDocument', 'file', 'controller', 'triggerCheckAttached', 'before');
     $oModuleController->insertTrigger('document.updateDocument', 'file', 'controller', 'triggerAttachFiles', 'after');
     $oModuleController->insertTrigger('document.deleteDocument', 'file', 'controller', 'triggerDeleteAttached', 'after');
     $oModuleController->insertTrigger('comment.insertComment', 'file', 'controller', 'triggerCommentCheckAttached', 'before');
     $oModuleController->insertTrigger('comment.insertComment', 'file', 'controller', 'triggerCommentAttachFiles', 'after');
     $oModuleController->insertTrigger('comment.updateComment', 'file', 'controller', 'triggerCommentCheckAttached', 'before');
     $oModuleController->insertTrigger('comment.updateComment', 'file', 'controller', 'triggerCommentAttachFiles', 'after');
     $oModuleController->insertTrigger('comment.deleteComment', 'file', 'controller', 'triggerCommentDeleteAttached', 'after');
     // 2009. 6. 9 자동저장문서 삭제시 첨부 파일도 같이 삭제
     $oModuleController->insertTrigger('editor.deleteSavedDoc', 'file', 'controller', 'triggerDeleteAttached', 'after');
     // 2007. 10. 17 모듈이 삭제될때 등록된 첨부파일도 모두 삭제하는 트리거 추가
     $oModuleController->insertTrigger('module.deleteModule', 'file', 'controller', 'triggerDeleteModuleFiles', 'after');
     // 2007. 10. 19 출력하기 전에 file 권한등을 세팅하는 트리거 호출
     $oModuleController->insertTrigger('module.dispAdditionSetup', 'file', 'view', 'triggerDispFileAdditionSetup', 'before');
     return new Object();
 }
开发者ID:hottaro,项目名称:xpressengine,代码行数:34,代码来源:file.class.php

示例3: moduleInstall

 /**
  * @brief 설치시 추가 작업이 필요할시 구현
  **/
 function moduleInstall()
 {
     // action forward에 등록 (관리자 모드에서 사용하기 위함)
     $oModuleController =& getController('module');
     $oDB =& DB::getInstance();
     $oDB->addIndex("modules", "idx_site_mid", array("site_srl", "mid"), true);
     // module 모듈에서 사용할 디렉토리 생성
     FileHandler::makeDir('./files/cache/module_info');
     FileHandler::makeDir('./files/cache/triggers');
     // sites 테이블에 기본 사이트 정보 입력
     $args->site_srl = 0;
     $output = $oDB->executeQuery('module.getSite', $args);
     if (!$output->data || !$output->data->index_module_srl) {
         $db_info = Context::getDBInfo();
         $domain = Context::getDefaultUrl();
         $url_info = parse_url($domain);
         $domain = $url_info['host'] . (!empty($url_info['port']) && $url_info['port'] != 80 ? ':' . $url_info['port'] : '') . $url_info['path'];
         $site_args->site_srl = 0;
         $site_args->index_module_srl = 0;
         $site_args->domain = $domain;
         $site_args->default_language = $db_info->lang_type;
         $output = executeQuery('module.insertSite', $site_args);
         if (!$output->toBool()) {
             return $output;
         }
     }
     return new Object();
 }
开发者ID:hottaro,项目名称:xpressengine,代码行数:31,代码来源:module.class.php

示例4: moduleUpdate

 /**
  * @brief 업데이트 실행
  **/
 function moduleUpdate()
 {
     if (!is_dir("./files/member_extra_info/new_message_flags")) {
         FileHandler::makeDir('./files/member_extra_info/new_message_flags');
     }
     return new Object(0, 'success_updated');
 }
开发者ID:hottaro,项目名称:xpressengine,代码行数:10,代码来源:communication.class.php

示例5: moduleInstall

 /**
  * @brief Implement if additional tasks are necessary when installing
  */
 function moduleInstall()
 {
     // Register action forward (to use in administrator mode)
     $oModuleController = getController('module');
     // Add the default editor component
     $oEditorController = getAdminController('editor');
     $oEditorController->insertComponent('colorpicker_text', true);
     $oEditorController->insertComponent('colorpicker_bg', true);
     $oEditorController->insertComponent('emoticon', true);
     $oEditorController->insertComponent('url_link', true);
     $oEditorController->insertComponent('image_link', true);
     $oEditorController->insertComponent('multimedia_link', true);
     $oEditorController->insertComponent('quotation', true);
     $oEditorController->insertComponent('table_maker', true);
     $oEditorController->insertComponent('poll_maker', true);
     $oEditorController->insertComponent('image_gallery', true);
     // Create a directory to use in the editor module
     FileHandler::makeDir('./files/cache/editor');
     // 2007. 10. 17 Add a trigger to delete automatically saved document whenever the document(insert or update) is modified
     $oModuleController->insertTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
     $oModuleController->insertTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
     // 2007. 10. 23 Add an editor trigger on the module addition setup
     $oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before');
     // 2009. 04. 14 Add a trigger from compiled codes of the editor component
     $oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before');
     return new Object();
 }
开发者ID:rhymix,项目名称:rhymix,代码行数:30,代码来源:editor.class.php

示例6: moduleInstall

 /**
  * @brief 설치시 추가 작업이 필요할시 구현
  **/
 function moduleInstall()
 {
     // action forward에 등록 (관리자 모드에서 사용하기 위함)
     $oModuleController =& getController('module');
     // 기본 에디터 컴포넌트를 추가
     $oEditorController =& getAdminController('editor');
     $oEditorController->insertComponent('colorpicker_text', true);
     $oEditorController->insertComponent('colorpicker_bg', true);
     $oEditorController->insertComponent('emoticon', true);
     $oEditorController->insertComponent('url_link', true);
     $oEditorController->insertComponent('image_link', true);
     $oEditorController->insertComponent('multimedia_link', true);
     $oEditorController->insertComponent('quotation', true);
     $oEditorController->insertComponent('table_maker', true);
     $oEditorController->insertComponent('poll_maker', true);
     $oEditorController->insertComponent('image_gallery', true);
     // 에디터 모듈에서 사용할 디렉토리 생성
     FileHandler::makeDir('./files/cache/editor');
     // 2007. 10. 17 글의 입력(신규 or 수정)이 일어날때마다 자동 저장된 문서를 삭제하는 trigger 추가
     $oModuleController->insertTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
     $oModuleController->insertTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
     // 2007. 10. 23 모듈의 추가 설정에서 에디터 trigger 추가
     $oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before');
     // 2009. 04. 14 editor component 변환 코드를 trigger로 독립
     $oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before');
     return new Object();
 }
开发者ID:hottaro,项目名称:xpressengine,代码行数:30,代码来源:editor.class.php

示例7: moduleInstall

 /**
  * Implement if additional tasks are necessary when installing
  *
  * @return Object
  */
 function moduleInstall()
 {
     // Register action forward (to use in administrator mode)
     $oModuleController = getController('module');
     // Save the default settings for attachments
     $config = new stdClass();
     $config->allowed_filesize = '2';
     $config->allowed_attach_size = '2';
     $config->allowed_filetypes = '*.*';
     $oModuleController->insertModuleConfig('file', $config);
     // Generate a directory for the file module
     FileHandler::makeDir('./files/attach/images');
     FileHandler::makeDir('./files/attach/binaries');
     // 2007. 10. 17 Create a trigger to insert, update, delete documents and comments
     $oModuleController->insertTrigger('document.insertDocument', 'file', 'controller', 'triggerCheckAttached', 'before');
     $oModuleController->insertTrigger('document.insertDocument', 'file', 'controller', 'triggerAttachFiles', 'after');
     $oModuleController->insertTrigger('document.updateDocument', 'file', 'controller', 'triggerCheckAttached', 'before');
     $oModuleController->insertTrigger('document.updateDocument', 'file', 'controller', 'triggerAttachFiles', 'after');
     $oModuleController->insertTrigger('document.deleteDocument', 'file', 'controller', 'triggerDeleteAttached', 'after');
     $oModuleController->insertTrigger('comment.insertComment', 'file', 'controller', 'triggerCommentCheckAttached', 'before');
     $oModuleController->insertTrigger('comment.insertComment', 'file', 'controller', 'triggerCommentAttachFiles', 'after');
     $oModuleController->insertTrigger('comment.updateComment', 'file', 'controller', 'triggerCommentCheckAttached', 'before');
     $oModuleController->insertTrigger('comment.updateComment', 'file', 'controller', 'triggerCommentAttachFiles', 'after');
     $oModuleController->insertTrigger('comment.deleteComment', 'file', 'controller', 'triggerCommentDeleteAttached', 'after');
     // 2009. 6. 9 Delete all the attachements when auto-saved document is deleted
     $oModuleController->insertTrigger('editor.deleteSavedDoc', 'file', 'controller', 'triggerDeleteAttached', 'after');
     // 2007. 10. 17 Create a trigger to delete all the attachements when the module is deleted
     $oModuleController->insertTrigger('module.deleteModule', 'file', 'controller', 'triggerDeleteModuleFiles', 'after');
     // 2007. 10. 19 Call a trigger to set up the file permissions before displaying
     $oModuleController->insertTrigger('module.dispAdditionSetup', 'file', 'view', 'triggerDispFileAdditionSetup', 'before');
     return new Object();
 }
开发者ID:rubythonode,项目名称:xe-core,代码行数:37,代码来源:file.class.php

示例8: CacheFile

 /**
  * Constructor
  *
  * @return void
  */
 function CacheFile()
 {
     $this->cache_dir = _XE_PATH_ . $this->cache_dir;
     if (!is_dir($this->cache_dir)) {
         FileHandler::makeDir($this->cache_dir);
     }
 }
开发者ID:relip,项目名称:xe-core,代码行数:12,代码来源:CacheFile.class.php

示例9: procRssAdminInsertConfig

 /**
  * @brief RSS 전체피드 설정
  **/
 function procRssAdminInsertConfig()
 {
     $oModuleModel =& getModel('module');
     $total_config = $oModuleModel->getModuleConfig('rss');
     $config_vars = Context::getRequestVars();
     $config_vars->feed_document_count = (int) $config_vars->feed_document_count;
     if (!$config_vars->use_total_feed) {
         $alt_message = 'msg_invalid_request';
     }
     if (!in_array($config_vars->use_total_feed, array('Y', 'N'))) {
         $config_vars->open_rss = 'Y';
     }
     if ($config_vars->image || $config_vars->del_image) {
         $image_obj = $config_vars->image;
         $config_vars->image = $total_config->image;
         // 삭제 요청에 대한 변수를 구함
         if ($config_vars->del_image == 'Y' || $image_obj) {
             FileHandler::removeFile($config_vars->image);
             $config_vars->image = '';
             $total_config->image = '';
         }
         // 정상적으로 업로드된 파일이 아니면 무시
         if ($image_obj['tmp_name'] && is_uploaded_file($image_obj['tmp_name'])) {
             // 이미지 파일이 아니어도 무시 (swf는 패스~)
             $image_obj['name'] = Context::convertEncodingStr($image_obj['name']);
             if (!preg_match("/\\.(jpg|jpeg|gif|png)\$/i", $image_obj['name'])) {
                 $alt_message = 'msg_rss_invalid_image_format';
             } else {
                 // 경로를 정해서 업로드
                 $path = './files/attach/images/rss/';
                 // 디렉토리 생성
                 if (!FileHandler::makeDir($path)) {
                     $alt_message = 'msg_error_occured';
                 } else {
                     $filename = $path . $image_obj['name'];
                     // 파일 이동
                     if (!move_uploaded_file($image_obj['tmp_name'], $filename)) {
                         $alt_message = 'msg_error_occured';
                     } else {
                         $config_vars->image = $filename;
                     }
                 }
             }
         }
     }
     if (!$config_vars->image && $config_vars->del_image != 'Y') {
         $config_vars->image = $total_config->image;
     }
     $output = $this->setFeedConfig($config_vars);
     if (!$alt_message) {
         $alt_message = 'success_updated';
     }
     $alt_message = Context::getLang($alt_message);
     Context::set('msg', $alt_message);
     $this->setLayoutPath('./common/tpl');
     $this->setLayoutFile('default_layout.html');
     $this->setTemplatePath($this->module_path . 'tpl');
     $this->setTemplateFile("top_refresh.html");
 }
开发者ID:hottaro,项目名称:xpressengine,代码行数:62,代码来源:rss.admin.controller.php

示例10: pluginInstall

 function pluginInstall($args)
 {
     // mkdir
     FileHandler::makeDir(sprintf(_XE_PATH_ . "files/epay/%s/log", $args->plugin_srl));
     // copy files
     FileHandler::copyFile(_XE_PATH_ . 'modules/epay/plugins/payplus6/.htaccess', sprintf(_XE_PATH_ . "files/epay/%s/.htaccess", $args->plugin_srl));
     FileHandler::copyFile(_XE_PATH_ . 'modules/epay/plugins/payplus6/readme.txt', sprintf(_XE_PATH_ . "files/epay/%s/readme.txt", $args->plugin_srl));
 }
开发者ID:bjrambo,项目名称:nurigo,代码行数:8,代码来源:payplus6.plugin.php

示例11: checkUpdate

 /**
  * @brief 설치가 이상이 없는지 체크하는 method
  **/
 function checkUpdate()
 {
     // cache 디렉토리가 없으면 바로 디렉토리 생성
     if (!is_dir('./files/cache/opage')) {
         FileHandler::makeDir('./files/cache/opage');
     }
     return false;
 }
开发者ID:hottaro,项目名称:xpressengine,代码行数:11,代码来源:opage.class.php

示例12: moduleInstall

 /**
  * @brief Additional tasks required to accomplish during the installation
  */
 function moduleInstall()
 {
     // Registration in action forward (for using in the administrator mode)
     $oModuleController = getController('module');
     // Create a directory to store points information
     FileHandler::makeDir('./files/member_extra_info/point');
     $oModuleController = getController('module');
     // The highest level
     $config = new stdClass();
     // default, point module is OFF
     $config->able_module = 'N';
     $config->max_level = 30;
     // Per-level score
     for ($i = 1; $i <= 30; $i++) {
         $config->level_step[$i] = pow($i, 2) * 90;
     }
     // Points for registration
     $config->signup_point = 10;
     // Login points
     $config->login_point = 5;
     // Point's name
     $config->point_name = 'point';
     // Level icon directory
     $config->level_icon = "default";
     // Prevent downloads if there are no scores
     $config->disable_download = false;
     /**
      * Define the default points per module as well as all actions (as we do not know if it is forum or blogs, specify "act")
      */
     // Insert document
     $config->insert_document = 10;
     $config->insert_document_act = 'procBoardInsertDocument';
     $config->delete_document_act = 'procBoardDeleteDocument';
     // Insert comment
     $config->insert_comment = 5;
     $config->insert_comment_act = 'procBoardInsertComment,procBlogInsertComment';
     $config->delete_comment_act = 'procBoardDeleteComment,procBlogDeleteComment';
     // Upload
     $config->upload_file = 5;
     $config->upload_file_act = 'procFileUpload';
     $config->delete_file_act = 'procFileDelete';
     // Download
     $config->download_file = -5;
     $config->download_file_act = 'procFileDownload';
     // View
     $config->read_document = 0;
     // Vote up / Vote down
     $config->voted = 0;
     $config->blamed = 0;
     // Save configurations
     $oModuleController->insertModuleConfig('point', $config);
     // Cash act list for faster execution
     $oPointController = getAdminController('point');
     $oPointController->cacheActList();
     return new Object();
 }
开发者ID:kimkucheol,项目名称:xe-core,代码行数:59,代码来源:point.class.php

示例13: moduleInstall

 /**
  * @brief 설치시 추가 작업이 필요할시 구현
  **/
 function moduleInstall()
 {
     // widget 에서 사용할 cache디렉토리 생성
     FileHandler::makeDir('./files/cache/widget');
     FileHandler::makeDir('./files/cache/widget_cache');
     // widget compile을 위한 display.after 트리거 추가
     $oModuleController =& getController('module');
     $oModuleController->insertTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before');
     return new Object();
 }
开发者ID:hottaro,项目名称:xpressengine,代码行数:13,代码来源:widget.class.php

示例14: moduleInstall

 /**
  * @brief Implement if additional tasks are necessary when installing
  **/
 function moduleInstall()
 {
     // Create cache directory used by widget
     FileHandler::makeDir('./files/cache/widget');
     FileHandler::makeDir('./files/cache/widget_cache');
     // Add this widget compile the trigger for the display.after
     $oModuleController =& getController('module');
     $oModuleController->insertTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before');
     return new Object();
 }
开发者ID:relip,项目名称:xe-core,代码行数:13,代码来源:widget.class.php

示例15: getThumbnailByUrl

 function getThumbnailByUrl($image_url, $width = 80, $height = 0, $thumbnail_type = '')
 {
     if (!$height) {
         $height = $width;
     }
     if (!in_array($thumbnail_type, array('crop', 'ratio'))) {
         $config = $GLOBALS['__document_config__'];
         if (!$config) {
             $oDocumentModel = getModel('document');
             $config = $oDocumentModel->getDocumentConfig();
             $GLOBALS['__document_config__'] = $config;
         }
         $thumbnail_type = $config->thumbnail_type;
     }
     if (!is_dir('./files/thumbnails/magiccontent_thumbnail')) {
         FileHandler::makeDir('./files/thumbnails/magiccontent_thumbnail');
     }
     $thumbnail_path = sprintf('files/thumbnails/magiccontent_thumbnail/%s', base64_encode($image_url));
     $thumbnail_file = sprintf('%s%dx%d.%s.jpg', $thumbnail_path, $width, $height, $thumbnail_type);
     $thumbnail_url = Context::getRequestUri() . $thumbnail_file;
     if (file_exists($thumbnail_file)) {
         if (filesize($thumbnail_file) < 1) {
             return false;
         } else {
             return $thumbnail_url;
         }
     }
     $tmp_file = sprintf('./files/cache/tmp/%s', md5(rand(111111, 999999) . $image_url));
     if (!is_dir('./files/cache/tmp')) {
         FileHandler::makeDir('./files/cache/tmp');
     }
     if (!preg_match('/^(http|https):\\/\\//i', $image_url)) {
         $image_url = Context::getRequestUri() . $image_url;
     }
     FileHandler::getRemoteFile($image_url, $tmp_file);
     if (!file_exists($tmp_file)) {
         return false;
     } else {
         list($_w, $_h, $_t, $_a) = @getimagesize($tmp_file);
         if (!in_array($_t, array(1, 2, 3, 6, 7, 8))) {
             FileHandler::writeFile($thumbnail_file, '', 'w');
             return false;
         }
         $source_file = $tmp_file;
     }
     $output = FileHandler::createImageFile($source_file, $thumbnail_file, $width, $height, 'jpg', $thumbnail_type);
     FileHandler::removeFile($source_file);
     if ($output) {
         return $thumbnail_url;
     } else {
         FileHandler::writeFile($thumbnail_file, '', 'w');
     }
     return false;
 }
开发者ID:ilbecms,项目名称:xe_module_magiccontent,代码行数:54,代码来源:magiccontent.model.php


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