Method to restart data transfer at a given byte

@param   integer  $point  Byte to restart transfer at

@return  boolean  True if successful

@since   1.0
169827
public function restart($point)
	{
		// If native FTP support is enabled let's use it...
		if (FTP_NATIVE)
		{
			if (@ftp_site($this->conn, 'REST ' . $point) === false)
			{
				Log::add(__METHOD__ . 'Bad response.', Log::WARNING, 'jerror');

				return false;
			}

			return true;
		}

		// Send restart command and verify success
		if (!$this->_putCmd('REST ' . $point, 350))
		{
			Log::add(
				sprintf(
					'%1$s: Bad response.  Server response: %2$s [Expected: 350].  Restart point sent: %3$s', __METHOD__, $this->response, $point
				),
				Log::WARNING, 'jerror'
			);

			return false;
		}

		return true;
	}
1150369
public function setPosition($position)
    {
        $oldPosition = $this->owner->{$this->positionAttribute};
        $transaction = $this->owner->getDb()->beginTransaction();
        try {
            $isUp = ($position - $oldPosition) > 0;
            $counters = [$this->positionAttribute => $isUp ? -1 : 1];
            $condition = [
                'between',
                $this->positionAttribute,
                $isUp ? $oldPosition : $position,
                $isUp ? $position : $oldPosition,
            ];
            $this->owner->updateAllCounters($counters, $condition);

            $this->owner->{$this->positionAttribute} = $position;
            $this->owner->save();

            $transaction->commit();

            return true;
        } catch (\Exception $e) {
            $transaction->rollBack();
            Yii::error($e);

            return false;
        }
    }
509275
public function encodePoint($point) {
        $enc = $point->getY()->toArray('le', $this->encodingLength);
        $enc[$this->encodingLength - 1] |= $point->getX()->isOdd() ? 0x80 : 0;
        return $enc;
    }
978207
public function rollbackSavepoint($savepoint)
    {
        if (! $this->getDatabasePlatform()->supportsSavepoints()) {
            throw ConnectionException::savepointsNotSupported();
        }

        $this->getWrappedConnection()->exec($this->platform->rollbackSavePoint($savepoint));
    }
568104
public function writePoint(QtiPoint $point)
    {
       try {
           $this->writeShort($point->getX());
           $this->writeShort($point->getY());
       } catch (BinaryStreamAccessException $e) {
           $msg = "An error occured while writing a point.";
           throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException::POINT, $e);
       }
    }
109824
public function commit($throw=true)
	{
		if (!$this->transactionOpen && $throw) { $this->throwError("Transaction not open to commit()",""); return false; }
		if (!$this->isOpen) { $this->throwError("It's not connected to the database",""); return false; }
		$this->transactionOpen = false;
		return @$this->conn1->commit();
	}
918685
public function codepoint($p)
    {
        if ($this->codepoint !== $p) {
            $this->codepoint = $p;
            return true;
        }

        return false;
    }
1327042
public function beginTransaction(array $options = [])
    {
        if (!$this->isConnected()) {
            $this->connect();
        }
        
        if (!$this->inTransaction() || !empty($options['new'])) {
            $this->workSavepoint(
                'beginTransaction',
                'SAVEPOINT ' . $this->savePointName()
            );
            $this->transactions[] = true;
        } else {
            $this->transactions[] = false;
        }
    }
906404
public function compareYCoord(Point $point, $precision = 1000)
    {
        return $this->compare($this->y, $point->y, $precision);
    }
559083
function transaction( $action )
    {
        switch ( $action )
        {
        case 'start':
            // store all the data away into the checkpoint variable
            $data = get_object_vars( $this );
            $this->checkpoint = $data;
            unset( $data );
            break;
        case 'commit':
            if ( is_array( $this->checkpoint ) && isset( $this->checkpoint['checkpoint'] ) )
            {
                $tmp = $this->checkpoint['checkpoint'];
                $this->checkpoint = $tmp;
                unset( $tmp );
            }
            else
            {
                $this->checkpoint = '';
            }
            break;
        case 'rewind':
            // do not destroy the current checkpoint, but move us back to the state then, so that we can try again
            if ( is_array( $this->checkpoint ) )
            {
                // can only abort if were inside a checkpoint
                $tmp = $this->checkpoint;
                foreach ( $tmp as $k => $v )
                {
                    if ( $k != 'checkpoint' )
                    {
                        $this->$k = $v;
                    }
                }
                unset($tmp);
            }
            break;
        case 'abort':
            if ( is_array( $this->checkpoint ) )
            {
                // can only abort if were inside a checkpoint
                $tmp = $this->checkpoint;
                foreach ( $tmp as $k => $v )
                {
                    $this->$k = $v;
                }
                unset($tmp);
            }
            break;
        }

    }
1127053
function Reset() {
    $this->error = null; # so no confusion is caused

    if(!$this->connected()) {
      $this->error = array(
      "error" => "Called Reset() without being connected");
      return false;
    }

    fputs($this->smtp_conn,"RSET" . $this->CRLF);

    $rply = $this->get_lines();
    $code = substr($rply,0,3);

    if($this->do_debug >= 2) {
      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
    }

    if($code != 250) {
      $this->error =
      array("error" => "RSET failed",
      "smtp_code" => $code,
      "smtp_msg" => substr($rply,4));
      if($this->do_debug >= 1) {
        echo "SMTP -> ERROR: " . $this->error["error"] .
        ": " . $rply . $this->CRLF;
      }
      return false;
    }

    return true;
  }
302001
public function start_transaction()
	{
		$result = true;

		if ($this->_transaction_depth == 0)
		{
			if ($this->driver_start_transaction())
			{
				$this->_in_transaction = true;
			}
			else
			{
				$result = false;
			}
		}
		else
		{
			$result = $this->set_savepoint($this->_transaction_depth);
			// If savepoint is not supported it is not an error
			isset($result) or $result = true;
		}

		$result and $this->_transaction_depth ++;

		return $result;
	}
753250
public function reopen_mbox($mbox){
    if ( $this->is_connected() ){
      if ( \in_array($mbox, $this->get_all_names_mboxes()) ){
        return imap_reopen($this->stream, $this->mbParam . $mbox);
      }
      else {
        return imap_reopen($this->stream, $mbox);
      }
    }
    return false;
  }
1270966
public function startRecording($stream)
    {
        $parts = explode('/', $this->streamserver_config[$stream->getRtmpServer()]['rtmp_url']);
        $rtmp_app = end($parts);
        $success = $this->record(
            $this->streamserver_config[$stream->getRtmpServer()]['rtmp_control'],
            $rtmp_app,
            $stream->getUniqID()
        );
        if ($success) {
            $stream->setTechnicalStatus(Stream::STATE_RECORDING);
            $this->em->persist($stream);
            $this->em->flush();

            $event = new StartRecordingStreamEvent($stream);
            $this->dispatcher->dispatch(
                OktolabMediaEvent::STREAM_START_RECORDING,
                $event
            );
            return true;
        }
        return false;
    }
1015999
public function restart()
	{
		$this->destroy();

		if ($this->_state !==  self::STATE_DESTROYED) {
			throw new LibSessionsException("Session is not destroyed!\n");
		}

		$this->_storage->register();

		$this->_state = self::STATE_RESTART;

		$id	= $this->_createToken(strlen($this->getId()));

		session_id($id);

		$this->_start();

		$this->_state = self::STATE_ACTIVE;

		$this->_setCounter();

		return true;
	}
254623
public void restart(Destination dst) throws KNXTimeoutException,
		KNXLinkClosedException
	{
		final byte[] send = DataUnitBuilder.createCompactAPDU(RESTART, null);
		if (dst.isConnectionOriented())
			tl.connect(dst);
		else
			logger.error("doing restart in connectionless mode, " + dst.toString());
		tl.sendData(dst.getAddress(), priority, send);
		// force a reconnect at later time
		tl.disconnect(dst);
	}
760693
public function begin($savepoint = null){
		$this->connection->getDriver()->beginTransaction($savepoint);
		$this->notifyObservers(ObserverInterface::BEGIN);
		return $this;
	}