]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - systems/eldiron/websites/cloud/add-htaccess.php
Squash changes containing private information
[perso/Immae/Config/Nix.git] / systems / eldiron / websites / cloud / add-htaccess.php
1 <?php
2
3 namespace bantu\IniGetWrapper { class IniGetWrapper { } }
4 namespace Psr\Log { class LoggerInterface { } }
5 namespace OCP {
6 class IL10N { }
7 class Defaults { }
8 }
9 namespace OCP\Security {
10 class ISecureRandom { }
11 }
12 namespace OC {
13 class Installer { }
14 class SystemConfig {
15 private $a;
16 public function __construct($a) {
17 $this->a = $a;
18 }
19 public function getValue($val, $default) {
20 if(isset($this->a[$val])) {
21 return $this->a[$val];
22 } else {
23 return $default;
24 }
25 }
26 }
27 }
28
29 namespace {
30 class NServer {
31 private $argv;
32 public function __construct($argv) {
33 $this->argv = $argv;
34 }
35 public function getSystemConfig() {
36 return new OC\SystemConfig(Array(
37 'htaccess.RewriteBase' => $this->argv[1],
38 ));
39 }
40
41 public function get($c) {
42 return new $c();
43 }
44 public function getL10N() {
45 return new \OCP\IL10N();
46 }
47 public function query($c) {
48 return new $c();
49 }
50 public function getSecureRandom() {
51 return new \OCP\Security\ISecureRandom();
52 }
53 }
54
55 class OC {
56 public static Bool $CLI = false;
57 public static $SERVERROOT = '.';
58 public static $WEBROOT;
59 public static \NServer $server;
60 }
61
62 \OC::$server = new NServer($argv);
63 \OC::$WEBROOT = $argv[1];
64
65 require "./lib/private/Setup.php";
66 $result = \OC\Setup::updateHtaccess();
67 if ($result) {
68 echo "done";
69 };
70 }