public function __construct($path, $vars = array())
{
$this->pipeline = Pipeline::getCurrentInstance();
$this->locator = $this->pipeline->getLocator();
$this->path = trim(trim($path, '/'), '\\');
$this->directory = '.' === ($dirname = dirname($path)) ? '' : $dirname;
$this->vars = $vars;
$this->file = basename($path);
list($this->name, $this->type, $i) = $this->locator->getNameAndExtension($this->file);
$this->path_with_simple_filename = ('' === $this->directory ? '' : $this->directory . '/') . $this->name;
$this->filepath = $this->locator->getFile($this->path_with_simple_filename, $this->type);
$this->full_filename = basename($this->filepath);
if (!$this->type) {
vdump($this->type, $path, 'no type');
}
$full_filename_parts = explode('.', $this->full_filename);
$this->filters = array_reverse(array_slice($full_filename_parts, $i + 1));
//['less', 'php'] => ['php', 'less']
if (in_array($this->type, array('html', 'css', 'js'))) {
$this->pipeline->addDependency($this->type, $this->filepath);
}
}