-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtpl.php
More file actions
41 lines (34 loc) · 799 Bytes
/
Copy pathtpl.php
File metadata and controls
41 lines (34 loc) · 799 Bytes
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
<?php
set_time_limit(0);
require 'vendor/autoload.php';
require 'MyBB_Template.php';
$mybb_template = new MyBB_Template([
'host'=>'localhost',
'user'=>'homestead',
'pass'=>'secret',
'db'=>'mybb',
], 3, -2, 1809);
if(isset($argv[1])) {
if($argv[1] == 'store') {
$mybb_template->store();
exit;
}
if($argv[1] == 'remove') {
$mybb_template->remove();
exit;
}
if($argv[1] == 'watch') {
$files = new Illuminate\Filesystem\Filesystem;
$tracker = new JasonLewis\ResourceWatcher\Tracker;
$watcher = new JasonLewis\ResourceWatcher\Watcher($tracker, $files);
$listener = $watcher->watch('templates');
$listener->modify(function($resource, $path) use($mybb_template) {
$mybb_template->sync($path);
});
$watcher->start();
}
}
else {
$mybb_template->sync_all();
exit;
}