12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- class GeneralSetup extends Setup {
-
- const SECTION = "[general]";
-
- const GENERAL_PORT = "generalPort",
- GENERAL_HOST = "generalHost";
-
- static $user, $host, $port, $root;
-
- static $properties;
-
- static $message = null;
- static $errors = array();
- function __construct($settings) {
- self::$host = $settings[self::GENERAL_HOST];
- self::$port = $settings[self::GENERAL_PORT];
- self::$properties = array(
- "api_key" => $this->generateRandomString(),
- "base_url" => self::$host,
- "base_port" => self::$port,
- );
- }
- function writeToTemp() {
- parent::writeToTemp(self::SECTION, self::$properties);
- }
-
- function runSetup() {
-
- if (count(self::$errors) <= 0) {
- $this->writeToTemp();
- }
- return array(
- "message" => self::$message,
- "errors" => self::$errors
- );
- }
- }
|