Location: PHPKode > scripts > CISVC > cisvc/cisvcclass.readme.html
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<p>A PHP class to encapsulate the Microsoft Indexing Service (cisvc). Tested under 
  version 3.0 of Indexing Service on Windows 2000 and IIS5.</p>
<p>NOTE: I am not a professional programmer or web page author. This code should 
  be used for educational purposes and should be highly suspect in a production 
<p>Contents <br />
  cisvcclass.inc.php - the class definition<br />
  search.php - an example page using the class<br />
  search1.php - an example page that is not using the class.</p>
<p>I began by translating the ASP example from <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/indexsrv/html/ixuwebqy_0r3m.asp">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/indexsrv/html/ixuwebqy_0r3m.asp</a> 
  into PHP and then built the class to support a similar page but makig it easier. 
  This is shown in search1.php.</p>
<p>During the attempt to translate the page from ASP to PHP, I discovered that 
  I could not save the record set across PHP sessions as was done in the Microsoft 
  example. This probably makes this class useless in a production environment 
  as the ASP version would be superior in performance and the class can only work 
  on Microsoft OS. Instead of preserving the record set across sessions, I instead 
  created a new record set on each run and then use a page counter to jump within 
  the larger record set.</p>
<p>The example page attempts to be very close to the ASP original. The PHP test 
  page search.php is pretty close to the original example but does show some additional 
  features like how to select a different page size.</p>
<p>Constructor <br />
  <font size="-1" face="Courier New, Courier, mono">cisvc ($strSearchString, $iCurrPage 
  = 0, $iPageSize=10, $strColumns=&quot;doctitle, vpath, path, filename, characterization, 
  size, write&quot;)</font><br />
  $strSearchString is the string to be searched for in the index.<br />
  $iCurrPage allows you to specify a starting point in the record set other than 
  the beginning. This offset is 0 indexed but most display is in human form so 
  I add one before displaying.<br />
  $iPageSize is an optional parameter to specify how many pages should be stored 
  in the record set. The default is 10. If specified, it must be specified the 
  same on every call or the pages get confused.<br />
  $strColumns is the fields to be collected in the record set. The first 4 are 
  pretty much mandatory to get a useful search. The last three (characterization, 
  size, write) are pretty optional. Additional fields are documented within MSDN. 
  The available fields vary based on what software is installed. vpath is only 
  available in the Web Index. Additional fields are available if Site Server ( 
  a Microsoft content management product) are installed.</p>
<p>Most interesting method<br />
  HTMLShowPage()<br />
  Dumps the output in a nice form. Uses style that should be defined in the calling 
  script to format output. <br />
  Weakness 1 -- I tried but failed to get around using the &lt;dd&gt; entry. When 
  I used style to get an indentation, the right side wrapped badly in IE.<br />
  Weakness 2 -- The path to the server in the HTML &lt;a&gt; is hardcoded to be 
  the current server. It is possible to use Content Index to index a foreign server 
  but I infer from the documentation that this requires Site Server and it would 
  provide the additional fields to find out what the real server is.</p>
Return current item: CISVC