コード例 #1
0
 /**
  * Used to push a local file to a remote filesystem
  * Used with the custom 'po_bebop_media.push_file_to_remote' hook
  *
  * @param  string $file Absolute or partial path to file, relative to uploads directory
  * @return void
  */
 public function __pushFileToRemote($file)
 {
     // Remove uploads base path so that we end up
     // with the "/YYYY/MM/filename.extension" format
     $path = str_replace(Config::getInstance()->get('local.base_dir'), '', Utils::getCleanAWSS3Key($file));
     // Push local file to remote filesystem
     $fs = Filesystem::getInstance();
     if ($fs->localHas($path)) {
         $fs->push($path);
     }
     // This is a hook function, so we should return $file
     return $file;
 }