Returns the relative path to this filetype
@param   String $type    Filetype, should be one of $this->_uploadTypes
@return  String          Relative path to this type of file
344710
protected function _getRelPath($filename, $type) {
        $ini = $this->_getIni();
        return $ini->cdn->path->upload->{$type} . DIRECTORY_SEPARATOR . $filename;
    }
798286
function getExportStylePath( $type ) {

		$fullpath = false;

		if ( CustomCss::isCustomCss() ) {
			$fullpath = CustomCss::getCustomCssFolder() . "$type.css";
			if ( ! is_file( $fullpath ) ) {
				$fullpath = false;
			}
		}

		if ( ! $fullpath ) {
			// Look for SCSS file
			$fullpath = Container::get( 'Styles' )->getPathToScss( $type );
			if ( ! $fullpath ) {
				// Look For CSS file
				$dir = Container::get( 'Styles' )->getDir();
				$fullpath = realpath( "$dir/export/$type/style.css" );
			}
		}

		return $fullpath;
	}
698460
public function get($type)
    {
        $ret = null;
        if ('image' == $type) {
            if (isset($this->metasProp['og:image'])) {
                $ret = $this->metasProp['og:image'];
            } elseif ($this->getParameter('nyroDev_utility.share.image')) {
                $ret = $this->getParameter('nyroDev_utility.share.image');
            }
        } else {
            if (isset($this->metas[$type])) {
                $ret = $this->metas[$type];
            } elseif ($this->getParameter('nyroDev_utility.share.'.$type)) {
                $ret = $this->getParameter('nyroDev_utility.share.'.$type);
            }
        }

        return preg_replace('/\s\s+/', ' ', $this->trans($ret));
    }
1043779
public function chmod($type) {
		
		if(false !== $this -> directory -> getExists()) {
			return chmod($this -> directory -> getPath(), $type);
		}

		return false;
	}
1177067
protected function getInheritanceTypeString($type)
    {
        if ( ! isset(static::$inheritanceTypeMap[$type])) {
            throw new \InvalidArgumentException(sprintf('Invalid provided InheritanceType: %s', $type));
        }

        return static::$inheritanceTypeMap[$type];
    }
720943
protected function getApartLevelFile($path, $type)
    {
        if ($this->config['single']) {
            $name = is_string($this->config['single']) ? $this->config['single'] : 'worker';

            $name .= '_' . $type;
        } elseif ($this->config['max_files']) {
            $name = date('Ymd') . '_' . $type . '_worker';
        } else {
            $name = date('d') . '_' . $type . '_worker';
        }

        return $path . DIRECTORY_SEPARATOR . $name . '.log';
    }
1263531
public static function getRelativeFilepath($file)
    {
        $storageDir = self::convertSlashes(config('filer.path.absolute'));
        $absolutePath = self::convertSlashes($file->getRealPath());
        return dirname(str_replace($storageDir, '', $absolutePath));
    }
709839
static public function getUploadFilePath($filename)
    {
        if ($filename) {
            $filename = static::getUploadFileRelativePath($filename);
            
            if (static::isRootImageFile($filename)) {
                
                return static::getWebRootPath() . $filename;
            }
            
            $filename = static::getUploadPath() . $filename;
        }
        
        return $filename;
    }
880283
public static function getAssetFilePaths($type)
    {
        $path = sprintf('%s/assets/%s/', __DIR__, $type);
        $filenames = preg_grep('/^[^\.]/', scandir($path));
        if (!Arr::iterable($filenames)) {
            return array();
        }

        return array_map(function ($filename) use ($path) {
            return $path.$filename;
        }, $filenames);
    }
292166
public function getBaseSnippetPath($type = null)
    {
        $path = '/' . $this->getPath('base') . '/' . $this->getPath('snippet');

        if ($type) {
            $path .= '/' . $type;
        }

        return $path;
    }
1239361
public function getDependenciesFileContent($type)
	{
		$hash = array();
		
		foreach ($this->getDependencies($type) as $dependency)
			$hash[] = $dependency . ':' . filemtime($dependency);
			
		return implode("\n", $hash);
	}
828944
public function path($type, $plugin = null)
	{
		static $paths = array();

		if (!isset($paths[$type . $plugin]))
		{
			$paths[$type . $plugin] = '';

			$p = DS . 'plugins' . DS . $type . ($plugin ? DS . $plugin : '');

			foreach (array(PATH_APP, PATH_CORE) as $base)
			{
				if (is_dir($base . $p))
				{
					$paths[$type . $plugin] = $base . $p;
					break;
				}
			}
		}

		return $paths[$type . $plugin];
	}
1051047
protected function listFiles($type)
    {
        if (!isset($this->cache['files'][$type])) {
            $path = sprintf('%s/%s', $this->directory, $type);

            if (!$this->files->exists($path)) {
                throw new Exception(sprintf(
                    'No content directory found for type "%s" (in "%s").',
                    $type,
                    $this->directory
                ));
            }

            $finder = new Finder();

            $this->cache['files'][$type] = $finder->files()->in($path);
        }

        return clone $this->cache['files'][$type];
    }
653747
static public function getStorableType( $type )
    {
        switch ( $type )
        {
            case 'google':      return self::TYPE_GOOGLE;
            case 'facebook':    return self::TYPE_FACEBOOK;
            case 'yahoo':       return self::TYPE_YAHOO;
            case 'twitter':     return self::TYPE_TWITTER;
        }
    }
664522
public function getType(string $type): Type
    {
        if (isset($this->types[$type])) {
            return $this->types[$type];
        }

        $instance = $this->createType($type);
        $this->addType($instance);
        $this->types[$type] = $instance;

        return $instance;
    }
722138
public function getFileType($ext, $type = '')
    {
        // 可上传类型
        $upload_type = $this->getUploadType();
        
        // 没有指定上传类型
        if ($type == '') {
            foreach ($upload_type as $c => $v) {
                if (in_array($ext, $v)) {
                    $type = $c;
                    break;
                }
            }
        }
        
        // 验证上传类型
        if ($type == '' || ! isset($upload_type[$type]) || ! in_array($ext, $upload_type[$type])) {
            return '';
        } else {
            return $type;
        }
    }
1085274
public function thumbnail($type)
    {
        // We take image from posts field
        $image = $this->attributes['image'];
        // We need to get extension type ( .jpeg , .png ...)
        $ext = pathinfo($image, PATHINFO_EXTENSION);
        // We remove extension from file name so we can append thumbnail type
        $name = rtrim($image, '.'.$ext);
        // We merge original name + type + extension
        return $name.'-'.$type.'.'.$ext;
    }