Compare commits

..
339 Commits
Author SHA1 Message Date
SVN Migration 6e53dfe985 This commit was manufactured by cvs2svn to create tag 'php_4_2_2'. 2002-07-21 12:49:34 +00:00
Derick Rethans a435b7baa9 - Merges sascha's fix 2002-07-21 12:49:33 +00:00
Derick Rethans 9d92bd6d8e - Typos 2002-07-20 19:20:20 +00:00
Derick Rethans 29a1772e06 - Merge Sascha's builds tools fix 2002-07-20 19:19:24 +00:00
Derick Rethans e02ef7fe8d - Merge Stefans patch that fixes the remote vulnarability 2002-07-20 19:17:52 +00:00
Derick Rethans 93f485e7e2 - Update NEWS and version numbers 2002-07-20 19:13:33 +00:00
SVN Migration 49e515d9ba This commit was manufactured by cvs2svn to create branch 'PHP_4_2_2'. 2002-05-12 21:23:59 +00:00
Derick Rethans fb1b7c9060 - Fix version 2002-05-12 21:23:57 +00:00
foobar f39b4a8582 short is good 2002-05-12 21:07:40 +00:00
Edin Kadribasic 06ceb7da90 Merged safe_mode fixes into one entry. 2002-05-12 20:54:29 +00:00
Edin Kadribasic 934b4388cb Fixed typo. 2002-05-12 20:36:05 +00:00
Edin Kadribasic 055710e95a MFH 2002-05-12 20:27:37 +00:00
Rasmus Lerdorf 12e6c6d95f MFH 2002-05-12 16:08:31 +00:00
Daniela Mariaschi cd11446263 fix bug #17040
User can't close a connection if there are blobs opened.
He must close them before to not lose data....
2002-05-12 13:01:28 +00:00
Rasmus Lerdorf 844c90a395 Damn, forgot a debug line 2002-05-11 20:02:21 +00:00
Rasmus Lerdorf f9ee6d3d9e Argh! Horrible logic here. The safemode include dir check defaulted
to letting stuff through if no safemode include dir was defined.
@ Another safe-mode fix related to the safemode incdir feature (Rasmus)
2002-05-11 19:56:10 +00:00
Rasmus Lerdorf 2d73699721 MFH - parse_ini_file() safe-mode fix 2002-05-11 19:23:05 +00:00
Rasmus Lerdorf 4caca1d6eb MFH - safe-mode show_source() fix 2002-05-11 18:50:28 +00:00
Zeev Suraski 64595cc959 MFH - avoid choking on 0 byte files 2002-05-11 11:58:52 +00:00
Sebastian Bergmann fb49473192 MFH: Patch by Justin Erenkrantz <jerenkrantz@apache.org>. 2002-05-11 09:49:54 +00:00
Sander Roobol 5c6ec3c7bf Added notes that php.exe and not php-cli.exe should be used. 2002-05-09 09:56:45 +00:00
Jason Greene a86833cc06 Merge overflow fix 2002-05-08 15:33:49 +00:00
Jason Greene dc1ff44e37 MFH BSD fix 2002-05-07 21:34:19 +00:00
Jason Greene ed235cf8b7 MFH 2002-05-06 23:10:54 +00:00
Jason Greene adb0cb5c01 MFH
Fix for ZTS and crash bugs
2002-05-06 20:44:58 +00:00
Derick Rethans 964d412062 - Swap back version number 2002-05-06 18:56:54 +00:00
Derick Rethans 3cb5d4790a - Fix release date 2002-05-06 18:55:55 +00:00
jim winstead a6faca14b7 MFH: fix problem with mkdir() on freebsd 2002-05-06 17:32:05 +00:00
Aaron Bannert 4bbf5a04ed Merge two SEGV fixes from the trunk:
- startup SEGV caused by delaying the initialization too long.
- graceful restart SEGV caused by not re-initializing.
2002-05-06 15:42:23 +00:00
Derick Rethans 99a15a90c7 - Fix release day 2002-05-06 15:22:24 +00:00
Derick Rethans b7e1d6a196 - GO with rc2 2002-05-06 15:19:36 +00:00
foobar 7d884d8e7b MFH 2002-05-05 17:12:27 +00:00
Rui Hirokawa 106d6a77ce fixed problem that ereg_replace() couldn't match with line stand/end marker. 2002-05-05 08:39:57 +00:00
foobar d10a337f00 MFH 2002-05-03 21:31:19 +00:00
Christian Stocker 43b21ea95f full MFH as discussed with derick
#  could someone copy the NEWS entries for domxml from HEAD to PHP_4_2_0
2002-05-03 15:16:15 +00:00
Sander Roobol 42bb3ed035 MFH 2002-05-02 17:20:41 +00:00
Derick Rethans e88d05b9a5 - MFH 2002-05-02 14:20:38 +00:00
Harald Radi 5771743122 MFH 2002-05-02 13:41:30 +00:00
Sascha Schumann dbe6bdca91 Readd warning 2002-05-02 13:23:20 +00:00
foobar ed101fb57d MFH: Do not use the old expat libs. 2002-05-02 10:24:11 +00:00
foobar d689414621 Added the usual search paths where to look for expat. 2002-05-02 10:21:52 +00:00
foobar 05729165c3 MFH 2002-05-02 08:32:45 +00:00
Derick Rethans 192c93ce8e - MFH 2002-05-01 20:12:51 +00:00
Sascha Schumann 1fbcdd2102 MFH 2002-05-01 13:34:53 +00:00
Derick Rethans 474aa9fbdf - Update version number 2002-05-01 12:40:28 +00:00
Derick Rethans 37fb4ddb51 - Go with 4.2.1rc1 2002-05-01 12:11:18 +00:00
Wez Furlong 242cb5ca83 Fix for #16885 2002-05-01 08:23:02 +00:00
Wez Furlong f9f1414172 No asserts in branch 2002-05-01 08:01:36 +00:00
Wez Furlong 4f005f63d5 MFH fix for #16940, compiler warnings and TSRMLS build fixes. 2002-05-01 07:53:53 +00:00
Markus Fischer 53584a7dfd - Mention the socket_select() API change 2002-05-01 07:25:23 +00:00
Markus Fischer 1784f408bc - MFH fix for socket_select() and some minor memory leak; NEWS entry follows. 2002-05-01 07:21:50 +00:00
Harald Radi 811b353f22 MFH 2002-04-30 14:37:39 +00:00
Sascha Schumann a94cc66d1c Touch file 2002-04-30 13:48:06 +00:00
Dan Kalowsky c5f264a8e0 re-setting the CURSOR back to DYNAMIC rather than FORWARD_ONLY. This change
broke many other ODBC drivers (obviously testing wasn't extensive).
# oops, well time to make the proper fix
2002-04-30 13:16:01 +00:00
foobar e78a9cc5d7 MFH: Add the shared extension check. 2002-04-29 22:33:56 +00:00
Harald Radi eb9ce1f481 MFH 2002-04-29 17:57:17 +00:00
Stanislav Malyshev c0c2b6916e MFH 2002-04-29 16:03:57 +00:00
Harald Radi 57edb51964 MFH 2002-04-29 15:54:02 +00:00
Stanislav Malyshev 3d1401d458 MFH serializer fix 2002-04-29 15:45:58 +00:00
Yasuo Ohgaki bd7cb92852 Added touch fix 2002-04-29 09:55:39 +00:00
Yasuo Ohgaki 18e00ac0a3 MFH touch bag fix 2002-04-29 09:43:48 +00:00
Yasuo Ohgaki 1bc1289953 Added NEWS entry for PostgreSQL function rename.
Removed duplicate entry.
2002-04-29 09:20:37 +00:00
foobar 6adaa2c394 Fixed bug: #16858 2002-04-28 23:55:06 +00:00
Sascha Schumann ac1f6d72cd touch file 2002-04-28 21:26:41 +00:00
Stanislav Malyshev fe130827b6 MFH: serializer/unserializer fix 2002-04-28 17:02:11 +00:00
foobar c43d9ad351 Fix bug: #16823 2002-04-28 01:40:05 +00:00
Harald Radi 568e301e46 MFH 2002-04-27 10:28:52 +00:00
foobar a47cc80ad9 MFH: fix for bug #16743 2002-04-27 01:09:56 +00:00
foobar 3f12d0f2e7 MFH: fix bug: #16791 (more reliable version check) 2002-04-26 03:13:00 +00:00
Edin Kadribasic aa431db411 MFH 2002-04-25 21:08:47 +00:00
Edin Kadribasic f36bc79e87 Fix the fix. 2002-04-25 17:18:31 +00:00
Edin Kadribasic e763001682 Fix win32 build 2002-04-25 17:03:17 +00:00
Rui Hirokawa 53da694542 fixed directory access problem when direcory name is encoded in japanese Shift_JIS encoding. 2002-04-25 14:52:58 +00:00
foobar 3af0eb20a0 MFH: fix for bug #16811 2002-04-25 14:02:51 +00:00
Derick Rethans 5c46b61769 - MFH: fix for bug #14353 2002-04-25 06:37:58 +00:00
foobar 0752ba8bc9 MFH 2002-04-24 18:01:10 +00:00
Stanislav Malyshev c5790584df MFH 2002-04-24 16:58:59 +00:00
Andrei Zmievski bc015f22c9 *** empty log message *** 2002-04-24 15:31:41 +00:00
foobar f02b9373c0 MFH 2002-04-24 15:30:16 +00:00
Andrei Zmievski c2ed94ed04 MFH. 2002-04-24 15:29:38 +00:00
Yasuo Ohgaki 86d9796c17 Fixed typo. Compiler compiled with this typo somehow.
# This is not in HEAD since I did this typo when marging :(
2002-04-24 09:46:23 +00:00
Derick Rethans 21c10baabc - Layout and release date 2002-04-24 06:38:35 +00:00
Yasuo Ohgaki 00f74e44b3 Added NEWS for recent multibyte related fixes. 2002-04-24 06:34:50 +00:00
foobar 43ae28411d Forgot this one.. 2002-04-24 02:06:08 +00:00
foobar a69c752d39 Added entry for the SID fix. 2002-04-24 02:04:01 +00:00
foobar 72cee8e34f This was not supposed to be committed.. 2002-04-24 01:53:54 +00:00
foobar 62a7f935b8 MFH 2002-04-24 01:51:50 +00:00
foobar be955c576f Make sure the extension will be named java.so 2002-04-23 23:47:06 +00:00
foobar 691a5a5314 MFH 2002-04-23 23:30:33 +00:00
foobar 30291f81e3 MFH 2002-04-23 23:18:06 +00:00
Markus Fischer 72c4458108 - MFH fix for #16766. 2002-04-23 21:25:50 +00:00
Derick Rethans 71f5acedf9 Fix TSRMLS_CC 2002-04-23 18:59:59 +00:00
Sascha Schumann 86cb47ea9c MFH: Rip out use of O_EXCL 2002-04-23 18:10:49 +00:00
Sascha Schumann 544a3a93a9 MFH define_sid issue 2002-04-23 18:10:06 +00:00
Rui Hirokawa d126bace5f fixed access problem when japanese Shift_JIS character is used as directory name. Some characters in Shift_JIS are including 0x5c (slash) as second byte. 2002-04-23 14:55:10 +00:00
Yasuo Ohgaki f5e96952d8 MFH
Fix empty output when no conversion is done.
Fix possible problem with wide chars.
2002-04-23 12:50:10 +00:00
foobar eb1ef0b37b MFH the possible crash bug fix and warning -> notice change. 2002-04-23 03:08:49 +00:00
Derick Rethans 56b6d7b555 - Fix date 2002-04-22 10:20:23 +00:00
Yasuo Ohgaki dd9ab596d2 Removed for consistency with current build system. 2002-04-20 15:21:18 +00:00
Wez Furlong 83f57e0381 The PECL version probably will not compile with PHP 4.2 unless they
check it out on the branch.
I have a tarball ready-to-go from my site, so add a not about it.
2002-04-20 14:29:06 +00:00
Derick Rethans 3fe419e7a2 - Fix mailparse dir for release 2002-04-20 12:26:32 +00:00
Derick Rethans f334499cec - Update version numbers 2002-04-20 12:14:01 +00:00
Derick Rethans ed253b36ee Go with 4.2.0 2002-04-20 11:14:06 +00:00
Derick Rethans bb41e69096 MFH: Missing .cvsignore file 2002-04-20 11:12:12 +00:00
Adam Dickmeiss f193a2ca40 fix warning 2002-04-19 20:39:27 +00:00
Derick Rethans a67ba9a314 - MFH for bug in Sambar 5.2 2002-04-18 22:52:20 +00:00
Aaron Bannert 34b94f143e Fix an intermittent SEGV when an error bubbled up from PHP before our
server context was set. Now if that happens we simply don't log against
any particular server config (vhost).

Obtained from bug report by:  Balazs Nagy <js@iksz.hu>
2002-04-18 16:34:49 +00:00
Aaron Bannert 23390048f0 It makes more sense to do the null-pointer check *before* trying to use it.
(Also fix a typo that Cliff pointed out: "safe" --> "save".)

Obtained from:  Ryan Morgan <rmorgan@covalent.net>
2002-04-18 16:25:50 +00:00
Stig Bakken 4d518b1a2e * another file that should not have been MFH'ed 2002-04-18 13:08:07 +00:00
Derick Rethans 41806af161 - Make DBA compile as a shared module 2002-04-18 12:31:19 +00:00
Hartmut Holzgraefe b71a29c587 MFH fix for #16473 2002-04-18 10:31:11 +00:00
Harald Radi fb9c8f841f MFH 2002-04-18 10:15:33 +00:00
Stig Bakken 1d03836951 * revert buildv5 changes 2002-04-17 13:35:59 +00:00
Sander Roobol bec22b1ce4 MFH (#16628) 2002-04-16 14:20:57 +00:00
Derick Rethans dd1cedd5ca - Remove version number here 2002-04-16 10:13:00 +00:00
Sterling Hughes 9c999b3d71 this news entry reports a new mailparse addition
a later news entry reports that mailparse has been moved to pecl
1+1 = 2
2002-04-14 23:26:29 +00:00
Thies C. Arntzen 1bb515dc2c fix crash bug introduced by last commit (damncvs diff!) 2002-04-14 18:28:32 +00:00
Derick Rethans d89eed693b - Swap back version numbers after tagging 2002-04-14 15:53:15 +00:00
Derick Rethans fa002563bc - Go with RC4 2002-04-14 15:43:47 +00:00
foobar b605fd9ec6 Make the configure fail if someone tries to use --with-apache with Apache2 2002-04-14 15:00:40 +00:00
Derick Rethans 3d77a3087c - MFH: Fix NULL-termination issue 2002-04-14 08:50:22 +00:00
Rui Hirokawa d7f9043378 fixed error output handler when 'pass' is choosed as output encoding. 2002-04-14 08:12:36 +00:00
foobar e4c4689c3e This is experimental still 2002-04-14 03:52:16 +00:00
foobar 783a4a7d74 Make this work as it was supposed to work. 2002-04-14 03:50:40 +00:00
foobar 2a6153f007 MFH (use of correct javac/jar binaries) 2002-04-14 00:40:59 +00:00
Thies C. Arntzen 9f3f7701f8 MFH: ocibind: avoid warning in debug mode 2002-04-13 18:59:38 +00:00
Thies C. Arntzen e70afa0c54 MFH: Mixing OCIPlogon and OCINLogon no longer leak Oracle-Sessions. (thies)
to RM: this is a real fix that _should_ be in 4.2!
2002-04-13 12:14:02 +00:00
foobar c213d9392c - Makefile.frag is not supposed to be here..
- Net/Socket.php doesn't exist anymore
2002-04-13 04:32:22 +00:00
foobar 5985d044b1 MFH: For example the compile in AIX does not like these at all.. 2002-04-13 00:34:42 +00:00
foobar 9905ed2b05 MFH.
(Prevent users from trying to build Apache 1.x module with Apache 2.x and
vice-versa)
2002-04-13 00:18:54 +00:00
foobar 0b81ec337c MFH (forgot to commit this..sorry Derick..) 2002-04-13 00:17:37 +00:00
Aaron Bannert e0fb69cfc4 Fix a typo and a build error detected by the lovely HPUX11 ANSI C compiler. 2002-04-12 22:26:28 +00:00
Derick Rethans 58b07a4f2c - Swap back development version numbers 2002-04-12 19:29:27 +00:00
Derick Rethans 0ed61df9d5 - Go with RC3 2002-04-12 19:14:18 +00:00
Jan Lehnardt de9cf6516f - fix testcase
- patch by: Roman Neuhauser <neuhauser@mail.cz>
2002-04-12 16:53:34 +00:00
Sander Roobol 24440f1df2 MFH 2002-04-12 15:27:00 +00:00
Rui Hirokawa fd4fb6bddc fixed a bug which causes crash when charset is not set. 2002-04-12 15:07:48 +00:00
Sebastian Bergmann 3bfd4173a2 MFH (Reduce warning level for re2c generated files. 2002-04-12 05:34:45 +00:00
Harald Radi 8dc6530c67 fixed type 2002-04-11 20:35:49 +00:00
Aaron Bannert a032a7e82a Fix a problem where php-generated data was pushed down the entire output
filter chain instead of just down the rest of the chain. This fix will
speed up some unnecessary overhead introduced in the last patch.

Suggested by:  Cliff Woolley <jwoolley@apache.org>
2002-04-11 20:34:31 +00:00
Aaron Bannert f44cd6f30e PHP filters and Apache 2 aren't quite a perfect match yet, so we have
to do some trickery with the server_context to make sure it is always
valid within the current thread.

This patch makes sure the server_context is created in apache's
post_read_request hook phase, and then registeres a cleanup that
will NULL out the server context when the request goes out of scope.
Then, inside the output filters, if the server_context is null we
throw an error. Finally, instead of saving the output filter in
the server_context, now we store the entire request_rec pointer
in there.

POST bodies appear to be working now, although they are very inefficient.
The input filter is still just realloc()ing for whatever data comes
down the input pipe, and then sending this to PHP. This means that
we are doing some really nasty memory management on big POST bodies.
For now this it allows for unlimited input bodies, which means that
a big POST could potentially DoS a box by making it run out of memory.
We might want to put a limit on here just in case, at least until
we figure out how to consume input data more efficiently into php.
2002-04-11 19:27:27 +00:00
Sebastian Bergmann 3dcb8f933f Disable ext/overload. 2002-04-11 18:15:58 +00:00
Aaron Bannert 5d2bb8b8d5 Don't depend on the context provided by the filter (f->ctx) anymore. In
Apache 2 the input and output filter contexts are kept unique. We now
only depend on SG(server_context) for each request, and assume that
the same thread will process the entire request. At some point it
would be wise to separate the input and output contexts.
2002-04-11 17:32:37 +00:00
Aaron Bannert 2721e6afa7 Return the number of bytes consumed, not the number of bytes left.
Suggested by:  Brian Havard <brianh@kheldar.apana.org.au>
2002-04-11 17:18:48 +00:00
Sebastian Bergmann 77b892c26e MFH (Update README). 2002-04-11 17:02:32 +00:00
Derick Rethans b89c43519a - Mark Apache2, overload and aggregation as experimental 2002-04-11 12:53:24 +00:00
Stig Bakken 54175c5fe6 * no more pear/scripts/pear-get 2002-04-11 10:03:02 +00:00
Sebastian Bergmann 3df45d6dd8 MFH (Patch by Aaron Bannert <aaron@clove.org> and Cliff Woolley <jwoolley@virginia.edu>). 2002-04-11 06:04:21 +00:00
foobar 453d7c8e4d Note about Apache2 support being experimental. 2002-04-10 09:45:01 +00:00
foobar c959af2365 MFH 2002-04-10 09:43:07 +00:00
Stig Bakken 827b7998f9 * add missing continuation 2002-04-10 07:59:31 +00:00
Stig Bakken 819a2fc1fd * tabify instead of untabify :-P 2002-04-10 07:58:17 +00:00
Stig Bakken 605682b3c8 * remove pear-get if installed 2002-04-10 07:44:28 +00:00
Stig Bakken 44a43188a6 * keep installing the bundled files in 4.2 too 2002-04-10 07:12:06 +00:00
Derick Rethans 452e8a0660 - Reverse patch 2002-04-10 06:37:49 +00:00
Derick Rethans b5e60437a0 MFH 2002-04-10 06:22:42 +00:00
jim winstead be71676a11 MFH 2002-04-09 20:19:04 +00:00
Stig Bakken 2ea4681ff1 * MFH Makefile 2002-04-09 19:07:52 +00:00
Stig Bakken 76cde0e16e * PEAR MFH
# using rsync this time, does it work?
2002-04-09 19:04:25 +00:00
SVN Migration 8a06e8c6c7 This commit was manufactured by cvs2svn to create branch 'PHP_4_2_0'. 2002-04-09 18:50:55 +00:00
Stig Bakken 09d7728c0a * partial PEAR MFH 2002-04-09 18:04:33 +00:00
SVN Migration 618fe005e6 This commit was manufactured by cvs2svn to create branch 'PHP_4_2_0'. 2002-04-09 17:15:18 +00:00
Stig Bakken 205b621002 * MFH: install the right expat header files 2002-04-09 16:08:18 +00:00
Sterling Hughes b866eac68f fix compile warnings 2002-04-09 06:13:01 +00:00
foobar 9c65107094 MFH 2002-04-08 22:21:30 +00:00
Sebastian Bergmann d3b47d4b2c MFH (MS VS.Net Fix). 2002-04-08 15:40:22 +00:00
Wez Furlong f1d78e3ef5 remove streams option from branch 2002-04-08 12:42:01 +00:00
Edin Kadribasic b1cf064c35 Finished syncing win32 build and docs with the unix counterpart.
Renamed the cli executable to php-cli.exe so somebody doesn't overwrite
cgi by mistake.
# To the packager: php4ts_cli.dsp (php-cli.exe) shouldn't be bundled
# with the binary distribution of PHP 4.2.0.
2002-04-08 08:24:23 +00:00
Sebastian Bergmann 590f13da18 Rename Win32 executable to php.exe. 2002-04-08 07:37:43 +00:00
Derick Rethans a30a24dc0b - MFH 2002-04-08 06:36:39 +00:00
foobar d1ded86a63 MFH 2002-04-08 01:15:16 +00:00
Marcus Boerger 205c2235fa -found userland solution to fix UNICODE comments (see tests/003.phpt)
#solution from HEAD would mean new functionality
#so this fix makes it work without adding new functionality
2002-04-07 19:45:36 +00:00
SVN Migration 0e1a181b47 This commit was manufactured by cvs2svn to create branch 'PHP_4_2_0'. 2002-04-07 19:42:06 +00:00
Derick Rethans 5a673f727c - MFH zip_entry_read_bug 2002-04-06 17:29:44 +00:00
Wez Furlong 32562cac4e Inform the masses about where to get a 4.2 compatible mailparse package 2002-04-06 16:58:49 +00:00
Sebastian Bergmann 79100113a7 MFH (.dsp fixes) 2002-04-06 16:12:52 +00:00
Sterling Hughes 1491b7a07d MFH changes per doug's request 2002-04-05 21:23:30 +00:00
Joseph Tate 28b6e435bf MFH added unlink_node alias 2002-04-05 19:13:58 +00:00
foobar 3eec585f05 MFH the fixed entries 2002-04-05 12:00:18 +00:00
Wez Furlong ea0d37a507 let people know about mailparse being pickled 2002-04-05 09:07:48 +00:00
Wez Furlong 4f2d14d7da MFH: add mbstring headers to those for pear/pecl extensions 2002-04-05 09:04:38 +00:00
Yasuo Ohgaki 14a77654c1 Forgot mention fixed bug that is reported by user. 2002-04-05 07:14:35 +00:00
Yasuo Ohgaki 254485dbea MFH.
Fixed pg_last_notice() double free.
2002-04-05 06:45:25 +00:00
Marcus Boerger bd30c3c17c removed calls to wctomb, wcstombs
#leave UNICODE to user
2002-04-04 20:42:47 +00:00
Sterling Hughes e4f620f894 mfh 2002-04-04 20:27:24 +00:00
Daniela Mariaschi f096c0ca6f Fixed sigfault in ibase_close (bug #15419-#15992) 2002-04-04 20:13:41 +00:00
jim winstead fad7db9695 MFH. mailparse moved to pear/PECL. 2002-04-04 18:44:33 +00:00
Yasuo Ohgaki aa6046f941 MFH
# Fixed crash with pg_escape_*()
# Added test for pg_escape_*()
2002-04-04 15:29:34 +00:00
SVN Migration 401f3711f6 This commit was manufactured by cvs2svn to create branch 'PHP_4_2_0'. 2002-04-04 15:25:47 +00:00
foobar e672133aa8 MFH 2002-04-04 14:33:35 +00:00
foobar c1a5d08fe1 missing .cvsignore 2002-04-04 13:37:57 +00:00
Sterling Hughes 20c3de56d5 MFH 2002-04-04 00:04:25 +00:00
foobar f8113293d3 Fix the test..somehow got corrupted? 2002-04-03 23:05:39 +00:00
foobar f4166f11e9 Partial MFH 2002-04-03 23:04:53 +00:00
foobar 7f4ff662fe - Added the autom4te.cache to be cleaned too with cvsclean 2002-04-03 19:58:45 +00:00
Derick Rethans 37461bd51f - Swap back version numbers for development 2002-04-03 19:53:54 +00:00
Derick Rethans 653273f34f - Fix build (Patch by Marcus Boerger) 2002-04-03 19:51:26 +00:00
Derick Rethans 361b97226e - Fix version number 2002-04-03 19:47:13 +00:00
Kirill Maximov 96a9a83f15 #Fix for the quot_print - remove unneeded char. 2002-04-02 08:54:23 +00:00
foobar c622d74952 MFH 2002-04-01 23:29:19 +00:00
Kirill Maximov 496133babd (PHP quoted_printable_decode) Fixed CR/LF processing for Windows/OS2
@ Fixed CR/LF processing for Windows/OS2 in quoted_printable_decode (kir)
2002-04-01 19:27:16 +00:00
Marcus Boerger 2c7866cf8b MFH finding test files 2002-04-01 13:27:47 +00:00
Yasuo Ohgaki e00cf495f7 MFH.
Forgot to commit this when I commit fix build with PostgreSQL 6.5.x
2002-04-01 11:44:52 +00:00
Derick Rethans c10647f7f0 - MFH for fix for bug #14966 2002-04-01 09:21:29 +00:00
Rui Hirokawa cac350dc27 moved static constant definitions for separeted files to fix compilation problem in Tru64. 2002-03-31 05:16:27 +00:00
Rui Hirokawa 83fa61ef7b revert Sascha's patch to fix compile error in Tru64. 2002-03-31 00:29:51 +00:00
Rui Hirokawa 8fbfb292d0 fixed crash bug in Tru64. 2002-03-31 00:19:17 +00:00
Yasuo Ohgaki 3e13ac26e9 MFH. 6.5.3 libpq build fix. 2002-03-30 23:23:58 +00:00
Marcus Boerger 8aa98687fa - corrected test-image 2002-03-30 19:11:44 +00:00
Marcus Boerger 131f5cfce2 MFH - corrected test-image 2002-03-30 18:32:09 +00:00
Marcus Boerger 3f9001850e -memory leaks 2002-03-30 18:31:08 +00:00
foobar 4462ee40ec another missing .cvsignore 2002-03-30 03:23:42 +00:00
foobar eb13b12855 missing .cvsignore 2002-03-30 03:14:40 +00:00
foobar 1206b0c1e7 missing entry (still needed here..) 2002-03-30 03:14:19 +00:00
foobar 9e14a25a81 MFH 2002-03-30 03:07:47 +00:00
Markus Fischer ce1bd6d110 - MFH fix for #16348. 2002-03-30 01:58:24 +00:00
foobar 8c5a1a03db - MFH fixes for these tests. 2002-03-29 15:15:16 +00:00
Derick Rethans 0d10b7dead - Backout Makefile patch, it caused problems 2002-03-28 10:58:39 +00:00
Derick Rethans 231b8e147f - Fix build for BSD: BSD_MAKEFILE and resolver functions. (Patch by Melvyn
Sopacua <msopacua@idg.nl>)
2002-03-28 07:56:35 +00:00
Derick Rethans 000eaf4a5a - MFH for bug 16314 2002-03-28 07:48:50 +00:00
Derick Rethans 20d1c8d5d0 - Fix build on BSDI 2002-03-28 07:35:09 +00:00
foobar ec92b77e22 MFH: fixed bug: #16237 2002-03-27 23:47:42 +00:00
Derick Rethans 408a8dfead - MFH for multiple To: lines 2002-03-27 20:39:27 +00:00
Yasuo Ohgaki 9080907ed7 MFH error message consistency changes 2002-03-27 00:14:30 +00:00
Sander Roobol 3757566d4f MFH 2002-03-26 18:18:18 +00:00
SVN Migration 8b4e565285 This commit was manufactured by cvs2svn to create branch 'PHP_4_2_0'. 2002-03-26 18:17:39 +00:00
Derick Rethans 6277583f69 - MFH for bug #11244 2002-03-26 08:57:18 +00:00
Derick Rethans beb3b6b44a - No asserts in the branch 2002-03-26 08:47:41 +00:00
Derick Rethans 8b416f0334 - Fix comments 2002-03-26 08:28:31 +00:00
Derick Rethans 9d277028e5 - MFH for passphrase bug 2002-03-26 07:40:00 +00:00
foobar 2b411094db MFH the use of correct header file -fix 2002-03-26 00:16:01 +00:00
foobar a618edb5dd MFH fixes for the iconv stuff 2002-03-26 00:15:34 +00:00
SVN Migration 5064f0781f This commit was manufactured by cvs2svn to create branch 'PHP_4_2_0'. 2002-03-26 00:03:12 +00:00
foobar 7ed66b20e5 MFH dl() error message fix 2002-03-25 23:22:05 +00:00
Edin Kadribasic 910cb1be81 Hidden the existance of CLI SAPI by:
- removing the NEWS entry
- removing cli from make install chain
- marking it EXPERIMENTAL
- reverting installed name of cgi from php-cgi to php

Marged max_execution_time override from head.
# I really hope that people who found cli to be "inconsistent" and
# "unstable" will find time to help rectify those problems.
2002-03-25 17:02:30 +00:00
Jan Lehnardt 9a78224278 - MFH 2002-03-24 23:17:06 +00:00
SVN Migration 718a1eb400 This commit was manufactured by cvs2svn to create branch 'PHP_4_2_0'. 2002-03-24 23:16:43 +00:00
Alex Waugh c325305a7c MFH 2002-03-24 22:58:08 +00:00
Jan Lehnardt 3c612c6432 - finally MFH. sorry for the inconveniance, especially Derick ;) 2002-03-24 16:43:58 +00:00
SVN Migration abd6206fee This commit was manufactured by cvs2svn to create branch 'PHP_4_2_0'. 2002-03-24 16:22:51 +00:00
Derick Rethans 016b308031 - MFH for bug #16232 (Patch by Alan Knowles <alan@akbkhome.com>) 2002-03-24 10:42:07 +00:00
Jan Lehnardt de30eedb5e - MFH 2002-03-23 23:26:27 +00:00
jim winstead fe8b66a4fe MFH 2002-03-23 18:40:59 +00:00
jim winstead 5819639209 MFH. 2002-03-23 18:38:25 +00:00
Marcus Boerger 5ba7dbb89f -no german in NEWS 2002-03-23 17:36:53 +00:00
Edin Kadribasic edd5bf9267 MFH (crypt on win32) 2002-03-23 14:51:30 +00:00
Rui Hirokawa e3f5063ec2 fixed some compilation warning. 2002-03-23 01:12:54 +00:00
Rui Hirokawa 3e348ed92f fixed POST/GET argument handling. 2002-03-23 01:12:29 +00:00
Derick Rethans 8a0805cd3a - Oops... I didn't mean to commit this 2002-03-22 14:28:46 +00:00
Derick Rethans 8a7354d1fd MFH 2002-03-22 14:26:09 +00:00
foobar 9d5d693cf6 MFH 2002-03-22 12:48:28 +00:00
Derick Rethans c808eacefb MFH for bug 14664 2002-03-22 12:15:34 +00:00
Derick Rethans 454666e36c MFH: Fix phpinfo() output 2002-03-22 09:19:53 +00:00
foobar a0ab5d239e MFH fix for bug #16182 2002-03-22 01:12:52 +00:00
Rasmus Lerdorf 5b2f73c7ac Fix for bug #15667 2002-03-21 21:53:26 +00:00
Derick Rethans 324eb12388 - Fix PGSql Compile 2002-03-21 21:49:11 +00:00
foobar ca6c23c5db - MFH iconv fixes. 2002-03-21 20:25:25 +00:00
foobar e5876039bb This file is generated, not supposed to be here. 2002-03-21 20:24:30 +00:00
SVN Migration d8a09a7c5b This commit was manufactured by cvs2svn to create branch 'PHP_4_2_0'. 2002-03-21 20:10:25 +00:00
Daniela Mariaschi 4edfec2b6c fixed numeric number incorrectly rendered 2002-03-21 16:53:06 +00:00
Ludovico Magnocavallo 4756d3234b synched with HEAD, tests 1-2-3-6 pass, 5 fails but ok, 4 needs work 2002-03-21 14:51:45 +00:00
Sander Roobol 29b19d979f MFH: more tests for pow() and count() 2002-03-21 14:23:24 +00:00
Sebastian Bergmann 529a68d134 MFH: ext/overload is a 'built-in' extension on Win32. 2002-03-21 06:26:49 +00:00
Boian Bonev 8251af93d9 MFH vpopmail 5.2 version compatibility fix 2002-03-20 20:09:58 +00:00
Boian Bonev 730634bbb4 ws fix 2002-03-20 19:44:29 +00:00
foobar b8ef38a0e2 MFH 2002-03-20 19:00:35 +00:00
Derick Rethans 58c70caf41 MFH makedist 2002-03-20 18:54:47 +00:00
Stefan Esser 85ca6a5fb7 MFH: filepro fixes 2002-03-20 18:21:19 +00:00
Derick Rethans f07d389ef2 - MFH iconv fix
- Configure Fix for vpopmail
2002-03-20 18:16:06 +00:00
Stefan Esser c3a9018ac4 MFH of bufferoverflow fix 2002-03-20 16:08:04 +00:00
Stefan Esser 72ff5105ef MFH of safe_mode.c text fix 2002-03-20 09:02:54 +00:00
Derick Rethans 1fd19dc38d MFH Sascha's fix 2002-03-20 08:56:15 +00:00
Markus Fischer 911042faeb - MFH fix for #16176. 2002-03-20 08:40:33 +00:00
Markus Fischer 9ecbb3cfd1 - MFH fix for #16120 (this also MFHs the proto fix by Sebastion which
I hope is ok).
2002-03-20 07:53:27 +00:00
foobar fc7bb77cd5 - Fixed bug: #14147 (partial MFH, the uncompress issue) 2002-03-20 01:58:34 +00:00
foobar 5336747ece MFH 2002-03-20 00:40:53 +00:00
foobar 7662c57e57 - MFH iconv fix 2002-03-19 22:40:29 +00:00
Stig Bakken 474f6007e2 MFH: Jani's fix to my iconv fix 2002-03-19 01:08:18 +00:00
Vlad Krupin ea25cdd7b7 MFH (rev. 1.49) 2002-03-18 23:16:57 +00:00
Derick Rethans 4d65bfe327 MFH socket fix 2002-03-18 22:12:57 +00:00
Derick Rethans e2ecf549e1 - MFH for bugfix for bug #10001 2002-03-18 21:40:55 +00:00
Edin Kadribasic 8daa261b97 MFH 2002-03-18 15:13:47 +00:00
Derick Rethans 5065f8bcb8 - MFH: backing out requirement on C++ compiler 2002-03-18 14:52:41 +00:00
jim winstead 6fa911f091 MFH 2002-03-18 02:05:06 +00:00
Stefan Esser 6ac350d1b8 move_uploaded_files checks open_basedir now 2002-03-17 20:54:57 +00:00
Marcus Boerger c998e8137e -fix bug with not correctly terminated comments 2002-03-16 20:02:12 +00:00
Rui Hirokawa c104474c3c fixed errors of mbstring in regression tests. 2002-03-16 07:13:14 +00:00
foobar 0555ad1f5d MFH 2002-03-15 21:46:18 +00:00
Harald Radi 2671926476 MFH 2002-03-15 21:03:20 +00:00
Harald Radi 30d72b04b5 MFH 2002-03-15 20:54:35 +00:00
foobar 663b247700 MFH 2002-03-15 20:22:32 +00:00
Stig Bakken f2135637e9 * MFH: "new and improved" iconv test 2002-03-15 14:16:52 +00:00
Stig Bakken 4f8ae68563 * MFH: yet another iconv fix 2002-03-15 14:15:04 +00:00
Marcus Boerger 5933b60dc0 #according to my ideas/patches 2002-03-15 11:24:55 +00:00
Rasmus Lerdorf 05e13601c9 MFH of safe_mode.c typo 2002-03-14 19:17:23 +00:00
Zeev Suraski af5e1c0364 MFH 2002-03-14 18:39:37 +00:00
Sebastian Bergmann 0b1db2afae MFH (Apache2Filter update). 2002-03-14 10:57:00 +00:00
Stefan Roehrich 30c35d4330 Added NEWS entry for gzencode() change. 2002-03-14 08:55:54 +00:00
foobar 61aa311e62 MFH fix for the include_path issue 2002-03-14 01:46:42 +00:00
Stefan Roehrich 8a010b513e Fix for #15930 in release branch.
@- The second parameter of gzencode() now is the compression level
@  like in the documentation. The encoding mode is a third (optional)
@  parameter. (Stefan)
2002-03-13 20:49:45 +00:00
Stefan Roehrich 29b1a4e97d Fix for #14939 in release branch. 2002-03-13 20:39:26 +00:00
Marcus Boerger e57cb388e2 -release merge
#discussed with derick
2002-03-13 19:49:35 +00:00
Jason Greene fa742989b5 Regenerate Credits for Release 2002-03-13 18:54:18 +00:00
Jason Greene 72f7116854 Merge credits fixes 2002-03-13 18:53:12 +00:00
Jason Greene 8c5aad339d Update credits in release branch 2002-03-13 14:41:15 +00:00
Jason Greene 6cd5cc0fa0 Update Credits in release branch 2002-03-13 14:22:51 +00:00
Stig Bakken 33f08d0231 * MFH: another libconv->libiconv typo 2002-03-13 09:59:54 +00:00
Christian Stocker 20120ecff3 Return attribute name in node_name(), if it's a XML_ATTRIBUTE_NODE 2002-03-13 08:15:54 +00:00
Christian Stocker 53b34e0e34 Return #document in node_name(), if it's a XML_DOCUMENT_NODE 2002-03-13 07:38:14 +00:00
Marcus Boerger 4ac3fdc8d9 -remove filetime from test
# that's magic - now the test should work on all installations
2002-03-13 00:27:19 +00:00
Stig Bakken 9363eaae3d * MFH: fix compile problem on platforms without iconv in libc 2002-03-12 15:16:44 +00:00
Marcus Boerger 1c1401787a -merged a wrong line
#this comes later, i left the documentation onthat)
-one compiling issue
#maybe some comilers get angry on the old form
2002-03-12 05:57:28 +00:00
foobar 902167c255 MFH 2002-03-12 02:27:47 +00:00
Derick Rethans 12cb33af5d - MFH for bug #16008 2002-03-11 23:11:37 +00:00
Marcus Boerger a810e44570 -Change status of ext/exif 2002-03-11 19:06:46 +00:00
Marcus Boerger 8ec3b47402 -fixes: memory handling & corrupted files
#don't worry i spend the whole day merging code
#and differenciating what was new functionality and what are
#necessary fixes.
2002-03-11 19:04:29 +00:00
Sascha Schumann f893cc65e1 MFH: refining supported thttpd version 2002-03-11 12:28:58 +00:00
Markus Fischer 98e8dede11 - MFH fix for #15799. 2002-03-10 23:00:35 +00:00
Rui Hirokawa c87a849a3e fixed module name iconv->mbstring. 2002-03-10 12:22:27 +00:00
Stefan Esser 3d343076ee Fix: Now returns correct Content-Type for Opera 6.01 2002-03-10 11:04:20 +00:00
foobar 86733d3b4f - Fixed bug #15748 (fixed otherwise in 4.3.0-dev) 2002-03-09 23:37:49 +00:00
foobar 1b7d024e5c MFH fix for bug #15686 and some exslt fix. 2002-03-09 21:38:35 +00:00
foobar cfafb32049 MFH fix for #15190 2002-03-09 18:17:37 +00:00
Jason Greene c68550c45d MFH: Recent Bug Fixes 2002-03-09 07:20:35 +00:00
foobar 74d82d0cb7 MFH 2002-03-09 00:26:40 +00:00
foobar 4e98e2d832 MFH the MacosX compile fix. 2002-03-09 00:26:09 +00:00
Joseph Tate 0d03789fb9 - Fixed a coredump involved in the domxml_unlink() function. Refer to bug #14522
for more details.
@ Fixed seg fault in domxml_unlink() (jtate)
2002-03-08 23:39:26 +00:00
foobar a8677aafbc - MFH (fix for the phpinfo() output) 2002-03-08 07:35:07 +00:00
Rui Hirokawa 4f9949dc2a revert my patch to fix freetype2 related problem. 2002-03-07 22:27:14 +00:00
Jason Greene 05d1e6d88f Merge News Entry 2002-03-07 20:50:52 +00:00
Jon Parise 5fcc8ca854 MFH r1.45: header file correction 2002-03-07 20:41:50 +00:00
Jason Greene 760add1c63 Disallow mysql's 'LOAD LOCAL' when safe mode is enabled 2002-03-07 20:39:55 +00:00
Derick Rethans 35d8b9408e - Fix typo in warning suppressor 2002-03-07 20:00:33 +00:00
Joseph Tate e1e8ee1924 Reverting the reverted patch. I hope this is the last time. No added functionality. Just a bug fix of #15918 2002-03-07 18:53:55 +00:00
Joseph Tate 15c658f21f Reverting patch at Derick's request. Reverted to 1.118 2002-03-07 18:47:25 +00:00
Joseph Tate 58269f1769 Added type attributes to XML_DTD_NODE and XML_ATTRIBUTE_NODE element types.
Reported in bug #15918.
2002-03-07 16:48:43 +00:00
Derick Rethans b736409e52 - Update NEWS 2002-03-07 08:18:02 +00:00
Jason Greene dd955a3b41 MFH 2002-03-07 00:24:30 +00:00
SVN Migration c5c68f4d36 This commit was manufactured by cvs2svn to create branch 'PHP_4_2_0'. 2002-03-06 22:08:26 +00:00
950 changed files with 24586 additions and 136487 deletions

No files matched your search

+3 -13
View File
@@ -60,19 +60,9 @@ Exceptions:
check its man page again, and only then, consider using it, and even then,
try avoiding it.
[7] Use ZEND_* macros instead of PHP_* macros. Use of PHP_* macros is not
recommended. Since most of the PHP_* macros are ZEND_* macro aliases, using
the PHP_* macros makes browsing the source code with a tag search harder.
[8] Use assert(). assert.h is included in php.h if it is available. Not only
does good assertion catch bugs, but it also helps with code readability.
- Do not use assert for error handling. Use assert only for the
condition that must be always true.
- Do not use assignments in assert conditions. If you assign inside an
assert condition, you risk an elusive bug that would be very difficult
to spot in a debug build, due to the side effect of the assignment.
Function calls in assert conditions may also cause this problem, if
they modify one of their arguments or global variables.
[7] Use ZEND_* macro instead of PHP_* macro. Use of PHP_* macros are
not recommended. Since most of PHP_* macros are ZEND_* macro alias, use of
PHP_* macro makes browsing source with tag search harder.
Naming Conventions
------------------
+1 -1
View File
@@ -1,2 +1,2 @@
For the list of people who've put work into PHP, please see
For the list of people who've put work into PHP 4.0, please see
http://www.php.net/credits.php
-11316
View File
File diff suppressed because it is too large. Load diff
-10
View File
@@ -36,11 +36,6 @@ PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: apache2
PRIMARY MAINTAINER: Aaron Bannert <aaron@php.net>
MAINTENANCE: Maintained
STATUS: Experimental
-------------------------------------------------------------------------------
EXTENSION: cgi
MAINTENANCE: Unknown
STATUS: Working
@@ -221,11 +216,6 @@ MAINTENANCE: Unknown
STATUS: Experimental
SINCE: 4.0.5
-------------------------------------------------------------------------------
EXTENSION: ctype
PRIMARY MAINTAINER: Hartmut Holzgraefe <hartmut@six.de>
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: curl
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>
MAINTENANCE: Maintained
+11 -11
View File
@@ -1,5 +1,5 @@
Installation Instructions for PHP 4
-----------------------------------
Installation Instructions for PHP 4.1
-------------------------------------
STOP!
@@ -62,8 +62,8 @@ Compiled-in modules:
Chances are you will see a lot more modules than these two. That's ok,
as long as mod_so.c shows up you can proceed with the following steps:
$ gunzip -c php-4.x.y.tar.gz | tar xf -
$ cd php-4.x.y
$ gunzip -c php-4.1.x.tar.gz | tar xf -
$ cd php-4.1.x
$ ./configure --with-mysql --with-apxs
$ make
$ make install
@@ -93,8 +93,8 @@ $ cd apache_1.3.x
$ ./configure
$ cd ..
$ gunzip -c php-4.x.y.tar.gz | tar xf -
$ cd php-4.x.y
$ gunzip -c php-4.1.x.tar.gz | tar xf -
$ cd php-4.1.x
$ ./configure --with-mysql --with-apache=../apache_1.3.x
$ make
$ make install
@@ -106,7 +106,7 @@ $ ./configure --prefix=/www --activate-module=src/modules/php4/libphp4.a
$ make
(you should now have an httpd binary which you can copy to your Apache bin dir if
is is your first install then you need to "make install" as well)
$ cd ../php-4.x.y
$ cd ../php-4.1.x
$ cp php.ini-dist /usr/local/lib/php.ini
You can edit /usr/local/lib/php.ini file to set PHP options.
Edit your httpd.conf or srm.conf file and add:
@@ -125,12 +125,12 @@ Installing PHP can be done in four simple steps:
1. Unpack your distribution file.
You will have downloaded a file named something like php-4.x.y.tar.gz.
Unzip this file with a command like: gunzip php-4.x.y.tar.gz
You will have downloaded a file named something like php-4.1.x.tar.gz.
Unzip this file with a command like: gunzip php-4.1.x.tar.gz
Next you have to untar it with: tar -xvf php-4.x.y.tar
Next you have to untar it with: tar -xvf php-4.1.x.tar
This will create a php-4.x.y directory. cd into this new directory.
This will create a php-4.1.x directory. cd into this new directory.
2a. Configure PHP (Dynamic Module) - Skip to 2b if you wish to build
a static module
+15 -4
View File
@@ -1,5 +1,5 @@
--------------------------------------------------------------------
The PHP License, version 3.0a1
The PHP License, version 2.02
Copyright (c) 1999 - 2002 The PHP Group. All rights reserved.
--------------------------------------------------------------------
@@ -37,6 +37,20 @@ are met:
"This product includes PHP, freely available from
http://www.php.net/".
6. The software incorporates the Zend Engine, a product of Zend
Technologies, Ltd. ("Zend"). The Zend Engine is licensed to the
PHP Association (pursuant to a grant from Zend that can be
found at http://www.php.net/license/ZendGrant/) for
distribution to you under this license agreement, only as a
part of PHP. In the event that you separate the Zend Engine
(or any portion thereof) from the rest of the software, or
modify the Zend Engine, or any portion thereof, your use of the
separated or modified Zend Engine software shall not be governed
by this license, and instead shall be governed by the license
set forth at http://www.zend.com/license/ZendLicense/.
THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND
ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
@@ -59,6 +73,3 @@ The PHP Group can be contacted via Email at group@php.net.
For more information on the PHP Group and the PHP project,
please see <http://www.php.net>.
This product includes the Zend Engine, freely available at
<http://www.zend.com>.
-18
View File
@@ -1,18 +0,0 @@
$(builddir)/zend_language_scanner.lo: $(builddir)/zend_language_parser.h
$(builddir)/zend_ini_scanner.lo: $(builddir)/zend_ini_parser.h
$(builddir)/zend_language_scanner.c: $(srcdir)/zend_language_scanner.l
$(LEX) -Pzend -S$(srcdir)/flex.skl -o$@ -i $(srcdir)/zend_language_scanner.l
$(builddir)/zend_language_parser.h: $(builddir)/zend_language_parser.c
$(builddir)/zend_language_parser.c: $(srcdir)/zend_language_parser.y
$(YACC) -p zend -v -d $(srcdir)/zend_language_parser.y -o $@
$(builddir)/zend_ini_parser.h: $(builddir)/zend_ini_parser.c
$(builddir)/zend_ini_parser.c: $(srcdir)/zend_ini_parser.y
$(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o $@
$(builddir)/zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l
$(LEX) -Pini_ -S$(srcdir)/flex.skl -o$@ -i $(srcdir)/zend_ini_scanner.l
$(builddir)/zend_indent.lo $(builddir)/zend_highlight.lo $(builddir)/zend_compile.lo: $(builddir)/zend_language_parser.h
-72
View File
@@ -1,72 +0,0 @@
mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p
INSTALL = $(top_srcdir)/build/shtool install -c
INSTALL_DATA = $(INSTALL) -m 644
DEFS = -DPHP_ATOM_INC -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir)
COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS)
all: $(all_targets)
build-modules: $(PHP_MODULES)
libphp4.la: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@
libs/libphp4.bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
$(CC) $(MH_BUNDLE_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ && cp $@ libs/libphp4.so
php: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
$(LIBTOOL) --mode=link $(CC) -export-dynamic $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@
sapi/cli/php: $(PHP_GLOBAL_OBJS) $(PHP_CLI_OBJS)
$(LIBTOOL) --mode=link $(CC) -export-dynamic $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_CLI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@
install: $(install_targets)
install-cli: sapi/cli/php
$(INSTALL_CLI)
install-sapi: libphp4.la
-@$(LIBTOOL) --silent --mode=install cp libphp4.la $(phptempdir)/libphp4.la >/dev/null 2>&1
-@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
-@if test ! -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME); then \
for i in 0.0.0 0.0 0; do \
if test -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME).$$i; then \
$(LN_S) $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME).$$i $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME); \
break; \
fi; \
done; \
fi
$(INSTALL_IT)
install-modules:
@test -d modules && \
$(mkinstalldirs) $(INSTALL_ROOT)$(EXTENSION_DIR) && \
echo "installing shared modules into $(EXTENSION_DIR)" && \
rm -f modules/*.la && \
cp modules/* $(INSTALL_ROOT)$(EXTENSION_DIR) >/dev/null 2>&1 || true
install-tester:
@echo "Installing regression tester"
@$(mkinstalldirs) $(PEAR_INSTALLDIR)
@$(INSTALL) -m 755 $(top_srcdir)/run-tests.php $(INSTALL_ROOT)$(PEAR_INSTALLDIR)
install-su: install-pear install-tester
test: sapi/cli/php
@TEST_PHP_EXECUTABLE=$(top_builddir)/sapi/cli/php \
$(top_builddir)/sapi/cli/php -c php.ini-dist $(top_srcdir)/run-tests.php
clean:
find . -name \*.lo -o -name \*.o -o -name \*.la -o -name \*.a| xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp4.la php sapi/cli/php modules/* libs/*
distclean: clean
rm -f config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h php4.spec sapi/apache/libphp4.module buildmk.stamp
find . -name Makefile | xargs rm -f
.PHONY: all clean install distclean test
.NOEXPORT:
+66
View File
@@ -0,0 +1,66 @@
ZEND_DIR = $(srcdir)/Zend
SUBDIRS = Zend main ext sapi $(TSRM_DIR) $(REGEX_DIR) $(CLI_DIR) . $(PEAR_DIR)
LTLIBRARY_NAME = libphp4.la
LTLIBRARY_SOURCES = stub.c
LTLIBRARY_DEPENDENCIES = \
Zend/libZend.la \
sapi/$(PHP_SAPI)/libsapi.la \
main/libmain.la \
$(REGEX_LIB) \
$(EXT_LTLIBS) \
$(TSRM_LIB)
LTLIBRARY_LDFLAGS = -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS)
LTLIBRARY_LIBADD = $(LTLIBRARY_DEPENDENCIES) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS)
PROGRAM_NAME = php
PROGRAM_SOURCES = stub.c
PROGRAM_LDADD = libphp4.la $(EXT_PROGRAM_LDADD)
PROGRAM_LDFLAGS = -export-dynamic
PROGRAM_DEPENDENCIES = $(PROGRAM_LDADD)
targets = $(LTLIBRARY_NAME) $(PHP_PROGRAM)
install_targets = install-sapi install-modules
include $(top_srcdir)/build/rules.mk
include $(top_srcdir)/build/library.mk
include $(top_srcdir)/build/program.mk
install-sapi:
@$(LIBTOOL) --silent --mode=install cp libphp4.la $(phptempdir)/libphp4.la >/dev/null 2>&1
-@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
-@if test ! -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME); then \
for i in 0.0.0 0.0 0; do \
if test -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME).$$i; then \
$(LN_S) $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME).$$i $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME); \
break; \
fi; \
done; \
fi
$(INSTALL_IT)
install-modules:
@test -d modules && \
$(mkinstalldirs) $(INSTALL_ROOT)$(moduledir) && \
echo "installing shared modules into $(moduledir)" && \
rm -f modules/*.la && \
cp modules/* $(INSTALL_ROOT)$(moduledir) >/dev/null 2>&1 || true
install-tester:
@echo "Installing regression tester"
@$(mkinstalldirs) $(PEAR_INSTALLDIR)
@$(INSTALL) -m 755 $(srcdir)/run-tests.php $(INSTALL_ROOT)$(PEAR_INSTALLDIR)
install-pear: install-modules
(cd pear && $(MAKE) install)
install-su: install-pear install-tester
clean-modules:
rm -f modules/*
.NOEXPORT:
+7 -132
View File
@@ -1,127 +1,10 @@
PHP 4 NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2002, Version 4.3.0
- Added preliminary SAX-Input support. It's now possible to build a DomDocument
with SAX-Events (added domxml_parser_start_document(), domxml_parser_end_document(),
domxml_parser_start_element(tagname[,attributes]), domxml_parser_end_element(tagname),
domxml_parser_characters(characters), domxml_parser_cdata_block(cdata),
domxml_parser_comment(comment), domxml_parser_get_document(). (chregu)
- Bundle gd library 2.0.1 with php (ext/gd/libgd) (Rasmus), tweak config.m4 to
work with it (Jani), smallers tweaks for Win32 (Markus, Edin)
- Fixed bug with Apache which let PHP_AUTH_* variables to be set when
external basic auth mechanism was used. (Jani)
- Fixed bzopen() crash in thread-safe mode. (Andrei)
- Added better error-messages (3rd parameter) and validating of DTDs (2nd
parameter) to domxml_open_mem() and domxml_open_file(). (Christian)
- Added domxml_doc_validate() for validating existing DomDocuments with a DTD.
(Christian)
- Added ability to capture string offsets in preg_match_*() results.
(David Brown, Andrei)
- Fixed set_error_handler() to accept methods as callbacks and also report
invalid callbacks. (Andrei)
- Fixed a memory corruption bug in overload extension. (Andrei)
- Fixed error handling in fsockopen() on win32. (Jason)
- Added win32 support for the timeout parameter of fsockopen(). (Jason)
- Fixed shuffle() to provide equal distribution of values. (Andrei)
- Added --with-mysql-sock configure option which can be used to override
the unix socket location. (e.g. NFS compiles, etc.) (James Cox)
- Fixed is_a() to properly work on extension registered classes. (Andrei)
- Added new constants: PHP_PREFIX and PHP_SHLIB_SUFFIX. (Stig)
- Added STDIN, STDOUT and STDERR constants for CLI sapi reflecting opened
streams to their respective I/O counterparts. (Edin)
- Added pctnl_alarm() function. (Edin)
- Fixed array_rand() on thread-safe platforms such as Windows. (Edin)
- If zlib.output_compression is enabled and a page is compressed
a "Vary: Accept-Encoding" header is added. (Stefan)
- Renamed getallheaders() to apache_request_headers() and kept getallheaders()
as an alias to it. Also added apache_response_headers() which returns the
current response headers from Apache. (Rasmus)
- Added missing AddRef() calls in the COM extension. This should fix weird
behaviour (in particular with ADODB). (Harald)
- Fixed some dummy errors. (dets)
- Fix segfault in version_compare(). (Stig)
- Added compressed Flash MX files support to getimagesize(). (Derick)
- Added ability to capture string offsets in preg_split() results.
(David Brown, Andrei)
- Fixed a crash bug in token_get_all(). (Andrei)
- Implemented glob() for Unix/Win32. (Hartmut, Edin, Markus)
- Added domxml_doc_set_root() to change the root node. (Lukas Schroeder)
- Fixed a crash bug in stripslashes() when working in sybase mode. (Rasmus)
- Added experimental support for Simplified Chinese, Traditional Chinese and
Korean encodings into mbstring. (Rui)
- Misc. Win32 mail() enhancements: support 'From:' header (msisolak@yahoo.com),
support Bcc header, case-insensitive headers, enhanced error reporting,
automatic proper line ending conversion, fix crash with Cc, fix buffer
overflows with $header. (Markus)
- Improved IMAP extension performance. (adam.kauffman@mindspring.com,
rjs3@andrew.cmu.edu, Jon)
- Added optional 5th parameter to domxml_xslt_process(). When set, profiling
information is saved to the specified file. (chregu)
- Added MD5 support for crypt() on Windows. (Edin)
- Fixed resource bug in LDAP extension. (Stig Venaas)
- Fixed crash in output buffering when buffer is overwritten in a callback.
(Yasuo)
- Added output_add_rewrite_var() and output_remove_rewrite_var() to inject
and remove variables from the URL-Rewriter. (Thies)
- The Windows build can now be configured more comfortably, for example
when dealing with built-in extensions. (Sebastian)
- Added optional 3rd parameter to mysql_select_db() which makes it return
the previously selected database name. (Jani)
- Added large OID value (2^31 to 2^32) support for pg_lo_import(),
pg_lo_unlink(), pg_lo_open() and pg_lo_export(). (Yasuo)
- Made the mbstring extension to be enabled by default. (Yasuo)
- Fixed mixing OCIPlogon() and OCINLogon() to not leak Oracle-Sessions. (Thies)
- Added php.ini options for EXIF extension to encode and decode Unicode/JIS
user comments. (Marcus)
- Changed the "-c" CLI/CGI option to allow both 'filename' and
'path to php.ini'. (Yasuo)
- Added version information to the .dll and .exe files created under Windows.
(jtate)
- Added __FUNCTION__ and __CLASS__ constants. (Jani, Zend Engine)
- Added pg_metadate(), pg_convert(), pg_insert(), pg_select(), pg_update()
and pg_delete(). (Yasuo)
- Added optional 2nd parameter for pg_result_status() to specify return type.
(Yasuo)
- Added "log_errors_max_len" php.ini option which controls maximum length for
error messages. (Marcus)
- Added "ignore_repeated_errors" and "ignore_repeated_source" php.ini options
which can be used to disable logging of repeated error messages. (Marcus)
- Made pg_last_notice() work correctly. (Yasuo)
- Added "pgsql.ignore_notice" and "pgsql.log_notice" php.ini options. (Yasuo)
- Added "zlib.output_compression_level" php.ini option. (Stig)
- Added support for --with-apxs build on Mac OS X / Darwin. (markonen)
- Added support for dynamically loaded extensions on OS X / Darwin.
NOTE: This requires Apache 1.3.25 or later. (kalowsky, markonen)
- Fixed CR/LF processing in quoted_printable_decode() on Win32. (kir)
- Made crack extension available on Win32. Cracklib libraries for Win32 are
available at http://www.jtatesoftware.com/cracklib/. (jtate)
- Added mysql_info() function. (Jan)
- Added mysql_list_processes() and mysql_stat() functions. (Georg)
- Added file_get_contents() which returns the contents of a file as a string.
This function also supports the URL wrappers. (Wez)
- Changed 'zlib:' fopen wrapper to 'compress.zlib://' to avoid ambiguities
when filenames have ':' characters. (Wez)
- Added URL-wrapper support to exif. (Marcus)
- PHP now has a new stream system that allows it to do some clever stuff with
fopen() and fsockopen(). As a result:
. URL wrappers natively supports https:// URLs
. fsockopen() adds support for ssl:// and tls:// connections via TCP/IP
. copy($srcfilename, $destfilename) can now be used with URL wrappers
. zlib wrappers/streams can be used even on systems without fopencookie()
. Added 'compress.bzip2://' stream and wrapper support.
. Added user-space streams - it is now possible to define a class in PHP
code and register it as a URL wrapper.
. Most extensions now support streams when passing files, which means
that those extensions will support URL wrappers. (Wez)
. Added memory stream support. (Marcus)
- Fixed memory allocation problem on systems that have iconv() support in libc.
(Yasuo)
- Made var_dump() handle recursive structures better. (Yasuo)
- Added exif_imagetype() function. (Marcus)
- New improved build system. Among other improvements, replaces the slow
recursive make with one global Makefile and eases the integration of proper
dependencies. Automake is only needed for its aclocal tool. The build
process is now more portable and less resource-consuming. (Sascha)
22 July 2002, Version 4.2.2
- Fixed a security problem in the file upload code, which allows remote parties
to crash the webserver's child. On the Sparc architecture this can be used to
run arbitrary code. (Stefan)
- Fixed the build system for Solaris users. (Sascha)
13 May 2002, Version 4.2.1
- Added safe-mode checks to show_source(), parse_ini_file() and rmdir(). Also
@@ -165,19 +48,13 @@ PHP 4 NEWS
- ATTENTION!! register_globals defaults to 'off' now !!!
- Note: Apache2 support is EXPERIMENTAL.
- PostgreSQL functions are renamed, but all old function names are available.
Old function names will be available long enough. User can safely use old
Old function names will be available long enough. User can safely use old
function names. (Yasuo)
- Moved ext/mailparse to PECL. See http://thebrainroom.com/opensource/php/
for more information and to download the extension. (Wez/Jim)
- Fixed pg_last_notice() crash. (Yasuo)
- Modified the mysql extension to disable 'LOAD LOCAL' when safe mode is
- Modified the mysql extension to disable 'LOAD LOCAL' when safe mode is
enabled. (Jason)
- Added CLI (command line interface) sapi which is more suitable for writing
shell scripts. Some of the differences to CGI sapi are: no HTTP headers,
plain text error messages, does not change working directory, have a new -r
option which executes a piece of PHP code directly from the commmand line, etc.
"make install" will install CLI SAPI version of php in {PREFIX}/bin/php while
CGI is renamed and installed as {PREFIX}/bin/php-cgi. (Edin)
- Fixed HTTP file upload support to handle big files better. (Jani)
- Major modifications to the Sockets Extension and its API (Jason):
. Fixed numerous bugs.
@@ -367,8 +244,6 @@ PHP 4 NEWS
in itself. (Andrei)
- Added ini_get_all() function which returns all registered ini entries
or entries for the specified extension. (Jani)
- Added mailparse_uudecode_all() which extracts all uuencoded attachments.
(Wez)
- Added support for chinese encodings in htmlentities() and htmlspecialchars().
(Patch by Alan Knowles <alan_k@hklc.com> and Wez)
- Improved support for autoconf-2.50+/libtool 1.4b+. (Jan Kneschke, Sascha)
+1 -2
View File
@@ -1,7 +1,6 @@
This is the first file you should be reading after you get your CVS account.
We'll assume you're basically familiar with CVS, but feel free to post
your questions on the mailing list. Please have a look at
http://cvsbook.red-bean.com/ for more detailed information on CVS.
your questions on the mailing list.
PHP is developed through the efforts of a large number of people.
Collaboration is a Good Thing(tm), and CVS lets us do this. Thus, following
+5 -10
View File
@@ -13,16 +13,11 @@ HOW TO USE IT
./ext_skel --extname=module_name
and everything you need is placed in directory module_name.
[ Note that GNU awk is likely required for this script to work. Debian
systems seem to default to using mawk, so you may need to change the
#! line in skeleton/create_stubs to use gawk explicitly. ]
If you don't need to test the existence of any external header files,
libraries or functions in them, the module is already almost ready to be
compiled in PHP. Just remove 3 comments in your_module_name/config.m4,
cd back up to PHP sources top directory, and do
and everything you need is placed in directory module_name. In fact, if you
don't need to test the existence of any external header files, libraries or
functions in them, the module is already almost ready to be compiled in PHP.
Just remove 3 comments in your_module_name/config.m4, cd back up to PHP
sources top directory, and do
./buildconf; ./configure --enable-module_name; make
+32 -12
View File
@@ -7,6 +7,7 @@ HOW TO CREATE A SELF-CONTAINED PHP EXTENSION
the PHP source. To create such an extension, three things are
required:
- Makefile template (Makefile.in)
- Configuration file (config.m4)
- Source code for your module
@@ -73,9 +74,28 @@ DEFINING THE NEW EXTENSION
need to specify anything).
CREATING THE MAKEFILE TEMPLATE
The Makefile Template (Makefile.in) contains three lines:
------------------------------------------------------------------------------
LTLIBRARY_SHARED_NAME = foobar.la
LTLIBRARY_SOURCES = foo.c bar.c
include $(top_srcdir)/build/dynlib.mk
------------------------------------------------------------------------------
LTLIBRARY_SHARED_NAME specifies the name of the extension.
It must be of the form `ext-name.la'.
LTLIBRARY_SOURCES specifies the names of the sources files. You can
name an arbitrary number of source files here.
The final include directive includes the build rules (you usually
don't need to care about what happens there). rules.mk and other
files are installed by phpize which we will cover later.
CREATING THE M4 CONFIGURATION FILE
The m4 configuration can perform additional checks. For a
@@ -87,17 +107,13 @@ PHP_ARG_ENABLE(foobar,whether to enable foobar,
[ --enable-foobar Enable foobar])
if test "$PHP_FOOBAR" != "no"; then
PHP_NEW_EXTENSION(foobar, foo.c bar.c, $ext_shared)
PHP_EXTENSION(foobar, $ext_shared)
fi
------------------------------------------------------------------------------
PHP_ARG_ENABLE will automatically set the correct variables, so
that the extension will be enabled by PHP_NEW_EXTENSION in shared mode.
that the extension will be enabled by PHP_EXTENSION in shared mode.
The first argument of PHP_NEW_EXTENSION describes the name of the
extension. The second names the source-code files. The third passes
$ext_shared which is set by PHP_ARG_ENABLE/WITH to PHP_NEW_EXTENSION.
Please use always PHP_ARG_ENABLE or PHP_ARG_WITH. Even if you do not
plan to distribute your module with PHP, these facilities allow you
to integrate your module easily into the main PHP module framework.
@@ -115,8 +131,8 @@ CREATING SOURCE FILES
CREATING THE SELF-CONTAINED EXTENSION
Put config.m4 and the source files into one directory. Afterwards,
run phpize (this is installed during make install by PHP 4.0).
Put Makefile.in, config.m4 and the source files into one directory.
Then run phpize (this is installed during make install by PHP 4.0).
For example, if you configured PHP with --prefix=/php, you would run
$ /php/bin/phpize
@@ -141,13 +157,17 @@ ADDING SHARED MODULE SUPPORT TO A MODULE
support to an existing module called foo.
1. In config.m4, use PHP_ARG_WITH/PHP_ARG_ENABLE. Then you will
automatically be able to use --with-foo=shared[,..] or
--enable-foo=shared[,..].
automatically be able to use --with-foo=shared or
--enable-foo=shared.
2. In config.m4, use PHP_NEW_EXTENSION(foo,.., $ext_shared) to enable
2. In config.m4, use PHP_EXTENSION(foo, $ext_shared) to enable
building the extension.
3. Add the following lines to your C source file:
3. Add the following line to Makefile.in:
LTLIBRARY_SHARED_NAME = foo.la
4. Add the following lines to your C source file:
#ifdef COMPILE_DL_FOO
ZEND_GET_MODULE(foo)
+57 -181
View File
@@ -4,6 +4,9 @@ $Id$
Please send comments to: Wez Furlong <wez@thebrainroom.com>
Note: this doc is preliminary and is intended to give the reader an idea of
how streams work and should be used.
Why Streams?
============
You may have noticed a shed-load of issock parameters flying around the PHP
@@ -23,7 +26,7 @@ The main functions are:
PHPAPI size_t php_stream_read(php_stream * stream, char * buf, size_t count);
PHPAPI size_t php_stream_write(php_stream * stream, const char * buf, size_t
count);
count);
PHPAPI int php_stream_eof(php_stream * stream);
PHPAPI int php_stream_getc(php_stream * stream);
PHPAPI char *php_stream_gets(php_stream * stream, char *buf, size_t maxlen);
@@ -37,119 +40,16 @@ names: fread, fwrite, feof, fgetc, fgets, fclose, fflush, fseek, ftell.
Opening Streams
===============
In most cases, you should use this API:
Ultimately, I aim to implement an fopen_wrapper-like call to do this with
minimum fuss.
Currently, mostly for testing purposes, you can use php_stream_fopen to open a
stream on a regular file.
PHPAPI php_stream *php_stream_open_wrapper(char *path, char *mode,
int options, char **opened_path TSRMLS_DC);
PHPAPI php_stream * php_stream_fopen(const char * filename, const char *
mode);
Where:
path is the file or resource to open.
mode is the stdio compatible mode eg: "wb", "rb" etc.
options is a combination of the following values:
IGNORE_PATH (default) - don't use include path to search for the file
USE_PATH - use include path to search for the file
IGNORE_URL - do not use plugin wrappers
REPORT_ERRORS - show errors in a standard format if something
goes wrong.
STREAM_MUST_SEEK - If you really need to be able to seek the stream
and don't need to be able to write to the original
file/URL, use this option to arrange for the stream
to be copied (if needed) into a stream that can
be seek()ed.
opened_path is used to return the path of the actual file opened,
but if you used STREAM_MUST_SEEK, may not be valid. You are
responsible for efree()ing opened_path. opened_path may be (and usually
is) NULL.
If you need to open a specific stream, or convert standard resources into
streams there are a range of functions to do this defined in php_streams.h.
A brief list of the most commonly used functions:
PHPAPI php_stream *php_stream_fopen_from_file(FILE *file, const char *mode);
Convert a FILE * into a stream.
PHPAPI php_stream *php_stream_fopen_tmpfile(void);
Open a FILE * with tmpfile() and convert into a stream.
PHPAPI php_stream *php_stream_fopen_temporary_file(const char *dir,
const char *pfx, char **opened_path TSRMLS_DC);
Generate a temporary file name and open it.
There are some network enabled relatives in php_network.h:
PHPAPI php_stream *php_stream_sock_open_from_socket(int socket, int persistent);
Convert a socket into a stream.
PHPAPI php_stream *php_stream_sock_open_host(const char *host, unsigned short port,
int socktype, int timeout, int persistent);
Open a connection to a host and return a stream.
PHPAPI php_stream *php_stream_sock_open_unix(const char *path, int persistent,
struct timeval *timeout);
Open a UNIX domain socket.
Stream Utilities
================
If you need to copy some data from one stream to another, you will be please
to know that the streams API provides a standard way to do this:
PHPAPI size_t php_stream_copy_to_stream(php_stream *src,
php_stream *dest, size_t maxlen);
If you want to copy all remaining data from the src stream, pass
PHP_STREAM_COPY_ALL as the maxlen parameter, otherwise maxlen indicates the
number of bytes to copy.
This function will try to use mmap where available to make the copying more
efficient.
If you want to read the contents of a stream into an allocated memory buffer,
you should use:
PHPAPI size_t php_stream_copy_to_mem(php_stream *src, char **buf,
size_t maxlen, int persistent);
This function will set buf to the address of the buffer that it allocated,
which will be maxlen bytes in length, or will be the entire length of the
data remaining on the stream if you set maxlen to PHP_STREAM_COPY_ALL.
The buffer is allocated using pemalloc(); you need to call pefree() to
release the memory when you are done.
As with copy_to_stream, this function will try use mmap where it can.
If you have an existing stream and need to be able to seek() it, you
can use this function to copy the contents into a new stream that can
be seek()ed:
PHPAPI int php_stream_make_seekable(php_stream *origstream, php_stream **newstream);
It returns one of the following values:
#define PHP_STREAM_UNCHANGED 0 /* orig stream was seekable anyway */
#define PHP_STREAM_RELEASED 1 /* newstream should be used; origstream is no longer valid */
#define PHP_STREAM_FAILED 2 /* an error occurred while attempting conversion */
#define PHP_STREAM_CRITICAL 3 /* an error occurred; origstream is in an unknown state; you should close origstream */
make_seekable will always set newstream to be the stream that is valid
if the function succeeds.
When you have finished, remember to close the stream.
NOTE: If you only need to seek forwards, there is no need to call this
function, as the php_stream_seek can emulate forward seeking when the
whence parameter is SEEK_CUR.
NOTE: Writing to the stream may not affect the original source, so it
only makes sense to use this for read-only use.
NOTE: If the origstream is network based, this function will block
until the whole contents have been downloaded.
NOTE: Never call this function with an origstream that is referenced
as a resource! It will close the origstream on success, and this
can lead to a crash when the resource is later used/released.
NOTE: If you are opening a stream and need it to be seekable, use the
STREAM_MUST_SEEK option to php_stream_open_wrapper();
This call behaves just like fopen(), except it returns a stream instead of a
FILE *
Casting Streams
===============
@@ -159,14 +59,14 @@ You need to "cast" the stream into a FILE*, and this is how you do it:
FILE * fp;
php_stream * stream; /* already opened */
if (php_stream_cast(stream, PHP_STREAM_AS_STDIO, (void*)&fp, REPORT_ERRORS) == FAILURE) {
RETURN_FALSE;
if (php_stream_cast(stream, PHP_STREAM_AS_STDIO, &fp, 1) == FAILURE) {
RETURN_FALSE;
}
The prototype is:
PHPAPI int php_stream_cast(php_stream * stream, int castas, void ** ret, int
show_err);
show_err);
The show_err parameter, if non-zero, will cause the function to display an
appropriate error message of type E_WARNING if the cast fails.
@@ -183,14 +83,8 @@ if you mix ANSI stdio calls on the FILE* with php stream calls on the stream.
If your system has the fopencookie function, php streams can synthesize a
FILE* on top of any stream, which is useful for SSL sockets, memory based
streams, data base streams etc. etc.
In situations where this is not desireable, you should query the stream
to see if it naturally supports FILE *. You can use this code snippet
for this purpose:
if (php_stream_is(stream, PHP_STREAM_IS_STDIO)) {
/* can safely cast to FILE* with no adverse side effects */
}
NOTE: There might be situations where this is not desireable, and we need to
provide a flag to inform the casting routine of this.
You can use:
@@ -199,15 +93,10 @@ PHPAPI int php_stream_can_cast(php_stream * stream, int castas)
to find out if a stream can be cast, without actually performing the cast, so
to check if a stream is a socket you might use:
if (php_stream_can_cast(stream, PHP_STREAM_AS_SOCKETD) == SUCCESS) {
/* it can be a socket */
if (php_stream_can_cast(stream, PHP_STREAM_AS_SOCKETD) == SUCCESS) {
/* it's a socket */
}
Please note the difference between php_stream_is and php_stream_can_cast;
stream_is tells you if the stream is a particular type of stream, whereas
can_cast tells you if the stream can be forced into the form you request.
The former doesn't change anything, while the later *might* change some
state in the stream.
Stream Internals
================
@@ -220,10 +109,10 @@ underlying implementation.
The php_streams ops struct consists of pointers to methods that implement
read, write, close, flush, seek, gets and cast operations. Of these, an
implementation need only implement write, read, close and flush. The gets
method is intended to be used for streams if there is an underlying method
that can efficiently behave as fgets. The ops struct also contains a label
for the implementation that will be used when printing error messages - the
stdio implementation has a label of "STDIO" for example.
method is intended to be used for non-buffered streams if there is an
underlying method that can efficiently behave as fgets. The ops struct also
contains a label for the implementation that will be used when printing error
messages - the stdio implementation has a label of "STDIO" for example.
The idea is that a stream implementation defines a php_stream_ops struct, and
associates it with a php_stream using php_stream_alloc.
@@ -232,17 +121,17 @@ As an example, the php_stream_fopen() function looks like this:
PHPAPI php_stream * php_stream_fopen(const char * filename, const char * mode)
{
FILE * fp = fopen(filename, mode);
php_stream * ret;
if (fp) {
ret = php_stream_alloc(&php_stream_stdio_ops, fp, 0, 0, mode);
if (ret)
return ret;
FILE * fp = fopen(filename, mode);
php_stream * ret;
if (fp) {
ret = php_stream_alloc(&php_stream_stdio_ops, fp, 0, 0, mode);
if (ret)
return ret;
fclose(fp);
}
return NULL;
fclose(fp);
}
return NULL;
}
php_stream_stdio_ops is a php_stream_ops structure that can be used to handle
@@ -254,7 +143,7 @@ to be passed back to fopen_wrapper (or it's yet to be implemented successor).
The prototype for php_stream_alloc is this:
PHPAPI php_stream * php_stream_alloc(php_stream_ops * ops, void * abstract,
size_t bufsize, int persistent, const char * mode)
size_t bufsize, int persistent, const char * mode)
ops is a pointer to the implementation,
abstract holds implementation specific data that is relevant to this instance
@@ -275,19 +164,6 @@ into a FILE*, so it should be compatible with the mode parameter of fopen().
Writing your own stream implementation
======================================
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
RULE #1: when writing your own streams: make sure you have configured PHP with
--enable-debug.
I've taken some great pains to hook into the zend memory manager to help track
down allocation problems. It will also help you spot incorrect use of the
STREAMS_DC, STREAMS_CC and the semi-private STREAMS_REL_CC macros for function
definitions.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
RULE #2: Please use the stdio stream as a reference; it will help you
understand the semantics of the stream operations, and it will always
be more up to date than these docs :-)
First, you need to figure out what data you need to associate with the
php_stream. For example, you might need a pointer to some memory for memory
based streams, or if you were making a stream to read data from an RDBMS like
@@ -300,9 +176,9 @@ appropriately), and use the abstract pointer to refer to it.
For structured state you might have this:
struct my_state {
MYSQL conn;
MYSQL_RES * result;
struct my_state {
MYSQL conn;
MYSQL_RES * result;
};
struct my_state * state = pemalloc(sizeof(struct my_state), persistent);
@@ -325,32 +201,32 @@ For example, for reading from this wierd mysql stream:
static size_t php_mysqlop_read(php_stream * stream, char * buf, size_t count)
{
struct my_state * state = (struct my_state*)stream->abstract;
struct my_state * state = (struct my_state*)stream->abstract;
if (buf == NULL && count == 0) {
/* in this special case, php_streams is asking if we have reached the
* end of file */
if (... at end of file ...)
return EOF;
else
return 0;
}
/* pull out some data from the stream and put it in buf */
... mysql_fetch_row(state->result) ...
/* we could do something strange, like format the data as XML here,
and place that in the buf, but that brings in some complexities,
such as coping with a buffer size too small to hold the data,
so I won't even go in to how to do that here */
if (buf == NULL && count == 0) {
/* in this special case, php_streams is asking if we have reached the
* end of file */
if (... at end of file ...)
return EOF;
else
return 0;
}
/* pull out some data from the stream and put it in buf */
... mysql_fetch_row(state->result) ...
/* we could do something strange, like format the data as XML here,
and place that in the buf, but that brings in some complexities,
such as coping with a buffer size too small to hold the data,
so I won't even go in to how to do that here */
}
Implement the other operations - remember that write, read, close and flush
are all mandatory. The rest are optional. Declare your stream ops struct:
php_stream_ops my_ops = {
php_mysqlop_write, php_mysqlop_read, php_mysqlop_close,
php_mysqlop_flush, NULL, NULL, NULL,
"Strange mySQL example"
php_mysqlop_write, php_mysqlop_read, php_mysqlop_close,
php_mysqlop_flush, NULL, NULL, NULL,
"Strange mySQL example"
}
Thats it!
@@ -364,4 +240,4 @@ connection and then use pefree to dispose of the struct you allocated.
You may read the stream->persistent field to determine if your struct was
allocated in persistent mode or not.
vim:tw=78:et
vim:tw=78
-121
View File
@@ -1,121 +0,0 @@
Submitting Patch for PHP
========================
This document describes how to submit a patch for PHP. Since you are
reading this document, you are willing to submit a patch for PHP.
Please keep reading! Submitting a patch for PHP is easy. The hard
part is making it acceptable for inclusion into our repository. :-)
How to create patch?
--------------------
We are working with CVS. You need to get CVS source to create a patch
that we accept. Visit http://www.php.net/anoncvs.php to get CVS
source. You can check out older versions, but make sure you get
the default branch (i.e. Do not use -r option when you check out the
CVS source)
Read CODING_STANDARDS file before you start working.
Now you are ready to create a patch. Modify source to fix a bug in PHP or
add a new feature to PHP. After you finished editing, please test your
patch. Read README.TESTING for testing.
After you finish testing your patch, take diff file using
"cvs diff > your.patch" command.
Read README.TESTING for submitting a test script for your patch. This is
not strictly required, but it is preferred to submit a test script along
with your patch. Making new test script is very easy. It also helps us
to understand what you have been fixed or added to PHP.
Tips for creating patch
-----------------------
If you would like to fix multiple bugs. It is easier for us if you
could create 1 patch for 1 bug, but this is not strictly required.
Note though that you might get little response, if your patch is
too hard to review.
If you would like change/add many lines, it is better to ask module
maintainer and/or php-dev@lists.php.net, or pear-dev@lists.php.net if
you are patching PEAR. Official module maintainers can be found in
EXTENSIONS file in PHP source.
If you are new to CVS (Concurrent Versions System), visit
http://cvshome.org/ for details.
Recommended CVS client settings for creating patch file
------------------------------------------------------
Recommended ~/.cvsrc file setting is:
------
cvs -z3
update -d -P
checkout -P
diff -u
------
diff -u means:
-u Use the unified output format.
With this CVS setting, you don't have to worry about adding/deleting
newlines and spaces.
Check list for submitting patch
-------------------------------
- Did you run "make test" to check if your patch didn't break
other features?
- Did you compile PHP with --enable-debug and check php/webserver
error logs when you test your patch?
- Did you build PHP for multi-threaded web servers. (Optional)
- Did you create test script for "make test"? (Recommended)
- Did you check your patch is unified format and it does not
contain white space changes? (If you are not using recommended
cvs setting)
- Did you update CVS source before you take final patch?
- Did you read the patch again?
Where to send your patch?
-------------------------
If you are patching C source, send the patch to php-dev@lists.php.net.
If you are patching a module, you should also send the patch to the
maintainer. Official module maintainers are listed in EXTENSION file
in source.
If you are patching PEAR, send the patch to pear-dev@lists.php.net.
Please add the prefix "[PATCH]" to your email subject and make sure
to include the patch as a MIME attachment even if it is short.
Test scripts should be included in the same email.
Explain what has been fixed/added/changed by your patch.
Finally, add the bug Id(s) which can be closed by your patch, if any.
What happens after you submit your patch
--------------------------------------
If your patch is easy to review and has obviously no side-effects,
it might take up to a few hours until someone commits it.
Because this is a volunteer-driven effort, more complex patches will
require more patience on your side.
If you did not receive any feedback in a few days, please consider
resubmitting the description of your patch, along-side with
these questions:
- Is my patch too hard to review? Because of which factors?
- Should I split it up in multiple parts?
- Are there any unwanted whitespace changes?
What happens when your patch is applied?
----------------------------------------
Your name will be included together with your email address in the CVS
commit log. If your patch affects end-users, a brief description
and your name might be added to the NEWS file.
Thank you for submitting patch for PHP!
-175
View File
@@ -1,175 +0,0 @@
[IMPORTANT NOTICE]
------------------
Do _not_ ask to developers why some or all tests are failed under
your environment! Let us know if you find why it fails. Thank you.
[Testing Basics]
----------------
To execute test scripts, you must build PHP with some SAPI, then you
type "make test" to execute all or some test scripts saved under
"tests" directory under source root directory.
Usage:
make test
"make test" basically executes "run-tests.php" script
under source root. Therefore you can execute the script
as follows
./sapi/cli/php -c /path/to/php.ini/ run-tests.php [ext/some_extension_name]
[Which "php" executable "make test" look for]
---------------------------------------------
"make test" executes "run-tests.php" script with "php" binary. Some
test scripts such as session must be executed by CGI SAPI. Therefore,
you must build PHP with CGI SAPI to perform all tests.
If PHP is not build with CGI SAPI, "run-tests.php" script uses CLI
SAPI. Tests that may not executed by CLI SAPI will be skipped.
NOTE: PHP binary executing "run-tests.php" and php binary used for
executing test scripts may differ. If you use different PHP binary for
executing "run-tests.php" script, you may get errors.
[Which php.ini is used]
-----------------------
"make test" force to use php.ini-dist as default config file. If
you would like to test with other configuration file, user
"run-tests.php" script.
Example:
./sapi/cli/php -c /path/to/php.ini/ ext/standard
If you use php.ini other than php.ini-dist, you may see more failed
tests.
[Which test scripts are executed]
---------------------------------
"run-tests.php" ("make test") executes all test scripts by default
by looking all directory named "tests". If there are files have "phpt"
extension, "run-tests.php" takes test php code from the file and
executes it.
Tester can easily executes tests selectively with as follows.
Example:
./sapi/cli/php -c /path/to/php.ini/ run-tests.php ext/mbstring
[Test results]
--------------
Test results are printed to standard output. If there is a failed test,
"run-tests.php" script saves the result, expected result and code
executed to the test script directory. For example, if
ext/myext/tests/myext.phpt is failed to pass, following files are
created:
ext/myext/tests/myext.out - output from test script
ext/myext/tests/myext.exp - expected output
ext/myext/tests/myext.php - test script executed
Tester can verify these files, if failed test is actually a bug
or not.
[Creating new test files]
-------------------------
Writing test file is very easy if you are used to PHP. Test file
has following format. Here is a actual test file from iconv module.
===== ext/iconv/002.phpt =======
--TEST--
UCS4BE to ASCII
--SKIPIF--
<?php include('skipif.inc'); ?>
--POST--
--GET--
--FILE--
<?php include('002.inc'); ?>
--EXPECT--
&#97;&#98;&#99;&#100;
abcd
===== end of ext/iconv/002.phpt =======
"--TEST--" is title of the test.
"--SKIPIF--" is condition when to skip this test.
"--POST--" is POST variable passed to test script.
"--GET--" is GET variable passed to test script.
"--FILE--" is the test script.
"--EXPECT--" is the expected output from the test script.
ext/iconv/002.phpt uses 2 files. "skipif.inc" is used to skip
test when test cannot be performed such as iconv module is not
compiled or loaded.
==== ext/iconv/skipif.inc ====
<?php
// This script prints "skip" if condition does not meet.
if (!extension_loaded("iconv") && ini_get("enable_dl")) {
$dlext = (substr(PHP_OS, 0, 3) == "WIN") ? ".dll" : ".so";
@dl("iconv$dlext");
}
if (!extension_loaded("iconv")) {
die("skip\n");
}
?>
==== end of ext/iconv/skipif.inc ====
ext/inconv/002.inc is the test script. "run-tests.php" script
executes test script with CGI executable.
==== ext/iconv/002.inc ===
<?php
/*
Expected output:
&#97;&#98;&#99;&#100;
abcd
*/
$s = unpack("V*", iconv("ascii","UCS-4LE", "abcd"));
foreach($s as $c) { print "&#$c;"; } print "\n";
$s = pack("NNNN", 97, 98, 99, 100);
$q = iconv("UCS-4BE", "ascii", $s);
print $q; print "\n";
?>
=== end of ext/iconv/002.inc ===
Test script and skipif code may be directly write into *.phpt.
However, it is recommended to use other files for ease of writing
test script. For instance, you can execute test script under
ext/iconv as follows:
./sapi/cli/php -c /path/to/php.ini/ ext/iconv
[How to help us]
----------------
If you find bug in PHP, you can submit bug report AND test script
for us. You don't have to write complete script, just give us test
script with following format. Please test the script and make sure
you write the correct ACTUAL OUTPUT and EXPECTED OUTPUT before you
submit.
<?php
/*
Bug #12345
substr() bug. Do not return expected string.
ACTUAL OUTPUT
XYXA
EXPECTED OUTPUT
ABCD
*/
$str = "XYZABCD";
echo substr($str,3,7);
?>
-123
View File
@@ -1,123 +0,0 @@
PHP Build System V5 Overview
- supports Makefile.ins during transition phase
- not-really-portable Makefile includes have been eliminated
- supports seperate build directories without VPATH by using
explicit rules only
- does not waste disk-space/CPU-time for building temporary libraries
=> especially noticeable on slower systems
- slow recursive make replaced with one global Makefile
- eases integration of proper dependencies
- adds PHP_DEFINE(what[, value]) which creates a single include-file
per what. This will allow more fine-grained dependencies.
- abandoning the "one library per directory" concept
- improved integration of the CLI
- several new targets
build-modules: builds and copies dynamic modules into modules/
install-cli: installs the CLI only, so that the install-sapi
target does only what its name says
- finally abandoned automake (still requires aclocal at this time)
- changed some configure-time constructs to run at buildconf-time
- upgraded shtool to 1.5.4
- removed $(moduledir) (use EXTENSION_DIR)
The Reason For a New System
It became more and more apparent that there is a severe need
for addressing the portability concerns and improving the chance
that your build is correct (how often have you been told to
"make clean"? When this is done, you won't need to anymore).
If You Build PHP on a Unix System
You, as a user of PHP, will notice no changes. Of course, the build
system will be faster, look better and work smarter.
If You Are Developing PHP
Extension developers:
Makefile.ins are abandoned. The files which are to be compiled
are specified in the config.m4 now using the following macro:
PHP_NEW_EXTENSION(foo, foo.c bar.c baz.cpp, $ext_shared)
E.g. this enables the extension foo which consists of three source-code
modules, two in C and one in C++. And dependending on the user's
wishes, the extension will even be built as a dynamic module.
The full syntax:
PHP_NEW_EXTENSION(extname, sources [, shared [,sapi_class[, extra-cflags]]])
Please have a look at acinclude.m4 for the gory details and meanings
of the other parameters.
And that's basically it for the extension side.
If you previously built sub-libraries for this module, add
the source-code files here as well. If you need to specify
separate include directories, do it this way:
PHP_NEW_EXTENSION(foo, foo.c mylib/bar.c mylib/gregor.c,,,-I@ext_srcdir@/lib)
E.g. this builds the three files which are located relative to the
extension source directory and compiles all three files with the
special include directive (@ext_srcdir@ is automatically replaced).
Now, you need to tell the build system that you want to build files
in a directory called $ext_builddir/lib:
PHP_ADD_BUILD_DIR($ext_builddir/lib)
Make sure to call this after PHP_NEW_EXTENSION, because $ext_builddir
is only set by the latter.
If you have a complex extension, you might to need add special
Make rules. You can do this by calling PHP_ADD_MAKEFILE_FRAGMENT
in your config.m4 after PHP_NEW_EXTENSION.
This will read a file in the source-dir of your extension called
Makefile.frag. In this file, $(builddir) and $(srcdir) will be
replaced by the values which are correct for your extension
and which are again determined by the PHP_NEW_EXTENSION macro.
Make sure to prefix *all* relative paths correctly with either
$(builddir) or $(srcdir). Because the build system does not
change the working directory anymore, we must use either
absolute paths or relative ones to the top build-directory.
Correct prefixing ensures that.
SAPI developers:
Instead of using PHP_SAPI=foo/PHP_BUILD_XYZ, you will need to type
PHP_SELECT_SAPI(name, type, sources.c)
I.e. specify the source-code files as above and also pass the
information regarding how PHP is supposed to be built (shared
module, program, etc).
For example for APXS:
PHP_SELECT_SAPI(apache, shared, sapi_apache.c mod_php4.c php_apache.c)
General info
The foundation for the new system is the flexible handling of
sources and their contexts. With the help of macros you
can define special flags for each source-file, where it is
located, in which target context it can work, etc.
Have a look at the well documented macros
PHP_ADD_SOURCES(_X) in acinclude.m4.
+186
View File
@@ -0,0 +1,186 @@
Advisory on the PHP Release Cycle
Copyright & Liciencing
This Document is (c) Copyright 2000,2001 by The PHP Group
This Document is distributed under the terms of the GNU General
Public License as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later
version.
Table of Contents
1. Introduction
2. Dealing with bugs
2.1 As a QA Team Member
2.2 As a Developer
3. Releaseing another RC
4. CVS During the Release Process
4.1 Useful CVS Commands
5 The Final Release
6 Summary
1. Introduction
This cycle should take place over roughly 10 days. When it is
decided it is time for an Release to occur Andi/Zeev (Or
Whoever) will tarball RC1, Tag & Branch CVS (see section 4)
and then announce the RC on PHP-QA and PHP-DEV. At this
point the build tracker and QA Bug System come into play.
If you successfully build PHP then report it in the build
tracker, If you then run and complete all the tests you
should report this too in the build tracker when
these features become avalible.
2. Dealing with Bugs
2.1 As a QA Team member
If you find a bug in an RC that you think is a showstopper
then, even if it is a known bug, you should report it in the
QA Bug system. This marks the bug for discussion at least,
and preferably fixing before the actual release. This system
is separate from the main bugs system so that important bugs
dont get lost in the midst if lots of feature/change request
in the approach to a release. It is imperitive where
appropraite that as a QA'er a test script, Configure options
and PHP.ini files are provided to enable the developer to
reproduce the bug, this is an important part of our job. If
you have a serious bug then you should also create a test
script to be added to the tests dir of the php source so
that at the end of the process to enable us to make sure bug
does not return. It is not difficult to create these test
scripts and a readme on it can be found in
php4/tests/README.
2.2 As a Developer
What should happen is that when a bug is reported it
is send to php-dev and php-qa as with other bugs. We should
have far stricter assignment system in this bug cycle rather
than just leaving them. Once again bugs should be able to be
marked as To Be Fixed Before release or moved to other bug
system. (This is currently the Release Masters responsibility)
Then before the actual release the qa bugs system can be
checked and if there are outstanding To Be Fixed Before
release bugs the Developers can see this easyly rather than
show stoppers being dismissed and not worried about.
When a bug is fixed the QAer who reported the bug is emailed
and asked to test again and see if the bug is fixed.
3 Releasing another RC
If it is felt necessary that a 2nd RC is needed then it
should be packaged as before and announced to both lists
again. The testing process then starts again, the RC2 is
added to the build tracker and QA'ers are asked to build and
retest the scripts as appropriate, espectially if you
reported a bug, you should test thourghly for your
bug and make sure it no longer occurs. This will normally
add anouther 3 days to the cycle, giving QA'ers time to
build test and report back, then for developers to
fix any problems.
4 CVS during the release process
At the point where the first RC is create a branch is
formed. This branch is not altered form that point onward
other than major bug fixes. Minor non important bug
fixes should not be applied to this branch but to the main
tree instead. Any major bug fixes should be applied to both
trees. The developer should test and check the RC tree then
also test and check the MAIN tree. This is their
responsibility to make sure (as far as possible) that the
bug fix works on both trees.
4.1 Useful CVS Commands
To create a Branch <Should only be done by person tarballing
the RC (The Release Master)>:
$ cvs tag -b php_4_0_<Version>RC<NUMBER>
IE:
$ cvs tag -b php_4_0_1RC1
This should be executed in the PHP directory of an up to
date checkout. Remember to also tag the Zend and TSRM repositories.
You can retrieve a branch in one of two ways: by checking it
out fresh from the repository, or by switching an existing
working copy over to the branch, I would suggest you
checkout a new copy.
To check out a new copy:
$ cvs checkout -r php_4_0_<Version>RC<NUMBER> php4
IE:
$ cvs checkout -r php_4_0_1RC1 php4
To switch a working copy (Not recomended due to possible
commiting to wrong branch)
$ cvs update -r php_4_0_<Version>RC<NUMBER> php4
IE:
$ cvs update -r php_4_0_1RC1 php4
This should be done in the PHP4 directory itself.
To revert back to normal branch you should use the
following:
$ cvs update -A
To Commit to the branch you follow exactly the same
procedure as normal
$ cvs commit file.c
MAKE SURE YOU DO NOT COMMIT TO THE WRONG BRANCH.
5 The Final Release
When it is time to make the final release the following
proceedure should be followed. The person who is tarballing
the final release should check the QA bugs system and make
sure there are no showstoppers left unfixed. If there are
then bug the person the bug is assigned to until they fix
it. If there are no more qa bugs then they should tag the
branch as php_4_0_<Version> and tarball as usual. An email
should be sent to PHP-GEN, PHP_DEV and PHP-QA about the new
release and it should be added to php.net. The windows
binaries and servelets should be built as soon as possible
and added too, as should the windows installer.
6 Summary
Here is a summary of what a release cycle might look like:
Thurs: RC is agreed on and packaged, an email is sent to
PHP_QA and PHP-DEV, the CVS is Branched and the
Release Cycle Begins.
Mon: After a weekends testing most show stoppers should
have been found (Hopefully) and the developers get to
work on fixing them.
Thurs: A second RC is released if needed with the new bug
fixes in and the QAers test again.
Sun: A review is made of all outstanding bugs and any show
stoppers should be fixed. if there are no show
stoppers then the final release is packaged and
released on the monday morning on php.net
Mon: Release is made.
James
--
James Moore
PHP QA Team
jmoore@php.net
+16 -16
View File
@@ -22,6 +22,8 @@ Zend
* Const'ify APIs. Right now, many functions leave parameters untouched,
but don't declare those as const. This makes interaction with other
interfaces difficult which pass const parameters to us.
* Add try..catch/throw exception handling.
* Fix Zend shallow copy issues with objects and arrays.
global
@@ -41,6 +43,10 @@ global
* on some platforms unimplemented function will just do nothing
(e.g. symlink) they should print a warning or not even be defined!
(DONE ?)
* Finish PHP streams abstraction, nuke all that issock stuff, implement SSL
socket support. (wez)
- ext/ftp/ -> all FILEs to streams
- ext/bz2/ -> convert to stream impl.
* Use arg_separator.input to implode args in the CGI sapi extension
and arg_separator.input to explode in php_build_argv(). (DONE?)
* Change the odbc_fetch_into() function to require ALWAYS the first two
@@ -81,16 +87,10 @@ documentation
* Add developer documentation.
* Add detailed documentation for Java extension.
ext/bz2
-------
* Add ini setting for decompression buffer size. The default 4k is to small
for big files and takes ages to decompress. However, 40k which perform
quite good with big files may be to much under certain environments as
default setting. There should be consideren different default sizes for
different SAPIS (e.g. apache and cli).
ext/curl
--------
* Use the cURL write handler to save data for use when returning data or
outputting data.
* Have a warning scheme for when people use unsupported features.
ext/oci8
@@ -105,12 +105,6 @@ ext/pcre
--------
* Allow user to set PCRE_NOTEMPTY, PCRE_ANCHORED at execution time, maybe
ext/pcntl
---------
* Change internal callback handler to use TICKS
* Remove all zend_extension code
* Add object callback support to pcntl_signal()
ext/pgsql
---------
For PHP 4.3.0:
@@ -135,8 +129,8 @@ ext/session
ext/sockets
-----------
* Implement IPv6
* Review/Fix vectors
* Make the extension work on windows (Daniel Beulshausen)
* Make the extension work with Solaris and the Sun GCC
ext/standard
------------
@@ -153,6 +147,12 @@ ext/standard
strrpos()
strrchr()
strip_tags()
* Rewrite win32 SMTP code to be usable for *ix to, maybe as a (default)
module of its own (Hartmut)
ext/zziplib
------------
* More fully support the zziplib API
ext/wddx
--------
-3
View File
@@ -1,3 +0,0 @@
- clean up .cvsignores
- purge Makefile.ins and replace PHP_EXTENSION in config.m4s
with appropiate calls to PHP_NEW_EXTENSION
-15
View File
@@ -412,8 +412,6 @@ TSRM_API THREAD_T tsrm_thread_id(void)
{
#ifdef TSRM_WIN32
return GetCurrentThreadId();
#elif defined(NETWARE)
return NXThreadGetId();
#elif defined(GNUPTH)
return pth_self();
#elif defined(PTHREADS)
@@ -432,17 +430,10 @@ TSRM_API THREAD_T tsrm_thread_id(void)
TSRM_API MUTEX_T tsrm_mutex_alloc(void)
{
MUTEX_T mutexp;
#ifdef NETWARE
long flags = 0; /* Don't require NX_MUTEX_RECURSIVE, I guess */
NXHierarchy_t order = 0;
NX_LOCK_INFO_ALLOC (lockInfo, "PHP-TSRM", 0);
#endif
#ifdef TSRM_WIN32
mutexp = malloc(sizeof(CRITICAL_SECTION));
InitializeCriticalSection(mutexp);
#elif defined(NETWARE)
mutexp = NXMutexAlloc(flags, order, &lockInfo); /* return value ignored for now */
#elif defined(GNUPTH)
mutexp = (MUTEX_T) malloc(sizeof(*mutexp));
pth_mutex_init(mutexp);
@@ -469,8 +460,6 @@ TSRM_API void tsrm_mutex_free(MUTEX_T mutexp)
if (mutexp) {
#ifdef TSRM_WIN32
DeleteCriticalSection(mutexp);
#elif defined(NETWARE)
NXMutexFree(mutexp);
#elif defined(GNUPTH)
free(mutexp);
#elif defined(PTHREADS)
@@ -497,8 +486,6 @@ TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp)
#ifdef TSRM_WIN32
EnterCriticalSection(mutexp);
return 1;
#elif defined(NETWARE)
return NXLock(mutexp);
#elif defined(GNUPTH)
return pth_mutex_acquire(mutexp, 0, NULL);
#elif defined(PTHREADS)
@@ -520,8 +507,6 @@ TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp)
#ifdef TSRM_WIN32
LeaveCriticalSection(mutexp);
return 1;
#elif defined(NETWARE)
return NXUnlock(mutexp);
#elif defined(GNUPTH)
return pth_mutex_release(mutexp);
#elif defined(PTHREADS)
+1 -8
View File
@@ -13,8 +13,7 @@
#ifndef TSRM_H
#define TSRM_H
/* #ifndef WIN32 */
#if !defined(WIN32) && !defined(NETWARE)
#ifdef HAVE_CONFIG_H
# include "tsrm_config.h"
#endif
@@ -37,9 +36,6 @@
#ifdef TSRM_WIN32
# include <windows.h>
#elif defined(NETWARE)
# include <nks/thread.h>
# include <nks/synch.h>
#elif defined(GNUPTH)
# include <pth.h>
#elif defined(PTHREADS)
@@ -54,9 +50,6 @@ typedef int ts_rsrc_id;
#ifdef TSRM_WIN32
# define THREAD_T DWORD
# define MUTEX_T CRITICAL_SECTION *
#elif defined(NETWARE)
# define THREAD_T NXThreadId_t
# define MUTEX_T NXMutex_t *
#elif defined(GNUPTH)
# define THREAD_T pth_t
# define MUTEX_T pth_mutex_t *
-9
View File
@@ -1,9 +0,0 @@
#ifndef TSRM_CONFIG_NW_H
#define TSRM_CONFIG_NW_H
#define HAVE_UTIME 1
/* Though we have alloca(), this seems to be causing some problem with the stack pointer -- hence not using it */
/* #define HAVE_ALLOCA 1 */
#endif
+3 -5
View File
@@ -5,13 +5,11 @@
# define TSRM_WIN32
#endif
#ifdef TSRM_WIN32
# include "tsrm_config.w32.h"
#elif defined(NETWARE)
# include "tsrm_config.nw.h"
#else
#ifndef TSRM_WIN32
# include "tsrm_config.h"
# include <sys/param.h>
#else
# include "tsrm_config.w32.h"
#endif
#ifdef TSRM_WIN32
-260
View File
@@ -1,260 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.php.net/license/2_02.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Venkat Raghavan S <rvenkat@novell.com> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include "TSRM.h"
#ifdef NETWARE
#ifdef USE_MKFIFO
#include <sys/stat.h>
#elif !defined(USE_PIPE_OPEN) /* NXFifoOpen */
#include <nks/fsio.h>
#endif
#include <nks/vm.h>
#include <nks/memory.h>
#include <string.h>
#include "mktemp.h"
/* strtok() call in LibC is abending when used in a different address space -- hence using
PHP's version itself for now : Venkat (30/4/02) */
#include "tsrm_strtok_r.h"
#define tsrm_strtok_r(a,b,c) strtok((a),(b))
#define WHITESPACE " \t"
#define MAX_ARGS 10
TSRM_API FILE* popen(const char *commandline, const char *type)
{
char *command = NULL, *argv[MAX_ARGS] = {'\0'}, **env = NULL;
char *tempName = "sys:/php/temp/phpXXXXXX.tmp";
char *filePath = NULL;
char *ptr = NULL;
int ptrLen = 0, argc = 0, i = 0, envCount = 0, err = 0;
FILE *stream = NULL;
#if defined(USE_PIPE_OPEN) || defined(USE_MKFIFO)
int pipe_handle;
int mode = O_RDONLY;
#else
NXHandle_t pipe_handle;
NXMode_t mode = NX_O_RDONLY;
#endif
NXExecEnvSpec_t envSpec;
NXNameSpec_t nameSpec;
NXVmId_t newVM = 0;
/* Check for validity of input parameters */
if (!commandline || !type)
return NULL;
/* Get temporary file name */
filePath = mktemp(tempName);
/*consoleprintf ("PHP | popen: file path = %s, mode = %s\n", filePath, type);*/
if (!filePath)
return NULL;
/* Set pipe mode according to type -- for now allow only "r" or "w" */
if (strcmp(type, "r") == 0)
#if defined(USE_PIPE_OPEN) || defined(USE_MKFIFO)
mode = O_RDONLY;
#else
mode = NX_O_RDONLY;
#endif
else if (strcmp(type, "w") == 0)
#if defined(USE_PIPE_OPEN) || defined(USE_MKFIFO)
mode = O_WRONLY;
#else
mode = NX_O_WRONLY;
#endif
else
return NULL;
#ifdef USE_PIPE_OPEN
pipe_handle = pipe_open(filePath, mode);
/*consoleprintf ("PHP | popen: pipe_open() returned %d\n", pipe_handle);*/
if (pipe_handle == -1)
return NULL;
#elif defined(USE_MKFIFO)
pipe_handle = mkfifo(filePath, mode);
consoleprintf ("PHP | popen: mkfifo() returned %d\n", pipe_handle);
if (pipe_handle == -1)
return NULL;
#else
/*
- NetWare doesn't require first parameter
- Allowing LibC to choose the buffer size for now
*/
err = NXFifoOpen(0, filePath, mode, 0, &pipe_handle);
/*consoleprintf ("PHP | popen: NXFifoOpen() returned %d\n", err);*/
if (err)
return NULL;
#endif
/* Copy the environment variables in preparation for the spawn call */
envCount = NXGetEnvCount() + 1; /* add one for NULL */
env = (char**)NXMemAlloc(sizeof(char*) * envCount, 0);
if (!env)
return NULL;
err = NXCopyEnv(env, envCount);
consoleprintf ("PHP | popen: NXCopyEnv() returned %d\n", err);
if (err)
{
NXMemFree (env);
return NULL;
}
/* Separate commandline string into words */
consoleprintf ("PHP | popen: commandline = %s\n", commandline);
ptr = tsrm_strtok_r((char*)commandline, WHITESPACE, NULL);
ptrLen = strlen(ptr);
command = (char*)malloc(ptrLen + 1);
if (!command)
{
NXMemFree (env);
return NULL;
}
strcpy (command, ptr);
ptr = tsrm_strtok_r(NULL, WHITESPACE, NULL);
while (ptr && (argc < MAX_ARGS))
{
ptrLen = strlen(ptr);
argv[argc] = (char*)malloc(ptrLen + 1);
if (!argv[argc])
{
NXMemFree (env);
if (command)
free (command);
for (i = 0; i < argc; i++)
{
if (argv[i])
free (argv[i]);
}
return NULL;
}
strcpy (argv[argc], ptr);
argc++;
ptr = tsrm_strtok_r(NULL, WHITESPACE, NULL);
}
consoleprintf ("PHP | popen: commandline string parsed into tokens\n");
/* Setup the execution environment and spawn new process */
envSpec.esFlags = 0; /* Not used */
envSpec.esArgc = argc;
envSpec.esArgv = (void**)argv;
envSpec.esEnv = (void**)env;
envSpec.esStdin.ssType =
envSpec.esStdout.ssType = NX_OBJ_FIFO;
envSpec.esStderr.ssType = NX_OBJ_FILE;
/*
envSpec.esStdin.ssHandle =
envSpec.esStdout.ssHandle =
envSpec.esStderr.ssHandle = -1;
*/
envSpec.esStdin.ssPathCtx =
envSpec.esStdout.ssPathCtx =
envSpec.esStderr.ssPathCtx = NULL;
#if defined(USE_PIPE_OPEN) || defined(USE_MKFIFO)
if (mode == O_RDONLY)
#else
if (mode == NX_O_RDONLY)
#endif
{
envSpec.esStdin.ssPath = filePath;
envSpec.esStdout.ssPath = stdout;
}
else /* Write Only */
{
envSpec.esStdin.ssPath = stdin;
envSpec.esStdout.ssPath = filePath;
}
envSpec.esStderr.ssPath = stdout;
nameSpec.ssType = NX_OBJ_FIFO;
/* nameSpec.ssHandle = 0; */ /* Not used */
nameSpec.ssPathCtx = NULL; /* Not used */
nameSpec.ssPath = argv[0];
consoleprintf ("PHP | popen: environment setup\n");
err = NXVmSpawn(&nameSpec, &envSpec, 0, &newVM);
consoleprintf ("PHP | popen: NXVmSpawn() returned %d\n", err);
if (!err)
/* Get file pointer corresponding to the pipe (file) opened */
stream = fdopen(pipe_handle, type);
/* Clean-up */
if (env)
NXMemFree (env);
if (pipe_handle)
#if defined(USE_PIPE_OPEN) || defined(USE_MKFIFO)
close(pipe_handle);
#else
NXClose(pipe_handle);
#endif
if (command)
free (command);
for (i = 0; i < argc; i++)
{
if (argv[i])
free (argv[i]);
}
consoleprintf ("PHP | popen: all clean-up done, returning...\n");
return stream;
}
TSRM_API int pclose(FILE* stream)
{
int err = 0;
NXHandle_t fd = 0;
/* Get the process associated with this pipe (file) handle and terminate it */
fd = fileno(stream);
NXClose (fd);
err = fclose(stream);
return err;
}
#endif
-28
View File
@@ -1,28 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.php.net/license/2_02.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Venkat Raghavan S <rvenkat@novell.com> |
+----------------------------------------------------------------------+
*/
#ifndef TSRM_NW_H
#define TSRM_NW_H
#include "TSRM.h"
TSRM_API FILE* popen(const char *command, const char *type);
TSRM_API int pclose(FILE* stream);
#endif
+39 -128
View File
@@ -36,17 +36,12 @@
#include "tsrm_win32.h"
#endif
#ifdef NETWARE
/*#include "pipe.h"*/
#include "tsrm_nw.h"
#endif
#define VIRTUAL_CWD_DEBUG 0
#include "TSRM.h"
/* Only need mutex for popen() in Windows and NetWare, because it doesn't chdir() on UNIX */
#if (defined(TSRM_WIN32) || defined(NETWARE)) && defined(ZTS)
/* Only need mutex for popen() in Windows because it doesn't chdir() on UNIX */
#if defined(TSRM_WIN32) && defined(ZTS)
MUTEX_T cwd_mutex;
#endif
@@ -90,13 +85,6 @@ static int php_check_dots(const char *element, int n)
#define IS_DIRECTORY_CURRENT(element, len) \
(len == 1 && ptr[0] == '.')
#elif defined(NETWARE)
/* NetWare has strtok() (in LibC) and allows both slashes in paths, like Windows --
but rest of the stuff is like Unix */
/* strtok() call in LibC is abending when used in a different address space -- hence using
PHP's version itself for now */
/*#define tsrm_strtok_r(a,b,c) strtok((a),(b))*/
#define TOKENIZER_STRING "/\\"
#else
#define TOKENIZER_STRING "/"
@@ -133,15 +121,9 @@ static int php_check_dots(const char *element, int n)
static int php_is_dir_ok(const cwd_state *state)
{
#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH))
struct stat buf;
if (stat(state->cwd, &buf) == 0 && S_ISDIR(buf.st_mode))
#else
struct stat_libc buf;
if (stat(state->cwd, (struct stat*)(&buf)) == 0 && S_ISDIR(buf.st_mode))
#endif
return (0);
return (1);
@@ -149,15 +131,9 @@ static int php_is_dir_ok(const cwd_state *state)
static int php_is_file_ok(const cwd_state *state)
{
#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH))
struct stat buf;
if (stat(state->cwd, &buf) == 0 && S_ISREG(buf.st_mode))
#else
struct stat_libc buf;
if (stat(state->cwd, (struct stat*)(&buf)) == 0 && S_ISREG(buf.st_mode))
#endif
return (0);
return (1);
@@ -298,7 +274,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
if (path_length == 0)
return (0);
#if !defined(TSRM_WIN32) && !defined(__BEOS__) && !defined(NETWARE)
#if !defined(TSRM_WIN32) && !defined(__BEOS__)
if (IS_ABSOLUTE_PATH(path, path_length)) {
if (realpath(path, resolved_path)) {
path = resolved_path;
@@ -333,12 +309,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
fprintf(stderr,"cwd = %s path = %s\n", state->cwd, path);
#endif
if (IS_ABSOLUTE_PATH(path_copy, path_length)) {
/* COPY_WHEN_ABSOLUTE needs to account for volume name that is unique to NetWare absolute paths */
#ifndef NETWARE
copy_amount = COPY_WHEN_ABSOLUTE;
#else
copy_amount = COPY_WHEN_ABSOLUTE(path_copy);
#endif
is_absolute = 1;
#ifdef TSRM_WIN32
} else if (IS_UNC_PATH(path_copy, path_length)) {
@@ -393,15 +364,10 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
state->cwd = (char *) realloc(state->cwd, state->cwd_length+ptr_length+1+1);
#ifdef TSRM_WIN32
/* Windows 9x will consider C:\\Foo as a network path. Avoid it. */
if ((state->cwd[state->cwd_length-1]!='\\' && state->cwd[state->cwd_length-1]!='/') ||
if ((state->cwd[state->cwd_length-1]!='\\' && state->cwd[state->cwd_length-1]!='/') ||
IsDBCSLeadByte(state->cwd[state->cwd_length-2])) {
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
}
#elif defined(NETWARE)
/* If the token is a volume name, it will have colon at the end -- so, no slash before it */
if (ptr[ptr_length-1] != ':') {
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
}
#else
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
#endif
@@ -411,12 +377,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
ptr = tsrm_strtok_r(NULL, TOKENIZER_STRING, &tok);
}
/* COPY_WHEN_ABSOLUTE needs to account for volume name that is unique to NetWare absolute paths */
#ifndef NETWARE
if (state->cwd_length == COPY_WHEN_ABSOLUTE) {
#else
if (state->cwd_length == COPY_WHEN_ABSOLUTE(state->cwd)) {
#endif
state->cwd = (char *) realloc(state->cwd, state->cwd_length+1+1);
state->cwd[state->cwd_length] = DEFAULT_SLASH;
state->cwd[state->cwd_length+1] = '\0';
@@ -466,12 +427,7 @@ CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path
return -1;
}
/* COPY_WHEN_ABSOLUTE needs to account for volume name that is unique to NetWare absolute paths */
#ifndef NETWARE
if (length == COPY_WHEN_ABSOLUTE && IS_ABSOLUTE_PATH(path, length+1)) { /* Also use trailing slash if this is absolute */
#else
if (length == COPY_WHEN_ABSOLUTE(path) && IS_ABSOLUTE_PATH(path, length+1)) { /* Also use trailing slash if this is absolute */
#endif
length++;
}
temp = (char *) tsrm_do_alloca(length+1);
@@ -570,7 +526,7 @@ CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC)
return ret;
}
#if !defined(TSRM_WIN32) && !defined(NETWARE)
#ifndef TSRM_WIN32
CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group TSRMLS_DC)
{
cwd_state new_state;
@@ -646,7 +602,6 @@ CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC)
return retval;
}
#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH))
CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC)
{
cwd_state new_state;
@@ -660,23 +615,9 @@ CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC)
CWD_STATE_FREE(&new_state);
return retval;
}
#else
CWD_API int virtual_stat(const char *path, struct stat_libc *buf TSRMLS_DC)
{
cwd_state new_state;
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
virtual_file_ex(&new_state, path, NULL);
#ifndef TSRM_WIN32
retval = stat(new_state.cwd, (struct stat*)buf);
CWD_STATE_FREE(&new_state);
return retval;
}
#endif
#if !defined(TSRM_WIN32) && !defined(NETWARE)
CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC)
{
cwd_state new_state;
@@ -690,6 +631,7 @@ CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC)
CWD_STATE_FREE(&new_state);
return retval;
}
#endif
CWD_API int virtual_unlink(const char *path TSRMLS_DC)
@@ -755,69 +697,7 @@ CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC)
return retval;
}
#ifdef TSRM_WIN32
/* On Windows the trick of prepending "cd cwd; " doesn't work so we need to perform
a real chdir() and mutex it
*/
CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC)
{
char prev_cwd[MAXPATHLEN];
char *getcwd_result;
FILE *retval;
getcwd_result = getcwd(prev_cwd, MAXPATHLEN);
if (!getcwd_result) {
return NULL;
}
#ifdef ZTS
tsrm_mutex_lock(cwd_mutex);
#endif
chdir(CWDG(cwd).cwd);
retval = popen(command, type);
chdir(prev_cwd);
#ifdef ZTS
tsrm_mutex_unlock(cwd_mutex);
#endif
return retval;
}
#elif defined(NETWARE)
/* On NetWare, the trick of prepending "cd cwd; " doesn't work so we need to perform
a VCWD_CHDIR() and mutex it
*/
CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC)
{
char prev_cwd[MAXPATHLEN];
char *getcwd_result;
FILE *retval;
getcwd_result = VCWD_GETCWD(prev_cwd, MAXPATHLEN);
if (!getcwd_result) {
return NULL;
}
#ifdef ZTS
tsrm_mutex_lock(cwd_mutex);
#endif
VCWD_CHDIR(CWDG(cwd).cwd);
retval = popen(command, type);
VCWD_CHDIR(prev_cwd);
#ifdef ZTS
tsrm_mutex_unlock(cwd_mutex);
#endif
return retval;
}
#else /* Unix */
#ifndef TSRM_WIN32
CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC)
{
@@ -853,6 +733,37 @@ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC)
return retval;
}
#else
/* On Windows the trick of prepending "cd cwd; " doesn't work so we need to perform
a real chdir() and mutex it
*/
CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC)
{
char prev_cwd[MAXPATHLEN];
char *getcwd_result;
FILE *retval;
getcwd_result = getcwd(prev_cwd, MAXPATHLEN);
if (!getcwd_result) {
return NULL;
}
#ifdef ZTS
tsrm_mutex_lock(cwd_mutex);
#endif
chdir(CWDG(cwd).cwd);
retval = popen(command, type);
chdir(prev_cwd);
#ifdef ZTS
tsrm_mutex_unlock(cwd_mutex);
#endif
return retval;
}
#endif
+6 -23
View File
@@ -58,19 +58,6 @@ typedef unsigned short mode_t;
#define IS_UNC_PATH(path, len) \
(len >= 2 && IS_SLASH(path[0]) && IS_SLASH(path[1]))
#elif defined(NETWARE)
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif
#define DEFAULT_SLASH '/'
#define DEFAULT_DIR_SEPARATOR ';'
#define IS_SLASH(c) ((c) == '/' || (c) == '\\')
#define COPY_WHEN_ABSOLUTE(path) \
(strchr(path, ':') - path + 1) /* Take the volume name which ends with a colon */
#define IS_ABSOLUTE_PATH(path, len) \
(strchr(path, ':') != NULL) /* Colon indicates volume name */
#else
#ifdef HAVE_DIRENT_H
#include <dirent.h>
@@ -133,12 +120,8 @@ CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC);
CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...);
CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC);
CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC);
#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH))
CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC);
#else
CWD_API int virtual_stat(const char *path, struct stat_libc *buf TSRMLS_DC);
#endif
#if !defined(TSRM_WIN32) && !defined(NETWARE)
#ifndef TSRM_WIN32
CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC);
#endif
CWD_API int virtual_unlink(const char *path TSRMLS_DC);
@@ -150,7 +133,7 @@ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC);
CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC);
#endif
CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC);
#if !defined(TSRM_WIN32) && !defined(NETWARE)
#ifndef TSRM_WIN32
CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group TSRMLS_DC);
#endif
@@ -185,7 +168,7 @@ typedef struct _virtual_cwd_globals {
#define VCWD_REALPATH(path, real_path) virtual_realpath(path, real_path TSRMLS_CC)
#define VCWD_RENAME(oldname, newname) virtual_rename(oldname, newname TSRMLS_CC)
#define VCWD_STAT(path, buff) virtual_stat(path, buff TSRMLS_CC)
#if !defined(TSRM_WIN32) && !defined(NETWARE)
#ifdef TSRM_WIN32
#define VCWD_LSTAT(path, buff) virtual_stat(path, buff TSRMLS_CC)
#else
#define VCWD_LSTAT(path, buff) virtual_lstat(path, buff TSRMLS_CC)
@@ -199,7 +182,7 @@ typedef struct _virtual_cwd_globals {
#define VCWD_UTIME(path, time) virtual_utime(path, time TSRMLS_CC)
#endif
#define VCWD_CHMOD(path, mode) virtual_chmod(path, mode TSRMLS_CC)
#if !defined(TSRM_WIN32) && !defined(NETWARE)
#ifndef TSRM_WIN32
#define VCWD_CHOWN(path, owner, group) virtual_chown(path, owner, group TSRMLS_CC)
#endif
@@ -222,7 +205,7 @@ typedef struct _virtual_cwd_globals {
#define VCWD_OPENDIR(pathname) opendir(pathname)
#define VCWD_POPEN(command, type) popen(command, type)
#if !defined(TSRM_WIN32) && !defined(NETWARE)
#ifndef TSRM_WIN32
#define VCWD_REALPATH(path, real_path) realpath(path, real_path)
#else
#define VCWD_REALPATH(path, real_path) strcpy(real_path, path)
@@ -232,7 +215,7 @@ typedef struct _virtual_cwd_globals {
#define VCWD_UTIME(path, time) utime(path, time)
#endif
#define VCWD_CHMOD(path, mode) chmod(path, mode)
#if !defined(TSRM_WIN32) && !defined(NETWARE)
#ifndef TSRM_WIN32
#define VCWD_CHOWN(path, owner, group) chown(path, owner, group)
#endif
+158 -350
View File
@@ -2,140 +2,7 @@ dnl $Id$
dnl
dnl This file contains local autoconf functions.
dnl PHP_ADD_MAKEFILE_FRAGMENT([srcfile[, ext_srcdir[, ext_builddir]]])
dnl
dnl Processes a file called Makefile.frag in the source directory
dnl of the most recently added extension. $(srcdir) and $(builddir)
dnl are substituted with the proper paths. Can be used to supply
dnl custom rules and/or additional targets.
dnl
AC_DEFUN(PHP_ADD_MAKEFILE_FRAGMENT,[
ifelse($1,,src=$ext_srcdir/Makefile.frag,src=$1)
ifelse($2,,ac_srcdir=$ext_srcdir,ac_srcdir=$2)
ifelse($3,,ac_builddir=$ext_builddir,ac_builddir=$3)
sed -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src >> Makefile.fragments
])
dnl PHP_DEFINE(WHAT[, value])
dnl
dnl Creates builddir/include/what.h and in there #define WHAT value
dnl
AC_DEFUN(PHP_DEFINE,[
[echo "#define ]$1[]ifelse([$2],,[ 1],[ $2])[" > include/php_]translit($1,A-Z,a-z)[.h]
])
dnl PHP_INIT_BUILD_SYSTEM
dnl
AC_DEFUN(PHP_INIT_BUILD_SYSTEM,[
mkdir include >/dev/null 2>&1
> Makefile.objects
> Makefile.fragments
dnl We need to play tricks here to avoid matching the egrep line itself
pattern=define
egrep $pattern'.*include/php' $srcdir/configure|sed 's/.*>//'|xargs touch 2>/dev/null
])
dnl PHP_GEN_GLOBAL_MAKEFILE
dnl
dnl Generates the global makefile.
dnl
AC_DEFUN(PHP_GEN_GLOBAL_MAKEFILE,[
cat >Makefile <<EOF
srcdir = $abs_srcdir
builddir = $abs_builddir
top_srcdir = $abs_srcdir
top_builddir = $abs_builddir
EOF
for i in $PHP_VAR_SUBST; do
eval echo "$i = \$$i" >> Makefile
done
cat $abs_srcdir/Makefile.global Makefile.fragments Makefile.objects >> Makefile
])
dnl PHP_ADD_SOURCES(source-path, sources[, special-flags[, type]])
dnl
dnl Adds sources which are located relative to source-path to the
dnl array of type type. Sources are processed with optional
dnl special-flags which are passed to the compiler. Sources
dnl can be either written in C or C++ (filenames shall end in .c
dnl or .cpp, respectively).
dnl
dnl Note: If source-path begins with a "/", the "/" is removed and
dnl the path is interpreted relative to the top build-directory.
dnl
dnl which array to append to?
AC_DEFUN(PHP_ADD_SOURCES,[
PHP_ADD_SOURCES_X($1, $2, $3, ifelse($4,cli,PHP_CLI_OBJS,ifelse($4,sapi,PHP_SAPI_OBJS,PHP_GLOBAL_OBJS)))
])
dnl
dnl PHP_ASSIGN_BUILD_VARS(type)
dnl internal, don't use
AC_DEFUN(PHP_ASSIGN_BUILD_VARS,[
ifelse($1,shared,[
b_c_pre=$shared_c_pre
b_cxx_pre=$shared_cxx_pre
b_c_meta=$shared_c_meta
b_cxx_meta=$shared_cxx_meta
b_c_post=$shared_c_post
b_cxx_post=$shared_cxx_post
],[
b_c_pre=$php_c_pre
b_cxx_pre=$php_cxx_pre
b_c_meta=$php_c_meta
b_cxx_meta=$php_cxx_meta
b_c_post=$php_c_post
b_cxx_post=$php_cxx_post
])dnl
b_lo=[$]$1_lo
])
dnl PHP_ADD_SOURCES_X(source-path, sources[, special-flags[, target-var[, shared[, special-post-flags]]]])
dnl
dnl Additional to PHP_ADD_SOURCES (see above), this lets you set the
dnl name of the array target-var directly, as well as whether
dnl shared objects will be built from the sources. Should not be
dnl used directly.
dnl
AC_DEFUN(PHP_ADD_SOURCES_X,[
dnl relative to source- or build-directory?
dnl ac_srcdir/ac_bdir include trailing slash
case $1 in
""[)] ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
/*[)] ac_srcdir=`echo $ac_n "$1$ac_c"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
*[)] ac_srcdir="$abs_srcdir/$1/"; ac_bdir="$1/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
esac
dnl how to build .. shared or static?
ifelse($5,yes,PHP_ASSIGN_BUILD_VARS(shared),PHP_ASSIGN_BUILD_VARS(php))
dnl iterate over the sources
old_IFS=[$]IFS
for ac_src in $2; do
dnl remove the suffix
IFS=.
set $ac_src
ac_obj=[$]1
IFS=$old_IFS
dnl append to the array which has been dynamically chosen at m4 time
$4="[$]$4 [$]ac_bdir[$]ac_obj.lo"
dnl choose the right compiler/flags/etc. for the source-file
case $ac_src in
*.c[)] ac_comp="$b_c_pre $3 $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_c_post" ;;
*.cpp[)] ac_comp="$b_cxx_pre $3 $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_cxx_post" ;;
esac
dnl create a rule for the object/source combo
cat >>Makefile.objects<<EOF
$ac_bdir[$]ac_obj.lo: $ac_srcdir[$]ac_src
$ac_comp
EOF
done
])
sinclude(dynlib.m4)
dnl
dnl Disable building CLI
@@ -185,35 +52,29 @@ AC_DEFUN(PHP_REMOVE_USR_LIB,[
])
AC_DEFUN(PHP_SETUP_OPENSSL,[
if test "$PHP_OPENSSL" = "yes"; then
if test "$PHP_OPENSSL" = "no"; then
PHP_OPENSSL="/usr/local/ssl /usr/local /usr /usr/local/openssl"
fi
for i in $PHP_OPENSSL; do
if test -r $i/include/openssl/evp.h; then
OPENSSL_INCDIR=$i/include
fi
if test -r $i/lib/libssl.a -o -r $i/lib/libssl.$SHLIB_SUFFIX_NAME; then
OPENSSL_LIBDIR=$i/lib
OPENSSL_DIR=$i
OPENSSL_INC=$i/include
fi
done
if test -z "$OPENSSL_INCDIR"; then
if test -z "$OPENSSL_DIR"; then
AC_MSG_ERROR([Cannot find OpenSSL's <evp.h>])
fi
if test -z "$OPENSSL_LIBDIR"; then
AC_MSG_ERROR([Cannot find OpenSSL's libraries])
fi
old_CPPFLAGS=$CPPFLAGS
CPPFLAGS=-I$OPENSSL_INCDIR
CPPFLAGS=-I$OPENSSL_INC
AC_MSG_CHECKING([for OpenSSL version])
AC_EGREP_CPP(yes,[
#include <openssl/opensslv.h>
#if OPENSSL_VERSION_NUMBER >= 0x0090500fL
#include <openssl/opensslv.h>
#if OPENSSL_VERSION_NUMBER >= 0x0090500fL
yes
#endif
#endif
],[
AC_MSG_RESULT([>= 0.9.5])
],[
@@ -221,27 +82,20 @@ AC_DEFUN(PHP_SETUP_OPENSSL,[
])
CPPFLAGS=$old_CPPFLAGS
PHP_ADD_INCLUDE($OPENSSL_INCDIR)
PHP_ADD_LIBPATH($OPENSSL_LIBDIR)
PHP_ADD_LIBPATH($OPENSSL_DIR/lib)
PHP_CHECK_LIBRARY(crypto, CRYPTO_free, [
AC_CHECK_LIB(crypto, CRYPTO_free, [
PHP_ADD_LIBRARY(crypto)
],[
AC_MSG_ERROR([libcrypto not found!])
],[
-L$OPENSSL_LIBDIR
])
PHP_CHECK_LIBRARY(ssl, SSL_CTX_set_ssl_version, [
AC_CHECK_LIB(ssl, SSL_CTX_set_ssl_version, [
PHP_ADD_LIBRARY(ssl)
],[
AC_MSG_ERROR([libssl not found!])
],[
-L$OPENSSL_LIBDIR
])
OPENSSL_INCDIR_OPT=-I$OPENSSL_INCDIR
AC_SUBST(OPENSSL_INCDIR_OPT)
PHP_ADD_INCLUDE($OPENSSL_INC)
])
dnl PHP_EVAL_LIBLINE(LINE, SHARED-LIBADD)
@@ -488,14 +342,16 @@ AC_DEFUN(PHP_LIBGCC_LIBPATH,[
changequote([,])
])
AC_DEFUN(PHP_ARG_ANALYZE_EX,[
ext_output="yes, shared"
ext_shared=yes
AC_DEFUN(PHP_ARG_ANALYZE,[
case [$]$1 in
shared,*)
ext_output="yes, shared"
ext_shared=yes
$1=`echo "[$]$1"|sed 's/^shared,//'`
;;
shared)
ext_output="yes, shared"
ext_shared=yes
$1=yes
;;
no)
@@ -508,12 +364,15 @@ no)
;;
esac
PHP_ALWAYS_SHARED([$1])
])
if test "$php_always_shared" = "yes"; then
ext_output="yes, shared"
ext_shared=yes
test "[$]$1" = "no" && $1=yes
fi
AC_DEFUN(PHP_ARG_ANALYZE,[
PHP_ARG_ANALYZE_EX([$1])
ifelse([$2],,,[AC_MSG_RESULT([$ext_output])])
if test -n "$2"; then
AC_MSG_RESULT([$ext_output])
fi
])
dnl
@@ -527,7 +386,9 @@ PHP_REAL_ARG_WITH([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z0-9-,A-Z0-9_))
])
AC_DEFUN(PHP_REAL_ARG_WITH,[
ifelse([$2],,,[AC_MSG_CHECKING([$2])])
if test -n "$2"; then
AC_MSG_CHECKING([$2])
fi
AC_ARG_WITH($1,[$3],$5=[$]withval,$5=ifelse($4,,no,$4))
PHP_ARG_ANALYZE($5,[$2])
])
@@ -543,7 +404,9 @@ PHP_REAL_ARG_ENABLE([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z-,A-Z_))
])
AC_DEFUN(PHP_REAL_ARG_ENABLE,[
ifelse([$2],,,[AC_MSG_CHECKING([$2])])
if test -n "$2"; then
AC_MSG_CHECKING([$2])
fi
AC_ARG_ENABLE($1,[$3],$5=[$]enableval,$5=ifelse($4,,no,$4))
PHP_ARG_ANALYZE($5,[$2])
])
@@ -630,6 +493,10 @@ AC_DEFUN(PHP_SUBST_OLD,[
AC_SUBST($1)
])
AC_DEFUN(PHP_FAST_OUTPUT,[
PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $1"
])
AC_DEFUN(PHP_MKDIR_P_CHECK,[
AC_CACHE_CHECK(for working mkdir -p, ac_cv_mkdir_p,[
test -d conftestdir && rm -rf conftestdir
@@ -645,6 +512,19 @@ dnl `mkdir -p' must be quiet about creating existing directories
])
])
AC_DEFUN(PHP_GEN_CONFIG_VARS,[
PHP_MKDIR_P_CHECK
echo creating config_vars.mk
> config_vars.mk
for i in $PHP_VAR_SUBST; do
eval echo "$i = \$$i" | sed 's%#%\\#%g' >> config_vars.mk
done
])
AC_DEFUN(PHP_GEN_MAKEFILES,[
$SHELL $srcdir/build/fastgen.sh $srcdir $ac_cv_mkdir_p $BSD_MAKEFILE $1
])
AC_DEFUN(PHP_TM_GMTOFF,[
AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff,
[AC_TRY_COMPILE([#include <sys/types.h>
@@ -765,34 +645,13 @@ dnl
dnl PHP_BUILD_SHARED
dnl
AC_DEFUN(PHP_BUILD_SHARED,[
PHP_BUILD_PROGRAM
OVERALL_TARGET=libphp4.la
php_build_target=shared
php_c_pre=$shared_c_pre
php_c_meta=$shared_c_meta
php_c_post=$shared_c_post
php_cxx_pre=$shared_cxx_pre
php_cxx_meta=$shared_cxx_meta
php_cxx_post=$shared_cxx_post
php_lo=$shared_lo
])
dnl
dnl PHP_BUILD_STATIC
dnl
AC_DEFUN(PHP_BUILD_STATIC,[
PHP_BUILD_PROGRAM
OVERALL_TARGET=libphp4.la
php_build_target=static
])
dnl
dnl PHP_BUILD_BUNDLE
dnl
AC_DEFUN(PHP_BUILD_BUNDLE,[
PHP_BUILD_PROGRAM
OVERALL_TARGET=libs/libphp4.bundle
php_build_target=static
])
@@ -800,23 +659,6 @@ dnl
dnl PHP_BUILD_PROGRAM
dnl
AC_DEFUN(PHP_BUILD_PROGRAM,[
OVERALL_TARGET=php
php_c_pre='$(CC)'
php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
php_c_post=' && echo > $[@]'
php_cxx_pre='$(CXX)'
php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
php_cxx_post=' && echo > $[@]'
php_lo=o
shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -prefer-pic'
shared_c_post=
shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -prefer-pic'
shared_cxx_post=
shared_lo=lo
php_build_target=program
])
@@ -852,17 +694,7 @@ AC_DEFUN(PHP_EXPAND_PATH,[
$2="$ep_realdir/`basename \"$1\"`"
fi
])
dnl
dnl internal, don't use
AC_DEFUN(PHP_ADD_LIBPATH_GLOBAL,[
AC_PHP_ONCE(LIBPATH, $1, [
test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$1"
LDFLAGS="$LDFLAGS -L$1"
PHP_RPATHS="$PHP_RPATHS $1"
])
])dnl
dnl
dnl
dnl
dnl PHP_ADD_LIBPATH(path[, shared-libadd])
dnl
@@ -871,15 +703,15 @@ dnl
AC_DEFUN(PHP_ADD_LIBPATH,[
if test "$1" != "/usr/lib"; then
PHP_EXPAND_PATH($1, ai_p)
ifelse([$2],,[
PHP_ADD_LIBPATH_GLOBAL([$ai_p])
],[
if test "$ext_shared" = "yes"; then
$2="-R$ai_p -L$ai_p [$]$2"
else
PHP_ADD_LIBPATH_GLOBAL([$ai_p])
fi
])
if test "$ext_shared" = "yes" && test -n "$2"; then
$2="-R$1 -L$1 [$]$2"
else
AC_PHP_ONCE(LIBPATH, $ai_p, [
test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
LDFLAGS="$LDFLAGS -L$ai_p"
PHP_RPATHS="$PHP_RPATHS $ai_p"
])
fi
fi
])
@@ -890,7 +722,7 @@ dnl builds RPATH from PHP_RPATHS
dnl
AC_DEFUN(PHP_BUILD_RPATH,[
if test "$PHP_RPATH" = "yes" && test -n "$PHP_RPATHS"; then
OLD_RPATHS=$PHP_RPATHS
OLD_RPATHS="$PHP_RPATHS"
unset PHP_RPATHS
for i in $OLD_RPATHS; do
PHP_LDFLAGS="$PHP_LDFLAGS -L$i"
@@ -918,36 +750,31 @@ AC_DEFUN(PHP_ADD_INCLUDE,[
])
fi
])
dnl
dnl internal, don't use
AC_DEFUN(PHP_X_ADD_LIBRARY,[dnl
ifelse([$2],,$3="-l$1 [$]$3", $3="[$]$3 -l$1") dnl
])dnl
dnl
dnl internal, don't use
AC_DEFUN(PHP_ADD_LIBRARY_SKELETON,[
case $1 in
c|c_r|pthread*) ;;
*) ifelse($3,,[
PHP_X_ADD_LIBRARY($1,$2,$5)
],[
if test "$ext_shared" = "yes"; then
PHP_X_ADD_LIBRARY($1,$2,$3)
else
$4($1,$2)
fi
]) ;;
esac
])dnl
dnl
dnl
AC_DEFUN(PHP_X_ADD_LIBRARY,[
ifelse($2,,$3="-l$1 [$]$3", $3="[$]$3 -l$1")
])
dnl
dnl PHP_ADD_LIBRARY(library[, append[, shared-libadd]])
dnl
dnl add a library to the link line
dnl
AC_DEFUN(PHP_ADD_LIBRARY,[
PHP_ADD_LIBRARY_SKELETON([$1],[$2],[$3],[PHP_ADD_LIBRARY],[LIBS])
case $1 in
c|c_r|pthread*) ;;
*)
ifelse($3,,[
PHP_X_ADD_LIBRARY($1,$2,LIBS)
],[
if test "$ext_shared" = "yes"; then
PHP_X_ADD_LIBRARY($1,$2,$3)
else
PHP_ADD_LIBRARY($1,$2)
fi
])
;;
esac
])
dnl
@@ -956,9 +783,22 @@ dnl
dnl add a library to the link line (deferred)
dnl
AC_DEFUN(PHP_ADD_LIBRARY_DEFER,[
PHP_ADD_LIBRARY_SKELETON([$1],[$2],[$3],[PHP_ADD_LIBRARY_DEFER],[DLIBS])
case $1 in
c|c_r|pthread*) ;;
*)
ifelse($3,,[
PHP_X_ADD_LIBRARY($1,$2,DLIBS)
],[
if test "$ext_shared" = "yes"; then
PHP_X_ADD_LIBRARY($1,$2,$3)
else
PHP_ADD_LIBRARY_DEFER($1,$2)
fi
])
;;
esac
])
dnl
dnl PHP_ADD_LIBRARY_WITH_PATH(library, path[, shared-libadd])
dnl
@@ -998,8 +838,8 @@ AC_DEFUN(PHP_ADD_LIBRARY_DEFER_WITH_PATH,[
dnl
dnl Set libtool variable
dnl
AC_DEFUN(PHP_SET_LIBTOOL_VARIABLE,[
LIBTOOL='$(SHELL) libtool $1'
AC_DEFUN(AM_SET_LIBTOOL_VARIABLE,[
LIBTOOL='$(SHELL) $(top_builddir)/libtool $1'
])
dnl
@@ -1030,15 +870,21 @@ AC_DEFUN(PHP_CHECK_CC_OPTION,[
AC_DEFUN(PHP_REGEX,[
if test "$REGEX_TYPE" = "php"; then
REGEX_LIB=regex/libregex.la
REGEX_DIR=regex
AC_DEFINE(HSREGEX,1,[ ])
AC_DEFINE(REGEX,1,[ ])
PHP_ADD_SOURCES(regex, regcomp.c regexec.c regerror.c regfree.c)
PHP_FAST_OUTPUT(regex/Makefile)
elif test "$REGEX_TYPE" = "system"; then
AC_DEFINE(REGEX,0,[ ])
fi
AC_MSG_CHECKING([which regex library to use])
AC_MSG_RESULT([$REGEX_TYPE])
PHP_SUBST(REGEX_DIR)
PHP_SUBST(REGEX_LIB)
PHP_SUBST(HSREGEX)
])
dnl
@@ -1075,115 +921,60 @@ AC_DEFUN(PHP_AC_BROKEN_SPRINTF,[
fi
])
dnl PHP_SHARED_MODULE(module-name, object-var, build-dir)
dnl
dnl Basically sets up the link-stage for building module-name
dnl from object_var in build-dir.
dnl
AC_DEFUN(PHP_SHARED_MODULE,[
PHP_MODULES="$PHP_MODULES \$(phplibdir)/$1.la"
PHP_SUBST($2)
cat >>Makefile.objects<<EOF
\$(phplibdir)/$1.la: $3/$1.la
\$(LIBTOOL) --mode=install cp $3/$1.la \$(phplibdir)
$3/$1.la: \$($2) \$(translit($1,a-z-,A-Z_)_SHARED_DEPENDENCIES)
\$(LIBTOOL) --mode=link \$(CC) \$(COMMON_FLAGS) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(LDFLAGS) -o \[$]@ -export-dynamic -avoid-version -prefer-pic -module -rpath \$(phplibdir) \$(EXTRA_LDFLAGS) \$($2) \$(translit($1,a-z-,A-Z_)_SHARED_LIBADD)
EOF
])
dnl
dnl PHP_SELECT_SAPI(name, type[, sources [, extra-cflags]])
dnl
dnl Selects the SAPI name and type (static, shared, programm)
dnl and optionally also the source-files for the SAPI-specific
dnl objects.
dnl
AC_DEFUN(PHP_SELECT_SAPI,[
PHP_SAPI=$1
case "$2" in
static) PHP_BUILD_STATIC;;
shared) PHP_BUILD_SHARED;;
bundle) PHP_BUILD_BUNDLE;;
program) PHP_BUILD_PROGRAM;;
esac
ifelse($3,,,[PHP_ADD_SOURCES([sapi/$1],[$3],[$4],[sapi])])
])
dnl deprecated
AC_DEFUN(PHP_EXTENSION,[
sources=`awk -f $abs_srcdir/scan_makefile_in.awk < []PHP_EXT_SRCDIR($1)[]/Makefile.in`
PHP_NEW_EXTENSION($1, $sources, $2, $3)
if test -r "$ext_srcdir/Makefile.frag"; then
PHP_ADD_MAKEFILE_FRAGMENT
fi
])
AC_DEFUN(PHP_ADD_BUILD_DIR,[
BUILD_DIR="$BUILD_DIR $1"
])
AC_DEFUN(PHP_GEN_BUILD_DIRS,[
PHP_MKDIR_P_CHECK
if test "$ac_cv_mkdir_p" = "yes"; then
mkdir -p $BUILD_DIR
fi
])
dnl
dnl PHP_NEW_EXTENSION(extname, sources [, shared [,sapi_class[, extra-cflags]]])
dnl PHP_EXTENSION(extname [, shared [,sapi_class]])
dnl
dnl Includes an extension in the build.
dnl
dnl "extname" is the name of the ext/ subdir where the extension resides.
dnl "sources" is a list of files relative to the subdir which are used
dnl to build the extension.
dnl "extname" is the name of the ext/ subdir where the extension resides
dnl "shared" can be set to "shared" or "yes" to build the extension as
dnl a dynamically loadable library. Optional parameter "sapi_class" can
dnl be set to "cli" to mark extension build only with CLI or CGI sapi's.
dnl extra-cflags are passed to the compiler, with @ext_srcdir@ being
dnl substituted.
AC_DEFUN(PHP_NEW_EXTENSION,[
ext_builddir=[]PHP_EXT_BUILDDIR($1)
ext_srcdir=[]PHP_EXT_SRCDIR($1)
dnl If "nocli" is passed the extension will be built only with a non-cli
dnl sapi.
dnl
AC_DEFUN(PHP_EXTENSION,[
EXT_SUBDIRS="$EXT_SUBDIRS $1"
if test -d "$abs_srcdir/ext/$1"; then
dnl ---------------------------------------------- Internal Module
ext_builddir=ext/$1
ext_srcdir=$abs_srcdir/ext/$1
else
dnl ---------------------------------------------- External Module
ext_builddir=.
ext_srcdir=$abs_srcdir
fi
ifelse($5,,ac_extra=,[ac_extra=`echo $ac_n "$5$ac_c"|sed s#@ext_srcdir@#$ext_srcdir#g`])
if test "$3" != "shared" && test "$3" != "yes" && test "$4" != "cli"; then
if test "$2" != "shared" && test "$2" != "yes" && test "$3" != "cli"; then
dnl ---------------------------------------------- Static module
PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,)
LIB_BUILD($ext_builddir)
EXT_LTLIBS="$EXT_LTLIBS $abs_builddir/$ext_builddir/lib$1.la"
EXT_STATIC="$EXT_STATIC $1"
if test "$3" != "nocli"; then
EXT_CLI_LTLIBS="$EXT_CLI_LTLIBS $abs_builddir/$ext_builddir/lib$1.la"
EXT_CLI_STATIC="$EXT_CLI_STATIC $1"
fi
else
if test "$3" = "shared" || test "$3" = "yes"; then
if test "$2" = "shared" || test "$2" = "yes"; then
dnl ---------------------------------------------- Shared module
PHP_ADD_SOURCES_X(PHP_EXT_DIR($1),$2,$ac_extra,shared_objects_$1,yes)
PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir)
LIB_BUILD($ext_builddir,yes)
AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z-,A-Z_), 1, Whether to build $1 as dynamic module)
fi
fi
if test "$3" != "shared" && test "$3" != "yes" && test "$4" = "cli"; then
dnl ---------------------------------------------- CLI static module
if test "$2" != "shared" && test "$2" != "yes" && test "$3" = "cli"; then
dnl ---------------------------------------------- CLI only static module
LIB_BUILD($ext_builddir)
if test "$PHP_SAPI" = "cgi"; then
PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,)
EXT_LTLIBS="$EXT_LTLIBS $abs_builddir/$ext_builddir/lib$1.la"
EXT_STATIC="$EXT_STATIC $1"
else
PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,cli)
fi
EXT_CLI_LTLIBS="$EXT_CLI_LTLIBS $abs_builddir/$ext_builddir/lib$1.la"
EXT_CLI_STATIC="$EXT_CLI_STATIC $1"
fi
PHP_ADD_BUILD_DIR($ext_builddir)
PHP_FAST_OUTPUT($ext_builddir/Makefile)
])
dnl
@@ -1218,9 +1009,22 @@ dnl and sets $shared to "yes" or "no", and removes "shared,?" stuff
dnl from $withval.
dnl
AC_DEFUN(PHP_WITH_SHARED,[
PHP_ARG_ANALYZE_EX(withval)
shared=$ext_shared
unset ext_shared ext_output
case $withval in
shared)
shared=yes
withval=yes
;;
shared,*)
shared=yes
withval=`echo $withval | sed -e 's/^shared,//'`
;;
*)
shared=no
;;
esac
if test -n "$php_always_shared"; then
shared=yes
fi
])
dnl The problem is that the default compilation flags in Solaris 2.6 won't
@@ -1323,6 +1127,11 @@ int main(void) {
fi
])
AC_DEFUN(AC_ADD_LIBPATH, [indir([PHP_ADD_LIBPATH], $@)])
AC_DEFUN(AC_ADD_LIBRARY, [indir([PHP_ADD_LIBRARY], $@)])
AC_DEFUN(AC_ADD_LIBRARY_WITH_PATH, [indir([PHP_ADD_LIBRARY_WITH_PATH], $@)])
AC_DEFUN(AC_ADD_INCLUDE, [indir([PHP_ADD_INCLUDE], $@)])
AC_DEFUN(PHP_FOPENCOOKIE,[
AC_CHECK_FUNC(fopencookie, [ have_glibc_fopencookie=yes ])
@@ -1381,6 +1190,7 @@ AC_DEFUN(PHP_CHECK_LIBRARY, [
])dnl
])
dnl
dnl PHP_SETUP_ICONV(shared-add [, action-found [, action-not-found]])
dnl
@@ -1395,11 +1205,10 @@ AC_DEFUN(PHP_SETUP_ICONV, [
dnl
if test "$PHP_ICONV" = "yes"; then
AC_CHECK_FUNC(iconv, [
PHP_DEFINE(HAVE_ICONV)
found_iconv=yes
],[
AC_CHECK_FUNC(libiconv,[
PHP_DEFINE(HAVE_LIBICONV)
AC_DEFINE(HAVE_LIBICONV, 1, [ ])
found_iconv=yes
])
])
@@ -1409,7 +1218,7 @@ AC_DEFUN(PHP_SETUP_ICONV, [
dnl Check external libs for iconv funcs
dnl
if test "$found_iconv" = "no"; then
for i in $PHP_ICONV /usr/local /usr; do
if test -r $i/include/giconv.h; then
AC_DEFINE(HAVE_GICONV_H, 1, [ ])
@@ -1432,11 +1241,10 @@ AC_DEFUN(PHP_SETUP_ICONV, [
then
PHP_CHECK_LIBRARY($iconv_lib_name, libiconv, [
found_iconv=yes
PHP_DEFINE(HAVE_LIBICONV)
AC_DEFINE(HAVE_LIBICONV, 1, [ ])
], [
PHP_CHECK_LIBRARY($iconv_lib_name, iconv, [
found_iconv=yes
PHP_DEFINE(HAVE_ICONV)
], [], [
-L$ICONV_DIR/lib
])
@@ -1445,10 +1253,10 @@ AC_DEFUN(PHP_SETUP_ICONV, [
])
fi
fi
if test "$found_iconv" = "yes"; then
AC_DEFINE(HAVE_ICONV, 1, [ ])
if test -n "$ICONV_DIR"; then
AC_DEFINE(HAVE_ICONV, 1, [ ])
PHP_ADD_LIBRARY_WITH_PATH($iconv_lib_name, $ICONV_DIR/lib, $1)
PHP_ADD_INCLUDE($ICONV_DIR/include)
fi
+34
View File
@@ -0,0 +1,34 @@
#! /bin/sh
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
# | available at through the world-wide-web at |
# | http://www.php.net/license/2_02.txt. |
# | If you did not receive a copy of the PHP license and are unable to |
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id$
#
# cwd must be top_srcdir
test -f build/bsd_makefile || exit 2
test -f bsd_converted && exit 0
tmpfile=`mktemp /tmp/bsd_makefile.XXXXXX 2>/dev/null` || tmpfile="tmp.$$"
for i in build/*.mk; do
sed 's/^include \(.*\)/.include "\1"/' $i >$tmpfile \
&& cp $tmpfile $i
done
rm -f $tmpfile
touch bsd_converted
exit 0
+24 -6
View File
@@ -30,16 +30,37 @@ config_h_in = main/php_config.h.in
acconfig_h_SOURCES = acconfig.h.in $(config_h_files)
targets = $(TOUCH_FILES) configure $(config_h_in)
targets = $(TOUCH_FILES) $(makefile_in_files) configure $(config_h_in)
all: $(targets)
all: Zend/Makefile.am TSRM/Makefile.am $(targets)
Zend/Makefile.am:
test -d Zend || (test -d ../Zend && ln -s ../Zend Zend)
TSRM/Makefile.am:
test -d TSRM || (test -d ../TSRM && ln -s ../TSRM TSRM)
acconfig.h: $(acconfig_h_SOURCES)
@echo rebuilding $@
cat $(acconfig_h_SOURCES) > $@
SUPPRESS_WARNINGS = (egrep -v '(AC_TRY_RUN called without default to allow cross compiling|AC_PROG_CXXCPP was called before AC_PROG_CXX|defined in acinclude.m4 but never used|AC_PROG_LEX invoked multiple times|AC_PROG_CPP was called before AC_PROG_CC)'||true)
$(makefile_in_files): $(makefile_am_files) aclocal.m4 configure.in $(config_m4_files)
@echo rebuilding Makefile templates
@for i in $(LT_TARGETS); do \
if test -f "$$i"; then \
mv $$i $$i.bak; \
cp $$i.bak $$i; \
fi; \
done
@test -f want_dependencies || flag=-i; \
automake -a $$flag $(AMFLAGS) $(makefile_files) 2>&1 | $(SUPPRESS_WARNINGS)
@for i in $(LT_TARGETS); do mv $$i.bak $$i; done
aclocal.m4: configure.in acinclude.m4 dynlib.m4
aclocal 2>&1 | $(SUPPRESS_WARNINGS)
SUPPRESS_WARNINGS = (egrep -v '(AC_TRY_RUN called without default to allow cross compiling|AC_PROG_CXXCPP was called before AC_PROG_CXX|.*AM_PROG_LEX.*|defined in acinclude.m4 but never used|AC_PROG_LEX invoked multiple times|AC_PROG_CPP was called before)'||true)
$(config_h_in): configure acconfig.h
# explicitly remove target since autoheader does not seem to work
@@ -51,9 +72,6 @@ $(config_h_in): configure acconfig.h
$(TOUCH_FILES):
touch $(TOUCH_FILES)
aclocal.m4: configure.in acinclude.m4
aclocal 2>&1 | $(SUPPRESS_WARNINGS)
configure: aclocal.m4 configure.in $(config_m4_files)
@echo rebuilding $@
@autoconf 2>&1 | $(SUPPRESS_WARNINGS)
+24
View File
@@ -0,0 +1,24 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
# | available at through the world-wide-web at |
# | http://www.php.net/license/2_02.txt. |
# | If you did not receive a copy of the PHP license and are unable to |
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id$
#
all: all-recursive
include $(builddir)/libs.mk
include $(top_srcdir)/build/rules.mk
+80
View File
@@ -0,0 +1,80 @@
#! /bin/sh
#
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
# | available at through the world-wide-web at |
# | http://www.php.net/license/2_02.txt. |
# | If you did not receive a copy of the PHP license and are unable to |
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id: fastgen.sh,v 1.14 2002-02-28 08:25:33 sebastian Exp $
#
if test "$#" = "0"; then
echo "Usage: fastgen.sh <srcdir> <mkdir_p> <bsdmakefile_p> <file>"
fi
srcdir=$1
shift
mkdir_p=$1
shift
bsd_makefile=$1
shift
top_srcdir=`(cd $srcdir; pwd)`
top_builddir=`pwd`
if test "$mkdir_p" = "yes"; then
mkdir_p="mkdir -p"
else
mkdir_p="$top_srcdir/build/shtool mkdir -p"
fi
if test "$bsd_makefile" = "yes"; then
(cd $top_srcdir; ./build/bsd_makefile)
for makefile in $@; do
echo "fastgen.sh: creating $makefile"
dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'`
$mkdir_p "$dir/"
cat - $top_srcdir/$makefile.in <<EOF |sed 's/^include \(.*\)/.include "\1"/' >$makefile
top_srcdir = $top_srcdir
top_builddir = $top_builddir
srcdir = $top_srcdir/$dir
builddir = $top_builddir/$dir
VPATH = $top_srcdir/$dir
EOF
test -z "$dir" && dir=.
touch $dir/.deps
done
else
for makefile in $@; do
echo "fastgen.sh: creating $makefile"
dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'`
$mkdir_p "$dir/"
cat - $top_srcdir/$makefile.in <<EOF >$makefile
top_srcdir = $top_srcdir
top_builddir = $top_builddir
srcdir = $top_srcdir/$dir
builddir = $top_builddir/$dir
VPATH = $top_srcdir/$dir
EOF
test -z "$dir" && dir=.
touch $dir/.deps
done
fi
+8 -8
View File
@@ -1,24 +1,24 @@
#! /bin/sh
# $Id: genif.sh,v 1.3 2002-03-22 10:22:41 sas Exp $
# $Id: genif.sh,v 1.2 2001-03-30 14:02:20 sas Exp $
# replacement for genif.pl
infile=$1
infile="$1"
shift
srcdir=$1
srcdir="$1"
shift
extra_module_ptrs=$1
extra_module_ptrs="$1"
shift
awk=$1
awk="$1"
shift
if test -z "$infile" || test -z "$srcdir"; then
if test "$infile" = "" -o "$srcdir" = ""; then
echo "please supply infile and srcdir"
exit 1
fi
module_ptrs=$extra_module_ptrs
header_list=
module_ptrs="$extra_module_ptrs"
header_list=""
olddir=`pwd`
cd $srcdir
+23
View File
@@ -0,0 +1,23 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
# | available at through the world-wide-web at |
# | http://www.php.net/license/2_02.txt. |
# | If you did not receive a copy of the PHP license and are unable to |
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id$
#
LTLIBRARY_OBJECTS = $(LTLIBRARY_SOURCES:.c=.lo) $(LTLIBRARY_OBJECTS_X)
$(LTLIBRARY_NAME): $(LTLIBRARY_OBJECTS) $(LTLIBRARY_DEPENDENCIES)
$(LINK) $(LTLIBRARY_LDFLAGS) $(LTLIBRARY_OBJECTS) $(LTLIBRARY_LIBADD)
+24
View File
@@ -0,0 +1,24 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
# | available at through the world-wide-web at |
# | http://www.php.net/license/2_02.txt. |
# | If you did not receive a copy of the PHP license and are unable to |
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id$
#
targets = $(LTLIBRARY_NAME)
include $(top_srcdir)/build/rules.mk
include $(top_srcdir)/build/library.mk
+23
View File
@@ -0,0 +1,23 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
# | available at through the world-wide-web at |
# | http://www.php.net/license/2_02.txt. |
# | If you did not receive a copy of the PHP license and are unable to |
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id$
#
PROGRAM_OBJECTS = $(PROGRAM_SOURCES:.c=.lo)
$(PROGRAM_NAME): $(PROGRAM_DEPENDENCIES) $(PROGRAM_OBJECTS)
$(LINK_CLEAN) $(PROGRAM_LDFLAGS) $(PROGRAM_OBJECTS) $(PROGRAM_LDADD)
+70
View File
@@ -0,0 +1,70 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
# | available at through the world-wide-web at |
# | http://www.php.net/license/2_02.txt. |
# | If you did not receive a copy of the PHP license and are unable to |
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id$
#
include $(top_srcdir)/build/rules_common.mk
all: all-recursive
install: install-recursive
distclean-recursive depend-recursive clean-recursive all-recursive install-recursive:
@otarget=`echo $@|sed s/-recursive//`; \
list='$(SUBDIRS)'; for i in $$list; do \
target="$$otarget"; \
echo "Making $$target in $$i"; \
if test "$$i" = "."; then \
ok=yes; \
target="$$target-p"; \
fi; \
(cd $$i && $(MAKE) $$target) || exit 1; \
done; \
if test "$$otarget" = "all" && test -z '$(targets)'; then ok=yes; fi; \
if test "$$ok" != "yes"; then $(MAKE) "$$otarget-p" || exit 1; fi
all-p: $(targets)
install-p: $(targets) $(install_targets)
distclean-p depend-p clean-p:
depend: depend-recursive
@echo $(top_srcdir) $(top_builddir) $(srcdir) $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) $(DEFS) $(CPPFLAGS) $(srcdir)/*.c *.c | $(AWK) -f $(top_srcdir)/build/mkdep.awk > $(builddir)/.deps || true
clean: clean-modules clean-recursive clean-x
clean-modules:
clean-x:
rm -f $(targets) *.lo *.slo *.la *.o $(CLEANFILES)
rm -rf .libs libs
distclean: distclean-recursive clean-x
rm -f config.cache config.log config.status config_vars.mk libtool \
php_config.h stamp-h Makefile build-defs.h php4.spec libphp4.module
test: $(top_builddir)/sapi/cli/php
@if test "$(TESTS)" = ""; then \
TOP_BUILDDIR=$(top_builddir) TOP_SRCDIR=$(top_srcdir) $(top_builddir)/sapi/cli/php -c $(top_srcdir)/php.ini-dist $(top_srcdir)/run-tests.php $(srcdir); \
else \
TOP_BUILDDIR=$(top_builddir) TOP_SRCDIR=$(top_srcdir) $(top_builddir)/sapi/cli/php -c $(top_srcdir)/php.ini-dist $(top_srcdir)/run-tests.php $(TESTS); \
fi
include $(builddir)/.deps
.PHONY: all-recursive clean-recursive install-recursive \
$(install_targets) install all clean depend depend-recursive shared \
distclean-recursive distclean clean-x all-p install-p distclean-p \
depend-p clean-p
+77
View File
@@ -0,0 +1,77 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
# | available at through the world-wide-web at |
# | http://www.php.net/license/2_02.txt. |
# | If you did not receive a copy of the PHP license and are unable to |
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id$
#
include $(top_builddir)/config_vars.mk
COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS)
COMPILE = $(CC) $(COMMON_FLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
CXX_COMPILE = $(CXX) $(COMMON_FLAGS) $(CXXFLAGS) $(EXTRA_CXXFLAGS)
SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) -prefer-pic $(EXTRA_CFLAGS) -c $< && touch $@
CXX_SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(CXX) $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) -prefer-pic $(EXTRA_CXXFLAGS) -c $< && touch $@
LINK = $(LIBTOOL) --mode=link $(COMPILE) $(LDFLAGS) -o $@
LINK_CLEAN = $(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@
mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p
INSTALL = $(top_srcdir)/build/shtool install -c
INSTALL_DATA = $(INSTALL) -m 644
DEFS = -I. -I$(srcdir) -I$(top_builddir)/main -I$(top_srcdir)
moduledir = $(EXTENSION_DIR)
CXX_SUFFIX = .cpp
.SUFFIXES:
.SUFFIXES: .slo .c $(CXX_SUFFIX) .lo .o .s .y .l
.c.o:
$(COMPILE) -c $<
$(CXX_SUFFIX).o:
$(CXX_COMPILE) -c $<
.s.o:
$(COMPILE) -c $<
.c.lo:
$(PHP_COMPILE)
$(CXX_SUFFIX).lo:
$(CXX_PHP_COMPILE)
.s.lo:
$(PHP_COMPILE)
.c.slo:
$(SHARED_COMPILE)
$(CXX_SUFFIX).slo:
$(CXX_SHARED_COMPILE)
.y.c:
$(YACC) $(YFLAGS) $< && mv y.tab.c $*.c
if test -f y.tab.h; then \
if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
else :; fi
.l.c:
$(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
+76
View File
@@ -0,0 +1,76 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
# | available at through the world-wide-web at |
# | http://www.php.net/license/2_02.txt. |
# | If you did not receive a copy of the PHP license and are unable to |
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id$
#
include $(top_srcdir)/build/rules_common.mk
install_targets = install-modules
all: all-recursive
install: install-recursive
distclean-recursive depend-recursive clean-recursive all-recursive install-recursive:
@otarget=`echo $@|sed s/-recursive//`; \
list='$(SUBDIRS)'; for i in $$list; do \
target="$$otarget"; \
echo "Making $$target in $$i"; \
if test "$$i" = "."; then \
ok=yes; \
target="$$target-p"; \
fi; \
(cd $$i && $(MAKE) $$target) || exit 1; \
done; \
if test "$$otarget" = "all" && test -z '$(targets)'; then ok=yes; fi; \
if test "$$ok" != "yes"; then $(MAKE) "$$otarget-p" || exit 1; fi
all-p: $(targets)
install-p: $(targets) $(install_targets)
distclean-p depend-p clean-p:
depend: depend-recursive
@echo $(top_srcdir) $(top_builddir) $(srcdir) $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) $(DEFS) $(CPPFLAGS) $(srcdir)/*.c *.c | $(AWK) -f $(top_srcdir)/build/mkdep.awk > $(builddir)/.deps || true
clean: clean-recursive clean-x
clean-x:
rm -f $(targets) *.lo *.slo *.la *.o $(CLEANFILES)
rm -rf .libs
distclean: distclean-recursive clean-x
rm -f config.cache config.log config.status config_vars.mk libtool \
config.h stamp-h Makefile build-defs.h php4.spec libphp4.module
cvsclean:
@for i in `find . -name .cvsignore`; do \
(cd `dirname $$i` 2>/dev/null && rm -rf `cat .cvsignore` *.o *.a || true); \
done
@rm -f $(SUBDIRS) 2>/dev/null || true
install-modules:
@test -d modules && \
$(mkinstalldirs) $(moduledir) && \
echo "installing shared modules into $(moduledir)" && \
rm -f modules/*.la && \
cp modules/* $(moduledir) || true
include $(builddir)/.deps
.PHONY: all-recursive clean-recursive install-recursive \
$(install_targets) install all clean depend depend-recursive shared \
distclean-recursive distclean clean-x all-p install-p distclean-p \
depend-p clean-p
+110 -181
View File
@@ -1,13 +1,13 @@
#!/bin/sh
##
## GNU shtool -- The GNU Portable Shell Tool
## Copyright (c) 1994-2001 Ralf S. Engelschall <rse@engelschall.com>
## Copyright (c) 1994-2000 Ralf S. Engelschall <rse@engelschall.com>
##
## See http://www.gnu.org/software/shtool/ for more information.
## See ftp://ftp.gnu.org/gnu/shtool/ for latest version.
##
## Version: 1.5.4 (14-Jun-2001)
## Contents: 3/17 available modules
## Version 1.4.9 (16-Apr-2000)
## Ingredients: 3/17 available modules
##
##
@@ -26,7 +26,7 @@
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
## USA, or contact Ralf S. Engelschall <rse@engelschall.com>.
##
## NOTICE: Given that you include this file verbatim into your own
## Notice: Given that you include this file verbatim into your own
## source tree, you are justified in saying that it remains separate
## from your package, and that this way you are simply just using GNU
## shtool. So, in this situation, there is no requirement that your
@@ -55,7 +55,7 @@
## arx Extended archive command
## slo Separate linker options by library class
## scpp Sharing C Pre-Processor
## version Maintain a version information file
## version Generate and maintain a version information file
## path Deal with program paths
##
@@ -65,22 +65,21 @@ if [ $# -eq 0 ]; then
exit 1
fi
if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then
echo "This is GNU shtool, version 1.5.4 (14-Jun-2001)"
echo "Copyright (c) 1994-2001 Ralf S. Engelschall <rse@engelschall.com>"
echo "This is GNU shtool, version 1.4.9 (16-Apr-2000)"
echo "Copyright (c) 1994-2000 Ralf S. Engelschall <rse@engelschall.com>"
echo "Report bugs to <bug-shtool@gnu.org>"
echo ''
echo "Usage: shtool [<options>] [<cmd-name> [<cmd-options>] [<cmd-args>]]"
echo "Usage: shtool [<options>] [<cmd-name> [<cmd-options>] [<cmd-args>]]"
echo ''
echo 'Available global <options>:'
echo ' -v, --version display shtool version information'
echo ' -h, --help display shtool usage help page (this one)'
echo ' -d, --debug display shell trace information'
echo ' -r, --recreate recreate this shtool script via shtoolize'
echo ''
echo 'Available <cmd-name> [<cmd-options>] [<cmd-args>]:'
echo ' echo [-n] [-e] [<str> ...]'
echo ' install [-v] [-t] [-c] [-C] [-s] [-m<mode>] [-o<owner>] [-g<group>]'
echo ' [-e<sed-cmd>] <file> [<file> ...] <path>'
echo ' [-e<ext>] <file> <path>'
echo ' mkdir [-t] [-f] [-p] [-m<mode>] <dir> [<dir> ...]'
echo ''
echo 'Not available <cmd-name> (because module was not built-in):'
@@ -91,25 +90,21 @@ if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then
echo ' mkln [-t] [-f] [-s] <src-path> [<src-path> ...] <dst-path>'
echo ' mkshadow [-v] [-t] [-a] <src-dir> <dst-dir>'
echo ' fixperm [-v] [-t] <path> [<path> ...]'
echo ' tarball [-t] [-v] [-o<tarball>] [-c<prog>] [-d<dir>] [-u<user>]'
echo ' [-g<group>] [-e<pattern>] <path> [<path> ...]'
echo ' tarball [-t] [-v] [-o <tarball>] [-c <prog>] [-d <dir>] [-u'
echo ' <user>] [-g <group>] [-e <pattern>] <path> [<path> ...]'
echo ' guessos '
echo ' arx [-t] [-C<cmd>] <op> <archive> [<file> ...]'
echo ' slo [-p<str>] -- -L<dir> -l<lib> [-L<dir> -l<lib> ...]'
echo ' scpp [-v] [-p] [-f<filter>] [-o<ofile>] [-t<tfile>] [-M<mark>]'
echo ' [-D<dname>] [-C<cname>] <file> [<file> ...]'
echo ' version [-l<lang>] [-n<name>] [-p<prefix>] [-s<version>] [-e]'
echo ' [-i<knob>] [-d<type>] <file>'
echo ' version [-l<lang>] [-n<name>] [-p<prefix>] [-s<version>] [-i<knob>]'
echo ' [-d<type>] <file>'
echo ' path [-s] [-r] [-d] [-b] [-m] [-p<path>] <str> [<str> ...]'
echo ''
exit 0
fi
if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then
echo "GNU shtool 1.5.4 (14-Jun-2001)"
exit 0
fi
if [ ".$1" = ".-r" -o ".$1" = ."--recreate" ]; then
shtoolize -ofoo echo install mkdir
echo "GNU shtool 1.4.9 (16-Apr-2000)"
exit 0
fi
if [ ".$1" = ".-d" -o ".$1" = ."--debug" ]; then
@@ -147,15 +142,15 @@ case $tool in
;;
install )
str_tool="install"
str_usage="[-v] [-t] [-c] [-C] [-s] [-m<mode>] [-o<owner>] [-g<group>] [-e<sed-cmd>] <file> [<file> ...] <path>"
arg_spec="2+"
opt_spec="v.t.c.C.s.m:o:g:e+"
str_usage="[-v] [-t] [-c] [-C] [-s] [-m<mode>] [-o<owner>] [-g<group>] [-e<ext>] <file> <path>"
arg_spec="2="
opt_spec="v.t.c.C.s.m:o:g:e:"
opt_v=no
opt_t=no
opt_c=no
opt_C=no
opt_s=no
opt_m="0755"
opt_m=""
opt_o=""
opt_g=""
opt_e=""
@@ -317,7 +312,6 @@ if [ ".$gen_tmpfile" = .yes ]; then
tmpfile="$tmpdir/.shtool.$$"
rm -f $tmpfile >/dev/null 2>&1
touch $tmpfile
chmod 600 $tmpfile
fi
##
@@ -329,7 +323,7 @@ case $tool in
echo )
##
## echo -- Print string with optional construct expansion
## Copyright (c) 1998-2001 Ralf S. Engelschall <rse@engelschall.com>
## Copyright (c) 1998-2000 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for WML as buildinfo
##
@@ -353,7 +347,7 @@ echo )
fi
# determine terminal bold sequence
term_bold=''
term_bold=''
term_norm=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[Bb]'`" != . ]; then
case $TERM in
@@ -404,7 +398,7 @@ echo )
# determine user name
username=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[uUgG]'`" != . ]; then
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[uU]'`" != . ]; then
username="$LOGNAME"
if [ ".$username" = . ]; then
username="$USER"
@@ -446,38 +440,8 @@ echo )
fi
fi
# determine (primary) group id
groupid=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[gG]'`" != . ]; then
groupid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \
sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
if [ ".$groupid" = . ]; then
groupid=`(ypcat passwd) 2>/dev/null | egrep "^${username}:" | \
sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
if [ ".$groupid" = . ]; then
groupid='?'
fi
fi
fi
# determine (primary) group name
groupname=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%g'`" != . ]; then
groupname=`egrep "^[^:]*:[^:]*:${groupid}:" /etc/group 2>/dev/null | \
sed -e 's/:.*$//'`
if [ ".$groupname" = . ]; then
groupname=`(ypcat group) 2>/dev/null | \
egrep "^[^:]*:[^:]*:${groupid}:" | \
sed -e 's/:.*$//'`
if [ ".$groupname" = . ]; then
groupname='?'
fi
fi
fi
# determine host and domain name
# determine host name
hostname=''
domainname=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%h'`" != . ]; then
hostname="`(uname -n) 2>/dev/null |\
awk '{ printf("%s", $1); }'`"
@@ -495,6 +459,9 @@ echo )
;;
esac
fi
# determine domain name
domainname=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%d'`" != . ]; then
if [ ".$domainname" = . ]; then
if [ -f /etc/resolv.conf ]; then
@@ -554,8 +521,6 @@ echo )
-e "s/%b/${term_norm}/g" \
-e "s/%u/${username}/g" \
-e "s/%U/${userid}/g" \
-e "s/%g/${groupname}/g" \
-e "s/%G/${groupid}/g" \
-e "s/%h/${hostname}/g" \
-e "s/%d/${domainname}/g" \
-e "s/%D/${time_day}/g" \
@@ -581,144 +546,114 @@ echo )
install )
##
## install -- Install a program, script or datafile
## Copyright (c) 1997-2001 Ralf S. Engelschall <rse@engelschall.com>
## Copyright (c) 1997-2000 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for shtool
##
# determine source(s) and destination
argc=$#
srcs=""
while [ $# -gt 1 ]; do
srcs="$srcs $1"
shift
done
dstpath="$1"
src="$1"
dst="$2"
# type check for destination
dstisdir=0
if [ -d $dstpath ]; then
dstpath=`echo "$dstpath" | sed -e 's:/$::'`
dstisdir=1
# If destination is a directory, append the input filename
if [ -d $dst ]; then
dst=`echo "$dst" | sed -e 's:/$::'`
dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'`
dst="$dst/$dstfile"
fi
# consistency check for destination
if [ $argc -gt 2 -a $dstisdir = 0 ]; then
echo "$msgprefix:Error: multiple sources require destination to be directory" 1>&2
# Add a possible extension to src and dst
if [ ".$opt_e" != . ]; then
src="$src$opt_e"
dst="$dst$opt_e"
fi
# Check for correct arguments
if [ ".$src" = ".$dst" ]; then
echo "$msgprefix:Error: source and destination are the same" 1>&2
exit 1
fi
# iterate over all source(s)
for src in $srcs; do
dst=$dstpath
# Make a temp file name in the destination directory
dstdir=`echo $dst | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'`
dsttmp="$dstdir/#INST@$$#"
# if destination is a directory, append the input filename
if [ $dstisdir = 1 ]; then
dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'`
dst="$dst/$dstfile"
fi
# Verbosity
if [ ".$opt_v" = .yes ]; then
echo "$src -> $dst" 1>&2
fi
# check for correct arguments
if [ ".$src" = ".$dst" ]; then
echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2
continue
# Copy or move the file name to the temp name
# (because we might be not allowed to change the source)
if [ ".$opt_C" = .yes ]; then
opt_c=yes
fi
if [ ".$opt_c" = .yes ]; then
if [ ".$opt_t" = .yes ]; then
echo "cp $src $dsttmp" 1>&2
fi
if [ -d "$src" ]; then
echo "$msgprefix:Warning: source \`$src' is a directory - skipped" 1>&2
continue
cp $src $dsttmp || exit $?
else
if [ ".$opt_t" = .yes ]; then
echo "mv $src $dsttmp" 1>&2
fi
mv $src $dsttmp || exit $?
fi
# make a temp file name in the destination directory
dsttmp=`echo $dst |\
sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \
-e "s;\$;/#INST@$$#;"`
# Adjust the target file
# (we do chmod last to preserve setuid bits)
if [ ".$opt_s" = .yes ]; then
if [ ".$opt_t" = .yes ]; then
echo "strip $dsttmp" 1>&2
fi
strip $dsttmp || exit $?
fi
if [ ".$opt_o" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chown $opt_o $dsttmp" 1>&2
fi
chown $opt_o $dsttmp || exit $?
fi
if [ ".$opt_g" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chgrp $opt_g $dsttmp" 1>&2
fi
chgrp $opt_g $dsttmp || exit $?
fi
if [ ".$opt_m" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chmod $opt_m $dsttmp" 1>&2
fi
chmod $opt_m $dsttmp || exit $?
fi
# verbosity
if [ ".$opt_v" = .yes ]; then
echo "$src -> $dst" 1>&2
# Determine whether to do a quick install
# (has to be done _after_ the strip was already done)
quick=no
if [ ".$opt_C" = .yes ]; then
if [ -r $dst ]; then
if cmp -s $src $dst; then
quick=yes
fi
fi
fi
# copy or move the file name to the temp name
# (because we might be not allowed to change the source)
if [ ".$opt_C" = .yes ]; then
opt_c=yes
# Finally install the file to the real destination
if [ $quick = yes ]; then
if [ ".$opt_t" = .yes ]; then
echo "rm -f $dsttmp" 1>&2
fi
if [ ".$opt_c" = .yes ]; then
if [ ".$opt_t" = .yes ]; then
echo "cp $src $dsttmp" 1>&2
fi
cp $src $dsttmp || exit $?
else
if [ ".$opt_t" = .yes ]; then
echo "mv $src $dsttmp" 1>&2
fi
mv $src $dsttmp || exit $?
rm -f $dsttmp
else
if [ ".$opt_t" = .yes ]; then
echo "rm -f $dst && mv $dsttmp $dst" 1>&2
fi
# adjust the target file
if [ ".$opt_e" != . ]; then
sed='sed'
for e in $opt_e; do
sed="$sed -e '$e'"
done
cp $dsttmp $dsttmp.old
eval "$sed <$dsttmp.old >$dsttmp" || exit $?
rm -f $dsttmp.old
fi
if [ ".$opt_s" = .yes ]; then
if [ ".$opt_t" = .yes ]; then
echo "strip $dsttmp" 1>&2
fi
strip $dsttmp || exit $?
fi
if [ ".$opt_o" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chown $opt_o $dsttmp" 1>&2
fi
chown $opt_o $dsttmp || exit $?
fi
if [ ".$opt_g" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chgrp $opt_g $dsttmp" 1>&2
fi
chgrp $opt_g $dsttmp || exit $?
fi
if [ ".$opt_m" != ".-" ]; then
if [ ".$opt_t" = .yes ]; then
echo "chmod $opt_m $dsttmp" 1>&2
fi
chmod $opt_m $dsttmp || exit $?
fi
# determine whether to do a quick install
# (has to be done _after_ the strip was already done)
quick=no
if [ ".$opt_C" = .yes ]; then
if [ -r $dst ]; then
if cmp -s $src $dst; then
quick=yes
fi
fi
fi
# finally, install the file to the real destination
if [ $quick = yes ]; then
if [ ".$opt_t" = .yes ]; then
echo "rm -f $dsttmp" 1>&2
fi
rm -f $dsttmp
else
if [ ".$opt_t" = .yes ]; then
echo "rm -f $dst && mv $dsttmp $dst" 1>&2
fi
rm -f $dst && mv $dsttmp $dst
fi
done
rm -f $dst && mv $dsttmp $dst
fi
;;
mkdir )
##
## mkdir -- Make one or more directories
## Copyright (c) 1996-2001 Ralf S. Engelschall <rse@engelschall.com>
## Copyright (c) 1996-2000 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for public domain by Noah Friedman <friedman@prep.ai.mit.edu>
## Cleaned up and enhanced for shtool
##
@@ -727,7 +662,7 @@ mkdir )
for p in ${1+"$@"}; do
# if the directory already exists...
if [ -d "$p" ]; then
if [ ".$opt_f" = .no -a ".$opt_p" = .no ]; then
if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then
echo "$msgprefix:Error: directory already exists: $p" 1>&2
errstatus=1
break
@@ -741,12 +676,6 @@ mkdir )
echo "mkdir $p" 1>&2
fi
mkdir $p || errstatus=$?
if [ ".$opt_m" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chmod $opt_m $p" 1>&2
fi
chmod $opt_m $p || errstatus=$?
fi
else
# the smart situation
set fnord `echo ":$p" |\
+34
View File
@@ -0,0 +1,34 @@
#! /bin/sh
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
# | available at through the world-wide-web at |
# | http://www.php.net/license/2_02.txt. |
# | If you did not receive a copy of the PHP license and are unable to |
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id$
#
# cwd must be top_srcdir
test -f build/sysv_makefile || exit 2
test -f bsd_converted || exit 1
tmpfile=`mktemp /tmp/sysv_makefile.XXXXXX` || tmpfile="tmp.$$"
for i in build/*.mk; do
sed 's/^\.include "\(.*\)"/include \1/' $i >$tmpfile \
&& cp $tmpfile $i
done
rm -f $tmpfile
rm bsd_converted
exit 0
+146 -184
View File
@@ -24,6 +24,7 @@ dnl ## All of these are normally in the extension directories.
dnl ## Diversion 5 is the last one. Here we generate files and clean up.
dnl Basic autoconf + automake initialization, generation of config.nice.
dnl -------------------------------------------------------------------------
@@ -35,19 +36,11 @@ for arg in $0 "$@"; do
done
AC_CANONICAL_HOST
AC_CONFIG_HEADER(main/php_config.h)
AM_INIT_AUTOMAKE(php, 4.2.2, nodefine)
AM_CONFIG_HEADER(main/php_config.h)
AM_MAINTAINER_MODE
MAJOR_VERSION=4
MINOR_VERSION=3
RELEASE_VERSION=0
EXTRA_VERSION="-dev"
VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
dnl Define where extension directories are located in the configure context
AC_DEFUN(PHP_EXT_BUILDDIR,[ext/$1])dnl
AC_DEFUN(PHP_EXT_DIR,[ext/$1])dnl
AC_DEFUN(PHP_EXT_SRCDIR,[$abs_srcdir/ext/$1])dnl
AC_DEFUN(PHP_ALWAYS_SHARED,[])dnl
dnl Setting up the PHP version based on the information above.
dnl -------------------------------------------------------------------------
@@ -55,17 +48,13 @@ dnl -------------------------------------------------------------------------
PHP_VERSION=$VERSION
echo "/* automatically generated by configure */" > php_version.h.new
echo "/* edit configure.in to change version number */" >> php_version.h.new
echo "#define PHP_MAJOR_VERSION $MAJOR_VERSION" >> php_version.h.new
echo "#define PHP_MINOR_VERSION $MINOR_VERSION" >> php_version.h.new
echo "#define PHP_RELEASE_VERSION $RELEASE_VERSION" >> php_version.h.new
echo "#define PHP_EXTRA_VERSION \"$EXTRA_VERSION\"" >> php_version.h.new
echo "#define PHP_VERSION \"$PHP_VERSION\"" >> php_version.h.new
cmp php_version.h.new php_version.h >/dev/null 2>&1
if test $? -ne 0 ; then
rm -f php_version.h && mv php_version.h.new php_version.h && \
echo 'Updated php_version.h'
else
rm -f php_version.h.new
rm -f php_version.h.new
fi
@@ -103,7 +92,7 @@ case $host_alias in
*dgux*)
CPPFLAGS="$CPPFLAGS -D_BSD_TIMEOFDAY_FLAVOR";;
*darwin*|*rhapsody*)
CPPFLAGS="$CPPFLAGS -no-cpp-precomp";;
CPPFLAGS="$CPPFLAGS -traditional-cpp";;
*bsdi*)
BSD_MAKEFILE=yes;;
*beos*)
@@ -120,8 +109,6 @@ dnl -------------------------------------------------------------------------
cwd=`pwd`
PHP_INIT_BUILD_SYSTEM
php_shtool=$srcdir/build/shtool
T_MD=`$php_shtool echo -n -e %B`
T_ME=`$php_shtool echo -n -e %b`
@@ -129,15 +116,10 @@ T_ME=`$php_shtool echo -n -e %b`
dnl We want this one before the checks, so the checks can modify CFLAGS.
test -z "$CFLAGS" && auto_cflags=1
dnl AC_AIX needs to be before any macros that run the C compiler.
AC_AIX
abs_srcdir=`(cd $srcdir; pwd)`
abs_builddir=`pwd`
php_abs_top_srcdir=$abs_srcdir
php_abs_top_builddir=$abs_builddir
dnl Because ``make install'' is often performed by the superuser,
dnl we create the libs subdirectory as the user who configures PHP.
dnl Otherwise, the current user will not be able to delete libs
@@ -146,42 +128,44 @@ dnl or the contents of libs.
$php_shtool mkdir -p libs
rm -f libs/*
PHP_FAST_OUTPUT(sapi/Makefile ext/Makefile Makefile pear/Makefile main/Makefile sapi/cli/Makefile)
dnl Checks for programs.
dnl -------------------------------------------------------------------------
AC_PROG_CC
AC_PROG_CC_C_O
dnl Change to AC_PROG_CC_STDC when we start requiring a post-2.13 autoconf
dnl AC_PROG_CC_STDC
AC_PROG_CPP
AC_AIX
dnl Change to AC_PROG_CC_STDC when we start requiring a post-2.13 autoconf
AM_PROG_CC_STDC
dnl AC_PROG_CXX
dnl AC_PROG_CXXCPP
dnl check for -R, etc. switch
AC_MSG_CHECKING([whether compiler supports -R])
AC_CACHE_VAL(php_cv_cc_dashr,[
SAVE_LIBS=$LIBS
LIBS="-R /usr/lib $LIBS"
AC_TRY_LINK([], [], php_cv_cc_dashr=yes, php_cv_cc_dashr=no)
LIBS=$SAVE_LIBS
])
SAVE_LIBS=$LIBS
LIBS="-R /usr/lib $LIBS"
AC_TRY_LINK([], [], php_cv_cc_dashr=yes, php_cv_cc_dashr=no)
LIBS=$SAVE_LIBS])
AC_MSG_RESULT([$php_cv_cc_dashr])
if test $php_cv_cc_dashr = "yes"; then
ld_runpath_switch=-R
ld_runpath_switch=-R
else
AC_MSG_CHECKING([whether compiler supports -Wl,-rpath,])
AC_CACHE_VAL(php_cv_cc_rpath, [
SAVE_LIBS=$LIBS
LIBS="-Wl,-rpath,/usr/lib $LIBS"
AC_TRY_LINK([], [], php_cv_cc_rpath=yes, php_cv_cc_rpath=no)
LIBS=$SAVE_LIBS
])
AC_MSG_RESULT([$php_cv_cc_rpath])
if test $php_cv_cc_rpath = "yes"; then
ld_runpath_switch=-Wl,-rpath,
else
dnl something innocuous
ld_runpath_switch=-L
fi
AC_MSG_CHECKING([whether compiler supports -Wl,-rpath,])
AC_CACHE_VAL(php_cv_cc_rpath,[
SAVE_LIBS=$LIBS
LIBS="-Wl,-rpath,/usr/lib $LIBS"
AC_TRY_LINK([], [], php_cv_cc_rpath=yes, php_cv_cc_rpath=no)
LIBS=$SAVE_LIBS])
AC_MSG_RESULT([$php_cv_cc_rpath])
if test $php_cv_cc_rpath = "yes"; then
ld_runpath_switch=-Wl,-rpath,
else
dnl something innocuous
ld_runpath_switch=-L
fi
fi
AC_PROG_RANLIB
AC_PROG_LN_S
@@ -235,7 +219,7 @@ dnl -------------------------------------------------------------------------
PTHREADS_CHECK
PHP_HELP_SEPARATOR([SAPI modules:])
PHP_SHLIB_SUFFIX_NAME
PHP_SAPI=default
PHP_SAPI=cgi
PHP_BUILD_PROGRAM
@@ -253,10 +237,6 @@ PHP_CONFIGURE_PART(Configuring SAPI modules)
esyscmd(./scripts/config-stubs sapi)
if test "$PHP_SAPI" = "default"; then
PHP_SELECT_SAPI(cgi, program, cgi_main.c getopt.c)
fi
AC_MSG_CHECKING([for chosen SAPI module])
AC_MSG_RESULT([$PHP_SAPI])
@@ -266,6 +246,7 @@ if test "$enable_experimental_zts" = "yes"; then
fi
divert(3)
dnl ## In diversion 3 we check for compile-time options to the PHP
@@ -307,18 +288,10 @@ AC_CHECK_LIB(socket, socket, [
dnl Some systems (OpenServer 5) dislike -lsocket -lnsl, so we try
dnl to avoid -lnsl checks, if we already have the functions which
dnl are usually in libnsl
dnl Also, uClibc will bark at linking with glibc's libnsl.
unset ac_cv_func_gethostname
unset ac_cv_func_yp_get_default_domain
AC_CHECK_FUNC(gethostname, [
php_no_nsl_checks=yes
],[
AC_CHECK_FUNC(yp_get_default_domain, [
php_no_nsl_checks=yes
])
])
unset ac_cv_func_gethostname
AC_CHECK_FUNC(yp_get_default_domain,
[php_no_nsl_checks=yes],[])
unset ac_cv_func_yp_get_default_domain
if test "$php_no_nsl_checks" != "yes"; then
@@ -374,9 +347,9 @@ AC_HEADER_STDC
dnl In QNX opendir resides in libc but dirent.h is still required
if test "`uname -s 2>/dev/null`" != "QNX"; then
AC_HEADER_DIRENT
AC_HEADER_DIRENT
else
AC_CHECK_HEADERS(dirent.h)
AC_CHECK_HEADERS(dirent.h)
fi
PHP_MISSING_FCLOSE_DECL
dnl QNX requires unix.h to allow functions in libunix to work properly
@@ -385,7 +358,6 @@ ApplicationServices/ApplicationServices.h \
alloca.h \
arpa/inet.h \
arpa/nameser.h \
assert.h \
crypt.h \
fcntl.h \
grp.h \
@@ -393,7 +365,6 @@ ieeefp.h \
langinfo.h \
limits.h \
locale.h \
mach-o/dyld.h \
netinet/in.h \
pwd.h \
resolv.h \
@@ -406,7 +377,6 @@ sysexits.h \
sys/file.h \
sys/mman.h \
sys/mount.h \
sys/poll.h \
sys/resource.h \
sys/select.h \
sys/socket.h \
@@ -421,7 +391,6 @@ sys/wait.h \
unistd.h \
unix.h \
utime.h \
sys/utsname.h \
)
@@ -444,10 +413,10 @@ AC_STRUCT_ST_BLKSIZE
dnl AC_STRUCT_ST_BLOCKS will screw QNX because fileblocks.o does not exists
dnl The WARNING_LEVEL required because cc in QNX hates -w option without an argument
if test "`uname -s 2>/dev/null`" != "QNX"; then
AC_STRUCT_ST_BLOCKS
AC_STRUCT_ST_BLOCKS
else
AC_MSG_WARN([warnings level for cc set to 0])
WARNING_LEVEL=0
AC_MSG_WARN([warnings level for cc set to 0])
WARNING_LEVEL=0
fi
AC_STRUCT_ST_RDEV
@@ -466,10 +435,10 @@ fi
dnl Check for IPv6 support
AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support,
[AC_TRY_LINK([ #include <sys/types.h>
[AC_TRY_COMPILE([ #include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
[ac_cv_ipv6_support=yes], [ac_cv_ipv6_support=no])])
#include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s],
ac_cv_ipv6_support=yes, ac_cv_ipv6_support=no)])
if test "$ac_cv_ipv6_support" = yes; then
AC_DEFINE(HAVE_IPV6,1,[Whether you have IPv6 support])
fi
@@ -634,20 +603,20 @@ if test "$PHP_CONFIG_FILE_PATH" = "DEFAULT"; then
fi
# compatibility
if test -z "$with_pear" && test "$enable_pear" = "no"; then
with_pear=no
if test "x$with_pear" = "x" -a "x$enable_pear" = "xno"; then
with_pear=no
fi
PHP_ARG_WITH(pear, [whether to install PEAR, and where],
[ --with-pear=DIR Install PEAR in DIR (default PREFIX/lib/php)
--without-pear Do not install PEAR], DEFAULT)
if test "$PHP_PEAR" != "no" && test "$disable_cli" != "1"; then
install_pear="install-pear install-build install-headers install-programs"
if test "$PHP_PEAR" != "no"; then
PEAR_DIR=pear
PEAR_INSTALLDIR=$PHP_PEAR
fi
if test "$PHP_PEAR" = "DEFAULT" || test "$PHP_PEAR" = "yes"; then
if test "$PHP_PEAR" = "DEFAULT" -o "x$PHP_PEAR" = "xyes"; then
case $PHP_LAYOUT in
GNU) PEAR_INSTALLDIR=$datadir/pear;;
*) PEAR_INSTALLDIR=$libdir/php;;
@@ -671,27 +640,29 @@ AC_ARG_WITH(exec-dir,
defaults to /usr/local/php/bin],
[
if test "$withval" != "no"; then
if test "$withval" = "yes"; then
AC_DEFINE(PHP_SAFE_MODE_EXEC_DIR,"/usr/local/php/bin", [ ])
AC_MSG_RESULT([/usr/local/php/bin])
else
AC_DEFINE_UNQUOTED(PHP_SAFE_MODE_EXEC_DIR,"$withval", [ ])
AC_MSG_RESULT([$withval])
fi
if test "$withval" = "yes"; then
AC_DEFINE(PHP_SAFE_MODE_EXEC_DIR,"/usr/local/php/bin", [ ])
AC_MSG_RESULT([/usr/local/php/bin])
else
AC_DEFINE_UNQUOTED(PHP_SAFE_MODE_EXEC_DIR,"$withval", [ ])
AC_MSG_RESULT([$withval])
fi
else
AC_DEFINE(PHP_SAFE_MODE_EXEC_DIR,"/usr/local/php/bin", [ ])
AC_MSG_RESULT([/usr/local/php/bin])
AC_DEFINE(PHP_SAFE_MODE_EXEC_DIR,"/usr/local/php/bin", [ ])
AC_MSG_RESULT([/usr/local/php/bin])
fi
],[
AC_DEFINE(PHP_SAFE_MODE_EXEC_DIR,"/usr/local/php/bin", [ ])
AC_MSG_RESULT([/usr/local/php/bin])
AC_DEFINE(PHP_SAFE_MODE_EXEC_DIR,"/usr/local/php/bin", [ ])
AC_MSG_RESULT([/usr/local/php/bin])
])
PHP_ARG_WITH(openssl,for OpenSSL support,
[ --with-openssl[=DIR] Include OpenSSL support (requires OpenSSL >= 0.9.5) ])
if test "$PHP_OPENSSL" = "yes"; then
PHP_OPENSSL="/usr/local/ssl /usr/local /usr /usr/local/openssl"
fi
if test "$PHP_OPENSSL" != "no"; then
ext_openssl_shared=$ext_shared
PHP_SETUP_OPENSSL
fi
@@ -788,6 +759,9 @@ PHP_CONFIGURE_PART(Configuring extensions)
# reading config stubs
esyscmd(./scripts/config-stubs ext)
PHP_FAST_OUTPUT(sapi/$PHP_SAPI/Makefile)
dnl Other settings.
dnl -------------------------------------------------------------------------
@@ -818,17 +792,28 @@ unset with_pic
case $php_build_target in
program|static)
standard_libtool_flag='-prefer-non-pic -static'
if test -z "$PHP_MODULES"; then
if test "$lib_build_shared" != "yes"; then
enable_shared=no
fi
PHP_COMPILE='$(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -c $< && touch $@'
CXX_PHP_COMPILE='$(CXX) $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -c $< && touch $@'
;;
shared)
enable_static=no
standard_libtool_flag=-prefer-pic
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -avoid-version -module"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -avoid-version"
;;
esac
if test "$PHP_SAPI" = "cgi"; then
PHP_PROGRAM=php
fi
if test "$PHP_SAPI" = "fastcgi"; then
PHP_PROGRAM=php
fi
PHP_REGEX
EXTRA_LIBS="$EXTRA_LIBS $DLIBS $LIBS"
@@ -913,16 +898,16 @@ if test -z "$EXTENSION_DIR"; then
part2=non-zts
fi
extbasedir=$part1-$part2-$extbasedir
EXTENSION_DIR=$libdir/extensions/$extbasedir
EXTENSION_DIR=$libdir/extensions/$extbasedir
else
if test "$enable_experimental_zts" = "yes"; then
extbasedir=$extbasedir-zts
fi
if test "$PHP_DEBUG" = "1"; then
extbasedir=$extbasedir-debug
fi
EXTENSION_DIR=$libdir/$extbasedir
if test "$enable_experimental_zts" = "yes"; then
extbasedir=$extbasedir-zts
fi
if test "$PHP_DEBUG" = "1"; then
extbasedir=$extbasedir-debug
fi
EXTENSION_DIR=$libdir/$extbasedir
fi
fi
@@ -965,26 +950,23 @@ AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[uname -a output])
PHP_OS=`uname`
AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS",[uname output])
if test "$disable_cli" != "1"; then
PHP_CLI_TARGET=sapi/cli/php
PHP_INSTALL_CLI_TARGET="install-cli"
PHP_ADD_SOURCES(sapi/cli, php_cli.c getopt.c,, cli)
if test "$disable_cli" = "1"; then
CLI_DIR=
else
CLI_DIR=sapi/cli
fi
PHP_SUBST(PHP_CLI_TARGET)
PHP_SUBST(PHP_SAPI_OBJS)
PHP_SUBST(PHP_CLI_OBJS)
PHP_SUBST(PHP_GLOBAL_OBJS)
PHP_SUBST(PHP_MODULES)
PHP_SUBST(CLI_DIR)
PHP_SUBST(EXT_SUBDIRS)
PHP_SUBST(EXT_STATIC)
PHP_SUBST(EXT_SHARED)
PHP_SUBST(EXT_LIBS)
PHP_SUBST(EXT_LTLIBS)
PHP_SUBST(EXT_CLI_LTLIBS)
PHP_SUBST_OLD(abs_builddir)
PHP_SUBST_OLD(abs_srcdir)
PHP_SUBST_OLD(php_abs_top_builddir)
PHP_SUBST_OLD(php_abs_top_srcdir)
PHP_SUBST(bindir)
PHP_SUBST(exec_prefix)
PHP_SUBST(includedir)
@@ -1013,8 +995,7 @@ PHP_SUBST_OLD(EXTENSION_DIR)
PHP_SUBST(EXTRA_LDFLAGS)
PHP_SUBST_OLD(EXTRA_LIBS)
PHP_SUBST_OLD(ZEND_EXTRA_LIBS)
PHP_SUBST_OLD(INCLUDES)
PHP_SUBST_OLD(EXTRA_INCLUDES)
PHP_SUBST(INCLUDES)
PHP_SUBST_OLD(INCLUDE_PATH)
PHP_SUBST_OLD(INSTALL_IT)
PHP_SUBST(LEX)
@@ -1023,15 +1004,16 @@ PHP_SUBST(LFLAGS)
PHP_SUBST(LIBTOOL)
PHP_SUBST(LN_S)
PHP_SUBST_OLD(NATIVE_RPATHS)
PHP_SUBST(PEAR_DIR)
PHP_SUBST_OLD(PEAR_INSTALLDIR)
PHP_SUBST(PHP_BUILD_DATE)
PHP_SUBST(PHP_COMPILE)
PHP_SUBST_OLD(PHP_LDFLAGS)
PHP_SUBST_OLD(PHP_LIBS)
PHP_SUBST(OVERALL_TARGET)
PHP_SUBST(PHP_PROGRAM)
PHP_SUBST(PHP_RPATHS)
PHP_SUBST(PHP_SAPI)
PHP_SUBST_OLD(PHP_VERSION)
PHP_SUBST(PHP_VERSION)
PHP_SUBST(PROG_SENDMAIL)
PHP_SUBST(SHELL)
PHP_SUBST(SHARED_LIBTOOL)
@@ -1039,7 +1021,6 @@ PHP_SUBST(TSRM_DIR)
PHP_SUBST(TSRM_LIB)
PHP_SUBST(WARNING_LEVEL)
PHP_SUBST_OLD(YACC)
PHP_SUBST_OLD(SHLIB_SUFFIX_NAME)
old_CC=$CC
@@ -1060,9 +1041,9 @@ if test "$PHP_THREAD_SAFETY" = "yes" && test "$PHP_MYSQL" = "yes"; then
CPPFLAGS="$CPPFLAGS -DTHREAD=1"
fi
AC_PROG_LIBTOOL
AM_PROG_LIBTOOL
if test "$enable_debug" != "yes"; then
PHP_SET_LIBTOOL_VARIABLE([--silent])
AM_SET_LIBTOOL_VARIABLE([--silent])
fi
@@ -1076,80 +1057,33 @@ PHP_CONFIGURE_PART(Generating files)
CXXFLAGS_CLEAN=$CXXFLAGS
CFLAGS_CLEAN=$CFLAGS
CFLAGS="\$(CFLAGS_CLEAN) $standard_libtool_flag"
CFLAGS="$CFLAGS $standard_libtool_flag"
INLINE_CFLAGS="$INLINE_CFLAGS $standard_libtool_flag"
CXXFLAGS="$CXXFLAGS $standard_libtool_flag"
all_targets='$(OVERALL_TARGET) $(PHP_MODULES) $(PHP_CLI_TARGET)'
install_targets="install-sapi install-modules $PHP_INSTALL_CLI_TARGET $install_pear"
PHP_SUBST(all_targets)
PHP_SUBST(install_targets)
PHP_ADD_SOURCES(TSRM, TSRM.c tsrm_strtok_r.c tsrm_virtual_cwd.c)
PHP_ADD_SOURCES(main, main.c snprintf.c spprintf.c php_sprintf.c \
safe_mode.c fopen_wrappers.c alloca.c \
php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \
strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c \
streams.c network.c php_open_temporary_file.c php_logos.c \
output.c memory_streams.c user_streams.c)
PHP_ADD_SOURCES(/main, internal_functions.c,, sapi)
PHP_ADD_SOURCES(/main, internal_functions_cli.c,, cli)
PHP_ADD_SOURCES(/Zend, zend_language_parser.c zend_language_scanner.c \
zend_ini_parser.c zend_ini_scanner.c)
PHP_ADD_SOURCES(Zend, \
zend_alloc.c zend_compile.c zend_constants.c zend_dynamic_array.c \
zend_execute_API.c zend_highlight.c zend_llist.c \
zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \
zend_variables.c zend.c zend_API.c zend_extensions.c zend_hash.c \
zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c \
zend_ini.c zend_qsort.c zend_multibyte.c)
if test -r "$abs_srcdir/Zend/zend_objects.c"; then
PHP_ADD_SOURCES(Zend, zend_objects.c zend_object_handlers.c zend_objects_API.c)
fi
dnl Selectively disable optimization due to high RAM usage during
dnl compiling the executor.
if test -n "$GCC" && test "$ZEND_INLINE_OPTIMIZATION" != "yes"; then
flag=-O0
else
flag=
fi
PHP_ADD_SOURCES_X(Zend, zend_execute.c,,PHP_GLOBAL_OBJS,,$flag)
PHP_ADD_BUILD_DIR(main)
PHP_ADD_BUILD_DIR(regex)
PHP_ADD_BUILD_DIR(sapi/$PHP_SAPI sapi/cli)
PHP_ADD_BUILD_DIR(TSRM)
PHP_ADD_BUILD_DIR(Zend)
PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/pear/Makefile.frag,$abs_srcdir/pear,pear)
PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/Makefile.frag,$abs_srcdir/Zend,Zend)
PHP_GEN_BUILD_DIRS
PHP_GEN_GLOBAL_MAKEFILE
PHP_GEN_CONFIG_VARS
$php_shtool mkdir -p pear/scripts
ALL_OUTPUT_FILES="php4.spec main/build-defs.h \
pear/scripts/phpize pear/scripts/php-config \
$PHP_OUTPUT_FILES"
ALL_OUTPUT_FILES="php4.spec Zend/Makefile main/build-defs.h \
pear/scripts/pear pear/scripts/phpize pear/scripts/php-config \
pear/scripts/pearize pear/scripts/phptar \
TSRM/Makefile $PHP_OUTPUT_FILES"
AC_OUTPUT($ALL_OUTPUT_FILES, [], [
if test "\$CONFIG_FILES" = "$ALL_OUTPUT_FILES" || test "\$CONFIG_FILES" = " $ALL_OUTPUT_FILES" || test -z "\$CONFIG_FILES"; then
if test "\$CONFIG_FILES" = "$ALL_OUTPUT_FILES" || test -z "\$CONFIG_FILES"; then
REDO_ALL=yes
fi
if test -n "\$REDO_ALL"; then
PHP_GEN_MAKEFILES($PHP_FAST_OUTPUT_FILES)
fi
if test ! -f $srcdir/ext/bcmath/number.c; then
echo "creating number.c"
echo "/* Dummy File */" > $srcdir/ext/bcmath/number.c
echo "creating number.h"
echo "/* Dummy File */" > $srcdir/ext/bcmath/number.h
echo "creating number.c"
echo "/* Dummy File */" > $srcdir/ext/bcmath/number.c
echo "creating number.h"
echo "/* Dummy File */" > $srcdir/ext/bcmath/number.h
fi
################################################################
@@ -1188,6 +1122,33 @@ dnl else
dnl rm -f main/internal_functions.c.old
dnl fi
# experimental things
if test $PHP_SAPI = "apache2filter" ; then
echo "+--------------------------------------------------------------------+"
echo "| *** WARNING *** |"
echo "| |"
echo "| Apache 2 Support is EXPERIMENTAL and should NOT be used in |"
echo "| production environment. Before submitting bug reports, try the |"
echo "| latest CVS snapshot from http://snaps.php.net |"
fi
if test "$PHP_OVERLOAD" != "no"; then
echo "+--------------------------------------------------------------------+"
echo "| *** WARNING *** |"
echo "| |"
echo "| The overload extension is highly EXPERIMENTAL and will most |"
echo "| certainly change in newer versions. You have been warned! |"
fi
if test "$PHP_AGGREGATE" != "no"; then
echo "+--------------------------------------------------------------------+"
echo "| *** WARNING *** |"
echo "| |"
echo "| The aggregate functions are highly EXPERIMENTAL and will most |"
echo "| certainly change in newer versions. You have been warned! |"
fi
if test $UNAME = "FreeBSD" && test $PHP_SAPI = "apache2filter" && test $TSRM_PTH != "pth-config" ; then
echo "+--------------------------------------------------------------------+"
echo "| *** WARNING *** |"
@@ -1239,7 +1200,7 @@ cat <<X
X
fi
if test "$MYSQL_MODULE_TYPE" = "builtin" && test "$PHP_SAPI" != "cgi" && test "$PHP_SAPI" != "cli"; then
if test "$MYSQL_MODULE_TYPE" = "builtin" ; then
cat <<X
+--------------------------------------------------------------------+
| *** WARNING *** |
@@ -1300,6 +1261,7 @@ cat<<X
+--------------------------------------------------------------------+
Thank you for using PHP.
X
+88
View File
@@ -0,0 +1,88 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
# | available at through the world-wide-web at |
# | http://www.php.net/license/2_02.txt. |
# | If you did not receive a copy of the PHP license and are unable to |
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id$
#
AC_DEFUN(LIB_SHARED_CONVENIENCE,[
lib_target="\$(LTLIBRARY_NAME)"
cat >>$1<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \[$]@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
EOF
])
AC_DEFUN(LIB_SHARED_MODULE,[
lib_target="\$(LTLIBRARY_SHARED_NAME)"
cat >>$1<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
\$(SHARED_LIBTOOL) --mode=link \$(CC) \$(COMMON_FLAGS) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(LDFLAGS) -o \[$]@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
\$(SHARED_LIBTOOL) --mode=install cp \[$]@ \$(phplibdir)
EOF
])
AC_DEFUN(LIB_STATIC_CONVENIENCE,[
lib_target="\$(LTLIBRARY_NAME)"
cat >>$1<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)
EOF
])
dnl LIB_BUILD(path, shared, convenience)
dnl sets up path to build a shared/static convenience/module
AC_DEFUN(LIB_BUILD,[
lib_makefile="$1/libs.mk"
lib_target=""
$php_shtool mkdir -p $1
if test "$BSD_MAKEFILE" = "yes"; then
lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
else
lib_include_conf="include \$(top_builddir)/config_vars.mk"
fi
cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF
if test "$2" = "shared" || test "$2" = "yes"; then
lib_build_shared=yes
if test -n "$3"; then
dnl ---------------------------------------- Shared Convenience
LIB_SHARED_CONVENIENCE($lib_makefile)
else
dnl ---------------------------------------- Shared Module
LIB_SHARED_MODULE($lib_makefile)
fi
else
dnl ---------------------------------------- Static Convenience = Static Module
LIB_STATIC_CONVENIENCE($lib_makefile)
fi
dnl ---------------------------------------- Generate build targets
if test -n "$lib_target"; then
cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
fi
])
+4
View File
@@ -0,0 +1,4 @@
SUBDIRS = $(EXT_SUBDIRS)
include $(top_srcdir)/build/rules.mk
+5
View File
@@ -0,0 +1,5 @@
LTLIBRARY_NAME = libaspell.la
LTLIBRARY_SOURCES = aspell.c
include $(top_srcdir)/build/dynlib.mk
+1 -1
View File
@@ -21,7 +21,7 @@ AC_ARG_WITH(aspell,
fi
AC_DEFINE(HAVE_ASPELL,1,[Whether you have aspell])
AC_MSG_RESULT(yes)
PHP_NEW_EXTENSION(aspell, aspell.c)
PHP_EXTENSION(aspell)
else
AC_MSG_RESULT(no)
fi
+11
View File
@@ -0,0 +1,11 @@
LTLIBRARY_NAME = libbcmath.la
LTLIBRARY_SOURCES = bcmath.c number.c
LTLIBRARY_SHARED_NAME = bcmath.la
LTLIBRARY_DEPENDENCIES = libbcmath/libbcmath.la
LTLIBRARY_LIBADD = $(LTLIBRARY_DEPENDENCIES)
LTLIBRARY_SHARED_LIBADD = $(LTLIBRARY_LIBADD)
SUBDIRS = libbcmath
include $(top_srcdir)/build/dynlib.mk
+4 -7
View File
@@ -7,11 +7,8 @@ PHP_ARG_ENABLE(bcmath, whether to enable bc style precision math functions,
if test "$PHP_BCMATH" != "no"; then
AC_DEFINE(WITH_BCMATH, 1, [Whether you have bcmath])
PHP_NEW_EXTENSION(bcmath, bcmath.c number.c \
libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c libbcmath/src/outofmem.c libbcmath/src/raisemod.c libbcmath/src/rt.c libbcmath/src/sub.c \
libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/output.c libbcmath/src/recmul.c \
libbcmath/src/sqrt.c libbcmath/src/zero.c libbcmath/src/debug.c libbcmath/src/doaddsub.c libbcmath/src/nearzero.c libbcmath/src/num2str.c libbcmath/src/raise.c \
libbcmath/src/rmzero.c libbcmath/src/str2num.c,
$ext_shared,,-I@ext_srcdir@/libbcmath/src)
PHP_ADD_BUILD_DIR($ext_builddir/libbcmath/src)
PHP_EXTENSION(bcmath, $ext_shared)
PHP_FAST_OUTPUT($ext_builddir/libbcmath/Makefile $ext_builddir/libbcmath/src/Makefile)
LIB_BUILD($ext_builddir/libbcmath,$ext_shared,yes)
LIB_BUILD($ext_builddir/libbcmath/src,$ext_shared,yes)
fi
+9
View File
@@ -0,0 +1,9 @@
LTLIBRARY_NAME = libbcmath.la
LTLIBRARY_DEPENDENCIES = src/libbcmath.la
LTLIBRARY_LIBADD = $(LTLIBRARY_DEPENDENCIES)
LTLIBRARY_SHARED_LIBADD = $(LTLIBRARY_LIBADD)
SUBDIRS = src
include $(top_srcdir)/build/dynlib.mk
+3
View File
@@ -0,0 +1,3 @@
# Documentation makefile
MAINTAINERCLEANFILES= Makefile.in
+171
View File
@@ -0,0 +1,171 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
# Documentation makefile
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
CC = @CC@
MAKEINFO = @MAKEINFO@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
VERSION = @VERSION@
MAINTAINERCLEANFILES = Makefile.in
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps doc/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
tags: TAGS
TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = doc
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
info-am:
info: info-am
dvi-am:
dvi: dvi-am
check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
install-exec-am:
install-exec: install-exec-am
install-data-am:
install-data: install-data-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am:
uninstall: uninstall-am
all-am: Makefile
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
mostlyclean-am: mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-generic clean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
maintainer-clean: maintainer-clean-am
.PHONY: tags distdir info-am info dvi-am dvi check check-am \
installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
mostlyclean distclean maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
+1
View File
@@ -0,0 +1 @@
./" bcmath library documentation
+7
View File
@@ -0,0 +1,7 @@
LTLIBRARY_NAME = libbcmath.la
LTLIBRARY_SOURCES = add.c div.c init.c neg.c outofmem.c raisemod.c rt.c sub.c \
compare.c divmod.c int2num.c num2long.c output.c recmul.c \
sqrt.c zero.c debug.c doaddsub.c nearzero.c num2str.c raise.c \
rmzero.c str2num.c
include $(top_srcdir)/build/dynlib.mk
+6
View File
@@ -0,0 +1,6 @@
# $Source$
# $Id$
define_option enable-bcmath 'Enable bc style precision math functions' yesno \
yes \
' Enables bc style arbitrary precision math functions.'
+6
View File
@@ -0,0 +1,6 @@
LTLIBRARY_NAME = libcalendar.la
LTLIBRARY_SOURCES = calendar.c dow.c french.c gregor.c jewish.c julian.c easter.c cal_unix.c
LTLIBRARY_SHARED_NAME = calendar.la
include $(top_srcdir)/build/dynlib.mk
+1 -5
View File
@@ -127,11 +127,7 @@ PHP_MINIT_FUNCTION(calendar)
REGISTER_LONG_CONSTANT("CAL_MONTH_JULIAN_LONG", CAL_MONTH_JULIAN_LONG, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CAL_MONTH_JEWISH", CAL_MONTH_JEWISH, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CAL_MONTH_FRENCH", CAL_MONTH_FRENCH, CONST_CS|CONST_PERSISTENT);
/* constants for easter calculation */
REGISTER_LONG_CONSTANT("CAL_EASTER_DEFAULT", CAL_EASTER_DEFAULT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CAL_EASTER_ROMAN", CAL_EASTER_ROMAN, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CAL_EASTER_ALWAYS_GREGORIAN", CAL_EASTER_ALWAYS_GREGORIAN, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CAL_EASTER_ALWAYS_JULIAN", CAL_EASTER_ALWAYS_JULIAN, CONST_CS | CONST_PERSISTENT);
return SUCCESS;
}
+1 -1
View File
@@ -7,5 +7,5 @@ PHP_ARG_ENABLE(calendar,whether to enable calendar conversion support,
if test "$PHP_CALENDAR" = "yes"; then
AC_DEFINE(HAVE_CALENDAR,1,[ ])
PHP_NEW_EXTENSION(calendar, calendar.c dow.c french.c gregor.c jewish.c julian.c easter.c cal_unix.c, $ext_shared)
PHP_EXTENSION(calendar, $ext_shared)
fi
+21 -20
View File
@@ -29,35 +29,36 @@ static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, int gm)
/* based on code by Simon Kershaw, <webmaster@ely.anglican.org> */
struct tm te;
pval *year_arg;
struct tm *ta, te;
time_t the_time;
long year, golden, solar, lunar, pfm, dom, tmp, easter;
long method = CAL_EASTER_DEFAULT;
/* Default to the current year if year parameter is not given */
{
time_t a;
struct tm b;
time(&a);
php_localtime_r(&a, &b);
year = 1900 + b.tm_year;
}
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"|ll", &year, &method) == FAILURE) {
return;
switch(ZEND_NUM_ARGS()) {
case 0:
the_time = time(NULL);
ta = localtime(&the_time);
year = ta->tm_year + 1900;
break;
case 1:
if (getParameters(ht, 1, &year_arg) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long(year_arg);
year = Z_LVAL_P(year_arg);
break;
default:
WRONG_PARAM_COUNT;
}
if (gm && (year<1970 || year>2037)) { /* out of range for timestamps */
php_error(E_WARNING, "easter_date() is only valid for years between 1970 and 2037 inclusive");
php3_error(E_WARNING, "easter_date() is only valid for years between 1970 and 2037 inclusive");
RETURN_FALSE;
}
golden = (year % 19) + 1; /* the Golden number */
if ((year <= 1582 && method != CAL_EASTER_ALWAYS_GREGORIAN) ||
(year >= 1583 && year <= 1752 && method != CAL_EASTER_ROMAN && method != CAL_EASTER_ALWAYS_GREGORIAN) ||
method == CAL_EASTER_ALWAYS_JULIAN) { /* JULIAN CALENDAR */
if ( year <= 1752 ) { /* JULIAN CALENDAR */
dom = (year + (year/4) + 5) % 7; /* the "Dominical number" - finding a Sunday */
if (dom < 0) {
dom += 7;
@@ -125,7 +126,7 @@ PHP_FUNCTION(easter_date)
}
/* }}} */
/* {{{ proto int easter_days([int year, [int method]])
/* {{{ proto int easter_days([int year])
Return the number of days after March 21 that Easter falls on for a given year (defaults to current year) */
PHP_FUNCTION(easter_days)
{
-15
View File
@@ -32,19 +32,4 @@ PHP_FUNCTION(cal_info);
#define phpext_calendar_ptr calendar_module_ptr
/*
* Specifying the easter calculation method
*
* DEFAULT is Anglican, ie. use Julian calendar before 1753
* and Gregorian after that. With ROMAN, the cutoff year is 1582.
* ALWAYS_GREGORIAN and ALWAYS_JULIAN force the calendar
* regardless of date.
*
*/
#define CAL_EASTER_DEFAULT 0
#define CAL_EASTER_ROMAN 1
#define CAL_EASTER_ALWAYS_GREGORIAN 2
#define CAL_EASTER_ALWAYS_JULIAN 3
#endif
+8
View File
@@ -0,0 +1,8 @@
# $Id$
LTLIBRARY_NAME = libccvs.la
LTLIBRARY_SOURCES = ccvs.c
LTLIBRARY_SHARED_NAME = ccvs.la
LTLIBRARY_SHARED_LIBADD = $(CCVS_SHARED_LIBADD)
include $(top_srcdir)/build/dynlib.mk
+1 -1
View File
@@ -22,6 +22,6 @@ if test "$PHP_CCVS" != "no"; then
PHP_ADD_INCLUDE($CCVS_DIR/include)
PHP_ADD_LIBRARY_WITH_PATH(ccvs, $CCVS_DIR/lib, CCVS_SHARED_LIBADD)
PHP_NEW_EXTENSION(ccvs, ccvs.c, $ext_shared)
PHP_EXTENSION(ccvs, $ext_shared)
PHP_SUBST(CCVS_SHARED_LIBADD)
fi
+53 -542
View File
@@ -15,10 +15,9 @@
| Author: Zeev Suraski <zeev@zend.com> |
| Harald Radi <h.radi@nme.at> |
| Alan Brown <abrown@pobox.com> |
| Wez Furlong <wez@thebrainroom.com> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
/*
* This module implements support for COM components that support the IDispatch
* interface. Both local (COM) and remote (DCOM) components can be accessed.
@@ -58,7 +57,6 @@
#include <iostream.h>
#include <math.h>
#include <ocidl.h>
#include "php.h"
#include "php_ini.h"
@@ -67,12 +65,11 @@
#include "php_VARIANT.h"
static ITypeLib *php_COM_find_typelib(char *search_string, int mode TSRMLS_DC);
static int php_COM_load_typelib(ITypeLib *TypeLib, int mode TSRMLS_DC);
static int do_COM_offget(VARIANT *result, comval *array, pval *property, int cleanup TSRMLS_DC);
static int do_COM_propget(VARIANT *var_result, comval *obj, pval *arg_property, int cleanup TSRMLS_DC);
static void php_register_COM_class(TSRMLS_D);
static void php_COM_init(int module_number TSRMLS_DC);
static char *php_string_from_clsid(const CLSID *clsid TSRMLS_DC);
static int com_enable_events(comval *obj, int enable);
static int le_comval;
static int codepage;
@@ -81,9 +78,6 @@ static int codepage;
int resourcecounter = 1;
#endif
static unsigned char arg1and2_force_ref[] =
{ 2, BYREF_FORCE, BYREF_FORCE };
function_entry COM_functions[] = {
PHP_FE(com_load, NULL)
PHP_FE(com_invoke, NULL)
@@ -93,9 +87,6 @@ function_entry COM_functions[] = {
PHP_FE(com_propput, NULL)
PHP_FE(com_load_typelib, NULL)
PHP_FE(com_isenum, NULL)
PHP_FE(com_event_sink, arg1and2_force_ref)
PHP_FE(com_message_pump, NULL)
PHP_FE(com_print_typeinfo, NULL)
PHP_FALIAS(com_get, com_propget, NULL)
PHP_FALIAS(com_propset, com_propput, NULL)
@@ -270,7 +261,7 @@ PHPAPI HRESULT php_COM_set(comval *obj, IDispatch FAR* FAR* ppDisp, int cleanup
C_REFCOUNT(obj) = 1;
C_DISPATCH(obj) = pDisp;
C_HASTLIB(obj) = SUCCEEDED(C_DISPATCH_VT(obj)->GetTypeInfo(C_DISPATCH(obj), 0, LANG_NEUTRAL, &C_TYPEINFO(obj)));
dispparams.rgvarg = NULL;
dispparams.rgdispidNamedArgs = NULL;
dispparams.cArgs = 0;
@@ -281,11 +272,9 @@ PHPAPI HRESULT php_COM_set(comval *obj, IDispatch FAR* FAR* ppDisp, int cleanup
if (C_HASENUM(obj) = SUCCEEDED(C_DISPATCH_VT(obj)->Invoke(C_DISPATCH(obj), DISPID_NEWENUM, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
DISPATCH_METHOD|DISPATCH_PROPERTYGET, &dispparams, var_result, NULL, NULL))) {
if (V_VT(var_result) == VT_UNKNOWN) {
V_UNKNOWN(var_result)->lpVtbl->AddRef(V_UNKNOWN(var_result));
C_HASENUM(obj) = SUCCEEDED(V_UNKNOWN(var_result)->lpVtbl->QueryInterface(V_UNKNOWN(var_result), &IID_IEnumVARIANT,
(void**)&C_ENUMVARIANT(obj)));
} else if (V_VT(var_result) == VT_DISPATCH) {
V_DISPATCH(var_result)->lpVtbl->AddRef(V_DISPATCH(var_result));
C_HASENUM(obj) = SUCCEEDED(V_DISPATCH(var_result)->lpVtbl->QueryInterface(V_DISPATCH(var_result), &IID_IEnumVARIANT,
(void**)&C_ENUMVARIANT(obj)));
}
@@ -369,10 +358,6 @@ PHPAPI HRESULT php_COM_destruct(comval *obj TSRMLS_DC)
{
HRESULT hr = S_OK;
com_enable_events(obj, FALSE);
if (obj->sinkdispatch)
obj->sinkdispatch->lpVtbl->Release(obj->sinkdispatch);
if (C_ISREFD(obj)) {
C_REFCOUNT(obj) = 1;
hr = php_COM_release(obj TSRMLS_CC);
@@ -522,34 +507,40 @@ PHP_FUNCTION(com_load)
server_name = NULL;
} else if (Z_TYPE_P(server_name) == IS_ARRAY) {
pval **tmp;
/* DAB: 22 Sept 2001
* Aha - we have a number of possible arguments.
* They are in the hash By name: Server, Domain, Username, Password
* Flags.
* This has been crafted to maintian maximum backward compatability.
* If the server name is specified as a string, then the function
* should behave as before by defaulting username and password and
* using the (I believe) incorrect CLSCTX_SERVER instantiation
* paramter. However if server is specified in this array then we
* use either CLSCTX_REMOTE_SERVER or whatever flags are specified
* in the array */
/* DAB: 22 Sept 2001 */
/* Aha - we have a number of possible */
/* arguments. They are in the hash */
/* By name: Server, Domain, Username, Password */
/* Flags. */
/* This has been crafted to maintian maximum backward */
/* compatability, If the server name is specified as a */
/* string, then the function shoule behave as before */
/* by defaulting username and password and using the */
/* (I believe) incorrect CLSCTX_SERVER instantiation */
/* paramter. However if server is specified in this array */
/* then we use either CLSCTX_REMOTE_SERVER or whatever */
/* flags are specified in the array */
HashTable *ht = Z_ARRVAL(*server_name);
if (FAILURE == zend_hash_find(ht, "Server", 7, (void **) &tmp)) {
server_name = NULL;
} else {
server_name = *tmp;
convert_to_string_ex(&server_name);
/* CLSCTX_SERVER includes INPROC and LOCAL SERVER. This means
* that any local server will be instantiated BEFORE even
* looking on a remote server. Thus if we have a server name,
* probably we want to access a remote machine or we would not
* have bothered specifying it. So it would be wrong to to
* connect locally. Futher, unless the name passed is a GUID,
* there has to be something to map the Prog.Id to GUID and
* unless that has been modified to remove the information
* about local instantiation CLSCTX_SERVER would force a local
* instantiation This setting can be overridden below if the
* user specifies a flags element */
/* CLSCTX_SERVER includes INPROC and LOCAL */
/* SERVER. This means that any local server */
/* will be instantiated BEFORE even looking */
/* on a remote server. Thus if we have a */
/* server name, probably we want to access */
/* a remote machine or we would not have */
/* bothered specifying it. So it would be */
/* wrong to to connect locally. Futher, */
/* unless the name passed is a GUID, there has */
/* to be something to map the Prog.Id to GUID */
/* and unless that has been modified to remove */
/* the information about local instantiation */
/* CLSCTX_SERVER would force a local instantiation */
/* This setting can be overridden below if the user */
/* specifies a flags element */
flags = CLSCTX_REMOTE_SERVER;
}
if (FAILURE == zend_hash_find(ht, "Username", 9, (void **) &tmp)) {
@@ -718,7 +709,7 @@ PHP_FUNCTION(com_load)
}
}
RETURN_RESOURCE(zend_list_insert(obj, IS_COM));
RETURN_LONG(zend_list_insert(obj, IS_COM));
}
/* }}} */
@@ -1013,461 +1004,6 @@ PHP_FUNCTION(com_addref)
}
/* }}} */
/* {{{ proto bool com_message_pump([int timeoutms])
Process COM messages, sleeping for up to timeoutms milliseconds */
PHP_FUNCTION(com_message_pump)
{
long timeoutms = 0;
MSG msg;
DWORD result;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &timeoutms) == FAILURE)
RETURN_FALSE;
result = MsgWaitForMultipleObjects(0, NULL, FALSE, timeoutms, QS_ALLINPUT);
if (result == WAIT_OBJECT_0) {
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
/* we processed messages */
RETVAL_TRUE;
} else {
/* we did not process messages (timed out) */
RETVAL_FALSE;
}
}
/* }}} */
static int com_enable_events(comval *obj, int enable)
{
if (obj->sinkdispatch) {
IConnectionPointContainer *cont;
IConnectionPoint *point;
if (SUCCEEDED(C_DISPATCH_VT(obj)->QueryInterface(C_DISPATCH(obj), &IID_IConnectionPointContainer, (void**)&cont))) {
if (SUCCEEDED(cont->lpVtbl->FindConnectionPoint(cont, &obj->sinkid, &point))) {
if (enable) {
point->lpVtbl->Advise(point, (IUnknown*)obj->sinkdispatch, &obj->sinkcookie);
} else {
point->lpVtbl->Unadvise(point, obj->sinkcookie);
}
point->lpVtbl->Release(point);
}
cont->lpVtbl->Release(cont);
}
}
return 0;
}
static const struct {
VARTYPE vt;
const char *name;
} vt_names[] = {
{ VT_NULL, "VT_NULL" },
{ VT_EMPTY, "VT_EMPTY" },
{ VT_UI1, "VT_UI1" },
{ VT_I2, "VT_I2" },
{ VT_I4, "VT_I4" },
{ VT_R4, "VT_R4" },
{ VT_R8, "VT_R8" },
{ VT_BOOL, "VT_BOOL" },
{ VT_ERROR, "VT_ERROR" },
{ VT_CY, "VT_CY" },
{ VT_DATE, "VT_DATE" },
{ VT_BSTR, "VT_BSTR" },
{ VT_DECIMAL, "VT_DECIMAL" },
{ VT_UNKNOWN, "VT_UNKNOWN" },
{ VT_DISPATCH, "VT_DISPATCH" },
{ VT_VARIANT, "VT_VARIANT" },
{ VT_I1, "VT_I1" },
{ VT_UI2, "VT_UI2" },
{ VT_UI4, "VT_UI4" },
{ VT_INT, "VT_INT" },
{ VT_UINT, "VT_UINT" },
{ VT_ARRAY, "VT_ARRAY" },
{ VT_BYREF, "VT_BYREF" },
{ VT_VOID, "VT_VOID" },
{ VT_PTR, "VT_PTR" },
{ VT_HRESULT, "VT_HRESULT" },
{ 0, NULL }
};
static inline const char *vt_to_string(VARTYPE vt)
{
int i;
for (i = 0; vt_names[i].name != NULL; i++) {
if (vt_names[i].vt == vt)
return vt_names[i].name;
}
return "?";
}
static int process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int printdef, GUID *guid TSRMLS_DC)
{
TYPEATTR *attr;
FUNCDESC *func;
int i;
OLECHAR *olename;
char *ansiname = NULL;
unsigned int ansinamelen;
int ret = 0;
if (FAILED(typeinfo->lpVtbl->GetTypeAttr(typeinfo, &attr)))
return 0;
/* verify that it is suitable */
if (id_to_name == NULL || attr->typekind == TKIND_DISPATCH) {
if (guid)
memcpy(guid, &attr->guid, sizeof(GUID));
if (printdef) {
char *guidstring;
typeinfo->lpVtbl->GetDocumentation(typeinfo, MEMBERID_NIL, &olename, NULL, NULL, NULL);
ansiname = php_OLECHAR_to_char(olename, &ansinamelen, codepage TSRMLS_CC);
SysFreeString(olename);
guidstring = php_string_from_clsid(&attr->guid TSRMLS_CC);
php_printf("class %s { /* GUID=%s */\n", ansiname, guidstring);
efree(guidstring);
efree(ansiname);
}
if (id_to_name)
zend_hash_init(id_to_name, 0, NULL, ZVAL_PTR_DTOR, 0);
/* So we've got the dispatch interface; lets list the event methods */
for (i = 0; i < attr->cFuncs; i++) {
zval *tmp;
DISPID lastid = 0; /* for props */
int isprop;
if (FAILED(typeinfo->lpVtbl->GetFuncDesc(typeinfo, i, &func)))
break;
isprop = (func->invkind & DISPATCH_PROPERTYGET || func->invkind & DISPATCH_PROPERTYPUT);
if (!isprop || lastid != func->memid) {
lastid = func->memid;
typeinfo->lpVtbl->GetDocumentation(typeinfo, func->memid, &olename, NULL, NULL, NULL);
ansiname = php_OLECHAR_to_char(olename, &ansinamelen, codepage TSRMLS_CC);
SysFreeString(olename);
if (printdef) {
int j;
char *funcdesc;
unsigned int funcdesclen, cnames = 0;
BSTR *names;
names = (BSTR*)emalloc((func->cParams + 1) * sizeof(BSTR));
typeinfo->lpVtbl->GetNames(typeinfo, func->memid, names, func->cParams + 1, &cnames);
/* first element is the function name */
SysFreeString(names[0]);
php_printf("\t/* DISPID=%d */\n", func->memid);
if (func->elemdescFunc.tdesc.vt != VT_VOID) {
php_printf("\t/* %s [%d] */\n",
vt_to_string(func->elemdescFunc.tdesc.vt),
func->elemdescFunc.tdesc.vt
);
}
if (isprop) {
typeinfo->lpVtbl->GetDocumentation(typeinfo, func->memid, NULL, &olename, NULL, NULL);
if (olename) {
funcdesc = php_OLECHAR_to_char(olename, &funcdesclen, codepage TSRMLS_CC);
SysFreeString(olename);
php_printf("\t/* %s */\n", funcdesc);
efree(funcdesc);
}
php_printf("\tvar $%s;\n\n", ansiname);
} else {
/* a function */
php_printf("\tfunction %s(\n", ansiname);
for (j = 0; j < func->cParams; j++) {
ELEMDESC *elem = &func->lprgelemdescParam[j];
php_printf("\t\t/* %s [%d] ", vt_to_string(elem->tdesc.vt), elem->tdesc.vt);
if (elem->paramdesc.wParamFlags & PARAMFLAG_FIN)
php_printf("[in]");
if (elem->paramdesc.wParamFlags & PARAMFLAG_FOUT)
php_printf("[out]");
if (elem->tdesc.vt == VT_PTR) {
/* what does it point to ? */
php_printf(" --> %s [%d] ",
vt_to_string(elem->tdesc.lptdesc->vt),
elem->tdesc.lptdesc->vt
);
}
/* when we handle prop put and get, this will look nicer */
if (j+1 < (int)cnames) {
funcdesc = php_OLECHAR_to_char(names[j+1], &funcdesclen, codepage TSRMLS_CC);
SysFreeString(names[j+1]);
} else {
funcdesc = "???";
}
php_printf(" */ %s%s%c\n",
elem->tdesc.vt == VT_PTR ? "&$" : "$",
funcdesc,
j == func->cParams - 1 ? ' ' : ','
);
if (j+1 < (int)cnames)
efree(funcdesc);
}
php_printf("\t\t)\n\t{\n");
typeinfo->lpVtbl->GetDocumentation(typeinfo, func->memid, NULL, &olename, NULL, NULL);
if (olename) {
funcdesc = php_OLECHAR_to_char(olename, &funcdesclen, codepage TSRMLS_CC);
SysFreeString(olename);
php_printf("\t\t/* %s */\n", funcdesc);
efree(funcdesc);
}
php_printf("\t}\n");
}
efree(names);
}
if (id_to_name) {
zend_str_tolower(ansiname, ansinamelen);
MAKE_STD_ZVAL(tmp);
ZVAL_STRINGL(tmp, ansiname, ansinamelen, 0);
zend_hash_index_update(id_to_name, func->memid, (void*)&tmp, sizeof(zval *), NULL);
}
}
typeinfo->lpVtbl->ReleaseFuncDesc(typeinfo, func);
}
if (printdef)
php_printf("}\n");
ret = 1;
} else {
zend_error(E_WARNING, "Thats not a dispatchable interface!! type kind = %08x\n", attr->typekind);
}
typeinfo->lpVtbl->ReleaseTypeAttr(typeinfo, attr);
return ret;
}
static ITypeInfo *locate_typeinfo(char *typelibname, comval *obj, char *dispname, int sink TSRMLS_DC)
{
ITypeInfo *typeinfo = NULL;
ITypeLib *typelib = NULL;
int gotguid = 0;
GUID iid;
if (obj) {
if (dispname == NULL && sink) {
IProvideClassInfo2 *pci2;
IProvideClassInfo *pci;
if (SUCCEEDED(C_DISPATCH_VT(obj)->QueryInterface(C_DISPATCH(obj), &IID_IProvideClassInfo2, (void**)&pci2))) {
gotguid = SUCCEEDED(pci2->lpVtbl->GetGUID(pci2, GUIDKIND_DEFAULT_SOURCE_DISP_IID, &iid));
pci2->lpVtbl->Release(pci2);
}
if (!gotguid && SUCCEEDED(C_DISPATCH_VT(obj)->QueryInterface(C_DISPATCH(obj), &IID_IProvideClassInfo, (void**)&pci))) {
/* examine the available interfaces */
/* TODO: write some code here */
pci->lpVtbl->Release(pci);
}
} else if (dispname && C_HASTLIB(obj)) {
unsigned int idx;
/* get the library from the object; the rest will be dealt with later */
C_TYPEINFO_VT(obj)->GetContainingTypeLib(C_TYPEINFO(obj), &typelib, &idx);
} else if (typelibname == NULL) {
C_DISPATCH_VT(obj)->GetTypeInfo(C_DISPATCH(obj), 0, LANG_NEUTRAL, &typeinfo);
}
} else if (typelibname) {
/* Fetch the typelibrary and use that to look things up */
typelib = php_COM_find_typelib(typelibname, CONST_CS TSRMLS_CC);
}
if (!gotguid && dispname && typelib) {
unsigned short cfound;
MEMBERID memid;
OLECHAR *olename = php_char_to_OLECHAR(dispname, strlen(dispname), CP_ACP TSRMLS_CC);
cfound = 1;
if (FAILED(typelib->lpVtbl->FindName(typelib, olename, 0, &typeinfo, &memid, &cfound)) || cfound == 0) {
CLSID coclass;
ITypeInfo *coinfo;
/* assume that it might be a progid instead */
if (SUCCEEDED(CLSIDFromProgID(olename, &coclass)) &&
SUCCEEDED(typelib->lpVtbl->GetTypeInfoOfGuid(typelib, &coclass, &coinfo))) {
/* enumerate implemented interfaces and pick the one as indicated by sink */
TYPEATTR *attr;
int i;
coinfo->lpVtbl->GetTypeAttr(coinfo, &attr);
for (i = 0; i < attr->cImplTypes; i++) {
HREFTYPE rt;
int tf;
if (FAILED(coinfo->lpVtbl->GetImplTypeFlags(coinfo, i, &tf)))
continue;
if ((sink && tf == (IMPLTYPEFLAG_FSOURCE|IMPLTYPEFLAG_FDEFAULT)) ||
(!sink && (tf & IMPLTYPEFLAG_FSOURCE) == 0)) {
/* flags match what we are looking for */
if (SUCCEEDED(coinfo->lpVtbl->GetRefTypeOfImplType(coinfo, i, &rt)))
if (SUCCEEDED(coinfo->lpVtbl->GetRefTypeInfo(coinfo, rt, &typeinfo)))
break;
}
}
coinfo->lpVtbl->ReleaseTypeAttr(coinfo, attr);
coinfo->lpVtbl->Release(coinfo);
}
}
efree(olename);
} else if (gotguid) {
typelib->lpVtbl->GetTypeInfoOfGuid(typelib, &iid, &typeinfo);
}
if (typelib)
typelib->lpVtbl->Release(typelib);
return typeinfo;
}
/* {{{ proto bool com_print_typeinfo(mixed comobject | string typelib, string dispinterface, bool wantsink)
Print out a PHP class definition for a dispatchable interface */
PHP_FUNCTION(com_print_typeinfo)
{
zval *arg1;
char *ifacename = NULL;
char *typelibname = NULL;
int ifacelen;
zend_bool wantsink = 0;
comval *obj = NULL;
ITypeInfo *typeinfo;
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/s!b", &arg1, &ifacename,
&ifacelen, &wantsink)) {
RETURN_FALSE;
}
if (Z_TYPE_P(arg1) == IS_OBJECT && (Z_OBJCE_P(arg1) == &COM_class_entry || !strcmp(Z_OBJCE_P(arg1)->name, "COM"))) {
zval **tmp;
zend_hash_index_find(Z_OBJPROP_P(arg1), 0, (void**)&tmp);
ZEND_FETCH_RESOURCE(obj, comval*, tmp, -1, "comval", IS_COM);
} else if (Z_TYPE_P(arg1) == IS_RESOURCE) {
ZEND_FETCH_RESOURCE(obj, comval*, &arg1, -1, "comval", IS_COM);
} else {
convert_to_string(arg1);
typelibname = Z_STRVAL_P(arg1);
}
typeinfo = locate_typeinfo(typelibname, obj, ifacename, wantsink TSRMLS_CC);
if (typeinfo) {
process_typeinfo(typeinfo, NULL, 1, NULL TSRMLS_CC);
typeinfo->lpVtbl->Release(typeinfo);
RETURN_TRUE;
} else {
zend_error(E_WARNING, "Unable to find typeinfo using the parameters supplied");
}
RETURN_FALSE;
}
/* }}} */
/* {{{ proto bool com_event_sink(mixed comobject, object sinkobject [, mixed sinkinterface])
Connect events from a COM object to a PHP object */
PHP_FUNCTION(com_event_sink)
{
zval *object, *sinkobject, *sink=NULL;
char *dispname = NULL, *typelibname = NULL;
zend_bool gotguid = 0;
comval *obj;
ITypeInfo *typeinfo = NULL;
RETVAL_FALSE;
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|z/", &object, &sinkobject, &sink)) {
RETURN_FALSE;
}
if (Z_TYPE_P(object) == IS_OBJECT && (Z_OBJCE_P(object) == &COM_class_entry || !strcmp(Z_OBJCE_P(object)->name, "COM"))) {
zval **tmp;
zend_hash_index_find(Z_OBJPROP_P(object), 0, (void**)&tmp);
ZEND_FETCH_RESOURCE(obj, comval*, tmp, -1, "comval", IS_COM);
} else {
ZEND_FETCH_RESOURCE(obj, comval*, &object, -1, "comval", IS_COM);
}
if (sink && Z_TYPE_P(sink) == IS_ARRAY) {
/* 0 => typelibname, 1 => dispname */
zval **tmp;
if (zend_hash_index_find(Z_ARRVAL_P(sink), 0, (void**)&tmp) == SUCCESS)
typelibname = Z_STRVAL_PP(tmp);
if (zend_hash_index_find(Z_ARRVAL_P(sink), 1, (void**)&tmp) == SUCCESS)
dispname = Z_STRVAL_PP(tmp);
} else if (sink != NULL) {
convert_to_string(sink);
dispname = Z_STRVAL_P(sink);
}
typeinfo = locate_typeinfo(typelibname, obj, dispname, 1 TSRMLS_CC);
if (typeinfo) {
HashTable *id_to_name;
ALLOC_HASHTABLE(id_to_name);
if (process_typeinfo(typeinfo, id_to_name, 0, &obj->sinkid TSRMLS_CC)) {
/* Create the COM wrapper for this sink */
obj->sinkdispatch = php_COM_export_as_sink(sinkobject, &obj->sinkid, id_to_name TSRMLS_CC);
/* Now hook it up to the source */
com_enable_events(obj, TRUE);
RETVAL_TRUE;
} else {
FREE_HASHTABLE(id_to_name);
}
}
if (typeinfo)
typeinfo->lpVtbl->Release(typeinfo);
}
/* }}} */
static int do_COM_offget(VARIANT *result, comval *array, pval *property, int cleanup TSRMLS_DC)
{
@@ -1586,36 +1122,33 @@ static void do_COM_propput(pval *return_value, comval *obj, pval *arg_property,
php_error(E_WARNING,"PropPut() failed: %s", error_message);
}
LocalFree(error_message);
efree(propname);
FREE_VARIANT(var_result);
efree(new_value);
efree(propname);
FREE_VARIANT(new_value);
RETURN_NULL();
}
if (return_value) {
dispparams.cArgs = 0;
dispparams.cNamedArgs = 0;
dispparams.cArgs = 0;
dispparams.cNamedArgs = 0;
hr = php_COM_invoke(obj, dispid, DISPATCH_PROPERTYGET, &dispparams, var_result, &ErrString TSRMLS_CC);
hr = php_COM_invoke(obj, dispid, DISPATCH_PROPERTYGET, &dispparams, var_result, &ErrString TSRMLS_CC);
if (SUCCEEDED(hr)) {
php_variant_to_pval(var_result, return_value, codepage TSRMLS_CC);
} else {
*return_value = *value;
zval_copy_ctor(return_value);
}
if (SUCCEEDED(hr)) {
php_variant_to_pval(var_result, return_value, codepage TSRMLS_CC);
} else {
*return_value = *value;
zval_copy_ctor(return_value);
}
if (ErrString) {
pefree(ErrString, 1);
}
if (ErrString) {
pefree(ErrString, 1);
}
FREE_VARIANT(var_result);
FREE_VARIANT(new_value);
efree(new_value); // FREE_VARIANT does a VariantClear() which is not desired here !
efree(propname);
}
@@ -1789,7 +1322,6 @@ PHPAPI pval php_COM_get_property_handler(zend_property_reference *property_refer
obj = obj_prop;
php_COM_set(obj, &V_DISPATCH(var_result), TRUE TSRMLS_CC);
VariantInit(var_result); // to protect C_DISPATCH(obj) from being freed when var_result is destructed
} else {
php_variant_to_pval(var_result, &return_value, codepage TSRMLS_CC);
@@ -1797,6 +1329,7 @@ PHPAPI pval php_COM_get_property_handler(zend_property_reference *property_refer
obj_prop = NULL;
}
VariantInit(var_result); // to protect C_DISPATCH(obj) from being freed when var_result is destructed
pval_destructor(&overloaded_property->element);
}
@@ -1813,6 +1346,7 @@ PHPAPI pval php_COM_get_property_handler(zend_property_reference *property_refer
PHPAPI int php_COM_set_property_handler(zend_property_reference *property_reference, pval *value)
{
pval result;
zend_overloaded_element *overloaded_property;
zend_llist_element *element;
pval **comval_handle;
@@ -1882,7 +1416,7 @@ PHPAPI int php_COM_set_property_handler(zend_property_reference *property_refere
FREE_VARIANT(var_result);
overloaded_property = (zend_overloaded_element *) element->data;
do_COM_propput(NULL, obj, &overloaded_property->element, value TSRMLS_CC);
do_COM_propput(&result, obj, &overloaded_property->element, value TSRMLS_CC);
FREE_COM(obj_prop);
pval_destructor(&overloaded_property->element);
@@ -1890,20 +1424,6 @@ PHPAPI int php_COM_set_property_handler(zend_property_reference *property_refere
return SUCCESS;
}
/* create an overloaded COM object from a dispatch pointer */
PHPAPI zval *php_COM_object_from_dispatch(IDispatch *disp, zval *val TSRMLS_DC)
{
comval *obj;
zval *zobj;
ALLOC_COM(obj);
MAKE_STD_ZVAL(zobj);
php_COM_set(obj, &disp, FALSE TSRMLS_CC);
ZVAL_COM_EX(zobj, obj, val);
return zobj;
}
PHPAPI void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference)
{
@@ -2006,10 +1526,6 @@ static ITypeLib *php_COM_find_typelib(char *search_string, int mode TSRMLS_DC)
*/
search_string = php_strtok_r(search_string, ",", &strtok_buf);
if (search_string == NULL)
return NULL;
major = php_strtok_r(NULL, ",", &strtok_buf);
minor = php_strtok_r(NULL, ",", &strtok_buf);
@@ -2156,7 +1672,7 @@ static ITypeLib *php_COM_find_typelib(char *search_string, int mode TSRMLS_DC)
}
PHPAPI int php_COM_load_typelib(ITypeLib *TypeLib, int mode TSRMLS_DC)
static int php_COM_load_typelib(ITypeLib *TypeLib, int mode TSRMLS_DC)
{
ITypeComp *TypeComp;
int i;
@@ -2238,6 +1754,7 @@ PHPAPI int php_COM_load_typelib(ITypeLib *TypeLib, int mode TSRMLS_DC)
return SUCCESS;
}
/* {{{ proto bool com_isenum(object com_module)
Grabs an IEnumVariant */
PHP_FUNCTION(com_isenum)
@@ -2283,18 +1800,11 @@ static void php_COM_init(int module_number TSRMLS_DC)
php_register_COM_class(TSRMLS_C);
}
PHPAPI ZEND_DECLARE_MODULE_GLOBALS(com)
static void php_com_init_globals(zend_com_globals *com_globals)
{
}
PHP_MINIT_FUNCTION(COM)
{
ZEND_INIT_MODULE_GLOBALS(com, php_com_init_globals, NULL);
php_COM_init(module_number TSRMLS_CC);
php_VARIANT_init(module_number TSRMLS_CC);
php_COM_dispatch_init(module_number TSRMLS_CC);
REGISTER_LONG_CONSTANT("CLSCTX_INPROC_SERVER", CLSCTX_INPROC_SERVER, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CLSCTX_INPROC_HANDLER", CLSCTX_INPROC_HANDLER, CONST_CS | CONST_PERSISTENT);
@@ -2308,6 +1818,7 @@ PHP_MINIT_FUNCTION(COM)
return SUCCESS;
}
PHP_MSHUTDOWN_FUNCTION(COM)
{
UNREGISTER_INI_ENTRIES();
@@ -2324,7 +1835,7 @@ zend_module_entry COM_module_entry = {
PHP_MSHUTDOWN(COM),
NULL,
NULL,
PHP_MINFO(COM),
PHP_MINFO(COM),
NO_VERSION_YET,
STANDARD_MODULE_PROPERTIES
};
+1 -1
View File
@@ -1,2 +1,2 @@
Win32 COM
Alan Brown, Wez Furlong, Harald Radi, Zeev Suraski
Zeev Suraski, Harald Radi, Alan Brown
+12 -13
View File
@@ -1,28 +1,27 @@
1) Multi-dimenstional array support
-- done 2) IErrorInfo
-- done 13) export VARIANT through the COM module
14) trap exceptions and errors
3) WithEvents
4) Documentation (internal and user) and howtos
5) IEnumVariant::All() which would be like IEnumVariant::Next(IDispatch::Count)
6) Look for memory leaks and AdRef/Release problems - I KNOW there are some...
7) Test component (goes with the docs)
8) Test suite (Needs test component)
9) reduce the need for VARIANT()
10) lets try if we are able to call non IDispatch - only Typelib components
-- delayed till PHP5: 3) WithEvents
-- delayed till PHP5: 9) reduce the need for VARIANT()
ad 6.) check vbsample.php (new VARIANT(*, *|VT_BYREF)) GPs
-- done 2) IErrorInfo
-- done 6) Look for memory leaks and AdRef/Release problems - I KNOW there are some...
-- done 11) IEnumVariant::Next() without parameter should only return an object, not an array with one element
-- done 12) VARIANT->value as lvalue
-- done 13) export VARIANT through the COM module
-- done 14) trap exceptions and errors
-- donne ad 4.) faq (i've collected a few questions from various lists)
ad 6.) check vbsample.php (new VARIANT(*, *|VT_BYREF)) GPs
ad 4.) faq (i've collected a few questions from various lists)
variant attributes !!
to be discussed:
- dcom inporc issue
- mts support (getcontext)
- adsi support (ads* functions)
-- delayed till PHP 5: try serialisation support (if component implements IPersist)
- winapi interface
- try serialisation support (if component implements IPersist)
-1
View File
@@ -181,7 +181,6 @@ static pval php_VARIANT_get_property_handler(zend_property_reference *property_r
case OE_IS_OBJECT:
if (!strcmp(Z_STRVAL(overloaded_property->element), "value")) {
// var_arg can't be an idispatch, so we don't care for the implicit AddRef() call here
php_variant_to_pval(var_arg, &result, codepage TSRMLS_CC);
} else if (!strcmp(Z_STRVAL(overloaded_property->element), "type")) {
ZVAL_LONG(&result, V_VT(var_arg))
+4 -13
View File
@@ -19,28 +19,19 @@ typedef struct comval_ {
ITypeInfo *typeinfo;
IEnumVARIANT *enumvariant;
} i;
IDispatch *sinkdispatch;
GUID sinkid;
DWORD sinkcookie;
} comval;
END_EXTERN_C()
#define ZVAL_COM(z,o) { \
zval *handle = NULL; \
ZVAL_COM_EX(z,o,handle) \
}
#define ZVAL_COM_EX(z,o,handle) { \
zval *handle; \
HashTable *properties; \
\
ALLOC_HASHTABLE(properties); \
zend_hash_init(properties, 0, NULL, ZVAL_PTR_DTOR, 0); \
\
if (handle == NULL) { \
MAKE_STD_ZVAL(handle); \
} \
ZVAL_RESOURCE(handle, zend_list_insert((o), IS_COM)); \
MAKE_STD_ZVAL(handle); \
ZVAL_LONG(handle, zend_list_insert((o), IS_COM)); \
\
zval_copy_ctor(handle); \
zend_hash_index_update(properties, 0, &handle, sizeof(zval *), NULL); \
@@ -51,7 +42,7 @@ END_EXTERN_C()
#define RETURN_COM(o) RETVAL_COM(o) \
return;
#define ALLOC_COM(z) (z) = (comval *) ecalloc(1, sizeof(comval)); \
#define ALLOC_COM(z) (z) = (comval *) emalloc(sizeof(comval)); \
C_REFCOUNT(z) = 0;
#define FREE_COM(z) php_COM_destruct(z TSRMLS_CC);
+6 -22
View File
@@ -56,7 +56,7 @@ PHPAPI void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg, int codepage T
case IS_OBJECT:
if (!strcmp(Z_OBJCE_P(pval_arg)->name, "VARIANT")) {
type = VT_VARIANT|VT_BYREF;
} else {
} else if (!strcmp(Z_OBJCE_P(pval_arg)->name, "COM")) {
type = VT_DISPATCH;
}
break;
@@ -155,12 +155,6 @@ PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, int type,
}
} else {
switch (V_VT(var_arg)) {
case VT_NULL:
case VT_VOID:
ZVAL_NULL(pval_arg);
break;
case VT_UI1:
convert_to_long_ex(&pval_arg);
V_UI1(var_arg) = (unsigned char) Z_LVAL_P(pval_arg);
@@ -217,7 +211,6 @@ PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, int type,
/** @todo
case IS_STRING:
*/
/* string representation of a time value */
default:
@@ -269,14 +262,7 @@ PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, int type,
break;
case VT_DISPATCH:
if (!strcmp(Z_OBJCE_P(pval_arg)->name, "COM")) {
comval_to_variant(pval_arg, var_arg TSRMLS_CC);
} else {
V_DISPATCH(var_arg) = php_COM_export_object(pval_arg TSRMLS_CC);
if (V_DISPATCH(var_arg)) {
V_VT(var_arg) = VT_DISPATCH;
}
}
comval_to_variant(pval_arg, var_arg TSRMLS_CC);
if (V_VT(var_arg) != VT_DISPATCH) {
VariantInit(var_arg);
}
@@ -451,7 +437,7 @@ PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, int type,
break;
default:
php_error(E_WARNING,"Unsupported variant type: %d (0x%X)", V_VT(var_arg), V_VT(var_arg));
php_error(E_WARNING, "Type not supported or not yet implemented.");
}
}
}
@@ -660,7 +646,6 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int codepage TS
ZVAL_NULL(pval_arg);
}
}
break;
case VT_DATE: {
@@ -720,10 +705,9 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int codepage TS
ZVAL_NULL(pval_arg);
} else {
ALLOC_COM(obj);
php_COM_set(obj, &V_DISPATCH(var_arg), FALSE TSRMLS_CC);
php_COM_set(obj, &V_DISPATCH(var_arg), TRUE TSRMLS_CC);
ZVAL_COM(pval_arg, obj);
VariantInit(var_arg); // to protect C_DISPATCH(obj) from being freed when var_result is destructed
}
}
break;
@@ -785,7 +769,7 @@ PHPAPI OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen, int codepage TSRML
if (strlen == -1) {
/* request needed buffersize */
strlen = MultiByteToWideChar(codepage, (codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED | MB_ERR_INVALID_CHARS), C_str, -1, NULL, 0);
strlen = MultiByteToWideChar(codepage, (codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED) | MB_ERR_INVALID_CHARS, C_str, -1, NULL, 0);
} else {
/* \0 terminator */
strlen++;
@@ -795,7 +779,7 @@ PHPAPI OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen, int codepage TSRML
unicode_str = (OLECHAR *) emalloc(sizeof(OLECHAR) * strlen);
/* convert string */
error = !MultiByteToWideChar(codepage, (codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED | MB_ERR_INVALID_CHARS), C_str, strlen, unicode_str, strlen);
error = !MultiByteToWideChar(codepage, (codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED) | MB_ERR_INVALID_CHARS, C_str, strlen, unicode_str, strlen);
} else {
/* return a zero-length string */
unicode_str = (OLECHAR *) emalloc(sizeof(OLECHAR));
-627
View File
@@ -1,627 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.php.net/license/2_02.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Wez Furlong <wez@thebrainroom.com> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
/*
* This module is used to export PHP objects to COM and DOTNET by exposing
* them as objects implementing IDispatch.
* */
#include "php.h"
#include "php_COM.h"
#include "php_VARIANT.h"
#include "conversion.h"
#include "variant.h"
#define COBJMACROS
#include <unknwn.h> /* IDispatch */
#include <dispex.h> /* IDispatchEx */
typedef struct {
/* This first part MUST match the declaration
* of interface IDispatchEx */
CONST_VTBL struct IDispatchExVtbl *lpVtbl;
/* now the PHP stuff */
THREAD_T engine_thread; /* for sanity checking */
zval *object; /* the object exported */
LONG refcount; /* COM reference count */
HashTable *dispid_to_name; /* keep track of dispid -> name mappings */
HashTable *name_to_dispid; /* keep track of name -> dispid mappings */
GUID sinkid; /* iid that we "implement" for event sinking */
int id;
} php_dispatchex;
static void disp_destructor(php_dispatchex *disp);
static void dispatch_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
php_dispatchex *disp = (php_dispatchex *)rsrc->ptr;
disp_destructor(disp);
}
static int le_dispatch;
int php_COM_dispatch_init(int module_number TSRMLS_DC)
{
le_dispatch = zend_register_list_destructors_ex(dispatch_dtor, NULL, "COM:Dispatch", module_number);
return le_dispatch;
}
/* {{{ trace */
static inline void trace(char *fmt, ...)
{
va_list ap;
char buf[4096];
sprintf(buf, "T=%08x ", tsrm_thread_id());
OutputDebugString(buf);
va_start(ap, fmt);
vsnprintf(buf, sizeof(buf), fmt, ap);
OutputDebugString(buf);
va_end(ap);
}
/* }}} */
#define FETCH_DISP(methname) \
php_dispatchex *disp = (php_dispatchex*)This; \
trace(" PHP:%s %s\n", Z_OBJCE_P(disp->object)->name, methname); \
if (tsrm_thread_id() != disp->engine_thread) \
return E_UNEXPECTED;
static HRESULT STDMETHODCALLTYPE disp_queryinterface(
IDispatchEx *This,
/* [in] */ REFIID riid,
/* [iid_is][out] */ void **ppvObject)
{
FETCH_DISP("QueryInterface");
if (IsEqualGUID(&IID_IUnknown, riid) ||
IsEqualGUID(&IID_IDispatch, riid) ||
IsEqualGUID(&IID_IDispatchEx, riid) ||
IsEqualGUID(&disp->sinkid, riid)) {
*ppvObject = This;
InterlockedIncrement(&disp->refcount);
return S_OK;
}
*ppvObject = NULL;
return E_NOINTERFACE;
}
static ULONG STDMETHODCALLTYPE disp_addref(IDispatchEx *This)
{
FETCH_DISP("AddRef");
return InterlockedIncrement(&disp->refcount);
}
static ULONG STDMETHODCALLTYPE disp_release(IDispatchEx *This)
{
ULONG ret;
TSRMLS_FETCH();
FETCH_DISP("Release");
ret = InterlockedDecrement(&disp->refcount);
trace("-- refcount now %d\n", ret);
if (ret == 0) {
/* destroy it */
if (disp->id)
zend_list_delete(disp->id);
}
return ret;
}
static HRESULT STDMETHODCALLTYPE disp_gettypeinfocount(
IDispatchEx *This,
/* [out] */ UINT *pctinfo)
{
FETCH_DISP("GetTypeInfoCount");
*pctinfo = 0;
return S_OK;
}
static HRESULT STDMETHODCALLTYPE disp_gettypeinfo(
IDispatchEx *This,
/* [in] */ UINT iTInfo,
/* [in] */ LCID lcid,
/* [out] */ ITypeInfo **ppTInfo)
{
FETCH_DISP("GetTypeInfo");
*ppTInfo = NULL;
return DISP_E_BADINDEX;
}
static HRESULT STDMETHODCALLTYPE disp_getidsofnames(
IDispatchEx *This,
/* [in] */ REFIID riid,
/* [size_is][in] */ LPOLESTR *rgszNames,
/* [in] */ UINT cNames,
/* [in] */ LCID lcid,
/* [size_is][out] */ DISPID *rgDispId)
{
UINT i;
HRESULT ret = S_OK;
TSRMLS_FETCH();
FETCH_DISP("GetIDsOfNames");
for (i = 0; i < cNames; i++) {
char *name;
unsigned int namelen;
zval **tmp;
name = php_OLECHAR_to_char(rgszNames[i], &namelen, CP_ACP TSRMLS_CC);
/* Lookup the name in the hash */
if (zend_hash_find(disp->name_to_dispid, name, namelen+1, (void**)&tmp) == FAILURE) {
ret = DISP_E_UNKNOWNNAME;
rgDispId[i] = 0;
} else {
rgDispId[i] = Z_LVAL_PP(tmp);
}
efree(name);
}
return ret;
}
static HRESULT STDMETHODCALLTYPE disp_invoke(
IDispatchEx *This,
/* [in] */ DISPID dispIdMember,
/* [in] */ REFIID riid,
/* [in] */ LCID lcid,
/* [in] */ WORD wFlags,
/* [out][in] */ DISPPARAMS *pDispParams,
/* [out] */ VARIANT *pVarResult,
/* [out] */ EXCEPINFO *pExcepInfo,
/* [out] */ UINT *puArgErr)
{
return This->lpVtbl->InvokeEx(This, dispIdMember,
lcid, wFlags, pDispParams,
pVarResult, pExcepInfo, NULL);
}
static HRESULT STDMETHODCALLTYPE disp_getdispid(
IDispatchEx *This,
/* [in] */ BSTR bstrName,
/* [in] */ DWORD grfdex,
/* [out] */ DISPID *pid)
{
HRESULT ret = DISP_E_UNKNOWNNAME;
char *name;
unsigned int namelen;
zval **tmp;
TSRMLS_FETCH();
FETCH_DISP("GetDispID");
name = php_OLECHAR_to_char(bstrName, &namelen, CP_ACP TSRMLS_CC);
/* Lookup the name in the hash */
if (zend_hash_find(disp->name_to_dispid, name, namelen+1, (void**)&tmp) == SUCCESS) {
*pid = Z_LVAL_PP(tmp);
ret = S_OK;
}
efree(name);
return ret;
}
static HRESULT STDMETHODCALLTYPE disp_invokeex(
IDispatchEx *This,
/* [in] */ DISPID id,
/* [in] */ LCID lcid,
/* [in] */ WORD wFlags,
/* [in] */ DISPPARAMS *pdp,
/* [out] */ VARIANT *pvarRes,
/* [out] */ EXCEPINFO *pei,
/* [unique][in] */ IServiceProvider *pspCaller)
{
zval **name;
UINT i;
int codepage = CP_ACP;
zval *retval = NULL;
zval ***params = NULL;
HRESULT ret = DISP_E_MEMBERNOTFOUND;
TSRMLS_FETCH();
FETCH_DISP("InvokeEx");
if (SUCCESS == zend_hash_index_find(disp->dispid_to_name, id, (void**)&name)) {
/* TODO: add support for overloaded objects */
trace("-- Invoke: %d %20s flags=%08x args=%d\n", id, Z_STRVAL_PP(name), wFlags, pdp->cArgs);
/* convert args into zvals.
* Args are in reverse order */
params = (zval ***)emalloc(sizeof(zval **) * pdp->cArgs);
for (i = 0; i < pdp->cArgs; i++) {
VARIANT *arg;
zval *zarg;
arg = &pdp->rgvarg[ pdp->cArgs - 1 - i];
trace("alloc zval for arg %d VT=%08x\n", i, V_VT(arg));
ALLOC_INIT_ZVAL(zarg);
if (V_VT(arg) == VT_DISPATCH) {
trace("arg %d is dispatchable\n", i);
if (NULL == php_COM_object_from_dispatch(V_DISPATCH(arg), zarg TSRMLS_CC)) {
trace("failed to convert arg %d to zval\n", i);
ZVAL_NULL(zarg);
}
} else {
// arg can't be an idispatch, so we don't care for the implicit AddRef() call here
if (FAILURE == php_variant_to_pval(arg, zarg, codepage TSRMLS_CC)) {
trace("failed to convert arg %d to zval\n", i);
ZVAL_NULL(zarg);
}
}
params[i] = &zarg;
}
trace("arguments processed, prepare to do some work\n");
if (wFlags & DISPATCH_PROPERTYGET) {
trace("trying to get a property\n");
zend_hash_find(Z_OBJPROP_P(disp->object), Z_STRVAL_PP(name), Z_STRLEN_PP(name)+1, (void**)&retval);
} else if (wFlags & DISPATCH_PROPERTYPUT) {
trace("trying to set a property\n");
add_property_zval(disp->object, Z_STRVAL_PP(name), *params[0]);
} else if (wFlags & DISPATCH_METHOD) {
trace("Trying to call user function\n");
if (SUCCESS == call_user_function_ex(EG(function_table), &disp->object, *name,
&retval, pdp->cArgs, params, 1, NULL TSRMLS_CC)) {
ret = S_OK;
} else {
ret = DISP_E_EXCEPTION;
}
} else {
trace("Don't know how to handle this invocation %08x\n", wFlags);
}
/* release arguments */
for (i = 0; i < pdp->cArgs; i++)
zval_ptr_dtor(params[i]);
efree(params);
/* return value */
if (retval) {
if (pvarRes) {
if (Z_TYPE_P(retval) == IS_OBJECT) {
/* export the object using a dispatch like ourselves */
VariantInit(pvarRes);
V_VT(pvarRes) = VT_DISPATCH;
V_DISPATCH(pvarRes) = php_COM_export_object(retval TSRMLS_CC);
} else {
php_pval_to_variant(retval, pvarRes, codepage TSRMLS_CC);
}
}
zval_ptr_dtor(&retval);
} else if (pvarRes) {
VariantInit(pvarRes);
}
} else {
trace("InvokeEx: I don't support DISPID=%d\n", id);
}
return ret;
}
static HRESULT STDMETHODCALLTYPE disp_deletememberbyname(
IDispatchEx *This,
/* [in] */ BSTR bstrName,
/* [in] */ DWORD grfdex)
{
FETCH_DISP("DeleteMemberByName");
return S_FALSE;
}
static HRESULT STDMETHODCALLTYPE disp_deletememberbydispid(
IDispatchEx *This,
/* [in] */ DISPID id)
{
FETCH_DISP("DeleteMemberByDispID");
return S_FALSE;
}
static HRESULT STDMETHODCALLTYPE disp_getmemberproperties(
IDispatchEx *This,
/* [in] */ DISPID id,
/* [in] */ DWORD grfdexFetch,
/* [out] */ DWORD *pgrfdex)
{
FETCH_DISP("GetMemberProperties");
return DISP_E_UNKNOWNNAME;
}
static HRESULT STDMETHODCALLTYPE disp_getmembername(
IDispatchEx *This,
/* [in] */ DISPID id,
/* [out] */ BSTR *pbstrName)
{
zval *name;
TSRMLS_FETCH();
FETCH_DISP("GetMemberName");
if (SUCCESS == zend_hash_index_find(disp->dispid_to_name, id, (void**)&name)) {
OLECHAR *olestr = php_char_to_OLECHAR(Z_STRVAL_P(name), Z_STRLEN_P(name), CP_ACP TSRMLS_CC);
*pbstrName = SysAllocString(olestr);
efree(olestr);
return S_OK;
} else {
return DISP_E_UNKNOWNNAME;
}
}
static HRESULT STDMETHODCALLTYPE disp_getnextdispid(
IDispatchEx *This,
/* [in] */ DWORD grfdex,
/* [in] */ DISPID id,
/* [out] */ DISPID *pid)
{
ulong next = id+1;
FETCH_DISP("GetNextDispID");
while(!zend_hash_index_exists(disp->dispid_to_name, next))
next++;
if (zend_hash_index_exists(disp->dispid_to_name, next)) {
*pid = next;
return S_OK;
}
return S_FALSE;
}
static HRESULT STDMETHODCALLTYPE disp_getnamespaceparent(
IDispatchEx *This,
/* [out] */ IUnknown **ppunk)
{
FETCH_DISP("GetNameSpaceParent");
*ppunk = NULL;
return E_NOTIMPL;
}
static struct IDispatchExVtbl php_dispatch_vtbl = {
disp_queryinterface,
disp_addref,
disp_release,
disp_gettypeinfocount,
disp_gettypeinfo,
disp_getidsofnames,
disp_invoke,
disp_getdispid,
disp_invokeex,
disp_deletememberbyname,
disp_deletememberbydispid,
disp_getmemberproperties,
disp_getmembername,
disp_getnextdispid,
disp_getnamespaceparent
};
/* enumerate functions and properties of the object and assign
* dispatch ids */
static void generate_dispids(php_dispatchex *disp TSRMLS_DC)
{
HashPosition pos;
char *name = NULL;
zval *tmp;
int namelen;
int keytype;
ulong pid;
if (disp->dispid_to_name == NULL) {
ALLOC_HASHTABLE(disp->dispid_to_name);
ALLOC_HASHTABLE(disp->name_to_dispid);
zend_hash_init(disp->name_to_dispid, 0, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_init(disp->dispid_to_name, 0, NULL, ZVAL_PTR_DTOR, 0);
}
/* properties */
zend_hash_internal_pointer_reset_ex(Z_OBJPROP_PP(&disp->object), &pos);
while (HASH_KEY_NON_EXISTANT != (keytype =
zend_hash_get_current_key_ex(Z_OBJPROP_PP(&disp->object), &name, &namelen, &pid, 0, &pos))) {
char namebuf[32];
if (keytype == HASH_KEY_IS_LONG) {
sprintf(namebuf, "%d", pid);
name = namebuf;
namelen = strlen(namebuf);
}
zend_hash_move_forward_ex(Z_OBJPROP_PP(&disp->object), &pos);
/* Find the existing id */
if (zend_hash_find(disp->name_to_dispid, name, namelen+1, (void**)&tmp) == SUCCESS)
continue;
/* add the mappings */
MAKE_STD_ZVAL(tmp);
ZVAL_STRINGL(tmp, name, namelen, 1);
zend_hash_index_update(disp->dispid_to_name, pid, (void*)&tmp, sizeof(zval *), NULL);
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, pid);
zend_hash_update(disp->name_to_dispid, name, namelen+1, (void*)&tmp, sizeof(zval *), NULL);
}
/* functions */
zend_hash_internal_pointer_reset_ex(&Z_OBJCE_PP(&disp->object)->function_table, &pos);
while (HASH_KEY_NON_EXISTANT != (keytype =
zend_hash_get_current_key_ex(&Z_OBJCE_PP(&disp->object)->function_table, &name, &namelen, &pid, 0, &pos))) {
char namebuf[32];
if (keytype == HASH_KEY_IS_LONG) {
sprintf(namebuf, "%d", pid);
name = namebuf;
namelen = strlen(namebuf);
}
zend_hash_move_forward_ex(Z_OBJPROP_PP(&disp->object), &pos);
/* Find the existing id */
if (zend_hash_find(disp->name_to_dispid, name, namelen+1, (void**)&tmp) == SUCCESS)
continue;
/* add the mappings */
MAKE_STD_ZVAL(tmp);
ZVAL_STRINGL(tmp, name, namelen, 1);
zend_hash_index_update(disp->dispid_to_name, pid, (void*)&tmp, sizeof(zval *), NULL);
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, pid);
zend_hash_update(disp->name_to_dispid, name, namelen+1, (void*)&tmp, sizeof(zval *), NULL);
}
}
static php_dispatchex *disp_constructor(zval *object TSRMLS_DC)
{
php_dispatchex *disp = (php_dispatchex*)CoTaskMemAlloc(sizeof(php_dispatchex));
trace("constructing a COM proxy\n");
if (disp == NULL)
return NULL;
memset(disp, 0, sizeof(php_dispatchex));
disp->engine_thread = tsrm_thread_id();
disp->lpVtbl = &php_dispatch_vtbl;
disp->refcount = 1;
if (object)
ZVAL_ADDREF(object);
disp->object = object;
disp->id = zend_list_insert(disp, le_dispatch);
return disp;
}
static void disp_destructor(php_dispatchex *disp)
{
TSRMLS_FETCH();
trace("destroying COM wrapper for PHP object %s\n", Z_OBJCE_P(disp->object)->name);
disp->id = 0;
if (disp->refcount > 0)
CoDisconnectObject((IUnknown*)disp, 0);
zend_hash_destroy(disp->dispid_to_name);
zend_hash_destroy(disp->name_to_dispid);
FREE_HASHTABLE(disp->dispid_to_name);
FREE_HASHTABLE(disp->name_to_dispid);
if (disp->object)
zval_ptr_dtor(&disp->object);
CoTaskMemFree(disp);
}
PHPAPI IDispatch *php_COM_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC)
{
php_dispatchex *disp = disp_constructor(val TSRMLS_CC);
HashPosition pos;
char *name = NULL;
zval *tmp, **ntmp;
int namelen;
int keytype;
ulong pid;
disp->dispid_to_name = id_to_name;
memcpy(&disp->sinkid, sinkid, sizeof(disp->sinkid));
/* build up the reverse mapping */
ALLOC_HASHTABLE(disp->name_to_dispid);
zend_hash_init(disp->name_to_dispid, 0, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_internal_pointer_reset_ex(id_to_name, &pos);
while (HASH_KEY_NON_EXISTANT != (keytype =
zend_hash_get_current_key_ex(id_to_name, &name, &namelen, &pid, 0, &pos))) {
if (keytype == HASH_KEY_IS_LONG) {
zend_hash_get_current_data_ex(id_to_name, (void**)&ntmp, &pos);
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, pid);
zend_hash_update(disp->name_to_dispid, Z_STRVAL_PP(ntmp), Z_STRLEN_PP(ntmp)+1, (void*)&tmp, sizeof(zval *), NULL);
}
zend_hash_move_forward_ex(id_to_name, &pos);
}
return (IDispatch*)disp;
}
PHPAPI IDispatch *php_COM_export_object(zval *val TSRMLS_DC)
{
php_dispatchex *disp = NULL;
if (Z_TYPE_P(val) != IS_OBJECT)
return NULL;
if (Z_OBJCE_P(val) == &COM_class_entry || !strcmp(Z_OBJCE_P(val)->name, "COM")) {
/* pass back it's IDispatch directly */
zval **tmp;
comval *obj;
int type;
zend_hash_index_find(Z_OBJPROP_P(val), 0, (void**)&tmp);
obj = (comval *)zend_list_find(Z_LVAL_PP(tmp), &type);
if (type != IS_COM)
return NULL;
C_DISPATCH(obj)->lpVtbl->AddRef(C_DISPATCH(obj));
return C_DISPATCH(obj);
}
disp = disp_constructor(val TSRMLS_CC);
generate_dispids(disp TSRMLS_CC);
return (IDispatch*)disp;
}
-22
View File
@@ -18,9 +18,6 @@ PHP_FUNCTION(com_propget);
PHP_FUNCTION(com_propput);
PHP_FUNCTION(com_load_typelib);
PHP_FUNCTION(com_isenum);
PHP_FUNCTION(com_event_sink);
PHP_FUNCTION(com_message_pump);
PHP_FUNCTION(com_print_typeinfo);
PHPAPI HRESULT php_COM_invoke(comval *obj, DISPID dispIdMember, WORD wFlags, DISPPARAMS FAR* pDispParams, VARIANT FAR* pVarResult, char **ErrString TSRMLS_DC);
PHPAPI HRESULT php_COM_get_ids_of_names(comval *obj, OLECHAR FAR* FAR* rgszNames, DISPID FAR* rgDispId TSRMLS_DC);
@@ -34,13 +31,6 @@ PHPAPI int php_COM_get_le_comval();
PHPAPI int php_COM_set_property_handler(zend_property_reference *property_reference, pval *value);
PHPAPI pval php_COM_get_property_handler(zend_property_reference *property_reference);
PHPAPI void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference);
PHPAPI zval *php_COM_object_from_dispatch(IDispatch *disp, zval *val TSRMLS_DC);
PHPAPI int php_COM_load_typelib(ITypeLib *TypeLib, int mode TSRMLS_DC);
/* dispatch.c */
PHPAPI IDispatch *php_COM_export_object(zval *val TSRMLS_DC);
PHPAPI IDispatch *php_COM_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC);
int php_COM_dispatch_init(int module_number TSRMLS_DC);
zend_module_entry COM_module_entry;
zend_class_entry COM_class_entry;
@@ -53,18 +43,6 @@ END_EXTERN_C()
#define phpext_com_ptr &COM_module_entry
ZEND_BEGIN_MODULE_GLOBALS(com)
int nothing;
ZEND_END_MODULE_GLOBALS(com)
PHPAPI ZEND_EXTERN_MODULE_GLOBALS(com);
#ifdef ZTS
#define COMG(v) TSRMG(com_globals_id, zend_com_globals *, v)
#else
#define COMG(v) (com_globals.v)
#endif
#else
#define phpext_com_ptr NULL
+1 -1
View File
@@ -16,7 +16,7 @@
comval *obj; \
ALLOC_COM(obj); \
php_COM_set(obj, &V_DISPATCH(v), TRUE TSRMLS_CC); \
ZVAL_RESOURCE((z), zend_list_insert(obj, IS_COM)); \
ZVAL_LONG((z), zend_list_insert(obj, IS_COM)); \
} else { \
php_variant_to_pval((v), (z), codepage TSRMLS_CC); \
FREE_VARIANT(v); \
+5
View File
@@ -0,0 +1,5 @@
LTLIBRARY_NAME = libcpdf.la
LTLIBRARY_SOURCES = cpdf.c
include $(top_srcdir)/build/dynlib.mk
+2 -2
View File
@@ -9,7 +9,7 @@ AC_ARG_WITH(cpdflib,
AC_MSG_RESULT(no) ;;
yes)
AC_MSG_RESULT(yes)
PHP_NEW_EXTENSION(cpdf, cpdf.c)
PHP_EXTENSION(cpdf)
AC_CHECK_LIB(cpdf, cpdf_open, [AC_DEFINE(HAVE_CPDFLIB,1,[Whether you have cpdflib])],
[AC_MSG_ERROR([Cpdf module requires cpdflib >= 2.])])
PHP_ADD_LIBRARY(cpdf)
@@ -20,7 +20,7 @@ AC_ARG_WITH(cpdflib,
test -f $withval/include/cpdflib.h && CPDFLIB_INCLUDE=$withval/include
if test -n "$CPDFLIB_INCLUDE" ; then
AC_MSG_RESULT(yes)
PHP_NEW_EXTENSION(cpdf, cpdf.c)
PHP_EXTENSION(cpdf)
old_LIBS=$LIBS
old_withval=$withval
-2
View File
@@ -1,4 +1,2 @@
crack
Alexander Feldman
Windows Port:
Joseph Tate
+8
View File
@@ -0,0 +1,8 @@
# $Id$
LTLIBRARY_NAME = libcrack.la
LTLIBRARY_SOURCES = crack.c
LTLIBRARY_SHARED_NAME = crack.la
LTLIBRARY_SHARED_LIBADD = $(CRACK_SHARED_LIBADD)
include $(top_srcdir)/build/dynlib.mk
+1 -1
View File
@@ -26,7 +26,7 @@ if test "$PHP_CRACK" != "no"; then
PHP_ADD_INCLUDE($CRACK_INCLUDEDIR)
PHP_ADD_LIBRARY_WITH_PATH(crack, $CRACK_LIBDIR, CRACK_SHARED_LIBADD)
PHP_NEW_EXTENSION(crack, crack.c, $ext_shared)
PHP_EXTENSION(crack, $ext_shared)
PHP_SUBST(CRACK_SHARED_LIBADD)
AC_DEFINE(HAVE_CRACK, 1, [ ])
fi
-114
View File
@@ -1,114 +0,0 @@
# Microsoft Developer Studio Project File - Name="crack" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=crack - Win32 Release_TS
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "crack.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "crack.mak" CFG="crack - Win32 Release_TS"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "crack - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "crack - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "crack - Win32 Release_TS"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release_TS"
# PROP BASE Intermediate_Dir "Release_TS"
# PROP BASE Ignore_Export_Lib 0
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release_TS"
# PROP Intermediate_Dir "Release_TS"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CRACK" /D ZTS=1 /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "CRACK_EXPORTS" /D "COMPILE_DL_CRACK" /D ZTS=1 /D HAVE_CRACK=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x406 /d "NDEBUG"
# ADD RSC /l 0x406 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386
# ADD LINK32 cracklib_Win32.lib wsock32.lib php4ts.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_crack.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "crack - Win32 Debug_TS"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Debug_TS"
# PROP BASE Intermediate_Dir "Debug_TS"
# PROP BASE Ignore_Export_Lib 0
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Debug_TS"
# PROP Intermediate_Dir "Debug_TS"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "mssql-70" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CRACK" /D ZTS=1 /YX /FD /c
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CRACK_EXPORTS" /D "COMPILE_DL_CRACK" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CRACK=1 /FR /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x406 /d "NDEBUG"
# ADD RSC /l 0x406 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386
# ADD LINK32 cracklib_Win32.lib php4ts_debug.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_crack.dll" /libpath:"..\..\Debug_TS"
!ENDIF
# Begin Target
# Name "crack - Win32 Release_TS"
# Name "crack - Win32 Debug_TS"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\crack.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\php_crack.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project
+8
View File
@@ -0,0 +1,8 @@
# $Id$
LTLIBRARY_NAME = libctype.la
LTLIBRARY_SOURCES = ctype.c
LTLIBRARY_SHARED_NAME = ctype.la
LTLIBRARY_SHARED_LIBADD = $(CTYPE_SHARED_LIBADD)
include $(top_srcdir)/build/dynlib.mk
+1 -1
View File
@@ -7,5 +7,5 @@ PHP_ARG_ENABLE(ctype, whether to enable ctype functions,
if test "$PHP_CTYPE" != "no"; then
AC_DEFINE(HAVE_CTYPE, 1, [ ])
PHP_NEW_EXTENSION(ctype, ctype.c, $ext_shared)
PHP_EXTENSION(ctype, $ext_shared)
fi
+1 -1
View File
@@ -84,7 +84,7 @@ ZEND_GET_MODULE(ctype)
PHP_MINFO_FUNCTION(ctype)
{
php_info_print_table_start();
php_info_print_table_row(2, "ctype functions", "enabled");
php_info_print_table_row(2, "ctype functions", "enabled (experimental)");
php_info_print_table_end();
}
/* }}} */
+21 -28
View File
@@ -6,22 +6,17 @@ ctype on strings
--GET--
--FILE--
<?php
setlocale(LC_ALL,"C");
setlocale(LC_ALL,"C");
print "LOCALE is '" . setlocale(LC_ALL,0) . "'\n";
function ctype_test_002($function) {
$n1 = $n2 = $n3 = 0;
// test portable POSIX characters 0..127
for ($a=0;$a<128;$a++) {
$c = chr($a);
if($function($a)) $n1++;
if($function("$c$c$c")) $n2++;
if($function("1-$c$c$c-x")) $n3++;
}
print "$function $n1 $n2 $n3\n";
}
function ctype_test_002($function) {
$n=0; $m=0;
for($a=0;$a<256;$a++) {
$c = chr($a);
if($function("$c$c$c")) $n++;
if($function("1-$c$c$c-x")) $m++;
}
echo "$function $n $m\n";
}
ctype_test_002("ctype_lower");
ctype_test_002("ctype_upper");
ctype_test_002("ctype_alpha");
@@ -33,18 +28,16 @@ ctype_test_002("ctype_print");
ctype_test_002("ctype_punct");
ctype_test_002("ctype_space");
ctype_test_002("ctype_xdigit");
?>
--EXPECT--
LOCALE is 'C'
ctype_lower 26 26 0
ctype_upper 26 26 0
ctype_alpha 52 52 0
ctype_digit 10 10 0
ctype_alnum 62 62 0
ctype_cntrl 33 33 0
ctype_graph 94 94 94
ctype_print 95 95 95
ctype_punct 32 32 0
ctype_space 6 6 0
ctype_xdigit 22 22 0
ctype_lower 26 0
ctype_upper 26 0
ctype_alpha 52 0
ctype_digit 10 0
ctype_alnum 62 0
ctype_cntrl 33 0
ctype_graph 94 94
ctype_print 95 95
ctype_punct 32 0
ctype_space 6 0
ctype_xdigit 22 0
+7
View File
@@ -0,0 +1,7 @@
LTLIBRARY_NAME = libcurl.la
LTLIBRARY_SOURCES = curl.c
LTLIBRARY_SHARED_NAME = curl.la
LTLIBRARY_SHARED_LIBADD = $(CURL_SHARED_LIBADD)
include $(top_srcdir)/build/dynlib.mk
+1 -1
View File
@@ -57,6 +57,6 @@ if test "$PHP_CURL" != "no"; then
$CURL_LIBS -L$CURL_DIR/lib
])
PHP_NEW_EXTENSION(curl, curl.c, $ext_shared)
PHP_EXTENSION(curl, $ext_shared)
PHP_SUBST(CURL_SHARED_LIBADD)
fi
+8 -15
View File
@@ -553,7 +553,7 @@ static void alloc_curl_handle(php_curl **ch)
}
/* }}} */
/* {{{ proto resource curl_init([string url])
/* {{{ proto int curl_init([string url])
Initialize a CURL session */
PHP_FUNCTION(curl_init)
{
@@ -602,7 +602,7 @@ PHP_FUNCTION(curl_init)
}
/* }}} */
/* {{{ proto bool curl_setopt(resource ch, string option, mixed value)
/* {{{ proto bool curl_setopt(int ch, string option, mixed value)
Set an option for a CURL transfer */
PHP_FUNCTION(curl_setopt)
{
@@ -692,14 +692,7 @@ PHP_FUNCTION(curl_setopt)
case CURLOPT_WRITEHEADER:
case CURLOPT_STDERR: {
FILE *fp = NULL;
int type;
void * what;
what = zend_fetch_resource(zvalue TSRMLS_CC, -1, "File-Handle", &type, 1, php_file_le_stream());
ZEND_VERIFY_RESOURCE(what);
if (FAILURE == php_stream_cast((php_stream*)what, PHP_STREAM_AS_STDIO, (void*)&fp, REPORT_ERRORS))
RETURN_FALSE;
ZEND_FETCH_RESOURCE(fp, FILE *, zvalue, -1, "File-Handle", php_file_le_fopen());
if (!fp) {
RETURN_FALSE;
}
@@ -866,7 +859,7 @@ PHP_FUNCTION(curl_setopt)
}
/* }}} */
/* {{{ proto bool curl_exec(resource ch)
/* {{{ proto bool curl_exec(int ch)
Perform a CURL session */
PHP_FUNCTION(curl_exec)
{
@@ -902,7 +895,7 @@ PHP_FUNCTION(curl_exec)
#define CAAD(s, v) add_assoc_double_ex(return_value, s, sizeof(s), v);
#define CAAS(s, v) add_assoc_string_ex(return_value, s, sizeof(s), v, 1);
/* {{{ proto string curl_getinfo(resource ch, int opt)
/* {{{ proto string curl_getinfo(int ch, int opt)
Get information regarding a specific transfer */
PHP_FUNCTION(curl_getinfo)
{
@@ -1002,7 +995,7 @@ PHP_FUNCTION(curl_getinfo)
}
/* }}} */
/* {{{ proto string curl_error(resource ch)
/* {{{ proto string curl_error(int ch)
Return a string contain the last error for the current session */
PHP_FUNCTION(curl_error)
{
@@ -1020,7 +1013,7 @@ PHP_FUNCTION(curl_error)
}
/* }}} */
/* {{{ proto int curl_errno(resource ch)
/* {{{ proto int curl_errno(int ch)
Return an integer containing the last error number */
PHP_FUNCTION(curl_errno)
{
@@ -1037,7 +1030,7 @@ PHP_FUNCTION(curl_errno)
}
/* }}} */
/* {{{ proto void curl_close(resource ch)
/* {{{ proto void curl_close(int ch)
Close a CURL session */
PHP_FUNCTION(curl_close)
{
+5
View File
@@ -0,0 +1,5 @@
LTLIBRARY_NAME = libcybercash.la
LTLIBRARY_SOURCES = cybercash.c
include $(top_srcdir)/build/dynlib.mk
+1 -1
View File
@@ -12,7 +12,7 @@ AC_ARG_WITH(cybercash,
test -f $withval/c-api/mckcrypt.h && MCK_DIR=$withval/c-api
if test -n "$MCK_DIR"; then
AC_MSG_RESULT(yes)
PHP_NEW_EXTENSION(cybercash, cybercash.c)
PHP_EXTENSION(cybercash)
old_LIBS=$LIBS
LIBS="$LIBS -L$MCK_DIR/lib"
AC_CHECK_LIB(mckcrypto,base64_encode,[AC_DEFINE(HAVE_MCK,1,[ ])],
+8
View File
@@ -0,0 +1,8 @@
# $Id$
LTLIBRARY_NAME = libcybermut.la
LTLIBRARY_SOURCES = cybermut.c
LTLIBRARY_SHARED_NAME = cybermut.la
LTLIBRARY_SHARED_LIBADD = $(CYBERMUT_SHARED_LIBADD)
include $(top_srcdir)/build/dynlib.mk
+1 -1
View File
@@ -44,5 +44,5 @@ if test "$PHP_CYBERMUT" != "no"; then
AC_DEFINE(HAVE_CYBERMUT, 1, [ ])
PHP_NEW_EXTENSION(cybermut, cybermut.c, $ext_shared)
PHP_EXTENSION(cybermut, $ext_shared)
fi
+8
View File
@@ -0,0 +1,8 @@
# $Id$
LTLIBRARY_NAME = libcyrus.la
LTLIBRARY_SOURCES = cyrus.c
LTLIBRARY_SHARED_NAME = cyrus.la
LTLIBRARY_SHARED_LIBADD = $(CYRUS_SHARED_LIBADD)
include $(top_srcdir)/build/dynlib.mk
+1 -1
View File
@@ -43,5 +43,5 @@ if test "$PHP_CYRUS" != "no"; then
AC_DEFINE(HAVE_CYRUS,1,[ ])
PHP_NEW_EXTENSION(cyrus, cyrus.c, $ext_shared)
PHP_EXTENSION(cyrus, $ext_shared)
fi
+5
View File
@@ -0,0 +1,5 @@
LTLIBRARY_NAME = libdb.la
LTLIBRARY_SOURCES = db.c
include $(top_srcdir)/build/dynlib.mk
+1 -1
View File
@@ -54,5 +54,5 @@ if test "$PHP_DB" != "no"; then
EXTRA_LIBS="$EXTRA_LIBS $DBM_LIB"
fi
PHP_NEW_EXTENSION(db, db.c)
PHP_EXTENSION(db)
fi
+8
View File
@@ -0,0 +1,8 @@
LTLIBRARY_NAME = libdba.la
LTLIBRARY_SOURCES = dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c \
dba_ndbm.c dba_db3.c
LTLIBRARY_SHARED_NAME = dba.la
LTLIBRARY_SHARED_LIBADD = $(DBA_SHARED_LIBADD)
include $(top_srcdir)/build/dynlib.mk
+3 -6
View File
@@ -152,10 +152,7 @@ AC_ARG_WITH(db3,
[ --with-db3[=DIR] Include Berkeley DB3 support],[
if test "$withval" != "no"; then
for i in /usr/local /usr /usr/local/BerkeleyDB.3.0 $withval; do
if test -f "$i/include/db3/db.h"; then
THIS_PREFIX=$i
DB3_EXTRA=db3/db.h
elif test -f "$i/include/db.h" ; then
if test -f "$i/include/db.h" ; then
THIS_PREFIX=$i
DB3_EXTRA=db.h
fi
@@ -165,7 +162,7 @@ AC_ARG_WITH(db3,
AC_DEFINE_UNQUOTED(DB3_INCLUDE_FILE, "$DB3_EXTRA", [ ])
fi
for LIB in db-3 db3 db; do
for LIB in db db-3 db3; do
PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
AC_CHECK_LIB($LIB, db_create, [AC_DEFINE(DBA_DB3,1,[ ]) THIS_LIBS=$LIB])
])
@@ -229,7 +226,7 @@ AC_MSG_CHECKING(whether to enable DBA interface)
if test "$HAVE_DBA" = "1"; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_DBA, 1, [ ])
PHP_NEW_EXTENSION(dba, dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db3.c, $ext_shared)
PHP_EXTENSION(dba,$ext_shared)
PHP_SUBST(DBA_SHARED_LIBADD)
else
AC_MSG_RESULT(no)
+46 -39
View File
@@ -35,9 +35,9 @@
#define DB2_DATA dba_db2_data *dba = info->dbf
#define DB2_GKEY \
DBT gkey = {0}; \
gkey.data = (char *) key; \
gkey.size = keylen
DBT gkey; \
memset(&gkey, 0, sizeof(gkey)); \
gkey.data = (char *) key; gkey.size = keylen
typedef struct {
DB *dbp;
@@ -53,7 +53,7 @@ DBA_OPEN_FUNC(db2)
struct stat check_stat;
int s = VCWD_STAT(info->path, &check_stat);
type = info->mode == DBA_READER ? DB_UNKNOWN :
type = info->mode == DBA_READER ? DB_UNKNOWN :
info->mode == DBA_TRUNC ? DB_BTREE :
s ? DB_BTREE : DB_UNKNOWN;
@@ -63,73 +63,75 @@ DBA_OPEN_FUNC(db2)
info->mode == DBA_WRITER ? 0 :
info->mode == DBA_TRUNC ? DB_CREATE | DB_TRUNCATE : -1;
if (gmode == -1)
if(gmode == -1)
return FAILURE;
if (info->argc > 0) {
if(info->argc > 0) {
convert_to_long_ex(info->argv[0]);
filemode = Z_LVAL_PP(info->argv[0]);
}
if (db_open(info->path, type, gmode, filemode, NULL, NULL, &dbp)) {
return FAILURE;
if(!db_open(info->path, type, gmode, filemode, NULL, NULL, &dbp)) {
info->dbf = malloc(sizeof(dba_db2_data));
memset(info->dbf, 0, sizeof(dba_db2_data));
((dba_db2_data *) info->dbf)->dbp = dbp;
return SUCCESS;
}
info->dbf = calloc(sizeof(dba_db2_data), 1);
((dba_db2_data *) info->dbf)->dbp = dbp;
return SUCCESS;
return FAILURE;
}
DBA_CLOSE_FUNC(db2)
{
DB2_DATA;
if (dba->cursor)
dba->cursor->c_close(dba->cursor);
if(dba->cursor) dba->cursor->c_close(dba->cursor);
dba->dbp->close(dba->dbp, 0);
free(dba);
}
DBA_FETCH_FUNC(db2)
{
DBT gval = {0};
DBT gval;
char *new = NULL;
DB2_DATA;
DB2_GKEY;
if (dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) {
return NULL;
memset(&gval, 0, sizeof(gval));
if(!dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) {
if(newlen) *newlen = gval.size;
new = estrndup(gval.data, gval.size);
}
if (newlen) *newlen = gval.size;
return estrndup(gval.data, gval.size);
return new;
}
DBA_UPDATE_FUNC(db2)
{
DBT gval = {0};
DBT gval;
DB2_DATA;
DB2_GKEY;
memset(&gval, 0, sizeof(gval));
gval.data = (char *) val;
gval.size = vallen;
if (dba->dbp->put(dba->dbp, NULL, &gkey, &gval,
if(!dba->dbp->put(dba->dbp, NULL, &gkey, &gval,
mode == 1 ? DB_NOOVERWRITE : 0)) {
return FAILURE;
return SUCCESS;
}
return SUCCESS;
return FAILURE;
}
DBA_EXISTS_FUNC(db2)
{
DBT gval = {0};
DBT gval;
DB2_DATA;
DB2_GKEY;
if (dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) {
return FAILURE;
memset(&gval, 0, sizeof(gval));
if(!dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) {
return SUCCESS;
}
return SUCCESS;
return FAILURE;
}
DBA_DELETE_FUNC(db2)
@@ -144,15 +146,15 @@ DBA_FIRSTKEY_FUNC(db2)
{
DB2_DATA;
if (dba->cursor) {
if(dba->cursor) {
dba->cursor->c_close(dba->cursor);
dba->cursor = NULL;
}
dba->cursor = NULL;
#if (DB_VERSION_MAJOR > 2) || (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR > 6) || (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 6 && DB_VERSION_PATCH >= 4)
if (dba->dbp->cursor(dba->dbp, NULL, &dba->cursor, 0)) {
if(dba->dbp->cursor(dba->dbp, NULL, &dba->cursor, 0)) {
#else
if (dba->dbp->cursor(dba->dbp, NULL, &dba->cursor)) {
if(dba->dbp->cursor(dba->dbp, NULL, &dba->cursor)) {
#endif
return NULL;
}
@@ -164,14 +166,19 @@ DBA_FIRSTKEY_FUNC(db2)
DBA_NEXTKEY_FUNC(db2)
{
DB2_DATA;
DBT gkey = {0}, gval = {0};
DBT gkey, gval;
char *nkey = NULL;
memset(&gkey, 0, sizeof(gkey));
memset(&gval, 0, sizeof(gval));
if (dba->cursor->c_get(dba->cursor, &gkey, &gval, DB_NEXT)
|| !gkey.data)
return NULL;
if (newlen) *newlen = gkey.size;
return estrndup(gkey.data, gkey.size);
if(!dba->cursor->c_get(dba->cursor, &gkey, &gval, DB_NEXT)) {
if(gkey.data) {
nkey = estrndup(gkey.data, gkey.size);
if(newlen) *newlen = gkey.size;
}
}
return nkey;
}
DBA_OPTIMIZE_FUNC(db2)
+6
View File
@@ -0,0 +1,6 @@
# $Source$
# $Id$
define_option with-dba 'dba support?' yesnodir no \
' Whether to build the dba extension.'
+6
View File
@@ -0,0 +1,6 @@
LTLIBRARY_NAME = libdbase.la
LTLIBRARY_SOURCES = dbf_head.c dbf_rec.c dbf_misc.c dbf_ndx.c dbase.c
LTLIBRARY_SHARED_NAME = dbase.la
include $(top_srcdir)/build/dynlib.mk
+1 -1
View File
@@ -9,5 +9,5 @@ PHP_ARG_ENABLE(dbase,whether to enable dbase support,
if test "$PHP_DBASE" = "yes"; then
AC_DEFINE(DBASE,1,[ ])
PHP_NEW_EXTENSION(dbase, dbf_head.c dbf_rec.c dbf_misc.c dbf_ndx.c dbase.c, $ext_shared)
PHP_EXTENSION(dbase, $ext_shared)
fi
+4
View File
@@ -0,0 +1,4 @@
# $Id$ -*- sh -*-
define_option with-dbase 'dBase support? ' yesno no \
' Whether to use the bundled dbase library.'
@@ -1,2 +1,2 @@
mime_magic
dbplus
Hartmut Holzgraefe
Loaded 100 of 950 files, more files were not shown because too many files have changed in this diff. Show more