86 lines
2.1 KiB
PHP
Executable File
86 lines
2.1 KiB
PHP
Executable File
<?php define('__ROOT__', dirname(__FILE__) );
|
|
require_once __ROOT__.'/manager/autoloader.php';
|
|
|
|
use \manager\ModuleRequest;
|
|
use \manager\ResourceDispatcher;
|
|
use \manager\sessionManager;
|
|
use \manager\ManagerError;
|
|
use \manager\Repo;
|
|
use \manager\Database;
|
|
|
|
use \api\client;
|
|
|
|
|
|
|
|
|
|
/* PARSAGE DE JOURNAUX D'APPEL
|
|
*
|
|
*
|
|
*/
|
|
function parseCallLog(){
|
|
|
|
/* [1] On recupere le journal d'appel
|
|
=========================================================*/
|
|
$file_content = file_get_contents('calllog.xml');
|
|
|
|
var_dump( $file_content ); return;
|
|
|
|
/* [2] On cree la requete
|
|
=========================================================*/
|
|
$request = new ModuleRequest('call_log/unserialize', array('filecontent'=>$file_content));
|
|
$answer = $request->dispatch(); // on l'execute
|
|
|
|
/* [3] Si erreur
|
|
=========================================================*/
|
|
if( $answer->error != ManagerError::Success ){
|
|
// on l'explicite
|
|
var_dump( ManagerError::explicit($answer->error) );
|
|
// on quitte
|
|
return;
|
|
}
|
|
|
|
|
|
/* [4] Sinon on recupere le resultat
|
|
=========================================================*/
|
|
$sms = $answer->get('sms');
|
|
$call = $answer->get('call');
|
|
$contact = $answer->get('contact');
|
|
|
|
/* [5] On debug les donnees recues
|
|
=========================================================*/
|
|
var_dump( "Il y a ".count($contact)." personnes :" );
|
|
var_dump( "- ".count($sms)." par SMS/MMS" );
|
|
var_dump( "- ".count($call)." par telephone" );
|
|
echo "<br>";
|
|
echo "TOP 10 DES APPELS<br>";
|
|
echo "=================<br>";
|
|
foreach($call as $v)
|
|
var_dump( $v[0] ." (".$contact[$v[0]].") \t\t\t". $v[1] ." appels");
|
|
|
|
echo "TOP 10 DES MMS/SMS<br>";
|
|
echo "==================<br>";
|
|
foreach($sms as $v)
|
|
var_dump( $v[0] ." (".$contact[$v[0]].") \t\t\t". $v[1] ." appels");
|
|
|
|
|
|
var_dump("\n\n\nOBJET COMPLET");
|
|
var_dump( $sms );
|
|
var_dump( $call );
|
|
var_dump( $contact );
|
|
}
|
|
|
|
// parseCallLog();
|
|
|
|
debug();
|
|
|
|
|
|
|
|
// $api = new client();
|
|
|
|
// $response = $api->send('testmethod', array(
|
|
// '@token'=> '52945efbed43b50c12413f2f0e9519bfd9e98ce8'
|
|
// ));
|
|
|
|
// var_dump($response);
|
|
|
|
?>
|