S
S
superpupervest2019-08-29 17:34:01
1C-Bitrix
superpupervest, 2019-08-29 17:34:01

Where are class files located and how to connect them to Bitrix?

There was a task to transfer the functionality from one Bitrix to another, but during the transfer the following error occurred
Fatal error: Class 'HtcCs\InvestPortal\BitrixComponent\ApiRouter' not found in /var/www/www-root/data/www/81.436.83.39/ local/components/htccs/investportal.api.router/class.php on line 16
And here is the code of the file itself, or rather its beginning

<?php

namespace HtcCs\InvestPortal\BitrixComponent;

use HtcCs\InvestPortal\BitrixTools\Services\Iblock;
use HtcCs\InvestPortal\Config\IblockCodes;
use HtcCs\InvestPortal\Config\IblockTypeCodes;
use HtcCs\InvestPortal\Config\PropertyCodes;
use Bitrix\Iblock\ElementTable;

/**
 * Роутер для api карты
 * Class InvestPortalApiRouter
 * todo отрефакторить жирные методы
 */
class InvestPortalApiRouter extends ApiRouter
{

If I understand correctly, then this class is located in the following file.
/local/src/BitrixComponent/ApiRouter.php
<?php

namespace HtcCs\InvestPortal\BitrixComponent;

use Bitrix\Main\Context;
use Bitrix\Main\HttpResponse;

/**
 * Class Router
 * @package HtcCs\InvestPortal\BitrixComponent
 */
class ApiRouter extends \CBitrixComponent
{

The files were transferred by analogy, with one caveat, on the source site, the main Bitrix script and the site itself are divided into different directories, and on the final site in one directory.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Georgy Baruchyan, 2019-08-29
@Snatch87

It is possible that your new project does not have a class autoloader. There should be an autoload.php file in the php_interface directory (maybe in another place), it is included in init.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question