Back to Patcher class

Method getSource

protected array
getSource
(mixed $src)
Get the lines of a source file
Parameters
  • string $src The path of a file
Returns
  • array The lines of the source file
Since
  • 3.0.0
Class: Patcher
Project: Joomla

Method getSource - Source code

/**
 * Get the lines of a source file
 *
 * @param   string  $src  The path of a file
 *
 * @return  array  The lines of the source file
 *
 * @since   3.0.0
 */
protected function &getSource($src)
{
    if (!isset($this->sources[$src])) {
        $this->sources[$src] = null;
        if (is_readable($src)) {
            $this->sources[$src] = self::splitLines(file_get_contents($src));
        }
    }
    return $this->sources[$src];
}