Internal path to CMS images

@param string $file      file to add to path
@return string
331817
public static function imagesInternal($file = null)
    {
        return base_path(
            self::appendToPath(
                self::appendToPath(config('pxlcms.paths.base_internal'), config('pxlcms.paths.images')),
                $file
            )
        );
    }
277923
public function loadImageDetails($file = null)
    {
        $file = $file ? $file : $this->pathToImage;

        is_readable($file)
            or $this->raiseError('Image file does not exist.');

        $info = list($this->width, $this->height, $this->fileType) = getimagesize($file);
        if (empty($info)) {
            // To support webp
            $this->fileType = false;
            if (function_exists("exif_imagetype")) {
                $this->fileType = exif_imagetype($file);
                if ($this->fileType === false) {
                    if (function_exists("imagecreatefromwebp")) {
                        $webp = imagecreatefromwebp($file);
                        if ($webp !== false) {
                            $this->width  = imagesx($webp);
                            $this->height = imagesy($webp);
                            $this->fileType = IMG_WEBP;
                        }
                    }
                }
            }
        }

        if (!$this->fileType) {
            throw new Exception("Loading image details, the file doesn't seem to be a valid image.");
        }

        if ($this->verbose) {
            $this->log("Loading image details for: {$file}");
            $this->log(" Image width x height (type): {$this->width} x {$this->height} ({$this->fileType}).");
            $this->log(" Image filesize: " . filesize($file) . " bytes.");
            $this->log(" Image mimetype: " . $this->getMimeType());
        }

        return $this;
    }
86978
public function downloadPath($file)
    {
        if (!$file) {
            return '';
        }

        $parts = explode(';', $file);
        $fileId = $parts[0];

        $src = $this->router->generate('frontendmedia_download', ['fileId' => $fileId], UrlGeneratorInterface::ABSOLUTE_PATH);

        return $src;
    }
836432
protected function getTypeByFile($file)
  {
    switch (strtolower(pathinfo($file, PATHINFO_EXTENSION))) {
      case 'jpg':
      case 'jpeg':
        $type = IMG_JPG;
        break;
      case 'png':
        $type = IMG_PNG;
        break;
      case 'gif':
        $type = IMG_GIF;
        break;
      default:
        $type = false;
    }

    return $type;
  }
139169
private function getRelativeFilePath($file)
    {
        $realPath = $file->getRealPath();
        $pathPrefix = $this->baseDir.'/';
        $pos = strpos($realPath, $pathPrefix);
        $relativePath = (false !== $pos) ? substr_replace($realPath, '', $pos, strlen($pathPrefix)) : $realPath;

        return strtr($relativePath, '\\', '/');
    }
184358
public function path($file = '', $theme = null)
    {
        if (is_null($theme)) {
            $theme = $this->getCurrent();
        }

        $theme = $this->format($theme);

        return base_path("themes/{$theme}/{$file}");
    }
761297
protected function _findFile($file)
    {
        foreach ($this->_settings['paths'] as $path) {
            $path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
            if (file_exists($path . $file)) {
                return $path . $file;
            }
        }
        return $file;
    }
421111
public static function storage_path(?string $file = null)
  {
    $file = (substr($file, 0, 1) == DIRECTORY_SEPARATOR ? substr($file, 1) : $file);
    return config('app.dir') . 'storage' . DIRECTORY_SEPARATOR . $file;
  }
1184661
public static function path( $file = null, $key = null ) 
	{
		// get the storage key
		if ( is_null( $key ) ) 
		{
			$key = static::$default;
		}

		// check if path exists
		if ( !isset( static::$paths[$key] ) ) 
		{
			throw new CCException( 'CCStorage - use of undefined storage path '.$key.'.' );
		}
			
		if ( strpos( $file, ':' ) )
		{
			$file = static::file( $file );
		}
		
		return static::$paths[$key].$file;
	}
398545
public static function asset(string $file)
  {
    $template = new Template();
    return file_get_contents($template->assets . $template->cleanPath($file));
  }
938879
public final function getRelativePath($file = null) {
        return $file ? MODULE_DIR . DS . $this->dirname . DS . ($file ? $file : '') : $this->path . DS;
    }
1129815
protected function getFileUploadPath($file)
    {
        // check if path override is defined for current file
        $pathOverrideMethod = camel_case(strtolower($this->uploadFieldName) . 'UploadFilePath');

        if (method_exists($this, $pathOverrideMethod)) {
            return $this->getImageUploadPath() . '/' . $this->$pathOverrideMethod($file);
        }

        return $this->getImageUploadPath() . '/' . $file->hashName();
    }
65596
public static function rpath(String $file = NULL) : String
    {
        $config = Config::get('Filesystem', 'file', self::$access);

        self::$access = NULL;

        if( $config['parentDirectoryAccess'] === false )
        {
            $file = str_replace('../', '', $file);
        }

        if( $config['realPath'] === true )
        {
            $file = Base::prefix(self::originpath($file), REAL_BASE_DIR);
        }

        return $file;
    }
280732
public static function base_path(?string $file = null)
  {
    $file = (substr($file, 0, 1) == DIRECTORY_SEPARATOR ? substr($file, 1) : $file);
    return config('app.dir') . $file;
  }
849116
protected function getPath($theme, $file = null)
	{
		$rootPath = $this->option('path');

		return $rootPath.'/'.$theme.'/' . $file;
	}
1206520
public function detectPath($file): string
    {
        if ($file == $this->noImage) {
            return Yii::getAlias($this->noImage);
        }

        $fullPath = $this->getImageSourcePath() . $file;

        if (is_file($fullPath)) {
            return $fullPath;
        }

        return false;
    }
1205976
protected function createEmbedViaPath($file)
    {
        /** @var $byteStream \Swift_ByteStream_FileByteStream */
        $byteStream = $this->getManager()->getDI()->get('\Swift_ByteStream_FileByteStream', [$file]);

        /** @var $image \Swift_Image */
        $image = $this->getManager()->getDI()->get('\Swift_Image')
            ->setFile($byteStream);

        return $image;
    }