You are here

function lessc::getEnv in Less CSS Preprocessor 6.3

2 calls to lessc::getEnv()
lessc::chunk in lessphp/lessc.inc.php
lessc::value in lessphp/lessc.inc.php

File

lessphp/lessc.inc.php, line 1119

Class

lessc

Code

function getEnv($path) {
  if (!is_array($path)) {
    $path = array(
      $path,
    );
  }

  //  move @ tags out of variable namespace
  foreach ($path as &$tag) {
    if ($tag[0] == $this->vPrefix) {
      $tag[0] = $this->mPrefix;
    }
  }
  $env = $this
    ->get(array_shift($path));
  while ($sub = array_shift($path)) {
    if (isset($env[$sub])) {

      // todo add a type check for environment
      $env = $env[$sub];
    }
    else {
      $env = null;
      break;
    }
  }
  return $env;
}