示例#1
0
 /**
  * Return the content of the file imsmanifest.xml
  * @return content of the imsmanifest.xml file as a string or FALSE
  *  it there is any error.
  */
 function ReadImsmanifest()
 {
     $filename = $this->path . '/imsmanifest.xml';
     if (strpos($filename, 'http') === 0) {
         // Remote manifest
         require_once _lib_ . '/lib.fsock_wrapper.php';
         $fsock = new FSock();
         $contents = $fsock->send_request($filename, '80', '');
         if (!$contents) {
             $this->setError(SPSCORM_E_FILENOTFOND, 'File: ' . $this->path . '/imsmanifest.xml not found');
             return FALSE;
         }
     } else {
         // Local manifest
         $handle = @fopen($filename, 'r');
         if ($handle === FALSE) {
             $this->setError(SPSCORM_E_FILENOTFOND, 'File: ' . $this->path . '/imsmanifest.xml not found');
             return FALSE;
         }
         $contents = fread($handle, filesize($filename));
         fclose($handle);
     }
     return $contents;
 }