PHP
  Home arrow PHP arrow Adding Methods to the Query Processor in PHP
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Adding Methods to the Query Processor in PHP
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 8
    2006-05-24


    Table of Contents:
  • Adding Methods to the Query Processor in PHP
  • Reviewing previous PHP networking functions: a quick look at the "QueryProcessor" class
  • Adding more functionality to the "QueryProcessor" class: defining the "Ping()" and "IpConfig()" methods
  • More methods ahead: defining the "Netstat()" and "getMXRecordsWin()" methods
  • Gluing the pieces together: listing the full source code of the "QueryProcessor" class

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Adding Methods to the Query Processor in PHP
    ( Page 1 of 5 )

    Over this second article in a series covering network programming in PHP, you will learn how to run popular Windows network monitoring utilities, such as the “ping,” “netstat” and “ipconfig” programs, by adding some new methods to the “QueryProcessor” class introduced in the previous article.

    Introduction

    Want to learn more about the basics of network programming in PHP? Look no further. Welcome to the second part of the series "Network Programming in PHP." This set of three tutorials teaches how to use numerous networking PHP built-in functions in a practical way, in order to build a query processor in PHP 5, which can be used to perform some of the most common network operations.

    As usual, I'd like to step back for a moment to the previous article of the series, and refresh your memory of some of the topics that I explored in that tutorial. In this way, you'll be able to pick up the flow of the concepts that I'll deploy in the next few lines, without needing to reread the prior article.

    As you'll probably recall, in the first part of the series, I went through the basics of using many native PHP functions included in its networking library, and started constructing an extensible query processor class in PHP 5. During this coding experience, you hopefully learned how convert host names to their corresponding IP addresses and vice versa, how to find the number of a given TCP port that is used by a specific service, and how to list the services in conjunction with their corresponding port numbers.

    Even though most of these tasks can be considered trivial operations, they should be taken into account as an introductory and educational exercise, useful for tackling more complex PHP projects that require the implementation of advanced network programming routines. This might eventually include working with low-level sockets, handling DNS records, reading and writing socket streams, and so forth.

    Right, at this point I guess that all the networking PHP built-in functions that I covered in the first article, such as the "gethostbyaddr()", "gethostbyname()", "gethostbynamel()" functions are already familiar to you. So now I will explain what new things you'll learn in this second article of the series. Since I want to continue expanding the "QueryProcessor" class that I coded previously, this installment will focus on adding more methods to it, by using other useful PHP network functions, aimed particularly at running popular Windows networking applications, like "ipconfig," "netstat" and more.

    Having established the goals for this article, let's move on and see how the "QueryProcessor" class can be expanded by aggregating more network-based methods. Let's get started.



     
     
    >>> More PHP Articles          >>> More By Alejandro Gervasio
     

       

    PHP ARTICLES

    - Using Directory Iterators to Build Loader Ap...
    - Using the spl_autoload() Functions to Build ...
    - Working Out of the Object Context to Build L...
    - Using the _autoload() Magic Function to Buil...
    - The Destruct Magic Function in PHP 5
    - The Autoload Magic Function in PHP 5
    - Developing a Recursive Loading Class for Loa...
    - The Sleep and Wakeup Magic Functions in PHP 5
    - Using the Clone Magic Function in PHP 5
    - Including Files Recursively with Loader Appl...
    - The Call Magic Function in PHP 5
    - Designing a Captcha System with PHP and MySQL
    - Using Static Methods to Build Loader Apps in...
    - The Isset and Unset Magic Functions in PHP 5
    - Advanced PHP Form Input Validation to Check ...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT