- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/core/class.dc.core.php
r2566 r2596 39 39 public $rest; ///< <b>dcRestServer</b> dcRestServer object 40 40 public $log; ///< <b>dcLog</b> dcLog object 41 public $stime; ///< <b>float</b> starting time 41 42 42 43 private $versions = null; … … 59 60 public function __construct($driver, $host, $db, $user, $password, $prefix, $persist) 60 61 { 62 if (defined('DC_START_TIME')) { 63 $this->stime=DC_START_TIME; 64 } else { 65 $this->stime = microtime(true); 66 } 67 61 68 $this->con = dbLayer::init($driver,$host,$db,$user,$password,$persist); 62 69 … … 982 989 private function getBlogCursor($cur) 983 990 { 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)) { 986 994 throw new Exception(__('Blog ID must contain at least 2 characters using letters, numbers or symbols.')); 987 995 } 988 996 989 if ($cur->blog_name !== null && $cur->blog_name == '') { 997 if (($cur->blog_name !== null && $cur->blog_name == '') || 998 (!$cur->blog_name)) { 990 999 throw new Exception(__('No blog name')); 991 1000 } 992 1001 993 if ($cur->blog_url !== null && $cur->blog_url == '') { 1002 if (($cur->blog_url !== null && $cur->blog_url == '') || 1003 (!$cur->blog_url)) { 994 1004 throw new Exception(__('No blog URL')); 995 1005 } … … 1306 1316 array('media_img_title_pattern','string','Title ;; Date(%b %Y) ;; separator(, )', 1307 1317 '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'), 1308 1320 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'), 1310 1322 array('nb_post_per_feed','integer',20, 1311 1323 'Number of entries on feeds'), … … 1469 1481 } 1470 1482 } 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 } 1471 1497 //@} 1498 1499 1500 1472 1501 }
Note: See TracChangeset
for help on using the changeset viewer.