Example #1
0
 protected function _saveFaviconTemp($icon, $iconname)
 {
     $site_info = Context::get('site_module_info');
     $virtual_site = '';
     if ($site_info->site_srl) {
         $virtual_site = $site_info->site_srl . '/';
     }
     $original_filename = $icon['tmp_name'];
     $type = $icon['type'];
     $relative_filename = 'files/attach/xeicon/' . $virtual_site . 'tmp/' . $iconname;
     $target_filename = \RX_BASEDIR . $relative_filename;
     if (!preg_match('/^(favicon|mobicon|default_image)\\.(ico|png|jpe?g)$/', $iconname)) {
         Context::set('msg', lang('msg_invalid_format'));
         return;
     }
     Rhymix\Framework\Storage::copy($original_filename, $target_filename, 0666 & ~umask());
     return $relative_filename;
 }
Example #2
0
 /**
  * Copy a file to target
  *
  * @param string $source Path of source file
  * @param string $target Path of target file
  * @param string $force Y: overwrite
  * @return void
  */
 public static function copyFile($source, $target, $force = 'Y')
 {
     setlocale(LC_CTYPE, 'en_US.UTF8', 'ko_KR.UTF8');
     return Rhymix\Framework\Storage::copy(self::getRealPath($source), self::getRealPath($target));
 }