forked from lbryio/lbry.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.php
executable file
·28 lines (20 loc) · 679 Bytes
/
update.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
#!/usr/bin/php
<?php
include __DIR__.'/bootstrap.php';
$options = getopt('f');
$force = isset($options['f']); // update even if no NEEDS_UPDATE file exists
$needsUpdateFile = ROOT_DIR . '/data/writeable/NEEDS_UPDATE';
if (!$force && !file_exists($needsUpdateFile)) {
echo "No update necessary\n";
return;
}
@unlink($needsUpdateFile);
chdir(ROOT_DIR);
Shell::exec('git fetch && git reset --hard origin/master');
Shell::exec('git submodule update --init');
Shell::exec('git submodule update --recursive --remote');
Shell::exec('php composer.phar install');
View::compileCss();
View::gzipAssets();
// clear cache
Curl::get('localhost'.Controller::CACHE_CLEAR_PATH);