-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmake.php
executable file
·125 lines (98 loc) · 2.38 KB
/
make.php
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/usr/bin/php
<?php
/**
* Make Helper
*
*
*/
// can 'use' here, cause there is maybe no autoloader yet
if ( ! is_file(__DIR__ . '/vendor/autoload.php')) {
$cmd = [];
$cmd[] = 'composer';
$cmd[] = 'install';
$cmd[] = '--classmap-authoritative';
$cmd[] = '2>&1';
echo "Composer:\n";
passthru(implode(' ', $cmd), $ret);
var_dump($ret);
}
require_once(__DIR__ . '/boot.php');
$doc = <<<DOC
OpenTHC Directory Make Helper
Usage:
make [options]
Commands:
install
search-update (calls bin/cli.php search-update)
Options:
--filter=<FILTER> Some Filter for PHPUnit
DOC;
// $cli_args
\OpenTHC\Make::composer();
\OpenTHC\Make::npm();
\OpenTHC\Make::install_bootstrap();
\OpenTHC\Make::install_fontawesome();
\OpenTHC\Make::install_jquery();
create_homepage();
/**
*
*/
function create_homepage() {
$cfg = \OpenTHC\Config::get('openthc/www/origin');
$url = sprintf('%s/home', $cfg);
$req = _curl_init($url);
$res = curl_exec($req);
$inf = curl_getinfo($req);
if (200 == $inf['http_code']) {
$file = sprintf('%s/webroot/index.html', APP_ROOT);
$data = $res;
file_put_contents($file, $data);
}
}
/**
* not sure how to implement this yet
*/
function install_fonts()
{
# Google Fonts
// curl -O https://openthc.com/pub/font/CedarvilleCursive-Regular.ttf
// curl -O https://openthc.com/pub/font/HomemadeApple-Regular.ttf
// vendor/tecnickcom/tcpdf/tools/tcpdf_addfont.php --fonts=CedarvilleCursive-Regular.ttf
// vendor/tecnickcom/tcpdf/tools/tcpdf_addfont.php --fonts=HomemadeApple-Regular.ttf
// rm CedarvilleCursive-Regular.ttf
// rm HomemadeApple-Regular.ttf
}
# libsodium is a special case
#if [ -d "libsodium.js" ]
#then
# cd libsodium.js
# git checkout master
# git pull
# cd -
# git checkout 0.7.13
#else
# mkdir libsodium.js
# cd libsodium.js
# git clone https://github.com/jedisct1/libsodium.js.git ./
# git checkout 0.7.13
# cd -
#fi
#mkdir -p webroot/vendor/libsodium/
#cp libsodium.js/dist/browsers/sodium.js webroot/vendor/libsodium/
#
# Document CrashCourse?
# mkdir -p ./webroot/crash-course
#asciidoctor \
# --verbose \
# --backend=html5 \
# --require=asciidoctor-diagram \
# --section-numbers \
# --out-file=./webroot/crash-course.html \
# ./content/crash-course.ad
#asciidoctor \
# --verbose \
# --backend=revealjs \
# --require=asciidoctor-diagram \
# --require=asciidoctor-revealjs \
# --out-file=./webroot/crash-course-slides.html \
# ./content/crash-course.ad