Commit c0a64af5 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge branch 'S11953ueberallAbsoluteAnstattRelativePfade' into 'develop'

S11953 ueberall absolute anstatt relative pfade & fix phpunit

See merge request !309
parents ed5b4038 2635737a
Pipeline #4988 passed with stages
in 3 minutes and 53 seconds
......@@ -38,7 +38,7 @@ $status = HTTP_400_BAD_REQUEST;
try {
try {
Path::setMainPaths(Path::API_TO_APP);
Path::setMainPaths();
$qfq = new QuickFormQuery(['bodytext' => '']);
$data = $qfq->dataReport();
......
......@@ -73,7 +73,7 @@ $flagSuccess = false;
try {
try {
Path::setMainPaths(Path::API_TO_APP);
Path::setMainPaths();
$qfq = new QuickFormQuery(['bodytext' => '']);
$answer = $qfq->delete();
......
......@@ -18,7 +18,7 @@ use IMATHUZH\Qfq\Core\Helper\Path;
*
*/
try {
Path::setMainPaths(Path::API_TO_APP);
Path::setMainPaths();
$dirty = new Dirty();
$answer = $dirty->process();
......
......@@ -22,7 +22,7 @@ $output = '';
try {
try {
Path::setMainPaths(Path::API_TO_APP);
Path::setMainPaths();
$download = new Download();
// If all is fine: process() will output file via print() !!
......
......@@ -51,7 +51,7 @@ $answer[API_MESSAGE] = '';
try {
try {
Path::setMainPaths(Path::API_TO_APP);
Path::setMainPaths();
$qfq = new QuickFormQuery(['bodytext' => '']);
$data = $qfq->dragAndDrop();
......
......@@ -38,7 +38,7 @@ $answer[API_MESSAGE] = '';
try {
try {
Path::setMainPaths(Path::API_TO_APP);
Path::setMainPaths();
$fileUpload = new File();
$fileUpload->process();
......
......@@ -52,7 +52,7 @@ $answer[API_MESSAGE] = '';
try {
try {
Path::setMainPaths(Path::API_TO_APP);
Path::setMainPaths();
$qfq = new QuickFormQuery(['bodytext' => '']);
$data = $qfq->updateForm();
......
......@@ -20,7 +20,7 @@ use IMATHUZH\Qfq\Core\Store\Config;
* Main
*/
try {
Path::setMainPaths(Path::API_TO_APP);
Path::setMainPaths();
$html2pdf = new Html2Pdf(Config::getConfigArray());
$html2pdf->outputHtml2Pdf();
......
......@@ -22,7 +22,7 @@ $data = array();
try {
try {
Path::setMainPaths(Path::API_TO_APP);
Path::setMainPaths();
$form = OnString::splitPathInfoToIdForm($_SERVER['PATH_INFO'] ?? '', $restId, $restForm);
// get latest `ìd`
......
......@@ -52,7 +52,7 @@ $answer[API_MESSAGE] = '';
try {
try {
Path::setMainPaths(Path::API_TO_APP);
Path::setMainPaths();
$qfq = new QuickFormQuery(['bodytext' => ""]);
$data = $qfq->saveForm();
......
......@@ -36,7 +36,7 @@ $status = HTTP_400_BAD_REQUEST;
try {
try {
Path::setMainPaths(Path::API_TO_APP);
Path::setMainPaths();
$qfq = new QuickFormQuery(['bodytext' => '']);
$qfq->setting();
......
......@@ -19,7 +19,7 @@ use IMATHUZH\Qfq\Core\Helper\Path;
*
*/
try {
Path::setMainPaths(Path::API_TO_APP);
Path::setMainPaths();
$typeAhead = new TypeAhead();
$answer = $typeAhead->process();
......
......@@ -35,7 +35,7 @@ class QfqController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
$flagOk = false;
try {
Path::setMainPaths('');
Path::setMainPaths();
$contentObject = $this->configurationManager->getContentObject();
// By T3 default 'E_NOTICE' is unset. E.g. 'Undefined Index' will throw an exception.
......
......@@ -71,9 +71,8 @@ class Delete {
// Take care the necessary target directories exist.
$cwd = getcwd();
$cwdToApp = Path::cwdToApp();
$sitePath = Path::absoluteApp();
if ($cwd === false || $sitePath === false || !HelperFile::chdir($sitePath, '')) {
if ($cwd === false || $sitePath === false || !HelperFile::chdir($sitePath)) {
throw new \UserFormException(
json_encode([ERROR_MESSAGE_TO_USER => 'getcwd() failed or SITE_PATH undefined or chdir() failed', ERROR_MESSAGE_TO_DEVELOPER => "getcwd() failed or SITE_PATH undefined or chdir('$sitePath') failed."]),
ERROR_IO_CHDIR);
......@@ -94,7 +93,7 @@ class Delete {
}
HelperFile::chdir($cwd, $cwdToApp);
HelperFile::chdir($cwd);
}
/**
......
......@@ -39,15 +39,15 @@ class FormAsFile
$formFromDb = $database->selectFormByName($formName, [F_ID, F_FILE_STATS]);
// Get file stats from file system
$cwdToFormFile = self::formPathFileName($formName, $database);
$fileReadException = function () use ($cwdToFormFile, $database, $formName) {
$absoluteFormFilePath = self::formPathFileName($formName, $database);
$fileReadException = function () use ($absoluteFormFilePath, $database, $formName) {
Thrower::userFormException(
"Form file not found or missing permission: '" . baseName($cwdToFormFile) . "'. Form names are case sensitive. Similar forms: "
"Form file not found or missing permission: '" . baseName($absoluteFormFilePath) . "'. Form names are case sensitive. Similar forms: "
. implode(', ', array_filter(self::formFileNames($database), function ($f) use ($formName) {return strtolower($f) === strtolower($formName);})),
"Form definition file not found or no permission to read file: '$cwdToFormFile'"
"Form definition file not found or no permission to read file: '$absoluteFormFilePath'"
);
};
if(!file_exists($cwdToFormFile)) {
if(!file_exists($absoluteFormFilePath)) {
if ($keepIfNeverExported && isset($formFromDb[F_ID]) && (!isset($formFromDb[F_FILE_STATS]) || !self::isValidFileStats($formFromDb[F_FILE_STATS]))) {
// if file not exists and form was never exported, then export
self::exportForm($formName, $database);
......@@ -56,7 +56,7 @@ class FormAsFile
$fileReadException();
}
}
$fileStatsNew = self::formFileStatsJson($cwdToFormFile);
$fileStatsNew = self::formFileStatsJson($absoluteFormFilePath);
if ($fileStatsNew === false) {
self::deleteFormDB($formName, $database, "Failed to read form file stats.");
$fileReadException();
......@@ -68,7 +68,7 @@ class FormAsFile
}
// Read form file
$fileContents = file_get_contents($cwdToFormFile);
$fileContents = file_get_contents($absoluteFormFilePath);
if ($fileContents === false) {
self::deleteFormDB($formName, $database, "Failed to read form file.");
$fileReadException();
......@@ -77,7 +77,7 @@ class FormAsFile
// form elements exist?
if (!isset($formFromFile[F_FILE_FORM_ELEMENT])) {
Thrower::userFormException('Failed to import form file.', "Json key '" . F_FILE_FORM_ELEMENT . "' in file '$cwdToFormFile' is missing.");
Thrower::userFormException('Failed to import form file.', "Json key '" . F_FILE_FORM_ELEMENT . "' in file '$absoluteFormFilePath' is missing.");
}
// make sure container names are unique and non-empty
......@@ -85,14 +85,14 @@ class FormAsFile
foreach ($formFromFile[F_FILE_FORM_ELEMENT] as $formElementFromFile) {
$keysNotSet = OnArray::keysNotSet([FE_CLASS, FE_NAME], $formElementFromFile);
if (!empty($keysNotSet)) {
Thrower::userFormException('Failed to import form file.', "One or more required keys are missing in FormElement definition in file: '$cwdToFormFile'. Missing keys: " . implode(', ', $keysNotSet));
Thrower::userFormException('Failed to import form file.', "One or more required keys are missing in FormElement definition in file: '$absoluteFormFilePath'. Missing keys: " . implode(', ', $keysNotSet));
}
if ($formElementFromFile[FE_CLASS] === FE_CLASS_CONTAINER) {
if (in_array($formElementFromFile[FE_NAME], $containerNames)) {
Thrower::userFormException('Failed to import form file.', "Multiple formElements of class container with the same name '" . $formElementFromFile[FE_NAME] . "' in form file '$cwdToFormFile'");
Thrower::userFormException('Failed to import form file.', "Multiple formElements of class container with the same name '" . $formElementFromFile[FE_NAME] . "' in form file '$absoluteFormFilePath'");
}
if ($formElementFromFile[FE_NAME] == '') {
Thrower::userFormException('Failed to import form file.', "Found formElement of class container with empty name in form file '$cwdToFormFile'");
Thrower::userFormException('Failed to import form file.', "Found formElement of class container with empty name in form file '$absoluteFormFilePath'");
}
$containerNames[] = $formElementFromFile[FE_NAME];
}
......@@ -131,7 +131,7 @@ class FormAsFile
if (array_key_exists(FE_FILE_CONTAINER_NAME, $formElementFromFile)) {
$containerName = $formElementFromFile[FE_FILE_CONTAINER_NAME];
if (!isset($containerIds[$containerName])) {
Thrower::userFormException('Failed to import form file.', "Key '" . FE_FILE_CONTAINER_NAME . "' points to non-existing container with name '$containerName' in definition of formElement with name '" . $formElementFromFile[FE_NAME] . "' in file '$cwdToFormFile'");
Thrower::userFormException('Failed to import form file.', "Key '" . FE_FILE_CONTAINER_NAME . "' points to non-existing container with name '$containerName' in definition of formElement with name '" . $formElementFromFile[FE_NAME] . "' in file '$absoluteFormFilePath'");
}
$containerId = $containerIds[$containerName];
$feId = $formElementFromFile[FE_ID];
......@@ -198,22 +198,22 @@ class FormAsFile
* Create copy of given form file in form/_backup. If given file does not exist, do nothing.
* New file name: <formName>.YYYMMDDhhmmss.file.json
*
* @param string $cwdToFormFile
* @param string $absoluteFormFilePath
* @throws \UserFormException
*/
private static function backupFormFile(string $cwdToFormFile)
private static function backupFormFile(string $absoluteFormFilePath)
{
if (file_exists($cwdToFormFile))
if (file_exists($absoluteFormFilePath))
{
if (!is_readable($cwdToFormFile)) {
Thrower::userFormException('Error while trying to backup form file.', "Form file is not readable: $cwdToFormFile");
if (!is_readable($absoluteFormFilePath)) {
Thrower::userFormException('Error while trying to backup form file.', "Form file is not readable: $absoluteFormFilePath");
}
// copy file
$cwdToBackupFile = self::newBackupPathFileName(basename($cwdToFormFile, '.json'), 'file');
$success = copy($cwdToFormFile, $cwdToBackupFile);
$absoluteBackupFilePath = self::newBackupPathFileName(basename($absoluteFormFilePath, '.json'), 'file');
$success = copy($absoluteFormFilePath, $absoluteBackupFilePath);
if ($success === false) {
Thrower::userFormException('Error while trying to backup form file.', "Can't copy file $cwdToFormFile to $cwdToBackupFile");
Thrower::userFormException('Error while trying to backup form file.', "Can't copy file $absoluteFormFilePath to $absoluteBackupFilePath");
}
}
}
......@@ -525,8 +525,8 @@ class FormAsFile
private static function backupFormDb(int $formId, Database $database)
{
list($formName, $formId, $formJson) = self::formToJson('', $database, $formId);
$cwdToBackupFile = self::newBackupPathFileName($formName, 'db');
HelperFile::file_put_contents($cwdToBackupFile, $formJson);
$absoluteBackupFilePath = self::newBackupPathFileName($formName, 'db');
HelperFile::file_put_contents($absoluteBackupFilePath, $formJson);
}
......@@ -606,22 +606,22 @@ class FormAsFile
*/
private static function formPath(Database $database): string
{
$cwdToForm = Path::cwdToProject(Path::PROJECT_TO_FORM);
if (!is_dir($cwdToForm)) {
$absoluteFormPath = Path::absoluteProject(Path::projectToForm());
if (!is_dir($absoluteFormPath)) {
// create path
$success = mkdir($cwdToForm, 0777, true);
$success = mkdir($absoluteFormPath, 0777, true);
if ($success === false) {
throw new \UserFormException(json_encode([
ERROR_MESSAGE_TO_USER => "Can't create form file path.",
ERROR_MESSAGE_TO_DEVELOPER => "Can't create path: " . $cwdToForm]),
ERROR_MESSAGE_TO_DEVELOPER => "Can't create path: " . $absoluteFormPath]),
ERROR_IO_WRITE_FILE);
}
// export all forms
self::exportAllForms($database);
}
return $cwdToForm;
return $absoluteFormPath;
}
/**
......@@ -771,25 +771,25 @@ class FormAsFile
private static function newBackupPathFileName(string $formName, string $tag): string
{
// create backup path if not exists
$cwdToBackup = Path::cwdToProject(Path::PROJECT_TO_FORM, Path::FORM_TO_FORM_BACKUP);
if (!is_dir($cwdToBackup)) {
$success = mkdir($cwdToBackup, 0777, true);
$absoluteBackupPath = Path::absoluteProject(Path::projectToForm(), Path::FORM_TO_FORM_BACKUP);
if (!is_dir($absoluteBackupPath)) {
$success = mkdir($absoluteBackupPath, 0777, true);
if ($success === false) {
Thrower::userFormException('Error while trying to backup form file.', "Can't create backup path: $cwdToBackup");
Thrower::userFormException('Error while trying to backup form file.', "Can't create backup path: $absoluteBackupPath");
}
}
$cwdToBackupFile = Path::join($cwdToBackup, $formName . '.json.' . date('Y-m-d_H-i-s') . ".$tag");
$absoluteBackupFilePath = Path::join($absoluteBackupPath, $formName . '.json.' . date('Y-m-d_H-i-s') . ".$tag");
// add index to filename if backup file with current timestamp already exists
$index = 1;
while (file_exists($cwdToBackupFile)) {
$cwdToBackupFile = Path::join($cwdToBackup, $formName . '.json.' . date('Y-m-d_H-i-s') . ".$index.$tag");
while (file_exists($absoluteBackupFilePath)) {
$absoluteBackupFilePath = Path::join($absoluteBackupPath, $formName . '.json.' . date('Y-m-d_H-i-s') . ".$index.$tag");
$index ++;
if ($index > 20) {
Thrower::userFormException('Error while trying to backup form file.', 'Infinite loop.');
}
}
return $cwdToBackupFile;
return $absoluteBackupFilePath;
}
}
\ No newline at end of file
......@@ -117,14 +117,14 @@ class HelperFile {
return $vars;
}
$pathFileNameRelToCwd = Path::cwdToApp($pathFileNameRelToApp);
$absolutePathFileName = Path::absoluteApp($pathFileNameRelToApp);
if (!file_exists($pathFileNameRelToCwd)) {
if (!file_exists($absolutePathFileName)) {
return $vars;
}
$vars[VAR_FILE_MIME_TYPE] = self::getMimeType($pathFileNameRelToCwd);
$vars[VAR_FILE_SIZE] = filesize($pathFileNameRelToCwd);
$vars[VAR_FILE_MIME_TYPE] = self::getMimeType($absolutePathFileName);
$vars[VAR_FILE_SIZE] = filesize($absolutePathFileName);
if ($vars[VAR_FILE_SIZE] === false) {
$vars[VAR_FILE_SIZE] = '-';
......@@ -250,20 +250,17 @@ class HelperFile {
* PHP System function: chdir() with QFQ exception.
*
* @param $newCwd
* @param string $pathNewCwdToApp Path from the new cwd to the App directory.
* @return string
* @throws \CodeException
* @throws \UserFormException
*/
public static function chdir($newCwd, string $pathNewCwdToApp) {
public static function chdir($newCwd) {
if (false === @chdir($newCwd)) {
$msg = self::errorGetLastAsString() . " - chdir($newCwd)";
throw new \UserFormException(json_encode([ERROR_MESSAGE_TO_USER => 'chdir failed', ERROR_MESSAGE_TO_DEVELOPER => $msg]), ERROR_IO_CHDIR);
}
Path::setMainPaths($pathNewCwdToApp);
return true;
}
......@@ -370,13 +367,11 @@ class HelperFile {
public static function mkDirParent($pathFileName, $chmodDir = false) {
$path = "";
$cwd = '';
$cwdToApp = '';
// Leading '/' will be removed - chdir to / to still use correct path
if ($pathFileName[0] == '/') {
$cwd = getcwd();
$cwdToApp = Path::cwdToApp();
self::chdir('/', Path::absoluteApp());
self::chdir('/');
}
// Teile "Directory/File.Extension" auf
......@@ -415,7 +410,7 @@ class HelperFile {
}
if ($cwd != '') {
self::chdir($cwd, $cwdToApp);
self::chdir($cwd);
}
}
......@@ -462,7 +457,7 @@ class HelperFile {
}
if (isset($extToFileType[$ext])) {
return Path::appToExt(Path::EXT_TO_HIGHLIGHT_JSON_DIR) . '/' . $extToFileType[$ext];
return Path::appToExt(Path::EXT_TO_HIGHLIGHT_JSON) . '/' . $extToFileType[$ext];
}
return '';
......
......@@ -16,43 +16,28 @@ namespace IMATHUZH\Qfq\Core\Helper;
*/
class Logger {
/**
* @var String
*/
private static $systemSitePath = '';
/**
* Copy the SystemSitePath to a local variable.
*
* @param $path
*/
public static function setSystemSitePathAbsolute($path) {
self::$systemSitePath = $path;
}
/**
* Append $msg to $filename. Create the file it it not exist.
*
* @param $msg
* @param $pathFileNameRelToCwd
*
* @param string $pathFileNameAbsoluteOrRelToApp Log file path (either absolute path or relative to app directory)
* @param string $mode
* @param bool $recursion
* @throws \CodeException
* @throws \UserFormException
*/
public static function logMessage($msg, $pathFileNameRelToCwd, $mode = FILE_MODE_APPEND, $recursion = false) {
public static function logMessage($msg, $pathFileNameAbsoluteOrRelToApp, $mode = FILE_MODE_APPEND, $recursion = false) {
$handle = false;
if ($pathFileNameRelToCwd == '') {
if ($pathFileNameAbsoluteOrRelToApp == '') {
return;
}
$pathFileNameRelToCwd = self::makePathAbsolute($pathFileNameRelToCwd);
$absolutePathFileName = Path::joinIfNotAbsolute(Path::absoluteApp(), $pathFileNameAbsoluteOrRelToApp);
try {
$handle = fopen($pathFileNameRelToCwd, $mode);
$handle = fopen($absolutePathFileName, $mode);
} catch (\Exception $e) {
$dummy = 1;
}
......@@ -64,21 +49,21 @@ class Logger {
if ($recursion) {
throw new \UserFormException(
json_encode([ERROR_MESSAGE_TO_USER => 'Error: cannot open file',
ERROR_MESSAGE_TO_DEVELOPER => "Error - cannot open. File: " . $pathFileNameRelToCwd .
ERROR_MESSAGE_TO_DEVELOPER => "Error - cannot open. File: " . $absolutePathFileName .
" ( CWD: " . getcwd() . ") - " . HelperFile::errorGetLastAsString()]),
ERROR_IO_OPEN);
}
// If open fails, maybe the directory does not exist. Create it:
HelperFile::mkDirParent($pathFileNameRelToCwd);
self::logMessage($msg, $pathFileNameRelToCwd, $mode, true);
HelperFile::mkDirParent($absolutePathFileName);
self::logMessage($msg, $absolutePathFileName, $mode, true);
return;
}
if (fwrite($handle, $msg . PHP_EOL) === false) {
throw new \UserFormException(
json_encode([ERROR_MESSAGE_TO_USER => 'Error: cannot write file',
ERROR_MESSAGE_TO_DEVELOPER => "Error - cannot open. File: " . $pathFileNameRelToCwd .
ERROR_MESSAGE_TO_DEVELOPER => "Error - cannot open. File: " . $absolutePathFileName .
" ( CWD: " . getcwd() . ") - " . HelperFile::errorGetLastAsString()]),
ERROR_IO_WRITE);
}
......@@ -99,20 +84,6 @@ class Logger {
self::logMessage(self::linePre() . $msg, $filename, $mode);
}
/**
* In case $pathFileNameRelToCwd is not absolute, make it absolute
*
* @param $pathFileNameRelToCwd
* @return string
*/
private static function makePathAbsolute($pathFileNameRelToCwd) {
if (isset($pathFileNameRelToCwd[0]) && $pathFileNameRelToCwd[0] != '/') {
return realpath($pathFileNameRelToCwd);
}
return $pathFileNameRelToCwd;
}
/**
* Returns a timestamp, IP, cookie.
*
......@@ -166,7 +137,7 @@ class Logger {
foreach ([FORM_LOG_FILE_ALL, FORM_LOG_FILE_SESSION] as $filename) {
if (!empty($form[$filename])) {
Logger::logMessage($line, Path::cwdToApp($form[$filename]));
Logger::logMessage($line, Path::absoluteApp($form[$filename]));
}
}
}
......
......@@ -288,4 +288,43 @@ class OnString {
}
return false;
}
/**
* Performs a case-sensitive check indicating if haystack begins with needle.
* As of PHP 8 you can use str_starts_with() instead.
*
* @param string $haystack
* @param string $needle
* @return bool
*/
public static function strStartsWith(string $haystack , string $needle) : bool
{
return substr_compare($haystack, $needle, 0, strlen($needle)) === 0;
}
/**
* Performs a case-sensitive check indicating if haystack ends with needle.
* As of PHP 8 you can use str_ends_with() instead.
*
* @param string $haystack
* @param string $needle
* @return bool
*/
public static function strEndsWith(string $haystack , string $needle) : bool
{
return substr_compare($haystack, $needle, -strlen($needle)) === 0;
}
/**
* Performs a case-sensitive check indicating if needle is contained in haystack.
* As of PHP 8 you can use str_contains() instead.
*
* @param string $haystack
* @param string $needle
* @return bool
*/
public static function strContains(string $haystack , string $needle) : bool
{
return strpos($haystack, $needle) !== false;
}
}
......@@ -7,17 +7,16 @@ namespace IMATHUZH\Qfq\Core\Helper;
* Glossar:
* - App: directory in which the index.php file is located. All urls should be relative to this.
* - Ext: directory in which the QFQ extension is loacted. e.g. the folder Classes is in there.
* - CWD: current working directory
* - API: api folder of qfq extension
*
* Naming convention of path constants/functions/variables:
* 1) name a path by its origin and its destination separated by 'to'. E.g. APP_TO_SYSTEM_LOG, $appToProject.
* 2) if the destination is a file, append "File". E.g. APP_TO_SYSTEM_QFQ_LOG_FILE.
* 3) if a path has to be variable, create a setter and getter. E.g. self::setCwdToApp(), self::cwdToApp(), private static $cwdToApp.
* 4) a path getter appends the given arguments to the requested path using self::join(..., func_get_args()). E.g. see cwdToApp().
* 5) additional path getters may be defined which combine other getters. E.g. see cwdToApi().
* 6) avoid manually defining new paths relative to cwd. Define path relative to App then combine it with cwdToApp()
* 7) avoid defining redundant paths in constants. E.g. create cwdToApi() by combining cwdToExt() and extToApi() instead of defining CWD_TO_API.
* 3) if a path has to be variable, create a setter and getter. E.g. self::setAbsoluteApp(), self::absoluteApp(), private static $absoluteApp.
* 4) a path getter appends the given arguments to the requested path using self::join(..., func_get_args()). E.g. see absoluteApp().
* 5) additional path getters may be defined which combine other getters. E.g. see absoluteProject().
* 6) avoid manually defining new absolute paths. Define paths relative to App then create a getter which joins it with absoluteApp()
* 7) avoid defining redundant paths in constants. E.g. create appToApi() by combining appToExt() and extToApi() instead of defining APP_TO_API.
*/
use IMATHUZH\Qfq\Core\Exception\Thrower;
......@@ -26,15 +25,14 @@ use IMATHUZH\Qfq\Core\Store\Config;
class Path
{
// App
// This should be manually overwritten (using Path::setCwdToApp()) if the CWD is not the one containing the typo3 index.php.
private static $cwdToApp = null;
// This is manually set in self::setMainPaths()
private static $absoluteApp = null;
// Extension
const APP_TO_EXT = 'typo3conf/ext/qfq';
// API
const EXT_TO_API = 'Classes/Api';
const API_TO_APP = '../../../../../'; // TODO: make relatvie to ext instead
// Javascript
const EXT_TO_JAVASCRIPT = 'Resources/Public/JavaScript';
......@@ -45,20 +43,24 @@ class Path
const EXT_TO_PATH_ICONS = 'Resources/Public/icons';
// Annotate
const EXT_TO_HIGHLIGHT_JSON_DIR = 'Resources/Public/Json'; // TODO: refactor: remove DIR at the end of the constant name
const EXT_TO_HIGHLIGHT_JSON = 'Resources/Public/Json';
// Twig
const EXT_TO_TWIG_TEMPLATES = 'Resources/Public/twig_templates';