View Full Version : Pear - Does anyone use this, and where is it?
Garowetz
08-18-2006, 02:45 PM
I've just moved to Bluehost and have been experimenting with PEAR (does anyone actually use this?) and I've been able to initiate the PEAR class it's self ... it found it in the include path but when I try to "require_once" another file as listed in PEAR documentation I can't seem to find where the directory is that has the file.
I'm trying to get to the PEAR_Info class ... and Pear says it should be PEAR/Info.php. Obviously this is just their standard but I don't know where to find this file in Bluehost. It says that it has it in the Helpdesk but it doesn't say where!
Anyhelp would be great
Stephen
aceofspades
08-18-2006, 03:45 PM
I've just moved to Bluehost and have been experimenting with PEAR (does anyone actually use this?) and I've been able to initiate the PEAR class it's self ... it found it in the include path but when I try to "require_once" another file as listed in PEAR documentation I can't seem to find where the directory is that has the file.
I'm trying to get to the PEAR_Info class ... and Pear says it should be PEAR/Info.php. Obviously this is just their standard but I don't know where to find this file in Bluehost. It says that it has it in the Helpdesk but it doesn't say where!
Anyhelp would be great
Stephen Well what is PEAR?????
page1ink.
08-18-2006, 04:13 PM
http://www.google.com/search?q=what+is+pear
It is a library of PHP scripts and an extension that supports automated installation of those scripts and dependencies. I believe that if you do a phpinfo you can see if pear is installed... if the pear extension that supports pear application installations is installed. Most introductory books on PHP have a section on PEAR.
joe
aceofspades
08-19-2006, 10:07 AM
OH so it is basically like a an extension with commonly used fuctions and scripts. Like commonly used functions for login and stuff. Ill read the manual and try to install it.
I believe Pear is installed by default on bluehost. Use phpinfo() and look for "--with-pear" in the configure command. I believe that indicates that pear was installed with php on your box. I've not used it yet so there may be other configuration issues you need to address.
If you don't know how to use phpinfo()... learn.
Basically, create a file in you public.html folder with the following content:
<?php
phpinfo()
?>
pretty complicated eh?
Name it something with a php extension like myinfo.php
now go to your browser and navigate to that file (www.mysite.com/myinfo.php).
You should get a page with a bunch of information about how PHP and other applications are installed and configured.
Save the page and delet the myinfo.php file from your public.html folder lest some badguy should go poking around for your configuration information.
My info shows --with-pear.
Good luck
joe
aceofspades
08-19-2006, 10:44 AM
I believe Pear is installed by default on bluehost. Use phpinfo() and look for "--with-pear" in the configure command. I believe that indicates that pear was installed with php on your box. I've not used it yet so there may be other configuration issues you need to address.
If you don't know how to use phpinfo()... learn.
Basically, create a file in you public.html folder with the following content:
<?php
phpinfo()
?>
pretty complicated eh?
Name it something with a php extension like myinfo.php
now go to your browser and navigate to that file (www.mysite.com/myinfo.php).
You should get a page with a bunch of information about how PHP and other applications are installed and configured.
Save the page and delet the myinfo.php file from your public.html folder lest some badguy should go poking around for your configuration information.
My info shows --with-pear.
Good luck
joe
EDIT:
Yah i read the php info. Thx i didnt know about that thx for ur help. Can you tell me exactly what Pear is???
Save it in a protected directory or tack on an auth.inc on the file.
EDIT:
Yah i read the php info. Thx i didnt know about that thx for ur help. Can you tell me exactly what Pear is???
Save it in a protected directory or tack on an auth.inc on the file.
First listing from google of php pear:
http://pear.php.net/
Garowetz
08-21-2006, 08:51 AM
Website: http://pear.php.net
About Pear: (Link - http://pear.php.net/manual/en/about-pear.php)
PEAR is short for "PHP Extension and Application Repository" and is pronounced just like the fruit. The purpose of PEAR is to provide:
A structured library of open-sourced code for PHP users
A system for code distribution and package maintenance
A standard style for code written in PHP, specified here
The PHP Extension Community Library (PECL), see more below
A web site, mailing lists and download mirrors to support the PHP/PEAR community
PEAR is a community-driven project with the PEAR Group as the governing body. The project has been founded by Stig S. Bakken in 1999 and quite a lot of people have joined the project since then.
What I'm Doing:
I'm trying to use it as a framework (something simple maybe somewhat similar to Ruby on Rails) in that it provides base classes and error handaling for my web programs. To start with I wanted to try out the MDB2 package for a backend to handaling Databases.
My Problem:
I don't know how to use it! There is a base class in PEAR that you can build on (handles the error handaling, and constructors and such) I can "require_once" it in my code. So it must be in my include path. But now when I try and "require_once" any other class file I can't seem to find it. PEAR has a great PEAR_Info function that is based off of the phpinfo function but for PEAR and in that function it tells me everything I need to know. Unfortunetly it's in another file also so I really just need the PEAR installation directory and then I will be able to find everything.
Ideas: Is there a way of listing the directories that are in my include path? I don't have SSH yet but I guess I could try and play around with that. But is there another way ... maybe then I could find the PEAR directory myself!! Plus it'd be nice to know what files are in my include path.
Thanks for all the help.
P.S. phpinfo is one of the best things about php I use it at least once a week. It's really good to use it inline with scripts/web programs it will help you with sessions, DB variables, and a whole bunch of other stuff.
I'm trying to use it as a framework (something simple maybe somewhat similar to Ruby on Rails) in that it provides base classes and error handaling for my web programs. To start with I wanted to try out the MDB2 package for a backend to handaling Databases.
Pear is not a framework, it is a structured arcive with utilities for installation and dependency checking.
If you want a framework like Rails... what about Rails? Or, if you want to stick with PHP you might check out CakePHP or Symfony.
joe
aceofspades
08-21-2006, 07:22 PM
im going on the rails boat it is the future. PHP is slightly outdated. Its been around for like 5 years. In about 2 years Ruby is gonna be dominant. Sure PHP is simple but its for the uber complex Web 2.0 programs, ruby is what you need. Unless you wanna make some simplisic login program PHP is good. But if u want to go into the big leauges use ruby.
Basil
08-21-2006, 09:42 PM
Gonna have to disagree with you on that one.
My simple question is does Bluehost have it?
Garowetz
08-28-2006, 01:38 PM
I would like to know if they have it also ... and if so the path to it ... that was preety much my original question!
But thanks for all the insight into PEAR and the introduction in to PHP frameworks
dkinzer
08-28-2006, 09:18 PM
I use PEAR in two of the scripts on my site. In both cases, I have installed the PEAR scripts in a subdirectory of the application that uses it. I have thought, from time to time, that I should perhaps install PEAR in my site's root directory and have all the apps use that code. So far, I've been too busy with other tasks.
You can download the PEAR code at http://pear.php.net
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.