Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
2c1d6b24
Commit
2c1d6b24
authored
15 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Add info of shared memory area
parent
7deeb9cb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/lib/memory.lib.php
+19
-2
19 additions, 2 deletions
htdocs/lib/memory.lib.php
with
19 additions
and
2 deletions
htdocs/lib/memory.lib.php
+
19
−
2
View file @
2c1d6b24
...
...
@@ -33,6 +33,23 @@ $shmkeys=array('main'=>1,'admin'=>2,'dict'=>3,'companies'=>4,'suppliers'=>5,'pro
$shmoffset
=
100
;
/** \brief Return list of contents of all memory area shared
* \return int 0=Nothing is done, <0 if KO, >0 if OK
*/
function
dol_listshmop
()
{
global
$shmkeys
,
$shmoffset
;
$resarray
=
array
();
foreach
(
$shmkeys
as
$key
=>
$val
)
{
$result
=
dol_getshmop
(
$key
);
if
(
!
is_numeric
(
$result
)
||
$result
>
0
)
$resarray
[
$key
]
=
$result
;
}
return
$resarray
;
}
/** \brief Read a memory area shared by all users, all sessions on server
* \param $memoryid Memory id of shared area
* \return int 0=Nothing is done, <0 if KO, >0 if OK
...
...
@@ -67,7 +84,7 @@ function dol_getshmop($memoryid)
function
dol_setshmop
(
$memoryid
,
$data
)
{
global
$shmkeys
,
$shmoffset
;
//print 'dol_setshmop memoryid='.$memoryid."<br>\n";
if
(
empty
(
$shmkeys
[
$memoryid
])
||
!
function_exists
(
"shmop_write"
))
return
0
;
$shmkey
=
$shmkeys
[
$memoryid
]
+
$shmoffset
;
...
...
@@ -79,7 +96,7 @@ function dol_setshmop($memoryid,$data)
{
$shm_bytes_written1
=
shmop_write
(
$handle
,
str_pad
(
$size
,
6
),
0
);
$shm_bytes_written2
=
shmop_write
(
$handle
,
$newdata
,
6
);
if
((
$shm_bytes_written1
+
$shm_bytes_written2
)
!=
(
6
+
strlen
(
$newdata
)))
if
((
$shm_bytes_written1
+
$shm_bytes_written2
)
!=
(
6
+
strlen
(
$newdata
)))
{
print
"Couldn't write the entire length of data
\n
"
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment