• Модуль: mobileapp
  • Путь к файлу: ~/bitrix/modules/mobileapp/lib/janative/entity/component.php
  • Класс: BitrixMobileAppJanativeEntityComponent
  • Вызов: Component::__construct
public function __construct($path = null, $namespace = "bitrix")
{
	Mobile::Init();

	$path = Path::normalize($path);
	if (mb_strpos($path, Application::getDocumentRoot()) === 0)
	{
		$this->path = $path;
	}
	else
	{
		$this->path = Application::getDocumentRoot() . $path;
	}

	if (mb_substr($this->path, -1) != '/') //compatibility fix
	{
		$this->path .= '/';
	}

	$directory = new Directory($this->path);
	$this->isBundleEnabled = isset($this->getConfig()["packer"]) ?? false;
	$this->baseFileName = 'component';
	$path = $directory->getPath() . '/'.$this->baseFileName.'.js';
	$file = new File($path);
	$this->name = $directory->getName();
	$this->namespace = $namespace;

	if (!$directory->isExists() || !$file->isExists())
	{
		throw new Exception("Component '{$this->name}' doesn't exists ($path) ");
	}
}