<?php require_once 'config.php'; $user = new \Lib\User(); $twitter = new \Lib\Twitter(); $db = new \Lib\Db($dbFile); $dao = new \Lib\Dao(); $dao->setDb($db); $page = isset($_GET['page']) ? strip_tags($_GET['page']) : ''; $param = isset($_GET['param']) ? strip_tags($_GET['param']) : 0; $template = null; $vars = array(); $baseUrl = 'http://' . $_SERVER['HTTP_HOST']; // Default meta data $metadata = array('ogTitle' => 'Lolgh', 'ogType' => 'website', 'ogImage' => $baseUrl . '/img/icon.png', 'ogUrl' => $baseUrl, 'ogDescription' => 'The LolGH strips are typically random and unordered strips depicting some isolated, stupid and funny events in Ghana, Africa and the world. Just jokes really!!! :)', 'twitterCard' => 'summary', 'twitterUrl' => $baseUrl, 'twitterTitle' => 'LolGH', 'twitterDescription' => 'The LolGH strips are typically random and unordered strips depicting some isolated, stupid and funny events in Ghana, Africa and the world. Just jokes really!!! :)', 'twitterImage' => $baseUrl . '/img/icon.png'); // Frontend Controller switch ($page) { case '': // Custom meta data $pageUrl = $baseUrl; $recentToon = $dao->fetchRecentToon(); $recentComic = $dao->fetchRecentComic(); $template = '@frontend/index.html'; $vars['pageTitle'] = 'A laugh a day...'; $vars['tweets'] = $twitter->getTimeLine(); $vars['recentToon'] = $recentToon; $vars['recentComic'] = $recentComic; break; case 'contact': if ($_POST) { $subject = 'Lolgh Contact';
<?php /** * Created by PhpStorm. * User: manny * Date: 07/11/14 * Time: 15:04 */ require_once '../config.php'; $db = new \Lib\Db($dbFile); $dao = new \Lib\Dao(); $dao->setDb($db); $twitter = new \Lib\Twitter(); $api = new \Lib\Api(); $api->setDao($dao); $api->setTwitter($twitter); $method = $_SERVER['REQUEST_METHOD']; $params = explode('/', rtrim($_SERVER['REQUEST_URI'], '/')); $api->setMethod($method)->setParams($params)->processApi();