Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Commit

Permalink
Update SDK to 1.3.2 & version control for WHMCS
Browse files Browse the repository at this point in the history
  • Loading branch information
MikyKuroneko committed Jan 8, 2016
1 parent 51adde0 commit aa1fbc3
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 11 deletions.
25 changes: 24 additions & 1 deletion ddwhois.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function ddwhois_config()
$config = array(
'name' => 'DonDominio Whois Addon',
'description' => 'Adds the capability to perform Whois queries using the DonDominio/MrDomain API through WHMCS',
'version' => '1.0',
'version' => ddwhois_getVersion(),
'author' => 'DonDominio',
'language' => 'English',
'fields' => array()
Expand All @@ -26,6 +26,29 @@ function ddwhois_config()
return $config;
}

function ddwhois_getVersion()
{
$versionFile = __DIR__ . '/version.json';

if( !file_exists( $versionFile )){
return 'unknown';
}

$json = @file_get_contents( $versionFile );

if( empty( $json )){
return 'unknown';
}

$versionInfo = json_decode( $json, true );

if( !is_array( $versionInfo ) || !array_key_exists( 'version', $versionInfo )){
return 'unknown';
}

return $versionInfo['version'];
}

/**
* Main output for the module.
* @param Array $vars Arguments passed by WHMCS
Expand Down
16 changes: 8 additions & 8 deletions lib/sdk/DonDominioAPI/Wrappers/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ protected function ftpList( $serviceName, array $args = array())
array( 'name' => 'filter', 'type' => 'string', 'required' => false )
);

return $this->execute( 'service/ftplist/', $_args, $map );
return $this->execute( 'service/ftplist/', $_params, $map );
}

/**
Expand All @@ -349,7 +349,7 @@ protected function ftpGetInfo( $serviceName, $entityID )
array( 'name' => 'entityID', 'type' => 'string', 'required' => true )
);

return $this->execute( 'service/ftpgetinfo/', $_args, $map );
return $this->execute( 'service/ftpgetinfo/', $_params, $map );
}

/**
Expand All @@ -371,7 +371,7 @@ protected function ftpGetInfo( $serviceName, $entityID )
*/
protected function ftpCreate( $serviceName, array $args = array())
{
$_params = array(
$_params = array_merge(
array( 'serviceName' => $serviceName ),
$args
);
Expand All @@ -384,7 +384,7 @@ protected function ftpCreate( $serviceName, array $args = array())
array( 'name' => 'quota', 'type' => 'integer', 'required' => true, 'min' => 1048576 )
);

return $this->execute( 'service/ftpcreate/', $_args, $map );
return $this->execute( 'service/ftpcreate/', $_params, $map );
}

/**
Expand Down Expand Up @@ -422,7 +422,7 @@ protected function ftpUpdate( $serviceName, $entityID, array $args = array())
array( 'name' => 'quota', 'type' => 'integer', 'required' => true, 'min' => 1048576 )
);

return $this->execute( 'service/ftpupdate/', $_args, $map );
return $this->execute( 'service/ftpupdate/', $_params, $map );
}

/**
Expand All @@ -447,7 +447,7 @@ protected function ftpDelete( $serviceName, $entityID )
array( 'name' => 'entityID', 'type' => 'string', 'required' => true )
);

return $this->execute( 'service/ftpdelete/', $_args, $map );
return $this->execute( 'service/ftpdelete/', $_params, $map );
}

/**
Expand Down Expand Up @@ -480,7 +480,7 @@ protected function ddbbList( $serviceName, array $args = array())
array( 'name' => 'filter', 'type' => 'string', 'required' => false )
);

return $this->execute( 'service/ddbblist/', $_args, $map );
return $this->execute( 'service/ddbblist/', $_params, $map );
}

/**
Expand All @@ -505,7 +505,7 @@ protected function ddbbGetInfo( $serviceName, $entityID )
array( 'name' => 'entityID', 'type' => 'string', 'required' => true )
);

return $this->execute( 'service/ddbbgetinfo/', $_args, $map );
return $this->execute( 'service/ddbbgetinfo/', $_params, $map );
}

/**
Expand Down
5 changes: 3 additions & 2 deletions version.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"version": "0.4",
"releaseDate": "2015-12-22"
"version": "0.5",
"releaseDate": "2016-01-08"

}

0 comments on commit aa1fbc3

Please sign in to comment.