src/acdhOeaw/fedora/Fedora.php
public function begin(int $keepAliveTimeout = 90) {
        $this->txKeepAlive = $keepAliveTimeout;
        $this->txTimestamp = time();

        $resp = $this->client->post($this->apiUrl . '/fcr:tx');
        $loc  = $resp->getHeader('Location');
        if (count($loc) == 0) {
            throw new RuntimeException('wrong response from fedora');
        }
        $this->txUrl = $loc[0];

        if (function_exists('pcntl_fork')) {
            $this->txProcPid = pcntl_fork();
            if ($this->txProcPid === 0) {
                $this->keepTransactionAlive();
            }
        } else if (defined('STDIN')) {
            if (!function_exists('curl_init')) {
                throw new RuntimeException('Please enable the curl extension in your php.ini');
            }
            $this->txProc = new KeepTransactionAlive($this->txUrl, RC::get('fedoraUser'), RC::get('fedoraPswd'), $this->txKeepAlive);
        }
    }
public function begin(int $keepAliveTimeout = 90) {
        $this->txKeepAlive = $keepAliveTimeout;
        $this->txTimestamp = time();

        $resp = $this->client->post($this->apiUrl . '/fcr:tx');
        $loc  = $resp->getHeader('Location');
        if (count($loc) == 0) {
            throw new RuntimeException('wrong response from fedora');
        }
        $this->txUrl = $loc[0];

        if (function_exists('pcntl_fork')) {
            $this->txProcPid = pcntl_fork();
            if ($this->txProcPid === 0) {
                $this->keepTransactionAlive();
            }
        } else if (defined('STDIN')) {
            if (!function_exists('curl_init')) {
                throw new RuntimeException('Please enable the curl extension in your php.ini');
            }
            $this->txProc = new KeepTransactionAlive($this->txUrl, RC::get('fedoraUser'), RC::get('fedoraPswd'), $this->txKeepAlive);
        }
    }
public function begin ( int $ keepAliveTimeout = 90 ) { $ this -> txKeepAlive = $ keepAliveTimeout ; $ this -> txTimestamp = time ( ) ; $ resp = $ this -> client -> post ( $ this -> apiUrl . '/fcr:tx' ) ; $ loc = $ resp -> getHeader ( 'Location' ) ; if ( count ( $ loc ) == 0 ) { throw new RuntimeException ( 'wrong response from fedora' ) ; } $ this -> txUrl = $ loc [ 0 ] ; if ( function_exists ( 'pcntl_fork' ) ) { $ this -> txProcPid = pcntl_fork ( ) ; if ( $ this -> txProcPid === 0 ) { $ this -> keepTransactionAlive ( ) ; } } else if ( defined ( 'STDIN' ) ) { if ( ! function_exists ( 'curl_init' ) ) { throw new RuntimeException ( 'Please enable the curl extension in your php.ini' ) ; } $ this -> txProc = new KeepTransactionAlive ( $ this -> txUrl , RC :: get ( 'fedoraUser' ) , RC :: get ( 'fedoraPswd' ) , $ this -> txKeepAlive ) ; } }
Starts new Fedora transaction.

Only one transaction can be opened at the same time,
so make sure you committed previous transactions before starting a new one.

Be aware that all metadata modified during the transaction will be not
visible in the triplestore coupled with the Fedora until the transaction
is committed.

@param int $keepAliveTimeout Automatic transaction prolongment timeout
(see the `prolong()` method) - if a Fedora REST API is called and at
least `$keepAliveTimeout` seconds passed since last prolongation, the
transaction will be automatically prolonged.
@see rollback()
@see commit()
@see prolong()
Starts new Fedora transaction .