1
0
mirror of synced 2024-12-15 15:46:02 +03:00
doctrine2/playground/index.php

28 lines
865 B
PHP
Raw Normal View History

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');
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') {
2007-09-24 08:58:57 +04:00
$config = array('name' => 'Doctrine_Resource_Test_Server',
'models' => $tables);
2007-09-22 05:32:48 +04:00
2007-09-24 08:58:57 +04:00
$server = Doctrine_Resource_Server::getInstance($config);
2007-09-22 05:32:48 +04:00
$server->run($_REQUEST);
2007-09-24 08:58:57 +04:00
2007-09-22 05:32:48 +04:00
} else {
2007-09-24 23:29:56 +04:00
//$config = array('url' => 'http://localhost/~jwage/doctrine_trunk/playground/index.php?action=server');
$config = array('url' => 'http://dev.centresource.com/jwage/hca/web/frontend_dev.php/main');
2007-09-22 05:32:48 +04:00
2007-09-24 08:58:57 +04:00
$client = Doctrine_Resource_Client::getInstance($config);
2007-09-24 23:29:56 +04:00
$user = $client->newRecord('sfGuardUser');
2007-09-22 05:32:48 +04:00
2007-09-24 23:29:56 +04:00
$user->name = 'jonnnywage';
$user->save();
2007-09-24 22:22:52 +04:00
2007-09-24 23:29:56 +04:00
print_r($user->toArray());
2007-09-22 05:32:48 +04:00
}