Login   Register  
PHP Classes
elePHPant
Icontem

File: tshmop_atomic.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Craig Manley  >  IPC Shared Memory  >  tshmop_atomic.php  >  Download  
File: tshmop_atomic.php
Role: Example script
Content type: text/plain
Description: Example/test script for IPC_SharedMem_ShmOp class.
Class: IPC Shared Memory
Access data stored in shared memory containers
Author: By
Last change:
Date: 2005-01-09 11:20
Size: 679 bytes
 

Contents

Class file image Download
<?php
error_reporting
(E_ALL E_STRICT);

// Set the private include path
$path_delimiter PHP_OS == 'WINNT' ';' ':';
ini_set('include_path','../../..' $path_delimiter ini_get('include_path'));


require_once(
'IPC/SharedMem/ShmOp.php');

$value '';
$shm = new IPC_SharedMem_ShmOp('TEST', array('size' => 40'remove' => false));


$value $shm->fetch();
print 
"Fetched: \"$value\"\n";

$value 'Once upon a time';
$shm->store($value);
print 
"Stored: \"$value\"\n";

$value $shm->fetch();
print 
"Fetched: \"$value\"\n";

$value .= " there was a wolf.";
$shm->store($value);
print 
"Stored: \"$value\"\n";

$value $shm->fetch();
print 
"Fetched: \"$value\"\n";



?>