CMS-Garden / cmsscanner

Detects FOSS CMS in the local filesystem
Other
40 stars 14 forks source link

Add SpipAdapter #76

Open camlafit opened 2 years ago

camlafit commented 2 years ago

Hi

Could be nice to add SPIP cms

Thanks

camlafit commented 2 years ago

Hello

I've a PR in progress at https://github.com/camlafit/cmsscanner/tree/issue-76_SPIPAdapter But I've some questions before :

Thanks a lot

SniperSister commented 2 years ago

I'm not sure looks as a good idea to run twice detectVersion()

Probably not the optimal way, but as you need the CMS version here, I can hardly see a way around it

about appendDetectionCriteria() we can have an other filespip_loader.php but If I add it, CMS could be detect twice.

If I understand you correctly, both files are present in SPIP instance, correct? If so, why adding a second file at all?

on detectSystem() we do a test to check files yet defined in appendDetectionCriteria() I don't understand why we duplicate this check ?

See: https://github.com/camlafit/cmsscanner/blob/issue-76_SPIPAdapter/src/Command/DetectCommand.php#L121

All findings, regardless of their source adapter, are passed to all adapters for verification

camlafit commented 2 years ago

Hello

I'm not sure looks as a good idea to run twice detectVersion()

Probably not the optimal way, but as you need the CMS version here, I can hardly see a way around it

Maybe detectVersion() could be set a local $version variable. Should be specific to this adapter but at least method will be run only once.

about appendDetectionCriteria() we can have an other filespip_loader.php but If I add it, CMS could be detect twice.

If I understand you correctly, both files are present in SPIP instance, correct? If so, why adding a second file at all?

Some user can personalize their spip.php to another name. Purpose is to catch this use case and use a workaround on an optional file specific to this CMS.

on detectSystem() we do a test to check files yet defined in appendDetectionCriteria() I don't understand why we duplicate this check ?

See: https://github.com/camlafit/cmsscanner/blob/issue-76_SPIPAdapter/src/Command/DetectCommand.php#L121 All findings, regardless of their source adapter, are passed to all adapters for verification

Ok I see, then actually this behavior is normal :)

SniperSister commented 2 years ago

Maybe detectVersion() could be set a local $version variable. Should be specific to this adapter but at least method will be run only once.

If you go down that road, you'll class property storing a path => version map, as only one class instance is created and multiple CMS instances with multiple versions might by present on the filesystem