Get the current maximum allowed size for a value

@return int
@throws common_Exception If size is set
331824
protected function getSize()
    {
        if (! $this->size) {
            $size = $this->getParam(self::MAX_VALUE_SIZE);
            if ($size !== false) {
                if (!is_int($size)) {
                    throw new common_Exception('Persistence max value size has to be an integer');
                }
                $this->size = $size - strlen($this->getMapIdentifier());
            }
        }
        return $this->size;
    }
660741
public function getLimit() {
        if (false !== strpos($this->limit, ','))
            return $this->limit; // both offset and limit are in the limit attribute;
        return $this->limit ? $this->limit . ' OFFSET ' . $this->offset : '';
    }
720599
public function max()
    {
        if (!isset($this->meta['max'])) {
            $this->meta['max'] = (int) @max($this->get());
        }

        return $this->meta['max'];
    }
858176
public function getUsedLength(): int
    {
        $maxLength = 0;

        /** @var PackedItem $item */
        foreach ($this->items as $item) {
            $maxLength = max($maxLength, $item->getY() + $item->getLength());
        }

        return $maxLength;
    }
229117
public function getAllowedMaxFileSize($ext = null)
    {

        // Check if there is any defined instance max file sizes
        if (empty($this->allowedMaxFileSize)) {
            // Set default max file sizes if there isn't
            $fileSize = Config::inst()->get(__CLASS__, 'default_max_file_size');
            if ($fileSize) {
                $this->setAllowedMaxFileSize($fileSize);
            } else {
                // When no default is present, use maximum set by PHP
                $maxUpload = File::ini2bytes(ini_get('upload_max_filesize'));
                $maxPost = File::ini2bytes(ini_get('post_max_size'));
                $this->setAllowedMaxFileSize(min($maxUpload, $maxPost));
            }
        }

        if ($ext !== null) {
            $ext = strtolower($ext);
            if (isset($this->allowedMaxFileSize[$ext])) {
                return $this->allowedMaxFileSize[$ext];
            }

            $category = File::get_app_category($ext);
            if ($category && isset($this->allowedMaxFileSize['[' . $category . ']'])) {
                return $this->allowedMaxFileSize['[' . $category . ']'];
            }
        }

        return (isset($this->allowedMaxFileSize['*'])) ? $this->allowedMaxFileSize['*'] : false;
    }
1296886
public static function getMaxUploadSize($max_size = 0): int
    {
        $post_max_size = FormatHelper::convertBytes(ini_get('post_max_size'));
        $upload_max_fileSize = FormatHelper::convertBytes(ini_get('upload_max_filesize'));

        if ($max_size > 0) {
            $result = min($post_max_size, $upload_max_fileSize, $max_size);
        } else {
            $result = min($post_max_size, $upload_max_fileSize);
        }

        return $result;
    }
824540
public function getMaxValue()
    {
        if (!$this->isNumeric()) {
            return null;
        }
        $dataType = $this->getEloquentDataMethod();
		$max = 2147483647;

        if ($this->isDecimal()) {
            $length = $this->getMethodParam(0) ?: 1;
            $declimal = $this->getMethodParam(1) ?: 0;
            $max = str_repeat('9', $length);

            if ($declimal > 0) {
                $max = substr_replace($max, '.', $declimal * -1, 0);
            }
            $max = floatval($max);
        } elseif ($dataType == 'integer' || $dataType == 'increments') {
            $max = $this->isUnsigned ? 4294967295 : 2147483647;
        } elseif ($dataType == 'mediumInteger' || $dataType == 'mediumIncrements') {
            $max = $this->isUnsigned ? 16777215 : 8388607;
        } elseif ($dataType == 'smallInteger' || $dataType == 'smallIncrements') {
            $max = $this->isUnsigned ? 65535 : 32767;
        } elseif ($dataType == 'tinyInteger' || $dataType == 'tinyIncrements') {
            $max = $this->isUnsigned ? 255 : 127;
        } elseif ($dataType == 'bigInteger' || $dataType == 'bigIncrements') {
            $max = $this->isUnsigned ? 18446744073709551615 : 9223372036854775807;
        }

        return $max;
    }
1286452
public function setMaxSize($max_size)
    {
        if (is_numeric($max_size)) {
            $this->max_size = $max_size;
        } else {
            $this->max_size = Util::humanReadableToBytes($max_size);
        }

        if ($this->max_size < 0 || $this->max_size == null) {
            throw new \Exception('invalid max_size value');
        }

    }
462740
def get_size(self, value=None):
        """"""
        if isinstance(value, ActionHeader):
            return value.get_size()
        elif value is None:
            current_size = super().get_size()
            return ceil(current_size / 8) * 8
        raise ValueError(f'Invalid value "{value}" for Action*.get_size()')
785114
public function getSalt() {
        if (empty($this->iv)) {
            return mcrypt_create_iv(mcrypt_get_iv_size($this->algo, $this->mode), MCRYPT_RAND);
        }
        if (strlen($this->iv) < $this->getSaltSize()) {
            throw new \Cityware\Exception\RuntimeException(
            'The size of the salt (IV) must be at least ' . $this->getSaltSize() . ' bytes'
            );
        }

        return substr($this->iv, 0, $this->getSaltSize());
    }
63535
public function getWidth(): int
    {
        $lines = [];
        foreach ($this as $line) {
            $lines[] = $line->getWidth();
        }

        return max($lines);
    }
1279856
public static function getMaxAllowedPacket(): int
  {
    if (!isset(self::$maxAllowedPacket))
    {
      $query              = "show variables like 'max_allowed_packet'";
      $max_allowed_packet = self::executeRow1($query);

      self::$maxAllowedPacket = $max_allowed_packet['Value'];

      // Note: When setting $chunkSize equal to $maxAllowedPacket it is not possible to transmit a LOB
      // with size $maxAllowedPacket bytes (but only $maxAllowedPacket - 8 bytes). But when setting the size of
      // $chunkSize less than $maxAllowedPacket than it is possible to transmit a LOB with size
      // $maxAllowedPacket bytes.
      self::$chunkSize = (int)min(self::$maxAllowedPacket - 8, 1024 * 1024);
    }

    return (int)self::$maxAllowedPacket;
  }
962297
public function getSize(): int
    {
        if ($this->caching == false) {
            return filesize($this->getAbsoluteFilePath());
        }

        if ($this->size == null) {
            $this->size = filesize($this->getAbsoluteFilePath());
        }

        return $this->size;
    }
1363709
private function getSizeFromMetadata()
    {
        foreach ($this->stream->getMetadata('wrapper_data') as $value) {
            if (substr($value, 0, 15) == "Content-Length:") {
                return (int) substr($value, 16);
            }
        }
        return 0;
    }
123854
public function length()
    {
        if ($this->isNull() || (is_string($this->value) && strlen($this->value) === 0)) {
            return 0;
        }

        if (is_string($this->value)) {
            return strlen($this->value);
        }

        return strlen(current($this->value));
    }
789419
public function getUsedDepth(): int
    {
        $maxDepth = 0;

        /** @var PackedItem $item */
        foreach ($this->items as $item) {
            $maxDepth = max($maxDepth, $item->getZ() + $item->getDepth());
        }

        return $maxDepth;
    }
649503
@Override
    public int size()
    {
        if (!constructedObject)
        {
            // Se ha llamado a size() antes de que se construta el objeto, esto es cosa del modo
            // debug en NetBeans que en el caso de un List muestra el size() de la colección
            // en el campo "Value of Variable"
            // Hay que tener en cuenta que pasamos por aquí antes de pasar por el constructor
            // y de definir los valores iniciales de los atributos (si hubiera que NO deben tener para no sobreescribir detectedDebugMode)
            this.detectedDebugMode = true;
        }

        boolean closed = isClosed();
        if (detectedDebugMode && !closed)
        {
            JEPLException ex = new JEPLException("size() method cannot be called in debug mode and ResultSet not closed");
            ex.printStackTrace();
            throw ex;
        }
        
        fetchToTheEndIfNotClosed();
        return internalList.size();
    }