Page MenuHomePhabricator

Break out CheckIfDead class into a separate GitHub repo
Closed, ResolvedPublic5 Estimated Story Points

Description

The CheckIfDead class could be useful to lots of open source developers, but in order for that to happen, it needs to be broken out into a separate repo and then included in the IABot repo via Composer or a similar mechanism.

In the process, we should probably break the checkDeadlinks() function into smaller testable pieces and add a convenience function for testing individual URLs (that is called something like 'isDeadLink' rather than 'checkDeadLink', which is ambiguous).

Finally, a README needs to be written with some basic documentation.

Existing code is here: https://github.com/cyberpower678/Cyberbot_II/blob/master/IABot/checkIfDead.php

Also, make this a composer package. This task does not include refactoring Cyberbot code to use the new library.

Event Timeline

DannyH triaged this task as Medium priority.Jul 14 2016, 5:44 PM
DannyH set the point value for this task to 5.
DannyH moved this task from Needs Discussion to Up Next on the Community-Tech board.

We're also going to do the Packagist packaging as part of this ticket.

I've updated the code to remove all the error array instances. The return format now is:

[ 'url1' => true, 'url2' => false ]

I've updated the tests accordingly.

Looking into the Packagist bit now.

You only removed the bits that return the error correct? The curl error codes are still part of the checks though, right?

You only removed the bits that return the error correct? The curl error codes are still part of the checks though, right?

Correct.

Looks good, but I'm still concerned about requiring PHP 5.6. Tool Labs only runs 5.5 and current versions of HHVM are mostly based on PHP 5.5 (from my understanding). I haven't tried building this in Vagrant yet, but I'm not sure if it would or not. Is there anything keeping us from using PHP 5.5 besides requiring a less up-to-date version of phpunit?

Do we need this class on tool labs?

We (as in IABot) don't, but other people might. For example, this would be a nice class for citation bot to use or even CopyPatrol.

As far as I can tell this class is fully operational on PHP 5.5 and only requires 5.6 for PHPUnit, which can easily be remedied by dowloading PHPUnit-old.

Okay, I will amend it to support 5.5.