forked from claroline/Distribution
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmerge.php
More file actions
80 lines (74 loc) · 1.54 KB
/
merge.php
File metadata and controls
80 lines (74 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
$vendors = [/*
'Claroline' => [
'ActivityToolBundle',
'AnnouncementBundle',
'AgendaBundle',
'BundleRecorder',
'CoreBundle',
'CursusBundle',
'ForumBundle',
'ImagePlayerBundle',
'InstallationBundle',
'KernelBundle',
'MessageBundle',
'MigrationBundle',
'PdfPlayerBundle',
'RssReaderBundle',
'ScormBundle',
'SurveyBundle',
'TeamBundle',
'TagBundle',
'LdapBundle',
'TextPlayerBundle',
'VideoPlayerBundle',
'WebInstaller',
'WebResourceBundle'
],
'FormaLibre' => [
'PresenceBundle',
'ReservationBundle',
'SupportBundle'
],
'HeVinci' => [
'CompetencyBundle',
'FavouriteBundle',
'UrlBundle'
],*/
'iCAPLyon1' => [
'BadgeBundle',
'BlogBundle',
'DropzoneBundle',
//'LessonBundle',
'PortfolioBundle',
'SocialMediaBundle',
//'WebsiteBundle',
'WikiBundle',
'OauthBundle',
], /*,
'InnovaLangues' => [
'PathBundle',
'CollecticielBundle'
],
'ujm-dev' => [
'ExoBundle'
]*/
];
foreach ($vendors as $vendor => $packages) {
foreach ($packages as $package) {
cmd("php import.php {$vendor} {$package} plugin/".prettify($package));
}
}
function cmd($cmd)
{
echo "Executing: {$cmd}\n";
exec($cmd, $output, $code);
if ($code !== 0) {
die("Command failed, aborting\n");
}
return $output;
}
function prettify($str)
{
return str_replace('-bundle', '', ltrim(strtolower(preg_replace('/(?!^)[A-Z]{2,}(?=[A-Z][a-z])|[A-Z][a-z]|[0-9]{1,}/', '-$0', $str)), '-'));
}