Compare commits

...

32 Commits

Author SHA1 Message Date
Anatol Belski
4074dc7e18 release 2.0.3 2017-05-08 19:29:44 +02:00
Anatol Belski
bef5693b20 Allow down to vc11
It still can be coupled with sdk 8.1, so while no particularly practical
for PHP, still might be useful. We still keep on vc14 as lowest for PHP.
2017-05-08 19:09:26 +02:00
Anatol Belski
09a5e2bedc cut off trailing slash, so unify with setvars part 2017-05-08 18:35:16 +02:00
Anatol Belski
49f6a761e2 improve path check for vc15+ 2017-05-08 18:32:23 +02:00
Anatol Belski
c385a12d58 further improvements to crt version checks 2017-05-08 18:21:54 +02:00
Anatol Belski
07546d9304 simplify 2017-05-08 18:09:18 +02:00
Anatol Belski
79da1ed7af improve crt version check 2017-05-08 18:07:33 +02:00
Anatol Belski
5ccdabeb39 fix crt version check, be future compatible 2017-05-08 17:36:24 +02:00
Anatol Belski
31291b5aba fix previous breach, get path before shifts 2017-05-08 16:43:22 +02:00
Anatol Belski
dc0a5cce5b rework starter, so no intermediate vars are left on the env 2017-05-08 16:39:32 +02:00
Anatol Belski
af67c49c46 extend local template 2017-05-08 16:06:38 +02:00
Anatol Belski
513dd29f8a back to dev 2017-04-26 16:34:24 +02:00
Anatol Belski
1a8c2e03b7 prepare for tag 2017-04-26 16:33:10 +02:00
Anatol Belski
866ffa7b3c upgrade vswhere 2017-04-26 16:09:49 +02:00
Anatol Belski
0b764877b2 add pgo subdir to ignore 2017-04-25 18:53:49 +02:00
Anatol Belski
9523a991d8 some more readme 2017-04-25 16:50:40 +02:00
Anatol Belski
b2e434d5a1 extend notes 2017-04-25 16:42:03 +02:00
Anatol Belski
42682a421b move actual vs. branch crt check to global stage 2017-04-25 15:24:52 +02:00
Anatol Belski
3dfcb7ccd1 bail out if the active crt is not what the branch tells 2017-04-25 12:34:44 +02:00
Anatol Belski
b79e4ba51b update tag name 2017-04-24 22:33:42 +02:00
Anatol Belski
1ce16ca360 back to dev 2017-04-24 19:43:36 +02:00
Anatol Belski
80e2aec078 prepare version for tag 2017-04-24 19:42:07 +02:00
Anatol Belski
f88e36cc2b implement phpsdk_deps --no-backup 2017-04-24 19:32:13 +02:00
Anatol Belski
524f27bd17 change msg 2017-04-24 19:19:52 +02:00
Anatol Belski
e0d0c67953 implement --force for deps update 2017-04-16 13:59:35 +02:00
Anatol Belski
6c2eee890e missed that 2017-04-15 01:01:48 +02:00
Anatol Belski
1e51c38c22 upgrade bundled php to 7.1.4 2017-04-13 14:37:10 +02:00
Anatol Belski
14c2e7f32e replace custom re2c build by msys2 pkg 2017-04-02 22:36:35 +02:00
Anatol Belski
2329abeefb upgrade bison to 3.0.4 2017-04-02 16:49:36 +02:00
Anatol Belski
0050de4131 wrong link syntax 2017-03-30 17:59:33 +02:00
Anatol Belski
71cf47f6f2 explicitly mention legacy branch 2017-03-30 17:58:44 +02:00
Anatol Belski
4abd44bae4 and back to dev 2017-03-30 17:55:08 +02:00
46 changed files with 326 additions and 169 deletions

1
.gitignore vendored
View File

@@ -18,3 +18,4 @@ oracle
# either these two become submodules, or uncomment them
#pgo-build
#rmtools*
pgo

View File

@@ -8,17 +8,18 @@ The PHP SDK itself and the SDK own tools are licensed under the BSD 2-Clause lic
# Overview
The PHP SDK 2.0 is compatible with PHP 7.0 and above. The compatibility with [older versions](http://windows.php.net/downloads/php-sdk/php-sdk-binary-tools-20110915.zip "php-sdk-binary-tools-20110915.zip") is kept. The toolset was significantly revamped. Newer tools are now available, better workflows are now possible. The toolset consists on a mix of the hand written scripts, selected MSYS2 parts and standalone programs.
The PHP SDK 2.0 is compatible with PHP 7.0 and above. The compatibility with [older versions](http://windows.php.net/downloads/php-sdk/php-sdk-binary-tools-20110915.zip "php-sdk-binary-tools-20110915.zip") is kept, also available from the [legacy branch](https://github.com/OSTC/php-sdk-binary-tools/tree/legacy). The toolset was significantly revamped. Newer tools are now available, better workflows are now possible. The toolset consists on a mix of the hand written scripts, selected MSYS2 parts and standalone programs.
# Requirements
- `Visual C++ 2015` or `Visual C++ 2017` must be installed prior SDK usage
- if `Cygwin` is installed, please read notes in the pitfalls section
- if a 64-bit build is intended, a 64-bit system is required. Cross compilation of 64-bit on 32-bit system is not supported at the moment
- The PHP SDK was successfully tested on Windows 7 or later, earlier versions might work but are not recommended
# Tools
All the tools included are either scripts or 32-bit binaries. They are therefore runable on any of x86 or x64 Windows system.
All the tools included are either scripts or 32-bit binaries. They are therefore runable on any of x86 or x64 supported Windows system.
## SDK
@@ -59,14 +60,14 @@ It is not required to hold the source in the PHP SDK directory. It could be usef
- `git clone https://github.com/OSTC/php-sdk-binary-tools.git c:\php-sdk`
- `cd c:\php-sdk`
- `git checkout new_binary_tools`
- invoke `phpsdk-vc14-x64.bat`
- `git checkout php-sdk-2.0.0` or later
- invoke `phpsdk-vc15-x64.bat`
- `phpsdk_buildtree phpmaster`
- `git clone https://github.com/php/php-src.git && cd php-src`, or fetch a zipball
- `phpsdk_deps --update --branch master`
- do the build, eg. `buildconf && configure --enable-cli && nmake`
TODO more extensive documentation on the wiki.
More extensive documentation can be found on the [wiki](https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2 "PHP wiki page").
## The old way
@@ -77,7 +78,7 @@ TODO more extensive documentation on the wiki.
## Custom environment setup
A sript called phpsdk-local.bat has to be put into the PHP SDK root. If present, it will be automatically picked up by the starter script. A template for such a script is included with the PHP SDK. This allows to automatically meet any required preparations, that are not foreseen by the standard PHP SDK startup. Be careful while creating your own phpsdk-local. It's your responsibility to ensure the regular PHP SDK startup isn't broken after phpsdk-local was injected into the startup sequence.
A sript called phpsdk-local.bat has to be put into the PHP SDK root. If present, it will be automatically picked up by the starter script. A template for such a script is included with the PHP SDK. This allows to automatically meet any required preparations, that are not foreseen by the standard PHP SDK startup. Be careful while creating your own phpsdk-local. It's your responsibility to ensure the regular PHP SDK startup isn't broken after phpsdk-local.bat was injected into the startup sequence.
## Console emulator integration
@@ -92,10 +93,12 @@ An elementary functionality to run unattended builds is included. See an example
# Upgrading
- backup phpsdk-local.bat
- backup the source trees and any other custom files in the PHP SDK root
- backup the source trees and any other custom files in the PHP SDK root, if any present
- move the PHP SDK folder into trash
- download, unpack and the new PHP SDK version under the same path
- move the custom files back into their respective places
- move the custom files back in their respective places
If the PHP SDK is kept as a git checkout, merely what is needed instead is to git fetch and to checkout an updated git tag.
# Extending
@@ -107,4 +110,6 @@ The SDK tools are based on the KISS principle and should be kept so. Basic tools
- SDK or PHP sources put into too long paths, will cause an issue.
- If Cygwin is installed, it might cause issues. If it's unavoidable, to have Cygwin on the same machine, ensure SDK preceeds it on the PATH.
- Tools, based on MSYS2, only accept paths with forward slashes.
- Both Visual C++ toolset and the Windows SDK components have to be installed for the PHP SDK to work properly.
- The VC++ toolset is still requried, even if another compiler, fe. clang, is intended to be used.

View File

@@ -1 +1 @@
2.0.0
2.0.3

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
bin/php/nghttp2.dll Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -5,7 +5,7 @@ include dirname(__FILE__) . "/../lib/php/libsdk/autoload.php";
use SDK\Config;
use SDK\Exception;
$sopt = "s:cuhb:a:d:t:";
$sopt = "s:cuhb:a:d:t:fn";
$lopt = array(
"branch:",
"update",
@@ -15,6 +15,8 @@ $lopt = array(
"crt:",
"help",
"deps:",
"force",
"no-backup",
);
$cmd = NULL;
@@ -22,6 +24,8 @@ $stability = NULL;
$arch = NULL;
$branch = NULL;
$crt = NULL;
$force = false;
$backup = true;
try {
@@ -76,6 +80,16 @@ try {
case "crt":
Config::setCurrentCrtName($val);
break;
case "f":
case "force":
$force = true;
break;
case "n":
case "no-backup":
$backup = false;
break;
}
}
@@ -155,6 +169,11 @@ try {
Config::setCurrentCrtName(array_keys($branch)[0]);
}
}
/* The current CRT needs to match the config one. */
$active_crt = getenv("PHP_SDK_VC");
if (Config::getCurrentCrtName() != $active_crt && !$force) {
throw new Exception("Active CRT '$active_crt' differs from the branch CRT '" . Config::getCurrentCrtName() . "'.");
}
if (NULL === Config::getCurrentStabilityName()) {
if ("master" == Config::getCurrentBranchName()) {
@@ -182,7 +201,10 @@ try {
}
break;
case "update":
$dm->performUpdate($msg);
if ($force) {
print "Replacing the current deps by the force option.\n\n";
}
$dm->performUpdate($msg, $force, $backup);
msg($msg);
break;
}
@@ -208,6 +230,8 @@ function usage(int $code = -1)
echo " -u --update Update dependencies. If deps directory already exists, backup copy is created automatically.", PHP_EOL, PHP_EOL;
echo "Misc:", PHP_EOL;
echo " -d --deps Path to the dependencies directory. If omited, CWD is used to guess.", PHP_EOL;
echo " -f --force Force the operation even if there are no upgrades available.", PHP_EOL;
echo " -n --no-backup Replace the current dependencies without creating backup.", PHP_EOL;
echo " -h --help Show help message.", PHP_EOL, PHP_EOL;
echo "Example: ", PHP_EOL;
echo " phpsdk_deps -c -b master", PHP_EOL;

View File

@@ -22,7 +22,7 @@ if "%PHP_SDK_ARCH%"=="x64" (
echo Build architecture: 32-bit
)
echo Visual C++: %PHP_SDK_VC:~2%
echo Visual C++: %PHP_SDK_VC_NUM%
echo PHP-SDK path: %PHP_SDK_ROOT_PATH%

View File

@@ -13,12 +13,32 @@ if "%1"=="-h" goto :help
if "%1"=="--help" goto :help
if "%2"=="" goto :help
if /i not "%1"=="vc14" (
if /i not "%1"=="vc15" (
echo Unsupported runtime "%1"
goto out_error
)
set PHP_SDK_VC=%1
if /i not "%PHP_SDK_VC:~0,2%"=="vc" (
:malformed_vc_string
echo Malformed CRT string "%1"
set PHP_SDK_VC=
goto out_error
)
if ""=="%PHP_SDK_VC:~2%" (
goto malformed_vc_string
)
set /a TMP_CHK=%PHP_SDK_VC:~2%
if 11 gtr %TMP_CHK% (
if "0"=="%TMP_CHK%" (
if not "0"=="%PHP_SDK_VC:~2%" (
set TMP_CHK=
goto malformed_vc_string
)
)
echo At least vc14 is required
set PHP_SDK_VC=
set TMP_CHK=
goto out_error
)
set PHP_SDK_VC_NUM=%TMP_CHK%
set TMP_CHK=
if /i not "%2"=="x64" (
if /i not "%2"=="x86" (
@@ -27,7 +47,6 @@ if /i not "%2"=="x64" (
)
)
set PHP_SDK_VC=%1
set PHP_SDK_ARCH=%2
rem check OS arch
@@ -45,7 +64,7 @@ if not errorlevel 1 (
set TMPKEY=
rem get vc base dir
if /i "%1"=="vc14" (
if 15 gtr %PHP_SDK_VC_NUM% (
if /i "%PHP_SDK_OS_ARCH%"=="x64" (
set TMPKEY=HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\%PHP_SDK_VC:~2%.0\Setup\VC
) else (
@@ -59,12 +78,16 @@ if /i "%1"=="vc14" (
for /f "tokens=2*" %%a in ('reg query !TMPKEY! /v ProductDir') do set PHP_SDK_VC_DIR=%%b
) else (
rem vc15 support only for now, could parse out and pass on later
for /f "tokens=1* delims=: " %%a in ('%~dp0\vswhere -nologo -version 15 -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath -format text') do set PHP_SDK_VC_DIR=%%b\VC
for /f "tokens=1* delims=: " %%a in ('%~dp0\vswhere -nologo -version %PHP_SDK_VC_NUM% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath -format text') do set PHP_SDK_VC_DIR=%%b\VC
set VSCMD_ARG_no_logo=nologo
if not exist "!PHP_SDK_VC_DIR!" (
echo Could not determine '%PHP_SDK_VC%' directory
goto out_error;
)
)
set TMPKEY=
if /i "%PHP_SDK_VC%"=="vc14" (
if 15 gtr %PHP_SDK_VC_NUM% (
rem get sdk dir
if /i "%PHP_SDK_OS_ARCH%"=="x64" (
set TMPKEY=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1
@@ -84,13 +107,13 @@ if /i "%PHP_SDK_VC%"=="vc14" (
)
if /i "%PHP_SDK_ARCH%"=="x64" (
if /i "%1"=="vc14" (
if 15 gtr %PHP_SDK_VC_NUM% (
set PHP_SDK_VC_SHELL_CMD="!PHP_SDK_VC_DIR!\vcvarsall.bat" amd64
) else (
set PHP_SDK_VC_SHELL_CMD="!PHP_SDK_VC_DIR!\Auxiliary\Build\vcvarsall.bat" amd64
)
) else (
if /i "%1"=="vc14" (
if 15 gtr %PHP_SDK_VC_NUM% (
set PHP_SDK_VC_SHELL_CMD="!PHP_SDK_VC_DIR!\vcvarsall.bat" x86
) else (
set PHP_SDK_VC_SHELL_CMD="!PHP_SDK_VC_DIR!\Auxiliary\Build\vcvarsall.bat" x86

Binary file not shown.

Binary file not shown.

View File

@@ -1,5 +1,9 @@
@echo off
rem edit if PGO scripts are present and are to be used
rem set PHP_SDK_PGO_TOOLS_ROOT_PATH=%PHP_SDK_ROOT_PATH%\pgo
rem set PATH=%PHP_SDK_PGO_TOOLS_ROOT_PATH%\bin;%PATH%
set PGSQL_TEST_CONNSTR=host=127.0.0.1 dbname=test port=5432 user=test password=test
set PDO_PGSQL_TEST_DSN=pgsql:host=127.0.0.1 port=5432 dbname=test user=test password=test

View File

@@ -47,11 +47,13 @@ class Manager
/* TODO and implement --force. */
/* FIXME implement rollback */
public function performUpdate(string &$msg = NULL)
public function performUpdate(string &$msg = NULL, bool $force = false, bool $backup = true)
{/*{{{*/
if (!$this->updatesAvailable()) {
$msg = "No updates are available";
return;
if (!$force) {
if (!$this->updatesAvailable()) {
$msg .= "No updates are available";
return;
}
}
$series_data = $this->series->getData();
@@ -82,12 +84,18 @@ class Manager
}
if (file_exists($this->path)) {
$suffix = date("YmdHi");
$new_path = "{$this->path}.$suffix";
if ($backup) {
$suffix = date("YmdHi");
$new_path = "{$this->path}.$suffix";
/* This is fine, it's gonna be on the same drive. */
if (!$this->mv($this->path, $new_path)) {
throw new Exception("Unable to rename '{$this->path}' to '$new_path'");
/* This is fine, it's gonna be on the same drive. */
if (!$this->mv($this->path, $new_path)) {
throw new Exception("Unable to rename '{$this->path}' to '$new_path'");
}
} else {
if (!$this->rm($this->path)) {
throw new Exception("Unable to remove the current dependency dir at '{$this->path}'");
}
}
} else {
$up = dirname($this->path);
@@ -106,9 +114,11 @@ class Manager
$this->series->cache();
/* save new series file, move the updated deps and backup the old ones, cleanup.*/
$msg = "Updates performed successfully. " . PHP_EOL;
if (isset($new_path)) {
$msg .= "Updates performed successfully. " . PHP_EOL;
if ($backup) {
$msg .= "Old dependencies backed up into '$new_path'.";
} else {
$msg .= "No backup was created.";
}
}/*}}}*/
}

Binary file not shown.

Binary file not shown.

BIN
msys2/usr/bin/re2c.exe Normal file

Binary file not shown.

View File

@@ -1,6 +1,6 @@
# bison-i18n.m4 serial 2
dnl Copyright (C) 2005-2006, 2009-2013 Free Software Foundation, Inc.
dnl Copyright (C) 2005-2006, 2009-2015 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,

View File

@@ -52,7 +52,7 @@ into various formats.
-----
Copyright (C) 2002, 2008-2013 Free Software Foundation, Inc.
Copyright (C) 2002, 2008-2015 Free Software Foundation, Inc.
This file is part of GNU Bison.

View File

@@ -2,7 +2,7 @@
# Language-independent M4 Macros for Bison.
# Copyright (C) 2002, 2004-2013 Free Software Foundation, Inc.
# Copyright (C) 2002, 2004-2015 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -437,7 +437,6 @@ m4_define([b4_symbol_action_location],
# b4_symbol_action(SYMBOL-NUM, KIND)
# ----------------------------------
# Run the action KIND (destructor or printer) for SYMBOL-NUM.
# Same as in C, but using references instead of pointers.
m4_define([b4_symbol_action],
[b4_symbol_if([$1], [has_$2],
[b4_dollar_pushdef([(*yyvaluep)],
@@ -1061,3 +1060,6 @@ b4_percent_define_ifdef([api.value.type],
[['%s' and '%s' cannot be used together]],
[%yacc],
[%define api.value.type "union"])])])])
# api.value.union.name.
b4_percent_define_check_kind([api.value.union.name], [keyword])

View File

@@ -2,7 +2,7 @@
# C++ skeleton dispatching for Bison.
# Copyright (C) 2006-2007, 2009-2013 Free Software Foundation, Inc.
# Copyright (C) 2006-2007, 2009-2015 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
# C++ skeleton for Bison
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
# Copyright (C) 2002-2015 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -17,6 +17,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Sanity checks, before defaults installed by c.m4.
b4_percent_define_ifdef([[api.value.union.name]],
[b4_complain_at(b4_percent_define_get_loc([[api.value.union.name]]),
[named %union is invalid in C++])])
m4_include(b4_pkgdatadir/[c.m4])
# b4_comment(TEXT, [PREFIX])
@@ -169,9 +174,12 @@ m4_define([b4_public_types_declare],
/// (External) token type, as returned by yylex.
typedef token::yytokentype token_type;
/// Internal symbol number.
/// Symbol type: an internal symbol number.
typedef int symbol_number_type;
/// The symbol type number to denote an empty symbol.
enum { empty_symbol = -2 };
/// Internal symbol number for tokens (subsumed by symbol_number_type).
typedef ]b4_int_type_for([b4_translate])[ token_number_type;
@@ -204,8 +212,15 @@ m4_define([b4_public_types_declare],
const semantic_type& v]b4_locations_if([,
const location_type& l])[);
/// Destroy the symbol.
~basic_symbol ();
/// Destroy contents, and record that is empty.
void clear ();
/// Whether empty.
bool empty () const;
/// Destructive move, \a s is emptied into this.
void move (basic_symbol& s);
@@ -235,21 +250,23 @@ m4_define([b4_public_types_declare],
/// Constructor from (external) token numbers.
by_type (kind_type t);
/// Record that this symbol is empty.
void clear ();
/// Steal the symbol type from \a that.
void move (by_type& that);
/// The (internal) type number (corresponding to \a type).
/// -1 when this symbol is empty.
/// \a empty when empty.
symbol_number_type type_get () const;
/// The token.
token_type token () const;
enum { empty = 0 };
/// The symbol type.
/// -1 when this symbol is empty.
token_number_type type;
/// \a empty_symbol when empty.
/// An int, not token_number_type, to be able to store empty_symbol.
int type;
};
/// "External" symbols: returned by the scanner.
@@ -318,9 +335,19 @@ m4_define([b4_public_types_define],
template <typename Base>
inline
]b4_parser_class_name[::basic_symbol<Base>::~basic_symbol ()
{
clear ();
}
template <typename Base>
inline
void
]b4_parser_class_name[::basic_symbol<Base>::clear ()
{]b4_variant_if([[
// User destructor.
symbol_number_type yytype = this->type_get ();
basic_symbol<Base>& yysym = *this;
(void) yysym;
switch (yytype)
{
]b4_symbol_foreach([b4_symbol_destructor])dnl
@@ -330,6 +357,15 @@ m4_define([b4_public_types_define],
// Type destructor.
]b4_symbol_variant([[yytype]], [[value]], [[template destroy]])])[
Base::clear ();
}
template <typename Base>
inline
bool
]b4_parser_class_name[::basic_symbol<Base>::empty () const
{
return Base::type_get () == empty_symbol;
}
template <typename Base>
@@ -347,7 +383,7 @@ m4_define([b4_public_types_define],
// by_type.
inline
]b4_parser_class_name[::by_type::by_type ()
: type (empty)
: type (empty_symbol)
{}
inline
@@ -360,12 +396,19 @@ m4_define([b4_public_types_define],
: type (yytranslate_ (t))
{}
inline
void
]b4_parser_class_name[::by_type::clear ()
{
type = empty_symbol;
}
inline
void
]b4_parser_class_name[::by_type::move (by_type& that)
{
type = that.type;
that.type = empty;
that.clear ();
}
inline

View File

@@ -2,7 +2,7 @@
# Common code for C-like languages (C, C++, Java, etc.)
# Copyright (C) 2012-2013 Free Software Foundation, Inc.
# Copyright (C) 2012-2015 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
# C skeleton dispatching for Bison.
# Copyright (C) 2006-2007, 2009-2013 Free Software Foundation, Inc.
# Copyright (C) 2006-2007, 2009-2015 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
# C M4 Macros for Bison.
# Copyright (C) 2002, 2004-2013 Free Software Foundation, Inc.
# Copyright (C) 2002, 2004-2015 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -97,7 +97,8 @@ m4_define([b4_api_PREFIX],
m4_define_default([b4_prefix], [b4_api_prefix])
# If the %union is not named, its name is YYSTYPE.
m4_define_default([b4_union_name], [b4_api_PREFIX[]STYPE])
b4_percent_define_default([[api.value.union.name]],
[b4_api_PREFIX[][STYPE]])
## ------------------------ ##
@@ -560,15 +561,15 @@ b4_locations_if([, yylocationp])[]b4_user_args[);
# b4_symbol_type_register(SYMBOL-NUM)
# -----------------------------------
# Symbol SYMBOL-NUM has a type (for variant) instead of a type-tag.
# Extend the definition of %union's body with a field of that type,
# and extend the symbol's "type" field to point to the field name,
# instead of the type name.
# Extend the definition of %union's body (b4_union_members) with a
# field of that type, and extend the symbol's "type" field to point to
# the field name, instead of the type name.
m4_define([b4_symbol_type_register],
[m4_define([b4_symbol($1, type_tag)],
[b4_symbol_if([$1], [has_id],
[b4_symbol([$1], [id])],
[yytype_[]b4_symbol([$1], [number])])])dnl
m4_append([b4_user_union_members],
m4_append([b4_union_members],
m4_expand([
b4_symbol_tag_comment([$1])dnl
b4_symbol([$1], [type]) b4_symbol([$1], [type_tag]);]))
@@ -608,10 +609,9 @@ m4_copy_force([b4_symbol_value_union], [b4_symbol_value])
])
# ---------------- #
# api.value.type. #
# ---------------- #
# -------------------------- #
# api.value.type = variant. #
# -------------------------- #
# b4_value_type_setup_variant
# ---------------------------
@@ -686,11 +686,13 @@ typedef ]b4_percent_define_get([[api.value.type]])[ ]b4_api_PREFIX[STYPE;
[m4_bmatch(b4_percent_define_get([[api.value.type]]),
[union\|union-directive],
[[#if ! defined ]b4_api_PREFIX[STYPE && ! defined ]b4_api_PREFIX[STYPE_IS_DECLARED
typedef union ]b4_union_name[ ]b4_api_PREFIX[STYPE;
union ]b4_union_name[
]b4_percent_define_get_syncline([[api.value.union.name]])[
union ]b4_percent_define_get([[api.value.union.name]])[
{
]b4_user_union_members[
};
]b4_percent_define_get_syncline([[api.value.union.name]])[
typedef union ]b4_percent_define_get([[api.value.union.name]])[ ]b4_api_PREFIX[STYPE;
# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1
# define ]b4_api_PREFIX[STYPE_IS_DECLARED 1
#endif

View File

@@ -2,7 +2,7 @@
# GLR skeleton for Bison
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
# Copyright (C) 2002-2015 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -178,9 +178,42 @@ m4_if(b4_skeleton, ["glr.c"],
## Output files. ##
## -------------- ##
# Unfortunately the order of generation between the header and the
# implementation file matters (for glr.c) because of the current
# implementation of api.value.type=union. In that case we still use a
# union for YYSTYPE, but we generate the contents of this union when
# setting up YYSTYPE. This is needed for other aspects, such as
# defining yy_symbol_value_print, since we need to now the name of the
# members of this union.
#
# To avoid this issue, just generate the header before the
# implementation file. But we should also make them more independant.
# ----------------- #
# The header file. #
# ----------------- #
# glr.cc produces its own header.
m4_if(b4_skeleton, ["glr.c"],
[b4_defines_if(
[b4_output_begin([b4_spec_defines_file])
b4_copyright([Skeleton interface for Bison GLR parsers in C],
[2002-2015])[
]b4_cpp_guard_open([b4_spec_defines_file])[
]b4_shared_declarations[
]b4_cpp_guard_close([b4_spec_defines_file])[
]b4_output_end()
])])
# ------------------------- #
# The implementation file. #
# ------------------------- #
b4_output_begin([b4_parser_file_name])
b4_copyright([Skeleton implementation for Bison GLR parsers in C],
[2002-2013])[
[2002-2015])[
/* C GLR parser skeleton written by Paul Hilfinger. */
@@ -2550,16 +2583,3 @@ m4_if(b4_prefix, [yy], [],
]b4_epilogue[]dnl
b4_output_end()
# glr.cc produces its own header.
m4_if(b4_skeleton, ["glr.c"],
[b4_defines_if(
[b4_output_begin([b4_spec_defines_file])
b4_copyright([Skeleton interface for Bison GLR parsers in C],
[2002-2013])[
]b4_cpp_guard_open([b4_spec_defines_file])[
]b4_shared_declarations[
]b4_cpp_guard_close([b4_spec_defines_file])[
]b4_output_end()
])])

View File

@@ -1,6 +1,6 @@
# C++ GLR skeleton for Bison
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
# Copyright (C) 2002-2015 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -329,7 +329,7 @@ b4_percent_define_flag_if([[global_tokens_and_yystype]],
b4_defines_if(
[b4_output_begin([b4_spec_defines_file])
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
[2002-2013])[
[2002-2015])[
// C++ GLR parser skeleton written by Akim Demaille.

View File

@@ -2,7 +2,7 @@
# Java skeleton dispatching for Bison.
# Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
# Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
# Java language support for Bison
# Copyright (C) 2007-2013 Free Software Foundation, Inc.
# Copyright (C) 2007-2015 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -1,6 +1,6 @@
# C++ skeleton for Bison
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
# Copyright (C) 2002-2015 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -131,7 +131,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))])])
m4_pushdef([b4_copyright_years],
[2002-2013])
[2002-2015])
m4_define([b4_parser_class_name],
[b4_percent_define_get([[parser_class_name]])])
@@ -149,10 +149,11 @@ b4_variant_if([m4_include(b4_pkgdatadir/[variant.hh])])
m4_define([b4_shared_declarations],
[b4_percent_code_get([[requires]])[
]b4_parse_assert_if([# include <cassert>])[
# include <vector>
# include <cstdlib> // std::abort
# include <iostream>
# include <stdexcept>
# include <string>]b4_defines_if([[
# include <string>
# include <vector>]b4_defines_if([[
# include "stack.hh"
]b4_bison_locations_if([[# include "location.hh"]])])[
]b4_variant_if([b4_variant_includes])[
@@ -214,9 +215,9 @@ b4_location_define])])[
/// Generate an error message.
/// \param yystate the state where the error occurred.
/// \param yytoken the lookahead token type, or yyempty_.
/// \param yyla the lookahead token.
virtual std::string yysyntax_error_ (state_type yystate,
symbol_number_type yytoken) const;
const symbol_type& yyla) const;
/// Compute post-reduction state.
/// \param yystate the current state
@@ -288,16 +289,21 @@ b4_location_define])])[
/// Copy constructor.
by_state (const by_state& other);
/// Record that this symbol is empty.
void clear ();
/// Steal the symbol type from \a that.
void move (by_state& that);
/// The (internal) type number (corresponding to \a state).
/// "empty" when empty.
/// \a empty_symbol when empty.
symbol_number_type type_get () const;
enum { empty = 0 };
/// The state number used to denote an empty symbol.
enum { empty_state = -1 };
/// The state.
/// \a empty when empty.
state_type state;
};
@@ -338,13 +344,12 @@ b4_location_define])])[
/// Pop \a n symbols the three stacks.
void yypop_ (unsigned int n = 1);
// Constants.
/// Constants.
enum
{
yyeof_ = 0,
yylast_ = ]b4_last[, ///< Last index in yytable_.
yynnts_ = ]b4_nterms_number[, ///< Number of nonterminal symbols.
yyempty_ = -2,
yyfinal_ = ]b4_final_state_number[, ///< Termination state number.
yyterror_ = 1,
yyerrcode_ = 256,
@@ -464,7 +469,7 @@ m4_if(b4_prefix, [yy], [],
#endif // !]b4_api_PREFIX[DEBUG
#define yyerrok (yyerrstatus_ = 0)
#define yyclearin (yyempty = true)
#define yyclearin (yyla.clear ())
#define YYACCEPT goto yyacceptlab
#define YYABORT goto yyabortlab
@@ -533,7 +538,7 @@ m4_if(b4_prefix, [yy], [],
// by_state.
inline
]b4_parser_class_name[::by_state::by_state ()
: state (empty)
: state (empty_state)
{}
inline
@@ -541,12 +546,19 @@ m4_if(b4_prefix, [yy], [],
: state (other.state)
{}
inline
void
]b4_parser_class_name[::by_state::clear ()
{
state = empty_state;
}
inline
void
]b4_parser_class_name[::by_state::move (by_state& that)
{
state = that.state;
that.state = empty;
that.clear ();
}
inline
@@ -558,7 +570,10 @@ m4_if(b4_prefix, [yy], [],
]b4_parser_class_name[::symbol_number_type
]b4_parser_class_name[::by_state::type_get () const
{
return state == empty ? 0 : yystos_[state];
if (state == empty_state)
return empty_symbol;
else
return yystos_[state];
}
inline
@@ -574,7 +589,7 @@ m4_if(b4_prefix, [yy], [],
[value], [move], [that.value])],
[[value = that.value;]])[
// that is emptied.
that.type = empty;
that.type = empty_symbol;
}
inline
@@ -611,6 +626,10 @@ m4_if(b4_prefix, [yy], [],
std::ostream& yyoutput = yyo;
YYUSE (yyoutput);
symbol_number_type yytype = yysym.type_get ();
// Avoid a (spurious) G++ 4.8 warning about "array subscript is
// below array bounds".
if (yysym.empty ())
std::abort ();
yyo << (yytype < yyntokens_ ? "token" : "nterm")
<< ' ' << yytname_[yytype] << " ("]b4_locations_if([
<< yysym.location << ": "])[;
@@ -695,9 +714,6 @@ m4_if(b4_prefix, [yy], [],
int
]b4_parser_class_name[::parse ()
{
/// Whether yyla contains a lookahead.
bool yyempty = true;
// State.
int yyn;
/// Length of the RHS of the rule being reduced.
@@ -754,7 +770,7 @@ b4_dollar_popdef])[]dnl
goto yydefault;
// Read a lookahead token.
if (yyempty)
if (yyla.empty ())
{
YYCDEBUG << "Reading a token: ";
try
@@ -768,7 +784,6 @@ b4_dollar_popdef])[]dnl
error (yyexc);
goto yyerrlab1;
}
yyempty = false;
}
YY_SYMBOL_PRINT ("Next token is", yyla);
@@ -788,9 +803,6 @@ b4_dollar_popdef])[]dnl
goto yyreduce;
}
// Discard the token being shifted.
yyempty = true;
// Count tokens shifted since error; after three, turn off error status.
if (yyerrstatus_)
--yyerrstatus_;
@@ -873,8 +885,7 @@ b4_dollar_popdef])[]dnl
{
++yynerrs_;
error (]b4_join(b4_locations_if([yyla.location]),
[[yysyntax_error_ (yystack_[0].state,
yyempty ? yyempty_ : yyla.type_get ())]])[);
[[yysyntax_error_ (yystack_[0].state, yyla)]])[);
}
]b4_locations_if([[
@@ -887,10 +898,10 @@ b4_dollar_popdef])[]dnl
// Return failure if at end of input.
if (yyla.type_get () == yyeof_)
YYABORT;
else if (!yyempty)
else if (!yyla.empty ())
{
yy_destroy_ ("Error: discarding", yyla);
yyempty = true;
yyla.clear ();
}
}
@@ -966,7 +977,7 @@ b4_dollar_popdef])[]dnl
goto yyreturn;
yyreturn:
if (!yyempty)
if (!yyla.empty ())
yy_destroy_ ("Cleanup: discarding lookahead", yyla);
/* Do not reclaim the symbols of the rule whose action triggered
@@ -986,7 +997,7 @@ b4_dollar_popdef])[]dnl
<< std::endl;
// Do not try to display the values of the reclaimed symbols,
// as their printer might throw an exception.
if (!yyempty)
if (!yyla.empty ())
yy_destroy_ (YY_NULLPTR, yyla);
while (1 < yystack_.size ())
@@ -1008,10 +1019,9 @@ b4_dollar_popdef])[]dnl
// Generate an error message.
std::string
]b4_parser_class_name[::yysyntax_error_ (]dnl
b4_error_verbose_if([state_type yystate, symbol_number_type yytoken],
[state_type, symbol_number_type])[) const
b4_error_verbose_if([state_type yystate, const symbol_type& yyla],
[state_type, const symbol_type&])[) const
{]b4_error_verbose_if([[
std::string yyres;
// Number of reported tokens (one for the "unexpected", one per
// "expected").
size_t yycount = 0;
@@ -1025,7 +1035,7 @@ b4_error_verbose_if([state_type yystate, symbol_number_type yytoken],
the only way this function was invoked is if the default action
is an error action. In that case, don't check for expected
tokens because there are none.
- The only way there can be no lookahead present (in yytoken) is
- The only way there can be no lookahead present (in yyla) is
if this state is a consistent state with a default action.
Thus, detecting the absence of a lookahead is sufficient to
determine that there is no unexpected or expected token to
@@ -1045,8 +1055,9 @@ b4_error_verbose_if([state_type yystate, symbol_number_type yytoken],
token that will not be accepted due to an error action in a
later state.
*/
if (yytoken != yyempty_)
if (!yyla.empty ())
{
int yytoken = yyla.type_get ();
yyarg[yycount++] = yytname_[yytoken];
int yyn = yypact_[yystate];
if (!yy_pact_value_is_default_ (yyn))
@@ -1089,6 +1100,7 @@ b4_error_verbose_if([state_type yystate, symbol_number_type yytoken],
#undef YYCASE_
}
std::string yyres;
// Argument number.
size_t yyi = 0;
for (char const* yyp = yyformat; *yyp; ++yyp)

View File

@@ -1,6 +1,6 @@
# Java skeleton for Bison -*- autoconf -*-
# Copyright (C) 2007-2013 Free Software Foundation, Inc.
# Copyright (C) 2007-2015 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -84,7 +84,7 @@ m4_define([b4_define_state],[[
b4_output_begin([b4_parser_file_name])
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in Java],
[2007-2013])
[2007-2015])
b4_percent_define_ifdef([package], [package b4_percent_define_get([package]);
])[/* First part of user declarations. */

View File

@@ -1,6 +1,6 @@
# C++ skeleton for Bison
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
# Copyright (C) 2002-2015 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
m4_pushdef([b4_copyright_years],
[2002-2013])
[2002-2015])
# b4_position_define
# ------------------
@@ -83,7 +83,7 @@ m4_define([b4_position_define],
}
};
/// Add and assign a position.
/// Add \a width columns, in place.
inline position&
operator+= (position& res, int width)
{
@@ -91,21 +91,21 @@ m4_define([b4_position_define],
return res;
}
/// Add two position objects.
/// Add \a width columns.
inline position
operator+ (position res, int width)
{
return res += width;
}
/// Add and assign a position.
/// Subtract \a width columns, in place.
inline position&
operator-= (position& res, int width)
{
return res += -width;
}
/// Add two position objects.
/// Subtract \a width columns.
inline position
operator- (position res, int width)
{
@@ -216,36 +216,42 @@ m4_define([b4_location_define],
position end;
};
/// Join two location objects to create a location.
inline location operator+ (location res, const location& end)
/// Join two locations, in place.
inline location& operator+= (location& res, const location& end)
{
res.end = end.end;
return res;
}
/// Change end position in place.
/// Join two locations.
inline location operator+ (location res, const location& end)
{
return res += end;
}
/// Add \a width columns to the end position, in place.
inline location& operator+= (location& res, int width)
{
res.columns (width);
return res;
}
/// Change end position.
/// Add \a width columns to the end position.
inline location operator+ (location res, int width)
{
return res += width;
}
/// Change end position in place.
/// Subtract \a width columns to the end position, in place.
inline location& operator-= (location& res, int width)
{
return res += -width;
}
/// Change end position.
inline location operator- (const location& begin, int width)
/// Subtract \a width columns to the end position.
inline location operator- (location res, int width)
{
return begin + -width;
return res -= width;
}
]b4_percent_define_flag_if([[define_location_comparison]], [[
/// Compare two location objects.
@@ -273,8 +279,7 @@ m4_define([b4_location_define],
operator<< (std::basic_ostream<YYChar>& ostr, const location& loc)
{
unsigned int end_col = 0 < loc.end.column ? loc.end.column - 1 : 0;
ostr << loc.begin// << "(" << loc.end << ") "
;
ostr << loc.begin;
if (loc.end.filename
&& (!loc.begin.filename
|| *loc.begin.filename != *loc.end.filename))

View File

@@ -1,6 +1,6 @@
# C++ skeleton for Bison
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
# Copyright (C) 2002-2015 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
m4_pushdef([b4_copyright_years],
[2002-2013])
[2002-2015])
# b4_stack_define
# ---------------
@@ -32,12 +32,12 @@ m4_define([b4_stack_define],
stack ()
: seq_ ()
{
seq_.reserve (200);
}
stack (unsigned int n)
: seq_ (n)
{
}
{}
inline
T&
@@ -114,8 +114,7 @@ m4_define([b4_stack_define],
slice (const S& stack, unsigned int range)
: stack_ (stack)
, range_ (range)
{
}
{}
inline
const T&

View File

@@ -1,6 +1,6 @@
# C++ skeleton for Bison
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
# Copyright (C) 2002-2015 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -95,13 +95,13 @@ m4_define([b4_variant_define],
/// Empty construction.
variant ()]b4_parse_assert_if([
: yytname_ (YY_NULLPTR)])[
: yytypeid_ (YY_NULLPTR)])[
{}
/// Construct and fill.
template <typename T>
variant (const T& t)]b4_parse_assert_if([
: yytname_ (typeid (T).name ())])[
: yytypeid_ (&typeid (T))])[
{
YYASSERT (sizeof (T) <= S);
new (yyas_<T> ()) T (t);
@@ -110,7 +110,7 @@ m4_define([b4_variant_define],
/// Destruction, allowed only if empty.
~variant ()
{]b4_parse_assert_if([
YYASSERT (!yytname_);
YYASSERT (!yytypeid_);
])[}
/// Instantiate an empty \a T in here.
@@ -118,9 +118,9 @@ m4_define([b4_variant_define],
T&
build ()
{]b4_parse_assert_if([
YYASSERT (!yytname_);
YYASSERT (!yytypeid_);
YYASSERT (sizeof (T) <= S);
yytname_ = typeid (T).name ();])[
yytypeid_ = & typeid (T);])[
return *new (yyas_<T> ()) T;
}
@@ -129,9 +129,9 @@ m4_define([b4_variant_define],
T&
build (const T& t)
{]b4_parse_assert_if([
YYASSERT (!yytname_);
YYASSERT (!yytypeid_);
YYASSERT (sizeof (T) <= S);
yytname_ = typeid (T).name ();])[
yytypeid_ = & typeid (T);])[
return *new (yyas_<T> ()) T (t);
}
@@ -140,7 +140,7 @@ m4_define([b4_variant_define],
T&
as ()
{]b4_parse_assert_if([
YYASSERT (yytname_ == typeid (T).name ());
YYASSERT (*yytypeid_ == typeid (T));
YYASSERT (sizeof (T) <= S);])[
return *yyas_<T> ();
}
@@ -150,7 +150,7 @@ m4_define([b4_variant_define],
const T&
as () const
{]b4_parse_assert_if([
YYASSERT (yytname_ == typeid (T).name ());
YYASSERT (*yytypeid_ == typeid (T));
YYASSERT (sizeof (T) <= S);])[
return *yyas_<T> ();
}
@@ -167,8 +167,8 @@ m4_define([b4_variant_define],
void
swap (self_type& other)
{]b4_parse_assert_if([
YYASSERT (yytname_);
YYASSERT (yytname_ == other.yytname_);])[
YYASSERT (yytypeid_);
YYASSERT (*yytypeid_ == *other.yytypeid_);])[
std::swap (as<T> (), other.as<T> ());
}
@@ -198,7 +198,7 @@ m4_define([b4_variant_define],
destroy ()
{
as<T> ().~T ();]b4_parse_assert_if([
yytname_ = YY_NULLPTR;])[
yytypeid_ = YY_NULLPTR;])[
}
private:
@@ -233,7 +233,7 @@ m4_define([b4_variant_define],
} yybuffer_;]b4_parse_assert_if([
/// Whether the content is built: if defined, the name of the stored type.
const char *yytname_;])[
const std::type_info *yytypeid_;])[
};
]])

View File

@@ -3,7 +3,7 @@
<!--
bison.xsl - common templates for Bison XSLT.
Copyright (C) 2007-2013 Free Software Foundation, Inc.
Copyright (C) 2007-2015 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.

View File

@@ -3,7 +3,7 @@
<!--
xml2dot.xsl - transform Bison XML Report into DOT.
Copyright (C) 2007-2013 Free Software Foundation, Inc.
Copyright (C) 2007-2015 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.

View File

@@ -3,7 +3,7 @@
<!--
xml2text.xsl - transform Bison XML Report into plain text.
Copyright (C) 2007-2013 Free Software Foundation, Inc.
Copyright (C) 2007-2015 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.

View File

@@ -3,7 +3,7 @@
<!--
xml2html.xsl - transform Bison XML Report into XHTML.
Copyright (C) 2007-2013 Free Software Foundation, Inc.
Copyright (C) 2007-2015 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.

View File

@@ -1,11 +1,11 @@
-*- C -*-
# Yacc compatible skeleton for Bison
# Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation,
# Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation,
# Inc.
m4_pushdef([b4_copyright_years],
[1984, 1989-1990, 2000-2013])
[1984, 1989-1990, 2000-2015])
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,9 @@
setlocal enableextensions enabledelayedexpansion
set IMHERE=%~dp0
rem this will be eventually overridden by phpsdk_setvars, but nothing wrong to use the same name here
set PHP_SDK_ROOT_PATH=%~dp0
set PHP_SDK_ROOT_PATH=%PHP_SDK_ROOT_PATH:~0,-1%
:getopt
if /i "%1" equ "-h" goto help
@@ -28,9 +30,14 @@ set ARCH=%ARCH: =%
set PHP_SDK_RUN_FROM_ROOT=1
title PHP SDK
call %IMHERE%bin\phpsdk_setshell.bat %CRT% %ARCH%
call %PHP_SDK_ROOT_PATH%\bin\phpsdk_setshell.bat %CRT% %ARCH%
set PHP_SDK_RUN_FROM_ROOT=
set CRT=
set ARCH=
if errorlevel 3 (
exit /b %errorlevel%
@@ -40,25 +47,25 @@ if "%TASK%" neq "" (
if exist "%TASK%" (
set TASK_ARGS=%TASK_ARGS:"=%
if exist "%IMHERE%phpsdk-local.bat" (
cmd /c "!PHP_SDK_VC_SHELL_CMD! && %IMHERE%\bin\phpsdk_setvars.bat && %IMHERE%\phpsdk-local.bat && %TASK% !TASK_ARGS!"
if exist "%PHP_SDK_ROOT_PATH%\phpsdk-local.bat" (
cmd /c "!PHP_SDK_VC_SHELL_CMD! && %PHP_SDK_ROOT_PATH%\bin\phpsdk_setvars.bat && %PHP_SDK_ROOT_PATH%\phpsdk-local.bat && %TASK% !TASK_ARGS!"
) else (
cmd /c "!PHP_SDK_VC_SHELL_CMD! && %IMHERE%\bin\phpsdk_setvars.bat && %TASK% !TASK_ARGS!"
cmd /c "!PHP_SDK_VC_SHELL_CMD! && %PHP_SDK_ROOT_PATH%\bin\phpsdk_setvars.bat && %TASK% !TASK_ARGS!"
)
set TASK=
exit /b
) else (
echo could not find the task file
set TASK=
exit /b 3
)
)
if exist "%IMHERE%phpsdk-local.bat" (
cmd /k "!PHP_SDK_VC_SHELL_CMD! && %IMHERE%\bin\phpsdk_setvars.bat && %IMHERE%\bin\phpsdk_dumpenv.bat && %IMHERE%\phpsdk-local.bat && echo. && set prompt=$P$_$+$$$S"
if exist "%PHP_SDK_ROOT_PATH%\phpsdk-local.bat" (
cmd /k "!PHP_SDK_VC_SHELL_CMD! && %PHP_SDK_ROOT_PATH%\bin\phpsdk_setvars.bat && %PHP_SDK_ROOT_PATH%\bin\phpsdk_dumpenv.bat && %PHP_SDK_ROOT_PATH%\phpsdk-local.bat && echo. && set prompt=$P$_$+$$$S"
) else (
cmd /k "!PHP_SDK_VC_SHELL_CMD! && %IMHERE%\bin\phpsdk_setvars.bat && %IMHERE%\bin\phpsdk_dumpenv.bat && set prompt=$P$_$+$$$S"
cmd /k "!PHP_SDK_VC_SHELL_CMD! && %PHP_SDK_ROOT_PATH%\bin\phpsdk_setvars.bat && %PHP_SDK_ROOT_PATH%\bin\phpsdk_dumpenv.bat && set prompt=$P$_$+$$$S"
)
set PHP_SDK_RUN_FROM_ROOT=
exit /b