Get row dimension at a specific row

@param int $pRow Numeric index of the row
@return PHPExcel_Worksheet_RowDimension
339058
public function getRowDimension($pRow = 1, $create = TRUE)
    {
        // Found
        $found = null;

        // Get row dimension
        if (!isset($this->_rowDimensions[$pRow])) {
			if (!$create)
				return NULL;
            $this->_rowDimensions[$pRow] = new PHPExcel_Worksheet_RowDimension($pRow);

            $this->_cachedHighestRow = max($this->_cachedHighestRow,$pRow);
        }
        return $this->_rowDimensions[$pRow];
    }
1047282
public function getSizesInfos()
    {
        if ($this->column_size===0 && $this->line_size===0 && $this->cell_size===0) {
            $this->_parseTableSizes();
        }
        return sprintf(self::$default_foot_mask, $this->getColumnSize(), $this->getLineSize(), $this->getCellSize());
    }
884104
public function getDimension($w, $h) {
        $labels = $this->getBiggestLabels(false);
        $pixelsAround = array(0, 0, 0, 0); // TRBL
        if (isset($labels[CINLabel::POSITION_TOP])) {
            $dimension = $labels[CINLabel::POSITION_TOP]->getDimension();
            $pixelsAround[0] += $dimension[1];
        }

        if (isset($labels[CINLabel::POSITION_RIGHT])) {
            $dimension = $labels[CINLabel::POSITION_RIGHT]->getDimension();
            $pixelsAround[1] += $dimension[0];
        }

        if (isset($labels[CINLabel::POSITION_BOTTOM])) {
            $dimension = $labels[CINLabel::POSITION_BOTTOM]->getDimension();
            $pixelsAround[2] += $dimension[1];
        }

        if (isset($labels[CINLabel::POSITION_LEFT])) {
            $dimension = $labels[CINLabel::POSITION_LEFT]->getDimension();
            $pixelsAround[3] += $dimension[0];
        }

        $finalW = ($w + $this->offsetX) * $this->scale;
        $finalH = ($h + $this->offsetY) * $this->scale;

        // This section will check if a top/bottom label is too big for its width and left/right too big for its height
        $reversedLabels = $this->getBiggestLabels(true);
        foreach ($reversedLabels as $label) {
            $dimension = $label->getDimension();
            $alignment = $label->getAlignment();
            if ($label->getPosition() === CINLabel::POSITION_LEFT || $label->getPosition() === CINLabel::POSITION_RIGHT) {
                if ($alignment === CINLabel::ALIGN_TOP) {
                    $pixelsAround[2] = max($pixelsAround[2], $dimension[1] - $finalH);
                } elseif ($alignment === CINLabel::ALIGN_CENTER) {
                    $temp = ceil(($dimension[1] - $finalH) / 2);
                    $pixelsAround[0] = max($pixelsAround[0], $temp);
                    $pixelsAround[2] = max($pixelsAround[2], $temp);
                } elseif ($alignment === CINLabel::ALIGN_BOTTOM) {
                    $pixelsAround[0] = max($pixelsAround[0], $dimension[1] - $finalH);
                }
            } else {
                if ($alignment === CINLabel::ALIGN_LEFT) {
                    $pixelsAround[1] = max($pixelsAround[1], $dimension[0] - $finalW);
                } elseif ($alignment === CINLabel::ALIGN_CENTER) {
                    $temp = ceil(($dimension[0] - $finalW) / 2);
                    $pixelsAround[1] = max($pixelsAround[1], $temp);
                    $pixelsAround[3] = max($pixelsAround[3], $temp);
                } elseif ($alignment === CINLabel::ALIGN_RIGHT) {
                    $pixelsAround[3] = max($pixelsAround[3], $dimension[0] - $finalW);
                }
            }
        }

        $this->pushLabel[0] = $pixelsAround[3];
        $this->pushLabel[1] = $pixelsAround[0];

        $finalW = ($w + $this->offsetX) * $this->scale + $pixelsAround[1] + $pixelsAround[3];
        $finalH = ($h + $this->offsetY) * $this->scale + $pixelsAround[0] + $pixelsAround[2];

        return array($finalW, $finalH);
    }
394046
private function getColumns()
    {
        $dimensions = $this->getApplication()->getTerminalDimensions();
        if (is_array($dimensions) && count($dimensions) > self::DIMENSION_WIDTH) {
            return $dimensions[self::DIMENSION_WIDTH];
        } else {
            return self::DEFAULT_WIDTH;
        }
    }
844215
public function refreshRowDimensions()
    {
        $currentRowDimensions = $this->getRowDimensions();
        $newRowDimensions = array();

        foreach ($currentRowDimensions as $objRowDimension) {
            $newRowDimensions[$objRowDimension->getRowIndex()] = $objRowDimension;
        }

        $this->_rowDimensions = $newRowDimensions;

        return $this;
    }
674126
public function getRowAt($row_num)
    {
        if ($this->seek($row_num)) {
            $this->next();

            return $this->getCurrentRow();
        } else {
            return null;
        }
    }
827521
protected function getWidth()
    {
        $first_row = reset($this->data);
        $first_row = $this->buildRow($first_row);

        return $this->lengthWithoutTags($first_row);
    }
1043081
protected function calculateRowHeight($row)
    {
        $rowsPerCell = array_map(function ($size, $columnWidth) {
            if (is_array($columnWidth)) {
                $rows = 0;
                foreach ($columnWidth as $width) {
                    $rows += ceil($width / ($size - 2));
                }

                return $rows;
            }

            return ceil($columnWidth / ($size - 2));
        }, $this->_columnWidths, array_map(function ($val) {
            if (is_array($val)) {
                $encodings = array_fill(0, count($val), $this->app->encoding);
                return array_map('mb_strwidth', $val, $encodings);
            }

            return mb_strwidth($val, $this->app->encoding);
        }, $row)
        );

        return max($rowsPerCell);
    }
1354411
public function getColumnDimension($pColumn = 'A', $create = true)
    {
        // Uppercase coordinate
        $pColumn = strtoupper($pColumn);

        // Fetch dimensions
        if (!isset($this->columnDimensions[$pColumn])) {
            if (!$create) {
                return null;
            }
            $this->columnDimensions[$pColumn] = new PHPExcel_Worksheet_ColumnDimension($pColumn);

            if (PHPExcel_Cell::columnIndexFromString($this->cachedHighestColumn) < PHPExcel_Cell::columnIndexFromString($pColumn)) {
                $this->cachedHighestColumn = $pColumn;
            }
        }
        return $this->columnDimensions[$pColumn];
    }
115355
static public function getSize( $force = FALSE ){
/*		preg_match_all("/rows.([0-9]+);.columns.([0-9]+);/", strtolower(exec('stty -a |grep columns')), $output);
		if(sizeof($output) == 3) {
			self::$width	= $output[2][0];
			self::$height	= $output[1][0];
		}*/
		return (object) array(
			'colors'	=> self::getColors(),
			'height'	=> self::getHeight(),
			'width'		=> self::getWidth(),
		);
	}
1304416
public function numRows() {
        if ($this->numRows === null) {
            if ($this->hResult) $this->numRows = pg_num_rows($this->hResult);
            else                $this->numRows = 0;
        }
        return $this->numRows;
    }
96187
public function getWidth() {
        $width = getenv('COLUMNS');
        if (false !== $width) {
            return (int)trim($width);
        }

        $dimensions = $this->getDimensions();

        return $dimensions[0] ?: 80;
    }
560752
public function getColumnFromRow($row, Table $table)
    {
        $name = $row['Field'];
        $is_nullable = ($row['Null'] == 'YES');
        $autoincrement = (strpos($row['Extra'], 'auto_increment') !== false);
        $size = null;
        $precision = null;
        $scale = null;
        $sqlType = false;
        $desc = $row['Comment'];

        $regexp = '/^
            (\w+)        # column type [1]
            [\(]         # (
                ?([\d,]*)  # size or size, precision [2]
            [\)]         # )
            ?\s*         # whitespace
            (\w*)        # extra description (UNSIGNED, CHARACTER SET, ...) [3]
        $/x';
        if (preg_match($regexp, $row['Type'], $matches)) {
            $nativeType = $matches[1];
            if ($matches[2]) {
                if (($cpos = strpos($matches[2], ',')) !== false) {
                    $size = (int) substr($matches[2], 0, $cpos);
                    $precision = $size;
                    $scale = (int) substr($matches[2], $cpos + 1);
                } else {
                    $size = (int) $matches[2];
                }
            }
            if ($matches[3]) {
                $sqlType = $row['Type'];
            }
            foreach (self::$defaultTypeSizes as $type => $defaultSize) {
                if ($nativeType == $type && $size == $defaultSize && $scale === null) {
                    $size = null;
                    continue;
                }
            }
        } elseif (preg_match('/^(\w+)\(/', $row['Type'], $matches)) {
            $nativeType = $matches[1];
            if ($nativeType == 'enum') {
                $sqlType = $row['Type'];
            }
        } else {
            $nativeType = $row['Type'];
        }

        //BLOBs can't have any default values in MySQL
        $default = preg_match('~blob|text~', $nativeType) ? null : $row['Default'];

        $propelType = $this->getMappedPropelType($nativeType);
        if (!$propelType) {
            $propelType = Column::DEFAULT_TYPE;
            $sqlType = $row['Type'];
            $this->warn("Column [" . $table->getName() . "." . $name . "] has a column type (" . $nativeType . ") that Propel does not support.");
        }

        // Special case for TINYINT(1) which is a BOOLEAN
        if (PropelTypes::TINYINT === $propelType && 1 === $size) {
            $propelType = PropelTypes::BOOLEAN;
        }

        $column = new Column($name);
        $column->setTable($table);
        $column->setDomainForType($propelType);
        if ($sqlType) {
            $column->getDomain()->replaceSqlType($sqlType);
        }
        $column->getDomain()->replaceSize($size);
        $column->getDomain()->replaceScale($scale);
        if ($default !== null) {
            if ($propelType == PropelTypes::BOOLEAN) {
                if ($default == '1') {
                    $default = 'true';
                }
                if ($default == '0') {
                    $default = 'false';
                }
            }
            if (in_array($default, array('CURRENT_TIMESTAMP'))) {
                $type = ColumnDefaultValue::TYPE_EXPR;
            } else {
                $type = ColumnDefaultValue::TYPE_VALUE;
            }
            $column->getDomain()->setDefaultValue(new ColumnDefaultValue($default, $type));
        }
        $column->setAutoIncrement($autoincrement);
        $column->setNotNull(!$is_nullable);

        if ($this->addVendorInfo) {
            $vi = $this->getNewVendorInfoObject($row);
            $column->addVendorInfo($vi);
        }

        if ($desc){
            if(!$this->isUtf8($desc))
                $desc = utf8_encode($desc);
            $column->setDescription($desc);
        }

        return $column;
    }
726795
public function getSize()
    {
        $filePath = $this->getPathname();
        $size = -1;
        $isWin = (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN');
        $execWorks = (function_exists('exec') && !ini_get('safe_mode') && exec('echo EXEC') == 'EXEC');
        if ($isWin) {
            if ($execWorks) {
                $cmd = "for %F in (\"$filePath\") do @echo %~zF";
                exec($cmd, $output);
                if (is_array($output)) {
                    $result = trim(implode("\n", $output));
                    if (ctype_digit($result)) {
                        $size = $result;
                    }
                }
            }
            // try the Windows COM interface if its fails
            if (class_exists('COM') && $size > -1) {
                $fsobj = new \COM('Scripting.FileSystemObject');
                $file = $fsobj->GetFile($filePath);
                $result = $file->Size;
                if (ctype_digit($result)) {
                    $size = $result;
                }
            }
        } else {
            $result = trim("stat -c%s $filePath");
            if (ctype_digit($result)) {
                $size = $result;
            }
        }
        if ($size < 0) {
            $size = filesize($filePath);
        }
        return $size;
    }
169534
public function getCellByColumnAndRow($pColumn = 0, $pRow = 1)
    {
        $columnLetter = PHPExcel_Cell::stringFromColumnIndex($pColumn);
        $coordinate = $columnLetter . $pRow;

        if ($this->_cellCollection->isDataSet($coordinate)) {
            return $this->_cellCollection->getCacheData($coordinate);
        }

		return $this->_createNewCell($coordinate);
    }
646567
public function getProsize(Int $width = 0, Int $height = 0)
    {
        if( ! isset($this->sets['filePath']) )
        {
            return false;
        }

        return $this->image->getProsize($this->sets['filePath'], $width, $height);
    }
270836
public function getDimensions($dim = "string") {
        if(!$this->getField('Filename')) {
            return null;
        }

        $imageDimensions = $this->getDimensionsFromDB($dim);
        if ($imageDimensions !== null) {
            return $imageDimensions;
        }

        // Download file from S3/CDN if we do not have dimensions stored in the DB
        $pointer = $this->obj('CDNFile');
        if($this->ID && $pointer->exists()) {
            $this->ensureLocalFile();
        }

        if (!$this->localFileExists()) {
            return null;
        }

        // Store in 'ImageDim' field and write if they've changed.
        $this->storeDimensions();
        if ($this->isChanged('ImageDim', \DataObject::CHANGE_VALUE)) {
            $this->write();
        }
        // Load dimensions
        return $this->getDimensionsFromDB($dim);
    }