Load a set of images and tags into a repository.

@param bool   $quiet
@param string $tar

@return mixed 200

@throws Exception
194872
public function load(bool $quiet = false, string $tar)
    {
        $url = self::$base_url.'/load?'.http_build_query(['quiet' => $quiet]);

        return self::$curl->post($url, $tar);
    }
192929
public function create(string $repository, string $model, string $path = '')
    {
        $this->setNamespace($repository);

        $this->setModel($model);

        $this->setRepository($repository);

        $this->setPath($path);

        //check file exists
        if ($this->fileSystem->exists($this->repositoryFilePath())) {
            throw new Exception("File {$this->repositoryFilePath()} exists");
        }

        //create directory
        $this->autoCreateDirectory();

        //write file
        $this->writeStubFile($this->getFormatStubFileContent());
    }
1100900
function OpenyAddFork($path, $repository) {
    $this->taskComposerConfig()
      ->dir($path . '/openy-project')
      ->repository(99, $repository, 'path')
      ->ansi(TRUE)
      ->run();
  }
899418
public static function add_to_repo($repository_path, $files = null)
    {
        $repo = new pakeGit($repository_path);
        $repo->add($files);

        return $repo;
    }
740918
def get_image_tar(image_path):
    '''
    '''
    bot.debug('Generate file system tar...')   
    file_obj = Client.image.export(image_path=image_path)
    if file_obj is None:
        bot.error("Error generating tar, exiting.")
        sys.exit(1)
    tar = tarfile.open(file_obj)
    return file_obj, tar
873250
private function load()
    {
        foreach ($this->resources as $key => $resource) {
            if (!$resource instanceof PuliResource) {
                $this->resources[$key] = $this->repo->get($resource);
            }
        }

        $this->loaded = true;
    }
1137425
function load($str, $lowercase=true, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
	{
		global $debug_object;

		// prepare
		$this->prepare($str, $lowercase, $stripRN, $defaultBRText, $defaultSpanText);
		// strip out cdata
		$this->remove_noise("'<!\[CDATA\[(.*?)\]\]>'is", true);
		// strip out comments
		$this->remove_noise("'<!--(.*?)-->'is");
		// Per sourceforge http://sourceforge.net/tracker/?func=detail&aid=2949097&group_id=218559&atid=1044037
		// Script tags removal now preceeds style tag removal.
		// strip out <script> tags
		$this->remove_noise("'<\s*script[^>]*[^/]>(.*?)<\s*/\s*script\s*>'is");
		$this->remove_noise("'<\s*script\s*>(.*?)<\s*/\s*script\s*>'is");
		// strip out <style> tags
		$this->remove_noise("'<\s*style[^>]*[^/]>(.*?)<\s*/\s*style\s*>'is");
		$this->remove_noise("'<\s*style\s*>(.*?)<\s*/\s*style\s*>'is");
		// strip out preformatted tags
		$this->remove_noise("'<\s*(?:code)[^>]*>(.*?)<\s*/\s*(?:code)\s*>'is");
		// strip out server side scripts
		$this->remove_noise("'(<\?)(.*?)(\?>)'s", true);
		// strip smarty scripts
		$this->remove_noise("'(\{\w)(.*?)(\})'s", true);

		// parsing
		while ($this->parse());
		// end
		$this->root->_[HDOM_INFO_END] = $this->cursor;
		$this->parse_charset();

		// make load function chainable
		return $this;

	}
766974
def _load_from_tar(self, dtype_out_time, dtype_out_vert=False):
        """"""
        path = os.path.join(self.dir_tar_out, 'data.tar')
        utils.io.dmget([path])
        with tarfile.open(path, 'r') as data_tar:
            ds = xr.open_dataset(
                data_tar.extractfile(self.file_name[dtype_out_time])
            )
            return ds[self.name]
1123433
private function update_visible($visible = null) {
        global $DB;

        if (!empty($visible)) {
            $this->_visible = $visible;
        }
        else if (!isset($this->_visible)) {
            throw new repository_exception('updateemptyvisible', 'repository');
        }

        cache::make('core', 'repositories')->purge();
        return $DB->set_field('repository', 'visible', $this->_visible, array('type'=>$this->_typename));
    }
1322581
public function findBinary($binary, $quiet = false)
    {
        return $this->commandExecutor->findBinary($binary, $quiet = false);
    }
375893
public function load($tmpFile, $folderPath = false) {
				
		if(!$folderPath) $folderPath = Config::inst()->get('Upload', 'uploads_folder');
		
		// @TODO This puts a HUGE limitation on files especially when lots
		// have been uploaded.
		$base = Director::baseFolder();
		$parentFolder = Folder::find_or_make($folderPath);

		// Generate default filename
        $fileArray = explode('/', $tmpFile);
        $fileName = $fileArray[(count($fileArray)-1)];
		$nameFilter = FileNameFilter::create();
		$file = $nameFilter->filter($fileName);
		$fileName = basename($file);

		$relativeFilePath = ASSETS_DIR . "/" . $folderPath . "/$fileName";
		
		// if filename already exists, version the filename (e.g. test.gif to test1.gif)
		while(file_exists("$base/$relativeFilePath")) {
			$i = isset($i) ? ($i+1) : 2;
			$oldFilePath = $relativeFilePath;
			// make sure archives retain valid extensions
			if(substr($relativeFilePath, strlen($relativeFilePath) - strlen('.tar.gz')) == '.tar.gz' ||
				substr($relativeFilePath, strlen($relativeFilePath) - strlen('.tar.bz2')) == '.tar.bz2') {
					$relativeFilePath = preg_replace('/[0-9]*(\.tar\.[^.]+$)/', $i . '\\1', $relativeFilePath);
			} else if (strpos($relativeFilePath, '.') !== false) {
				$relativeFilePath = preg_replace('/[0-9]*(\.[^.]+$)/', $i . '\\1', $relativeFilePath);
			} else if (strpos($relativeFilePath, '_') !== false) {
				$relativeFilePath = preg_replace('/_([^_]+$)/', '_'.$i, $relativeFilePath);
			} else {
				$relativeFilePath .= '_'.$i;
			}
			if($oldFilePath == $relativeFilePath && $i > 2) {
				user_error("Couldn't fix $relativeFilePath with $i tries", E_USER_ERROR);
			}
		}
		
		if(file_exists($tmpFile) && copy($tmpFile, $base."/".$relativeFilePath)) {
			$this->owner->ParentID = $parentFolder->ID;
			// This is to prevent it from trying to rename the file
			$this->owner->Name = basename($relativeFilePath);
			$this->owner->write();
			return true;
		} else {
			return false;
		}
	}
370029
public static function bundle(string $root = "", string $ignore = ""): void
    {
        echo "Bundling...\n";

        $root = realpath($root ?: self::rootPath());
        $ignore = realpath($ignore ?: self::rootPath()."/.zipignore");

        $archive_name = basename($root);
        $archive_path = $root."/zip/";

        echo "$archive_path => $archive_name.zip\n";

        $directory = new \RecursiveDirectoryIterator($archive_path);
        $file_info = new \RecursiveIteratorIterator($directory);

        $files = [];
        foreach ($file_info as $info)
        {
            $real_path = $info->getPathname();
            $file_name = $info->getFilename();

            // Skip /. and /..
            if($file_name === "." || $file_name === "..")
                continue;

            $path = str_replace($root, "", $real_path); // Remove base path from the path string.
            $path = str_replace("\\", "/", $path); // Match .zipignore format
            $path = substr($path, 1, strlen($path) - 1);

            if (!self::inIgnoreFile($path, $ignore))
            {
                $files[] = $path;
                echo "ADDED  : $path\n";
            }
            else
                echo "IGNORED: $path\n";
        }

        $zip = new \ZipArchive();
        $file_name = $root."/$archive_name.zip";

        if ($zip->open($file_name, \ZipArchive::CREATE | \ZipArchive::OVERWRITE) !== true) {
            exit("Unable to create $file_name!\n");
        }

        // Save the current working directory and move to the root of the project for the next steps!
        $old_dir = getcwd();
        chdir($root);

        // Loop through each file in the list...
        foreach ($files as $file) {
            // Ensure .zipignore directory separators are converted to OS separators.
            //$path = str_replace("/", DIRECTORY_SEPARATOR, $file);
            $path = $file;

            // Remove the leading folder, as we do not want that structure in the ZIP archive.
            $local = str_replace("zip/", "", $path);

            // Add the file to the archive.
            $zip->addFile($path, $local);
        }

        $total_files = $zip->numFiles;
        $status = $zip->status !== 0 ? $zip->getStatusString() : "SUCCESS!";

        echo "FILES  : $total_files\n";
        echo "STATUS : $status\n";

        // Close the archive, we're all finished!
        $zip->close();

        // Return to the previous working directory.
        chdir($old_dir);
    }
250412
public static function checkCache(&$config, $silent = false) {
		$dirs = self::getCacheDirectories ( $config, $silent );
		foreach ( $dirs as $dir ) {
			self::safeMkdir ( $dir );
		}
		return $dirs;
	}
634092
static public function get_coin($symbol, $silentfail=false) {
        $data = self::get_all_coins();
        
        $info = @$data[strtoupper($symbol)];
        if( !$info && !$silentfail ) {
            throw new \Exception("Coin not found: $symbol");
        }
        
        return $info;
    }
404919
public void loadNodeSpecifiedByURL() {
        repositoriesList.select(jcrURL.getRepository(), jcrURL.getWorkspace(), jcrURL.getPath(), true);
    }
1003462
protected function copyTarget($path, $tar)
	{
		$map = array();
		$hdl = opendir($path);

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

			// Ignore hidden files
			if (substr($entry, 0, 1) != '.')
			{
				if (isset($this->getJConfig()->exclude)
					&& in_array($entry, explode(',', $this->getJConfig()->exclude)))
				{
					continue;
				}

				if (is_file($p))
				{
					$map[] = array("file" => $entry);
					$this->_copy($p, $tar . "/" . $entry);
				}
				else
				{
					$map[] = array("folder" => $entry);
					$this->_copyDir($p, $tar . "/" . $entry);
				}
			}
		}

		closedir($hdl);

		return $map;
	}
792929
public function doBuild($quiet = false, $populate = true, $testMode = false)
    {
        if ($quiet) {
            DB::quiet();
        } else {
            $conn = DB::get_conn();
            // Assumes database class is like "MySQLDatabase" or "MSSQLDatabase" (suffixed with "Database")
            $dbType = substr(get_class($conn), 0, -8);
            $dbVersion = $conn->getVersion();
            $databaseName = $conn->getSelectedDatabase();

            if (Director::is_cli()) {
                echo sprintf("\n\nBuilding database %s using %s %s\n\n", $databaseName, $dbType, $dbVersion);
            } else {
                echo sprintf("<h2>Building database %s using %s %s</h2>", $databaseName, $dbType, $dbVersion);
            }
        }

        // Set up the initial database
        if (!DB::is_active()) {
            if (!$quiet) {
                echo '<p><b>Creating database</b></p>';
            }

            // Load parameters from existing configuration
            $databaseConfig = DB::getConfig();
            if (empty($databaseConfig) && empty($_REQUEST['db'])) {
                throw new BadMethodCallException("No database configuration available");
            }
            $parameters = (!empty($databaseConfig)) ? $databaseConfig : $_REQUEST['db'];

            // Check database name is given
            if (empty($parameters['database'])) {
                throw new BadMethodCallException(
                    "No database name given; please give a value for SS_DATABASE_NAME or set SS_DATABASE_CHOOSE_NAME"
                );
            }
            $database = $parameters['database'];

            // Establish connection
            unset($parameters['database']);
            DB::connect($parameters);

            // Check to ensure that the re-instated SS_DATABASE_SUFFIX functionality won't unexpectedly
            // rename the database. To be removed for SS5
            if ($suffix = Environment::getEnv('SS_DATABASE_SUFFIX')) {
                $previousName = preg_replace("/{$suffix}$/", '', $database);

                if (!isset($_GET['force_suffix_rename']) && DB::get_conn()->databaseExists($previousName)) {
                    throw new DatabaseException(
                        "SS_DATABASE_SUFFIX was previously broken, but has now been fixed. This will result in your "
                        . "database being named \"{$database}\" instead of \"{$previousName}\" from now on. If this "
                        . "change is intentional, please visit dev/build?force_suffix_rename=1 to continue"
                    );
                }
            }

            // Create database
            DB::create_database($database);
        }

        // Build the database.  Most of the hard work is handled by DataObject
        $dataClasses = ClassInfo::subclassesFor(DataObject::class);
        array_shift($dataClasses);

        if (!$quiet) {
            if (Director::is_cli()) {
                echo "\nCREATING DATABASE TABLES\n\n";
            } else {
                echo "\n<p><b>Creating database tables</b></p><ul>\n\n";
            }
        }

        $showRecordCounts = (boolean)$this->config()->show_record_counts;

        // Initiate schema update
        $dbSchema = DB::get_schema();
        $dbSchema->schemaUpdate(function () use ($dataClasses, $testMode, $quiet, $showRecordCounts) {
            $dataObjectSchema = DataObject::getSchema();

            foreach ($dataClasses as $dataClass) {
                // Check if class exists before trying to instantiate - this sidesteps any manifest weirdness
                if (!class_exists($dataClass)) {
                    continue;
                }

                // Check if this class should be excluded as per testing conventions
                $SNG = singleton($dataClass);
                if (!$testMode && $SNG instanceof TestOnly) {
                    continue;
                }
                $tableName = $dataObjectSchema->tableName($dataClass);

                // Log data
                if (!$quiet) {
                    if ($showRecordCounts && DB::get_schema()->hasTable($tableName)) {
                        try {
                            $count = DB::query("SELECT COUNT(*) FROM \"$tableName\"")->value();
                            $countSuffix = " ($count records)";
                        } catch (Exception $e) {
                            $countSuffix = " (error getting record count)";
                        }
                    } else {
                        $countSuffix = "";
                    }

                    if (Director::is_cli()) {
                        echo " * $tableName$countSuffix\n";
                    } else {
                        echo "<li>$tableName$countSuffix</li>\n";
                    }
                }

                // Instruct the class to apply its schema to the database
                $SNG->requireTable();
            }
        });
        ClassInfo::reset_db_cache();

        if (!$quiet && !Director::is_cli()) {
            echo "</ul>";
        }

        if ($populate) {
            if (!$quiet) {
                if (Director::is_cli()) {
                    echo "\nCREATING DATABASE RECORDS\n\n";
                } else {
                    echo "\n<p><b>Creating database records</b></p><ul>\n\n";
                }
            }

            // Remap obsolete class names
            $remappingConfig = $this->config()->get('classname_value_remapping');
            $remappingFields = $this->getClassNameRemappingFields();
            foreach ($remappingFields as $className => $fieldNames) {
                foreach ($fieldNames as $fieldName) {
                    foreach ($remappingConfig as $oldClassName => $newClassName) {
                        $this->updateLegacyClassNames($className, $fieldName, $oldClassName, $newClassName);
                    }
                }
            }

            // Require all default records
            foreach ($dataClasses as $dataClass) {
                // Check if class exists before trying to instantiate - this sidesteps any manifest weirdness
                // Test_ indicates that it's the data class is part of testing system
                if (strpos($dataClass, 'Test_') === false && class_exists($dataClass)) {
                    if (!$quiet) {
                        if (Director::is_cli()) {
                            echo " * $dataClass\n";
                        } else {
                            echo "<li>$dataClass</li>\n";
                        }
                    }

                    DataObject::singleton($dataClass)->requireDefaultRecords();
                }
            }

            if (!$quiet && !Director::is_cli()) {
                echo "</ul>";
            }
        }

        touch(TEMP_PATH
            . DIRECTORY_SEPARATOR
            . 'database-last-generated-'
            . str_replace(array('\\', '/', ':'), '.', Director::baseFolder()));

        if (isset($_REQUEST['from_installer'])) {
            echo "OK";
        }

        if (!$quiet) {
            echo (Director::is_cli()) ? "\n Database build completed!\n\n" :"<p>Database build completed!</p>";
        }

        ClassInfo::reset_db_cache();
    }