Find the given value in the INI array
If not found, returns the currently set value

@param string $path "Path" to the value
@param array $ini Current INI settings
@return string Found INI value
491571
public function findValue($path, &$ini)
	{
		$value = false;

		if (array_key_exists($path, $ini)) {
			$value = $ini[$path];
		} else {
			// not in the file, pull out the default
			$value = ini_get($path);
			$ini[$path] = $value;
		}

		return $value;
	}
948418
public static function LoadCache ($ini_path, $cache_file_path) {
		clearstatcache(false, $cache_file_path);
		clearstatcache(false, $ini_path);
		return file_exists($cache_file_path) && filemtime($cache_file_path) < filemtime($ini_path) ? include $cache_file_path : null;
	}
220581
public function find($path, $i = 0)
    {
        Argument::i()
            //Argument 1 must be a string
            ->test(1, 'string')
            //Argument 2 must be an integer
            ->test(2, 'int');
        
        if ($i >= count($this->tree)) {
            return null;
        }

        $current = $this->tree[$i];

        //if they are asking for the parent
        if (strpos($path, '../') === 0) {
            return $this->find(substr($path, 3), $i + 1);
        }
        
        if (strpos($path, './') === 0) {
            return $this->find(substr($path, 2), $i);
        }
        
        //separate by .
        $path = explode('.', $path);
        $last = count($path) - 1;

        foreach ($path as $i => $node) {
            //is it the last ?
            if ($i === $last) {
                //does it exist?
                if (isset($current[$node])) {
                    return $current[$node];
                }
                
                //is it length ?
                if ($node === 'length') {
                    //is it a string?
                    if (is_string($current)) {
                        return strlen($current);
                    }
                    
                    //is it an array?
                    if (is_array($current) || $current instanceof \Countable) {
                        return count($current);
                    }
                    
                    //we cant count it, so it's 0
                    return 0;
                }
            }
            
            //we are not at the last node...
            
            //does the node exist and is it an array ?
            if (isset($current[$node]) && is_array($current[$node])) {
                //great we can continue
                $current = $current[$node];
                continue;
            }
            
            //if it exists and we are just getting the length
            if (isset($current[$node]) && $path[$i + 1] === 'length' && ($i + 1) === $last) {
                //let it continue
                continue;
            }
            
            //if we are here, then there maybe a node in current,
            //but there's still more nodes to process
            //either way it cannot be what we are searching for
            break;
        }

        return null;
    }
1246665
private function get($arr, $path)
    {
        foreach (explode('.', $path) as $prop) {
            $arr = $arr[$prop];
        }
        return $arr;
    }
314144
protected function evaluateFile(array $ini)
	{
		$savePath = $this->findValue('session.save_path', $ini);

		if ($savePath === '/tmp') {
			$this->setDescription('Custom path not set, default (/tmp) is world writeable');
			$this->fail();
			return false;
		}

		if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
			$this->na();
			$this->setDescription('Cannot check Windows permissions. Please verify them manually');
			return true;
		}

		$perms = substr(sprintf('%o', fileperms($savePath)), - 3);
		if ($perms == 777) {
			$this->fail();
			$this->setDescription('Path '.$savePath.' is world writeable');
			return false;
		} else {
			$this->pass();
			return true;
		}
	}
619538
function setPath($path = null)
    {
        if ($path === null)
            $path = array();

        // the associate array is useless
        $this->_pathSequence = array_values( (array) $path);
        return $this;
    }
860717
protected static function initPath($path)
    {
        // Fallback
        if (empty($path)) {
            $defaultDir = self::getProperty('application.startdir');
            $path = $defaultDir . DIRECTORY_SEPARATOR . self::DEFAULT_BUILD_FILENAME;
        }

        // Adding filename if necessary
        if (is_dir($path)) {
            $path .= DIRECTORY_SEPARATOR . self::DEFAULT_BUILD_FILENAME;
        }

        // Check if path is available
        $dirname = dirname($path);
        if (is_dir($dirname) && !is_file($path)) {
            return $path;
        }

        // Path is valid, but buildfile already exists
        if (is_file($path)) {
            throw new ConfigurationException('Buildfile already exists.');
        }

        throw new ConfigurationException('Invalid path for sample buildfile.');
    }
407510
public static function getValueFromXPath($path, \DOMXPath $xpath, \DomNode $context = null, $default = null)
    {
        $result = $xpath->query($path, $context);
        if (0 === $result->length) {
            return $default;
        }

        $item = $result->item(0);
        if (null === $item) {
            return $default;
        }

        return $item->nodeValue;
    }
712431
public function getValueByPath($path)
    {
        if (is_string($path)) {
            $path = $this->parsePath($path);
        }

        $child = $this->data;

        foreach ($path as $part) {
            if (isset($child[$part])) {
                $child = $child[$part];
            } else {
                return null;
            }
        }

        return $child;
    }
887250
private function loadIniFile($path)
    {
        $data = parse_ini_file($path, true);
        if ($data === false) {
            throw new UnexpectedValueException(
                sprintf('INI file "%s" is empty or invalid', $path)
            );
        }

        return $data;
    }
575289
public function getConfigValueFromPath($path)
    {
        /** @var Configuration $node */
        $node = $this->configuration;

        foreach (explode('/', $path) as $nodeName) {
            if (!is_object($node)) {
                return null;
            }

            $node = $node->{'get' . ucfirst($nodeName)}();
        }

        return $node;
    }
1089472
public static function setting($path, $default = null)
    {
        $setting = Configure::read('Settings.' . $path);

        if ($setting === null) {
            $setting = Configure::read('Wasabi.' . $path);
        }

        if ($setting === null) {
            return $default;
        }

        return $setting;
    }
1221019
public function get($path, $default = null)
    {
        $array = $this->getValues();

        if (!empty($path)) {
            $keys = $this->explode($path);

            foreach ($keys as $key) {
                if (isset($array[$key])) {
                    $array = $array[$key];
                } else {
                    return $default;
                }
            }
        }

        return $array;
    }
733555
public static function get($ini_file, $scanner_mode = INI_SCANNER_RAW)
    {
        self::$path_to_ini_file = $ini_file;

        if (file_exists(self::$path_to_ini_file) === true) {
            self::$data_ini_file = @parse_ini_file(self::$path_to_ini_file, true, $scanner_mode);
        } else {
            throw new \Exception(sprintf('File ini does not exist: %s', self::$path_to_ini_file));
        }

        if (self::$data_ini_file === false) {
            throw new \Exception(sprintf('Unable to parse file ini: %s', self::$path_to_ini_file));
        }

        return self::$data_ini_file;
    }
966121
public function get($path, $default = NULL)
    {
        $item = ArrayUtils::getValueOrNull($path, $this->container);

        return $item ? $item : $default;
    }
488688
public function execute($key, $value, $ini)
	{
		$found = $this->findValue($key, $ini);
		if (empty($found)) {
			return false;
		}
		return true;
	}
829548
public function loadFile($path) {
        $config = null;
        $mode = defined('INI_SCANNER_TYPED') ? INI_SCANNER_TYPED : INI_SCANNER_NORMAL;

        try {
            $config = parse_ini_file($path, true, $mode);
        } catch (Exception $ex) {}

        if ( ! is_array($config)) {
            throw new InvalidConfigFormatException(
                s('IniConfigDriver expects config at path %s to be a valid ini file.', $path)
            );
        }

        return $config;
    }