Skip to content

Commit

Permalink
Make class more testable
Browse files Browse the repository at this point in the history
  • Loading branch information
Synchro committed Apr 23, 2014
1 parent 3c2e24f commit 79f6a34
Showing 1 changed file with 62 additions and 2 deletions.
64 changes: 62 additions & 2 deletions UAS/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,10 @@ protected function getContents($url, $timeout = 300)
$headers = array();
if (array_key_exists('wrapper_data', $res) && array_key_exists('headers', $res['wrapper_data']) ) {
$headers = $res['wrapper_data']['headers'];
}
}
elseif (array_key_exists('wrapper_data', $res) ) {
$headers = $res['wrapper_data'];
}
}
if( !empty($headers) ) {
foreach ($headers as $d) {
if ($d == 'Content-Encoding: gzip') { //Data was compressed
Expand Down Expand Up @@ -623,4 +623,64 @@ public function getDoDownloads()
public function setDoDownloads($doDownloads) {
$this->doDownloads = (boolean)$doDownloads;
}

/**
* Get the download URL for the ini file
* @return string
*/
public function getIniUrl()
{
return self::$ini_url;
}

/**
* Set the download URL for the ini file
* @param string $url
*/
public function setIniUrl($url)
{
if (filter_var($url, FILTER_VALIDATE_URL)) {
self::$ini_url = $url;
}
}

/**
* Get the download URL for the version file
* @return string
*/
public function getVerUrl()
{
return self::$ver_url;
}

/**
* Set the download URL for the version file
* @param string $url
*/
public function setVerUrl($url)
{
if (filter_var($url, FILTER_VALIDATE_URL)) {
self::$ver_url = $url;
}
}

/**
* Get the download URL for the checksum file
* @return string
*/
public function getMd5Url()
{
return self::$md5_url;
}

/**
* Set the download URL for the checksum file
* @param string $url
*/
public function setMd5Url($url)
{
if (filter_var($url, FILTER_VALIDATE_URL)) {
self::$md5_url = $url;
}
}
}

0 comments on commit 79f6a34

Please sign in to comment.