Compare commits

...

103 Commits

Author SHA1 Message Date
Anatol Belski
fc185fd315 fix help msg 2016-10-31 19:05:27 +01:00
Anatol Belski
94ff7b53cf fix getopt check with no opt passed 2016-10-31 18:54:54 +01:00
Anatol Belski
217647a68e extend doc 2016-10-31 18:50:14 +01:00
Anatol Belski
52df9f9f4e fix phrase 2016-10-31 18:40:58 +01:00
Anatol Belski
4fb69d4c23 fix some doc 2016-10-31 16:57:41 +01:00
Anatol Belski
e99ec6722c expand on latest features 2016-10-31 16:54:26 +01:00
Anatol Belski
8fecd7c279 the is moved into doc already 2016-10-31 16:43:46 +01:00
Anatol Belski
97b62b2182 move some more stuff into doc 2016-10-31 16:42:50 +01:00
Anatol Belski
2d4aa4d54b bump version 2016-10-31 16:36:43 +01:00
Anatol Belski
0267758ff1 add task.exe tool 2016-10-31 16:36:11 +01:00
Anatol Belski
ca2ccd968a rework phpsdk-starter
- add argument names
- make possible to attach a task script for CI integration
2016-10-31 15:45:56 +01:00
Anatol Belski
422073f540 note about ConEmu 2016-10-30 12:19:51 +01:00
Anatol Belski
08fbbc7cd2 improve phrase 2016-10-29 23:45:00 +02:00
Anatol Belski
182f988f92 rework readme with more info 2016-10-29 23:43:47 +02:00
Anatol Belski
022eaba41e yet more edits 2016-10-29 23:01:44 +02:00
Anatol Belski
2a403e1820 some edits to the readme 2016-10-29 22:18:02 +02:00
Anatol Belski
07efa67e87 remove more unrelated tools 2016-10-29 22:01:42 +02:00
Anatol Belski
e74a98e253 add fixme 2016-10-28 16:13:24 +02:00
Anatol Belski
04aaf65cda accumulate return value 2016-10-28 15:18:36 +02:00
Anatol Belski
33c82a766f fix wording again 2016-10-28 14:14:27 +02:00
Anatol Belski
efb77f4589 add some vim folds 2016-10-28 14:09:01 +02:00
Anatol Belski
cddbe84fe3 add vim mode configs 2016-10-28 14:03:17 +02:00
Anatol Belski
6326bba7a1 rework pkg update msg 2016-10-28 13:27:38 +02:00
Anatol Belski
fdf6827c51 add FileOps trait and rework the deps update routine 2016-10-28 13:24:35 +02:00
Anatol Belski
feb2b675cb unset temp var 2016-10-28 02:18:57 +02:00
Anatol Belski
b60fd588d5 it's alpha4 now 2016-10-28 02:13:27 +02:00
Anatol Belski
4af7617b84 separate dumpenv out 2016-10-28 02:13:01 +02:00
Anatol Belski
7395237e33 edit error msg 2016-10-28 01:59:25 +02:00
Anatol Belski
2bd2595a16 add phpsdk-local example 2016-10-28 01:52:13 +02:00
Anatol Belski
3c204136a2 don't allow to append arbitrary code, but just a local file - that's
enough
2016-10-27 22:28:19 +02:00
Anatol Belski
ac205e153f do necessary followup ns renames 2016-10-27 16:08:29 +02:00
Anatol Belski
71f60852f8 move cache into the config space 2016-10-27 16:02:43 +02:00
Anatol Belski
5999098add check infos also in other scripts if run outside starter shell 2016-10-26 17:18:35 +02:00
Anatol Belski
9f8cf17928 fix phpsdk_deps dies when called with no SdK setup 2016-10-26 17:09:54 +02:00
Anatol Belski
496a4498a1 bump version 2016-10-26 16:49:48 +02:00
Anatol Belski
1162213596 fix order 2016-10-26 16:11:50 +02:00
Anatol Belski
c8e1563cd4 separate list and do it shorter 2016-10-26 16:10:00 +02:00
Anatol Belski
9b139a61c8 remove unnecessary sentence 2016-10-26 16:07:29 +02:00
Anatol Belski
bf84962182 more readme rework 2016-10-26 16:06:10 +02:00
Anatol Belski
d87c132a7e improve note 2016-10-26 16:04:35 +02:00
Anatol Belski
c781649433 add more readme notes 2016-10-26 15:59:05 +02:00
Anatol Belski
bd8b82579f fix starter arg passing, handle error from setshell script 2016-10-26 15:30:00 +02:00
Anatol Belski
d6b76e7f7d split out the phpsdk-starter part and make possible to append scripts 2016-10-26 15:19:03 +02:00
Anatol Belski
7f0015a68c rework the buildtree script 2016-10-26 13:40:14 +02:00
Anatol Belski
23a3eb2473 set console title when run from the starter script 2016-10-26 02:07:10 +02:00
Anatol Belski
296be1b3b4 make the prompt a bit more user friendly 2016-10-26 02:00:53 +02:00
Anatol Belski
3ec0ac9d0b extend .gitignore 2016-10-26 01:20:18 +02:00
Anatol Belski
baf09da395 remove unsupported branches 2016-10-26 01:17:33 +02:00
Anatol Belski
7cf38ce10e improve note on build_tree 2016-10-25 13:11:13 +02:00
Anatol Belski
8d11bd9946 add note about not included tools 2016-10-23 22:16:22 +02:00
Anatol Belski
f9c1089ed6 readme wording 2016-10-23 22:09:40 +02:00
Anatol Belski
7a6d2423e2 add sdk setup checks 2016-10-23 21:42:36 +02:00
Anatol Belski
61c8a9a849 add doc note 2016-10-23 21:37:51 +02:00
Anatol Belski
2684ac07c7 bat files should have windows eol 2016-10-23 21:36:33 +02:00
Anatol Belski
03dd696c99 rename var 2016-10-23 21:34:15 +02:00
Anatol Belski
f32680ead6 bump version, quite a lot happened since the start 2016-10-23 21:22:40 +02:00
Anatol Belski
000e5cfe3e some more doc edits 2016-10-23 21:18:53 +02:00
Anatol Belski
be28a3901e some edits to the REDME
it's basically a rough draft anyway
2016-10-23 21:13:40 +02:00
Anatol Belski
6e425fbf57 update readme 2016-10-23 21:06:31 +02:00
Anatol Belski
1141b512bf Revert "minor fix"
This reverts commit dd1fec0fdb.

it was fine without the dash
2016-10-23 20:14:48 +02:00
Anatol Belski
b00a9bfeb4 strip trailing slashes from the basic path vars 2016-10-23 20:03:20 +02:00
Anatol Belski
b92a5ad29b add some info, formatting and a couple of other improvements 2016-10-23 19:41:29 +02:00
Anatol Belski
dd1fec0fdb minor fix 2016-10-23 19:27:01 +02:00
Anatol Belski
f1c27b9ff5 add dumpenv and rename a bit 2016-10-23 19:22:05 +02:00
Anatol Belski
c7e7d0aa8e git version script 2016-10-23 19:21:39 +02:00
Anatol Belski
c81f7603f8 improve starter scripts 2016-10-23 17:52:50 +02:00
Anatol Belski
1a4dcd135e add sdk shell starter scripts 2016-10-23 02:11:47 +02:00
Anatol Belski
8374a12d19 remove some tools that are unlikely to be useful 2016-10-22 18:43:26 +02:00
Anatol Belski
22a9523d32 signal updates availability also with the exit code 2016-10-22 18:40:55 +02:00
Anatol Belski
ec68a972f8 add checksum utils 2016-10-22 18:39:39 +02:00
Anatol Belski
20c25af856 make wget worky with ssl 2016-10-22 16:33:58 +02:00
Anatol Belski
c104d8f02f Remove some msys2 files, that are not absolutely necessary for PHP
Some more to go, some can be reconcidered later, if needed.
2016-10-22 16:09:40 +02:00
Anatol Belski
b556ae0be7 add special case to put openssl.cnf into template dir
and also rework the deps dir arg
2016-10-20 21:40:57 +02:00
Anatol Belski
0af60fb9be more revamp on usage 2016-10-20 20:55:23 +02:00
Anatol Belski
5478ba102c extend help text 2016-10-20 20:47:40 +02:00
Anatol Belski
987084a5d6 prefix files with phpsdk_ 2016-10-20 20:44:27 +02:00
Anatol Belski
b52253461f revamp the whole branch config thing
The series alone deliver the information about the known branches,
no need to maintain an extra file. The only downside is the absense
of mapping between master and latest, howevere that's fine as it's
only master.
2016-10-20 20:40:36 +02:00
Anatol Belski
0eaad349f2 add package cleanup 2016-10-20 18:34:58 +02:00
Anatol Belski
dd4dd38165 implement cache, allow passing unknown branch and hope for best 2016-10-20 17:57:07 +02:00
Anatol Belski
d9651a2d9b add 7z bins 2016-10-20 15:50:26 +02:00
Anatol Belski
063774e3c9 add missing file 2016-10-20 02:07:54 +02:00
Anatol Belski
a40c832007 add depman wrapper 2016-10-20 01:58:09 +02:00
Anatol Belski
b12afb3233 basic implementation deps update
- fetch
- unpack
- local replace/put

sanity checks are to go yet, but the basic stuff works.
2016-10-20 01:45:53 +02:00
Anatol Belski
1041f1bf80 extend .gitignore 2016-10-20 01:11:04 +02:00
Anatol Belski
17291e5af3 add some config guessing and minor changes 2016-10-19 19:47:13 +02:00
Anatol Belski
0b2002e4ca basic stuff to fetch the deps 2016-10-19 18:56:18 +02:00
Anatol Belski
cbfcaed369 extend .gitignore 2016-10-19 18:56:00 +02:00
Anatol Belski
61ca7f64b0 put re2c 0.15.3, now depend on msys2 2016-10-10 13:02:41 +02:00
Anatol Belski
f0ea933e26 echo off 2016-10-08 21:35:27 +02:00
Anatol Belski
75ba8889b5 add VERSION 2016-09-29 19:45:39 +02:00
Anatol Belski
52a03d8e7e add wrapper for dllmap.php 2016-09-29 18:23:35 +02:00
Anatol Belski
312d4bbc26 add php executable for binary tools internal usage 2016-09-29 18:19:01 +02:00
Anatol Belski
9e304fc6fb extend .gitignore 2016-09-29 18:18:26 +02:00
Anatol Belski
e8879f2cda add yet missing msys2 dlls 2016-09-29 13:33:43 +02:00
Anatol Belski
8273166ab3 missing dll for grep 2016-09-28 19:58:02 +02:00
Anatol Belski
712f922d18 add wget, zip and unzip 2016-09-28 02:58:03 +02:00
Anatol Belski
6ac527e3f2 add diff and others 2016-09-28 02:54:13 +02:00
Anatol Belski
719014727e add grep 2016-09-28 02:40:05 +02:00
Anatol Belski
95b786e714 add awk 2016-09-28 02:38:30 +02:00
Anatol Belski
220728cad9 add sed 2016-09-28 02:18:50 +02:00
Anatol Belski
5589ce1452 fix setvars batch 2016-09-28 02:05:33 +02:00
Anatol Belski
f7fa229df4 add m4 and flex 2016-09-28 02:05:10 +02:00
Anatol Belski
be84a3b8dc remove the old stuff, start to readd tools based on msys2 2016-09-28 01:24:53 +02:00
268 changed files with 29649 additions and 11684 deletions

12
.gitignore vendored
View File

@@ -1,10 +1,20 @@
php53
php54
php55
php56
php70
php71
phpmaster
php
!lib/php
!bin/php
rmtools-client
rmtools.base
logs
PFTT
\.tmp
\.cache
oracle
# either these two become submodules, or uncomment them
#pgo-build
#rmtools*

110
README.md
View File

@@ -1,8 +1,110 @@
# PHP SDK
PHP SDK is a toolset for building PHP under windows
PHP SDK is a tool kit for Windows PHP builds
## Usage
# License
The PHP SDK itself and the SDK own tools are licensed under the BSD 2-Clause license. With the usage of the other tools, you accept the respective licenses.
# Overview
The PHP SDK 2.0 is compatible with PHP 7.0 and above. The compatibility with older versions, eq. php-sdk-binary-tools-20110915.zip available from windows.php.net previously, is kept. Though, some irrelevant tools was removed. 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` 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
# Tools
All the tools included are either scripts or 32-bit binaries. They are therefore runable on any of x86 or x64 Windows system.
## SDK
- starter scripts, named phpsdk-<crt>-<arch>.bat
- `phpsdk_buildtree` - initialize the development filesystem structure
- `phpsdk_deps` - handle dependency libraries
- `phpsdk_version` - show SDK version
- `phpsdk_dllmap` - create a JSON listing of DLLs contained in zip files
- `task.exe` - wrapper to hide the given command line
## Other tools
- `bison` 3.0.2, `re2c` 0.15.3
- `awk`, `gawk`, `sed`, `grep`
- `diff`, `diff3`, `patch`
- `md5sum`, `sha1sum`, `sha224sum`, `sha256sum`, `sha384sum`, `sha512sum`
- `7za`, `zip`, `unzip`, `unzipsfx`
- `wget`
## Optional, not included
These are not included with the PHP SDK, but might be useful. While Visual C++ is the only required, the others might enable some additional functionality. Care yourself about making them available on your system, if relevant.
- `Git` - useful for PHP source management
- `Cppcheck` - used for static analysis
- `clang` - useful for experimental builds and for static analysis
- `ICC` - useful for experimental builds
# Usage
The PHP SDK should be unzipped into the shortest possible path, preferrably somewhere near the drive root.
Usually, the first step to start the PHP SDK is by invoking one of the suitable starter scripts. This automatically puts the console on the correct environment relevant for the desired PHP build configuration.
It is not required to hold the source in the PHP SDK directory. It could be useful, for example, to simplify the SDK updates.
## Basic usage example
- `git clone https://github.com/OSTC/php-sdk-binary-tools.git c:\php-sdk`
- `cd c:\php-sdk`
- `git checkout new_binary_tools`
- either run or click on `phpsdk-vc14-x64.bat` in the PHP SDK root
- `cd` to c:\php-sdk and click on `phpsdk-vc14-x64.bat` in the PHP SDK root
- `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.
## The old way
- `git clone https://github.com/OSTC/php-sdk-binary-tools.git c:\php-sdk`
- follow the instructions on the PHP [wiki page](https://wiki.php.net/internals/windows/stepbystepbuild "PHP wiki page")
# Customizing
## 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 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 process.
## Console emulator integration
The starter scripts can be also easy integrated with the consoles other than standard cmd.exe. For the reference, here's an example ConEmu task
`C:\php-sdk\phpsdk-vc14-x64.bat -cur_console:d:C:\php-sdk\php70\vc14\x64\php-src`
## Unattended builds
An elementary functionality to run unattended builds is included. See an example on how to setup a simple unattended build task in the doc directory.
# Upgrading
- backup phpsdk-local.bat
- backup the source trees and any other custom files in the PHP SDK root
- move the PHP SDK folder into trash
- download, unpack and the new PHP SDK version under the same path
# Extending
The SDK tools are based on the KISS principle and should be kept so. Basic tools are implemented as simple batch script. The minimalistic `PHP` is available for internal SDK purposes. It can be used, if more complexity is required. If you have an idea for some useful tool or workflow, please open a ticket or PR, so it can be discussed, implemented and added to the SDK. By contributing an implementation, you should also accept the SDK license.
# Pitfalls
- SDK or PHP sources put into paths including spaces might cause issue.
- 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.
- git checkout https://github.com/OSTC/php-sdk-binary-tools.git c:\php-sdk
- follow the instructions on the PHP [wiki page](https://wiki.php.net/internals/windows/stepbystepbuild "PHP wiki page")

1
VERSION Normal file
View File

@@ -0,0 +1 @@
2.0.0alpha5

BIN
bin/7za.dll Normal file

Binary file not shown.

BIN
bin/7za.exe Normal file

Binary file not shown.

BIN
bin/7zxa.dll Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -1,761 +0,0 @@
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "/usr/local/share/bison.simple"
/* This file comes from bison-1.28. */
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 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
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
This special exception was added by the Free Software Foundation
in version 1.24 of Bison. */
/* This is the parser code that is written into each bison parser
when the %semantic_parser declaration is not specified in the grammar.
It was written by Richard Stallman by simplifying the hairy parser
used when %semantic_parser is specified. */
#ifndef YYSTACK_USE_ALLOCA
#ifdef alloca
#define YYSTACK_USE_ALLOCA
#else /* alloca not defined */
#ifdef __GNUC__
#define YYSTACK_USE_ALLOCA
#define alloca __builtin_alloca
#else /* not GNU C. */
#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
#define YYSTACK_USE_ALLOCA
#include <alloca.h>
#else /* not sparc */
/* We think this test detects Watcom and Microsoft C. */
/* This used to test MSDOS, but that is a bad idea
since that symbol is in the user namespace. */
#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
#if 0 /* No need for malloc.h, which pollutes the namespace;
instead, just don't use alloca. */
#include <malloc.h>
#endif
#else /* not MSDOS, or __TURBOC__ */
#if defined(_AIX)
/* I don't know what this was needed for, but it pollutes the namespace.
So I turned it off. rms, 2 May 1997. */
/* #include <malloc.h> */
#pragma alloca
#define YYSTACK_USE_ALLOCA
#else /* not MSDOS, or __TURBOC__, or _AIX */
#if 0
#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
and on HPUX 10. Eventually we can turn this on. */
#define YYSTACK_USE_ALLOCA
#define alloca __builtin_alloca
#endif /* __hpux */
#endif
#endif /* not _AIX */
#endif /* not MSDOS, or __TURBOC__ */
#endif /* not sparc */
#endif /* not GNU C */
#endif /* alloca not defined */
#endif /* YYSTACK_USE_ALLOCA not defined */
#ifdef YYSTACK_USE_ALLOCA
#define YYSTACK_ALLOC alloca
#else
#define YYSTACK_ALLOC malloc
#endif
/* Note: there must be only one dollar sign in this file.
It is replaced by the list of actions, each action
as one case of the switch. */
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
#define YYEMPTY -2
#define YYEOF 0
#define YYACCEPT goto yyacceptlab
#define YYABORT goto yyabortlab
#define YYERROR goto yyerrlab1
/* Like YYERROR except do call yyerror.
This remains here temporarily to ease the
transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. */
#define YYFAIL goto yyerrlab
#define YYRECOVERING() (!!yyerrstatus)
#define YYBACKUP(token, value) \
do \
if (yychar == YYEMPTY && yylen == 1) \
{ yychar = (token), yylval = (value); \
yychar1 = YYTRANSLATE (yychar); \
YYPOPSTACK; \
goto yybackup; \
} \
else \
{ yyerror ("syntax error: cannot back up"); YYERROR; } \
while (0)
#define YYTERROR 1
#define YYERRCODE 256
#ifndef YYPURE
#define YYLEX yylex()
#endif
#ifdef YYPURE
#ifdef YYLSP_NEEDED
#ifdef YYLEX_PARAM
#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
#else
#define YYLEX yylex(&yylval, &yylloc)
#endif
#else /* not YYLSP_NEEDED */
#ifdef YYLEX_PARAM
#define YYLEX yylex(&yylval, YYLEX_PARAM)
#else
#define YYLEX yylex(&yylval)
#endif
#endif /* not YYLSP_NEEDED */
#endif
/* If nonreentrant, generate the variables here */
#ifndef YYPURE
int yychar; /* the lookahead symbol */
YYSTYPE yylval; /* the semantic value of the */
/* lookahead symbol */
#ifdef YYLSP_NEEDED
YYLTYPE yylloc; /* location data for the lookahead */
/* symbol */
#endif
int yynerrs; /* number of parse errors so far */
#endif /* not YYPURE */
#if YYDEBUG != 0
int yydebug; /* nonzero means print parse trace */
/* Since this is uninitialized, it does not stop multiple parsers
from coexisting. */
#endif
/* YYINITDEPTH indicates the initial size of the parser's stacks */
#ifndef YYINITDEPTH
#define YYINITDEPTH 200
#endif
/* YYMAXDEPTH is the maximum size the stacks can grow to
(effective only if the built-in stack extension method is used). */
#if YYMAXDEPTH == 0
#undef YYMAXDEPTH
#endif
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 10000
#endif
/* Define __yy_memcpy. Note that the size argument
should be passed with type unsigned int, because that is what the non-GCC
definitions require. With GCC, __builtin_memcpy takes an arg
of type size_t, but it can handle unsigned int. */
#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
#else /* not GNU C or C++ */
#ifndef __cplusplus
/* This is the most reliable way to avoid incompatibilities
in available built-in functions on various systems. */
static void
__yy_memcpy (to, from, count)
char *to;
char *from;
unsigned int count;
{
register char *f = from;
register char *t = to;
register int i = count;
while (i-- > 0)
*t++ = *f++;
}
#else /* __cplusplus */
/* This is the most reliable way to avoid incompatibilities
in available built-in functions on various systems. */
static void
__yy_memcpy (char *to, char *from, unsigned int count)
{
register char *t = to;
register char *f = from;
register int i = count;
while (i-- > 0)
*t++ = *f++;
}
#endif
#endif
#line 217 "/usr/local/share/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
It should actually point to an object.
Grammar actions can access the variable by casting it
to the proper pointer type. */
#ifdef YYPARSE_PARAM
#ifdef __cplusplus
#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
#define YYPARSE_PARAM_DECL
#else /* not __cplusplus */
#define YYPARSE_PARAM_ARG YYPARSE_PARAM
#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
#endif /* not __cplusplus */
#else /* not YYPARSE_PARAM */
#define YYPARSE_PARAM_ARG
#define YYPARSE_PARAM_DECL
#endif /* not YYPARSE_PARAM */
/* Prevent warning if -Wstrict-prototypes. */
#ifdef __GNUC__
#ifdef YYPARSE_PARAM
int yyparse (void *);
#else
int yyparse (void);
#endif
#endif
int
yyparse(YYPARSE_PARAM_ARG)
YYPARSE_PARAM_DECL
{
register int yystate;
register int yyn;
register short *yyssp;
register YYSTYPE *yyvsp;
int yyerrstatus; /* number of tokens to shift before error messages enabled */
int yychar1 = 0; /* lookahead token as an internal (translated) token number */
short yyssa[YYINITDEPTH]; /* the state stack */
YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
short *yyss = yyssa; /* refer to the stacks thru separate pointers */
YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
#ifdef YYLSP_NEEDED
YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
YYLTYPE *yyls = yylsa;
YYLTYPE *yylsp;
#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
#else
#define YYPOPSTACK (yyvsp--, yyssp--)
#endif
int yystacksize = YYINITDEPTH;
int yyfree_stacks = 0;
#ifdef YYPURE
int yychar;
YYSTYPE yylval;
int yynerrs;
#ifdef YYLSP_NEEDED
YYLTYPE yylloc;
#endif
#endif
YYSTYPE yyval; /* the variable used to return */
/* semantic values from the action */
/* routines */
int yylen;
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Starting parse\n");
#endif
yystate = 0;
yyerrstatus = 0;
yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers.
Waste one element of value and location stack
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
yyssp = yyss - 1;
yyvsp = yyvs;
#ifdef YYLSP_NEEDED
yylsp = yyls;
#endif
/* Push a new state, which is found in yystate . */
/* In all cases, when you get here, the value and location stacks
have just been pushed. so pushing a state here evens the stacks. */
yynewstate:
*++yyssp = yystate;
if (yyssp >= yyss + yystacksize - 1)
{
/* Give user a chance to reallocate the stack */
/* Use copies of these so that the &'s don't force the real ones into memory. */
YYSTYPE *yyvs1 = yyvs;
short *yyss1 = yyss;
#ifdef YYLSP_NEEDED
YYLTYPE *yyls1 = yyls;
#endif
/* Get the current used size of the three stacks, in elements. */
int size = yyssp - yyss + 1;
#ifdef yyoverflow
/* Each stack pointer address is followed by the size of
the data in use in that stack, in bytes. */
#ifdef YYLSP_NEEDED
/* This used to be a conditional around just the two extra args,
but that might be undefined if yyoverflow is a macro. */
yyoverflow("parser stack overflow",
&yyss1, size * sizeof (*yyssp),
&yyvs1, size * sizeof (*yyvsp),
&yyls1, size * sizeof (*yylsp),
&yystacksize);
#else
yyoverflow("parser stack overflow",
&yyss1, size * sizeof (*yyssp),
&yyvs1, size * sizeof (*yyvsp),
&yystacksize);
#endif
yyss = yyss1; yyvs = yyvs1;
#ifdef YYLSP_NEEDED
yyls = yyls1;
#endif
#else /* no yyoverflow */
/* Extend the stack our own way. */
if (yystacksize >= YYMAXDEPTH)
{
yyerror("parser stack overflow");
if (yyfree_stacks)
{
free (yyss);
free (yyvs);
#ifdef YYLSP_NEEDED
free (yyls);
#endif
}
return 2;
}
yystacksize *= 2;
if (yystacksize > YYMAXDEPTH)
yystacksize = YYMAXDEPTH;
#ifndef YYSTACK_USE_ALLOCA
yyfree_stacks = 1;
#endif
yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
__yy_memcpy ((char *)yyss, (char *)yyss1,
size * (unsigned int) sizeof (*yyssp));
yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
__yy_memcpy ((char *)yyvs, (char *)yyvs1,
size * (unsigned int) sizeof (*yyvsp));
#ifdef YYLSP_NEEDED
yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
__yy_memcpy ((char *)yyls, (char *)yyls1,
size * (unsigned int) sizeof (*yylsp));
#endif
#endif /* no yyoverflow */
yyssp = yyss + size - 1;
yyvsp = yyvs + size - 1;
#ifdef YYLSP_NEEDED
yylsp = yyls + size - 1;
#endif
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Stack size increased to %d\n", yystacksize);
#endif
if (yyssp >= yyss + yystacksize - 1)
YYABORT;
}
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Entering state %d\n", yystate);
#endif
goto yybackup;
yybackup:
/* Do appropriate processing given the current state. */
/* Read a lookahead token if we need one and don't already have one. */
/* yyresume: */
/* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
if (yyn == YYFLAG)
goto yydefault;
/* Not known => get a lookahead token if don't already have one. */
/* yychar is either YYEMPTY or YYEOF
or a valid token in external form. */
if (yychar == YYEMPTY)
{
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Reading a token: ");
#endif
yychar = YYLEX;
}
/* Convert token to internal form (in yychar1) for indexing tables with */
if (yychar <= 0) /* This means end of input. */
{
yychar1 = 0;
yychar = YYEOF; /* Don't call YYLEX any more */
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Now at end of input.\n");
#endif
}
else
{
yychar1 = YYTRANSLATE(yychar);
#if YYDEBUG != 0
if (yydebug)
{
fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
/* Give the individual parser a way to print the precise meaning
of a token, for further debugging info. */
#ifdef YYPRINT
YYPRINT (stderr, yychar, yylval);
#endif
fprintf (stderr, ")\n");
}
#endif
}
yyn += yychar1;
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
goto yydefault;
yyn = yytable[yyn];
/* yyn is what to do for this token type in this state.
Negative => reduce, -yyn is rule number.
Positive => shift, yyn is new state.
New state is final state => don't bother to shift,
just return success.
0, or most negative number => error. */
if (yyn < 0)
{
if (yyn == YYFLAG)
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
else if (yyn == 0)
goto yyerrlab;
if (yyn == YYFINAL)
YYACCEPT;
/* Shift the lookahead token. */
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
#endif
/* Discard the token being shifted unless it is eof. */
if (yychar != YYEOF)
yychar = YYEMPTY;
*++yyvsp = yylval;
#ifdef YYLSP_NEEDED
*++yylsp = yylloc;
#endif
/* count tokens shifted since error; after three, turn off error status. */
if (yyerrstatus) yyerrstatus--;
yystate = yyn;
goto yynewstate;
/* Do the default action for the current state. */
yydefault:
yyn = yydefact[yystate];
if (yyn == 0)
goto yyerrlab;
/* Do a reduction. yyn is the number of a rule to reduce with. */
yyreduce:
yylen = yyr2[yyn];
if (yylen > 0)
yyval = yyvsp[1-yylen]; /* implement default value of the action */
#if YYDEBUG != 0
if (yydebug)
{
int i;
fprintf (stderr, "Reducing via rule %d (line %d), ",
yyn, yyrline[yyn]);
/* Print the symbols being reduced, and their result. */
for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
fprintf (stderr, "%s ", yytname[yyrhs[i]]);
fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
}
#endif
$ /* the action file gets copied in in place of this dollarsign */
#line 543 "/usr/local/share/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
#ifdef YYLSP_NEEDED
yylsp -= yylen;
#endif
#if YYDEBUG != 0
if (yydebug)
{
short *ssp1 = yyss - 1;
fprintf (stderr, "state stack now");
while (ssp1 != yyssp)
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
#endif
*++yyvsp = yyval;
#ifdef YYLSP_NEEDED
yylsp++;
if (yylen == 0)
{
yylsp->first_line = yylloc.first_line;
yylsp->first_column = yylloc.first_column;
yylsp->last_line = (yylsp-1)->last_line;
yylsp->last_column = (yylsp-1)->last_column;
yylsp->text = 0;
}
else
{
yylsp->last_line = (yylsp+yylen-1)->last_line;
yylsp->last_column = (yylsp+yylen-1)->last_column;
}
#endif
/* Now "shift" the result of the reduction.
Determine what state that goes to,
based on the state we popped back to
and the rule number reduced by. */
yyn = yyr1[yyn];
yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
yystate = yydefgoto[yyn - YYNTBASE];
goto yynewstate;
yyerrlab: /* here on detecting error */
if (! yyerrstatus)
/* If not already recovering from an error, report this error. */
{
++yynerrs;
#ifdef YYERROR_VERBOSE
yyn = yypact[yystate];
if (yyn > YYFLAG && yyn < YYLAST)
{
int size = 0;
char *msg;
int x, count;
count = 0;
/* Start X at -yyn if nec to avoid negative indexes in yycheck. */
for (x = (yyn < 0 ? -yyn : 0);
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
size += strlen(yytname[x]) + 15, count++;
msg = (char *) malloc(size + 15);
if (msg != 0)
{
strcpy(msg, "parse error");
if (count < 5)
{
count = 0;
for (x = (yyn < 0 ? -yyn : 0);
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
{
strcat(msg, count == 0 ? ", expecting `" : " or `");
strcat(msg, yytname[x]);
strcat(msg, "'");
count++;
}
}
yyerror(msg);
free(msg);
}
else
yyerror ("parse error; also virtual memory exceeded");
}
else
#endif /* YYERROR_VERBOSE */
yyerror("parse error");
}
goto yyerrlab1;
yyerrlab1: /* here on error raised explicitly by an action */
if (yyerrstatus == 3)
{
/* if just tried and failed to reuse lookahead token after an error, discard it. */
/* return failure if at end of input */
if (yychar == YYEOF)
YYABORT;
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
#endif
yychar = YYEMPTY;
}
/* Else will try to reuse lookahead token
after shifting the error token. */
yyerrstatus = 3; /* Each real token shifted decrements this */
goto yyerrhandle;
yyerrdefault: /* current state does not do anything special for the error token. */
#if 0
/* This is wrong; only states that explicitly want error tokens
should shift them. */
yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
if (yyn) goto yydefault;
#endif
yyerrpop: /* pop the current state because it cannot handle the error token */
if (yyssp == yyss) YYABORT;
yyvsp--;
yystate = *--yyssp;
#ifdef YYLSP_NEEDED
yylsp--;
#endif
#if YYDEBUG != 0
if (yydebug)
{
short *ssp1 = yyss - 1;
fprintf (stderr, "Error: state stack now");
while (ssp1 != yyssp)
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
#endif
yyerrhandle:
yyn = yypact[yystate];
if (yyn == YYFLAG)
goto yyerrdefault;
yyn += YYTERROR;
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
goto yyerrdefault;
yyn = yytable[yyn];
if (yyn < 0)
{
if (yyn == YYFLAG)
goto yyerrpop;
yyn = -yyn;
goto yyreduce;
}
else if (yyn == 0)
goto yyerrpop;
if (yyn == YYFINAL)
YYACCEPT;
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Shifting error token, ");
#endif
*++yyvsp = yylval;
#ifdef YYLSP_NEEDED
*++yylsp = yylloc;
#endif
yystate = yyn;
goto yynewstate;
yyacceptlab:
/* YYACCEPT comes here. */
if (yyfree_stacks)
{
free (yyss);
free (yyvs);
#ifdef YYLSP_NEEDED
free (yyls);
#endif
}
return 0;
yyabortlab:
/* YYABORT comes here. */
if (yyfree_stacks)
{
free (yyss);
free (yyvs);
#ifdef YYLSP_NEEDED
free (yyls);
#endif
}
return 1;
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,761 +0,0 @@
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "bison.simple"
/* This file comes from bison-1.27. */
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 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
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
This special exception was added by the Free Software Foundation
in version 1.24 of Bison. */
/* This is the parser code that is written into each bison parser
when the %semantic_parser declaration is not specified in the grammar.
It was written by Richard Stallman by simplifying the hairy parser
used when %semantic_parser is specified. */
#ifndef YYSTACK_USE_ALLOCA
#ifdef alloca
#define YYSTACK_USE_ALLOCA
#else /* alloca not defined */
#ifdef __GNUC__
#define YYSTACK_USE_ALLOCA
#define alloca __builtin_alloca
#else /* not GNU C. */
#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
#define YYSTACK_USE_ALLOCA
#include <alloca.h>
#else /* not sparc */
/* We think this test detects Watcom and Microsoft C. */
/* This used to test MSDOS, but that is a bad idea
since that symbol is in the user namespace. */
#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
#if 0 /* No need for malloc.h, which pollutes the namespace;
instead, just don't use alloca. */
#include <malloc.h>
#endif
#else /* not MSDOS, or __TURBOC__ */
#if defined(_AIX)
/* I don't know what this was needed for, but it pollutes the namespace.
So I turned it off. rms, 2 May 1997. */
/* #include <malloc.h> */
#pragma alloca
#define YYSTACK_USE_ALLOCA
#else /* not MSDOS, or __TURBOC__, or _AIX */
#if 0
#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
and on HPUX 10. Eventually we can turn this on. */
#define YYSTACK_USE_ALLOCA
#define alloca __builtin_alloca
#endif /* __hpux */
#endif
#endif /* not _AIX */
#endif /* not MSDOS, or __TURBOC__ */
#endif /* not sparc */
#endif /* not GNU C */
#endif /* alloca not defined */
#endif /* YYSTACK_USE_ALLOCA not defined */
#ifdef YYSTACK_USE_ALLOCA
#define YYSTACK_ALLOC alloca
#else
#define YYSTACK_ALLOC malloc
#endif
/* Note: there must be only one dollar sign in this file.
It is replaced by the list of actions, each action
as one case of the switch. */
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
#define YYEMPTY -2
#define YYEOF 0
#define YYACCEPT goto yyacceptlab
#define YYABORT goto yyabortlab
#define YYERROR goto yyerrlab1
/* Like YYERROR except do call yyerror.
This remains here temporarily to ease the
transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. */
#define YYFAIL goto yyerrlab
#define YYRECOVERING() (!!yyerrstatus)
#define YYBACKUP(token, value) \
do \
if (yychar == YYEMPTY && yylen == 1) \
{ yychar = (token), yylval = (value); \
yychar1 = YYTRANSLATE (yychar); \
YYPOPSTACK; \
goto yybackup; \
} \
else \
{ yyerror ("syntax error: cannot back up"); YYERROR; } \
while (0)
#define YYTERROR 1
#define YYERRCODE 256
#ifndef YYPURE
#define YYLEX yylex()
#endif
#ifdef YYPURE
#ifdef YYLSP_NEEDED
#ifdef YYLEX_PARAM
#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
#else
#define YYLEX yylex(&yylval, &yylloc)
#endif
#else /* not YYLSP_NEEDED */
#ifdef YYLEX_PARAM
#define YYLEX yylex(&yylval, YYLEX_PARAM)
#else
#define YYLEX yylex(&yylval)
#endif
#endif /* not YYLSP_NEEDED */
#endif
/* If nonreentrant, generate the variables here */
#ifndef YYPURE
int yychar; /* the lookahead symbol */
YYSTYPE yylval; /* the semantic value of the */
/* lookahead symbol */
#ifdef YYLSP_NEEDED
YYLTYPE yylloc; /* location data for the lookahead */
/* symbol */
#endif
int yynerrs; /* number of parse errors so far */
#endif /* not YYPURE */
#if YYDEBUG != 0
int yydebug; /* nonzero means print parse trace */
/* Since this is uninitialized, it does not stop multiple parsers
from coexisting. */
#endif
/* YYINITDEPTH indicates the initial size of the parser's stacks */
#ifndef YYINITDEPTH
#define YYINITDEPTH 200
#endif
/* YYMAXDEPTH is the maximum size the stacks can grow to
(effective only if the built-in stack extension method is used). */
#if YYMAXDEPTH == 0
#undef YYMAXDEPTH
#endif
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 10000
#endif
/* Define __yy_memcpy. Note that the size argument
should be passed with type unsigned int, because that is what the non-GCC
definitions require. With GCC, __builtin_memcpy takes an arg
of type size_t, but it can handle unsigned int. */
#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
#else /* not GNU C or C++ */
#ifndef __cplusplus
/* This is the most reliable way to avoid incompatibilities
in available built-in functions on various systems. */
static void
__yy_memcpy (to, from, count)
char *to;
char *from;
unsigned int count;
{
register char *f = from;
register char *t = to;
register int i = count;
while (i-- > 0)
*t++ = *f++;
}
#else /* __cplusplus */
/* This is the most reliable way to avoid incompatibilities
in available built-in functions on various systems. */
static void
__yy_memcpy (char *to, char *from, unsigned int count)
{
register char *t = to;
register char *f = from;
register int i = count;
while (i-- > 0)
*t++ = *f++;
}
#endif
#endif
#line 216 "bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
It should actually point to an object.
Grammar actions can access the variable by casting it
to the proper pointer type. */
#ifdef YYPARSE_PARAM
#ifdef __cplusplus
#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
#define YYPARSE_PARAM_DECL
#else /* not __cplusplus */
#define YYPARSE_PARAM_ARG YYPARSE_PARAM
#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
#endif /* not __cplusplus */
#else /* not YYPARSE_PARAM */
#define YYPARSE_PARAM_ARG
#define YYPARSE_PARAM_DECL
#endif /* not YYPARSE_PARAM */
/* Prevent warning if -Wstrict-prototypes. */
#ifdef __GNUC__
#ifdef YYPARSE_PARAM
int yyparse (void *);
#else
int yyparse (void);
#endif
#endif
int
yyparse(YYPARSE_PARAM_ARG)
YYPARSE_PARAM_DECL
{
register int yystate;
register int yyn;
register short *yyssp;
register YYSTYPE *yyvsp;
int yyerrstatus; /* number of tokens to shift before error messages enabled */
int yychar1 = 0; /* lookahead token as an internal (translated) token number */
short yyssa[YYINITDEPTH]; /* the state stack */
YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
short *yyss = yyssa; /* refer to the stacks thru separate pointers */
YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
#ifdef YYLSP_NEEDED
YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
YYLTYPE *yyls = yylsa;
YYLTYPE *yylsp;
#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
#else
#define YYPOPSTACK (yyvsp--, yyssp--)
#endif
int yystacksize = YYINITDEPTH;
int yyfree_stacks = 0;
#ifdef YYPURE
int yychar;
YYSTYPE yylval;
int yynerrs;
#ifdef YYLSP_NEEDED
YYLTYPE yylloc;
#endif
#endif
YYSTYPE yyval; /* the variable used to return */
/* semantic values from the action */
/* routines */
int yylen;
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Starting parse\n");
#endif
yystate = 0;
yyerrstatus = 0;
yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers.
Waste one element of value and location stack
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
yyssp = yyss - 1;
yyvsp = yyvs;
#ifdef YYLSP_NEEDED
yylsp = yyls;
#endif
/* Push a new state, which is found in yystate . */
/* In all cases, when you get here, the value and location stacks
have just been pushed. so pushing a state here evens the stacks. */
yynewstate:
*++yyssp = yystate;
if (yyssp >= yyss + yystacksize - 1)
{
/* Give user a chance to reallocate the stack */
/* Use copies of these so that the &'s don't force the real ones into memory. */
YYSTYPE *yyvs1 = yyvs;
short *yyss1 = yyss;
#ifdef YYLSP_NEEDED
YYLTYPE *yyls1 = yyls;
#endif
/* Get the current used size of the three stacks, in elements. */
int size = yyssp - yyss + 1;
#ifdef yyoverflow
/* Each stack pointer address is followed by the size of
the data in use in that stack, in bytes. */
#ifdef YYLSP_NEEDED
/* This used to be a conditional around just the two extra args,
but that might be undefined if yyoverflow is a macro. */
yyoverflow("parser stack overflow",
&yyss1, size * sizeof (*yyssp),
&yyvs1, size * sizeof (*yyvsp),
&yyls1, size * sizeof (*yylsp),
&yystacksize);
#else
yyoverflow("parser stack overflow",
&yyss1, size * sizeof (*yyssp),
&yyvs1, size * sizeof (*yyvsp),
&yystacksize);
#endif
yyss = yyss1; yyvs = yyvs1;
#ifdef YYLSP_NEEDED
yyls = yyls1;
#endif
#else /* no yyoverflow */
/* Extend the stack our own way. */
if (yystacksize >= YYMAXDEPTH)
{
yyerror("parser stack overflow");
if (yyfree_stacks)
{
free (yyss);
free (yyvs);
#ifdef YYLSP_NEEDED
free (yyls);
#endif
}
return 2;
}
yystacksize *= 2;
if (yystacksize > YYMAXDEPTH)
yystacksize = YYMAXDEPTH;
#ifndef YYSTACK_USE_ALLOCA
yyfree_stacks = 1;
#endif
yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
__yy_memcpy ((char *)yyss, (char *)yyss1,
size * (unsigned int) sizeof (*yyssp));
yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
__yy_memcpy ((char *)yyvs, (char *)yyvs1,
size * (unsigned int) sizeof (*yyvsp));
#ifdef YYLSP_NEEDED
yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
__yy_memcpy ((char *)yyls, (char *)yyls1,
size * (unsigned int) sizeof (*yylsp));
#endif
#endif /* no yyoverflow */
yyssp = yyss + size - 1;
yyvsp = yyvs + size - 1;
#ifdef YYLSP_NEEDED
yylsp = yyls + size - 1;
#endif
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Stack size increased to %d\n", yystacksize);
#endif
if (yyssp >= yyss + yystacksize - 1)
YYABORT;
}
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Entering state %d\n", yystate);
#endif
goto yybackup;
yybackup:
/* Do appropriate processing given the current state. */
/* Read a lookahead token if we need one and don't already have one. */
/* yyresume: */
/* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
if (yyn == YYFLAG)
goto yydefault;
/* Not known => get a lookahead token if don't already have one. */
/* yychar is either YYEMPTY or YYEOF
or a valid token in external form. */
if (yychar == YYEMPTY)
{
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Reading a token: ");
#endif
yychar = YYLEX;
}
/* Convert token to internal form (in yychar1) for indexing tables with */
if (yychar <= 0) /* This means end of input. */
{
yychar1 = 0;
yychar = YYEOF; /* Don't call YYLEX any more */
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Now at end of input.\n");
#endif
}
else
{
yychar1 = YYTRANSLATE(yychar);
#if YYDEBUG != 0
if (yydebug)
{
fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
/* Give the individual parser a way to print the precise meaning
of a token, for further debugging info. */
#ifdef YYPRINT
YYPRINT (stderr, yychar, yylval);
#endif
fprintf (stderr, ")\n");
}
#endif
}
yyn += yychar1;
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
goto yydefault;
yyn = yytable[yyn];
/* yyn is what to do for this token type in this state.
Negative => reduce, -yyn is rule number.
Positive => shift, yyn is new state.
New state is final state => don't bother to shift,
just return success.
0, or most negative number => error. */
if (yyn < 0)
{
if (yyn == YYFLAG)
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
else if (yyn == 0)
goto yyerrlab;
if (yyn == YYFINAL)
YYACCEPT;
/* Shift the lookahead token. */
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
#endif
/* Discard the token being shifted unless it is eof. */
if (yychar != YYEOF)
yychar = YYEMPTY;
*++yyvsp = yylval;
#ifdef YYLSP_NEEDED
*++yylsp = yylloc;
#endif
/* count tokens shifted since error; after three, turn off error status. */
if (yyerrstatus) yyerrstatus--;
yystate = yyn;
goto yynewstate;
/* Do the default action for the current state. */
yydefault:
yyn = yydefact[yystate];
if (yyn == 0)
goto yyerrlab;
/* Do a reduction. yyn is the number of a rule to reduce with. */
yyreduce:
yylen = yyr2[yyn];
if (yylen > 0)
yyval = yyvsp[1-yylen]; /* implement default value of the action */
#if YYDEBUG != 0
if (yydebug)
{
int i;
fprintf (stderr, "Reducing via rule %d (line %d), ",
yyn, yyrline[yyn]);
/* Print the symbols being reduced, and their result. */
for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
fprintf (stderr, "%s ", yytname[yyrhs[i]]);
fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
}
#endif
$ /* the action file gets copied in in place of this dollarsign */
#line 542 "bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
#ifdef YYLSP_NEEDED
yylsp -= yylen;
#endif
#if YYDEBUG != 0
if (yydebug)
{
short *ssp1 = yyss - 1;
fprintf (stderr, "state stack now");
while (ssp1 != yyssp)
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
#endif
*++yyvsp = yyval;
#ifdef YYLSP_NEEDED
yylsp++;
if (yylen == 0)
{
yylsp->first_line = yylloc.first_line;
yylsp->first_column = yylloc.first_column;
yylsp->last_line = (yylsp-1)->last_line;
yylsp->last_column = (yylsp-1)->last_column;
yylsp->text = 0;
}
else
{
yylsp->last_line = (yylsp+yylen-1)->last_line;
yylsp->last_column = (yylsp+yylen-1)->last_column;
}
#endif
/* Now "shift" the result of the reduction.
Determine what state that goes to,
based on the state we popped back to
and the rule number reduced by. */
yyn = yyr1[yyn];
yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
yystate = yydefgoto[yyn - YYNTBASE];
goto yynewstate;
yyerrlab: /* here on detecting error */
if (! yyerrstatus)
/* If not already recovering from an error, report this error. */
{
++yynerrs;
#ifdef YYERROR_VERBOSE
yyn = yypact[yystate];
if (yyn > YYFLAG && yyn < YYLAST)
{
int size = 0;
char *msg;
int x, count;
count = 0;
/* Start X at -yyn if nec to avoid negative indexes in yycheck. */
for (x = (yyn < 0 ? -yyn : 0);
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
size += strlen(yytname[x]) + 15, count++;
msg = (char *) malloc(size + 15);
if (msg != 0)
{
strcpy(msg, "parse error");
if (count < 5)
{
count = 0;
for (x = (yyn < 0 ? -yyn : 0);
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
{
strcat(msg, count == 0 ? ", expecting `" : " or `");
strcat(msg, yytname[x]);
strcat(msg, "'");
count++;
}
}
yyerror(msg);
free(msg);
}
else
yyerror ("parse error; also virtual memory exceeded");
}
else
#endif /* YYERROR_VERBOSE */
yyerror("parse error");
}
goto yyerrlab1;
yyerrlab1: /* here on error raised explicitly by an action */
if (yyerrstatus == 3)
{
/* if just tried and failed to reuse lookahead token after an error, discard it. */
/* return failure if at end of input */
if (yychar == YYEOF)
YYABORT;
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
#endif
yychar = YYEMPTY;
}
/* Else will try to reuse lookahead token
after shifting the error token. */
yyerrstatus = 3; /* Each real token shifted decrements this */
goto yyerrhandle;
yyerrdefault: /* current state does not do anything special for the error token. */
#if 0
/* This is wrong; only states that explicitly want error tokens
should shift them. */
yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
if (yyn) goto yydefault;
#endif
yyerrpop: /* pop the current state because it cannot handle the error token */
if (yyssp == yyss) YYABORT;
yyvsp--;
yystate = *--yyssp;
#ifdef YYLSP_NEEDED
yylsp--;
#endif
#if YYDEBUG != 0
if (yydebug)
{
short *ssp1 = yyss - 1;
fprintf (stderr, "Error: state stack now");
while (ssp1 != yyssp)
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
#endif
yyerrhandle:
yyn = yypact[yystate];
if (yyn == YYFLAG)
goto yyerrdefault;
yyn += YYTERROR;
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
goto yyerrdefault;
yyn = yytable[yyn];
if (yyn < 0)
{
if (yyn == YYFLAG)
goto yyerrpop;
yyn = -yyn;
goto yyreduce;
}
else if (yyn == 0)
goto yyerrpop;
if (yyn == YYFINAL)
YYACCEPT;
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Shifting error token, ");
#endif
*++yyvsp = yylval;
#ifdef YYLSP_NEEDED
*++yylsp = yylloc;
#endif
yystate = yyn;
goto yynewstate;
yyacceptlab:
/* YYACCEPT comes here. */
if (yyfree_stacks)
{
free (yyss);
free (yyvs);
#ifdef YYLSP_NEEDED
free (yyls);
#endif
}
return 0;
yyabortlab:
/* YYABORT comes here. */
if (yyfree_stacks)
{
free (yyss);
free (yyvs);
#ifdef YYLSP_NEEDED
free (yyls);
#endif
}
return 1;
}

Binary file not shown.

View File

@@ -1,82 +0,0 @@
@ECHO OFF
IF NOT "%OS%"=="Windows_NT" GOTO Syntax
IF "%?1"=="" GOTO Syntax
IF NOT "%?6"=="" GOTO Syntax
ECHO .%* | FIND "?" > NUL && GOTO Syntax
SETLOCAL ENABLEDELAYEDEXPANSION
FOR /F "tokens=2-4 delims=(/-)" %%A IN ('VER ?| DATE') DO (
SET Var1=%%A
SET Var2=%%B
SET Var3=%%C
)
FOR /F "tokens=2 delims=:" %%A IN ('VER ?| DATE ?| FIND /V "("') DO (
FOR /F "tokens=1-3 delims=/- " %%B IN ("%%A") DO (
SET %Var1%=%%B
SET %Var2%=%%C
SET %Var3%=%%D
)
)
IF /I NOT "%?1"=="%Var1%" IF /I NOT "%?1"=="%Var2%" IF /I NOT "%?1"=="%Var3%" (
ENDLOCAL
GOTO Syntax
)
IF /I "%?4"=="/LZ" (SET Delim=) ELSE (SET Delim=%4)
IF /I NOT "%?3"=="%Var1%" IF /I NOT "%?3"=="%Var2%" IF /I NOT "%?3"=="%Var3%" IF /I NOT "%?3"=="/LZ" (SET Delim=%?3)
IF /I NOT "%?2"=="%Var1%" IF /I NOT "%?2"=="%Var2%" IF /I NOT "%?2"=="%Var3%" IF /I NOT "%?2"=="/LZ" (SET Delim=%?2)
ECHO.%* | FIND /I "/LZ" >NUL
IF NOT ERRORLEVEL 1 CALL :AddLeadingZero
SET DateFmt=!%1!
IF /I NOT "%?2"=="%Delim%" IF /I NOT "%?2"=="/LZ" (SET DateFmt=%DateFmt%%Delim%!%2!)
IF /I NOT "%?3"=="%Delim%" IF /I NOT "%?3"=="/LZ" (SET DateFmt=%DateFmt%%Delim%!%3!)
ENDLOCAL & SET DateFmt=%DateFmt%
SET DateFmt
GOTO:EOF
:AddLeadingZero
CALL SET Char1=%%%Var1%:?0,1%%
IF NOT "%Char1%"=="0" (
IF !%Var1%! LSS 10 SET %Var1%=0!%Var1%!
)
CALL SET Char1=%%%Var2%:?0,1%%
IF NOT "%Char1%"=="0" (
IF !%Var2%! LSS 10 SET %Var2%=0!%Var2%!
)
CALL SET Char1=%%%Var3%:?0,1%%
IF NOT "%Char1%"=="0" (
IF !%Var3%! LSS 10 SET %Var3%=0!%Var3%!
)
GOTO:EOF
:Syntax
ECHO DateFmt.bat, Version 0.52 BETA for Windows NT 4 and later
ECHO Display the current date in the specified format
ECHO.
ECHO Usage: DATEFMT date_format [ delimiter ] [ /LZ ]
ECHO.
IF "%OS%"=="Windows_NT" FOR /F "tokens=2-4 delims=()/-" %%A IN ('VER ?| DATE ?| FIND "("') DO ECHO Where: date_format is any combination of %%A, %%B and/or %%C
IF NOT "%OS%"=="Windows_NT" ECHO Where: date_format is any combination of dd, mm and/or yy
ECHO (these date_format options are always in the computer's
IF NOT "%OS%"=="Windows_NT" ECHO local language; to look them up, type VER ¦ DATE)
IF NOT "%OS%"=="Windows_NT" GOTO Skip
ECHO local language; to look them up, type VER ?| DATE)
:Skip
ECHO delimiter is the delimiter to be used in the end result
ECHO /LZ use leading zeroes in the end result
ECHO.
ECHO Examples (for English Windows versions):
ECHO DATEFMT yy mm dd --- 2007115 (January 15 or November 5, 2007)
ECHO DATEFMT yy mm dd - --- 2007-11-5 (November 5, 2007)
ECHO DATEFMT yy mm dd - /LZ --- 2007-11-05 (November 5, 2007)
ECHO DATEFMT mm /LZ --- 01 (January)
ECHO DATEFMT yy mm - /LZ --- 2007-06 (June 2007)
ECHO DATEFMT dd mm dd * /LZ --- 11*03*11 (March 11)
ECHO.
ECHO Inspired by Simon Sheppard's GetDate.bat
ECHO http://www.ss64.com/ntsyntax/getdate.html
ECHO Written by Rob van der Woude
ECHO http://www.robvanderwoude.com

View File

@@ -1,3 +0,0 @@
for /F "tokens=1-4 delims=:., " %%a in ('time/T') do set _TIME=%%a%%b%%c
for /F "tokens=2-5 delims=:.,/ " %%a in ('date/T') do set _DATE=%%a%%b%%c
SET SNAPDATETIME=%_DATE%%_TIME%

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,3 +0,0 @@
@echo off
c:\Users\pierre\Documents\php-sdk\bin\patch.exe < %1
pause

Binary file not shown.

Binary file not shown.

View File

3
bin/php/do_php.bat Normal file
View File

@@ -0,0 +1,3 @@
@echo ofF
%~dp0php.exe -c %~dp0php.ini -d extension_dir=%~dp0ext %*

BIN
bin/php/ext/php_curl.dll Normal file

Binary file not shown.

BIN
bin/php/ext/php_ftp.dll Normal file

Binary file not shown.

BIN
bin/php/ext/php_openssl.dll Normal file

Binary file not shown.

BIN
bin/php/ext/php_sqlite3.dll Normal file

Binary file not shown.

BIN
bin/php/libeay32.dll Normal file

Binary file not shown.

BIN
bin/php/libssh2.dll Normal file

Binary file not shown.

BIN
bin/php/php.exe Normal file

Binary file not shown.

6
bin/php/php.ini Normal file
View File

@@ -0,0 +1,6 @@
extension=php_curl.dll
extension=php_ftp.dll
extension=php_sqlite3.dll
extension=php_openssl.dll
memory_limit=1G

BIN
bin/php/php7.dll Normal file

Binary file not shown.

BIN
bin/php/ssleay32.dll Normal file

Binary file not shown.

View File

@@ -4,38 +4,34 @@ IF "%1" EQU "" GOTO Help
IF "%2" NEQ "" SET _=%2\%1
IF "%2" EQU "" SET _=%CD%\%1
MD %_%\vc9\x86\deps\bin
MD %_%\vc9\x86\deps\lib
MD %_%\vc9\x86\deps\include
MD %_%\vc9\x64\deps\bin
MD %_%\vc9\x64\deps\lib
MD %_%\vc9\x64\deps\include
rem if we're in the starter script shell, create the only struct that corresponds to the current env
rem otherwise - retain the old behavior, create structs for all the known build combinations and don't cd
MD %_%\vc11\x86\deps\bin
MD %_%\vc11\x86\deps\lib
MD %_%\vc11\x86\deps\include
MD %_%\vc11\x64\deps\bin
MD %_%\vc11\x64\deps\lib
MD %_%\vc11\x64\deps\include
if "%PHP_SDK_ARCH%" NEQ "" (
if "%PHP_SDK_VC%" NEQ "" (
MD %_%\%PHP_SDK_VC%\%PHP_SDK_ARCH%\deps\bin
MD %_%\%PHP_SDK_VC%\%PHP_SDK_ARCH%\deps\lib
MD %_%\%PHP_SDK_VC%\%PHP_SDK_ARCH%\deps\include
cd %_%\%PHP_SDK_VC%\%PHP_SDK_ARCH%
goto exit
)
goto create_all
) else (
:create_all
MD %_%\vc14\x86\deps\bin
MD %_%\vc14\x86\deps\lib
MD %_%\vc14\x86\deps\include
MD %_%\vc14\x64\deps\bin
MD %_%\vc14\x64\deps\lib
MD %_%\vc14\x64\deps\include
)
MD %_%\vc12\x86\deps\bin
MD %_%\vc12\x86\deps\lib
MD %_%\vc12\x86\deps\include
MD %_%\vc12\x64\deps\bin
MD %_%\vc12\x64\deps\lib
MD %_%\vc12\x64\deps\include
MD %_%\vc14\x86\deps\bin
MD %_%\vc14\x86\deps\lib
MD %_%\vc14\x86\deps\include
MD %_%\vc14\x64\deps\bin
MD %_%\vc14\x64\deps\lib
MD %_%\vc14\x64\deps\include
set _=
GOTO EXIT
:help
echo createbuildtree ^<nameofthetree^> [PATH]
echo phpsdk_buildtree ^<nameofthetree^> [PATH]
echo Create the common directory structure used by the PHP SDK
:EXIT

14
bin/phpsdk_deps.bat Normal file
View File

@@ -0,0 +1,14 @@
@echo off
if "%PHP_SDK_PHP_CMD%"=="" (
call %~dp0phpsdk_setvars.bat
if "!PHP_SDK_PHP_CMD!"=="" (
echo PHP SDK is not setup
exit /b 3
)
)
call %PHP_SDK_PHP_CMD% %PHP_SDK_BIN_PATH%\phpsdk_deps.php %*
exit /b

234
bin/phpsdk_deps.php Normal file
View File

@@ -0,0 +1,234 @@
<?php
include dirname(__FILE__) . "/../lib/php/libsdk/autoload.php";
use SDK\Config;
use SDK\Exception;
$sopt = "s:cuhb:a:d:t:";
$lopt = array(
"branch:",
"update",
"check",
"stability:",
"arch:",
"crt:",
"help",
"deps:",
);
$cmd = NULL;
$stability = NULL;
$arch = NULL;
$branch = NULL;
$crt = NULL;
try {
$opt = getopt($sopt, $lopt);
foreach ($opt as $name => $val) {
switch ($name) {
default:
throw new Exception("Unknown switch '$name'");
break;
case "h":
case "help":
usage(0);
break;
case "b":
case "branch":
$branch = $val;
break;
case "s":
case "stability":
if ("stable" != $val && "staging" != $val) {
throw new Exception("Unknown stability keyword, either stable or staging is accepted");
}
Config::setCurrentStabilityName($val);
break;
case "a":
case "arch":
if ("x64" != $val && "x86" != $val) {
throw new Exception("Unknown arch keyword, either x86 or x64 is accepted");
}
Config::setCurrentArchName($val);
break;
case "d":
case "deps":
Config::setDepsLocalPath($val);
break;
case "c":
case "check":
$cmd = "check";
break;
case "u":
case "update":
$cmd = "update";
break;
case "t":
case "crt":
Config::setCurrentCrtName($val);
break;
}
}
if (NULL === $cmd) {
usage();
}
if (!Config::getDepsLocalPath()) {
if (file_exists("../deps")) {
Config::setDepsLocalPath(realpath("../deps"));
} else if (file_exists("main/php_version.h")) {
/* Deps dir might not exist. */
Config::setDepsLocalPath(realpath("..") . DIRECTORY_SEPARATOR . "deps");
} else {
usage(3);
}
}
if ($branch) {
Config::setCurrentBranchName($branch);
}
if (!Config::getCurrentBranchName()) {
/* Try to figure out the branch. For now it only works if CWD is in php-src. */
$fl = "main/php_version.h";
if (file_exists($fl)) {
$s = file_get_contents($fl);
$major = $minor = NULL;
if (preg_match(",PHP_MAJOR_VERSION (\d+),", $s, $m)) {
$major = $m[1];
}
if (preg_match(",PHP_MINOR_VERSION (\d+),", $s, $m)) {
$minor = $m[1];
}
if (is_numeric($major) && is_numeric($minor)) {
Config::setCurrentBranchName("$major.$minor");
} else {
usage(3);
}
} else {
usage(3);
}
}
if (NULL === Config::getCurrentArchName()) {
/* XXX this might be not true for other compilers! */
passthru("where cl.exe >nul", $status);
if (!$status) {
exec("cl.exe /? 2>&1", $a, $status);
if (!$status) {
if (preg_match(",x64,", $a[0])) {
Config::setCurrentArchName("x64");
} else {
Config::setCurrentArchName("x86");
}
} else {
usage(3);
}
} else {
usage(3);
}
$arch = Config::getCurrentArchName();
}
if (NULL === Config::getCurrentCrtName()) {
$all_branches = Config::getKnownBranches();
if (!isset($all_branches[Config::getCurrentBranchName()])) {
throw new Exception("Couldn't find any configuration for branch '" . Config::getCurrentBranchName() . "'");
}
$branch = $all_branches[Config::getCurrentBranchName()];
if (count($branch) > 1) {
throw new Exception("Multiple CRTs are available for this branch, please choose one from " . implode(",", array_keys($branch)));
} else {
Config::setCurrentCrtName(array_keys($branch)[0]);
}
}
if (NULL === Config::getCurrentStabilityName()) {
if ("master" == Config::getCurrentBranchName()) {
Config::setCurrentStabilityName("staging");
} else {
Config::setCurrentStabilityName("stable");
}
}
$branch_data = Config::getCurrentBranchData();
echo "\nConfiguration: " . Config::getCurrentBranchName() . "-$branch_data[crt]-$branch_data[arch]-$branch_data[stability]\n\n";
/* Let the dep manager to run the command. */
$dm = new SDK\Dependency\Manager(Config::getDepsLocalPath(), $branch_data["stability"], $branch_data["arch"]);
switch ($cmd) {
default:
throw new Exception("Unknown command '$cmd'");
break;
case "check":
$ret = $dm->updatesAvailable();
if ($ret) {
msg("Updates are available.", 7);
} else {
msg("No updates are available.");
}
break;
case "update":
$dm->performUpdate($msg);
msg($msg);
break;
}
} catch (Throwable $e) {
//var_dump($e);
//echo "\nError: ", $e->getMessage(), PHP_EOL;
throw $e;
exit(3);
}
function usage(int $code = -1)
{
echo "PHP SDK dependency handling tool.", PHP_EOL;
echo "Usage: ", PHP_EOL, PHP_EOL;
echo "Configuration:", PHP_EOL;
echo " -b --branch Branch name, eg. 7.0, 7.1, etc. If omited, CWD is used to guess.", PHP_EOL;
echo " -a --arch Architecture, x86 or x64. If omited, cl.exe is used to guess.", PHP_EOL;
echo " -t --crt CRT, marked by the corresponding VC++ version, eg. vc11, vc14, etc.", PHP_EOL;
echo " -s --stability One of stable or staging.", PHP_EOL, PHP_EOL;
echo "Commands:", PHP_EOL;
echo " -c --check Check for dependency updates. If updates are available, the exit code is set to 7.", PHP_EOL;
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 " -h --help Show help message.", PHP_EOL, PHP_EOL;
echo "Example: ", PHP_EOL;
echo " phpsdk_deps -c -b master", PHP_EOL;
echo " phpsdk_deps -u -b 7.0 -a x86 -d c:\\path\\to\\deps\\dir", PHP_EOL, PHP_EOL;
$code = -1 == $code ? 0 : $code;
exit($code);
}
function msg(string $s, int $code = 0) {
echo $s, PHP_EOL;
exit($code);
}
exit(0);
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/

14
bin/phpsdk_dllmap.bat Normal file
View File

@@ -0,0 +1,14 @@
@echo off
if "%PHP_SDK_PHP_CMD%"=="" (
call %~dp0phpsdk_setvars.bat
if "!PHP_SDK_PHP_CMD!"=="" (
echo PHP SDK is not setup
exit /b 3
)
)
call %PHP_SDK_PHP_CMD% %PHP_SDK_BIN_PATH%\phpsdk_dllmap.php %*
exit /b

View File

@@ -102,3 +102,11 @@ foreach ($dirs as $path) {
echo json_encode($out);
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/

28
bin/phpsdk_dumpenv.bat Normal file
View File

@@ -0,0 +1,28 @@
@echo off
if "%PHP_SDK_OS_ARCH%"=="" (
echo PHP SDK is not setup
exit /b 3
)
call %PHP_SDK_BIN_PATH%\phpsdk_version.bat
echo.
if "%PHP_SDK_OS_ARCH%"=="x64" (
echo OS architecture: 64-bit
) else (
echo OS architecture: 32-bit
)
if "%PHP_SDK_ARCH%"=="x64" (
echo Build architecture: 64-bit
) else (
echo Build architecture: 32-bit
)
echo Visual C++: %PHP_SDK_VC:~2%
echo PHP-SDK path: %PHP_SDK_PATH%
exit /b

102
bin/phpsdk_setshell.bat Normal file
View File

@@ -0,0 +1,102 @@
@echo off
if not defined PHP_SDK_RUN_FROM_ROOT (
echo This script should not be run directly.
echo Use starter scripts looking like phpsdk-^<crt^>-^<arch^>.bat in the PHP SDK root instead.
goto out_error
)
if "%1"=="" goto :help
if "%1"=="/?" goto :help
if "%1"=="-h" goto :help
if "%1"=="--help" goto :help
if "%2"=="" goto :help
if /i not "%1"=="vc14" (
echo Unsupported runtime "%1"
goto out_error
)
if /i not "%2"=="x64" (
if /i not "%2"=="x86" (
echo Unsupported arch "%2"
goto out_error
)
)
set PHP_SDK_VC=%1
set PHP_SDK_ARCH=%2
rem check OS arch
set TMPKEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion
reg query "%TMPKEY%" /v "ProgramFilesDir (x86)" >nul 2>nul
if not errorlevel 1 (
set PHP_SDK_OS_ARCH=x64
) else (
if /i "%PHP_SDK_ARCH%"=="x64" (
echo 32-bit OS detected, native 64-bit toolchain is unavailable.
goto out_error
)
set PHP_SDK_OS_ARCH=x86
)
set TMPKEY=
rem get vc base dir
if /i "%PHP_SDK_OS_ARCH%"=="x64" (
set TMPKEY=HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\%PHP_SDK_VC:~2%.0\Setup\VC
) else (
set TMPKEY=HKLM\SOFTWARE\Microsoft\VisualStudio\%PHP_SDK_VC:~2%.0\Setup\VC
)
reg query !TMPKEY! /v ProductDir >nul 2>&1
if errorlevel 1 (
echo Couldn't determine VC%PHP_SDK_VC:~2% directory
goto out_error;
)
for /f "tokens=2*" %%a in ('reg query !TMPKEY! /v ProductDir') do set PHP_SDK_VC_DIR=%%b
set TMPKEY=
rem get sdk dir
if /i "%PHP_SDK_OS_ARCH%"=="x64" (
set TMPKEY=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1
) else (
set TMPKEY=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1
)
for /f "tokens=2*" %%a in ('reg query "!TMPKEY!" /v InstallationFolder') do (
if exist "%%b\Include\um\Windows.h" (
set PHP_SDK_WIN_SDK_DIR=%%b
)
)
if not defined PHP_SDK_WIN_SDK_DIR (
echo Windows SDK not found.
goto out_error;
)
set TMPKEY=
if /i "%PHP_SDK_ARCH%"=="x64" (
set PHP_SDK_VC_SHELL_CMD="!PHP_SDK_VC_DIR!\vcvarsall.bat" amd64
) else (
set PHP_SDK_VC_SHELL_CMD="!PHP_SDK_VC_DIR!\vcvarsall.bat" x86
)
rem echo Visual Studio path %PHP_SDK_VC_DIR%
rem echo Windows SDK path %PHP_SDK_WIN_SDK_DIR%
goto out
:help
echo "Start Visual Studio command line for PHP SDK"
echo "Usage: %0 vc arch"
echo nul
:out_error
exit /b 3
:out
rem echo Shell configuration complete
exit /b 0
goto :eof

View File

@@ -1,13 +1,19 @@
REM phpsdk.bat
@ECHO OFF
REM Add skd\bin directory to the path
SET PHP_SDK_SCRIPT_PATH=%~dp0
SET PHP_SDK_BIN_PATH=%PHP_SDK_SCRIPT_PATH%\..\bin
SET PHP_SDK_PATH=%PHP_SDK_SCRIPT_PATH%\..
SET PATH=%PATH%;%PHP_SDK_BIN_PATH%;%PHP_SDK_SCRIPT_PATH%;D:\apps\svn\bin
REM Set BISON_SIMPLE
SET BISON_SIMPLE=%PHP_SDK_BIN_PATH%\bison.simple
@echo off
rem Add necessary dirs to the path
set PHP_SDK_BIN_PATH=%~dp0
rem remove trailing slash
set PHP_SDK_BIN_PATH=%PHP_SDK_BIN_PATH:~0,-1%
for %%a in ("%PHP_SDK_BIN_PATH%") do set PHP_SDK_PATH=%%~dpa
rem remove trailing slash
set PHP_SDK_PATH=%PHP_SDK_PATH:~0,-1%
set PHP_SDK_MSYS2_PATH=%PHP_SDK_PATH%\msys2\usr\bin
set PHP_SDK_PHP_CMD=%PHP_SDK_BIN_PATH%\php\do_php.bat
set PATH=%PHP_SDK_BIN_PATH%;%PHP_SDK_MSYS2_PATH%;%PATH%
exit /b

14
bin/phpsdk_version.bat Normal file
View File

@@ -0,0 +1,14 @@
@echo off
if "%PHP_SDK_PHP_CMD%"=="" (
call %~dp0phpsdk_setvars.bat
if "!PHP_SDK_PHP_CMD!"=="" (
echo PHP SDK is not setup
exit /b 3
)
)
%PHP_SDK_PHP_CMD% -r "echo 'PHP SDK ' . file_get_contents(getenv('PHP_SDK_PATH') . '\\VERSION');"
exit /b

View File

@@ -1,10 +0,0 @@
::phpsdk.bat
@ECHO OFF
:: Add skd\bin directory to the path
SET PHP_SDK_BIN_PATH=%~dp0
SET PATH=%PATH%;%PHP_SDK_BIN_PATH%
:: Set BISON_SIMPLE
SET BISON_SIMPLE=%PHP_SDK_BIN_PATH%bison.simple

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,272 +0,0 @@
@ECHO off
REM Configuration
CALL %PHP_SDK_PATH%\script\conf_tools.bat
IF EXIST %PHP_SDK_PATH%\snaps.lock (
ECHO Snapshot script is already running
GOTO EXIT_LOCKED
)
SET LOG_DIR=%PHP_SDK_PATH%\log
SET START=%CD%
echo "LOCKED" > %PHP_SDK_PATH%\snaps.lock
IF "%1"=="" GOTO HELP
IF "%2"=="" GOTO HELP
IF "%3"=="" GOTO HELP
IF "%4"=="" SET USE_CVS=Yes
IF "%5"=="msi" SET USE_INSTALLER=Yes
SET SRC_ARCHIVE=%4
SET VC=%1
SET BRANCH=%2
SET DEST=%3
FOR /F "TOKENS=1* DELIMS= " %%A IN ('DATE/T') DO SET CALL_DATE=%%B
FOR /F "TOKENS=*" %%A IN ('TIME/T') DO SET CALL_TIME=%%A
SET CALL_DATETIME=%CALL_DATE% %CALL_TIME%
IF "%2"=="5.2" (
SET BRANCH=PHP_5_2
SET PHP_VERSION=5.2
GOTO START
)
IF "%2"=="5.3" (
SET BRANCH=PHP_5_3
SET PHP_VERSION=5.3
GOTO START
)
IF "%2"=="6.0" (
SET BRANCH=HEAD
SET PHP_VERSION=6.0
GOTO START
)
echo Invalid branch name
GOTO EXIT
:START
for /F "tokens=1-4 delims=:., " %%a in ('time/T') do set _TIME=%%a%%b%%c
for /F "tokens=2-5 delims=:.,/ " %%a in ('date/T') do set _DATE=%%a%%b%%c
SET SNAPDATETIME=%_DATE%%_TIME%
REM IF EXIST %3 rmdir /s /q %3
SET OLD_INCLUDE=%INCLUDE%
SET OLD_LIB=%LIB%
SET OLD_PATH=%PATH%
IF "%VC%"=="6" GOTO CONFIG_VC6
IF "%VC%"=="9" GOTO CONFIG_VC9
IF "%VC%"=="9x64" GOTO CONFIG_VC9_X64
echo Invalid VC Version
GOTO EXIT
:CONFIG_VC6
ECHO Setting environment for VC6-x86
SET INCLUDE=%VC6_INCLUDE%
SET LIB=%VC6_LIB%
SET PATH=%VC6_PATH%;%PATH%
SET ARCH=x86
SET VC_VERS=VC6
GOTO CVS
:CONFIG_VC9
ECHO Setting environment for VC9-x86
SET INCLUDE=%VC9_INCLUDE%
SET LIB=%VC9_LIB%
SET PATH=%VC9_PATH%;%PATH%
SET VC_VERS=VC9
SET ARCH=x86
GOTO CVS
:CONFIG_VC9_X64
ECHO Setting environment for VC9-x64
SET INCLUDE=%VC9_X64_INCLUDE%
SET LIB=%VC9_LIB%
SET PATH=%VC9_X64_PATH%;%PATH%
SET VC_VERS=VC9
SET ARCH=x64
:CVS
IF NOT "%USE_CVS%"=="Yes" GOTO USE_LAST_ARCHIVE
IF EXIST %DEST% RD /Q /S %DEST%
echo checkout from cvs %PHP_CVSROOT% -z3 checkout -r %BRANCH% -d %DEST% %PHP_MODULE%
cvs %PHP_CVSROOT% -z3 export -r %BRANCH% -d %DEST% %PHP_MODULE% > %START%\cvs.log 2<&1
GOTO TEST_DEST
:USE_LAST_ARCHIVE
ECHO Using archive %SRC_ARCHIVE% ...
unzip -o -qq %SRC_ARCHIVE%
FOR /D %%A IN (php-?.?-src-*) DO (
SET DIRNAME=%%A
)
ECHO Using %DIRNAME% ...
IF EXIST %DIRNAME%.last GOTO ALREADY_DONE
IF EXIST %DEST% RD /Q /S %DEST%
REN %DIRNAME% %DEST%
REM Clean old directories and .last file
FOR /D %%A IN (php-?.?-src-*) DO (
RD /Q /S %%A
)
FOR /F "tokens=4 delims=-" %%A IN ("%DIRNAME%") DO SET SNAPDATETIME=%%A
:TEST_DEST
echo Testing %DEST%...
IF EXIST %DEST% GOTO DEST_EXISTS
ECHO CVS or Archive ERROR %DEST% cannot be found
GOTO EXIT
:DEST_EXISTS
echo Compiling...
cd %DEST%
echo Buildconf log for %SNAPDATETIME% called at %CALL_DATETIME% >> %START%\buildconf.log
call buildconf.bat > %START%\buildconf.log 2<&1
echo Configure log for %SNAPDATETIME% called at %CALL_DATETIME% > %START%\configure.log 2<&1
cscript /nologo configure.js %CONFIGURE_ARGS% >> %START%\configure.log 2<&1
echo Compile log for %SNAPDATETIME% called at %CALL_DATETIME% > %START%\compile.log
nmake snap >> %START%\compile.log 2<&1
:TRANSFERT
echo Transfert files to %SSH_HOST%
cd %DEST%
IF EXIST Release_TS GOTO RELEASE_TS
IF EXIST Release GOTO RELEASE_NTS
:RELEASE_TS
SET PHP_BUILD_DIR=Release_TS
SET PHP_EXE=Release_TS\php.exe
SET NTS_POSTFIX=
SET NTS=ts
IF NOT EXIST %PHP_EXE% (
ECHO Build error.
GOTO EXIT
)
GOTO REMOTE_COPY
:RELEASE_NTS
SET PHP_BUILD_DIR=Release
SET PHP_EXE=Release\php.exe
SET NTS_POSTFIX=-nts
SET NTS=nts
IF NOT EXIST %PHP_EXE% (
ECHO Build error.
GOTO EXIT
)
:REMOTE_COPY
FOR /F "tokens=*" %%A IN ('%PHP_EXE% -r "echo substr(phpversion(),0,3);"') DO SET _PHPVERSION_SHORT=%%A
FOR /F "tokens=*" %%A IN ('%PHP_EXE% -r "echo phpversion();"') DO SET _PHPVERSION_STRING=%%A
IF "%USE_CVS%"=="Yes" FOR /F "tokens=*" %%A IN ('%PHP_EXE% -r "echo date('YmdHi');"') DO SET SNAPDATETIME=%%A
SET SSH_URL=%SSH_USER%@%SSH_HOST%
echo %SSH_KEY%
FOR %%A IN (%START%\*.log) DO (
ECHO copying %LOG_DIR%\%%~nA-%_PHPVERSION_SHORT%-%VC_VERS%-%ARCH%%NTS_POSTFIX%-%SNAPDATETIME%.log ...
COPY %START%\%%~nA.log %LOG_DIR%\%%~nA-%_PHPVERSION_SHORT%-%VC_VERS%-%ARCH%%NTS_POSTFIX%-%SNAPDATETIME%.log
"%PUTTYBASE%pscp.exe" -batch -q -i %SSH_KEY% -l %SSH_USER% %LOG_DIR%\%%~nA-%_PHPVERSION_SHORT%-%VC_VERS%-%ARCH%%NTS_POSTFIX%-%SNAPDATETIME%.log %SSH_URL%:%REMOTE_PATH% >> %LOG_DIR%\scp_%PHP_VERSION%%NTS_POSTFIX%-%SNAPDATETIME%.log 2<&1
)
FOR %%A IN (%PHP_BUILD_DIR%\*.zip) DO (
echo Copying %%~nA-%SNAPDATETIME%.zip ...
"%PUTTYBASE%pscp.exe" -batch -q -i %SSH_KEY% -l %SSH_USER% %PHP_BUILD_DIR%\%%~nA.zip %SSH_URL%:%REMOTE_PATH%/%%~nA-%SNAPDATETIME%.zip >> %LOG_DIR%\scp_%PHP_VERSION%%NTS_POSTFIX%-%SNAPDATETIME%.log 2<&1
copy %PHP_BUILD_DIR%\%%~nA.zip %PHP_BUILD_DIR%\%%~nA-%SNAPDATETIME%.zip
)
REM Remove old links and create the "-latest links"
"%PUTTYBASE%plink.exe" -i %SSH_KEY% -l %SSH_USER% %SSH_HOST% "rm -f" %REMOTE_PATH%/php-%PHP_VERSION%%NTS_POSTFIX%-win32-%VC_VERS%-%ARCH%-latest.zip >> %LOG_DIR%\scp_%PHP_VERSION%%NTS_POSTFIX%-%SNAPDATETIME%.log 2<&1
"%PUTTYBASE%plink.exe" -i %SSH_KEY% -l %SSH_USER% %SSH_HOST% "rm -f" %REMOTE_PATH%/php-debug-pack-%PHP_VERSION%%NTS_POSTFIX%-win32-%VC_VERS%-%ARCH%-latest.zip >> %LOG_DIR%\scp_%PHP_VERSION%%NTS_POSTFIX%-%SNAPDATETIME%.log 2<&1
"%PUTTYBASE%plink.exe" -i %SSH_KEY% -l %SSH_USER% %SSH_HOST% "rm -f" %REMOTE_PATH%/php-test-pack-%_PHPVERSION_SHORT%-latest.zip >> %LOG_DIR%\scp_%PHP_VERSION%%NTS_POSTFIX%-%SNAPDATETIME%.log 2<&1
"%PUTTYBASE%plink.exe" -i %SSH_KEY% -l %SSH_USER% %SSH_HOST% "rm -f" %REMOTE_PATH%/compile-%PHP_VERSION%%NTS_POSTFIX%-%VC_VERS%-%ARCH%-latest.log >> %LOG_DIR%\scp_%PHP_VERSION%%NTS_POSTFIX%-%SNAPDATETIME%.log 2<&1
"%PUTTYBASE%plink.exe" -i %SSH_KEY% -l %SSH_USER% %SSH_HOST% "rm -f" %REMOTE_PATH%/buildconf-%PHP_VERSION%%NTS_POSTFIX%-%VC_VERS%-%ARCH%-latest.log >> %LOG_DIR%\scp_%PHP_VERSION%%NTS_POSTFIX%-%SNAPDATETIME%.log 2<&1
"%PUTTYBASE%plink.exe" -i %SSH_KEY% -l %SSH_USER% %SSH_HOST% "rm -f" %REMOTE_PATH%/configure-%PHP_VERSION%%NTS_POSTFIX%-%VC_VERS%-%ARCH%-latest.log >> %LOG_DIR%\scp_%PHP_VERSION%%NTS_POSTFIX%-%SNAPDATETIME%.log 2<&1
"%PUTTYBASE%plink.exe" -i %SSH_KEY% -l %SSH_USER% %SSH_HOST% "rm -f" %REMOTE_PATH%/cache.info >> %LOG_DIR%\scp_%PHP_VERSION%%NTS_POSTFIX%-%SNAPDATETIME%.log 2<&1
SET VERSION_INFO=%_PHPVERSION_STRING%%NTS_POSTFIX%-Win32
IF "%PHP_VERSION%"=="5.2" GOTO OLD_NAMING
:CLEAN_NAMING
"%PUTTYBASE%plink.exe" -i %SSH_KEY% -l %SSH_USER% %SSH_HOST% ln -s %REMOTE_PATH%/php-%VERSION_INFO%-%VC_VERS%-%ARCH%-%SNAPDATETIME%.zip %REMOTE_PATH%/php-%PHP_VERSION%%NTS_POSTFIX%-win32-%VC_VERS%-%ARCH%-latest.zip >> %LOG_DIR%\scp_%PHP_VERSION%%NTS_POSTFIX%-%SNAPDATETIME%.log 2<&1
"%PUTTYBASE%plink.exe" -i %SSH_KEY% -l %SSH_USER% %SSH_HOST% ln -s %REMOTE_PATH%/php-debug-pack-%VERSION_INFO%-%VC_VERS%-%ARCH%-%SNAPDATETIME%.zip %REMOTE_PATH%/php-debug-pack-%PHP_VERSION%%NTS_POSTFIX%-win32-%VC_VERS%-%ARCH%-latest.zip >> %LOG_DIR%\scp_%PHP_VERSION%%NTS_POSTFIX%-%SNAPDATETIME%.log 2<&1
"%PUTTYBASE%plink.exe" -i %SSH_KEY% -l %SSH_USER% %SSH_HOST% ln -s %REMOTE_PATH%/php-test-pack-%_PHPVERSION_STRING%-%SNAPDATETIME%.zip %REMOTE_PATH%/php-test-pack-%_PHPVERSION_SHORT%-latest.zip >> %LOG_DIR%\scp_%PHP_VERSION%%NTS_POSTFIX%-%SNAPDATETIME%.log 2<&1
"%PUTTYBASE%plink.exe" -i %SSH_KEY% -l %SSH_USER% %SSH_HOST% ln -s %REMOTE_PATH%/compile-%PHP_VERSION%-%VC_VERS%-%ARCH%%NTS_POSTFIX%-%SNAPDATETIME%.log %REMOTE_PATH%/compile-%PHP_VERSION%%NTS_POSTFIX%-%VC_VERS%-%ARCH%-latest.log >> %LOG_DIR%\scp_%PHP_VERSION%%NTS_POSTFIX%-%SNAPDATETIME%.log 2<&1
"%PUTTYBASE%plink.exe" -i %SSH_KEY% -l %SSH_USER% %SSH_HOST% ln -s %REMOTE_PATH%/buildconf-%PHP_VERSION%-%VC_VERS%-%ARCH%%NTS_POSTFIX%-%SNAPDATETIME%.log %REMOTE_PATH%/buildconf-%PHP_VERSION%%NTS_POSTFIX%-%VC_VERS%-%ARCH%-latest.log >> %LOG_DIR%\scp_%PHP_VERSION%%NTS_POSTFIX%-%SNAPDATETIME%.log 2<&1
"%PUTTYBASE%plink.exe" -i %SSH_KEY% -l %SSH_USER% %SSH_HOST% ln -s %REMOTE_PATH%/configure-%PHP_VERSION%-%VC_VERS%-%ARCH%%NTS_POSTFIX%-%SNAPDATETIME%.log %REMOTE_PATH%/configure-%PHP_VERSION%%NTS_POSTFIX%-%VC_VERS%-%ARCH%-latest.log >> %LOG_DIR%\scp_%PHP_VERSION%%NTS_POSTFIX%-%SNAPDATETIME%.log 2<&1
SET PHP_ZIP_FILE=%PHP_BUILD_DIR%\php-%VERSION_INFO%-%VC_VERS%-%ARCH%-%SNAPDATETIME%.zip
GOTO INSTALLER
:OLD_NAMING
"%PUTTYBASE%plink.exe" -i %SSH_KEY% -l %SSH_USER% %SSH_HOST% ln -s %REMOTE_PATH%/php-%VERSION_INFO%-%SNAPDATETIME%.zip %REMOTE_PATH%/php-%PHP_VERSION%%NTS_POSTFIX%-win32-%VC_VERS%-%ARCH%-latest.zip >> %LOG_DIR%\scp_%PHP_VERSION%%NTS_POSTFIX%-%SNAPDATETIME%.log 2<&1
"%PUTTYBASE%plink.exe" -i %SSH_KEY% -l %SSH_USER% %SSH_HOST% ln -s %REMOTE_PATH%/php-debug-pack-%VERSION_INFO%-%SNAPDATETIME%.zip %REMOTE_PATH%/php-debug-pack-%PHP_VERSION%%NTS_POSTFIX%-win32-%VC_VERS%-%ARCH%-latest.zip >> %LOG_DIR%\scp_%PHP_VERSION%%NTS_POSTFIX%-%SNAPDATETIME%.log 2<&1
"%PUTTYBASE%plink.exe" -i %SSH_KEY% -l %SSH_USER% %SSH_HOST% ln -s %REMOTE_PATH%/compile-%PHP_VERSION%-%VC_VERS%-%ARCH%-%SNAPDATETIME%.log %REMOTE_PATH%/compile-%PHP_VERSION%-%VC_VERS%-%ARCH%-latest.log >> %LOG_DIR%\scp_%PHP_VERSION%%NTS_POSTFIX%-%SNAPDATETIME%.log 2<&1
"%PUTTYBASE%plink.exe" -i %SSH_KEY% -l %SSH_USER% %SSH_HOST% ln -s %REMOTE_PATH%/buildconf-%PHP_VERSION%-%VC_VERS%-%ARCH%-%SNAPDATETIME%.log %REMOTE_PATH%/buildconf-%PHP_VERSION%-%VC_VERS%-%ARCH%-latest.log >> %LOG_DIR%\scp_%PHP_VERSION%%NTS_POSTFIX%-%SNAPDATETIME%.log 2<&1
"%PUTTYBASE%plink.exe" -i %SSH_KEY% -l %SSH_USER% %SSH_HOST% ln -s %REMOTE_PATH%/configure-%PHP_VERSION%-%VC_VERS%-%ARCH%-%SNAPDATETIME%.log %REMOTE_PATH%/configure-%PHP_VERSION%-%VC_VERS%-%ARCH%-latest.log >> %LOG_DIR%\scp_%PHP_VERSION%%NTS_POSTFIX%-%SNAPDATETIME%.log 2<&1
SET PHP_ZIP_FILE=%PHP_BUILD_DIR%\php-%VERSION_INFO%-%SNAPDATETIME%.zip
GOTO INSTALLER
:INSTALLER
echo ************************ 3
IF "%USE_INSTALLER%"=="Yes" (
echo ************************ 3.1 installer
FOR %%A IN (%PHP_ZIP_FILE%) DO (
echo snapshot_installer.bat %PHP_VERSION%.0 %NTS% %VC_VERS% %ARCH% %%~fA
CALL snapshot_installer.bat %PHP_VERSION%.0 %NTS% %VC_VERS% %ARCH% %%~fA >> %LOG_DIR%\msi_%PHP_VERSION%%NTS_POSTFIX%-%VC_VERS%-%ARCH%-%SNAPDATETIME%.log 2<&1
)
)
FOR %%A IN (%PHP_BUILD_DIR%\*.msi) DO (
echo Copying %%~nA.msi ...
"%PUTTYBASE%pscp.exe" -batch -q -i %SSH_KEY% -l %SSH_USER% %PHP_BUILD_DIR%\%%~nA.msi %SSH_URL%:%REMOTE_PATH%/%%~nA.msi >> %LOG_DIR%\scp_%PHP_VERSION%%NTS_POSTFIX%-%VC_VERS%-%ARCH%-%SNAPDATETIME%.log 2<&1
"%PUTTYBASE%plink.exe" -i %SSH_KEY% -l %SSH_USER% %SSH_HOST% rm %REMOTE_PATH%/php-%PHP_VERSION%%NTS_POSTFIX%-win32-%VC_VERS%-%ARCH%-latest.msi >> %LOG_DIR%\scp_%PHP_VERSION%%NTS_POSTFIX%-%VC_VERS%-%ARCH%-%SNAPDATETIME%.log 2<&1
"%PUTTYBASE%plink.exe" -i %SSH_KEY% -l %SSH_USER% %SSH_HOST% ln -s %REMOTE_PATH%/%%~nA.msi %REMOTE_PATH%/php-%PHP_VERSION%%NTS_POSTFIX%-win32-%VC_VERS%-%ARCH%-latest.msi >> %LOG_DIR%\scp_%PHP_VERSION%%NTS_POSTFIX%-%VC_VERS%-%ARCH%-%SNAPDATETIME%.log 2<&1
)
"%PUTTYBASE%plink.exe" -i %SSH_KEY% -l %SSH_USER% %SSH_HOST% "sha1sum %REMOTE_PATH%/*-latest.zip %REMOTE_PATH%/*-latest.msi > %REMOTE_PATH%/sha1sum.txt" >> %LOG_DIR%\scp_%PHP_VERSION%%NTS_POSTFIX%-%SNAPDATETIME%.log 2<&1
echo ************************ 4
GOTO EXIT
:HELP
ECHO snapshot ^<VC version^> ^<branch/tag^> ^<destination^>
GOTO EXIT
:ALREADY_DONE
ECHO Snapshot for %DIRNAME% already done
:EXIT
del %PHP_SDK_PATH%\snaps.lock
FOR /D %%A IN (*.last) DO (
DEL %%A
)
REM Set the last "snap"
echo %DIRNAME% > %DIRNAME%.last
:EXIT_LOCKED
cd %START%
SET LIB=%OLD_LIB%
SET INCLUDE=%OLD_INCLUDE%
SET PATH=%OLD_PATH%
SET BRANCH=
SET DEST=
SET DIRNAME=
SET USE_CVS=
SET LOG_DIR=
SET NTS_POSTFIX=
SET PHP_BUILD_DIR=
SET PHP_EXE=
SET PHP_VERSION=
SET SSH_URL=
SET START=
SET VC=
SET ZIP_PATH=

View File

@@ -1,30 +0,0 @@
@ECHO OFF
SET PHP_SDK_SCRIPT_PATH=%~dp0
REM change the drive
%~d0
CALL %PHP_SDK_SCRIPT_PATH%\phpsdk_setvars.bat
IF "%1" == "" (
SET CONFIGURE_ARGS=--enable-snapshot-build --enable-debug-pack --with-snapshot-template=%PHP_SDK_PATH%\snap_5_2\vc6\x86\template --with-php-build=%PHP_SDK_PATH%\snap_5_2\vc6\x86\php_build --with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared
)
IF "%1" == "ts" (
SET CONFIGURE_ARGS=--enable-snapshot-build --enable-debug-pack --with-snapshot-template=%PHP_SDK_PATH%\snap_5_2\vc6\x86\template --with-php-build=%PHP_SDK_PATH%\snap_5_2\vc6\x86\php_build --with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared
)
IF "%1" == "nts" (
SET CONFIGURE_ARGS=--enable-snapshot-build --enable-debug-pack --disable-zts --disable-isapi --with-snapshot-template=%PHP_SDK_PATH%\snap_5_2\vc6\x86\template --with-php-build=%PHP_SDK_PATH%\snap_5_2\vc6\x86\php_build --with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared
)
SET PHP_MODULE=php5
IF "%2" == "" (
CD %PHP_SDK_PATH%\snap_5_2\sources
CALL snapshot_src_download.bat 5.2
)
CD %PHP_SDK_PATH%\snap_5_2\vc6\x86
CALL snapshot.bat 6 5.2 snap52_vc6 %PHP_SDK_PATH%\snap_5_2\sources\php-5.2-src-latest.zip %4

View File

@@ -1,13 +0,0 @@
@ECHO OFF
SET PHP_SDK_SCRIPT_PATH=%~dp0
REM change the drive
%~d0
CALL %PHP_SDK_SCRIPT_PATH%\phpsdk_setvars.bat
CD %PHP_SDK_PATH%\snap_5_2\sources
CALL snapshot_src_download.bat 5.2
CMD /C snapshot_5_2.bat ts nodownload no msi
CMD /C snapshot_5_2.bat nts nodownload no msi

View File

@@ -1,28 +0,0 @@
@ECHO OFF
SET PHP_SDK_SCRIPT_PATH=%~dp0
REM change the drive
%~d0
CALL %PHP_SDK_SCRIPT_PATH%\phpsdk_setvars.bat
SET PHP_MODULE=php5
IF "%1" == "" (
SET CONFIGURE_ARGS=--enable-snapshot-build --enable-debug-pack --disable-isapi --with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared
)
IF "%1" == "ts" (
SET CONFIGURE_ARGS=--enable-snapshot-build --enable-debug-pack --disable-isapi --with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared
)
IF "%1" == "nts" (
SET CONFIGURE_ARGS=--enable-snapshot-build --enable-debug-pack --disable-zts --disable-isapi --disable-nsapi --with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared
)
IF "%2" == "" (
CD %PHP_SDK_PATH%\snap_5_3\sources
CALL snapshot_src_download.bat 5.3
)
CD %PHP_SDK_PATH%\snap_5_3\vc6\x86
CALL snapshot.bat 6 5.3 snap53_vc6 %PHP_SDK_PATH%\snap_5_3\sources\php-5.3-src-latest.zip %4

View File

@@ -1,14 +0,0 @@
@ECHO OFF
SET OLDPATH=%PATH%
CALL d:\php-sdk\rmtools\bin\snap.bat d:\php-sdk\rmtools\config\php53vc9x86.ini
SET PATH=%OLDPATH%
SET OLDPATH=%PATH%
CALL d:\php-sdk\rmtools\bin\snap.bat d:\php-sdk\rmtools\config\php53ntsvc9x86.ini
SET PATH=%OLDPATH%
SET OLDPATH=%PATH%
CALL d:\php-sdk\rmtools\bin\snap.bat d:\php-sdk\rmtools\config\php53vc6x86.ini
SET PATH=%OLDPATH%
SET OLDPATH=%PATH%
CALL d:\php-sdk\rmtools\bin\snap.bat d:\php-sdk\rmtools\config\php53ntsvc6x86.ini
SET PATH=%OLDPATH%

View File

@@ -1,15 +0,0 @@
@ECHO OFF
SET PHP_SDK_SCRIPT_PATH=%~dp0
REM change the drive
%~d0
CALL %PHP_SDK_SCRIPT_PATH%\phpsdk_setvars.bat
CD %PHP_SDK_PATH%\snap_5_3\sources
CALL snapshot_src_download.bat 5.3
CMD /C snapshot_5_3_vc9.bat ts nodownload no msi
CMD /C snapshot_5_3_vc9.bat nts nodownload no msi
CMD /C snapshot_5_3.bat ts nodownload no msi
CMD /C snapshot_5_3.bat nts nodownload no msi

View File

@@ -1,30 +0,0 @@
@ECHO OFF
SET PHP_SDK_SCRIPT_PATH=%~dp0
REM change the drive
%~d0
CALL %PHP_SDK_SCRIPT_PATH%\phpsdk_setvars.bat
CD %PHP_SDK_PATH%\php_5_3\vc9\x86
IF "%1" == "" (
SET CONFIGURE_ARGS=--enable-snapshot-build --disable-isapi --enable-debug-pack --disable-isapi --with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared --with-enchant=shared
)
IF "%1" == "ts" (
SET CONFIGURE_ARGS=--enable-snapshot-build --disable-isapi --enable-debug-pack --disable-isapi --with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared --with-enchant=shared
)
IF "%1" == "nts" (
SET CONFIGURE_ARGS=--enable-snapshot-build --enable-debug-pack --disable-zts --disable-isapi --disable-nsapi --with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared --with-enchant=shared
)
SET PHP_MODULE=php5
IF "%2" == "" (
CD %PHP_SDK_PATH%\snap_5_3\sources
CALL snapshot_src_download.bat 5.3
)
CD %PHP_SDK_PATH%\snap_5_3\vc9\x86
CALL snapshot.bat 9 5.3 snap53_vc9 %PHP_SDK_PATH%\snap_5_3\sources\php-5.3-src-latest.zip %4

View File

@@ -1,25 +0,0 @@
@ECHO OFF
REM %VC9_SHELL%
REM CD "C:\Program Files\Microsoft SDKs\Windows\v6.1\"
REM CALL "C:\Program Files\Microsoft SDKs\Windows\v6.1\Bin\SetEnv.Cmd" /x86 /xp /release
SET PHP_SDK_SCRIPT_PATH=%~dp0
REM change the drive
%~d0
CALL %PHP_SDK_SCRIPT_PATH%\phpsdk_setvars.bat
SET CONFIGURE_ARGS=--enable-snapshot-build --enable-debug-pack --with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared --with-enchant=shared
SET PHP_MODULE=php5
CD %PHP_SDK_PATH%\snap_5_3\sources
CALL snapshot_src_download.bat 5.3
REM XP is the minimum version we support
REM setenv /x86 /xp /release
CD %PHP_SDK_PATH%\snap_5_3\vc9\x64
CALL snapshot.bat 9x64 PHP_5_3 snap53_vc9x64 %PHP_SDK_PATH%\snap_5_3\sources\php-5.3-src-latest.zip

View File

@@ -1,31 +0,0 @@
@ECHO OFF
SET PHP_SDK_SCRIPT_PATH=%~dp0
REM change the drive
%~d0
CALL %PHP_SDK_SCRIPT_PATH%\phpsdk_setvars.bat
SET PHP_MODULE=HEAD
IF "%1" == "" (
SET CONFIGURE_ARGS=--enable-snapshot-build --disable-isapi --enable-debug-pack --without-sqlite --without-apache-hooks --without-static-icu --with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared
)
IF "%1" == "ts" (
SET CONFIGURE_ARGS=--enable-snapshot-build --disable-isapi --enable-debug-pack --without-sqlite --without-apache-hooks --without-static-icu --with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared
)
IF "%1" == "nts" (
SET CONFIGURE_ARGS=--enable-snapshot-build --disable-zts --without-sqlite --disable-isapi --without-apache-hooks --enable-debug-pack --without-static-icu --with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared
)
SET OLD_PATH=%PATH%
SET PATH=%PATH%;%PHP_SDK_PATH%\snap_6_0\vc6\x86\deps\bin
IF "%2" == "" (
CD %PHP_SDK_PATH%\snap_6_0\sources
CALL snapshot_src_download.bat 6.0
)
CD %PHP_SDK_PATH%\snap_6_0\vc6\x86
CALL snapshot.bat 6 6.0 snap60_vc6 %PHP_SDK_PATH%\snap_6_0\sources\php-6.0-src-latest.zip %4

View File

@@ -1,15 +0,0 @@
@ECHO OFF
SET PHP_SDK_SCRIPT_PATH=%~dp0
REM change the drive
%~d0
CALL %PHP_SDK_SCRIPT_PATH%\phpsdk_setvars.bat
CD %PHP_SDK_PATH%\snap_6_0\sources
CALL snapshot_src_download.bat 6.0
CMD /C snapshot_6_0_vc9.bat ts nodownload no msi
CMD /C snapshot_6_0_vc9.bat nts nodownload no msi
REM CMD /C snapshot_6_0.bat ts nodownload no msi
REM CMD /C snapshot_6_0.bat nts nodownload no msi

View File

@@ -1,32 +0,0 @@
@ECHO OFF
SET PHP_SDK_SCRIPT_PATH=%~dp0
REM change the drive
%~d0
CALL %PHP_SDK_SCRIPT_PATH%\phpsdk_setvars.bat
SET PHP_MODULE=HEAD
IF "%1" == "" (
SET CONFIGURE_ARGS=--enable-snapshot-build --disable-isapi --enable-debug-pack --without-static-icu --without-sqlite --with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared
)
IF "%1" == "ts" (
SET CONFIGURE_ARGS=--enable-snapshot-build --disable-isapi --enable-debug-pack --without-static-icu --without-sqlite --with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared
)
IF "%1" == "nts" (
SET CONFIGURE_ARGS=--enable-snapshot-build --disable-zts --disable-isapi --enable-debug-pack --without-static-icu --without-sqlite --with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared
)
SET OLD_PATH=%PATH%
SET PATH=%PATH%;%PHP_SDK_PATH%\snap_6_0\vc9\x86\deps\bin
IF "%2" == "" (
CD %PHP_SDK_PATH%\snap_6_0\sources
CALL snapshot_src_download.bat 6.0
)
CD %PHP_SDK_PATH%\snap_6_0\vc9\x86
CALL snapshot.bat 9 6.0 snap60_vc9 %PHP_SDK_PATH%\snap_6_0\sources\php-6.0-src-latest.zip %4

View File

@@ -1,124 +0,0 @@
@echo off
goto old
IF "%1"=="" GOTO HELP
IF "%2"=="" GOTO HELP
IF NOT EXIST %1% (
echo ^<%1^> does not exist
GOTO EXIT
)
IF NOT EXIST %2% (
echo ^<%2^> does not exist
GOTO EXIT
)
IF "%3%"=="VC9" (
if "%4%"== "x64" set includevc9msm="x86_x64"
if "%4%"=="x86" set includevc9msm="x86"
if "%4%"=="" set includevc9msm="x86"
)
:old
SET PHP_SDK_SCRIPT_PATH=%~dp0
SET START=%CD%
REM change the drive
%~d0
echo %PHP_SDK_SCRIPT_PATH%
CALL %PHP_SDK_SCRIPT_PATH%\phpsdk_setvars.bat
SET PHP_INSTALLER_PATH=%PHP_SDK_SCRIPT_PATH%..\win-installer
SET A=%~n5
SET MSI_PATH=%A%.msi
cd %PHP_INSTALLER_PATH%
IF EXIST Files RD /Q /S Files
echo %5
unzip -o -qq -d Files %5
SET php_exe=Files\php.exe
copy %PHP_SDK_SCRIPT_PATH%..\template\php_manual_en.chm Files\
echo generating ... %MSI_PATH%
set phpver=%1
set phpver=%phpver:~0,3%
set phpver=%phpver:.=%
echo Building ExtensionsFeatures.wxs
copy ExtensionsFeatures%phpver%.wxs ExtensionsFeatures.wxs
set suffix=
set extrants=
set extrasnaps=
set buildtype="VC6-x86"
set includevc9msm=
if (%2)==() goto build
if %2==nts set extrants="nts-"
if %2==nts set suffix=NTS
if %2==VC9 set buildtype="VC9-x86"
if %2==VC9 set includeVC9msm="x86"
if %2==x64 set buildtype="VC9-x64"
if %2==x64 set includeVC9msm="x86_x64"
if %2==snapshot set extrasnaps="-latest"
if (%3)==() goto build
if %3==nts set extrants="nts-"
if %3==nts set suffix=NTS
if %3==VC9 set buildtype="VC9-x86"
if %3==VC9 set includeVC9msm="x86"
if %3==x64 set buildtype="VC9-x64"
if %3==x64 set includeVC9msm="x86_x64"
if %3==snapshot set extrasnaps="-latest"
if (%4)==() goto build
if %4==nts set extrants="nts-"
if %4==nts set suffix="NTS"
if %4==VC9 set buildtype="VC9-x86"
if %4==VC9 set includeVC9msm="x86"
if %4==x64 set buildtype="VC9-x64"
if %4==x64 set includeVC9msm="x86_x64"
if %4==snapshot set extrasnaps="-latest"
echo WebServerConfig%phpver%%suffix%.wxs ****
echo %phpver% %suffix%
:build
set msiname="%MSI_PATH%"
echo Building ExtensionsFeatures.wxs
copy ExtensionsFeatures%phpver%.wxs ExtensionsFeatures.wxs
echo Building ExtensionsComponents.wxs
%php_exe% GenExtensionsComponents.wxs.php "%phpver%"
echo Building PHPInstaller%1.wxs
%php_exe% GenPHPInstaller.wxs.php "PHPInstallerBase%phpver%%suffix%.wxs" "%1" "%includevc9msm%"
echo Building WebServerConfig%1.wxs
copy WebServerConfig%phpver%%suffix%.wxs WebServerConfig%1.wxs
echo Compiling UI....
Wix\candle.exe -out PHPInstallerCommon.wixobj PHPInstallerCommon%suffix%%phpver%.wxs
echo Building UI....
Wix\lit.exe -out PHPInstallerCommon.wixlib PHPInstallerCommon.wixobj
echo Compiling Installer....
Wix\candle.exe ExtensionsComponents.wxs ExtensionsFeaturesBuild.wxs WebServerConfig%1.wxs PHPInstaller%1.wxs
echo Linking Installer....
Wix\light.exe -out "%msiname%" ExtensionsComponents.wixobj ExtensionsFeaturesBuild.wixobj WebServerConfig%1.wixobj PHPInstaller%1.wixobj PHPInstallerCommon.wixlib -loc WixUI_en-us.wxl
copy %msiname% %~dp5
del %msiname%
GOTO EXIT
:help
ECHO snapshot_installer ^<php dist files^> ^<destination directory^>
echo create the MSI file using the php version, architecture and compiler information
GOTO EXIT
:EXIT
CD %START%

View File

@@ -1,41 +0,0 @@
@ECHO OFF
SET PHP_SDK_SCRIPT_PATH=%~dp0
CALL %PHP_SDK_SCRIPT_PATH%\phpsdk_setvars.bat
ECHO %PHP_SDK_SCRIPT_PATH%
REM change the drive
%~d0
IF "%1"=="5.2" GOTO DOWNLOAD
IF "%1"=="5.3" GOTO DOWNLOAD
IF "%1"=="6.0" GOTO DOWNLOAD
GOTO USAGE
:DOWNLOAD
SET BRANCH=%1
SET PHP_ARCHIVE_FILENAME=php-%BRANCH%-src-latest.zip
IF EXIST %PHP_ARCHIVE_FILENAME% DEL %PHP_ARCHIVE_FILENAME%
wget http://windows.php.net/downloads/snaps/php-%BRANCH%/%PHP_ARCHIVE_FILENAME%
REM unzip -o -qq %PHP_ARCHIVE_FILENAME%
REM Take the last one
FOR /D %%A IN (php-%BRANCH%-src-*) DO (
SET DIRNAME=%%A
)
ECHO Downloaded: %DIRNAME%
:DONE
GOTO EXIT
:USAGE
echo Usage %~n0 ^<branch name^> (5.2 5.3 or 6.0)
:EXIT
SET A=
SET N=
SET BRANCH=
SET PHP_ARCHIVE_FILENAME=
SET DIRNAME=
SET cnt=

View File

@@ -1,8 +0,0 @@
@ECHO OFF
SET OLDPATH=%PATH%
CALL d:\php-sdk\rmtools\bin\snap.bat d:\php-sdk\rmtools\config\phptrunkvc9x86.ini
SET PATH=%OLDPATH%
SET OLDPATH=%PATH%
CALL d:\php-sdk\rmtools\bin\snap.bat d:\php-sdk\rmtools\config\phptrunkntsvc9x86.ini
SET PATH=%OLDPATH%

BIN
bin/task.exe Normal file

Binary file not shown.

View File

@@ -1,11 +0,0 @@
@echo off
set MY=Release\php-5.3.0alpha3-dev-nts-Win32-VC9-x86.zip
FOR %%A IN (%MY%) DO echo %%~dpA
set USE_INSTALLER=Yes
IF %USE_INSTALLER%==Yes (
FOR %%A IN (%MY%) DO (
echo snapshot_installer.bat %PHP_VERSION%.0 %NTS% %VC_VERS% %ARCH% %%~fA
REM CALL snapshot_installer.bat %PHP_VERSION%.0 %NTS% %VC_VERS% %ARCH% %%~dpA
)
)

View File

@@ -1,27 +0,0 @@
@ECHO OFF
REM Run 5.3 Snapshots builds with VC9/VC6
SET PHP_SDK_SCRIPT_PATH=%~dp0
CALL %PHP_SDK_SCRIPT_PATH%\phpsdk_setvars.bat
%~d0
CD %PHP_SDK_PATH%\php_5_3\sources
REM unzip -o -qq %PHP_SDK_PATH%\php_5_3\sources\php-5.3-src-latest.zip
FOR /D %%A IN (php-?.?-src-*) DO (
SET DIRNAME=%%A
)
ECHO Using %DIRNAME% ...
FOR /D %%A IN (php-?.?-src-*) DO (
SET DIRNAME=%%A
)
FOR /D %%A IN (php-?.?-src-*) DO (
SET DIRNAME=%%A
)
FOR /F "tokens=4 delims=-" %%A IN ("%DIRNAME%") DO ECHO %%A
REM snapshot_src_download.bat 5.3

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,2 +0,0 @@
#! /bin/sh
exec 'c:/progra~1/bison/bin/bison' -y "$@"

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,20 @@
@echo off
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
set PHP_SDK_FIREBIRD_PATH=
if "%PHP_SDK_ARCH%"=="x64" (
set PHP_SDK_FIREBIRD_PATH=E:\local_programs\Firebird-2.5.5.26952-0_x64\bin;
set PDO_FIREBIRD_TEST_DSN=firebird:dbname=127.0.0.1:E:\local_programs\Firebird-2.5.5.26952-0_x64\examples\empbuild\EMPLOYEE.FDB
set PDO_FIREBIRD_TEST_USER=SYSDBA
set PDO_FIREBIRD_TEST_PASS=masterkey
)
set PATH=%PHP_SDK_FIREBIRD_PATH%%PATH%
set ODBC_TEST_USER=php_test2
set ODBC_TEST_PASS=php_test2
set ODBC_TEST_DSN=Driver={SQL Server};Server={W530-PHP-DEV\TEST2014};Database={php_test2};uid=%ODBC_TEST_USER%;pwd=%ODBC_TEST_PASS%
set PDOTEST_DSN=odbc:%ODBC_TEST_DSN%

72
doc/task.c Normal file
View File

@@ -0,0 +1,72 @@
/**
* Run the passed command line hidden, suitable for a scheduled task.
* Author: Anatol Belski <ab@php.net>
* License: BSD 2-Clause
*/
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#define CMD_PRE "cmd.exe /c "
#define CMD_PRE_LEN (sizeof(CMD_PRE)-1)
#ifdef DEBUG
int
main(int argc, char **argv)
#else
int
APIENTRY WinMain(HINSTANCE inst, HINSTANCE prev_inst, LPTSTR in_cmd, int show)
#endif
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
DWORD exit_code;
char *cmd = NULL;
size_t cmd_len = 0, arg_len = 0;
char *arg = strchr(GetCommandLine(), ' ');
if (!arg) {
return 3;
}
#ifdef DEBUG
printf("passed cmd: '%s'\n", arg);
#endif
arg_len = strlen(arg);
cmd_len = CMD_PRE_LEN + arg_len + 1;
cmd = malloc(cmd_len * sizeof(char));
memmove(cmd, CMD_PRE, CMD_PRE_LEN);
memmove(cmd + CMD_PRE_LEN, arg, arg_len);
cmd[cmd_len-1] = '\0';
#ifdef DEBUG
printf("constructed cmd: '%s'\n", cmd);
#endif
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_HIDE;
ZeroMemory( &pi, sizeof(pi) );
if (CreateProcess(NULL, cmd, NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi)) {
CloseHandle( pi.hThread );
} else {
free(cmd);
printf( "Error: CreatePracess 0x%08lx \n", GetLastError() );
return 3;
}
WaitForSingleObject( pi.hProcess, INFINITE );
GetExitCodeProcess(pi.hProcess, &exit_code);
CloseHandle( pi.hProcess );
free(cmd);
return exit_code;
}

View File

@@ -0,0 +1,19 @@
rem Task batch example.
rem Create a task, put an action with the following data:
rem Action: start a program
rem Program/script: C:\php-sdk\bin\task.exe
rem Add arguments: "C:\php-sdk\phpsdk-starter.bat -c vc14 -a x64 -t C:\php-sdk\unattended-build-task.bat"
rem Run the task
pushd C:\php-sdk\php70\vc14\x64\php-src
git pull --rebase
nmake clean
nmake > vs.log 2>&1
popd
exit

View File

@@ -0,0 +1,81 @@
<?php
namespace SDK;
use SDK\Config;
use SDK\Cache;
use SDK\Exception;
class Cache
{
protected $id;
protected $hash;
public function __construct(string $id)
{/*{{{*/
$this->id = $id;
$this->hash = md5($id);
/* XXX pass as arg, fine for now. */
}/*}}}*/
protected function getCacheablePath(string $path, bool $relative = false) : string
{/*{{{*/
if ($relative) {
$dir = Config::getCacheDir();
$name = $path;
} else {
$dir = dirname($path);
$name = basename($path);
}
return $dir . DIRECTORY_SEPARATOR . $this->hash . "." . $name;
}/*}}}*/
public function fileIsCached(string $path, bool $relative = false) : bool
{/*{{{*/
return file_exists($this->getCacheablePath($path, $relative));
}/*}}}*/
public function cachedContentDiffers(string $path, string $content, bool $relative = false) : bool
{/*{{{*/
$p = $this->getCacheablePath($path, $relative);
if (!file_exists($p)) {
return true;
}
$old_sum = md5_file($p);
$new_sum = md5($content);
return $old_sum != $new_sum;
}/*}}}*/
public function cacheContent(string $path, string $content, bool $relative = false)
{/*{{{*/
$p = $this->getCacheablePath($path, $relative);
if (strlen($content) !== file_put_contents($p, $content)) {
throw new Exception("Couldn't cache '$p'");
}
}/*}}}*/
public function getCachedContent(string $path, bool $relative = false)
{/*{{{*/
$p = $this->getCacheablePath($path, $relative);
if ($this->isFileCached($p)) {
return file_get_contents($p);
}
return "";
}/*}}}*/
}
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/

View File

@@ -0,0 +1,249 @@
<?php
namespace SDK;
use SDK\Dependency\Fetcher;
use SDK\Cache;
use SDK\Exception;
class Config
{
/* Config variables. */
protected static $depsHost = 'windows.php.net';
protected static $depsPort = 80;
protected static $depsBaseUri = "/downloads/php-sdk/deps";
/* protected static $sdkNugetFeedUrl = "http://127.0.0.1/sdk/nuget"; */
protected static $knownBranches = array ();
/* Helper props and methods. */
protected static $currentBranchName = NULL;
protected static $currentArchName = NULL;
protected static $currentCrtName = NULL;
protected static $currentStabilityName = NULL;
protected static $depsLocalPath = NULL;
public static function getDepsHost() : string
{/*{{{*/
return self::$depsHost;
}/*}}}*/
public static function getDepsPort() : string
{/*{{{*/
return self::$depsPort;
}/*}}}*/
public static function getDepsBaseUri() : string
{/*{{{*/
return self::$depsBaseUri;
}/*}}}*/
public static function setCurrentArchName(string $arch)
{/*{{{*/
self::$currentArchName = $arch;
} /*}}}*/
public static function getCurrentArchName()
{/*{{{*/
return self::$currentArchName;
} /*}}}*/
public static function setCurrentCrtName(string $crt)
{/*{{{*/
self::$currentCrtName = $crt;
} /*}}}*/
public static function getCurrentCrtName()
{/*{{{*/
return self::$currentCrtName;
} /*}}}*/
public static function setCurrentStabilityName(string $stability)
{/*{{{*/
self::$currentStabilityName = $stability;
} /*}}}*/
public static function getCurrentStabilityName()
{/*{{{*/
return self::$currentStabilityName;
} /*}}}*/
public static function getKnownBranches() : array
{/*{{{*/
if (empty(self::$knownBranches)) {
$cache_file = "known_branches.txt";
$cache = new Cache(self::getDepsLocalPath());
$fetcher = new Fetcher(self::$depsHost, self::$depsPort);
$tmp = $fetcher->getByUri(self::$depsBaseUri . "/series/");
if (false !== $tmp) {
$data = array();
if (preg_match_all(",/packages-(.+)-(vc\d+)-(x86|x64)-(stable|staging)\.txt,U", $tmp, $m, PREG_SET_ORDER)) {
foreach ($m as $b) {
if (!isset($data[$b[1]])) {
$data[$b[1]] = array();
}
$data[$b[1]][$b[2]][] = array("arch" => $b[3], "stability" => $b[4]);
}
$cache->cachecontent($cache_file, json_encode($data, JSON_PRETTY_PRINT), true);
}
} else {
/* It might be ok to use cached branches list, if a fetch failed. */
$tmp = $cache->getCachedContent($cache_file, true);
$data = json_decode($tmp, true);
}
if (!is_array($data) || empty($data)) {
throw new Exception("Failed to fetch supported branches");
}
self::$knownBranches = $data;
}
return self::$knownBranches;
}/*}}}*/
public static function setCurrentBranchName(string $name)
{/*{{{*/
if (!array_key_exists($name, self::getKnownBranches())) {
// throw new Exception("Unsupported branch '$name'");
}
self::$currentBranchName = $name;
}/*}}}*/
public static function getCurrentBranchName()
{/*{{{*/
return self::$currentBranchName;
}/*}}}*/
public static function getCurrentBranchData() : array
{/*{{{*/
$ret = array();
$branches = self::getKnownBranches();
if (!array_key_exists(self::$currentBranchName, $branches)) {
throw new Exception("Unknown branch '" . self::$currentBranchName . "'");
}
$cur_crt = Config::getCurrentCrtName();
if (count($branches[self::$currentBranchName]) > 1) {
if (NULL === $cur_crt) {
throw new Exception("More than one CRT is available for branch '" . self::$currentBranchName . "', pass one explicitly.");
}
$crt = array_keys($branches[self::$currentBranchName])[0];
if ($cur_crt != $crt) {
throw new Exception("The passed CRT '$cur_crt' doesn't match any availbale for branch '" . self::$currentBranchName . "'");
}
$data = $branches[self::$currentBranchName][$cur_crt];
} else {
/* Evaluate CRTs, to avoid ambiquity. */
list($crt, $data) = each($branches[self::$currentBranchName]);
if ($crt != $cur_crt) {
throw new Exception("The passed CRT '$cur_crt' doesn't match any availbale for branch '" . self::$currentBranchName . "'");
}
}
$ret["name"] = self::$currentBranchName;
$ret["crt"] = $crt;
/* Last step, filter by arch and stability. */
foreach ($data as $d) {
if (self::getCurrentArchName() == $d["arch"]) {
if (self::getCurrentStabilityName() == $d["stability"]) {
$ret["arch"] = $d["arch"];
$ret["stability"] = $d["stability"];
}
}
}
if (!$ret["stability"]) {
throw new Exception("Failed to find config with stability '" . self::getCurrentStabilityName() . "'");
}
if (!$ret["crt"]) {
throw new Exception("Failed to find config with arch '" . self::getCurrentArchName() . "'");
}
return $ret;
}/*}}}*/
public static function getSdkNugetFeedUrl() : string
{/*{{{*/
return self::$sdkNugetFeedUrl;
}/*}}}*/
public static function getSdkPath()
{/*{{{*/
$path = getenv("PHP_SDK_PATH");
if (!$path) {
throw new Exception("PHP_SDK_PATH isn't set!");
}
$path = realpath($path);
if (!file_exists($path)) {
throw new Exception("The path '$path' is non existent.");
}
return $path;
}/*}}}*/
public static function getSdkVersion() : string
{/*{{{*/
$path = self::getSdkPath() . DIRECTORY_SEPARATOR . "VERSION";
if (!file_exists($path)) {
throw new Exception("Couldn't find the SDK version file.");
}
return file_get_contents($path);
}/*}}}*/
public static function getDepsLocalPath()
{/*{{{*/
return self::$depsLocalPath;
}/*}}}*/
public static function setDepsLocalPath(string $path)
{/*{{{*/
self::$depsLocalPath = $path;
}/*}}}*/
public static function getCacheDir() : string
{/*{{{*/
$path = self::getSdkPath() . DIRECTORY_SEPARATOR . ".cache";
if (!file_exists($path)) {
if (!mkdir($path)) {
throw new Exception("Failed to create '$path'");
}
}
return $path;
}/*}}}*/
public static function getTmpDir() : string
{/*{{{*/
$path = self::getSdkPath() . DIRECTORY_SEPARATOR . ".tmp";
if (!file_exists($path)) {
if (!mkdir($path)) {
throw new Exception("Failed to create '$path'");
}
}
return $path;
}/*}}}*/
}
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/

View File

@@ -0,0 +1,90 @@
<?php
namespace SDK\Dependency;
use SDK\Config;
use SDK\Exception;
class Fetcher
{
protected $host;
protected $port;
protected $stability;
protected $arch;
protected $series;
public function __construct(string $host, int $port, string $arch = NULL, string $stability = NULL, Series $series = NULL)
{/*{{{*/
$this->stability = $stability;
$this->arch = $arch;
$this->host = $host;
$this->port = $port;
}/*}}}*/
public function getSeries() : Series
{/*{{{*/
return $this->series;
}/*}}}*/
public function setSeries(Series $series)
{/*{{{*/
$this->series = $series;
}/*}}}*/
/* TODO more robust implementation. */
/* TODO implement indicator. */
public function getByUri($uri) : string
{/*{{{*/
$url = "http://{$this->host}:{$this->port}$uri";
$s = file_get_contents($url);
if (false === $s) {
throw new Exception("failed to fetch $url");
}
return $s;
}/*}}}*/
/*protected function fetch($uri) : string
{
$fp = @fsockopen($this->host, $this->port);
if (!$fp) {
throw new Exception("Couldn't connect to windows.php.net");
}
$hdrs = "GET $uri HTTP/1.0\r\nHost: {$this->host}\r\nConnection: close\r\n\r\n";
$r = fwrite($fp, $hdrs);
if (false === $r || $r != strlen($hdrs)) {
fclose($fp);
throw new Exception("Request to windows.php.net failed");
}
$r = '';
while (!feof($fp)) {
$r .= fread($fp, 32768);
}
if (preg_match(',HTTP/\d\.\d 200 .*,', $r) < 1) {
var_dump($r);
fclose($fp);
throw new Exception("Invalid response from {$this->host}:{$this->port} while fetching '$uri'");
}
fclose($fp);
$ret = substr($r, strpos($r, "\r\n"));
return trim($ret);
}*/
}
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/

View File

@@ -0,0 +1,123 @@
<?php
namespace SDK\Dependency;
use SDK\Config;
use SDK\Cache;
use SDK\Exception;
use SDK\FileOps;
class Manager
{
use FileOps;
protected $stability;
protected $arch;
protected $path;
protected $series;
protected $fetcher;
public function __construct(string $path, string $stability, string $arch)
{/*{{{*/
$this->stability = $stability;
$this->arch = $arch;
$this->path = $path;
$this->cache = new Cache($path);
$host = Config::getDepsHost();
$port = Config::getDepsPort();
$fetcher = new Fetcher($host, $port, $this->arch, $this->stability);
$series = new Series($this->stability, $this->arch, $this->cache, NULL);
$fetcher->setSeries($series);
$series->setFetcher($fetcher);
$this->fetcher = $fetcher;
$this->series = $series;
}/*}}}*/
protected function getTmpSeriesPath()
{/*{{{*/
return Config::getTmpDir() . DIRECTORY_SEPARATOR . $this->series->getname();
}/*}}}*/
public function updatesAvailable() : bool
{/*{{{*/
return $this->series->updatesAvailable();
}/*}}}*/
/* TODO and implement --force. */
/* FIXME implement rollback */
public function performUpdate(string &$msg = NULL)
{/*{{{*/
if (!$this->updatesAvailable()) {
$msg = "No updates are available";
return;
}
$series_data = $this->series->getData();
$tmp_dir = $this->md("", true);
$tmp_dir_packs = $this->md($tmp_dir . DIRECTORY_SEPARATOR . "packs");
$tmp_dir_deps = $this->md($tmp_dir . DIRECTORY_SEPARATOR . "deps");
foreach ($series_data as $item) {
echo "Processing package $item", PHP_EOL;
$pkg = new Package($item, $this->series, $this->fetcher);
$pkg->retrieve($tmp_dir_packs);
$pkg->unpack($tmp_dir_deps);
$pkg->cleanup();
unset($pkg);
}
/* Clear, it is an extra handling. So far it's the only case, doing it this way. And, we have
no package definitions ATM to handle it otherwise. */
$extra = $tmp_dir_deps . DIRECTORY_SEPARATOR . "openssl.cnf";
if (file_exists($extra)) {
$tdir = $tmp_dir_deps . DIRECTORY_SEPARATOR . "template" . DIRECTORY_SEPARATOR . "ssl";
$this->md($tdir);
$this->mv($extra, $tdir . DIRECTORY_SEPARATOR . "openssl.cnf");
}
if (file_exists($this->path)) {
$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'");
}
} else {
$up = dirname($this->path);
if (!file_exists($up)) {
if (!$this->md($up)) {
throw new Exception("Unable to create '{$this->path}'");
}
}
}
$this->mv($tmp_dir_deps, $this->path);
$this->rm($tmp_dir_packs);
$this->rm($tmp_dir);
$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 .= "Old dependencies backed up into '$new_path'.";
}
}/*}}}*/
}
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/

View File

@@ -0,0 +1,71 @@
<?php
namespace SDK\Dependency;
use SDK\Config;
use SDK\Exception;
class Package
{
protected $name;
protected $series;
protected $fetcher;
protected $filepath;
public function __construct(string $name, Series $series, Fetcher $fetcher)
{/*{{{*/
$this->name = $name;
$this->series = $series;
$this->fetcher = $fetcher;
}/*}}}*/
public function getUri() : string
{/*{{{*/
$base = Config::getDepsBaseUri();
$branch_data = Config::getCurrentBranchData();
$arch = $this->series->getArch();
return "$base/{$branch_data['crt']}/$arch/{$this->name}";
}/*}}}*/
public function retrieve(string $path)
{/*{{{*/
$this->filepath = $path . DIRECTORY_SEPARATOR . $this->name;
$cont = $this->fetcher->getByUri($this->getUri());
$fd = fopen($this->filepath, "wb");
fwrite($fd, $cont);
fclose($fd);
}/*}}}*/
public function unpack(string $path)
{/*{{{*/
if (!$this->filepath || !file_exists($this->filepath)) {
throw new Exception("Invalid filepath '{$this->filepath}'");
}
$zip = new \ZipArchive;
$ret = $zip->open($this->filepath);
if (true === $ret) {
$zip->extractTo($path);
$zip->close();
} else {
throw new Exception("Failed to unpack, error code '$ret'");
}
}/*}}}*/
public function cleanup()
{/*{{{*/
unlink($this->filepath);
}/*}}}*/
}
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/

View File

@@ -0,0 +1,112 @@
<?php
namespace SDK\Dependency;
use SDK\Config;
use SDK\Cache;
use SDK\Exception;
class Series
{
protected $fetcher;
protected $stability;
protected $arch;
protected $rawData;
protected $cache;
public function __construct(string $stability, string $arch, Cache $cache, Fetcher $fetcher = NULL)
{/*{{{*/
$this->fetcher = $fetcher;
$this->stability = $stability;
$this->arch = $arch;
$this->cache = $cache;
}/*}}}*/
public function getFetcher() : Fetcher
{/*{{{*/
return $this->fetcher;
}/*}}}*/
public function setFetcher(Fetcher $fetcher)
{/*{{{*/
$this->fetcher = $fetcher;
}/*}}}*/
public function getArch() : string
{/*{{{*/
return $this->arch;
}/*}}}*/
public function setArch(string $arch)
{/*{{{*/
$this->arch = $arch;
}/*}}}*/
public function getName() : string
{/*{{{*/
$base = Config::getDepsBaseUri();
$branch_data = Config::getCurrentBranchData();
$file = "packages-" . Config::getCurrentBranchName() . "-{$branch_data['crt']}-{$this->arch}-{$this->stability}.txt";
return $file;
}/*}}}*/
protected function getUri() : string
{/*{{{*/
$base = Config::getDepsBaseUri();
$file = $this->getName();
return "$base/series/$file";
}/*}}}*/
public function getData(bool $raw = false, bool $cache = true)
{/*{{{*/
if ($cache && $this->rawData) {
$ret = $this->rawData;
} else {
if (!$this->fetcher) {
throw new Exception("Fetcher is not set");
}
$ret = $this->fetcher->getByUri($this->getUri());
}
if (!$raw) {
$ret = explode(" ", preg_replace(",[\r\n ]+,", " ", trim($ret)));
}
return $ret;
}/*}}}*/
public function getSavePath()
{/*{{{*/
return Config::getCacheDir() . DIRECTORY_SEPARATOR . $this->getname();
}/*}}}*/
public function updatesAvailable()
{/*{{{*/
$series_data = $this->getData(true);
$series_file = $this->getSavePath();
return $this->cache->cachedContentDiffers($series_file, $series_data);
}/*}}}*/
public function cache(string $path = NULL)
{/*{{{*/
if (!$path) {
$path = $this->getSavePath();
}
$this->cache->cacheContent($path, $this->getData(true));
}/*}}}*/
}
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/

View File

@@ -0,0 +1,17 @@
<?php
namespace SDK;
class Exception extends \Exception
{
}
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/

View File

@@ -0,0 +1,127 @@
<?php
namespace SDK;
use SDK\Config;
use SDK\Exception;
trait FileOps
{
protected function md(string $name = "", bool $tmp = false) : string
{/*{{{*/
$ret = $name;
if (!$name) {
if ($tmp) {
$pre = Config::getTmpDir();
$ret = $pre . DIRECTORY_SEPARATOR . md5(uniqid());
} else {
throw new Exception("Dir name is empty");
}
}
if (!is_dir($ret)) {
if (!mkdir($ret, 0755, true)) {
throw new Exception("Unable to create '$ret'");
}
}
return $ret;
}/*}}}*/
/* TODO is link and more checks. */
protected function rm(string $path) : bool
{/*{{{*/
if (!file_exists($path)) {
return false;
} else if (is_file($path)) {
return unlink($path);
}
$ret = true;
$iterator = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator(
$path,
\FilesystemIterator::SKIP_DOTS
),
\RecursiveIteratorIterator::CHILD_FIRST
);
foreach ($iterator as $item) {
if ($item->isDir()) {
$ret = $ret && rmdir($item->getPathname());
} else {
$ret = $ret && unlink($item->getPathname());
}
}
return $ret && rmdir($path);
}/*}}}*/
/* TODO islink and more checks */
protected function cp_or_mv(string $src, string $dst, callable $cb) : bool
{/*{{{*/
if (!file_exists($src)) {
return false;
} else if (is_file($src)) {
return call_user_func($cb, $src, $dst);
}
if (!file_exists($dst)) {
$this->md($dst);
}
$iterator = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator(
$src,
\FilesystemIterator::SKIP_DOTS
),
\RecursiveIteratorIterator::CHILD_FIRST
);
$cut_len = strlen($src)+1;
foreach ($iterator as $item) {
$src_path = $item->getPathname();
$sub = substr($src_path, $cut_len);
$dst_path = $dst . DIRECTORY_SEPARATOR . $sub;
$dst_parent = dirname($dst_path);
if (!is_dir($dst_parent)) {
if (!$this->md($dst_parent)) {
throw new Exception("Unable to create '$dst_parent'");
}
}
if ($item->isFile()) {
if (!call_user_func($cb, $src_path, $dst_path)) {
throw new Exception("Unable to $cb '$src_path' to '$dst_path'");
}
}
}
return true;
}/*}}}*/
protected function cp(string $src, string $dst) : bool
{/*{{{*/
return $this->cp_or_mv($src, $dst, "copy");
}/*}}}*/
protected function mv(string $src, string $dst) : bool
{/*{{{*/
$ret = $this->cp_or_mv($src, $dst, "rename");
$ret = $ret && $this->rm($src);
return $ret;
}/*}}}*/
}
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/

View File

@@ -0,0 +1,15 @@
<?php
function __autoload($name)
{
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . $name . ".php";
}
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More