Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/treetrek.git
<?php
class Config {
  const SITE_TITLE = "Dave Jarvis' Repositories";

  private static function getHomeDirectory() {
    if( !empty( $_SERVER['HOME'] ) ) {
      return $_SERVER['HOME'];
    }

    if( !empty( getenv( 'HOME' ) ) ) {
      return getenv( 'HOME' );
    }

    if( function_exists( 'posix_getpwuid' ) &&
        function_exists( 'posix_getuid' ) ) {
      $userInfo = posix_getpwuid( posix_getuid() );

      if( !empty( $userInfo['dir'] ) ) {
        return $userInfo['dir'];
      }
    }

    return '';
  }

  public static function getReposPath() {
    return self::getHomeDirectory() . '/repos';
  }

  public static function init() {
    ini_set( 'display_errors', 0 );
    ini_set( 'log_errors', 1 );
    ini_set( 'error_log', __DIR__ . '/error.log' );
  }
}