Esempio n. 1
0
<?php

/**
 * @package		CleverStyle CMS
 * @author		Nazar Mokrynskyi <*****@*****.**>
 * @copyright	Copyright (c) 2011-2014, Nazar Mokrynskyi
 * @license		MIT License, see license.txt
 */
namespace cs;

require CORE . '/thirdparty/upf.php';
//Inclusion of Useful PHP Functions
_require_once(DIR . '/vendor/autoload.php', false);
//Inclusion of composer's autoloader.php with user's dependencies
require CORE . '/functions.php';
//Inclusion of general system functions and system autoloader
error_reporting(E_ALL);
header('Content-Type: text/html; charset=utf-8');
header('Vary: Content-Language,User-Agent,Cookie');
mb_internal_encoding('utf-8');
header('Connection: close');
/**
 * Defining of basic constants with paths to system directories
 */
/**
 * Directory for configuration
 */
define('CONFIG', DIR . '/config');
/**
 * Directory for main core classes
 */
Esempio n. 2
0
<?php

/**
 * @package        OAuth2 customization
 * @category       plugins
 * @author         Nazar Mokrynskyi <*****@*****.**>
 * @copyright      Copyright (c) 2014, Nazar Mokrynskyi
 * @license        MIT License, see license.txt
 */
namespace cs\custom\modules\OAuth2;

use cs\modules\OAuth2\OAuth2 as OAuth2_original;
_require_once(MODULES . '/OAuth2/OAuth2.php', false);
class OAuth2 extends OAuth2_original
{
    /**
     * Check granted access for specified client
     *
     * @param int      $client
     * @param bool|int $user If not specified - current user assumed
     *
     * @return bool
     */
    function get_access($client, $user = false)
    {
        return true;
    }
}
Esempio n. 3
0
        $cache = file_exists(CACHE . '/classes_autoloading') ? file_get_json(CACHE . '/classes_autoloading') : [];
    }
    if (isset($cache[$class])) {
        return require_once $cache[$class];
    }
    $prepared_class_name = ltrim($class, '\\');
    if (substr($prepared_class_name, 0, 3) == 'cs\\') {
        $prepared_class_name = substr($prepared_class_name, 3);
    }
    $prepared_class_name = explode('\\', $prepared_class_name);
    $namespace = count($prepared_class_name) > 1 ? implode('/', array_slice($prepared_class_name, 0, -1)) : '';
    $class_name = array_pop($prepared_class_name);
    /**
     * Try to load classes from different places. If not found in one place - try in another.
     */
    if (_require_once($file = CLASSES . "/{$namespace}/{$class_name}.php", false) || _require_once($file = THIRDPARTY . "/{$namespace}/{$class_name}.php", false) || _require_once($file = TRAITS . "/{$namespace}/{$class_name}.php", false) || _require_once($file = ENGINES . "/{$namespace}/{$class_name}.php", false) || _require_once($file = MODULES . "/../{$namespace}/{$class_name}.php", false)) {
        $cache[$class] = realpath($file);
        file_put_json(CACHE . '/classes_autoloading', $cache);
        return true;
    }
    return false;
}, true, true);
/**
 * Correct termination
 */
register_shutdown_function(function () {
    if (!class_exists('\\cs\\Core', false)) {
        return;
    }
    Index::instance(true)->__finish();
    Page::instance()->__finish();