Fixed some API stuff to return the right values for pypo.
Created a test script to schedule a test file one minute after running it. Moved the database connection initialization to conf.php instead of in ui_conf.php. Changed some includes to rely on the pear path instead of specifying it directly in the include. This will make it easier to use the system defaults (for Ubuntu/Debian for example).
This commit is contained in:
parent
ef8b8dc54d
commit
8e7e0226e6
11 changed files with 289 additions and 68 deletions
22
backend/tests/pdoTest.php
Normal file
22
backend/tests/pdoTest.php
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
require_once(__DIR__.'/../../3rd_party/php/propel/runtime/lib/Propel.php');
|
||||
// Initialize Propel with the runtime configuration
|
||||
Propel::init(__DIR__."/../propel-db/build/conf/campcaster-conf.php");
|
||||
// Add the generated 'classes' directory to the include path
|
||||
set_include_path(__DIR__."/../propel-db/build/classes" . PATH_SEPARATOR . get_include_path());
|
||||
$con = Propel::getConnection("campcaster");
|
||||
|
||||
$sql = "SELECT COUNT(*) FROM cc_schedule WHERE (starts >= '2010-01-01 00:00:00.000') "
|
||||
." AND (ends <= (TIMESTAMP '2011-01-01 00:00:00.000' + INTERVAL '01:00:00.123456'))";
|
||||
$rows1 = $con->query($sql);
|
||||
var_dump($rows1->fetchAll());
|
||||
|
||||
$sql2 = "SELECT COUNT(*) FROM cc_playlistcontents";
|
||||
$rows2 = $con->query($sql2);
|
||||
var_dump($rows2->fetchAll());
|
||||
|
||||
$sql3 = "SELECT TIMESTAMP '2011-01-01 00:00:00.000' + INTERVAL '01:00:00.123456'";
|
||||
$result3 = $con->query($sql3);
|
||||
var_dump($result3->fetchAll());
|
||||
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue