Skip to content

Commit

Permalink
Merge pull request #50 from bthibault/master
Browse files Browse the repository at this point in the history
Fixing a few typos in fshelper.php
  • Loading branch information
dweeves committed Jun 9, 2014
2 parents f38434a + 38d7968 commit 5514736
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions magmi/inc/fshelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,12 @@ public function log($data)
public abstract function urlExists($url);

public abstract function copyRemoteFile($url, $dest);

// using credentials
public function setCredentials($user = null, $passwd = null)
{
$this->_user = $user;
$this->_password = $password;
$this->_password = $passwd;
}

public function getErrors()
Expand Down Expand Up @@ -218,6 +219,7 @@ public function setCookie($cookie = null)
public function copyRemoteFile($url, $dest)
{
$result = false;
$creds = null;
if ($this->_user != null)
{
$creds = $this->_user;
Expand Down Expand Up @@ -250,7 +252,7 @@ public function getRemoteFile($url, $dest, $creds = null, $authmode = null, $coo
$lookup = $this->_lookup;
$outname = $dest;

if ($creds != "")
if (!is_null($creds) && $creds != "")
{
if ($lookup != 0)
{
Expand Down Expand Up @@ -295,11 +297,12 @@ public function getRemoteFile($url, $dest, $creds = null, $authmode = null, $coo
if ($res !== false)
{
$lm = curl_getinfo($ch);
$err = curl_error($ch);
if (curl_getinfo($ch, CURLINFO_HTTP_CODE) > 400)
{
$resp = explode("\n\r\n", $res);
$this->destroyContext($ch);
throw new Exception("Cannot fetch $url :" . $err);
throw new Exception("Cannot fetch $url : " . $err);
}
}
else
Expand Down Expand Up @@ -374,7 +377,7 @@ public function copyRemoteFile($url, $dest)
{
if (!$this->urlExists($url))
{
$this->_errors = array("type"=>"target error","message"=>"URL $remoteurl is unreachable");
$this->_errors = array("type"=>"target error","message"=>"URL $url is unreachable");
return false;
}

Expand Down Expand Up @@ -616,4 +619,4 @@ public function exec_cmd($cmd, $params, $working_dir = null)
}
return $out;
}
}
}

0 comments on commit 5514736

Please sign in to comment.