コード例 #1
0
 /**
  * @param $leagueId
  * @param $year
  * @param $week
  * @return string
  */
 public function index($leagueId, $year, $week)
 {
     /**
      * @var array $stats
      */
     $service = new PowerStatsGateway(Config::init(), new WebRequest());
     $dto = new IndexViewData();
     $dto->setLeagues($service->getLeagues($leagueId, true));
     $dto->setYears($service->getYearsForLeague($leagueId, true));
     $dto->setWeeks($service->getWeeksForLeague($leagueId, $year, true));
     $dto->setStats($service->getStats($leagueId, $year, $week));
     $dto->setLeagueId($leagueId);
     $dto->setYear($year);
     $dto->setWeek($week);
     return (new SportsAIViewLoader(new SiteTemplate()))->index($dto);
 }
コード例 #2
0
 /**
  * @param Config $config
  * @param WebRequest $request
  */
 public function __construct(Config $config, WebRequest $request)
 {
     $this->configData = $config->getData('webservice', 'powerranking');
     $request->setUrl($this->getUrl());
     $this->gateway = $request;
 }
コード例 #3
0
<?php

require 'Functions/Config.php';
use System\Functions\Config;
switch ($argv[1]) {
    case 'config':
        switch ($argv[2]) {
            case 'add':
                $console = new Config();
                $console->add('webservice', ['sportsai' => ['url' => 'http://sportsai.robguida.com', 'key' => 'penelope']]);
                $console->add('webservice', ['test2' => ['url' => 'http://test2.robguida.com', 'key' => 'penelope']]);
                $console->add('webservice', ['test3' => ['url' => 'http://test3.robguida.com', 'key' => 'penelope']]);
                break;
            case 'add2':
                $console = new Config();
                $console->add('environment', ['prod' => ['robguida.com', 'phatcigar.com']]);
                $console->add('environment', ['dev' => ['leroy.robguida.com']]);
                break;
        }
        break;
}