createBook() 공개 정적인 메소드

Utility function to help clients create new address books without having to create an imsp driver instance first.
public static createBook ( array $source, string $newName ) : mixed
$source array Information about the user's default IMSP address book.
$newName string The name of the new address book.
리턴 mixed true on success or PEAR_Error on failure.
예제 #1
0
파일: Imsp.php 프로젝트: DSNS-LAB/Dmail
 /**
  * Creates a new Horde_Share and creates the address book
  * on the IMSP server.
  *
  * @param array  The params for the share.
  *
  * @return Horde_Share  The share object.
  * @throws Turba_Exception
  */
 public function createShare($share_id, $params)
 {
     $params['params']['name'] = $this->params['username'];
     if (!isset($params['default']) || $params['default'] !== true) {
         $params['params']['name'] .= '.' . $params['name'];
     }
     $result = Turba::createShare($share_id, $params);
     try {
         Horde_Core_Imsp_Utils::createBook($GLOBALS['cfgSources']['imsp'], $params['params']['name']);
     } catch (Horde_Imsp_Exception $e) {
         throw new Turba_Exception($e);
     }
     return $result;
 }