From ff32e499745367b816d10f25e63ff3328214c32f Mon Sep 17 00:00:00 2001 From: Damien Lallement Date: Mon, 13 Aug 2012 10:45:23 +0000 Subject: - Import moonmoon - Create repo per langs --- common/install.php | 190 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100755 common/install.php (limited to 'common/install.php') diff --git a/common/install.php b/common/install.php new file mode 100755 index 0000000..3a3eae7 --- /dev/null +++ b/common/install.php @@ -0,0 +1,190 @@ +' . $str . '' . $msg . ''; +} + +// If the password and config files exist, moonmoon is already installed +if (file_exists(dirname(__FILE__) . '/custom/config.yml') + && file_exists(dirname(__FILE__) . '/admin/inc/pwd.inc.php')) { + $status = 'installed'; +} elseif (isset($_REQUEST['url'])) { + $save = array(); + //Save config file + $config = array( + 'url' => filter_var($_REQUEST['url'], FILTER_SANITIZE_ENCODED), + 'name' => filter_var($_REQUEST['title'], FILTER_SANITIZE_SPECIAL_CHARS), + 'locale' => filter_var($_REQUEST['locale'], FILTER_SANITIZE_SPECIAL_CHARS), + 'items' => 10, + 'shuffle' => 0, + 'refresh' => 240, + 'cache' => 10, + 'nohtml' => 0, + 'postmaxlength' => 0, + 'cachedir' => './cache' + ); + + $CreatePlanetConfig = new PlanetConfig($config); + $save['config'] = file_put_contents(dirname(__FILE__).'/custom/config.yml', $CreatePlanetConfig->toYaml()); + + //Save password + $save['password'] = file_put_contents(dirname(__FILE__).'/admin/inc/pwd.inc.php', ''); + + if (0 != ($save['config'] + $save['password'])) { + $status = 'installed'; + } +} else { + + // We start by malking sure we have PHP5 as a base requirement + if(phpversion() >= 5) { + $strInstall = installStatus('Server is running PHP5', 'OK',true); + $strRecommendation = ''; + } else { + $strInstall = installStatus('Server is running PHP5', 'FAIL',false); + $strRecommendation = '
  • Check your server documentation to activate PHP5
  • '; + } + + // Writable file requirements + $tests = array( + '/custom', + '/custom/people.opml', + '/admin/inc/pwd.inc.php', + '/cache', + ); + + // We now test that all required files are writable + foreach ($tests as $v) { + if(is_writable(dirname(__FILE__) . $v)) { + $strInstall .= installStatus("$v is writable", 'OK', true); + } else { + $strInstall .= installStatus("$v is writable", 'FAIL',false); + $strRecommendation .= "
  • Make $v writable with CHMOD
  • "; + } + } + + // We can now decide if we install moonmoon or not + $status = ($strRecommendation != '') ? 'error' : 'install'; + +} +?> + + + + + <?=_g('moonmoon installation')?> + + + + +

    + + +
    +

    Sorry, your server is not compatible with moonmoon.

    + +

    Your server does not fulfill the requirements

    + + + + + + + + + + +
    TestResult
    + +

    Troubleshooting

    +

    To install moonmoon, try the following changes:

    + +
    + + +
    +
    +
    + + + +

    + + +

    + +

    + + +

    +

    + + +

    +

    + +

    +
    +
    +
    + + + +

    +

    +
      +
    1. + Delete install.php with your FTP software.')?> +
    2. +
    3. + administration panel')?> +
    4. +
    + + + -- cgit v1.2.1