2016-07-03 20:54:55 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Sikofitt\Config\ConfigTrait;
|
|
|
|
use Silex\Application;
|
|
|
|
|
|
|
|
require '../vendor/autoload.php';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class App
|
|
|
|
*/
|
|
|
|
class App extends Application {
|
|
|
|
|
2016-07-05 14:41:50 -07:00
|
|
|
use ConfigTrait;
|
|
|
|
use Application\TwigTrait;
|
|
|
|
use Application\MonologTrait;
|
|
|
|
use Application\SwiftmailerTrait;
|
|
|
|
use Application\TranslationTrait;
|
|
|
|
use Application\UrlGeneratorTrait;
|
2016-07-03 20:54:55 -07:00
|
|
|
|
2016-07-05 14:41:50 -07:00
|
|
|
public $conf;
|
2016-07-03 20:54:55 -07:00
|
|
|
|
2016-07-05 14:41:50 -07:00
|
|
|
/**
|
|
|
|
* Returns the application directory.
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
* The main application directory.
|
|
|
|
*/
|
|
|
|
public function getAppDirectory() {
|
|
|
|
$r = new ReflectionClass($this);
|
|
|
|
return dirname($r->getFileName());
|
|
|
|
}
|
2016-07-03 20:54:55 -07:00
|
|
|
|
2016-07-05 14:41:50 -07:00
|
|
|
/**
|
|
|
|
* Returns the root directory of the application.
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
* The root directory of the application.
|
|
|
|
*/
|
|
|
|
public function getRootDirectory() {
|
|
|
|
return dirname($this->getAppDirectory());
|
|
|
|
}
|
2016-07-03 20:54:55 -07:00
|
|
|
|
2016-07-05 14:41:50 -07:00
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getConfDirectory() {
|
|
|
|
return $this->getAppDirectory() . '/config';
|
|
|
|
}
|
2016-07-03 20:54:55 -07:00
|
|
|
|
2016-07-05 14:41:50 -07:00
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getDataDirectory() {
|
|
|
|
return $this->getRootDirectory() . '/data';
|
|
|
|
}
|
2016-07-03 20:54:55 -07:00
|
|
|
|
2016-07-05 14:41:50 -07:00
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getResumeJson() {
|
|
|
|
return $this->getDataDirectory() . '/resume.json';
|
|
|
|
}
|
2016-07-03 20:54:55 -07:00
|
|
|
|
2016-07-05 14:41:50 -07:00
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getResumeSchema() {
|
|
|
|
return $this->getDataDirectory() . '/resume.schema.json';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return \Noodlehaus\Config
|
|
|
|
*/
|
|
|
|
public function conf2() {
|
|
|
|
return Noodlehaus\Config::load($this->getConfDirectory());
|
|
|
|
}
|
2016-07-03 20:54:55 -07:00
|
|
|
}
|
|
|
|
|