4 class Controller_Api_Apps extends Controller_Api_ImageBase
6 public function handle($data)
8 $path = str_replace('-.-', '/', $data);
9 $fullPath = $GLOBALS['imagestore']['basedir'] . $path;
10 if (!is_dir($fullPath)) {
11 return $this->error('404 Not Found', 'Path not found');
14 $dirInfo = new \SplFileInfo($fullPath);
18 'apkFileSize' => 123456789,
19 'contentRating' => 'Everyone',
20 'description' => 'Images from folder ' . $fullPath,
21 'developer' => 'Christian Weiske',
22 'filepickerScreenshots' => $this->getScreenshots($dirInfo),
24 'latestVersion' => '11111111-0000-1111-0000-111111111111',
26 'mainImageFullUrl' => $this->getImageUrl($this->getFirstImage($dirInfo)),
27 'overview' => 'Images from a folder',
28 'publishedAt' => date('c', $dirInfo->getMTime()),
29 'screenshots' => array(),
30 'supportEmailAddress' => 'cweiske+ouya@cweiske.de',
31 'supportPhone' => null,
32 'title' => $dirInfo->getBasename(),
34 'versionNumber' => '0.0.1',
35 'website' => 'http://git.cweiske.de/ouya-imagestore.git/'
39 header('Content-Type: application/json');
40 echo json_encode($data, JSON_PRETTY_PRINT);
43 protected function getScreenshots(\SplFileInfo $dirInfo)
45 $lit = new \LimitIterator($this->getImageIterator($dirInfo), 0, 20);
47 foreach ($lit as $file) {
48 $urls[] = $this->getImageUrl($file);