Пример #1
0
 public static function client()
 {
     if (!self::$instance) {
         self::$instance = new ClientSupport();
     }
     return self::$instance->client;
 }
Пример #2
0
Файл: init.php Проект: ted/ted
<?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());
Пример #3
0
<?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";
}