⌈⌋ branch:  freshcode


Check-in [44a53a1581]

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

Overview
SHA1:44a53a1581a11162343422f152dd43f837d69252
Date: 2014-11-03 02:12:56
User: mario
Comment:For absent results, allow singular ->property_row access to silently return NULL.
Tags And Properties
  • branch=trunk inherited from [82405bb421]
  • sym-trunk inherited from [82405bb421]
Context
2014-11-03
02:15
[08ed5cd6ea] Add CloudFlare and DB statistics to frontpage (replacing no-ads whitebox). (user: mario, tags: trunk)
02:12
[44a53a1581] For absent results, allow singular ->property_row access to silently return NULL. (user: mario, tags: trunk)
02:12
[b147818f59] Avoid lengthy loops with SQL SELECT queries in cron jobs, to eschew SQLite database locking up meanwhile. (user: mario, tags: trunk)
Changes

Changes to lib/db.php.

383
384
385
386
387
388
389
390
391
392







393
394
395
396
397
398
399
        return call_user_func_array(array($this->results, $func), $args);
    }

    // Single column access
    function offsetGet($name) {
    
        // get first result, transfuse into $this
        if (is_object($this->results)) {
            $this->exchangeArray($this->results->fetch());
            unset($this->results);







        }
        
        // suffice __get
        return parent::offsetGet($name);
    }

    // Just let PDOStatement handle the Traversable







|
<

>
>
>
>
>
>
>







383
384
385
386
387
388
389
390

391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
        return call_user_func_array(array($this->results, $func), $args);
    }

    // Single column access
    function offsetGet($name) {
    
        // get first result, transfuse into $this
        if (is_object($r = $this->results)) {

            unset($this->results);
            if ($row = $r->fetch()) {
                $this->exchangeArray($row);
            }
            // no row returned, silently return
            else {
                return NULL;
            }
        }
        
        // suffice __get
        return parent::offsetGet($name);
    }

    // Just let PDOStatement handle the Traversable