beginning of 'duplication-prevent'
This commit is contained in:
parent
7626adf3d5
commit
aa25bf3693
|
@ -6,6 +6,7 @@
|
|||
if( !defined('__CONFIG__') ) define('__CONFIG__', __ROOT__.'/config' );
|
||||
if( !defined('__BUILD__') ) define('__BUILD__', __ROOT__.'/build' );
|
||||
if( !defined('__PUBLIC__') ) define('__PUBLIC__', __ROOT__.'/public_html' );
|
||||
if( !defined('__TMP__') ) define('__TMP__', __ROOT__.'/public_html/tmp' );
|
||||
|
||||
|
||||
/* ACTIVE LE DEBUGGAGE (WARNING + EXCEPTION)
|
||||
|
|
|
@ -106,7 +106,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* EXECUTE LE TRAITEMENT ASSOCIE ET REMPLIE LA REPONSE
|
||||
*
|
||||
* @return answer<ModuleResponse> Retourne une reponse de type <ModuleResponse> si tout s'est bien passe
|
||||
|
@ -146,13 +145,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* EXECUTE LE TRAITEMENT ASSOCIE ET RENVOIE UN FICHIER AVEC LE HEADER ET LE BODY SPECIFIE
|
||||
*
|
||||
*/
|
||||
|
@ -309,9 +301,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* VERIFICATION DU FORMAT ET DE LA COHERENCE DU CHEMIN SPECIFIE
|
||||
*
|
||||
* @path<String> String correspondant au chemin de delegation ("module/methode")
|
||||
|
@ -359,10 +348,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* RETOURNE SI ON A LA PERMISSION D'EXECUTER CETTE METHODE
|
||||
*
|
||||
* @token<String> Token d'acces a l'API (OPTIONNEL)
|
||||
|
@ -430,8 +415,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* VERIFICATION DU TYPE DES PARAMETRES ENVOYES
|
||||
*
|
||||
* @params<Array> Tableau associatif contenant les parametres
|
||||
|
@ -492,9 +475,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* AJOUT DES OPTIONS A PARTIR DE LA CONFIGURATION
|
||||
*
|
||||
*/
|
||||
|
@ -535,9 +515,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* RENVOI LE CHEMIN D'AMORCAGE DE LA METHODE
|
||||
*
|
||||
* @return path<Array> Retourne le chemin d'amorcage de la requete
|
||||
|
|
|
@ -185,6 +185,9 @@
|
|||
foreach($json['contacts'] as $contact){
|
||||
$checkContact = isset($contact['uid']) && is_numeric($contact['uid']);
|
||||
$checkContact = $checkContact && isset($contact['username']) && is_string($contact['username']);
|
||||
// Existing ou username.length > 0
|
||||
$checkContact = $checkContact && isset($contact['existing']);
|
||||
$checkContact = $checkContact && ( is_numeric($contact['existing']) || strlen($contact['username']) > 0 );
|
||||
// $checkContact = $checkContact && isset($contact['sms']) && is_numeric($contact['sms']);
|
||||
// $checkContact = $checkContact && isset($contact['call']) && is_numeric($contact['call']);
|
||||
// $checkContact = $checkContact && isset($contact['countsms']) && is_numeric($contact['countsms']);
|
||||
|
@ -196,6 +199,7 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* (5) Vérification des mini-fiches */
|
||||
foreach($json['mini'] as $mini){
|
||||
$checkMini = isset($mini['uid']) && is_numeric($mini['uid']);
|
||||
|
|
|
@ -77,10 +77,9 @@
|
|||
|
||||
public function close(){ $this->driver = null; }
|
||||
|
||||
/* RETOURNE LA LISTE DES INDEX
|
||||
|
||||
|
||||
|
||||
/* RETOURNE LA LISTE DES INDEX
|
||||
*
|
||||
* @i<String> Index pour lequel on veut la ligne et le hash
|
||||
*
|
||||
|
@ -199,10 +198,9 @@
|
|||
return $json;
|
||||
}
|
||||
|
||||
/* RENVOIE LES DONNEES ASSOCIEES AUX CLES DONNEES
|
||||
|
||||
|
||||
|
||||
/* RENVOIE LES DONNEES ASSOCIEES AUX CLES DONNEES
|
||||
*
|
||||
* @keys<Array> Clés associées aux valeurs à récupérer
|
||||
*
|
||||
|
@ -253,7 +251,7 @@
|
|||
$line = $this->index[$key]['line'];
|
||||
|
||||
/* (2) On réarrange la bd pour supprimer la ligne */
|
||||
$tmpfilename = __BUILD__.'/tmp/'.uniqid().'.dat';
|
||||
$tmpfilename = __TMP__.'/'.uniqid().'.dat';
|
||||
$tmpfile = new \SplFileObject($tmpfilename, 'w');
|
||||
$this->driver->seek(0);
|
||||
|
||||
|
@ -342,7 +340,7 @@
|
|||
/* [3] On supprime les lignes à supprimer
|
||||
=========================================================*/
|
||||
/* (1) On réarrange la bd pour supprimer la ligne */
|
||||
$tmpfilename = __BUILD__.'/tmp/'.uniqid().'.dat';
|
||||
$tmpfilename = __TMP__.'/'.uniqid().'.dat';
|
||||
$tmpfile = new \SplFileObject($tmpfilename, 'w');
|
||||
$this->driver->seek(0);
|
||||
|
||||
|
@ -393,10 +391,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* RENVOIE LES DONNEES ASSOCIEES A UN CHAMP DE RECHERCHE
|
||||
*
|
||||
* @nomParam<typeParam> Description du param
|
||||
|
@ -432,11 +426,10 @@
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected function simpleFilter($e){ return $e['hash'] == $this->tmp; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
{"1":{"line":0,"hash":"10a358a685d0fbdff78068d891fdd08f06011be4"},"2":{"line":1,"hash":"dad8b6bc0c54a329075ae2a5f55e188dc1fd13fa"},"":{"line":2,"hash":"847db4a9bf7f5397425f60a0c596910216ab8f7c"}}
|
||||
[]
|
|
@ -1,190 +0,0 @@
|
|||
<?php
|
||||
|
||||
define('__ROOT__', dirname(dirname(dirname(__FILE__))) );
|
||||
|
||||
require_once __ROOT__.'/autoloader.php';
|
||||
|
||||
|
||||
|
||||
|
||||
use \database\core\Repo;
|
||||
use \database\core\DatabaseDriver;
|
||||
use \orm\core\Table;
|
||||
use \orm\core\Rows;
|
||||
|
||||
debug();
|
||||
|
||||
|
||||
/* [2] Requests on lab-surveys
|
||||
=========================================================*/
|
||||
function fetchAllData(){
|
||||
$lisst = Table::get('laboratoires', 'lab-surveys')
|
||||
->whereIntitule('LISST');
|
||||
|
||||
$etudes = Table::get('etudes', 'lab-surveys')
|
||||
->join('idLaboratoire', $lisst)
|
||||
->orderby('idEtude')
|
||||
->unique();
|
||||
|
||||
$fiches = Table::get('fiches', 'lab-surveys')
|
||||
->select('idFiche')
|
||||
->orderby('idFiche')
|
||||
->join('idEtude', $etudes);
|
||||
|
||||
$questions = Table::get('questionsFiches', 'lab-surveys')
|
||||
->select('idQuestionFiche')
|
||||
->select('intitule', null, null, 'question')
|
||||
->orderby('idQuestionFiche')
|
||||
->join('idFiche', $fiches);
|
||||
|
||||
$repAtt = Table::get('reponsesAttenduesFiches', 'lab-surveys')
|
||||
->select('intitule', Rows::SEL_CONCAT, null, 'possible')
|
||||
->join('idQuestionFiche', $questions)
|
||||
->orderby('idReponseAttendueFiche');
|
||||
|
||||
$sujets = Table::get('sujets', 'lab-surveys')
|
||||
->select('idSujet')
|
||||
->select('pseudo')
|
||||
->orderby('idSujet');
|
||||
|
||||
$repSuj = Table::get('reponsesFiches', 'lab-surveys')
|
||||
->select('intitule', null, null, 'reponse')
|
||||
->join('idSujet', $sujets)
|
||||
->join('idQuestionFiche', $repAtt);
|
||||
|
||||
var_dump( $repSuj->fetch() );
|
||||
}
|
||||
|
||||
|
||||
function fetchSujets(){
|
||||
$lisst = Table::get('laboratoires', 'lab-surveys')
|
||||
->whereIntitule('LISST');
|
||||
|
||||
$etudes = Table::get('etudes', 'lab-surveys')
|
||||
->join('idLaboratoire', $lisst)
|
||||
->orderby('idEtude')
|
||||
->unique();
|
||||
|
||||
$sujets = Table::get('sujets', 'lab-surveys')
|
||||
->select('idSujet')
|
||||
->select('pseudo')
|
||||
->join('idEtude', $lisst)
|
||||
->orderby('idSujet');
|
||||
|
||||
var_dump( $sujets->fetch() );
|
||||
}
|
||||
|
||||
|
||||
function fetchNbQuestionsPerFiche(){
|
||||
$lisst = Table::get('laboratoires', 'lab-surveys')
|
||||
->whereIntitule('LISST');
|
||||
|
||||
$etudes = Table::get('etudes', 'lab-surveys')
|
||||
->join('idLaboratoire', $lisst)
|
||||
->orderby('idEtude')
|
||||
->unique();
|
||||
|
||||
$fiches = Table::get('fiches', 'lab-surveys')
|
||||
->select('idFiche')
|
||||
->orderby('idFiche')
|
||||
->join('idEtude', $etudes);
|
||||
|
||||
$questions = Table::get('questionsFiches', 'lab-surveys')
|
||||
->select('idQuestionFiche', Rows::SEL_COUNT)
|
||||
->join('idFiche', $fiches);
|
||||
|
||||
var_dump( $questions->fetch() );
|
||||
}
|
||||
|
||||
|
||||
function fetchFicheComplete(){
|
||||
$lisst = Table::get('laboratoires', 'lab-surveys')
|
||||
->whereIntitule('LISST');
|
||||
|
||||
$etudes = Table::get('etudes', 'lab-surveys')
|
||||
->join('idLaboratoire', $lisst)
|
||||
->orderby('idEtude')
|
||||
->unique();
|
||||
|
||||
$fiche = Table::get('fiches', 'lab-surveys')
|
||||
->select('idFiche')
|
||||
->orderby('idFiche')
|
||||
->join('idEtude', $etudes)
|
||||
->unique();
|
||||
|
||||
$questions = Table::get('questionsFiches', 'lab-surveys')
|
||||
->select('idQuestionFiche')
|
||||
->select('intitule')
|
||||
->orderby('idQuestionFiche')
|
||||
->join('idFiche', $fiche);
|
||||
|
||||
$rep = Table::get('reponsesAttenduesFiches', 'lab-surveys')
|
||||
->select('idReponseAttendueFiche', Rows::SEL_CONCAT, null, 'reponsesid')
|
||||
->select('intitule', Rows::SEL_CONCAT, null, 'reponses')
|
||||
->orderby('idReponseAttendueFiche')
|
||||
->join('idQuestionFiche', $questions);
|
||||
|
||||
var_dump( $rep->fetch() );
|
||||
}
|
||||
|
||||
|
||||
function fetchRelations(){
|
||||
$lisst = Table::get('laboratoires', 'lab-surveys')
|
||||
->whereIntitule('LISST');
|
||||
|
||||
$etudes = Table::get('etudes', 'lab-surveys')
|
||||
->join('idLaboratoire', $lisst)
|
||||
->orderby('idEtude')
|
||||
->unique();
|
||||
|
||||
$A = Table::get('sujets', 'lab-surveys')
|
||||
->select('idSujet')
|
||||
->join('idEtude', $lisst)
|
||||
->orderby('idSujet')
|
||||
->fetch();
|
||||
$Ain = [];
|
||||
foreach($A as $i=>$v)
|
||||
$Ain[] = $v['idSujet'];
|
||||
|
||||
$B = Table::get('sujets', 'lab-surveys')
|
||||
->join('idEtude', $lisst)
|
||||
->orderby('idSujet');
|
||||
|
||||
$cate = Table::get('categoriesRelations', 'lab-surveys')
|
||||
->select('intitule', null, null, 'categorie');
|
||||
|
||||
$rel = Table::get('relations', 'lab-surveys')
|
||||
->select('idSujetA', Rows::SEL_CONCAT)
|
||||
->select('idSujetB')
|
||||
->select('knows')
|
||||
->select('isEgo')
|
||||
->where('idSujetA', [$Ain, Rows::COND_IN])
|
||||
->join('idSujetB', $B)
|
||||
->join('idCategorieRelation', $cate);
|
||||
|
||||
var_dump( $rel->fetch() );
|
||||
}fetchRelations();
|
||||
|
||||
|
||||
function idQuestionToKey($idQuestion){
|
||||
switch($idQuestion){
|
||||
case 3: return 'sexe'; break;
|
||||
case 6: return 'studies1'; break;
|
||||
case 5: return 'famsit'; break;
|
||||
case 12: return 'context'; break;
|
||||
case 7: return 'reltype'; break;
|
||||
case 10: return 'dist'; break;
|
||||
case 15: return 'freq[face]'; break;
|
||||
case 16: return 'freq[skype]'; break;
|
||||
case 17: return 'freq[sms]'; break;
|
||||
case 18: return 'freq[mail]'; break;
|
||||
case 19: return 'freq[facebook]'; break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
|
@ -1,275 +0,0 @@
|
|||
<?php define('__BUILD__', dirname(__FILE__) );
|
||||
require_once __ROOT__.'/autoloader.php';
|
||||
|
||||
|
||||
|
||||
|
||||
use \api\core\ModuleRequest;
|
||||
use \manager\ManagerError;
|
||||
use \database\core\Repo;
|
||||
use \database\core\DatabaseDriver;
|
||||
use \lightdb\core\lightdb;
|
||||
|
||||
use \api\client;
|
||||
debug();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* PARSAGE DE JOURNAUX D'APPEL
|
||||
*
|
||||
*
|
||||
*/
|
||||
function parseCallLog(){
|
||||
/* [2] On cree la requete
|
||||
=========================================================*/
|
||||
$request = new ModuleRequest('call_log/unserialize', [
|
||||
'phone_number' => '01 02 03 04 05'
|
||||
]);
|
||||
$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
|
||||
=========================================================*/
|
||||
$directory = $answer->get('directory');
|
||||
$logs = $answer->get('logs');
|
||||
|
||||
foreach($directory as $num=>$name)
|
||||
echo $num.' <> '.$name.'<br>';
|
||||
}
|
||||
|
||||
// parseCallLog();
|
||||
|
||||
|
||||
/* [1] Test du client de l'API generique
|
||||
=========================================================*/
|
||||
// $api = new client();
|
||||
//
|
||||
// $response = $api->send('generate-network-chart-data', [
|
||||
// '@token'=> '52945efbed43b50c12413f2f0e9519bfd9e98ce8'
|
||||
// ]);
|
||||
//
|
||||
// var_dump($response);
|
||||
|
||||
|
||||
/* [2] Gestion du getter dynamique des Repos
|
||||
=========================================================*/
|
||||
// var_dump( \database\repo\user::getById(1) );
|
||||
// var_dump( \database\repo\user::getByLogin('xdrm') );
|
||||
// var_dump( \database\repo\subject::getById(69) );
|
||||
// var_dump( \database\repo\relation::getById(638, 640, 30) );
|
||||
|
||||
|
||||
|
||||
/* [3] Test de la vérification du format de fichier pour l'upload
|
||||
=========================================================*/
|
||||
?>
|
||||
<!-- <form action='' method='POST' enctype='multipart/form-data'>
|
||||
<input type='file' name='file'>
|
||||
<input type='submit' value='Upload'>
|
||||
</form> -->
|
||||
<?php
|
||||
// var_dump($_FILES);
|
||||
//
|
||||
// if( isset($_FILES) ){
|
||||
//
|
||||
// $request = new ModuleRequest('upload/local_data',[] );
|
||||
// $response = $request->dispatch();
|
||||
// var_dump( ManagerError::explicit($response->error) );
|
||||
//
|
||||
// }
|
||||
|
||||
// $rq = new ModuleRequest('download/chart', ['subjects'=>[1], 'phone'=>true]);
|
||||
// $rs = $rq->dispatch();
|
||||
// var_dump($rs);
|
||||
|
||||
|
||||
/* [4] Test download via AJAX
|
||||
=========================================================*/
|
||||
// $req = new ModuleRequest('subject/search', [ 'name' => 'a' ]);
|
||||
//
|
||||
// $res = $req->dispatch();
|
||||
//
|
||||
// if( $res->error != ManagerError::Success )
|
||||
// var_dump( ManagerError::explicit($res->error) );
|
||||
//
|
||||
// var_dump($res);
|
||||
|
||||
// $db = new lightdb('phone_db');
|
||||
// $db->delete(284);
|
||||
// $db->close();
|
||||
|
||||
|
||||
// $start = microtime(true);
|
||||
// $f = new SplFileObject('compress.zlib://'.__BUILD__.'/tmp/test1.gz', 'w');
|
||||
// $f->fwrite('SOME TEXT');
|
||||
// $f=null;
|
||||
// var_dump('writing time : '.(microtime(true)-$start));
|
||||
//
|
||||
//
|
||||
// $start = microtime(true);
|
||||
// $f2 = new SplFileObject('compress.zlib://'.__BUILD__.'/tmp/test1.gz', 'r');
|
||||
// $read = $f2->fgets();
|
||||
// $f2=null;
|
||||
// var_dump('reading time : '.(microtime(true)-$start));
|
||||
// var_dump($read);
|
||||
//
|
||||
// exit();
|
||||
|
||||
|
||||
/* [4] Analyse des performances de `lightdb`
|
||||
=========================================================*/
|
||||
// $start = microtime(true);
|
||||
// $db = new lightdb('test1', __BUILD__.'/tmp/');
|
||||
//
|
||||
// /* (0) Création des objets à insérer */
|
||||
// $object_10 = [];
|
||||
// for( $i = 0 ; $i < 10 ; $i++ )
|
||||
// $object_10["key-$i-"] = "value-$i-";
|
||||
// $o10len = strlen( json_encode($object_10) );
|
||||
//
|
||||
// $object_100 = [];
|
||||
// for( $i = 0 ; $i < 100 ; $i++ )
|
||||
// $object_100["key-$i-"] = "value-$i-";
|
||||
// $o100len = strlen( json_encode($object_100) );
|
||||
//
|
||||
// $object_1000 = [];
|
||||
// for( $i = 0 ; $i < 1000 ; $i++ )
|
||||
// $object_1000["key-$i-"] = "value-$i-";
|
||||
// $o1000len = strlen( json_encode($object_1000) );
|
||||
|
||||
|
||||
|
||||
/* (1) Insertion de 1000 données */
|
||||
// {1} Insertion d'objects de taille 10 //
|
||||
// var_dump("Inserting 1000* object_10($o10len)");
|
||||
// $start = microtime(true);
|
||||
//
|
||||
// $data = [];
|
||||
// for( $i = 0 ; $i < 1000 ; $i++ )
|
||||
// // $db->insert("object-10-$i", $object_10);
|
||||
// $data["object-10-$i"] = $object_10;
|
||||
//
|
||||
// $db->insertAll($data);
|
||||
//
|
||||
// $stop = microtime(true);
|
||||
// var_dump('1000 lines inserted in '.($stop-$start).' sec.'); echo '<br>';
|
||||
//
|
||||
// // {2} Insertion d'objects de taille 100 //
|
||||
// var_dump("Inserting 1000* object_100($o100len)");
|
||||
// $start = microtime(true);
|
||||
//
|
||||
//
|
||||
// $data = [];
|
||||
// for( $i = 0 ; $i < 1000 ; $i++ )
|
||||
// // $db->insert("object-100-$i", $object_100);
|
||||
// $data["object-100-$i"] = $object_100;
|
||||
//
|
||||
// $db->insertAll($data);
|
||||
//
|
||||
// $stop = microtime(true);
|
||||
// var_dump('1000 lines inserted in '.($stop-$start).' sec.'); echo '<br>';
|
||||
//
|
||||
// // {3} Insertion d'objects de taille 1000 //
|
||||
// var_dump("Inserting 1000* object_1000($o1000len)");
|
||||
// $start = microtime(true);
|
||||
//
|
||||
// $data = [];
|
||||
// for( $i = 0 ; $i < 1000 ; $i++ )
|
||||
// // $db->insert("object-1000-$i", $object_1000);
|
||||
// $data["object-1000-$i"] = $object_1000;
|
||||
//
|
||||
// $db->insertAll($data);
|
||||
//
|
||||
// $stop = microtime(true);
|
||||
// var_dump('1000 lines inserted in '.($stop-$start).' sec.'); echo '<br>';
|
||||
|
||||
/* (2) Récupération de 1000 données */
|
||||
// {1} Récupération d'objects de taille 10 //
|
||||
// var_dump("Fetching 1000* object_10($o10len)");
|
||||
// $start = microtime(true);
|
||||
//
|
||||
// for( $i = 0 ; $i < 1000 ; $i++ )
|
||||
// $db->fetch("object-10-$i");
|
||||
//
|
||||
// $stop = microtime(true);
|
||||
// var_dump('1000 lines fetched in '.($stop-$start).' sec.'); echo '<br>';
|
||||
//
|
||||
// // {2} Récupération d'objects de taille 100 //
|
||||
// var_dump("Fetching 1000* object_100($o100len)");
|
||||
// $start = microtime(true);
|
||||
//
|
||||
// for( $i = 0 ; $i < 1000 ; $i++ )
|
||||
// $db->fetch("object-100-$i");
|
||||
//
|
||||
// $stop = microtime(true);
|
||||
// var_dump('1000 lines fetched in '.($stop-$start).' sec.'); echo '<br>';
|
||||
//
|
||||
// // {3} Récupération d'objects de taille 1000 //
|
||||
// var_dump("Fetching 1000* object_1000($o1000len)");
|
||||
// $start = microtime(true);
|
||||
//
|
||||
// for( $i = 0 ; $i < 1000 ; $i++ )
|
||||
// $db->fetch("object-1000-$i");
|
||||
//
|
||||
// $stop = microtime(true);
|
||||
// var_dump('1000 lines fetched in '.($stop-$start).' sec.'); echo '<br>';
|
||||
|
||||
|
||||
/* (3) Suppression de 1000 données */
|
||||
// {1} Suppression d'objects de taille 10 //
|
||||
// var_dump("Deleting 10* object_10($o10len)");
|
||||
//
|
||||
// $keys = [];
|
||||
// for( $i = 0 ; $i < 1000 ; $i++ )
|
||||
// array_push($keys, "object-10-$i");
|
||||
//
|
||||
// $start = microtime(true);
|
||||
// $db->deleteAll($keys);
|
||||
// $stop = microtime(true);
|
||||
// var_dump('10 lines deleted in '.($stop-$start).' sec.'); echo '<br>';
|
||||
|
||||
|
||||
// // {2} Suppression d'objects de taille 100 //
|
||||
// var_dump("Deleting 1000* object_100($o100len)");
|
||||
//
|
||||
// $keys = [];
|
||||
// for( $i = 0 ; $i < 1000 ; $i++ )
|
||||
// array_push($keys, "object-100-$i");
|
||||
//
|
||||
// $start = microtime(true);
|
||||
// $db->deleteAll($keys);
|
||||
// $stop = microtime(true);
|
||||
// var_dump('1000 lines deleted in '.($stop-$start).' sec.'); echo '<br>';
|
||||
|
||||
|
||||
// // {3} Suppression d'objects de taille 1000 //
|
||||
// var_dump("Deleting 1000* object_1000($o1000len)");
|
||||
|
||||
// $keys = [];
|
||||
// for( $i = 0 ; $i < 1000 ; $i++ )
|
||||
// array_push($keys, "object-1000-$i");
|
||||
//
|
||||
// $start = microtime(true);
|
||||
// $db->deleteAll($keys);
|
||||
// $stop = microtime(true);
|
||||
// var_dump('1000 lines deleted in '.($stop-$start).' sec.');
|
||||
//
|
||||
// $db->close();
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
|
@ -271,7 +271,6 @@ var phoneRoutine = function(){
|
|||
console.log('> GATHERING ALL DATA');
|
||||
|
||||
/* (1) On met dans la mémoire tout les champs non enregistrés */
|
||||
pSubjectManager.fieldsToStorage();
|
||||
pContactManager.fieldsToStorage();
|
||||
pMiniManager.fieldsToStorage();
|
||||
pFicheManager.fieldsToStorage();
|
||||
|
@ -309,7 +308,7 @@ var phoneRoutine = function(){
|
|||
var request = {
|
||||
path: 'input/facebook',
|
||||
|
||||
subject: lsi.export('p_subject')[0],
|
||||
subject: lsi.export('p_subject')[0]['subject_id'],
|
||||
contacts: lsi.export('p_contacts'),
|
||||
mini: lsi.export('p_mini-fiches'),
|
||||
fiches: lsi.export('p_fiches'),
|
||||
|
|
|
@ -7,10 +7,10 @@ pContactManager.attach(pDynamicUpdate),pMiniManager=new inputPhoneMini($('[data-
|
|||
$('[data-sublink="phone"] #p_clear-all').addEventListener("click",function(a){lsi.clear("p_subject");lsi.clear("p_contacts");lsi.clear("p_mini-fiches");lsi.clear("p_fiches");lsi.clear("p_matrice");lsi.clear("p_friends");pSubjectManager.storageToFields();pContactManager.storageToFields();pMiniManager.storageToFields();pFicheManager.storageToFields();pMatriceManager.storageToFields();Notification.success("OK","Les donn\u00e9es ont \u00e9t\u00e9 supprim\u00e9es")},!1),$('[data-sublink="phone"] #p_export-all').addEventListener("click",
|
||||
function(a){Notification.info("INFORMATION","Lancement du t\u00e9l\u00e9chargement de la sauvegarde");a={subject:lsi["export"]("p_subject")[0],contacts:lsi["export"]("p_contacts"),mini:lsi["export"]("p_mini-fiches"),fiches:lsi["export"]("p_fiches"),matrice:lsi["export"]("p_matrice")[0]};var b=$('[data-sublink="phone"] #p_download-target');b.download="local-facebook-data.json";b.href="data:application/octet-stream,"+encodeURIComponent(JSON.stringify(a));b.click()},!1),$('[data-sublink="phone"] #p_import-all').addEventListener("click",
|
||||
function(a){$('[data-sublink="phone"] #p_local-upload').click()},!1),$('[data-sublink="phone"] #p_local-upload').addEventListener("click",function(a){a.target.value=null},!1),$('[data-sublink="phone"] #p_local-upload').addEventListener("change",function(a){a={path:"upload/local_data",file:$('[data-sublink="phone"] #p_local-upload').files[0]};api.send(a,function(a){console.log(a);if(0!=a.ModuleError)return Notification.error("Erreur",a.ModuleError),!1;lsi.set("p_subject",0,a.local_data.subject);lsi["import"]("p_contacts",
|
||||
a.local_data.contacts);lsi["import"]("p_mini-fiches",a.local_data.mini);lsi["import"]("p_fiches",a.local_data.fiches);lsi.set("p_matrice",0,a.local_data.matrice);pSubjectManager.storageToFields();pContactManager.storageToFields();pMatriceManager.storageToFields();pDynamicUpdate(!0)})},!1),$('[data-sublink="phone"] #p_submit-all').addEventListener("click",function(a){console.log("> GATHERING ALL DATA");pSubjectManager.fieldsToStorage();pContactManager.fieldsToStorage();pMiniManager.fieldsToStorage();
|
||||
pFicheManager.fieldsToStorage();if(!pSubjectManager.check())return Notification.warning("Attention","Vous devez saisir les informations du <i>sujet</i>"),!1;a=lsi["export"]("p_mini-fiches");var b=0,c;for(c in a)if(!isNaN(c)&&(b++,!a[c].valid))return Notification.warning("Attention","La <i>fiche rapide</i> <b>"+b+"</b> est incompl\u00e8te et/ou incorrecte"),!1;a=lsi["export"]("p_fiches");for(c in a)if(!a[c].valid)return Notification.warning("Attention","La <i>fiche compl\u00e8te</i> <b>"+(parseInt(c)+
|
||||
1)+"</b> est incompl\u00e8te et/ou incorrecte"),!1;c={path:"input/facebook",subject:lsi["export"]("p_subject")[0],contacts:lsi["export"]("p_contacts"),mini:lsi["export"]("p_mini-fiches"),fiches:lsi["export"]("p_fiches"),matrice:lsi["export"]("p_matrice")[0]};api.send(c,function(a){console.log(a);if(0!=a.ModuleError)return Notification.error("ERREUR",a.ModuleError),!1;Notification.success("OK","L'identifiant du sujet est <strong>"+a.subject_id+"</strong> ! Tout s'est bien d\u00e9roul\u00e9.",1E4);
|
||||
console.log(a)},!1)},!1),console.groupEnd())};include("/js/includes/input-phone-subject.js",function(){pLoaded[0]=1;phoneRoutine()});include("/js/includes/input-phone-contact.js",function(){pLoaded[1]=1;phoneRoutine()});include("/js/includes/input-phone-mini.js",function(){pLoaded[2]=1;phoneRoutine()});include("/js/includes/input-phone-fiche.js",function(){pLoaded[3]=1;phoneRoutine()});include("/js/includes/input-phone-matrice.js",function(){pLoaded[4]=1;phoneRoutine()});
|
||||
a.local_data.contacts);lsi["import"]("p_mini-fiches",a.local_data.mini);lsi["import"]("p_fiches",a.local_data.fiches);lsi.set("p_matrice",0,a.local_data.matrice);pSubjectManager.storageToFields();pContactManager.storageToFields();pMatriceManager.storageToFields();pDynamicUpdate(!0)})},!1),$('[data-sublink="phone"] #p_submit-all').addEventListener("click",function(a){console.log("> GATHERING ALL DATA");pContactManager.fieldsToStorage();pMiniManager.fieldsToStorage();pFicheManager.fieldsToStorage();
|
||||
if(!pSubjectManager.check())return Notification.warning("Attention","Vous devez saisir les informations du <i>sujet</i>"),!1;a=lsi["export"]("p_mini-fiches");var b=0,c;for(c in a)if(!isNaN(c)&&(b++,!a[c].valid))return Notification.warning("Attention","La <i>fiche rapide</i> <b>"+b+"</b> est incompl\u00e8te et/ou incorrecte"),!1;a=lsi["export"]("p_fiches");for(c in a)if(!a[c].valid)return Notification.warning("Attention","La <i>fiche compl\u00e8te</i> <b>"+(parseInt(c)+1)+"</b> est incompl\u00e8te et/ou incorrecte"),
|
||||
!1;c={path:"input/facebook",subject:lsi["export"]("p_subject")[0].subject_id,contacts:lsi["export"]("p_contacts"),mini:lsi["export"]("p_mini-fiches"),fiches:lsi["export"]("p_fiches"),matrice:lsi["export"]("p_matrice")[0]};api.send(c,function(a){console.log(a);if(0!=a.ModuleError)return Notification.error("ERREUR",a.ModuleError),!1;Notification.success("OK","L'identifiant du sujet est <strong>"+a.subject_id+"</strong> ! Tout s'est bien d\u00e9roul\u00e9.",1E4);console.log(a)},!1)},!1),console.groupEnd())};
|
||||
include("/js/includes/input-phone-subject.js",function(){pLoaded[0]=1;phoneRoutine()});include("/js/includes/input-phone-contact.js",function(){pLoaded[1]=1;phoneRoutine()});include("/js/includes/input-phone-mini.js",function(){pLoaded[2]=1;phoneRoutine()});include("/js/includes/input-phone-fiche.js",function(){pLoaded[3]=1;phoneRoutine()});include("/js/includes/input-phone-matrice.js",function(){pLoaded[4]=1;phoneRoutine()});
|
||||
var fAlready=0,fLoaded=[0,0,0,0,0],facebookRoutine=function(){!Math.min.apply(Math,fLoaded)|fAlready||(fAlready=1,console.groupEnd(),console.group("[facebook] Initialization"),fSubjectManager=new inputFacebookSubject($('[data-sublink="facebook"] article.subject-panel [data-name="subject_id"]'),$('[data-sublink="facebook"] article.subject-panel [data-name="submit"]')),fSubjectManager.attach(fDynamicUpdate),fContactManager=new inputFacebookContact($('[data-sublink="facebook"] article.contact-panel'),
|
||||
$('[data-sublink="facebook"] #f_nav-contact')),fContactManager.attach(fDynamicUpdate),fMiniManager=new inputFacebookMini($('[data-sublink="facebook"] article.mini-relation-panel'),$('[data-sublink="facebook"] #f_nav-mini')),fMiniManager.attach(fDynamicUpdate),fFicheManager=new inputFacebookFiche($('[data-sublink="facebook"] article.relation-panel'),$('[data-sublink="facebook"] #f_nav-fiche')),fFicheManager.top_size=20,fFicheManager.attach(fDynamicUpdate),fMatriceManager=new inputFacebookMatrice($('[data-sublink="facebook"] article.matrice-panel')),
|
||||
fMatriceManager.attach(fDynamicUpdate),$('[data-sublink="facebook"] #f_clear-all').addEventListener("click",function(a){lsi.clear("f_subject");lsi.clear("f_contacts");lsi.clear("f_mini-fiches");lsi.clear("f_fiches");lsi.clear("f_matrice");lsi.clear("f_friends");fSubjectManager.storageToFields();fContactManager.storageToFields();fMiniManager.storageToFields();fFicheManager.storageToFields();fMatriceManager.storageToFields();Notification.success("OK","Les donn\u00e9es ont \u00e9t\u00e9 supprim\u00e9es")},
|
||||
|
|
Loading…
Reference in New Issue