Create Manifest
@param array $dados
160672
private function createManifest(array $dados)
    {
        //Cria Tamanhos de Ícones
        $this->createFaviconSizes($dados);

        //Create Manifest
        $theme = explode("}", explode(".theme{", file_get_contents(PATH_HOME . "public/assets/theme.min.css"))[1])[0];
        $themeBack = explode("!important", explode("background-color:", $theme)[1])[0];
        $themeColor = explode("!important", explode("color:", $theme)[1])[0];
        $faviconName = pathinfo($dados['favicon'], PATHINFO_FILENAME);
        $faviconExt = pathinfo($dados['favicon'], PATHINFO_EXTENSION);
        $content = str_replace(['{$sitename}', '{$faviconName}', '{$faviconExt}', '{$theme}', '{$themeColor}'], [$dados['sitename'], $faviconName, $faviconExt, $themeBack, $themeColor], file_get_contents(PATH_HOME . VENDOR . "config/public/installTemplates/manifest.txt"));

        $fp = fopen(PATH_HOME . "manifest.json", "w");
        fwrite($fp, $content);
        fclose($fp);
    }
1338612
public function add_new_organization(cc_i_organization &$org) {
        $norg    = $this->activemanifest->create_organization_node($org, $this->doc);
        $orgnode = $this->node("//imscc:manifest[@identifier='".
            $this->activemanifest->manifestID().
            "']/imscc:organizations");
        $orgnode->appendChild($norg);
    }
490158
protected function createConnection($pdo)
    {
        $params = [
            'user' => $this->config['username'],
            'password' => $this->config['password'],
            'pdo' => $pdo,
            'driverClass' => DoctrineDriver::class,
        ];
        $this->doctrineConnection = \Doctrine\DBAL\DriverManager::getConnection($params);
    }
1136844
protected function create_metadata_manifest(cc_i_metadata_manifest $met, DOMDocument &$doc, $xmlnode = null) {

        $dnode = $doc->createElementNS($this->ccnamespaces['lomimscc'], "lom");
        if (!empty($xmlnode)) {
            $xmlnode->appendChild($dnode);
        }
        $dnodegeneral   = empty($met->arraygeneral) ? null : $this->create_metadata_general($met, $doc, $xmlnode);
        $dnodetechnical = empty($met->arraytech) ? null : $this->create_metadata_technical($met, $doc, $xmlnode);
        $dnoderights    = empty($met->arrayrights) ? null : $this->create_metadata_rights($met, $doc, $xmlnode);
        $dnodelifecycle = empty($met->arraylifecycle) ? null : $this->create_metadata_lifecycle($met, $doc, $xmlnode);

        !is_null($dnodegeneral) ? $dnode->appendChild($dnodegeneral) : null;
        !is_null($dnodetechnical) ? $dnode->appendChild($dnodetechnical) : null;
        !is_null($dnoderights) ? $dnode->appendChild($dnoderights) : null;
        !is_null($dnodelifecycle) ? $dnode->appendChild($dnodelifecycle) : null;

        return $dnode;

    }
1327476
public function attach($dados)
    {
        foreach ($dados as $item => $value) {
            $this->{$item} = $value;
        }

        $this->withDefaultValuesValidation();
    }
1122710
public function create(array $aData = [], $bReturnObject = false)
    {
        $oDb    = Factory::service('Database');
        $sTable = $this->getTableName();

        // --------------------------------------------------------------------------

        //  Execute the data pre-write hooks
        $this
            ->prepareCreateData($aData)
            ->prepareWriteData($aData);

        // --------------------------------------------------------------------------

        //  If there are any expandable fields which should automatically save,
        //  then separate them out now
        $aAutoSaveExpandableFields = $this->autoSaveExpandableFieldsExtract($aData);

        // --------------------------------------------------------------------------

        $this
            ->setDataTimestamps($aData)
            ->setDataUsers($aData)
            ->setDataSlug($aData)
            ->setDataToken($aData);

        // --------------------------------------------------------------------------

        if ($this->saveToDb($aData)) {

            if (classUses($this, Localised::class)) {
                $iId = $aData['id'];
            } else {
                $iId = $oDb->insert_id();
            }

            $this->autoSaveExpandableFieldsSave($iId, $aAutoSaveExpandableFields);
            $this->triggerEvent(static::EVENT_CREATED, [$iId]);

            return $bReturnObject ? $this->getById($iId) : $iId;

        } else {
            return null;
        }
    }
939555
public static function createConfig(array $dados = [])
    {
        $path = defined("PATH_HOME") ? PATH_HOME : "../../../";
        if (empty($dados))
            $dados = json_decode(file_get_contents($path . "_config/config.json"), true);
        else
            self::writeFile("_config/config.json", json_encode($dados));

        $conf = "<?php\n";
        foreach ($dados as $dado => $value) {
            $value = (is_bool($value) ? ($value ? 'true' : 'false') : "'{$value}'");
            $conf .= "define('" . strtoupper(trim($dado)) . "', {$value});\n";
        }

        //atualiza versão do Service Worker
        if(file_exists(PATH_HOME . "service-worker.js")) {
            $serviceWorker = file_get_contents(PATH_HOME . "service-worker.js");
            $version = (float)explode("'", explode("const VERSION = '", $serviceWorker)[1])[0];
            $serviceWorker = str_replace("const VERSION = '{$version}'", "const VERSION = '{$dados['version']}'", $serviceWorker);
            self::writeFile("service-worker.js", $serviceWorker);
        }

        $conf .= "\nrequire_once PATH_HOME . 'vendor/autoload.php';\nnew Route\Sessao();";

        self::writeFile("_config/config.php", $conf);
    }
849736
def create_manifest(self):
        
        self.manifest = {}
        self.manifest['applications'] = [{'name': self.app_name}]
        self.manifest['services'] = []
        self.manifest['env'] = {
                'PREDIXPY_VERSION': str(predix.version),
                }

        self.write_manifest()
1262667
public static function createFromOptions(array $options)
    {
        Validate::notNull($options['Name'], 'options[Name]');
        Validate::notNull($options['ParentAssetId'], 'options[ParentAssetId]');

        $assetFile = new self($options['Name'], $options['ParentAssetId']);
        $assetFile->fromArray($options);

        return $assetFile;
    }
350929
private function execute()
    {
        $this->connect();
        try {
            $this->create->execute($this->dados);
            $this->result = $this->conn->lastInsertId();
        } catch (\PDOException $e) {
            $this->result = null;
            $this->erro = "<b>Erro ao cadastrar: ({$this->tabela})</b> {$e->getMessage()}";
        }

        parent::setDefault();
    }
916017
public function generateManifest(array $schemas)
    {
        $response = new GeneratorResponse();
        $manifests = ['all' => []];

        /** @var SchemaDescriptor $schema */
        foreach ($schemas as $schema) {
            $id = $schema->getId();
            $curie = $id->getCurie();
            $pkg = "{$id->getVendor()}-{$id->getPackage()}";
            $category = $id->getCategory() ? "category-{$id->getCategory()}" : '';
            if (!isset($manifests[$pkg])) {
                $manifests[$pkg] = [];
            }

            if (!isset($manifests[$category])) {
                $manifests[$category] = [];
            }

            if ($schema->isMixinSchema()) {
                continue;
            }

            if (isset($manifests['all'][$id->getCurieWithMajorRev()])) {
                continue;
            }

            if (!SchemaStore::hasOtherSchemaMajorRev($id)) {
                $manifests['all'][$curie] = $schema;
                $manifests[$pkg][$curie] = $schema;
                $manifests[$category][$curie] = $schema;
                continue;
            }

            if ($schema->isLatestVersion()) {
                $manifests['all'][$curie] = $schema;
                $manifests[$pkg][$curie] = $schema;
                $manifests[$category][$curie] = $schema;
            }

            $manifests['all'][$id->getCurieWithMajorRev()] = $schema;
            $manifests[$pkg][$id->getCurieWithMajorRev()] = $schema;
            $manifests[$category][$id->getCurieWithMajorRev()] = $schema;

            /** @var SchemaDescriptor $s */
            foreach (SchemaStore::getOtherSchemaMajorRev($schema->getId()) as $s) {
                $spkg = "{$s->getId()->getVendor()}-{$s->getId()->getPackage()}";
                $scategory = "category-{$s->getId()->getCategory()}";
                $manifests['all'][$s->getId()->getCurieWithMajorRev()] = $s;
                $manifests[$spkg][$s->getId()->getCurieWithMajorRev()] = $s;
                $manifests[$scategory][$s->getId()->getCurieWithMajorRev()] = $s;
            }
        }

        foreach ($manifests as $group => $schemas) {
            if ('all' !== $group) {
                // we are getting rid of manifest groups... quick n dirty removal here.
                // more complete refactor to come later
                continue;
            }

            $filename = 'all' === $group ? static::MANIFEST : $group;

            // delete invalid schemas
            foreach ($schemas as $key => $schema) {
                if (!SchemaStore::getSchemaById($schema->getId(), true)) {
                    unset($schemas[$key]);
                }
            }

            if (empty($schemas)) {
                continue;
            }

            ksort($schemas);

            $manifest = [
                'version' => '0.1',
                'curies'  => [],
                'classes' => [],
                'mixins'  => [],
            ];

            $id = 0;

            /** @var SchemaDescriptor $schema */
            foreach ($schemas as $curie => $schema) {
                $manifest['curies'][$curie] = $id;
                $manifest['classes'][$id] = $this->schemaToNativeClassPath($schema);
                foreach ($schema->getMixins() as $mixin) {
                    $mixinId = $mixin->getId()->getCurieWithMajorRev();
                    if (!isset($manifest['mixins'][$mixinId])) {
                        $manifest['mixins'][$mixinId] = [];
                    }

                    $manifest['mixins'][$mixinId][] = $id;
                }
                ++$id;
            }

            ksort($manifest['mixins']);

            $response->addFile(
                $this->generateOutputFile('manifest.twig', $filename, [
                    'schemas' => $schemas,
                    'manifest' => $manifest,
                ])
            );
        }

        return $response;
    }
180671
private function _addManifests( array $deps, array $stack=array( ) )
	{
		foreach ( $deps as $extName => $name )
		{
			if ( in_array( $extName, $this->_extensionsDone ) ) {
				continue;
			}

			if ( in_array( $extName, $stack ) ) {
				$msg = sprintf( 'Circular dependency for "%1$s" detected', $extName );
				throw new Exception( $msg );
			}

			$stack[] = $extName;

			/** @todo test for expression object or array when implementing version checks */
			if ( isset( $this->_dependencies[$extName] ) ) {
				$this->_addManifests( (array) $this->_dependencies[$extName], $stack );
			}

			if ( isset( $this->_extensions[$extName] ) ) {
				$this->_manifests[$this->_extensions[$extName]['location']] = $this->_extensions[$extName];
			}

			$this->_extensionsDone[] = $extName;
		}
	}
1070851
def create_manifest(self, cart_name, manifests):
        
        cart = juicer.common.Cart.Cart(cart_name)

        for manifest in manifests:
            cart.add_from_manifest(manifest, self.connectors)

        cart.save()
        return cart
989115
public function load(array $directories)
    {
        $manifest = $this->loadManifest();

        if ($this->shouldRecompile($manifest, $directories)) {
            $manifest = $this->compileManifest($directories);
        }

        // Load plugins defined in the manifest.
        // Dispatch an event with loaded plugin data.
        foreach ($manifest as $plugin => $headers) {
            $path = sprintf('%s/%s', $plugin, $headers['root']);
            $this->app->registerPlugin($path);
            $this->app['events']->dispatch(
                new PluginLoaded($plugin, $headers)
            );
        }
    }
885184
def setup_manifest(datadir):
    
    manifest_dir = os.path.join(datadir, "manifest")
    if not os.path.exists(manifest_dir):
        os.makedirs(manifest_dir)
1063121
public static function create($content, $jsonOption = 0, $status = 200, $reason = '', array $headers = [])
    {
        return new static($content, $jsonOption, $status, $reason, $headers);
    }
297644
public function create(array $args = array()) {
        $this->_overwrite = isset($args['overwrite']) && $args['overwrite'];
        if (isset($args['i']) || isset($args['interactive'])) {
            return $this->_createInteractive();
        }
        $file = $this->_parseFileFromArguments($args);
        $file = APPLICATION_PATH . '/configs/' . $file;
        $this->_createFromFile($file);
        return true;
    }