aboutsummaryrefslogtreecommitdiff
path: root/cli/prepare.php
blob: 81fb53f852666626c3909cc62da39ef7c347534f (plain)
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
#!/usr/bin/php
<?php
require(__DIR__ . '/_cli.php');

$dirs = array(
	'/',
	'/cache',
	'/extensions-data',
	'/favicons',
	'/fever',
	'/PubSubHubbub',
	'/PubSubHubbub/feeds',
	'/PubSubHubbub/keys',
	'/tokens',
	'/users',
	'/users/_',
);

$ok = true;

foreach ($dirs as $dir) {
	@mkdir(DATA_PATH . $dir, 0770, true);
	$ok &= touch(DATA_PATH . $dir . '/index.html');
}

if (!is_file(DATA_PATH . '/config.php')) {
	$ok &= touch(DATA_PATH . '/do-install.txt');
}

file_put_contents(DATA_PATH . '/.htaccess',
"Order	Allow,Deny\n" .
"Deny	from all\n" .
"Satisfy	all\n"
);

accessRights();

done($ok);