pear

Checking FTP status codes with a PHP script.

I have a script that checks responses from HTTP servers using the PEAR HTTP classes. However, I've recently found that the script fails on FTP servers (and probably anything that's not HTTP or HTTPS). I tried Google, but didn't see any scripts or code that returned the server status code from servers other than HTTP servers. How can I f...

What design pattern is PEAR DB_DataObject implementing?

DB_DataObject does not appear to be ActiveRecord because you do not necessarily store business logic in the "table" classes. It seems more like Table Data Gateway or Row Data Gateway, but I really cannot tell. What I need is good ORM layer that we can use with DataMapper and a DomainModel. Any ideas? ...

Getting PEAR to work on XAMPP (Apache/MySQL stack on Windows)

I'm trying to install Laconica, an open-source Microblogging application on my Windows development server using XAMPP as per the instructions provided. The website cannot find PEAR, and throws the below errors: Warning: require_once(PEAR.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampplite\htdo...

Including files case-sensitively on Windows from PHP

We have an issue using the PEAR libraries on Windows from PHP. Pear contains many classes, we are making use of a fair few, one of which is the Mail class found in Mail.php. We use PEAR on the path, rather than providing the full explicit path to individual PEAR files: require_once('Mail.php'); Rather than: require_once('/path/to/pe...

What is the best way to access a database from PHP?

Hi, When accessing a MySQL-database from PHP there seems to be several ways: Sprinkle the code with raw SQL-statements Use the VO-pattern from Java (e.g. DB_DataObjects from PEAR) DIY and write a script that auto-generates one PHP class per database table Apart from this I have also read about LINQ in .NET but have not s...

MDB2 disconnects and forgets charset setting when reconnecting

We recently debugged a strange bug. A solution was found, but the solution is not entirely satisfactory. We use IntSmarty to localize our website, and store the localized strings in a database using our own wrapper. In its destructor, IntSmarty saves any new strings that it might have, resulting in a database call. We use a Singleton ...

PHP: Use Pecl/Pear, or build my own systems?

When building some of my PHP apps, a lot of the functionality could be coded using PEAR/PECL modules, however, the fact that some people using it may not have the access to install things, It poses a puzzler for me. Should I forsake some users to use PEAR/PECL for functionality, where these will allow me to have a system coded up quicke...

PEAR Channels - Setting up your own?

I am looking for instructions on how to setup a PEAR channel for our project so that we can deploy it with the pear installer. I have Googled for a while and cannot find any straightforward information. I followed this tutorial for a while, but I am having a hell of a time getting this to work. Does anyone know how to do this? Is there a...

PHP PEAR Spreadsheet_Excel_Writer sending an empty file.

Has anyone used Pear: Spreadsheet_Excel_Writer? The Formatting Tutorial lists a script similar to what I'm working with: (trimmed down) <?php require_once 'Spreadsheet/Excel/Writer.php'; $workbook = new Spreadsheet_Excel_Writer(); $worksheet =& $workbook->addWorksheet(); $worksheet->write(0, 0, "Quarterly Profits for Dotcom.Com"); $w...

Strange error when creating Excel files with Spreadsheet_Excel_Writer

Here's the code. Not much to it. <?php include("Spreadsheet/Excel/Writer.php"); $xls = new Spreadsheet_Excel_Writer(); $sheet = $xls->addWorksheet('At a Glance'); $colNames = array('Foo', 'Bar'); $sheet->writeRow(0, 0, $colNames, $colHeadingFormat); for($i=1; $i<=10; $i++) { $row = array( "foo $i", "bar $i"); $sheet->wri...

sending mail with php & escaping hotmails junk folder

I have been trying to get PEAR::mail to successfully deliver emails to hotmail users without being flagged as SPAM and ending up in the junk folder, i have no problems with yahoo/gmail only with hotmail. google suggested that this is a common problem with hotmail and that possible causes can include incorrect reverse DNS for main IP o...

PHP5: calling external functions, and logging errors

I'm painfully new to PHP, and was trying to set up phpBB on my local site. I have a stock debian install of apache2 and php5. The phpBB installer ran fine, connected to the database and created all its tables with no problem. But when I tried to open the login page, I got a 0-byte response. A little digging showed that it was never m...

php/pear package for "remember me on this computer"

I know this is usually done with cookies, but I am getting unpredictable results on different browsers and decided to look for a pear package that focuses on this. Just wondering if there's a package (HTTP_Client for example?) that anyone has had success using for this particular situation. Or actually, do people never or rarely have p...

XML/Parser.php installation

I recently signed up to shared web hosting with godaddy using Linux and PHP 5. I want to work with multiple RSS feeds. I previously had this all functioning under Apache, however, the host supplied the PEAR installation. Now I have to do this myself and I am in unfamiliar territory.I installed PEAR PHP and managed to get rss.php in the...

PHP and PEAR

Hi All, PHP 5 and I want to install PEAR so I can use Spreadsheet_Excel_Writer I dont see how to install it on my ISP nor my personal Macbook. Thoughts for both? Thanks! ...

Adding functions to PHP core

I have several functions that I wrote and I use regularly on my servers, is there a way I can add them to the core so I don't have to include them from external files? I am running PHP5 ...

PHP:Writing to excel file using PEAR

I have installed PEAR, Spreadsheet_Excel_Writer and OLE. The sample program is executed successfully but when I try to read the file it shows garbage values. I also tried $workbook->setVersion(8); and $worksheet->setInputEncoding('UTF-8'); I am using this tutorial and Google lot for this problem. http://www.sitepoint.com/article/gettin...

Apply Diff in PHP

I'm working with the Text_Diff PEAR package to diff to short text documents, where the Text_Diff object is created with a space-delimited list of the words in each document. I was hoping to store the diff in a database, and then apply it when the file is loaded again. Is there an easy way to apply this diff, or do I need to write a fun...

Problem using Math_Matrix PEAR library

Hi, I've not used PEAR before, and so I'm probably doing something dumb. I've installed the Math_Matrix library, but when I include it I just get an error. My entire code is this: <?php $path = '/home/PEAR/Math_Matrix-0.8.0'; set_include_path(get_include_path() . PATH_SEPARATOR . $path); include_once 'Matrix.php'; ?> The error ...

PEAR vs PHP time functions

Hi All I'm looking into basic time functions (creating a UTC timestamp and converting into a local timezone). The first set of tutorials i encountered pointed toward PEAR as it's better at avoiding overspill errors in calculations. Now, mid-way through another, it appears that PEAR has issues with some of it's timezone functions running...