-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a37de5
commit 9f7d305
Showing
9 changed files
with
78 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,7 @@ | |
|
||
class DL{ | ||
public static $methods = array ( | ||
"Stations", | ||
"Liveboard" | ||
|
||
); | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,52 @@ | ||
<?php | ||
/* Copyright (C) 2011 by iRail vzw/asbl | ||
* | ||
* Author: Pieter Colpaert <pieter aŧ iRail.be> | ||
* License: AGPLv3 | ||
/** | ||
* @copyright (C) 2011 by iRail vzw/asbl | ||
* @author Pieter Colpaert <pieter aŧ iRail.be> | ||
* @license AGPLv3 | ||
* | ||
* Lists all stations for a certain system | ||
*/ | ||
|
||
include_once("modules/AMethod.php"); | ||
|
||
class Stations extends AMethod{ | ||
|
||
private $lang,$system = "NMBS"; | ||
|
||
public function __construct(){ | ||
parent::__construct("Stations"); | ||
} | ||
|
||
public static function getParameters(){ | ||
return array("lang" => "Language for the stations", | ||
"system" => "The name of the public transport company: for instance De Lijn, or NMBS" | ||
); | ||
} | ||
|
||
public static function getRequiredParameters(){ | ||
return array(); | ||
} | ||
|
||
public function setParameter($key,$val){ | ||
if($key == "lang"){ | ||
$this->lang = $val; | ||
} | ||
|
||
if($key == "system"){ | ||
if(in_array($val,iRailTools::ALLOWED_SYSTEMS)){ | ||
$this->system = $val; | ||
} | ||
} | ||
} | ||
|
||
public function call(){ | ||
$o = new StdClass(); | ||
|
||
$o->stations[] | ||
return $o; | ||
} | ||
|
||
public static function getAllowedPrintMethods(){ | ||
return array("xml","json","php", "jsonp","html"); | ||
} | ||
|
||
|
||
public static function getDoc(){ | ||
return "Stations will return a list of all known stops of a system"; | ||
} | ||
class Stations extends AResource{ | ||
|
||
private $lang = "EN"; | ||
|
||
/** | ||
* If language has not been given, just return the english ones | ||
*/ | ||
public static function getParameters(){ | ||
return array("lang" => "Language for the stations"); | ||
} | ||
|
||
/** | ||
* No required parameters for the stations resource | ||
*/ | ||
public static function getRequiredParameters(){ | ||
return array(); | ||
} | ||
|
||
public function setParameter($key,$val){ | ||
if($key == "lang"){ | ||
$this->lang = $val; | ||
} | ||
} | ||
|
||
/** | ||
* This function should get all stations from the NMBS/SNCB and return them. | ||
* Can't we get all information from DBPedia? | ||
* Does Open Street Map has a SPARQL end-point? | ||
*/ | ||
public function call(){ | ||
return new StdClass(); | ||
} | ||
|
||
public static function getAllowedPrintMethods(){ | ||
return array("xml","json","php", "jsonp","html", "kml"); | ||
} | ||
|
||
public static function getDoc(){ | ||
return "Stations will return a list of all known stops of a system"; | ||
} | ||
} | ||
|
||
?> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,6 @@ | |
*/ | ||
class NS{ | ||
public static $methods = array ( | ||
"Stations", | ||
"Liveboard" | ||
); | ||
} | ||
|
||
|
This file was deleted.
Oops, something went wrong.