Saves bounding box record, possibly using 0 instead of not set values.

@param file   $file File object
@param string $type Bounding box dimension (eg. xmax, mmin...)
970727
private function _saveBBoxRecord($file, $type)
    {
        fwrite($file, Util::packDouble(
            isset($this->boundingBox[$type]) ? $this->boundingBox[$type] : 0
        ));
    }
1012026
public function bindValue($column, $value, $type = 'string')
    {
        if ($type === null) {
            $type = 'string';
        }
        if (!ctype_digit($type)) {
            list($value, $type) = $this->cast($value, $type);
        }
        if ($type == PDO::PARAM_LOB) {
            $this->_statement->bindParam($column, $value, $type, 0, PDO::SQLSRV_ENCODING_BINARY);
        } else {
            $this->_statement->bindValue($column, $value, $type);
        }
    }
1228503
public function compress($type, $files, $file) 
	{
		// files have been updated so update the minified file
		if($this->isUpdated($files))
		{
			$content = $this->getFileContents($files);
			switch($type){
				case 'css':
					$content = $this->minifyCSS($content);
				break;
				case 'js':
					$content = $this->minifyJS($content);
				break;
			}
			$this->saveFile($file, $content);
		}
		return str_replace($this->scriptPath,$this->coreUrl,$file);	
	}
1374452
public function setType($type)
    {
        $const = sprintf('%s::TYPE_%s', __CLASS__, strtoupper($type));
        
        if(defined($const))
        {
            $type = constant($const);
        }
        
        $this->setAttributeDirectly('type', $type);
        
        $this->enumerationStrategy = null;
    }
1291223
public function save($file = NULL)
    {
        if(is_null($file) && $this->storage)
        {
            $this->storage->save($this);
        }
        elseif(!is_null($file))
        {
            $this->savePicture($file);
        }
        else
        {
            trigger_error('Image file to save is not defined', E_USER_WARNING);
        }
    }
193168
public function minify($file, $type = null)
    {
        if ($type === null) {
            $type = File::getExtension($file);
        }

        $type = strtolower($type);

        if ($type === 'css') {
            $content = CssMinifier::process(file_get_contents($file));
        } elseif ($type === 'js') {
            $content = JsMinifier::process(file_get_contents($file));
        } else {
            return $this;
        }

        $dest = dirname($file) . '/' . File::stripExtension(File::getFilename($file)) . '.min.' . $type;

        file_put_contents($dest, $content);

        $this->out('Minify file: ' . $dest);

        return $this;
    }
757240
public function save($file = null)
    {
        //argument 1 must be a file or null
        Argument::i()->test(1, 'string', 'null');
        
        if (is_null($file)) {
            $file = $this->file;
        }
        
        if (is_null($file)) {
            Exception::i()
                ->setMessage(Argument::INVALID_ARGUMENT)
                ->addVariable(1)
                ->addVariable(__CLASS__.'->'.__FUNCTION__)
                ->addVariable('file or null')
                ->addVariable($file)
                ->setTypeLogic()
                ->trigger();
        }
        
        File::i($file)->setData($this->language);
        
        return $this;
    }
1242612
public function setFileType (int $fileType)
    {
        if (self::isFileTypeValid($fileType)) $this->fileType = self::$fileTypes[$fileType];
    }
661525
public function flush($file_content = null, $type = null)
    {
        if (!empty($file_content)) {
            if (empty($type)) {
                $finfo = new \finfo();
                $type = $finfo->buffer($file_content, FILEINFO_MIME);
            }
            $this->addHeader('Content-Type', $type);
            $this->renderHeaders();
            echo $file_content;
            exit;
        }
        return;
    }
1294727
public function addIndexFile($file, $type = 'cli')
    {
        $type = strtolower($type);

        if (!in_array($type, ['cli', 'web'])) {
            throw new \InvalidArgumentException(sprintf('Index file type "%s" is invalid, must be one of: cli, web', $type));
        }

        $this->index[$type] = [$file, realpath($this->path . DIRECTORY_SEPARATOR . $file)];
    }
26321
public function setFile(\Lexik\Bundle\TranslationBundle\Model\File $file)
    {
        $this->file = $file;
    }
651129
public function load($file, $type = null)
    {
        $path   = $this->locator->locate($file);
        $config = array();

        $result = parse_ini_file($path, true);
        if (false === $result || array() === $result) {
            throw new InvalidArgumentException(sprintf('The "%s" file is not valid.', $file));
        }

        if (isset($result['parameters']) && is_array($result['parameters'])) {
            $config['parameters'] = array();
            foreach ($result['parameters'] as $key => $value) {
                $config['parameters'][$key] = $value;
            }
        }
    }
883535
public function errorHandler(int $type, string $message, string $file, int $line) :void
    {
        $this->whichError($message, $type, $file, $line);
    }
1121274
public function save($pathToFile = null, $type = null, $jpgQuality = null)
    {
        if ($pathToFile === null) $pathToFile = $this->pathToFile;
        if ($type === null) $type = $this->type;
        if ($jpgQuality === null) $jpgQuality = $this->jpgQuality;
        switch ($type) {
            case self::GIF:
                imagegif($this->resource, $pathToFile);
                break;
            case self::JPG:
                imagejpeg($this->resource, $pathToFile, $jpgQuality);
                break;
            case self::PNG:
                imagepng($this->resource, $pathToFile);
                break;
            case self::BMP:
                imagewbmp($this->resource, $pathToFile);
                break;
            default:
                throw new ImageException("Unknown type of file " . ($this->pathToFile) . ".", ImageException::UnsupportedFormatException);
                break;
        }
        $this->pathToFile = $pathToFile;
    }
1072315
public function putFileToOss($key, $file, $type = 'images') {
		$src = null;
		if(isset($this->oss[$type])) {
			OSSClient::factory($this->oss['config'])->putObject([
				'Bucket' => $this->oss[$type]['Bucket'],
				'Key' => $key,
				'Content' => fopen($file, 'r'),
				'ContentLength' => filesize($file),
			]);
			$src = $this->oss[$type]['src'] . DIRECTORY_SEPARATOR . $key;
			unlink($file);
		}

		return $src;
	}
310446
public function create_perm_by_real($file, $type='file'){
    if ( !empty($file) &&
      \defined('BBN_APP_PATH') &&
      file_exists($file) &&
      // It must be a controller
      (strpos($file, '/mvc/public/') !== false)
    ){
      $is_file = $type === 'file';
      // Check if it's an external route
      foreach ( $this->routes as $i => $r ){
        if ( strpos($file, $r) === 0 ){
          // Remove route
          $f = substr($file, \strlen($r), \strlen($file));
          // Remove /mvc/public
          $f = substr($f, \strlen('/mvc/public'), \strlen($f));
          // Add the route's name to path
          $f = $i . $f;
        }
      }
      // Internal route
      if ( empty($f) ){
        $root_path = BBN_APP_PATH.'mvc/public/';
        if ( strpos($file, $root_path) === 0 ){
          // Remove root path
          $f = substr($file, \strlen($root_path), \strlen($file));
        }
      }
      if ( !empty($f) ){
        $bits = bbn\x::remove_empty(explode('/', $f));
        $code = $is_file ? bbn\str::file_ext(array_pop($bits), 1)[0] : array_pop($bits).'/';
        $id_parent = $this->options->from_code('page', 'bbn_permissions');
        foreach ( $bits as $b ){
          if ( !$this->options->from_code($b.'/', $id_parent) ){
            $this->options->add([
              'id_parent' => $id_parent,
              'code' => $b.'/',
              'text' => $b
            ]);
          }
          $id_parent = $this->options->from_code($b.'/', $id_parent);
        }
        if ( !$this->options->from_code($code, $id_parent) ){
          $this->options->add([
            'id_parent' => $id_parent,
            'code' => $code,
            'text' => $code
          ]);
        }
        return $this->options->from_code($code, $id_parent);
      }
      else if ( !$is_file ){
        return $this->options->from_code('page', 'bbn_permissions');
      }
      return true;
    }
    return false;
  }
1256512
public function bindColumn($column, &$param, $type = null)
    {
        if ($type === null) :
            $this->_statement->bindColumn($column, $param);
        else :
            $this->_statement->bindColumn($column, $param, $type);
        endif;
    }