getParameter() public method

Example: getParameter('test?q=1', 'q') == 1
public getParameter ( string $url, string $parameter, string $default = null )
$url string The complete URL.
$parameter string The parameter name to extract.
$default string A default value to return if none has been provided in the URL.
Exemplo n.º 1
0
 /**
  * Replaces an entry in the server database.
  *
  * @param string $databaseURI  URI of Database to sync. Like calendar,
  *                             tasks, contacts or notes. May include
  *                             optional parameters:
  *                             tasks?options=ignorecompleted.
  * @param string $content      The actual data.
  * @param string $contentType  MIME type of the content.
  * @param string $cuid         Client ID of this entry.
  *
  * @return string  PEAR_Error or server ID (Horde GUID) of modified entry.
  */
 public function replaceEntry($databaseURI, $content, $contentType, $cuid)
 {
     global $registry;
     $database = $this->normalize($databaseURI);
     // Only server needs to do a cuid<->suid map
     if ($this->_backendMode == Horde_SyncMl_Backend::MODE_SERVER) {
         $suid = $this->_getSuid($database, $cuid);
     } else {
         $suid = $cuid;
     }
     if (!$suid) {
         return PEAR::raiseError("No map entry found for client id {$cuid} replacing on server");
     }
     // Entry exists: replace current one.
     try {
         $ok = $registry->call($database . '/replace', array($suid, $content, $contentType));
     } catch (Horde_Exception $e) {
         return PEAR::raiseError($e->getMessage());
     }
     $this->logMessage("Replaced in server db {$database} client id {$cuid} -> server id {$suid}", 'DEBUG');
     $ts = $registry->call($database . '/getActionTimestamp', array($suid, 'modify', Horde_SyncMl_Backend::getParameter($databaseURI, 'source')));
     // Only server needs to do a cuid<->suid map
     if ($this->_backendMode == Horde_SyncMl_Backend::MODE_SERVER) {
         $this->createUidMap($database, $cuid, $suid, $ts);
     }
     return $suid;
 }