This commit is contained in:
Ulf Gebhardt 2016-06-12 18:37:26 +02:00
parent 600cf1de0a
commit 8ab04dc999
16 changed files with 380 additions and 23 deletions

View File

@ -1,5 +1,19 @@
<?php
/**
* System - PHP Framework
*
* PHP Version 5.6
*
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://github.com/webcraftmedia/system
* @package SYSTEM\SQL
*/
namespace SYSTEM\SQL;
/**
* DATA_SYSTEM_API Class provided by System to install the System apis to the Database
*/
class DATA_SYSTEM_API extends \SYSTEM\DB\QI {
public static function get_class(){return \get_class();}
public static function files_pgsql(){

View File

@ -1,5 +1,19 @@
<?php
/**
* System - PHP Framework
*
* PHP Version 5.6
*
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://github.com/webcraftmedia/system
* @package SYSTEM\SQL
*/
namespace SYSTEM\SQL;
/**
* DATA_SYSTEM_CRON Class provided by System to install the System crons to the Database
*/
class DATA_SYSTEM_CRON extends \SYSTEM\DB\QI {
public static function get_class(){return \get_class();}
public static function files_pgsql(){

View File

@ -1,5 +1,19 @@
<?php
/**
* System - PHP Framework
*
* PHP Version 5.6
*
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://github.com/webcraftmedia/system
* @package SYSTEM\SQL
*/
namespace SYSTEM\SQL;
/**
* DATA_SYSTEM_PAGE Class provided by System to install the System pages to the Database
*/
class DATA_SYSTEM_PAGE extends \SYSTEM\DB\QI {
public static function get_class(){return \get_class();}
public static function files_pgsql(){

View File

@ -1,11 +1,23 @@
<?php
/**
* System - PHP Framework
*
* PHP Version 5.6
*
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://github.com/webcraftmedia/system
* @package SYSTEM\SQL
*/
namespace SYSTEM\SQL;
/**
* DATA_SYSTEM_RIGHTS Class provided by System to install the System rights to the Database
*/
class DATA_SYSTEM_RIGHTS extends \SYSTEM\DB\QI {
public static function get_class(){return \get_class();}
public static function files_pgsql(){
return array( (new \SYSTEM\PSQL('/qt/pgsql/data/system_rights.sql'))->SERVERPATH());
}
return array( (new \SYSTEM\PSQL('/qt/pgsql/data/system_rights.sql'))->SERVERPATH());}
public static function files_mysql(){
return array( (new \SYSTEM\PSQL('/qt/mysql/data/system_rights.sql'))->SERVERPATH());
}
return array( (new \SYSTEM\PSQL('/qt/mysql/data/system_rights.sql'))->SERVERPATH());}
}

View File

@ -1,11 +1,23 @@
<?php
/**
* System - PHP Framework
*
* PHP Version 5.6
*
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://github.com/webcraftmedia/system
* @package SYSTEM\SQL
*/
namespace SYSTEM\SQL;
/**
* DATA_SYSTEM_TEXT Class provided by System to install the System texts to the Database(includes Tags)
*/
class DATA_SYSTEM_TEXT extends \SYSTEM\DB\QI {
public static function get_class(){return \get_class();}
public static function files_pgsql(){
return array( (new \SYSTEM\PSQL('/qt/pgsql/data/system_text.sql'))->SERVERPATH());
}
return array( (new \SYSTEM\PSQL('/qt/pgsql/data/system_text.sql'))->SERVERPATH());}
public static function files_mysql(){
return array( (new \SYSTEM\PSQL('/qt/mysql/data/system_text.sql'))->SERVERPATH());
}
return array( (new \SYSTEM\PSQL('/qt/mysql/data/system_text.sql'))->SERVERPATH());}
}

View File

@ -1,5 +1,19 @@
<?php
/**
* System - PHP Framework
*
* PHP Version 5.6
*
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://github.com/webcraftmedia/system
* @package SYSTEM\SQL
*/
namespace SYSTEM\SQL;
/**
* SCHEMA_SYSTEM Class provided by System to install the Database Schema for system
*/
class SCHEMA_SYSTEM extends \SYSTEM\DB\QI {
public static function get_class(){return \get_class();}
public static function files_pgsql(){

View File

@ -1,24 +1,59 @@
<?php
/**
* System - PHP Framework
*
* PHP Version 5.6
*
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://github.com/webcraftmedia/system
* @package SYSTEM\SQL
*/
namespace SYSTEM\SQL;
/**
* Setup Class provided by System to execute QIs defining sql files to be setup on the database
*/
class setup {
private static $qis = array(); //only strings!
/** array Registered QIs to be executed on setup */
private static $qis = array();
/**
* Check if a given QI classname is a valid QI
*
* @param string $qi Classname of the QI
* @return bool Returns true or false.
*/
private static function check_qi($qi){
if( !\class_exists($qi) ||
!\is_array($parents = \class_parents($qi)) ||
!\array_search('SYSTEM\DB\QI', $parents)){
return false;}
return true;}
return true;}
/**
* Register a given QI classname
*
* @param string $qi Classname of the QI
* @return null Returns null.
*/
public static function register($qi){
if(!self::check_qi($qi)){
throw new \SYSTEM\LOG\ERROR('Problem with your QI class: '.$qi.'; it might not be available or inherits from the wrong class!');}
array_push(self::$qis,$qi);}
public static function check(){}
public static function delete(){}
public static function backup(){}
//public static function check(){}
//public static function delete(){}
//public static function backup(){}
/**
* Execute all registered QIs installing the Database
*
* @return array Returns array with scripts executed and their results.
*/
public static function install(){
$result = array();
foreach(self::$qis as $qi){
$result[] = array($qi,\call_user_func(array($qi, 'QI')));}
return \SYSTEM\LOG\JsonResult::toString($result);
}
}
}

View File

@ -1,22 +1,48 @@
<?php
/**
* System - PHP Framework
*
* PHP Version 5.6
*
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://github.com/webcraftmedia/system
* @package SYSTEM\SQL
*/
namespace SYSTEM\SQL;
/**
* system_api Class provided by System to describe system_api table
*/
class system_api {
/** string Tablename in PostgreSQL */
const NAME_PG = 'system.api';
/** string Tablename in MYSQL */
const NAME_MYS = 'system_api';
/** string Fieldname for field ID */
const FIELD_ID = 'ID';
/** string Fieldname for field group */
const FIELD_GROUP = 'group';
/** string Fieldname for field type */
const FIELD_TYPE = 'type';
/** string Fieldname for field parentID */
const FIELD_PARENTID = 'parentID';
/** string Fieldname for field parentValue */
const FIELD_PARENTVALUE = 'parentValue';
const FIELD_NAME = 'name';
/** string Fieldname for field name */
const FIELD_NAME = 'name';
/** string Fieldname for field verify */
const FIELD_VERIFY = 'verify';
/** string Fieldvalue for field type - command */
const VALUE_TYPE_COMMAND = 0;
/** string Fieldvalue for field type - command flag */
const VALUE_TYPE_COMMAND_FLAG = 1;
/** string Fieldvalue for field type - param */
const VALUE_TYPE_PARAM = 2;
/** string Fieldvalue for field type - param ipt */
const VALUE_TYPE_PARAM_OPT = 3;
/** string Fieldvalue for field type - static */
const VALUE_TYPE_STATIC = 4;
}

View File

@ -1,18 +1,41 @@
<?php
/**
* System - PHP Framework
*
* PHP Version 5.6
*
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://github.com/webcraftmedia/system
* @package SYSTEM\SQL
*/
namespace SYSTEM\SQL;
/**
* system_cron Class provided by System to describe system_cron table
*/
class system_cron {
/** string Tablename in PostgreSQL */
const NAME_PG = 'system.cron';
/** string Tablename in MYSQL */
const NAME_MYS = 'system_cron';
/** string Fieldname for field class */
const FIELD_CLASS = 'class';
/** string Fieldname for field min */
const FIELD_MIN = 'min';
/** string Fieldname for field hour */
const FIELD_HOUR = 'hour';
/** string Fieldname for field day */
const FIELD_DAY = 'day';
/** string Fieldname for field day_week */
const FIELD_DAY_WEEK = 'day_week';
/** string Fieldname for field month */
const FIELD_MONTH = 'month';
/** string Fieldname for field day_month */
const FIELD_DAY_MONTH = 'day_month';
/** string Fieldname for field last_run */
const FIELD_LAST_RUN = 'last_run';
/** string Fieldname for field status */
const FIELD_STATUS = 'status';
}

View File

@ -1,26 +1,59 @@
<?php
/**
* System - PHP Framework
*
* PHP Version 5.6
*
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://github.com/webcraftmedia/system
* @package SYSTEM\SQL
*/
namespace SYSTEM\SQL;
/**
* system_log Class provided by System to describe system_log table
*/
class system_log {
/** string Tablename in PostgreSQL */
const NAME_PG = 'system.log';
/** string Tablename in MYSQL */
const NAME_MYS = 'system_log';
/** string Fieldname for field ID */
const FIELD_ID = 'ID';
/** string Fieldname for field class */
const FIELD_CLASS = 'class';
/** string Fieldname for field message */
const FIELD_MESSAGE = 'message';
/** string Fieldname for field code */
const FIELD_CODE = 'code';
/** string Fieldname for field file */
const FIELD_FILE = 'file';
/** string Fieldname for field line */
const FIELD_LINE = 'line';
/** string Fieldname for field trace */
const FIELD_TRACE = 'trace';
/** string Fieldname for field ip */
const FIELD_IP = 'ip';
/** string Fieldname for field querytime */
const FIELD_QUERYTIME = 'querytime';
/** string Fieldname for field time */
const FIELD_TIME = 'time';
/** string Fieldname for field server_name */
const FIELD_SERVER_NAME = 'server_name';
/** string Fieldname for field server_port */
const FIELD_SERVER_PORT = 'server_port';
/** string Fieldname for field request_uri */
const FIELD_REQUEST_URI = 'request_uri';
/** string Fieldname for field post */
const FIELD_POST = 'post';
/** string Fieldname for field http_referer */
const FIELD_HTTP_REFERER = 'http_referer';
/** string Fieldname for field http_user_agent */
const FIELD_HTTP_USER_AGENT = 'http_user_agent';
/** string Fieldname for field user */
const FIELD_USER = 'user';
/** string Fieldname for field thrown */
const FIELD_THROWN = 'thrown';
}

View File

@ -1,20 +1,46 @@
<?php
/**
* System - PHP Framework
*
* PHP Version 5.6
*
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://github.com/webcraftmedia/system
* @package SYSTEM\SQL
*/
namespace SYSTEM\SQL;
/**
* system_page Class provided by System to describe system_page table
*/
class system_page {
/** string Tablename in PostgreSQL */
const NAME_PG = 'system.page';
/** string Tablename in MYSQL */
const NAME_MYS = 'system_page';
/** string Fieldname for field id */
const FIELD_ID = 'id';
/** string Fieldname for field name */
const FIELD_NAME = 'name';
/** string Fieldname for field group */
const FIELD_GROUP = 'group';
/** string Fieldname for field state */
const FIELD_STATE = 'state';
/** string Fieldname for field parent_id */
const FIELD_PARENT_ID = 'parent_id';
/** string Fieldname for field login */
const FIELD_LOGIN = 'login';
/** string Fieldname for field type */
const FIELD_TYPE = 'type';
/** string Fieldname for field div */
const FIELD_DIV = 'div';
/** string Fieldname for field url */
const FIELD_URL = 'url';
/** string Fieldname for field func */
const FIELD_FUNC = 'func';
/** string Fieldvalue for field ID - default */
const VALUE_ID_DEFAULT = 'default';
}

View File

@ -1,35 +1,71 @@
<?php
/**
* System - PHP Framework
*
* PHP Version 5.6
*
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://github.com/webcraftmedia/system
* @package SYSTEM\SQL
*/
namespace SYSTEM\SQL;
/**
* system_text Class provided by System to describe system_text table
*/
class system_text {
/** string Tablename in PostgreSQL */
const NAME_PG = 'system.text';
/** string Tablename in MYSQL */
const NAME_MYS = 'system_text';
/** string Fieldname for field id */
const FIELD_ID = 'id';
/** string Fieldname for field text */
const FIELD_TEXT = 'text';
/** string Tag value for tag basic */
const TAG_BASIC = 'basic';
/** string Tag value for tag time */
const TAG_TIME = 'time';
/** string Tag value for tag table */
const TAG_TABLE = 'table';
/** string Tag value for tag sai */
const TAG_SAI = 'sai';
/** string Tag value for tag sai_default */
const TAG_SAI_DEFAULT = 'sai_default';
/** string Tag value for tag sai_start */
const TAG_SAI_START = 'sai_start';
/** string Tag value for tag sai_api */
const TAG_SAI_API = 'sai_api';
/** string Tag value for tag sai_cache */
const TAG_SAI_CACHE = 'sai_cache';
/** string Tag value for tag sai_config */
const TAG_SAI_CONFIG = 'sai_config';
/** string Tag value for tag sai_cron */
const TAG_SAI_CRON = 'sai_cron';
/** string Tag value for tag sai_docu */
const TAG_SAI_DOCU = 'sai_docu';
/** string Tag value for tag sai_files */
const TAG_SAI_FILES = 'sai_files';
/** string Tag value for tag sai_langswitcher */
const TAG_SAI_LANGSWITCHER = 'sai_langswitcher';
/** string Tag value for tag sai_log */
const TAG_SAI_LOG = 'sai_log';
/** string Tag value for tag sai_login */
const TAG_SAI_LOGIN = 'sai_login';
/** string Tag value for tag sai_mod */
const TAG_SAI_MOD = 'sai_mod';
/** string Tag value for tag sai_page */
const TAG_SAI_PAGE = 'sai_page';
/** string Tag value for tag sai_security */
const TAG_SAI_SECURITY = 'sai_security';
/** string Tag value for tag sai_text */
const TAG_SAI_TEXT = 'sai_text';
/** string Tag value for tag sai_todo */
const TAG_SAI_TODO = 'sai_todo';
/** string Tag value for tag sai_git */
const TAG_SAI_GIT = 'sai_git';
}

View File

@ -1,38 +1,82 @@
<?php
/**
* System - PHP Framework
*
* PHP Version 5.6
*
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://github.com/webcraftmedia/system
* @package SYSTEM\SQL
*/
namespace SYSTEM\SQL;
/**
* system_todo Class provided by System to describe system_todo table
*/
class system_todo {
/** string Tablename in PostgreSQL */
const NAME_PG = 'system.todo';
/** string Tablename in MYSQL */
const NAME_MYS = 'system_todo';
/** string Fieldname for field ID */
const FIELD_ID = 'ID';
/** string Fieldname for field class */
const FIELD_CLASS = 'class';
/** string Fieldname for field message */
const FIELD_MESSAGE = 'message';
/** string Fieldname for field message_hash */
const FIELD_MESSAGE_HASH = 'message_hash';
/** string Fieldname for field code */
const FIELD_CODE = 'code';
/** string Fieldname for field file */
const FIELD_FILE = 'file';
/** string Fieldname for field line */
const FIELD_LINE = 'line';
/** string Fieldname for field trace */
const FIELD_TRACE = 'trace';
/** string Fieldname for field ip */
const FIELD_IP = 'ip';
/** string Fieldname for field querytime */
const FIELD_QUERYTIME = 'querytime';
/** string Fieldname for field time */
const FIELD_TIME = 'time';
/** string Fieldname for field server_name */
const FIELD_SERVER_NAME = 'server_name';
/** string Fieldname for field server_port */
const FIELD_SERVER_PORT = 'server_port';
/** string Fieldname for field request_uri */
const FIELD_REQUEST_URI = 'request_uri';
/** string Fieldname for field post */
const FIELD_POST = 'post';
/** string Fieldname for field http_referer */
const FIELD_HTTP_REFERER = 'http_referer';
/** string Fieldname for field http_user_agent */
const FIELD_HTTP_USER_AGENT = 'http_user_agent';
/** string Fieldname for field user */
const FIELD_USER = 'user';
/** string Fieldname for field thrown */
const FIELD_THROWN = 'thrown';
/** string Fieldname for field count */
const FIELD_COUNT = 'count';
/** string Fieldname for field type */
const FIELD_TYPE = 'type';
/** string Fieldvalue for field type - exception */
const FIELD_TYPE_EXCEPTION = 0;
/** string Fieldvalue for field type - user */
const FIELD_TYPE_USER = 1;
/** string Fieldvalue for field type - report */
const FIELD_TYPE_REPORT = 2;
/** string Fieldname for field state */
const FIELD_STATE = 'state';
/** string Fieldvalue for field state - open */
const FIELD_STATE_OPEN = 0;
/** string Fieldvalue for field state - closed */
const FIELD_STATE_CLOSED = 1;
/** string Fieldname for field priority */
const FIELD_PRIORITY = 'priority';
/** string Fieldname for field time_closed */
const FIELD_TIME_CLOSED = 'time_closed';
}

View File

@ -1,11 +1,29 @@
<?php
/**
* System - PHP Framework
*
* PHP Version 5.6
*
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://github.com/webcraftmedia/system
* @package SYSTEM\SQL
*/
namespace SYSTEM\SQL;
/**
* system_todo_assign Class provided by System to describe system_todo_assign table
*/
class system_todo_assign {
/** string Tablename in PostgreSQL */
const NAME_PG = 'system.todo_assign';
/** string Tablename in MYSQL */
const NAME_MYS = 'system_todo_assign';
/** string Fieldname for field todo */
const FIELD_TODO = 'todo';
/** string Fieldname for field user */
const FIELD_USER = 'user';
/** string Fieldname for field time */
const FIELD_TIME = 'time';
}

View File

@ -1,18 +1,39 @@
<?php
/**
* System - PHP Framework
*
* PHP Version 5.6
*
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://github.com/webcraftmedia/system
* @package SYSTEM\SQL
*/
namespace SYSTEM\SQL;
/**
* system_user Class provided by System to describe system_user table
*/
class system_user {
/** string Tablename in PostgreSQL */
const NAME_PG = 'system.user';
/** string Tablename in MYSQL */
const NAME_MYS = 'system_user';
/** string Fieldname for field id */
const FIELD_ID = 'id';
/** string Fieldname for field username */
const FIELD_USERNAME = 'username';
/** string Fieldname for field password_sha1 */
const FIELD_PASSWORD_SHA = 'password_sha1';
/** string Fieldname for field email */
const FIELD_EMAIL = 'email';
/** string Fieldname for field joindate */
const FIELD_JOINDATE = 'joindate';
/** string Fieldname for field locale */
const FIELD_LOCALE = 'locale';
/** string Fieldname for field last_active */
const FIELD_LAST_ACTIVE = 'last_active';
/** string Fieldname for field email_confirmed */
const FIELD_EMAIL_CONFIRMED = 'email_confirmed';
}

View File

@ -1,12 +1,27 @@
<?php
/**
* System - PHP Framework
*
* PHP Version 5.6
*
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://github.com/webcraftmedia/system
* @package SYSTEM\SQL
*/
namespace SYSTEM\SQL;
/**
* system_user_to_rights Class provided by System to describe system_user_to_rights table
*/
class system_user_to_rights {
/** string Tablename in PostgreSQL */
const NAME_PG = 'system.user_to_rights';
/** string Tablename in MYSQL */
const NAME_MYS = 'system_user_to_rights';
/** string Fieldname for field userID */
const FIELD_USERID = 'userID';
/** string Fieldname for field rightID */
const FIELD_RIGHTID = 'rightID';
}