Pickle\Package\PHP\Command\Build\Windows::getInfoFromPhpizeLog PHP Method

getInfoFromPhpizeLog() protected method

protected getInfoFromPhpizeLog ( )
    protected function getInfoFromPhpizeLog()
    {
        $ret = array('php_major' => null, 'php_minor' => null, 'php_patch' => null);
        $tmp = $this->getLog('phpize');
        if (!preg_match(",Rebuilding configure.js[\n\r\\d:]+\\s+(.+)[\n\r]+,", $tmp, $m)) {
            throw new \Exception("Couldn't determine PHP development SDK path");
        }
        $sdk = $m[1];
        $ver_header = file_get_contents("{$sdk}/include/main/php_version.h");
        if (!preg_match(",PHP_MAJOR_VERSION\\s+(\\d+),", $ver_header, $m)) {
            throw new \Exception("Couldn't determine PHP_MAJOR_VERSION");
        }
        $ret['php_major'] = $m[1];
        if (!preg_match(",PHP_MINOR_VERSION\\s+(\\d+),", $ver_header, $m)) {
            throw new \Exception("Couldn't determine PHP_MINOR_VERSION");
        }
        $ret['php_minor'] = $m[1];
        if (!preg_match(",PHP_RELEASE_VERSION\\s+(\\d+),", $ver_header, $m)) {
            throw new \Exception("Couldn't determine PHP_RELEASE_VERSION");
        }
        $ret['php_patch'] = $m[1];
        return $ret;
    }