Beispiel #1
0
<?php

print getPurpleColoredString("");
print getPurpleColoredString("8888888b.                            888     \n");
print getPurpleColoredString("888   Y88b                           888     \n");
print getPurpleColoredString("888    888                           888     \n");
print getPurpleColoredString("888   d88P .d88b.   .d88b.   .d8888b 88888b. \n");
print getPurpleColoredString("8888888P\" d88\"\"88b d88\"\"88b d88P\"    888 \"88b\n");
print getPurpleColoredString("888       888  888 888  888 888      888  888\n");
print getPurpleColoredString("888       Y88..88P Y88..88P Y88b.    888  888\n");
print getPurpleColoredString("888        \"Y88P\"   \"Y88P\"   \"Y8888P 888  888\n");
print "\n";
print getCyanColoredString("Setting up empty project...");
recurse_copy(realpath(__DIR__ . '/base/'), realpath(__DIR__ . '/../../../../'));
print getCyanColoredString(" Finished!\n\n");
print getLightCyanColoredString("Welcome to the Dog Pound!!!\n");
function getCyanColoredString($string)
{
    return getColoredString($string, '0;36');
}
function getLightCyanColoredString($string)
{
    return getColoredString($string, '1;36');
}
function getGreenColoredString($string)
{
    return getColoredString($string, '0;33');
}
function getPurpleColoredString($string)
{
    return getColoredString($string, '0;35');
Beispiel #2
0
$projectPath = realpath(__DIR__ . '/../../../../');
recurse_copy(realpath(__DIR__ . '/base/'), $projectPath);
date_default_timezone_set('America/Chicago');
$timeStr = date("YmdHi", time());
rename($projectPath . "/migrations/create_users.php", $projectPath . "/migrations/" . $timeStr . "01_create_users.php");
rename($projectPath . "/migrations/create_accounts.php", $projectPath . "/migrations/" . $timeStr . "02_create_accounts.php");
rename($projectPath . "/migrations/create_failed_logins.php", $projectPath . "/migrations/" . $timeStr . "03_create_failed_logins.php");
print getCyanColoredString(" Finished!\n");
print "\n";
print getPurpleColoredString("Put the following paths in your routes file:\n");
print getGreenColoredString("\$config['routes'] = array(\n");
print getGreenColoredString("  array('/login','sessions', 'login'),\n");
print getGreenColoredString("  array('/logout','sessions', 'logout')\n");
print getGreenColoredString(");\n");
print "\n";
print getPurpleColoredString("Put the following code in your ApplicationController:\n");
print getGreenColoredString("class ApplicationController extends Controller{\n");
print getGreenColoredString("\tpublic \$auth;\n");
print getGreenColoredString("\n");
print getGreenColoredString("\tfunction __construct(\$controller, \$action) {\n");
print getGreenColoredString("\t\tparent::__construct(\$controller, \$action);\n");
print getGreenColoredString("\n");
print getGreenColoredString("\t\t\$this->auth = new HermanAuth();\n");
print getGreenColoredString("\n");
print getGreenColoredString("\t\t//Require password for everything but login page\n");
print getGreenColoredString("\t\tif(\$controller != 'sessions'){\n");
print getGreenColoredString("\t\t\t\$this->auth->membersOnly();\n");
print getGreenColoredString("\t\t}\n");
print getGreenColoredString("\n");
print getGreenColoredString("\t\tif(\$this->auth->isLoggedIn()){\n");
print getGreenColoredString("\t\t\t\$this->getCurrentUser();\n");