?
Solved

editing the php source module

Posted on 2003-10-31
7
Medium Priority
?
257 Views
Last Modified: 2006-11-17
I need to know the following:

 

1.       How to add new function to php module

2.       In that function how to write to the http stream

3.       How to access data from sql recordset
0
Comment
Question by:buck2769
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
7 Comments
 
LVL 11

Expert Comment

by:shmert
ID: 9660984
<?php
// 1. How to add new function to php module
function myNewFunction() {
    // 2. In that function how to write to the http stream
    echo "This is being written to the HTTP response stream";
    // 3. How to access data from sql recordset
    $result = mysql_query("SELECT * FROM USER");
    while ($row = mysql_fetch_assoc($result)) {
        foreach ($row AS $key=>$value) echo "$key = $value <br />\n";
        echo "<hr />\n";
    }
}

?>
0
 
LVL 1

Author Comment

by:buck2769
ID: 10272818
Yes that would be how to do it inside a php file. Read the initial question and you will find that I want add a built in function inside of php. In other words I need to write C not PHP and then recompile PHP with my added enhancements. Thanks anyways.
0
 
LVL 14

Expert Comment

by:ThG
ID: 10275213
buck2769, are you still interested in this question? I can partially help you because I already edited php/zend source.
Otherwise I can delete this question and refund your points, let me know.
0
 
LVL 1

Author Comment

by:buck2769
ID: 10409695
yes, I am still interested
0
 
LVL 14

Accepted Solution

by:
ThG earned 2000 total points
ID: 10425194
ok then..
first you should definitely read http://www.zend.com/apidoc/
this will give an interesting starting point.

After that, IIRC, you are going to need more information about the ext_skel tool, and you can find them in README.EXT_SKEL file, included in php distribution.

After that, you can start testing your new extension (note that everything in php is filed as "extension", but you can builtin it if you want, it's not necessarily a shared module).

In my experience, i found more help in ext/standard/, which contains all basic functions of PHP. There you can understand how the parameter passing works and all other internal things that are not covered in the apidoc manual.

For the sql handling of course watch in the proper extension (ext/mysql/) and so on.
0

Featured Post

WordPress Tutorial 3: Plugins, Themes, and Widgets

The three most common changes you will make to your website involve the look (themes), the functionality (plugins), and modular elements (widgets).

In this article we will briefly define each again, and give you directions on how to install them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This article discusses how to implement server side field validation and display customized error messages to the client.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question