andy's php projects
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Script and site usage:
All of the scripts on this site are provided free for non-commerical, personal or non-profit use. If you find these scripts useful to you, appreciate the free support, or are just an all round nice person, then why not donate a little dosh? If you wish to use any of these in a commercial system, please refer to the payment plan.


Can I reference a completely different set of man pages

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> Man Page Lookup
View previous topic :: View next topic  
Author Message
fat
Newbie


Joined: 27 Jun 2004
Posts: 4

PostPosted: Sun Jun 27, 2004 6:17 am    Post subject: Can I reference a completely different set of man pages Reply with quote

First off Kudos for excellent tool.!

I am setting up a community wiki portal for a live linux distro. I want to copy all the man pages from this distro to my web hosting and use your script to reference only this set of man pages. Essentially a virtual man of the live cd distro.

Is this possible with this script?

I have to appologise in advance as php is really not my thing so I may need a bit of hand holding if you can spare the time. Wink

Appreciated,

Mark
Back to top
View user's profile Send private message
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Tue Jun 29, 2004 8:04 am    Post subject: Reply with quote

Hi, and welcome to the board.

The ease of doing this depends on how you copy them to the new server.

As I see it, you have three ways to do this:

Copy them into the man page directory

If you copy the man pages from your distro into the man page directory for that server, and your server uses the 'man' command, then it's really simple. Just use the class once you've copied them to the correct location.

Using pre-cached pages

You could setup a script to automatically create a cached page for every single man page from your distro, and then copy them into the cache folder on your server. Turn on caching in the script and there you go.

Using man pages from a different location

The script might need some tweaking, such as defining the path of your man page files, but this should be possible to do.

If none of the above helps, could you please explain the situation a little more?

Cheers,

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
fat
Newbie


Joined: 27 Jun 2004
Posts: 4

PostPosted: Tue Jun 29, 2004 8:47 am    Post subject: Reply with quote

Andy thanks for the reply.

Some more specifics to start with. I am using tikiwiki from http://tikiwiki.org/ as a community portal where users of the distro can contribute to documentation etc.

Since it is predominatly a documentation site the idea is to take as much of the documentation that exists already and populate the wiki. One great source of documentation is man. The distro itself has a large number of tools that are not on a general linux distro and as such are not so easy to find with google searches. A number of them are not even on the net are they are distributed solely in the tarball.

To go through your ideas:

Copy them into the man page directory

im pretty sure this wont work as the hosting is shared on a commercial supplier. I am not sure they would like me messing with there man setup Wink

Using pre-cached pages

this sounds like a good option although i am not sure what the logisitcs of actually doing it are. There is also the posibilty of retrieving the man page from the wrong distro if we miss any. Still a viable option though.

Using man pages from a different location

Obviously this would be an excellent solution as it completely seperates the man lookup form the native OS. What i dont really want (although i could easily live with it) is the lookup returning a man page from the OS. As i said earlier this could be the wrong man page but also if the man page exists on the web server but not on the distro the user could be tricked into thinking the tool exists on the distro when i doesn't.

As i said originally i am not a php man (no pun intended Wink but id love to try anything that could work.

Mark
Back to top
View user's profile Send private message
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Tue Jun 29, 2004 9:58 am    Post subject: Reply with quote

fat wrote:
Using man pages from a different location

Obviously this would be an excellent solution as it completely seperates the man lookup form the native OS. What i dont really want (although i could easily live with it) is the lookup returning a man page from the OS. As i said earlier this could be the wrong man page but also if the man page exists on the web server but not on the distro the user could be tricked into thinking the tool exists on the distro when i doesn't.


Check out this thread:

http://php.amnuts.com/forums/viewtopic.php?t=118

That should allow you to use the man commadn with a specific path. Instead of presenting a collection of paths, just set the one specific area you are keeping all your man pages in. Providing your hosting account has the man shell command, I think this should work nicely for you. It would also ensure that only man pages from that specific location are used, and not ones from the OS.

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
anacreo
Newbie


Joined: 18 May 2004
Posts: 4

PostPosted: Thu Jul 15, 2004 4:20 pm    Post subject: If you are going to make the patch... Reply with quote

You should also combine the patch from http://php.amnuts.com/forums/viewtopic.php?t=119

So in the end

The line similar to this (should be around line 184) will look like:
$pipe = popen('man ' . ($this->path ? "-M {$this->path} " : '' ) . ' -k \'\'', 'r');

Good luck with this! I've been working on doing a similar thing on an external site. My goal is to be able to serve man pages straight out of a zip archive that registered users can upload and maintain.

Anacreo
Back to top
View user's profile Send private message
fat
Newbie


Joined: 27 Jun 2004
Posts: 4

PostPosted: Tue Feb 14, 2006 4:55 am    Post subject: Reply with quote

Well i have been away for a while but now i am back and raring to configure this class.

I realise it is rude to ask however before i go and mess about adding these patches is there a new "pre patched" version by the author due out.?

Wherever possible i prefer not to mess about with code when i dont understand the real ramifications of what i am changing.

Kudos
Back to top
View user's profile Send private message
fat
Newbie


Joined: 27 Jun 2004
Posts: 4

PostPosted: Thu Apr 06, 2006 1:13 pm    Post subject: Reply with quote

Before i go on my merry way can i be so bold as to bumpt this thread one last time.

Ta
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> Man Page Lookup All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group