Jump to content


Photo

PEAR Newbie question...


  • Please log in to reply
4 replies to this topic

#1 russia5

russia5
  • Members
  • PipPipPip
  • Advanced Member
  • 94 posts

Posted 03 August 2006 - 06:15 PM

This is probably a basic for most of you.  But, if I want to use a function that is PEAR or PECL, how do I do it?  Cut and Paste it from somewhere on my host?  Maybe call it with a tag?

Also, how would I find out all of the extensions and libraries that my HOST has besides ask them?  Thanks...

#2 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 04 August 2006 - 01:22 AM

But, if I want to use a function that is PEAR or PECL, how do I do it?  Cut and Paste it from somewhere on my host?  Maybe call it with a tag?


Yes, include the script, then call the function or class.

Also, how would I find out all of the extensions and libraries that my HOST has besides ask them?


Use phpinfo() or ask them.

#3 Buyocat

Buyocat
  • Members
  • PipPipPip
  • Advanced Member
  • 267 posts

Posted 04 August 2006 - 01:27 AM

I may be wrong, but to use PECL I believe you need to recompile PHP with the extensions flagged.  As for PEAR that is usually just a matter of including the proper file in your script.  I often make a lib directory and store PEAR packages there, for example MDB2...
require_once 'lib/db/MDB2.php';

// use the package now, huzzah

Looking for some easy-to-use tools?  Try these, https://sourceforge....jects/utils-php -- I made them myself.  They're distinct tools which are easy to understand and use.  See some examples uses at http://www.anotherearlymorning.com

#4 russia5

russia5
  • Members
  • PipPipPip
  • Advanced Member
  • 94 posts

Posted 04 August 2006 - 06:04 PM

My Host has told me we have PEAR installed.  This would mean I do not have to start a dirctory and upload the PEAR packages to it, correct?  Is there another reason you start a lib directory besides your host not having PEAR packages installed?

#5 ignace

ignace
  • Moderators
  • Now mod flavored
  • 6,431 posts
  • LocationBelgium

Posted 04 August 2006 - 08:23 PM

include_once('DB.php');// This will not be in your directory, but it will be in php's

for the manual I would refer you to: http://pear.php.net/




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users