/usr/share/php/Horde/Db/Adapter/Oracle/Column.php is in php-horde-db 2.3.4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | <?php
/**
* Copyright 2013-2016 Horde LLC (http://www.horde.org/)
*
* @author Jan Schneider <jan@horde.org>
* @license http://www.horde.org/licenses/bsd
* @category Horde
* @package Db
* @subpackage Adapter
*/
/**
* @since Horde_Db 2.1.0
* @author Jan Schneider <jan@horde.org>
* @license http://www.horde.org/licenses/bsd
* @category Horde
* @package Db
* @subpackage Adapter
*/
class Horde_Db_Adapter_Oracle_Column extends Horde_Db_Adapter_Base_Column
{
/*##########################################################################
# Construct/Destruct
##########################################################################*/
/**
* Constructor.
*
* @param string $name Column name, such as "supplier_id" in
* "supplier_id int(11)".
* @param string $default Type-casted default value, such as "new"
* in "sales_stage varchar(20) default 'new'".
* @param string $sqlType Column type.
* @param boolean $null Whether this column allows NULL values.
* @param integer $length Column width.
* @param integer $precision Precision for NUMBER and FLOAT columns.
* @param integer $scale Number of digits to the right of the decimal
* point in a number.
*/
public function __construct($name, $default, $sqlType = null, $null = true,
$length = null, $precision = null,
$scale = null)
{
$this->_name = $name;
$this->_sqlType = Horde_String::lower($sqlType);
$this->_null = $null;
$this->_limit = $length;
$this->_precision = $precision;
$this->_scale = $scale;
$this->_setSimplifiedType();
$this->_isText = $this->_type == 'text' || $this->_type == 'string';
$this->_isNumber = $this->_type == 'float' || $this->_type == 'integer' || $this->_type == 'decimal';
$this->_default = $this->typeCast($default);
}
/*##########################################################################
# Type Juggling
##########################################################################*/
/**
* Used to convert from BLOBs to Strings
*
* @return string
*/
public function binaryToString($value)
{
if (is_a($value, 'OCI-Lob')) {
return $value->load();
}
return parent::binaryToString($value);
}
/*##########################################################################
# Protected
##########################################################################*/
/**
*/
protected function _setSimplifiedType()
{
if (Horde_String::lower($this->_sqlType) == 'number' &&
$this->_precision == 1) {
$this->_type = 'boolean';
return;
}
parent::_setSimplifiedType();
}
}
|