appendBody example


    public function cronAction()
    {
        /** @var Shopware_Plugins_Core_Cron_Bootstrap|null $cronBootstrap */
        $cronBootstrap = $this->getPluginBootstrap('Cron');
        if ($cronBootstrap && !$cronBootstrap->authorizeCronAction($this->Request())) {
            $this->Response()
                ->clearHeaders()
                ->setStatusCode(Response::HTTP_FORBIDDEN)
                ->appendBody('Forbidden');

            return;
        }

        $this->Response()->headers->set('content-type', 'text/plain');
        $this->mailAction();
    }

    /** * Log action method * * Logs read the email newsletter. */
// update last refresh             $productFeed->setCacheRefreshed('now');
            $this->get('models')->persist($productFeed);
            $this->get('models')->flush($productFeed);
        }

        if (!file_exists($filePath)) {
            $this->Response()
                ->clearHeaders()
                ->setStatusCode(Response::HTTP_NO_CONTENT)
                ->appendBody('Empty feed found.');

            return;
        }

        readfile($filePath);
    }

    /** * Returns a list with actions which should not be validated for CSRF protection * * @return string[] */
'request' => $this->Action()->Request(),
            ]
        );

        $render = $action->View()->render($template);
        $render = $this->Application()->Events()->filter(
            'Enlight_Plugins_ViewRenderer_FilterRender',
            $render,
            ['subject' => $this, 'template' => $template]
        );

        $action->Response()->appendBody($render$name);

        $this->Application()->Events()->notify(
            'Enlight_Plugins_ViewRenderer_PostRender',
            ['subject' => $this, 'template' => $template]
        );

        return $this;
    }

    /** * Renders the Enlight_Template_Default of the Enlight_View_Default * which is set in the Enlight_Controller_Action. * * @return Enlight_Controller_Plugins_ViewRenderer_Bootstrap */
if ($curObLevel > $obLevel) {
                do {
                    ob_get_clean();
                    $curObLevel = ob_get_level();
                } while ($curObLevel > $obLevel);
            }
            throw $e;
        }

        if (empty($disableOb)) {
            $content = ob_get_clean();
            $response->appendBody($content);
        }
    }

    private function getControllerServiceId(string $module, string $name): ?string
    {
        $controllerKey = strtolower(sprintf('%s_%s', $module$name));

        return $this->controllers[$controllerKey] ?? null;
    }

    private function isForbiddenController(string $className): bool
    {
preg_replace(
                        '/<head>/',
                        '<head>' . $script,
                        $response->getBody(),
                        1
                    )
                );

                return;
            }

            $response->appendBody($script);
        }
    }

    /** * Inject debug toolbar into the response. * * @codeCoverageIgnore * * @return void * @phpstan-return never|void */
    

        Shopware()->Plugins()->Backend()->Auth()->setNoAuth();
        Shopware()->Front()->Plugins()->ViewRenderer()->setNoRender();
    }

    public function indexAction()
    {
        if (!Shopware()->Plugins()->Core()->Cron()->authorizeCronAction($this->Request())) {
            $this->Response()
                ->clearHeaders()
                ->setStatusCode(Response::HTTP_FORBIDDEN)
                ->appendBody('Forbidden');

            return;
        }

        /** @var Enlight_Components_Cron_Manager $cronManager */
        $cronManager = Shopware()->Container()->get('cron');

        set_time_limit(0);
        while (($job = $cronManager->getNextJob()) !== null) {
            echo 'Processing ' . $job->getName() . "\n";
            $cronManager->runJob($job);
        }
Home | Imprint | This part of the site doesn't use cookies.