Extended CHM PHP Grammar manual diy_php Tutorial

Source: Internet
Author: User
Tags php website xml xsl xsl
Extended CHM PHP Grammar manual DIY

1. Main features of the Extended CHM
Customizable Right-click menu
PHP code blocks are highlighted in syntax
A function in a PHP code block with a corresponding function manual link
Clearer manual interface
You can customize the appearance style of the manual
Support Skin changing function
More detailed manual content
Very useful user notes included
Can be integrated in most IDES and editors
For more information, please visit
< >



2. Why DIY
I do not know why, such a good thing on the official website of PHP has not been updated for a long time (the latest official
Version was released in 2003.9.6). Especially after the release of PHP5 is a lot of content can not be found, the
To only carry forward the DIY spirit, to make their own. ^_^

3. Pre-knowledge
The use of the CVS client.
The basic operation of Linux environment, as well as the compilation and installation of software.

4. Software Requirements
CVS Client software:
We want to get the latest version of Phpdoc via the CVS server on the official PHP website.
Wincvs Chinese version recommended in Windows environment
< Ncvs/>>
The Unix camp's operating system typically comes with CVS clients,
You can check if CVS is installed by typing "CVS version" directly under the command line.
If not installed, from
< > Download the latest version
Ben's CVS Client
Windows Operating System:
Need to run Microsoft Html help Workshop in Windows system to generate CHM files
You can also run wine under Linux to emulate Windows
Microsoft Html Help Workshop
Microsoft releases a tool for creating CHM files
< Workshop>>
Linux Operating System:
We need to compile and install the manuals and some prerequisite packages here,
You can also use other Unix-camp systems,
Or simply use Cygwin, VMware and other software to emulate a Linux environment under Windows
PHP4.0 or later:
PHP is required to compile and build the CHM file, so you need to be in the Windows and Linux environment
All install PHP.
The environment used in this article:
Two PCs, each equipped with Redhat 9 and Windows Professional

5. Start DIY
First, in the Linux machine
Installing Openjada and OPENSP
Go to the Linux console

Code:--------------------------------------------------------------------------------
$mkdir/home/phpdoc
$CD/home/phpdoc
$wget "Http://prdownloads.sourceforge.net/openjade/openjade-1.3.2.tar.gz"
$wget "Http://prdownloads.sourceforge.net/openjade/OpenSP-1.5.1.tar.gz"
$tar-ZXVF *.tar.gz
$CD openjade-1.3.2
$./configure
$make
$make Install
$CD: /opensp-1.5.1
$./configure
$make
$make Install
$CD: /
--------------------------------------------------------------------------------

Then we'll get the latest version of Phpdoc from the official CVS server in PHP.

Code:--------------------------------------------------------------------------------
$export cvsroot=:p server:cvsread@cvs.php.net:/repository
$CVS-z9 Checkout Phpdoc
$CD Phpdoc
$cvs update-dp-d "December, 2002 11:00pm" XSL
$cvs up-a Xsl/version.xml xsl/docbook/html/chunker.xsl
--------------------------------------------------------------------------------

Set compilation parameters

Code:--------------------------------------------------------------------------------
$autoconf
$./configure--with-chm=yes--with-lang=en
--------------------------------------------------------------------------------

At this point, we need to make some minor corrections.
Open/home/phpdoc/phpdoc/xsl/htmlhelp-db.xsl with editor
Search for "@DOCBOOKXSL_HTML @" in this file,
Replace it with "./docbook/html/chunk.xsl", side-by-side disc exit
And then open/home/phpdoc/phpdoc/xsl/html-common.xsl.
Add the following code to the tail of the fileA row above, and a parallel disk exits

Code:--------------------------------------------------------------------------------



select= "' Http://www.w3.org/TR/html4/loose.dtd '"/>

--------------------------------------------------------------------------------

Then proceed with the compile operation,

Code:--------------------------------------------------------------------------------
$make chm_xsl
--------------------------------------------------------------------------------

After the compilation is complete, we need to get the latest list of PHP mirror sites, and user note files

Code:--------------------------------------------------------------------------------
$CD HTMLHelp
$wget "Http://www.php.net/include/mirrors.inc"
$wget "HTTP://WWW.PHP.NET/BACKEND/NOTES/ALL.BZ2"
$bunzip 2 all.bz2
Cd.. /
--------------------------------------------------------------------------------

The generated files can be sent to a package and transferred to a Windows machine.

Code:--------------------------------------------------------------------------------
TAR-CZVF phpdoc.tar.gz./htmlhelp
--------------------------------------------------------------------------------

Here, the operations that need to be performed on the Linux platform are completed.
From now on, go to the Windows environment
First, unzip the phpdoc.tar.gz that you just generated
Because of the errors in the links to the related functions in some of the files generated after the version I obtained
So I need to modify the htmlhelp/filter_files.php file.
First add the following code to its head

PHP Code:--------------------------------------------------------------------------------
Fix functions Link Error
function Fix_function_link ($m) {
$fname 1 = ' function '. Strtolower (Str_replace (' _ ', '-', $m [1])). HTML ';
$fname 2 = ' function '. Strtolower (Str_replace (' _ ', '. ', $m [1])). HTML ';
if (file_exists ("html/". $fname 1)) {
Return ' '. $m [1]. ' ()';
}elseif (file_exists ("html/". $fname 2)) {
Return ' '. $m [1]. ' ()';
}else{
Return ' '. $m [1]. ' ()';
}
}

--------------------------------------------------------------------------------

Then find the following code in the file

PHP Code:--------------------------------------------------------------------------------
Read in the contents of the source file
$content = Join ("", File ("$HTML _src/$filename"));

--------------------------------------------------------------------------------

Change it to

PHP Code:--------------------------------------------------------------------------------
Read in the contents of the source file
$content = Join ("", File ("$HTML _src/$filename"));
$content = Str_replace ("»", "»", $content);
$reg _fix = '/'. Preg_quote (' ', "/").' (\w+) \ (\) '. Preg_quote ('', "/").' /is ';
$content = Preg_replace_callback ($reg _fix, ' Fix_function_link ', $content);
$reg _fix = '/'. Preg_quote (' ', "/").' (\w+) \ (\) '. Preg_quote ('', "/").' /is ';
$content = Preg_replace_callback ($reg _fix, ' Fix_function_link ', $content);

--------------------------------------------------------------------------------

After saving, rename "Htmlhelp\local_vars.php.src" to
"Htmlhelp\local_vars.php"
Edit "htmlhelp\local_vars.php",
Set the $HELP _workshop variable value to the installation directory of Html help WORKSHOP
Out
Add the directory where the Php.exe is located in the PATH environment variable.
In run, type cmd into console mode and enter Phpdoc.tar.gz's release directory

Code:--------------------------------------------------------------------------------
CD HTMLHelp
Make_chm.bat
--------------------------------------------------------------------------------

By the end of its execution, the Extended CHM version of the PHP grammar manual was generated.
stored in the Htmlhelp/release directory
Re-download
< , and save in the manual directory
to perform this procedure, you can set the right-click menu in the manual, the skin used, and so on. After the
setting is complete, double-click Php_manual_en.chm to browse the manual. (Source: viphot)

http:// www.bkjia.com/PHPjc/314131.html www.bkjia.com true http:// www.bkjia.com/PHPjc/314131.html techarticle extended CHM PHP Grammar manual DIY 1. Main features of the Extended CHM customizable right-click menu PHP code block syntax highlighting the functions in the PHP code block with the corresponding function manual chain ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.