1 | <?php |
||
37 | class PMF_Instance_Setup |
||
38 | { |
||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | private $_rootDir; |
||
43 | |||
44 | /** |
||
45 | * Constructor. |
||
46 | * |
||
47 | * @return PMF_Instance_Setup |
||
48 | */ |
||
49 | public function __construct() |
||
50 | { |
||
51 | $this->setRootDir(PMF_INCLUDE_DIR); |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * Sets the root directory of the phpMyFAQ instance. |
||
56 | * |
||
57 | * @param string $rootDir |
||
58 | */ |
||
59 | public function setRootDir($rootDir) |
||
60 | { |
||
61 | $this->_rootDir = $rootDir; |
||
62 | } |
||
63 | |||
64 | /** |
||
65 | * Creates the anonymous default user. |
||
66 | * |
||
67 | * @param PMF_Configuration $faqConfig |
||
68 | */ |
||
69 | public function createAnonymousUser(PMF_Configuration $faqConfig) |
||
80 | |||
81 | /** |
||
82 | * Checks basic folders and creates them if necessary. |
||
83 | * |
||
84 | * @param array $dirs |
||
85 | * |
||
86 | * @return array |
||
87 | */ |
||
88 | public function checkDirs(Array $dirs) |
||
109 | |||
110 | /** |
||
111 | * Creates the file /config/database.php. |
||
112 | * |
||
113 | * @param array $data Array with database credentials |
||
114 | * @param string $folder Folder |
||
115 | * |
||
116 | * @return int |
||
117 | */ |
||
118 | public function createDatabaseFile(Array $data, $folder = '/config') |
||
134 | |||
135 | /** |
||
136 | * Creates the file /config/ldap.php. |
||
137 | * |
||
138 | * @param array $data Array with LDAP credentials |
||
139 | * @param string $folder Folder |
||
140 | * |
||
141 | * @return int |
||
142 | */ |
||
143 | public function createLdapFile(Array $data, $folder = '/config') |
||
158 | |||
159 | /** |
||
160 | * Creates the file /config/elasticsearch.php |
||
161 | * |
||
162 | * @param array $data Array with LDAP credentials |
||
163 | * @param string $folder Folder |
||
164 | * |
||
165 | * @return int |
||
166 | */ |
||
167 | public function createElasticsearchFile(Array $data, $folder = '/config') |
||
180 | |||
181 | /** |
||
182 | * Creates a new folder. |
||
183 | * |
||
184 | * @param string $name Name of the new folder |
||
185 | * @param string $path Path to the new folder |
||
186 | * |
||
187 | * @return bool |
||
188 | */ |
||
189 | public function createFolder($name, $path) |
||
193 | } |
||
194 |