version 0.2 beta nibiru framework, added onclick to the navbar json configuration, added a new dispatcher class that can handle actions as well, removed the dirty method calls fro the constructor $this->pageAction() and the navbar call, added ODBC support, and a postgress class. Overall improved the core functions of the framework.
This commit is contained in:
17
README.md
17
README.md
@@ -37,7 +37,22 @@ Engine Implementation.</div>
|
||||
<li>Dwoo tempalte eninge tests</li>
|
||||
<li>Twig tempalte eninge tests</li>
|
||||
<li>Improved routing</li>
|
||||
|
||||
</ul>
|
||||
<h1>Update</h1>
|
||||
<p>Version 0.2 beta 19.07.2017</p>
|
||||
<ul>
|
||||
<li>Dispatcher update now supports actions within Controllers</li>
|
||||
<li>Main Framework call moved to the framework file</li>
|
||||
<li>Added support for ODBC in a basic Postgress class</li>
|
||||
<li>Updated the router and added a static printstufftoscreen call</li>
|
||||
</ul>
|
||||
<p>Still in progress for the next version</p>
|
||||
<ul>
|
||||
<li>framework documentation</li>
|
||||
<li>class documentation</li>
|
||||
<li>soap interface to a given SOAP server</li>
|
||||
<li>Dwoo tempalte eninge tests</li>
|
||||
<li>Twig tempalte eninge tests</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -14,8 +14,7 @@ class indexController extends View implements IController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->navigationAction();
|
||||
$this->pageAction();
|
||||
|
||||
}
|
||||
|
||||
public function pageAction()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"navigation" :
|
||||
{
|
||||
"Home": { "link": "/", "tooltip": "Home", "icon": "icon-home" }
|
||||
"Home": { "link": "/", "tooltip": "Home", "icon": "icon icon-home" }
|
||||
}
|
||||
}
|
||||
@@ -6,10 +6,17 @@
|
||||
<ul class="nav nav-pills iconav-nav">
|
||||
{foreach $navigationJson as $naventry}
|
||||
<li >
|
||||
<a href="{$naventry.link}" title="{$naventry.tooltip}" data-toggle="tooltip" data-placement="right" data-container="body">
|
||||
<span class="icon {$naventry.icon}"></span>
|
||||
<small class="iconav-nav-label visible-xs-block">{$naventry.title}</small>
|
||||
</a>
|
||||
{if $naventry.onclick}
|
||||
<a title="{$naventry.tooltip}" data-toggle="tooltip" data-placement="right" data-container="body" onclick="{$naventry.onclick}">
|
||||
<span class="{$naventry.icon}"></span>
|
||||
<small class="iconav-nav-label visible-xs-block">{$naventry.title}</small>
|
||||
</a>
|
||||
{elseif $naventry.link}
|
||||
<a href="{$naventry.link}" title="{$naventry.tooltip}" data-toggle="tooltip" data-placement="right" data-container="body">
|
||||
<span class="{$naventry.icon}"></span>
|
||||
<small class="iconav-nav-label visible-xs-block">{$naventry.title}</small>
|
||||
</a>
|
||||
{/if}
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
|
||||
52
core/c/dispatcher.php
Normal file
52
core/c/dispatcher.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: skasdorf
|
||||
* Date: 18.07.17
|
||||
* Time: 16:50
|
||||
*/
|
||||
|
||||
namespace Nibiru;
|
||||
|
||||
|
||||
final class Dispatcher
|
||||
{
|
||||
private static $_instance;
|
||||
|
||||
protected function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static function getInstance()
|
||||
{
|
||||
$className = get_called_class();
|
||||
if(self::$_instance==null) self::$_instance = new $className();
|
||||
return self::$_instance;
|
||||
}
|
||||
|
||||
public function run()
|
||||
{
|
||||
Router::getInstance();
|
||||
Router::getInstance()->route();
|
||||
require_once __DIR__ . '/../../application/controller/' . Router::getInstance()->tplName() . 'Controller.php';
|
||||
$class = "Sunrise\\".\Sunrise\Router::getInstance()->tplName()."Controller";
|
||||
$controller = new $class();
|
||||
|
||||
if(array_key_exists('_action', $_REQUEST))
|
||||
{
|
||||
$action = $_REQUEST['_action']."Action";
|
||||
$controller->navigationAction();
|
||||
$controller->$action();
|
||||
$controller->pageAction();
|
||||
}
|
||||
else
|
||||
{
|
||||
$controller->navigationAction();
|
||||
$controller->pageAction();
|
||||
}
|
||||
|
||||
Debug::getInstance();
|
||||
Display::getInstance()->display();
|
||||
}
|
||||
}
|
||||
28
core/c/json-navigation.php
Normal file → Executable file
28
core/c/json-navigation.php
Normal file → Executable file
@@ -44,7 +44,7 @@ class JsonNavigation extends Config
|
||||
*/
|
||||
private static function setFileContentString( )
|
||||
{
|
||||
self::$_file_content_string = file_get_contents( Settings::SETTINGS_PATH . self::getConfig()["SETTINGS"]["navigation"] );
|
||||
self::$_file_content_string = file_get_contents( Settings::SETTINGS_PATH . parent::getInstance()->getConfig()["SETTINGS"]["navigation"] );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,7 +60,7 @@ class JsonNavigation extends Config
|
||||
*/
|
||||
private static function setFileContentArray( )
|
||||
{
|
||||
self::$_file_content_array = file( Settings::SETTINGS_PATH . self::getConfig()["SETTINGS"]["navigation"] );
|
||||
self::$_file_content_array = file( Settings::SETTINGS_PATH . parent::getInstance()->getConfig()["SETTINGS"]["navigation"] );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,12 +116,24 @@ class JsonNavigation extends Config
|
||||
$keys = array_keys($value);
|
||||
for($i=0; sizeof($keys)>$i;$i++)
|
||||
{
|
||||
self::$_navigation_array[] = array(
|
||||
'title' => $keys[$i],
|
||||
'icon' => $value[$keys[$i]]["icon"],
|
||||
'link' => $value[$keys[$i]]["link"],
|
||||
'tooltip' => $value[$keys[$i]]["tooltip"],
|
||||
);
|
||||
if(array_key_exists('link', $value[$keys[$i]]))
|
||||
{
|
||||
self::$_navigation_array[] = array(
|
||||
'title' => $keys[$i],
|
||||
'icon' => $value[$keys[$i]]["icon"],
|
||||
'link' => $value[$keys[$i]]["link"],
|
||||
'tooltip' => $value[$keys[$i]]["tooltip"]
|
||||
);
|
||||
}
|
||||
elseif(array_key_exists('onclick', $value[$keys[$i]]))
|
||||
{
|
||||
self::$_navigation_array[] = array(
|
||||
'title' => $keys[$i],
|
||||
'icon' => $value[$keys[$i]]["icon"],
|
||||
'tooltip' => $value[$keys[$i]]["tooltip"],
|
||||
'onclick' => $value[$keys[$i]]["onclick"]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
16
core/c/mysql.php
Normal file → Executable file
16
core/c/mysql.php
Normal file → Executable file
@@ -14,15 +14,15 @@ class Mysql implements IMysql
|
||||
|
||||
private static $_instance;
|
||||
|
||||
private $_dsn = self::PLACE_DSN;
|
||||
private $_username = self::PLACE_USERNAME;
|
||||
private $_password = self::PLACE_PASSWORD;
|
||||
private $_diver = self::PLACE_DRIVER;
|
||||
private $_hostname = self::PLACE_HOSTNAME;
|
||||
private $_dbname = self::PLACE_DATABASE;
|
||||
private $_port = self::PLACE_PORT;
|
||||
protected $_dsn = self::PLACE_DSN;
|
||||
protected $_username = self::PLACE_USERNAME;
|
||||
protected $_password = self::PLACE_PASSWORD;
|
||||
protected $_diver = self::PLACE_DRIVER;
|
||||
protected $_hostname = self::PLACE_HOSTNAME;
|
||||
protected $_dbname = self::PLACE_DATABASE;
|
||||
protected $_port = self::PLACE_PORT;
|
||||
|
||||
private $_conn = self::PLACE_CONNECTION;
|
||||
protected $_conn = self::PLACE_CONNECTION;
|
||||
|
||||
protected function __construct( )
|
||||
{
|
||||
|
||||
121
core/c/odbc.php
Executable file
121
core/c/odbc.php
Executable file
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: skasdorf
|
||||
* Date: 10.07.17
|
||||
* Time: 13:49
|
||||
*/
|
||||
|
||||
namespace Nibiru;
|
||||
|
||||
|
||||
class Odbc extends Mysql implements IOdbc
|
||||
{
|
||||
use Messages;
|
||||
|
||||
protected $_readOnly = false;
|
||||
|
||||
private static $_instance;
|
||||
|
||||
protected function __construct( )
|
||||
{
|
||||
|
||||
$settings = Config::getInstance()->getConfig()[self::SETTINGS_DATABASE];
|
||||
$this->_setUsername($settings[self::PLACE_USERNAME]);
|
||||
$this->_setPassword($settings[self::PLACE_PASSWORD]);
|
||||
$this->_setDbname($settings[self::PLACE_DATABASE]);
|
||||
$this->_setDiver($settings[self::PLACE_DRIVER]);
|
||||
$this->_setHostname($settings[self::PLACE_HOSTNAME]);
|
||||
$this->_setPort($settings[self::PLACE_PORT]);
|
||||
$this->_setReadOnly($settings[self::PLACE_READONLY]);
|
||||
$this->_setDsn();
|
||||
$this->_setConn();
|
||||
}
|
||||
|
||||
public static function getInstance()
|
||||
{
|
||||
$className = get_called_class();
|
||||
if(self::$_instance==null) self::$_instance = new $className();
|
||||
return self::$_instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $dsn
|
||||
*/
|
||||
private function _setDsn( )
|
||||
{
|
||||
$this->_dsn = 'Driver=' . $this->getDiver() . ';Server=' . $this->getHostname() . ';Port=' . $this->getPort() . ';Database=' . $this->getDbname() . ';ReadOnly=' . $this->getReadOnly();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $username
|
||||
*/
|
||||
private function _setUsername( $username )
|
||||
{
|
||||
$this->_username = $username;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $password
|
||||
*/
|
||||
private function _setPassword( $password )
|
||||
{
|
||||
$this->_password = $password;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $diver
|
||||
*/
|
||||
private function _setDiver( $diver )
|
||||
{
|
||||
$this->_diver = $diver;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $hostname
|
||||
*/
|
||||
private function _setHostname( $hostname )
|
||||
{
|
||||
$this->_hostname = $hostname;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $dbname
|
||||
*/
|
||||
private function _setDbname( $dbname )
|
||||
{
|
||||
$this->_dbname = $dbname;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $conn
|
||||
*/
|
||||
private function _setConn( )
|
||||
{
|
||||
$this->_conn = \odbc_connect( $this->getDsn(), $this->getUsername(), $this->getPassword() );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $port
|
||||
*/
|
||||
private function _setPort( $port )
|
||||
{
|
||||
$this->_port = $port;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
*/
|
||||
private function getReadOnly()
|
||||
{
|
||||
return $this->_readOnly;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param boolean $readOnly
|
||||
*/
|
||||
protected function _setReadOnly( $readOnly )
|
||||
{
|
||||
$this->_readOnly = $readOnly;
|
||||
}
|
||||
}
|
||||
155
core/c/postgres.php
Executable file
155
core/c/postgres.php
Executable file
@@ -0,0 +1,155 @@
|
||||
<?php
|
||||
|
||||
namespace Nibiru;
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: skasdorf
|
||||
* Date: 29.06.17
|
||||
* Time: 15:06
|
||||
*/
|
||||
class Postgres extends Odbc implements IPostgres
|
||||
{
|
||||
/**
|
||||
* @desc does a plain SQL query on a postgres database, and returns the
|
||||
* result as an array
|
||||
* @param string $string
|
||||
* @return array
|
||||
*/
|
||||
public static function query($string = IOdbc::PLACE_NO_QUERY)
|
||||
{
|
||||
$all = array();
|
||||
$result = \odbc_exec(parent::getInstance()->getConn(), $string);
|
||||
for($i=1;$row=\odbc_fetch_object($result,$i);$i++)
|
||||
{
|
||||
$row_values = array();
|
||||
$key_values = array();
|
||||
|
||||
foreach($row as $key=>$item)
|
||||
{
|
||||
$row_values[] = $item;
|
||||
$key_values[] = $key;
|
||||
}
|
||||
$all[] = array_combine($key_values, $row_values);
|
||||
}
|
||||
return $all;
|
||||
}
|
||||
|
||||
public static function fetchRowInArrayById($tablename = IOdbc::PLACE_TABLE_NAME, $id = IOdbc::NO_ID)
|
||||
{
|
||||
// TODO: Implement fetchRowInArrayById() method.
|
||||
}
|
||||
|
||||
public static function fetchRowInArrayByWhere($tablename = IOdbc::PLACE_TABLE_NAME,
|
||||
$column_name = IOdbc::PLACE_COLUMN_NAME,
|
||||
$parameter_name = IOdbc::PLACE_SEARCH_TERM)
|
||||
{
|
||||
return self::query("SELECT * FROM " . $tablename . " WHERE " . $column_name . "='" . $parameter_name . "';");
|
||||
}
|
||||
|
||||
public static function getLastInsertedID()
|
||||
{
|
||||
// TODO: Implement getLastInsertedID() method.
|
||||
}
|
||||
|
||||
public static function fetchTableFieldsAsArray($tablename = IOdbc::PLACE_TABLE_NAME)
|
||||
{
|
||||
$columns = array();
|
||||
$result = \odbc_columns(parent::getInstance()->getConn(), null, null, $tablename);
|
||||
for($i=0;$row=\odbc_fetch_object($result, $i);$i++)
|
||||
{
|
||||
foreach ($row as $key=>$entry)
|
||||
{
|
||||
if(self::FILTER_COLUMN_NAME == $key)
|
||||
{
|
||||
$columns[] = $entry;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $columns;
|
||||
}
|
||||
|
||||
public static function fetchTableAsArray($tablename = IOdbc::PLACE_TABLE_NAME)
|
||||
{
|
||||
return self::query("SELECT * FROM " . $tablename . ";");
|
||||
}
|
||||
|
||||
public static function insertArrayIntoTable($tablename = IOdbc::PLACE_TABLE_NAME,
|
||||
$array_name = IOdbc::PLACE_ARRAY_NAME,
|
||||
$encrypted = IOdbc::PLACE_DES_ENCRYPT)
|
||||
{
|
||||
if(array_key_exists(0, $array_name))
|
||||
{
|
||||
foreach( $array_name as $entry )
|
||||
{
|
||||
$field_names = array_keys( $entry );
|
||||
$numItems = sizeof( $field_names );
|
||||
$i = 0;
|
||||
$row = " ( ";
|
||||
foreach( $field_names as $field )
|
||||
{
|
||||
if( ++$i === $numItems )
|
||||
{
|
||||
$row .= $field;
|
||||
}
|
||||
else
|
||||
{
|
||||
$row .= $field . ", ";
|
||||
}
|
||||
}
|
||||
$i = 0;
|
||||
$row .= " ) VALUES ( ";
|
||||
foreach ( $entry as $field )
|
||||
{
|
||||
if( ++$i === $numItems )
|
||||
{
|
||||
$row .= "'" . $field . "'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$row .= "'" . $field . "', ";
|
||||
}
|
||||
}
|
||||
$row .= " )";
|
||||
$sql = 'INSERT INTO ' . $tablename . $row . ';';
|
||||
|
||||
\odbc_exec(parent::getInstance()->getConn(), $sql);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$field_names = array_keys($array_name);
|
||||
$numItems = sizeof($field_names);
|
||||
$i = 0;
|
||||
$row = " ( ";
|
||||
foreach( $field_names as $field )
|
||||
{
|
||||
if( ++$i === $numItems )
|
||||
{
|
||||
$row .= $field;
|
||||
}
|
||||
else
|
||||
{
|
||||
$row .= $field . ", ";
|
||||
}
|
||||
}
|
||||
$row .= " ) VALUES ( ";
|
||||
$i = 0;
|
||||
foreach ( $array_name as $entry )
|
||||
{
|
||||
if( ++$i === $numItems )
|
||||
{
|
||||
$row .= "'" . $entry . "'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$row .= "'" . $entry . "', ";
|
||||
}
|
||||
}
|
||||
$row .= " )";
|
||||
$sql = 'INSERT INTO ' . $tablename . $row . ';';
|
||||
|
||||
\odbc_exec(parent::getInstance()->getConn(), $sql);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
52
core/c/router.php
Normal file → Executable file
52
core/c/router.php
Normal file → Executable file
@@ -12,7 +12,7 @@ namespace Nibiru;
|
||||
class Router extends Config
|
||||
{
|
||||
private static $_routing;
|
||||
private static $_cur_route;
|
||||
private static $_cur_route = null;
|
||||
private static $_instance;
|
||||
private static $_cur_page;
|
||||
private static $_routes = array();
|
||||
@@ -36,6 +36,30 @@ class Router extends Config
|
||||
self::$_routing = Config::getInstance()->getConfig()[View::ATM_ROUTING];
|
||||
self::setRoutes(self::$_routing);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
protected static function getCurRoute()
|
||||
{
|
||||
return self::$_cur_route;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $cur_route
|
||||
*/
|
||||
private static function _setCurRoute( )
|
||||
{
|
||||
if( Controller::getInstance()->getController() != IController::START_CONTROLLER_NAME )
|
||||
{
|
||||
self::$_cur_route = Controller::getInstance()->getController();
|
||||
}
|
||||
else
|
||||
{
|
||||
self::$_cur_route = IController::START_CONTROLLER_NAME;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
@@ -94,19 +118,25 @@ class Router extends Config
|
||||
*/
|
||||
private static function setCurPage( )
|
||||
{
|
||||
|
||||
$uri_parts = explode('/', $_SERVER["REQUEST_URI"]);
|
||||
if(is_array($uri_parts))
|
||||
self::_setCurRoute();
|
||||
if( self::getCurRoute() == null )
|
||||
{
|
||||
if($uri_parts[1] == "")
|
||||
$uri_parts = explode('/', $_SERVER["REQUEST_URI"]);
|
||||
if(is_array($uri_parts))
|
||||
{
|
||||
self::$_cur_page = "index";
|
||||
if($uri_parts[1] == "")
|
||||
{
|
||||
self::$_cur_page = "index";
|
||||
}
|
||||
else
|
||||
{
|
||||
self::$_cur_page = $uri_parts[1];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
self::$_cur_page = $uri_parts[1];
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
self::$_cur_page = self::getCurRoute();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
43
core/c/view.php
Normal file → Executable file
43
core/c/view.php
Normal file → Executable file
@@ -19,6 +19,13 @@ class View extends Controller implements IView
|
||||
private static $smarty = array();
|
||||
private static $engine = array();
|
||||
|
||||
/**
|
||||
* @desc not part of the core should be working standalone on the
|
||||
* $this->buildCsv() method
|
||||
* @var int
|
||||
*/
|
||||
private $xmlPos = 0;
|
||||
|
||||
protected function __construct()
|
||||
{
|
||||
Controller::getInstance();
|
||||
@@ -52,10 +59,10 @@ class View extends Controller implements IView
|
||||
{
|
||||
case Engine::T_ENGINE_SMARTY:
|
||||
self::$engine = new \Smarty();
|
||||
self::$engine->setTemplateDir(Config::getInstance()->getConfig()[Engine::T_ENGINE]["templates"]);
|
||||
self::$engine->setCompileDir(Config::getInstance()->getConfig()[Engine::T_ENGINE]["templates_c"]);
|
||||
self::$engine->setCacheDir(Config::getInstance()->getConfig()[Engine::T_ENGINE]["cache"]);
|
||||
self::$engine->setConfigDir(Config::getInstance()->getConfig()[Engine::T_ENGINE]["config_dir"]);
|
||||
self::$engine->setTemplateDir(__DIR__ . Config::getInstance()->getConfig()[Engine::T_ENGINE]["templates"]);
|
||||
self::$engine->setCompileDir(__DIR__ . Config::getInstance()->getConfig()[Engine::T_ENGINE]["templates_c"]);
|
||||
self::$engine->setCacheDir(__DIR__ . Config::getInstance()->getConfig()[Engine::T_ENGINE]["cache"]);
|
||||
self::$engine->setConfigDir(__DIR__ . Config::getInstance()->getConfig()[Engine::T_ENGINE]["config_dir"]);
|
||||
self::$engine->assign('debuging', Config::getInstance()->getConfig()[Engine::T_ENGINE]["debugbar"]);
|
||||
break;
|
||||
case Engine::T_ENGINE_TWIG:
|
||||
@@ -100,4 +107,32 @@ class View extends Controller implements IView
|
||||
Controller::getInstance()->action( $this->getEngine(), $page );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $xmlPos
|
||||
*/
|
||||
protected function _setXmlPos( $xmlPos )
|
||||
{
|
||||
$this->xmlPos = $xmlPos;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getXmlPos( )
|
||||
{
|
||||
return $this->xmlPos;
|
||||
}
|
||||
|
||||
protected static function printStuffToScreen( $stuff, $die = false )
|
||||
{
|
||||
$output = "<pre>" . print_r( $stuff, true ) . "</pre>";
|
||||
if( $die )
|
||||
{
|
||||
die( $output );
|
||||
}
|
||||
else
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,11 @@
|
||||
* @license - BSD License
|
||||
*/
|
||||
session_start();
|
||||
/**
|
||||
* @desc Nibiru framework functionality
|
||||
* TODO: write a javascript controller handler
|
||||
* in order to be full scale compatible with limbas
|
||||
*/
|
||||
require_once __DIR__ . '/t/messages.php';
|
||||
require_once __DIR__ . '/c/settings.php';
|
||||
require_once __DIR__ . '/c/config.php';
|
||||
@@ -29,10 +34,29 @@ require_once __DIR__ . '/i/mysql.php';
|
||||
require_once __DIR__ . '/c/mysql.php';
|
||||
require_once __DIR__ . '/i/pdo.php';
|
||||
require_once __DIR__ . '/c/pdo.php';
|
||||
require_once __DIR__ . '/i/odbc.php';
|
||||
require_once __DIR__ . '/c/odbc.php';
|
||||
require_once __DIR__ . '/i/postgres.php';
|
||||
require_once __DIR__ . '/c/postgres.php';
|
||||
|
||||
/**
|
||||
* @desc currently unfinished
|
||||
*/
|
||||
require_once __DIR__ . '/i/soap.php';
|
||||
require_once __DIR__ . '/c/soap.php';
|
||||
require_once __DIR__ . '/i/auth.php';
|
||||
require_once __DIR__ . '/c/auth.php';
|
||||
/**
|
||||
* @desc main application starters
|
||||
*/
|
||||
require_once __DIR__ . '/c/debug.php';
|
||||
require_once __DIR__ . '/c/display.php';
|
||||
require_once __DIR__ . '/dispatch.php';
|
||||
/**
|
||||
* @desc Framework dispatch process
|
||||
* basic controller and action handling
|
||||
*/
|
||||
require_once __DIR__ . '/c/dispatcher.php';
|
||||
/**
|
||||
* @desc Run the framework no game no gain
|
||||
*/
|
||||
Nibiru\Dispatcher::getInstance()->run();
|
||||
16
core/i/odbc.php
Executable file
16
core/i/odbc.php
Executable file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: skasdorf
|
||||
* Date: 10.07.17
|
||||
* Time: 13:48
|
||||
*/
|
||||
|
||||
namespace Nibiru;
|
||||
|
||||
|
||||
interface IOdbc extends IMysql
|
||||
{
|
||||
const PLACE_READONLY = "readonly";
|
||||
const FILTER_COLUMN_NAME = "COLUMN_NAME";
|
||||
}
|
||||
71
core/i/postgres.php
Executable file
71
core/i/postgres.php
Executable file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
namespace Nibiru;
|
||||
/**
|
||||
* User - stephan
|
||||
* Date - 01.02.17
|
||||
* Time - 19:03
|
||||
* @author - alllinux.de GbR
|
||||
* @category - [PLEASE SPECIFIY]
|
||||
* @license - BSD License
|
||||
*/
|
||||
interface IPostgres
|
||||
{
|
||||
|
||||
/**
|
||||
* @desc returns the query by ressult
|
||||
* @param string $string
|
||||
*
|
||||
* @return array()
|
||||
*/
|
||||
public static function query( $string = IOdbc::PLACE_NO_QUERY );
|
||||
|
||||
/**
|
||||
* @desc returns the row by id
|
||||
* @param bool $id
|
||||
*
|
||||
* @return array()
|
||||
*/
|
||||
public static function fetchRowInArrayById( $tablename = IOdbc::PLACE_TABLE_NAME, $id = IOdbc::NO_ID );
|
||||
|
||||
/**
|
||||
* @desc returns row by column name and search parameter
|
||||
* @param string $tablename
|
||||
* @param string $column_name
|
||||
* @param IMysql $
|
||||
* @return mixed
|
||||
*/
|
||||
public static function fetchRowInArrayByWhere( $tablename = IOdbc::PLACE_TABLE_NAME,
|
||||
$column_name = IOdbc::PLACE_COLUMN_NAME,
|
||||
$parameter_name = IOdbc::PLACE_SEARCH_TERM );
|
||||
|
||||
/**
|
||||
* @desc will return the last inserted ID
|
||||
* @return integer
|
||||
*/
|
||||
public static function getLastInsertedID();
|
||||
|
||||
|
||||
/**
|
||||
* @desc fetch all fieldnames of the parameter tablename to an array
|
||||
* @param string $tablename
|
||||
* @return mixed
|
||||
*/
|
||||
public static function fetchTableFieldsAsArray( $tablename = IOdbc::PLACE_TABLE_NAME );
|
||||
|
||||
/**
|
||||
* @desc will return all entries from the selected tablename
|
||||
*
|
||||
* @param string $tablename
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function fetchTableAsArray( $tablename = IOdbc::PLACE_TABLE_NAME );
|
||||
|
||||
/**
|
||||
* @desc insert array content into database
|
||||
* @param string $tablename
|
||||
* @param string $array_name
|
||||
* @return mixed
|
||||
*/
|
||||
public static function insertArrayIntoTable( $tablename = IOdbc::PLACE_TABLE_NAME, $array_name = IOdbc::PLACE_ARRAY_NAME, $encrypted = IOdbc::PLACE_DES_ENCRYPT );
|
||||
}
|
||||
Reference in New Issue
Block a user