X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=systems%2Feldiron%2Fwebsites%2Fcloud%2Fadd-htaccess.php;h=e11d9438dee3fe368ba36062d7ce0943935075c6;hb=1a64deeb894dc95e2645a75771732c6cc53a79ad;hpb=fa25ffd4583cc362075cd5e1b4130f33306103f0;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/systems/eldiron/websites/cloud/add-htaccess.php b/systems/eldiron/websites/cloud/add-htaccess.php new file mode 100644 index 0000000..e11d943 --- /dev/null +++ b/systems/eldiron/websites/cloud/add-htaccess.php @@ -0,0 +1,70 @@ +a = $a; + } + public function getValue($val, $default) { + if(isset($this->a[$val])) { + return $this->a[$val]; + } else { + return $default; + } + } + } +} + +namespace { + class NServer { + private $argv; + public function __construct($argv) { + $this->argv = $argv; + } + public function getSystemConfig() { + return new OC\SystemConfig(Array( + 'htaccess.RewriteBase' => $this->argv[1], + )); + } + + public function get($c) { + return new $c(); + } + public function getL10N() { + return new \OCP\IL10N(); + } + public function query($c) { + return new $c(); + } + public function getSecureRandom() { + return new \OCP\Security\ISecureRandom(); + } + } + + class OC { + public static Bool $CLI = false; + public static $SERVERROOT = '.'; + public static $WEBROOT; + public static \NServer $server; + } + + \OC::$server = new NServer($argv); + \OC::$WEBROOT = $argv[1]; + + require "./lib/private/Setup.php"; + $result = \OC\Setup::updateHtaccess(); + if ($result) { + echo "done"; + }; +}