Core - Simple MVC framework [PHP 7, PDO, Prepared Statements]

Status
Not open for further replies.

M8than

yes
Mar 16, 2012
463
102
Core is a framework I've been working on in my free time to help me build personal projects.

Features:
- MVC (obviously)
- Templating Engine (caching, inline template-logic, proper inheritance)
- Simple Router
- PDO wrapper (uses prepared statements)
- Example User Model

The source code should be easy to understand.
Any questions or feedback would be appreciated
 
Last edited:

griimnak

You're a slave to the money then you die
Jul 20, 2013
955
794
Damn fella, I take it you main php?
The router is especially nice because i didn't know how to go about a good scratch one when I was using php.
Clean and intelligent by the looks of it, good job
 

M8than

yes
Mar 16, 2012
463
102
Thanks, I tried to create my router without using regex.
And PHP is my main language yeah
 
Thanks to everyone in the shoutbox being so kind as to giving me some constructive criticism and some flame. I've updated some shit and im gonna go jump off a bridge also. cya in a bit
 

Weasel

👄 I'd intercept me
Nov 25, 2011
4,128
2,456
Moved and cleaned the thread. Don't take flame on here too seriously, everyone has a starting point and feedback is a great way to improve yourself. If someone flames - try to turn it in to something constructive for yourself, or let them be and report the post. Never let people discourage you. Always keep on learning and keep on trying. People tend to forget they also started off as some shitty programmers who had a hard time understanding CuteNews (for example).
 

M8than

yes
Mar 16, 2012
463
102
Moved and cleaned the thread. Don't take flame on here too seriously, everyone has a starting point and feedback is a great way to improve yourself. If someone flames - try to turn it in to something constructive for yourself, or let them be and report the post. Never let people discourage you. Always keep on learning and keep on trying. People tend to forget they also started off as some shitty programmers who had a hard time understanding CuteNews (for example).

Don't worry mate its just a bit of banter. I'm not taking it too seriously, I promise
 
Done some namespace update.
Bit rough around the edges, hmu if you got any suggestions.
 

griimnak

You're a slave to the money then you die
Jul 20, 2013
955
794
The structure is pretty nice, I like the template engine the most


Template engine's replaces are reminiscent of how jinja2 does it.
The pdo, a real man uses pdo. very good
Personally i don't fancy the Upper-casing on the structure dirs/files but a php aesthetic thing i presume.

And your registry idea is pretty cool, i don't think I get it 100% but i get the picture
->

Continue to polish this, it's pretty light and by the looks of it pretty fast as well. If I still used php i'd probably use this framework as I don't like to get down with big frameworks like codeigniter laravel etc, good job
 

M8than

yes
Mar 16, 2012
463
102
The structure is pretty nice, I like the template engine the most


Template engine's replaces are reminiscent of how jinja2 does it.
The pdo, a real man uses pdo. very good
Personally i don't fancy the Upper-casing on the structure dirs/files but a php aesthetic thing i presume.

And your registry idea is pretty cool, i don't think I get it 100% but i get the picture
->

Continue to polish this, it's pretty light and by the looks of it pretty fast as well. If I still used php i'd probably use this framework as I don't like to get down with big frameworks like codeigniter laravel etc, good job
Thanks griimnak. Just added some simple performance logging and changed the template logic to use '{#' and '#}' instead of '{{' and '}}'.



 
Added new function return cache.
- Will probably make it possible to do this by db at a later date.

Also updated code and moved more logic to the index file to make it easier to pick and choose what to use.
 

griimnak

You're a slave to the money then you die
Jul 20, 2013
955
794
I tested the cache with return strings and mysql queries, the results below prove that the cache system is actually effective.

Live demo:

Return strings
Initial site load:
Y8PSkDkXQiOrztSSCbKgGg.png


TRIGGERED ->
DATA CACHED FOR 30 SECONDS, beats live-data time

Gq5nZfpVTUqL3DXR4elkAw.png


Code used:
KMrYCSa4QtOgVoVbYXc5Kg.png


Hcq1p6e3SHKG9PLHvab2yw.png



MySQL
Initial site load:
RHBlgSkJRSOj6WeHAQKcig.png


TRIGGERED ->
DATA CACHED FOR 30 SECONDS, beats live-mysql time

BR_qdVzsSYSgnrmrn4IIIA.png



Code used:
Controller
7uT_g80nQ12W1LW5jF_f4w.png


Model
ir9sIOdJTqKN5di9n9mSHw.png


View
vg5VvY8QRYyt4VvraKWRXg.png


while cache is ticking:
5EhpT6N0QDSv18FHJCAlYg.png


RMK3vzizSTCkBdpq2f26nQ.png



z_LXxQqiR4a6GhkoM0nbwQ.png


Nicely done
 
Basic docs are online and running on Core if anyone needs:
 

M8than

yes
Mar 16, 2012
463
102
Closing this project. Something bigger and better is coming (and more compliant with the PHP-FIG PSRs)
 
Status
Not open for further replies.

Users who are viewing this thread

Top