install module to client
This commit is contained in:
parent
d84f23c756
commit
10605e17e7
@ -97,20 +97,12 @@ class ModuleShopRestController extends RestController
|
||||
$this->renderApi($res);
|
||||
}
|
||||
|
||||
public function actionInstall(int $id): void
|
||||
public function actionInstall($id): void
|
||||
{
|
||||
$model = $this->model->where("id", $id)->first();
|
||||
|
||||
header('Content-type: application/zip');
|
||||
header('Content-Disposition: attachment; filename="' . $model->slug . '.igm"');
|
||||
header('Content-Length: ' . filesize(ROOT_DIR . $model->path_to_archive));
|
||||
|
||||
// Debug::dd(filesize(ROOT_DIR . $model->path_to_archive));
|
||||
readfile(ROOT_DIR . $model->path_to_archive);
|
||||
|
||||
|
||||
$model->installations++;
|
||||
$model->save();
|
||||
$this->renderApi($model->toArray());
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user