Changeset 439 for branches/eli_branch/lib/Lock.inc.php
- Timestamp:
- Nov 30, 2013 7:30:44 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eli_branch/lib/Lock.inc.php
r438 r439 32 32 33 33 // Configuration of this object. 34 var$_params = array(34 private $_params = array( 35 35 'timeout' => 600, 36 36 'auto_timeout' => 1800, … … 44 44 45 45 // Store lock data from DB. 46 var$data = array();46 private $data = array(); 47 47 48 48 // Auth_SQL object from which to access a current user_id. 49 var$_auth;49 private $_auth; 50 50 51 51 /** … … 56 56 * @static 57 57 */ 58 static function &getInstance($auth_object)58 public static function &getInstance($auth_object) 59 59 { 60 60 static $instance = null; … … 72 72 * @param mixed $auth_object An Auth_SQL or Auth_FILE object. 73 73 */ 74 function Lock($auth_object)74 public function __construct($auth_object) 75 75 { 76 76 $app =& App::getInstance(); … … 95 95 * @since 26 Aug 2005 17:09:36 96 96 */ 97 function initDB($recreate_db=false)97 public function initDB($recreate_db=false) 98 98 { 99 99 $app =& App::getInstance(); … … 142 142 * @param array $params Array of param keys and values to set. 143 143 */ 144 function setParam($params=null)144 public function setParam($params=null) 145 145 { 146 146 if (isset($params) && is_array($params)) { … … 157 157 * @return mixed Configured parameter value. 158 158 */ 159 function getParam($param)159 public function getParam($param) 160 160 { 161 161 $app =& App::getInstance(); … … 178 178 * @param string $title A title to apply to the lock, for display purposes. 179 179 */ 180 function select($record_table_or_lock_id, $record_key=null, $record_val=null)180 public function select($record_table_or_lock_id, $record_key=null, $record_val=null) 181 181 { 182 182 $app =& App::getInstance(); … … 219 219 * @return bool True if locked. 220 220 */ 221 function isLocked()221 public function isLocked() 222 222 { 223 223 return isset($this->data['lock_id']); … … 230 230 * @return bool True if current user set the lock. 231 231 */ 232 function isMine()232 public function isMine() 233 233 { 234 234 $db =& DB::getInstance(); … … 258 258 * @return int The id for the lock (mysql last insert id). 259 259 */ 260 function set($record_table, $record_key, $record_val, $title='')260 public function set($record_table, $record_key, $record_val, $title='') 261 261 { 262 262 $db =& DB::getInstance(); … … 304 304 * Unlock the currently selected record. 305 305 */ 306 function remove()306 public function remove() 307 307 { 308 308 $app =& App::getInstance(); … … 326 326 * Unlock all records, or all records for a specified user. 327 327 */ 328 function removeAll($user_id=null)328 public function removeAll($user_id=null) 329 329 { 330 330 $app =& App::getInstance(); … … 350 350 * Deletes all locks that are older than auto_timeout. 351 351 */ 352 function _auto_timeout()352 private function _auto_timeout() 353 353 { 354 354 $db =& DB::getInstance(); … … 371 371 * Redirect to record lock error page. 372 372 */ 373 function dieErrorPage()373 public function dieErrorPage() 374 374 { 375 375 $app =& App::getInstance(); … … 381 381 * Print error page. 382 382 */ 383 function printErrorHTML()383 public function printErrorHTML() 384 384 { 385 385 $app =& App::getInstance(); … … 416 416 * Return lock_id of locked record. 417 417 */ 418 function getID()418 public function getID() 419 419 { 420 420 return $this->data['lock_id']; … … 424 424 * Return title of locked record. 425 425 */ 426 function getTitle()426 public function getTitle() 427 427 { 428 428 return $this->data['title']; … … 432 432 * Return administrator username for locked record. 433 433 */ 434 function getEditor()434 public function getEditor() 435 435 { 436 436 return $this->data['editor']; … … 440 440 * Return total seconds since the record was locked. 441 441 */ 442 function getSecondsElapsed()442 public function getSecondsElapsed() 443 443 { 444 444 if (isset($this->data['lock_datetime']) && strtotime($this->data['lock_datetime']) < time()) {
Note: See TracChangeset
for help on using the changeset viewer.