Lines Matching refs:data
141 $data = $this->userData($request);
149 if ($data['lang'] === '') {
154 $data['lang'] = $locale->languageTag();
157 I18N::init($data['lang'], true);
159 $data['cpu_limit'] = $this->maxExecutionTime();
160 $data['locales'] = $locales;
161 $data['memory_limit'] = $this->memoryLimit();
165 $data['errors'] = $this->server_check_service->serverErrors($data['dbtype']);
166 $data['warnings'] = $this->server_check_service->serverWarnings($data['dbtype']);
168 $data['errors'] = $this->server_check_service->serverErrors();
169 $data['warnings'] = $this->server_check_service->serverWarnings();
173 $data['errors']->push(
183 return $this->step1Language($data);
185 return $this->step2CheckServer($data);
187 return $this->step3DatabaseType($data);
189 return $this->step4DatabaseConnection($data);
191 return $this->step5Administrator($data);
193 return $this->step6Install($data);
204 $data = [];
207 $data[$key] = Validator::parsedBody($request)->string($key, $default);
210 return $data;
276 private function step1Language(array $data): ResponseInterface argument
278 return $this->viewResponse('setup/step-1-language', $data);
286 private function step2CheckServer(array $data): ResponseInterface argument
288 return $this->viewResponse('setup/step-2-server-checks', $data);
296 private function step3DatabaseType(array $data): ResponseInterface argument
298 if ($data['errors']->isNotEmpty()) {
299 return $this->viewResponse('setup/step-2-server-checks', $data);
302 return $this->viewResponse('setup/step-3-database-type', $data);
310 private function step4DatabaseConnection(array $data): ResponseInterface argument
312 if ($data['errors']->isNotEmpty()) {
313 return $this->step3DatabaseType($data);
316 return $this->viewResponse('setup/step-4-database-' . $data['dbtype'], $data);
324 private function step5Administrator(array $data): ResponseInterface argument
327 $data['dbport'] = $data['dbport'] ?: self::DEFAULT_PORTS[$data['dbtype']];
330 $this->connectToDatabase($data);
332 $data['errors']->push($ex->getMessage());
335 return $this->viewResponse('setup/step-4-database-' . $data['dbtype'], $data);
338 return $this->viewResponse('setup/step-5-administrator', $data);
346 private function step6Install(array $data): ResponseInterface argument
348 …$error = $this->checkAdminUser($data['wtname'], $data['wtuser'], $data['wtpass'], $data['wtemail']…
351 $data['errors']->push($error);
353 return $this->step5Administrator($data);
357 $this->createConfigFile($data);
363 return redirect($data['baseurl']);
392 private function createConfigFile(array $data): void argument
395 $this->connectToDatabase($data);
402 $admin = $this->user_service->findByIdentifier($data['wtemail']);
404 $admin = $this->user_service->findByIdentifier($data['wtuser']);
408 …$admin = $this->user_service->create($data['wtuser'], $data['wtname'], $data['wtemail'], $data['wt…
409 $admin->setPreference(UserInterface::PREF_LANGUAGE, $data['lang']);
420 $config_ini_php = view('setup/config.ini', $data);
426 ->withAttribute('base_url', $data['baseurl']);
430 Session::put('language', $data['lang']);
438 private function connectToDatabase(array $data): void argument
441 switch ($data['dbtype']) {
443 touch(Webtrees::ROOT_DIR . 'data/' . $data['dbname'] . '.sqlite');
448 driver: $data['dbtype'],
449 host: $data['dbhost'],
450 port: $data['dbport'],
452 username: $data['dbuser'],
453 password: $data['dbpass'],
454 prefix: $data['tblpfx'],
455 key: $data['dbkey'],
456 certificate: $data['dbcert'],
457 ca: $data['dbca'],
458 verify_certificate: (bool) $data['dbverify'],
460 … DB::exec('CREATE DATABASE IF NOT EXISTS `' . $data['dbname'] . '` COLLATE utf8mb4_unicode_ci');
465 driver: $data['dbtype'],
466 host: $data['dbhost'],
467 port: $data['dbport'],
468 database: $data['dbname'],
469 username: $data['dbuser'],
470 password: $data['dbpass'],
471 prefix: $data['tblpfx'],
472 key: $data['dbkey'],
473 certificate: $data['dbcert'],
474 ca: $data['dbca'],
475 verify_certificate: (bool) $data['dbverify'],