Location: PHPKode > projects > phundament > phundament-2.1-b9/index.php
$baseDir = dirname(__FILE__);
$errors = array();
defined('YII_DEBUG') or define('YII_DEBUG',true);


// very basic checks
if (!file_exists($configDir.'local.php')) {
    $errors[]="Please copy {$configDir}local-sample.php to {$configDir}local.php";
    $config = include($configDir.'main.php');
} else
    $config = include($configDir.'local.php');

$checkDirs[] = $baseDir.DIRECTORY_SEPARATOR.'www'.DIRECTORY_SEPARATOR.'assets';
$checkDirs[] = $baseDir.DIRECTORY_SEPARATOR.'runtime';
$checkDirs[] = $baseDir.DIRECTORY_SEPARATOR.$config['params']['publicRuntimePath'];
$checkDirs[] = $baseDir.DIRECTORY_SEPARATOR.$config['params']['protectedRuntimePath'];

foreach($checkDirs AS $dir) {
    if (!is_writable($dir)) {
        if ((!is_dir($dir))) {
            $errors[] = "Directory $dir does not exist!";
        } else {
            $errors[] = "Directory $dir is not writable by the webserver!";

if (isset($config['components']['urlManager']['urlFormat']) && $config['components']['urlManager']['urlFormat'] == 'path') {
    $installCheckUrl = 'www/index.php/p2/default/install';
} else {
    $installCheckUrl = 'www/index.php?r=p2/default/install';
$testUrl = 'tests';

    "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title>phundament 2 - Installer</title>
        <style type="text/css" >
            body {
            h1 { }
            h2 { }
            h3 {}
            p {}
            div.errors ul {color: red;}
            .version {color: gray;font-size:8pt;border-top:1px solid #aaaaaa;}

    <body id="system">
        <div id="wrapper">
            <div id="header">
                <h1>phundament 2</h1>

            <div id="content">
                    Phundament II comes with a handy set of command-line tools for installation, backup and other tasks.                    
                    <br/>Go to your application root folder on your shell
                <code>cd <?php echo $baseDir; ?></code>
                start the installation by issuing this command:</p>
                <code>./yiic install</code>

                    <a href="www">Visit your Home Page ></a><br/>
                    <a href="<?php echo $installCheckUrl ?>">Module Installation Check ></a>(run install command first)

                    <b>Please make sure that this web application is installed in a secure way!</b>

                    <li>set your document root to <code><?php echo dirname(__FILE__).DS.'www' ?></code>, or</li>
                    <li>move your application outside your document root and link <code>www</code> back into your <code>htdocs</code>*, or</li>
                    <li>protect all directories, except for <code>www</code> with a <code>.htaccess</code> file*
                    * use mod_rewrite and <code>Yii::app()->request->setBaseUrl()</code> for friendly-URLs

                <?php if (count($errors)): ?>
                <p>Use the install command to fix these errors:</p>
                <div class="errors">
                            <?php foreach($errors AS $error) {
                                echo "<li>".$error."</li>";
                            } ?>
                <?php else: ?>

                <?php endif; ?>

                <div id="footer">
                    <small>Visit <a class="poweredByP2" href="http://phundament.com">phunament.com</a></small>

Return current item: phundament