TNTDebug::Warning('$path->Get(\'array\')=', $path->Get('array')); TNTDebug::Warning('$path->Get(\'string\') === $path_string =', $path->Get('string') === $path_string); echo '<h1>Time Format Tests</h1>'; TNTLoader::RequireClass('tnttime'); $tm =& new TNTTime(); $tm_string = '15/06/2004 AD 11:53:04 GMT'; $tm_array = array('day' => 15, 'month' => 6, 'year' => 2004, 'period' => 'AD', 'hour' => 11, 'minute' => 53, 'second' => 4, 'tz' => 'GMT'); TNTDebug::Warning('$tm->Set($tm_string)=', $tm->Set($tm_string)); TNTDebug::Warning('$tm->Get()=', $tm->Get()); TNTDebug::Warning('$tm->Get(\'string\')=', $tm->Get('string')); TNTDebug::Warning('$tm->Get(\'array\')=', $tm->Get('array')); TNTDebug::Warning('array_diff($tm->Get(\'array\'),$tm_array)=', array_diff($tm->Get('array'), $tm_array)); TNTDebug::Warning('$tm->Set($tm_array)=', $tm->Set($tm_array)); TNTDebug::Warning('$tm->Get()=', $tm->Get()); TNTDebug::Warning('$tm->Get(\'string\')=', $tm->Get('string')); TNTDebug::Warning('$tm->Get(\'array\')=', $tm->Get('array')); TNTDebug::Warning('$tm->Get(\'string\') === $tm_string =', $tm->Get('string') === $tm_string); echo '<h1>Ini Tests</h1>'; TNTLoader::RequireClass('tntini'); $ini =& new TNTIni(); TNTDebug::Warning('$ini->LoadFile(\'test-ini.ini\')=', $ini->LoadFile('test-ini.ini')); TNTDebug::Warning('$tm->Items()=', $ini->Items()); TNTDebug::Warning('$ini->SaveFile(\'test-ini-tmp.ini\')=', $ini->SaveFile('test-ini-tmp.ini')); ?> </body> </html> <!-- /* vim: set expandtab tabstop=4 shiftwidth=4: */ -->
require_once dirname(__FILE__) . '/includes/libs/tnt/tnt.inc'; /* * Globals */ /* * Defines */ define('__SITE__', 'tnt'); /* Report all errors and warnings */ error_reporting(E_ALL); /* * Disable session.use_trans_sid to mitigate performance-penalty * (do it before any output is started) */ if (!defined('SID')) { @ini_set('session.use_trans_sid', 0); } TNT::Initialise(__SITE__, 1); TNTLoader::RequireClass('TNTCtrlHttpFront'); $front =& TNTCtrlHttpFront::Singleton(); if (!$front->Main()) { echo '<pre>Error: ' . htmlentities($front->Error()) . '</pre>'; } $ini =& TNT::Registry(); echo '<hr />'; tnt_dump('TNT_ROOT_DIR: ', TNT_ROOT_DIR); tnt_dump('TNT_ROOT_URI: ', TNT_ROOT_URI); tnt_dump('Config: ', var_info($ini->Items())); echo '<hr />'; TNT::Shutdown(); /* vim: set expandtab tabstop=4 shiftwidth=4: */
* Test cases for tnt/xml library */ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>XML Tests</title> </head> <body> <?php global $tnt; include '../../../../../includes/tntsynergy.inc'; TNTDebug::SetFlags(TNT_DEBUG_FLAGS_TOSCREEN); TNTLoader::RequireClass('TNTXmlParser'); $file = './test.xml'; $opts = TNT_TAGPARSER_OPTS_CASELOWER | TNT_TAGPARSER_OPTS_SKIPALL | TNT_TAGPARSER_OPTS_TRIM; echo '<h1>Basic XML Parser Tests</h1>'; $xmlParser =& new TNTXmlParser(); if (!$xmlParser->ParseFile($file, $opts)) { TNTError::Error('Failed to parse the xml file: ' . $xmlParser->Error()); } else { TNTDebug::Warning('Parsed data=', $xmlParser->Root()); TNTDebug::Warning('Reduced data=', $xmlParser->Reduce()); TNTDebug::Warning('Condensed data=', $xmlParser->Condense()); TNTDebug::Warning('Group data=', $xmlParser->Group()); TNTDebug::Warning('Merge data=', $xmlParser->Merge()); } ?>
case 'gif': header('content-type: image/gif'); break; case 'gif': header('content-type: image/jpeg'); break; case 'png': header('content-type: image/png'); break; } passthru($path); TNT::Shutdown(); break; } TNT::Timestamp('Constructing Page'); TNTLoader::RequireClass('TNTWuiWidget'); $page =& new TNTWuiWidget(); TNT::Timestamp('Initialising Page'); if (!$page->SetTemplate($path)) { TNT::Abort('Failed to set the page template', $page->_GetError()); } TNT::Timestamp('Rendering page'); $output = $page->Render(); if (is_null($output)) { TNT::Abort('Failed to render page', $page->_GetError()); } $response->Output($output); $response->Close(); TNT::Timestamp('Test Finished'); TNT::Shutdown(); /* vim: set expandtab tabstop=4 shiftwidth=4: */