* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
+ * @file
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
+/**
+ * Maintenance script that sends purge requests for listed pages to squid.
+ *
+ * @ingroup Maintenance
+ */
class PurgeList extends Maintenance {
public function __construct() {
parent::__construct();
while ( !feof( $stdin ) ) {
$page = trim( fgets( $stdin ) );
- if ( substr( $page, 0, 7 ) == 'http://' ) {
+ if ( preg_match( '%^https?://%', $page ) ) {
$urls[] = $page;
} elseif ( $page !== '' ) {
$title = Title::newFromText( $page );