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