Core
in package
Core
Tags
Table of Contents
Properties
- $config : Core_Config
- Core_Config object
- $log : Core_Log
- Core_Log object
- $mainConfig : array<string|int, mixed>
- Main config located /modules/core/config/config.php
- $modulesList : array<string|int, mixed>
- List of modules, key $oModule->path, value $oModule
- $modulesPath : string
- Modules path, e.g. CMS_FOLDER . 'modules' . DIRECTORY_SEPARATOR
- $url : array<string|int, mixed>
- Fragments of URL path
- $_autoloadCache : array<string|int, mixed>
- _autoload cache
- $_init : mixed
- Core::init() has been called
- $_lng : mixed
- Site LNG
- $_loadModuleTime : mixed
- Load Module Time
- $_logged : null|bool
- User Logged
Methods
- _() : string
- Returns a string produced according to the formatting string $key.
- _autoload() : mixed
- Callback function
- _error() : mixed
- Callback function
- _exception() : mixed
- Callback function
- _shutdown() : mixed
- Callback function
- checkBot() : bool
- Проверка user-agent на принадлежность к ботам
- checkPanel() : bool
- Checks if admin panel is possible to show
- convert64b32() : int
- 64 bit to 32
- crc32() : int
- Get CRC32 from source string
- cutRootPath() : string
- Cut CMS_FOLDER from $path
- debugBacktrace() : array<string|int, mixed>
- Get debug trace
- deinit() : mixed
- Deinitialization
- factory() : mixed
- Create class $className
- generateUniqueId() : string
- Generate an unique ID
- getCallableName() : string
- Get callable name
- getClassPath() : string
- Get path to class file by class name
- getClientIp() : string
- Get Real Client Ip
- getLng() : string
- Get Site Language
- getLoadModuleTime() : float
- Get Load Module Time
- getmicrotime() : float
- Get microtime
- getPcreVersion() : string
- Get PCRE version
- getVersion() : string
- Get HostCMS Version
- httpsUses() : bool
- Checks if HTTPS is used
- init() : bool
- Initialization
- initConstants() : mixed
- Initialize constants for site
- isFunctionEnable() : bool
- Checks if function $function_name is enabled
- isIIS() : bool
- Check if server is Microsoft IIS
- isInit() : bool
- Check if self::init() has been called
- mainConfig() : mixed
- Load configuration for core
- moduleIsActive() : bool
- Checks if module exists and is active
- parseUrl() : array<string|int, mixed>
- Parse URL and set controller properties
- registerCallbackFunction() : mixed
- Register all callback functions
- setCookie() : mixed
- Set cookie
- setLng() : mixed
- Set Site Language
- setModulesPath() : mixed
- Set path to the modules
- showJson() : mixed
- Show headers and JSON
- xPoweredBy() : string
- Get HostCMS fingerprint
- _loadModuleList() : mixed
- Load modules list
Properties
$config
Core_Config object
public
static Core_Config
$config
= \NULL
$log
Core_Log object
public
static Core_Log
$log
= \NULL
$mainConfig
Main config located /modules/core/config/config.php
public
static array<string|int, mixed>
$mainConfig
= array()
$modulesList
List of modules, key $oModule->path, value $oModule
public
static array<string|int, mixed>
$modulesList
= array()
$modulesPath
Modules path, e.g. CMS_FOLDER . 'modules' . DIRECTORY_SEPARATOR
public
static string
$modulesPath
= \NULL
$url
Fragments of URL path
public
static array<string|int, mixed>
$url
= array('scheme' => '', 'host' => '', 'port' => '', 'user' => '', 'pass' => '', 'path' => '', 'query' => '', 'fragment' => '')
$_autoloadCache
_autoload cache
protected
static array<string|int, mixed>
$_autoloadCache
= array()
$_init
Core::init() has been called
protected
static mixed
$_init
= \NULL
$_lng
Site LNG
protected
static mixed
$_lng
= \NULL
$_loadModuleTime
Load Module Time
protected
static mixed
$_loadModuleTime
= 0
$_logged
User Logged
protected
static null|bool
$_logged
= \NULL
Methods
_()
Returns a string produced according to the formatting string $key.
public
static _(string $key) : string
Parameters
- $key : string
-
source string
Tags
Return values
string_autoload()
Callback function
public
static _autoload(string $class) : mixed
Parameters
- $class : string
-
path to class file
_error()
Callback function
public
static _error(int $errno, string $msg, string $file, int $line) : mixed
Parameters
- $errno : int
-
код ошибки - E_ERROR и т.д.
- $msg : string
-
сообщение об ошбике
- $file : string
-
имя файла, в котором произошла ошибка
- $line : int
-
строка, в котором произошла ошибка
_exception()
Callback function
public
static _exception(Exception $exception) : mixed
Parameters
- $exception : Exception
_shutdown()
Callback function
public
static _shutdown() : mixed
checkBot()
Проверка user-agent на принадлежность к ботам
public
static checkBot(string $agent) : bool
Parameters
- $agent : string
-
user-agent
Return values
bool —
$is_bot = Core::checkBot($agent);
// Распечатаем результат
var_dump($is_bot);
?>
checkPanel()
Checks if admin panel is possible to show
public
static checkPanel() : bool
Return values
boolconvert64b32()
64 bit to 32
public
static convert64b32(int $int) : int
Parameters
- $int : int
Return values
intcrc32()
Get CRC32 from source string
public
static crc32(string $value) : int
Parameters
- $value : string
-
value
Return values
intcutRootPath()
Cut CMS_FOLDER from $path
public
static cutRootPath(string $path) : string
Parameters
- $path : string
-
path
Return values
stringdebugBacktrace()
Get debug trace
public
static debugBacktrace() : array<string|int, mixed>
Return values
array<string|int, mixed>deinit()
Deinitialization
public
static deinit() : mixed
factory()
Create class $className
public
static factory(string $className) : mixed
Parameters
- $className : string
-
class name
generateUniqueId()
Generate an unique ID
public
static generateUniqueId([int $bytes = 16 ]) : string
Parameters
- $bytes : int = 16
-
default 16
Return values
stringgetCallableName()
Get callable name
public
static getCallableName(callable|object $callable) : string
Parameters
- $callable : callable|object
Return values
stringgetClassPath()
Get path to class file by class name
public
static getClassPath(string $class) : string
Parameters
- $class : string
-
name of the class
Return values
stringgetClientIp()
Get Real Client Ip
public
static getClientIp() : string
Return values
stringgetLng()
Get Site Language
public
static getLng() : string
Return values
stringgetLoadModuleTime()
Get Load Module Time
public
static getLoadModuleTime() : float
Return values
floatgetmicrotime()
Get microtime
public
static getmicrotime() : float
Return values
floatgetPcreVersion()
Get PCRE version
public
static getPcreVersion() : string
Return values
stringgetVersion()
Get HostCMS Version
public
static getVersion() : string
Return values
stringhttpsUses()
Checks if HTTPS is used
public
static httpsUses() : bool
Return values
boolinit()
Initialization
public
static init() : bool
Return values
boolinitConstants()
Initialize constants for site
public
static initConstants(Site_Model $oSite) : mixed
Parameters
- $oSite : Site_Model
-
site
Tags
isFunctionEnable()
Checks if function $function_name is enabled
public
static isFunctionEnable(string $function_name) : bool
Parameters
- $function_name : string
-
name of the function
Return values
boolisIIS()
Check if server is Microsoft IIS
public
static isIIS() : bool
Return values
boolisInit()
Check if self::init() has been called
public
static isInit() : bool
Return values
boolmainConfig()
Load configuration for core
public
static mainConfig() : mixed
moduleIsActive()
Checks if module exists and is active
public
static moduleIsActive(string $moduleName) : bool
Parameters
- $moduleName : string
-
module name
Return values
boolparseUrl()
Parse URL and set controller properties
public
static parseUrl() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —Core::$url
registerCallbackFunction()
Register all callback functions
public
static registerCallbackFunction() : mixed
setCookie()
Set cookie
public
static setCookie(string $name, string $value[, int $expire = 0 ][, string $path = '' ][, string $domain = '' ][, bool $secure = FALSE ][, bool $httponly = FALSE ][, bool $replace = FALSE ]) : mixed
Parameters
- $name : string
-
cookie name
- $value : string
-
cookie value
- $expire : int = 0
-
cookie expire date
- $path : string = ''
-
cookie path
- $domain : string = ''
-
cookie domain
- $secure : bool = FALSE
-
cookie secure
- $httponly : bool = FALSE
-
http only
- $replace : bool = FALSE
-
replace exists cookie
setLng()
Set Site Language
public
static setLng(sting $lng) : mixed
Parameters
- $lng : sting
setModulesPath()
Set path to the modules
public
static setModulesPath() : mixed
showJson()
Show headers and JSON
public
static showJson(mixed $content) : mixed
Parameters
- $content : mixed
xPoweredBy()
Get HostCMS fingerprint
public
static xPoweredBy() : string
Return values
string_loadModuleList()
Load modules list
protected
static _loadModuleList() : mixed