Test db/* files with PHPCS too!

parent 752dced8
Pipeline #804 passed with stage
in 3 minutes and 34 seconds
......@@ -35,7 +35,7 @@
},
"scripts": {
"check-code": [
"vendor/bin/phpcs --standard=PSR2 -snp --encoding=utf-8 --report-width=150 lib *.php"
"vendor/bin/phpcs --standard=PSR2 -snp --encoding=utf-8 --report-width=150 db lib *.php"
]
}
}
......@@ -124,7 +124,6 @@ if (!$stop) {
}
echo 'Data successfully inserted! Your pod will be checked and live on the list in a few hours!';
} else {
echo 'Could not validate your pod, check your setup!<br>Take a look at <a href="' . $link . '">your /nodeinfo</a>';
}
......
......@@ -4,6 +4,4 @@ declare(strict_types=1);
require_once __DIR__ . '/../boot.php';
use Carbon\Carbon;
updateMeta('pods_updating', false);
updateMeta('pods_updating', false);
......@@ -37,7 +37,7 @@ if ($pods = json_decode(file_get_contents('https://the-federation.info/graphql?q
//limiting to diaspora compatible for now
if (in_array('diaspora', $protocols, true)) {
$foundpods[] = strtolower(preg_replace("(^https?://)", "", $poddata['host'] ));
$foundpods[] = strtolower(preg_replace('(^https?://)', '', $poddata['host']));
}
}
}
......
......@@ -30,7 +30,7 @@ if (!is_connected()) {
die('no internet');
}
updateMeta('pods_updating', true);
updateMeta('pods_updating', true);
$time_start = microtime(true);
......@@ -227,7 +227,6 @@ foreach ($pods as $pod) {
//tmp//if pod is on the development branch - see when you last updated your pod and when the last commit was made to dev branch - if the repo is active and your not updating every 120 days why are you on dev branch?
if ($updategap + $devlastdays > 200) {
debug('Outdated More than 200 days', 'Yes');
$podminhelp = 'Your code base seems too out of date to be used. Last time you updated was ' . $updategap;
......@@ -241,15 +240,12 @@ foreach ($pods as $pod) {
$score -= 2;
$updategap = date_diff(new DateTime($lastdatechecked), new DateTime($releasedate))->format('%a');
$podminhelp = 'Your code base seems too out of date to be used. Current version is ' . $masterversion . ' and you are running ' . $shortversion;
} elseif ($updategap - date_diff(new DateTime($releasedate), new DateTime())->format('%a') > 200) {
debug('Outdated more than 200 days since x ', 'Yes');
$score -= 2;
$updategap = date_diff(new DateTime($lastdatechecked), new DateTime($releasedate))->format('%a');
$podminhelp = 'Your code base seems too out of date to be used. Last time you updated was ' . $updategap;
} else {
$updategap = date_diff(new DateTime($lastdatechecked), new DateTime($releasedate))->format('%a');
}
......@@ -452,11 +448,11 @@ if ($languagesupdated) {
//check daily updates
if (Carbon::createFromFormat('Y-m-d H:i:s.u', getMeta('masterversions_updated', 'date_created'))->diffInHours() > 12) {
require_once('update-masterversions.php');
require __DIR__ . '/update-masterversions.php';
}
if (Carbon::createFromFormat('Y-m-d H:i:s.u', getMeta('statstable_updated', 'date_created'))->diffInHours() > 23) {
require_once('update-monthly-stats.php');
require __DIR__ . '/update-monthly-stats.php';
}
if (Carbon::createFromFormat('Y-m-d H:i:s.u', getMeta('cacert_updated', 'date_created'))->diffInHours() > 40) {
......@@ -465,21 +461,21 @@ if (Carbon::createFromFormat('Y-m-d H:i:s.u', getMeta('cacert_updated', 'date_cr
$getcacert->throwExceptionOnError(false);
$getcacert->execute();
updateMeta('cacert_updated');
}
if (Carbon::createFromFormat('Y-m-d H:i:s.u', getMeta('geoip_updated', 'date_created'))->diffInHours() > 45) {
$geo2ip = c('geoip2db');
$geo2ip = c('geoip2db');
$getgeo2ip = new NPM\Xec\Command("funzip <(curl -Lss http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz) > {$geo2ip}");
$getgeo2ip->throwExceptionOnError(false);
$getgeo2ip->execute();
updateMeta('cacert_updated');
updateMeta('geoip_updated');
updateMeta('geoip_updated');
}
if (Carbon::createFromFormat('Y-m-d H:i:s.u', getMeta('federation_updated', 'date_created'))->diffInHours() > 9) {
require_once('update-remote-data.php');
require __DIR__ . '/update-remote-data.php';
}
require_once('backup.php');
updateMeta('pods_updating', false);
require __DIR__ . '/backup.php';
updateMeta('pods_updating', false);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment