mirror of
https://github.com/atlanticbiomedical/portal-legacy.git
synced 2025-07-02 01:47:28 -04:00
initial commit
This commit is contained in:
184
lib/symfony/vendor/propel/adapter/DBAdapter.php
vendored
Executable file
184
lib/symfony/vendor/propel/adapter/DBAdapter.php
vendored
Executable file
@ -0,0 +1,184 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* $Id: DBAdapter.php 536 2007-01-10 14:30:38Z heltem $
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the LGPL. For more information please see
|
||||
* <http://propel.phpdb.org>.
|
||||
*/
|
||||
|
||||
include_once 'creole/Connection.php';
|
||||
|
||||
/**
|
||||
* DBAdapter</code> defines the interface for a Propel database adapter.
|
||||
*
|
||||
* <p>Support for new databases is added by subclassing
|
||||
* <code>DBAdapter</code> and implementing its abstract interface, and by
|
||||
* registering the new database adapter and corresponding Creole
|
||||
* driver in the private adapters map (array) in this class.</p>
|
||||
*
|
||||
* <p>The Propel database adapters exist to present a uniform
|
||||
* interface to database access across all available databases. Once
|
||||
* the necessary adapters have been written and configured,
|
||||
* transparent swapping of databases is theoretically supported with
|
||||
* <i>zero code change</i> and minimal configuration file
|
||||
* modifications.</p>
|
||||
*
|
||||
* @author Hans Lellelid <hans@xmpl.org> (Propel)
|
||||
* @author Jon S. Stevens <jon@latchkey.com> (Torque)
|
||||
* @author Brett McLaughlin <bmclaugh@algx.net> (Torque)
|
||||
* @author Daniel Rall <dlr@finemaltcoding.com> (Torque)
|
||||
* @version $Revision: 536 $
|
||||
* @package propel.adapter
|
||||
*/
|
||||
abstract class DBAdapter {
|
||||
|
||||
/**
|
||||
* Creole driver to Propel adapter map.
|
||||
* @var array
|
||||
*/
|
||||
private static $adapters = array(
|
||||
'mysql' => 'DBMySQL',
|
||||
'mysqli' => 'DBMySQLi',
|
||||
'mssql' => 'DBMSSQL',
|
||||
'sybase' => 'DBSybase',
|
||||
'oracle' => 'DBOracle',
|
||||
'pgsql' => 'DBPostgres',
|
||||
'sqlite' => 'DBSQLite',
|
||||
'' => 'DBNone',
|
||||
);
|
||||
|
||||
/**
|
||||
* Creates a new instance of the database adapter associated
|
||||
* with the specified Creole driver.
|
||||
*
|
||||
* @param string $driver The name of the Propel/Creole driver to
|
||||
* create a new adapter instance for or a shorter form adapter key.
|
||||
* @return DBAdapter An instance of a Propel database adapter.
|
||||
* @throws PropelException if the adapter could not be instantiated.
|
||||
*/
|
||||
public static function factory($driver) {
|
||||
$adapterClass = isset(self::$adapters[$driver]) ? self::$adapters[$driver] : null;
|
||||
if ($adapterClass !== null) {
|
||||
require_once 'propel/adapter/'.$adapterClass.'.php';
|
||||
$a = new $adapterClass();
|
||||
return $a;
|
||||
} else {
|
||||
throw new PropelException("Unsupported Propel driver: " . $driver . ": Check your configuration file");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to ignore case.
|
||||
*
|
||||
* @param in The string to transform to upper case.
|
||||
* @return string The upper case string.
|
||||
*/
|
||||
public abstract function toUpperCase($in);
|
||||
|
||||
/**
|
||||
* Returns the character used to indicate the beginning and end of
|
||||
* a piece of text used in a SQL statement (generally a single
|
||||
* quote).
|
||||
*
|
||||
* @return string The text delimeter.
|
||||
*/
|
||||
public function getStringDelimiter()
|
||||
{
|
||||
return '\'';
|
||||
}
|
||||
|
||||
/**
|
||||
* Locks the specified table.
|
||||
*
|
||||
* @param Connection $con The Creole connection to use.
|
||||
* @param string $table The name of the table to lock.
|
||||
* @return void
|
||||
* @throws SQLException No Statement could be created or executed.
|
||||
*/
|
||||
public abstract function lockTable(Connection $con, $table);
|
||||
|
||||
/**
|
||||
* Unlocks the specified table.
|
||||
*
|
||||
* @param Connection $con The Creole connection to use.
|
||||
* @param string $table The name of the table to unlock.
|
||||
* @return void
|
||||
* @throws SQLException No Statement could be created or executed.
|
||||
*/
|
||||
public abstract function unlockTable(Connection $con, $table);
|
||||
|
||||
/**
|
||||
* This method is used to ignore case.
|
||||
*
|
||||
* @param string $in The string whose case to ignore.
|
||||
* @return string The string in a case that can be ignored.
|
||||
*/
|
||||
public abstract function ignoreCase($in);
|
||||
|
||||
/**
|
||||
* This method is used to ignore case in an ORDER BY clause.
|
||||
* Usually it is the same as ignoreCase, but some databases
|
||||
* (Interbase for example) does not use the same SQL in ORDER BY
|
||||
* and other clauses.
|
||||
*
|
||||
* @param string $in The string whose case to ignore.
|
||||
* @return string The string in a case that can be ignored.
|
||||
*/
|
||||
public function ignoreCaseInOrderBy($in)
|
||||
{
|
||||
return $this->ignoreCase($in);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns SQL which concatenates the second string to the first.
|
||||
*
|
||||
* @param string String to concatenate.
|
||||
* @param string String to append.
|
||||
* @return string
|
||||
*/
|
||||
public abstract function concatString($s1, $s2);
|
||||
|
||||
/**
|
||||
* Returns SQL which extracts a substring.
|
||||
*
|
||||
* @param string String to extract from.
|
||||
* @param int Offset to start from.
|
||||
* @param int Number of characters to extract.
|
||||
* @return string
|
||||
*/
|
||||
public abstract function subString($s, $pos, $len);
|
||||
|
||||
/**
|
||||
* Returns SQL which calculates the length (in chars) of a string.
|
||||
*
|
||||
* @param string String to calculate length of.
|
||||
* @return string
|
||||
*/
|
||||
public abstract function strLength($s);
|
||||
|
||||
|
||||
/**
|
||||
* Quotes database objec identifiers (table names, col names, sequences, etc.).
|
||||
* @param string $text The identifier to quote.
|
||||
* @return string The quoted identifier.
|
||||
*/
|
||||
public function quoteIdentifier($text)
|
||||
{
|
||||
return '"' . $text . '"';
|
||||
}
|
||||
|
||||
}
|
36
lib/symfony/vendor/propel/adapter/DBMSSQL.php
vendored
Executable file
36
lib/symfony/vendor/propel/adapter/DBMSSQL.php
vendored
Executable file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* $Id: DBMSSQL.php 536 2007-01-10 14:30:38Z heltem $
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the LGPL. For more information please see
|
||||
* <http://propel.phpdb.org>.
|
||||
*/
|
||||
|
||||
require_once 'propel/adapter/DBSybase.php';
|
||||
|
||||
/**
|
||||
* This is used to connect to a MSSQL database. For now, this class
|
||||
* simply extends the adaptor for Sybase.
|
||||
*
|
||||
* @author Hans Lellelid <hans@xmpl.org> (Propel)
|
||||
* @author Gonzalo Diethelm <gonzalo.diethelm@sonda.com> (Torque)
|
||||
* @version $Revision: 536 $
|
||||
* @package propel.adapter
|
||||
*/
|
||||
class DBMSSQL extends DBSybase {
|
||||
// no difference currently
|
||||
}
|
133
lib/symfony/vendor/propel/adapter/DBMySQL.php
vendored
Executable file
133
lib/symfony/vendor/propel/adapter/DBMySQL.php
vendored
Executable file
@ -0,0 +1,133 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* $Id: DBMySQL.php 536 2007-01-10 14:30:38Z heltem $
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the LGPL. For more information please see
|
||||
* <http://propel.phpdb.org>.
|
||||
*/
|
||||
|
||||
require_once 'propel/adapter/DBAdapter.php';
|
||||
|
||||
/**
|
||||
* This is used in order to connect to a MySQL database.
|
||||
*
|
||||
* @author Hans Lellelid <hans@xmpl.org> (Propel)
|
||||
* @author Jon S. Stevens <jon@clearink.com> (Torque)
|
||||
* @author Brett McLaughlin <bmclaugh@algx.net> (Torque)
|
||||
* @author Daniel Rall <dlr@finemaltcoding.com> (Torque)
|
||||
* @version $Revision: 536 $
|
||||
* @package propel.adapter
|
||||
*/
|
||||
class DBMySQL extends DBAdapter {
|
||||
|
||||
/**
|
||||
* This method is used to ignore case.
|
||||
*
|
||||
* @param in The string to transform to upper case.
|
||||
* @return The upper case string.
|
||||
*/
|
||||
public function toUpperCase($in)
|
||||
{
|
||||
return "UPPER(" . $in . ")";
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to ignore case.
|
||||
*
|
||||
* @param in The string whose case to ignore.
|
||||
* @return The string in a case that can be ignored.
|
||||
*/
|
||||
public function ignoreCase($in)
|
||||
{
|
||||
return "UPPER(" . $in . ")";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns SQL which concatenates the second string to the first.
|
||||
*
|
||||
* @param string String to concatenate.
|
||||
* @param string String to append.
|
||||
* @return string
|
||||
*/
|
||||
public function concatString($s1, $s2)
|
||||
{
|
||||
return "CONCAT($s1, $s2)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns SQL which extracts a substring.
|
||||
*
|
||||
* @param string String to extract from.
|
||||
* @param int Offset to start from.
|
||||
* @param int Number of characters to extract.
|
||||
* @return string
|
||||
*/
|
||||
public function subString($s, $pos, $len)
|
||||
{
|
||||
return "SUBSTRING($s, $pos, $len)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns SQL which calculates the length (in chars) of a string.
|
||||
*
|
||||
* @param string String to calculate length of.
|
||||
* @return string
|
||||
*/
|
||||
public function strLength($s)
|
||||
{
|
||||
return "CHAR_LENGTH($s)";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Locks the specified table.
|
||||
*
|
||||
* @param Connection $con The Creole connection to use.
|
||||
* @param string $table The name of the table to lock.
|
||||
* @throws SQLException No Statement could be created or
|
||||
* executed.
|
||||
*/
|
||||
public function lockTable(Connection $con, $table)
|
||||
{
|
||||
$statement = $con->createStatement();
|
||||
$sql = "LOCK TABLE " . $table . " WRITE";
|
||||
$statement->executeUpdate($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlocks the specified table.
|
||||
*
|
||||
* @param Connection $con The Creole connection to use.
|
||||
* @param string $table The name of the table to unlock.
|
||||
* @throws SQLException No Statement could be created or
|
||||
* executed.
|
||||
*/
|
||||
public function unlockTable(Connection $con, $table)
|
||||
{
|
||||
$statement = $con->createStatement();
|
||||
$statement->executeUpdate("UNLOCK TABLES");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DBAdapter::quoteIdentifier()
|
||||
*/
|
||||
public function quoteIdentifier($text)
|
||||
{
|
||||
return '`' . $text . '`';
|
||||
}
|
||||
|
||||
}
|
34
lib/symfony/vendor/propel/adapter/DBMySQLi.php
vendored
Executable file
34
lib/symfony/vendor/propel/adapter/DBMySQLi.php
vendored
Executable file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* $Id: DBMySQLi.php 3750 2007-04-11 08:39:43Z fabien $
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the LGPL. For more information please see
|
||||
* <http://propel.phpdb.org>.
|
||||
*/
|
||||
|
||||
require_once 'propel/adapter/DBMySQL.php';
|
||||
|
||||
/**
|
||||
* This is used in order to connect to a MySQL database using the new mysqli API.
|
||||
*
|
||||
* @author Hans Lellelid <hans@xmpl.org> (Propel)
|
||||
* @version $Revision: 536 $
|
||||
* @package propel.adapter
|
||||
*/
|
||||
class DBMySQLi extends DBMySQL {
|
||||
|
||||
}
|
131
lib/symfony/vendor/propel/adapter/DBNone.php
vendored
Executable file
131
lib/symfony/vendor/propel/adapter/DBNone.php
vendored
Executable file
@ -0,0 +1,131 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* $Id: DBNone.php 536 2007-01-10 14:30:38Z heltem $
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the LGPL. For more information please see
|
||||
* <http://propel.phpdb.org>.
|
||||
*/
|
||||
|
||||
require_once 'propel/adapter/DBAdapter.php';
|
||||
|
||||
/**
|
||||
* This DatabaseHandler is used when you do not have a database
|
||||
* installed.
|
||||
*
|
||||
* @author Hans Lellelid <hans@xmpl.org> (Propel)
|
||||
* @author Jon S. Stevens <jon@clearink.com> (Torque)
|
||||
* @author Brett McLaughlin <bmclaugh@algx.net> (Torque)
|
||||
* @version $Revision: 536 $
|
||||
* @package propel.adapter
|
||||
*/
|
||||
class DBNone extends DBAdapter {
|
||||
|
||||
/**
|
||||
* @return null
|
||||
*/
|
||||
public function getConnection()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DBAdapter::init()
|
||||
*/
|
||||
public function init($url, $username, $password)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to ignore case.
|
||||
*
|
||||
* @param in The string to transform to upper case.
|
||||
* @return The upper case string.
|
||||
*/
|
||||
public function toUpperCase($in)
|
||||
{
|
||||
return $in;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to ignore case.
|
||||
*
|
||||
* @param in The string whose case to ignore.
|
||||
* @return The string in a case that can be ignored.
|
||||
*/
|
||||
public function ignoreCase($in)
|
||||
{
|
||||
return $in;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns SQL which concatenates the second string to the first.
|
||||
*
|
||||
* @param string String to concatenate.
|
||||
* @param string String to append.
|
||||
* @return string
|
||||
*/
|
||||
public function concatString($s1, $s2)
|
||||
{
|
||||
return ($s1 . $s2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns SQL which extracts a substring.
|
||||
*
|
||||
* @param string String to extract from.
|
||||
* @param int Offset to start from.
|
||||
* @param int Number of characters to extract.
|
||||
* @return string
|
||||
*/
|
||||
public function subString($s, $pos, $len)
|
||||
{
|
||||
return substr($s, $pos, $len);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns SQL which calculates the length (in chars) of a string.
|
||||
*
|
||||
* @param string String to calculate length of.
|
||||
* @return string
|
||||
*/
|
||||
public function strLength($s)
|
||||
{
|
||||
return strlen($s);
|
||||
}
|
||||
|
||||
/**
|
||||
* Locks the specified table.
|
||||
*
|
||||
* @param Connection $con The Creole connection to use.
|
||||
* @param string $table The name of the table to lock.
|
||||
* @throws SQLException No Statement could be created or executed.
|
||||
*/
|
||||
public function lockTable(Connection $con, $table)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlocks the specified table.
|
||||
*
|
||||
* @param Connection $con The Creole connection to use.
|
||||
* @param string $table The name of the table to unlock.
|
||||
* @throws SQLException No Statement could be created or executed.
|
||||
*/
|
||||
public function unlockTable(Connection $con, $table)
|
||||
{
|
||||
}
|
||||
}
|
123
lib/symfony/vendor/propel/adapter/DBOracle.php
vendored
Executable file
123
lib/symfony/vendor/propel/adapter/DBOracle.php
vendored
Executable file
@ -0,0 +1,123 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* $Id: DBOracle.php 536 2007-01-10 14:30:38Z heltem $
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the LGPL. For more information please see
|
||||
* <http://propel.phpdb.org>.
|
||||
*/
|
||||
|
||||
require_once 'propel/adapter/DBAdapter.php';
|
||||
|
||||
/**
|
||||
* Oracle adapter.
|
||||
*
|
||||
* @author David Giffin <david@giffin.org> (Propel)
|
||||
* @author Hans Lellelid <hans@xmpl.org> (Propel)
|
||||
* @author Jon S. Stevens <jon@clearink.com> (Torque)
|
||||
* @author Brett McLaughlin <bmclaugh@algx.net> (Torque)
|
||||
* @author Bill Schneider <bschneider@vecna.com> (Torque)
|
||||
* @author Daniel Rall <dlr@finemaltcoding.com> (Torque)
|
||||
* @version $Revision: 536 $
|
||||
* @package propel.adapter
|
||||
*/
|
||||
class DBOracle extends DBAdapter {
|
||||
|
||||
/**
|
||||
* This method is used to ignore case.
|
||||
*
|
||||
* @param string $in The string to transform to upper case.
|
||||
* @return string The upper case string.
|
||||
*/
|
||||
public function toUpperCase($in)
|
||||
{
|
||||
return "UPPER(" . $in . ")";
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to ignore case.
|
||||
*
|
||||
* @param string $in The string whose case to ignore.
|
||||
* @return string The string in a case that can be ignored.
|
||||
*/
|
||||
public function ignoreCase($in)
|
||||
{
|
||||
return "UPPER(" . $in . ")";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns SQL which concatenates the second string to the first.
|
||||
*
|
||||
* @param string String to concatenate.
|
||||
* @param string String to append.
|
||||
* @return string
|
||||
*/
|
||||
public function concatString($s1, $s2)
|
||||
{
|
||||
return "CONCAT($s1, $s2)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns SQL which extracts a substring.
|
||||
*
|
||||
* @param string String to extract from.
|
||||
* @param int Offset to start from.
|
||||
* @param int Number of characters to extract.
|
||||
* @return string
|
||||
*/
|
||||
public function subString($s, $pos, $len)
|
||||
{
|
||||
return "SUBSTR($s, $pos, $len)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns SQL which calculates the length (in chars) of a string.
|
||||
*
|
||||
* @param string String to calculate length of.
|
||||
* @return string
|
||||
*/
|
||||
public function strLength($s)
|
||||
{
|
||||
return "LENGTH($s)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Locks the specified table.
|
||||
*
|
||||
* @param Connection $con The Creole connection to use.
|
||||
* @param string $table The name of the table to lock.
|
||||
* @throws SQLException No Statement could be created or executed.
|
||||
*/
|
||||
public function lockTable(Connection $con, $table)
|
||||
{
|
||||
$statement = $con->createStatement();
|
||||
$statement->executeQuery("SELECT next_id FROM " . $table ." FOR UPDATE");
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlocks the specified table.
|
||||
*
|
||||
* @param Connection $con The Creole connection to use.
|
||||
* @param string $table The name of the table to unlock.
|
||||
* @throws SQLException - No Statement could be created or executed.
|
||||
*/
|
||||
public function unlockTable(Connection $con, $table)
|
||||
{
|
||||
// Tables in Oracle are unlocked when a commit is issued. The
|
||||
// user may have issued a commit but do it here to be sure.
|
||||
$con->commit();
|
||||
}
|
||||
}
|
117
lib/symfony/vendor/propel/adapter/DBPostgres.php
vendored
Executable file
117
lib/symfony/vendor/propel/adapter/DBPostgres.php
vendored
Executable file
@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* $Id: DBPostgres.php 536 2007-01-10 14:30:38Z heltem $
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the LGPL. For more information please see
|
||||
* <http://propel.phpdb.org>.
|
||||
*/
|
||||
|
||||
require_once 'propel/adapter/DBAdapter.php';
|
||||
|
||||
/**
|
||||
* This is used to connect to PostgresQL databases.
|
||||
*
|
||||
* <a href="http://www.pgsql.org">http://www.pgsql.org</a>
|
||||
*
|
||||
* @author Hans Lellelid <hans@xmpl.org> (Propel)
|
||||
* @author Hakan Tandogan <hakan42@gmx.de> (Torque)
|
||||
* @version $Revision: 536 $
|
||||
* @package propel.adapter
|
||||
*/
|
||||
class DBPostgres extends DBAdapter {
|
||||
|
||||
/**
|
||||
* This method is used to ignore case.
|
||||
*
|
||||
* @param string $in The string to transform to upper case.
|
||||
* @return string The upper case string.
|
||||
*/
|
||||
public function toUpperCase($in)
|
||||
{
|
||||
return "UPPER(" . $in . ")";
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to ignore case.
|
||||
*
|
||||
* @param in The string whose case to ignore.
|
||||
* @return The string in a case that can be ignored.
|
||||
*/
|
||||
public function ignoreCase($in)
|
||||
{
|
||||
return "UPPER(" . $in . ")";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns SQL which concatenates the second string to the first.
|
||||
*
|
||||
* @param string String to concatenate.
|
||||
* @param string String to append.
|
||||
* @return string
|
||||
*/
|
||||
public function concatString($s1, $s2)
|
||||
{
|
||||
return "($s1 || $s2)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns SQL which extracts a substring.
|
||||
*
|
||||
* @param string String to extract from.
|
||||
* @param int Offset to start from.
|
||||
* @param int Number of characters to extract.
|
||||
* @return string
|
||||
*/
|
||||
public function subString($s, $pos, $len)
|
||||
{
|
||||
return "substring($s from $pos" . ($len > -1 ? "for $len" : "") . ")";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns SQL which calculates the length (in chars) of a string.
|
||||
*
|
||||
* @param string String to calculate length of.
|
||||
* @return string
|
||||
*/
|
||||
public function strLength($s)
|
||||
{
|
||||
return "char_length($s)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Locks the specified table.
|
||||
*
|
||||
* @param Connection $con The Creole connection to use.
|
||||
* @param string $table The name of the table to lock.
|
||||
* @exception SQLException No Statement could be created or executed.
|
||||
*/
|
||||
public function lockTable(Connection $con, $table)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlocks the specified table.
|
||||
*
|
||||
* @param Connection $con The Creole connection to use.
|
||||
* @param string $table The name of the table to unlock.
|
||||
* @exception SQLException No Statement could be created or executed.
|
||||
*/
|
||||
public function unlockTable(Connection $con, $table)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
124
lib/symfony/vendor/propel/adapter/DBSQLite.php
vendored
Executable file
124
lib/symfony/vendor/propel/adapter/DBSQLite.php
vendored
Executable file
@ -0,0 +1,124 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* $Id: DBSQLite.php 536 2007-01-10 14:30:38Z heltem $
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the LGPL. For more information please see
|
||||
* <http://propel.phpdb.org>.
|
||||
*/
|
||||
|
||||
require_once 'propel/adapter/DBAdapter.php';
|
||||
|
||||
/**
|
||||
* This is used in order to connect to a SQLite database.
|
||||
*
|
||||
* @author Hans Lellelid <hans@xmpl.org>
|
||||
* @version $Revision: 536 $
|
||||
* @package propel.adapter
|
||||
*/
|
||||
class DBSQLite extends DBAdapter {
|
||||
|
||||
/**
|
||||
* This method is used to ignore case.
|
||||
*
|
||||
* @param in The string to transform to upper case.
|
||||
* @return The upper case string.
|
||||
*/
|
||||
public function toUpperCase($in)
|
||||
{
|
||||
return 'UPPER(' . $in . ')';
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to ignore case.
|
||||
*
|
||||
* @param in The string whose case to ignore.
|
||||
* @return The string in a case that can be ignored.
|
||||
*/
|
||||
public function ignoreCase($in)
|
||||
{
|
||||
return 'UPPER(' . $in . ')';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns SQL which concatenates the second string to the first.
|
||||
*
|
||||
* @param string String to concatenate.
|
||||
* @param string String to append.
|
||||
* @return string
|
||||
*/
|
||||
public function concatString($s1, $s2)
|
||||
{
|
||||
return "($s1 || $s2)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns SQL which extracts a substring.
|
||||
*
|
||||
* @param string String to extract from.
|
||||
* @param int Offset to start from.
|
||||
* @param int Number of characters to extract.
|
||||
* @return string
|
||||
*/
|
||||
public function subString($s, $pos, $len)
|
||||
{
|
||||
return "substr($s, $pos, $len)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns SQL which calculates the length (in chars) of a string.
|
||||
*
|
||||
* @param string String to calculate length of.
|
||||
* @return string
|
||||
*/
|
||||
public function strLength($s)
|
||||
{
|
||||
return "length($s)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Locks the specified table.
|
||||
*
|
||||
* @param Connection $con The Creole connection to use.
|
||||
* @param string $table The name of the table to lock.
|
||||
* @throws SQLException No Statement could be created or
|
||||
* executed.
|
||||
*/
|
||||
public function lockTable(Connection $con, $table)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlocks the specified table.
|
||||
*
|
||||
* @param Connection $con The Creole connection to use.
|
||||
* @param string $table The name of the table to unlock.
|
||||
* @throws SQLException No Statement could be created or
|
||||
* executed.
|
||||
*/
|
||||
public function unlockTable(Connection $con, $table)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DBAdapter::quoteIdentifier()
|
||||
*/
|
||||
public function quoteIdentifier($text)
|
||||
{
|
||||
return '[' . $text . ']';
|
||||
}
|
||||
|
||||
}
|
133
lib/symfony/vendor/propel/adapter/DBSybase.php
vendored
Executable file
133
lib/symfony/vendor/propel/adapter/DBSybase.php
vendored
Executable file
@ -0,0 +1,133 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* $Id: DBSybase.php 536 2007-01-10 14:30:38Z heltem $
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the LGPL. For more information please see
|
||||
* <http://propel.phpdb.org>.
|
||||
*/
|
||||
|
||||
require_once 'propel/adapter/DBAdapter.php';
|
||||
|
||||
/**
|
||||
* This is used to connect to a Sybase database using Sybase's
|
||||
* Creole driver.
|
||||
*
|
||||
* <B>NOTE:</B><I>Currently JConnect does not implement the required
|
||||
* methods for ResultSetMetaData, and therefore the village API's may
|
||||
* not function. For connection pooling, everything works.</I>
|
||||
*
|
||||
* @author Hans Lellelid <hans@xmpl.org> (Propel)
|
||||
* @author Jeff Brekke <ekkerbj@netscape.net> (Torque)
|
||||
* @version $Revision: 536 $
|
||||
* @package propel.adapter
|
||||
*/
|
||||
class DBSybase extends DBAdapter {
|
||||
|
||||
/**
|
||||
* This method is used to ignore case.
|
||||
*
|
||||
* @param in The string to transform to upper case.
|
||||
* @return The upper case string.
|
||||
*/
|
||||
public function toUpperCase($in)
|
||||
{
|
||||
return "UPPER(" . $in . ")";
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to ignore case.
|
||||
*
|
||||
* @param in The string whose case to ignore.
|
||||
* @return The string in a case that can be ignored.
|
||||
*/
|
||||
public function ignoreCase($in)
|
||||
{
|
||||
return "UPPER(" . $in . ")";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns SQL which concatenates the second string to the first.
|
||||
*
|
||||
* @param string String to concatenate.
|
||||
* @param string String to append.
|
||||
* @return string
|
||||
*/
|
||||
public function concatString($s1, $s2)
|
||||
{
|
||||
return "($s1 + $s2)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns SQL which extracts a substring.
|
||||
*
|
||||
* @param string String to extract from.
|
||||
* @param int Offset to start from.
|
||||
* @param int Number of characters to extract.
|
||||
* @return string
|
||||
*/
|
||||
public function subString($s, $pos, $len)
|
||||
{
|
||||
return "SUBSTRING($s, $pos, $len)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns SQL which calculates the length (in chars) of a string.
|
||||
*
|
||||
* @param string String to calculate length of.
|
||||
* @return string
|
||||
*/
|
||||
public function strLength($s)
|
||||
{
|
||||
return "LEN($s)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Locks the specified table.
|
||||
*
|
||||
* @param Connection $con The Creole connection to use.
|
||||
* @param string $table The name of the table to lock.
|
||||
* @throws SQLException No Statement could be created or executed.
|
||||
*/
|
||||
public function lockTable(Connection $con, $table)
|
||||
{
|
||||
$statement = $con->createStatement();
|
||||
$sql = "SELECT next_id FROM " . $table . " FOR UPDATE";
|
||||
$statement->executeQuery($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlocks the specified table.
|
||||
*
|
||||
* @param Connection $con The Creole connection to use.
|
||||
* @param string $table The name of the table to unlock.
|
||||
* @throws SQLException No Statement could be created or executed.
|
||||
*/
|
||||
public function unlockTable(Connection $con, $table)
|
||||
{
|
||||
// Tables in Sybase are unlocked when a commit is issued. The
|
||||
// user may have issued a commit but do it here to be sure.
|
||||
$con->commit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DBAdapter::quoteIdentifier()
|
||||
*/
|
||||
public function quoteIdentifier($text)
|
||||
{
|
||||
return '[' . $text . ']';
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user