SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Evangelist
    Join Date
    Nov 2005
    Posts
    496
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    So who actually uses PEAR these days?

    Hello. I've had a good half year break from doing web programming, due to being involved in other projects and not having a web programming job. Now I work full time as a junior web software developer and my interest in all things XHTML, CSS, JavaScript, PHP have come back!

    I've been getting into OOP techniques in PHP (was before the break too) and I think I've pretty much got my head around it. I've always read alot about PEAR, but never really used it, as I thought I'd be better off learning the fundamentals and writting class/functions myself.

    But the questions has come around again... What is PEAR? What can it do? Is it worth investigating more? Will it benefit me?

    I thought I'd ask here, who actually uses PEAR? How has it benefitted you? Is it worth me using it? The kind of project I'm on at the moment is writing a tailor made CMS that I can plug into client web sites.

    Thanks for your time!

  2. #2
    SitePoint Guru brent5392's Avatar
    Join Date
    Dec 2005
    Location
    Australia
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PEAR is The PHP Extension and Application Repository. Basically, it contains everything you can ever need to build a website. From database abstraction layer to complete mail management solutions. It can do pretty much everything you would even want a website to do.

    If you want to save some time in some cases (although, you have to understand what you are doing first), then yes, it may be worth investigating, and it will benefit you if you want to build something quickly with less issues.

    Although, in saying that, if you can't actually "install" PEAR on the server, things can get a little bit more complex. Also, if performance is a very important factor in your application, you'd definitely be better off writing everything yourself as most of the stuff you will find in a PEAR package, you will never use. But, everything is there if you need to use it.

    I have used it, along side with Smarty, but now, I don't as I require performance more than a quick coding time :P

    But yeah, definitely check it out. May come in quite handy one day.
    PHP | MySQL | (X)HTML | CSS

  3. #3
    SitePoint Wizard Hammer65's Avatar
    Join Date
    Nov 2004
    Location
    Lincoln Nebraska
    Posts
    1,161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I usually shi away from PEAR, not because it doesn't have some good code in it, but because I often work on servers that I have little or no control over. I try to make my code re-usable from project to project, which is supposed to be a strong point of OOP.

    If I try to rely on PEAR, I also have to rely on all the server admins for the servers I work on to support it, keep it up to date, and actually make it accessible to PHP (have the PEAR directory in the include path). That's a lot of ifs to deal with.

    Yes you can post your own copy to the web root, but it would be a pain to pair it down for just what you needed and it takes up space on the server that you may not want to take up if you don't need everything that is there.

    I have my own "toolbox" framework that I can use that doesn't have near the dependencies that PEAR has. I think that's really a better solution and can be more easily integrated into an MVC framework as a set of custom classes.

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,460
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)

    using PEAR

    My host server has PEAR installed. But only enough for what they need. It was no problem for me to upload only the packages that I want to use and add my PEAR location to the include path. IMHO the PEAR "core" files are not that many. Using go-pear makes managing the packages easy and most packages I've looked into have good documentation and/or example use files.
    Although it is true that some packages have "feature bloat", others are amazingly small for what they can do.
    Definately worth looking into before you make a decision one way or the other.

  5. #5
    SitePoint Evangelist
    Join Date
    Nov 2005
    Posts
    496
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But PEAR, from what I can gather, is just a collection of OOP classes that can be used in your projects - right? for example... Instead of me writing a database class, that handles running queries, making updates etc... I could use one from PEAR right?

    Thing is I'm realising, is the fun bit in coding I find, is writing the classes myself and making things work from my own code...

    ... So really... I'm not missing anything from not using PEAR right? If I'm writing my own 'toolbox' framework - that I know is portable and modular - I have no real reason to use PEAR or anyother frameworks, right?

  6. #6
    SitePoint Wizard Hammer65's Avatar
    Join Date
    Nov 2004
    Location
    Lincoln Nebraska
    Posts
    1,161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That may be true and for the most part, and that's what I have done. I also have some 3rd party classes in my framework as well however.

    There is only so much time in the day. For me, I have a family as well, so I don't always have time, and I don't always have the inclination to read and learn every technical detail of what I do. If you are working on deadlines, that's even more the case.

    The PDF specification for instance, is a long, complex spec. I could read it (I have mostly) and comprehend it enough to use it in my own code, but I really haven't found a great need to do so.

    Most of the pre-written tools for PDF that are available for PHP are as good as it's going to get given what Adobe has available to work with. I don't need to write my own version of fpdf or similar tool.

    Same with sending mail. I don't have an overriding interest in learning the full breadth of the MIME email spec. There are plenty of pre-written classes out there that have proven code for that sort of thing. I don't really need to write myself a PHPMailer clone, nor do I have the time.

    You can write classes to extend a lot of this stuff, and many PEAR classes and those of other repositories were written by people or groups of people that happen to have an interest in that particular area of programming (like encryption). Sometimes it's smart to take advantage of the work others have done, to make it easier on yourself.

    If you have a wide interest in programming and a lot of time, you may not do that quite as often, but it can still be useful, it may also teach you a lot by looking at the code.

  7. #7
    SitePoint Enthusiast
    Join Date
    Aug 2006
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found that the ExcelSpreadsheetWriter is a great PEAR class.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •