2007-09-13 20:55:32 +04:00
|
|
|
<?php
|
2007-09-19 20:26:28 +04:00
|
|
|
require_once('playground.php');
|
|
|
|
require_once('connection.php');
|
2007-09-20 19:02:07 +04:00
|
|
|
require_once('models.php');
|
2007-09-22 05:32:48 +04:00
|
|
|
require_once('data.php');
|
|
|
|
|
|
|
|
$action = isset($_REQUEST['action']) ? $_REQUEST['action']:'client';
|
|
|
|
|
|
|
|
if ($action == 'server') {
|
|
|
|
$config = array();
|
|
|
|
|
|
|
|
$server = new Doctrine_Resource_Server($config);
|
|
|
|
$server->run($_REQUEST);
|
|
|
|
} else {
|
|
|
|
$config = array('url' => 'http://localhost/~jwage/doctrine_trunk/playground/index.php?action=server');
|
|
|
|
|
|
|
|
$client = new Doctrine_Resource_Client($config);
|
|
|
|
$record = $client->newRecord('User');
|
|
|
|
$record->name = 'jon wage';
|
|
|
|
$record->loginname = 'test';
|
|
|
|
$record->save();
|
|
|
|
|
|
|
|
print_r($record->toArray());
|
|
|
|
}
|