PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of lusfikar sheba   Strategy based serializable object registry   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: entry point
Class: Strategy based serializable object registry
Store object values in a registry using a strategy
Author: By
Last change: new comment added
Date: 14 years ago
Size: 842 bytes
 

Contents

Class file image Download
<?php
require_once("cimporter.php");
define(ALLOW_EXEC,1);
CImporter::getInstance()->import("library","cserializableobjectregistry.php");
CImporter::getInstance()->import("driver","csomething1filedriver.php");

$reg = new CSerializableObjectRegistry(new CSomething1FileDriver(),
CConfiguration::root_path."/"."data_samples/something1.txt"); //use absolute path always
echo $reg->get("db_host")."</br>"; //first, look at something1.txt content
$reg->set("db_host","hostname_after_run");
echo
$reg->get("db_host")."</br>"; //now, something1.txt has been modified

//add comment ('//') to this command to make sure that something1.txt has been modified
$reg->set("db_host","hostname_before_run");
//like this:
//$reg->set("db_host","hostname_before_run");
//then check out the something1.txt directly (using text editor)
?>