PHP Classes

File: v1/tests/test.php

Recommend this page to a friend!
  Classes of Nicola Covolo   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: Update of v1/tests/test.php
Date: 8 months 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
?>