public function parsePropertyFile(BuildInterface $build, $fileName)
    {
        $activeProperty = false;
        $trimNextLine = false;
        $arr = array();
        $fh = fopen($fileName, 'r');
        if (is_resource($fh)) {
            while ($line = fgets($fh)) {
                if (preg_match('/^[!#].*/', $line)) {
                    // comment
                } elseif (preg_match("/^.*?([\._-\w]+?)\s*[=:]+\s*(.*)$/", $line, $matches)) {
                    // we have a key definition
                    $activeProperty = true;
                    $key = $matches[1];
                    $valuePart = $matches[2];
                    $arr[$key] = trim($valuePart);
                    if ($arr[$key]{strlen($arr[$key]) - 1} == '\\') {
                        $arr[$key] = substr($arr[$key], 0, -1);
                        $trimNextLine = true;
                    } else {
                        $trimNextLine = false;
                    }
                } elseif ($activeProperty) {
                    $trimmed = trim($line);
                    if (empty($trimmed)) {
                        $activeProperty = false;
                        continue;
                    } elseif ($trimNextLine) {
                        $line = $trimmed;
                    } else {
                        $line = rtrim($line);
                    }
                    $arr[$key] .= "\n".$line;
                    if ($arr[$key]{strlen($arr[$key]) - 1} == '\\') {
                        $arr[$key] = substr($arr[$key], 0, -1);
                        $trimNextLine = true;
                    } else {
                        $trimNextLine = false;
                    }
                }
            }
            foreach ($arr as $key => $value) {
                $build->debug('Setting property "${'.$key.'}" to "'.$value.'"');
                $build->setProperty($key, stripcslashes($value));
            }
        } else {
            $build->error('Cannot read from property file: '.$fileName);
        }
    }
public function parsePropertyFile(BuildInterface $build, $fileName)
    {
        $activeProperty = false;
        $trimNextLine = false;
        $arr = array();
        $fh = fopen($fileName, 'r');
        if (is_resource($fh)) {
            while ($line = fgets($fh)) {
                if (preg_match('/^[!#].*/', $line)) {
                    // comment
                } elseif (preg_match("/^.*?([\._-\w]+?)\s*[=:]+\s*(.*)$/", $line, $matches)) {
                    // we have a key definition
                    $activeProperty = true;
                    $key = $matches[1];
                    $valuePart = $matches[2];
                    $arr[$key] = trim($valuePart);
                    if ($arr[$key]{strlen($arr[$key]) - 1} == '\\') {
                        $arr[$key] = substr($arr[$key], 0, -1);
                        $trimNextLine = true;
                    } else {
                        $trimNextLine = false;
                    }
                } elseif ($activeProperty) {
                    $trimmed = trim($line);
                    if (empty($trimmed)) {
                        $activeProperty = false;
                        continue;
                    } elseif ($trimNextLine) {
                        $line = $trimmed;
                    } else {
                        $line = rtrim($line);
                    }
                    $arr[$key] .= "\n".$line;
                    if ($arr[$key]{strlen($arr[$key]) - 1} == '\\') {
                        $arr[$key] = substr($arr[$key], 0, -1);
                        $trimNextLine = true;
                    } else {
                        $trimNextLine = false;
                    }
                }
            }
            foreach ($arr as $key => $value) {
                $build->debug('Setting property "${'.$key.'}" to "'.$value.'"');
                $build->setProperty($key, stripcslashes($value));
            }
        } else {
            $build->error('Cannot read from property file: '.$fileName);
        }
    }
public function parsePropertyFile ( BuildInterface $ build , $ fileName ) { $ activeProperty = false ; $ trimNextLine = false ; $ arr = array ( ) ; $ fh = fopen ( $ fileName , 'r' ) ; if ( is_resource ( $ fh ) ) { while ( $ line = fgets ( $ fh ) ) { if ( preg_match ( '/^[!#].*/' , $ line ) ) { // comment } elseif ( preg_match ( "/^.*?([\._-\w]+?)\s*[=:]+\s*(.*)$/" , $ line , $ matches ) ) { // we have a key definition $ activeProperty = true ; $ key = $ matches [ 1 ] ; $ valuePart = $ matches [ 2 ] ; $ arr [ $ key ] = trim ( $ valuePart ) ; if ( $ arr [ $ key ] { strlen ( $ arr [ $ key ] ) - 1 } == '\\' ) { $ arr [ $ key ] = substr ( $ arr [ $ key ] , 0 , - 1 ) ; $ trimNextLine = true ; } else { $ trimNextLine = false ; } } elseif ( $ activeProperty ) { $ trimmed = trim ( $ line ) ; if ( empty ( $ trimmed ) ) { $ activeProperty = false ; continue ; } elseif ( $ trimNextLine ) { $ line = $ trimmed ; } else { $ line = rtrim ( $ line ) ; } $ arr [ $ key ] .= "\n" . $ line ; if ( $ arr [ $ key ] { strlen ( $ arr [ $ key ] ) - 1 } == '\\' ) { $ arr [ $ key ] = substr ( $ arr [ $ key ] , 0 , - 1 ) ; $ trimNextLine = true ; } else { $ trimNextLine = false ; } } } foreach ( $ arr as $ key => $ value ) { $ build -> debug ( 'Setting property "${' . $ key . '}" to "' . $ value . '"' ) ; $ build -> setProperty ( $ key , stripcslashes ( $ value ) ) ; } } else { $ build -> error ( 'Cannot read from property file: ' . $ fileName ) ; } }
loads properties from a property file.

@param BuildInterface $build
@param string         $fileName
loads properties from a property file .