git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7523 b9a71923-0436-4b27-9f14-aed3839534dd

This commit is contained in:
rGaillard committed 2011-07-06 10:11:35 +00:00
1 parent 69f2f09dc5
commit ba9cdcf295
646 files changed
-94688

No files matched your search

-111
View File
@@ -1,111 +0,0 @@
<?php
/**
* Swift Mailer Array Iterator Interface
* Please read the LICENSE file
* @author Chris Corbyn <chris@w3style.co.uk>
* @package Swift
* @license GNU Lesser General Public License
*/
require_once dirname(__FILE__) . "/../ClassLoader.php";
Swift_ClassLoader::load("Swift_Iterator");
/**
* Swift Array Iterator Interface
* Iterates over a standard PHP array.
* @package Swift
* @author Chris Corbyn <chris@w3style.co.uk>
*/
class Swift_Iterator_Array implements Swift_Iterator
{
/**
* All keys in this array.
* @var array
*/
protected $keys;
/**
* All values in this array.
* @var array
*/
protected $values;
/**
* The current array position.
* @var int
*/
protected $pos = -1;
/**
* Ctor.
* @param array The array to iterate over.
*/
public function __construct($input)
{
$input = (array) $input;
$this->keys = array_keys($input);
$this->values = array_values($input);
}
/**
* Returns the original array.
* @return array
*/
public function getArray()
{
return array_combine($this->keys, $this->values);
}
/**
* Returns true if there is a value after the current one.
* @return boolean
*/
public function hasNext()
{
return array_key_exists($this->pos + 1, $this->keys);
}
/**
* Moves to the next array element if possible.
* @return boolean
*/
public function next()
{
if ($this->hasNext())
{
++$this->pos;
return true;
}
return false;
}
/**
* Goes directly to the given element in the array if possible.
* @param int Numeric position
* @return boolean
*/
public function seekTo($pos)
{
if (array_key_exists($pos, $this->keys))
{
$this->pos = $pos;
return true;
}
return false;
}
/**
* Returns the value at the current position, or NULL otherwise.
* @return mixed.
*/
public function getValue()
{
if (array_key_exists($this->pos, $this->values))
return $this->values[$this->pos];
else return null;
}
/**
* Gets the current numeric position within the array.
* @return int
*/
public function getPosition()
{
return $this->pos;
}
}
-121
View File
@@ -1,121 +0,0 @@
<?php
/**
* Swift Mailer MySQL Resultset Iterator
* Please read the LICENSE file
* @author Chris Corbyn <chris@w3style.co.uk>
* @package Swift
* @license GNU Lesser General Public License
*/
require_once dirname(__FILE__) . "/../ClassLoader.php";
Swift_ClassLoader::load("Swift_Iterator");
/**
* Swift Mailer MySQL Resultset Iterator.
* Iterates over MySQL Resultset from mysql_query().
* @package Swift
* @author Chris Corbyn <chris@w3style.co.uk>
*/
class Swift_Iterator_MySQLResult implements Swift_Iterator
{
/**
* The MySQL resource.
* @var resource
*/
protected $resultSet;
/**
* The current row (array) in the resultset.
* @var array
*/
protected $currentRow = array(null, null);
/**
* The current array position.
* @var int
*/
protected $pos = -1;
/**
* The total number of rows in the resultset.
* @var int
*/
protected $numRows = 0;
/**
* Ctor.
* @param resource The resultset iterate over.
*/
public function __construct($rs)
{
$this->resultSet = $rs;
$this->numRows = mysql_num_rows($rs);
}
/**
* Get the resultset.
* @return resource
*/
public function getResultSet()
{
return $this->resultSet;
}
/**
* Returns true if there is a value after the current one.
* @return boolean
*/
public function hasNext()
{
return (($this->pos + 1) < $this->numRows);
}
/**
* Moves to the next array element if possible.
* @return boolean
*/
public function next()
{
if ($this->hasNext())
{
$this->currentRow = mysql_fetch_array($this->resultSet);
$this->pos++;
return true;
}
return false;
}
/**
* Goes directly to the given element in the array if possible.
* @param int Numeric position
* @return boolean
*/
public function seekTo($pos)
{
if ($pos >= 0 && $pos < $this->numRows)
{
mysql_data_seek($this->resultSet, $pos);
$this->currentRow = mysql_fetch_array($this->resultSet);
mysql_data_seek($this->resultSet, $pos);
$this->pos = $pos;
return true;
}
return false;
}
/**
* Returns the value at the current position, or NULL otherwise.
* @return mixed.
*/
public function getValue()
{
$row = $this->currentRow;
if ($row[0] !== null)
return new Swift_Address($row[0], isset($row[1]) ? $row[1] : null);
else
return null;
}
/**
* Gets the current numeric position within the array.
* @return int
*/
public function getPosition()
{
return $this->pos;
}
}
-11
View File
@@ -1,11 +0,0 @@
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;