Ejemplo n.º 1
0
 public function getApplicationInput()
 {
     $httpd_bin_found = OsUtils::findBinary(array('apachectl', 'apache2ctl'));
     if (!empty($httpd_bin_found)) {
         $httpd_bin_message = "The following apachectl script has been detected: {$httpd_bin_found}. Do you want to use this script to run your Kaltura application? Leave empty to use or provide a pathname to an alternative apachectl script on your server.";
         $httpd_error_message = "Invalid pathname for apachectl script, leave empty to use {$httpd_bin_found} or enter an alternative apachectl path";
     } else {
         $httpd_bin_message = "Installation could not automatically detect any apachectl script. Please provide a pathname to the apachectl script on your server.";
         $httpd_error_message = "Invalid pathname for apachectl script, please enter the apachectl pathname again";
     }
     $php_bin_found = OsUtils::findBinary('php');
     if (!empty($php_bin_found)) {
         $php_bin_message = "The following PHP binary has been detected: {$php_bin_found}. Do you want to use this script to run your Kaltura application? Leave empty to use or provide a pathname to an alternative PHP binary on your server.";
         $php_error_message = "Invalid pathname for PHP binary, leave empty to use {$php_bin_found} or enter an alternative PHP path";
     } else {
         $php_bin_message = "Installation could not automatically detect any PHP binary. Please provide a pathname to the PHP binary on your server.";
         $php_error_message = "Invalid pathname for PHP binary, please enter the PHP pathname again";
     }
     logMessage(L_USER, "Please provide the following information:");
     echo PHP_EOL;
     $this->getInput('HTTPD_BIN', $httpd_bin_message, $httpd_error_message, InputValidator::createFileValidator(), $httpd_bin_found);
     $this->getInput('PHP_BIN', $php_bin_message, $php_error_message, InputValidator::createFileValidator(), $php_bin_found);
     $this->getInput('BASE_DIR', "Full target directory path for Kaltura application (leave empty for /opt/kaltura)", "Target directory must be a valid directory path, please enter again", InputValidator::createDirectoryValidator(), '/opt/kaltura');
     $this->getInput('KALTURA_FULL_VIRTUAL_HOST_NAME', "Please enter the domain name/virtual hostname that will be used for the Kaltura server (without http://)", 'Must be a valid hostname or ip, please enter again', InputValidator::createHostValidator(), null);
     $this->getInput('ADMIN_CONSOLE_ADMIN_MAIL', "Your primary system administrator email address", "Email must be in a valid email format, please enter again", InputValidator::createEmailValidator(false), null);
     $this->getInput('ADMIN_CONSOLE_PASSWORD', "The password you want to set for your primary administrator", "Password should not be empty and should not contain whitespaces, please enter again", InputValidator::createNoWhitespaceValidator(), null);
     $this->getInput('DB1_HOST', "Database host (leave empty for 'localhost')", "Must be a valid hostname or ip, please enter again (leave empty for 'localhost')", InputValidator::createHostValidator(), 'localhost');
     $this->getInput('DB1_PORT', "Database port (leave empty for '3306')", "Must be a valid port (1-65535), please enter again (leave empty for '3306')", InputValidator::createRangeValidator(1, 65535), '3306');
     $this->set('DB1_NAME', 'kaltura');
     // currently we do not support getting the DB name from the user because of the DWH implementation
     $this->getInput('DB1_USER', "Database username (with create & write privileges)", "Database username cannot be empty, please enter again", InputValidator::createNonEmptyValidator(), null);
     $this->getInput('DB1_PASS', "Database password (leave empty for no password)", null, null, null);
     $this->getInput('XYMON_URL', "The URL to your xymon/hobbit monitoring location. Xymon is an optional installation. Leave empty to set manually later\nExamples:\nhttp://www.xymondomain.com/xymon/\nhttp://www.xymondomain.com/hobbit/", null, null, null);
     $this->saveInput();
 }