v1.3.1.443

This commit is contained in:
RainLoop Team 2013-10-16 22:52:37 +04:00
parent f32876928e
commit 91a9f85659
400 changed files with 636 additions and 612 deletions

View file

@ -0,0 +1,72 @@
<?php
namespace MailSo\Mime\Parser;
/**
* @category MailSo
* @package Mime
* @subpackage Parser
*/
class ParserEmpty implements ParserInterface
{
/**
* @param \MailSo\Mime\Part $oPart
*
* @return void
*/
public function StartParse(\MailSo\Mime\Part &$oPart)
{
}
/**
* @param \MailSo\Mime\Part $oPart
*
* @return void
*/
public function EndParse(\MailSo\Mime\Part &$oPart)
{
}
/**
* @param \MailSo\Mime\Part $oPart
*
* @return void
*/
public function StartParseMimePart(\MailSo\Mime\Part &$oPart)
{
}
/**
* @param \MailSo\Mime\Part $oMimePart
*
* @return void
*/
public function EndParseMimePart(\MailSo\Mime\Part &$oPart)
{
}
/**
* @return void
*/
public function InitMimePartHeader()
{
}
/**
* @param string $sBuffer
*
* @return void
*/
public function ReadBuffer($sBuffer)
{
}
/**
* @param string $sBuffer
*
* @return void
*/
public function WriteBody($sBuffer)
{
}
}

View file

@ -0,0 +1,57 @@
<?php
namespace MailSo\Mime\Parser;
/**
* @category MailSo
* @package Mime
* @subpackage Parser
*/
interface ParserInterface
{
/**
* @param \MailSo\Mime\Part $oPart
*
* @return void
*/
public function StartParse(\MailSo\Mime\Part &$oPart);
/**
* @param \MailSo\Mime\Part $oPart
*
* @return void
*/
public function EndParse(\MailSo\Mime\Part &$oPart);
/**
* @param \MailSo\Mime\Part $oPart
*
* @return void
*/
public function StartParseMimePart(\MailSo\Mime\Part &$oPart);
/**
* @param \MailSo\Mime\Part $oMimePart
*
* @return void
*/
public function EndParseMimePart(\MailSo\Mime\Part &$oPart);
/**
* @return void
*/
public function InitMimePartHeader();
/**
* @param string $sBuffer
*
* @return void
*/
public function ReadBuffer($sBuffer);
/**
* @param string $sBuffer
* @return void
*/
public function WriteBody($sBuffer);
}

View file

@ -0,0 +1,44 @@
<?php
namespace MailSo\Mime\Parser;
/**
* @category MailSo
* @package Mime
* @subpackage Parser
*/
class ParserMemory extends ParserEmpty implements ParserInterface
{
/**
* @var \MailSo\Mime\Part
*/
protected $oCurrentMime = null;
/**
* @param \MailSo\Mime\Part $oMimePart
*
* @return void
*/
public function StartParseMimePart(\MailSo\Mime\Part &$oPart)
{
$this->oCurrentMime = $oPart;
}
/**
* @param string $sBuffer
*
* @return void
*/
public function WriteBody($sBuffer)
{
if (null === $this->oCurrentMime->Body)
{
$this->oCurrentMime->Body = \MailSo\Base\ResourceRegistry::CreateMemoryResource();
}
if (\is_resource($this->oCurrentMime->Body))
{
\fwrite($this->oCurrentMime->Body, $sBuffer);
}
}
}