Main function of the module. Outputs all content directly instead of collecting it and doing the output later.

@return void
5515
public function main()
    {
        LibraryLoader::includeAll();

        $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
        $this->doc->backPath = $GLOBALS['BACK_PATH'];

        if ($GLOBALS['BE_USER']->user['admin']) {
            $this->doc->bodyTagAdditions = 'id="doc3"';

            $this->addAdditionalHeaderData();

            $this->cleanOutputBuffers();
            $this->outputService->output(
                $this->doc->startPage($this->translate('title')) .
                $this->doc->header(\PHPUnit_Runner_Version::getVersionString())
            );

            $this->renderRunTests();

            $this->outputService->output(
                $this->doc->section(
                    $this->translate('shortcuts.title'),
                    '<p>' . $this->translate('shortcuts.text') . '</p>
                    <p>' . $this->translate('shortcuts.browser_dependency') . '</p>
                    <ul>
                    <li>' . $this->translate('shortcuts.browser_safari_ie') . '</li>
                    <li>' . $this->translate('shortcuts.browser_firefox') . '</li>
                    </ul>'
                )
            );
        } else {
            $this->outputService->output(
                $this->doc->startPage($this->translate('title')) .
                $this->doc->header($this->translate('title')) .
                $this->translate('admin_rights_needed')
            );
        }

        $this->outputService->output($this->doc->endPage());
    }
1209638
public function main()
    {
        $this->setup('info');

        if ($this->oldVersion) {
            $output = $this->run(['--xml']);

            if (!($xmlObj = @simplexml_load_string($output))) {
                throw new BuildException("Failed to parse the output of 'svn info --xml'.");
            }

            if ($this->lastChanged) {
                $found = (int) $xmlObj->entry->commit['revision'];
            } else {
                $found = (int) $xmlObj->entry['revision'];
            }
        } else {
            $output = $this->run();

            if (empty($output) || !isset($output['entry'][0])) {
                throw new BuildException("Failed to parse the output of 'svn info'.");
            }

            if ($this->lastChanged) {
                $found = $output['entry'][0]['commit']['revision'];
            } else {
                $found = $output['entry'][0]['revision'];
            }
        }

        $this->project->setProperty($this->getPropertyName(), $found);
    }
223796
public function main()
    {
        $this->out('CodeBlastr Queue Plugin:');
        $this->hr();
        $this->out('Usage:');
        $this->out('	cake CodeBlastr.Queue help');
        $this->out('		-> Display this Help message');
//        $this->out('	cake Queue.Queue add <taskname>');
//        $this->out('		-> Try to call the cli add() function on a task');
//        $this->out('		-> tasks may or may not provide this functionality.');
        $this->out('	cake Queue.Queue runworker');
        $this->out('		-> run a queue worker, which will look for a pending task it can execute.');
        $this->out('		-> the worker will always try to find jobs matching its installed Tasks');
        $this->out('		-> see "Available Tasks" below.');
        $this->out('	cake Queue.Queue runworker');
        $this->out('		-> run a queue worker, which will look for a pending task it can execute.');
        $this->out('		-> the worker will always try to find jobs matching its installed Tasks');
        $this->out('		-> see "Available Tasks" below.');
        $this->out('	cake Queue.Queue stats');
        $this->out('		-> Display some general Statistics.');
        $this->out('	cake Queue.Queue clean');
        $this->out('		-> Manually call cleanup function to delete task data of completed tasks.');
    }
419770
public function main()
    {
        $options = (array)$this->params;
        if (empty($options['use'])) {
            $this->err(__d('eav', 'You must indicate a table alias name using the "--use" option. Example: "Articles.Users"'));

            return false;
        }

        try {
            $table = TableRegistry::get($options['use']);
        } catch (\Exception $ex) {
            $table = false;
        }

        if (!$table) {
            $this->err(__d('eav', 'The specified table does not exists.'));

            return false;
        } elseif (!$table->behaviors()->has('Eav')) {
            $this->err(__d('eav', 'The specified table is not using EAV behavior.'));

            return false;
        } elseif (empty($options['name'])) {
            $this->err(__d('eav', 'You must indicate a table column.'));

            return false;
        } elseif (!preg_match('/^[a-z\d\-_]+$/', $options['name'])) {
            $this->err(__d('eav', 'Invalid column name, please use only lowercase letters, numbers, "-" and "_", e.g.: "user_age".'));

            return false;
        }

        $meta = [
            'type' => $options['type'],
            'bundle' => (empty($options['bundle']) ? null : (string)$options['bundle']),
            'searchable' => $options['searchable'],
            'overwrite' => $options['overwrite'],
        ];

        if ($options['action'] == 'drop') {
            return $table->dropColumn($options['name'], $meta['bundle']);
        }

        try {
            $errors = $table->addColumn($options['name'], $meta);
            if (!empty($errors)) {
                foreach ($errors as $message) {
                    $this->err($message);
                }

                return false;
            }

            return true;
        } catch (FatalErrorException $ex) {
            $this->err($ex->getMessage());

            return false;
        }
    }
930510
final public function output (){

        if($this->_outputOnlyHeaders){
            $this->sendHttpHeaders();
            return true;
        }
    
        $this->_httpHeaders['Content-Type'] =
                'application/atom+xml;charset=' . $this->charset;

        if(!$this->infos->updated){
            $this->infos->updated = date("Y-m-d H:i:s");
        }

        // generate the main content, in a buffer
        // so we can handle errors
        $this->_template->assign ('atom', $this->infos);
        $this->_template->assign ('items', $this->itemList);
        $this->_template->assign ('lang',$this->lang);
        $content = $this->_template->fetch ($this->_mainTpl);

        $this->sendHttpHeaders();
        echo '<?xml version="1.0" encoding="'. $this->charset .'"?>', "\n";
        $this->_outputXmlHeader ();
        echo $content;
        return true;
    }
55658
public function output()
    {
        if ($this->status === null) {
            $this->status = (empty($this->body) || $this->method === 'HEAD')
                ? HttpResponse::HTTP_NO_CONTENT
                : HttpResponse::HTTP_OK;
        }

        if ($this->method === 'HEAD'
            || !HttpResponse::canHaveBody($this->status)
        ) {
            $content_type = 'HEAD';
        } elseif (is_array($this->body)) {
            $content_type = 'application/json';
        } else {
            $content_type = $this->headers['Content-Type'] ?? null;
        }

        Utils::checkOutput($content_type);

        if ($this->zlib_compression && $content_type !== 'HEAD') {
            ini_set('zlib.output_compression', 1);
        }

        header(HttpResponse::getHeader($this->status));
        foreach ($this->headers as $key => $value) {
            header("$key: " . implode(',', (array) $value));
        }

        if ($content_type !== 'HEAD') {
            if (is_array($this->body)) {
                echo json_encode($this->body, JSON_PRETTY_PRINT);
            } else {
                echo $this->body;
            }
        }
    }
1116386
public function main()
    {
        if (!empty($this->params['exclude'])) {
            $this->_exclude = explode(',', $this->params['exclude']);
        }
        if (isset($this->params['files']) && !is_array($this->params['files'])) {
            $this->_files = explode(',', $this->params['files']);
        }
        if (isset($this->params['paths'])) {
            $this->_paths = explode(',', $this->params['paths']);
        } elseif (isset($this->params['plugin'])) {
            $plugin = Inflector::camelize($this->params['plugin']);
            if (!Plugin::loaded($plugin)) {
                Plugin::load($plugin);
            }
            $this->_paths = [Plugin::classPath($plugin)];
            $this->params['plugin'] = $plugin;
        } else {
            $this->_getPaths();
        }

        if (isset($this->params['extract-core'])) {
            $this->_extractCore = !(strtolower($this->params['extract-core']) === 'no');
        } else {
            $response = $this->in('Would you like to extract the messages from the CakePHP core?', ['y', 'n'], 'n');
            $this->_extractCore = strtolower($response) === 'y';
        }

        if (!empty($this->params['exclude-plugins']) && $this->_isExtractingApp()) {
            $this->_exclude = array_merge($this->_exclude, App::path('Plugin'));
        }

        if (!empty($this->params['validation-domain'])) {
            $this->_validationDomain = $this->params['validation-domain'];
        }

        if ($this->_extractCore) {
            $this->_paths[] = CAKE;
        }

        if (isset($this->params['merge'])) {
            $this->_merge = !(strtolower($this->params['merge']) === 'no');
        } else {
            $this->out();
            $response = $this->in(
                'Would you like to merge all domain strings into the default domain?',
                ['y', 'n'],
                'n'
            );
            $this->_merge = strtolower($response) === 'y';
        }

        if (empty($this->_files)) {
            $this->_searchFiles();
        }

        $this->_extract();
    }
853346
public function main() {
        foreach ($this->migrators as $migration) {
            if ($migration->isNeeded()) {
                try {
                    $this->messages[] = $migration->process();
                } catch (\Exception $e) {
                    $this->messages[] = [FlashMessage::ERROR, 'Execution failed', $e->getMessage()];
                }
            }
        }
        return $this->generateOutput();
    }
1339436
public function executeAndReturnContent()
  {
    ob_start();
    Output::$controller = WebApp::$page->controller;
    include $this->file;
    $content = ob_get_contents();
    ob_clean();

    return $content;
  }
694645
protected function starting_output() {
        global $CFG;

        if (!during_initial_install()) {
            $this->blocks->load_blocks();
            if (empty($this->_block_actions_done)) {
                $this->_block_actions_done = true;
                if ($this->blocks->process_url_actions($this)) {
                    redirect($this->url->out(false));
                }
            }
            $this->blocks->create_all_block_instances();
        }

        // If maintenance mode is on, change the page header.
        if (!empty($CFG->maintenance_enabled)) {
            $this->set_button('<a href="' . $CFG->wwwroot . '/' . $CFG->admin .
                    '/settings.php?section=maintenancemode">' . get_string('maintenancemode', 'admin') .
                    '</a> ' . $this->button);

            $title = $this->title;
            if ($title) {
                $title .= ' - ';
            }
            $this->set_title($title . get_string('maintenancemode', 'admin'));
        }

        $this->initialise_standard_body_classes();
    }
1108168
public function main()
    {
        $pull = $this->getFactoryInstance('update');
        try {
            $pull->setBranch($this->getBranch());
        } catch (Exception $ex) {
            $this->log("Caught: " . $ex->getMessage(), Project::MSG_DEBUG);
        }
        $pull->setClean($this->getClean());
        $pull->setQuiet($this->getQuiet());

        $cwd = getcwd();

        if ($this->repository === '') {
            $prog = $this->getProject();
            $dir = $prog->getProperty('application.startdir');
        } else {
            $dir = $this->repository;
        }

        $this->checkRepositoryIsDirAndExists($dir);
        chdir($dir);
        try {
            $this->log("Executing: " . $pull->asString(), Project::MSG_INFO);
            $output = $pull->execute();
            if ($output !== '') {
                $this->log($output);
            }
        } catch (Exception $ex) {
            $msg = $ex->getMessage();
            $p = strpos($msg, 'hg returned:');
            if ($p !== false) {
                $msg = substr($msg, $p + 13);
            }
            chdir($cwd);
            throw new BuildException($msg);
        }
        chdir($cwd);
    }
403289
public function main()
    {
        // INIT
        $tsSetup = $GLOBALS['TSFE']->tmpl->setup;
        $headers = array();

        // don't send any headers if headers are already sent
        if (headers_sent()) {
            return;
        }

        // Init caches
        $cacheIdentification = sprintf(
            '%s_%s_http',
            $GLOBALS['TSFE']->id,
            substr(sha1(FrontendUtility::getCurrentUrl()), 10, 30)
        );

        /** @var \TYPO3\CMS\Core\Cache\CacheManager $cacheManager */
        $objectManager = Typo3GeneralUtility::makeInstance(
            'TYPO3\\CMS\\Extbase\\Object\\ObjectManager'
        );
        $cacheManager  = $objectManager->get('TYPO3\\CMS\\Core\\Cache\\CacheManager');
        $cache         = $cacheManager->getCache('cache_pagesection');

        if (!empty($GLOBALS['TSFE']->tmpl->loaded)) {
            // ##################################
            // Non-Cached page
            // ##################################

            if (!empty($tsSetup['plugin.']['metaseo.']['metaTags.'])) {
                $tsSetupSeo = $tsSetup['plugin.']['metaseo.']['metaTags.'];

                // ##################################
                // W3C P3P Tags
                // ##################################
                $p3pCP        = null;
                $p3pPolicyUrl = null;

                if (!empty($tsSetupSeo['p3pCP'])) {
                    $p3pCP = $tsSetupSeo['p3pCP'];
                }

                if (!empty($tsSetupSeo['p3pPolicyUrl'])) {
                    $p3pPolicyUrl = $tsSetupSeo['p3pPolicyUrl'];
                }

                if (!empty($p3pCP) || !empty($p3pPolicyUrl)) {
                    $p3pHeader = array();

                    if (!empty($p3pCP)) {
                        $p3pHeader[] = 'CP="' . $p3pCP . '"';
                    }

                    if (!empty($p3pPolicyUrl)) {
                        $p3pHeader[] = 'policyref="' . $p3pPolicyUrl . '"';
                    }

                    $headers['P3P'] = implode(' ', $p3pHeader);
                }
            }

            // Store headers into cache
            $cache->set($cacheIdentification, $headers, array('pageId_' . $GLOBALS['TSFE']->id));
        } else {
            // #####################################
            // Cached page
            // #####################################

            // Fetched cached headers
            $cachedHeaders = $cache->get($cacheIdentification);

            if (!empty($cachedHeaders)) {
                $headers = $cachedHeaders;
            }
        }

        // Call hook
        GeneralUtility::callHookAndSignal(__CLASS__, 'httpHeaderOutput', $this, $headers);

        // #####################################
        // Sender headers
        // #####################################
        if (!empty($headers['P3P'])) {
            header('P3P: ' . $headers['P3P']);
        }
    }
718361
public function main(): void
    {
        $pumlDiagram = $this->generatePumlDiagram();
        $destination = $this->resolveImageDestination();
        $format = $this->getFormat();
        $image = $this->generateImage($pumlDiagram, $format);
        $this->saveToFile($image, $destination);
    }
139389
public function main_init() {
		if ( $this->_initialized ) {
			return;
		}
		$this->_initialized = true;

		$this->filter->do_action( 'app_initialize', $this );
		$this->setup_property();
		$this->setup_textdomain();
		$this->setup_settings();
		$this->filter->do_action( 'app_initialized', $this );
	}
163256
public function output(): void
    {
        header('HTTP/1.1 ' . $this->getStatusCode());

        // Output headers.
        foreach ($this->getHeaders() as $headerName => $headerValue) {
            header($headerName . ': ' . $headerValue);
        }

        // Set cookies.
        foreach ($this->getCookies() as $cookieName => $cookie) {
            /** @var ResponseCookieInterface $cookie */
            setcookie(
                $cookieName,
                $cookie->getValue(),
                $cookie->getExpiry() !== null ? $cookie->getExpiry()->getTimestamp() : 0,
                $cookie->getPath() !== null ? $cookie->getPath()->__toString() : '',
                $cookie->getDomain() !== null ? $cookie->getDomain()->__toString() : '',
                $cookie->isSecure(),
                $cookie->isHttpOnly()
            );
        }

        // Output content.
        echo $this->getContent();
    }
1010485
public function main()
    {
        if (!empty($this->params['exclude'])) {
            $this->_exclude = explode(',', $this->params['exclude']);
        }
        if (isset($this->params['files']) && !is_array($this->params['files'])) {
            $this->_files = explode(',', $this->params['files']);
        }
        if (isset($this->params['paths'])) {
            $this->_paths = explode(',', $this->params['paths']);
        } elseif (isset($this->params['plugin'])) {
            $plugin = Inflector::camelize($this->params['plugin']);
            if (!Plugin::isLoaded($plugin)) {
                throw new MissingPluginException(['plugin' => $plugin]);
            }
            $this->_paths = [Plugin::classPath($plugin)];
            $this->params['plugin'] = $plugin;
        } else {
            $this->_getPaths();
        }

        if (isset($this->params['extract-core'])) {
            $this->_extractCore = !(strtolower($this->params['extract-core']) === 'no');
        } else {
            $response = $this->in('Would you like to extract the messages from the CakePHP core?', ['y', 'n'], 'n');
            $this->_extractCore = strtolower($response) === 'y';
        }

        if (!empty($this->params['exclude-plugins']) && $this->_isExtractingApp()) {
            $this->_exclude = array_merge($this->_exclude, App::path('Plugin'));
        }

        if (!empty($this->params['validation-domain'])) {
            $this->_validationDomain = $this->params['validation-domain'];
        }

        if ($this->_extractCore) {
            $this->_paths[] = CAKE;
        }

        if (isset($this->params['output'])) {
            $this->_output = $this->params['output'];
        } elseif (isset($this->params['plugin'])) {
            $this->_output = $this->_paths[0] . 'Locale';
        } else {
            $message = "What is the path you would like to output?\n[Q]uit";
            while (true) {
                $response = $this->in($message, null, rtrim($this->_paths[0], DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'Locale');
                if (strtoupper($response) === 'Q') {
                    $this->err('Extract Aborted');
                    $this->_stop();

                    return;
                }
                if ($this->_isPathUsable($response)) {
                    $this->_output = $response . DIRECTORY_SEPARATOR;
                    break;
                }

                $this->err('');
                $this->err(
                    '<error>The directory path you supplied was ' .
                    'not found. Please try again.</error>'
                );
                $this->out();
            }
        }

        if (isset($this->params['merge'])) {
            $this->_merge = !(strtolower($this->params['merge']) === 'no');
        } else {
            $this->out();
            $response = $this->in('Would you like to merge all domain strings into the default.pot file?', ['y', 'n'], 'n');
            $this->_merge = strtolower($response) === 'y';
        }

        $this->_markerError = $this->param('marker-error');
        $this->_relativePaths = $this->param('relative-paths');

        if (empty($this->_files)) {
            $this->_searchFiles();
        }

        $this->_output = rtrim($this->_output, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
        if (!$this->_isPathUsable($this->_output)) {
            $this->err(sprintf('The output directory %s was not found or writable.', $this->_output));
            $this->_stop();

            return;
        }

        $this->_extract();
    }
687065
public function main()
    {
        $options = (array)$this->params;
        $options['bundle'] = empty($options['bundle']) ? null : $options['bundle'];

        if (empty($options['use'])) {
            $this->err(__d('eav', 'You must indicate a table alias name using the "--use" option. Example: "Articles.Users"'));

            return false;
        }

        try {
            $table = TableRegistry::get($options['use']);
        } catch (\Exception $ex) {
            $table = false;
        }

        if (!$table) {
            $this->err(__d('eav', 'The specified table does not exists.'));

            return false;
        } elseif (!$table->behaviors()->has('Eav')) {
            $this->err(__d('eav', 'The specified table is not using EAV behavior.'));

            return false;
        }

        $columns = $table->listColumns($options['bundle']);
        ksort($columns, SORT_LOCALE_STRING);
        $rows = [
            [
                __d('eav', 'Column Name'),
                __d('eav', 'Data Type'),
                __d('eav', 'Bundle'),
                __d('eav', 'Searchable'),
            ]
        ];

        foreach ($columns as $name => $info) {
            $rows[] = [
                $name,
                $info['type'],
                (!empty($info['bundle']) ? $info['bundle'] : '---'),
                (!empty($info['searchable']) ? 'no' : 'yes'),
            ];
        }

        $this->out();
        $this->out(__d('eav', 'EAV information for table "{0}":', $options['use']));
        $this->out();
        $this->helper('table')->output($rows);

        return true;
    }