therselman 7 years ago
parent
commit
4e58b42ce7
  1. 15
      HISTORY.md
  2. 50
      composer.json
  3. 0
      src/Twister/Assets.php
  4. 0
      src/Twister/Collection.php
  5. 0
      src/Twister/Container.php
  6. 0
      src/Twister/ContainerAwareTrait.php
  7. 0
      src/Twister/ContainerInterface.php
  8. 0
      src/Twister/Controller.php
  9. 0
      src/Twister/Css.php
  10. 0
      src/Twister/Db.php
  11. 0
      src/Twister/Duo.php
  12. 0
      src/Twister/Entity.php
  13. 0
      src/Twister/ExceptionHandler.php
  14. 0
      src/Twister/Lang.php
  15. 0
      src/Twister/Mb.php
  16. 6
      src/Twister/Request.php
  17. 0
      src/Twister/Response.php
  18. 0
      src/Twister/S.php
  19. 0
      src/Twister/Schema/Model.php
  20. 0
      src/Twister/Schema/Schema.php
  21. 0
      src/Twister/Schema/Table.php
  22. 0
      src/Twister/Schema/Types/ArrayType.php
  23. 0
      src/Twister/Schema/Types/BaseType.php
  24. 0
      src/Twister/Schema/Types/BinaryType.php
  25. 0
      src/Twister/Schema/Types/DateType.php
  26. 0
      src/Twister/Schema/Types/EnumType.php
  27. 0
      src/Twister/Schema/Types/FloatType.php
  28. 0
      src/Twister/Schema/Types/IntegerType.php
  29. 0
      src/Twister/Schema/Types/SetType.php
  30. 0
      src/Twister/Schema/Types/StringType.php
  31. 0
      src/Twister/Schema/Types/Type.php
  32. 0
      src/Twister/Schema/composer.json
  33. 5
      src/Twister/Session.php
  34. 0
      src/Twister/Str.php
  35. 0
      src/Twister/Uri.php
  36. 2
      src/Twister/User.php
  37. 0
      src/Twister/Utf8.php
  38. 0
      src/Twister/Validation.php

15
HISTORY.md

@ -0,0 +1,15 @@ @@ -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) ...

50
composer.json

@ -1,25 +1,25 @@ @@ -1,25 +1,25 @@
{
"name": "twister/twister",
"description": "Twister - micro-framework component library",
"keywords": ["framework", "micro-framework", "library", "router"],
"type": "library",
"homepage": "https://github.com/twister-php/twister/",
"license": "MIT",
"authors": [
{
"name": "Trevor Herselman",
"email": "therselman@gmail.com"
}
],
"require": {
"php": ">=5.6",
"psr/http-message": "^1.0",
"twister/sql": "*"
},
"autoload": {
"psr-4": {
"Twister\\": "src/",
"": "src/"
}
}
}
{
"name": "twister/twister",
"description": "Twister - micro-framework component library",
"keywords": ["framework", "micro-framework", "library", "router"],
"type": "library",
"homepage": "https://github.com/twister-php/twister/",
"license": "MIT",
"authors": [
{
"name": "Trevor Herselman",
"email": "therselman@gmail.com"
}
],
"require": {
"php": ">=5.6",
"psr/http-message": "^1.0",
"twister/sql": "*"
},
"autoload": {
"psr-4": {
"Twister\\": "src/Twister/",
"": "src/"
}
}
}

0
src/Assets.php → src/Twister/Assets.php

0
src/Collection.php → src/Twister/Collection.php

0
src/Container.php → src/Twister/Container.php

0
src/ContainerAwareTrait.php → src/Twister/ContainerAwareTrait.php

0
src/ContainerInterface.php → src/Twister/ContainerInterface.php

0
src/Controller.php → src/Twister/Controller.php

0
src/Css.php → src/Twister/Css.php

0
src/Db.php → src/Twister/Db.php

0
src/Duo.php → src/Twister/Duo.php

0
src/Entity.php → src/Twister/Entity.php

0
src/ExceptionHandler.php → src/Twister/ExceptionHandler.php

0
src/Lang.php → src/Twister/Lang.php

0
src/Mb.php → src/Twister/Mb.php

6
src/Request.php → src/Twister/Request.php

@ -292,9 +292,9 @@ class Request @@ -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)

0
src/Response.php → src/Twister/Response.php

0
src/S.php → src/Twister/S.php

0
src/Schema/Model.php → src/Twister/Schema/Model.php

0
src/Schema/Schema.php → src/Twister/Schema/Schema.php

0
src/Schema/Table.php → src/Twister/Schema/Table.php

0
src/Schema/Types/ArrayType.php → src/Twister/Schema/Types/ArrayType.php

0
src/Schema/Types/BaseType.php → src/Twister/Schema/Types/BaseType.php

0
src/Schema/Types/BinaryType.php → src/Twister/Schema/Types/BinaryType.php

0
src/Schema/Types/DateType.php → src/Twister/Schema/Types/DateType.php

0
src/Schema/Types/EnumType.php → src/Twister/Schema/Types/EnumType.php

0
src/Schema/Types/FloatType.php → src/Twister/Schema/Types/FloatType.php

0
src/Schema/Types/IntegerType.php → src/Twister/Schema/Types/IntegerType.php

0
src/Schema/Types/SetType.php → src/Twister/Schema/Types/SetType.php

0
src/Schema/Types/StringType.php → src/Twister/Schema/Types/StringType.php

0
src/Schema/Types/Type.php → src/Twister/Schema/Types/Type.php

0
src/Schema/composer.json → src/Twister/Schema/composer.json

5
src/Session.php → src/Twister/Session.php

@ -1,15 +1,14 @@ @@ -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;

0
src/Str.php → src/Twister/Str.php

0
src/Uri.php → src/Twister/Uri.php

2
src/User.php → src/Twister/User.php

@ -81,7 +81,7 @@ class User @@ -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;
}

0
src/Utf8.php → src/Twister/Utf8.php

0
src/Validation.php → src/Twister/Validation.php

Loading…
Cancel
Save