Files
FreshRSS/cli/prepare.php
Alexis Degrugillier 1694264e2c Modify shebang to be more portable (#3038)
The new shebang is a portable way to find the php interpreter. It works
on Mac, GNU/Linux and BSD.
2020-06-06 19:04:21 +02:00

47 lines
777 B
PHP
Executable File

#!/usr/bin/env 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',
"# Apache 2.2\n" .
"<IfModule !mod_authz_core.c>\n" .
" Order Allow,Deny\n" .
" Deny from all\n" .
" Satisfy all\n" .
"</IfModule>\n" .
"\n" .
"# Apache 2.4\n" .
"<IfModule mod_authz_core.c>\n" .
" Require all denied\n" .
"</IfModule>\n"
);
accessRights();
done($ok);