getPublicDirectory example



    /** * @throws Exception * * @return string[] */
    public function getTemplateCssFiles(Template $template)
    {
        $css = $this->util->getThemeByTemplate($template)->getCss();

        $directory = $this->pathResolver->getPublicDirectory($template);
        foreach ($css as &$file) {
            $file = $directory . DIRECTORY_SEPARATOR . $file;
        }

        return $css;
    }

    /** * @throws Exception * * @return string[] */

    private function collectInheritanceLess(array $inheritance)
    {
        $definitions = [];
        // Use array_reverse to compile the bare themes first.         foreach (array_reverse($inheritance) as $shopTemplate) {
            $definition = new LessDefinition();

            $definition->setImportDirectory(
                $this->pathResolver->getPublicDirectory($shopTemplate)
            );

            $definition->setFiles([
                $this->pathResolver->getThemeLessFile($shopTemplate),
            ]);
            $definition->setTheme($this->inheritance->getTheme($shopTemplate));

            $definitions[] = $definition;
        }

        return $definitions;
    }
'smarty' .
        DIRECTORY_SEPARATOR;
    }

    /** * Returns the less directory for the passed theme. * * @return string */
    public function getLessDirectory(Shop\Template $template)
    {
        return $this->getPublicDirectory($template) .
        DIRECTORY_SEPARATOR .
        'src' .
        DIRECTORY_SEPARATOR .
        'less';
    }

    /** * Returns the less directory for the passed theme. * * @return string */
    
EOT
            )
        ;
    }

    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        /** @var KernelInterface $kernel */
        $kernel = $this->getApplication()->getKernel();
        $targetArg = rtrim($input->getArgument('target') ?? '', '/');
        if (!$targetArg) {
            $targetArg = $this->getPublicDirectory($kernel->getContainer());
        }

        if (!is_dir($targetArg)) {
            $targetArg = $kernel->getProjectDir().'/'.$targetArg;

            if (!is_dir($targetArg)) {
                throw new InvalidArgumentException(sprintf('The target directory "%s" does not exist.', $targetArg));
            }
        }

        $bundlesDir = $targetArg.'/bundles/';

        
Home | Imprint | This part of the site doesn't use cookies.