[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

editing the php source module

Posted on 2003-10-31
7
Medium Priority
?
265 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

650 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