My goal with vervPHP was to create a framework I could create applications in very quickly, without any excessive configuration or over the top framework.
Here's a link to the github, to see more: https://github.com/verv/vervPHP
And now, for some code examples to show how awesome (I think) it is:
index.php:
// Start the session:
session_start();
// Include the framework base:
include_once('framework/verv.php');
// Start the application:
$verv = new verv();
framework/verv.php
class verv {
// Variables:
public static $db;
public static $url;
public static $rq = array();
public static $lang = array();
public static $page = array();
public static $config = array();
public static $commands = array();
public static $framework = array();
/**
* Constructor. Do not call manually, unless your module extends verv.
*
* @return null
* @since 1.0
*/
public function __construct() {
// Parse the config:
self::$config = parse_ini_file('config.ini', true);
// Setup Language:
self::setLang();
// Connect to the database if required:
self::dbConnect();
// Prepare the request:
self::setRQ();
// Load the remaining framework:
self::loadFramework();
// Load the appropriate module:
self::loadModule(self::getCommand(0));
// Load the template:
self::loadTemplate();
// And finally, render the page:
self::renderPage();
}
// More functions follow...
What I'm hoping from a peer review:
- How can I improve my code (generally speaking)?
- Are there any glaring security holes that I should fix?
- I'm wanting to make this open source (for all the help I recieved on SO while making it) so I need to add an open source license to it - one that allows modification (preferrably with attribution) and allows for commercial development.
And yes, I am in the process of improving the actual documentation - it's pretty shocking (particularly the iCommand chaining) at the moment ;)