Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
439 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
framework/Kolab_Storage/lib/Horde/Kolab/Storage/Data/Modifiable.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?php | ||
/** | ||
* A modifiable message object. | ||
* | ||
* PHP version 5 | ||
* | ||
* @category Kolab | ||
* @package Kolab_Storage | ||
* @author Gunnar Wrobel <wrobel@pardus.de> | ||
* @license http://www.fsf.org/copyleft/lgpl.html LGPL | ||
* @link http://pear.horde.org/index.php?package=Kolab_Storage | ||
*/ | ||
|
||
/** | ||
* A modifiable message object. | ||
* | ||
* Copyright 2011 The Horde Project (http://www.horde.org/) | ||
* | ||
* See the enclosed file COPYING for license information (LGPL). If you | ||
* did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. | ||
* | ||
* @category Kolab | ||
* @package Kolab_Storage | ||
* @author Gunnar Wrobel <wrobel@pardus.de> | ||
* @license http://www.fsf.org/copyleft/lgpl.html LGPL | ||
* @link http://pear.horde.org/index.php?package=Kolab_Storage | ||
*/ | ||
class Horde_Kolab_Storage_Data_Modifiable | ||
{ | ||
/** | ||
* Constructor. | ||
* | ||
* @param Horde_Kolab_Storage_Driver $driver The backend driver. | ||
* @param string $folder The folder this object belongs to. | ||
* @param array $object The MIME parsed message elements. | ||
*/ | ||
public function __construct($driver, $folder, $object) | ||
{ | ||
$this->_driver = $driver; | ||
$this->_folder = $folder; | ||
$this->_object = $object; | ||
} | ||
|
||
public function getStructure() | ||
{ | ||
return $this->_object[1]; | ||
} | ||
|
||
public function setPart($mime_id, $new_part) | ||
{ | ||
$this->_object[1]->getPart(0)->setContents(''); | ||
$this->_object[1]->alterPart($mime_id, $new_part); | ||
$this->_object[1]->buildMimeIds(); | ||
} | ||
|
||
public function store() | ||
{ | ||
return $this->_driver->appendMessage( | ||
$this->_folder, | ||
$this->_object[1]->toString( | ||
array( | ||
'canonical' => true, | ||
'stream' => true, | ||
'headers' => $this->_object[0] | ||
) | ||
) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.