WikiFile::downloadData PHP Method

downloadData() public method

Downloads and returns the current file's contents, or null if an error occurs.
public downloadData ( ) : mixed
return mixed Contents (string), or null if error
    public function downloadData()
    {
        // Download file, or handle error
        $data = $this->wikimate->download($this->getUrl());
        if ($data === null) {
            $this->error = $this->wikimate->getError();
            // Copy error if there was one
        } else {
            $this->error = null;
            // Reset the error status
        }
        return $data;
    }