Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
249 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
/*! | ||
* Traq | ||
* Copyright (C) 2009-2015 Jack Polgar | ||
* Copyright (C) 2012-2015 Traq.io | ||
* https://github.com/nirix | ||
* https://traq.io | ||
* | ||
* This file is part of Traq. | ||
* | ||
* Traq is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; version 3 only. | ||
* | ||
* Traq is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Traq. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
require dirname(__DIR__) . '/vendor/autoload.php'; | ||
use Traq\Installer\Kernel; | ||
(new Kernel)->run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
/*! | ||
* Traq | ||
* Copyright (C) 2009-2015 Jack Polgar | ||
* Copyright (C) 2012-2015 Traq.io | ||
* https://github.com/nirix | ||
* https://traq.io | ||
* | ||
* This file is part of Traq. | ||
* | ||
* Traq is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; version 3 only. | ||
* | ||
* Traq is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Traq. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
namespace Traq\Installer\Controllers; | ||
|
||
use Avalon\Http\Controller; | ||
|
||
/** | ||
* @author Jack P. | ||
* @since 4.0.0 | ||
*/ | ||
class AppController extends Controller | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
|
||
$this->set("installStep", function($routeName) { | ||
return $this->request->basePath("index.php") . $this->generateUrl($routeName); | ||
}); | ||
} | ||
|
||
/** | ||
* Set page title. | ||
* | ||
* @param string $title | ||
*/ | ||
protected function title($title) | ||
{ | ||
$this->set("stepTitle", $title); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
/*! | ||
* Traq | ||
* Copyright (C) 2009-2015 Jack Polgar | ||
* Copyright (C) 2012-2015 Traq.io | ||
* https://github.com/nirix | ||
* https://traq.io | ||
* | ||
* This file is part of Traq. | ||
* | ||
* Traq is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; version 3 only. | ||
* | ||
* Traq is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Traq. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
namespace Traq\Installer\Controllers; | ||
|
||
/** | ||
* @author Jack P. | ||
* @since 4.0.0 | ||
*/ | ||
class Checks extends AppController | ||
{ | ||
/** | ||
* License agreement page. | ||
*/ | ||
public function licenseAgreementAction() | ||
{ | ||
$this->title("License Agreement"); | ||
|
||
// Get license | ||
$license = file_get_contents(dirname(dirname(dirname(__DIR__))) . '/COPYING'); | ||
$this->set("license", $license); | ||
|
||
return $this->render("license_agreement.phtml"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
/*! | ||
* Traq | ||
* Copyright (C) 2009-2015 Jack Polgar | ||
* Copyright (C) 2012-2015 Traq.io | ||
* https://github.com/nirix | ||
* https://traq.io | ||
* | ||
* This file is part of Traq. | ||
* | ||
* Traq is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; version 3 only. | ||
* | ||
* Traq is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Traq. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
namespace Traq\Installer; | ||
|
||
use Exception; | ||
use Avalon\AppKernel; | ||
|
||
/** | ||
* Traq installation kernel. | ||
* | ||
* @package Traq\Installer | ||
*/ | ||
class Kernel extends AppKernel | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
|
||
class_alias("Avalon\\Http\\Request", "Request"); | ||
class_alias("Avalon\\Helpers\\HTML", "HTML"); | ||
} | ||
|
||
/** | ||
* Loads the applications configuration. | ||
*/ | ||
protected function loadConfiguration() | ||
{ | ||
// We don't need the configuration during installation. | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/*! | ||
* Traq | ||
* Copyright (C) 2009-2015 Jack Polgar | ||
* Copyright (C) 2012-2015 Traq.io | ||
* https://github.com/nirix | ||
* https://traq.io | ||
* | ||
* This file is part of Traq. | ||
* | ||
* Traq is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; version 3 only. | ||
* | ||
* Traq is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Traq. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
use Avalon\Routing\Router; | ||
|
||
Router::map(function($r) { | ||
$r->root("Traq\\Installer\\Controllers\\Checks::licenseAgreement"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Traq Installation - <?=$stepTitle?></title> | ||
<link rel="stylesheet" type="text/css" href="<?=dirname(Request::basePath())?>/assets/css/traq.css"> | ||
<style type="text/css"> | ||
.license { | ||
font-family: monospace; | ||
max-height: 400px; | ||
overflow: auto; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<header id="header" class="navbar navbar-default navbar-static-top"> | ||
<div class="container"> | ||
<div class="navbar-header"> | ||
<span class="navbar-brand">Traq Installation</span> | ||
</div> | ||
<div class="navbar-collapse collapse"> | ||
<p class="navbar-text"> | ||
<?=$stepTitle?> | ||
</p> | ||
</div> | ||
</div> | ||
</header> | ||
<?=$content?> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<div class="container"> | ||
<h1 class="page-title">License Agreement</h1> | ||
|
||
<form action="<?=$installStep("step1")?>" method="post"> | ||
<div class="row"> | ||
<div class="col-md-8 col-md-offset-2"> | ||
<pre class="license"><?=htmlentities($license)?></pre> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-8 col-md-offset-2"> | ||
<button class="btn btn-block btn-primary">Accept</button> | ||
</div> | ||
</div> | ||
</form> | ||
</div> |