ALLOWED_EXTENSIONS
Allowed file extensions for uploads
public
array<string|int, mixed>
ALLOWED_EXTENSIONS
= ['jpg', 'jpeg', 'png', 'gif', 'webp', 'svg']
Allowed file extensions for uploads
public
array<string|int, mixed>
ALLOWED_EXTENSIONS
= ['jpg', 'jpeg', 'png', 'gif', 'webp', 'svg']
public
mixed
APP_NAME
= 'core'
public
mixed
CACHE_DRIVER
= 'file'
public
mixed
CACHE_ENABLED
= \false
public
mixed
CACHE_ENCRYPTION_CIPHER
= 'aes-256-cbc'
public
mixed
CACHE_ENCRYPTION_ENABLED
= \true
public
mixed
CACHE_ENCRYPTION_KEY
= 'change-this-to-a-very-secret-and-long-key'
public
mixed
CACHE_MAX_SIZE_PER_ELEMENT
= 65536
DressAPI
public
mixed
CACHE_PATH
= '/dev/shm/'
public
mixed
CORE_PATH
= \CORE_SRC_PATH . '/modules/base'
Base path to the core modules directory Path: core/src/api/components -> core/src/api -> core/src
public
string
CORE_SRC_PATH
= \dirname(__DIR__, 2)
Default view folder for components
public
string
DEFAULT_VIEW
= 'bi5'
public
mixed
DOMAIN_NAME
= 'dressapi'
Root directory for gallery files storage Shared location: /var/vhosts/dressapi/public-files
public
string
GALLERY_ROOT
= \dirname(__DIR__, 4) . '/public-files'
public
mixed
ITEM_ID
= 'id'
public
mixed
MAIL_DEBUG
= false
public
mixed
MAIL_ENCRYPTION
= \PHPMailer\PHPMailer\PHPMailer::ENCRYPTION_SMTPS
public
mixed
MAIL_PORT
= 465
public
mixed
MAIL_SMTP_PROTOCOL
= true
public
mixed
MAX_LEVEL_FOLDERS
= 20
Maximum file upload size in bytes (10MB)
public
int
MAX_UPLOAD_SIZE
= 10 * 1024 * 1024
public
mixed
OCI_DEFAULT
= OCI_COMMIT_ON_SUCCESS
public
mixed
OCI_DESCRIBE_ONLY
= 16
public
mixed
PDO_MYSQL_BUFFERED_QUERY
= true
public
mixed
PWD_ENC_ALGORITHM
= 'tiger192,4'
public
mixed
REDIS_DATABASE
= 0
public
mixed
REDIS_HOST
= '127.0.0.1'
public
mixed
REDIS_PASSWORD
= \null
public
mixed
REDIS_PORT
= 6379
DressAPI
public
mixed
REDIS_SCHEME
= 'tcp'
public
mixed
REDIS_USERNAME
= \null
public
mixed
RELATED_REPOSITORY_ID
= 'id_repository'
public
mixed
REPOSITORY_TABLE
= 'repository'
public
mixed
ROOT_FOLDER_ID
= 1
public
mixed
TOKEN_ENC_ALGORITHM
= 'HS512'
Lists all available components with their metadata
HandleList() : void
GET /api-core/components/?action=list&view=bi5
Outputs JSON response with components array
Renders a component for preview purposes
HandleRender() : void
POST /api-core/components/?action=render Body: {"type": "card", "data": {"title": "Test"}}
Outputs JSON response with rendered HTML
Parses component parameters from HTML comment block.
ParseComponentParams(string $html) : array<string|int, mixed>
Expected format in template (PHPDoc-style):
The template HTML content.
['params' => array, 'is_repeater' => bool]
Parses component examples from HTML comment block
ParseComponentExamples(string $html) : array<string|int, mixed>
Expected format:
EXAMPLE 1:
The template HTML content
Array of example objects with raw JSON data
Parses component description from HTML comment block
ParseComponentDescription(string $html) : string
Extracts the component name from the first line of the comment
The template HTML content
The component description or empty string
Renders a simple preview of a component
RenderSimplePreview(string $template_file, array<string|int, mixed> $data) : string
This is a simplified renderer for editor preview. For full rendering, use CComponent class.
Path to the template file
Component data
Rendered HTML preview
Sanitizes output to prevent XSS attacks
SanitizeOutput(string|null $string) : string
The string to sanitize
The sanitized string, empty if input is null
Validates and normalizes a path to prevent directory traversal attacks
ValidatePath(string $path) : string
The path to validate
The sanitized path without dangerous characters
Gets the full safe path by validating and resolving the relative path
GetFullPath(string $relative_path) : string
The relative path to resolve
The full validated path
Handles file upload requests
HandleUpload() : void
Outputs JSON response
Lists files and folders in a directory
HandleList() : void
Outputs JSON response with list of items
Deletes a file or folder recursively
HandleDelete() : void
Outputs JSON response
Renames a file or folder in the gallery
HandleRename() : void
Outputs JSON response with renamed item info
Creates a new folder in the gallery
HandleCreateFolder() : void
Outputs JSON response with created folder info
Returns CSS class string if the current URL matches the menu item URL.
MenuActiveClass(string $current_url, string $item_url[, string $active_class = ' active' ]) : string
The current page URL.
The menu item URL to compare.
The CSS class to return when active.
The active class string or empty string.
Checks if a URL points to an external site.
IsExternalUrl(string $url) : bool
The URL to check.
True if the URL is external.
Returns the target attribute for external links.
ExternalTarget(string|bool $url_or_is_external) : string
Accepts either a URL string or a pre-computed boolean from IsExternalUrl().
URL to check, or boolean result of IsExternalUrl().
' target="_blank"' for external URLs, empty string otherwise.
Returns the translated and formatted menu item title.
MenuTitle(array<string|int, mixed> $voice[, bool $ucfirst = true ]) : string
The menu item array with 'title' and/or 'name' keys.
Whether to capitalize the first letter.
The formatted title.