This repository has been archived by the owner on Dec 16, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
55 additions
and
640 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace CrudKit\Util; | ||
|
||
use Composer\Script\Event; | ||
use Composer\Installer\PackageEvent; | ||
|
||
class Installer { | ||
private static function recursiveCopy ($source, $dest) { | ||
if (!is_dir($dest)) { | ||
mkdir($dest, 0755, true); | ||
} | ||
foreach ( | ||
$iterator = new \RecursiveIteratorIterator( | ||
new \RecursiveDirectoryIterator($source, \RecursiveDirectoryIterator::SKIP_DOTS), | ||
\RecursiveIteratorIterator::SELF_FIRST) as $item | ||
) { | ||
if ($item->isDir()) { | ||
$target = $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName(); | ||
if (!is_dir($target)) | ||
mkdir($target); | ||
} else { | ||
echo "Copying:\nSource:". $item."\nDestination:".$dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName()."\n\n"; | ||
copy($item, $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName()); | ||
} | ||
} | ||
} | ||
public static function copyFiles (Event $event) { | ||
$composer = $event->getComposer (); | ||
|
||
$vendorPath = $composer->getConfig()->get('vendor-dir'); | ||
$root = dirname($vendorPath); | ||
$ds = DIRECTORY_SEPARATOR; | ||
|
||
$src = $vendorPath.$ds."skyronic".$ds."crudkit".$ds."src".$ds."static".$ds."build".$ds; | ||
$dest = $root.$ds."public".$ds."static".$ds."crudkit"; | ||
|
||
echo "Copying crudkit static files... \n\n"; | ||
self::recursiveCopy ($src, $dest); | ||
echo "Done!\n\n"; | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<link href="{{ staticRoot }}/build/css/crudkit.min.css" type="text/css" rel="stylesheet" /> | ||
<script src="{{ staticRoot }}/build/js/crudkit.min.js" type="text/javascript"></script> | ||
<link href="{{ staticRoot }}css/crudkit.min.css" type="text/css" rel="stylesheet" /> | ||
<script src="{{ staticRoot }}js/crudkit.min.js" type="text/javascript"></script> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters