74 lines
1.4 KiB
PHP
74 lines
1.4 KiB
PHP
<?php
|
|
|
|
use Sikofitt\Config\ConfigTrait;
|
|
use Silex\Application;
|
|
|
|
require '../vendor/autoload.php';
|
|
|
|
/**
|
|
* Class App
|
|
*/
|
|
class App extends Application {
|
|
|
|
use ConfigTrait;
|
|
|
|
public $conf;
|
|
|
|
/**
|
|
* Returns the application directory.
|
|
*
|
|
* @return string
|
|
* The main application directory.
|
|
*/
|
|
public function getAppDirectory() {
|
|
$r = new ReflectionClass($this);
|
|
return dirname($r->getFileName());
|
|
}
|
|
|
|
/**
|
|
* Returns the root directory of the application.
|
|
*
|
|
* @return string
|
|
* The root directory of the application.
|
|
*/
|
|
public function getRootDirectory() {
|
|
return dirname($this->getAppDirectory());
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getConfDirectory() {
|
|
return $this->getAppDirectory() . '/config';
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getDataDirectory() {
|
|
return $this->getRootDirectory() . '/data';
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getResumeJson() {
|
|
return $this->getDataDirectory() . '/resume.json';
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getResumeSchema() {
|
|
return $this->getDataDirectory() . '/resume.schema.json';
|
|
}
|
|
|
|
/**
|
|
* @return \Noodlehaus\Config
|
|
*/
|
|
public function conf2() {
|
|
return Noodlehaus\Config::load($this->getConfDirectory());
|
|
}
|
|
}
|
|
|