⌈⌋ ⎇ branch:  freshcode


Check-in [b2cdb48c30]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Populate `tags` table.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b2cdb48c301b1f545e3ddb0a9ac2d4150aa3cad6
User & Date: mario 2014-06-30 01:10:28
Context
2014-06-30
01:10
curl() wrapper check-in: 11fd88164c user: mario tags: trunk, 0.3
01:10
Populate `tags` table. check-in: b2cdb48c30 user: mario tags: trunk
01:07
Moved utility code to (misnomer) layout_aux. check-in: 1cdf4582fe user: mario tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added cron.daily/tags.php.



































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
<?php
/**
 * api: cron
 * title: Update `tags` table
 * description: Splits out tags from according column in project `release`.
 * version: 0.1
 *
 *
 * Manually update tags table.
 *
 */

chdir(dirname(__DIR__)); 
include("config.php");

/**
 * Scan each project,
 * split up `tags` as CSV and just fille up according tags table.
 *
 */
foreach (db("SELECT * FROM release_versions GROUP BY name") as $entry) {

    print_r($entry);
    
    $name = $entry->name;
    $tags = array_slice(p_csv($entry->tags), 0, 7);

    db("DELETE FROM tags WHERE name=?", $name);
    foreach ($tags as $t) {
        db("INSERT INTO tags (name, tag) VALUES (?, ?)", $name, $t);
    }

}