Beispiel #1
0
 public function read($url = '')
 {
     $file = new File();
     $data = $file->read($url);
     $data = $this->object($data);
     return $data;
 }
Beispiel #2
0
 public function read($dir = '')
 {
     if (stristr($dir, $this->json('Priya\\Dir.web_application')) !== false) {
         $name = basename($dir);
         $url = str_replace($this->json('Priya\\Dir.web_application'), $this->json('Priya\\Url.web_application'), $dir);
         $tmp = explode($name, $url);
         foreach ($tmp as $nr => $part) {
             if (empty($part)) {
                 unset($tmp[$nr]);
                 break;
             }
         }
         $url = implode($name, $tmp);
     }
     $file = new File();
     $data = $file->read($dir);
     if (empty($data)) {
         return false;
     }
     $data = explode("\r\n", $data);
     $list = array();
     foreach ($data as $row => $location) {
         if (substr($location, 0, 1) == '#') {
             continue;
         }
         if (empty($location)) {
             continue;
         }
         if (stristr($location, $url) === false) {
             $location = $url . $location;
         }
         $list[] = $location;
     }
     $this->json('player.list', $list);
 }
Beispiel #3
0
 public function json_load($load)
 {
     $url = $this->locate($load);
     if (!empty($url)) {
         $file = new File();
         $data = $file->read($url);
         $data = $this->object($data);
         if ($this->environment() == 'development' && empty($data)) {
             trigger_error('File (' . $url . '): empty or corrupted. (No valid Json)');
         }
         return $data;
     }
     return false;
 }