Login   Register  
PHP Classes
elePHPant
Icontem

File: v1/tests/test.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of jstar88  >  Safe IO  >  v1/tests/test.php  >  Download  
File: v1/tests/test.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Safe IO
Access files using locks to prevent corruption
Author: By
Last change:
Date: 0 years ago
Size: 270 bytes
 

Contents

Class file image Download
<?php
    
include("../SafeIO.php");
    
SafeIO::startTransaction("data.txt");
    
//
    //  ... Other users can't write data.txt while you are inside here
    //
    
SafeIO::stopTransaction("data.txt");
    echo 
SafeIO::open("data.txt");
    
// now the lock is released
?>