SitePoint Sponsor |
|
User Tag List
Results 1 to 11 of 11
Thread: PEAR & PECL
-
Nov 23, 2004, 17:26 #1
- Join Date
- Nov 2004
- Location
- Edinburgh
- Posts
- 116
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
PEAR & PECL
Hi folks,
Right I'll take the risk to sound like a complete idiot but I just learnt about PECL and I was wondering what the difference between that and PEAR was.
I'm guessing one is a repository of extentions while the other is a repository of modules but that doesn't tell me what the difference actually is.
Thanks for clearing a confused mind
-Jean-Loup
-
Nov 23, 2004, 17:38 #2
- Join Date
- Nov 2004
- Location
- Parry Sound, ON
- Posts
- 725
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
That's about right. PEAR modules are written in PHP while PECL extentions are written in C.
-
Nov 23, 2004, 17:44 #3
- Join Date
- May 2004
- Location
- Netherlands
- Posts
- 219
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by loupblanc
As HardCoded said: PEAR is written in PHP, PECL in C, that's the most basic way to explain the difference...
You can use PEAR on any server and just load the PEAR PHP code into your own and use it. PECL however is something that HAS to be installed on the server (and activated) in order for you to use it. PECL adds new PHP FUNCTIONS (it extends PHP in a way..) while PEAR adds ready-to-use code that YOU can use to quickly handle common problems (so you won't have to reinvent the wheel).
I'd say it's WELL WORTH your time diving into, (PEAR that is) as it's really brilliantly written code that allows you to handle common stuff so much quicker! I would only really look into PECL once you encounter really specific trouble (like wanting to add the possibility to PHP5 to create PDF documents) (wrong example, can be done differently (using PHP code) but than again, it's just an example)
-
Nov 23, 2004, 17:45 #4
- Join Date
- Nov 2004
- Location
- Edinburgh
- Posts
- 116
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I see, does that mean you have to recompile the PHP source code when you add a PECL extention? And then what? Do they work in the same way as a PHP function like, I dunno, xml_parse() works? ( Note: I don't know if such a function exists, I'm just giving an example
)
Just curious
Cheers
-Jean-Loup
-
Nov 23, 2004, 17:48 #5
- Join Date
- May 2004
- Location
- Netherlands
- Posts
- 219
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yes you have to recompile PHP (with the extension), and yes they add functions to PHP. By the way, on Windows servers, you only have to place the DLL file in the correct folder, and mention the DLL in your PHP.ini (and possibly restart Apache) and it will work aswell...
Just curious, what functionality do you seek?
-
Nov 23, 2004, 17:49 #6
- Join Date
- Nov 2004
- Location
- Edinburgh
- Posts
- 116
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Quaint, thanks that's a lot clearer now.
I'd use PEAR more, except the only modules that are interesting to me right now (SVG) are so poorly documented (unless it changed recently) that I pretty much had to use my own code.
I do intend to check out PEAR for further projects though
Cheers
-Jean-Loup
PS: Sorry this is a very bad joke that must have been done a zillion times but doesn't anyone worry if their PHP code goes PEAR shaped?... *I'll get my coat now*
-
Nov 23, 2004, 17:51 #7
- Join Date
- Nov 2004
- Location
- Edinburgh
- Posts
- 116
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Quaint
Cheers
-Jean-Loup
-
Nov 23, 2004, 17:52 #8
- Join Date
- May 2004
- Location
- Netherlands
- Posts
- 219
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by loupblanc
PEAR definitely is worth checking out at the start of EVERY project. Auth class for example works great in any situation, just for session handling itself it's brilliant...
-
Nov 23, 2004, 17:56 #9
- Join Date
- Nov 2004
- Location
- Edinburgh
- Posts
- 116
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Quaint
Cheers
-Jean-Loup
-
Nov 23, 2004, 18:04 #10
- Join Date
- May 2004
- Location
- Netherlands
- Posts
- 219
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Indeed, the documention is quite poor, but with a little google I came up with:
http://www.svgopen.org/2004/papers/ServerSideSurvey/#S3
http://circle.ch/php/
and lot's more..
Bear in mind that you can use the sample code (test files) and API documention and a little effort to get to understand PEAR...
http://pear.php.net/package/XML_SVG/docs/0.0.3/ (API docs)
A lot of PEAR classes are not yet full releases, the SVG class is actually at release 0.03, which means that the code might be working, but the documentation has not been written (possibly because the code might change in future versions, or more likely because it is not YET the main point of interest for the coder)...
Really, sample files + API documention + a look at the actual source code get's me to where I want to go...
-
Nov 23, 2004, 18:17 #11
- Join Date
- Nov 2004
- Location
- Edinburgh
- Posts
- 116
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
For for my redemption, at least developping my own classes has given me a greater understanding of OO PHP and therefore will help me make better use of other PEAR modules in the future. Gotta learn somehow
Thanks for those links, I've seen them before (except the circle.ch one) and couldn't get much out of them
Cheers
-Jean-Loup
Bookmarks