static function remoteDocument() { if (!self::$document) { self::$documentTmpFile = appPATH . 'cache/tmp/pri/module_index.xml'; touch(self::$documentTmpFile); self::ftp()->get(self::$documentTmpFile, '/module/index.xml', FTP_BINARY); self::$document = new domDocument(); self::$document->load(self::$documentTmpFile); $root = self::$document->documentElement; if (!$root) { $root = self::$document->createElement('modules'); self::$document->appendChild($root); } } return self::$document; }