Giter VIP home page Giter VIP logo

Comments (7)

mgufrone avatar mgufrone commented on July 22, 2024

is this happen when the $arguments is null?

from cpanel-php.

 avatar commented on July 22, 2024

no, this happen when is has one item in array.

from cpanel-php.

mgufrone avatar mgufrone commented on July 22, 2024

Try it again

from cpanel-php.

 avatar commented on July 22, 2024

tks guy :)

from cpanel-php.

mgufrone avatar mgufrone commented on July 22, 2024

Use dev-master instead, i still haven't pushed it as a tag. 👍

from cpanel-php.

twouters avatar twouters commented on July 22, 2024

This is still a problem because the $arguments parameter of __call() is always an enumerated array containing the parameters passed to the method.

$accounts = listaccts(['searchtype'=>'domain', 'search'=>'', 'exact', 'search'=>'helloworld.com']);

This would result in the following $arguments:

array(1) {
  [0]=>
  array(3) {
    ["searchtype"]=>
    string(6) "domain"
    ["search"]=>
    string(14) "helloworld.com"
    [0]=>
    string(5) "exact"
  }
}

Which results in the following POST request:

> POST /json-api/listaccts?0%5Bsearchtype%5D=domain&0%5Bsearch%5D=helloworld.com&0%5B0%5D=exact HTTP/1.1

from cpanel-php.

ponasromas avatar ponasromas commented on July 22, 2024

Hello,

This issue still not resolved. There is code like this:

include_once ('class.cpanel.php');

$cpanel = new Cpanel();

$account_info = $cpanel->callWHMApi('accountsummary',
    [
,    'domain'        => "domain.tld"
    ]
);

if ( isset($account_info) ) {
    $result = json_decode ( $account_info, true );
    $results = $result[ 'data' ][ 'acct' ][0];

    $cgi_domain = $results[ 'domain' ];
    $cgi_inodes = $results[ 'inodesused' ];
    $cgi_mailboxes = $results[ 'maxpop' ];
    $cgi_mailsperhour = $results[ 'max_email_per_hour' ];
    $cgi_outgoingmail = $results[ 'outgoing_mail_suspended' ];
    $cgi_suspended = $results[ 'suspended' ];
    $cgi_suspend_reason = $results[ 'suspendreason' ];
    $cgi_ip = $results[ 'ip' ];
    $cgi_plan = $results[ 'plan' ];
    $cgi_user = $results[ 'user' ];
    $cgi_diskused = $results[ 'diskused' ];
    $cgi_maxsql = $results[ 'maxsql' ];
    $cgi_disklimit = $results[ 'diskused' ];
}   

Code executed and result received, but with notice:

Notice: Undefined offset: 0

Sure, I can use "@" to supress that dirty notice, but it's not the best way...

from cpanel-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.