Compile the migration stub.

@return string
493508
protected function compileLocalizationStub()
    {
        $stub = $this->files->get(substr(__DIR__,0, -5) . 'Stubs/localization.stub');

        $this->build($stub);

        return $stub;
    }
887300
private function migration()
    {
        $migrationContent = "<?php\n\n".view('scaffold-interface::template.ManyToMany.migration', $this->tables)->render();

        $migrationFileName = date('Y').'_'.date('m').'_'.date('d').'_'.date('his').'_'.ucfirst($this->tables['first']).ucfirst($this->tables['second']).'.php';

        $this->make(config('amranidev.config.migration').'/'.$migrationFileName, $migrationContent);
    }
1260747
def compile(self, name, migrate='', rollback='', num=None):
        """"""
        if num is None:
            num = len(self.todo)

        name = '{:03}_'.format(num + 1) + name
        filename = name + '.py'
        path = os.path.join(self.migrate_dir, filename)
        with open(path, 'w') as f:
            f.write(MIGRATE_TEMPLATE.format(migrate=migrate, rollback=rollback, name=filename))

        return name
832954
public function compile()
    {
        $report = $this->internalCompile();
        if ($report->getType() == common_report_Report::TYPE_SUCCESS) {
            // replace instances with service
            list($item, $publicDirectory, $privateDirectory) = $report->getData();
            $report->setData($this->createQtiService($item, $publicDirectory, $privateDirectory));
        }
        return $report;
    }
1002193
protected function compile()
  {

    $arrData = array();

    $strWhere = " WHERE member=0";
    if (FE_USER_LOGGED_IN)
    {
      $this->import('FrontendUser', 'User');
      $strWhere = " WHERE member=" . $this->User->id;
    }

    if ($this->showWithoutFilter)
    {
      $strWhere = "";
    }


    if ($this->showTracks)
    {
      $objTracks = $this->Database->prepare("SELECT tl_c4g_tracking_tracks.*, CONCAT('track') as type, count(*) as count FROM tl_c4g_tracking_tracks LEFT JOIN tl_c4g_tracking_positions ON tl_c4g_tracking_positions.track_uuid=tl_c4g_tracking_tracks.uuid" . $strWhere . " GROUP BY tl_c4g_tracking_tracks.id")
                                  ->execute();
      if ($objTracks->numRows > 0)
      {
        $arrTracks = $objTracks->fetchAllAssoc();
        $arrData = array_merge($arrData, $arrTracks);
      }
    }
    if ($this->showPois)
    {
      $objPois = $this->Database->prepare("SELECT *, CONCAT('poi') as type FROM tl_c4g_tracking_pois" . $strWhere)
                                  ->execute();
      if ($objPois->numRows > 0)
      {
        $arrPois = $objPois->fetchAllAssoc();
        $arrData = array_merge($arrData, $arrPois);
      }
    }

    uasort($arrData, array($this, 'sortByTstamp'));

    $arrDataManipulatet = array();

    $blnUseEditLink = false;
    if (($objJumpTo = $this->objModel->getRelated('jumpTo')) !== null)
		{
      $blnUseEditLink = true;
      $arrJumpTo = $objJumpTo->row();
		}

    foreach ($arrData as $arrEntry)
    {

      $arrEntry['date'] = \Date::parse(\Date::getNumericDateFormat(),$arrEntry['tstamp']);
      $arrEntry['datim'] = \Date::parse(\Date::getNumericDatimFormat(),$arrEntry['tstamp']);
      if ($blnUseEditLink)
      {
        if ($this->editWithoutFilter || (FE_USER_LOGGED_IN && $this->User->id==$arrEntry['member']))
        {
          $arrEntry['editHref'] = ampersand($this->generateFrontendUrl($arrJumpTo, ((\Config::get('useAutoItem') && !\Config::get('disableAlias')) ?  '/' : '/items/') . $arrEntry['type'] . '_' . $arrEntry['id']));
        }
      }

      //((\Config::get('useAutoItem') && !\Config::get('disableAlias')) ?  '/' : '/items/') . ((!\Config::get('disableAlias') && $objItem->alias != '') ? $objItem->alias : $objItem->id)));

      $arrDataManipulatet[] = $arrEntry;
    }

    //print_r($arrDataManipulatet);
    $this->Template->data = $arrDataManipulatet;

  }
856703
public function migrate(): array
    {
        $result = $this->getFactory()->createPropelCommandProvider()->execute('migration:diff');
        return array_merge(
            $result,
            $this->getFactory()->createPropelCommandProvider()->execute('migration:migrate')
        );
    }
717703
protected function compileRouteStub()
    {
        $stub = $this->files->get(substr(__DIR__,0, -5) . 'Stubs/route.stub');

        $this->buildStub($this->scaffoldCommandObj->getMeta(), $stub);

        return $stub;
    }
299077
public function generateMigration(): string
    {
        if (empty($this->_modifications)) {
            return parent::generateMigration();
        }

        return $this->view->renderFile(Yii::getAlias($this->templateFileUpdate), [
            'className' => $this->className,
            'table' => $this->table,
            'plan' => $this->plan,
            'namespace' => $this->normalizedNamespace
        ]);
    }
750646
def compile_migrations(migrator, models, reverse=False):
    """"""
    source = migrator.orm.values()
    if reverse:
        source, models = models, source

    migrations = diff_many(models, source, migrator, reverse=reverse)
    if not migrations:
        return False

    migrations = NEWLINE + NEWLINE.join('\n\n'.join(migrations).split('\n'))
    return CLEAN_RE.sub('\n', migrations)
904148
public function compile($stub, $modelName, $modelData, stdClass $scaffolderConfig, $hash, array $extensions, $extra = null)
    {
        $this->stub = $stub;

        $this->replaceResource($modelName);

        return $this->stub;
    }
681019
protected function compileStub($stub, array $data)
    {
        $stub = $this->files->get(__DIR__ . '/../stub/' . $stub);

        foreach ($data as $key => $value) {
            $stub = str_replace('{{' . $key . '}}', $value, $stub);
        }

        return $stub;
    }
789541
public function compile()
    {
        $translator = $this
            ->checkNamespace($this->configuration)
            ->checkAlias($this->configuration)
            ->checkMethods($this->configuration)
            ->createTranslator();

        return $translator;
    }
794532
public function compile() {
		foreach ($this->_params as $key => $value) {
			if (!strpos($key, ':')) {
				continue;
			}
			unset($this->_params[$key]);
			$this->_meta[$key] = $value;
		}

		$this->_match = $this->_params;

		if ($this->_template === '/' || $this->_template === '') {
			$this->_pattern = '@^/*$@';
			return;
		}
		$this->_pattern = "@^{$this->_template}\$@";
		$match = '@([/.])?\{:([^:}]+):?((?:[^{]+?(?:\{[0-9,]+\})?)*?)\}@S';

		if ($this->_config['unicode']) {
			$this->_pattern .= 'u';
		}
		preg_match_all($match, $this->_pattern, $m);

		if (!$tokens = $m[0]) {
			return;
		}
		$slashes = $m[1];
		$params = $m[2];
		$regexs = $m[3];
		unset($m);
		$this->_keys = [];

		foreach ($params as $i => $param) {
			$this->_keys[$param] = $param;
			$this->_pattern = $this->_regex($regexs[$i], $param, $tokens[$i], $slashes[$i]);
		}
		$this->_defaults += array_intersect_key($this->_params, $this->_keys);
		$this->_match = array_diff_key($this->_params, $this->_defaults);
	}
7045
public function getStub()
    {
        $parser = $this->getNameParser();

        if ($this->existing) {
            $this->name = 'create_'.str_plural($this->name).'_table';
            
            $parser = $this->getNameParser();
                
            $fields = (new TableDumper($parser->getTable()))->toSchema();

            $stub = Stub::create('/migration/create.stub', [
                'class' => $this->getClass(),
                'table' => $parser->getTable(),
                'fields' => (new SchemaParser($fields))->render(),
            ]);
        }
        elseif ($parser->isCreate()) {
            $stub = Stub::create('/migration/create.stub', [
                'class' => $this->getClass(),
                'table' => $parser->getTable(),
                'fields' => $this->getSchemaParser()->render(),
            ]);
        } elseif ($parser->isAdd()) {
            $stub = Stub::create('/migration/add.stub', [
                'class' => $this->getClass(),
                'table' => $parser->getTable(),
                'fields_up' => $this->getSchemaParser()->up(),
                'fields_down' => $this->getSchemaParser()->down(),
            ]);
        } elseif ($parser->isDelete()) {
            $stub = Stub::create('/migration/delete.stub', [
                'class' => $this->getClass(),
                'table' => $parser->getTable(),
                'fields_down' => $this->getSchemaParser()->up(),
                'fields_up' => $this->getSchemaParser()->down(),
            ]);
        } elseif ($parser->isDrop()) {
            $stub = Stub::create('/migration/drop.stub', [
                'class' => $this->getClass(),
                'table' => $parser->getTable(),
                'fields' => $this->getSchemaParser()->render(),
            ]);
        } else {
            $stub = false;
        }

        if ($stub) {
            return $stub->render();
        }

        return parent::getStub();
    }
575286
protected function getTemplateContents()
    {
        $parser = new NameParser($this->argument('name'));

        if ($parser->isCreate()) {
            return Stub::create('/migration/create.stub', [
                'class' => $this->getClass(),
                'table' => $parser->getTable(),
                'fields' => $this->getSchemaParser()->render(),
            ]);
        } elseif ($parser->isAdd()) {
            return Stub::create('/migration/add.stub', [
                'class' => $this->getClass(),
                'table' => $parser->getTable(),
                'fields_up' => $this->getSchemaParser()->up(),
                'fields_down' => $this->getSchemaParser()->down(),
            ]);
        } elseif ($parser->isDelete()) {
            return Stub::create('/migration/delete.stub', [
                'class' => $this->getClass(),
                'table' => $parser->getTable(),
                'fields_down' => $this->getSchemaParser()->up(),
                'fields_up' => $this->getSchemaParser()->down(),
            ]);
        } elseif ($parser->isDrop()) {
            return Stub::create('/migration/drop.stub', [
                'class' => $this->getClass(),
                'table' => $parser->getTable(),
                'fields' => $this->getSchemaParser()->render(),
            ]);
        }

        throw new \InvalidArgumentException('Invalid migration name');
    }
464590
public function compile($stub, $modelName, $modelData, stdClass $scaffolderConfig, $hash, array $extensions, $extra = null)
    {
        if (File::exists(base_path('scaffolder-config/cache/api_controller_' . $hash . self::CACHE_EXT)))
        {
            return $this->store($modelName, $scaffolderConfig, '', new FileToCompile(true, $hash));
        }
        else
        {
            $this->stub = $stub;

            $this->replaceClassName($modelName)
                ->setValidations($modelData);

            return $this->store($modelName, $scaffolderConfig, $this->stub, new FileToCompile(false, $hash));
        }
    }
373233
public function compile()
    {
        $this->manageInheritance();
        $this->serviceConfig = $this->insertParameters($this->serviceConfig);
        $this->buildArguments('Arguments');
        $this->buildArguments('MethodArguments');
        $this->buildCallsArguments();
        $this->buildFactoryArgument();

        return $this->buildServiceConfig();
    }