Dotclear


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.core.php

    r2566 r2596  
    3939     public $rest;       ///< <b>dcRestServer</b> dcRestServer object 
    4040     public $log;        ///< <b>dcLog</b>             dcLog object 
     41     public $stime;      ///< <b>float</b>             starting time 
    4142 
    4243     private $versions = null; 
     
    5960     public function __construct($driver, $host, $db, $user, $password, $prefix, $persist) 
    6061     { 
     62          if (defined('DC_START_TIME')) { 
     63               $this->stime=DC_START_TIME; 
     64          } else { 
     65               $this->stime = microtime(true); 
     66          } 
     67 
    6168          $this->con = dbLayer::init($driver,$host,$db,$user,$password,$persist); 
    6269 
     
    982989     private function getBlogCursor($cur) 
    983990     { 
    984           if ($cur->blog_id !== null 
    985           && !preg_match('/^[A-Za-z0-9._-]{2,}$/',$cur->blog_id)) { 
     991          if (($cur->blog_id !== null 
     992               && !preg_match('/^[A-Za-z0-9._-]{2,}$/',$cur->blog_id)) || 
     993               (!$cur->blog_id)) { 
    986994               throw new Exception(__('Blog ID must contain at least 2 characters using letters, numbers or symbols.')); 
    987995          } 
    988996 
    989           if ($cur->blog_name !== null && $cur->blog_name == '') { 
     997          if (($cur->blog_name !== null && $cur->blog_name == '') || 
     998               (!$cur->blog_name)) { 
    990999               throw new Exception(__('No blog name')); 
    9911000          } 
    9921001 
    993           if ($cur->blog_url !== null && $cur->blog_url == '') { 
     1002          if (($cur->blog_url !== null && $cur->blog_url == '') || 
     1003               (!$cur->blog_url)) { 
    9941004               throw new Exception(__('No blog URL')); 
    9951005          } 
     
    13061316                    array('media_img_title_pattern','string','Title ;; Date(%b %Y) ;; separator(, )', 
    13071317                    'Pattern to set image title when you insert it in a post'), 
     1318                    array('nb_post_for_home','integer',20, 
     1319                    'Number of entries on first home page'), 
    13081320                    array('nb_post_per_page','integer',20, 
    1309                     'Number of entries on home page and category pages'), 
     1321                    'Number of entries on home pages and category pages'), 
    13101322                    array('nb_post_per_feed','integer',20, 
    13111323                    'Number of entries on feeds'), 
     
    14691481          } 
    14701482     } 
     1483 
     1484     /** 
     1485      Return elapsed time since script has been started 
     1486      @param   $mtime <b>float</b> timestamp (microtime format) to evaluate delta from 
     1487                                     current time is taken if null 
     1488      @return <b>float</b>        elapsed time 
     1489      */ 
     1490     public function getElapsedTime ($mtime=null) { 
     1491          if ($mtime !== null) { 
     1492               return $mtime-$this->stime; 
     1493          } else { 
     1494               return microtime(true)-$this->stime; 
     1495          } 
     1496     } 
    14711497     //@} 
     1498 
     1499 
     1500 
    14721501} 
Note: See TracChangeset for help on using the changeset viewer.

Sites map