mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-05 04:37:51 +02:00
#431 general structure changes
This commit is contained in:
17
index.php
17
index.php
@@ -1,8 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of the Monstra.
|
||||
*
|
||||
* (c) Romanenko Sergey / Awilum <awilum@msn.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Monstra;
|
||||
|
||||
// Register the auto-loader.
|
||||
$loader = require __DIR__ . '/vendor/autoload.php';
|
||||
$autoload = __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
// Ensure vendor libraries exist
|
||||
!is_file($autoload) and exit("Please run: <i>composer install</i>");
|
||||
|
||||
// Register the auto-loader.
|
||||
$loader = require_once $autoload;
|
||||
|
||||
// Check PHP Version
|
||||
version_compare($ver = PHP_VERSION, $req = '7.1.3', '<') and exit(sprintf('You are running PHP %s, but Monstra needs at least <strong>PHP %s</strong> to run.', $ver, $req));
|
||||
|
@@ -62,10 +62,6 @@ class Monstra extends Container
|
||||
// Start the session
|
||||
//\Session::start();
|
||||
|
||||
$container['markdown'] = function ($c) {
|
||||
return new ParsedownExtra();
|
||||
};
|
||||
|
||||
$container['events'] = function ($c) {
|
||||
return new EventDispatcher();
|
||||
};
|
||||
@@ -80,6 +76,10 @@ class Monstra extends Container
|
||||
|
||||
$container['plugins']->init();
|
||||
|
||||
$container['markdown'] = function ($c) {
|
||||
return new ParsedownExtra();
|
||||
};
|
||||
|
||||
$container['pages'] = function ($c) {
|
||||
return new Pages($c);
|
||||
};
|
||||
|
@@ -25,4 +25,11 @@ class Themes
|
||||
$this->monstra = $c;
|
||||
}
|
||||
|
||||
public function getTemplate($template_name)
|
||||
{
|
||||
$template_ext = '.php';
|
||||
|
||||
include THEMES_PATH . '/' . $this->monstra['config']->get('site.theme') . '/' . $template_name . $template_ext;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user