Example #1
0
function autol_moduleContent($name)
{
    $settings = Graphene::getInstance()->getSettings();
    $modPath = $settings['modulesUrl'];
    $name = str_replace('\\', '/', $name);
    $filename = $modPath . "/" . $name . ".php";
    if (is_readable(G_path($filename))) {
        G_Require($filename);
    }
}
Example #2
0
<?php

date_default_timezone_set('Europe/Rome');
/** @noinspection PhpIncludeInspection */
require_once G_path('utils/Settings.php');
/** @noinspection PhpIncludeInspection */
require_once G_path('utils/Log.php');
G_Require('utils/autoloaders.php');
Settings::getInstance();
Log::setUp();
function G_path($path)
{
    if (is_absolute_path($path) && is_readable($path)) {
        return $path;
    } else {
        $basePath = dirname(dirname(__FILE__));
        if ($path !== '' && !strpos($path, DIRECTORY_SEPARATOR === 0)) {
            $path = DIRECTORY_SEPARATOR . $path;
        } else {
            if ($path === null) {
                $path = '';
            }
        }
        $splPath = explode(DIRECTORY_SEPARATOR, $path);
        $splBase = explode(DIRECTORY_SEPARATOR, $basePath);
        $retBase = join(DIRECTORY_SEPARATOR, $splBase);
        $retPath = join(DIRECTORY_SEPARATOR, $splPath);
        return $retBase . $retPath;
    }
}
function G_Require($path)