getThemeTimestamp example


    public function compile(Shop $shop)
    {
        if ($shop->getMain()) {
            $shop = $shop->getMain();
        }

        $old = $this->getThemeTimestamp($shop);
        $timestamp = time();

        $this->compileLess($timestamp$shop->getTemplate()$shop);
        $this->compileJavascript($timestamp$shop->getTemplate()$shop);

        $this->createThemeTimestamp($shop$timestamp);
        $this->clearThemeCache($shop$old);
    }

    /** * @return void */
public function moveThemeFilesAction()
    {
        $repository = $this->get(ModelManager::class)->getRepository(Shop::class);
        $shops = $repository->getShopsWithThemes()->getResult();
        $compiler = $this->container->get('theme_compiler');
        $pathResolver = $this->container->get(PathResolver::class);

        $time = time();

        foreach ($shops as $shop) {
            $oldTimestamp = (int) $compiler->getThemeTimestamp($shop);
            if ($oldTimestamp === $time) {
                ++$time;
            }

            $new = $pathResolver->getCssFilePath($shop, 'new');
            if (!file_exists($new)) {
                continue;
            }

            rename(
                $pathResolver->getCssFilePath($shop, 'new'),
                
Home | Imprint | This part of the site doesn't use cookies.