Sequenzia/install/ApplicationInstaller/Base.php
2013-10-26 18:06:58 -05:00

47 lines
876 B
PHP
Executable File

<?php
namespace ApplicationInstaller;
use Rails;
abstract class Base
{
static protected $instance;
static protected $step;
static public function instance()
{
if (!self::$instance) {
self::initialize();
}
return self::$instance;
}
static protected function initialize()
{
Rails::loader()->addPath(dirname(__DIR__));
self::$instance = new Installer();
}
protected function root()
{
return dirname(__DIR__);
}
protected function request()
{
return Rails::application()->dispatcher()->request();
}
protected function refreshPage()
{
$urlFor = new Rails\Routing\UrlFor('root');
header('Location: ' . $urlFor->url());
}
protected function step()
{
return self::$step;
}
}