diff --git a/code/extensions/FilesystemPublisher.php b/code/extensions/FilesystemPublisher.php index e32b3b7..3e18198 100644 --- a/code/extensions/FilesystemPublisher.php +++ b/code/extensions/FilesystemPublisher.php @@ -304,32 +304,6 @@ class FilesystemPublisher extends StaticPublisher { ); } - - // Add externals - /* - $externals = $this->externalReferencesFor($content); - if($externals) foreach($externals as $external) { - // Skip absolute URLs - if(preg_match('/^[a-zA-Z]+:\/\//', $external)) continue; - // Drop querystring parameters - $external = strtok($external, '?'); - - if(file_exists("../" . $external)) { - // Break into folder and filename - if(preg_match('/^(.*\/)([^\/]+)$/', $external, $matches)) { - $files[$external] = array( - "Copy" => "../$external", - "Folder" => $matches[1], - "Filename" => $matches[2], - ); - - } else { - user_error("Can't parse external: $external", E_USER_WARNING); - } - } else { - $missingFiles[$external] = true; - } - }*/ } //return config to its previous state diff --git a/code/extensions/StaticPublisher.php b/code/extensions/StaticPublisher.php index 9b3aa84..19f5436 100644 --- a/code/extensions/StaticPublisher.php +++ b/code/extensions/StaticPublisher.php @@ -179,39 +179,8 @@ abstract class StaticPublisher extends DataExtension { } /** - * Get all external references to CSS, JS, - */ - public function externalReferencesFor($content) { - $CLI_content = escapeshellarg($content); - $tidy = `echo $CLI_content | tidy -numeric -asxhtml`; - $tidy = preg_replace('/xmlns="[^"]+"/','', $tidy); - $xContent = new SimpleXMLElement($tidy); - - $xlinks = array( - "//link[@rel='stylesheet']/@href" => false, - "//script/@src" => false, - "//img/@src" => false, - "//a/@href" => true, - ); - - $urls = array(); - - foreach($xlinks as $xlink => $assetsOnly) { - $matches = $xContent->xpath($xlink); - if($matches) foreach($matches as $item) { - $url = $item . ''; - if($assetsOnly && substr($url,0,7) != ASSETS_DIR . '/') continue; - - $urls[] = $url; - } - } - - return $urls; - } - - /** + * * @param string $url - * * @return array */ public function getMetadata($url) {