Build the manifest and write it to disk.

@return array
763300
public function build()
    {
        $packages = [];

        if ($this->files->exists($path = $this->vendorPath.'/composer/installed.json')) {
            $packages = json_decode($this->files->get($path), true);
        }

        $ignoreAll = in_array('*', $ignore = $this->packagesToIgnore());

        $this->write($keys = collect($packages)->mapWithKeys(function ($package) {
            return [$this->format($package['name']) => $package['extra']['nano7'] ? $package['extra']['nano7'] : []];
        })->each(function ($configuration) use (&$ignore) {
            $ignore = array_merge($ignore, $configuration['dont-discover'] ? $configuration['dont-discover'] : []);
        })->reject(function ($configuration, $package) use ($ignore, $ignoreAll) {
            return $ignoreAll || in_array($package, $ignore);
        })->filter()->all());

        return $keys;
    }
923307
private function build(): void
    {
        $prefix = "<?xml version='1.0' encoding='UTF-8'?>" . $this->glue() . "<feed xmlns='http://www.w3.org/2005/Atom' xmlns:apps='http://schemas.google.com/apps/2006'>";
        $suffix = '</feed>';

        $xml = collect($this->filters)->map(function ($items) {
            return $this->buildEntry($items);
        })->implode($this->glue());

        $this->xml = collect([$prefix, $xml, $suffix])->implode($this->glue());

        if ($this->writeFile) {
            $this->filesystem->dumpFile($this->outputFile, $this->xml);
        }
    }
917761
public function writeData(): array
    {
        $dataBuilder = new DataBuilder();
        $dataBuilder->setString('n', $this->name, '')
                    ->setArray('t', $this->titles->writeData(), null, [])
                    ->setArray('d', $this->descriptions->writeData(), null, [])
                    ->setString('a', $this->author, '')
                    ->setString('v', $this->version, '')
                    ->setString('f', $this->fileName, '')
                    ->setString('i', $this->directoryName, '')
                    ->setArray('e', $this->dependencies, function (Dependency $dependency): array {
                        return $dependency->writeData();
                    }, [])
                    ->setString('h', $this->thumbnailHash, '')
                    ->setString('s', $this->checksum, '')
                    ->setInteger('o', $this->order, 0)
                    ->setArray('c', array_values(array_unique($this->combinationHashes)), 'strval', []);
        return $dataBuilder->getData();
    }
691645
public function build()
    {
        $params = [
            'badge' => $this->badge,
            'alert' => $this->alert,
            'sound' => $this->sound,
            'category' => $this->category,
            'expiry' => $this->expiryDate ? $this->expiryDate->format('c') : null,
            'custom_uri' => $this->uri,
            'message_variation_id' => $this->messageVariationId,
            'asset_url' => $this->assetUrl,
            'asset_file_type' => $this->assetFileType,
        ];

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

        return array_filter($params, function ($param) {
            return $param !== null;
        });
    }
62566
public function write()
	{
		$wddx	= $this->builder->build();
		$writer	= new FS_File_Writer( $this->fileName );
		return $writer->writeString( $wddx );
	}
864232
def write_manifest(self):
        
        if os.path.exists(self.directory.manifest_path):
            self.main_manifest.write(open(self.directory.manifest_path, "w+"))
985583
public function buildFileContents()
    {
        $data = array('pages' => $this->getPages());
        $output = array();
        $output[] = "var tipuesearch = " . json_encode($data) . ";";
        $output[] = null;

        return implode(PHP_EOL, $output);
    }
914271
public function build()
    {
        $files = $this->filesystem->listFiles($this->directory, $this->recursive);

        $this->cache->clear();

        foreach ($files as $file) {
            $entity = $this->parseFile($file);
            if ($entity != null) $this->cache->put($entity->getIdentifier(), $entity);
        }
        
        $this->cache->persist();
    }
409073
public function build()
    {
        $this->appendToFile($this->getFooter());

        if ($this->gzipOutput) {
            $this->writeGZipFile();
        }

        \fclose($this->filePointer);
    }
32307
protected function getFile()
    {
        $path = $this->directory.'/'.self::MANIFEST_FILENAME;
        $file = $this->pathHelper->getPublicPath($path, true);
        return $file;
    }
136755
protected function createManifestFile()
    {
        $manifestXmlFileContents = <<<EOD
<?xml version="1.0" encoding="UTF-8"?>
<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" manifest:version="1.2">
    <manifest:file-entry manifest:full-path="/" manifest:media-type="application/vnd.oasis.opendocument.spreadsheet"/>
    <manifest:file-entry manifest:full-path="styles.xml" manifest:media-type="text/xml"/>
    <manifest:file-entry manifest:full-path="content.xml" manifest:media-type="text/xml"/>
    <manifest:file-entry manifest:full-path="meta.xml" manifest:media-type="text/xml"/>
</manifest:manifest>
EOD;

        $this->createFileWithContents($this->metaInfFolder, self::MANIFEST_XML_FILE_NAME, $manifestXmlFileContents);

        return $this;
    }
260407
public function scan()
    {
        $paths = $this->getScanPaths();

        $components = [];

        foreach ($paths as $key => $path) {
            $manifests = $this->app['files']->glob("{$path}/component.json");

            is_array($manifests) || $manifests = [];

            foreach ($manifests as $manifest) {
                $name = Json::make($manifest)->get('name');

                $components[$name] = new Component($this->app, $name, dirname($manifest));
            }
        }

        return $components;
    }
1340892
public function getArrayCopy()
	{
		return array(
			'ProjectId' => $this->projectId,
			'Name' => $this->name,
			'Description' => $this->description,
			'Created' => $this->created,
			// *Extra* properties
			'CreatedFormatted' => $this->getCreatedFormatted()
		);
	}
742069
public function writeData(): array
    {
        $dataBuilder = new DataBuilder();
        $dataBuilder->setString('t', $this->type, '')
                    ->setString('n', $this->name, '')
                    ->setArray('l', $this->labels->writeData(), null, [])
                    ->setArray('d', $this->descriptions->writeData(), null, [])
                    ->setInteger('r', $this->providesRecipeLocalisation ? 1 : 0, 0)
                    ->setInteger('m', $this->providesMachineLocalisation ? 1 : 0, 0)
                    ->setString('i', $this->iconHash, '')
                    ->setInteger('e', $this->isNew ? 1 : 0, 1);
        return $dataBuilder->getData();
    }
699074
protected function generateManifest()
    {
        $manifest = $this->package->getManifestHeader();

        $requestedItems = $this->package->getServices();

        foreach ($requestedItems as $service => $resources) {
            foreach ($resources as $resourceName => $details) {
                if (isset($this->data[$service][$resourceName])) {
                    $records = $this->data[$service][$resourceName];
                    foreach ($records as $i => $record) {
                        $api = $service . '/' . $resourceName;
                        switch ($api) {
                            case 'system/user':
                            case 'system/admin':
                                $manifest['service'][$service][$resourceName][] =
                                    array_get($record, 'email', array_get($record, 'id', array_get($details, $i, [])));
                                break;
                            default:
                                $manifest['service'][$service][$resourceName][] =
                                    array_get($record, 'name', array_get($record, 'id', array_get($details, $i, [])));
                                break;
                        }
                    }
                } else {
                    $manifest['service'][$service][$resourceName] = $details;
                }
            }
        }

        return $manifest;
    }
148588
public function load()
    {
        $path = $this->manifestPath.'/collections.json';

        if ($this->files->exists($path) and is_array($manifest = json_decode($this->files->get($path), true)))
        {
            foreach ($manifest as $key => $entry)
            {
                $entry = new Entry($entry['fingerprints'], $entry['development']);

                $this->entries->put($key, $entry);
            }
        }
    }
1345547
public function build()
    {
        // The default time limit of 30 seconds is normally not enough
        Environment::increaseTimeLimitTo(600);

        // If this code is being run outside of a dev/build or without a ?flush query string param,
        // the class manifest hasn't been flushed, so do it here
        $request = $this->getRequest();
        if (!array_key_exists('flush', $request->getVars()) && strpos($request->getURL(), 'dev/build') !== 0) {
            ClassLoader::inst()->getManifest()->regenerate(false);
        }

        $url = $this->getReturnURL();
        if ($url) {
            echo "<p>Setting up the database; you will be returned to your site shortly....</p>";
            $this->doBuild(true);
            echo "<p>Done!</p>";
            $this->redirect($url);
        } else {
            $quiet = $this->request->requestVar('quiet') !== null;
            $fromInstaller = $this->request->requestVar('from_installer') !== null;
            $populate = $this->request->requestVar('dont_populate') === null;
            $this->doBuild($quiet || $fromInstaller, $populate);
        }
    }