コード例 #1
0
 public function getPodcasts()
 {
     $path = $this->Config->get('path_data_podcast');
     $files = array();
     if ($handle = opendir($path)) {
         while (false !== ($entry = readdir($handle))) {
             if ($entry != "." && $entry != ".." && substr($entry, -4) == 'json') {
                 $files[] = $entry;
             }
         }
         closedir($handle);
     }
     foreach ($files as $fileName) {
         $filePath = $path . $fileName;
         $file = file($filePath);
         if (trim($file[0]) != '') {
             $data = json_decode(implode($file), true);
             $data['file_name'] = str_replace('.json', '', $fileName);
             $this->Feed[$data['file_name']] = $data;
         }
     }
     $this->Feed = ksortBy($this->Feed, 'timestamp');
     $this->Feed = kfillBy($this->Feed, 'file_name');
     $this->Feed = array_reverse($this->Feed);
 }
コード例 #2
0
 public function getShowBy($val, $key){
     $data = kfillBy($this->Show, $key);
     return $data[$val];
 }
コード例 #3
0
 public function silentAction()
 {
     global $_p;
     return array('schedule' => $this->Radio->Schedule, 'stations' => $this->Radio->Station, 'shows' => kfillBy($this->Radio->Show, 'slug'));
 }