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

$yii=dirname(__FILE__).'/lib/yii/yii.php';
require_once($yii);
require_once('helpers/globals.php');


// very basic checks
$configDir=$baseDir.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR;
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';
?>

<!DOCTYPE html PUBLIC
    "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title>phundament 2 - Installer</title>
        <style type="text/css" >
            /*<![CDATA[*/
            body {
                font-family:"Arial";
                font-weight:normal;
                color:black;
                background-color:white;
            }
            h1 { }
            h2 { }
            h3 {}
            p {}
            div.errors ul {color: red;}
            .version {color: gray;font-size:8pt;border-top:1px solid #aaaaaa;}
            /*]]>*/
        </style>
    </head>

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


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

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

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

                <p>Options:</p>
                <ol>
                    <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*
                    </li>
                </ol>
                <small>
                    * use mod_rewrite and <code>Yii::app()->request->setBaseUrl()</code> for friendly-URLs
                </small>

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

                <?php endif; ?>


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


    </body>
Return current item: phundament