Documentation

Core
in package

Core

Tags
subpackage

Core

version
7.x
author

Hostmake LLC

copyright

© 2005-2024 ООО "Хостмэйк" (Hostmake LLC), http://www.hostcms.ru

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

$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
see
Core_I18n::get()
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
bool

convert64b32()

64 bit to 32

public static convert64b32(int $int) : int
Parameters
$int : int
Return values
int

crc32()

Get CRC32 from source string

public static crc32(string $value) : int
Parameters
$value : string

value

Return values
int

cutRootPath()

Cut CMS_FOLDER from $path

public static cutRootPath(string $path) : string
Parameters
$path : string

path

Return values
string

debugBacktrace()

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
string

getCallableName()

Get callable name

public static getCallableName(callable|object $callable) : string
Parameters
$callable : callable|object
Return values
string

getClassPath()

Get path to class file by class name

public static getClassPath(string $class) : string
Parameters
$class : string

name of the class

Return values
string

getClientIp()

Get Real Client Ip

public static getClientIp() : string
Return values
string

getLng()

Get Site Language

public static getLng() : string
Return values
string

getLoadModuleTime()

Get Load Module Time

public static getLoadModuleTime() : float
Return values
float

getmicrotime()

Get microtime

public static getmicrotime() : float
Return values
float

getPcreVersion()

Get PCRE version

public static getPcreVersion() : string
Return values
string

getVersion()

Get HostCMS Version

public static getVersion() : string
Return values
string

httpsUses()

Checks if HTTPS is used

public static httpsUses() : bool
Return values
bool

init()

Initialization

public static init() : bool
Return values
bool

initConstants()

Initialize constants for site

public static initConstants(Site_Model $oSite) : mixed
Parameters
$oSite : Site_Model

site

Tags
hostcms-event

Core.onBeforeInitConstants

hostcms-event

Core.onAfterInitConstants

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
bool

isIIS()

Check if server is Microsoft IIS

public static isIIS() : bool
Return values
bool

isInit()

Check if self::init() has been called

public static isInit() : bool
Return values
bool

mainConfig()

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
bool

parseUrl()

Parse URL and set controller properties

public static parseUrl() : array<string|int, mixed>
Tags
hostcms-event

Core.onAfterParseUrl

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
Tags
hostcms-event

Core.onBeforeLoadModuleList

hostcms-event

Core.onAfterLoadModuleList


        
On this page

Search results