I would like to know if it is possible to connect to my WHM with PHP using the cPanel PublicAPI PHP Repository https://github.com/CpanelInc/publicapi-php so that I can create a list of the accounts in the WHM.
Is there anything I should know? Are there any restrictions? I simply want to populate a list of my accounts that are in my WHM.
Right now I'm getting an error
Warning: count(): Parameter must be an array or an object that implements Countable in
I was wondering if there was something blocking me?
Here is what my code looks like, I'd like to create a php variable to holds the array data, then loop through it printing the account domain name
require_once '../_libraries/publicapi-php-master/Cpanel/Util/Autoload.php';
$config = array(
'service' => array(
'whm' => array(
'config' => array(
'host' => 'XXXXXXXXXXXXXX',
'user' => 'XXXXXXXXXXXXXX',
'password' => 'XXXXXXXXXX'
),
),
),
);
$cp = Cpanel_PublicAPI::getInstance($config);
$accounts = $cp->whm_api('listaccts');
print_R($accounts);
#print $accounts->_response->dataContainer->storage->acct->dataContainer->storage[0];
When I do a print_r($accounts) this is what I get, I just need to know how to traverse this and loop through it with PHP. I can see in this output the first domain is cfpacking.com, that is the data I'm after.
Cpanel_Query_Object Object
(
[_query:Cpanel_Query_Object:private] => Cpanel_Core_Object Object
(
[dataContainer:protected] => ArrayObject Object
(
[storage:ArrayObject:private] => Array
(
[adapter] => whostmgr
[client] => curl
[url] => https://XXXXXXXXXXXXXX:2087/json-api/listaccts
[args] =>
[argsArray] => Cpanel_Core_Object Object
(
[dataContainer:protected] => ArrayObject Object
(
[storage:ArrayObject:private] => Array
(
)
)
)
[authstr] => Authorization: Basic XXXXXXXXXXXXXXXXXXXXXXX==
[directURL] =>
)
)
)
[_response:Cpanel_Query_Object:private] => Cpanel_Core_Object Object
(
[dataContainer:protected] => ArrayObject Object
(
[storage:ArrayObject:private] => Array
(
[status] => 1
[statusmsg] => Ok
[acct] => Cpanel_Core_Object Object
(
[dataContainer:protected] => ArrayObject Object
(
[storage:ArrayObject:private] => Array
(
[0] => Cpanel_Core_Object Object
(
[dataContainer:protected] => ArrayObject Object
(
[storage:ArrayObject:private] => Array
(
[inodeslimit] => 500000
[ip] => XXXXXXXXXXXXXXX
[mailbox_format] => maildir
[plan] => default
[maxftp] => unlimited
[maxparked] => unlimited
[owner] => XXXXXXXXXXXXXXXXXXX
[maxpop] => unlimited
[email] => XXXXXXXXXXXXXXXXXXXXXX
[max_email_per_hour] => 500
[disklimit] => unlimited
[maxlst] => unlimited
[min_defer_fail_to_trigger_protection] => 5
[backup] => 1
[startdate] => 17 Dec 27 15:59
[inodesused] => 3281
[maxsql] => unlimited
[max_defer_fail_percentage] => 25
[ipv6] => Cpanel_Core_Object Object
(
[dataContainer:protected] => ArrayObject Object
(
[storage:ArrayObject:private] => Array
(
)
)
)
[max_emailacct_quota] => unlimited
[maxsub] => unlimited
[unix_startdate] => 1514411971
[outgoing_mail_hold] => 0
[partition] => home
[legacy_backup] => 1
[maxaddons] => unlimited
[suspendtime] => 0
[uid] => 1750
[suspendreason] => not suspended
[suspended] => 0
[user] => XXXXXXXXXXXXXX
[domain] => cfpacking.com
[diskused] => 79M
[theme] => paper_lantern
[temporary] => 0
[is_locked] => 0
[shell] => /bin/bash
[outgoing_mail_suspended] => 0
)
)
)
[1] => Cpanel_Core_Object Object
The response object can be turned into an array using the following syntax:
require_once '../_libraries/publicapi-php-master/Cpanel/Util/Autoload.php';
$config = array(
'service' => array(
'whm' => array(
'config' => array(
'host' => 'XXXXXXXXXXXXXXXXXXXX',
'user' => 'XXXXXXXXXXXXXXXXXXXX',
'password' => 'XXXXXXXXXXXXXXXX'
),
),
),
);
$cp = Cpanel_PublicAPI::getInstance($config);
$accounts = $cp->whm_api('listaccts',array('search'=>'XXXXXXXXX','searchtype'=>'owner'));
$accounts = $accounts->getResponse('array')['acct'];
foreach($accounts as $account){
print $account['domain'];
print '<br />';
}
The library(https://github.com/CpanelInc/publicapi-php) contains code that generates warnings in php 7.2 because of a breaking change. Because the library hasn't been maintaned for 9 years you will have to fix it yourself.
The fix:
old:
Cpanel/PublicApi.php line 343
if (count($storedServicesConfig) > 1) {
new:
Cpanel/PublicApi.php line 343
if (count($storedServicesConfig->getAllData()) > 1) {
Related
I am trying to build an online form that a user can enter their invoice number, the webserver will then interface with the Xero API to GET the invoice details and populate some additional fields for payment.
I have already got the form logic built and in place however I have no clue of how to start with the Xero API.
I've created a private app and have the required keys but I cannot find any documentation on how to actually go about setting up the API call in PHP.
Any help would be much appreciated.
**** UPDATE ****
I was able to get the API working using the following:
function GetInvData ($InvNumber) {
try {
$config = [
'oauth' => [
'consumer_key' => 'REDACTED',
'rsa_private_key' => 'REDACTED',
],
];
$xero = new PrivateApplication($config);
//$invoice = $xero->load(\XeroPHP\Models\Accounting\Invoice::class)->where('InvoiceNumber',$InvNumber)->execute();
$invoice = $xero->load('Accounting\Invoice')
->where('InvoiceNumber',$InvNumber)
->execute();
}
catch(\Exception $ex) {
var_dump($ex);
}
return ($invoice);
}
However what is returned is the most complex piece of JSON I have ever laid eyes on.... Probably not saying much.
All I need to be able to extract is the the Invoice Amount, The Customer name and Their email address, can anybody assist with this?
XeroPHP\Remote\Collection Object
(
[_associated_objects:protected] =>
[storage:ArrayObject:private] => Array
(
[0] => XeroPHP\Models\Accounting\Invoice Object
(
[_data:protected] => Array
(
[Type] => ACCREC
[Contact] => XeroPHP\Models\Accounting\Contact Object
(
[_data:protected] => Array
(
[ContactID] => cf6eef48-cda3-4862-8518-4d631ea54c1c
[ContactNumber] =>
[AccountNumber] =>
[ContactStatus] =>
[Name] => REDACTED
[FirstName] =>
[LastName] =>
[EmailAddress] =>
[SkypeUserName] =>
[ContactPersons] =>
[BankAccountDetails] =>
[TaxNumber] =>
[AccountsReceivableTaxType] =>
[AccountsPayableTaxType] =>
[Addresses] =>
[Phones] =>
[IsSupplier] =>
[IsCustomer] =>
[DefaultCurrency] =>
[XeroNetworkKey] =>
[SalesDefaultAccountCode] =>
[PurchasesDefaultAccountCode] =>
[SalesTrackingCategories] =>
[PurchasesTrackingCategories] =>
[TrackingCategoryName] =>
[TrackingCategoryOption] =>
[PaymentTerms] =>
[UpdatedDateUTC] =>
[ContactGroups] =>
[Website] =>
[BrandingTheme] =>
[BatchPayments] =>
[Discount] =>
[Balances] =>
[HasAttachments] =>
)
[_dirty:protected] => Array
(
)
[_associated_objects:protected] => Array
(
[Contact] => XeroPHP\Models\Accounting\Invoice Object
*RECURSION*
)
[_application:protected] =>
)
[LineItems] =>
[Date] => DateTime Object
(
[date] => 2019-03-05 00:00:00.000000
[timezone_type] => 3
[timezone] => Australia/Melbourne
)
[DueDate] => DateTime Object
(
[date] => 2019-03-12 00:00:00.000000
[timezone_type] => 3
[timezone] => Australia/Melbourne
)
[LineAmountTypes] => Exclusive
[InvoiceNumber] => Inv-1521
[Reference] => Feb 2019
[BrandingThemeID] => c560d364-0331-4677-a529-8ce702559165
[Url] =>
[CurrencyCode] => AUD
[CurrencyRate] => 1
[Status] => AUTHORISED
[SentToContact] => 1
[ExpectedPaymentDate] =>
[PlannedPaymentDate] =>
[SubTotal] => 2150
[TotalTax] => 215
[Total] => 2365
[TotalDiscount] =>
[InvoiceID] => f5cfaed4-db9b-41f3-94e5-a025c2bc898a
[HasAttachments] =>
[Payments] =>
[Prepayments] =>
[Overpayments] =>
[AmountDue] => 2365
[AmountPaid] => 0
[FullyPaidOnDate] =>
[AmountCredited] => 0
[UpdatedDateUTC] => DateTime Object
(
[date] => 2019-03-05 00:32:01.813000
[timezone_type] => 3
[timezone] => UTC
)
[CreditNotes] =>
)
[_dirty:protected] => Array
(
)
[_associated_objects:protected] => Array
(
)
[_application:protected] => XeroPHP\Application\PrivateApplication Object
(
[config:protected] => Array
(
[xero] => Array
(
[site] => https://api.xero.com
[base_url] => https://api.xero.com
[core_version] => 2.0
[payroll_version] => 1.0
[file_version] => 1.0
[model_namespace] => \XeroPHP\Models
)
[oauth] => Array
(
[signature_method] => RSA-SHA1
[signature_location] => header
[authorize_url] => https://api.xero.com/oauth/Authorize
[request_token_path] => oauth/RequestToken
[access_token_path] => oauth/AccessToken
[consumer_key] => REDACTED
[rsa_private_key] => REDACTED
[token] => REDACTED
)
[curl] => Array
(
[10018] => XeroPHP
[78] => 30
[13] => 20
[64] => 2
[81] => 2
[52] =>
[10004] =>
[10006] =>
[10102] =>
)
)
[oauth_client:protected] => XeroPHP\Remote\OAuth\Client Object
(
[config:XeroPHP\Remote\OAuth\Client:private] => Array
(
[signature_method] => RSA-SHA1
[signature_location] => header
[authorize_url] => https://api.xero.com/oauth/Authorize
[request_token_path] => oauth/RequestToken
[access_token_path] => oauth/AccessToken
[consumer_key] => REDACTED
[rsa_private_key] => REDACTED
[token] => REDACTED
)
[token_secret:XeroPHP\Remote\OAuth\Client:private] =>
[verifier:XeroPHP\Remote\OAuth\Client:private] =>
)
)
)
)
)
You're pretty much asking how to do the whole thing which people don't take kindly to here. Good job getting the API call done, it might take a while before you completely understand what goes on with each line but it's not required.
Now that you've got that part done you just need to work with the data that Xero gives you back, well rather what xero-php (which is the library you're using) gives you back. What you've posted is not JSON, it's just a dump (text representation) of the data as it exists as an object in your code.
That object is a Collection of Invoices, but it's just a singular invoice in your case. It will always return a Collection even if you have really specific search queries, but you can always make yourself a little check to make sure the Collection only has one invoice if you're only expecting one.
So, for what you actually want (Invoice Amount, The Customer name and Their email address), here's the next lines of code.
Invoice Amount:
$invoice->Invoices[0]->Total;
Customer Name:
$invoice->Invoices[0]->Contact->Name;
Email Address:
$invoice->Invoices[0]->Contact->EmailAddress;
Invoices[0] is used to grab the first Invoice in the Collection, so it assumes there's only one. Hopefully that points you in the right direction.
Ended up Getting it working with the following:
function GetInvData ($InvNumber) {
global $xero;
$return = array('AmountDue' => null, 'Customer' => null, 'EmailAddress' => null);
try {
//throw new Exception("Test");
$invoices = $xero->load(Accounting\Invoice::class)
->where('InvoiceNumber',$InvNumber)
->where('Status', 'AUTHORISED')
->execute();
$invoice = $invoices->first();
if(empty($invoice)){
$return = '';
}
else {
$invoiceCount = count($invoice);
if($invoiceCount > 1) {
throw new \Exception("Managed to find [" . $invoiceCount . "] with Invoice ID [" . $InvNumber . "]. Expected this to be unique.");
}
$contact = $invoice->getContact();
$return['AmountDue'] = $invoice->getAmountDue();
$return['Customer'] = $contact->getName();
$return['EmailAddress'] = $contact->getEmailAddress();
}
}
catch(\Exception $ex) {
$return = LogException($ex);
}
return $return;
}
Thanks everyone for the assistance.
I'm getting an error while using TwitchTV provider on HybridAuth 2.9, after login/permission given. I'm getting well my permission app's page.
'TwitchTV' => [
'enabled' => true,
'keys' => [
'id' => 'xxxxx',
'secret' => 'xxxxx',
],
],
Error :
Fatal error: Uncaught exception 'Hybridauth\Exception\HttpRequestFailedException' with message 'Signed API request has returned an error. HTTP error 400.
Raw Provider API response: {"error":"Bad Request","status":400,"message":"No client id specified"}.' in /home/partagesuv/www/tournaments/oauth/src/Adapter/AbstractAdapter.php:360 Stack trace: #0 /home/partagesuv/www/tournaments/oauth/src/Adapter/OAuth2.php(682): Hybridauth\Adapter\AbstractAdapter->validateApiResponse('Signed API requ...') #1 /home/partagesuv/www/tournaments/oauth/src/Provider/TwitchTV.php(55): Hybridauth\Adapter\OAuth2->apiRequest('user') #2 /home/partagesuv/www/tournaments/oauth/examples/example_06/index.php(41): Hybridauth\Provider\TwitchTV->getUserProfile() #3 {main} thrown in /home/partagesuv/www/tournaments/oauth/src/Adapter/AbstractAdapter.php on line 360
Any ideas on how to resolve this?
Thanks,
Additionnal infos (array after login) :
Array ( [TwitchTV] => Hybridauth\Provider\TwitchTV Object ( [scope:protected] => user_read channel_read [apiBaseUrl:protected] => https://api.twitch.tv/kraken/ [authorizeUrl:protected] => https://api.twitch.tv/kraken/oauth2/authorize [accessTokenUrl:protected] => https://api.twitch.tv/kraken/oauth2/token [accessTokenName:protected] => oauth_token [apiDocumentation:protected] => https://dev.twitch.tv/docs/v5/guides/authentication/ [clientId:protected] => ikp9amliqu9d23wysppu6eahqu1w6l [clientSecret:protected] => secret [accessTokenInfoUrl:protected] => [callback:protected] => http://www.shareyour.live/tournaments/oauth/examples/example_06/callback.php [AuthorizeUrlParameters:protected] => Array ( [response_type] => code [client_id] => ikp9amliqu9d23wysppu6eahqu1w6l [redirect_uri] => http://www.shareyour.live/tournaments/oauth/examples/example_06/callback.php [scope] => user_read channel_read ) [supportRequestState:protected] => 1 [tokenExchangeMethod:protected] => POST [tokenExchangeParameters:protected] => Array ( [client_id] => ikp9amliqu9d23wysppu6eahqu1w6l [client_secret] => secret [grant_type] => authorization_code [redirect_uri] => http://www.shareyour.live/tournaments/oauth/examples/example_06/callback.php ) [tokenExchangeHeaders:protected] => Array ( ) [tokenRefreshMethod:protected] => POST [tokenRefreshParameters:protected] => Array ( [grant_type] => refresh_token [refresh_token] => aueso5pw6zfxijwbytzr9zik0hkfak0s49hs7tpwhvbiodny07 ) [tokenRefreshHeaders:protected] => Array ( ) [apiRequestParameters:protected] => Array ( ) [apiRequestHeaders:protected] => Array ( [Authorization] => Bearer kquwfvdq95ruh0rzmbl1s2zg636oyl ) [providerId:protected] => TwitchTV [config:protected] => Hybridauth\Data\Collection Object ( [collection:protected] => stdClass Object ( [enabled] => 1 [keys] => Array ( [id] => ikp9amliqu9d23wysppu6eahqu1w6l [secret] => secret) [callback] => http://www.shareyour.live/tournaments/oauth/examples/example_06/callback.php ) ) [params:protected] => [storage] => Hybridauth\Storage\Session Object ( [storeNamespace:protected] => HYBRIDAUTH::STORAGE [keyPrefix:protected] => ) [httpClient] => Hybridauth\HttpClient\Curl Object ( [curlOptions:protected] => Array ( [13] => 30 [78] => 30 [64] => [81] => [19913] => 1 [52] => 1 [68] => 5 [2] => 1 [10102] => identity [10018] => HybridAuth, PHP Social Authentication Library (https://github.com/hybridauth/hybridauth) ) [requestArguments:protected] => Array ( ) [requestHeader:protected] => Array ( [Accept] => / [Cache-Control] => max-age=0 [Connection] => keep-alive [Expect] => [Pragma] => ) [responseBody:protected] => [responseHeader:protected] => Array ( ) [responseHttpCode:protected] => 0 [responseClientError:protected] => [responseClientInfo:protected] => Array ( ) [logger:protected] => Hybridauth\Logger\Logger Object ( [level:protected] => none [file:protected] => ) ) [logger] => Hybridauth\Logger\Logger Object ( [level:protected] => none [file:protected] => ) [validateApiResponseHttpCode:protected] => 1 ) )
This was a bug, fixed in the latest v3.
See https://github.com/hybridauth/hybridauth/pull/956
This is the response when I call the login method from twinfield API. It given the session id and cluster namespace, but the problem is how to get the value from it.
$customerApiConnector = new \PhpTwinfield\ApiConnectors\CustomerApiConnector($login);
print_r($customerApiConnector);die;
Output:
PhpTwinfield\ApiConnectors\CustomerApiConnector Object
(
[service:protected] => PhpTwinfield\Services\ProcessXmlService Object
(
[trace] => 1
[compression] => 32
[_stream_context] => Resource id #153
[_soap_version] => 1
[sdl] => Resource id #154
[__default_headers] => Array
(
[0] => SoapHeader Object
(
[namespace] => http://www.twinfield.com/
[name] => Header
[data] => Array
(
[SessionID] => f7b4c213-1a01-4c7c-87cb-7de80b1583fe
)
[mustUnderstand] =>
)
)
)
)
This is the other object.
Array
(
[1] => PhpTwinfield\CustomerAddress Object
(
[ID:PhpTwinfield\CustomerAddress:private] => 1
[type:PhpTwinfield\CustomerAddress:private] => invoice
[default:PhpTwinfield\CustomerAddress:private] => true
[name:PhpTwinfield\CustomerAddress:private] => Anand
[contact:PhpTwinfield\CustomerAddress:private] =>
[country:PhpTwinfield\CustomerAddress:private] => IN
[city:PhpTwinfield\CustomerAddress:private] => Indore
[postcode:PhpTwinfield\CustomerAddress:private] => 452001
[telephone:PhpTwinfield\CustomerAddress:private] =>
[fax:PhpTwinfield\CustomerAddress:private] =>
[email:PhpTwinfield\CustomerAddress:private] => anand#comfisoft.com
[field1:PhpTwinfield\CustomerAddress:private] =>
[field2:PhpTwinfield\CustomerAddress:private] => lig
[field4:PhpTwinfield\CustomerAddress:private] =>
[field5:PhpTwinfield\CustomerAddress:private] =>
[field6:PhpTwinfield\CustomerAddress:private] =>
)
)
Try this it will work ;)
function accessProtectedProperty($obj, $prop)
{
$reflection = new \ReflectionClass($obj);
$property = $reflection->getProperty($prop);
$property->setAccessible(true);
return json_decode($property->getValue($obj));
}
I'm reproducing exactly the same simple example for lead form creation on facebook
(https://developers.facebook.com/docs/marketing-api/guides/lead-ads/create)
I'm using the API SDK PHP and after running $form.create(); i'm recibing this error..
Fatal error: Uncaught FacebookAds\Http\Exception\AuthorizationException: (#100) The parameter questions[0][type] is required in C:\inetpub\wwwroot\leads\vendor\facebook\php-ads-sdk\src\FacebookAds\Http\Exception\RequestException.php:
This is the function code.
function create_form($page_id,$form_name,$url_follow,$idlegal,$idcontext){
$form = new LeadgenForm(null, $page_id);
$form->setData(array(
LeadgenFormFields::NAME => $form_name,
LeadgenFormFields::FOLLOW_UP_ACTION_URL => $url_follow,
LeadgenFormFields::QUESTIONS => array(
(new LeadGenQuestion())->setData(array(
LeadgenQuestionFields::TYPE => 'EMAIL',
)),
),
'context_card_id' => $idcontext,
'legal_content_id' => $idlegal,
));
$form->create();
}
$idcontext $idlegal are recently created with succesfully code.
Any Idea? thanks in advance!
I debuged until api:call and dumped this $data (befor call)
Array ( [name] => AGENT-TIME_STAMP-Title [follow_up_action_url] => https://www.site.es/ [questions] => Array ( [0] => FacebookAds\Object\LeadGenQuestion Object ( [data:protected] => Array ( [key] => [label] => [options] => [type] => EMAIL ) [_type_checker:protected] => FacebookAds\TypeChecker Object ( [type_data:FacebookAds\TypeChecker:private] => Array ( [key] => string [label] => string [options] => list [type] => string ) [enum_data:FacebookAds\TypeChecker:private] => Array ( ) [primitive_types:FacebookAds\TypeChecker:private] => Array ( [0] => unsigned int [1] => int [2] => bool [3] => string [4] => Object [5] => datetime [6] => float ) ) ) ) [context_card_id] => 1120914681377165 [legal_content_id] => 1166716330131814 )
Solved thanks to musashii!
LeadgenFormFields::QUESTIONS => array(array('type' => 'EMAIL')),
instead of LeadgenQuestionFields::TYPE => 'EMAIL'
try this 'type' => 'EMAIL'
I'm using JAXL 3.x to write a module that allow me to send a message to another facebook user.
public function sendTo($id = null, $name = null, $user = null){
if(!$id)
throw new NotFoundException(__('Invalid user id'));
if(!$name)
throw new NotFoundException(__('Invalid name'));
if(!$user)
throw new NotFoundException(__('Invalid user'));
$this->set('mess',$_POST['mess']);
$this->set('id',$id);
$this->set('name',$name);
$config = new Config();
$client = new JAXL(array(
// (required) credentials
'jid' => $id,
'fb_app_key' => $config->fb_app_id,
'fb_access_token' => $config->fb_access_token,
// force tls (facebook require this now)
'force_tls' => true,
// (required) force facebook oauth
'auth_type' => 'X-FACEBOOK-PLATFORM',
// (optional)
//'resource' => 'resource',
'log_level' => JAXL_INFO
));
//
// add necessary event callbacks here
//
$client->add_cb('on_auth_success', function() {
echo "got on_auth_success cb, jid ".$client->full_jid->to_string();
});
$client->add_cb('on_auth_failure', function($reason) {
$client->send_end_stream();
echo "got on_auth_failure cb with reason $reason";
});
$client->add_cb('on_chat_message', function($stanza) {
// echo back incoming message stanza
$stanza->to = $id;
$stanza->from = $client->full_jid->to_string();
$client->send($stanza);
});
$client->add_cb('on_disconnect', function() {
echo "got disconnected";
});
//
// finally start configured xmpp stream
//
$client->start();
echo "done\n";
}
But it turned out to me an error with a null $client after enter 'on_auth_success'. But as you see in the code, after the $client was created, i tried tyo print out its' content by print_r($client); and result is:
JAXL Object ( [cfg] => Array ( [jid] => -to_some_one#chat.facebook.com [fb_app_key] => appid [fb_access_token] => access_token [force_tls] => 1 [auth_type] => X-FACEBOOK-PLATFORM [log_level] => 4 [host] => chat.facebook.com [port] => 5222 ) [ev:protected] => JAXLEvent Object ( [common:protected] => Array ( ) [reg] => Array ( ) ) [xeps] => Array ( [0030] => XEP_0030 Object ( [jaxl:protected] => JAXL Object *RECURSION* ) [0115] => XEP_0115 Object ( [jaxl:protected] => JAXL Object *RECURSION* ) ) [roster] => Array ( ) [manage_roster] => 1 [manage_subscribe] => none [log_level] => 4 [priv_dir] => C:\xampp\htdocs\cake\app\Lib\Facebook/.jaxl [tmp_dir] => C:\xampp\htdocs\cake\app\Lib\Facebook/.jaxl/tmp [log_dir] => C:\xampp\htdocs\cake\app\Lib\Facebook/.jaxl/log [pid_dir] => C:\xampp\htdocs\cake\app\Lib\Facebook/.jaxl/run [sock_dir] => C:\xampp\htdocs\cake\app\Lib\Facebook/.jaxl/sock [sock:JAXL:private] => [cli:JAXL:private] => [local_ip] => 172.17.1.137 [pid] => 4736 [mode] => apache2handler [status] => [features] => Array ( ) [category] => client [type] => bot [lang] => en [retry] => 1 [retry_interval:JAXL:private] => 1 [retry_attempt:JAXL:private] => 0 [retry_max_interval:JAXL:private] => 32 [full_jid] => [jid] => XMPPJid Object ( [node] => -ffff[domain] => chat.facebook.com [resource] => [bare] => -fffff#chat.facebook.com ) [pass] => [resource] => jaxl#f2991f0002fbd1af8df4754c1df8683c [force_tls] => 1 [trans:protected] => JAXLSocketClient Object ( [host:JAXLSocketClient:private] => [port:JAXLSocketClient:private] => [transport:JAXLSocketClient:private] => [stream_context:JAXLSocketClient:private] => [blocking:JAXLSocketClient:private] => [fd] => [errno] => [errstr] => [timeout:JAXLSocketClient:private] => 10 [ibuffer:JAXLSocketClient:private] => [obuffer:JAXLSocketClient:private] => [compressed:JAXLSocketClient:private] => [recv_bytes:JAXLSocketClient:private] => 0 [send_bytes:JAXLSocketClient:private] => 0 [recv_cb:JAXLSocketClient:private] => Array ( [0] => JAXLXmlStream Object ( [delimiter:JAXLXmlStream:private] => \ [ns:JAXLXmlStream:private] => [parser:JAXLXmlStream:private] => Resource id #93 [stanza:JAXLXmlStream:private] => [depth:JAXLXmlStream:private] => -1 [start_cb:JAXLXmlStream:private] => Array ( [0] => JAXL Object *RECURSION* [1] => start_cb ) [stanza_cb:JAXLXmlStream:private] => Array ( [0] => JAXL Object *RECURSION* [1] => stanza_cb ) [end_cb:JAXLXmlStream:private] => Array ( [0] => JAXL Object *RECURSION* [1] => end_cb ) ) [1] => parse ) [recv_chunk_size:JAXLSocketClient:private] => 1024 [writing:JAXLSocketClient:private] => ) [xml:protected] => JAXLXmlStream Object ( [delimiter:JAXLXmlStream:private] => \ [ns:JAXLXmlStream:private] => [parser:JAXLXmlStream:private] => Resource id #93 [stanza:JAXLXmlStream:private] => [depth:JAXLXmlStream:private] => -1 [start_cb:JAXLXmlStream:private] => Array ( [0] => JAXL Object *RECURSION* [1] => start_cb ) [stanza_cb:JAXLXmlStream:private] => Array ( [0] => JAXL Object *RECURSION* [1] => stanza_cb ) [end_cb:JAXLXmlStream:private] => Array ( [0] => JAXL Object *RECURSION* [1] => end_cb ) ) [last_id:protected] => 0 [state:protected] => setup )
That means $client was success in connecting to XMPP service. Any helps?
\\\\\\\\ADDING COMMENT\\\\\\\\\
I'm using cakephp in developing web apps.