Пример #1
0
function pbuUser($userID)
{
    $s = microtime(true);
    // TODO: transaction support?
    $pbu = PBU::create($userID, $coordChanges);
    $pbu->close();
    echo "<br>\nPBU for user " . $userID . " completed in " . (microtime(true) - $s) . "-<br>\n";
}
 /**
  * @see WOTAPIAction::execute()
  */
 public function execute()
 {
     var_dump($this->coordChanges);
     $this->pbuObj = PBU::create($this->userID, $this->coordChanges);
     $this->pbuObj->close();
     $this->pbuStr = file_get_contents($this->pbuObj->getFileName());
     parent::execute();
 }
 /**
  * @see WOTAPIAction::execute()
  */
 public function execute()
 {
     $this->pbuID = PBU::insert($this->userID, $this->serverID, $this->time);
     $this->pbuObj = new PBU($this->pbuID);
     $this->pbuObj->getFile()->write($this->pbuStr);
     $this->pbuObj->close(PBU::FILE_HANDLE);
     chmod($this->pbuObj->getFileName(), 0777);
     if ($this->recover) {
         $this->pbuObj->recover();
     }
     parent::execute();
 }
Пример #4
0
 /**
  * Creates a new backup.
  * 
  * @param	int		userid
  * @param	array	changes the coordinates
  * @return	PBU
  */
 public static function create($userID, $coordChanges = array())
 {
     $pbuID = self::insert($userID);
     $pbuObj = new PBU($pbuID);
     $pbuObj->backup($coordChanges);
     return $pbuObj;
 }