This is an implementation of a storage engine plugin for the MySQL Server 5.1 which can be controlled using PHP
Extremely experimental storage engine for the MySQL Database Server 5.1
THIS PLUGIN IS NOT THREAD SAFE - PARALLEL REQUEST WILL SEGFAULT!
(I guess I'll have to add some mutexes when calling into PHP)
This code comes directly from the RawIdea area of my brain to code. It's my
first storage engine so some things might be weird :-)
Show case:
<?php
class Test extends ArrayIterator implements MySQLStorage_
public function write($data) {
$this[] = $data;
}
public function update($data) {
}
public function delete() {
}
}
function create_
return true;
}
function open_table($table) {
return new Test(array(
array('id' => 1, 'a' => 'foo'),
array('id' => 2, 'a' => 'bar')));
}
}
?>
mysql> SELECT * FROM php_write;
+------+------+
| id | val |
+------+------+
| 1 | foo |
| 2 | bar |
+------+------+
2 rows in set (0.00 sec)
mysql> CREATE TABLE php_write (id int, val CHAR(3)) ENGINE=PHP;
Query OK, 0 rows affected (0.00 sec)
mysql> UPDATE php_write SET val = 'baz' WHERE id = 1;
Query OK, 1 row affected (0.02 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> DELETE FROM php_write WHERE id = 2;
Query OK, 1 row affected (0.02 sec)
mysql> INSERT INTO php_write VALUES(3, 'bar');
Query OK, 1 row affected (0.00 sec)
mysql> SELECT * FROM php_write;
+------+------+
| id | val |
+------+------+
| 1 | baz |
| 3 | bar |
+------+------+
2 rows in set (0.01 sec)
For more see the README in my branch: http://
This product includes PHP software, freely available from <http://
PHP includes the Zend Engine, freely available at <http://
Project information
- Maintainer:
- Johannes Schlüter
- Driver:
- Not yet selected
- Licence:
- Simplified BSD Licence
View full history Series and milestones
trunk series is the current focus of development.