X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FInstaller.php;h=2824b072c414e853d1abe51a19aa1d35946c75bd;hb=e8929efbea071505aa583c4b8576f0bd13d06ea8;hp=01ef1d8c923c5b397ef1e3e3806abdefdba1e594;hpb=ab8997f9db910ba70c592bf106a7f5fc41a55b2d;p=friendica.git diff --git a/src/Core/Installer.php b/src/Core/Installer.php index 01ef1d8c92..2824b072c4 100644 --- a/src/Core/Installer.php +++ b/src/Core/Installer.php @@ -1,17 +1,33 @@ . + * */ + namespace Friendica\Core; use DOMDocument; use Exception; -use Friendica\Core\Config\Cache\ConfigCache; +use Friendica\Core\Config\Cache; use Friendica\Database\Database; use Friendica\Database\DBStructure; use Friendica\DI; use Friendica\Util\Images; -use Friendica\Util\Network; use Friendica\Util\Strings; /** @@ -129,12 +145,12 @@ class Installer * - Creates `config/local.config.php` * - Installs Database Structure * - * @param ConfigCache $configCache The config cache with all config relevant information + * @param Cache $configCache The config cache with all config relevant information * * @return bool true if the config was created, otherwise false * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public function createConfig(ConfigCache $configCache) + public function createConfig(Cache $configCache) { $basepath = $configCache->get('system', 'basepath'); @@ -176,11 +192,11 @@ class Installer */ public function installDatabase($basePath) { - $result = DBStructure::update($basePath, false, true, true); + $result = DBStructure::install($basePath); if ($result) { $txt = DI::l10n()->t('You may need to import the file "database.sql" manually using phpmyadmin or mysql.') . EOL; - $txt .= DI::l10n()->t('Please see the file "INSTALL.txt".'); + $txt .= DI::l10n()->t('Please see the file "doc/INSTALL.md".'); $this->addCheck($txt, false, true, htmlentities($result, ENT_COMPAT, 'UTF-8')); @@ -242,7 +258,7 @@ class Installer $help = ""; if (!$passed) { $help .= DI::l10n()->t('Could not find a command line version of PHP in the web server PATH.') . EOL; - $help .= DI::l10n()->t("If you don't have a command line version of PHP installed on your server, you will not be able to run the background processing. See 'Setup the worker'") . EOL; + $help .= DI::l10n()->t("If you don't have a command line version of PHP installed on your server, you will not be able to run the background processing. See 'Setup the worker'") . EOL; $help .= EOL . EOL; $tpl = Renderer::getMarkupTemplate('field_input.tpl'); /// @todo Separate backend Installer class and presentation layer/view @@ -447,6 +463,13 @@ class Installer ); $returnVal = $returnVal ? $status : false; + $status = $this->checkFunction('proc_open', + DI::l10n()->t('Program execution functions'), + DI::l10n()->t('Error: Program execution functions required but not enabled.'), + true + ); + $returnVal = $returnVal ? $status : false; + $status = $this->checkFunction('json_encode', DI::l10n()->t('JSON PHP module'), DI::l10n()->t('Error: JSON PHP module required but not installed.'), @@ -482,7 +505,7 @@ class Installer $help = DI::l10n()->t('The web installer needs to be able to create a file called "local.config.php" in the "config" folder of your web server and it is unable to do so.') . EOL; $help .= DI::l10n()->t('This is most often a permission setting, as the web server may not be able to write files in your folder - even if you can.') . EOL; $help .= DI::l10n()->t('At the end of this procedure, we will give you a text to save in a file named local.config.php in your Friendica "config" folder.') . EOL; - $help .= DI::l10n()->t('You can alternatively skip this procedure and perform a manual installation. Please see the file "INSTALL.txt" for instructions.') . EOL; + $help .= DI::l10n()->t('You can alternatively skip this procedure and perform a manual installation. Please see the file "doc/INSTALL.md" for instructions.') . EOL; } $this->addCheck(DI::l10n()->t('config/local.config.php is writable'), $status, false, $help); @@ -531,11 +554,11 @@ class Installer $help = ""; $error_msg = ""; if (function_exists('curl_init')) { - $fetchResult = Network::fetchUrlFull($baseurl . "/install/testrewrite"); + $fetchResult = DI::httpRequest()->fetchFull($baseurl . "/install/testrewrite"); $url = Strings::normaliseLink($baseurl . "/install/testrewrite"); if ($fetchResult->getReturnCode() != 204) { - $fetchResult = Network::fetchUrlFull($url); + $fetchResult = DI::httpRequest()->fetchFull($url); } if ($fetchResult->getReturnCode() != 204) { @@ -618,12 +641,12 @@ class Installer /** * Setup the default cache for a new installation * - * @param ConfigCache $configCache The configuration cache - * @param string $basePath The determined basepath + * @param Cache $configCache The configuration cache + * @param string $basePath The determined basepath * * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public function setUpCache(ConfigCache $configCache, $basePath) + public function setUpCache(Cache $configCache, $basePath) { $configCache->set('config', 'php_path' , $this->getPHPPath()); $configCache->set('system', 'basepath' , $basePath);