Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/treetrek.git

Moves order.txt reference into Config

AuthorDave Jarvis <email>
Date2026-02-23 13:57:33 GMT-0800
Commit9819949531e06779efefa5a2d843a5f4b28d24b4
Parent11a80fb
Config.php
public const SITE_TITLE = "Dave Jarvis' Repositories";
private const REPOS_SUBDIR = '/repos';
+ private const ORDER_FILE = __DIR__ . '/order.txt';
private const LOG_FILE = '/error.log';
public function createRouter() {
- return new Router( $this->getHomeDirectory() . self::REPOS_SUBDIR );
+ return new Router(
+ $this->getHomeDirectory() . self::REPOS_SUBDIR,
+ self::ORDER_FILE
+ );
}
model/RepositoryList.php
<?php
class RepositoryList {
- private const ORDER_FILE = __DIR__ . '/../order.txt';
private const GIT_EXT = '.git';
private const GLOB_PATTERN = '/*';
private string $reposPath;
+ private string $orderFile;
- public function __construct( string $path ) {
+ public function __construct( string $path, string $orderFile ) {
$this->reposPath = $path;
+ $this->orderFile = $orderFile;
}
private function sortRepositories( array $repos ): array {
- $file = self::ORDER_FILE;
+ $file = $this->orderFile;
if( file_exists( $file ) ) {
model/Router.php
private string $baseHash = '';
- public function __construct( string $reposPath ) {
+ public function __construct( string $reposPath, string $orderFile ) {
$this->git = new Git( $reposPath );
- $list = new RepositoryList( $reposPath );
+ $list = new RepositoryList( $reposPath, $orderFile );
$list->eachRepository( function( $repo ) {
Delta11 lines added, 6 lines removed, 5-line increase