From 80f3c69ae925b09068b0642306a8a14a42c7d25c Mon Sep 17 00:00:00 2001 From: Rodrigo Prado Date: Sat, 20 Apr 2019 23:53:02 -0300 Subject: Updated visual text elements using markdown --- docs/input-filter.md | 5 +++-- docs/mailinglist-rules.md | 4 +--- docs/self-contained-extensions.md | 26 ++++++++++++++------------ docs/unix-build-system.md | 24 +++++++----------------- 4 files changed, 25 insertions(+), 34 deletions(-) (limited to 'docs') diff --git a/docs/input-filter.md b/docs/input-filter.md index bca7f29ad2..c5307a2155 100644 --- a/docs/input-filter.md +++ b/docs/input-filter.md @@ -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, 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 the data. +``` ZEND_BEGIN_MODULE_GLOBALS(my_input_filter) zval *post_array; zval *get_array; @@ -180,3 +180,4 @@ PHP_FUNCTION(my_get_raw) RETVAL_FALSE; } } +``` diff --git a/docs/mailinglist-rules.md b/docs/mailinglist-rules.md index 8fafbd717d..c76dc7862a 100644 --- a/docs/mailinglist-rules.md +++ b/docs/mailinglist-rules.md @@ -1,6 +1,4 @@ -==================== - Mailinglist Rules -==================== +# Mailinglist Rules 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 diff --git a/docs/self-contained-extensions.md b/docs/self-contained-extensions.md index 1aaec6d6c4..84d6aaa685 100644 --- a/docs/self-contained-extensions.md +++ b/docs/self-contained-extensions.md @@ -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 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 together. -PREPARING YOUR SYSTEM +## PREPARING YOUR SYSTEM While the result will run on any system, a developer's setup needs these tools: @@ -23,7 +23,7 @@ PREPARING YOUR SYSTEM 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 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. -DEFINING THE NEW EXTENSION +## DEFINING THE NEW EXTENSION 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 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 self-contained extension, you do not need more than a few macro calls. ------------------------------------------------------------------------------- +``` PHP_ARG_ENABLE([foobar], [whether to enable foobar], [AS_HELP_STRING([--enable-foobar], @@ -87,7 +87,7 @@ PHP_ARG_ENABLE([foobar], if test "$PHP_FOOBAR" != "no"; then PHP_NEW_EXTENSION(foobar, foo.c bar.c, $ext_shared) fi ------------------------------------------------------------------------------- +``` PHP_ARG_ENABLE will automatically set the correct variables, so that the extension will be enabled by PHP_NEW_EXTENSION in shared mode. @@ -100,7 +100,7 @@ fi plan to distribute your module with PHP, these facilities allow you 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 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. -CREATING THE SELF-CONTAINED EXTENSION +## CREATING THE SELF-CONTAINED EXTENSION Put config.m4 and the source files into one directory. Then, run phpize (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. -INSTALLING A SELF-CONTAINED EXTENSION +## INSTALLING A SELF-CONTAINED EXTENSION An extension can be installed by running: @@ -133,7 +133,7 @@ INSTALLING A SELF-CONTAINED EXTENSION [--with-php-config=/path/to/php-config] $ 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 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: +``` #ifdef COMPILE_DL_FOO ZEND_GET_MODULE(foo) #endif +``` -PECL SITE CONFORMITY +## PECL SITE CONFORMITY If you plan to release an extension to the PECL website, there are several points to be regarded. diff --git a/docs/unix-build-system.md b/docs/unix-build-system.md index a184b909ba..e13053e39e 100644 --- a/docs/unix-build-system.md +++ b/docs/unix-build-system.md @@ -1,4 +1,4 @@ -PHP Build System V5 Overview +# PHP Build System V5 Overview - supports Makefile.ins during transition phase - not-really-portable Makefile includes have been eliminated @@ -21,28 +21,21 @@ PHP Build System V5 Overview - upgraded shtool to 1.5.4 - 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 for addressing the portability concerns and improving the chance that your build is correct (how often have you been told to "make clean"? When this is done, you won't need to anymore). - -If You Build PHP on a Unix System - +## If You Build PHP on a Unix System You, as a user of PHP, will notice no changes. Of course, the build system will be faster, look better and work smarter. +## If You Are Developing PHP - -If You Are Developing PHP - - - - -Extension developers: +### Extension developers: Makefile.ins are abandoned. The files which are to be compiled 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. Correct prefixing ensures that. - -SAPI developers: +### SAPI developers: 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) - - -General info +## General info The foundation for the new system is the flexible handling of sources and their contexts. With the help of macros you -- cgit v1.2.1