haha
public text v1 · immutable<?php
class createDatabase {
function __construct($name){
$this->name = $name;
if(!file_exists($name . '.xml')){
touch($name . '.xml');
$dbContent = '<?xml version="1.0"?><x/>';
file_put_contents($name . '.xml', $dbContent);
}
}
public function write($what, $content){
// name from __construct should be available here
echo 'You wrote row '.$what.' with '.$content.' to database '.$this->name.'';
}
}
$taste = new createDatabase('test');
$taste->write('name','Jonathan');
?>