Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/aslo/db-check.php
blob: 82fbdbfe5e6721518c6a49fc1960bd2cd9816a10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php

// Before doing anything, test to see if we are calling this from the command
// line.  If this is being called from the web, HTTP environment variables will
// be automatically set by Apache.  If these are found, exit immediately.
if (isset($_SERVER['HTTP_HOST'])) {
    exit;
}

require_once('database.class.php');

// New database class
$db = new Database();

$sql = "
    SELECT
        a.id
    FROM
        addons as a
    WHERE
        0 = (select count(*) from translations as t where t.id=a.name and t.locale=a.defaultlocale)
        AND a.status=4
";

$rows = $db->read($sql);

while ($row = mysql_fetch_array($rows)) {
    debug("Missed name for default locale id={$row['id']}", true);
}

// No need in aslo, but if it is beeing set (from the code), it breaks uploader's workflow
$db->read('UPDATE addons SET prerelease=0');

/**
 * Give this function your output.  If the debug flag (in the database) is set or if the error is serious it will get printed
 *
 * @param string what to print
 * @param boolean if the error is fatal or not
 */
function debug($msg, $serious=false) {
    if (CRON_DEBUG || $serious) {
        $_ts = strftime('%H:%M:%S');
        echo "{$_ts} {$msg}\n";
    }
}

exit;
?>