获取文件的哈希散列值
@param string $type
@return mixed $string
6824
public function hash($type = 'sha1') {
		if (!isset($this->hash[$type])) {
			$this->hash[$type] = hash_file($type, $this->filename);
		}
		return $this->hash[$type];
	}
779043
public static function doctype($type)
    {
        $doctypes = array(
            'html5'        => '<!DOCTYPE html>',
            'xhtml'        => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
            'xhtml-trans'  => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
            'xhtml-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
        );

        if ($doctypes[$type]) {
            self::$doctype = preg_replace('/-\w+$/', '', $type);
            return $doctypes[$type];
        }

        return '';
    }
849386
public function getAsString(string $type): ?string
    {
        $ret = $this->entry[$type];
        if (is_array($ret)) {
            $ret = implode('', $ret);
        }
        return $ret;
    }
1073689
public function type($type = null)
    {
        if (is_null($type)) {
            return $this->type;
        }

        $this->type = $type;

        return $this;
    }
156905
public function getCode($type = 'default')
    {
        $code = $this->exception->getCode();
        if (empty($this->exception->getCode())) {
            $code = config($this->configFile.'.codes.'.$type);
        }

        return $code;
    }
1206461
protected function getCharacter($type)
    {
        $character = $this->charSet[$type][rand(0, strlen($this->charSet[$type]) - 1)];

        if ($this->unique) {
            $this->removeFromArray($character);
        }

        return $character;
    }
36701
public function link($type='')
	{
		if (!$this->get('id') || !self::$linkBase)
		{
			return '';
		}

		$link = str_replace(
			array(
				'{ID}',
				'{USERNAME}',
				'{EMAIL}',
				'{NAME}'
			),
			array(
				$this->get('id'),
				$this->get('username'),
				$this->get('email'),
				str_replace(' ', '+', $this->get('name'))
			),
			self::$linkBase
		);

		return $link;
	}
41540
public function ToString($Type = 'more') {
      if ($this->_PropertiesDefined === FALSE)
         trigger_error(ErrorMessage('You must configure the pager with $Pager->Configure() before retrieving the pager.', 'MorePager', 'GetSimple'), E_USER_ERROR);
      
      // Urls with url-encoded characters will break sprintf, so we need to convert them for backwards compatibility.
      $this->Url = str_replace(array('%1$s', '%2$s', '%s'), array('{Offset}', '{Size}', '{Offset}'), $this->Url);

      $Pager = '';
      if ($Type == 'more') {
         $ClientID = $this->ClientID == '' ? '' : $this->ClientID . 'More';
         if ($this->Offset + $this->Limit >= $this->TotalRecords) {
            $Pager = ''; // $this->Offset .' + '. $this->Limit .' >= '. $this->TotalRecords;
         } else {
            $ActualRecordsLeft = $RecordsLeft = $this->TotalRecords - $this->_LastOffset;
            if ($RecordsLeft > $this->Limit)
               $RecordsLeft = $this->Limit;
               
            $NextOffset = $this->Offset + $this->Limit;

            $Pager .= Anchor(
               sprintf(T($this->MoreCode), $ActualRecordsLeft),
               self::FormatUrl($this->Url, $NextOffset, $this->Limit),
               '',
               array('rel' => 'nofollow')
            );
         }
      } else if ($Type == 'less') {
         $ClientID = $this->ClientID == '' ? '' : $this->ClientID . 'Less';
         if ($this->Offset <= 0) {
            $Pager = '';
         } else {
            $RecordsBefore = $this->Offset;
            if ($RecordsBefore > $this->Limit)
               $RecordsBefore = $this->Limit;
               
            $PreviousOffset = $this->Offset - $this->Limit;
            if ($PreviousOffset < 0)
               $PreviousOffset = 0;
               
            $Pager .= Anchor(
               sprintf(T($this->LessCode), $this->Offset),
               self::FormatUrl($this->Url, $PreviousOffset, $RecordsBefore),
               '',
               array('rel' => 'nofollow')
            );
         }
      }
      if ($Pager == '')
         return $this->PagerEmpty;
      else
         return sprintf($this->Wrapper, Attribute(array('id' => $ClientID, 'class' => $this->CssClass)), $Pager);
   }
641537
public function dump($type = \NonDB\Components\Dump::DUMP_VAR_DUMP){

            return \NonDB\Components\Dump::dump($this->getArray(), $type);

        }
752271
public function dataUrl($type = 'jpeg')
    {
        $type      = $this->getType($type);
        $imageFunc = 'image' . $type;

        ob_start();

        $imageFunc($this->newImage);

        $data = ob_get_contents();

        ob_end_clean();

        $this->destroyAll();

        $dataUrl = 'data:image/'. $type . ';base64,' . base64_encode($data);

        return $dataUrl;
    }
949098
public function toString($type = 'jpg', $quality = 75)
        {
            ob_start();

            if($type == 'jpg' && (imagetypes() & IMG_JPG))
                imagejpeg($this->im, null, $quality);
            elseif($type == 'png' && (imagetypes() & IMG_PNG))
                imagepng($this->im);
            elseif($type == 'gif' && (imagetypes() & IMG_GIF))
                imagegif($this->im);

            return ob_get_clean();
        }
242312
public static function getType($type)
    {
        $type = strtolower($type);

        if (!isset(static::$typeMapping[$type])) {
            return $type;
        }

        return static::$typeMapping[$type];
    }
1239361
public function getDependenciesFileContent($type)
	{
		$hash = array();
		
		foreach ($this->getDependencies($type) as $dependency)
			$hash[] = $dependency . ':' . filemtime($dependency);
			
		return implode("\n", $hash);
	}
1167186
public static function getPhpType($type)
    {
        switch ($type) {
            case self::TYPE_DOUBLE:
            case self::TYPE_FLOAT:
                return 'float';
            case self::TYPE_INT64:
            case self::TYPE_UINT64:
            case self::TYPE_INT32:
            case self::TYPE_FIXED64:
            case self::TYPE_FIXED32:
            case self::TYPE_UINT32:
            case self::TYPE_SFIXED32:
            case self::TYPE_SFIXED64:
            case self::TYPE_SINT32:
            case self::TYPE_SINT64:
                return 'int';
            case self::TYPE_BOOL:
                return 'bool';
            case self::TYPE_STRING:
                return 'string';
            case self::TYPE_BYTES:
                return '\Protobuf\Stream';
            default:
                return null;
        }
    }
550915
public function getString($type = self::RFC_4314)
    {
        $acl = strval($this);

        if ($type == self::RFC_2086) {
            foreach ($this->_virtual as $key => $val) {
                $acl = str_replace($val, '', $acl, $count);
                if ($count) {
                    $acl .= $key;
                }
            }
        }

        return $acl;
    }
726924
public function type($type = null)
    {
        if ($type !== null) {
            $this->type = $type;
            return $this;
        }
        return $this->type;
    }
880387
public static function input(string $type)
    {
        $self = self::$input[$type] ?? new self;

        self::$input[$type] = $self;

        switch (strtoupper($type)) {
            case 'GET':
            case 'POST':
                $self->params = filter_input_array(constant('INPUT_' . $type)) ?? [];
                break;
            case 'PUT':
            case 'DELETE':
                $self->params = self::getParsedInput();
                break;
        }

        return function ($key = null) use ($self) {
            $self->key = $key;

            return $self;
        };
    }