<?php

ini_set('memory_limit', '1G');
ini_set('display_errors', 1);
error_reporting(E_ALL | E_STRICT);
$options = array('tabsize' => 4);
require_once 'lib/TFSN/Projects.php';
require_once 'lib/TFSN/Get.php';
require_once 'lib/TFSN/CommandLine.php';
$get = new Get();
$params = $get->getParams();
$commandLine = new CommandLine();
$projects = new Projects();
$projectsList = $title = $errors = '';
$projectsList .= $projects->renderProjects();
$siteDirectory = '';
if (array_key_exists('a', $params) && $params['a'] == 'debug' && array_key_exists('site', $params)) {
    $site = $params['site'];
    $siteDirectory = $projects->getDirectoryFromSiteName($site);
    $mageFile = $siteDirectory . 'app/Mage.php';
    if (file_exists($mageFile)) {
        require_once $mageFile;
        Mage::setIsDeveloperMode(true);
        umask(0);
        Mage::app(array_key_exists('isAdmin', $params) && $params['isAdmin'] ? 'admin' : '');
        $title = '<img src="' . Mage::getDesign()->getSkinUrl() . Mage::getStoreConfig('design/header/logo_src') . '" />';
        $title .= array_key_exists('site', $params) ? ' <a target="_blank" href="' . Mage::app()->getStore()->getBaseUrl() . '">' . $params['site'] . '</a>' : '';
    }
}
/**
 * PHP Console