Suppression du numéro de téléphone dans 'lightdb'
14
automate.php
|
@ -87,15 +87,15 @@
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
// $req = new ModuleRequest('download/phone', array('subjects'=>array(1)));
|
$req = new ModuleRequest('download/phone', array('subjects'=>array(1, 273)));
|
||||||
// $req->download();
|
var_dump( $req->download() );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* [4] Analyse des performances de `lightdb`
|
/* [4] Analyse des performances de `lightdb`
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
$start = microtime(true);
|
// $start = microtime(true);
|
||||||
$db = new lightdb('test1', __ROOT__.'/tmp/');
|
// $db = new lightdb('test1', __ROOT__.'/tmp/');
|
||||||
|
|
||||||
/* (0) Création des objets à insérer */
|
/* (0) Création des objets à insérer */
|
||||||
// $object_10 = array();
|
// $object_10 = array();
|
||||||
|
@ -207,9 +207,9 @@
|
||||||
//
|
//
|
||||||
// $stop = microtime(true);
|
// $stop = microtime(true);
|
||||||
// var_dump('1000 lines deleted in '.($stop-$start).' sec.');
|
// var_dump('1000 lines deleted in '.($stop-$start).' sec.');
|
||||||
|
//
|
||||||
|
// $db->close();
|
||||||
|
|
||||||
$db->close();
|
// var_dump('total execution time : '.(microtime(true)-$start).' sec');
|
||||||
|
|
||||||
var_dump('total execution time : '.(microtime(true)-$start).' sec');
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
var NotificationClass=function(a){this.container=a};NotificationClass.prototype={container:this.container,stack:[],types:["warning","info","success","error"],defaultTimeout:2E3,errorCodes:{}};NotificationClass.prototype.pushStack=function(a,c,b){if(!(a instanceof Array&&b instanceof Array&&c instanceof Element))return null;var e=-1,d;for(d in a)if(-1<b.indexOf(a[d])){e=d;break}if(-1==e)return a.push(c)-1;a[e]=c;return e};
|
var NotificationClass=function(a){this.container=a};NotificationClass.prototype={container:this.container,stack:[],types:["warning","info","success","error"],defaultTimeout:2E3,errorCodes:{}};NotificationClass.prototype.pushStack=function(a,c,b){if(!(a instanceof Array&&b instanceof Array&&c instanceof Element))return null;var e=-1,d;for(d in a)if(-1<b.indexOf(a[d])){e=d;break}if(-1==e)return a.push(c)-1;a[e]=c;return e};
|
||||||
NotificationClass.prototype.hide=function(a){if(isNaN(a))return!1;a=parseInt(a);null!=this.stack[a]&&this.stack[a].element instanceof Element&&this.container.removeChild(this.stack[a].element);this.stack[a]=null};
|
NotificationClass.prototype.hide=function(a){if(isNaN(a))return!1;a=parseInt(a);this.stack[a].element instanceof Element&&this.container.removeChild(this.stack[a].element);this.stack[a]=null};
|
||||||
NotificationClass.prototype.show=function(a,c,b,e){a=-1<this.types.indexOf(a)?a:this.types[0];c="string"==typeof c?c:"";b="string"==typeof b.toString()?b:"...";null!=this.errorCodes[b]&&(b=this.errorCodes[b]);e="number"==typeof e?e:this.defaultTimeout;var d={element:document.createElement("div"),type:a,title:c,message:b,timeout:null};d.element.className="notification-element";d.element.setAttribute("data-"+a,"");d.element.innerHTML="<p><strong>"+c+":</strong> "+b+"<p>";this.container.appendChild(d.element);
|
NotificationClass.prototype.show=function(a,c,b,e){a=-1<this.types.indexOf(a)?a:this.types[0];c="string"==typeof c?c:"";b="string"==typeof b.toString()?b:"...";null!=this.errorCodes[b]&&(b=this.errorCodes[b]);e="number"==typeof e?e:this.defaultTimeout;var d={element:document.createElement("div"),type:a,title:c,message:b,timeout:null};d.element.className="notification-element";d.element.setAttribute("data-"+a,"");d.element.innerHTML="<p><strong>"+c+":</strong> "+b+"<p>";this.container.appendChild(d.element);
|
||||||
var f=this.pushStack(this.stack,d,[null]);d.element.id=f;var g=this;d.element.className="notification-element notification-visible";setTimeout(function(){d.element.className="notification-element"},500+e);d.timeout=setTimeout(function(){g.hide(f)},500+e+500);d.element.addEventListener("click",function(a){g.hide(f)},!1);return d.element};NotificationClass.prototype.warning=function(a,c,b){return this.show("warning",a,c,b)};
|
var f=this.pushStack(this.stack,d,[null]);d.element.id=f;var g=this;d.element.className="notification-element notification-visible";setTimeout(function(){d.element.className="notification-element"},500+e);d.timeout=setTimeout(function(){g.hide(f)},500+e+500);d.element.addEventListener("click",function(a){g.hide(f)},!1);return d.element};NotificationClass.prototype.warning=function(a,c,b){return this.show("warning",a,c,b)};
|
||||||
NotificationClass.prototype.info=function(a,c,b){return this.show("info",a,c,b)};NotificationClass.prototype.success=function(a,c,b){return this.show("success",a,c,b)};NotificationClass.prototype.error=function(a,c,b){return this.show("error",a,c,b)};
|
NotificationClass.prototype.info=function(a,c,b){return this.show("info",a,c,b)};NotificationClass.prototype.success=function(a,c,b){return this.show("success",a,c,b)};NotificationClass.prototype.error=function(a,c,b){return this.show("error",a,c,b)};
|
||||||
|
|
200
js/lib/notif.js
|
@ -2,7 +2,7 @@
|
||||||
/* [0] CONSTRUCTEUR
|
/* [0] CONSTRUCTEUR
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
var NotificationClass = function(container){
|
var NotificationClass = function(container){
|
||||||
this.container = container;
|
this.container = container;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,16 +10,16 @@ var NotificationClass = function(container){
|
||||||
/* [1] PROTOTYPE ET ATTRIBUTS
|
/* [1] PROTOTYPE ET ATTRIBUTS
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
NotificationClass.prototype = {
|
NotificationClass.prototype = {
|
||||||
container: this.container, // Parent de la page à notifier
|
container: this.container, // Parent de la page à notifier
|
||||||
stack: [], // Contiendra les données de toutes les notifications actives
|
stack: [], // Contiendra les données de toutes les notifications actives
|
||||||
types: [ // Définition des différents types
|
types: [ // Définition des différents types
|
||||||
'warning',
|
'warning',
|
||||||
'info',
|
'info',
|
||||||
'success',
|
'success',
|
||||||
'error'
|
'error'
|
||||||
],
|
],
|
||||||
defaultTimeout: 2000, // Temps d'apparition par défaut
|
defaultTimeout: 2000, // Temps d'apparition par défaut
|
||||||
errorCodes: {} // codes d'erreurs sous la forme {codeErreur1: texteErreur1, codeErreur2: texteErreur2, ...}
|
errorCodes: {} // codes d'erreurs sous la forme {codeErreur1: texteErreur1, codeErreur2: texteErreur2, ...}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -33,37 +33,37 @@ NotificationClass.prototype = {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
NotificationClass.prototype.pushStack = function(stack, element, emptyValues){
|
NotificationClass.prototype.pushStack = function(stack, element, emptyValues){
|
||||||
/* (0) Vérification des INPUT
|
/* (0) Vérification des INPUT
|
||||||
---------------------------------------------------------*/
|
---------------------------------------------------------*/
|
||||||
/* (1) Vérification de @stack */
|
/* (1) Vérification de @stack */
|
||||||
if( !(stack instanceof Array) )
|
if( !(stack instanceof Array) )
|
||||||
return null;
|
return null;
|
||||||
/* (2) Vérification de @emptyValues */
|
/* (2) Vérification de @emptyValues */
|
||||||
if( !(emptyValues instanceof Array) )
|
if( !(emptyValues instanceof Array) )
|
||||||
return null;
|
return null;
|
||||||
/* (3) Vérification de element */
|
/* (3) Vérification de element */
|
||||||
if( !(element instanceof Element) )
|
if( !(element instanceof Element) )
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
|
||||||
/* (1) On cherche la première valeur vide dans @stack
|
/* (1) On cherche la première valeur vide dans @stack
|
||||||
---------------------------------------------------------*/
|
---------------------------------------------------------*/
|
||||||
var index = -1;
|
var index = -1;
|
||||||
for( var i in stack )
|
for( var i in stack )
|
||||||
if( emptyValues.indexOf(stack[i]) > -1 ){
|
if( emptyValues.indexOf(stack[i]) > -1 ){
|
||||||
index = i;
|
index = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (2) Insertion et résultat
|
/* (2) Insertion et résultat
|
||||||
---------------------------------------------------------*/
|
---------------------------------------------------------*/
|
||||||
/* (1) Si on a rien trouvé, on fait un push normal */
|
/* (1) Si on a rien trouvé, on fait un push normal */
|
||||||
if( index == -1 )
|
if( index == -1 )
|
||||||
return stack.push(element) - 1;
|
return stack.push(element) - 1;
|
||||||
|
|
||||||
/* (2) Si on a trouvé, on enregistre @element et on renvoie @index */
|
/* (2) Si on a trouvé, on enregistre @element et on renvoie @index */
|
||||||
stack[index] = element;
|
stack[index] = element;
|
||||||
return index;
|
return index;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -77,19 +77,19 @@ NotificationClass.prototype.pushStack = function(stack, element, emptyValues){
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
NotificationClass.prototype.hide = function(id){
|
NotificationClass.prototype.hide = function(id){
|
||||||
/* (0) Vérification de @id */
|
/* (0) Vérification de @id */
|
||||||
if( isNaN(id) )
|
if( isNaN(id) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
id = parseInt(id);
|
id = parseInt(id);
|
||||||
|
|
||||||
|
|
||||||
/* (1) Suppression de l'élément */
|
/* (1) Suppression de l'élément */
|
||||||
if( this.stack[id] != null && this.stack[id].element instanceof Element )
|
if( this.stack[id].element instanceof Element )
|
||||||
this.container.removeChild( this.stack[id].element );
|
this.container.removeChild( this.stack[id].element );
|
||||||
|
|
||||||
/* (2) On supprime la notification de la pile */
|
/* (2) On supprime la notification de la pile */
|
||||||
this.stack[id] = null;
|
this.stack[id] = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -104,74 +104,74 @@ NotificationClass.prototype.hide = function(id){
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
NotificationClass.prototype.show = function(type, title, message, timeout){
|
NotificationClass.prototype.show = function(type, title, message, timeout){
|
||||||
/* (0) Vérification des INPUT
|
/* (0) Vérification des INPUT
|
||||||
---------------------------------------------------------*/
|
---------------------------------------------------------*/
|
||||||
/* (1) Vérification de @type */
|
/* (1) Vérification de @type */
|
||||||
type = this.types.indexOf(type) > -1 ? type : this.types[0];
|
type = this.types.indexOf(type) > -1 ? type : this.types[0];
|
||||||
|
|
||||||
/* (2) Vérification de @title */
|
/* (2) Vérification de @title */
|
||||||
title = typeof title == 'string' ? title : '';
|
title = typeof title == 'string' ? title : '';
|
||||||
|
|
||||||
/* (3) Vérification de @message */
|
/* (3) Vérification de @message */
|
||||||
message = typeof message.toString() == 'string' ? message : '...';
|
message = typeof message.toString() == 'string' ? message : '...';
|
||||||
|
|
||||||
// On cherche s'il y a une occurence dans le dictionnaire
|
// On cherche s'il y a une occurence dans le dictionnaire
|
||||||
if( this.errorCodes[message] != null )
|
if( this.errorCodes[message] != null )
|
||||||
message = this.errorCodes[message];
|
message = this.errorCodes[message];
|
||||||
|
|
||||||
/* (4) Vérification de @timeout */
|
/* (4) Vérification de @timeout */
|
||||||
timeout = typeof timeout == 'number' ? timeout : this.defaultTimeout;
|
timeout = typeof timeout == 'number' ? timeout : this.defaultTimeout;
|
||||||
|
|
||||||
/* (1) Construction de l'élément
|
/* (1) Construction de l'élément
|
||||||
---------------------------------------------------------*/
|
---------------------------------------------------------*/
|
||||||
/* (1) Création du set de données */
|
/* (1) Création du set de données */
|
||||||
var stackItem = {
|
var stackItem = {
|
||||||
element: document.createElement('div'),
|
element: document.createElement('div'),
|
||||||
type: type,
|
type: type,
|
||||||
title: title,
|
title: title,
|
||||||
message: message,
|
message: message,
|
||||||
timeout: null
|
timeout: null
|
||||||
};
|
};
|
||||||
|
|
||||||
/* (2) Construction de l'élément */
|
/* (2) Construction de l'élément */
|
||||||
stackItem.element.className = 'notification-element';
|
stackItem.element.className = 'notification-element';
|
||||||
stackItem.element.setAttribute('data-'+type, '');
|
stackItem.element.setAttribute('data-'+type, '');
|
||||||
stackItem.element.innerHTML = '<p><strong>'+title+':</strong> '+message+'<p>';
|
stackItem.element.innerHTML = '<p><strong>'+title+':</strong> '+message+'<p>';
|
||||||
|
|
||||||
/* (2) Ajout à la pile et au DOM
|
/* (2) Ajout à la pile et au DOM
|
||||||
---------------------------------------------------------*/
|
---------------------------------------------------------*/
|
||||||
this.container.appendChild(stackItem.element);
|
this.container.appendChild(stackItem.element);
|
||||||
var id = this.pushStack( this.stack, stackItem, [null] );
|
var id = this.pushStack( this.stack, stackItem, [null] );
|
||||||
stackItem.element.id = id;
|
stackItem.element.id = id;
|
||||||
|
|
||||||
/* (3) Gestion du temps d'apparition
|
/* (3) Gestion du temps d'apparition
|
||||||
---------------------------------------------------------*/
|
---------------------------------------------------------*/
|
||||||
var ptr = this;
|
var ptr = this;
|
||||||
|
|
||||||
// {1} fadeIn START //
|
// {1} fadeIn START //
|
||||||
stackItem.element.className = 'notification-element notification-visible';
|
stackItem.element.className = 'notification-element notification-visible';
|
||||||
|
|
||||||
// {2} fadeOut START //
|
// {2} fadeOut START //
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
stackItem.element.className = 'notification-element';
|
stackItem.element.className = 'notification-element';
|
||||||
}, 500+timeout);
|
}, 500+timeout);
|
||||||
|
|
||||||
// {3} fadeOut STOP + animation STOP //
|
// {3} fadeOut STOP + animation STOP //
|
||||||
stackItem.timeout = setTimeout(function(){
|
stackItem.timeout = setTimeout(function(){
|
||||||
ptr.hide(id);
|
ptr.hide(id);
|
||||||
}, 500+timeout+500);
|
}, 500+timeout+500);
|
||||||
|
|
||||||
|
|
||||||
/* (4) Gestion du clic qui ferme la notification
|
/* (4) Gestion du clic qui ferme la notification
|
||||||
---------------------------------------------------------*/
|
---------------------------------------------------------*/
|
||||||
stackItem.element.addEventListener('click', function(e){
|
stackItem.element.addEventListener('click', function(e){
|
||||||
ptr.hide(id);
|
ptr.hide(id);
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
|
|
||||||
/* (5) On retourne l'élément
|
/* (5) On retourne l'élément
|
||||||
---------------------------------------------------------*/
|
---------------------------------------------------------*/
|
||||||
return stackItem.element;
|
return stackItem.element;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,6 @@
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
$file['subject'] = array(
|
$file['subject'] = array(
|
||||||
'id' => $offset + $subject_id,
|
'id' => $offset + $subject_id,
|
||||||
'number' => $subject['number'],
|
|
||||||
'name' => self::readableName($subject['username'], $subject['firstname'], $subject['lastname'])
|
'name' => self::readableName($subject['username'], $subject['firstname'], $subject['lastname'])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -142,7 +141,6 @@
|
||||||
// On remplit les données qui iront dans le fichier pour ce contact
|
// On remplit les données qui iront dans le fichier pour ce contact
|
||||||
array_push($file['contacts'], array(
|
array_push($file['contacts'], array(
|
||||||
'id' => $offset + $miniData['uid'],
|
'id' => $offset + $miniData['uid'],
|
||||||
'number' => $contact['number'],
|
|
||||||
'name' => self::readableName($contact['username'], $contact['firstname'], $contact['lastname']),
|
'name' => self::readableName($contact['username'], $contact['firstname'], $contact['lastname']),
|
||||||
'sexe' => $miniData['sexe'],
|
'sexe' => $miniData['sexe'],
|
||||||
'age' => $miniData['age'],
|
'age' => $miniData['age'],
|
||||||
|
@ -166,7 +164,6 @@
|
||||||
// On remplit les données qui iront dans le fichier pour ce contact
|
// On remplit les données qui iront dans le fichier pour ce contact
|
||||||
array_push($file['contacts'], array(
|
array_push($file['contacts'], array(
|
||||||
'id' => $offset + $ficheData['uid'],
|
'id' => $offset + $ficheData['uid'],
|
||||||
'number' => $contact['number'],
|
|
||||||
'name' => self::readableName($contact['username'], $contact['firstname'], $contact['lastname']),
|
'name' => self::readableName($contact['username'], $contact['firstname'], $contact['lastname']),
|
||||||
'sexe' => $ficheData['sexe'],
|
'sexe' => $ficheData['sexe'],
|
||||||
'age' => $ficheData['age'],
|
'age' => $ficheData['age'],
|
||||||
|
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 430 KiB After Width: | Height: | Size: 430 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 129 KiB |
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 9.9 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 241 KiB After Width: | Height: | Size: 241 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
@ -1 +1 @@
|
||||||
{"1":{"line":0,"hash":"95ad3f4b33bdef63dae17b5cafee1e39c6233314"},"69":{"line":1,"hash":"3d2eb540fa5b2c5e020f759a7627f899875df978"}}
|
{"1":{"line":0,"hash":"95ad3f4b33bdef63dae17b5cafee1e39c6233314"},"69":{"line":1,"hash":"3d2eb540fa5b2c5e020f759a7627f899875df978"},"137":{"line":2,"hash":"a8529e83f05688e89e1318b443a036e97386105d"},"205":{"line":3,"hash":"0a296a89a05509be912fefda7fdcc2692a244208"},"273":{"line":4,"hash":"1b9c3317ae25f49f6cfdee6aa34fcbc381c3a7a7"}}
|
|
@ -1 +1 @@
|
||||||
136
|
340
|