This commit is contained in:
therselman 2017-08-04 13:56:34 +02:00
parent 64273e1f1f
commit 4e58b42ce7
38 changed files with 46 additions and 32 deletions

15
HISTORY.md Normal file
View File

@ -0,0 +1,15 @@
17 July 2017: @ 3:30am - I implemented the \ArrayAccess syntactic suggar to SQL, it's taking readability to the next level!
16 July 2017: On this day, I was on the MyBatis website reading documentation on their `Dynamic SQL` and `SQL Builder Class`;
http://www.mybatis.org/mybatis-3/statement-builders.html
http://www.mybatis.org/mybatis-3/dynamic-sql.html
So I have begun the first steps in implementing the SQL class.
The really funny thing about all these Query builders is that they normally require MORE code than straight SQL, I hate them all!
@ 2:30pm I had the idea to incorporate my `builder` technique as well!
The MyBatis `Dynamic SQL` builder is somewhat similar to my `builder` technique, except it's in XML! Yuk!
Reading the Doctrine Data Mapping page (I hate Doctrine even more now), I have so much disrespect for it!
Why put `check constraints` in the Entity class? http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/basic-mapping.html#property-mapping
@ 4:15pm - BRAINSTORM! I had the idea to do `= new SQL().('My Additional Text here').().().('howdee doodee folks %s', $test).('WHERE id = :id', ['id' => 5]).('AND name = ?', $name)
OMG! I don't have to use sprintf() ... OMG ... I can add text DIRECTLY to the SQL('SELECT * FROM bla bla WHERE id = ', $id) ...

View File

@ -18,7 +18,7 @@
},
"autoload": {
"psr-4": {
"Twister\\": "src/",
"Twister\\": "src/Twister/",
"": "src/"
}
}

View File

@ -292,9 +292,9 @@ class Request
private function _get_args_from_params(array $params)
{
$byType = [ 'twister\container' => &$this->container,
'db' => &$this->db,
'request' => &$this,
// 'user' => &$this->container->user
'twister\db' => &$this->db,
'twister\user' => &$this->container->user,
'twister\request' => &$this
];
$args = [];
foreach ($params as $param)

View File

@ -1,15 +1,14 @@
<?php
namespace Twister;
dump('Starting session');
class Session
{
private static $_db = null;
function __construct(Db &$db)
{
dump('Starting session for real');
session_set_save_handler('Session::open', 'Session::close', 'Session::read', 'Session::write', 'Session::destroy', 'Session::gc');
session_set_save_handler('Twister\Session::open', 'Twister\Session::close', 'Twister\Session::read', 'Twister\Session::write', 'Twister\Session::destroy', 'Twister\Session::gc');
// register_shutdown_function('session_write_close');
session_set_cookie_params(0, '/', null, true, true);
self::$_db = $db;

View File

@ -81,7 +81,7 @@ class User
{
if (is_string($query_data)) $query_data = ['next' => $query_data];
$query_data['warning'] = 'Protected Area! Login with relevant permissions required!'; // <== TODO: Translate this!!! Or send a constant!
$this->container->request->redirect('/login', $query_data);
$this->container->request->redirect('/login?' . http_build_query($query_data));
}
return false;
}