[enh] adding isFtp() function to FTP API class

This commit is contained in:
Benjamin Sonntag 2015-01-12 21:48:19 +01:00
parent 2981d32453
commit e3d1a993a1
1 changed files with 17 additions and 0 deletions

View File

@ -104,6 +104,23 @@ class Alternc_Api_Object_Ftp extends Alternc_Api_Legacyobject {
}
}
/** API Method from legacy class method ftp->is_ftp()
* @param $options a hash with parameters transmitted to legacy call
* mandatory parameters: DIR
* @return Alternc_Api_Response Integer the ID of the account in this folder, or FALSE
*/
function isFtp($options) {
if (!isset($options["dir"])) {
return new Alternc_Api_Response(array("code" => self::ERR_INVALID_ARGUMENT, "message" => "Missing or invalid argument: DIR"));
}
$result = $this->ftp->is_ftp($options["dir"]);
if (!$result) {
return $this->alterncLegacyErrorManager();
} else {
return new Alternc_Api_Response(array("content" => $result));
}
}
}
// class Alternc_Api_Object_Ftp