Skip to content
Snippets Groups Projects
Commit 08fad11a authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

More information in shared memory area

parent 651d0f8b
No related branches found
No related tags found
No related merge requests found
<?php
/* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* This program is free software; you can redistribute it and/or modify
......@@ -101,12 +101,19 @@ if (sizeof($shmoparray) > 0)
{
$var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").'</td><td colspan="2">'.$langs->trans("NbOfEntries").'</td></tr>'."\n";
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").'</td>';
print '<td>'.$langs->trans("NbOfEntries").'</td>';
print '<td align="right">'.$langs->trans("Address").'</td>';
print '</tr>'."\n";
foreach($shmoparray as $key => $val)
{
$var=!$var;
print "<tr ".$bc[$var]."><td width=\"300\">".$key.'</td><td colspan="2">'.sizeof($val)."</td></tr>\n";
print "<tr ".$bc[$var]."><td width=\"300\">".$key.'</td>';
print '<td>'.sizeof($val)."</td>";
print '<td align="right">'.dol_getshmopaddress($key).'</td>';
print "</tr>\n";
}
print '</table>';
......
......@@ -263,6 +263,7 @@ ModuleDisabled=Module disabled
ModuleDisabledSoNoEvent=Module disabled so event never created
ConfirmPurge=Are you sure you want to execute this purge ?<br>This will delete definitely all your data files with no way to restore them (ECM files, attached files...).
MinLength=Minimum length
LanguageFilesCachedIntoShmopSharedMemory=Files .lang loaded in shared memory
# Modules
Module0Name=Users & groups
......
......@@ -47,6 +47,7 @@ ErrorFailedToSaveFile=Error, failed to save file.
ErrorOnlyPngJpgSupported=Error, only .png and .jpg image format file are supported.
ErrorImageFormatNotSupported=Your PHP does not support functions to convert images of this format.
BackgroundColorByDefault=Default background color
NbOfEntries=Nb of entries
GoToWikiHelpPage=Read online help (need Internet access)
GoToHelpPage=Read help
RecordSaved=Record saved
......
......@@ -263,6 +263,7 @@ ModuleDisabled=Module désactivé
ModuleDisabledSoNoEvent=Module désactivé donc évênement jamais créé
ConfirmPurge=Etes vous sur de vouloir réaliser cette purge ?<br>Ceci effacera définitivement toutes vos données fichier (espace GED, pièces jointes, etc...).
MinLength=Longueur minimale
LanguageFilesCachedIntoShmopSharedMemory=Fichiers .lang en mémoire partagée
# Modules = undefined
Module0Name = Utilisateurs & groupes
......@@ -310,7 +311,7 @@ Module58Desc = Intégration de ClickToDial
Module59Name = Bookmark4u
Module59Desc = Ajoute fonction pour générer un compte Bookmark4u depuis un compte Dolibarr
Module70Name = Interventions
Module70Desc = Gestion des interventions
Module70Desc = Gestion des interventions chez les tiers
Module75Name = Notes de frais et déplacements
Module75Desc = Gestion des notes de frais et déplacements
Module80Name = Expéditions
......
......@@ -47,6 +47,7 @@ ErrorFailedToSaveFile=Erreur, l'enregistrement du fichier a échoué.
ErrorOnlyPngJpgSupported=Erreur, seuls les formats images .jpg et .png sont supportés.
ErrorImageFormatNotSupported=Votre PHP ne supporte pas les fonctions de conversion de ce format d'image.
BackgroundColorByDefault=Couleur de fond
NbOfEntries=Nb d'entrées
GoToWikiHelpPage=Consulter l'aide (nécessite un accès internet)
GoToHelpPage=Consulter l'aide
RecordSaved=Enregistrement sauvegardé
......
......@@ -34,6 +34,18 @@ $shmoffset=100;
/** \brief Return shared memory address used to store dataset with key memoryid
* \param $memoryid Memory id of shared area
* \return int <0 if KO, Memoy address of shared memory for key
*/
function dol_getshmopaddress($memoryid)
{
global $shmkeys,$shmoffset;
if (empty($shmkeys[$memoryid])) return 0;
return $shmkeys[$memoryid]+$shmoffset;
}
/** \brief Return list of contents of all memory area shared
* \return int 0=Nothing is done, <0 if KO, >0 if OK
*/
......@@ -59,7 +71,7 @@ function dol_getshmop($memoryid)
global $shmkeys,$shmoffset;
if (empty($shmkeys[$memoryid]) || ! function_exists("shmop_open")) return 0;
$shmkey=($shmkeys[$memoryid]+$shmoffset);
$shmkey=dol_getshmopaddress($memoryid);;
//print 'dol_getshmop memoryid='.$memoryid." shmkey=".$shmkey."<br>\n";
$handle=@shmop_open($shmkey,'a',0,0);
if ($handle)
......@@ -87,7 +99,7 @@ function dol_setshmop($memoryid,$data)
//print 'dol_setshmop memoryid='.$memoryid."<br>\n";
if (empty($shmkeys[$memoryid]) || ! function_exists("shmop_write")) return 0;
$shmkey=$shmkeys[$memoryid]+$shmoffset;
$shmkey=dol_getshmopaddress($memoryid);
$newdata=serialize($data);
$size=strlen($newdata);
//print 'dol_setshmop memoryid='.$memoryid." shmkey=".$shmkey." newdata=".$size."bytes<br>\n";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment