PHP Inspection Unit for Borland Delphi

© 2004 - 2005 by David "mirage228" Fekete. All rights reserved.

With the PHP Inspection Unit for Borland Delphi you can analyze PHP files in Borland Delphi. You can enumerate functions, classes, interfaces and many more PHP constructs.

Table of contents



Features

Key features of the PHP Inspection Unit:


Installation

Requirements to run:

List of files shipped in the PHP Inspector Package:

You need all of this files to use the PHP Inspection Unit in your application.
All .pas files are only required at design-time, the PCRE.dll is required at runtime,
so you must ship this DLL with your application!

To use the PHP Inspection in your Delphi Application follow the following steps:
  1. Copy all .PAS files in a directory of your choice and include this path into the Librarypath of Borland Delphi, if necessary.
    Tip: Put the files in the Lib directory of your Delphi installation. This path is already part of the Librarypath of Delphi so must not modify the Librarypath.

  2. Copy the PCRE.dll into the directory of your Application or in any other directory that is listed in the global PATH Enviornment variable.



Usage

To use the PHP Inspection Unit in your Application you must add the Unit to your uses-List.

Example:

If your uses-list looks like this:
  uses
    Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms;
  

Change it into:
  uses
    Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
    uPHPInspector;
  


The TPHPSource class, that is inside the unit, provides all required functionality.

Example:

  var
    MySource: TPHPSource;
    I: Integer;
  begin
    MySource := TPHPSource.Create(SomeString);
    try
      ShowMessage('There are ' + IntToStr(MySource.ClassCount) + ' classes in the text!');
      
      // Enumerate all classes and display their names!
      for i := 0 to MySource.ClassCount-1 do
      begin
        ShowMessage(MySource.Classes[i].Name);
      end;
    finally
      MySource.Free;
    end;
  end;
  
The Variable SomeString (which is a string) contains the supplied PHP source text.
You could also use Memo1.Text or any other string-variable or -constant.
You may also set a new source text by using the SourceText property of the TPHPSource class.

Note: You can download an extended sample application from the PHP Inspection Unit homepage.


Credits and Licence

PHP Inspection Unit for Borland Delphi
  © 2004 - 2005 by David Fekete
  
http://www.mirage228.net,
  mirage228@gmx.net
  All rights reserved.

-----------------------------------------------------------------------------
Licence:

  The contents of this file are subject to the Mozilla Public License Version
  1.1 (the "License"); you may not use this file except in compliance with the
  License. You may obtain a copy of the License at http://www.mozilla.org/MPL/

  Software distributed under the License is distributed on an "AS IS" basis,
  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
  the specific language governing rights and limitations under the License.

  The Original Code is: uPHPInspector.pas, released on November 1 2004

  The Initial Developer of the Original Code is David Fekete.
  Portions created by David Fekete are Copyright (c) 2004 - 2005 David Fekete.
  All Rights Reserved.

-----------------------------------------------------------------------------
PCRE 5.0 Wrapper for Delphi 7 © 2003 - 2004 by Renato Mancuso,
  http://www.renatomancuso.com
  All rights reserved.

-----------------------------------------------------------------------------
PCRE 5.0 by
  Philip Hazel <ph10@cam.ac.uk>
  University of Cambridge Computing Service,
  Cambridge, England. Phone: +44 1223 334714.

  Copyright © 1997-2004 University of Cambridge
  All rights reserved.