Exemple #1
0
 public function findImport($name)
 {
     // Adds support for absolute paths
     if (substr($name, 0, 7) == "file://") {
         $full = substr($name, 7);
         // TODO: Restrict importing of less files within the allowed directories.
         if ($this->fileExists($file = $full . '.less') || $this->fileExists($file = $full)) {
             return $file;
         }
     }
     return parent::findImport($name);
 }
Exemple #2
0
 protected function to($what, &$out, $until = false, $allowNewline = false)
 {
     if (is_string($allowNewline)) {
         $validChars = $allowNewline;
     } else {
         $validChars = $allowNewline ? "." : "[^\n]";
     }
     if (!$this->match('(' . $validChars . '*?)' . FD40_lessc::preg_quote($what), $m, !$until)) {
         return false;
     }
     if ($until) {
         $this->count -= strlen($what);
     }
     // give back $what
     $out = $m[1];
     return true;
 }