belanglose vervollst?ndigung / test
This commit is contained in:
commit
a017c7a79d
177 changed files with 14495 additions and 0 deletions
127
configs/AppConfig.inc
Normal file
127
configs/AppConfig.inc
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* The Legend of Z
|
||||
*
|
||||
* @author Oliver Hanraths <oliver.hanraths@uni-duesseldorf.de>
|
||||
* @copyright 2014 Heinrich-Heine-Universität Düsseldorf
|
||||
* @license http://www.gnu.org/licenses/gpl.html
|
||||
* @link https://bitbucket.org/coderkun/the-legend-of-z
|
||||
*/
|
||||
|
||||
namespace nre\configs;
|
||||
|
||||
|
||||
/**
|
||||
* Application configuration.
|
||||
*
|
||||
* This class contains static variables with configuration values for
|
||||
* the specific application.
|
||||
*
|
||||
* @author Oliver Hanraths <oliver.hanraths@uni-duesseldorf.de>
|
||||
*/
|
||||
final class AppConfig
|
||||
{
|
||||
|
||||
/**
|
||||
* Application values
|
||||
*
|
||||
* @static
|
||||
* @var array
|
||||
*/
|
||||
public static $app = array(
|
||||
'name' => 'The Legend of Z',
|
||||
'namespace' => 'hhu\\z\\',
|
||||
'timeZone' => 'Europe/Berlin'
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Default values
|
||||
*
|
||||
* @static
|
||||
* @var array
|
||||
*/
|
||||
public static $defaults = array(
|
||||
'toplevel' => 'html',
|
||||
'toplevel-error' => 'fault',
|
||||
'intermediate' => 'introduction',
|
||||
'intermediate-error' => 'error',
|
||||
'language' => 'de_DE.utf8',
|
||||
'locale' => 'de-DE'
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Directories
|
||||
*
|
||||
* @static
|
||||
* @var array
|
||||
*/
|
||||
public static $dirs = array(
|
||||
'locale' => 'locale',
|
||||
'media' => 'media',
|
||||
'questtypes' => 'questtypes'
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Routes
|
||||
*
|
||||
* @static
|
||||
* @var array
|
||||
*/
|
||||
public static $routes = array(
|
||||
array('css/?(.*)', 'css/$1?layout=stylesheet', true),
|
||||
array('users/([^/]+)/(edit|delete)', 'users/$2/$1', true),
|
||||
array('users/(?!(index|login|logout|create|edit|delete))', 'users/user/$1', true),
|
||||
array('seminaries/([^/]+)/(edit|delete)', 'seminaries/$2/$1', true),
|
||||
array('seminaries/(?!(index|create|edit|delete))', 'seminaries/seminary/$1', true),
|
||||
/*// z/<Seminary> ⇒ z/seminaries/seminary/<Seminary>
|
||||
array('^([^/]+)/*$', 'seminaries/seminary/$1', true),
|
||||
// z/<Seminary>/<Questgroup> ⇒ z/questgroups/questgroup/<Seminary>/<Questgroup>
|
||||
array('^([^/]+)/([^/]+)/?$', 'questgropus/questgroup/$1/$2', true),
|
||||
// z/<Seminary>/<Questgroup>/<Quest> ⇒ z/quests/quest/<Seminary>/<Questgroup>/<Quest>
|
||||
array('^([^/]+)/([^/]+)/([^/]+)/?$', 'quests/quest/$1/$2/3', true)*/
|
||||
array('characters/(?!(index|character))', 'characters/index/$1', true),
|
||||
array('charactergroups/(?!(index|groupsgroup|group))', 'charactergroups/index/$1', true),
|
||||
array('charactergroupsquests/(?!(quest))', 'charactergroupsquests/quest/$1', true),
|
||||
array('media/(.*)', 'media/$1?layout=binary', false),
|
||||
array('media/(.*)', 'media/index/$1', true)
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Reverse routes
|
||||
*
|
||||
* @static
|
||||
* @var array
|
||||
*/
|
||||
public static $reverseRoutes = array(
|
||||
array('users/user/(.*)', 'users/$1', true),
|
||||
array('users/([^/]+)/(.*)', 'users/$2/$1', true),
|
||||
array('seminaries/seminary/(.*)', 'seminaries/$1', false),
|
||||
//array('seminaries/seminary/(.*)', '$1', false)
|
||||
array('characters/index/(.*)', 'characters/$1', true),
|
||||
array('charactergroup/index/(.*)', 'charactergroup/$1', true),
|
||||
array('charactergroupsquests/quest/(.*)', 'charactergroupsquests/$1', true),
|
||||
array('media/index/(.*)', 'media/$1', true)
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Database connection settings
|
||||
*
|
||||
* @static
|
||||
* @var array
|
||||
*/
|
||||
public static $database = array(
|
||||
'user' => 'z',
|
||||
'host' => 'localhost',
|
||||
'password' => 'legendofZ',
|
||||
'db' => 'z'
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
167
configs/CoreConfig.inc
Normal file
167
configs/CoreConfig.inc
Normal file
|
|
@ -0,0 +1,167 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* NRE
|
||||
*
|
||||
* @author coderkun <olli@coderkun.de>
|
||||
* @copyright 2013 coderkun (http://www.coderkun.de)
|
||||
* @license http://www.gnu.org/licenses/gpl.html
|
||||
* @link http://www.coderkun.de/projects/nre
|
||||
*/
|
||||
|
||||
namespace nre\configs;
|
||||
|
||||
|
||||
/**
|
||||
* Core configuration.
|
||||
*
|
||||
* This class contains static variables with configuration values.
|
||||
*
|
||||
* @author coderkun <olli@coderkun.de>
|
||||
*/
|
||||
final class CoreConfig
|
||||
{
|
||||
|
||||
/**
|
||||
* Core values
|
||||
*
|
||||
* @static
|
||||
* @var array
|
||||
*/
|
||||
public static $core = array(
|
||||
'namespace' => 'nre\\',
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Directories
|
||||
*
|
||||
* @static
|
||||
* @var array
|
||||
*/
|
||||
public static $dirs = array(
|
||||
'core' => 'core',
|
||||
'publicDir' => 'www'
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* File extensions
|
||||
*
|
||||
* @static
|
||||
* @var array
|
||||
*/
|
||||
public static $fileExts = array(
|
||||
'default' => 'inc',
|
||||
'views' => 'tpl',
|
||||
'logs' => 'log',
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Default values
|
||||
*
|
||||
* @static
|
||||
* @var array
|
||||
*/
|
||||
public static $defaults = array(
|
||||
'action' => 'index',
|
||||
'errorFile' => 'error',
|
||||
'inlineErrorFile' => 'inlineerror'
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Miscellaneous settings
|
||||
*
|
||||
* @static
|
||||
* @var array
|
||||
*/
|
||||
public static $misc = array(
|
||||
'fileExtDot' => '.'
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Logging settings
|
||||
*
|
||||
* @static
|
||||
* @var array
|
||||
*/
|
||||
public static $log = array(
|
||||
'filename' => 'errors',
|
||||
'format' => 'Fehler %d: %s in %s, Zeile %d'
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Class-specific settings
|
||||
*
|
||||
* @static
|
||||
* @var array
|
||||
*/
|
||||
public static $classes = array(
|
||||
'linker' => array(
|
||||
'url' => array(
|
||||
'length' => 128,
|
||||
'delimiter' => '-'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Determine the directory for a specific classtype.
|
||||
*
|
||||
* @param string $classType Classtype to get directory of
|
||||
* @return string Directory of given classtype
|
||||
*/
|
||||
public static function getClassDir($classType)
|
||||
{
|
||||
// Default directory (for core classes)
|
||||
$classDir = self::$dirs['core'];
|
||||
|
||||
// Configurable directory
|
||||
if(array_key_exists($classType, self::$dirs)) {
|
||||
$classDir = self::$dirs[$classType];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Default directory for classtype
|
||||
if(is_dir(ROOT.DS.$classType)) {
|
||||
$classDir = $classType;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Return directory
|
||||
return $classDir;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine the file extension for a specific filetype.
|
||||
*
|
||||
* @param string $fileType Filetype to get file extension of
|
||||
* @return string File extension of given filetype
|
||||
*/
|
||||
public static function getFileExt($fileType)
|
||||
{
|
||||
// Default file extension
|
||||
$fileExt = self::$fileExts['default'];
|
||||
|
||||
// Configurable file extension
|
||||
if(array_key_exists($fileType, self::$fileExts)) {
|
||||
$fileExt = self::$fileExts[$fileType];
|
||||
}
|
||||
|
||||
|
||||
// Return file extension
|
||||
return self::$misc['fileExtDot'].$fileExt;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue