<?php /*** include the controller class ***/ include __SITE_PATH . '/application/' . 'controller_base.class.php'; /*** include the registry class ***/ include __SITE_PATH . '/application/' . 'registry.class.php'; /*** include the router class ***/ include __SITE_PATH . '/application/' . 'router.class.php'; /*** include the template class ***/ include __SITE_PATH . '/application/' . 'template.class.php'; include __SITE_PATH . '/client_support.php'; /*** auto load model classes ***/ function __autoload($class_name) { $filename = strtolower($class_name) . '.class.php'; $file = __SITE_PATH . '/model/' . $filename; if (file_exists($file) == false) { return false; } include $file; } /*** a new registry object ***/ $registry = new registry(); // Add Ted service here (model)? session_start(); $registry->client = ClientSupport::client(session_id());
<?php require_once 'client_support.php'; try { $image_src = ClientSupport::client()->getImageByGuideId($_REQUEST['guideId'], ImageType::BANNER_THUMBNAIL); $im = imagecreatefromstring($image_src->data); header("Content-type: image/jpeg"); imagejpeg($im); imagedestroy($im); } catch (TException $tx) { // a general thrift exception, like no such server echo "ThriftException: " . $tx->getMessage() . "\r\n"; }