Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Drupal.php #7

Merged
merged 1 commit into from
Mar 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions src/DetectCMS/Systems/Drupal.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
class Drupal extends \DetectCMS\DetectCMS {

public $methods = array(
"readme_d6",
"changelog",
"changelog_d8",
"generator_header",
Expand All @@ -17,11 +18,26 @@ class Drupal extends \DetectCMS\DetectCMS {
public $url = "";

function __construct($home_html, $home_headers, $url) {
$this->home_html = $home_html;
$this->home_headers = $home_headers;
$this->home_html = $home_html;
$this->home_headers = $home_headers;
$this->url = $url;
}

}

public function readme_d6() {
/*
* See if README.TXT exists, and check for Drupal 6.xx
* @return [boolean]
*/
if($data = $this->fetch($this->url."/sites/all/README.txt")) {
$lines = explode(PHP_EOL, $data);
for($i=0;$i<count($lines);$i++) {
if(strpos($lines[$i], "Drupal") !== FALSE) {
return TRUE;
}
}
return FALSE;
}
}
/**
* See if CHANGELOG.TXT exists, and check for Drupal
* @return [boolean]
Expand Down