Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Create Folder Assets on Resources in Your Project Laravel.
- $assets = __DIR__ . "/resources/assets";
- $public = __DIR__ . "/public/assets";
- $system = php_uname("s");
- if(preg_match("/Mac/mi", $system)){
- $system = "Mac";
- }elseif(preg_match("/(Linux|FreeBSD)/mi", $system)){
- $system = "Linux";
- }elseif(preg_match("/Windows/mi", $system)){
- $system = "Windows";
- }
- switch($system){
- case "Mac":
- shell_exec("cp -RfXv {$assets} {$public}");
- echo "OK!";
- break;
- case "Linux":
- shell_exec("cp -rf {$assets} {$public}");
- echo "OK!";
- break;
- case "Windows":
- shell_exec("xcopy ".str_replace("/", "\\", $assets)." ".str_replace("/", "\\", $public)." /S /I /E /b /v /y");
- echo "OK!";
- break;
- default:
- echo "OS not supported!";
- break;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement