Open helmo opened 4 years ago
@helmo can you explain what the potential usecase of such a detection would be?
I'm using this in my vhost list page.
A site that is 'static only' is not affected by a change in php version. That extra info can help when upgrading a server of planning which sites to migrate. But a site that is mostly static ( so no CMS detected) but does have a single contact.php file does require extra testing.
I see your point, however I'm unsure if that should be really part of this tool or if it's "out of scope" as it's pretty much the opposite of the initial goal of this tool.
@zero-24 what do you think?
Hmm i have to agree with @SniperSister here. That non detected sites does not have to be a static html site and I‘m not sure whether we should try to detect such maybe custom build sites.
For a site to be detected as static html it would require an index.html or index.htm
That branch also contains a draft PlaceholderPageAdapter.php that currently detects my own placeholder page and the default one from ISPconfig
But fair enough, it's good to stay in scope :)
Would it be easy to detect a static only site?
The current adapters all look for a pattern to be present in either file name or content, but for this we'd have to check the absence of other things.
E.g. a single html file in a subfolder of a wordpress site should not be detected here. The presences of index.html is a good indication, but to be useful I'd want be sure no other php files are present (e.g. a contact.php file for some form processing). And the html files should not contain inline
<?php ?>
shippits.Or we'd have to also create a GenericPhpAdapter that acts as a fallthrough for when we have *.php files but no cms is detected.
I've been drafting a bit of this in a feature/statichtml branch