diff --git a/README.md b/README.md index ad015a4..f959d7b 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,10 @@ ## Requirements -- PHP 5.5.0 or newer -- A database engine compatible with your PHP install and Laravel/Illuminate's database abstraction layer. +- PHP 7.0.0 or newer +- A database engine compatible with your PHP install and Laravel/Illuminate's database abstraction layer, MySQL 5.7 recommended. -_these will likely update in the future because i'm planning to go php 7 only_ +I will include a full list of required extensions later. ## Contributing diff --git a/composer.json b/composer.json index ba3f33a..45853f2 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "issues": "https://github.com/flashwave/sakura/issues" }, "require": { - "php": ">=5.5.0", + "php": ">=7.0.0", "ext-curl": "*", "ext-json": "*", "twig/twig": "*", diff --git a/libraries/Template.php b/libraries/Template.php index b18b222..e11d177 100644 --- a/libraries/Template.php +++ b/libraries/Template.php @@ -104,6 +104,8 @@ class Template self::$template->addFunction(new Twig_SimpleFunction('route', function ($name, $args = null) { return Router::route($name, $args); })); + + self::$template->addFunction(new Twig_SimpleFunction('session_id', 'session_id')); } /** diff --git a/public/settings.php b/public/settings.php index 4963448..3975d00 100644 --- a/public/settings.php +++ b/public/settings.php @@ -9,6 +9,9 @@ namespace Sakura; use Sakura\Perms\Site; use Sakura\Router; +// Legacy support!!!!!!!!! +$renderData = []; + // If this we're requesting notifications this page won't require templating if (isset($_REQUEST['request-notifications']) && $_REQUEST['request-notifications']) { define('SAKURA_NO_TPL', true); diff --git a/sakura.php b/sakura.php index f27a147..4fe1eb8 100644 --- a/sakura.php +++ b/sakura.php @@ -23,9 +23,9 @@ set_time_limit(0); // Set internal encoding method mb_internal_encoding('utf-8'); -// Stop the execution if the PHP Version is older than 5.5.0 -if (version_compare(phpversion(), '5.5.0', '<')) { - throw new \Exception('Sakura requires at least PHP 5.5.0, please upgrade to a newer PHP version.'); +// Stop the execution if the PHP Version is older than 7.0.0 +if (version_compare(phpversion(), '7.0.0', '<')) { + throw new \Exception('Sakura requires at least PHP 7.0.0, please upgrade to a newer PHP version.'); } // Check if the composer autoloader exists @@ -162,16 +162,10 @@ if (!defined('SAKURA_NO_TPL')) { 'forumTextMaxLength' => Config::get('forum_text_max'), 'forumTextMinLength' => Config::get('forum_text_min'), ], - 'php' => [ - 'sessionid' => \session_id(), - 'time' => \time(), - 'self' => $_SERVER['PHP_SELF'], - ], 'session' => array_merge([ 'checkLogin' => $authCheck, 'sessionId' => $authCheck[1], - 'userId' => $authCheck[0], ], $_SESSION), 'user' => $currentUser, @@ -183,9 +177,6 @@ if (!defined('SAKURA_NO_TPL')) { 'server' => $_SERVER, ]); - // Add the default render data - $renderData = []; - // Site closing if (Config::get('site_closed')) { // Set parse variables diff --git a/templates/misaki/global/master.twig b/templates/misaki/global/master.twig index 89e9669..daff41b 100644 --- a/templates/misaki/global/master.twig +++ b/templates/misaki/global/master.twig @@ -108,7 +108,7 @@