### Untitled No description -------------------------------- ### Install nginx Source: https://www.hostcms.ru/documentation/server/nginx This command installs nginx on a system using yum package manager. Ensure your system has the 'yum' command available. ```bash # yum install nginx ``` -------------------------------- ### Get Shop Item Query Example Source: https://www.hostcms.ru/documentation/modules/restapi/api Demonstrates filtering and pagination for shop item resources. It retrieves 5 items starting from the 10th item and includes the total count in the X-Total-Count header. ```http GET /api/v1.1/shop_item_bonuses/?$limit=5&$offset=10&$count=true __ GET /api/v1.1/shop_item_certificates/?$limit=5&$offset=10&$count=true __ GET /api/v1.1/shop_item_delivery_options/?$limit=5&$offset=10&$count=true __ GET /api/v1.1/shop_item_digitals/?$limit=5&$offset=10&$count=true __ GET /api/v1.1/shop_item_discounts/?$limit=5&$offset=10&$count=true __ ``` -------------------------------- ### Untitled No description -------------------------------- ### Basic nginx Configuration Example Source: https://www.hostcms.ru/documentation/server/nginx A fundamental nginx configuration file example, demonstrating worker processes, event handling, error logging, HTTP settings including log format, sendfile, and gzip compression. It also includes a basic server block for handling requests on port 80. ```nginx worker_processes 1; events { worker_connections 1024; } # [ debug | info | notice | warn | error | crit ] error_log /var/log/nginx.error_log error; http { include mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] $status ' '"$request" $body_bytes_sent "$http_referer ``` -------------------------------- ### Untitled No description -------------------------------- ### Install APC using PECL Source: https://www.hostcms.ru/documentation/server/install-apc Installs the Alternative PHP Cache (APC) using the PECL (PHP Extension Community Library) installer. It is recommended to answer all prompts with the default options during installation. ```bash # pecl install apc ``` -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Install APC Dependencies with Yum Source: https://www.hostcms.ru/documentation/server/install-apc Installs necessary packages like `php-pear`, `php-devel`, `httpd-devel`, `pcre-devel`, and `gcc` using the `yum` package manager, which are required for building and installing APC. ```bash # yum install php-pear php-devel httpd-devel pcre-devel gcc make ``` -------------------------------- ### GET Request: Retrieve Specific Shop Source: https://www.hostcms.ru/documentation/modules/restapi/intro Example GET request to retrieve details for a specific shop identified by its ID. ```http GET /api/v1.1/shops/3/ ``` -------------------------------- ### Untitled No description -------------------------------- ### Install LibreOffice Core Components on CentOS Source: https://www.hostcms.ru/documentation/modules/printlayouts/libreoffice This command installs the necessary LibreOffice components for the driver to function on CentOS. It requires root or sudo privileges to execute. The packages installed are 'libreoffice-core', 'libreoffice-headless', and 'libreoffice-writer'. ```bash yum install libreoffice-core libreoffice-headless libreoffice-writer ``` -------------------------------- ### Untitled No description -------------------------------- ### Get Module Directory Path and User Options in PHP Source: https://www.hostcms.ru/documentation/modules/additional/market This snippet demonstrates how to retrieve the temporary directory path for module files and the options entered by the user. It also shows how to define language settings and prepare an array for string replacements based on user options. This is crucial for dynamically configuring modules during installation. ```php tmpDir . DIRECTORY_SEPARATOR; // Массив значений, введенных пользователем $aOptions = Market_Controller::instance()->options; // Текущий язык $sLng = 'ru'; // Массив возможных языков $aPossibleLanguages = array('en', 'ru'); // Используется для автоматического добавления суффиксов к именам XSL-шаблонов и типовых динамических страниц $sSitePostfix = ''; // Массив замен $aReplace = array(); foreach ($aOptions as $optionName => $optionValue) {     $aReplace['%' . $optionName . '%'] = $optionValue; } $Install_Controller = Install_Controller::instance(); $Install_Controller->setTemplatePath($tmpDir); ``` -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Reload Systemd and Start MinIO Service Source: https://www.hostcms.ru/documentation/modules/cdn/minio Reloads the systemd manager configuration to recognize the new service file and then starts the MinIO service. It also enables the service to start automatically on boot. ```bash systemctl daemon-reload systemctl start minio systemctl enable minio ``` -------------------------------- ### Untitled No description -------------------------------- ### GET Request: Multi-Field Sorting Source: https://www.hostcms.ru/documentation/modules/restapi/intro Example demonstrating how to specify multiple sorting criteria for a GET request. Each criterion is passed as a separate parameter. ```http ?$orderBy[]=field1 DESC&orderBy[]=field2 ASC ``` -------------------------------- ### GET Request: Retrieve All Shops Source: https://www.hostcms.ru/documentation/modules/restapi/intro Example GET request to retrieve a list of all shops across all sites. The result is limited to 25 items by default. ```http GET /api/v1.1/shops/ ``` -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### GET Request: Retrieve Child Resources Source: https://www.hostcms.ru/documentation/modules/restapi/intro Example GET request to retrieve resources that are children of another resource, like shops belonging to a specific site. ```http GET /api/v1.1/sites/1/shops/ ``` -------------------------------- ### GET Request: Limit Results Source: https://www.hostcms.ru/documentation/modules/restapi/intro Example GET request to retrieve a limited number of shops. The '$limit' parameter controls the maximum number of items returned. ```http GET /api/v1.1/shops/?$limit=10 ``` -------------------------------- ### Untitled No description -------------------------------- ### Restart Apache Server Source: https://www.hostcms.ru/documentation/server/install-apc Restarts the Apache web server to apply the changes made to the PHP configuration, specifically to load the newly installed APC extension. ```bash # service httpd restart ``` -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### GET Request: Sort Results by ID Descending Source: https://www.hostcms.ru/documentation/modules/restapi/intro Example GET request to retrieve shops sorted by their ID in descending order. The '$orderBy' parameter is used for sorting. ```http GET /api/v1.1/sites/1/shops/?$orderBy=id DESC ``` -------------------------------- ### GET Request: Retrieve Shop Item Property Values Source: https://www.hostcms.ru/documentation/modules/restapi/intro Example GET request to retrieve additional property values for a shop item, expanding the property details. ```http GET /api/v1.1/shop_item/345/getPropertyValues/?$expand=property ``` -------------------------------- ### Untitled No description -------------------------------- ### Install Module Database Operations in HostCMS (PHP) Source: https://www.hostcms.ru/documentation/modules/additional/demo-module The `install` method is used to perform database operations when a module is installed. This example demonstrates executing a SQL query using `Sql_Controller::instance()->execute()`. The `uninstall` method would be implemented similarly for module removal. ```PHP public function install() { $query = "Текст запроса"; // Выполняем запрос Sql_Controller::instance()->execute($query); } ```