Looks up a path to a skin-based file, if it doesn't exist, the default path is used.
@param  string  $path
@param  boolean $isPublic
@return string
771779
public function getPath($path = null, $isPublic = false)
    {
        $path = RouterHelper::normalizeUrl($path);
        $assetFile = $this->skinPath . $path;

        if (File::isFile($assetFile)) {
            return $isPublic
                ? $this->publicSkinPath . $path
                : $this->skinPath . $path;
        }

        return $isPublic
            ? $this->defaultPublicSkinPath . $path
            : $this->defaultSkinPath . $path;
    }
1238769
public function getUrl($path, $imagestyle_id = null, $absolute = false)
    {
        if (empty($path)) {
            return $this->getPlaceholder($imagestyle_id, $absolute);
        }

        if (isset($imagestyle_id)) {
            $suffix = preg_replace('/^image\//', '', gplcart_path_normalize($path));
            $path = GC_DIR_IMAGE_CACHE . "/$imagestyle_id/$suffix";
        }

        return $this->url->image($path);
    }
114223
public function byKeyAndPublic($key, $isPublic, $databaseConnectionName = null)
   {
     if(empty($databaseConnectionName))
     {
       $databaseConnectionName = $this->databaseConnectionName;
     }

     return $this->File->setConnection($databaseConnectionName)
      ->where('key', '=', $key)
      ->where('is_public', '=', $isPublic)
      ->get();
   }
435822
public function Index($ExtraPaths = NULL) {
      
      $FileMasks = array(
         sprintf(self::LOOKUP_CLASS_MASK, '*'),
         sprintf(self::LOOKUP_INTERFACE_MASK, '*')
      );
      
      $ExtraPathsRemove = NULL;
      if (!is_null($ExtraPaths)) {
         $ExtraPathsRemove = array();
         foreach ($ExtraPaths as $PathOpts) {
            $ExtraPath = GetValue('path', $PathOpts);
            if (array_key_exists($ExtraPath, $this->Paths)) continue;
            
            $ExtraPathsRemove[] = $ExtraPath;
            $ExtraOptions = $this->BuildOptions;
            $ExtraOptions['SplitTopic'] = GetValue('topic', $PathOpts);
            $this->AddPath($ExtraPath, $ExtraOptions);
         }
      }
      
      foreach ($this->Paths as $Path => $PathOptions) {

         $Recursive = GetValue('recursive', $PathOptions);
         $Files = $this->FindFiles($Path, $FileMasks, $Recursive);
         if ($Files === FALSE) continue;
         
         foreach ($Files as $File) {
            $SplitTopic = GetValue('topic', $PathOptions, self::TOPIC_DEFAULT);
            
            $ProvidedClass = $this->GetClassNameFromFile($File);
            if ($ProvidedClass) {
               $this->Map[$SplitTopic][$ProvidedClass] = $File;
               $this->MapInfo['dirty'] = TRUE;
            }
               
//            $ProvidesClasses = $this->Investigate($File);
//            if ($ProvidesClasses === FALSE) continue;
//            
//            foreach ($ProvidesClasses as $ProvidedClass) {
//               $ProvidedClass = strtolower($ProvidedClass);
//               $this->Map[$SplitTopic][$ProvidedClass] = $File;
//               $this->MapInfo['dirty'] = TRUE;
//            }
         }
      }
      
      // Save
      $this->Shutdown();
      
      if (!is_null($ExtraPathsRemove))
         foreach ($ExtraPathsRemove as $RemPath)
            unset($this->Paths[$RemPath]);
   }
923955
public function getPublicUrl(string $resourcePath = '/', bool $isFullUrl = false, array $fullUrlInfo = [])
    {
        $url = $this->context . $resourcePath;
        if ($isFullUrl) {
            $this->formatUrlData($fullUrlInfo);
            $prefix = $fullUrlInfo['scheme'] . '://' . $fullUrlInfo['host'];
            if (($fullUrlInfo['scheme'] == 'http') && ($fullUrlInfo['port'] != 80)) {
                $prefix .= (':' . $fullUrlInfo['port']);
            } elseif (($fullUrlInfo['scheme'] == 'https') && ($fullUrlInfo['port'] != 443)) {
                $prefix .= (':' . $fullUrlInfo['port']);
            }
            $url = $prefix . $url;
        }
        return $url;
    }
269984
public function initFromPath($path)
    {
        $core = new \Imagick;

        try {

            $core->setBackgroundColor(new \ImagickPixel('transparent'));
            $core->readImage($path);
            $core->setImageType(defined('\Imagick::IMGTYPE_TRUECOLORALPHA') ? \Imagick::IMGTYPE_TRUECOLORALPHA : \Imagick::IMGTYPE_TRUECOLORMATTE);

        } catch (\ImagickException $e) {
            throw new \Hail\Image\Exception\NotReadableException(
                "Unable to read image from path ({$path}).",
                0,
                $e
            );
        }

        // build image
        $image = $this->initFromImagick($core);
        $image->setFileInfoFromPath($path);

        return $image;
    }
802820
public function getPublicPath()
    {
        $uploadsPath = Config::get('cms.storage.uploads.path', '/storage/app/uploads');

        if ($this->isPublic()) {
            $uploadsPath .= '/public';
        }
        else {
            $uploadsPath .= '/protected';
        }

        return Url::asset($uploadsPath) . '/';
    }
866612
public static function toPath(string $url, string $publicPath): string
    {
        $unixPublic = rtrim(str_replace('\\', '/', $publicPath), '\\/') . '/';

        return $unixPublic . ltrim($url, '/');
    }
643658
protected function checkPath($path)
    {
        // provide compatibility with objects such as \SplFileInfo
        if (is_object($path) && method_exists($path, '__toString')) {
            $path = (string) $path;
        }

        $handle = @fopen($path, 'r');

        if (false === $handle) {
            throw new InvalidArgumentException(sprintf('File %s does not exist.', $path));
        }

        fclose($handle);

        return $path.'[0]';
    }
533591
public function getPublicPackageResourceUriByPath($path)
    {
        $this->initialize();
        list($packageKey, $relativePathAndFilename) = $this->getPackageAndPathByPublicPath($path);
        return $this->getPublicPackageResourceUri($packageKey, $relativePathAndFilename);
    }
1163622
public function isTrustedResourceDir($filepath, $isConfig = null)
    {
        if ($this->_include_path_status !== $this->smarty->use_include_path) {
            foreach ($this->_include_dir as $directory) {
                unset($this->_resource_dir[$directory]);
            }
            if ($this->smarty->use_include_path) {
                $this->_include_dir = array();
                $_dirs = $this->smarty->ext->_getIncludePath->getIncludePathDirs($this->smarty);
                foreach ($_dirs as $directory) {
                    $this->_include_dir[] = $directory;
                    $this->_resource_dir[$directory] = true;
                }
            }
            $this->_include_path_status = $this->smarty->use_include_path;
        }
        if ($isConfig !== true &&
            (!isset($this->smarty->_cache['template_dir_new']) || $this->smarty->_cache['template_dir_new'])
        ) {
            $_dir = $this->smarty->getTemplateDir();
            if ($this->_template_dir !== $_dir) {
                foreach ($this->_template_dir as $directory) {
                    unset($this->_resource_dir[$directory]);
                }
                foreach ($_dir as $directory) {
                    $this->_resource_dir[$directory] = true;
                }
                $this->_template_dir = $_dir;
            }
            $this->smarty->_cache['template_dir_new'] = false;
        }
        if ($isConfig !== false &&
            (!isset($this->smarty->_cache['config_dir_new']) || $this->smarty->_cache['config_dir_new'])
        ) {
            $_dir = $this->smarty->getConfigDir();
            if ($this->_config_dir !== $_dir) {
                foreach ($this->_config_dir as $directory) {
                    unset($this->_resource_dir[$directory]);
                }
                foreach ($_dir as $directory) {
                    $this->_resource_dir[$directory] = true;
                }
                $this->_config_dir = $_dir;
            }
            $this->smarty->_cache['config_dir_new'] = false;
        }
        if ($this->_secure_dir !== (array) $this->secure_dir) {
            foreach ($this->_secure_dir as $directory) {
                unset($this->_resource_dir[$directory]);
            }
            foreach ((array) $this->secure_dir as $directory) {
                $directory = $this->smarty->_realpath($directory . DS, true);
                $this->_resource_dir[$directory] = true;
            }
            $this->_secure_dir = (array) $this->secure_dir;
        }
        $this->_resource_dir = $this->_checkDir($filepath, $this->_resource_dir);
        return true;
    }
379285
public function storePublicly($path, $options = [])
    {
        $options = $this->parseOptions($options);

        $options['visibility'] = 'public';

        return $this->storeAs($path, $this->hashName(), $options);
    }
592095
public function isPath($path, $isRegex = false)
    {
        if ($isRegex) {
            return preg_match('#^'.$path.'$#', $this->path) === 1;
        } else {
            return $this->path == $path;
        }
    }
411760
protected function getUrlPath($path, $exitsFile = false): string
    {
        $this->checkRoot();

        $path = $this->cleanPathInternal($path);
        if ($this->isVirtual($path)) {
            $path = $this->get($path);
        }

        $subject = $path;
        $pattern = '/^' . preg_quote($this->root, '/') . '/i';

        if ($exitsFile && !$this->isVirtual($path) && !file_exists($path)) {
            $subject = null;
        }

        return ltrim(preg_replace($pattern, '', $subject), '/');
    }
1126770
public function getBasePublicPath()
    {
        $projectPath = $this->getBasePath();
        $publicPath = $this->publicPathExists()
            ? Util::joinPaths($projectPath, self::PUBLIC_PATH, self::RESOURCES_PATH)
            : Util::joinPaths($projectPath, self::RESOURCES_PATH);
        return $publicPath;
    }
1105019
public function getUrlFromPath($assetPath)
    {
        // Ensure platform independency
        $path = str_replace('\\', '/', $assetPath);

        $filePath = pathinfo($path);

        $fileType = array_key_exists(strtolower($filePath['extension']), config('nodes.assets.providers.publicFolder.imageExtensionMimeTypes')) ? 'images' : 'data';

        // If the asset is type 'data', show the raw file. If it's 'image' we want to use the CDN
        if ($fileType == 'data') {
            return  $this->getUrlProtocol().config('nodes.assets.providers.publicFolder.domain').'/'.config('nodes.assets.providers.publicFolder.subFolder').'/'.$path;
        } else {
            $fileParts = explode('/', $path);

            return route('nodes.assets.public_folder.cdn', $fileParts);
        }
    }
314802
public function getFiles(string $path, bool $isRecursive = false) : array
    {
        if (!$this->isDirectory($path)) {
            return [];
        }

        $files = [];
        $iter = new RecursiveIteratorIterator(
            new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS),
            RecursiveIteratorIterator::SELF_FIRST,
            RecursiveIteratorIterator::CATCH_GET_CHILD
        );

        if (!$isRecursive) {
            $iter->setMaxDepth(0);
        }

        foreach ($iter as $path => $item) {
            if ($item->isFile()) {
                $files[] = $path;
            }
        }

        return $files;
    }