---------------------------------------------------------------------------- Main ----------------------------------------------------------------------------
174663
function checkSourceInfo () {
  return new Promise((resolve, reject) => {
    let ok = pjson.name === oldInfo.packageName
    ok = ok && readSync('android/app/src/main/AndroidManifest.xml').includes(`package="${oldInfo.packageID}"`)

    if (!ok) {
      reject(new Error('The App name is already modified.'))
      return
    }

    console.log()
    console.log('---------------------------------------------------------')
    console.log('New project parameters:')
    console.log('---------------------------------------------------------')
    console.log('App display name :', newInfo.appName)
    console.log('Project name     :', newInfo.projectName)
    console.log('Package name     :', newInfo.packageName)
    console.log('Package id       :', newInfo.packageID)
    console.log('---------------------------------------------------------')

    let r = null
    try {
      r = readline.createInterface({
        input: process.stdin,
        output: process.stdout,
      })
      r.question('Is this correct?', (answer) => {
        r.close()
        resolve(answer)
      })
    } catch (e) {
      if (r) {
        r.close()
      }
      reject(e)
    }
  })
}
131306
public function main()
    {
        $this->validate();
        $this->datetimeTaskStart = new \DateTimeImmutable();

        if ($this->describeMainStack()) {
            $this->updateStacks();
        } else {
            $this->creationStacks();
        }

        while (!$this->stackIsReady()) {
            sleep(3);
            if (empty($this->events)) {
                $this->log("Waiting for stack provisioning...");
            }
        }

        $stacks = $this->describeMainStack($e);

        if (null === $stacks) {
            throw $e;
        }

        $outputLog = '';

        if ($stacks[0]['Outputs']) {
            foreach ($stacks[0]['Outputs'] as $row) {
                $outputLog .= PHP_EOL . $row['OutputKey'] . ': ' . $row['OutputValue'];
                if ($output = $this->getOutput($row['OutputKey'])) {
                    /** @var StackOutput $output */
                    $this->project->setProperty($output->getProperty(), $row['OutputValue']);
                }
            }
        }

        $this->log($outputLog);
    }
1276699
public function main()
	{
		$this->addProperty('yii.version',$this->getYiiVersion());
		$this->addProperty('yii.revision',$this->getYiiRevision());
		$this->addProperty('yii.winbuild', substr(PHP_OS, 0, 3) == 'WIN' ? 'true' : 'false');
		$this->addProperty('yii.release',$this->getYiiRelease());
		$this->addProperty('yii.date',date('M j, Y'));
	}
1307303
function main()
{
	aqParseOptions();

	aq_queuename = 'amqpsnoop.' + Math.random() * 10000000;
	aq_amqp = mod_amqp.createConnection(aq_broker);
	aq_amqp.on('ready', function () {
		aq_queue = aq_amqp.queue(aq_queuename,
		    { exclusive: true }, function () {
			aq_queue.bind(aq_exchange, aq_routekey);
			aq_queue.subscribe(aqReceiveMessage);
		    });
	});
}
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();
    }
122411
public function main()
    {
        $this->ini = new IniFileConfig();
        $readFile = null;
        $writeFile = null;

        if (null !== $this->source && null === $this->dest) {
            $readFile = $this->source;
        } elseif (null !== $this->dest && null === $this->source) {
            $readFile = $this->dest;
        } else {
            $readFile = $this->source;
        }

        if (null !== $this->dest) {
            $writeFile = $this->dest;
        } elseif (null !== $this->source) {
            $writeFile = $this->source;
        } else {
            $writeFile = $this->dest;
        }

        if ($readFile === null && $writeFile === null) {
            $msg = "Neither source nor dest is set";
            if ($this->haltonerror) {
                throw new BuildException($msg);
            }
            $this->log($msg, Project::MSG_ERR);
            return;
        }

        if (!$this->checkReadFile($readFile)) {
            return;
        }

        if (!$this->checkWriteFile($writeFile)) {
            return;
        }

        $this->enumerateGets();
        $this->enumerateSets();
        $this->enumerateRemoves();

        if (count($this->sets) || count($this->removals)) {
            try {
                $this->ini->write($writeFile);
                $this->log("Wrote to $writeFile");
            } catch (Exception $ex) {
                $msg = $ex->getMessage();
                if ($this->haltonerror) {
                    throw new BuildException($msg);
                }
                $this->log($msg, Project::MSG_ERR);
            }
        }
    }
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 );
	}
1355762
public function main()
    {
        $msg = '';
        $title = 'Phing';
        $executable = 'notify-send';

        if ($this->title != '') {
            $title = "'" . $this->title . "'";
        }

        if ($this->msg != '') {
            $msg = "'" . $this->msg . "'";
        }

        $cmd = $executable . ' -i ' . $this->icon . ' ' . $title . ' ' . $msg;

        $this->log(sprintf("Title: '%s'", $title), Project::MSG_DEBUG);
        $this->log(sprintf("Message: '%s'", $msg), Project::MSG_DEBUG);
        $this->log($msg, Project::MSG_INFO);

        $this->log(sprintf("cmd: %s", $cmd), Project::MSG_DEBUG);
        if (!$this->silent) {
            $fs = FileSystem::getFileSystem();
            if ($fs->which($executable) !== false) {
                exec(escapeshellcmd($cmd), $output, $return);
                if ($return !== 0) {
                    throw new BuildException("Notify task failed.");
                }
            } else {
                $this->log("Executable ($executable) not found", Project::MSG_DEBUG);
            }
        } else {
            $this->log("Silent flag set; not executing", Project::MSG_DEBUG);
        }
    }
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());
    }
426021
public function main()
    {
        $this->validate();

        try {
            if ($this->to !== null) {
                // create a file writer to append to "to" file.
                $writer = new FileWriter($this->to, $this->append);
            } else {
                $writer = new LogWriter($this);
            }

            if ($this->text !== null) {
                // simply append the text
                if ($this->to instanceof PhingFile) {
                    $this->log("Appending string to " . $this->to->getPath());
                }

                $text = $this->text;
                if ($this->filtering) {
                    $fr = $this->getFilteredReader(new StringReader($text));
                    $text = $fr->read();
                }

                $text = $this->appendHeader($text);
                $text = $this->appendFooter($text);
                $writer->write($text);
            } else {
                // append explicitly-specified file
                if ($this->file !== null) {
                    try {
                        $this->appendFile($writer, $this->file);
                    } catch (Exception $ioe) {
                        $this->log(
                            "Unable to append contents of file " . $this->file->getAbsolutePath() . ": " . $ioe->getMessage(),
                            Project::MSG_WARN
                        );
                    }
                }

                // append any files in filesets
                foreach ($this->filesets as $fs) {
                    try {
                        if ($fs instanceof Path) {
                            $files = $fs->listPaths();
                            $this->appendFiles($writer, $files);
                        } elseif ($fs instanceof FileSet) {
                            $files = $fs->getDirectoryScanner($this->project)->getIncludedFiles();
                            $this->appendFiles($writer, $files, $fs->getDir($this->project));
                        }
                    } catch (BuildException $be) {
                        if (strpos($be->getMessage(), 'is the same as the output file') === false) {
                            $this->log($be->getMessage(), Project::MSG_WARN);
                        } else {
                            throw new BuildException($be->getMessage());
                        }
                    } catch (IOException $ioe) {
                        throw new BuildException($ioe);
                    }
                }

                foreach ($this->filelists as $list) {
                    $dir = $list->getDir($this->project);
                    $files = $list->getFiles($this->project);
                    foreach ($files as $file) {
                        $this->appendFile($writer, new PhingFile($dir, $file));
                    }
                }
            }
        } catch (Exception $e) {
            throw new BuildException($e);
        }

        $writer->close();
    }
905568
public function main()
    {
        $ret = '';

        $settings = GeneralUtility::getRootSetting();

        // INIT
        $this->tsSetup = $GLOBALS['TSFE']->tmpl->setup;
        $this->cObj    = $GLOBALS['TSFE']->cObj;
        $this->rootPid = GeneralUtility::getRootPid();

        $this->tsSetupSeo = null;
        if (!empty($this->tsSetup['plugin.']['metaseo.']['robotsTxt.'])) {
            $this->tsSetupSeo = $this->tsSetup['plugin.']['metaseo.']['robotsTxt.'];
        }

        // check if sitemap is enabled in root
        if (!GeneralUtility::getRootSettingValue('is_robotstxt', true)) {
            return true;
        }

        $this->linkToStaticSitemap = GeneralUtility::getRootSettingValue('is_robotstxt_sitemap_static', false);

        // Language lock
        $this->sitemapLanguageLock = GeneralUtility::getRootSettingValue('is_sitemap_language_lock', false);
        $this->languageId          = GeneralUtility::getLanguageId();

        // ###############################
        // Fetch robots.txt content
        // ###############################
        $settings['robotstxt'] = trim($settings['robotstxt']);

        if (!empty($settings['robotstxt'])) {
            // Custom Robots.txt
            $ret .= $settings['robotstxt'];
        } elseif ($this->tsSetupSeo) {
            // Default robots.txt
            $ret .= $this->cObj->cObjGetSingle($this->tsSetupSeo['default'], $this->tsSetupSeo['default.']);
        }

        // ###############################
        // Fetch extra robots.txt content
        // ###############################
        // User additional
        if (!empty($settings['robotstxt_additional'])) {
            $ret .= "\n\n" . $settings['robotstxt_additional'];
        }

        // Setup additional
        if ($this->tsSetupSeo) {
            // Default robots.txt
            $tmp = $this->cObj->cObjGetSingle($this->tsSetupSeo['extra'], $this->tsSetupSeo['extra.']);

            if (!empty($tmp)) {
                $ret .= "\n\n" . $tmp;
            }
        }

        // ###############################
        // Marker
        // ###############################
        if (!empty($this->tsSetupSeo['marker.'])) {
            $ret = $this->applyMarker($ret);
        }

        // Call hook
        GeneralUtility::callHookAndSignal(__CLASS__, 'robotsTxtOutput', $this, $ret);

        return $ret;
    }
583835
public function main()
    {
        // INIT
        $this->metaTagList = array();

        $this->initialize();

        $sysLanguageId = 0;
        if (!empty($this->tsSetup['config.']['sys_language_uid'])) {
            $sysLanguageId = $this->tsSetup['config.']['sys_language_uid'];
        }

        // Init News extension
        $this->initExtensionSupport();

        if ($this->tsSetupSeo) {
            $this->collectMetaDataFromPage();
            $customMetaTagList = $this->collectMetaDataFromConnector();

            // #####################################
            // Blacklists
            // #####################################

            // Check search engine indexing blacklist
            if (!empty($this->tsSetupSeo['robotsIndex.']['blacklist.'])) {
                // Page is blacklisted, set to noindex
                $this->tsSetupSeo['robotsIndex'] = 0;
            }

            // #####################################
            // Process StdWrap List
            // #####################################
            $stdWrapItemList = array(
                'title',
                'description',
                'keywords',
                'copyright',
                'email',
                'author',
                'publisher',
                'distribution',
                'rating',
                'lastUpdate',
            );
            foreach ($stdWrapItemList as $key) {
                $this->tsSetupSeo[$key] = $this->applyStdWrap($key, $this->tsSetupSeo[$key]);
            }

            // Call hook
            GeneralUtility::callHookAndSignal(
                __CLASS__,
                'metatagSetup',
                $this,
                $this->tsSetupSeo
            );

            // standard metatags
            $this->generateStandardMetaTags();

            // crawler (eg. robots)
            $this->generateCrawlerMetaTags();

            // geo position
            $this->generateGeoPosMetaTags();

            // services (eg. google plus)
            $this->generateServicesMetaTags();

            // user agent stuff
            $this->generateUserAgentMetaTags();

            // Link meta tags (eg. prev, next...)
            if (!empty($this->tsSetupSeo['linkGeneration'])) {
                $this->generateLinkMetaTags();
            }

            // canonical url
            $this->generateCanonicalUrlMetaTags();

            // OpenGraph
            if (!empty($this->tsSetupSeo['opengraph']) && !empty($this->tsSetupSeo['opengraph.'])) {
                $this->generateOpenGraphMetaTags();
            }

            // Advanced meta tags
            $this->advMetaTags($this->metaTagList, $this->pageRecord, $sysLanguageId, $customMetaTagList);
        }

        // #################
        // SOCIAL
        // #################
        if (!empty($this->tsSetup['plugin.']['metaseo.']['social.'])) {
            $this->tsSetupSeo = $this->tsSetup['plugin.']['metaseo.']['social.'];

            if (!empty($this->tsSetupSeo['googlePlus.']['profilePageId'])) {
                $this->metaTagList['social.googleplus.direct-connect'] = array(
                    'tag'        => 'link',
                    'attributes' => array(
                        'rel'  => 'publisher',
                        'href' => 'https://plus.google.com/' . $this->tsSetupSeo['googlePlus.']['profilePageId'],
                    ),
                );
            }
        }

        $this->processMetaTags($this->metaTagList);

        return $this->renderMetaTags($this->metaTagList);
    }
833991
public function main()
    {
        if ($this->realThing === null) {
            // plain impossible to get here, maybeConfigure should
            // have thrown an exception.
            throw new BuildException("Should not be executing UnknownElement::main() -- task/type: {$this->elementName}");
        }

        if ($this->realThing instanceof Task) {
            $this->realThing->main();
        }
    }
258210
function _main() {
  const {guides: acGuidePaths, images: acGuideImagesPaths, examples: acExamplePaths} = getPathsFromAioContent();
  const {guides: coGuidePaths, images: coGuideImagesPaths, examples: coExamplePaths} = getPathsFromCodeowners();

  const guidesDiff = arrayDiff(acGuidePaths, coGuidePaths);
  const imagesDiff = arrayDiff(acGuideImagesPaths, coGuideImagesPaths);
  const examplesDiff = arrayDiff(acExamplePaths, coExamplePaths);
  const hasDiff = !!(guidesDiff.diffCount || imagesDiff.diffCount || examplesDiff.diffCount);

  if (hasDiff) {
    const expectedGuidesSrc = path.relative(PROJECT_ROOT_DIR, AIO_GUIDES_DIR);
    const expectedImagesSrc = path.relative(PROJECT_ROOT_DIR, AIO_GUIDE_IMAGES_DIR);
    const expectedExamplesSrc = path.relative(PROJECT_ROOT_DIR, AIO_GUIDE_EXAMPLES_DIR);
    const actualSrc = path.relative(PROJECT_ROOT_DIR, CODEOWNERS_PATH);

    reportDiff(guidesDiff, expectedGuidesSrc, actualSrc);
    reportDiff(imagesDiff, expectedImagesSrc, actualSrc);
    reportDiff(examplesDiff, expectedExamplesSrc, actualSrc);
  }

  process.exit(hasDiff ? 1 : 0);
}
718361
public function main(): void
    {
        $pumlDiagram = $this->generatePumlDiagram();
        $destination = $this->resolveImageDestination();
        $format = $this->getFormat();
        $image = $this->generateImage($pumlDiagram, $format);
        $this->saveToFile($image, $destination);
    }
29671
public function main()
    {
        # The theme is activated.
        # Location: Resources/Themes/Default/
        Theme::active('Default');
        
        # The current settings are being configured.
        Masterpage::headPage('Sections/head')
                  ->bodyPage('Sections/body')
                  ->browserIcon(FILES_DIR . 'favicon.ico')
                  ->backgroundImage(FILES_DIR . 'background.jpg');
    }
846744
public function main()
    {
        $this->validateAttributes();

        if ($this->action == 'w') {
            $this->write();
        } elseif ($this->action == 'r') {
            $this->read();
        }
    }