Skip to content

Commit

Permalink
WordPress core does not contain a wp-config.php file; do not require …
Browse files Browse the repository at this point in the history
…that file to be present when detecting WordPress installs. (#1)
  • Loading branch information
greg-1-anderson authored Dec 12, 2018
1 parent e3cc68f commit 9581460
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/Inspectors/WordPressInspector.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ public function valid(ComposerInfo $composer_info)
*/
protected function isWordPressRoot(ComposerInfo $composer_info, $document_root)
{
if (file_exists("$document_root/wp-config.php")) {
foreach (['/', '/wp/'] as $dir) {
$version_file = $dir . 'wp-includes/version.php';
if (file_exists("$document_root/$version_file")) {
return new VersionInfo('WordPress', $composer_info, $document_root, $version_file, "#wp_version = '([0-9.]*)';#m");
}
foreach (['/', '/wp/'] as $dir) {
$version_file = $dir . 'wp-includes/version.php';
if (file_exists("$document_root/$version_file")) {
return new VersionInfo('WordPress', $composer_info, $document_root, $version_file, "#wp_version = '([0-9.]*)';#m");
}
}
return false;
Expand Down

0 comments on commit 9581460

Please sign in to comment.