Compare commits

...
2 Commits
87 changed files with 4707 additions and 9862 deletions

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
If you think you've found a bug in PHP3, you can report it on the bug
reporting page at:
http://www.php.net/
Current Known Bugs:
* split() function doesn't return regex errors nicely
* Preprocessed scripts don't work with require() and define()
* unset() doesn't actually erase the variables it just marks them as uninitialized
* Some parts in the language core prevent more than 256 arguments in function
calls from being possible
+624
View File
@@ -0,0 +1,624 @@
Noticeable Changes between PHP/FI 2.0 and PHP 3.0
=================================================
This file was designed to be viewed with a tab size of 4 characters.
This file is divided into 4 sections:
1. Downwards incompatible language changes. This section includes all of
the changes in the core language which may require people to modify
their scripts before using them with PHP 3.0. It does NOT list
changes made in the behavior of specific functions.
2. New language features. This section includes all of the new additions
to the core language, that may be used to enhance scripts designed for
PHP 3.0. Likewise, it does not include a listing of new functions.
3. Structural changes not directly effecting the end user. The core
of PHP 3.0 is a complete rewrite. As such, many issues effecting
PHP/FI 2.0 were addressed and vastly improved in this version,
resulting in a much more stable and efficient implementation. This
section lists these changes in design.
4. Other changes that don't fit in any of the above categories.
Please remember that PHP 3.0's core is a complete rewrite, and thus,
there may be other undocumented incompatibilities we haven't thought
of ourselves. If you think you've found a incompatibility (or a new
feature) which is not listed here, please mail us at
php-dev@php.iquest.net.
- Zeev
------------------------------------------------------------------------------
Downwards incompatible language changes
=======================================
[1] The close-PHP tag has changed from > to ?>
This means that instead of writing:
<?echo $title;>
You should write:
<?echo $title;?>
PHP3 also includes support for a longer-form start tag that is
XML-compliant:
<?php echo $title;?>
The ability to use the short start tag ('<?') can be turned on and
off using the short_tags() function. Whether it is enabled or not by
default is a compile-time option (normally set to enabled by default).
[2] Semicolons in if/elseif/else must be replaced with colons.
For example, the equivalent of:
if (expr);
statements
...
elseif (expr);
statements
...
else;
statements
endif;
in PHP 3.0 would be:
if (expr):
statements
...
elseif (expr):
statements
...
else:
statements
endif;
Note that the endif is followed by a semicolon and not a colon even in
PHP 3.0, which marks the end of the entire IF sentence.
Also note that the implementation of the colon-mode and curly-braces
mode in PHP 3.0 is identical, one isn't buggier than the other (note
that I'm not saying they're not buggy, though :)
[3] Semicolons in while loops must also be replaced with colons.
For example, the equivalent of:
while (expr);
statements
...
endwhile;
in PHP 3.0 would be:
while (expr):
statements
...
endwhile;
Note that the endwhile is followed by a semicolon and not a colon even
in PHP 3.0, which marks the end of the WHILE sentence. As with the IF
statement, the implementation of the colon-mode and curly-braces mode
in PHP 3.0 is identical, one isn't buggier than the other.
Also note that failing to change the semicolon to a colon can result in
scripts that get stuck in the while loop because the loop-condition never
changes.
[4] $foo[0] is no longer identical to $foo.
In PHP/FI 2.0, a side-effect of the implementation caused $foo[0] to be
identical to $foo. This is not the case in PHP 3.0.
[5] Expressions determine their types differently.
The way expressions are evaluated has changed radically in PHP 3.0.
Expressions are no longer given the type of the left argument, but are
assigned types taking both types into account, and regardless of which
is on the left side and which is on the right side. On simple scripts
that should probably not effect you, but if you've relied on this fact
(even without realizing you do) it may change the way your scripts work.
Consider the next example:
$a[0]=5;
$a[1]=7;
$key = key($a);
while ("" != $key) {
echo "$key\n";
next($a);
}
In PHP/FI 2.0, this would display both of $a's indices. In PHP 3.0, it
wouldn't display anything. The reason is that in PHP/FI 2.0, because the
left argument's type was string, a string comparison was made, and indeed
"" does not equal "0", and the loop went through. In PHP 3.0, when a
string is compared with an integer, an integer comparison is made (the
string is converted to an integer). This results in comparing atoi("")
which is 0, and $key which is also 0, and since 0==0, the loop doesn't
go through even once. The fix for this is simple, by replacing the
while statement with:
while ("" != stringval($key)) {
This would first convert the integer 0 to a string "0", and then
compare "" and "0", which are not equal, and the loop would go through
as expected. As mentioned later, casting operators are supported in
PHP 3.0 for a quicker and more readable way of changing variables'
types. For example, you could use:
while ("" != (string)$key) {
[6] The structure of error messages has changed.
Although the error messages are usually more accurate, you won't be shown
the actual line of text and actual place in which the error occured.
You'll be supplied with the line number in which the error has occured,
though.
[7] The format string argument to echo is no longer supported.
Use printf(format,arg1,arg2,arg3,...) instead (unlimited arguments).
[8] The use of read-mode $array[] is no longer supported.
That is, you cannot traverse an array by having a loop that does $data =
$array[]. Use current() and next() instead. Also, $array1[] = $array2
does not append the values of $array2 to $array1, but appends $array2
as the last entry of $array1 (see the multidimensional array support).
[9] Apache versions older than 1.2 are not supported anymore.
The apache module requires apache 1.2 or later (1.3-beta is supported).
[10] Indirect references inside quoted strings
PHP2-style indirect reference inside quoted strings is no longer
supported. That is, if $foo="bar", and $bar="abc", in PHP2,
"$$foo" would print out "abc". In PHP3, this would print
"$bar" (the contents of $foo is replaced with "bar").
To use indirect reference in PHP3 inside quoted strings, you should use
the new notation: "${$foo}". The standard $$foo notation will work
outside of the quoted string.
[11]
Some functions have changed names, are missing, or have been deprecated
by other functions
As a whole new rewrite, written by many more people and supporting many
more APIs than it's predecessor, there's a good chance some of the functions
you're used to from PHP/FI 2 aren't available in release 3, or have changed
names. Many functions that do exist behave a bit differently, mainly
because they return different values for errors (false) but also for other
reasons. We can't list all of these functions here, simply because drawing
a full comparison between the function sets of the two versions is way too
much work. If a converted PHP/FI 2 script doesn't work for you, nothing
can replace the good old human eye going over the code, doublechecking
with the online manual that each function still does what you expected it
to do.
[12] Other incompatibilities.
It's not too unlikely that other documented behavior of PHP2 has changed
in this release. If you think you've found an example, please mail
us at php-dev@php.iquest.net. Even if you've found an undocumented
feature of PHP2 that stopped working in PHP3, we'd like to know about it
(although it's more than likely that it will not be supported).
------------------------------------------------------------------------------
New Language Features
=====================
[1] Expressions
PHP 3.0 includes a rich implementation of expressions, much more advanced
than this of 2.0. Just about any complex C-like or perl-like expression
would work. Support was added for assignment operators (+=, -=, *= etc),
pre and post increment/decerement (e.g. $i++, ++$i) and the questionmark
operator ( (expr?expr:expr) ). Every assignment is now an expression
with a value, which means stuff like $a = $b = $c = $d = 0; would work.
It is difficult to describe the power of expressions within a few lines
of text, but if you're familiar with them, you probably get the picture.
[2] for loops are now supported.
for loops were fairly difficult to implement (in fact, we didn't find
any parallel interpreter that supports for loops anywhere (no, perl is
not an interpreter)). The bottom line is that for loops work, and are
around 5% slower than comparable while loops (that may vary), but often
they're much nicer.
The syntax is identical to the one of C:
for (expr; expr; expr) statement;
or
for (expr; expr; expr) { statements ... }
The first expression is executed the first time the loop is encountered,
the loop is run as long as the second expression is evaluated as TRUE,
and after each iteration, the 3rd expression is evaluated.
Colon-mode FOR loops are also supported:
for (expr; expr; expr):
statements
...
endfor;
[3] do..while(expr) loops are now supported.
Like with its C parallel, the statements inside a do..while loop are
run once the first time the loop is encountered, and then as long as
the expression evaluates as true.
For example:
do {
statements;
} while ($i++ < $max);
[4] break and continue statements are now supported inside loops.
You can break out of loops, or continue to the next iteration of the
loop using these statements. A special feature of PHP is the ability
to specify an expression argument to break or continue, which specifies
how many loops you want to break out from or continue to. For example:
for ($i=0; $i<10; $i++) {
for ($j=0; $j<10; $j++) {
if ($j>5)
break;
if ($i>5)
break 2;
}
}
The first break statement would end the inner loop every time $j is
greater than 5. The second break statement would end both the inner
and outer loop when $i is greater than 5.
Note: For this matter, switch statements are considered as loops. So
if you write "break 2;" inside a switch statement, you would be asking
to break out of the switch, and the innermost loop in which is nested.
[5] Switched to C-style declaration of functions.
Here's a pretty useless function which makes a good example:
function concat($str1,$str2)
{
return $str1.$str2;
}
NOTE: The old style function definition is still supported, to
allow easier upgrading from PHP/FI 2.0 scripts. Simply
change 'function' to 'old_function' for these functions.
[6] OOP support
Classes and inheritance are supported to a limited extent in PHP 3.0.
Here's how to declare a simple class:
class simple_class {
var $property1,$property2;
var $property3=5;
function display() {
printf("p1=%d, p2=%d, p3=%d\n",
$this->property1,
$this->property2,
$this->property3);
}
function init($p1,$p2) {
$this->property1 = $p1;
$this->property2 = $p2;
}
};
Here's how to create an object of that class:
$obj = new simple_class;
At this point, $obj is an object with 2 uninitialized variables, 1
initialized variable, and 2 member functions. No protection is made on
the internals of the object, and using its properties is simple:
$obj->property1 = 7;
would assign 7 to $property1 inside $obj. Calling member functions is
also simple:
$obj->display()
would run the display() member function of $obj. Note that the
implementation of display() uses the special variable $this, which is
replaced with the object the function is called on.
Inheritance is pretty simple too:
class complex_class extends simple_class {
var $property4="test";
function display() {
printf("p1=%d, p2=%d, p3=%d, p4=%d\n",
$this->property1,
$this->property2,
$this->property3,
$this->property4);
}
}
Basically, the class complex_class inherits everything from its parent,
simple_class, except properties or member functions which override the
ones in the parent. In this example, since we supply an alternative
display() function, it would be used with complex_class objects instead
of the display() function that was declared in simple_class. On the other
hand, since we don't supply an alternative init() function, complex_class
objects would have the same init() function as simple_class objects do.
As with expressions, it's impossible to teach OOP in a few lines, and
personally I'm unclear as to how useful this would be in day to day
scripting. If you like this, play with this until you figure it out :)
Objects can reside in arrays, and can contain arrays. However,
a limitation of the current implementation doesn't allow an object
to contain an array of objects (actually, this is allowed, but
there's no way to address the properties of such an object directly,
but only indirectly). For example, assuming $a[3] is an object,
$a[3]->b[2] is an object as well, you can't address the properties
of $a[3]->b[2] (i.e. you can't write $a[3]->b[2]->foo = "bar", for
instance).
[7] Function pointers are now supported.
A simple illustrative example:
$func_ptr = "time";
$current_time = $func_ptr();
is identical to
$current_time = time();
[8] Indirect references are much more powerful.
For example, one can use the dollar operator an infinite amount of times:
$a = "b";
$b = "c";
$c = "d";
$d = "e";
$e = "Testing\n";
echo $$$$$a;
Would display $e's content, which is "Testing\n".
In addition, one can use complex expressions to generate variable names
using a perl-like notation:
$i="123";
${"test".$i} = 5;
would assign 5 to $test123.
[9] A string concatenation operator was added, '+' no longer concatenates strings.
A perl-like string concatenation operator was added, the '.' operator.
It converts both of its arguments to strings, and concatenates them.
For example:
$result = "abcd".5;
assigns "abcd5" to result. Note that under PHP 3.0, the '+' operator
no longer performs concatenation if its arguments are strings. Use
the '.' operator instead.
[10] Supports passing function arguments by references instead of by value.
Support for passing function arguments by reference instead of by value
has been added. This doesn't result in having to change the function
implementations in any way, but, when calling the function, you can
decide on whether the variable you supply would actually be changed by
the function, or a copy of it.
Example:
function inc($arg)
{
$arg++;
}
$i=0;
inc($i); # here $i in the outer scope wouldn't change, and remain 0
inc(&$i); # here $i is passed by reference, and would change to 1
[11] Support for multidimensional arrays.
(Or as Andi calls them, 'hyperdimensional variables'.)
The easiest way to define this support of PHP 3.0 is inductive -
arrays can contain any type of variables, including other arrays.
A simple example:
$a[0]=5;
$a[1]["testing"]=17;
$b["foo"]=$a;
Ok, so it may be not so simple. Play with it, it's pretty powerful.
[12] Array initialization is now supported.
For example, let's say you want to initialize a lookup table to convert
number to month names:
$months = array("January", "February", "March",
"April", "May", "June", "July", "August",
"September", "October", "November", "December");
would assign $months[0] to be January, $months[1] to be February, etc.
Alternately, you may want the count to start at '1' instead of 0.
You can do so easily:
$months = array(1=>"January", "February", "March",
"April", "May", "June", "July", "August",
"September", "October", "November", "December");
Also, you can specify an index for every entry, not just the first one:
$first_names = array("Doe"=>"John", "Gates"=>"William",
"Clinton"=>"Bill" });
would assign $first_names["Doe"]="John", etc.
[13] Perl style lists now supported.
Multiple values from arrays may now be assigned into several
variables using one assignment. For example:
$str = "johndoe:x:555:555:Doe, John:/home/johndoe:/bin/tcsh";
list($username,$passwd,$uid,$gid,$realname,$homedir,$shell) =
explode(":",$str);
Would assign 'johndoe' into $username, 'x' into $passwd, etc.
[14] Colons are supported in 'case' and 'default' statements.
For example:
switch($value) {
case 'A':
statement;
break;
case 'B':
statement;
break;
case 'C':
statement;
/* fall-through */
default:
statement;
}
Semicolons are still supported, but when writing new scripts, they
should be phased out in favour of colons.
------------------------------------------------------------------------------
Non Language Related New Features
=================================
[1] Persistent resource lists.
In plain english this means that there's now an easy way of writing the
SQL drivers so that they don't open and close the SQL link every time,
but instead open it the first time it's required, and then use it on
every later hit. As of PHP 3.0a1, only the MySQL, mSQL and PostgresSQL
drivers have been changed (rewritten) to take advantage of this option.
To use it, use mysql_pconnect() instead of mysql_connect() (or the
equivalents for the two other databases).
[2] Configuration file.
PHP now has its own configuration file, and many compile-time options
of PHP2 are now configurable at runtime.
[3] Syntax Highlighting.
A syntax highlighter has been built into PHP 3.0, which means PHP 3.0 can
display your code, syntax highlighted, instead of executing it.
There are currently two ways to use the syntax highlighter. One is to
use the show_source() statement. This statement is identical to the
include() statement, except instead of executing the file, it displays
its source syntax highlighted.
The second way is possible only when running as an apache module, and is
to define a special extension for PHP 3.0 source files (e.g. .php3s)
and instruct apache to automatically syntax highlight them.
[4] Loadable modules.
This would have a huge impact on the Windows version, and would probably
be used in the UNIX environment as well. One can now add PHP internal
functions in runtime by loading a dynamic module. This is known to work
under Solaris, Linux and Win32 at this time, but would be ported to any
other capable platform if an incompatability is found.
------------------------------------------------------------------------------
Other Interesting Issues
========================
[1] Improved performance.
The performance of PHP 3.0 is much better than the one of PHP/FI 2.0.
Memory consumption has been dramatically reduced in many cases, due
to the use of an internal memory manager, instead of apache's pools.
Speedwise, PHP 3.0 is somewhere between 2 and 3 times faster than
PHP/FI 2.0.
[2] More reliable parser.
After PHP 3.0 is well tested, it'll be pretty safe to say that it's
more reliable than PHP/FI 2.0 is. While PHP/FI 2.0 performed well on
simple, and fairly complex scripts, a fundamental design difference
from PHP 3.0 makes it more prone to errors. In PHP 3.0, obscure parser
problems are much less likely.
[3] Improved C API.
If you're a C coder, adding functionality to PHP was never easier.
A pretty well documented API is available (apidoc.txt), and you no longer
have to touch the parser or scanner code when adding your function.
Also, it's more complicated to 'go wrong' when implementing a PHP3
function than it was in PHP2 (no stack to maintain) - but of course,
you can mess up here too :)
[4] Name change.
PHP/FI 2.0 was renamed to PHP 3.0, and the meaning has changed from
'Personal Home Pages / Forms Interpreter' to 'PHP: Hypertext Preprocessor'.
'Personal' home pages was an understatement for PHP/FI 2.0, and is
definitely an understatement for PHP 3.0.
+339
View File
@@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
+857 -17
View File
@@ -1,20 +1,860 @@
PHP 4.0 CHANGE LOG ChangeLog
PHP 3.0 CHANGE LOG ChangeLog
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
??? ?? 1999, Version 4.0 Beta 2
- Removed --with-shared-apache (Sascha)
- Added patch for reverse lookup table in base64_decode (Sascha)
Submitted by bfranklin@dct.com
- Merged in php3 version of str_replace (Sascha)
- Added DBA module (Sascha)
- Added session id detection within REQUEST_URI (Sascha)
- Merged in HP-UX/ANSI compatibility switch from php3 (Sascha)
- Fixed rpath handling for utilitites built during Apache build (Sascha)
- Added missing E_ error level constants (Zeev, libzend)
- Fixed a bug in sending multiple HTTP Cookies under Apache (Zeev)
- Fixed implicit connect on the MySQL, mSQL, PostgreSQL and Sybase
modules (Zeev)
December 24 1998, Version 3.0.6
- Fix GetImageSize() to work with non-standard jpg images
- Add Mersenne Twister functions (mt_rand, mt_srand, etc)
- Add str_replace() function
- Add chunk_split() function
- Fixed a bug in the memory limit code, in cases where $php_errormsg was
also used.
- Add iptcparse() function
- Adobe FDF supported
- getallheaders() NULL string fix <michale@utko.fee.vutbr.cz>
- Add all configuration directives to phpinfo() page
- Functions pack() and unpack() rewritten to be binary and buffer overrun
safe and behave like the Perl functions for all implemented format codes.
- Ensured that msql_error() will not return error messages generated by
previously-run scripts.
- Add base_convert() function
- Make sprintf() and printf() output binary safe
- Made gzgetc binary safe
- Add convert_cyr_string() and quoted_printable_decode() functions
- Fix ldap_free_result() core dump bug
- Add support for current OpenLDAP-2.0-devel library
- Add php3_asp_tags directive so it can be set from Apache config files
- Added UTF-8 support in the XML extension
- Make rand(min,max) safer on older platforms where the low-order bits have
short cycles.
- Added new pdf (Portable Document Format) module
- Added an XML parsing extension using James Clark's "expat" library
- Optimized parts of the token cache code.
- Terminate on out-of-memory errors. Until now, PHP could crash in out of
memory situations (clean-up, no real effect).
- Unterminated comments in include files were being reported with the wrong line
number. Fixed.
- Added ImageCopy() and ImageColorDeallocate(). ImageCopy() is about
20% faster than ImageCopyResized(). ImageColorDeallocate() marks
palette entries free for reuse (by <mka@satama.com>).
- In the CGI version, it was impossible to access resources (e.g. SQL links,
images) from user-defined shutdown functions. Fixed.
- Added optional third parameter to strpos() to specify the offset to
start searching from.
- Fixed a crash bug in unset() when unsetting illegal variables (rare).
- Made ImageInterlace and ImageTransparentColor parameters optional, and made
them return the current/new settings.
- Optimized GetImageSize() <thies@digicol.de>.
- Made odbc_autocommit() without args return status
- Added connect workaround for OpenLink ODBC
- Added minimal InterBase support. Tested only on 4.0 & Linux.
- Fixed some memory leaks and bogus error messages in the URL handler of
the various file open functions. Should only affect error handling
in bad URLs.
October 5 1998 Version 3.0.5
- mysql_field_flags now reports all MySQL flags and the result is suitable
for automatic parsing. Compatibility warning: The result format has
changed. If you have scripts parsing the result of this function, you
may need to adapt them.
- Made nl2br() binary safe (not that it's of much use).
- Fixed a bug in the API function getThis(). It affected mostly the dir
functions, if nested within objects.
- Fixed a problem in require() in conjunction with switch(), and in some other
cases. Also fixed an identical problem with the call_user_function() API
function.
- Removed -lpthread when compiling with MySQL support. It caused various
serious problems when compiled into Apache.
- Add serialize() and unserialize() functions from jkl@njet.net
- Fix in_addr_t check for systems with in_addr_t in netinet/in.h
- Add atan2() function
September 22 1998 Version 3.0.4
- Added uksort() - array key sort using a user defined comparison function.
- Added 'j' support to date() - generates the day of the month, without
possible leading zeros.
- Added support for multiple crypt() encryptions if the system supports it
- Added optional support for ASP-style <% %> and <%= tags
- Fixed data loss problems with very large numeric array indices on 64-bit
platforms (e.g. DEC UNIX).
- 2 cursor_type parameters for ifx_query() and ifx_prepare changed
to 1 (bitmask). Added a few constants for use in Informix module.
- Added php3.ini option ifx.charasvarchar. If set, trailing blanks
are stripped from fixed-length char columns. (Makes life easier
for people using Informix SE.)
- Static SNMP module which compiles with ucd-snmp 3.5.2
- fixed imap_header & header_info from crashing when a header line
is > 1024 characters.
- Added patch for rfc822_parse_adr to return an array of objects instead
of a single object.
- Informix Online 7.x & SE 7.x support now fairly complete and stable
- Add dbase_get_record_with_names() function
- Added a special case for open_basedir. When open_basedir is set to "."
the directory in which the script is stored will be used as basedir.
- Include alloca.c in the distribution for platforms without alloca().
- Improved stripping of URL passwords from error messages - the length of the
username/password isn't obvious now, and all protocols are handled properly
(most importantly, http).
- Copying objects that had member functions with static variables produced
undetermined results. Fixed.
- Added function lstat() and cleaned up the status functions,
added tests for file status functions (this may break on some plattforms)
- Fixed is_link() - it was returning always false.
- Fixed apache_note() - it was corrupting memory.
- New Function. void get_meta_tags(string filename); Parses filename until
closing head tag and turns all meta tags into variables prefixed with 'meta_'.
The below meta tag would produce $meta_test="some string here"
<meta name="test" content="some string here">
- Generalized some internal functions in order to better support calling
user-level functions from C code. Fixes a few sporadic problems related
to constructors inside eval() and more.
- Fixed an endless loop in explode(), strstr() and strpos() in case of an
invalid empty delimiter.
- rand() now accepts two optional arguments, which denote the requested range
of the generated number. E.g., rand(3,7) would generate a random number
between 3 and 7.
- Added M_PI constant.
- Added deg2rad() and rad2deg() for converting radians<->degrees.
- ImageArc() misbehaved when given negative angles, fixed.
- Fixed a bug in ereg() that may have caused buglets under some circumstances.
- Added imap_status
- Shutdown functions, registered via register_shutdown_function(), could never
generate output in the Apache module version. Fixed.
- Brought IMAP docs into sync with acutal imap code
- imap_fetchstructure now takes in optional flags
- Fix potential core dumps in imap_append and imap_fetchtext_full
- Fix problem in SetCookie() function related to long cookies
- Add uasort() function to go along with usort (like sort() and asort())
- Add port number to Host header as per section 14.23 of the HTTP 1.1 RFC
- Fix imap_reopen to only take 2 arguments with an optional 3rd flags arg
- Add optional 2nd argument to imap_close
- Add CL_EXPUNGE flag to imap_open() flags
- Fix 4th arg on imap_append(). It was getting converted to a long by mistake.
- Fix shutdown warning in the LDAP module
- *COMPATIBILITY WARNING* imap_fetchstructure() "parametres" object and property
name changed to "parameters" to match the documentation and to be consistent
with the rest of the API.
- Delete uploaded temporary files automatically at the end of a request
- Add upload_max_filesize and correponsing php3_upload_max_filesize directive
to control the maximum size of an uploaded file. Setting this to 0 would
completely eliminate file uploads.
- Force $PHP_SELF to PATH_INFO value when running in CGI FORCE_CGI_REDIRECT mode
- Add apache_lookup_uri() function which does an internal sub-request lookup
and returns an object containing the request_rec fields for the URI. (Yes,
you have to be a bit of a gearhead to figure this one out)
- Fix a few signed char problems causing functions like ucfirst() not to work
correctly with non-English charsets
- md5() function not binary safe - fixed
August 15 1998 Version 3.0.3
- Changed the name of fopen_basedir to open_basedir, to be a little more
accurate about what it does.
- Added Hyperwave module
- Added config-option (php3_)enable_dl <on/off>. This enables/disables the
dl() function. In safe-mode dl() is always disabled.
- Auto-prepended files were crashing under some circumstances - fixed.
- Win32 mail fixes provided by walton@nordicdms.com
- Comparing between arrays and/or objects now generates a warning (it always
returns false, as it used to; no comparison is made)
- Fixed a bug in the syntax highlighting code, that made ending-double-quotes
appear twice under certain circumstances.
- Fix bug in filetype() function related to symlinks
- Started integrating Informix SE support to PHP configure/makefile setup.
- gdttf roundoff fixes from ellson@lucent.com
- Added initial Informix SE support files from Danny Heijl - This code still
needs to be integrated into the PHP configure/makefile setup and the code
itself needs more work.
- return in the global scope now terminates the execution of the current file.
- Added the ability to register shutdown function(s), via
register_shutdown_function($function_name).
- Clean up const warnings
- Add write support to ftp fopen wrappers
- Add strspn() and strcspn() functions
- On systems without strerror use Apache version if compiling as Apache module
- The PHP start tag was being ignored under some circumstances - fixed.
- The db, dbase and filepro functions are now Safe-Mode aware.
- Added config-option (php3_)fopen_basedir <path>. This limits the directory-
tree scripts can open files in to <path>.
- Fixed pg_loreadall that didn't always return all the contents in a PostgreSQL
large object. Also, doesn't pass through anything if method is HEAD.
- configure fix to create target Apache module dir
- Fix core dump in imageTTFtext() function
- Added static IMAP support
- Syntax highlighting was generating additional whitespace - fixed.
- Added ucwords. Works like ucfirst, but works on all words within a string.
- Added array_walk() - apply user function to every element of an array
- Added usort() - array sort that accepts a user defined comparison function!
- Added the ability to call user-level functions and object methods on demand
from the C source using a completely generalized, slick API function.
Miracles do happen every once in a while.
- Added constructors. Don't even squeek about destructors! :) (we mean that)
- Make pg_lowrite() binary safe
- Fixed mod_charset option in ./setup
- Fixed rewinddir() and dir()::rewind() under Win32 (they didn't work before).
- Add Win32 COM support! By-name referencing is supported using the IDispatch
interface (automation). Available functions - COM_Load(), COM_Invoke(),
COM_PropGet() and COM_PropSet().
July 19 1999, Version 4.0 Beta 1
- First public beta of PHP 4.0
July 20 1998 Version 3.0.2a
- Fix a quirk in the configuration file parser, the endless fountain of joy
and fun.
- Fix a bug in the API function add_method() that made dir() crash.
July 18 1998 Version 3.0.2
- Compile cleanups for *BSD
- Add support for the OpenLink ODBC Drivers
- Add PHP_SELF, PHP_AUTH_* and HTTP_*_VARS PHP variables to phpinfo() output
- Add workaround for broken makes
- Add Apache 1.3.1 support (some Apache header files were moved around)
- Added apache_note() function.
- Fix order of system libraries and detect libresolv correctly
- Fixed a bug in the Sybase-DB module. Several numeric field types were
getting truncated when having large values.
- Added testpages for unified odbc
- Fix php -s seg fault when filename was missing
- Made getdate() without args default to current time
- Added ImageColorResolve() and some fixes to the freetype support.
- Added strcasecmp()
- Added error_prepend_string and error_append_string .ini and .conf directives
to make it possible to configure the look of error messages displayed by PHP
to some extent
- Added E_ERROR, E_WARNING, E_NOTICE, E_PARSE and E_ALL constants, that can be
used in conjunction with error_reporting()
(e.g. error_reporting(E_ERROR|E_WARNING|E_NOTICE);
- Fixed a crash problem with classes that contained function(s) with default
values.
- Fixed a problem in the browscap module. Browscap files weren't being read
properly.
- Fix -L path in libphp4.module to make ApacheSSL compile without errors
- Fix StripSlashes so it correctly decodes a \0 to a NUL
July 04 1998 Version 3.0.1
- echo/print of empty strings don't trigger sending the header anymore.
- Implemented shift left and shift right operators (<< and >>)
- Compile fix for cc on HP-UX.
- Look for beta-version Solid libraries as well.
- Make GD module show more info in phpinfo().
- Compile fix for NextStep 3.0.
- Fix for Oracle extension on OSF/1.
- Fix gd 1.3 bug in ImageColorAt().
- pg_loread() hopefully handles binary data now.
- Turned off some warnings in dns.c
- Added ImageTTFBBox() and made ImageTTFText() return bounding box.
- Added constants for Ora_Bind()'s modes.
- Renamed all hash_*() routines to _php3_hash_*() to avoid clashes with other
libraries.
- Changed uodbc default LONG behaviour: longreadlen 4096 bytes, binmode 1.
The module now actually uses the php.ini settings.
- New PostgreSQL functions: pg_fetch_row(), pg_fetch_array()
and pg_fetch_object()
- Fix a segmentation fault when calling invalid functions in certain
circumstances
- Fix bug that caused link-related functions to not pay attention to
run-time safe mode setting (it was using whatever was set at compile time).
- Fix bug in exec() function when used in safe mode
June 6 1998 Version 3.0
- Add checkdnsrr function (check availability DNS records)
- Add getmxrr function (get MX hostnames and weights)
- Fixed bug in nl2br() function
- Fix for an RC5 related problem in the Sybase module, when dealing
with very long data types.
- Speed up string concatenation by roughly a factor of 2
- Add escape-handling to date function
- Make base64 functions binary safe
- Add strrpos function to complement strpos function added in RC5
- Add ltrim function (strips only at the start of string)
- Add rtrim as an alias to chop() for completeness sake
- Add trim function (similar to chop, except it strips at the start as well)
- Added 2 optional args to fsockopen function - errno and errstr
- Fixed bug in split() function related to leading matches
- Fixed problem in error_log() function (thanks to Jan Legenhausen)
- empty("0") was returning true - fixed
- Removed the old sybsql module. Use the new sybase_*() functions instead.
- Several fixes to the configuration file parser
- LDAP fixes - fixed return values on several functions
May 23 1998 Version 3.0RC5
- The BC math library functions now compile in by default.
- Fixed a bug in virtual() and other types of SSI's (e.g. <!--#exec). Under
certain circumstances, this used to result in random problems.
- Fixed a bug in virtual(). It was misbehaving if it was called before any
other output.
- Added mysql.default_port, mysql.default_host, mysql.default_user and
mysql.default_password ini-file directives.
- Improved handling of the MySQL default port. It now honors /etc/services
and $MYSQL_TCP_PORT.
- Fixed a crash in opening of broken ftp:// URLs, and improved error reporting
in opening of URLs.
- Fixed several non-critical scanner issues with syntax highlighting mode and
the <script language=php> tag.
- Fixed fseek on windows. (windows only): fseek will not return proper results
on files opened as text mode. PHP uses binary mode as the default for file
operations, but this can be overiden by fopen. Do not open files in text
mode and use fseek on them!
- Add strpos() function
- Added zlib module, requires zlib >= 1.0.9
- Improved the module API implementation. Dynamic modules may now register
persistent resources (not that it makes much sense, but at least PHP
won't crash). The API itself remains unchanged.
- bcmod() wasn't always behaving like modulus should behave (it was behaving
exactly like GNU bc's % operator). Fixed.
- Changed the Sybase-DB module to always return strings, instead of auto-typing
result sets. This was done for consistency with the other database modules,
and in order to avoid overflows due to the platform-dependant limitations
of the numeric data types of PHP. You can turn compatability mode on using
the sybase.compatability_mode directive in the php3.ini file.
- Fixed problems with the TINYINT field in the Sybase-CT module.
- Applied some small speed optimizations to the Sybase-DB module querying code.
- Added 'numeric' and 'type' properties to the object returned by
sybase_fetch_field().
- The 'new' operator doesn't accept all expressions anymore. Instead, it
accepts a class name, or a variable reference (scalar, array element, etc).
- Add ora_numcols() function
- Add ora_do() and ora_fetch_into() functions to Oracle driver
- Add persistent connection support to Oracle driver
- Make Oracle driver clean up open connections and open cursors automatically
- Added fread() and fwrite() that properly handle binary data.
- Add Ora_ColumnSize() to Oracle code
- The string "0" means FALSE again. This was done in order to maintain type
conversion consistency.
- Added solid_fetch_prev() for fetching the previous result row from Solid.
- Huge integers are now automatically converted to floating point numbers
(that have a wider range).
- Floating point numbers are now displayed using scientific notation when
they're extremely big or extremely small. The 'precision' php3.ini directive
no longer designates the number of decimal digits, but rather, the maximum
number of significant digits required.
- Added support for scientific notation for floating point numbers (e.g. 1E7)
throughout the entire language.
- Fixed a potential/probable memory corruption problem with HEAD request
handling.
- Using un-encapsulated strings now generates a NOTICE-level warning
(e.g. $a = foo; instead of $a = "foo";)
- Added defined("name") function to check if a certain constant is defined
or not.
- Support new Apache mechanism for setting SERVER_SUBVERSION
- Added PHP_OS and PHP_VERSION constants
- Added the ability to define constants in runtime! Constants are script-wide,
(there's no scope, once the constant is defined, it's valid everywhere).
Syntax is define("name", $value [, $case_insensitive]). 'name' can be any name
that is a valid variable name, *without* the $ prefix. 'value' can be
any *scalar* value. If the optional 'case_insensitive' parameter is 1,
then the constant is created case-insensitive (the default is case
sensitive). Note: define() is currently *NOT* supported in preprocessed
scripts.
- Added general support for constants. The Syslog constants (e.g.
LOG_ERR, LOG_CRIT, etc.) should be accessed as constants from now on (that
is, without a $ prefix). You can still set define_syslog_variables to On
in the php3.ini file if you want to define the various $ variables. The
default for this directive in the php3.ini-dist file has been changed to
Off.
- The configuration file path variable now expands . and .. into their
respective directories. You can obtain the path of the php3.ini file
that was used by printing get_cfg_var("cfg_file_path").
- Fixed a crash-recovery parser crash ($a=7; $a[3]+=5;)
- Add gmmktime() function
- Fixed a crash with implode() and empty arrays.
- Fixed a bug that, under fairly rare circumstances, caused PHP not to
recognize if(), require() and other statements as statements, and
to complain about them as being unsupported functions.
- Beautified php3.ini-dist and added more comments to it. Also changed
the behavior of the configuration file parser to be brighter about
the various constants (TRUE/FALSE/ON/OFF etc).
- Fixed a bug in openlog() - the specified device name was being mangled.
- Memory leaks were sometimes reported erroneously - fixed.
- Improved the convertor to handle some quirks of the PHP/FI 2 parser with
comments.
- Fixed number_format() to properly handle negative numbers, and optimized it
a bit.
- Fixed static variables inside class member functions. Note that using such
static variables inside member functions usually defeats the purpose of
objects, so it is not recommended.
- Fixed a bug in fpassthru() (the file was being closed twice).
- Added strftime().
- Add set_socket_blocking() function to control blocking on socket fd's
- The sendmail_path in php3.ini was being ignored - fixed.
- Fixed a bug with file upload, with files that contained the MIME boundary
inside them.
- Fixed a bug with form variables of type array, with spaces in their
index (e.g. name="foo[bar bar]").
- gd-1.3 autodetect and support
- Year 2000 compliance is now togglable from the php3.ini file. Setting PHP
to be y2k compliant effects the way it creates cookies, and means it'll
NOT work with many browsers out there that are not y2k compliant! For
that reason, the default for this option is off.
- safe mode / fix from monti@vesatec.com
- Integrated the FreeType support in the GD extension.
- Added --with-gd=DIR and --without-gd options to configure
April 18 1998 Version 3.0 Release Candidate 4
- Auto-prepended and auto-appended files were reporting the wrong filename
in errors and in __FILE__ - fixed.
- Fix GPC problem related to mixed scalar and array vars with the same name
- Made putenv() Apache-safe. Environment variables may no longer leak in
between requests.
- The trailing semicolon is no longer required in class declarations.
- Fixed a memory leak in the (array) and (object) operators under certain
conditions.
- <script> tags weren't working unless short tags were enabled - Fixed.
- Fixed a bug in certain array indices that weren't treated as numbers
even though they looked like numbers (e.g. "10", "20").
- Changes to support renamed API functions in Apache-1.3
- Fixed the -p and -e command line switches
- Fix a segfault when calling command line version without parameters
- Fix for feof() when used on a socket
- Fix off-by-one error in fgets() when used on a socket
- Fix bug in ImageSetPixel() (Thanks to ecain@Phosphor.net)
March 31 1998 Version 3.0 Release Candidate 3
- Tiny bugfix for magic_quotes_sybase
- Fix Apache build problems introduced in RC2
- $a["0"]==$a[0] fix
- Apache-1.3 build changes to support 100% automatic builds and shared library
module builds. See INSTALL file.
March 30 1998 Version 3.0 Release Candidate 2
- Changed the socket implementation under UNIX to not use FILE pointers, in
order to work around the buggy Solaris libc (and possibly buggy libc's
in other platforms).
- Fixed a bug in min() and max() with certain arrays.
- *WARNING* Move Apache 1.3 php3 file install to src/modules/php4 instead of
src/modules/extra. Make sure you change your AddModule line correctly
in your Apache Configuration file. This change is to take advantage of
new Apache-1.3 configuration mechanism which makes it easier to build an
Apache server with PHP automatically enabled. It will also help building
a shared library module version of PHP soon.
- Fixed a crash bug with auto-appended files.
- Made --enable-discard-path work on all Unix servers #!/path/php CGI scripts
should now work everywhere. I have tested on Apache, WN and Netscape 2.0
- Made $a["123"] and $a[123] be identical. $a["0123"] is still different,
though.
- Added 'precision' ini directive, to set the number of decimal digits
displayed for floating point numbers (default - 6).
- Made integer/integer divisions evaluate to floating point numbers when
applicable (e.g., 5/2==2.5(float), but 4/2==2(int))
- Get rid of reliance on tied streams and move all socket reads and writes
to recv/send calls
- Cleaned up head.c a bit and fixed CGI SetCookie order problem
- Changed default variable parsing order to Get-Cookie-Post (GPC)
- Fixed setup so it has all configure options and defaults.
- Added optional decimal point and thousands seperator to number_format()
e.g., number_format(1500,2,',','.') == 1.500,00
- Fixed cgi bug in windows that prevented files from being parsed on many
systems and servers.
March 23 1998 Version 3.0 Release Candidate
- Added support for the Raima database (ALPHA)
- Fixed a bug in persistent PostgreSQL links and the connection-string method.
- Added EXTENSION_STATUS file, that specifies the stability and status of
every module in the distribution.
- Added optional parameters to user functions with default values, variables
that are forced to be passed by reference and variables that can be
optionally passed by reference. The ini file directive
'ignore_missing_userfunc_args' is no longer supported.
- Added fhttpd support (by Alex Belits)
- Improved performance by approximately 20-30%.
- Added mysql_error(), mysql_errno() (if available) and msql_error().
Errors coming back from the database backend no longer issue warnings.
Instead, use these functions to retreive the error.
- Patched count(), each(), prev(), next(), reset() and end() to work around
the implementation side effects of unset(). As far as the users are
concerned, this should be transparent now (even though it's slower now,
until it's thoroughly fixed in 3.1).
- Added number_format(). number_format(2499,2)=='2,499.00'.
- error_reporting() now sets the error reporting level to the supplied
argument, without any interpretations.
- Fixed a lookahead parser bug that occured under rare circumstances.
- Change the comparison operators to compare numeric strings as numbers. If
you want to compare them as strings, you can use the new C-like strcmp()
- Fixed Ora_GetColumn() bug when fetching strings
- Added Ora_ColumnName() and Ora_ColumnType()
- Preliminary LONG and LONG RAW support in Oracle extension
- Add \123 and \xAB style octal and hex escapes to "" and `` strings
- Add "-c" command line flag for specifying path to php3.ini file
- Improved list() so that elements can be skipped, for example:
list($name,,,$realname) = explode(":",fgets($passwd_file));
- Fixed a tiny bug in the hash initialization which caused excessive use of
memory. Report and fix by short@k332.feld.cvut.cz
- Fixed strtolower() and strtoupper() to work with 8-bit chars
- Fixed to compile and run on SunOS 4.1
- Fixed a crash in soundex() of an empty string
- Fixed parse_str() - it wasn't always defining the right variables,
and didn't work with arrays.
- Made [m,My]SQL create/drop database functions return success status
- Fixed some memory leak/crash problems in the Adabas module
- Added each() in order to allow for easy and correct array traversing.
- Make Apache module version respect LOCALE setting
- Add support for Apache 1.3b6+ ap_config.h file
- Fixed a nasty corruption bug in eval() and show_source() that resulted in
script termination (e.g. eval("exit();").
- Fixed a syntax highlighting problem with keywords used as variable
names.
- Fixed a possible crash and/or file descriptor leak
- Fixed line number being off by one in #! shell style execution
- Made it possible to disable auto_prepend/append with "none" filename
- Allow safe CGI calling through #!php style scripts
March 2 1998 Version 3.0b6
- Made [s]printf handle %ld
- Changed CGI version to only open regular files as input script
- Added ignore_missing_userfunc_args directive to suppress warnings messages
about missing arguments to user-defined functions
- Added Postgres function - pg_cmdtuples(), by Vladimir Litovka
- Disabled command line options if used as CGI
- Changed CGI version to use PATH_TRANSLATED as the script file name
- Link with solid shared library instead of static one
- Fixed a crash with functions that aren't being called correctly
- Fixed file descriptor leak in auto-prepend/append
- Imap module is usable. See README in dl/imap.
February 24 1998 Version 3.0b5
- Made the URL aware file functions be enabled by default
- Fixed an unlikely crash bug in the parser, with uninitialized array elements
which are refered to as objects.
- Fixed several fields that were being incorrectly read in Sybase CT.
- Fix Apache-1.3 related SIGHUP problem which was preventing php3.ini from
getting re-read on a SIGHUP
- *** WARNING *** Downwards incompatible change: The plus operator (+) is not
longer overloaded as concatenation for strings. Instead, it converts its
arguments to numbers and performs numeric addition.
- Add Stig and Tin's bdf2gdfont script to extra/gd directory
- Added join() as an alias to implode()
- Made implode() accept arguments in the order used by explode() as well
- Made $php_errormsg local in function calls
- Fixed Apache configuration directive bugs
- Added a number of .ini directives to Apache .conf directive list
- Fixed a 'memory leak' with strtok()
- echo/print now handle binary data correctly.
- NEW now accepts any expression for the class name argument.
- Add ImageDashedLine() GD function
- Add arg_separator .ini directive so the '&' GET method separator can be
changed to ';' for example. Corresponding php3_arg_separator Apache .conf
directive works as well.
- Walked around an implementation side effect of switch(). <? switch(expr) { ?>
now works.
- Added memory caching, resulting in a significant performance boost
- Added support for for(): .. endfor; loops
- Added a new predicate - empty($var). Returns true if $var is not set,
or is FALSE. Returns false otherwise.
- Added is_integer() (same as is_long()) and is_real() (same as is_double()).
- Added sizeof() as an alias to the count() function
- Added --enable-force-cgi-redirect, to prevent the CGI from working if
someone directly accesses PHP not through Apache's CGI redirect
(off by default).
- Fixed marking of deleted dBase records. Noticed by Simon Gornall
<simon@oyster.co.uk>.
- Fixed fixed "%%" bug in [s]printf
- Fixed a UMR (initialized memory read) in the Oracle code
- Potential fix for mysql-related SIGPIPE problem which caused httpd to spin
- Made PHP responsive to the Apache link status (stop executing if the link
dies).
- Fixed a crash bug with StrongHold and secure pages
- Fixed StrongHold installation
- Optimized the function call sequence a bit.
- Fixed Sybase/CT date/datetime/money fields work to correctly.
- Fixed Apache module startup problems - php3_module_startup should only be
called once.
- Fixed ord() with characters >127
- Fixed bug in file_exists() function
- Fixed stripslashes() to remove the escaping quote (instead of backslash)
in case magic_quotes_sybase is true.
- Also make echo and print automatically remove trailing decimal zeros.
- Added htmlentities(), currently handling only ISO-8859-1 entities
- "0" is no longer considered false, the only string which is false is the
empty string "".
- Added 'true' and 'false' keywords
- Added 'xor' (logical exclusive or)
- Automatic conversion from double to string removes decimal trailing zeros.
- Added arsort() and rsort() to sort in descending order.
- Turned on "XLATOPT_NOCNV" by default for uODBC/Solid.
- Added support for a port number in the mysql_(p)connect() functions
- Fixed a file descriptor leak in the configuration parser.
- Fixed a few buglets with syntax highlighting with certain language keywords
- Added functions to control minimum severity level of Sybase messages to
display.
- Added highlight_string() - behaves like highlight_file(), only instead
of highlighting a file, it syntax highlights the contents of its
argument.
- Renamed show_source() to highlight_file(). show_source() is still
supported for downwards compatability.
- Fixed a bug in class inheritence - member functions with upper case
letters in their names couldn't be redefined.
- Made chown(), chgrp() and chmod() return TRUE/FALSE instead of 0/-1.
February 02 1998 Version 3.0b4
- Fixed a segfault bug in one of the unified ODBC error messages.
- Set default file modes to binary on Win32 (solved a lot of bs)
- Fixed file copy on Win32
- MIME file uploads fixed on Win32
- Added contributed icons by Colin Viebrock (undex extra/icons)
- Fixed the debugger enough to call it "beta code".
- Fixed some leaks in the Oracle module, tidied up the code a bit.
- Added __FILE__ and __LINE__ which evaluate to the currently parsed file
and currently parsed line respectively.
- Added ImageColorAt(), ImageColorSet(), ImageColorsForIndex(), and
ImageColorsTotal() to allow manipulating the palette of GIF images.
- Rename '--enable-url-includes' option to '--enable-url-fopen-wrapper' to
better describe what it does, and pay attention to the setting.
- Added optional parameter to the file(), readfile() and fopen() functions
to look for files located in the include path.
- Fixed bug that allowed the file() and readfile() to open files in the
include path inadvertantly.
- Fixed a (documented) bug in printf()/sprintf() with hard limited strings
and alignment (e.g. %-.20s).
- Optimized several quoted string routines.
- Added error_log ini directive to select where errors get logged when
log_errors is turned on or the error_log() function is used.
- Added the ability to direct errors to log files instead of or in addition
to the script output. Use the new display_errors and log_errors
php3.ini directives.
- Made environment variables uneraseable by POST/GET/Cookie variables.
- Fixed a bug in the elseif() construct. The expression was being evaluated
even if a previous if/elseif already evaluated to true and got executed.
- Fixed a bug in the exit code parameter of system()
- Tighten up all exec() related functions in safe mode
- Added error_log() function to log messages to the server error log, or
stderr for the CGI version.
- Added support for a general memory limit of scripts.
- Fixed a segfault bug that occured under certain circumstances with shell
escapes ($foo = `...`)
- Made keywords be valid property names of objects.
- Fixed a segfault bug when creating new objects of an unknown class.
- Fixed a problem with the maximum execution time limit, that may have
prevented this feature from working on certain platforms.
- PHP would now warn you with E_NOTICE about unknown escape characters,
e.g. "\f". It would still be considered as a backslash followed by f,
but the proper way of writing this is "\\f" or '\f'.
- Added support for ${...} inside encapsulated strings. Supported: ${foo},
${foo[bar]}, ${foo[0]}, ${$foo[$bar]}, ${$foo->bar} and ${$foo}
- Fixed a bug in automatic persistent link reconnect of the Sybase/DB module.
Thanks to Steve Willer for finding that 'stealth' bug!
- Fixed a crash bug in the GET/POST/Cookie parser in case of regular
and array variables with the same name.
- Added round() function.
- Can't use encapsed strings as variable names anymore, ie. $"blah blah".
- Fixed bug in gethostby*() functions that resulted in a core dump.
(Noticed by torben@coastnet.com.)
- Fixed bug in dbase_get_record that prevented number and date fields
from being properly decoded. (Thanks again to colins@infofind.com.)
- Make dbase_get_record include a 'deleted' field that indicates whether
that record had been marked for deletion.
- Fixed bug in dbase library that stomped on the deleted flag of the first
record in the file if it was set. (Thanks to colins@infofind.com.)
- Fixed putenv() to not report a memory leak and possibly prevent a bug
from that memory being freed.
- Added setlocale()
- Added pg_fieldisnull() (by Stephan Duehr)
- Changed pg_exec() to always return a result identifier on succees
- Solid linking fixes (tries to find the right library)
- Fixed a but with date() and the 'w' element.
- Tried to eliminate unimportant memory leak notifications.
- Made min() and max() backwards compatible and able to handle doubles.
- Add fgetc() function
- Fixed bug in getmyuid(), getmyinode() and getlastmod(). Thanks to
khim@sch57.msk.ru for pointing this out.
- Fixed http:// URL includes with no path specified send request for /.
- Added GetAllHeaders() (Apache-only)
- Added workaround that made the Image text functions 8-bit clean
- Made snmp internally compilable for Win32 (not the unix one though),
only adds 2k to binary size, so no reason not to have it there.
- Fixed ldap loading on Win32
- Fixed MySQL Info function on Win32 platform
- Fixed compilation of syntax highlighting mode
January 17 1998 Version 3.0b3
- Added mysql support under windows ;) happy happy joy joy
- Fixed dbase.dll for Win32 to actualy load now.
- Enhanced the convertor to recognize ?> as a php-close-block as well.
- Fixed potential SetCookie() core dumps
- Changed print to be an expression instead of a statement. That means you can
now do stuff like foobar() or print("Unable to foobar!"). echo has NOT been
changed.
- Removed the flex optimization flags to reduce the size of the scanner
- Added memory leak logging into apache log files (apache module only)
- Fixed a nasty bug in one of the internal stacks. This may have caused
random crashes in several occassions.
- Fixed bug in ImageGif() making it hang sometimes
- Added ImageLoadFont(), ImageFontWidth() and ImageFontHeight()
- error_reporting() now returns the old error reporting level
- Fixed url includes/opens not working under Win32
- Fixed errorneous handling of multipart/form-data input
- Added rawurlencode(), rawurldecode() and changed urlencode() and urldecode()
a bit too.
- Fixed a bug in [s]printf, sign was forgotten for doubles.
- Fixed a segfault bug in pg_fieldprtlen(), and made it accept field names
in addition to field offsets.
- Made the setup script a little more user-friendly.
- Added is_long(), is_double(), is_string(), is_array() and is_object()
- Fixed a bug in freeing of mSQL results.
- Improved pg_exec() to properly return true or false with queries that don't
return rows (i.e. insert, update, create, etc)
- Added get_cfg_var() to enable checking cfg file directives from within
a script.
- Fixed a bug with urlencode() and characters 0x80-0xff
- Changed the behaviour of ereg_replace to more intuitive. The
backslashes other than valid existing back references in the second
argument are no more evaluated as escape sequences.
- Fixed a bug in the configuration file loader and safe mode.
- Fixed a bug with configuration variables taken from the environment.
- Added <script language=php> </script> as PHP open/close tags, to allow
the use of editors such as Microsoft Frontpage.
- Fixed a bug in the default php3.ini directory - it wasn't defaulting to
/usr/local/lib properly.
- Added support for \r\n line endings
- Fixed a bug that may have prevented POST method variables from working
with certain scripts when using the CGI version.
- Convertor: Added support for single-quoted strings
- Fixed segfault bug in the Adabas module, with queries that don't return
rows (update, insert, etc).
December 22 1997 Version 3.0b2
- Changed variable type conversions that do not specify base to always use
base 10. "010" is no more 8, it is 10. Use intval ($x, 0) to get C-style
octal and hex numbers recognized.
- Fixed a possible segfault bug in several functions, when using the concat
operator and possibly other operators/functions.
- # is no longer accepted as a comment in php3.ini. Use ; instead.
- Added browscap support
- Configuration file directives are now case-sensitive
- Fixed msql_tablename() and msql_dbname()
- Added a PHP/FI 2.0 -> PHP 3.0 convertor
- Added support for shell/perl-style single quotes
- Added support for execution of external programs using backquotes ($a=`ls -l`)
- fixed mail() on windows, also fixed memory leaks in mail on windows
- added sendmail_from to handle return route on windows
- Changed the way the config file is searched. The file name is now
php3.ini (hardcoded), and it'll be looked for in: local directory, $PHPRC
and builtin path designated by ./configure under UNIX or Windows directory
under Windows.
- Fixed ereg_replace replacing empty matches and a one off buffer overflow
- Fixed File upload on windows platform
- Fixed a bug that caused 'HTTP/1.1 100 Continue' messages with
Internet Explorer 4.0 and certain scripts that receive POST variables
- Get/POST/Cookie data variables are from now *ALWAYS* strings. If you want
to use them in integer/real context, you must explicitly change their types.
This was done in order to avoid possible loss of data when doing these
conversions automatically.
- Variables named as keywords are now allowed (e.g. $function, $class, etc)
- Fixed a problem with msql() and mysql() with NULL fields
- Fixed a segfault bug with class declarations
- Fixed bugs with FOR loops and include() from within eval()
- Changed include() to be executed conditionally. PHP-3.0 efficient
unconditional include is now require()
December 08 1997 Version 3.0b1
- Switched to public beta test phase
- Generalized unset() and isset() to work on any type of variables, including
specific array indices or object properties (e.g., unset($a[4]) now works).
- Added support for object references inside encapsulated strings
(for example, 'echo "Username: $user->name"' now works)
- Added arbitary precision math support (basic operations with
unlimited range numbers, and support for unlimited decimal digits)
- Apache module can now handle preprocessed scripts (by using:
AddType application/x-httpd-php3-preprocessed .php3p
in the Apache configuration)
- Made settype() pass its first parameter by value. Improved it to be able
to convert to arrays and objects (originally by Steve Willer)
- Implemented CPU time limit on scripts when setitimer() is available
- Computed field names in the Sybase/CT and Sybase/DB modules are now named
computed, computed1, computed2, ...
- Added Sybase/CT client/server message handlers and updated the Sybase/DB ones
- Made the regexp function automatically take arguments by reference
when necessary
- Added builtin support for auto append and prepend in the parser level
- Improved the Sybase/CT sybase_query(). Should be more stable now, and
hopefully work with a wider range of queries. It's difficult to work
without docs, though, so it may still not be 100% right...
- Changed error messages to show error type, file and line with bold
- Added support for autoprepend and autoprepend
- Added some more warning flags if gcc is used
December 03 1997 Version 3.0a4
- Improved the internal functions API - no need to explicitly pass
parameters by reference to internal functions that specifically
require them, e.g. sort(), ksort(), reset(), count(), etc.
This is *STILL* downwards compatible with the previous alphas,
in the sense that you can explicitly pass the arguments by reference
if you want to.
- use srandom/random instead of srand/rand if available
- Added [m,My]sql_listfields() for downwards compatability
- -p now replaces .php3 extension with .php3p (otherwise it adds .php3p)
- Added C++ style comments (// comment)
- Fixed # commenting to terminate at a close PHP tag
- Added \0 back reference for full string match to *reg*_replace and
added backslash escaping to replace string
- Fixed a few bugs in the Sybase DB-library module.
- Added Sybase CT-library support. It should be considered experimental.
Syntax is identical to the one of the DB-library. Allows people to
connect to MS-SQL servers from Linux without having to pay for a
library!
- Beautified phpinfo()
- Add ImageColorClosest() and ImageColorExact() GD functions
- Make all .ini directives work as Apache .conf directives as well
- Added PHP2-like File() function with PHP3 URL support
- Upgraded the Sybase interface. It's practically MySQL compatible now!
Among other things, added sybase_fetch_array() and sybase_fetch_object().
- Fixed problem in multi dimensional array handling and self modifying
operators (+=, -=, etc).
- Safe Mode file open implementation
- SVR3 portability problem fix
November 23 1997 Version 3.0a3
- Made the global statement behave like PHP 2 with undefined variables
- Added msql_fetch_object() and msql_fetch_array()
- Switched between the 1st and 2nd parameters to explode(), so that it acts
like split()
- Fixed passthru(), exec() and system() functions
- Implemented second optional parameter to intval() to specify conversion base
(The default is to assume you want to do a base 10 conversion.)
- Implemented SQL safe mode for MySQL
- Read UploadTmpDir from php3.ini instead of apache conf files
- Added mysql_fetch_object() and mysql_fetch_array()
- Changed function->old_function. function is now an alias to cfunction.
- Split the magic_quotes directive to get/post/data and other
- Added generic copy() function
- Added a $GLOBALS[] array, which contains all global variables
- Fix broken getimagesize() function
- Made mysql_fetch_field() and msql_fetch_field() optionally accept a 2nd argument
- Fixed mysql_data_seek() and msql_data_seek()
- Changed list assignment to list(...) and array init to array(...)
- Made <?php_track_vars?> work
- cgi when not in debug mode uses regular malloc(), free() functions now
- Added preliminary support for perl-style list assignments
- Fixed a bug in mysql_result() and msql_result() when specifying table
- renamed internal error-handling function and levels
- Added basename and dirname functions similar to sh counterparts
- Added base64_encode() and base64_decode()
- Support Basic authorization for http url includes
- Added parse_url() function to extract url components
- Made it possible to use anonymous ftp on URL includes
- Fixed url includes to handle different URLs better
- Fixed mysql_field*() functions
- Made mysql_connect() smarter, after a mysql_close() (applies to msql and pgsql too)
November 6 1997 Version 3.0a2
- Fixed a segfault bug caused by non-persistent connect in [m,My,Postgres]SQL modules
- Fix command line argument handling
- Made empty array list assignments work ($a=({});)
- Made '$' escaping optional when a variable name parsing isn't possible
- Added support for mysql_[p]connect(host) and mysql_[p]connect(host,user)
- New layout in phpinfo()
- Update Oracle extension to use php3_list functions
- Add includepath support
- Add #!php shell script escape support
- Change name of CGI/command line version from php3.cgi to php
- Add SNMP extension
- show_source() support
- Parsing of command-line args for CGI version
- Support for backreferences in ereg_replace
- Support for hexadecimal numbers directly at the scanner level
- Support octal numbers directly at the scanner level
- Fixed problem with huge html files (with little or no php code)
- Fix eval() empty string argument core dump
- renamed 'install' to 'setup' to be more accurate and avoid name conflict
- Fixed Oracle compilation
- Fixed mSQL 1.0 compilation
- Fixed a problem in the mSQL, MySQL and PostgresSQL drivers and NULL fields.
- Fixed the GLOBAL statement to be able to declare an array.
October 29 1997 Version 3.0a1
- Start with excellent new parser from Andi and Zeev
-860
View File
@@ -1,860 +0,0 @@
PHP 3.0 CHANGE LOG ChangeLog
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
December 24 1998, Version 3.0.6
- Fix GetImageSize() to work with non-standard jpg images
- Add Mersenne Twister functions (mt_rand, mt_srand, etc)
- Add str_replace() function
- Add chunk_split() function
- Fixed a bug in the memory limit code, in cases where $php_errormsg was
also used.
- Add iptcparse() function
- Adobe FDF supported
- getallheaders() NULL string fix <michale@utko.fee.vutbr.cz>
- Add all configuration directives to phpinfo() page
- Functions pack() and unpack() rewritten to be binary and buffer overrun
safe and behave like the Perl functions for all implemented format codes.
- Ensured that msql_error() will not return error messages generated by
previously-run scripts.
- Add base_convert() function
- Make sprintf() and printf() output binary safe
- Made gzgetc binary safe
- Add convert_cyr_string() and quoted_printable_decode() functions
- Fix ldap_free_result() core dump bug
- Add support for current OpenLDAP-2.0-devel library
- Add php3_asp_tags directive so it can be set from Apache config files
- Added UTF-8 support in the XML extension
- Make rand(min,max) safer on older platforms where the low-order bits have
short cycles.
- Added new pdf (Portable Document Format) module
- Added an XML parsing extension using James Clark's "expat" library
- Optimized parts of the token cache code.
- Terminate on out-of-memory errors. Until now, PHP could crash in out of
memory situations (clean-up, no real effect).
- Unterminated comments in include files were being reported with the wrong line
number. Fixed.
- Added ImageCopy() and ImageColorDeallocate(). ImageCopy() is about
20% faster than ImageCopyResized(). ImageColorDeallocate() marks
palette entries free for reuse (by <mka@satama.com>).
- In the CGI version, it was impossible to access resources (e.g. SQL links,
images) from user-defined shutdown functions. Fixed.
- Added optional third parameter to strpos() to specify the offset to
start searching from.
- Fixed a crash bug in unset() when unsetting illegal variables (rare).
- Made ImageInterlace and ImageTransparentColor parameters optional, and made
them return the current/new settings.
- Optimized GetImageSize() <thies@digicol.de>.
- Made odbc_autocommit() without args return status
- Added connect workaround for OpenLink ODBC
- Added minimal InterBase support. Tested only on 4.0 & Linux.
- Fixed some memory leaks and bogus error messages in the URL handler of
the various file open functions. Should only affect error handling
in bad URLs.
October 5 1998 Version 3.0.5
- mysql_field_flags now reports all MySQL flags and the result is suitable
for automatic parsing. Compatibility warning: The result format has
changed. If you have scripts parsing the result of this function, you
may need to adapt them.
- Made nl2br() binary safe (not that it's of much use).
- Fixed a bug in the API function getThis(). It affected mostly the dir
functions, if nested within objects.
- Fixed a problem in require() in conjunction with switch(), and in some other
cases. Also fixed an identical problem with the call_user_function() API
function.
- Removed -lpthread when compiling with MySQL support. It caused various
serious problems when compiled into Apache.
- Add serialize() and unserialize() functions from jkl@njet.net
- Fix in_addr_t check for systems with in_addr_t in netinet/in.h
- Add atan2() function
September 22 1998 Version 3.0.4
- Added uksort() - array key sort using a user defined comparison function.
- Added 'j' support to date() - generates the day of the month, without
possible leading zeros.
- Added support for multiple crypt() encryptions if the system supports it
- Added optional support for ASP-style <% %> and <%= tags
- Fixed data loss problems with very large numeric array indices on 64-bit
platforms (e.g. DEC UNIX).
- 2 cursor_type parameters for ifx_query() and ifx_prepare changed
to 1 (bitmask). Added a few constants for use in Informix module.
- Added php3.ini option ifx.charasvarchar. If set, trailing blanks
are stripped from fixed-length char columns. (Makes life easier
for people using Informix SE.)
- Static SNMP module which compiles with ucd-snmp 3.5.2
- fixed imap_header & header_info from crashing when a header line
is > 1024 characters.
- Added patch for rfc822_parse_adr to return an array of objects instead
of a single object.
- Informix Online 7.x & SE 7.x support now fairly complete and stable
- Add dbase_get_record_with_names() function
- Added a special case for open_basedir. When open_basedir is set to "."
the directory in which the script is stored will be used as basedir.
- Include alloca.c in the distribution for platforms without alloca().
- Improved stripping of URL passwords from error messages - the length of the
username/password isn't obvious now, and all protocols are handled properly
(most importantly, http).
- Copying objects that had member functions with static variables produced
undetermined results. Fixed.
- Added function lstat() and cleaned up the status functions,
added tests for file status functions (this may break on some plattforms)
- Fixed is_link() - it was returning always false.
- Fixed apache_note() - it was corrupting memory.
- New Function. void get_meta_tags(string filename); Parses filename until
closing head tag and turns all meta tags into variables prefixed with 'meta_'.
The below meta tag would produce $meta_test="some string here"
<meta name="test" content="some string here">
- Generalized some internal functions in order to better support calling
user-level functions from C code. Fixes a few sporadic problems related
to constructors inside eval() and more.
- Fixed an endless loop in explode(), strstr() and strpos() in case of an
invalid empty delimiter.
- rand() now accepts two optional arguments, which denote the requested range
of the generated number. E.g., rand(3,7) would generate a random number
between 3 and 7.
- Added M_PI constant.
- Added deg2rad() and rad2deg() for converting radians<->degrees.
- ImageArc() misbehaved when given negative angles, fixed.
- Fixed a bug in ereg() that may have caused buglets under some circumstances.
- Added imap_status
- Shutdown functions, registered via register_shutdown_function(), could never
generate output in the Apache module version. Fixed.
- Brought IMAP docs into sync with acutal imap code
- imap_fetchstructure now takes in optional flags
- Fix potential core dumps in imap_append and imap_fetchtext_full
- Fix problem in SetCookie() function related to long cookies
- Add uasort() function to go along with usort (like sort() and asort())
- Add port number to Host header as per section 14.23 of the HTTP 1.1 RFC
- Fix imap_reopen to only take 2 arguments with an optional 3rd flags arg
- Add optional 2nd argument to imap_close
- Add CL_EXPUNGE flag to imap_open() flags
- Fix 4th arg on imap_append(). It was getting converted to a long by mistake.
- Fix shutdown warning in the LDAP module
- *COMPATIBILITY WARNING* imap_fetchstructure() "parametres" object and property
name changed to "parameters" to match the documentation and to be consistent
with the rest of the API.
- Delete uploaded temporary files automatically at the end of a request
- Add upload_max_filesize and correponsing php3_upload_max_filesize directive
to control the maximum size of an uploaded file. Setting this to 0 would
completely eliminate file uploads.
- Force $PHP_SELF to PATH_INFO value when running in CGI FORCE_CGI_REDIRECT mode
- Add apache_lookup_uri() function which does an internal sub-request lookup
and returns an object containing the request_rec fields for the URI. (Yes,
you have to be a bit of a gearhead to figure this one out)
- Fix a few signed char problems causing functions like ucfirst() not to work
correctly with non-English charsets
- md5() function not binary safe - fixed
August 15 1998 Version 3.0.3
- Changed the name of fopen_basedir to open_basedir, to be a little more
accurate about what it does.
- Added Hyperwave module
- Added config-option (php3_)enable_dl <on/off>. This enables/disables the
dl() function. In safe-mode dl() is always disabled.
- Auto-prepended files were crashing under some circumstances - fixed.
- Win32 mail fixes provided by walton@nordicdms.com
- Comparing between arrays and/or objects now generates a warning (it always
returns false, as it used to; no comparison is made)
- Fixed a bug in the syntax highlighting code, that made ending-double-quotes
appear twice under certain circumstances.
- Fix bug in filetype() function related to symlinks
- Started integrating Informix SE support to PHP configure/makefile setup.
- gdttf roundoff fixes from ellson@lucent.com
- Added initial Informix SE support files from Danny Heijl - This code still
needs to be integrated into the PHP configure/makefile setup and the code
itself needs more work.
- return in the global scope now terminates the execution of the current file.
- Added the ability to register shutdown function(s), via
register_shutdown_function($function_name).
- Clean up const warnings
- Add write support to ftp fopen wrappers
- Add strspn() and strcspn() functions
- On systems without strerror use Apache version if compiling as Apache module
- The PHP start tag was being ignored under some circumstances - fixed.
- The db, dbase and filepro functions are now Safe-Mode aware.
- Added config-option (php3_)fopen_basedir <path>. This limits the directory-
tree scripts can open files in to <path>.
- Fixed pg_loreadall that didn't always return all the contents in a PostgreSQL
large object. Also, doesn't pass through anything if method is HEAD.
- configure fix to create target Apache module dir
- Fix core dump in imageTTFtext() function
- Added static IMAP support
- Syntax highlighting was generating additional whitespace - fixed.
- Added ucwords. Works like ucfirst, but works on all words within a string.
- Added array_walk() - apply user function to every element of an array
- Added usort() - array sort that accepts a user defined comparison function!
- Added the ability to call user-level functions and object methods on demand
from the C source using a completely generalized, slick API function.
Miracles do happen every once in a while.
- Added constructors. Don't even squeek about destructors! :) (we mean that)
- Make pg_lowrite() binary safe
- Fixed mod_charset option in ./setup
- Fixed rewinddir() and dir()::rewind() under Win32 (they didn't work before).
- Add Win32 COM support! By-name referencing is supported using the IDispatch
interface (automation). Available functions - COM_Load(), COM_Invoke(),
COM_PropGet() and COM_PropSet().
July 20 1998 Version 3.0.2a
- Fix a quirk in the configuration file parser, the endless fountain of joy
and fun.
- Fix a bug in the API function add_method() that made dir() crash.
July 18 1998 Version 3.0.2
- Compile cleanups for *BSD
- Add support for the OpenLink ODBC Drivers
- Add PHP_SELF, PHP_AUTH_* and HTTP_*_VARS PHP variables to phpinfo() output
- Add workaround for broken makes
- Add Apache 1.3.1 support (some Apache header files were moved around)
- Added apache_note() function.
- Fix order of system libraries and detect libresolv correctly
- Fixed a bug in the Sybase-DB module. Several numeric field types were
getting truncated when having large values.
- Added testpages for unified odbc
- Fix php -s seg fault when filename was missing
- Made getdate() without args default to current time
- Added ImageColorResolve() and some fixes to the freetype support.
- Added strcasecmp()
- Added error_prepend_string and error_append_string .ini and .conf directives
to make it possible to configure the look of error messages displayed by PHP
to some extent
- Added E_ERROR, E_WARNING, E_NOTICE, E_PARSE and E_ALL constants, that can be
used in conjunction with error_reporting()
(e.g. error_reporting(E_ERROR|E_WARNING|E_NOTICE);
- Fixed a crash problem with classes that contained function(s) with default
values.
- Fixed a problem in the browscap module. Browscap files weren't being read
properly.
- Fix -L path in libphp4.module to make ApacheSSL compile without errors
- Fix StripSlashes so it correctly decodes a \0 to a NUL
July 04 1998 Version 3.0.1
- echo/print of empty strings don't trigger sending the header anymore.
- Implemented shift left and shift right operators (<< and >>)
- Compile fix for cc on HP-UX.
- Look for beta-version Solid libraries as well.
- Make GD module show more info in phpinfo().
- Compile fix for NextStep 3.0.
- Fix for Oracle extension on OSF/1.
- Fix gd 1.3 bug in ImageColorAt().
- pg_loread() hopefully handles binary data now.
- Turned off some warnings in dns.c
- Added ImageTTFBBox() and made ImageTTFText() return bounding box.
- Added constants for Ora_Bind()'s modes.
- Renamed all hash_*() routines to _php3_hash_*() to avoid clashes with other
libraries.
- Changed uodbc default LONG behaviour: longreadlen 4096 bytes, binmode 1.
The module now actually uses the php.ini settings.
- New PostgreSQL functions: pg_fetch_row(), pg_fetch_array()
and pg_fetch_object()
- Fix a segmentation fault when calling invalid functions in certain
circumstances
- Fix bug that caused link-related functions to not pay attention to
run-time safe mode setting (it was using whatever was set at compile time).
- Fix bug in exec() function when used in safe mode
June 6 1998 Version 3.0
- Add checkdnsrr function (check availability DNS records)
- Add getmxrr function (get MX hostnames and weights)
- Fixed bug in nl2br() function
- Fix for an RC5 related problem in the Sybase module, when dealing
with very long data types.
- Speed up string concatenation by roughly a factor of 2
- Add escape-handling to date function
- Make base64 functions binary safe
- Add strrpos function to complement strpos function added in RC5
- Add ltrim function (strips only at the start of string)
- Add rtrim as an alias to chop() for completeness sake
- Add trim function (similar to chop, except it strips at the start as well)
- Added 2 optional args to fsockopen function - errno and errstr
- Fixed bug in split() function related to leading matches
- Fixed problem in error_log() function (thanks to Jan Legenhausen)
- empty("0") was returning true - fixed
- Removed the old sybsql module. Use the new sybase_*() functions instead.
- Several fixes to the configuration file parser
- LDAP fixes - fixed return values on several functions
May 23 1998 Version 3.0RC5
- The BC math library functions now compile in by default.
- Fixed a bug in virtual() and other types of SSI's (e.g. <!--#exec). Under
certain circumstances, this used to result in random problems.
- Fixed a bug in virtual(). It was misbehaving if it was called before any
other output.
- Added mysql.default_port, mysql.default_host, mysql.default_user and
mysql.default_password ini-file directives.
- Improved handling of the MySQL default port. It now honors /etc/services
and $MYSQL_TCP_PORT.
- Fixed a crash in opening of broken ftp:// URLs, and improved error reporting
in opening of URLs.
- Fixed several non-critical scanner issues with syntax highlighting mode and
the <script language=php> tag.
- Fixed fseek on windows. (windows only): fseek will not return proper results
on files opened as text mode. PHP uses binary mode as the default for file
operations, but this can be overiden by fopen. Do not open files in text
mode and use fseek on them!
- Add strpos() function
- Added zlib module, requires zlib >= 1.0.9
- Improved the module API implementation. Dynamic modules may now register
persistent resources (not that it makes much sense, but at least PHP
won't crash). The API itself remains unchanged.
- bcmod() wasn't always behaving like modulus should behave (it was behaving
exactly like GNU bc's % operator). Fixed.
- Changed the Sybase-DB module to always return strings, instead of auto-typing
result sets. This was done for consistency with the other database modules,
and in order to avoid overflows due to the platform-dependant limitations
of the numeric data types of PHP. You can turn compatability mode on using
the sybase.compatability_mode directive in the php3.ini file.
- Fixed problems with the TINYINT field in the Sybase-CT module.
- Applied some small speed optimizations to the Sybase-DB module querying code.
- Added 'numeric' and 'type' properties to the object returned by
sybase_fetch_field().
- The 'new' operator doesn't accept all expressions anymore. Instead, it
accepts a class name, or a variable reference (scalar, array element, etc).
- Add ora_numcols() function
- Add ora_do() and ora_fetch_into() functions to Oracle driver
- Add persistent connection support to Oracle driver
- Make Oracle driver clean up open connections and open cursors automatically
- Added fread() and fwrite() that properly handle binary data.
- Add Ora_ColumnSize() to Oracle code
- The string "0" means FALSE again. This was done in order to maintain type
conversion consistency.
- Added solid_fetch_prev() for fetching the previous result row from Solid.
- Huge integers are now automatically converted to floating point numbers
(that have a wider range).
- Floating point numbers are now displayed using scientific notation when
they're extremely big or extremely small. The 'precision' php3.ini directive
no longer designates the number of decimal digits, but rather, the maximum
number of significant digits required.
- Added support for scientific notation for floating point numbers (e.g. 1E7)
throughout the entire language.
- Fixed a potential/probable memory corruption problem with HEAD request
handling.
- Using un-encapsulated strings now generates a NOTICE-level warning
(e.g. $a = foo; instead of $a = "foo";)
- Added defined("name") function to check if a certain constant is defined
or not.
- Support new Apache mechanism for setting SERVER_SUBVERSION
- Added PHP_OS and PHP_VERSION constants
- Added the ability to define constants in runtime! Constants are script-wide,
(there's no scope, once the constant is defined, it's valid everywhere).
Syntax is define("name", $value [, $case_insensitive]). 'name' can be any name
that is a valid variable name, *without* the $ prefix. 'value' can be
any *scalar* value. If the optional 'case_insensitive' parameter is 1,
then the constant is created case-insensitive (the default is case
sensitive). Note: define() is currently *NOT* supported in preprocessed
scripts.
- Added general support for constants. The Syslog constants (e.g.
LOG_ERR, LOG_CRIT, etc.) should be accessed as constants from now on (that
is, without a $ prefix). You can still set define_syslog_variables to On
in the php3.ini file if you want to define the various $ variables. The
default for this directive in the php3.ini-dist file has been changed to
Off.
- The configuration file path variable now expands . and .. into their
respective directories. You can obtain the path of the php3.ini file
that was used by printing get_cfg_var("cfg_file_path").
- Fixed a crash-recovery parser crash ($a=7; $a[3]+=5;)
- Add gmmktime() function
- Fixed a crash with implode() and empty arrays.
- Fixed a bug that, under fairly rare circumstances, caused PHP not to
recognize if(), require() and other statements as statements, and
to complain about them as being unsupported functions.
- Beautified php3.ini-dist and added more comments to it. Also changed
the behavior of the configuration file parser to be brighter about
the various constants (TRUE/FALSE/ON/OFF etc).
- Fixed a bug in openlog() - the specified device name was being mangled.
- Memory leaks were sometimes reported erroneously - fixed.
- Improved the convertor to handle some quirks of the PHP/FI 2 parser with
comments.
- Fixed number_format() to properly handle negative numbers, and optimized it
a bit.
- Fixed static variables inside class member functions. Note that using such
static variables inside member functions usually defeats the purpose of
objects, so it is not recommended.
- Fixed a bug in fpassthru() (the file was being closed twice).
- Added strftime().
- Add set_socket_blocking() function to control blocking on socket fd's
- The sendmail_path in php3.ini was being ignored - fixed.
- Fixed a bug with file upload, with files that contained the MIME boundary
inside them.
- Fixed a bug with form variables of type array, with spaces in their
index (e.g. name="foo[bar bar]").
- gd-1.3 autodetect and support
- Year 2000 compliance is now togglable from the php3.ini file. Setting PHP
to be y2k compliant effects the way it creates cookies, and means it'll
NOT work with many browsers out there that are not y2k compliant! For
that reason, the default for this option is off.
- safe mode / fix from monti@vesatec.com
- Integrated the FreeType support in the GD extension.
- Added --with-gd=DIR and --without-gd options to configure
April 18 1998 Version 3.0 Release Candidate 4
- Auto-prepended and auto-appended files were reporting the wrong filename
in errors and in __FILE__ - fixed.
- Fix GPC problem related to mixed scalar and array vars with the same name
- Made putenv() Apache-safe. Environment variables may no longer leak in
between requests.
- The trailing semicolon is no longer required in class declarations.
- Fixed a memory leak in the (array) and (object) operators under certain
conditions.
- <script> tags weren't working unless short tags were enabled - Fixed.
- Fixed a bug in certain array indices that weren't treated as numbers
even though they looked like numbers (e.g. "10", "20").
- Changes to support renamed API functions in Apache-1.3
- Fixed the -p and -e command line switches
- Fix a segfault when calling command line version without parameters
- Fix for feof() when used on a socket
- Fix off-by-one error in fgets() when used on a socket
- Fix bug in ImageSetPixel() (Thanks to ecain@Phosphor.net)
March 31 1998 Version 3.0 Release Candidate 3
- Tiny bugfix for magic_quotes_sybase
- Fix Apache build problems introduced in RC2
- $a["0"]==$a[0] fix
- Apache-1.3 build changes to support 100% automatic builds and shared library
module builds. See INSTALL file.
March 30 1998 Version 3.0 Release Candidate 2
- Changed the socket implementation under UNIX to not use FILE pointers, in
order to work around the buggy Solaris libc (and possibly buggy libc's
in other platforms).
- Fixed a bug in min() and max() with certain arrays.
- *WARNING* Move Apache 1.3 php3 file install to src/modules/php4 instead of
src/modules/extra. Make sure you change your AddModule line correctly
in your Apache Configuration file. This change is to take advantage of
new Apache-1.3 configuration mechanism which makes it easier to build an
Apache server with PHP automatically enabled. It will also help building
a shared library module version of PHP soon.
- Fixed a crash bug with auto-appended files.
- Made --enable-discard-path work on all Unix servers #!/path/php CGI scripts
should now work everywhere. I have tested on Apache, WN and Netscape 2.0
- Made $a["123"] and $a[123] be identical. $a["0123"] is still different,
though.
- Added 'precision' ini directive, to set the number of decimal digits
displayed for floating point numbers (default - 6).
- Made integer/integer divisions evaluate to floating point numbers when
applicable (e.g., 5/2==2.5(float), but 4/2==2(int))
- Get rid of reliance on tied streams and move all socket reads and writes
to recv/send calls
- Cleaned up head.c a bit and fixed CGI SetCookie order problem
- Changed default variable parsing order to Get-Cookie-Post (GPC)
- Fixed setup so it has all configure options and defaults.
- Added optional decimal point and thousands seperator to number_format()
e.g., number_format(1500,2,',','.') == 1.500,00
- Fixed cgi bug in windows that prevented files from being parsed on many
systems and servers.
March 23 1998 Version 3.0 Release Candidate
- Added support for the Raima database (ALPHA)
- Fixed a bug in persistent PostgreSQL links and the connection-string method.
- Added EXTENSION_STATUS file, that specifies the stability and status of
every module in the distribution.
- Added optional parameters to user functions with default values, variables
that are forced to be passed by reference and variables that can be
optionally passed by reference. The ini file directive
'ignore_missing_userfunc_args' is no longer supported.
- Added fhttpd support (by Alex Belits)
- Improved performance by approximately 20-30%.
- Added mysql_error(), mysql_errno() (if available) and msql_error().
Errors coming back from the database backend no longer issue warnings.
Instead, use these functions to retreive the error.
- Patched count(), each(), prev(), next(), reset() and end() to work around
the implementation side effects of unset(). As far as the users are
concerned, this should be transparent now (even though it's slower now,
until it's thoroughly fixed in 3.1).
- Added number_format(). number_format(2499,2)=='2,499.00'.
- error_reporting() now sets the error reporting level to the supplied
argument, without any interpretations.
- Fixed a lookahead parser bug that occured under rare circumstances.
- Change the comparison operators to compare numeric strings as numbers. If
you want to compare them as strings, you can use the new C-like strcmp()
- Fixed Ora_GetColumn() bug when fetching strings
- Added Ora_ColumnName() and Ora_ColumnType()
- Preliminary LONG and LONG RAW support in Oracle extension
- Add \123 and \xAB style octal and hex escapes to "" and `` strings
- Add "-c" command line flag for specifying path to php3.ini file
- Improved list() so that elements can be skipped, for example:
list($name,,,$realname) = explode(":",fgets($passwd_file));
- Fixed a tiny bug in the hash initialization which caused excessive use of
memory. Report and fix by short@k332.feld.cvut.cz
- Fixed strtolower() and strtoupper() to work with 8-bit chars
- Fixed to compile and run on SunOS 4.1
- Fixed a crash in soundex() of an empty string
- Fixed parse_str() - it wasn't always defining the right variables,
and didn't work with arrays.
- Made [m,My]SQL create/drop database functions return success status
- Fixed some memory leak/crash problems in the Adabas module
- Added each() in order to allow for easy and correct array traversing.
- Make Apache module version respect LOCALE setting
- Add support for Apache 1.3b6+ ap_config.h file
- Fixed a nasty corruption bug in eval() and show_source() that resulted in
script termination (e.g. eval("exit();").
- Fixed a syntax highlighting problem with keywords used as variable
names.
- Fixed a possible crash and/or file descriptor leak
- Fixed line number being off by one in #! shell style execution
- Made it possible to disable auto_prepend/append with "none" filename
- Allow safe CGI calling through #!php style scripts
March 2 1998 Version 3.0b6
- Made [s]printf handle %ld
- Changed CGI version to only open regular files as input script
- Added ignore_missing_userfunc_args directive to suppress warnings messages
about missing arguments to user-defined functions
- Added Postgres function - pg_cmdtuples(), by Vladimir Litovka
- Disabled command line options if used as CGI
- Changed CGI version to use PATH_TRANSLATED as the script file name
- Link with solid shared library instead of static one
- Fixed a crash with functions that aren't being called correctly
- Fixed file descriptor leak in auto-prepend/append
- Imap module is usable. See README in dl/imap.
February 24 1998 Version 3.0b5
- Made the URL aware file functions be enabled by default
- Fixed an unlikely crash bug in the parser, with uninitialized array elements
which are refered to as objects.
- Fixed several fields that were being incorrectly read in Sybase CT.
- Fix Apache-1.3 related SIGHUP problem which was preventing php3.ini from
getting re-read on a SIGHUP
- *** WARNING *** Downwards incompatible change: The plus operator (+) is not
longer overloaded as concatenation for strings. Instead, it converts its
arguments to numbers and performs numeric addition.
- Add Stig and Tin's bdf2gdfont script to extra/gd directory
- Added join() as an alias to implode()
- Made implode() accept arguments in the order used by explode() as well
- Made $php_errormsg local in function calls
- Fixed Apache configuration directive bugs
- Added a number of .ini directives to Apache .conf directive list
- Fixed a 'memory leak' with strtok()
- echo/print now handle binary data correctly.
- NEW now accepts any expression for the class name argument.
- Add ImageDashedLine() GD function
- Add arg_separator .ini directive so the '&' GET method separator can be
changed to ';' for example. Corresponding php3_arg_separator Apache .conf
directive works as well.
- Walked around an implementation side effect of switch(). <? switch(expr) { ?>
now works.
- Added memory caching, resulting in a significant performance boost
- Added support for for(): .. endfor; loops
- Added a new predicate - empty($var). Returns true if $var is not set,
or is FALSE. Returns false otherwise.
- Added is_integer() (same as is_long()) and is_real() (same as is_double()).
- Added sizeof() as an alias to the count() function
- Added --enable-force-cgi-redirect, to prevent the CGI from working if
someone directly accesses PHP not through Apache's CGI redirect
(off by default).
- Fixed marking of deleted dBase records. Noticed by Simon Gornall
<simon@oyster.co.uk>.
- Fixed fixed "%%" bug in [s]printf
- Fixed a UMR (initialized memory read) in the Oracle code
- Potential fix for mysql-related SIGPIPE problem which caused httpd to spin
- Made PHP responsive to the Apache link status (stop executing if the link
dies).
- Fixed a crash bug with StrongHold and secure pages
- Fixed StrongHold installation
- Optimized the function call sequence a bit.
- Fixed Sybase/CT date/datetime/money fields work to correctly.
- Fixed Apache module startup problems - php3_module_startup should only be
called once.
- Fixed ord() with characters >127
- Fixed bug in file_exists() function
- Fixed stripslashes() to remove the escaping quote (instead of backslash)
in case magic_quotes_sybase is true.
- Also make echo and print automatically remove trailing decimal zeros.
- Added htmlentities(), currently handling only ISO-8859-1 entities
- "0" is no longer considered false, the only string which is false is the
empty string "".
- Added 'true' and 'false' keywords
- Added 'xor' (logical exclusive or)
- Automatic conversion from double to string removes decimal trailing zeros.
- Added arsort() and rsort() to sort in descending order.
- Turned on "XLATOPT_NOCNV" by default for uODBC/Solid.
- Added support for a port number in the mysql_(p)connect() functions
- Fixed a file descriptor leak in the configuration parser.
- Fixed a few buglets with syntax highlighting with certain language keywords
- Added functions to control minimum severity level of Sybase messages to
display.
- Added highlight_string() - behaves like highlight_file(), only instead
of highlighting a file, it syntax highlights the contents of its
argument.
- Renamed show_source() to highlight_file(). show_source() is still
supported for downwards compatability.
- Fixed a bug in class inheritence - member functions with upper case
letters in their names couldn't be redefined.
- Made chown(), chgrp() and chmod() return TRUE/FALSE instead of 0/-1.
February 02 1998 Version 3.0b4
- Fixed a segfault bug in one of the unified ODBC error messages.
- Set default file modes to binary on Win32 (solved a lot of bs)
- Fixed file copy on Win32
- MIME file uploads fixed on Win32
- Added contributed icons by Colin Viebrock (undex extra/icons)
- Fixed the debugger enough to call it "beta code".
- Fixed some leaks in the Oracle module, tidied up the code a bit.
- Added __FILE__ and __LINE__ which evaluate to the currently parsed file
and currently parsed line respectively.
- Added ImageColorAt(), ImageColorSet(), ImageColorsForIndex(), and
ImageColorsTotal() to allow manipulating the palette of GIF images.
- Rename '--enable-url-includes' option to '--enable-url-fopen-wrapper' to
better describe what it does, and pay attention to the setting.
- Added optional parameter to the file(), readfile() and fopen() functions
to look for files located in the include path.
- Fixed bug that allowed the file() and readfile() to open files in the
include path inadvertantly.
- Fixed a (documented) bug in printf()/sprintf() with hard limited strings
and alignment (e.g. %-.20s).
- Optimized several quoted string routines.
- Added error_log ini directive to select where errors get logged when
log_errors is turned on or the error_log() function is used.
- Added the ability to direct errors to log files instead of or in addition
to the script output. Use the new display_errors and log_errors
php3.ini directives.
- Made environment variables uneraseable by POST/GET/Cookie variables.
- Fixed a bug in the elseif() construct. The expression was being evaluated
even if a previous if/elseif already evaluated to true and got executed.
- Fixed a bug in the exit code parameter of system()
- Tighten up all exec() related functions in safe mode
- Added error_log() function to log messages to the server error log, or
stderr for the CGI version.
- Added support for a general memory limit of scripts.
- Fixed a segfault bug that occured under certain circumstances with shell
escapes ($foo = `...`)
- Made keywords be valid property names of objects.
- Fixed a segfault bug when creating new objects of an unknown class.
- Fixed a problem with the maximum execution time limit, that may have
prevented this feature from working on certain platforms.
- PHP would now warn you with E_NOTICE about unknown escape characters,
e.g. "\f". It would still be considered as a backslash followed by f,
but the proper way of writing this is "\\f" or '\f'.
- Added support for ${...} inside encapsulated strings. Supported: ${foo},
${foo[bar]}, ${foo[0]}, ${$foo[$bar]}, ${$foo->bar} and ${$foo}
- Fixed a bug in automatic persistent link reconnect of the Sybase/DB module.
Thanks to Steve Willer for finding that 'stealth' bug!
- Fixed a crash bug in the GET/POST/Cookie parser in case of regular
and array variables with the same name.
- Added round() function.
- Can't use encapsed strings as variable names anymore, ie. $"blah blah".
- Fixed bug in gethostby*() functions that resulted in a core dump.
(Noticed by torben@coastnet.com.)
- Fixed bug in dbase_get_record that prevented number and date fields
from being properly decoded. (Thanks again to colins@infofind.com.)
- Make dbase_get_record include a 'deleted' field that indicates whether
that record had been marked for deletion.
- Fixed bug in dbase library that stomped on the deleted flag of the first
record in the file if it was set. (Thanks to colins@infofind.com.)
- Fixed putenv() to not report a memory leak and possibly prevent a bug
from that memory being freed.
- Added setlocale()
- Added pg_fieldisnull() (by Stephan Duehr)
- Changed pg_exec() to always return a result identifier on succees
- Solid linking fixes (tries to find the right library)
- Fixed a but with date() and the 'w' element.
- Tried to eliminate unimportant memory leak notifications.
- Made min() and max() backwards compatible and able to handle doubles.
- Add fgetc() function
- Fixed bug in getmyuid(), getmyinode() and getlastmod(). Thanks to
khim@sch57.msk.ru for pointing this out.
- Fixed http:// URL includes with no path specified send request for /.
- Added GetAllHeaders() (Apache-only)
- Added workaround that made the Image text functions 8-bit clean
- Made snmp internally compilable for Win32 (not the unix one though),
only adds 2k to binary size, so no reason not to have it there.
- Fixed ldap loading on Win32
- Fixed MySQL Info function on Win32 platform
- Fixed compilation of syntax highlighting mode
January 17 1998 Version 3.0b3
- Added mysql support under windows ;) happy happy joy joy
- Fixed dbase.dll for Win32 to actualy load now.
- Enhanced the convertor to recognize ?> as a php-close-block as well.
- Fixed potential SetCookie() core dumps
- Changed print to be an expression instead of a statement. That means you can
now do stuff like foobar() or print("Unable to foobar!"). echo has NOT been
changed.
- Removed the flex optimization flags to reduce the size of the scanner
- Added memory leak logging into apache log files (apache module only)
- Fixed a nasty bug in one of the internal stacks. This may have caused
random crashes in several occassions.
- Fixed bug in ImageGif() making it hang sometimes
- Added ImageLoadFont(), ImageFontWidth() and ImageFontHeight()
- error_reporting() now returns the old error reporting level
- Fixed url includes/opens not working under Win32
- Fixed errorneous handling of multipart/form-data input
- Added rawurlencode(), rawurldecode() and changed urlencode() and urldecode()
a bit too.
- Fixed a bug in [s]printf, sign was forgotten for doubles.
- Fixed a segfault bug in pg_fieldprtlen(), and made it accept field names
in addition to field offsets.
- Made the setup script a little more user-friendly.
- Added is_long(), is_double(), is_string(), is_array() and is_object()
- Fixed a bug in freeing of mSQL results.
- Improved pg_exec() to properly return true or false with queries that don't
return rows (i.e. insert, update, create, etc)
- Added get_cfg_var() to enable checking cfg file directives from within
a script.
- Fixed a bug with urlencode() and characters 0x80-0xff
- Changed the behaviour of ereg_replace to more intuitive. The
backslashes other than valid existing back references in the second
argument are no more evaluated as escape sequences.
- Fixed a bug in the configuration file loader and safe mode.
- Fixed a bug with configuration variables taken from the environment.
- Added <script language=php> </script> as PHP open/close tags, to allow
the use of editors such as Microsoft Frontpage.
- Fixed a bug in the default php3.ini directory - it wasn't defaulting to
/usr/local/lib properly.
- Added support for \r\n line endings
- Fixed a bug that may have prevented POST method variables from working
with certain scripts when using the CGI version.
- Convertor: Added support for single-quoted strings
- Fixed segfault bug in the Adabas module, with queries that don't return
rows (update, insert, etc).
December 22 1997 Version 3.0b2
- Changed variable type conversions that do not specify base to always use
base 10. "010" is no more 8, it is 10. Use intval ($x, 0) to get C-style
octal and hex numbers recognized.
- Fixed a possible segfault bug in several functions, when using the concat
operator and possibly other operators/functions.
- # is no longer accepted as a comment in php3.ini. Use ; instead.
- Added browscap support
- Configuration file directives are now case-sensitive
- Fixed msql_tablename() and msql_dbname()
- Added a PHP/FI 2.0 -> PHP 3.0 convertor
- Added support for shell/perl-style single quotes
- Added support for execution of external programs using backquotes ($a=`ls -l`)
- fixed mail() on windows, also fixed memory leaks in mail on windows
- added sendmail_from to handle return route on windows
- Changed the way the config file is searched. The file name is now
php3.ini (hardcoded), and it'll be looked for in: local directory, $PHPRC
and builtin path designated by ./configure under UNIX or Windows directory
under Windows.
- Fixed ereg_replace replacing empty matches and a one off buffer overflow
- Fixed File upload on windows platform
- Fixed a bug that caused 'HTTP/1.1 100 Continue' messages with
Internet Explorer 4.0 and certain scripts that receive POST variables
- Get/POST/Cookie data variables are from now *ALWAYS* strings. If you want
to use them in integer/real context, you must explicitly change their types.
This was done in order to avoid possible loss of data when doing these
conversions automatically.
- Variables named as keywords are now allowed (e.g. $function, $class, etc)
- Fixed a problem with msql() and mysql() with NULL fields
- Fixed a segfault bug with class declarations
- Fixed bugs with FOR loops and include() from within eval()
- Changed include() to be executed conditionally. PHP-3.0 efficient
unconditional include is now require()
December 08 1997 Version 3.0b1
- Switched to public beta test phase
- Generalized unset() and isset() to work on any type of variables, including
specific array indices or object properties (e.g., unset($a[4]) now works).
- Added support for object references inside encapsulated strings
(for example, 'echo "Username: $user->name"' now works)
- Added arbitary precision math support (basic operations with
unlimited range numbers, and support for unlimited decimal digits)
- Apache module can now handle preprocessed scripts (by using:
AddType application/x-httpd-php3-preprocessed .php3p
in the Apache configuration)
- Made settype() pass its first parameter by value. Improved it to be able
to convert to arrays and objects (originally by Steve Willer)
- Implemented CPU time limit on scripts when setitimer() is available
- Computed field names in the Sybase/CT and Sybase/DB modules are now named
computed, computed1, computed2, ...
- Added Sybase/CT client/server message handlers and updated the Sybase/DB ones
- Made the regexp function automatically take arguments by reference
when necessary
- Added builtin support for auto append and prepend in the parser level
- Improved the Sybase/CT sybase_query(). Should be more stable now, and
hopefully work with a wider range of queries. It's difficult to work
without docs, though, so it may still not be 100% right...
- Changed error messages to show error type, file and line with bold
- Added support for autoprepend and autoprepend
- Added some more warning flags if gcc is used
December 03 1997 Version 3.0a4
- Improved the internal functions API - no need to explicitly pass
parameters by reference to internal functions that specifically
require them, e.g. sort(), ksort(), reset(), count(), etc.
This is *STILL* downwards compatible with the previous alphas,
in the sense that you can explicitly pass the arguments by reference
if you want to.
- use srandom/random instead of srand/rand if available
- Added [m,My]sql_listfields() for downwards compatability
- -p now replaces .php3 extension with .php3p (otherwise it adds .php3p)
- Added C++ style comments (// comment)
- Fixed # commenting to terminate at a close PHP tag
- Added \0 back reference for full string match to *reg*_replace and
added backslash escaping to replace string
- Fixed a few bugs in the Sybase DB-library module.
- Added Sybase CT-library support. It should be considered experimental.
Syntax is identical to the one of the DB-library. Allows people to
connect to MS-SQL servers from Linux without having to pay for a
library!
- Beautified phpinfo()
- Add ImageColorClosest() and ImageColorExact() GD functions
- Make all .ini directives work as Apache .conf directives as well
- Added PHP2-like File() function with PHP3 URL support
- Upgraded the Sybase interface. It's practically MySQL compatible now!
Among other things, added sybase_fetch_array() and sybase_fetch_object().
- Fixed problem in multi dimensional array handling and self modifying
operators (+=, -=, etc).
- Safe Mode file open implementation
- SVR3 portability problem fix
November 23 1997 Version 3.0a3
- Made the global statement behave like PHP 2 with undefined variables
- Added msql_fetch_object() and msql_fetch_array()
- Switched between the 1st and 2nd parameters to explode(), so that it acts
like split()
- Fixed passthru(), exec() and system() functions
- Implemented second optional parameter to intval() to specify conversion base
(The default is to assume you want to do a base 10 conversion.)
- Implemented SQL safe mode for MySQL
- Read UploadTmpDir from php3.ini instead of apache conf files
- Added mysql_fetch_object() and mysql_fetch_array()
- Changed function->old_function. function is now an alias to cfunction.
- Split the magic_quotes directive to get/post/data and other
- Added generic copy() function
- Added a $GLOBALS[] array, which contains all global variables
- Fix broken getimagesize() function
- Made mysql_fetch_field() and msql_fetch_field() optionally accept a 2nd argument
- Fixed mysql_data_seek() and msql_data_seek()
- Changed list assignment to list(...) and array init to array(...)
- Made <?php_track_vars?> work
- cgi when not in debug mode uses regular malloc(), free() functions now
- Added preliminary support for perl-style list assignments
- Fixed a bug in mysql_result() and msql_result() when specifying table
- renamed internal error-handling function and levels
- Added basename and dirname functions similar to sh counterparts
- Added base64_encode() and base64_decode()
- Support Basic authorization for http url includes
- Added parse_url() function to extract url components
- Made it possible to use anonymous ftp on URL includes
- Fixed url includes to handle different URLs better
- Fixed mysql_field*() functions
- Made mysql_connect() smarter, after a mysql_close() (applies to msql and pgsql too)
November 6 1997 Version 3.0a2
- Fixed a segfault bug caused by non-persistent connect in [m,My,Postgres]SQL modules
- Fix command line argument handling
- Made empty array list assignments work ($a=({});)
- Made '$' escaping optional when a variable name parsing isn't possible
- Added support for mysql_[p]connect(host) and mysql_[p]connect(host,user)
- New layout in phpinfo()
- Update Oracle extension to use php3_list functions
- Add includepath support
- Add #!php shell script escape support
- Change name of CGI/command line version from php3.cgi to php
- Add SNMP extension
- show_source() support
- Parsing of command-line args for CGI version
- Support for backreferences in ereg_replace
- Support for hexadecimal numbers directly at the scanner level
- Support octal numbers directly at the scanner level
- Fixed problem with huge html files (with little or no php code)
- Fix eval() empty string argument core dump
- renamed 'install' to 'setup' to be more accurate and avoid name conflict
- Fixed Oracle compilation
- Fixed mSQL 1.0 compilation
- Fixed a problem in the mSQL, MySQL and PostgresSQL drivers and NULL fields.
- Fixed the GLOBAL statement to be able to declare an array.
October 29 1997 Version 3.0a1
- Start with excellent new parser from Andi and Zeev
+4
View File
@@ -15,6 +15,10 @@ over to PHP4.
- PUT method support (mlemos@acm.org)
- Fix parameter count problem in odbc_setoption()
- Really fix implode() this time. The fix in 3.0.7 was bogus
- Added more option to the date() function: (Colin Viebrock)
'g' - hour, 12-hour format, no leading zeros
'G' - hour, 24-hour format, no leading zeros
'n' - month, numeric, no leading zeros
- Make fgetss() slightly smarter
- Add strip_tags() which uses the fgetss state-machine but acts on a string
+54
View File
@@ -0,0 +1,54 @@
The core of PHP 3.0 is considered to be stable at this time. However, some of
the modules that are bundled with it are still undergoing development, or
contain known bugs. The purpose of this file is to document the status of
each module (extension). Patches to unstable modules will be available through
the CVS, and through periodic maintenance releases.
Stability scale:
Rock solid - We believe it's safe to base a production site on it.
Stable - It should be safe to base a production site on it.
Isn't rated as rock-solid because it contained problems
in the not-so-far past, or doesn't have enough users
to test it to know it's rock solid.
Beta - This module probably contains bugs, sometimes even known
bugs. You can give it a try and there's a good chance
it'll work fine, but it might not be a good idea to base
a production site on it.
Alpha - This module is in initial development steps. Don't trust
it, play with it at your own risk.
Deprecated - This module is only available for downwards compatability,
and will not be supported in any way. The code quality
is usually around the Beta status.
The standard disclaimers apply, that is, if a rock-solid module blows up on
you and ruins your site, nobody in the PHP development team is responsible.
We'll probably try to help, though.
Extension Name Status Comments
-----------------------------------------------------------------------------
DBM Rock Solid That relies on a working DBM library.
The flatfile support is probably not
as stable.
MySQL Rock Solid
mSQL Rock Solid
Sybase DB Stable
Sybase CT Stable
BC Math Rock Solid Arbitary precision math library
Postgres SQL Stable Postgres 6.2 and earlier is stable,
but problems were reported with 6.3
Debugger Beta
Unified ODBC Beta
Solid Deprecated Replaced by Unified ODBC
iODBC Deprecated Replaced by Unified ODBC
Adabas Deprecated Replaced by Unified ODBC
LDAP Stable Lightweight Directory Access Protocol.
dBase
FilePro
Oracle Beta Not tested thoroughly enough.
IMAP Beta Bundled in the dl/ directory
SNMP Stable Very solid, but also very limited.
Only supports GET and WALK requests.
Raima Velocis Beta If use with Unified ODBC, replaced
by Unified ODBC
Raima Velocis Alpha If use without Unified ODBC
+16 -17
View File
@@ -1,17 +1,16 @@
Module Status
------ ------
MySQL Working
COM Working
WDDX Working
PCRE Working
DBA Working
mcrypt Working
mhash Working
dbase Working
aspell Working
imap Working
ldap Working
oci8 Working (but no blob-support yet)
oracle Working
iptc Working
informix Working
Module Status
------ ------
MySQL Working
COM Working
WDDX Not yet ported
PCRE Working
DBA Not yet ported
mcrypt Working
mhash Working
dbase Working
aspell Working
imap Working
ldap Working
oci8 Working (but no blob-support yet)
oracle Working
iptc Working
+2 -9
View File
@@ -65,7 +65,6 @@ APXS_LDFLAGS = $(EXTRA_LIBS) $(LIBS)
APXS_EXP = @APXS_EXP@
WARNING_LEVEL = @WARNING_LEVEL@
LEX_CFLAGS = -w$(WARNING_LEVEL) @LEX_CFLAGS@
EXT_SHARED = @EXT_SHARED@
SOURCE = main.c internal_functions.c snprintf.c php3_sprintf.c \
configuration-parser.c configuration-scanner.c request_info.c \
@@ -171,6 +170,7 @@ distdir:
flex -Pcfg -oconfiguration-scanner.c -i configuration-scanner.l ;\
bison -p cfg -v -d configuration-parser.y -o configuration-parser.c
find $(distdir) -name CVS -o -name .cvsignore | xargs rm -rf
maintainer-clean-depend: maintainer-clean-depend-recursive
@@ -203,16 +203,9 @@ php_config.h.in: @MAINT@ stamp-h.in
stamp-h.in: configure.in aclocal.m4 acconfig.h
cd ${srcdir} && autoheader && touch ${srcdir}/stamp-h.in
install: install-recursive $(BINNAME)
install: $(BINNAME)
$(INSTALL_IT)
install-recursive:
if test "$(EXT_SHARED)" != ""; then \
for dir in X $(EXT_SHARED); do \
test -d ext/$$dir && (cd ext/$$dir; $(MAKE) install); \
done; \
fi
indent: clean
indent -v -kr -cli4 -ts4 \
-T pval -T HashTable -T Bucket -T Token -T TokenCache -T TokenCacheManager \
+100
View File
@@ -0,0 +1,100 @@
$Id$
+----
| * -- to be done
| ? -- to be done sometime if possible
| P -- in progress (name should appear in parentheses after task)
| D -- delayed until later date (specify in parentheses after task)
| U -- done, untested
| V -- done
+----
Configuration Issues
--------------------
* properly detect dbm routines when they're in libc
* add the appropriate #define magic for memmove and friends (see
GNU autoconf info pages for details)
* make it possible to disable support for some extensions (gd, dbm)
* make it possible to build selected extensions so they are
dynamically-loadable
Core Language Issues
--------------------
* go through PHP2's php.h and see how each special #define might be
applied/supported in PHP3
* move Treatdata() to language-scanner.lex where hash_environment()
is called including a decision about priority of variables and moving
Treatdata() to use hash_add() instead of hash_update() for insertions
to the symbol table.
* go through FIXME and XXX lines (egrep 'FIXME|XXX' *.[ch])
* make lexer and parser thread-safe
* verify that binary strings are handled correctly
V don't evaluate truth expressions more than once
V make unset() work on arrays (tricky)
Core Functions
--------------
* go through all file functions and make sure they are opened in binary
mode in win32 if needed (ie copy)
* go through all functions and look at PHP_SAFE_MODE issues
* have a look at return codes of fsockopen() function - we should
probably RETURN_FALSE and then set an error code somewhere (Rasmus)
* go through FIXME and XXX lines (egrep 'FIXME|XXX' functions/*.[ch])
* add user-level flock() implementation to let people lock and unlock files
* add "'" modifier to sprintf to group thousands by comma
* Add an improved eval() that doesn't "leak"
? sorting of objects with a user-defined comparison function (like Perl)
(this shouldn't be expected before 3.1, if at all).
Extensions
----------
* add version strings for all extensions
* Oracle persistent connections
U gd support for windows
* Illustra support (APIS)
? CQL++ support (http://www.cql.com/)
? GNU SQL support (does anybody actually use this?)
? DB2 support (http://www.sleepycat.com/)
? Shore support (http://www.cs.wisc.edu/shore/)
? PGP Interface (use PGPlib?)
? more Perl-like regex handling?
Server Support
--------------
P ISAPI (Shane)
* process cookies
* blocking functions
* make sure it's Microsoft-clean so it can be used with other ISAPI
implementations
* WSAPI
* NSAPI
* process cookies
* check POST method handling code
* use Netscape memory allocation inside emalloc() and company
* FastCGI support - see http://fastcgi.idle.com/
Win32 Specific
--------------
* implement some kind of syslog->file log support for win95.
* change all file open/read/write functions from c library to win32
api file functions. The win32 api functions handle both disk files
and network files. This will allow include and require to use http
or ftp files as the unix version does, and do away with my
workaround to support this. (3.1?)
* implement symlinks via windows shell links (shortcuts). This will
work only at the script level and is not a c language level port.
Testing
-------
* truss/strace a typical PHP request and see if there are some system
calls that could be optimized out
* verify that regression tests exist for all core functions
Miscellaneous
-------------
* remove hard-coded compilation options
? locale issues - funny things happen in PHP2 when the locale is set to
use , instead of . as the decimal seperator. ie. 1.5+1.5 = 1
? SSI->PHP3 conversion script
? SQL-based access logging (start with examples/log-*.php3)
+4 -4
View File
@@ -3,10 +3,10 @@
mv aclocal.m4 aclocal.m4.old 2>/dev/null
aclocal
if cmp aclocal.m4.old aclocal.m4 > /dev/null 2>&1; then
echo "buildconf: keeping ${1}aclocal.m4"
echo keeping ${1}aclocal.m4
mv aclocal.m4.old aclocal.m4
else
echo "buildconf: created or modified ${1}aclocal.m4"
echo created or modified ${1}aclocal.m4
fi
autoheader
@@ -16,9 +16,9 @@ automake --add-missing --include-deps
mv configure configure.old 2>/dev/null
autoconf
if cmp configure.old configure > /dev/null 2>&1; then
echo "buildconf: keeping ${1}configure"
echo keeping ${1}configure
mv configure.old configure
else
echo "buildconf: created or modified ${1}configure"
echo created or modified ${1}configure
fi
+17
View File
@@ -0,0 +1,17 @@
- Persistant per-process scripting
Apache 1.3 has added things that makes this much easier than before.
The module structure now contains a child_init hook and a child_exit
hook where you can register functions to be called when an httpd
process starts up and when one shuts down (due to MaxRequestsPerChild
or a Kill). The only real trick now is to come up with some sort of
syntax for specifying what to do from the child_init call and the
child_exit call.
One idea is to be able to add a <PHP>...</PHP> block to the Apache
httpd.conf file which would somehow define a series of PHP statements
to be executed from the child_* calls. One for startup and another
block for shutdown. These blocks would work with the per-process
memory pool, so any variables initialized here would have a lifespan
equal to that of the httpd process. Basically request-spanning
global variables.
+55
View File
@@ -0,0 +1,55 @@
V Do yystype_ptr and hash pointers the right way - use the hash
pointer and the bucket pointer, instead of a pointer to the data.
Allows for a real unset() among other things.
V Improve performance of simple variable lookups
* Improve string performance by using smarter memory allocation methods
- Improve preprocessor (handle require() efficiently), possibly handle
automatic preprocessing for sites based on timestamp
V Use a reference count mechanism to prevent unnecessary duplication of data.
* Write and stabilize a complete persistent data API. Feature wishlist:
- memory manager using shared memory
- process-global symbol table
- make api inter-thread capable for win32 and some far off future where unix
version will be multithreaded
V Handle out of memory (inside emalloc()?)
* Try to figure out a way to declare *real* global variables
* Improve the reading of configuration variables into php3_ini (generalize)
Make it possible to implement config_get("configuration_variable") and
config_set("configuration_variable","value") that'll work with *php3_ini*,
not the configuration hash!
* Bundle some nice classes (like Bjørn's graphing class)
* Bundle some database abstraction classes
* Distribute binaries
* Clean up API and modules to make .so modules portable across CGI and server
binaries
* dbm cleanup (don't arbitrarily pick, and support multiple concurrent formats)
* start system defines so that we can move away from the standard c lib on
windows to the win32 lib. (file functions primarily)
* COM implementation so php can be used as an asp language (cant find any docs
on how this is done though)
* Clean up the file structure so the top-level directory isn't such a mess.
* Bring the module concept to maturity: use libtool and make it
possible to decide at compile time whether you want to compile a
module statically or dynamically. Remove the distinction between
the stuff currently in dl/ and functions/.
* a way of letting each module specify its options, so ini file options and
Apache directives can be set up from the same specification.
V Make it possible to declare smarter user functions: (done in 3.0)
- Optional parameters
- Parameters that are forced/prefered by reference
* Make object parsing more general, and allow nested arrays/objects with
unlimited levels.
V Make it possible to copy references of variables.
* data tainting (like perl -T)
* multi-dimensional array support in GET/POST/COOKIE handling code
* Persistent functions and classes
* odbc_fetch_assoc
* Add env handling to gpc_order
* Populate track_vars regardless of gpc_order
* a real exec() function
* Support passing arguments to functions by name (e.g. foo(arg1 => "bar", arg2 => "foobar"))
* Add an optional setting to destroy persistent resources if a PHP script terminates
abnormally
V COM automation support for Win32
? Add a setting for making function names case sensitive
* stat() files before feeding them to flex - it doesn't handle special files very well
+4 -4
View File
@@ -3,10 +3,10 @@
mv aclocal.m4 aclocal.m4.old 2>/dev/null
aclocal
if cmp aclocal.m4.old aclocal.m4 > /dev/null 2>&1; then
echo "buildconf: keeping ${1}aclocal.m4"
echo keeping ${1}aclocal.m4
mv aclocal.m4.old aclocal.m4
else
echo "buildconf: created or modified ${1}aclocal.m4"
echo created or modified ${1}aclocal.m4
fi
autoheader
@@ -16,9 +16,9 @@ automake --add-missing --include-deps
mv configure configure.old 2>/dev/null
autoconf
if cmp configure.old configure > /dev/null 2>&1; then
echo "buildconf: keeping ${1}configure"
echo keeping ${1}configure
mv configure.old configure
else
echo "buildconf: created or modified ${1}configure"
echo created or modified ${1}configure
fi
+1
View File
@@ -933,6 +933,7 @@ void do_early_binding(CLS_D)
opline->opcode = ZEND_NOP;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
//CG(active_op_array)->last--;
}
+1 -6
View File
@@ -121,13 +121,8 @@ void zend_register_standard_constants(ELS_D)
#endif
REGISTER_MAIN_LONG_CONSTANT("E_ERROR", E_ERROR, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_WARNING", E_WARNING, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_PARSE", E_PARSE, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_NOTICE", E_NOTICE, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_CORE_ERROR", E_CORE_ERROR, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_CORE_WARNING", E_CORE_WARNING, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_COMPILE_ERROR", E_COMPILE_ERROR, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_COMPILE_WARNING", E_COMPILE_WARNING, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_PARSE", E_PARSE, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_ALL", E_ALL, CONST_PERSISTENT | CONST_CS);
/* true/false constants */
-4
View File
@@ -21,10 +21,6 @@
#include <stdio.h>
#include <signal.h>
#if (HAVE_ALLOCA && HAVE_ALLOCA_H)
#include <alloca.h>
#endif
#include "zend.h"
#include "zend_compile.h"
#include "zend_execute.h"
+1
View File
@@ -313,6 +313,7 @@ int call_user_function(HashTable *function_table, zval *object, zval *function_n
*param = *(params[i]);
INIT_PZVAL(param);
zval_copy_ctor(param);
//zend_hash_next_index_insert_ptr(function_state.function_symbol_table, param, sizeof(zval *), NULL);
zend_ptr_stack_push(&EG(argument_stack), param);
}
+2 -2
View File
@@ -48,7 +48,7 @@ static inline int zend_list_do_delete(HashTable *list,int id)
ELS_FETCH();
if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) {
/* printf("del(%d): %d->%d\n", id, le->refcount, le->refcount-1); */
// printf("del(%d): %d->%d\n", id, le->refcount, le->refcount-1);
if (--le->refcount<=0) {
return zend_hash_index_del(&EG(regular_list), id);
} else {
@@ -96,7 +96,7 @@ ZEND_API int zend_list_addref(int id)
ELS_FETCH();
if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) {
/* printf("add(%d): %d->%d\n", id, le->refcount, le->refcount+1); */
// printf("add(%d): %d->%d\n", id, le->refcount, le->refcount+1);
le->refcount++;
return SUCCESS;
} else {
+1
View File
@@ -936,6 +936,7 @@ ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2)
ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2)
{
//printf("Comparing %d and %d\n", op1->value.lval, op2->value.lval);
if (compare_function(result, op1, op2) == FAILURE) {
return FAILURE;
}
+6 -12
View File
@@ -38,8 +38,9 @@ AC_DEFUN(AC_ADD_LIBPATH,[
AC_EXPAND_PATH($1, ai_p)
AC_PHP_ONCE(LIBPATH, $ai_p, [
EXTRA_LIBS="$EXTRA_LIBS -L$ai_p"
RAW_RPATHS="$RAW_RPATHS ${raw_runpath_switch}$ai_p"
if test -n "$APXS" ; then
if test -n "$rpath_raw" ; then
RPATHS="$RPATHS ${raw_runpath_switch}$ai_p"
elif test -n "$APXS" ; then
RPATHS="$RPATHS ${apxs_runpath_switch}$ai_p'"
else
RPATHS="$RPATHS ${ld_runpath_switch}$ai_p"
@@ -138,22 +139,15 @@ dnl to make dynamic libraries as well.
dnl
AC_DEFUN(PHP_EXTENSION,[
EXT_SUBDIRS="$EXT_SUBDIRS $1"
if test "$2" != "shared" -a "$2" != "yes"; then
_extlib="libphpext_$1.a"
EXT_LIBS="$EXT_LIBS $1/$_extlib"
EXTINFO_DEPS="$EXTINFO_DEPS ../ext/$1/extinfo.c.stub"
EXT_STATIC="$EXT_STATIC $1"
else
EXT_SHARED="$EXT_SHARED $1"
fi
_extlib="libphpext_$1.a"
EXT_LIBS="$EXT_LIBS $1/$_extlib"
EXTINFO_DEPS="$EXTINFO_DEPS ../ext/$1/extinfo.c.stub"
dnl EXT_INCLUDE_CODE="\#include \"ext/$1/php3_$1.h\"\\n$EXT_INCLUDE_CODE"
dnl EXT_MODULE_PTRS="phpext_$1_ptr, $EXT_MODULE_PTRS"
dnl "
])
AC_SUBST(EXT_SUBDIRS)
AC_SUBST(EXT_STATIC)
AC_SUBST(EXT_SHARED)
AC_SUBST(EXT_LIBS)
AC_SUBST(EXTINFO_DEPS)
dnl AC_SUBST(EXT_INCLUDE_CODE)
+7 -71
View File
@@ -1,85 +1,21 @@
#!/bin/sh
# do some version checking for the tools we use
if test "$1" = "--force"; then
shift
else
echo "buildconf: checking installation..."
# autoconf 2.13 or newer
ac_version=`autoconf --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
if test "$ac_version" = ""; then
echo "buildconf: autoconf not found."
echo " You need autoconf version 2.13 or newer installed"
echo " to build PHP from CVS."
exit 1
fi
IFS=.; set $ac_version; IFS=' '
if test "$1" = "2" -a "$2" -lt "13" || test "$1" -lt "2"; then
echo "buildconf: autoconf version $ac_version found."
echo " You need autoconf version 2.13 or newer installed"
echo " to build PHP from CVS."
exit 1
else
echo "buildconf: autoconf version $ac_version (ok)"
fi
# automake 1.4 or newer
am_version=`automake --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
if test "$am_version" = ""; then
echo "buildconf: automake not found."
echo " You need automake version 1.4 or newer installed"
echo " to build PHP from CVS."
exit 1
fi
IFS=.; set $am_version; IFS=' '
if test "$1" = "1" -a "$2" -lt "4" || test "$1" -lt "1"; then
echo "buildconf: automake version $am_version found."
echo " You need automake version 1.4 or newer installed"
echo " to build PHP from CVS."
exit 1
else
echo "buildconf: automake version $am_version (ok)"
fi
# The stuff from libtool we need is in CVS right now, so it is
# not required to run buildconf.
fi
if test "$1" = "--copy"; then
automake_flags=--copy
automake_flags=--copy
fi
if ! test -d libzend; then
if test -d ../libzend; then
echo "buildconf: linking ../libzend to ./libzend"
ln -s ../libzend .
else
echo "buildconf: can not find libzend"
echo " libzend should be installed in . or .."
exit 1
fi
fi
if ! test -d TSRM; then
if test -d ../TSRM; then
echo "buildconf: linking ../TSRM to ./TSRM"
ln -s ../TSRM .
else
echo "buildconf: can not find TSRM"
echo " TSRM should be installed in . or .."
exit 1
fi
fi
test -d libzend || ln -s ../libzend .
test -d TSRM || ln -s ../TSRM .
./scripts/preconfig
mv aclocal.m4 aclocal.m4.old 2>/dev/null
aclocal
if cmp aclocal.m4.old aclocal.m4 > /dev/null 2>&1; then
echo "buildconf: keeping aclocal.m4"
echo keeping aclocal.m4
mv aclocal.m4.old aclocal.m4
else
echo "buildconf: created or modified aclocal.m4"
echo created or modified aclocal.m4
fi
autoheader
@@ -89,10 +25,10 @@ automake --add-missing --include-deps $automake_flags
mv configure configure.old 2>/dev/null
autoconf
if cmp configure.old configure > /dev/null 2>&1; then
echo "buildconf: keeping configure"
echo keeping configure
mv configure.old configure
else
echo "buildconf: created or modified configure"
echo created or modified configure
fi
(cd libzend; ./buildconf libzend/)
+69 -323
View File
@@ -1,6 +1,6 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
# Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -23,7 +23,6 @@
# Written by Per Bothner <bothner@cygnus.com>.
# The master version of this file is at the FSF in /home/gd/gnu/lib.
# Please send patches to the Autoconf mailing list <autoconf@gnu.org>.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
@@ -47,60 +46,17 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
dummy=dummy-$$
trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
alpha:OSF1:*:*)
if test $UNAME_RELEASE = "V4.0"; then
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
fi
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
cat <<EOF >$dummy.s
.globl main
.ent main
main:
.frame \$30,0,\$26,0
.prologue 0
.long 0x47e03d80 # implver $0
lda \$2,259
.long 0x47e20c21 # amask $2,$1
srl \$1,8,\$2
sll \$2,2,\$2
sll \$0,3,\$0
addl \$1,\$0,\$0
addl \$2,\$0,\$0
ret \$31,(\$26),1
.end main
EOF
${CC-cc} $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
./$dummy
case "$?" in
7)
UNAME_MACHINE="alpha"
;;
15)
UNAME_MACHINE="alphaev5"
;;
14)
UNAME_MACHINE="alphaev56"
;;
10)
UNAME_MACHINE="alphapca56"
;;
16)
UNAME_MACHINE="alphaev6"
;;
esac
fi
rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//'`
exit 0 ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
@@ -114,9 +70,6 @@ EOF
amiga:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
*:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos
exit 0 ;;
arc64:OpenBSD:*:*)
echo mips64el-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
@@ -138,13 +91,10 @@ EOF
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
arm32:NetBSD:*:*)
echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
SR2?01:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit 0;;
Pyramid*:OSx*:*:*|MIS*:OSx*:*:*|MIS*:SMP_DC-OSx*:*:*)
Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
@@ -152,12 +102,9 @@ EOF
echo pyramid-pyramid-bsd
fi
exit 0 ;;
NILE*:*:*:dcosx)
NILE:*:*:dcosx)
echo pyramid-pyramid-svr4
exit 0 ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
@@ -182,18 +129,6 @@ EOF
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
exit 0 ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
echo m68k-sun-sunos${UNAME_RELEASE}
;;
sun4)
echo sparc-sun-sunos${UNAME_RELEASE}
;;
esac
exit 0 ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit 0 ;;
@@ -224,9 +159,6 @@ EOF
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit 0 ;;
macppc:NetBSD:*:*)
echo powerpc-apple-netbsd${UNAME_RELEASE}
exit 0 ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit 0 ;;
@@ -240,12 +172,8 @@ EOF
echo clipper-intergraph-clix${UNAME_RELEASE}
exit 0 ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
sed 's/^ //' << EOF >$dummy.c
#ifdef __cplusplus
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
sed 's/^ //' << EOF >dummy.c
int main (argc, argv) int argc; char **argv; {
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
@@ -260,10 +188,10 @@ EOF
exit (-1);
}
EOF
${CC-cc} $dummy.c -o $dummy \
&& ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
&& rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
${CC-cc} dummy.c -o dummy \
&& ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
&& rm dummy.c dummy && exit 0
rm -f dummy.c dummy
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
Night_Hawk:Power_UNIX:*:*)
@@ -315,7 +243,7 @@ EOF
exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
sed 's/^ //' << EOF >$dummy.c
sed 's/^ //' << EOF >dummy.c
#include <sys/systemcfg.h>
main()
@@ -326,8 +254,8 @@ EOF
exit(0);
}
EOF
${CC-cc} $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
@@ -336,8 +264,7 @@ EOF
fi
exit 0 ;;
*:AIX:*:4)
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
@@ -370,50 +297,18 @@ EOF
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
exit 0 ;;
9000/[34678]??:HP-UX:*:*)
9000/[3478]??:HP-UX:*:*)
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/6?? | 9000/7?? | 9000/80[024] | 9000/8?[136790] | 9000/892 )
sed 's/^ //' << EOF >$dummy.c
#include <stdlib.h>
#include <unistd.h>
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break;
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
EOF
(${CC-cc} $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
rm -f $dummy.c $dummy
9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;;
9000/8?? ) HP_ARCH=hppa1.0 ;;
esac
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
3050*:HI-UX:*:*)
sed 's/^ //' << EOF >$dummy.c
sed 's/^ //' << EOF >dummy.c
#include <unistd.h>
int
main ()
@@ -438,8 +333,8 @@ EOF
exit (0);
}
EOF
${CC-cc} $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
echo unknown-hitachi-hiuxwe2
exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
@@ -448,12 +343,6 @@ EOF
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit 0 ;;
*9??*:MPE*:*:*)
echo hppa1.0-hp-mpeix
exit 0 ;;
*9??*:MPE*:*:*)
echo hppa1.0-hp-mpeix
exit 0 ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
exit 0 ;;
@@ -502,9 +391,6 @@ EOF
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE}
exit 0 ;;
CRAY*T3E:*:*:*)
echo t3e-cray-unicosmk${UNAME_RELEASE}
exit 0 ;;
CRAY-2:*:*:*)
echo cray2-cray-unicos
exit 0 ;;
@@ -522,22 +408,10 @@ EOF
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
i?86:BSD/386:*:* | *:BSD/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
*:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*)
if test -x /usr/bin/objformat; then
if test "elf" = "`/usr/bin/objformat`"; then
echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
exit 0
fi
fi
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;;
*:NetBSD:*:*)
@@ -547,13 +421,10 @@ EOF
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit 0 ;;
i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
echo i386-pc-cygwin32
exit 0 ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
echo powerpcle-unknown-cygwin32
exit 0 ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
@@ -562,87 +433,31 @@ EOF
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
*:Linux:*:*)
# # uname on the ARM produces all sorts of strangeness, and we need to
# # filter it out.
# case "$UNAME_MACHINE" in
# armv*) UNAME_MACHINE=$UNAME_MACHINE ;;
# arm* | sa110*) UNAME_MACHINE="arm" ;;
# esac
# The BFD linker knows what the default object file format is, so
# first see if it will tell us.
ld_help_string=`ld --help 2>&1`
ld_supported_emulations=`echo $ld_help_string \
| sed -ne '/supported emulations:/!d
s/[ ][ ]*/ /g
s/.*supported emulations: *//
s/ .*//
p'`
case "$ld_supported_emulations" in
i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
elf32arm) echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0 ;;
elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;;
esac
if test "${UNAME_MACHINE}" = "alpha" ; then
sed 's/^ //' <<EOF >$dummy.s
.globl main
.ent main
main:
.frame \$30,0,\$26,0
.prologue 0
.long 0x47e03d80 # implver $0
lda \$2,259
.long 0x47e20c21 # amask $2,$1
srl \$1,8,\$2
sll \$2,2,\$2
sll \$0,3,\$0
addl \$1,\$0,\$0
addl \$2,\$0,\$0
ret \$31,(\$26),1
.end main
EOF
LIBC=""
${CC-cc} $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
./$dummy
case "$?" in
7)
UNAME_MACHINE="alpha"
;;
15)
UNAME_MACHINE="alphaev5"
;;
14)
UNAME_MACHINE="alphaev56"
;;
10)
UNAME_MACHINE="alphapca56"
;;
16)
UNAME_MACHINE="alphaev6"
;;
esac
objdump --private-headers $dummy | \
grep ld.so.1 > /dev/null
if test "$?" = 0 ; then
LIBC="libc1"
fi
fi
rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i.86"; then
echo "${UNAME_MACHINE}-pc-linux-gnu" ; exit 0
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86linux"; then
echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86coff"; then
echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then
echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then
echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf32ppc"; then
echo "powerpc-unknown-linux-gnu" ; exit 0
elif test "${UNAME_MACHINE}" = "alpha" ; then
echo alpha-unknown-linux-gnu ; exit 0
elif test "${UNAME_MACHINE}" = "sparc" ; then
echo sparc-unknown-linux-gnu ; exit 0
elif test "${UNAME_MACHINE}" = "mips" ; then
cat >$dummy.c <<EOF
#ifdef __cplusplus
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
cat >dummy.c <<EOF
main(argc, argv)
int argc;
char *argv[];
{
#ifdef __MIPSEB__
printf ("%s-unknown-linux-gnu\n", argv[1]);
#endif
@@ -652,65 +467,35 @@ EOF
return 0;
}
EOF
${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
else
# Either a pre-BFD a.out linker (linux-gnuoldld)
# or one that does not give us useful --help.
# GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
# If ld does not provide *any* "supported emulations:"
# that means it is gnuoldld.
echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
case "${UNAME_MACHINE}" in
i?86)
VENDOR=pc;
;;
*)
VENDOR=unknown;
;;
esac
# Either a pre-BFD a.out linker (linux-gnuoldld) or one that does not give us
# useful --help. Gcc wants to distinguish between linux-gnuoldld and linux-gnuaout.
test ! -d /usr/lib/ldscripts/. \
&& echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
# Determine whether the default compiler is a.out or elf
cat >$dummy.c <<EOF
#include <features.h>
#ifdef __cplusplus
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
cat >dummy.c <<EOF
main(argc, argv)
int argc;
char *argv[];
{
#ifdef __ELF__
# ifdef __GLIBC__
# if __GLIBC__ >= 2
printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
# else
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
# endif
# else
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
# endif
printf ("%s-pc-linux-gnu\n", argv[1]);
#else
printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
printf ("%s-pc-linux-gnuaout\n", argv[1]);
#endif
return 0;
}
EOF
${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
fi ;;
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
# are messed up and put the nodename in both sysname and nodename.
i?86:DYNIX/ptx:4*:*)
echo i386-sequent-sysv4
exit 0 ;;
i?86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit 0 ;;
i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
@@ -732,18 +517,6 @@ EOF
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit 0 ;;
i?86:UnixWare:*:*)
if /bin/uname -X 2>/dev/null >/dev/null ; then
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
fi
echo ${UNAME_MACHINE}-unixware-${UNAME_RELEASE}-${UNAME_VERSION}
exit 0 ;;
pc:*:*:*)
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i386.
echo i386-pc-msdosdjgpp
exit 0 ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit 0 ;;
@@ -780,7 +553,7 @@ EOF
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit 0 ;;
i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
i?86:LynxOS:2.*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.*:*)
@@ -792,9 +565,6 @@ EOF
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit 0 ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
exit 0 ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
exit 0 ;;
@@ -806,6 +576,9 @@ EOF
echo ns32k-sni-sysv
fi
exit 0 ;;
BS2000:POSIX-BC:*:*) # EBCDIC based mainframe with POSIX subsystem
echo bs2000-siemens-sysv4
exit 0 ;;
PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4
@@ -822,43 +595,19 @@ EOF
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit 0 ;;
news*:NEWS-OS:*:6*)
echo mips-sony-newsos6
exit 0 ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*)
R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit 0 ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit 0 ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
echo powerpc-apple-beos
exit 0 ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit 0 ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit 0 ;;
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
exit 0 ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
cat >$dummy.c <<EOF
cat >dummy.c <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
# include <sys/utsname.h>
@@ -896,10 +645,7 @@ main ()
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
if (version < 4)
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
else
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
@@ -959,8 +705,8 @@ main ()
}
EOF
${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
# Apollos put the system type in the environment.
Vendored
+45 -85
View File
@@ -1,6 +1,6 @@
#! /bin/sh
# Configuration validation subroutine script, version 1.1.
# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc.
# Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
@@ -149,21 +149,19 @@ esac
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
| 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \
| hppa2.0w \
| alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
| i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
| mipstx39 | mipstx39el | armv[34][lb] \
| sparc | sparclet | sparclite | sparc64 | v850)
tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arm \
| arme[lb] | pyramid | mn10300 \
| tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
| alpha | we32k | ns16k | clipper | i370 | sh \
| powerpc | powerpcle | 1750a | dsp16xx | mips64 | mipsel \
| pdp11 | mips64el | mips64orion | mips64orionel \
| sparc | sparclet | sparclite | sparc64)
basic_machine=$basic_machine-unknown
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
i[34567]86)
i[3456]86)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
@@ -172,19 +170,14 @@ case $basic_machine in
exit 1
;;
# Recognize the basic CPU types with company name.
vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
| xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \
| hppa2.0w-* \
| alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
| ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
| sparc64-* | mips64-* | mipsel-* | armv[34][lb]-*\
| mips64el-* | mips64orion-* | mips64orionel-* \
| mipstx39-* | mipstx39el-* \
| f301-* | armv*-*)
vax-* | tahoe-* | i[3456]86-* | i860-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \
| none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
| hppa-* | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
| pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
| pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* | f301-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
@@ -211,9 +204,9 @@ case $basic_machine in
amiga | amiga-*)
basic_machine=m68k-cbm
;;
amigaos | amigados)
amigados)
basic_machine=m68k-cbm
os=-amigaos
os=-amigados
;;
amigaunix | amix)
basic_machine=m68k-cbm
@@ -347,32 +340,24 @@ case $basic_machine in
hppa-next)
os=-nextstep3
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
basic_machine=hppa1.0-hp
os=-mpeix
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
basic_machine=hppa1.0-hp
os=-mpeix
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
os=-mvs
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i[34567]86v32)
i[3456]86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
;;
i[34567]86v4*)
i[3456]86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv4
;;
i[34567]86v)
i[3456]86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv
;;
i[34567]86sol2)
i[3456]86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
@@ -406,11 +391,11 @@ case $basic_machine in
;;
mipsel*-linux*)
basic_machine=mipsel-unknown
os=-linux-gnu
os=-linux
;;
mips*-linux*)
basic_machine=mips-unknown
os=-linux-gnu
os=-linux
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
@@ -422,10 +407,6 @@ case $basic_machine in
basic_machine=i486-ncr
os=-sysv4
;;
netwinder)
basic_machine=armv4l-corel
os=-linux
;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
os=-newsos
@@ -483,23 +464,25 @@ case $basic_machine in
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pentium | p5 | k5 | nexen)
basic_machine=i586-pc
pentium | p5)
basic_machine=i586-intel
;;
pentiumpro | p6 | k6 | 6x86)
basic_machine=i686-pc
pentiumpro | p6)
basic_machine=i686-intel
;;
pentiumii | pentium2)
basic_machine=i786-pc
;;
pentium-* | p5-* | k5-* | nexen-*)
pentium-* | p5-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | k6-* | 6x86-*)
pentiumpro-* | p6-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-*)
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
k5)
# We don't have specific support for AMD's K5 yet, so just call it a Pentium
basic_machine=i586-amd
;;
nexen)
# We don't have specific support for Nexgen yet, so just call it a Pentium
basic_machine=i586-nexgen
;;
pn)
basic_machine=pn-gould
@@ -583,12 +566,6 @@ case $basic_machine in
basic_machine=i386-sequent
os=-dynix
;;
tx39)
basic_machine=mipstx39-unknown
;;
tx39el)
basic_machine=mipstx39el-unknown
;;
tower | tower-32)
basic_machine=m68k-ncr
;;
@@ -608,7 +585,7 @@ case $basic_machine in
basic_machine=vax-dec
os=-vms
;;
vpp*|vx|vx-*)
vpp*|vx|vx-*)
basic_machine=f301-fujitsu
;;
vxworks960)
@@ -638,7 +615,7 @@ case $basic_machine in
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
mips)
if [ x$os = x-linux-gnu ]; then
if [ x$os = x-linux ]; then
basic_machine=mips-unknown
else
basic_machine=mips-mips
@@ -703,12 +680,9 @@ case $os in
-solaris)
os=-solaris2
;;
-svr4*)
-unixware* | svr4*)
os=-sysv4
;;
-unixware*)
os=-sysv4.2uw
;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;;
@@ -719,17 +693,15 @@ case $os in
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* \
| -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -rhapsody* \
| -openstep* | -mpeix* | -oskit*)
| -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -linux-gnu* | -uxpv*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-linux*)
@@ -815,9 +787,6 @@ case $basic_machine in
*-acorn)
os=-riscix1.2
;;
arm*-corel)
os=-linux
;;
arm*-semi)
os=-aout
;;
@@ -845,9 +814,6 @@ case $basic_machine in
sparc-* | *-sun)
os=-sunos4.1.1
;;
*-be)
os=-beos
;;
*-ibm)
os=-aix
;;
@@ -861,7 +827,7 @@ case $basic_machine in
os=-sysv
;;
*-cbm)
os=-amigaos
os=-amigados
;;
*-dg)
os=-dgux
@@ -938,12 +904,6 @@ case $basic_machine in
-hpux*)
vendor=hp
;;
-mpeix*)
vendor=hp
;;
-mpeix*)
vendor=hp
;;
-hiux*)
vendor=hitachi
;;
+104 -69
View File
@@ -1,6 +1,8 @@
dnl $Id$ -*- sh -*-
dnl Process this file with autoconf to produce a configure script.
divert(0)
AC_INIT(main.c)
recurse=yes
@@ -14,25 +16,14 @@ for arg in $@; do
esac
done
if test "$with_shared_apache" != "no" && test -n "$with_shared_apache" ; then
echo ""
echo "ERROR: --with-shared-apache is not supported."
echo " Please read INSTALL.DSO for instructions on using APXS."
exit 1
fi
cwd=`pwd`
cachefile=$cwd/config.cache
if test "$recurse" = "yes"; then
(set -x; test -d libzend || mkdir libzend ; cd libzend; $cwd/$srcdir/libzend/configure --cache-file=$cachefile $@)
cwd=`pwd`
(set -x; test -d libzend || mkdir libzend ; cd libzend; $cwd/$srcdir/libzend/configure --cache-file=$cwd/config.cache $@)
if test "$threadsafe" = "yes"; then
(set -x; test -d TSRM || mkdir TSRM; cd TSRM; $cwd/$srcdir/TSRM/configure --cache-file=$cachefile $@)
(set -x; test -d TSRM || mkdir TSRM; cd TSRM; $cwd/$srcdir/TSRM/configure --cache-file=$cwd/config.cache $@)
fi
fi
(set -x; cd $srcdir; ./ltconfig --disable-static --enable-dlopen --cache-file=$cachefile ltmain.sh)
dnl ## Diversion 1 is the initial checking of OS features, programs,
dnl ## libraries and so on.
@@ -51,14 +42,12 @@ dnl ## Diversion 4 is the last one. Here we generate files and clean up.
divert(1)
dnl ## This is where the version number is changed from now on!
AM_INIT_AUTOMAKE(php, 4.0b2-dev)
AM_INIT_AUTOMAKE(php, 4.0B1)
PHP_VERSION=$VERSION
echo "/* automatically generated by configure */" > php_version.h.new
echo "/* edit configure.in.in to change version number */" >> php_version.h.new
echo "#define PHP_VERSION \"$PHP_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 && \
@@ -74,13 +63,7 @@ AM_MAINTAINER_MODE
dnl We want this one before the checks, so the checks can modify CFLAGS.
test -z "$CFLAGS" && auto_cflags=1
dnl If we're using cc on HP-UX, add the -Ae to CFLAGS
if test -n "$auto_cflags" && test "`uname -s 2>/dev/null`" = "HP-UX"; then
test -n "$GCC" || CFLAGS="-Ae $CFLAGS -D_HPUX_SOURCE"
fi
dnl Checks for programs.
AM_PROG_LIBTOOL
AC_PROG_YACC
if test "$YACC" != "bison -y"; then
AC_MSG_WARN(You will need bison if you want to regenerate the PHP parsers.)
@@ -314,9 +297,7 @@ AC_CHECK_FUNCS(memcpy memmove strdup strerror strcasecmp strstr flock lockf pute
AC_FUNC_UTIME_NULL
AC_FUNC_ALLOCA
dnl## OLDLIBS=$LIBS; LIBS=""
dnl This is also defined/used in libzend. To avoid a redefinition
dnl we use that version
dnl AC_BROKEN_SPRINTF
AC_BROKEN_SPRINTF
dnl## LIBS=$OLDLIBS
AC_REPLACE_FUNCS(getopt)
@@ -384,6 +365,64 @@ AC_ARG_WITH(apxs,
APACHE_INSTALL_FILES="$srcdir/mod_php4.* libphp4.module"
AC_MSG_CHECKING(for Apache module support via DSO through APACI)
AC_ARG_WITH(shared-apache,
[ --with-shared-apache[=DIR] Build shared Apache module. DIR is the top-level
Apache build directory, defaults to /usr/local/etc/httpd.
(This option needs Perl installed)],
[
if test "$withval" = "yes"; then
# Apache's default directory
withval=/usr/local/etc/httpd
fi
if test "$withval" != "no"; then
rpath_raw=yes
if test -f $withval/src/include/httpd.h; then
AC_EXPAND_PATH($withval, withval)
APACHE_INCLUDE="-I$withval/src/include -I$withval/src/os/unix"
APACHE_TARGET=$withval/src/modules/php4
if test ! -d $APACHE_TARGET; then
mkdir $APACHE_TARGET
fi
CFLAGS_SHLIB=`perl -V:cccdlflags | cut -d\' -f2`
LDFLAGS_SHLIB=`perl -V:lddlflags | cut -d\' -f2`
LDFLAGS_SHLIB_EXPORT=`perl -V:ccdlflags | cut -d\' -f2`
PHP_LIBS=
BINNAME=libmodphp4-so.a
INSTALL_IT="mkdir -p $APACHE_TARGET; cp $BINNAME $APACHE_INSTALL_FILES $APACHE_TARGET; cp apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp apMakefile.libdir $APACHE_TARGET/Makefile.libdir"
AC_DEFINE(APACHE)
AC_MSG_RESULT(yes - Shared Apache 1.3.x)
STRONGHOLD=
if test -f $withval/src/include/ap_config.h; then
AC_DEFINE(HAVE_AP_CONFIG_H)
fi
if test -f $withval/src/include/ap_compat.h; then
AC_DEFINE(HAVE_AP_COMPAT_H)
if test ! -f $withval/src/include/ap_config_auto.h; then
AC_MSG_ERROR(Please run Apache's configure or src/Configure program once and try again)
fi
else
if test -f $withval/src/include/compat.h; then
AC_DEFINE(HAVE_OLD_COMPAT_H)
fi
fi
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(Invalid Apache directory - unable to find httpd.h under $withval/src/include)
fi
fi
INCLUDES="$INCLUDES $APACHE_INCLUDE"
AC_SUBST(APACHE_INCLUDE)
AC_SUBST(APACHE_TARGET)
AC_SUBST(INSTALL_IT)
AC_SUBST(BINNAME)
AC_SUBST(PHP_LIBS)
],[
AC_MSG_RESULT(no)
])
if test "$BINNAME" != "libmodphp4-so.a"; then
if test "$BINNAME" != "libphp4.so"; then
AC_MSG_CHECKING(for Apache module support)
@@ -877,8 +916,7 @@ AC_SUBST(CFLAGS_SHLIB)
AC_SUBST(LDFLAGS_SHLIB)
AC_SUBST(LDFLAGS_SHLIB_EXPORT)
AC_SUBST(RPATHS)
AC_SUBST(RAW_RPATHS)
PHP_BUILD_DATE=`date '+%Y-%m-%d'`
AC_SUBST(PHP_BUILD_DATE)
AC_DEFINE_UNQUOTED(PHP_BUILD_DATE,"$PHP_BUILD_DATE")
@@ -899,48 +937,45 @@ if test ! -f $srcdir/ext/bcmath/number.c; then
echo "/* Dummy File */" > $srcdir/ext/bcmath/number.h
fi
if test "" = ""; then
chmod +x scripts/mkextlib
# Hacking while airborne considered harmful.
#
echo "creating internal_functions.c"
extensions=\`grep '^s.@EXT_STATIC@' \$0|sed -e 's/^.*@% *//' -e 's/%.*$//'\`
mv -f internal_functions.c internal_functions.c.old 2>/dev/null
sh $srcdir/genif.sh $srcdir/internal_functions.c.in $srcdir \$extensions > internal_functions.c
if cmp internal_functions.c.old internal_functions.c > /dev/null 2>&1; then
echo "internal_functions.c is unchanged"
mv internal_functions.c.old internal_functions.c
else
rm -f internal_functions.c.old
fi
# Warn about CGI version with no extra security options.
if test "$BINNAME" = "php"; then
if test "$REDIRECT" = "0"; then
if test "$DISCARD_PATH" = "0"; then
echo "+--------------------------------------------------------------------+"
echo "| Warning: |"
echo "| You will be compiling the CGI version of PHP without any |"
echo "| redirection checking. By putting this cgi binary somewhere in |"
echo "| your web space, users may be able to circumvent existing .htaccess |"
echo "| security by loading files directly through the parser. See |"
echo "| http://www.php.net/manual/config-security.php3 for more details. |"
fi
fi
fi
echo "+--------------------------------------------------------------------+"
echo "| License: |"
echo "| This software is subject to the PHP License, available in this |"
echo "| distribution in the file LICENSE. By continuing this installation |"
echo "| process, you are bound by the terms of this license agreement. |"
echo "| If you do not agree with the terms of this license, you must abort |"
echo "| the installation process at this point. |"
echo "+--------------------------------------------------------------------+"
chmod +x scripts/mkextlib
# Hacking while airborne considered harmful.
#
echo "creating internal_functions.c"
extensions=\`grep '^s.@EXT_SUBDIRS@' \$0|sed -e 's/^.*@% *//' -e 's/%.*$//'\`
mv -f internal_functions.c internal_functions.c.old 2>/dev/null
sh $srcdir/genif.sh $srcdir/internal_functions.c.in $srcdir \$extensions > internal_functions.c
if cmp internal_functions.c.old internal_functions.c > /dev/null 2>&1; then
echo "internal_functions.c is unchanged"
mv internal_functions.c.old internal_functions.c
else
rm -f internal_functions.c.old
fi
dnl Warn about CGI version with no extra security options.
if test "$BINNAME" = "php"; then
if test "$REDIRECT" = "0"; then
if test "$DISCARD_PATH" = "0"; then
echo "+--------------------------------------------------------------------+"
echo "| Warning: |"
echo "| You will be compiling the CGI version of PHP without any |"
echo "| redirection checking. By putting this cgi binary somewhere in |"
echo "| your web space, users may be able to circumvent existing .htaccess |"
echo "| security by loading files directly through the parser. See |"
echo "| http://www.php.net/manual/config-security.php3 for more details. |"
fi
fi
fi
echo "+--------------------------------------------------------------------+"
echo "| License: |"
echo "| This software is subject to the PHP License, available in this |"
echo "| distribution in the file LICENSE. By continuing this installation |"
echo "| process, you are bound by the terms of this license agreement. |"
echo "| If you do not agree with the terms of this license, you must abort |"
echo "| the installation process at this point. |"
echo "+--------------------------------------------------------------------+"
])
divert
+62
View File
@@ -0,0 +1,62 @@
CVS login Name Email Works on
andi Andi Gutmans andi@php.net Core + API
jim Jim Winstead jimw@php.net Everything
rasmus Rasmus Lerdorf rasmus@php.net Everything
shane Shane Caraveo shane@php.net WIN32 + API
ssb Stig Bakken stig@php.net Everything
zeev Zeev Suraski zeev@php.net Everything
jaakko Jaakko Hyvatti jaakko@hyvatti.iki.fi Everything
veebert Rex Logan veebert@dimensional.com IMAP
chad Chad Robinson chadr@brttech.com Documentation
myddryn PostgreSQL
wojtek
mitch Mitch Golden Oracle
brian
lr Lachlan Roche lr@www.wwi.com.au MD5
damian
ian
jah Jouni Ahto jah@cultnet.fi Postgres, Informix
adam
amitay Amitay Isaacs amitay@w-o-i.com LDAP
dizzy
mark
guy
jeffhu Jeffrey Hulten jeffh@premier1.net WIN32 + modules(?)
eschmid Egon Schmid eschmid@delos.lf.net Documentation
cslawi Torben Wilson torben@netmill.com Documentation
bwk
eric
tcobb Troy Cobb www
gareth www
willer Steve Willer willer@interlog.com pack
cmv Colin Viebrock cmv@privateworld.com www
soderman
tin
musone Mark Musone musone@afterfive.com IMAP
abelits Alex Belits abelits@phobos.illtel.denver.co.us fhttpd module
ars Ariel Shkedi ars@ziplink.net setup
mag Nikolay P. Romanyuk mag@redcom.ru Raima DB
rse Ralf S. Engelschall rse@engelschall.com Apache configuration
sr Stefan Roehrich sr@linux.de zlib module
owl Igor Kovalenko owl@infomarket.ru QNX support
pcurtis Paul Curtis pcurtis@netscape.com NSAPI work (??)
lynch Richard Lynch lynch@lscorp.com Documentation
steffann Sander Steffann steffann@nederland.net Safe Mode
wdiestel Wolfram Diestel wdiestel@debis.com Oracle WebServer cartridge
fmk Frank M. Kromann fmk@businessnet.dk Direct MS-SQL, NaVision, Lotus Notes
steinm Uwe Steinmann Uwe.Steinmann@fernuni-hagen.de Hyperwave Module
danny Danny Heijl Danny.Heijl@cevi.be Informix
kara Andreas Karajannis Andreas.Karajannis@gmd.de ODBC, Oracle
nyenyon Christian Cartus chc@idgruppe.de Informix
kk Kristian Köhntopp kk@shonline.de Documentation
ted Ted Rolle ted.rolle@usa.net Documentation
holger Holger Zimmermann zimpel@t-online.de Pi3Web support
sgk Shigeru Kanemoto sgk@happysize.co.jp Japanese language support
jimjag Jim Jagielski jim@jaguNET.com Misc scraps
martin Martin Kraemer Martin.Kraemer@Mch.SNI.De EBCDIC (BS2000 mainframe port)
kwazy Landon Bradshaw landon@bradshaw.org Documentation
thies Thies C. Arntzen thies@digicol.de implement IPTC reader, maybe some oracle stuff
cschneid Christian Schneider cschneid@relog.ch gzip run-time encoding of output stream
tommay Tom May tom@go2net.com Sybase-CT
swilliam Steve Williams swilliam@empress.com Empress support in unified ODBC
sas Sascha Schumann sas@schell.de Various tweaks
+1 -2
View File
@@ -1,10 +1,9 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = @EXT_SUBDIRS@
EXT_STATIC = @EXT_STATIC@
noinst_LIBRARIES=libphpext.a
libphpext.a: @EXT_LIBS@
top_srcdir=$(top_srcdir) $(top_builddir)/scripts/mkextlib $@ $(EXT_STATIC)
top_srcdir=$(top_srcdir) $(top_builddir)/scripts/mkextlib $@ $(SUBDIRS)
-@test "`uname -s`" = "Rhapsody" && $(RANLIB) $@
-7
View File
@@ -1,7 +0,0 @@
# $Id$
INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend
noinst_LIBRARIES=libphpext_dba.a
libphpext_dba_a_SOURCES=dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c \
dba_ndbm.c
-17
View File
@@ -1,17 +0,0 @@
/* define if you want to use the dba extension */
#define NDBM_DB1_NDBM_H 0
#define NDBM_NDBM_H 0
#define DB2_DB2_DB_H 0
#define DB2_DB_DB2_H 0
#define DB2_DB_H 0
#define DB2_DB2_H 0
#define HAVE_DBA 0
#define DBA_GDBM 0
#define DBA_NDBM 0
#define DBA_DBOPEN 0
#define DBA_DB2 0
#define DBA_DBM 0
#define DBA_CDB 0
-210
View File
@@ -1,210 +0,0 @@
dnl $Id$
dnl config.m4 for extension dba
dnl don't forget to call PHP_EXTENSION(dba)
AC_DEFUN(AC_TEMP_LDFLAGS,[
old_LDFLAGS="$LDFLAGS"
LDFLAGS="$1 $LDFLAGS"
$2
LDFLAGS="$old_LDFLAGS"
])
dnl Assign INCLUDE/LFLAGS from PREFIX
AC_DEFUN(AC_DBA_STD_ASSIGN,[
if test "$THIS_PREFIX" != "" -a "$THIS_PREFIX" != "/usr"; then
THIS_INCLUDE="$THIS_PREFIX/include"
THIS_LFLAGS="$THIS_PREFIX/lib"
fi
])
dnl Standard check
AC_DEFUN(AC_DBA_STD_CHECK,[
THIS_RESULT="yes"
if test "$THIS_PREFIX" != "/usr"; then
if test "$THIS_INCLUDE" = "" ; then
AC_MSG_ERROR(cannot find necessary header file(s))
elif test "$THIS_LIBS" = "" ; then
AC_MSG_ERROR(cannot find necessary library)
fi
fi
])
dnl Attach THIS_x to DBA_x
AC_DEFUN(AC_DBA_STD_ATTACH,[
AC_ADD_INCLUDE($THIS_INCLUDE)
AC_ADD_LIBRARY_WITH_PATH($THIS_LIBS, $THIS_LFLAGS)
THIS_INCLUDE=""
THIS_LIBS=""
THIS_LFLAGS=""
THIS_PREFIX=""
])
dnl Print the result message
AC_DEFUN(AC_DBA_STD_RESULT,[
if test "$THIS_RESULT" = "yes"; then
HAVE_DBA=1
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
THIS_RESULT=""
])
AC_ARG_WITH(gdbm,
[ --with-gdbm[=DIR] Include GDBM support],[
if test "$withval" != "no"; then
for i in /usr/local /usr $withval; do
if test -f "$i/include/gdbm.h"; then
THIS_PREFIX="$i"
fi
done
unset ac_cv_lib_gdbm_gdbm_open
AC_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
AC_CHECK_LIB(gdbm, gdbm_open, [AC_DEFINE(DBA_GDBM, 1) THIS_LIBS="gdbm"])
])
AC_DBA_STD_ASSIGN
AC_DBA_STD_CHECK
AC_DBA_STD_ATTACH
fi
])
AC_MSG_CHECKING(for GDBM support)
AC_DBA_STD_RESULT
AC_ARG_WITH(ndbm,
[ --with-ndbm[=DIR] Include NDBM support],[
if test "$withval" != "no"; then
for i in /usr/local /usr $withval; do
if test -f "$i/include/db1/ndbm.h" ; then
THIS_PREFIX="$i"
NDBM_EXTRA="NDBM_DB1_NDBM_H"
elif test -f "$i/include/ndbm.h" ; then
THIS_PREFIX="$i"
NDBM_EXTRA="NDBM_NDBM_H"
fi
done
if test "$NDBM_EXTRA" != ""; then
eval "AC_DEFINE($NDBM_EXTRA, 1)"
fi
for LIB in db1 ndbm c; do
AC_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
AC_CHECK_LIB($LIB, dbm_open, [AC_DEFINE(DBA_NDBM,1) THIS_LIBS="$LIB"])
])
done
AC_DBA_STD_ASSIGN
AC_DBA_STD_CHECK
AC_DBA_STD_ATTACH
fi
])
AC_MSG_CHECKING(for NDBM support)
AC_DBA_STD_RESULT
AC_ARG_WITH(db2,
[ --with-db2[=DIR] Include DB2 support],[
if test "$withval" != "no"; then
for i in /usr/local /usr /usr/BerkeleyDB $withval; do
if test -f "$i/db2/db.h"; then
THIS_PREFIX="$i"
DB2_EXTRA="db2"
elif test -f "$i/include/db2/db.h"; then
THIS_PREFIX="$i"
DB2_EXTRA="DB2_DB2_DB_H"
elif test -f "$i/include/db/db2.h"; then
THIS_PREFIX="$i"
DB2_EXTRA="DB2_DB_DB2_H"
elif test -f "$i/include/db2.h"; then
THIS_PREFIX="$i"
DB2_EXTRA="DB2_DB2_H"
elif test -f "$i/include/db.h" ; then
THIS_PREFIX="$i"
DB2_EXTRA="DB2_DB_H"
fi
done
if test "$DB2_EXTRA" = "db2" ; then
DBA_INCLUDE="$DBA_INCLUDE -I$THIS_PREFIX/db2"
DB2_EXTRA="DB2_DB_H"
fi
if test "$DB2_EXTRA" != ""; then
eval "AC_DEFINE($DB2_EXTRA, 1)"
fi
for LIB in db db2 c; do
AC_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
AC_CHECK_LIB($LIB, db_appinit, [AC_DEFINE(DBA_DB2,1) THIS_LIBS="$LIB"])
])
done
AC_DBA_STD_ASSIGN
AC_DBA_STD_CHECK
AC_DBA_STD_ATTACH
fi
])
AC_MSG_CHECKING(for DB2 support)
AC_DBA_STD_RESULT
AC_ARG_WITH(dbm,
[ --with-dbm[=DIR] Include DBM support],[
if test "$withval" != "no"; then
for i in /usr/local /usr $withval; do
if test -f "$i/include/dbm.h" ; then
THIS_PREFIX="$i"
fi
done
for LIB in db1 dbm c; do
AC_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
AC_CHECK_LIB($LIB, dbminit, [AC_DEFINE(DBA_DBM,1) THIS_LIBS="$LIB"])
])
done
AC_DBA_STD_ASSIGN
AC_DBA_STD_CHECK
AC_DBA_STD_ATTACH
fi
])
AC_MSG_CHECKING(for DBM support)
AC_DBA_STD_RESULT
AC_ARG_WITH(cdb,
[ --with-cdb[=DIR] Include CDB support],[
if test "$withval" != "no"; then
for i in /usr/local /usr $withval; do
if test -f "$i/include/cdb.h" ; then
THIS_PREFIX="$i"
fi
done
for LIB in cdb c; do
AC_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
AC_CHECK_LIB($LIB, cdb_bread, [AC_DEFINE(DBA_CDB,1) THIS_LIBS="$LIB"])
])
done
AC_DBA_STD_ASSIGN
AC_DBA_STD_CHECK
AC_DBA_STD_ATTACH
fi
])
AC_MSG_CHECKING(for CDB support)
AC_DBA_STD_RESULT
AC_MSG_CHECKING(whether to enable DBA interface)
if test "$HAVE_DBA" = "1"; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_DBA, 1)
PHP_EXTENSION(dba)
else
AC_MSG_RESULT(no)
AC_DEFINE(HAVE_DBA, 0)
fi
-476
View File
@@ -1,476 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP HTML Embedded Scripting Language Version 3.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1999 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
| it under the terms of one of the following licenses: |
| |
| A) 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. |
| |
| B) the PHP License as published by the PHP Development Team and |
| included in the distribution in the file: LICENSE |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
| |
| You should have received a copy of both licenses referred to here. |
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
| Authors: Sascha Schumann <sas@schell.de> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "php.h"
#if HAVE_DBA
#include "php3_dba.h"
#include "php3_gdbm.h"
#include "php3_ndbm.h"
#include "php3_dbm.h"
#include "php3_cdb.h"
#include "php3_db2.h"
function_entry dba_functions[] = {
PHP_FE(dba_open, NULL)
PHP_FE(dba_popen, NULL)
PHP_FE(dba_close, NULL)
PHP_FE(dba_delete, NULL)
PHP_FE(dba_exists, NULL)
PHP_FE(dba_fetch, NULL)
PHP_FE(dba_insert, NULL)
PHP_FE(dba_replace, NULL)
PHP_FE(dba_firstkey, NULL)
PHP_FE(dba_nextkey, NULL)
PHP_FE(dba_optimize, NULL)
PHP_FE(dba_sync, NULL)
{NULL,NULL,NULL}
};
static int php3_minit_dba(INIT_FUNC_ARGS);
static int php3_mshutdown_dba(SHUTDOWN_FUNC_ARGS);
static void php3_info_dba(ZEND_MODULES_INFO_FUNC_ARGS);
php3_module_entry dba_module_entry = {
"DataBase API", dba_functions,
php3_minit_dba,
php3_mshutdown_dba,
NULL, NULL,
php3_info_dba,
STANDARD_MODULE_PROPERTIES
};
typedef struct dba_handler {
char *name;
int (*open)(dba_info *);
void (*close)(dba_info *);
char* (*fetch)(dba_info *, char *, int, int *);
int (*update)(dba_info *, char *, int, char *, int, int);
int (*exists)(dba_info *, char *, int);
int (*delete)(dba_info *, char *, int);
char* (*firstkey)(dba_info *, int *);
char* (*nextkey)(dba_info *, int *);
int (*optimize)(dba_info *);
int (*sync)(dba_info *);
} dba_handler;
/* {{{ macromania */
#define DBA_ID_PARS pval *id; dba_info *info = NULL; int type, ac = ARG_COUNT(ht)
/* these are used to get the standard arguments */
#define DBA_GET1 \
if(ac != 1 || getParameters(ht, ac, &id) != SUCCESS) { \
WRONG_PARAM_COUNT; \
}
#define DBA_GET2 \
pval *key; \
if(ac != 2 || getParameters(ht, ac, &key, &id) != SUCCESS) { \
WRONG_PARAM_COUNT; \
} \
convert_to_string(key)
#define DBA_IF_NOT_CORRECT_TYPE(link_id) \
info = php3_list_find(link_id, &type); \
if(!info || (type != GLOBAL(le_db) && type != GLOBAL(le_pdb)))
#define DBA_ID_GET \
convert_to_long(id); \
DBA_IF_NOT_CORRECT_TYPE(id->value.lval) { \
php3_error(E_WARNING, "Unable to find DBA identifier %d", id->value.lval); \
RETURN_FALSE; \
}
#define DBA_ID_GET1 DBA_ID_PARS; DBA_GET1; DBA_ID_GET
#define DBA_ID_GET2 DBA_ID_PARS; DBA_GET2; DBA_ID_GET
/* a DBA handler must have specific routines */
#define DBA_HND(x) \
{\
#x, dba_open_##x, dba_close_##x, dba_fetch_##x, dba_update_##x, \
dba_exists_##x, dba_delete_##x, dba_firstkey_##x, dba_nextkey_##x, \
dba_optimize_##x, dba_sync_##x \
},
/* check whether the user has write access */
#define DBA_WRITE_CHECK \
if(info->mode != DBA_WRITER && info->mode != DBA_TRUNC && info->mode != DBA_CREAT) { \
php3_error(E_WARNING, "you cannot perform a modification to a database without proper access"); \
RETURN_FALSE; \
}
#define GLOBAL(a) a
/* }}} */
/* {{{ globals */
static dba_handler handler[] = {
#if DBA_GDBM
DBA_HND(gdbm)
#endif
#if DBA_DBM
DBA_HND(dbm)
#endif
#if DBA_NDBM
DBA_HND(ndbm)
#endif
#if DBA_CDB
DBA_HND(cdb)
#endif
#if DBA_DB2
DBA_HND(db2)
#endif
{ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
};
static int le_db;
static int le_pdb;
static HashTable ht_keys;
/* }}} */
/* {{{ helper routines */
/* {{{ dba_close */
static void dba_close(dba_info *info)
{
if(info->hnd) info->hnd->close(info);
if(info->path) free(info->path);
free(info);
}
/* }}} */
/* {{{ php3_minit_dba */
static int php3_minit_dba(INIT_FUNC_ARGS)
{
_php3_hash_init(&ht_keys, 0, NULL, NULL, 1);
GLOBAL(le_db) = register_list_destructors(dba_close, NULL);
GLOBAL(le_pdb) = register_list_destructors(NULL, dba_close);
return SUCCESS;
}
/* }}} */
/* {{{ php3_mshutdown_dba */
static int php3_mshutdown_dba(SHUTDOWN_FUNC_ARGS)
{
_php3_hash_destroy(&ht_keys);
return SUCCESS;
}
/* }}} */
/* {{{ php3_info_dba */
static void php3_info_dba(ZEND_MODULE_INFO_FUNC_ARGS)
{
dba_handler *hptr;
PUTS("V1 ($Id$)");
for(hptr = handler; hptr->name; hptr++) {
PUTS(" ");
PUTS(hptr->name);
}
}
/* }}} */
/* {{{ _php3_dba_update */
static void _php3_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
{
DBA_ID_PARS;
pval *val, *key;
if(ac != 3 || getParameters(ht, ac, &key, &val, &id) != SUCCESS) {
WRONG_PARAM_COUNT;
}
convert_to_string(key);
convert_to_string(val);
DBA_ID_GET;
DBA_WRITE_CHECK;
if(info->hnd->update(info, VALLEN(key), VALLEN(val), mode) == SUCCESS)
RETURN_TRUE;
RETURN_FALSE;
}
/* }}} */
/* {{{ _php3_dba_open */
#define FREENOW if(args) efree(args); if(key) efree(key)
static void _php3_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
{
pval **args = (pval **) NULL;
int ac = ARG_COUNT(ht);
dba_mode_t modenr;
dba_info *info;
dba_handler *hptr;
char *key = NULL;
int keylen = 0;
int listid;
int i;
if(ac < 3) {
WRONG_PARAM_COUNT;
}
/* we pass additional args to the respective handler */
args = emalloc(ac * sizeof(pval *));
if(getParametersArray(ht, ac, args) != SUCCESS) {
FREENOW;
WRONG_PARAM_COUNT;
}
/* we only take string arguments */
for(i = 0; i < ac; i++) {
convert_to_string(args[i]);
keylen += args[i]->value.str.len;
}
if(persistent) {
/* calculate hash */
key = emalloc(keylen);
keylen = 0;
for(i = 0; i < ac; i++) {
memcpy(key+keylen,args[i]->value.str.val,args[i]->value.str.len);
keylen += args[i]->value.str.len;
}
if(_php3_hash_find(&ht_keys, key, keylen, (void **) &info) == SUCCESS) {
FREENOW;
RETURN_LONG(php3_list_insert(info, GLOBAL(le_pdb)));
}
}
/* this is O(n) and could be improved */
for(hptr = handler; hptr->name &&
strcasecmp(hptr->name, args[2]->value.str.val); hptr++);
if(!hptr->name) {
php3_error(E_WARNING, "no such handler: %s", args[2]->value.str.val);
FREENOW;
RETURN_FALSE;
}
switch(args[1]->value.str.val[0]) {
case 'c':
modenr = DBA_CREAT;
break;
case 'w':
modenr = DBA_WRITER;
break;
case 'r':
modenr = DBA_READER;
break;
case 'n':
modenr = DBA_TRUNC;
break;
default:
php3_error(E_WARNING,"illegal DBA mode: %s",args[1]->value.str.val);
FREENOW;
RETURN_FALSE;
}
info = malloc(sizeof(*info));
memset(info, 0, sizeof(info));
info->path = strdup(args[0]->value.str.val);
info->mode = modenr;
info->argc = ac - 3;
info->argv = args + 3;
info->hnd = NULL;
if(hptr->open(info) != SUCCESS) {
dba_close(info);
php3_error(E_WARNING, "driver initialization failed");
FREENOW;
RETURN_FALSE;
}
info->hnd = hptr;
info->argc = 0;
info->argv = NULL;
listid = php3_list_insert(info, persistent?GLOBAL(le_pdb):GLOBAL(le_db));
if(persistent) {
_php3_hash_update(&ht_keys, key, keylen, info, sizeof(*info), NULL);
}
FREENOW;
RETURN_LONG(listid);
}
#undef FREENOW
/* }}} */
/* }}} */
/* {{{ proto int dba_popen(string path, string mode, string handlername[, ...])
opens path using the specified handler in mode persistently */
PHP_FUNCTION(dba_popen)
{
_php3_dba_open(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
/* }}} */
/* {{{ proto int dba_open(string path, string mode, string handlername[, ...])
opens path using the specified handler in mode*/
PHP_FUNCTION(dba_open)
{
_php3_dba_open(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */
/* {{{ proto void dba_close(int handle)
closes database */
PHP_FUNCTION(dba_close)
{
DBA_ID_GET1;
php3_list_delete(id->value.lval);
}
/* }}} */
/* {{{ proto bool dba_exists(string key, int handle)
checks, if the specified key exists */
PHP_FUNCTION(dba_exists)
{
DBA_ID_GET2;
if(info->hnd->exists(info, VALLEN(key)) == SUCCESS) {
RETURN_TRUE;
}
RETURN_FALSE;
}
/* }}} */
/* {{{ proto string dba_fetch(string key, int handle)
fetches the data associated with key */
PHP_FUNCTION(dba_fetch)
{
char *val;
int len = 0;
DBA_ID_GET2;
if((val = info->hnd->fetch(info, VALLEN(key), &len)) != NULL) {
RETURN_STRINGL(val, len, 0);
}
RETURN_FALSE;
}
/* }}} */
/* {{{ proto string dba_firstkey(int handle)
resets the internal key pointer and returns the first key */
PHP_FUNCTION(dba_firstkey)
{
char *fkey;
int len;
DBA_ID_GET1;
fkey = info->hnd->firstkey(info, &len);
if(fkey)
RETURN_STRINGL(fkey, len, 0);
RETURN_FALSE;
}
/* }}} */
/* {{{ proto string dba_nextkey(int handle)
returns the next key */
PHP_FUNCTION(dba_nextkey)
{
char *nkey;
int len;
DBA_ID_GET1;
nkey = info->hnd->nextkey(info, &len);
if(nkey)
RETURN_STRINGL(nkey, len, 0);
RETURN_FALSE;
}
/* }}} */
/* {{{ proto bool dba_delete(string key, int handle)
deletes the entry associated with key */
PHP_FUNCTION(dba_delete)
{
DBA_ID_GET2;
DBA_WRITE_CHECK;
if(info->hnd->delete(info, VALLEN(key)) == SUCCESS)
RETURN_TRUE;
RETURN_FALSE;
}
/* }}} */
/* {{{ proto bool dba_insert(string key, string value, int handle)
inserts value as key, returns false, if key exists already */
PHP_FUNCTION(dba_insert)
{
_php3_dba_update(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
/* }}} */
/* {{{ proto bool dba_replace(string key, string value, int handle)
inserts value as key, replaces key, if key exists already */
PHP_FUNCTION(dba_replace)
{
_php3_dba_update(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */
/* {{{ proto bool dba_optimize(int handle)
optimizes (e.g. clean up, vacuum) database */
PHP_FUNCTION(dba_optimize)
{
DBA_ID_GET1;
DBA_WRITE_CHECK;
if(info->hnd->optimize(info) == SUCCESS) {
RETURN_TRUE;
}
RETURN_FALSE;
}
/* }}} */
/* {{{ proto bool dba_sync(int handle)
synchronizes database */
PHP_FUNCTION(dba_sync)
{
DBA_ID_GET1;
if(info->hnd->sync(info) == SUCCESS) {
RETURN_TRUE;
}
RETURN_FALSE;
}
/* }}} */
#endif
-220
View File
@@ -1,220 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP HTML Embedded Scripting Language Version 3.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1999 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
| it under the terms of one of the following licenses: |
| |
| A) 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. |
| |
| B) the PHP License as published by the PHP Development Team and |
| included in the distribution in the file: LICENSE |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
| |
| You should have received a copy of both licenses referred to here. |
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
| Authors: Sascha Schumann <sas@schell.de> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "php.h"
#if DBA_CDB
#include "php3_cdb.h"
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <cdb.h>
#include <cdbmake.h>
#define CDB_INFO \
dba_cdb *cdb = (dba_cdb *) info->dbf
typedef struct {
int fd;
uint32 eod; /* size of constant database */
uint32 pos; /* current position for traversing */
} dba_cdb;
DBA_OPEN_FUNC(cdb)
{
int gmode = 0;
dba_cdb *cdb;
dba_info *pinfo = (dba_info *) info;
switch(info->mode) {
case DBA_READER:
gmode = O_RDONLY; break;
/* currently not supported: */
#if 0
case DBA_WRITER:
gmode = O_RDWR; break;
#endif
default:
return FAILURE;
}
cdb = malloc(sizeof *cdb);
memset(cdb, 0, sizeof *cdb);
cdb->fd = open(info->path, gmode);
if(cdb->fd < 0) {
free(cdb);
return FAILURE;
}
pinfo->dbf = cdb;
return SUCCESS;
}
DBA_CLOSE_FUNC(cdb)
{
CDB_INFO;
close(cdb->fd);
free(cdb);
}
DBA_FETCH_FUNC(cdb)
{
CDB_INFO;
int len;
char *new = NULL;
if(cdb_seek(cdb->fd, key, keylen, &len) == 1) {
new = emalloc(len);
read(cdb->fd, new, len);
if(newlen) *newlen = len;
}
return new;
}
DBA_UPDATE_FUNC(cdb)
{
/* if anyone figures out cdbmake.c, let me know */
return FAILURE;
}
DBA_EXISTS_FUNC(cdb)
{
CDB_INFO;
int len;
if(cdb_seek(cdb->fd, key, keylen, &len) == 1)
return SUCCESS;
return FAILURE;
}
DBA_DELETE_FUNC(cdb)
{
return FAILURE;
}
#define CREAD(n) if(read(cdb->fd, buf, n) < n) return NULL
#define CSEEK(n) \
if(n >= cdb->eod) return NULL; \
if(lseek(cdb->fd, (off_t)n, SEEK_SET) != (off_t) n) return NULL
DBA_FIRSTKEY_FUNC(cdb)
{
CDB_INFO;
uint32 len;
char buf[8];
char *key;
cdb->eod = -1;
CSEEK(0);
CREAD(4);
cdb->eod = cdb_unpack(buf);
CSEEK(2048);
CREAD(8);
len = cdb_unpack(buf);
key = emalloc(len + 1);
if(read(cdb->fd, key, len) < len) {
efree(key);
key = NULL;
} else
key[len] = '\0';
/* header + klenlen + dlenlen + klen + dlen */
cdb->pos = 2048 + 4 + 4 + len + cdb_unpack(buf + 4);
return key;
}
DBA_NEXTKEY_FUNC(cdb)
{
CDB_INFO;
uint32 len;
char buf[8];
char *nkey;
CSEEK(cdb->pos);
CREAD(8);
len = cdb_unpack(buf);
nkey = emalloc(len + 1);
if(read(cdb->fd, nkey, len) < len) {
efree(nkey);
return NULL;
}
nkey[len] = '\0';
if(newlen) *newlen = len;
cdb->pos += 8 + len + cdb_unpack(buf + 4);
return nkey;
#if 0
/* this code cdb_seeks and is thus slower than directly seeking
in the file */
CDB_INFO;
char *nkey = NULL;
uint32 len;
char buf[8];
if(cdb_seek(cdb->fd, key, keylen, &len) == 1) {
if(lseek(cdb->fd, (off_t) len, SEEK_CUR) >= (off_t) cdb->eod)
return NULL;
CREAD(8);
len = cdb_unpack(buf);
nkey = emalloc(len + 1);
if(read(cdb->fd, nkey, len) < len) {
efree(nkey);
nkey = NULL;
} else
nkey[len] = '\0';
}
return nkey;
#endif
}
DBA_OPTIMIZE_FUNC(cdb)
{
return SUCCESS;
}
DBA_SYNC_FUNC(cdb)
{
/* this is read-only */
return SUCCESS;
}
#endif
-207
View File
@@ -1,207 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP HTML Embedded Scripting Language Version 3.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1999 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
| it under the terms of one of the following licenses: |
| |
| A) 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. |
| |
| B) the PHP License as published by the PHP Development Team and |
| included in the distribution in the file: LICENSE |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
| |
| You should have received a copy of both licenses referred to here. |
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
| Authors: Sascha Schumann <sas@schell.de> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "php.h"
#if DBA_DB2
#include "php3_db2.h"
#include <sys/stat.h>
#include <string.h>
#if DB2_DB2_DB_H
#include <db2/db.h>
#elif DB2_DB_DB2_H
#include <db/db2.h>
#elif DB2_DB2_H
#include <db2.h>
#elif DB2_DB_H
#include <db.h>
#endif
#define DB2_DATA dba_db2_data *dba = info->dbf
#define DB2_GKEY \
DBT gkey; \
memset(&gkey, 0, sizeof(gkey)); \
gkey.data = (char *) key; gkey.size = keylen
typedef struct {
DB *dbp;
DBC *cursor;
} dba_db2_data;
DBA_OPEN_FUNC(db2)
{
DB *dbp;
DBTYPE type;
int gmode = 0;
int filemode = 0644;
struct stat check_stat;
type = info->mode == DBA_READER ? DB_UNKNOWN :
info->mode == DBA_TRUNC ? DB_BTREE :
stat(info->path, &check_stat) ? DB_BTREE : DB_UNKNOWN;
gmode = info->mode == DBA_READER ? DB_RDONLY :
info->mode == DBA_CREAT ? DB_CREATE :
info->mode == DBA_WRITER ? 0 :
info->mode == DBA_TRUNC ? DB_CREATE | DB_TRUNCATE : -1;
if(gmode == -1)
return FAILURE;
if(info->argc > 0) {
convert_to_long(info->argv[0]);
filemode = info->argv[0]->value.lval;
}
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;
}
return FAILURE;
}
DBA_CLOSE_FUNC(db2)
{
DB2_DATA;
if(dba->cursor) dba->cursor->c_close(dba->cursor);
dba->dbp->close(dba->dbp, DB_NOSYNC);
free(dba);
}
DBA_FETCH_FUNC(db2)
{
DBT gval;
char *new = NULL;
DB2_DATA;
DB2_GKEY;
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);
}
return new;
}
DBA_UPDATE_FUNC(db2)
{
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,
mode == 1 ? DB_NOOVERWRITE : 0)) {
return SUCCESS;
}
return FAILURE;
}
DBA_EXISTS_FUNC(db2)
{
DBT gval;
DB2_DATA;
DB2_GKEY;
memset(&gval, 0, sizeof(gval));
if(!dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) {
return SUCCESS;
}
return FAILURE;
}
DBA_DELETE_FUNC(db2)
{
DB2_DATA;
DB2_GKEY;
return dba->dbp->del(dba->dbp, NULL, &gkey, 0) ? FAILURE : SUCCESS;
}
DBA_FIRSTKEY_FUNC(db2)
{
DB2_DATA;
if(dba->cursor) {
dba->cursor->c_close(dba->cursor);
}
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)) {
#else
if(dba->dbp->cursor(dba->dbp, NULL, &dba->cursor)) {
#endif
return NULL;
}
/* we should introduce something like PARAM_PASSTHRU... */
return dba_nextkey_db2(info, newlen);
}
DBA_NEXTKEY_FUNC(db2)
{
DB2_DATA;
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)) {
if(gkey.data) {
nkey = estrndup(gkey.data, gkey.size);
if(newlen) *newlen = gkey.size;
}
}
return nkey;
}
DBA_OPTIMIZE_FUNC(db2)
{
return SUCCESS;
}
DBA_SYNC_FUNC(db2)
{
DB2_DATA;
return dba->dbp->sync(dba->dbp, 0) ? FAILURE : SUCCESS;
}
#endif
-190
View File
@@ -1,190 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP HTML Embedded Scripting Language Version 3.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1999 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
| it under the terms of one of the following licenses: |
| |
| A) 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. |
| |
| B) the PHP License as published by the PHP Development Team and |
| included in the distribution in the file: LICENSE |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
| |
| You should have received a copy of both licenses referred to here. |
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
| Authors: Sascha Schumann <sas@schell.de> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "php.h"
#if DBA_DBM
#include "php3_dbm.h"
#include <dbm.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#define DBM_DATA dba_dbm_data *dba = info->dbf
#define DBM_GKEY datum gkey; gkey.dptr = (char *) key; gkey.dsize = keylen
#ifndef PATH_MAX
#define PATH_MAX 255
#endif
#define TRUNC_IT(extension, mode) \
snprintf(buf, PATH_MAX, "%s" extension, info->path); \
buf[PATH_MAX] = '\0'; \
if((fd = open(buf, O_CREAT | mode | O_WRONLY, filemode)) == -1) \
return FAILURE; \
close(fd);
typedef struct {
datum nextkey;
} dba_dbm_data;
DBA_OPEN_FUNC(dbm)
{
int fd;
int filemode = 0644;
if(info->argc > 0) {
convert_to_long(info->argv[0]);
filemode = info->argv[0]->value.lval;
}
if(info->mode == DBA_TRUNC) {
char buf[PATH_MAX + 1];
/* dbm/ndbm original */
TRUNC_IT(".pag", O_TRUNC);
TRUNC_IT(".dir", O_TRUNC);
}
if(info->mode == DBA_CREAT) {
char buf[PATH_MAX + 1];
TRUNC_IT(".pag", 0);
TRUNC_IT(".dir", 0);
}
if(dbminit((char *) info->path) == -1) {
return FAILURE;
}
info->dbf = calloc(sizeof(dba_dbm_data), 1);
return SUCCESS;
}
DBA_CLOSE_FUNC(dbm)
{
free(info->dbf);
dbmclose();
}
DBA_FETCH_FUNC(dbm)
{
datum gval;
char *new = NULL;
DBM_GKEY;
gval = fetch(gkey);
if(gval.dptr) {
if(newlen) *newlen = gval.dsize;
new = estrndup(gval.dptr, gval.dsize);
}
return new;
}
DBA_UPDATE_FUNC(dbm)
{
datum gval;
DBM_GKEY;
gval.dptr = (char *) val;
gval.dsize = vallen;
return (store(gkey, gval) == -1 ? FAILURE : SUCCESS);
}
DBA_EXISTS_FUNC(dbm)
{
datum gval;
DBM_GKEY;
gval = fetch(gkey);
if(gval.dptr) {
return SUCCESS;
}
return FAILURE;
}
DBA_DELETE_FUNC(dbm)
{
DBM_GKEY;
return(delete(gkey) == -1 ? FAILURE : SUCCESS);
}
DBA_FIRSTKEY_FUNC(dbm)
{
DBM_DATA;
datum gkey;
char *key = NULL;
gkey = firstkey();
if(gkey.dptr) {
if(newlen) *newlen = gkey.dsize;
key = estrndup(gkey.dptr, gkey.dsize);
dba->nextkey = gkey;
} else
dba->nextkey.dptr = NULL;
return key;
}
DBA_NEXTKEY_FUNC(dbm)
{
DBM_DATA;
datum gkey;
char *nkey = NULL;
if(!dba->nextkey.dptr) return NULL;
gkey = nextkey(dba->nextkey);
if(gkey.dptr) {
if(newlen) *newlen = gkey.dsize;
nkey = estrndup(gkey.dptr, gkey.dsize);
dba->nextkey = gkey;
} else
dba->nextkey.dptr = NULL;
return nkey;
}
DBA_OPTIMIZE_FUNC(dbm)
{
/* dummy */
return SUCCESS;
}
DBA_SYNC_FUNC(dbm)
{
return SUCCESS;
}
#endif
-189
View File
@@ -1,189 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP HTML Embedded Scripting Language Version 3.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1999 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
| it under the terms of one of the following licenses: |
| |
| A) 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. |
| |
| B) the PHP License as published by the PHP Development Team and |
| included in the distribution in the file: LICENSE |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
| |
| You should have received a copy of both licenses referred to here. |
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
| Authors: Sascha Schumann <sas@schell.de> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "php.h"
#if DBA_GDBM
#include "php3_gdbm.h"
#include <gdbm.h>
#define GDBM_DATA dba_gdbm_data *dba = info->dbf
#define GDBM_GKEY datum gkey; gkey.dptr = (char *) key; gkey.dsize = keylen
typedef struct {
GDBM_FILE dbf;
datum nextkey;
} dba_gdbm_data;
DBA_OPEN_FUNC(gdbm)
{
GDBM_FILE dbf;
int gmode = 0;
int filemode = 0644;
gmode = info->mode == DBA_READER ? GDBM_READER :
info->mode == DBA_WRITER ? GDBM_WRITER :
info->mode == DBA_CREAT ? GDBM_WRCREAT :
info->mode == DBA_TRUNC ? GDBM_NEWDB : -1;
if(gmode == -1)
return FAILURE;
if(info->argc > 0) {
convert_to_long(info->argv[0]);
filemode = info->argv[0]->value.lval;
}
dbf = gdbm_open(info->path, 0, gmode, filemode, NULL);
if(dbf) {
info->dbf = malloc(sizeof(dba_gdbm_data));
memset(info->dbf, 0, sizeof(dba_gdbm_data));
((dba_gdbm_data *) info->dbf)->dbf = dbf;
return SUCCESS;
}
return FAILURE;
}
DBA_CLOSE_FUNC(gdbm)
{
GDBM_DATA;
if(dba->nextkey.dptr) free(dba->nextkey.dptr);
gdbm_close(dba->dbf);
free(dba);
}
DBA_FETCH_FUNC(gdbm)
{
GDBM_DATA;
datum gval;
char *new = NULL;
GDBM_GKEY;
gval = gdbm_fetch(dba->dbf, gkey);
if(gval.dptr) {
if(newlen) *newlen = gval.dsize;
new = estrndup(gval.dptr, gval.dsize);
free(gval.dptr);
}
return new;
}
DBA_UPDATE_FUNC(gdbm)
{
datum gval;
GDBM_DATA;
GDBM_GKEY;
gval.dptr = (char *) val;
gval.dsize = vallen;
if(gdbm_store(dba->dbf, gkey, gval,
mode == 1 ? GDBM_INSERT : GDBM_REPLACE) == 0)
return SUCCESS;
printf("XXX %s\n", gdbm_strerror(gdbm_errno));
return FAILURE;
}
DBA_EXISTS_FUNC(gdbm)
{
GDBM_DATA;
GDBM_GKEY;
return gdbm_exists(dba->dbf, gkey) ? SUCCESS : FAILURE;
}
DBA_DELETE_FUNC(gdbm)
{
GDBM_DATA;
GDBM_GKEY;
return gdbm_delete(dba->dbf, gkey) == -1 ? FAILURE : SUCCESS;
}
DBA_FIRSTKEY_FUNC(gdbm)
{
GDBM_DATA;
datum gkey;
char *key = NULL;
if(dba->nextkey.dptr) {
free(dba->nextkey.dptr);
}
gkey = gdbm_firstkey(dba->dbf);
if(gkey.dptr) {
key = estrndup(gkey.dptr, gkey.dsize);
if(newlen) *newlen = gkey.dsize;
dba->nextkey = gkey;
} else {
dba->nextkey.dptr = NULL;
}
return key;
}
DBA_NEXTKEY_FUNC(gdbm)
{
GDBM_DATA;
char *nkey = NULL;
datum gkey;
if(!dba->nextkey.dptr) return NULL;
gkey = gdbm_nextkey(dba->dbf, dba->nextkey);
free(dba->nextkey.dptr);
if(gkey.dptr) {
nkey = estrndup(gkey.dptr, gkey.dsize);
if(newlen) *newlen = gkey.dsize;
dba->nextkey = gkey;
} else {
dba->nextkey.dptr = NULL;
}
return nkey;
}
DBA_OPTIMIZE_FUNC(gdbm)
{
GDBM_DATA;
gdbm_reorganize(dba->dbf);
return SUCCESS;
}
DBA_SYNC_FUNC(gdbm)
{
GDBM_DATA;
gdbm_sync(dba->dbf);
return SUCCESS;
}
#endif
-169
View File
@@ -1,169 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP HTML Embedded Scripting Language Version 3.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1999 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
| it under the terms of one of the following licenses: |
| |
| A) 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. |
| |
| B) the PHP License as published by the PHP Development Team and |
| included in the distribution in the file: LICENSE |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
| |
| You should have received a copy of both licenses referred to here. |
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
| Authors: Sascha Schumann <sas@schell.de> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "php.h"
#if DBA_NDBM
#include "php3_ndbm.h"
#include <fcntl.h>
#if NDBM_DB1_NDBM_H
#include <db1/ndbm.h>
#elif NDBM_NDBM_H
#include <ndbm.h>
#endif
#define NDBM_GKEY datum gkey; gkey.dptr = (char *) key; gkey.dsize = keylen
DBA_OPEN_FUNC(ndbm)
{
DBM *dbf;
int gmode = 0;
int filemode = 0644;
dba_info *pinfo = (dba_info *) info;
switch(info->mode) {
case DBA_READER:
gmode = O_RDONLY;
break;
case DBA_WRITER:
gmode = O_RDWR;
break;
case DBA_CREAT:
gmode = O_RDWR | O_CREAT;
break;
case DBA_TRUNC:
gmode = O_RDWR | O_CREAT | O_TRUNC;
break;
default:
return FAILURE;
}
if(info->argc > 0) {
convert_to_long(info->argv[0]);
filemode = info->argv[0]->value.lval;
}
dbf = dbm_open(info->path, gmode, filemode);
if(dbf) {
pinfo->dbf = dbf;
return SUCCESS;
}
return FAILURE;
}
DBA_CLOSE_FUNC(ndbm)
{
dbm_close(info->dbf);
}
DBA_FETCH_FUNC(ndbm)
{
datum gval;
char *new = NULL;
NDBM_GKEY;
gval = dbm_fetch(info->dbf, gkey);
if(gval.dptr) {
if(newlen) *newlen = gval.dsize;
new = estrndup(gval.dptr, gval.dsize);
}
return new;
}
DBA_UPDATE_FUNC(ndbm)
{
datum gval;
NDBM_GKEY;
gval.dptr = (char *) val;
gval.dsize = vallen;
if(!dbm_store(info->dbf, gkey, gval, mode == 1 ? DBM_INSERT : DBM_REPLACE))
return SUCCESS;
return FAILURE;
}
DBA_EXISTS_FUNC(ndbm)
{
datum gval;
NDBM_GKEY;
gval = dbm_fetch(info->dbf, gkey);
if(gval.dptr) {
return SUCCESS;
}
return FAILURE;
}
DBA_DELETE_FUNC(ndbm)
{
NDBM_GKEY;
return(dbm_delete(info->dbf, gkey) == -1 ? FAILURE : SUCCESS);
}
DBA_FIRSTKEY_FUNC(ndbm)
{
datum gkey;
char *key = NULL;
gkey = dbm_firstkey(info->dbf);
if(gkey.dptr) {
if(newlen) *newlen = gkey.dsize;
key = estrndup(gkey.dptr, gkey.dsize);
}
return key;
}
DBA_NEXTKEY_FUNC(ndbm)
{
datum gkey;
char *nkey = NULL;
gkey = dbm_nextkey(info->dbf);
if(gkey.dptr) {
if(newlen) *newlen = gkey.dsize;
nkey = estrndup(gkey.dptr, gkey.dsize);
}
return nkey;
}
DBA_OPTIMIZE_FUNC(ndbm)
{
return SUCCESS;
}
DBA_SYNC_FUNC(ndbm)
{
return SUCCESS;
}
#endif
-12
View File
@@ -1,12 +0,0 @@
#ifndef _PHP3_CDB_H
#define _PHP3_CDB_H
#if DBA_CDB
#include "php3_dba.h"
DBA_FUNCS(cdb);
#endif
#endif
-12
View File
@@ -1,12 +0,0 @@
#ifndef _PHP3_DB2_H
#define _PHP3_DB2_H
#if DBA_DB2
#include "php3_dba.h"
DBA_FUNCS(db2);
#endif
#endif
-115
View File
@@ -1,115 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP HTML Embedded Scripting Language Version 3.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-1999 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
| it under the terms of one of the following licenses: |
| |
| A) 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. |
| |
| B) the PHP License as published by the PHP Development Team and |
| included in the distribution in the file: LICENSE |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
| |
| You should have received a copy of both licenses referred to here. |
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
| Authors: Sascha Schumann <sas@schell.de> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef _DBA_H
#define _DBA_H
#if HAVE_DBA
typedef enum {
DBA_READER = 1,
DBA_WRITER,
DBA_TRUNC,
DBA_CREAT
} dba_mode_t;
typedef struct dba_info {
/* public */
void *dbf; /* ptr to private data or whatever */
char *path;
dba_mode_t mode;
/* arg[cv] are only available when the dba_open handler is called! */
int argc;
pval **argv;
/* private */
struct dba_handler *hnd;
} dba_info;
extern php3_module_entry dba_module_entry;
#define dba_module_ptr &dba_module_entry
/* common prototypes which must be supplied by modules */
#define DBA_OPEN_FUNC(x) \
int dba_open_##x(dba_info *info)
#define DBA_CLOSE_FUNC(x) \
void dba_close_##x(dba_info *info)
#define DBA_FETCH_FUNC(x) \
char *dba_fetch_##x(dba_info *info, char *key, int keylen, int *newlen)
#define DBA_UPDATE_FUNC(x) \
int dba_update_##x(dba_info *info, char *key, int keylen, char *val, int vallen, int mode)
#define DBA_EXISTS_FUNC(x) \
int dba_exists_##x(dba_info *info, char *key, int keylen)
#define DBA_DELETE_FUNC(x) \
int dba_delete_##x(dba_info *info, char *key, int keylen)
#define DBA_FIRSTKEY_FUNC(x) \
char *dba_firstkey_##x(dba_info *info, int *newlen)
#define DBA_NEXTKEY_FUNC(x) \
char *dba_nextkey_##x(dba_info *info, int *newlen)
#define DBA_OPTIMIZE_FUNC(x) \
int dba_optimize_##x(dba_info *info)
#define DBA_SYNC_FUNC(x) \
int dba_sync_##x(dba_info *info)
#define DBA_FUNCS(x) \
DBA_OPEN_FUNC(x); \
DBA_CLOSE_FUNC(x); \
DBA_FETCH_FUNC(x); \
DBA_UPDATE_FUNC(x); \
DBA_DELETE_FUNC(x); \
DBA_EXISTS_FUNC(x); \
DBA_FIRSTKEY_FUNC(x); \
DBA_NEXTKEY_FUNC(x); \
DBA_OPTIMIZE_FUNC(x); \
DBA_SYNC_FUNC(x)
#define VALLEN(p) (p)->value.str.val, (p)->value.str.len
PHP_FUNCTION(dba_open);
PHP_FUNCTION(dba_popen);
PHP_FUNCTION(dba_close);
PHP_FUNCTION(dba_firstkey);
PHP_FUNCTION(dba_nextkey);
PHP_FUNCTION(dba_replace);
PHP_FUNCTION(dba_insert);
PHP_FUNCTION(dba_delete);
PHP_FUNCTION(dba_exists);
PHP_FUNCTION(dba_fetch);
PHP_FUNCTION(dba_optimize);
PHP_FUNCTION(dba_sync);
#else
#define dba_module_ptr NULL
#endif
#define phpext_dba_ptr dba_module_ptr
#endif
-12
View File
@@ -1,12 +0,0 @@
#ifndef _PHP3_DBM_H
#define _PHP3_DBM_H
#if DBA_DBM
#include "php3_dba.h"
DBA_FUNCS(dbm);
#endif
#endif
-12
View File
@@ -1,12 +0,0 @@
#ifndef _PHP3_GDBM_H
#define _PHP3_GDBM_H
#if DBA_GDBM
#include "php3_dba.h"
DBA_FUNCS(gdbm);
#endif
#endif
-12
View File
@@ -1,12 +0,0 @@
#ifndef _PHP3_NDBM_H
#define _PHP3_NDBM_H
#if DBA_NDBM
#include "php3_dba.h"
DBA_FUNCS(ndbm);
#endif
#endif
-6
View File
@@ -1,6 +0,0 @@
# $Source$
# $Id$
define_option with-dba 'dba support?' yesnodir no \
' Whether to build the dba extension.'
+1 -1
View File
@@ -28,7 +28,7 @@
#endif
#include "php.h"
#include "ext/standard/head.h"
#include "head.h"
#include <math.h>
#include "php3_fdf.h"
+128
View File
@@ -0,0 +1,128 @@
/****************************************************************************
*
* Copyright (C) 1991 Kendall Bennett.
* All rights reserved.
*
* Filename: $RCSfile$
* Version: $Revision$
*
* Language: ANSI C
* Environment: any
*
* Description: Header file for doubly linked list routines.
*
* $Id$
*
* Revision History:
* -----------------
*
* $Log$
* Revision 1.1.1.1 1999/04/07 21:03:20 zeev
* PHP 4.0
*
* Revision 1.1.1.1 1999/03/17 04:29:11 andi
* PHP4
*
* Revision 1.1.1.1 1998/12/21 07:56:22 andi
* Trying to start the zend CVS tree
*
* Revision 1.2 1998/08/14 15:51:12 shane
* Some work on getting hyperwave to work on windows. hg_comm needs a lot of work.
*
* Mainly, signals, fnctl, bzero, bcopy, etc are not portable functions. Most of this
* will have to be rewriten for windows.
*
* Revision 1.1 1998/08/12 09:29:16 steinm
* First version of Hyperwave module.
*
* Revision 1.5 91/12/31 19:40:54 kjb
*
* Modified include files directories.
*
* Revision 1.4 91/09/27 03:10:41 kjb
* Added compatibility with C++.
*
* Revision 1.3 91/09/26 10:07:16 kjb
* Took out extern references
*
* Revision 1.2 91/09/01 19:37:20 ROOT_DOS
* Changed DLST_TAIL macro so that it returns a pointer to the REAL last
* node of the list, not the dummy last node (l->z).
*
* Revision 1.1 91/09/01 18:38:23 ROOT_DOS
* Initial revision
*
****************************************************************************/
#ifndef __DLIST_H
#define __DLIST_H
#ifndef __DEBUG_H
/*#include "debug.h"*/
#endif
/*---------------------- Macros and type definitions ----------------------*/
typedef struct DLST_BUCKET {
struct DLST_BUCKET *next;
struct DLST_BUCKET *prev;
} DLST_BUCKET;
typedef struct {
int count; /* Number of elements currently in list */
DLST_BUCKET *head; /* Pointer to head element of list */
DLST_BUCKET *z; /* Pointer to last node of list */
DLST_BUCKET hz[2]; /* Space for head and z nodes */
} DLIST;
/* Return a pointer to the user space given the address of the header of
* a node.
*/
#define DLST_USERSPACE(h) ((void*)((DLST_BUCKET*)(h) + 1))
/* Return a pointer to the header of a node, given the address of the
* user space.
*/
#define DLST_HEADER(n) ((DLST_BUCKET*)(n) - 1)
/* Return a pointer to the user space of the list's head node. This user
* space does not actually exist, but it is useful to be able to address
* it to enable insertion at the start of the list.
*/
#define DLST_HEAD(l) DLST_USERSPACE((l)->head)
/* Return a pointer to the user space of the last node in list. */
#define DLST_TAIL(l) DLST_USERSPACE((l)->z->prev)
/* Determine if a list is empty
*/
#define DLST_EMPTY(l) ((l)->count == 0)
/*-------------------------- Function Prototypes --------------------------*/
#ifdef __cplusplus
extern "C" {
#endif
void *dlst_newnode(int size);
void dlst_freenode(void *node);
DLIST *dlst_init(void);
void dlst_kill(DLIST *l,void (*freeNode)(void *node));
void dlst_insertafter(DLIST *l,void *node,void *after);
void *dlst_deletenext(DLIST *l,void *node);
void *dlst_first(DLIST *l);
void *dlst_last(DLIST *l);
void *dlst_next(void *prev);
void *dlst_prev(void *next);
void dlst_mergesort(DLIST *l,int (*cmp_func)(void*,void*));
#ifdef __cplusplus
}
#endif
#endif
+413
View File
@@ -0,0 +1,413 @@
/****************************************************************************
*
* Copyright (C) 1991 Kendall Bennett.
* All rights reserved.
*
* Filename: $RCSfile$
* Version: $Revision$
*
* Language: ANSI C
* Environment: any
*
* Description: Module to implement doubly linked lists. Includes a routine
* to peform a mergesort on the doubly linked list.
*
* $Id$
*
* Revision History:
* -----------------
*
* $Log$
* Revision 1.1 1999/04/21 23:11:20 ssb
* moved apache, com and hyperwave into ext/
*
* Revision 1.1.1.1 1999/04/07 21:03:31 zeev
* PHP 4.0
*
* Revision 1.1.1.1 1999/03/17 04:29:11 andi
* PHP4
*
* Revision 1.1.1.1 1998/12/21 07:56:22 andi
* Trying to start the zend CVS tree
*
* Revision 1.1 1998/08/12 09:29:16 steinm
* First version of Hyperwave module.
*
* Revision 1.5 91/12/31 19:39:49 kjb
* Modified include file directories.
*
* Revision 1.4 91/10/28 03:16:39 kjb
* Ported to the Iris.
*
* Revision 1.3 91/09/27 03:09:18 kjb
* Cosmetic change.
*
* Revision 1.2 91/09/03 18:27:42 ROOT_DOS
* Ported to UNIX.
*
* Revision 1.1 91/09/01 18:35:23 ROOT_DOS
* Initial revision
*
****************************************************************************/
#ifndef MSVC5
#include "php_config.h"
#endif
#if HYPERWAVE
#include <stdio.h>
#include <malloc.h>
#include <signal.h>
#include "debug.h"
#include "DList.h"
PUBLIC void *dlst_newnode(int size)
/****************************************************************************
*
* Function: dlst_newnode
* Parameters: size - Amount of memory to allocate for node
* Returns: Pointer to the allocated node's user space.
*
* Description: Allocates the memory required for a node, adding a small
* header at the start of the node. We return a reference to
* the user space of the node, as if it had been allocated via
* malloc().
*
****************************************************************************/
{
DLST_BUCKET *node;
if ( !(node = (DLST_BUCKET*)malloc(size + sizeof(DLST_BUCKET))) ) {
fprintf(stderr,"Not enough memory to allocate list node.\n");
/* raise(SIGABRT);*/
return NULL;
}
return DLST_USERSPACE(node); /* Return pointer to user space */
}
PUBLIC void dlst_freenode(void *node)
/****************************************************************************
*
* Function: dlst_freenode
* Parameters: node - Node to free.
*
* Description: Frees a node previously allocated with lst_newnode().
*
****************************************************************************/
{
free(DLST_HEADER(node));
}
PUBLIC DLIST *dlst_init(void)
/****************************************************************************
*
* Function: dlst_init
* Returns: Pointer to a newly created list.
*
* Description: Initialises a list and returns a pointer to it.
*
****************************************************************************/
{
DLIST *l;
if ((l = (DLIST*)malloc(sizeof(DLIST))) != NULL) {
l->count = 0;
l->head = &(l->hz[0]);
l->z = &(l->hz[1]);
l->head->next = l->z->next = l->z;
l->z->prev = l->head->prev = l->head;
}
else {
fprintf(stderr,"Insufficient memory to allocate list\n");
/*raise(SIGABRT);*/
return NULL;
}
return l;
}
PUBLIC void dlst_kill(DLIST *l,void (*freeNode)(void *node))
/****************************************************************************
*
* Function: dlst_kill
* Parameters: l - List to kill
* freeNode - Pointer to user routine to free a node
*
* Description: Kills the list l, by deleting all of the elements contained
* within the list one by one and then deleting the list
* itself. Note that we call the user supplied routine
* (*freeNode)() to free each list node. This allows the user
* program to perform any extra processing needed to kill each
* node (if each node contains pointers to other items on the
* heap for example). If no extra processing is required, just
* pass the address of dlst_freenode(), ie:
*
* dlst_kill(myList,dlst_freenode);
*
****************************************************************************/
{
DLST_BUCKET *n,*p;
n = l->head->next;
while (n != l->z) { /* Free all nodes in list */
p = n;
n = n->next;
(*freeNode)(DLST_USERSPACE(p));
}
free(l); /* Free the list itself */
}
PUBLIC void dlst_insertafter(DLIST *l,void *node,void *after)
/****************************************************************************
*
* Function: lst_insertafter
* Parameters: l - List to insert node into
* node - Pointer to user space of node to insert
* after - Pointer to user space of node to insert node after
*
* Description: Inserts a new node into the list after the node 'after'. To
* insert a new node at the beginning of the list, user the
* macro DLST_HEAD in place of 'after'. ie:
*
* dlst_insertafter(mylist,node,DLST_HEAD(mylist));
*
****************************************************************************/
{
DLST_BUCKET *n = DLST_HEADER(node),*a = DLST_HEADER(after);
n->next = a->next;
a->next = n;
n->prev = a;
n->next->prev = n;
l->count++;
}
PUBLIC void *dlst_deletenext(DLIST *l,void *node)
/****************************************************************************
*
* Function: lst_deletenext
* Parameters: l - List to delete node from.
* node - Node to delete the next node from
* Returns: Pointer to the deleted node's userspace.
*
* Description: Removes the node AFTER 'node' from the list l.
*
****************************************************************************/
{
DLST_BUCKET *n = DLST_HEADER(node);
node = DLST_USERSPACE(n->next);
n->next->next->prev = n;
n->next = n->next->next;
l->count--;
return node;
}
PUBLIC void *dlst_first(DLIST *l)
/****************************************************************************
*
* Function: dlst_first
* Parameters: l - List to obtain first node from
* Returns: Pointer to first node in list, NULL if list is empty.
*
* Description: Returns a pointer to the user space of the first node in
* the list. If the list is empty, we return NULL.
*
****************************************************************************/
{
DLST_BUCKET *n;
n = l->head->next;
return (n == l->z ? NULL : DLST_USERSPACE(n));
}
PUBLIC void *dlst_last(DLIST *l)
/****************************************************************************
*
* Function: dlst_last
* Parameters: l - List to obtain last node from
* Returns: Pointer to last node in list, NULL if list is empty.
*
* Description: Returns a pointer to the user space of the last node in
* the list. If the list is empty, we return NULL.
*
****************************************************************************/
{
DLST_BUCKET *n;
n = l->z->prev;
return (n == l->head ? NULL : DLST_USERSPACE(n));
}
PUBLIC void *dlst_next(void *prev)
/****************************************************************************
*
* Function: dlst_next
* Parameters: prev - Previous node in list to obtain next node from
* Returns: Pointer to the next node in the list, NULL at end of list.
*
* Description: Returns a pointer to the user space of the next node in the
* list given a pointer to the user space of the previous node.
* If we have reached the end of the list, we return NULL. The
* end of the list is detected when the next pointer of a node
* points back to itself, as does the dummy last node's next
* pointer. This enables us to detect the end of the list
* without needed access to the list data structure itself.
*
* NOTE: We do no checking to ensure that 'prev' is NOT a
* NULL pointer.
*
****************************************************************************/
{
DLST_BUCKET *n = DLST_HEADER(prev);
n = n->next;
return (n == n->next ? NULL : DLST_USERSPACE(n));
}
PUBLIC void *dlst_prev(void *next)
/****************************************************************************
*
* Function: dlst_prev
* Parameters: next - Next node in list to obtain previous node from
* Returns: Pointer to the previous node in the list, NULL at start list.
*
* Description: Returns a pointer to the user space of the prev node in the
* list given a pointer to the user space of the next node.
* If we have reached the start of the list, we return NULL. The
* start of the list is detected when the prev pointer of a node
* points back to itself, as does the dummy head node's prev
* pointer. This enables us to detect the start of the list
* without needed access to the list data structure itself.
*
* NOTE: We do no checking to ensure that 'next' is NOT a
* NULL pointer.
*
****************************************************************************/
{
DLST_BUCKET *n = DLST_HEADER(next);
n = n->prev;
return (n == n->prev ? NULL : DLST_USERSPACE(n));
}
/* Static globals required by merge() */
static DLST_BUCKET *z;
static int (*cmp)(void*,void*);
PRIVATE DLST_BUCKET *merge(DLST_BUCKET *a,DLST_BUCKET *b,DLST_BUCKET **end)
/****************************************************************************
*
* Function: merge
* Parameters: a,b - Sublist's to merge
* Returns: Pointer to the merged sublists.
*
* Description: Merges two sorted lists of nodes together into a single
* sorted list.
*
****************************************************************************/
{
DLST_BUCKET *c;
/* Go through the lists, merging them together in sorted order */
c = z;
while (a != z && b != z) {
if ((*cmp)(DLST_USERSPACE(a),DLST_USERSPACE(b)) <= 0) {
c->next = a; c = a; a = a->next;
}
else {
c->next = b; c = b; b = b->next;
}
};
/* If one of the lists is not exhausted, then re-attach it to the end
* of the newly merged list
*/
if (a != z) c->next = a;
if (b != z) c->next = b;
/* Set *end to point to the end of the newly merged list */
while (c->next != z) c = c->next;
*end = c;
/* Determine the start of the merged lists, and reset z to point to
* itself
*/
c = z->next; z->next = z;
return c;
}
PUBLIC void dlst_mergesort(DLIST *l,int (*cmp_func)(void*,void*))
/****************************************************************************
*
* Function: dlst_mergesort
* Parameters: l - List to merge sort
* cmp_func - Function to compare two user spaces
*
* Description: Mergesort's all the nodes in the list. 'cmp' must point to
* a comparison function that can compare the user spaces of
* two different nodes. 'cmp' should work the same as
* strcmp(), in terms of the values it returns. Rather than
* waste processing time keeping the previous pointers up to
* date while performing the mergesort, we simply run through
* the list at the end of the sort to fix the previous pointers.
*
****************************************************************************/
{
int i,N;
DLST_BUCKET *a,*b; /* Pointers to sublists to merge */
DLST_BUCKET *c; /* Pointer to end of sorted sublists */
DLST_BUCKET *head; /* Pointer to dummy head node for list */
DLST_BUCKET *todo; /* Pointer to sublists yet to be sorted */
DLST_BUCKET *t; /* Temporary */
/* Set up globals required by merge() and pointer to head */
z = l->z; cmp = cmp_func; head = l->head;
for (N = 1,a = z; a != head->next; N = N + N) {
todo = head->next; c = head;
while (todo != z) {
/* Build first sublist to be merged, and splice from main list
*/
a = t = todo;
for (i = 1; i < N; i++) t = t->next;
b = t->next; t->next = z; t = b;
/* Build second sublist to be merged and splice from main list
*/
for (i = 1; i < N; i++) t = t->next;
todo = t->next; t->next = z;
/* Merge the two sublists created, and set 'c' to point to the
* end of the newly merged sublists.
*/
c->next = merge(a,b,&t); c = t;
}
}
/* Fix the previous pointers for the list */
a = b = l->head;
b = b->next;
while (1) {
b->prev = a;
if (b == z)
break;
a = a->next;
b = b->next;
}
}
#endif
-4
View File
@@ -11,16 +11,12 @@ AC_ARG_WITH(imap,
withval=/usr
elif test -f /usr/include/imap/mail.h; then
withval=/usr
elif test -f /usr/include/c-client/mail.h; then
withval=/usr
fi
fi
if test "$withval" != "no" && test "$withval" != "yes"; then
IMAP_DIR=$withval
if test -f $IMAP_DIR/include/imap/mail.h; then
IMAP_INC_DIR=$IMAP_DIR/include/imap
elif test -f $IMAP_DIR/include/c-client/mail.h; then
IMAP_INC_DIR=$IMAP_DIR/include/c-client
else
IMAP_INC_DIR=$withval/include
fi
+438 -327
View File
File diff suppressed because it is too large. Load diff
+17 -49
View File
@@ -40,36 +40,22 @@
#define HAVE_IFX 1
#endif
#if WIN32||WINNT
#define PHP_IFX_API __declspec(dllexport)
#else
#define PHP_IFX_API
#endif
#if HAVE_IFX /* with Informix */
#if HAVE_IFX
#ifndef DLEXPORT
#define DLEXPORT
#endif
#ifdef ZTS
#include "TSRM.h"
#endif
#include "locator.h"
#include "sqltypes.h"
extern php3_module_entry ifx_module_entry;
#define ifx_module_ptr &ifx_module_entry
#include "locator.h"
#include "sqltypes.h"
/* user functions */
extern int php3_minit_ifx(INIT_FUNC_ARGS);
extern int php3_rinit_ifx(INIT_FUNC_ARGS);
extern int php3_mshutdown_ifx(SHUTDOWN_FUNC_ARGS);
void php3_info_ifx(ZEND_MODULE_INFO_FUNC_ARGS);
/* functions common to all Informix versions */
PHP_FUNCTION(ifx_connect);
PHP_FUNCTION(ifx_pconnect);
PHP_FUNCTION(ifx_close);
@@ -87,7 +73,7 @@ PHP_FUNCTION(ifx_htmltbl_result);
PHP_FUNCTION(ifx_fieldtypes);
PHP_FUNCTION(ifx_fieldproperties);
PHP_FUNCTION(ifx_getsqlca);
/* BLOB related stuff, IDS & IUS only */
PHP_FUNCTION(ifx_create_blob);
PHP_FUNCTION(ifx_free_blob) ;
PHP_FUNCTION(ifx_get_blob);
@@ -97,12 +83,13 @@ PHP_FUNCTION(ifx_copy_blob);
PHP_FUNCTION(ifx_textasvarchar);
PHP_FUNCTION(ifx_byteasvarchar);
PHP_FUNCTION(ifx_nullformat);
PHP_FUNCTION(ifx_create_char);
PHP_FUNCTION(ifx_free_char) ;
PHP_FUNCTION(ifx_update_char);
PHP_FUNCTION(ifx_get_char);
/* SLOB, CLOB : IUS only functions */
#if HAVE_IFX_IUS
PHP_FUNCTION(ifxus_create_slob);
PHP_FUNCTION(ifxus_free_slob) ;
@@ -131,36 +118,11 @@ typedef struct {
long nullformat; /* 0=NULL as "", 1= NULL as "NULL" */
char *nullvalue; /* "" */
char *nullstring; /* "NULL" */
} php_ifx_globals; /* formerly "ifx_module" in the php3 version */
#ifndef ZTS
extern php_ifx_globals ifx_globals;
#endif
#ifdef ZTS
# define IFXLS_D php_ifx_globals *ifx_globals
# define IFXLS_DC , IFXLS_D
# define IFXLS_C ifx_globals
# define IFXLS_CC , IFXLS_C
# define IFXG(v) (ifx_globals->v)
# define IFXLS_FETCH() php_ifx_globals *ifx_globals = ts_resource(ifx_globals_id)
# define IFX_TLS_VARS char *globals; IFXLS_FETCH(); globals = (char *)ifx_globals;
#else
# define IFXLS_D
# define IFXLS_DC
# define IFXLS_C
# define IFXLS_CC
# define IFXG(v) (ifx_globals.v)
# define IFXLS_FETCH()
# define IFX_TLS_VARS char *globals = (char *)&ifx_globals
extern ZEND_API php_ifx_globals ifx_globals;
#endif
} ifx_module;
#define MAX_RESID 64
#define BLOBINFILE 0 /* 0=in memory, 1=in file */
/* query result set data */
typedef struct ifx_res {
char connecid[16];
char cursorid[16];
@@ -212,12 +174,18 @@ typedef struct _IFX_IDRES {
#endif
#else /* not HAVE_IFX */
#ifndef THREAD_SAFE
extern ifx_module php3_ifx_module;
#endif
#else
#define ifx_module_ptr NULL
#endif
#define phpext_informix_ptr ifx_module_ptr
#endif /* _PHP3_IFX_H */
+1 -1
View File
@@ -6,7 +6,7 @@ dnl
AC_DEFUN(AC_MSQL_VERSION,[
AC_MSG_CHECKING([mSQL version])
ac_php_oldcflags=$CFLAGS
CFLAGS="$INCLUDES $CFLAGS"
CFLAGS="$INCLUDES $CFLAGS";
AC_TRY_COMPILE([#include <sys/types.h>
#include "msql.h"],[int i = IDX_TYPE],[
AC_DEFINE(MSQL1,0)
+1 -2
View File
@@ -450,8 +450,7 @@ static int php3_msql_get_default_link(INTERNAL_FUNCTION_PARAMETERS)
{
MSQL_TLS_VARS;
if (MSQL_GLOBAL(php3_msql_module).default_link==-1) { /* no link opened yet, implicitly open one */
ht = 0;
php3_msql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
php3_msql_do_connect(0, return_value, list, plist, this_ptr,0);
}
return MSQL_GLOBAL(php3_msql_module).default_link;
}
+2 -3
View File
@@ -587,7 +587,6 @@ static void php3_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
static int php3_mysql_get_default_link(INTERNAL_FUNCTION_PARAMETERS MySLS_DC)
{
if (MySG(default_link)==-1) { /* no link opened yet, implicitly open one */
ht = 0;
php3_mysql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
return MySG(default_link);
@@ -1473,7 +1472,7 @@ PHP_FUNCTION(mysql_fetch_row)
/* }}} */
/* {{{ proto object mysql_fetch_object(int result [, int result_type])
/* {{{ proto object mysql_fetch_object(int result)
Fetch a result row as an object */
PHP_FUNCTION(mysql_fetch_object)
{
@@ -1487,7 +1486,7 @@ PHP_FUNCTION(mysql_fetch_object)
/* }}} */
/* {{{ proto array mysql_fetch_array(int result [, int result_type])
/* {{{ proto array mysql_fetch_array(int result)
Fetch a result row as an associative array */
PHP_FUNCTION(mysql_fetch_array)
{
-26
View File
@@ -1,26 +0,0 @@
dnl $Id$
dnl config.m4 for extension pcre
dnl By default we'll compile and link against the bundled PCRE library
dnl if DIR is supplied, we'll use that for linking
AC_MSG_CHECKING(whether to include PCRE support)
AC_ARG_WITH(pcre-regex,
[ --without-pcre-regex Don't include Perl Compatible Regular Expressions support],[
if test "$withval" = "yes"; then
EXTRA_LIBS="-L$abs_builddir/ext/pcre/pcrelib -lpcre $EXTRA_LIBS"
PCRE_SUBDIR="pcrelib"
AC_DEFINE(HAVE_PCRE, 1)
AC_MSG_RESULT(yes)
PHP_EXTENSION(pcre)
else
AC_MSG_RESULT(no)
fi
],[
EXTRA_LIBS="-L$abs_builddir/ext/pcre/pcrelib -lpcre $EXTRA_LIBS"
PCRE_SUBDIR="pcrelib"
AC_DEFINE(HAVE_PCRE, 1)
AC_MSG_RESULT(yes)
PHP_EXTENSION(pcre)
])
AC_SUBST(PCRE_SUBDIR)
+6 -28
View File
@@ -77,9 +77,6 @@ static int _php_free_pcre_cache(void *data)
{
pcre_cache_entry *pce = (pcre_cache_entry *) data;
pefree(pce->re, 1);
#if HAVE_SETLOCALE
pefree((void*)pce->tables, 1);
#endif
return 1;
}
@@ -166,10 +163,6 @@ static pcre* _pcre_get_compiled_regex(char *regex, pcre_extra *extra, int *preg_
int regex_len;
int do_study = 0;
int poptions = 0;
unsigned const char *tables = NULL;
#if HAVE_SETLOCALE
char *locale = setlocale(LC_CTYPE, NULL);
#endif
pcre_cache_entry *pce;
pcre_cache_entry new_entry;
PCRE_LS_FETCH();
@@ -178,15 +171,9 @@ static pcre* _pcre_get_compiled_regex(char *regex, pcre_extra *extra, int *preg_
back the compiled pattern, otherwise go on and compile it. */
regex_len = strlen(regex);
if (zend_hash_find(&PCRE_G(pcre_cache), regex, regex_len+1, (void **)&pce) == SUCCESS) {
#if HAVE_SETLOCALE
if (!strcmp(pce->locale, locale)) {
#endif
extra = pce->extra;
*preg_options = pce->preg_options;
return pce->re;
#if HAVE_SETLOCALE
}
#endif
extra = pce->extra;
*preg_options = pce->preg_options;
return pce->re;
}
p = regex;
@@ -231,7 +218,7 @@ static pcre* _pcre_get_compiled_regex(char *regex, pcre_extra *extra, int *preg_
*preg_options = 0;
/* Parse through the options, setting appropriate flags. Display
a warning if we encounter an unknown modifier. */
a warning if we encounter an unknown option. */
while (*pp != 0) {
switch (*pp++) {
/* Perl compatible options */
@@ -255,23 +242,18 @@ static pcre* _pcre_get_compiled_regex(char *regex, pcre_extra *extra, int *preg_
break;
default:
zend_error(E_WARNING, "Unknown modifier '%c'", pp[-1]);
zend_error(E_WARNING, "Unknown option '%c'", pp[-1]);
efree(pattern);
return NULL;
}
}
#if HAVE_SETLOCALE
if (strcmp(locale, "C"))
tables = pcre_maketables();
#endif
/* Compile pattern and display a warning if compilation failed. */
re = pcre_compile(pattern,
coptions,
&error,
&erroffset,
tables);
NULL);
if (re == NULL) {
zend_error(E_WARNING, "Compilation failed: %s at offset %d\n", error, erroffset);
@@ -296,10 +278,6 @@ static pcre* _pcre_get_compiled_regex(char *regex, pcre_extra *extra, int *preg_
new_entry.re = re;
new_entry.extra = extra;
new_entry.preg_options = poptions;
#if HAVE_SETLOCALE
new_entry.locale = locale;
new_entry.tables = tables;
#endif
zend_hash_update(&PCRE_G(pcre_cache), regex, regex_len+1, (void *)&new_entry,
sizeof(pcre_cache_entry), NULL);
-7
View File
@@ -35,9 +35,6 @@
#if HAVE_PCRE
#include "pcrelib/pcre.h"
#if HAVE_LOCALE_H
#include <locale.h>
#endif
extern void php_info_pcre(ZEND_MODULE_INFO_FUNC_ARGS);
extern int php_minit_pcre(INIT_FUNC_ARGS);
@@ -58,10 +55,6 @@ typedef struct {
pcre *re;
pcre_extra *extra;
int preg_options;
#if HAVE_SETLOCALE
char *locale;
unsigned const char *tables;
#endif
} pcre_cache_entry;
typedef struct {
-1
View File
@@ -12,7 +12,6 @@ AC_ARG_WITH(pgsql,
else
PGSQL_INCDIR=$withval/include
test -d $withval/include/pgsql && PGSQL_INCDIR=$withval/include/pgsql
test -d $withval/include/postgresql && PGSQL_INCDIR=$withval/include/postgresql
PGSQL_LIBDIR=$withval/lib
test -d $withval/lib/pgsql && PGSQL_LIBDIR=$withval/lib/pgsql
fi
+6 -4
View File
@@ -351,13 +351,15 @@ void php3_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
int php3_pgsql_get_default_link(INTERNAL_FUNCTION_PARAMETERS)
{
if (php3_pgsql_module.default_link==-1) { /* no link opened yet, implicitly open one */
ht = 0;
HashTable tmp;
_php3_hash_init(&tmp,0,NULL,NULL,0);
php3_pgsql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,0);
_php3_hash_destroy(&tmp);
}
return php3_pgsql_module.default_link;
}
/* {{{ proto int pg_connect([string connection_string] | [string host, string port, [string options, [string tty,]] string database)
Open a PostgreSQL connection */
PHP_FUNCTION(pgsql_connect)
@@ -953,7 +955,7 @@ PHP_FUNCTION(pgsql_fetch_row)
/* }}} */
/* ?? This is a rather odd function - why not just point pg_fetcharray() directly at fetch_hash ? -RL */
/* {{{ proto array pg_fetch_array(int result, int row [, int result_type])
/* {{{ proto array pg_fetch_array(int result, int row)
Fetch a row as an array */
PHP_FUNCTION(pgsql_fetch_array)
{
@@ -961,7 +963,7 @@ PHP_FUNCTION(pgsql_fetch_array)
}
/* }}} */
/* {{{ proto object pg_fetch_object(int result, int row [, int result_type])
/* {{{ proto object pg_fetch_object(int result, int row)
Fetch a row as an object */
PHP_FUNCTION(pgsql_fetch_object)
{
+2 -20
View File
@@ -13,7 +13,6 @@
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Sascha Schumann <ss@2ns.de> |
| Andrey Zmievski <andrey@ispi.net> |
+----------------------------------------------------------------------+
*/
@@ -327,21 +326,17 @@ static void _php_session_start(PSLS_D)
{
pval **ppid;
pval **data;
char *p;
int send_cookie = 1;
int define_sid = 1;
int module_number = PS(module_number);
int nrand;
int lensess;
ELS_FETCH();
if (PS(nr_open_sessions) > 0) return;
lensess = strlen(PS(session_name));
if(!PS(id) &&
zend_hash_find(&EG(symbol_table), PS(session_name),
lensess + 1, (void **) &ppid) == SUCCESS) {
strlen(PS(session_name)) + 1, (void **) &ppid) == SUCCESS) {
convert_to_string((*ppid));
PS(id) = estrndup((*ppid)->value.str.val, (*ppid)->value.str.len);
send_cookie = 0;
@@ -352,22 +347,9 @@ static void _php_session_start(PSLS_D)
sizeof("HTTP_COOKIE_VARS"), (void **) &data) == SUCCESS &&
(*data)->type == IS_ARRAY &&
zend_hash_find((*data)->value.ht, PS(session_name),
lensess + 1, (void **) &ppid) == SUCCESS) {
strlen(PS(session_name)) + 1, (void **) &ppid) == SUCCESS) {
define_sid = 0;
}
if(!PS(id) &&
zend_hash_find(&EG(symbol_table), "REQUEST_URI",
sizeof("REQUEST_URI"), (void **) &data) == SUCCESS &&
(*data)->type == IS_STRING &&
(p = strstr((*data)->value.str.val, PS(session_name))) &&
p[lensess] == '=') {
char *q;
p += lensess + 1;
if((q = strpbrk(p, "/?\\")))
PS(id) = estrndup(p, q - p);
}
if(!PS(id)) {
PS(id) = _php_create_id(NULL);
-1
View File
@@ -12,7 +12,6 @@ AC_ARG_WITH(snmp,
SNMP_LIBDIR=/usr/local/lib
test -d /usr/local/include/ucd-snmp && SNMP_INCDIR=/usr/local/include/ucd-snmp
test -d /usr/include/ucd-snmp && SNMP_INCDIR=/usr/include/ucd-snmp
test -d /usr/include/snmp && SNMP_INCDIR=/usr/include/snmp
test -f /usr/lib/libsnmp.a && SNMP_LIBDIR=/usr/lib
else
SNMP_INCDIR=$withval/include
+4 -19
View File
@@ -71,24 +71,8 @@ unsigned char *_php3_base64_encode(const unsigned char *string, int length, int
unsigned char *_php3_base64_decode(const unsigned char *string, int length, int *ret_length) {
const unsigned char *current = string;
int ch, i = 0, j = 0, k;
/* this sucks for threaded environments */
static short reverse_table[256];
static int table_built;
unsigned char *result;
if (++table_built == 1) {
char *chp;
for(ch = 0; ch < 256; ch++) {
chp = strchr(base64_table, ch);
if(chp) {
reverse_table[ch] = chp - base64_table;
} else {
reverse_table[ch] = -1;
}
}
}
result = (unsigned char *)emalloc((length / 4 * 3 + 1) * sizeof(char));
unsigned char *result = (unsigned char *)emalloc((length / 4 * 3 + 1) * sizeof(char));
if (result == NULL) {
return NULL;
}
@@ -96,8 +80,9 @@ unsigned char *_php3_base64_decode(const unsigned char *string, int length, int
/* run through the whole string, converting as we go */
while ((ch = *current++) != '\0') {
if (ch == base64_pad) break;
ch = reverse_table[ch];
if (ch < 0) continue;
ch = (int)strchr(base64_table, ch);
if (ch == 0) continue;
ch -= (int)base64_table;
switch(i % 4) {
case 0:
+1 -2
View File
@@ -284,7 +284,6 @@ function_entry basic_functions[] = {
PHP_FE(print_r, NULL)
{"setcookie", php3_SetCookie, NULL},
{"header", php3_Header, NULL},
PHP_FE(headers_sent, NULL)
PHP_FE(function_exists, NULL)
PHP_FE(in_array, NULL)
PHP_FE(extract, NULL)
@@ -1414,7 +1413,7 @@ static int _php3_array_walk(const void *a)
pval retval;
CLS_FETCH();
args[0] = *((pval **)a);
args[0] = (pval *)a;
call_user_function(CG(function_table), NULL, php3_array_walk_func_name, &retval, 1, args);
return 0;
+2 -59
View File
@@ -60,8 +60,6 @@ static int phpday_tab[2][12] =
{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
};
#define isleap(year) (((year%4) == 0 && (year%100)!=0) || (year%400)==0)
PHP_FUNCTION(time)
{
return_value->value.lval = (long) time(NULL);
@@ -144,7 +142,7 @@ _php3_date(INTERNAL_FUNCTION_PARAMETERS, int gm)
pval *format, *timestamp;
time_t the_time;
struct tm *ta;
int i, size = 0, length, h, beat;
int i, size = 0, length, h;
char tmp_buff[16];
switch(ARG_COUNT(ht)) {
@@ -183,45 +181,33 @@ _php3_date(INTERNAL_FUNCTION_PARAMETERS, int gm)
break;
case 'F': /* month, textual, full */
case 'l': /* day (of the week), textual */
case 'T': /* timezone name */
size += 9;
break;
case 'Z': /* timezone offset in seconds */
size += 6;
break;
case 'Y': /* year, numeric, 4 digits */
size += 4;
break;
case 'M': /* month, textual, 3 letters */
case 'D': /* day, textual, 3 letters */
case 'z': /* day of the year, 1 to 366 */
case 'z': /* day of the year */
size += 3;
break;
case 'y': /* year, numeric, 2 digits */
case 'm': /* month, numeric */
case 'n': /* month, numeric, no leading zeroes */
case 'd': /* day of the month, numeric */
case 'j': /* day of the month, numeric, no leading zeros */
case 'H': /* hour, numeric, 24 hour format */
case 'h': /* hour, numeric, 12 hour format */
case 'G': /* hour, numeric, 24 hour format, no leading zeroes */
case 'g': /* hour, numeric, 12 hour format, no leading zeroes */
case 'i': /* minutes, numeric */
case 's': /* seconds, numeric */
case 'A': /* AM/PM */
case 'a': /* am/pm */
case 'S': /* standard english suffix for the day of the month (e.g. 3rd, 2nd, etc) */
case 't': /* days in current month */
size += 2;
break;
case '\\':
if(i < format->value.str.len-1) {
i++;
}
case 'L': /* boolean for leap year */
case 'B': /* Swatch Beat, 3 digits */
size += 3;
break;
case 'w': /* day of the week, numeric */
default:
size++;
@@ -275,10 +261,6 @@ _php3_date(INTERNAL_FUNCTION_PARAMETERS, int gm)
sprintf(tmp_buff, "%02d", ta->tm_mon + 1); /* SAFE */
strcat(return_value->value.str.val, tmp_buff);
break;
case 'n': /* month, numeric, no leading zeros */
sprintf(tmp_buff, "%d", ta->tm_mon + 1); /* SAFE */
strcat(return_value->value.str.val, tmp_buff);
break;
case 'd': /* day of the month, numeric */
sprintf(tmp_buff, "%02d", ta->tm_mday); /* SAFE */
strcat(return_value->value.str.val, tmp_buff);
@@ -296,15 +278,6 @@ _php3_date(INTERNAL_FUNCTION_PARAMETERS, int gm)
sprintf(tmp_buff, "%02d", h); /* SAFE */
strcat(return_value->value.str.val, tmp_buff);
break;
case 'G': /* hour, numeric, 24 hour format, no leading zeros */
sprintf(tmp_buff, "%d", ta->tm_hour); /* SAFE */
strcat(return_value->value.str.val, tmp_buff);
break;
case 'g': /* hour, numeric, 12 hour format, no leading zeros */
h = ta->tm_hour % 12; if (h==0) h = 12;
sprintf(tmp_buff, "%d", h); /* SAFE */
strcat(return_value->value.str.val, tmp_buff);
break;
case 'i': /* minutes, numeric */
sprintf(tmp_buff, "%02d", ta->tm_min); /* SAFE */
strcat(return_value->value.str.val, tmp_buff);
@@ -339,40 +312,10 @@ _php3_date(INTERNAL_FUNCTION_PARAMETERS, int gm)
}
}
break;
case 't': /* days in current month */
sprintf(tmp_buff, "%2d", phpday_tab[isleap((ta->tm_year+1900))][ta->tm_mon] );
strcat(return_value->value.str.val, tmp_buff);
break;
case 'w': /* day of the week, numeric EXTENSION */
sprintf(tmp_buff, "%01d", ta->tm_wday); /* SAFE */
strcat(return_value->value.str.val, tmp_buff);
break;
case 'Z': /* timezone offset in seconds */
#if HAVE_TM_GMTOFF
sprintf(tmp_buff, "%ld", ta->tm_gmtoff );
#else
sprintf(tmp_buff, "%ld", timezone);
#endif
strcat(return_value->value.str.val, tmp_buff);
break;
case 'L': /* boolean for leapyear */
sprintf(tmp_buff, "%d", (isleap((ta->tm_year+1900)) ? 1 : 0 ) );
strcat(return_value->value.str.val, tmp_buff);
break;
case 'T': /* timezone name */
#if HAVE_TM_ZONE
strcat(return_value->value.str.val, ta->tm_zone);
#else
strcat(return_value->value.str.val, tzname[0]);
#endif
break;
case 'B': /* Swatch Beat a.k.a. Internet Time */
beat = (((((long)the_time)-(((long)the_time) -
((((long)the_time) % 86400) + 3600))) * 10) / 864);
if (beat > 999) beat = 0;
sprintf(tmp_buff, "%03d", beat); /* SAFE */
strcat(return_value->value.str.val, tmp_buff);
break;
default:
length = strlen(return_value->value.str.val);
return_value->value.str.val[length] = format->value.str.val[i];
+3 -41
View File
@@ -41,20 +41,12 @@
static int _Exec(int type, char *cmd, pval *array, pval *return_value)
{
FILE *fp;
char *buf, *tmp=NULL;
int buflen = 0;
char buf[EXEC_INPUT_BUF], *tmp=NULL;
int t, l, ret, output=1;
int overflow_limit, lcmd, ldir;
char *b, *c, *d=NULL;
PLS_FETCH();
buf = (char*) emalloc(EXEC_INPUT_BUF);
if (!buf) {
php3_error(E_WARNING, "Unable to emalloc %d bytes for exec buffer", EXEC_INPUT_BUF);
return -1;
}
buflen = EXEC_INPUT_BUF;
if (PG(safe_mode)) {
lcmd = strlen(cmd);
ldir = strlen(PG(safe_mode_exec_dir));
@@ -64,7 +56,6 @@ static int _Exec(int type, char *cmd, pval *array, pval *return_value)
if (c) *c = '\0';
if (strstr(cmd, "..")) {
php3_error(E_WARNING, "No '..' components allowed in path");
efree(buf);
return -1;
}
d = emalloc(l);
@@ -94,7 +85,6 @@ static int _Exec(int type, char *cmd, pval *array, pval *return_value)
if (!fp) {
php3_error(E_WARNING, "Unable to fork [%s]", d);
efree(d);
efree(buf);
return -1;
}
} else { /* not safe_mode */
@@ -105,7 +95,6 @@ static int _Exec(int type, char *cmd, pval *array, pval *return_value)
#endif
if (!fp) {
php3_error(E_WARNING, "Unable to fork [%s]", cmd);
efree(buf);
return -1;
}
}
@@ -117,33 +106,7 @@ static int _Exec(int type, char *cmd, pval *array, pval *return_value)
}
}
if (type != 3) {
l=0;
while ( !feof(fp) || l != 0 ) {
l = 0;
/* Read a line or fill the buffer, whichever comes first */
do {
if ( buflen <= (l+1) ) {
buf = erealloc(buf, buflen + EXEC_INPUT_BUF);
if ( buf == NULL ) {
php3_error(E_WARNING, "Unable to erealloc %d bytes for exec buffer",
buflen + EXEC_INPUT_BUF);
return -1;
}
buflen += EXEC_INPUT_BUF;
}
if ( fgets(&(buf[l]), buflen - l, fp) == NULL ) {
/* eof */
break;
}
l += strlen(&(buf[l]));
} while ( (l > 0) && (buf[l-1] != '\n') );
if ( feof(fp) && (l == 0) ) {
break;
}
while (fgets(buf, EXEC_INPUT_BUF - 1, fp)) {
if (type == 1) {
SLS_FETCH();
@@ -169,7 +132,7 @@ static int _Exec(int type, char *cmd, pval *array, pval *return_value)
/* strip trailing whitespaces */
l = strlen(buf);
t = l;
while (l-- && isspace((int)buf[l]));
while (l && isspace((int)buf[--l]));
if (l < t) {
buf[l + 1] = '\0';
}
@@ -210,7 +173,6 @@ static int _Exec(int type, char *cmd, pval *array, pval *return_value)
#endif
if (d) efree(d);
efree(buf);
return ret;
}
+108 -96
View File
@@ -20,7 +20,6 @@
/* $Id$ */
/* Synced with php3 revision 1.121 1999-06-18 [ssb] */
/* Synced with php3 revision 1.133 1999-07-21 [sas] */
#include "php.h"
#include "php_globals.h"
@@ -71,9 +70,6 @@ extern int le_fp;
#define FREE_SOCK if(socketd >= 0) close(socketd); efree(sock); if (key) efree(key)
#define SEARCHCR \
p = memchr(READPTR(sock), '\n', MIN(TOREAD(sock), maxlen - 1));
#if WIN32|WINNT
#define EWOULDBLOCK WSAEWOULDBLOCK
#else
@@ -237,7 +233,6 @@ static void _php3_fsockopen(INTERNAL_FUNCTION_PARAMETERS, int persistent) {
int socketd = -1;
struct timeval timeout = { 60, 0 };
unsigned short portno;
unsigned long conv;
char *key = NULL;
PLS_FETCH();
@@ -247,10 +242,8 @@ static void _php3_fsockopen(INTERNAL_FUNCTION_PARAMETERS, int persistent) {
}
switch(arg_count) {
case 5:
convert_to_double(args[4]);
conv = args[4]->value.dval * 1000000.0;
timeout.tv_sec = conv / 1000000;
timeout.tv_usec = conv % 1000000;
convert_to_long(args[4]);
timeout.tv_sec = args[4]->value.lval;
/* fall-through */
case 4:
if(!ParameterPassedByReference(ht,4)) {
@@ -278,7 +271,7 @@ static void _php3_fsockopen(INTERNAL_FUNCTION_PARAMETERS, int persistent) {
if (persistent && _php3_hash_find(&PG(ht_fsock_keys), key, strlen(key) + 1,
(void *) &sockp) == SUCCESS) {
FREE_SOCK;
efree(key);
*sock = *sockp;
RETURN_LONG(php3_list_insert(sock, wsa_fp));
}
@@ -362,14 +355,14 @@ static void _php3_fsockopen(INTERNAL_FUNCTION_PARAMETERS, int persistent) {
}
/* }}} */
/* {{{ proto int fsockopen(string hostname, int port [, int errno [, string errstr [, double timeout]]])
/* {{{ proto int fsockopen(string hostname, int port [, int errno [, string errstr]])
Open Internet or Unix domain socket connection */
PHP_FUNCTION(fsockopen)
{
_php3_fsockopen(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */
/* {{{ proto int pfsockopen(string hostname, int port [, int errno [, string errstr [, double timeout]]])
/* {{{ proto int pfsockopen(string hostname, int port [, int errno [, string errstr]])
Open persistent Internet or Unix domain socket connection */
PHP_FUNCTION(pfsockopen)
{
@@ -377,7 +370,40 @@ PHP_FUNCTION(pfsockopen)
}
/* }}} */
#define CHUNK_SIZE 8192
/* Known issues with the socket buffering code:
* - does not work reliably with persistent sockets yet
* (buffered data is not persistent)
* - php3_fopen_url_wrapper() is still doing single-byte lookahead/read
*/
static php3i_sockbuf *_php3_sock_findsock(int socket)
{
/* FIXME: O(n) could be improved */
php3i_sockbuf *buf = NULL, *tmp;
for(tmp = phpsockbuf; tmp; tmp = tmp->next)
if(tmp->socket == socket) {
buf = tmp;
break;
}
return buf;
}
int _php3_sock_eof(int socket)
{
php3i_sockbuf *sockbuf;
int ret = 0;
sockbuf = _php3_sock_findsock(socket);
if(sockbuf) {
ret = (sockbuf->writepos - sockbuf->readpos) == 0 ? 1 : 0;
}
return ret;
}
#define CHUNK_SIZE 2048
#define SOCK_DESTROY(sock) \
if(sock->readbuf) pefree(sock->readbuf, sock->persistent); \
if(sock->prev) sock->prev->next = sock->next; \
@@ -412,12 +438,12 @@ static php3i_sockbuf *_php3_sock_find(int socket)
{
php3i_sockbuf *buf = NULL, *tmp;
for(tmp = phpsockbuf; tmp; tmp = tmp->next)
if(tmp->socket == socket) {
for (tmp = phpsockbuf; tmp; tmp = tmp->next) {
if (tmp->socket == socket) {
buf = tmp;
break;
}
}
return buf;
}
@@ -428,8 +454,9 @@ static php3i_sockbuf *_php3_sock_create(int socket)
sock = pecalloc(sizeof(*sock), 1, persistent);
sock->socket = socket;
if((sock->next = phpsockbuf))
if ((sock->next = phpsockbuf)) {
phpsockbuf->prev = sock;
}
sock->persistent = persistent;
sock->is_blocked = 1;
sock->chunk_size = def_chunk_size;
@@ -444,8 +471,9 @@ size_t _php3_sock_set_def_chunk_size(size_t size)
old = def_chunk_size;
if(size <= CHUNK_SIZE || size > 0)
if (size <= CHUNK_SIZE || size > 0) {
def_chunk_size = size;
}
return old;
}
@@ -456,7 +484,7 @@ int _php3_sock_destroy(int socket)
php3i_sockbuf *sock;
sock = _php3_sock_find(socket);
if(sock) {
if (sock) {
ret = 1;
SOCK_DESTROY(sock);
}
@@ -464,31 +492,24 @@ int _php3_sock_destroy(int socket)
return ret;
}
#if !defined(WIN32) && !defined(WINNT)
#undef closesocket
#define closesocket close
#endif
#ifndef HAVE_SHUTDOWN
#undef shutdown
#define shutdown
#endif
#define SOCK_CLOSE(s) shutdown(s, 0); closesocket(s)
int _php3_sock_close(int socket)
{
int ret = 0;
php3i_sockbuf *sock;
sock = _php3_sock_find(socket);
if(sock) {
if(!sock->persistent) {
SOCK_CLOSE(sock->socket);
if (sock) {
if (!sock->persistent) {
#if HAVE_SHUTDOWN
shutdown(sock->socket, 0);
#endif
#if WIN32||WINNT
closesocket(sock->socket);
#else
close(sock->socket);
#endif
SOCK_DESTROY(sock);
}
} else {
SOCK_CLOSE(socket);
}
return ret;
@@ -503,64 +524,52 @@ static void _php3_sock_wait_for_data(php3i_sockbuf *sock)
FD_ZERO(&fdr);
FD_SET(sock->socket, &fdr);
while(1) {
while (1) {
tfdr = fdr;
if(select(sock->socket + 1, &tfdr, NULL, NULL, NULL) == 1)
if(select(sock->socket + 1, &tfdr, NULL, NULL, NULL) == 1) {
break;
}
}
}
static size_t _php3_sock_read_internal(php3i_sockbuf *sock)
static size_t _php3_sock_read_limited(php3i_sockbuf *sock, int maxread)
{
char buf[CHUNK_SIZE];
int nr_bytes;
size_t nr_read = 0;
/* For blocking sockets, we wait until there is some
data to read (real data or EOF)
Otherwise, recv() may time out and return 0 and
therefore sock->eof would be set errornously.
*/
if(sock->is_blocked) {
if (sock->eof || TOREAD(sock) >= maxread) {
return 0;
}
if (sock->is_blocked) {
_php3_sock_wait_for_data(sock);
}
/* read at a maximum sock->chunk_size */
nr_bytes = recv(sock->socket, buf, sock->chunk_size, 0);
if(nr_bytes > 0) {
if(sock->writepos + nr_bytes > sock->readbuflen) {
if (nr_bytes > 0) {
if (sock->writepos + nr_bytes > sock->readbuflen) {
sock->readbuflen += sock->chunk_size;
sock->readbuf = perealloc(sock->readbuf, sock->readbuflen,
sock->persistent);
sock->persistent);
}
memcpy(WRITEPTR(sock), buf, nr_bytes);
sock->writepos += nr_bytes;
nr_read = nr_bytes;
} else if(nr_bytes == 0 || (nr_bytes < 0 && errno != EWOULDBLOCK)) {
} else if (nr_bytes == 0 || (nr_bytes < 0 && errno != EWOULDBLOCK)) {
sock->eof = 1;
}
return nr_read;
}
static void _php3_sock_read_total(php3i_sockbuf *sock, size_t maxread)
{
while(!sock->eof && TOREAD(sock) < maxread) {
_php3_sock_read_internal(sock);
}
}
static size_t _php3_sock_read(php3i_sockbuf *sock)
{
size_t nr_bytes;
size_t nr_read = 0;
int i;
for(i = 0; !sock->eof && i < MAX_CHUNKS_PER_READ; i++) {
nr_bytes = _php3_sock_read_internal(sock);
for (i = 0; !sock->eof && i < MAX_CHUNKS_PER_READ; i++) {
nr_bytes = _php3_sock_read_limited(sock, CHUNK_SIZE);
if(nr_bytes == 0) break;
nr_read += nr_bytes;
}
@@ -574,60 +583,64 @@ int _php3_sock_set_blocking(int socket, int mode)
SOCK_FIND(sock, socket);
old = sock->is_blocked;
sock->is_blocked = mode;
return old;
}
#define SOCK_FIND_AND_READ_MAX(max) \
SOCK_FIND(sock, socket); \
if(sock->is_blocked) _php3_sock_read_total(sock, max); else _php3_sock_read(sock)
SOCK_FIND(sock, socket); \
if(sock->is_blocked) _php3_sock_read_limited(sock, max); else _php3_sock_read(sock)
/* {{{ _php3_sock_fgets() */
/*
* FIXME: fgets depends on '\n' as line delimiter
* FIXME: fgets depends on '\n' as line delimiters
*/
char *_php3_sock_fgets(char *buf, size_t maxlen, int socket)
{
char *p = NULL;
char *ret = NULL;
size_t amount = 0;
size_t nr_read;
size_t nr_toread;
SOCK_FIND(sock, socket);
SEARCHCR;
if(!p) {
if(sock->is_blocked) {
while(!p && !sock->eof && TOREAD(sock) < maxlen - 1) {
_php3_sock_read_internal(sock);
SEARCHCR;
}
} else {
_php3_sock_read(sock);
SEARCHCR;
}
if (maxlen < 0) {
return ret;
}
if(p) {
if (sock->is_blocked) {
nr_toread = 0;
for (nr_read = 1; !sock->eof && nr_read < maxlen; ) {
nr_read += _php3_sock_read_limited(sock, nr_toread);
if ((p = memchr(READPTR(sock), '\n', TOREAD(sock))) != NULL) {
break;
}
nr_toread = 512;
}
} else {
_php3_sock_read(sock);
p = memchr(READPTR(sock), '\n', MIN(TOREAD(sock), maxlen - 1));
}
if (p) {
amount = (ptrdiff_t) p - (ptrdiff_t) READPTR(sock) + 1;
} else {
amount = TOREAD(sock);
amount = MIN(TOREAD(sock), maxlen - 1);
}
amount = MIN(amount, maxlen - 1);
if(amount > 0) {
if (amount > 0) {
memcpy(buf, READPTR(sock), amount);
sock->readpos += amount;
}
buf[amount] = '\0';
/* signal error only, if we don't return data from this call and
/* signal error only, if we don't return data from this call and
if there is no data to read and if the eof flag is set */
if(amount || TOREAD(sock) || !sock->eof)
if (amount || TOREAD(sock) || !sock->eof) {
ret = buf;
}
return ret;
}
@@ -646,7 +659,7 @@ int _php3_sock_fgetc(int socket)
int ret = EOF;
SOCK_FIND_AND_READ_MAX(1);
if(TOREAD(sock) > 0) {
if (TOREAD(sock) > 0) {
ret = *READPTR(sock);
sock->readpos++;
}
@@ -659,11 +672,9 @@ int _php3_sock_feof(int socket)
int ret = 0;
SOCK_FIND(sock, socket);
if(!sock->is_blocked)
_php3_sock_read(sock);
if(!TOREAD(sock) && sock->eof)
if (!TOREAD(sock) && sock->eof) {
ret = 1;
}
return ret;
}
@@ -675,11 +686,12 @@ size_t _php3_sock_fread(char *ptr, size_t size, int socket)
size_t ret = 0;
SOCK_FIND_AND_READ_MAX(size);
if(size < 0)
if (size < 0) {
return ret;
}
ret = MIN(TOREAD(sock), size);
if(ret) {
if (ret) {
memcpy(ptr, READPTR(sock), ret);
sock->readpos += ret;
}
-11
View File
@@ -24,7 +24,6 @@
#include "main.h"
#include "head.h"
#include "post.h"
#include "SAPI.h"
#ifdef TM_IN_SYS_TIME
#include <sys/time.h>
#else
@@ -557,16 +556,6 @@ int php3_headers_unsent(void)
}
}
PHP_FUNCTION(headers_sent)
{
SLS_FETCH();
if (SG(headers_sent)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
}
}
function_entry php3_header_functions[] = {
{NULL, NULL, NULL}
-1
View File
@@ -55,7 +55,6 @@ extern php3_module_entry php3_header_module_entry;
extern int php3_init_head(INIT_FUNC_ARGS);
PHP_FUNCTION(Header);
PHP_FUNCTION(SetCookie);
PHP_FUNCTION(headers_sent);
void php4i_add_header_information(char *header_information, uint header_length);
-1
View File
@@ -310,7 +310,6 @@ void php_print_credits(int flag)
CREDIT_LINE("Sybase", "Zeev Suraski");
CREDIT_LINE("System V Shared Memory", "Christian Cartus");
CREDIT_LINE("System V Semaphores", "Tom May");
CREDIT_LINE("WDDX", "Andrey Zmievski");
CREDIT_LINE("XML", "Stig Bakken");
CREDIT_LINE("Yellow Pages", "Stephanie Wehner");
CREDIT_LINE("Zlib", "Rasmus Lerdorf, Stefan Ruhrich");
+54
View File
@@ -1344,6 +1344,11 @@ PHPAPI void _php3_char_to_str(char *str,uint len,char from,char *to,int to_len,p
*target = 0;
}
#if 0
/*
* this is a binary safe equivalent to strnstr
* note that we don't check for the end in str_to_str but here
*/
static inline char *
_php3_memnstr(char *haystack, char *needle, int needle_len, char *end)
@@ -1409,6 +1414,55 @@ finish:
return new;
}
#else
static char *_php3_memstr(char *s, char *c, size_t n, size_t m)
{
char *p;
for(p = s; (p - s) < n; p++)
if(memcmp(p, c, m) == 0)
return p;
return NULL;
}
#define ATTCHSTR(st, sz) \
nl += sz; \
n = erealloc(n, nl + 1); \
memcpy(n + no, st, sz); \
no += sz
PHPAPI char *_php3_str_to_str(char *a, int al, char *b, int bl, char *c, int cl,
int *newlen)
{
char *n = NULL, *p, *q;
int nl = 0;
int no = 0;
/* run through all occurences of b in a */
for(p = q = a; (p = _php3_memstr(p, b, al - (p - a), bl)); q = p) {
/* attach everything between the previous occ. and this one */
ATTCHSTR(q, p - q);
/* attach the replacement string c */
ATTCHSTR(c, cl);
/* jump over string b in a */
p += bl;
}
/* anything left over ? */
if((al - (q - a)) > 0) {
ATTCHSTR(q, al - (q - a));
}
if(newlen) *newlen = nl;
n[nl] = '\0';
return n;
}
#undef ATTCHSTR
#endif
/* {{{ proto string str_replace(string needle, string str, string haystack)
Replace all occurrences of needle in haystack with str */
+9 -3
View File
@@ -20,6 +20,9 @@
/* $Id$ */
#ifndef MSVC5
#include "php_config.h"
#endif
#include "php.h"
#include "php3_sybase-ct.h"
#include "ext/standard/php3_standard.h"
@@ -602,8 +605,11 @@ static void php3_sybct_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
static int php3_sybct_get_default_link(INTERNAL_FUNCTION_PARAMETERS)
{
if (php3_sybct_module.default_link==-1) { /* no link opened yet, implicitly open one */
ht = 0;
php3_sybct_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
HashTable dummy;
_php3_hash_init(&dummy,0,NULL,NULL,0);
php3_sybct_do_connect(&dummy,return_value,list,plist,0);
_php3_hash_destroy(&dummy);
}
return php3_sybct_module.default_link;
}
@@ -1309,7 +1315,7 @@ static PHP_FUNCTION(sybct_fetch_hash)
tmp->value.str.val = _php3_addslashes(tmp->value.str.val,tmp->value.str.len,&tmp->value.str.len,1);
}
_php3_hash_index_update(return_value->value.ht, i, (void *) &tmp, sizeof(pval *), NULL);
_php3_hash_update(return_value->value.ht, result->fields[i].name, strlen(result->fields[i].name)+1, (void *) &tmp, sizeof(pval *), NULL);
_php3_hash_update(return_value->value.ht, result->fields[i].name, strlen(result->fields[i].name)+1, (void *) &tmp, sizeof(pval *) NULL);
}
result->cur_row++;
}
+2 -1
View File
@@ -473,7 +473,8 @@ static void php3_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
static int php3_sybase_get_default_link(INTERNAL_FUNCTION_PARAMETERS)
{
if (php3_sybase_module.default_link==-1) { /* no link opened yet, implicitly open one */
ht = 0;
int ht;
php3_sybase_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,0);
}
return php3_sybase_module.default_link;
-6
View File
@@ -1,6 +0,0 @@
# $Id$
INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend
noinst_LIBRARIES=libphpext_wddx.a
libphpext_wddx_a_SOURCES=wddx.c
-2
View File
@@ -1,2 +0,0 @@
/* define if you want to use the wddx extension */
#define HAVE_WDDX 0
-20
View File
@@ -1,20 +0,0 @@
dnl $Id$
dnl config.m4 for extension wddx
AC_MSG_CHECKING(whether to include WDDX support)
AC_ARG_WITH(wddx,
[ --with-wddx Include WDDX support],[
if test "$withval" = "yes"; then
if test "${with_xml+set}" != "set" -o "$with_xml" = "no"; then
AC_MSG_ERROR(WDDX requires --with-xml)
else
AC_DEFINE(HAVE_WDDX, 1)
AC_MSG_RESULT(yes)
PHP_EXTENSION(wddx)
fi
else
AC_MSG_RESULT(no)
fi
],[
AC_MSG_RESULT(no)
])
-59
View File
@@ -1,59 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP HTML Embedded Scripting Language Version 3.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-1999 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
| it under the terms of one of the following licenses: |
| |
| A) 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. |
| |
| B) the PHP License as published by the PHP Development Team and |
| included in the distribution in the file: LICENSE |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
| |
| You should have received a copy of both licenses referred to here. |
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
| Authors: Andrey Zmievski <andrey@ispi.net> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef _WDDX_H
#define _WDDX_H
#if HAVE_WDDX
#include "xml/xmlparse.h"
extern int php_minit_wddx(INIT_FUNC_ARGS);
extern zend_module_entry wddx_module_entry;
#define wddx_module_ptr &wddx_module_entry
PHP_FUNCTION(wddx_serialize_value);
PHP_FUNCTION(wddx_serialize_vars);
PHP_FUNCTION(wddx_packet_start);
PHP_FUNCTION(wddx_packet_end);
PHP_FUNCTION(wddx_add_vars);
PHP_FUNCTION(wddx_deserialize);
#else
#define wddx_module_ptr NULL
#endif /* HAVE_WDDX */
#define phpext_wddx_ptr wddx_module_ptr
#endif /* !_WDDX_H */
-6
View File
@@ -1,6 +0,0 @@
# $Source$
# $Id$
define_option with-wddx 'wddx support?' yesnodir no \
' Whether to build the wddx extension.'
-842
View File
@@ -1,842 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP HTML Embedded Scripting Language Version 3.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-1999 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
| it under the terms of one of the following licenses: |
| |
| A) 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. |
| |
| B) the PHP License as published by the PHP Development Team and |
| included in the distribution in the file: LICENSE |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
| |
| You should have received a copy of both licenses referred to here. |
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
| Authors: Andrey Zmievski <andrey@ispi.net> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "php.h"
#include "php_wddx.h"
#if HAVE_WDDX
#include "dlist.h"
#define WDDX_PACKET_S "<wddxPacket version='0.9'>"
#define WDDX_PACKET_E "</wddxPacket>"
#define WDDX_HEADER "<header/>"
#define WDDX_HEADER_COMMENT "<header comment='%s'/>"
#define WDDX_DATA_S "<data>"
#define WDDX_DATA_E "</data>"
#define WDDX_STRING_S "<string>"
#define WDDX_STRING_E "</string>"
#define WDDX_CHAR "<char code='%02X'/>"
#define WDDX_NUMBER "<number>%s</number>"
#define WDDX_ARRAY_S "<array length='%d'>"
#define WDDX_ARRAY_E "</array>"
#define WDDX_VAR_S "<var name='%s'>"
#define WDDX_VAR_E "</var>"
#define WDDX_STRUCT_S "<struct>"
#define WDDX_STRUCT_E "</struct>"
#define WDDX_BUF_LEN 256
#define EL_STRING "string"
#define EL_CHAR "char"
#define EL_CHAR_CODE "code"
#define EL_NUMBER "number"
#define EL_ARRAY "array"
#define EL_STRUCT "struct"
#define EL_VAR "var"
#define EL_VAR_NAME "name"
#define EL_PACKET "wddxPacket"
#define EL_VERSION "version"
static int le_wddx;
typedef struct {
DLIST *packet_head;
int packet_length;
} wddx_packet;
typedef struct {
zval *data;
enum {
ST_STRING,
ST_NUMBER,
ST_ARRAY,
ST_STRUCT
} type;
char *varname;
} st_entry;
typedef struct {
int top, max;
char *varname;
void **elements;
} wddx_stack;
/* {{{ function prototypes */
static void _php_wddx_serialize_var(wddx_packet *packet, zval *var, char *name);
static void _php_wddx_process_data(void *user_data, const char *s, int len);
/* }}} */
/* {{{ module definition structures */
function_entry wddx_functions[] = {
PHP_FE(wddx_serialize_value, NULL)
PHP_FE(wddx_serialize_vars, NULL)
PHP_FE(wddx_packet_start, NULL)
PHP_FE(wddx_packet_end, NULL)
PHP_FE(wddx_add_vars, NULL)
PHP_FE(wddx_deserialize, NULL)
{NULL, NULL, NULL}
};
zend_module_entry wddx_module_entry = {
"WDDX_A", wddx_functions, php_minit_wddx, NULL, NULL, NULL, NULL, STANDARD_MODULE_PROPERTIES
};
/* }}} */
/* {{{ int wddx_stack_init(wddx_stack *stack) */
static int wddx_stack_init(wddx_stack *stack)
{
stack->top = 0;
stack->elements = (void **) emalloc(sizeof(void **) * STACK_BLOCK_SIZE);
if (!stack->elements) {
return FAILURE;
} else {
stack->max = STACK_BLOCK_SIZE;
stack->varname = NULL;
return SUCCESS;
}
}
/* }}} */
/* {{{ int wddx_stack_push(wddx_stack *stack, void *element, int size) */
static int wddx_stack_push(wddx_stack *stack, void *element, int size)
{
if (stack->top >= stack->max) { /* we need to allocate more memory */
stack->elements = (void **) erealloc(stack->elements,
(sizeof(void **) * (stack->max += STACK_BLOCK_SIZE)));
if (!stack->elements) {
return FAILURE;
}
}
stack->elements[stack->top] = (void *) emalloc(size);
memcpy(stack->elements[stack->top], element, size);
return stack->top++;
}
/* }}} */
/* {{{ int wddx_stack_top(wddx_stack *stack, void **element) */
static int wddx_stack_top(wddx_stack *stack, void **element)
{
if (stack->top > 0) {
*element = stack->elements[stack->top - 1];
return SUCCESS;
} else {
*element = NULL;
return FAILURE;
}
}
/* }}} */
/* {{{ int wddx_stack_is_empty(wddx_stack *stack) */
static int wddx_stack_is_empty(wddx_stack *stack)
{
if (stack->top == 0) {
return 1;
} else {
return 0;
}
}
/* }}} */
/* {{{ int wddx_stack_destroy(wddx_stack *stack) */
static int wddx_stack_destroy(wddx_stack *stack)
{
register int i;
if (stack->elements) {
for (i = 0; i < stack->top; i++) {
if (((st_entry *)stack->elements[i])->data)
{
zval_dtor(((st_entry *)stack->elements[i])->data);
efree(((st_entry *)stack->elements[i])->data);
}
efree(stack->elements[i]);
}
efree(stack->elements);
}
return SUCCESS;
}
/* }}} */
/* {{{ _php_free_packet_chunk */
static void _php_free_packet_chunk(char **chunk_ptr)
{
if ((*chunk_ptr))
efree((*chunk_ptr));
}
/* }}} */
/* {{{ _php_wddx_destructor */
static void _php_wddx_destructor(wddx_packet *packet)
{
dlst_kill(packet->packet_head, (void (*)(void *))_php_free_packet_chunk);
efree(packet);
}
/* }}} */
/* {{{ php_minit_wddx */
int php_minit_wddx(INIT_FUNC_ARGS)
{
le_wddx = register_list_destructors(_php_wddx_destructor, NULL);
return SUCCESS;
}
/* }}} */
/* {{{ _php_wddx_add_chunk */
static void _php_wddx_add_chunk(wddx_packet *packet, char *str)
{
char **chunk_ptr;
chunk_ptr = (char**)dlst_newnode(sizeof(char *));
(*chunk_ptr) = estrdup(str);
dlst_insertafter(packet->packet_head, chunk_ptr, PHP_DLST_TAIL(packet->packet_head));
packet->packet_length += strlen(str);
}
/* }}} */
/* {{{ _php_wddx_gather */
static char* _php_wddx_gather(wddx_packet *packet)
{
char **chunk;
char *buf;
buf = (char *)emalloc(packet->packet_length+1);
buf[0] = '\0';
for(chunk=dlst_first(packet->packet_head);
chunk!=NULL;
chunk = dlst_next(chunk)) {
strcat(buf, *chunk);
}
return buf;
}
/* }}} */
/* {{{ void _php_wddx_packet_start */
static void _php_wddx_packet_start(wddx_packet *packet, char *comment)
{
char tmp_buf[WDDX_BUF_LEN];
_php_wddx_add_chunk(packet, WDDX_PACKET_S);
if (comment)
{
sprintf(tmp_buf, WDDX_HEADER_COMMENT, comment);
_php_wddx_add_chunk(packet, tmp_buf);
}
else
_php_wddx_add_chunk(packet, WDDX_HEADER);
_php_wddx_add_chunk(packet, WDDX_DATA_S);
}
/* }}} */
/* {{{ int _php_wddx_packet_end */
static void _php_wddx_packet_end(wddx_packet *packet)
{
_php_wddx_add_chunk(packet, WDDX_DATA_E);
_php_wddx_add_chunk(packet, WDDX_PACKET_E);
}
/* }}} */
/* {{{ void _php_wddx_serialize_var(wddx_packet *packet, zval *var) */
static void _php_wddx_serialize_string(wddx_packet *packet, zval *var)
{
char *buf,
*c,
control_buf[WDDX_BUF_LEN];
int i;
_php_wddx_add_chunk(packet, WDDX_STRING_S);
i = 0;
buf = (char *)emalloc(var->value.str.len);
for(c=var->value.str.val; *c!='\0'; c++)
{
if (iscntrl((int)*c))
{
if (*buf)
{
buf[i] = '\0';
_php_wddx_add_chunk(packet, buf);
i = 0;
buf[i] = '\0';
}
sprintf(control_buf, WDDX_CHAR, *c);
_php_wddx_add_chunk(packet, control_buf);
}
else
buf[i++] = *c;
}
buf[i] = '\0';
if (*buf)
_php_wddx_add_chunk(packet, buf);
efree(buf);
_php_wddx_add_chunk(packet, WDDX_STRING_E);
}
/* }}} */
/* {{{ void _php_wddx_serialize_number(wddx_packet *packet, zval *var) */
static void _php_wddx_serialize_number(wddx_packet *packet, zval *var)
{
char tmp_buf[WDDX_BUF_LEN];
convert_to_string(var);
sprintf(tmp_buf, WDDX_NUMBER, var->value.str.val);
_php_wddx_add_chunk(packet, tmp_buf);
}
/* }}} */
/* {{{ void _php_wddx_serialize_hash(wddx_packet *packet, zval *var) */
static void _php_wddx_serialize_hash(wddx_packet *packet, zval *var)
{
zval **ent;
char *key;
int hash_type, ent_type;
ulong idx;
char tmp_buf[WDDX_BUF_LEN];
zend_hash_internal_pointer_reset(var->value.ht);
hash_type = zend_hash_get_current_key(var->value.ht, &key, &idx);
if (hash_type == HASH_KEY_IS_STRING) {
_php_wddx_add_chunk(packet, WDDX_STRUCT_S);
efree(key);
} else {
sprintf(tmp_buf, WDDX_ARRAY_S, zend_hash_num_elements(var->value.ht));
_php_wddx_add_chunk(packet, tmp_buf);
}
while(zend_hash_get_current_data(var->value.ht, (void**)&ent) == SUCCESS) {
if (hash_type == HASH_KEY_IS_STRING) {
ent_type = zend_hash_get_current_key(var->value.ht, &key, &idx);
if (ent_type == HASH_KEY_IS_STRING) {
_php_wddx_serialize_var(packet, *ent, key);
efree(key);
} else {
sprintf(tmp_buf, "%ld", idx);
_php_wddx_serialize_var(packet, *ent, tmp_buf);
}
} else
_php_wddx_serialize_var(packet, *ent, NULL);
zend_hash_move_forward(var->value.ht);
}
if (hash_type == HASH_KEY_IS_STRING)
_php_wddx_add_chunk(packet, WDDX_STRUCT_E);
else
_php_wddx_add_chunk(packet, WDDX_ARRAY_E);
}
/* }}} */
/* {{{ void _php_wddx_serialize_var(wddx_packet *packet, zval *var, char *name) */
static void _php_wddx_serialize_var(wddx_packet *packet, zval *var, char *name)
{
char tmp_buf[WDDX_BUF_LEN];
if (name) {
sprintf(tmp_buf, WDDX_VAR_S, name);
_php_wddx_add_chunk(packet, tmp_buf);
}
switch(var->type) {
case IS_STRING:
_php_wddx_serialize_string(packet, var);
break;
case IS_LONG:
case IS_DOUBLE:
_php_wddx_serialize_number(packet, var);
break;
case IS_ARRAY:
case IS_OBJECT:
_php_wddx_serialize_hash(packet, var);
break;
}
if (name) {
_php_wddx_add_chunk(packet, WDDX_VAR_E);
}
}
/* }}} */
/* {{{ void _php_wddx_add_var(wddx_packet *packet, zval *name_var) */
static void _php_wddx_add_var(wddx_packet *packet, zval *name_var)
{
zval **val;
ELS_FETCH();
if (name_var->type & IS_STRING)
{
if (zend_hash_find(EG(active_symbol_table), name_var->value.str.val,
name_var->value.str.len+1, (void**)&val) != FAILURE) {
_php_wddx_serialize_var(packet, *val, name_var->value.str.val);
}
}
else if (name_var->type & IS_ARRAY)
{
zend_hash_internal_pointer_reset(name_var->value.ht);
while(zend_hash_get_current_data(name_var->value.ht, (void**)&val) == SUCCESS) {
_php_wddx_add_var(packet, *val);
zend_hash_move_forward(name_var->value.ht);
}
}
}
/* }}} */
/* {{{ void _php_wddx_push_element(void *user_data, const char *name, const char **atts) */
static void _php_wddx_push_element(void *user_data, const char *name, const char **atts)
{
st_entry ent;
wddx_stack *stack = (wddx_stack *)user_data;
if (!strcmp(name, EL_PACKET)) {
int i;
for (i=0; atts[i]; i++) {
if (!strcmp(atts[i], EL_VERSION)) {
}
}
} else if (!strcmp(name, EL_STRING)) {
ent.type = ST_STRING;
if (stack->varname) {
ent.varname = estrdup(stack->varname);
efree(stack->varname);
stack->varname = NULL;
} else
ent.varname = NULL;
ent.data = (zval *)emalloc(sizeof(zval));
ent.data->value.str.len = 0;
INIT_PZVAL(ent.data);
wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry));
} else if (!strcmp(name, EL_CHAR)) {
int i;
char tmp_buf[2];
for (i=0; atts[i]; i++) {
if (!strcmp(atts[i], EL_CHAR_CODE) && atts[i+1]) {
sprintf(tmp_buf, "%c", (char)strtol(atts[i+1], NULL, 16));
_php_wddx_process_data(user_data, tmp_buf, strlen(tmp_buf));
}
}
} else if (!strcmp(name, EL_NUMBER)) {
ent.type = ST_NUMBER;
if (stack->varname) {
ent.varname = estrdup(stack->varname);
efree(stack->varname);
stack->varname = NULL;
} else
ent.varname = NULL;
ent.data = (zval *)emalloc(sizeof(zval));
INIT_PZVAL(ent.data);
wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry));
} else if (!strcmp(name, EL_ARRAY)) {
ent.type = ST_ARRAY;
if (stack->varname) {
ent.varname = estrdup(stack->varname);
efree(stack->varname);
stack->varname = NULL;
} else
ent.varname = NULL;
ent.data = (zval *)emalloc(sizeof(zval));
array_init(ent.data);
INIT_PZVAL(ent.data);
wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry));
} else if (!strcmp(name, EL_STRUCT)) {
ent.type = ST_STRUCT;
if (stack->varname) {
ent.varname = estrdup(stack->varname);
efree(stack->varname);
stack->varname = NULL;
} else
ent.varname = NULL;
ent.data = (zval *)emalloc(sizeof(zval));
array_init(ent.data);
INIT_PZVAL(ent.data);
wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry));
} else if (!strcmp(name, EL_VAR)) {
int i;
for (i=0; atts[i]; i++) {
if (!strcmp(atts[i], EL_VAR_NAME) && atts[i+1]) {
stack->varname = estrdup(atts[i+1]);
}
}
}
}
/* }}} */
/* {{{ void _php_wddx_pop_element(void *user_data, const char *name) */
static void _php_wddx_pop_element(void *user_data, const char *name)
{
st_entry *ent1, *ent2;
wddx_stack *stack = (wddx_stack *)user_data;
if (!strcmp(name, EL_STRING) || !strcmp(name, EL_NUMBER) ||
!strcmp(name, EL_ARRAY) || !strcmp(name, EL_STRUCT)) {
if (stack->top > 1) {
wddx_stack_top(stack, (void**)&ent1);
stack->top--;
wddx_stack_top(stack, (void**)&ent2);
if (ent2->data->type == IS_ARRAY) {
if (ent1->varname) {
zend_hash_update(ent2->data->value.ht,
ent1->varname, strlen(ent1->varname)+1,
&ent1->data, sizeof(zval *), NULL);
efree(ent1->varname);
} else {
zend_hash_next_index_insert(ent2->data->value.ht,
&ent1->data,
sizeof(zval *), NULL);
}
}
efree(ent1);
}
}
}
/* }}} */
/* {{{ void _php_wddx_process_data(void *user_data, const char *s, int len) */
static void _php_wddx_process_data(void *user_data, const char *s, int len)
{
st_entry *ent;
wddx_stack *stack = (wddx_stack *)user_data;
if (!wddx_stack_is_empty(stack)) {
wddx_stack_top(stack, (void**)&ent);
switch (ent->type) {
case ST_STRING:
ent->data->type = IS_STRING;
if (ent->data->value.str.len == 0) {
ent->data->value.str.val = estrndup(s, len);
ent->data->value.str.len = len;
} else {
ent->data->value.str.val = erealloc(ent->data->value.str.val,
ent->data->value.str.len + len + 1);
strncpy(ent->data->value.str.val+ent->data->value.str.len, s, len);
ent->data->value.str.len += len;
ent->data->value.str.val[ent->data->value.str.len] = '\0';
}
break;
case ST_NUMBER:
ent->data->type = IS_STRING;
ent->data->value.str.len = len;
ent->data->value.str.val = estrndup(s, len);
convert_scalar_to_number(ent->data);
break;
default:
break;
}
}
}
/* }}} */
/* {{{ void _php_wddx_deserialize(zval *packet, zval *return_value) */
static void _php_wddx_deserialize(zval *packet, zval *return_value)
{
wddx_stack stack;
XML_Parser parser;
st_entry *ent;
wddx_stack_init(&stack);
parser = XML_ParserCreate(NULL);
XML_SetUserData(parser, &stack);
XML_SetElementHandler(parser, _php_wddx_push_element, _php_wddx_pop_element);
XML_SetCharacterDataHandler(parser, _php_wddx_process_data);
XML_Parse(parser, packet->value.str.val, packet->value.str.len, 1);
XML_ParserFree(parser);
wddx_stack_top(&stack, (void**)&ent);
*return_value = *(ent->data);
zval_copy_ctor(return_value);
wddx_stack_destroy(&stack);
}
/* }}} */
/* {{{ proto string wddx_serialize_value(mixed var [, string comment ])
Creates a new packet and serializes the given value */
PHP_FUNCTION(wddx_serialize_value)
{
int argc;
zval *var,
*comment;
wddx_packet *packet;
char *buf;
argc = ARG_COUNT(ht);
if(argc < 1 || argc > 2 || getParameters(ht, argc, &var, &comment) == FAILURE) {
WRONG_PARAM_COUNT;
}
packet = emalloc(sizeof(wddx_packet));
if (!packet) {
zend_error(E_WARNING, "Unable to allocate memory in php_wddx_packet_start");
RETURN_FALSE;
}
packet->packet_head = dlst_init();
packet->packet_length = 0;
if (argc == 2)
{
convert_to_string(comment);
_php_wddx_packet_start(packet, comment->value.str.val);
}
else
_php_wddx_packet_start(packet, NULL);
_php_wddx_serialize_var(packet, var, NULL);
_php_wddx_packet_end(packet);
buf = _php_wddx_gather(packet);
_php_wddx_destructor(packet);
RETURN_STRING(buf, 0);
}
/* }}} */
/* {{{ proto string wddx_serialize_vars(. . .)
Creates a new packet and serializes given variables into a struct */
PHP_FUNCTION(wddx_serialize_vars)
{
int argc, i;
wddx_packet *packet;
zval **args;
char *buf;
argc = ARG_COUNT(ht);
/* Allocate arguments array and get the arguments, checking for errors. */
args = (zval **)emalloc(argc * sizeof(zval *));
if (getParametersArray(ht, argc, args) == FAILURE) {
efree(args);
WRONG_PARAM_COUNT;
}
packet = emalloc(sizeof(wddx_packet));
if (!packet) {
zend_error(E_WARNING, "Unable to allocate memory in php_wddx_packet_start");
RETURN_FALSE;
}
packet->packet_head = dlst_init();
packet->packet_length = 0;
_php_wddx_packet_start(packet, NULL);
_php_wddx_add_chunk(packet, WDDX_STRUCT_S);
for (i=0; i<argc; i++) {
_php_wddx_add_var(packet, args[i]);
}
_php_wddx_add_chunk(packet, WDDX_STRUCT_E);
_php_wddx_packet_end(packet);
buf = _php_wddx_gather(packet);
_php_wddx_destructor(packet);
efree(args);
RETURN_STRING(buf, 0);
}
/* }}} */
/* {{{ proto int wddx_packet_start([ string comment ])
Starts a WDDX packet with optional comment and returns the packet id */
PHP_FUNCTION(wddx_packet_start)
{
int argc;
zval *comment;
wddx_packet *packet;
comment = NULL;
argc = ARG_COUNT(ht);
if (argc>1 || (argc==1 && getParameters(ht, 1, &comment)==FAILURE)) {
WRONG_PARAM_COUNT;
}
packet = emalloc(sizeof(wddx_packet));
if (!packet) {
zend_error(E_WARNING, "Unable to allocate memory in php_wddx_packet_start");
RETURN_FALSE;
}
packet->packet_head = dlst_init();
packet->packet_length = 0;
if (argc == 1) {
convert_to_string(comment);
_php_wddx_packet_start(packet, comment->value.str.val);
}
else
_php_wddx_packet_start(packet, NULL);
_php_wddx_add_chunk(packet, WDDX_STRUCT_S);
RETURN_LONG(zend_list_insert(packet, le_wddx));
}
/* }}} */
/* {{{ proto string wddx_packet_end(int packet_id)
Ends specified WDDX packet and returns the string containing the packet */
PHP_FUNCTION(wddx_packet_end)
{
zval *packet_id;
char *buf;
wddx_packet *packet;
int type, id;
if (ARG_COUNT(ht)!=1 || getParameters(ht, 1, &packet_id)==FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long(packet_id);
id = packet_id->value.lval;
packet = zend_list_find(id, &type);
if (type!=le_wddx) {
zend_error(E_WARNING, "%d is not a valid WDDX packet id", id);
RETURN_FALSE;
}
_php_wddx_add_chunk(packet, WDDX_STRUCT_E);
_php_wddx_packet_end(packet);
buf = _php_wddx_gather(packet);
zend_list_delete(id);
RETURN_STRING(buf, 0);
}
/* }}} */
/* {{{ proto int wddx_add_vars(int packet_id, . . .)
Serializes given variables and adds them to packet given by packet_id */
PHP_FUNCTION(wddx_add_vars)
{
int argc, type, id, i;
zval **args;
zval *packet_id;
wddx_packet *packet;
argc = ARG_COUNT(ht);
if (argc < 2) {
WRONG_PARAM_COUNT;
}
/* Allocate arguments array and get the arguments, checking for errors. */
args = (zval **)emalloc(argc * sizeof(zval *));
if (getParametersArray(ht, argc, args) == FAILURE) {
efree(args);
WRONG_PARAM_COUNT;
}
packet_id = args[0];
convert_to_long(packet_id);
id = packet_id->value.lval;
packet = zend_list_find(id, &type);
if (type!=le_wddx) {
zend_error(E_WARNING, "%d is not a valid WDDX packet id", id);
RETURN_FALSE;
}
for (i=1; i<argc; i++) {
_php_wddx_add_var(packet, args[i]);
}
efree(args);
RETURN_TRUE;
}
/* }}} */
/* {{{ proto mixed wddx_deserialized(string packet)
Deserializes given packet and returns a PHP value */
PHP_FUNCTION(wddx_deserialize)
{
zval *packet;
if (ARG_COUNT(ht)!=1 || getParameters(ht, 1, &packet) == FAILURE) {
WRONG_PARAM_COUNT;
}
_php_wddx_deserialize(packet, return_value);
}
/* }}} */
#endif /* HAVE_LIBEXPAT */
+3 -9
View File
@@ -1,12 +1,6 @@
# $Id$
phplibdir=$(libdir)/php
SRC=xml.c
INCLUDES=@INCLUDES@ @XML_INCLUDE@ -I@top_srcdir@ -I@top_srcdir@/libzend
INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend
noinst_LIBRARIES=libphpext_xml.a
phplib_LTLIBRARIES=libphpext_xml.la
libphpext_xml_a_SOURCES=$(SRC)
libphpext_xml_la_SOURCES=$(SRC)
libphpext_xml_la_LIBADD=@XML_LIBS@
EXTRA_LIBS=
libphpext_xml_a_SOURCES=xml.c
+8 -35
View File
@@ -1,51 +1,24 @@
# $Source$
# $Id$
dnl $Id$
AC_MSG_CHECKING(for XML support)
AC_ARG_WITH(xml,
[ --with-xml Include XML support],[
case $withval in
shared)
shared=yes
withval=yes
;;
shared,*)
shared=yes
withval=`echo $withval | sed -e 's/^shared,//'`
;;
*)
shared=no
;;
esac
if test "$withval" != "no"; then
if test "$shared" = "yes"; then
AC_MSG_RESULT([yes (shared)])
else
AC_MSG_RESULT([yes (static)])
fi
if test "$withval" = "yes"; then
test -d /usr/include/xmltok && XML_INCLUDE="-I/usr/include/xmltok"
test -d /usr/include/xml && XML_INCLUDE="-I/usr/include/xml"
test -d /usr/local/include/xml && XML_INCLUDE="-I/usr/local/include/xml"
AC_CHECK_LIB(expat, main, XML_LIBS="-lexpat", XML_LIBS="-lxmlparse -lxmltok")
XML_LIBS="-lexpat"
XML_INCLUDE=""
else
XML_LIBS="-L$withval/lib -lexpat"
if test -d $withval/include/xml; then
XML_INCLUDE="-I$withval/include/xml"
else
XML_INCLUDE="-I$withval/include"
fi
XML_INCLUDE="-I$withval/include"
fi
AC_DEFINE(HAVE_LIBEXPAT, 1)
PHP_EXTENSION(xml, $shared)
if test "$shared" != "yes"; then
EXTRA_LIBS="$EXTRA_LIBS $XML_LIBS"
fi
AC_MSG_RESULT(yes)
PHP_EXTENSION(xml)
EXTRA_LIBS="$EXTRA_LIBS $XML_LIBS"
INCLUDES="$INCLUDES $XML_INCLUDE"
else
AC_MSG_RESULT(no)
fi
],[
AC_MSG_RESULT(no)
])
AC_SUBST(XML_LIBS)
AC_SUBST(XML_INCLUDE)
+6 -8
View File
@@ -29,13 +29,13 @@
/* $Id$ */
#ifndef _PHP_XML_H
# define _PHP_XML_H
#if HAVE_LIBEXPAT
# ifndef _PHP_XML_H
# define _PHP_XML_H
# endif
# if HAVE_LIBEXPAT
#include <xmltok.h>
#include <xmlparse.h>
#include <xml/xmltok.h>
#include <xml/xmlparse.h>
#ifdef XML_UNICODE
# error "UTF-16 Unicode support not implemented!"
@@ -129,8 +129,6 @@ PHP_FUNCTION(xml_parse_into_struct);
#define phpext_xml_ptr xml_module_ptr
# endif /* _PHP_XML_H */
/*
* Local variables:
* tab-width: 4
+19 -56
View File
@@ -18,12 +18,6 @@
/* $Id$ */
#define IS_EXT_MODULE
/* boldly assume that if PIC is defined, we are being compiled dynamically */
#ifdef PIC
# define COMPILE_DL 1
#endif
#if COMPILE_DL
# if PHP_31
# include "../phpdl.h"
@@ -98,44 +92,27 @@ DLEXPORT php3_module_entry *get_module() { return &xml_module_entry; };
#if PHP_API_VERSION >= 19990421
#define php3tls_pval_destructor(a) zval_dtor(a)
#endif
/* {{{ php3i_long_pval() */
PHPAPI pval *php3i_long_pval(long value)
static pval *php3i_long_pval(long value)
{
pval *ret = emalloc(sizeof(pval));
ret->type = IS_LONG;
ret->value.lval = value;
return ret;
pval *ret = emalloc(sizeof(pval));
ret->type = IS_LONG;
ret->value.lval = value;
INIT_PZVAL(ret);
return ret;
}
/* }}} */
/* {{{ php3i_double_pval() */
PHPAPI pval *php3i_double_pval(double value)
static pval *php3i_string_pval(const char *str)
{
pval *ret = emalloc(sizeof(pval));
ret->type = IS_DOUBLE;
ret->value.dval = value;
return ret;
}
/* }}} */
/* {{{ php3i_string_pval() */
PHPAPI pval *php3i_string_pval(const char *str)
{
pval *ret = emalloc(sizeof(pval));
int len = strlen(str);
ret->type = IS_STRING;
ret->value.str.len = len;
ret->value.str.val = estrndup(str, len);
return ret;
}
/* }}} */
pval *ret = emalloc(sizeof(pval));
int len = strlen(str);
ret->type = IS_STRING;
ret->value.str.len = len;
INIT_PZVAL(ret);
ret->value.str.val = estrndup(str, len);
return ret;
}
/* end of UGLY HACK!!! */
@@ -641,21 +618,7 @@ static int php3i_xmlcharlen(const XML_Char *s)
}
/* }}} */
/* {{{ php3i_pval_strdup() */
PHPAPI char *php3i_pval_strdup(pval *val)
{
if (val->type == IS_STRING) {
char *buf = emalloc(val->value.str.len + 1);
memcpy(buf, val->value.str.val, val->value.str.len);
buf[val->value.str.len] = '\0';
return buf;
}
return NULL;
}
/* }}} */
/* {{{ php3i_add_to_info */
/* {{{ php3i_add_to_info */
static void php3i_add_to_info(xml_parser *parser,char *name)
{
pval **element, *values;
@@ -682,7 +645,7 @@ static void php3i_add_to_info(xml_parser *parser,char *name)
}
/* }}} */
/* {{{ php3i_xml_startElementHandler() */
/* {{{ php3i_xml_startElementHandler() */
void php3i_xml_startElementHandler(void *userData, const char *name,
const char **attributes)
+2 -2
View File
@@ -1,8 +1,8 @@
Name: php4_module
ConfigStart
RULE_WANTHSREGEX=@HSREGEX@
LDFLAGS_SHLIB="@RAW_RPATHS@ $LDFLAGS_SHLIB"
LIBS="@RPATHS@ @PHP_LIBS@ @EXTRA_LIBS@ @LIBS@ @RDYNAMIC_LFLAGS@ $LIBS"
LDFLAGS_SHLIB="@RPATHS@ $LDFLAGS_SHLIB"
LIBS="@PHP_LIBS@ @EXTRA_LIBS@ @LIBS@ @RDYNAMIC_LFLAGS@ $LIBS"
RULE_HIDE=yes
CFLAGS="$CFLAGS -I@abs_srcdir@ -I@abs_srcdir@/libzend -I@abs_builddir@/libzend -I@abs_builddir@"
ConfigEnd
+285 -2043
View File
File diff suppressed because it is too large. Load diff
+740 -2706
View File
File diff suppressed because it is too large. Load diff
+5 -7
View File
@@ -426,20 +426,18 @@ PHPAPI void php3_error(int type, const char *format,...)
}
}
if (PG(track_errors)) {
pval *tmp;
pval tmp;
va_start(args, format);
size = vsnprintf(buffer, sizeof(buffer) - 1, format, args);
va_end(args);
buffer[sizeof(buffer) - 1] = 0;
tmp = (pval *)emalloc(sizeof(pval));
INIT_PZVAL(tmp);
tmp->value.str.val = (char *) estrndup(buffer, size);
tmp->value.str.len = size;
tmp->type = IS_STRING;
tmp.value.str.val = (char *) estrndup(buffer, size);
tmp.value.str.len = size;
tmp.type = IS_STRING;
_php3_hash_update(EG(active_symbol_table), "php_errormsg", sizeof("php_errormsg"), (void **) & tmp, sizeof(pval *), NULL);
_php3_hash_update(EG(active_symbol_table), "php_errormsg", sizeof("php_errormsg"), (void *) & tmp, sizeof(pval), NULL);
}
switch (type) {
-2
View File
@@ -149,8 +149,6 @@ int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_headers_str
if (!strcasecmp(header_name, "Content-Type")) {
r->content_type = pstrdup(r->pool, header_content);
} else if (!strcasecmp(header_name, "Set-Cookie")) {
table_add(r->headers_out, header_name, header_content);
} else {
table_set(r->headers_out, header_name, header_content);
}
+7
View File
@@ -0,0 +1,7 @@
<?
$a->foo[4][32]["bar"] = 9;
print "------------------------------\n";
$a->foo[4][32]["bar"];
+47
View File
@@ -0,0 +1,47 @@
FOR IMMEDIATE RELEASE
PHP 3.0 RELEASED
June 6, 1998 -- The PHP Development Team announced the release of
PHP 3.0, the latest release of the server-side scripting solution already
in use on over 70,000 World Wide Web sites.
This all-new version of the popular scripting language includes support
for all major operating systems (Windows 95/NT, most versions of Unix,
and Macintosh) and web servers (including Apache, Netscape servers,
WebSite Pro, and Microsoft Internet Information Server).
PHP 3.0 also supports a wide range of databases, including Oracle, Sybase,
Solid, MySQ, mSQL, and PostgreSQL, as well as ODBC data sources.
New features include persistent database connections, support for the
SNMP and IMAP protocols, and a revamped C API for extending the language
with new features.
"PHP is a very programmer-friendly scripting language suitable for
people with little or no programming experience as well as the
seasoned web developer who needs to get things done quickly. The
best thing about PHP is that you get results quickly," said
Rasmus Lerdorf, one of the developers of the language.
"Version 3 provides a much more powerful, reliable and efficient
implementation of the language, while maintaining the ease of use and
rapid development that were the key to PHP's success in the past",
added Andi Gutmans, one of the implementors of the new language core.
"At Circle Net we have found PHP to be the most robust platform for
rapid web-based application development available today," said Troy
Cobb, Chief Technology Officer at Circle Net, Inc. "Our use of PHP
has cut our development time in half, and more than doubled our client
satisfaction. PHP has enabled us to provide database-driven dynamic
solutions which perform at phenomenal speeds."
PHP 3.0 is available for free download in source form and binaries for
several platforms at http://www.php.net/.
The PHP Development Team is an international group of programmers who
lead the open development of PHP and related projects.
For more information, the PHP Development Team can be contacted at
core@php.net.