<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1015907" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1015907</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sourceviewer-11-beta#comment-1092382</link>
    <description> &lt;p&gt;Logic looks good, as for the variable in the path problem, if PHP is like ASP then it will be impossible, since include files (and their vars) are processed before any ASP code.&lt;/p&gt;
&lt;p&gt;That&#039;s some neat code!&lt;/p&gt;
 </description>
     <pubDate>Wed, 24 Oct 2001 13:19:06 +0000</pubDate>
 <dc:creator>Peter J. Boettcher</dc:creator>
 <guid isPermaLink="false">comment 1092382 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>An update...</title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sourceviewer-11-beta#comment-1092343</link>
    <description> &lt;p&gt;I&#039;ll give you an outline (psuedo-code) of what I&#039;ve got now, then see if anyone can come up with something better.&lt;/p&gt;
&lt;p&gt;1) pattern match for all included files, load into array1&lt;/p&gt;
&lt;p&gt;2) loop through array built in #1&lt;br /&gt;
3) if filename starts with &quot;/&quot; (using an absolute path)&lt;br /&gt;
4) check if file exists, if so, store in array2&lt;br /&gt;
5) else (using relative path)&lt;br /&gt;
6) change to directory of file whose source is being printed&lt;br /&gt;
7) change to directory of found included file (line 1)&lt;br /&gt;
&lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/nerdy.png&quot; title=&quot;Cool&quot; alt=&quot;Cool&quot; class=&quot;smiley-content&quot; /&gt; create var containing the current working directory appended by filename of found included file&lt;br /&gt;
9) check if file (in line 10) exists, if so store it in array2&lt;br /&gt;
10) end if&lt;br /&gt;
11) end loop&lt;/p&gt;
&lt;p&gt;12) extract unique paths which were stored in array2 on lines 5 and 11&lt;/p&gt;
&lt;p&gt;13) loop through array created on line 13&lt;br /&gt;
14) create link to file, and store in array3&lt;br /&gt;
15) end loop&lt;/p&gt;
&lt;p&gt;16) print array of included files&lt;/p&gt;
&lt;p&gt;If your familiar with PHP, you may prefer looking at the code &lt;a href=&quot;http://24.177.52.222:801/sourceviewer_dev.php?file=sourceviewer_dev.php&amp;amp;numbers=true&quot; class=&quot;bb-url&quot;&gt;here&lt;/a&gt;.  Lines 303 to 403.&lt;/p&gt;
&lt;p&gt;My feeble little mind thinks that this will accomodate files that are included using absolute paths or relative paths.  I&#039;m thinking that it&#039;s near impossible to handle files with vars in the path.&lt;/p&gt;
&lt;p&gt;Any thoughts?&lt;/p&gt;
 </description>
     <pubDate>Wed, 24 Oct 2001 07:27:55 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1092343 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sourceviewer-11-beta#comment-1092243</link>
    <description> &lt;p&gt;&lt;a href=&quot;http://www.php.net/manual/en/function.realpath.php&quot; class=&quot;bb-url&quot;&gt;realpath()&lt;/a&gt; is the PHP equivalent to ASP&#039;s Server.MapPath&lt;/p&gt;
&lt;p&gt;The more I think about this, the more my head hurts.  Problems I see...&lt;br /&gt;
1) included files being relative to the parent process&lt;br /&gt;
2) variables in include path&lt;br /&gt;
3) included files residing outside the public_html, but in the &lt;a href=&quot;http://www.php.net/manual/en/configuration.php#ini.include-path&quot; class=&quot;bb-url&quot;&gt;include_path&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Just struck me, I can evaluate the path as best I can, then do an &lt;a href=&quot;http://www.php.net/manual/en/function.is-file.php&quot; class=&quot;bb-url&quot;&gt;is_file()&lt;/a&gt; to see if I have the correct path.  If I do, create the link. If not, don&#039;t link it.&lt;/p&gt;
 </description>
     <pubDate>Tue, 23 Oct 2001 15:55:36 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1092243 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sourceviewer-11-beta#comment-1092231</link>
    <description> &lt;p&gt;I wish I could help you Mark, you know more about PHP than me! Does PHP have an equivalent method to Server.MapPath in ASP? That way everything could be relative and dynamic, including the SourceViewer file.&lt;/p&gt;
 </description>
     <pubDate>Tue, 23 Oct 2001 12:53:43 +0000</pubDate>
 <dc:creator>Peter J. Boettcher</dc:creator>
 <guid isPermaLink="false">comment 1092231 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
