Example #1
0
 public function query($sql, $start = null, $perpage = null, $nolimit = false)
 {
     $start and !$perpage and $perpage = 10000;
     $query = mssql_query($sql, $this->dbConnection());
     if ($start) {
         $qcount = mssql_num_rows($query);
         if ($qcount < $start) {
             return array();
         } else {
             mssql_data_seek($query, $start);
         }
     }
     if ($query) {
         $result = array();
         while ($row = mssql_fetch_assoc($query)) {
             if (DBCHARSET == 'gbk' && CHARSET != 'gbk') {
                 $row = Base_Class::gbktoutf($row);
             }
             $result[] = $row;
             if ($perpage && count($result) >= $perpage) {
                 break;
             }
         }
         return $result;
     } else {
         $this->halt("数据库查询错误", $sql);
     }
 }
Example #2
0
 /**
  * Class constructor.
  */
 public function __construct()
 {
     parent::__construct();
     global $wpdb;
     $this->wpdb = $wpdb;
     $this->load_message_headers();
     $this->set_hooks();
 }
 public function __construct()
 {
     parent::__construct();
     $this->large_edge = '1000';
     $this->small_edge = '400';
     $this->arWatermarks = ['large_watermark' => dirname(__FILE__) . '/watermark/large_watermark.png', 'small_watermark' => dirname(__FILE__) . '/watermark/small_watermark.png'];
     $this->small_watermark = $this->arWatermarks['small_watermark'];
     $this->large_watermark = $this->arWatermarks['large_watermark'];
 }
Example #4
0
 /**
  * Class constructor.
  *
  * @param string lock_name The name to assign to the lock.
  * @param int The amount of seconds after which a "locked lock" is considered
  * stuck and should be forcibly unlocked.
  */
 public function __construct($lock_name, $semaphore_lock_wait = self::DEFAULT_SEMAPHORE_LOCK_WAIT)
 {
     parent::__construct();
     $this->semaphore_lock_wait = $semaphore_lock_wait;
     $this->text_domain = WC_AeliaFoundationClasses::$text_domain;
     if (empty($lock_name)) {
         throw new \InvalidArgumentException('Invalid lock name specified for semaphore.', $this->text_domain);
     }
     $this->lock_name = $lock_name;
 }
 public function __construct()
 {
     parent::__construct();
     $this->files = [];
 }