1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Contains \Cybertaxonomy\composer\CdmDataportalHelper.
|
6
|
*/
|
7
|
|
8
|
namespace Cybertaxonomy\composer;
|
9
|
|
10
|
use Composer\Script\Event;
|
11
|
use Composer\Semver\Comparator;
|
12
|
use DrupalFinder\DrupalFinder;
|
13
|
use Symfony\Component\Filesystem\Filesystem;
|
14
|
|
15
|
class CdmDataPortalHelper {
|
16
|
|
17
|
public static function createPolyfillSymlinks(Event $event) {
|
18
|
$fs = new Filesystem();
|
19
|
$drupalFinder = new DrupalFinder();
|
20
|
$drupalFinder->locateRoot(getcwd());
|
21
|
$drupalRoot = $drupalFinder->getDrupalRoot();
|
22
|
|
23
|
// Prepare the settings file for installation
|
24
|
if (!$fs->exists($drupalRoot . '/polyfills')) {
|
25
|
$fs->remove($drupalRoot . '/polyfills');
|
26
|
$event->getIO()->write("Existing ./polyfills removed");
|
27
|
}
|
28
|
$fs->symlink('./sites/all/themes/contrib/zen_dataportal/polyfills', $drupalRoot . '/polyfills');
|
29
|
$event->getIO()->write("Created a symlink from ./polyfills to ./sites/all/themes/contrib/zen_dataportal/polyfills");
|
30
|
}
|
31
|
}
|