コード例 #1
0
ファイル: FilesController.php プロジェクト: joadr/cms
 public function store()
 {
     $data = \Input::only(['file']);
     $path = public_path() . '/uploads/files/';
     \FilesHelper::storeFileInPath($path, $data['file']);
     return \Redirect::route('dev.files.index');
 }
コード例 #2
0
ファイル: PackagesController.php プロジェクト: joadr/cms
 public function store()
 {
     $data = \Input::only(['file', 'github']);
     if (array_key_exists('github', $data)) {
         $path = app_path() . '/Cms/Packages/Temp/';
         $file = 'master.zip';
         $parts = explode('/', $data['github']);
         $name = end($parts);
         file_put_contents($path . $file, file_get_contents($data['github'] . "/archive/master.zip"));
         \FilesHelper::unzipFile($path . $file, $path);
         \PackagesHelper::installPackage($name . '-master');
     } else {
         $path = app_path() . '/Cms/Packages/Temp/';
         $file = \FilesHelper::storeFileInPath($path, $data['file']);
         \FilesHelper::unzipFile($path . $file, $path);
         \PackagesHelper::installPackage(str_replace('.zip', '', $file));
     }
     return \Redirect::route('dev.packages.index');
 }
コード例 #3
0
ファイル: FileDriver.php プロジェクト: joadr/cms
 private function saveFile($file, $name)
 {
     $path = app_path() . '/storage/files/';
     \FilesHelper::storeFileInPath($path, $file, $name);
 }