Ejemplo n.º 1
0
 /**
  * Check if provided logo name matches with existing one
  * @param {string} $name logo to seach
  * @return {boolean} true or false
  */
 static function logoMatches($name)
 {
     $name = basename($name);
     // stip dir info
     $list = Federations::getFederationList();
     foreach ($list as $fed) {
         if (basename($fed['Logo']) === $name) {
             return true;
         }
         if (basename($fed['ParentLogo']) === $name) {
             return true;
         }
     }
     // arriving here means not found
     return false;
 }
Ejemplo n.º 2
0
<?php

/**
 * Created by PhpStorm.
 * User: jantonio
 * Date: 21/10/15
 * Time: 14:11
 */
require_once "../modules/Federations.php";
$feds = Federations::getFederationList();
foreach ($feds as $fed) {
    echo "ID:{$fed['ID']} : {$fed['LongName']}\n";
    // print_r($fed);
}
Ejemplo n.º 3
0
require_once __DIR__ . "/../server/tools.php";
require_once __DIR__ . "/Federations.php";
try {
    $result = null;
    $federation = http_request("Federation", "i", -1);
    // -1 defaults to all federations
    $operation = http_request("Operation", "s", null);
    // retrieve requested operation
    $recorrido = http_request("Recorrido", "i", 0);
    // 0:separate 1:mixed 2:common
    if ($operation === null) {
        throw new Exception("Call to moduleFunctions without 'Operation' requested");
    }
    switch ($operation) {
        case "list":
            $result = Federations::getFederationList();
            break;
        case "info":
            $result = Federations::getFederation($federation);
            break;
        case "enumerate":
            $result = Federations::enumerate();
            break;
        case "infomanga":
            $result = Federations::infomanga($federation, $recorrido);
            break;
        default:
            throw new Exception("moduleFunctions:: invalid operation: '{$operation}' provided");
    }
    if ($result === null) {
        throw new Exception($jueces->errormsg);