public function convert($asset, $basePath)
    {
        $pos = strrpos($asset, '.');
        if ($pos !== false) {
            $srcExt = substr($asset, $pos + 1);
            if (isset($this->commands[$srcExt])) {
                [$ext, $command] = $this->commands[$srcExt];
                $result = substr($asset, 0, $pos + 1) . $ext;
                if ($this->forceConvert || $this->isOutdated($basePath, $asset, $result, $srcExt, $ext)) {
                    $this->runCommand($command, $basePath, $asset, $result);
                }

                return $result;
            }
        }

        return $asset;
    }
public function convert($asset, $basePath)
    {
        $pos = strrpos($asset, '.');
        if ($pos !== false) {
            $srcExt = substr($asset, $pos + 1);
            if (isset($this->commands[$srcExt])) {
                [$ext, $command] = $this->commands[$srcExt];
                $result = substr($asset, 0, $pos + 1) . $ext;
                if ($this->forceConvert || $this->isOutdated($basePath, $asset, $result, $srcExt, $ext)) {
                    $this->runCommand($command, $basePath, $asset, $result);
                }

                return $result;
            }
        }

        return $asset;
    }
public function convert ( $ asset , $ basePath ) { $ pos = strrpos ( $ asset , '.' ) ; if ( $ pos !== false ) { $ srcExt = substr ( $ asset , $ pos + 1 ) ; if ( isset ( $ this -> commands [ $ srcExt ] ) ) { [ $ ext , $ command ] = $ this -> commands [ $ srcExt ] ; $ result = substr ( $ asset , 0 , $ pos + 1 ) . $ ext ; if ( $ this -> forceConvert || $ this -> isOutdated ( $ basePath , $ asset , $ result , $ srcExt , $ ext ) ) { $ this -> runCommand ( $ command , $ basePath , $ asset , $ result ) ; } return $ result ; } } return $ asset ; }
Converts a given asset file into a CSS or JS file.
@param string $asset the asset file path, relative to $basePath
@param string $basePath the directory the $asset is relative to.
@return string the converted asset file path, relative to $basePath.
Converts a given asset file into a CSS or JS file .