1
0
mirror of synced 2024-12-13 22:56:04 +03:00
doctrine2/playground/index.php
2007-09-22 01:32:48 +00:00

24 lines
673 B
PHP

<?php
require_once('playground.php');
require_once('connection.php');
require_once('models.php');
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());
}