コード例 #1
0
ファイル: ArtProxyTest.php プロジェクト: Alenpiera/streeme
<?php

include dirname(__FILE__) . '/../bootstrap/doctrine.php';
// Initialize the test object
$t = new lime_test(3, new lime_output_color());
$art_proxy = new ArtProxy('13212ABCD', 'medium', dirname(__FILE__) . '/../files/album_art');
$t->is($art_proxy->getImage(), 'placeholder/medium.jpg', 'placeholder image showed for broken hash');
$art_proxy = new ArtProxy(null, null, dirname(__FILE__) . '/../files/album_art');
$t->is($art_proxy->getImage(), 'placeholder/medium.jpg', 'placeholder image showed for no hash or size');
$art_proxy = new ArtProxy('1BC341AD21124AB11AAC3454', 'large', dirname(__FILE__) . '/../files/album_art');
$t->is($art_proxy->getImage(), '1BC341AD21124AB11AAC3454/large.jpg', 'found artwork by unique id');
コード例 #2
0
ファイル: proxy_art.php プロジェクト: Alenpiera/streeme
<?php

#
# This is the art proxy redirect - it may not be part of the regular controller because of conflicts
# with HTTP_Download setting its own headers. the routing for this resides in the .htaccess file
#
require_once dirname(__FILE__) . '/../apps/client/lib/ProxyBootstrap.class.php';
$art_proxy = new ArtProxy($_REQUEST['hash'], $_REQUEST['size'], dirname(__FILE__) . '/../data/album_art');
//shut down the symfony context so it doesn't lock up symfony while streaming
global $context;
$context->shutdown();
unset($context);
$art_proxy->getImage();
exit;