[ Index ] |
|
Code source de Horde 3.1.3 |
1 #!/usr/bin/php 2 <?php 3 /** 4 * The main Horde setup script which allows for a step by step setup 5 * or reconfiguration of a Horde installation. 6 * 7 * $Horde: horde/scripts/setup.php,v 1.25.10.10 2006/05/18 15:47:32 chuck Exp $ 8 * 9 * Copyright 2003-2006 Marko Djukic <marko@oblo.com> 10 * Copyright 2003-2006 Charles J. Hagenbuch <chuck@horde.org> 11 * 12 * See the enclosed file COPYING for license information (LGPL). If you 13 * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. 14 * 15 * @author Marko Djukic <marko@oblo.com> 16 * @author Charles J. Hagenbuch <chuck@horde.org> 17 * @since Horde 3.0 18 */ 19 20 @define('AUTH_HANDLER', true); 21 @define('HORDE_BASE', dirname(__FILE__) . '/..'); 22 require_once HORDE_BASE . '/lib/core.php'; 23 require_once 'Horde/CLI.php'; 24 25 $cli = new Horde_CLI(); 26 27 /* Check for config files. */ 28 $files = array('conf.php', 29 'mime_drivers.php', 30 'nls.php', 31 'prefs.php', 32 'registry.php'); 33 foreach ($files as $filename) { 34 $file = HORDE_BASE . '/config/' . $filename; 35 if (file_exists($file)) { 36 cli_log(sprintf(_("File \"%s\" is available."), $filename), 'message'); 37 continue; 38 } 39 40 cli_log(sprintf(_("File \"%s\" is missing."), $filename), 'warning'); 41 42 $distfile = $file . '.dist'; 43 if (file_exists($distfile)) { 44 $create_config = $cli->prompt(sprintf(_("Create \"%s\" from defaults now?"), $filename), array('y' => _("Yes"), 'n' => _("No"))); 45 if ($create_config == 'y') { 46 if (!copy($distfile, $file)) { 47 $cli->fatal(sprintf(_("Copying \"%1$s.dist\" to \"%1$s\" failed. Check your installation."), $filename)); 48 } 49 cli_log(sprintf(_("File %s created."), $filename), 'success'); 50 } else { 51 $cli->fatal(sprintf(_("You need the \"%s\" file to continue setup and to use Horde."), $filename)); 52 } 53 } else { 54 $cli->fatal(sprintf(_("Cannot find \"%s\", check your installation."), $distfile)); 55 } 56 } 57 58 cli_log(_("Initial setup completed. Now continue the setup with your browser, go to: http://<Your Horde install URL>/admin/"), 'success'); 59 exit; 60 61 /** 62 * Wrap the messages with an indent, neater screen display. 63 */ 64 function cli_log($message, $type = 'message') 65 { 66 $message = wordwrap($message, 69, "\n "); 67 $GLOBALS['cli']->message($message, 'cli.' . $type); 68 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 18:01:28 2007 | par Balluche grâce à PHPXref 0.7 |