Generate defined pluggable files.

@return void
17823
protected function generateFiles()
    {
        foreach ($this->files as $key => $file) {
            $file = $this->formatContent($file);

            $this->makeFile($key, $file);
        }
    }
374576
public function generateModels()
    {
        $sourceRoot = $this->source . '/Model';

        $destinationRoot = $this->cwd
            . $this->schema['paths']['model']
            . '/' . ucwords($this->schema['name']);

        if(!is_dir($destinationRoot)) {
            mkdir($destinationRoot, 0777, true);
        }

        foreach($this->schema['model'] as $action) {
            $source = $sourceRoot . '/' . ucwords($action) . '.html';

            $destination = $destinationRoot . '/' . ucwords($action) . '.php';

            if(!file_exists($source)) {
                Index::error(sprintf(
                    self::SKIP,
                    'Model',
                    ucwords($action)),
                false);

                continue;
            }

            $this->copy($source, $destination);
        }
    }
918490
public function generateFolders()
    {
        foreach ($this->getFolders() as $folder) {
            $path = $this->module->getModulePath($this->getName()).'/'.$folder;

            $this->filesystem->makeDirectory($path, 0755, true);

            $this->generateGitKeep($path);
        }
    }
423336
public function generateEntriesFromTypoScript()
    {
        $urlEntries = $this->pluginConfig['urlEntries'];
        foreach ($urlEntries as $urlEntry) {
            if (!empty($urlEntry['active'])) {
                $this->mapToEntries($urlEntry);
            }
        }
    }
1059792
private function canGenerate()
    {
        foreach ($this->generatedFiles as $file) {
            if ($uses = $file->getData('generator')) {
                if (count($uses) > 0) {
                    return true;
                }
            }
        }

        return false;
    }
460439
public function generate()
    {
        if (!is_dir($this->getInputDirectory())) {
            throw new \RuntimeException('The MakeDocs input directory does not exist.');
        }

        if (!$this->builders) {
            throw new \RuntimeException('No MakeDocs builders present.');
        }

        // First we change the working directory to the input, this makes rendering easier since
        // all paths are relative to source directory:
        $workingDirectory = getcwd();
        chdir($this->getInputDirectory());

        foreach ($this->builders as $builder) {
            $builder->build($this);
        }

        // Restore the working directory to its original form:
        chdir($workingDirectory);
    }
710421
private static function plugins()
    {
        $files = ['Plugins'];
        $folder = static::$root.'Plugins'.'/';

        self::call($files, $folder);

        $files = ['AutoloadFileNotFoundException', 'InfoStructureException'];
        $folder = static::$root.'Plugins/Exceptions'.'/';

        self::call($files, $folder);
    }
1325109
protected function availableReflections(): \Generator
    {
        /**
         * @var SplFileInfo
         */
        foreach ($this->finder->getIterator() as $file) {
            $reflection = new ReflectionFile((string)$file);

            if ($reflection->hasIncludes()) {
                //We are not analyzing files which has includes, it's not safe to require such reflections
                $this->getLogger()->warning(
                    sprintf("File `%s` has includes and excluded from analysis", $file),
                    compact('file')
                );

                continue;
            }

            /*
             * @var ReflectionFile $reflection
             */
            yield $reflection;
        }
    }
1154874
def generate_files!
      # iterate through the templates in reverse, so files in the templates
      # loaded last override the previously templates.
      @templates.reverse_each do |template|
        # copy in the static files first
        template.each_file(@markup) do |dest,file|
          generate_file dest, file
        end

        # then render the templates
        template.each_template(@markup) do |dest,file|
          generate_file dest, file, template: true
        end
      end

      @generated_files.each_value do |path|
        dir = path.split(File::SEPARATOR,2).first

        if dir == 'bin'
          chmod path, 0755
        end
      end
    end
178118
public function afterGenerate() {
    foreach ($this->extension as $name => $generated) {
      file_put_contents(
        $this->directory->getRealPath() . DIRECTORY_SEPARATOR . $name . '.php',
        $generated
      );
    }
  }
1031481
public function createStubs()
    {
        foreach ($this->options() as $stubKey => $fileName) {
            if(!blank($fileName) && $fileName) {
                $this->resourceName = $fileName;
                $this->stubKey = $stubKey;
                if($stubKey == 'key') {
                    $this->stubKey = $fileName;
                    $this->resourceName = strtolower($this->ask('Enter your file name'));
                }
                $configuration = $this->config->get('tie.stubs.structure.' . $this->stubKey);
                $this->createStubFiles($configuration);
            }
        }
    }
1266106
private function pluginMigrations()
    {
        $files = [];

        if (file_exists($this->pluginManifestOfMigrations)) {
            $basePath = base_path();
            /** @noinspection PhpIncludeInspection */
            $migrations = include $this->pluginManifestOfMigrations;
            foreach ($migrations as $name => $file) {
                $files[$name] = $basePath . DIRECTORY_SEPARATOR . $file;
            }
        }

        return $files;
    }
1303522
public function createPluginZips()
	{
		$path = $this->current . "/plugins";

		// Get every plugin
		$hdl = opendir($path);

		while ($entry = readdir($hdl))
		{
			// Only folders
			$p = $path . "/" . $entry;

			if (substr($entry, 0, 1) == '.')
			{
				continue;
			}

			if (!is_file($p))
			{
				// Plugin type folder
				$type = $entry;

				$hdl2 = opendir($p);

				while ($plugin = readdir($hdl2))
				{
					if (substr($plugin, 0, 1) == '.')
					{
						continue;
					}

					// Only folders
					$p2 = $path . "/" . $type . "/" . $plugin;

					if (!is_file($p2))
					{
						$plg = "plg_" . $type . "_" . $plugin;

						$this->say("Packaging Plugin " . $plg);

						// Package file
						$zip = new \ZipArchive(JPATH_BASE . "/dist", \ZipArchive::CREATE);

						$zip->open(JPATH_BASE . '/dist/zips/' . $plg . '.zip', \ZipArchive::CREATE);

						// Process the files to zip
						$this->addFiles($zip, $p2);

						// Close the zip archive
						$zip->close();
					}
				}

				closedir($hdl2);
			}
		}

		closedir($hdl);
	}
811481
public function createStoredFieldsFiles()
    {
        $this->_fdxFile = $this->_directory->createFile($this->_name . '.fdx');
        $this->_fdtFile = $this->_directory->createFile($this->_name . '.fdt');

        $this->_files[] = $this->_name . '.fdx';
        $this->_files[] = $this->_name . '.fdt';
    }
283745
protected function _generateFiles() {
        foreach ($this->selectedArtifacts as $artifact) {
            $settings = $artifact->getGeneratorSettings(static::getKey());

            foreach ($this->getFileOrDirectorySettings($settings, "files") as $file)
                $this->_processFileSpecification(
                    $artifact, fphp\Specification\FileSpecification::fromArrayAndSettings($file, $settings));

            foreach ($this->getFileOrDirectorySettings($settings, "directories") as $directory) {
                $directorySpecification = fphp\Specification\DirectorySpecification::fromArrayAndSettings($directory, $settings);
                
                foreach ($directorySpecification->getFileSpecifications() as $fileSpecification)
                    $this->_processFileSpecification($artifact, $fileSpecification);
            }
        }
    }
815524
public function generate()
    {
        if (empty($this->hosts)) {
            $host = $this->router->getContext()->getHost();
            $this->hosts = [$host];
        }
        if ($this->scheme === null) {
            $this->scheme = $this->router->getContext()->getScheme();
        }
        $schemeMode = Host::SCHEME_HTTP;
        if ($this->scheme == 'https') {
            $schemeMode = Host::SCHEME_HTTPS;
        } elseif ($this->scheme == 'https_only') {
            $schemeMode = Host::SCHEME_ONLY_HTTPS;
        }
        if (file_exists($this->webDir.'/robots.txt')) {
            unlink($this->webDir.'/robots.txt');
        }
        foreach ($this->hosts as $hostName) {
            $postfix = (count($this->hosts) > 1 ? '.'.$hostName : '');
            $host = new Host($hostName, $schemeMode, $this->port);
            $sitemap = new Sitemap($host);
            $this->configureRobotsFile($sitemap->getRobotsFile());
            $event = new SitemapGenerateEvent($sitemap);
            $this->eventDispatcher->dispatch(SitemapGenerateEvent::ON_SITEMAP_GENERATE, $event);
            $sitemap->save($this->webDir, $this->gzip, $postfix);
        }
    }
1139417
public function generateSlug()
    {
        if ( $this->getRegenerateSlugOnUpdate() || empty( $this->slug ) ) {
            $fields = $this->getSluggableFields();
            $values = [];

            foreach ($fields as $field) {
                if (property_exists($this, $field)) {
                    $val = $this->{$field};
                } else {
                    $methodName = 'get' . ucfirst($field);
                    if (method_exists($this, $methodName)) {
                        $val = $this->{$methodName}();
                    } else {
                        $val = null;
                    }
                }

                $values[] = $val;
            }

            $this->slug = $this->generateSlugValue($values);
        }
    }