adds the $path to dependency list of $type
using type-based dependencies to, for example, allow a css file to rely on a .png file

@param string $type dependency type (application.$type)
@param string $path file path (x.png, for example)
484296
public function addDependency($type, $path)
	{
		if (null === $this->dependencies)
			$this->dependencies = array();
		if (!isset($this->dependencies[$type]))
			$this->dependencies[$type] = array();
		
		if (!isset($this->dependencies[$type][$path]))
			//in order to not register the first file
			$this->dependencies[$type][$path] = true;
	}
530511
public function is(string $path, string $type = 'page'): ?string
  {
    return $this->from_path($path, $type);
  }
139012
public function save($path, $type = null)
    {
        #imagepng() - Output a PNG image to either the browser or a file
        #imagegif() - Output image to browser or file
        #imagewbmp() - Output image to browser or file
        #imagejpeg() - Output image to browser or file
        
        if (!$type) {
            $type = $this->type;
        }

        switch ($type) {
            case 'gif':
                imagegif($this->resource, $path);
                break;
            case 'png':
                $quality = (100 - $this->quality) / 10;

                if ($quality > 9) {
                    $quality = 9;
                }

                imagepng($this->resource, $path, $quality);
                break;
            case 'bmp':
            case 'wbmp':
                imagewbmp($this->resource, $path, $this->quality);
                break;
            case 'jpg':
            case 'jpeg':
            case 'pjpeg':
            default:
                imagejpeg($this->resource, $path, $this->quality);
                break;

        }

        return $this;
    }
191739
public function setCACertificates($path, $type)
    {
        if (!in_array($type, array('capath', 'cainfo'))) {
            throw new \OtherCode\Rest\Exceptions\RestException('Invalid param "type" in for ' . __METHOD__ . 'method.');
        }

        $this->ssl_verifypeer = true;
        $this->ssl_verifyhost = 2;
        $this->$type = $path;
        return $this;
    }
633361
public function upload(string $type, string $path)
    {
        $files = [
            'media' => $path,
        ];

        return $this->httpUpload('cgi-bin/media/upload', $files, [], compact('type'));
    }
286790
public function addRoutesFile(string $path)
    {
        $datas = yaml_parse_file($path);

        $this->addRoutes($this->parseRoutesFiles($datas));
    }
1363967
public static function create(string $path, string $type):int
    {
        try {
            switch ($type) {
                case "directory":
                    if (!is_dir($path)) {
                        mkdir($path);
                    }
                    break;
                case "file":
                    if (!is_file($path)) {
                        touch($path);
                    }
                    break;
            }
        } catch (\Exception $exception) {
            throw new \Exception("Server Error : Cannot create $type element => ".$exception);
        }

        return (1);
    }
71970
protected function adapter(string $type, string $path): DriverInterface
    {
        if (!$this->corundum->exists($type))
        {
            throw new Invalid('Unknown type `' . $type . '`');
        }

        return $this->corundum->{$type}($path);
    }
148085
public function addPath($path)
    {
        if (!is_string($path)) {
            throw new Exception\InvalidArgumentException(sprintf(
                'Invalid path provided; must be a string, received %s',
                gettype($path)
            ));
        }

        $this->paths[] = $this->normalizePath($path);
    }
49365
public static function createFromPath(string $path)
    {
        $createFunctions = [
            'image/png' => 'imagecreatefrompng',
            'image/jpeg' => 'imagecreatefromjpeg',
            'image/gif' => 'imagecreatefromgif',
        ];

        $mimeType = mime_content_type($path);

        if (!array_key_exists($mimeType, $createFunctions)) {
            throw new InvalidMimeTypeException(sprintf('The "%s" mime type is not supported.', $mimeType));
        }

        $resource = $createFunctions[$mimeType]($path);

        return new static($resource);
    }
1307182
public function set($type, $path)
    {
        if ($path instanceof pathmanager\FallbackInterface) {
            $this->paths[$type] = $path;
            return $this;
        }

        if (is_array($path)) {
            if (isset($this->paths[$type])) {
                $fallback = $this->paths[$type];
                if (!$fallback instanceof pathmanager\FallbackInterface) {
                    $first = $fallback;
                    $fallback = new pathmanager\DefaultFallback();
                    $fallback->addPath($first);
                }
            } else {
                $fallback = new pathmanager\DefaultFallback();
            }

            $this->paths[$type] = $fallback;
            foreach ($path as $item) {
                $this->set($type, $item);
            }

            return $this;
        }

        $path = $this->prepare($path);

        if (isset($this->paths[$type]) && ($this->paths[$type] instanceof pathmanager\FallbackInterface)) {
            $this->paths[$type]->addPath($path);
        } else {
            $this->paths[$type] = $path;
        }

        return $this;
    }
582718
public static function createInvalidLinkTypeReturned(string $path, string $type): self
    {
        return new self(
            sprintf(
                'The link normalizer callback needs to return a %s|null, "%s" given at path: "%s"',
                LinkInterface::class,
                $type,
                $path
            )
        );
    }
1267764
public function setPath($path, $type = 'replace', $replace = '')
    {
        $oldPath = (!empty($this->url['path']) ? $this->url['path'] : '');

        switch ($type) {
            case 'add':
                $path = $oldPath . $path;
                break;
            case 'remove':
                $path = str_replace($path, '', $oldPath);
                break;
            case 'replace':
            default:
                $path = str_replace($replace, $path, $oldPath);
                break;
        }

        $this->url['path'] = $path;

        return $this;
    }
899569
public static function delete(string $path, string $type):int
    {
        try {
            switch ($type) {
                case "directory":
                    if (is_link($path)) {
                        unlink($path);
                    } elseif (is_dir($path)) {
                        try {
                            self::recursiveRmdir($path);
                        } catch (\Exception $e) {
                            throw new \Exception("Server Manager delete error =>" . $e->getMessage());
                        }
                    }
                    break;
                case "file":
                    if (is_link($path)) {
                        unlink($path);
                    } elseif (file($path)) {
                        try {
                            unlink($path);
                        } catch (\Exception $e) {
                            throw new \Exception("Server Manager delete error =>" . $e->getMessage());
                        }
                    }
                    break;
            }
        } catch (\Exception $exception) {
            throw new \Exception("Server Error : Cannot delete $type element => ".$exception);
        }

        return (1);
    }
390184
public static function ensureConfigFile($path, $type)
    {
        if (!is_file($path)) {
            $content = self::getExampleConfiguration($type);
            file_put_contents($path, $content);
        }
    }
1182138
public static function addPath($path)
    {
        $path = str_replace('//', '/', rtrim($path, '/'));
        if (is_dir($path) && !in_array($path, self::$_paths)) {
            array_unshift(self::$_paths, $path);
        }
    }
511793
public function add_type($type, $path = null)
	{
		isset($this->_asset_paths[$type]) or $this->_asset_paths[$type] = array();
		isset($this->_path_folders[$type]) or $this->_path_folders[$type] = $type.'/';

		if ( ! is_null($path))
		{
			$path = $this->_unify_path($path);
			$this->_asset_paths[$type][] = $path;
		}

		return $this;
	}