Browscap automatically updated plus fixes
This commit is contained in:
parent
94590ac50a
commit
0882952dcf
|
@ -1,4 +1,4 @@
|
|||
hedera-web (1.406.45) stable; urgency=low
|
||||
hedera-web (1.406.46) stable; urgency=low
|
||||
|
||||
* Initial Release.
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ Vcs-Git: https://git.verdnatura.es/hedera-web
|
|||
Package: hedera-web
|
||||
Architecture: all
|
||||
Depends: apache2 | httpd, nodejs, php-cli, php-vn-lib, php-apcu, php-ldap, php-ssh2, php-mcrypt, php-imap
|
||||
Suggests: php-text-captcha, php-soap
|
||||
Suggests: php-text-captcha, php-soap, libphp-phpmailer, php-gd
|
||||
Section: misc
|
||||
Priority: optional
|
||||
Description: Verdnatura's web page
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
MAILTO=webmaster
|
||||
*/4 * * * * root hedera-web.php -m tpv/confirm-mail
|
||||
*/2 * * * * root hedera-web.php -m edi/load
|
||||
0 23 * * * root hedera-web.php -m edi/clean
|
||||
0 5 * * * root hedera-web.php -m edi/update
|
||||
*/1 * * * * root hedera-web.php -m misc/mail
|
||||
0 5 * * * root hedera-web.php -m misc/exchange-rate
|
||||
*/1 * * * * root hedera-web.php -m misc/mail
|
||||
*/4 * * * * root hedera-web.php -m tpv/confirm-mail
|
||||
*/2 * * * * root hedera-web.php -m edi/load
|
||||
0 23 * * * root hedera-web.php -m edi/clean
|
||||
0 5 * * * root hedera-web.php -m edi/update
|
||||
0 5 * * * root hedera-web.php -m misc/exchange-rate
|
||||
0 */1 * * * root /usr/share/hedera-web/utils/update-browscap.sh > /dev/null
|
||||
|
|
|
@ -9,6 +9,7 @@ js usr/share/hedera-web
|
|||
pages usr/share/hedera-web
|
||||
reports usr/share/hedera-web
|
||||
rest usr/share/hedera-web
|
||||
utils usr/share/hedera-web
|
||||
index.php usr/share/hedera-web
|
||||
package.json usr/share/hedera-web
|
||||
build usr/share/hedera-web
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "hedera-web",
|
||||
"version": "1.406.45",
|
||||
"version": "1.406.46",
|
||||
"description": "Verdnatura web page",
|
||||
"license": "GPL-3.0",
|
||||
"repository": {
|
||||
|
|
|
@ -2,11 +2,24 @@
|
|||
|
||||
class VisitsSync extends Vn\Lib\Method {
|
||||
function run($db) {
|
||||
$result = $db->query("SELECT id, agent FROM visit_agent
|
||||
WHERE version = '0.0' OR platform = 'unknown' OR cookies IS NULL ORDER BY id DESC");
|
||||
$result = $db->query(
|
||||
"SELECT id, agent
|
||||
FROM visitAgent
|
||||
WHERE version = '0.0'
|
||||
OR platform = 'unknown'
|
||||
OR cookies IS NULL
|
||||
ORDER BY id DESC LIMIT 1"
|
||||
);
|
||||
|
||||
$stmt = $db->prepare('UPDATE visit_agent
|
||||
SET platform = ?, browser = ?, version = ?, javascript = ?, cookies = ? WHERE id = ?');
|
||||
$stmt = $db->prepare(
|
||||
"UPDATE visitAgent
|
||||
SET platform = ?,
|
||||
browser = ?,
|
||||
version = ?,
|
||||
javascript = ?,
|
||||
cookies = ?
|
||||
WHERE id = ?"
|
||||
);
|
||||
|
||||
if ($result && $stmt) {
|
||||
set_time_limit(0);
|
||||
|
@ -26,18 +39,20 @@ class VisitsSync extends Vn\Lib\Method {
|
|||
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$info = get_browser($row['agent']);
|
||||
if (!$info) continue;
|
||||
|
||||
$platform = $info->platform;
|
||||
$browser = $info->browser;
|
||||
$version = $info->version;
|
||||
$javascript = $info->javascript;
|
||||
$cookies = $info->cookies;
|
||||
$javascript = !property_exists($info, 'javascript') || $info->javascript;
|
||||
$cookies = !property_exists($info, 'cookies') || $info->cookies;
|
||||
$id = $row['id'];
|
||||
$stmt->execute();
|
||||
|
||||
$count++;
|
||||
}
|
||||
|
||||
echo "$count records updated\n";
|
||||
echo "$count records updated.\n";
|
||||
}
|
||||
|
||||
if ($stmt)
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
|
||||
phpCfgDir=/etc/php
|
||||
browscapFile="$phpCfgDir/lite_php_browscap.ini"
|
||||
versionFile="$phpCfgDir/browscap.version"
|
||||
currentVersion=0
|
||||
|
||||
if [ -f "$versionFile" ]; then
|
||||
currentVersion=$(cat "$phpCfgDir/browscap.version")
|
||||
fi
|
||||
|
||||
lastVersion=$(wget --quiet -O - http://browscap.org/version-number)
|
||||
|
||||
if [ "$lastVersion" -gt "$currentVersion" ] || [ ! -f "$browscapFile" ]; then
|
||||
echo -n "$lastVersion" > "$versionFile"
|
||||
wget --quiet -O "$browscapFile" https://browscap.org/stream?q=Lite_PHP_BrowsCapINI
|
||||
echo "Browscap updated."
|
||||
else
|
||||
echo "Browscap up to date."
|
||||
fi
|
Loading…
Reference in New Issue