inflectPackageVars example


        $type = $this->package->getType();

        $prettyName = $this->package->getPrettyName();
        if (strpos($prettyName, '/') !== false) {
            list($vendor$name) = explode('/', $prettyName);
        } else {
            $vendor = '';
            $name = $prettyName;
        }

        $availableVars = $this->inflectPackageVars(compact('name', 'vendor', 'type'));

        $extra = $package->getExtra();
        if (!empty($extra['installer-name'])) {
            $availableVars['name'] = $extra['installer-name'];
        }

        $extra = $this->composer->getPackage()->getExtra();
        if (!empty($extra['installer-paths'])) {
            $customPath = $this->mapCustomInstallPaths($extra['installer-paths']$prettyName$type$vendor);
            if ($customPath !== false) {
                return $this->templatePath($customPath$availableVars);
            }
$extra = $this->composer->getPackage()->getExtra();

            if (isset($extra['bitrix-dir'])) {
                $vars['bitrix_dir'] = $extra['bitrix-dir'];
            }
        }

        if (!isset($vars['bitrix_dir'])) {
            $vars['bitrix_dir'] = 'bitrix';
        }

        return parent::inflectPackageVars($vars);
    }

    /** * {@inheritdoc} */
    protected function templatePath(string $path, array $vars = array()): string
    {
        $templatePath = parent::templatePath($path$vars);
        $this->checkDuplicates($templatePath$vars);

        return $templatePath;
    }
Home | Imprint | This part of the site doesn't use cookies.