Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
retroluxfilm authored and retroluxfilm committed Feb 24, 2022
1 parent 17e97c6 commit 733a23d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
27 changes: 20 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ This is a PHP Web library to manage remote repositories for the
- Ability to issue repository tasks over the command line (cron jobs etc.)
- Package and Repository object handling allowing easy extension to build it into your web frontend


## Requirements
- PHP 7.4+
- PHP 7.4+ (using PHP 8.1+ will speed up the library)
- ImageMagick
- DOM Extension
- SimpleXML Extension
Expand All @@ -29,15 +28,29 @@ latest version of this package. Install it as a global library in case you only
composer global require retrolux/omm-php-library
```

## Use Examples
## Command Line options

### generateFolderRepository
Generates a networked repository from a folder structure with the contained mod archives.

**Note:**
Needs to be called within the folder that is accessible through the web server and located side by side the folder
it should be looked for mod archives.

### Command Line

**generateFolderRepository**
*Usage Options:*

Generates the `Mod Download Repository` saved into `repository.xml` scanning for the packages in the `mods` folder (relative to the xml).
````
OMMTask generateFolderRepository <xmlName> <repositoryName> <packageRootPath> (<recursive>)
Arguments:
xmlName : name and path of the repository xml
repositoryName : name for the repository
packageRootPath : root path where the mod packages are placed relative to repository xml location
recursive : true if the sub folders should be processed as well (Default: true)
````

*Note:* Needs to be called within the folder that is accessible through the web server.
The example below will generate the `Mod Download Repository` saved into `repository.xml` scanning for the packages
in the `mods` folder and subdirectories (relative to the xml).

```bash
OMMTask generateFolderRepository "repository.xml" "Mod Download Repository" "mods"
Expand Down
6 changes: 3 additions & 3 deletions src/Task/GenerateFolderRepositoryTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public static function showHelp(): void
echo "Arguments:\n";
echo " xmlName : name and path of the repository xml\n";
echo " repositoryName : name for the repository\n";
echo " packageRootPath : root path where the mod packages are placed\n";
echo " recursive : true if the sub folders should be processed as well (Default: false)\n";
echo " packageRootPath : root path where the mod packages are placed relative to repository xml location\n";
echo " recursive : true if the sub folders should be processed as well (Default: true)\n";

// TODO parse from php doc the possible params?
// $class = new ReflectionClass(FolderRepositoryTask::class);
Expand Down Expand Up @@ -87,7 +87,7 @@ public static function generateFolderRepository(
string $xmlName,
string $repositoryName,
string $repositoryRootPath,
bool $recursive = false
bool $recursive = true
) {
// check if the root patch a valid directory
if (!is_dir($repositoryRootPath)) {
Expand Down

0 comments on commit 733a23d

Please sign in to comment.