mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Updated visual text elements using markdown
This commit is contained in:
parent
47c5fa0710
commit
80f3c69ae9
4 changed files with 25 additions and 34 deletions
|
@ -1,5 +1,4 @@
|
||||||
Input Filter Support in PHP 5
|
# Input Filter Support in PHP 5
|
||||||
-----------------------------
|
|
||||||
|
|
||||||
XSS (Cross Site Scripting) hacks are becoming more and more prevalent,
|
XSS (Cross Site Scripting) hacks are becoming more and more prevalent,
|
||||||
and can be quite difficult to prevent. Whenever you accept user data
|
and can be quite difficult to prevent. Whenever you accept user data
|
||||||
|
@ -21,6 +20,7 @@ $_POST, $_GET and $_COOKIE arrays are only populated with stripped
|
||||||
data. In this simple example all I am doing is calling strip_tags() on
|
data. In this simple example all I am doing is calling strip_tags() on
|
||||||
the data.
|
the data.
|
||||||
|
|
||||||
|
```
|
||||||
ZEND_BEGIN_MODULE_GLOBALS(my_input_filter)
|
ZEND_BEGIN_MODULE_GLOBALS(my_input_filter)
|
||||||
zval *post_array;
|
zval *post_array;
|
||||||
zval *get_array;
|
zval *get_array;
|
||||||
|
@ -180,3 +180,4 @@ PHP_FUNCTION(my_get_raw)
|
||||||
RETVAL_FALSE;
|
RETVAL_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
====================
|
# Mailinglist Rules
|
||||||
Mailinglist Rules
|
|
||||||
====================
|
|
||||||
|
|
||||||
This is the first file you should be reading before doing any posts on PHP
|
This is the first file you should be reading before doing any posts on PHP
|
||||||
mailinglists. Following these rules is considered imperative to the success of
|
mailinglists. Following these rules is considered imperative to the success of
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
HOW TO CREATE A SELF-CONTAINED PHP EXTENSION
|
# HOW TO CREATE A SELF-CONTAINED PHP EXTENSION
|
||||||
|
|
||||||
A self-contained extension can be distributed independently of
|
A self-contained extension can be distributed independently of
|
||||||
the PHP source. To create such an extension, two things are
|
the PHP source. To create such an extension, two things are
|
||||||
|
@ -10,7 +10,7 @@ HOW TO CREATE A SELF-CONTAINED PHP EXTENSION
|
||||||
We will describe now how to create these and how to put things
|
We will describe now how to create these and how to put things
|
||||||
together.
|
together.
|
||||||
|
|
||||||
PREPARING YOUR SYSTEM
|
## PREPARING YOUR SYSTEM
|
||||||
|
|
||||||
While the result will run on any system, a developer's setup needs these
|
While the result will run on any system, a developer's setup needs these
|
||||||
tools:
|
tools:
|
||||||
|
@ -23,7 +23,7 @@ PREPARING YOUR SYSTEM
|
||||||
|
|
||||||
ftp://ftp.gnu.org/pub/gnu/
|
ftp://ftp.gnu.org/pub/gnu/
|
||||||
|
|
||||||
CONVERTING AN EXISTING EXTENSION
|
## CONVERTING AN EXISTING EXTENSION
|
||||||
|
|
||||||
Just to show you how easy it is to create a self-contained
|
Just to show you how easy it is to create a self-contained
|
||||||
extension, we will convert an embedded extension into a
|
extension, we will convert an embedded extension into a
|
||||||
|
@ -56,7 +56,7 @@ CONVERTING AN EXISTING EXTENSION
|
||||||
library or the MySQL installation in MYSQL-DIR.
|
library or the MySQL installation in MYSQL-DIR.
|
||||||
|
|
||||||
|
|
||||||
DEFINING THE NEW EXTENSION
|
## DEFINING THE NEW EXTENSION
|
||||||
|
|
||||||
Our demo extension is called "foobar".
|
Our demo extension is called "foobar".
|
||||||
|
|
||||||
|
@ -72,13 +72,13 @@ DEFINING THE NEW EXTENSION
|
||||||
LTLIBRARY_SOURCES specifies the names of the sources files. You can
|
LTLIBRARY_SOURCES specifies the names of the sources files. You can
|
||||||
name an arbitrary number of source files here.
|
name an arbitrary number of source files here.
|
||||||
|
|
||||||
CREATING THE M4 CONFIGURATION FILE
|
## CREATING THE M4 CONFIGURATION FILE
|
||||||
|
|
||||||
The m4 configuration can perform additional checks. For a
|
The m4 configuration can perform additional checks. For a
|
||||||
self-contained extension, you do not need more than a few
|
self-contained extension, you do not need more than a few
|
||||||
macro calls.
|
macro calls.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
```
|
||||||
PHP_ARG_ENABLE([foobar],
|
PHP_ARG_ENABLE([foobar],
|
||||||
[whether to enable foobar],
|
[whether to enable foobar],
|
||||||
[AS_HELP_STRING([--enable-foobar],
|
[AS_HELP_STRING([--enable-foobar],
|
||||||
|
@ -87,7 +87,7 @@ PHP_ARG_ENABLE([foobar],
|
||||||
if test "$PHP_FOOBAR" != "no"; then
|
if test "$PHP_FOOBAR" != "no"; then
|
||||||
PHP_NEW_EXTENSION(foobar, foo.c bar.c, $ext_shared)
|
PHP_NEW_EXTENSION(foobar, foo.c bar.c, $ext_shared)
|
||||||
fi
|
fi
|
||||||
------------------------------------------------------------------------------
|
```
|
||||||
|
|
||||||
PHP_ARG_ENABLE will automatically set the correct variables, so
|
PHP_ARG_ENABLE will automatically set the correct variables, so
|
||||||
that the extension will be enabled by PHP_NEW_EXTENSION in shared mode.
|
that the extension will be enabled by PHP_NEW_EXTENSION in shared mode.
|
||||||
|
@ -100,7 +100,7 @@ fi
|
||||||
plan to distribute your module with PHP, these facilities allow you
|
plan to distribute your module with PHP, these facilities allow you
|
||||||
to integrate your module easily into the main PHP module framework.
|
to integrate your module easily into the main PHP module framework.
|
||||||
|
|
||||||
CREATING SOURCE FILES
|
## CREATING SOURCE FILES
|
||||||
|
|
||||||
ext_skel can be of great help when creating the common code for all modules
|
ext_skel can be of great help when creating the common code for all modules
|
||||||
in PHP for you and also writing basic function definitions and C code for
|
in PHP for you and also writing basic function definitions and C code for
|
||||||
|
@ -111,7 +111,7 @@ CREATING SOURCE FILES
|
||||||
modules, use a simple module as a starting point and add your own code.
|
modules, use a simple module as a starting point and add your own code.
|
||||||
|
|
||||||
|
|
||||||
CREATING THE SELF-CONTAINED EXTENSION
|
## CREATING THE SELF-CONTAINED EXTENSION
|
||||||
|
|
||||||
Put config.m4 and the source files into one directory. Then, run phpize
|
Put config.m4 and the source files into one directory. Then, run phpize
|
||||||
(this is installed during make install by PHP 4.0).
|
(this is installed during make install by PHP 4.0).
|
||||||
|
@ -125,7 +125,7 @@ CREATING THE SELF-CONTAINED EXTENSION
|
||||||
|
|
||||||
And that's it. You now have a self-contained extension.
|
And that's it. You now have a self-contained extension.
|
||||||
|
|
||||||
INSTALLING A SELF-CONTAINED EXTENSION
|
## INSTALLING A SELF-CONTAINED EXTENSION
|
||||||
|
|
||||||
An extension can be installed by running:
|
An extension can be installed by running:
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ INSTALLING A SELF-CONTAINED EXTENSION
|
||||||
[--with-php-config=/path/to/php-config]
|
[--with-php-config=/path/to/php-config]
|
||||||
$ make install
|
$ make install
|
||||||
|
|
||||||
ADDING SHARED MODULE SUPPORT TO A MODULE
|
## ADDING SHARED MODULE SUPPORT TO A MODULE
|
||||||
|
|
||||||
In order to be useful, a self-contained extension must be loadable
|
In order to be useful, a self-contained extension must be loadable
|
||||||
as a shared module. I will explain now how you can add shared module
|
as a shared module. I will explain now how you can add shared module
|
||||||
|
@ -148,11 +148,13 @@ ADDING SHARED MODULE SUPPORT TO A MODULE
|
||||||
|
|
||||||
3. Add the following lines to your C source file:
|
3. Add the following lines to your C source file:
|
||||||
|
|
||||||
|
```
|
||||||
#ifdef COMPILE_DL_FOO
|
#ifdef COMPILE_DL_FOO
|
||||||
ZEND_GET_MODULE(foo)
|
ZEND_GET_MODULE(foo)
|
||||||
#endif
|
#endif
|
||||||
|
```
|
||||||
|
|
||||||
PECL SITE CONFORMITY
|
## PECL SITE CONFORMITY
|
||||||
|
|
||||||
If you plan to release an extension to the PECL website, there are several
|
If you plan to release an extension to the PECL website, there are several
|
||||||
points to be regarded.
|
points to be regarded.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
PHP Build System V5 Overview
|
# PHP Build System V5 Overview
|
||||||
|
|
||||||
- supports Makefile.ins during transition phase
|
- supports Makefile.ins during transition phase
|
||||||
- not-really-portable Makefile includes have been eliminated
|
- not-really-portable Makefile includes have been eliminated
|
||||||
|
@ -21,28 +21,21 @@ PHP Build System V5 Overview
|
||||||
- upgraded shtool to 1.5.4
|
- upgraded shtool to 1.5.4
|
||||||
- removed $(moduledir) (use EXTENSION_DIR)
|
- removed $(moduledir) (use EXTENSION_DIR)
|
||||||
|
|
||||||
The Reason For a New System
|
## The Reason For a New System
|
||||||
|
|
||||||
It became more and more apparent that there is a severe need
|
It became more and more apparent that there is a severe need
|
||||||
for addressing the portability concerns and improving the chance
|
for addressing the portability concerns and improving the chance
|
||||||
that your build is correct (how often have you been told to
|
that your build is correct (how often have you been told to
|
||||||
"make clean"? When this is done, you won't need to anymore).
|
"make clean"? When this is done, you won't need to anymore).
|
||||||
|
|
||||||
|
## If You Build PHP on a Unix System
|
||||||
If You Build PHP on a Unix System
|
|
||||||
|
|
||||||
|
|
||||||
You, as a user of PHP, will notice no changes. Of course, the build
|
You, as a user of PHP, will notice no changes. Of course, the build
|
||||||
system will be faster, look better and work smarter.
|
system will be faster, look better and work smarter.
|
||||||
|
|
||||||
|
## If You Are Developing PHP
|
||||||
|
|
||||||
|
### Extension developers:
|
||||||
If You Are Developing PHP
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Extension developers:
|
|
||||||
|
|
||||||
Makefile.ins are abandoned. The files which are to be compiled
|
Makefile.ins are abandoned. The files which are to be compiled
|
||||||
are specified in the config.m4 now using the following macro:
|
are specified in the config.m4 now using the following macro:
|
||||||
|
@ -95,8 +88,7 @@ change the working directory anymore, we must use either
|
||||||
absolute paths or relative ones to the top build-directory.
|
absolute paths or relative ones to the top build-directory.
|
||||||
Correct prefixing ensures that.
|
Correct prefixing ensures that.
|
||||||
|
|
||||||
|
### SAPI developers:
|
||||||
SAPI developers:
|
|
||||||
|
|
||||||
Instead of using PHP_SAPI=foo/PHP_BUILD_XYZ, you will need to type
|
Instead of using PHP_SAPI=foo/PHP_BUILD_XYZ, you will need to type
|
||||||
|
|
||||||
|
@ -110,9 +102,7 @@ For example for APXS:
|
||||||
|
|
||||||
PHP_SELECT_SAPI(apache, shared, sapi_apache.c mod_php7.c php_apache.c)
|
PHP_SELECT_SAPI(apache, shared, sapi_apache.c mod_php7.c php_apache.c)
|
||||||
|
|
||||||
|
## General info
|
||||||
|
|
||||||
General info
|
|
||||||
|
|
||||||
The foundation for the new system is the flexible handling of
|
The foundation for the new system is the flexible handling of
|
||||||
sources and their contexts. With the help of macros you
|
sources and their contexts. With the help of macros you
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue