Seriosk
Programmer;
- Oct 29, 2016
- 256
- 105
GreekCMS
Hello. I am here again with a brand new development. I am here today to announce a new HabboCMS in the development which I am working on. I know many of the users here wont even use it as they like RevCMS and the simplicity of it, how it works, and how easy it is to alter things. Also, many people on this forum have got used to how it works after using it for years on end, but I feel like my CMS can bring that Simplicity to the community, with all the features that you need.
What happens when you want to extend the functionality of RevCMS? You have to go into the core, add it, and sometimes you don't even know where to put if if your an inexperienced developer, or how to even code it. GreekCMS brings you all the features you could ever want, with blazing fast speed.
Tell me more about the Blazing Speed?
It uses Propel, a blazing fast PHP ORM, in User-Friendly terms, its a database library that's super fast, and super flexible if you ever need to change it. It also uses Twig Template Engine which is known to be the fastest, and FastRoute, clue is in the name.
Why should I even be interested, whats different?
Your library's are known to be the most advanced, how are you bringing simplicity?
The library's will all have what I like to call 'Controllers' which are a way of easily removing, extending and modifying existing functionality with advanced library's, don't take it as an actual 'Controller', it isn't a controller. I could simply create a Framework, throw it out there and tell you to use it, but I know that wouldn't benefit most users on this forum. With Greek, developers AND new developers can use, modify, extend, and easily use this CMS.
Code Area
Once more has been done, I'll implement MonoLog and other things.
Hello. I am here again with a brand new development. I am here today to announce a new HabboCMS in the development which I am working on. I know many of the users here wont even use it as they like RevCMS and the simplicity of it, how it works, and how easy it is to alter things. Also, many people on this forum have got used to how it works after using it for years on end, but I feel like my CMS can bring that Simplicity to the community, with all the features that you need.
What happens when you want to extend the functionality of RevCMS? You have to go into the core, add it, and sometimes you don't even know where to put if if your an inexperienced developer, or how to even code it. GreekCMS brings you all the features you could ever want, with blazing fast speed.
Tell me more about the Blazing Speed?
It uses Propel, a blazing fast PHP ORM, in User-Friendly terms, its a database library that's super fast, and super flexible if you ever need to change it. It also uses Twig Template Engine which is known to be the fastest, and FastRoute, clue is in the name.
Why should I even be interested, whats different?
- Dependency Injection
- Organised Structure
- Goodbye Global
Your library's are known to be the most advanced, how are you bringing simplicity?
The library's will all have what I like to call 'Controllers' which are a way of easily removing, extending and modifying existing functionality with advanced library's, don't take it as an actual 'Controller', it isn't a controller. I could simply create a Framework, throw it out there and tell you to use it, but I know that wouldn't benefit most users on this forum. With Greek, developers AND new developers can use, modify, extend, and easily use this CMS.
Code Area
Index.php:
Bootstrap.php:
Composer.Json:
Dependencies.php:
Routes:
Code:
<?php
declare(strict_types = 1);
require __DIR__ . '/../src/Bootstrap.php';
Bootstrap.php:
Code:
<?php
declare(strict_types = 1);
namespace Greek;
require __DIR__ . '/../vendor/autoload.php';
error_reporting(E_ALL);
$environment = 'development';
$whoops = new \Whoops\Run;
if ($environment !== 'production') {
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
} else {
$whoops->pushHandler(function($e){
echo 'Todo: Friendly error page and send an email to the developer';
});
}
$whoops->register();
$injector = include('Dependencies.php');
$request = $injector->make('Http\HttpRequest');
$response = $injector->make('Http\HttpResponse');
foreach ($response->getHeaders() as $header) {
header($header, false);
}
$routeDefinitionCallback = function (\FastRoute\RouteCollector $r) {
$routes = include('Routes.php');
foreach ($routes as $route) {
$r->addRoute($route[0], $route[1], $route[2]);
}
};
$dispatcher = \FastRoute\simpleDispatcher($routeDefinitionCallback);
$routeInfo = $dispatcher->dispatch($request->getMethod(), $request->getPath());
switch ($routeInfo[0]) {
case \FastRoute\Dispatcher::NOT_FOUND:
$response->setContent('404 - Page not found');
$response->setStatusCode(404);
break;
case \FastRoute\Dispatcher::METHOD_NOT_ALLOWED:
$response->setContent('405 - Method not allowed');
$response->setStatusCode(405);
break;
case \FastRoute\Dispatcher::FOUND:
$className = $routeInfo[1][0];
$method = $routeInfo[1][1];
$vars = $routeInfo[2];
$class = $injector->make($className);
$class->$method($vars);
break;
}
foreach ($response->getHeaders() as $header) {
header($header, false);
}
echo $response->getContent();
Composer.Json:
Code:
{
"name": "Greek CMS",
"description": "A simple content management system for Habbo.",
"keywords": ["Your keyword", "Another keyword"],
"license": "MIT",
"authors": [
{
"name": "Seriosk",
"email": "[email protected]",
"role": "Creator / Main Developer"
}
],
"require": {
"php": ">=7.0.0",
"filp/whoops": "~2.1",
"patricklouys/http": "~1.4",
"nikic/fast-route": "^1.2",
"rdlowrey/auryn": "^1.4",
"twig/twig": "^2.2",
"propel/propel": "~2.0@dev"
},
"autoload": {
"psr-4": {
"Greek\\": "src/"
}
}
}
Dependencies.php:
Code:
<?php
declare(strict_types = 1);
$injector = new \Auryn\Injector;
$injector->alias('Http\Request', 'Http\HttpRequest');
$injector->share('Http\HttpRequest');
$injector->define('Http\HttpRequest', [
':get' => $_GET,
':post' => $_POST,
':cookies' => $_COOKIE,
':files' => $_FILES,
':server' => $_SERVER,
]);
$injector->alias('Http\Response', 'Http\HttpResponse');
$injector->share('Http\HttpResponse');
$injector->alias('Greek\Template\Renderer', 'Greek\Template\TwigRenderer');
$injector->alias('Greek\Template\FrontendRenderer', 'Greek\Template\FrontendTwigRenderer');
$injector->delegate('Twig_Environment', function () use ($injector) {
$loader = new Twig_Loader_Filesystem(dirname(__DIR__) . '/templates');
$twig = new Twig_Environment($loader);
return $twig;
});
$injector->define('Greek\Page\FilePageReader', [
':pageFolder' => __DIR__ . '/../pages',
]);
$injector->alias('Greek\Page\PageReader', 'Greek\Page\FilePageReader');
$injector->share('Greek\Page\FilePageReader');
$injector->alias('Greek\Menu\MenuReader', 'Greek\Menu\ArrayMenuReader');
$injector->share('Greek\Menu\ArrayMenuReader');
return $injector;
Routes:
Code:
<?php
declare(strict_types = 1);
return [
['GET', '/hello', ['Greek\Handlers\HomeController', 'show']],
['GET', '/{slug}', ['Greek\Handlers\PageController', 'show']],
];
Once more has been done, I'll implement MonoLog and other things.
Last edited: