Re: [PHP] Correcting contractions

2005-06-25 Thread Burhan Khalid

Dotan Cohen wrote:


Ill I knew about, its I didn't. I didn't mean to put ill in there...

Should I enter each contraction twice (for the capitalization), or
should I try to do something smart so that the capitalization will
happen automatically. The 'I' contractions are special, I will deal
with those seperatly.


str_ireplace() is a case-insensitive version of str_replace

For god's sake -- please trim your posts! No need to see the enter 
repetitive array + rob's signature in your reply!


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: Re[2]: [PHP] comparing two texts

2005-06-25 Thread jenny mathew
 Today's newbie is tomorrow's Programmer. Some day
 she'll maybe write that script she deemed impossible today, and contribute
 it back to the community.

 Or maybe she'll some day add a PHP Module to interface directly to diff
 somehow.
 Thanks Richard, for the motivation, and thanks to the group as well for the 
crude php code.
i am working on this problem now. To tell you the truth i am a c programmer 
but now i have moved to php.
At first i thought that asp will be best to experiment but after doing some 
research i found that asp is moving towards a slow death.So friends, finally 
i am in php community.Let me confess,i am not very experienced in php ,but 
very soon i will be as experienced as you are (of course i will need your 
help).


Re: [PHP] Correcting contractions

2005-06-25 Thread Robert Cummings
On Sat, 2005-06-25 at 02:17, Burhan Khalid wrote:
 Dotan Cohen wrote:
 
  Ill I knew about, its I didn't. I didn't mean to put ill in there...
  
  Should I enter each contraction twice (for the capitalization), or
  should I try to do something smart so that the capitalization will
  happen automatically. The 'I' contractions are special, I will deal
  with those seperatly.
 
 str_ireplace() is a case-insensitive version of str_replace

str_ireplace() is PHP5 only and so not necessarily a good option.
Additionally it won't work properly since it will normalize all
replacements into lower case which is not the desired outcome since
sentences beginning with foobar'd contractions should maintain their
capitalization.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: SAFEMODE w/ PEAR

2005-06-25 Thread Jasper Bryant-Greene
Ashley M. Kirchner wrote:
I'm having a small problem with SAFE MODE and PEAR that I'm unsure
 how to solve:
 
[error] PHP Warning:  raiseerror(): SAFE MODE Restriction in effect. 
 The script whose uid is 524 is not allowed to access
 /usr/lib/php/PEAR.php owned by uid 0 in /path/to/script/Lite.php on line
 470
 
How should that get solved?  Everything in /usr/lib/php is owned by
 root.root and just about everyone wants access to the PEAR library, but
 SAFE MODE won't allow it?
 

You either need to chown /usr/lib/php to the script's UID (not
recommended) or turn off Safe Mode. The whole point of Safe Mode is that
scripts cannot access files which do not match their UID.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Correcting contractions

2005-06-25 Thread Dotan Cohen
On 6/25/05, Bob Winter [EMAIL PROTECTED] wrote:
 Dotan,
 
 Your task intrigued me, so I put together a function that will help process 
 your data:
 
 ?php
snippped and trimmed as per Buehan Khalid suggeted 
 ?
 
 --Bob
 

Thank you Bob! This is the route that I had tried going down on my
first attempt, but the code is much more professional than I had
produced. I am eager to see where it takes me. Interesting that it
does not introduce to me any new functions, but rather better
organization than I had come up with.

Dotan
http://lyricslist.com/lyrics/artist_albums/465/stroke_9.php
Stroke 9 lyrics

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How do I create an Outlook calendar entry?

2005-06-25 Thread Burhan Khalid

Daevid Vincent wrote:
You are on to something. Maybe I did get an email with a confirmation. 
I could swear it was via their website though...


There are some pretty crazy Thread-Index: and UID: things in there. 
Do I have to generate them somehow?  


Anyways, for those interested, this is what the email looks like:


What they are doing is sending you a vcalendar document in the email. 
You can send similar notifications yourself by reading up on the 
vcalendar specs[1] and sending out the appropriate email.


Cheers,
Burhan

[1] http://www.imc.org/pdi/vcal-10.txt

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Problems with MMCache

2005-06-25 Thread Merlin

Hi there,

I just steped over mmcache:
http://turck-mmcache.sourceforge.net/index_old.html#install

After installing it, I can not see a real performance gain at all. The 
system is installed corectly and mmcache.php tells me it is active and 
running.


Now I saw that there is a mmcache API. Does that mean that I do have to 
recode my whole app to make use of mmcache?!


Thanx for any hint,

Merlin

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] MMcache question

2005-06-25 Thread Merlin

Hi there,

I just steped over mmcache:
http://turck-mmcache.sourceforge.net/index_old.html#install

After installing it, I can not see a real performance gain at all. The 
system is installed corectly and mmcache.php tells me it is active and 
running.


Now I saw that there is a mmcache API. Does that mean that I do have to 
recode my whole app to make use of mmcache?!


Thanx for any hint,

Merlin

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: MMcache question

2005-06-25 Thread Catalin Trifu
The use of mmcache (try eaccelerator btw!) is not visible
without some stress on the server. Try building a rahter complex PHP
script, which does some crazy iterations but without DB connections
and such things which are not related to PHPs abilities and
use ab (apache benchmark tool) to issue many simultaneous requests
to that page; do it a few times, with mmcache and without mmcache enabled
and will surely see the differences.
No! You don't have to rewrite your application. What mmacache does is
to keep a bytecode version of the script available so that PHP won't have
to reparse the script every time, which is expensive and also has a nice code 
optimizer.
On heavy loaded sites and on sites that use lots of libraries and objects
mmcache (eaccelerator) does a perfect job.


Catalin


Merlin wrote:
 Hi there,
 
 I just steped over mmcache:
 http://turck-mmcache.sourceforge.net/index_old.html#install
 
 After installing it, I can not see a real performance gain at all. The
 system is installed corectly and mmcache.php tells me it is active and
 running.
 
 Now I saw that there is a mmcache API. Does that mean that I do have to
 recode my whole app to make use of mmcache?!
 
 Thanx for any hint,
 
 Merlin

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: PHP web archeticture

2005-06-25 Thread Catalin Trifu
  Hi,

I personally use phrame because it's small, pretty fast, easy to setup
and was enough for my needs, although it does not seem to be maintained
anymore.
I think you should choose the one which better suits the needs of your 
project.
It's rather hard to say that framework is better than the other.
I also tend to stay away from PEAR, which is kinda bloated for my taste, 
except
the Log package.
Other than that, it all comes to project needs, personal choice and testing 
for
features, speed, stability and support (if you are interested in such things) 
although
tests are not always very concludent since they depend on many factors.


Catalin


Joe Muddah wrote:
 Thanks a bunch. I have alot of work now ahead of me to decide which
 framework to use. Any opinions on which one is the best?
 
 On 6/24/05, Catalin Trifu [EMAIL PROTECTED] wrote:
 
   Hi,

  You can take a look at phrame.sf.net, phpmvc.net, horder.org, 
 binarycloud.com
adodb.sf.net (for fast db abstraction layer).
  Read around and one of those will surely satisfy your needs.

Catalin


Joe Muddah wrote:

I am trying to design a website archeticture. Does anyone have any
links or experience with archetictures that actually work. Any ideas
of how to layout a website would be greatly appreciated.

This is what I am thinking of doing

1)Seperate Logic from presentation
 Using Templates (Smarty) for presentation
 Using PHP Objects for logic (no echo statements)

2)Use Controllers to bring together logic and presentation
  I don't really have an idea yet of how to do this. I am thinking
about having something like a page variable to figure out what
template to output, action variable to figure out what objects are
called (save, delete, etc.). All this would be under a switch
statment. Example:

switch($page){
case UserListPage
  if(action==saveUser)
userObject-saveUser(_$POST)

  displayTemplate(UserList)


case EmailPage
  .
}


Thanks.

j.m.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] SAFEMODE w/ PEAR

2005-06-25 Thread Marek Kilimajer

Ashley M. Kirchner wrote:


   I'm having a small problem with SAFE MODE and PEAR that I'm unsure 
how to solve:


   [error] PHP Warning:  raiseerror(): SAFE MODE Restriction in effect.  
The script whose uid is 524 is not allowed to access 
/usr/lib/php/PEAR.php owned by uid 0 in /path/to/script/Lite.php on line 
470



   How should that get solved?  Everything in /usr/lib/php is owned by 
root.root and just about everyone wants access to the PEAR library, but 
SAFE MODE won't allow it?




Administrator should put this to php.ini:

safe_mode_include_dir = /usr/lib/php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Strange is_dir() behavior

2005-06-25 Thread Marcos Mendonça
Hello

I'm using PHP 4.3.9, under Windows XP with Apache.

I have the following directory structure on a given app, i'm working on.

photos/
   folder1
   folder2
   folder3
   ... and so on

I'm trying the following code to make a list of folder under photos:

  $d = dir('photos/');

while (false !== ($entry = $d-read())) {
if (is_dir($entry)  $entry != '.'  $entry != 
'..')
echo $entry . br /;
}

For some strange reason, that echoes nothing. is_dir is returning
false on every folder (dir)
under photos, except for '.' and '..' dirs. Can someone explain this?

Thanks ind advance.
Marcos

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Stop spreading PEAR FUD; WAS Re: [PHP] Re: PHP web archeticture

2005-06-25 Thread Matthew Weier O'Phinney
* Catalin Trifu [EMAIL PROTECTED] :
 I also tend to stay away from PEAR, which is kinda bloated for my
 taste, except the Log package.

rant
I hear that a lot on this list, and I don't understand the reasoning
behind such comments -- perhaps because nobody offers any reasoning,
only the opinion?

I'm a PEAR user, and I've found the packages anything *but* bloated.
Granted, I only use a subset of PEAR, but that subset has made mycoding
easier. I use DB, Log, Mail, Mail_MIME, HTML_QuickForm, Cache_Lite, and
Pager daily; additionally, we use custom PEAR error handlers to catch
errors generated by these packages, log them, and display custom error
pages. If I'd had to write the functionality I have readily available in
these packages, I wouldn't have a job right now. They've helped me meet
numerous deadlines.

If somebody could offer some *constructive* criticism of PEAR -- PEAR as
it is TODAY, not 3 years ago, when I last tried it -- these comments
would have more weight. As it is, I feel they're just FUD based on
ignorance.
/rant

-- 
Matthew Weier O'Phinney   | WEBSITES:
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:[EMAIL PROTECTED] | http://vermontbotanical.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Stop spreading PEAR FUD; WAS Re: [PHP] Re: PHP web archeticture

2005-06-25 Thread Robert Cummings
On Sat, 2005-06-25 at 10:32, Matthew Weier O'Phinney wrote:
 * Catalin Trifu [EMAIL PROTECTED] :
  I also tend to stay away from PEAR, which is kinda bloated for my
  taste, except the Log package.
 
 rant
 I hear that a lot on this list, and I don't understand the reasoning
 behind such comments -- perhaps because nobody offers any reasoning,
 only the opinion?
 
 I'm a PEAR user, and I've found the packages anything *but* bloated.
 Granted, I only use a subset of PEAR, but that subset has made mycoding
 easier. I use DB, Log, Mail, Mail_MIME, HTML_QuickForm, Cache_Lite, and
 Pager daily; additionally, we use custom PEAR error handlers to catch
 errors generated by these packages, log them, and display custom error
 pages. If I'd had to write the functionality I have readily available in
 these packages, I wouldn't have a job right now. They've helped me meet
 numerous deadlines.

No matter how many deadlines PEAR helps you meet and how much you may
find the PEAR modules indispensable, you are expressing a subjective
opinion unrelated to the OP's comment about bloated. A package can be
very bloated and still be extremely useful to someone who doesn't have
the time or the ability (not to say you don't have the ability) to
implement similar functionality themself. Additionally PEAR does present
a centralized location for common functionality with good peer review,
however IMHO I side with the OP with respect to much of PEAR being
bloated.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Strange is_dir() behavior

2005-06-25 Thread Burhan Khalid

Marcos Mendonça wrote:

Hello

I'm using PHP 4.3.9, under Windows XP with Apache.

I have the following directory structure on a given app, i'm working on.

photos/
   folder1
   folder2
   folder3
   ... and so on

I'm trying the following code to make a list of folder under photos:

  $d = dir('photos/');

while (false !== ($entry = $d-read())) {
if (is_dir($entry)  $entry != '.'  $entry != 
'..')
echo $entry . br /;
}

For some strange reason, that echoes nothing. is_dir is returning
false on every folder (dir)
under photos, except for '.' and '..' dirs. Can someone explain this?


iirc, is_dir is relative to the path of the script that is calling it. 
Try giving it the full path of the directory. Might solve your problem.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Stop spreading PEAR FUD; WAS Re: [PHP] Re: PHP web archeticture

2005-06-25 Thread Matthew Weier O'Phinney
* Robert Cummings [EMAIL PROTECTED] :
 On Sat, 2005-06-25 at 10:32, Matthew Weier O'Phinney wrote:
  * Catalin Trifu [EMAIL PROTECTED] :
   I also tend to stay away from PEAR, which is kinda bloated for my
   taste, except the Log package.
  
  rant
  I hear that a lot on this list, and I don't understand the reasoning
  behind such comments -- perhaps because nobody offers any reasoning,
  only the opinion?
  
  I'm a PEAR user, and I've found the packages anything *but* bloated.
  Granted, I only use a subset of PEAR, but that subset has made mycoding
  easier. I use DB, Log, Mail, Mail_MIME, HTML_QuickForm, Cache_Lite, and
  Pager daily; additionally, we use custom PEAR error handlers to catch
  errors generated by these packages, log them, and display custom error
  pages. If I'd had to write the functionality I have readily available in
  these packages, I wouldn't have a job right now. They've helped me meet
  numerous deadlines.

It may be my opinion, but I've also given some reasoning for my opinion:
help in meeting deadlines, centralized error handling, and variety of
packages. I've helped to *qualify* my opinion. I'll do more of that
below.

 No matter how many deadlines PEAR helps you meet and how much you may
 find the PEAR modules indispensable, you are expressing a subjective
 opinion unrelated to the OP's comment about bloated. A package can be
 very bloated and still be extremely useful to someone who doesn't have
 the time or the ability (not to say you don't have the ability) to
 implement similar functionality themself. 

Correct; ability isn't the problem; time often is. 

aside
However, I also find that I start by creating some functionality myself,
and then as special cases start popping up, modifying, adding on... and
then discovering that an equivalent PEAR package already exists that
covers all these special cases and a number I hadn't thought of. (Pager
comes to mind).

I often wonder if what is meant by 'bloat' is that those claiming
'bloat' feel that the PEAR code covers too many special cases -- cases
they have not encountered or do not expect to encounter.

Personally, I feel that I'd rather have all my bases covered; I can see
a point in wanting to keep code trimmed to the necessary cases, though.
/aside

 Additionally PEAR does present a centralized location for common
 functionality with good peer review, 

This is one of the selling points for PEAR; many eyes looking at the
code, including people who aren't invested in the particular problem.
Having the diversity of reviewers often makes for better code.

 however IMHO I side with the OP with respect to much of PEAR being
 bloated.

Then explain what you mean by 'bloated'. Just throwing out that phrase
doesn't give anybody any extra information -- just your opinion. Can you
give some examples to *qualify* your statement that PEAR is bloated?
That was the main thrust of my rant -- people throwing out unqualified
opinion statements like 'PEAR sucks' or 'PEAR is bloated' without
explaining *why*.

-- 
Matthew Weier O'Phinney   | WEBSITES:
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:[EMAIL PROTECTED] | http://vermontbotanical.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Strange is_dir() behavior

2005-06-25 Thread Edward Vermillion


On Jun 25, 2005, at 8:34 AM, Marcos Mendonça wrote:


Hello

I'm using PHP 4.3.9, under Windows XP with Apache.

I have the following directory structure on a given app, i'm working 
on.


photos/

folder1
folder2
folder3
... and so on


I'm trying the following code to make a list of folder under photos:

  $d = dir('photos/');

while (false !== ($entry = $d-read())) {
if (is_dir($entry)  $entry != '.'  $entry != 
'..')
echo $entry . br /;
}

For some strange reason, that echoes nothing. is_dir is returning
false on every folder (dir)
under photos, except for '.' and '..' dirs. Can someone explain this?


What do you get if you just echo out $entry without the if() statement?

Do you get a list of the directories you'd expect?



Edward Vermillion
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Stop spreading PEAR FUD; WAS Re: [PHP] Re: PHP web archeticture

2005-06-25 Thread Chris Shiflett

Matthew Weier O'Phinney wrote:

 I also tend to stay away from PEAR, which is kinda bloated for my
 taste, except the Log package.

rant
I hear that a lot on this list, and I don't understand the reasoning
behind such comments -- perhaps because nobody offers any reasoning,
only the opinion?


There is some justification, but as you correctly note, it's mostly 
based on what PEAR was a few years ago or because of some bad experience 
with a particular package (often both).



I'm a PEAR user, and I've found the packages anything *but* bloated.


Part of the perception was that the PEAR base class was a bit bloated, 
and combined with the poor performance of OO in PHP 4, this did make a 
noticeable difference in many cases.


Luckily, both aspects have been improved. :-)

Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] send email at certain hour

2005-06-25 Thread vlad georgescu
i want to make a reminder application which sends emails at certain hour 
in php. is this posibile ? if not, what else can I use ?


[PHP] Php-MySQL general function for insert, update,delete, count query

2005-06-25 Thread Rasim ÞEN
Hi friends,

I am using one perfect function for my queries for PHP+Oracle pages, this is 
below

==
function sorgu($sql)
{
global $baglanti;
$stmt=ociparse($baglanti,$sql);
$sonuc=ociexecute($stmt,OCI_DEFAULT);

$erra=OCIError();
$e=$erra['message'];

$sorgutipi=ocistatementtype($stmt);
$kayit_dizi=array();
$kayit_sayisi=-1;
if($sonuc)
{
if($sorgutipi==SELECT)
{
$kayit_sayisi = 
OCIFetchStatement($stmt,$kayit_dizi,0,-1,OCI_FETCHSTATEMENT_BY_ROW);
}
else
{
$kayit_sayisi = ocirowcount($stmt);
}
}
return array($sonuc,$kayit_sayisi,$kayit_dizi);
}

==


I am using it for every kind of oracle db query. So my all queries under my 
control.


Now I am looking for one function with PHP+MySQL

Anybody know like short function as above php+oracle function? I am using 
some function sets they are using much database queries. I want to use min. 
query and connection.


Thanks alot.

Rasim
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Stop spreading PEAR FUD; WAS Re: [PHP] Re: PHP web archeticture

2005-06-25 Thread Paul Waring
On Sat, Jun 25, 2005 at 10:32:41AM -0400, Matthew Weier O'Phinney wrote:
 If somebody could offer some *constructive* criticism of PEAR -- PEAR as
 it is TODAY, not 3 years ago, when I last tried it -- these comments
 would have more weight. As it is, I feel they're just FUD based on
 ignorance.

The documentation for some of the less well known packages is poor or
non-existant, or at least that's what I've always noticed and has been
my major bug bear with PEAR for a long time. For example, I want to use
the DB_Pager module but there is *no* end user documentation, all I have
to work with is some poorly formatted information pulled from the API
comments.

There are also a lot of packages (again, less well known ones) that
haven't been updated in a long time, in some cases several years. I'm
not saying that PEAR in general is a stale project, or that it's no good
(on the contrary, I use several of the packages on my sites and they're
very useful), but I do get the feeling that the non-core packages have
been left to rot both in terms of updates and documentation.

I've used both PEAR and CPAN for a few years now and I've noticed that
CPAN tends to win hands down in terms of documentation and updates. That
might just be down to the particular packages I've happened to use but
given a choice I know which one I'd rather use.

Paul

-- 
Rogue Tory
http://www.roguetory.org.uk

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Verifying images with getimagesize()

2005-06-25 Thread Jack Jackson



Edward Vermillion wrote:

Sorry to reply to this message but I wanted the OP to find it too...

On Jun 23, 2005, at 9:42 AM, Jack Jackson wrote:
[snip]

Through your help I was able to validate image files using 
getimagesize() and have made a nice script to upload and rename images.



[\snip]

I've been meaning to post a reply to a problem I ran into a while back 
that included validating images with getimagesize(). I've seen a few 
posts from folks saying this is the way to go and just want to share my 
experiences.


My original problem was that a script I had for batch generating 
thumbnails from uploaded images was running out of memory. With Richard 
Lynch's help I was able to track the problem to createimagefromjpeg() 
using an unholy amount of memory on one particular file, a file that had 
passed through getimagesize() with no problems.
What I found was that if an image ( in this case a jpeg ) is corrupted, 
but just barely, getimagesize() will let it through. Just for the record 
I could open it up in Photoshop and that's how I discovered that it was 
corrupted, the last ten or fifteen rows on the image were gone. 
Photoshop showed an uncompressed file size of 11M for this image. But 
what I had to end up doing is setting my memory limit to 48M before 
createimagefromjpeg() could get enough memory to work with that it 
finally failed.


Just a heads up to anyone that's using getimagesize() to verify an image 
before running it through createimagefromjpeg(), just because it passes 
getimagesize() doesn't necessarily mean it's a good image.


Edward Vermillion
[EMAIL PROTECTED]

Thanks for telling me about that, Edward. I apprecate it. Actually in 
this case I was using it only to verify that it was something like an 
image to validate the file type before allowing it on the server. But 
you raise a very good point and I appreciate it.


JJ

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Stop spreading PEAR FUD; WAS Re: [PHP] Re: PHP web archeticture

2005-06-25 Thread Chris Shiflett

Paul Waring wrote:

I've used both PEAR and CPAN for a few years now and I've noticed that
CPAN tends to win hands down in terms of documentation and updates. That
might just be down to the particular packages I've happened to use but
given a choice I know which one I'd rather use.


Yeah, you're basing that on which ones you've used. The interesting 
thing about CPAN is that it has far more crap than PEAR. This seems to 
work out well, because the best packages trickle up in terms of 
reputation. For example, most Perl developers use Test::More to 
implement their tests, but there is a lot of stuff in CPAN that does the 
same thing (and outputs a TAP-compliant protocol), and many of them 
existed before Test::More.


PEAR is much more guarded, and it has a higher quality to quantity 
ratio. This has some advantages. Of course, it also has disadvantages - 
there will always be complaints about PEAR being political (independent 
of whether it actually is) by those whose packages don't get accepted. 
Another problem is stagnant or poor packages that solve an important 
problem. With CPAN, I can just write a better solution, and if it is 
actually better, everyone starts using that. With PEAR, I need to try to 
work with the original author, which might involve enough effort just to 
make contact that I give up, and the better solution is never developed. 
It's a risk.


Anyway, take what I say with a grain of salt - I have contributed no 
CPAN or PEAR packages (yet). :-)


Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] send email at certain hour

2005-06-25 Thread Paul Waring
On Sat, Jun 25, 2005 at 06:29:16PM +0300, vlad georgescu wrote:
 i want to make a reminder application which sends emails at certain hour 
 in php. is this posibile ? if not, what else can I use ?

It's sort of possible - I know vBulletin uses a hidden image or
something to call a file called cron.php which runs certain tasks every
X hours or so. I haven't looked at it in detail though.

If you have access to a server where you can run cron jobs though, I'd
recommend doing things that way above anything else, as PHP isn't really
the best way to implement a do something every X timespan solution.

Paul

-- 
Rogue Tory
http://www.roguetory.org.uk

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Strange is_dir() behavior

2005-06-25 Thread Marcos Mendonça
Yes, if i try to to echo the variable $entry outside the if is returns
the expected directories list.

I tried giving it the full path and it still doesn't work.

On 6/25/05, Edward Vermillion [EMAIL PROTECTED] wrote:
 
 On Jun 25, 2005, at 8:34 AM, Marcos Mendonça wrote:
 
  Hello
 
  I'm using PHP 4.3.9, under Windows XP with Apache.
 
  I have the following directory structure on a given app, i'm working
  on.
 
  photos/
  folder1
  folder2
  folder3
  ... and so on
 
  I'm trying the following code to make a list of folder under photos:
 
$d = dir('photos/');
 
while (false !== ($entry = $d-read())) {
if (is_dir($entry)  $entry != '.'  $entry != 
  '..')
echo $entry . br /;
}
 
  For some strange reason, that echoes nothing. is_dir is returning
  false on every folder (dir)
  under photos, except for '.' and '..' dirs. Can someone explain this?
 
 What do you get if you just echo out $entry without the if() statement?
 
 Do you get a list of the directories you'd expect?
 
 
 
 Edward Vermillion
 [EMAIL PROTECTED]
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: send email at certain hour

2005-06-25 Thread janbro

vlad georgescu schrieb:
i want to make a reminder application which sends emails at certain hour 
in php. is this posibile ? if not, what else can I use ?




For Linux you could start a cron job, with windows I'd use the taskmanager
to start a batch file which contains something like

cd\programs\php
php c:\webpages\php\timer.php

janbro

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: send email at certain hour

2005-06-25 Thread Nicolas Diez
It also exists one website to do that :  http://www.webcron.org/

On 6/25/05, janbro [EMAIL PROTECTED] wrote:
 vlad georgescu schrieb:
  i want to make a reminder application which sends emails at certain hour
  in php. is this posibile ? if not, what else can I use ?
 
 
 For Linux you could start a cron job, with windows I'd use the taskmanager
 to start a batch file which contains something like
 
 cd\programs\php
 php c:\webpages\php\timer.php
 
 janbro
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] send email at certain hour

2005-06-25 Thread Rory Browne
That would depend a lot:

Using your PHP/Webserver alone wouldn't be the best way of doing
things - unless you have no other choice. If you do have a choice, I
would use cron on Unix, and task schecduler, on windos, as mentioned
above. You could use these schecdulers to call a PHP CLI script.

If cron/taskManager isn't available to you, then all you can really
do, is perhaps use the first request send after the certain time to
perform the task. For example if you choose to send an email at 2pm
and someone visits your site at 2:05(assuming nobody visited between
2:00 and 2:04), then the mail would be sent at 2:05. The problem with
this would be that if nobody visited your site until 10pm, then your
emails will be 8 hours late, and if nobody visits your site until 3
days later, then your emails will be three days late..

On 6/25/05, vlad georgescu [EMAIL PROTECTED] wrote:
 i want to make a reminder application which sends emails at certain hour
 in php. is this posibile ? if not, what else can I use ?
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Stop spreading PEAR FUD; WAS Re: [PHP] Re: PHP web archeticture

2005-06-25 Thread Robert Cummings
On Sat, 2005-06-25 at 11:06, Matthew Weier O'Phinney wrote:
 * Robert Cummings [EMAIL PROTECTED] :
  On Sat, 2005-06-25 at 10:32, Matthew Weier O'Phinney wrote:
   * Catalin Trifu [EMAIL PROTECTED] :
I also tend to stay away from PEAR, which is kinda bloated for my
taste, except the Log package.
   
   rant
   I hear that a lot on this list, and I don't understand the reasoning
   behind such comments -- perhaps because nobody offers any reasoning,
   only the opinion?
   
   I'm a PEAR user, and I've found the packages anything *but* bloated.
   Granted, I only use a subset of PEAR, but that subset has made mycoding
   easier. I use DB, Log, Mail, Mail_MIME, HTML_QuickForm, Cache_Lite, and
   Pager daily; additionally, we use custom PEAR error handlers to catch
   errors generated by these packages, log them, and display custom error
   pages. If I'd had to write the functionality I have readily available in
   these packages, I wouldn't have a job right now. They've helped me meet
   numerous deadlines.
 
 It may be my opinion, but I've also given some reasoning for my opinion:
 help in meeting deadlines, centralized error handling, and variety of
 packages. I've helped to *qualify* my opinion. I'll do more of that
 below.

Your argumentation is flawed, you are using a red-herring technique to
justify how PEAR is not bloated by giving examples of its usefulness. I
give no argumentation either way as to the usefulness of PEAR. I have
used PEAR and continue to use PEAR as I see a need; however, that
usefulness has ABSOLUTELY NO BEARING on whether it is bloated or not.
Now so far you have said the following:

- I use such and such a package in PEAR
- I wouldn't have a job if not for PEAR
- PEAR has helped me meet deadlines
- centralized error handling

  No matter how many deadlines PEAR helps you meet and how much you may
  find the PEAR modules indispensable, you are expressing a subjective
  opinion unrelated to the OP's comment about bloated. A package can be
  very bloated and still be extremely useful to someone who doesn't have
  the time or the ability (not to say you don't have the ability) to
  implement similar functionality themself. 
 
 Correct; ability isn't the problem; time often is.

- ability isn't problem time often is

 aside
 However, I also find that I start by creating some functionality myself,
 and then as special cases start popping up, modifying, adding on... and
 then discovering that an equivalent PEAR package already exists that
 covers all these special cases and a number I hadn't thought of. (Pager
 comes to mind).

- pear often already has equivalent code
- covers all these special cases

 I often wonder if what is meant by 'bloat' is that those claiming
 'bloat' feel that the PEAR code covers too many special cases -- cases
 they have not encountered or do not expect to encounter.
 
 Personally, I feel that I'd rather have all my bases covered; I can see
 a point in wanting to keep code trimmed to the necessary cases, though.
 /aside
 
  Additionally PEAR does present a centralized location for common
  functionality with good peer review, 
 
 This is one of the selling points for PEAR; many eyes looking at the
 code, including people who aren't invested in the particular problem.
 Having the diversity of reviewers often makes for better code.
 
  however IMHO I side with the OP with respect to much of PEAR being
  bloated.
 
 Then explain what you mean by 'bloated'. Just throwing out that phrase
 doesn't give anybody any extra information -- just your opinion. Can you
 give some examples to *qualify* your statement that PEAR is bloated?
 That was the main thrust of my rant -- people throwing out unqualified
 opinion statements like 'PEAR sucks' or 'PEAR is bloated' without
 explaining *why*.

So far all the reasons you've given to indicate why PEAR is NOT bloated
have nothing to do with why PEAR is or is not bloated. You have clearly
indicated a passion for it, a usefulness from it, even established a
decent amount of superiority in it, but if anything your arguments have
indicated why it is bloated in many respects:

- covers all of these special cases (and by virtue probably more)
- I can see a point in wanting to keep code trimmed to necessary
  cases though
- rather have all my bases covered

It is my opinion and the opinion of many others that the fact that PEAR
covers so many exceptional cases, the fact that PEAR implements such a
generalize error handling system, the fact that PEAR do so much generic
everything to make everone happy, that these elements that make it so
versatile also make it feel bloated. It's like kicking a soccer ball to
the goal, but rather than take the most direct route, you take the
fringe route to cover all your bases...ultimately this is generally a
longer path.

Now that I've given examples of why bloated please refrain from giving
subjective measurements of gratitude over arguments that 

[PHP] Re: send email at certain hour

2005-06-25 Thread Arthur Wiebe

vlad georgescu wrote:
i want to make a reminder application which sends emails at certain hour 
in php. is this posibile ? if not, what else can I use ?




I've done it using pure PHP for a calendar script.

What I did was write a PHP script with a loop that checks every second 
whether or not something should be done. For example:



?php
$t = true;
while ($t) {
  if (time() == $myTimeStamp) {
mail(args);
  }
}
?

at the top of the script I have a line like this:
#!/usr/bin/env php
for *nixs' and I wrote a little batch file for Windows systems.
At least it works.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] a basic array question!

2005-06-25 Thread bruce
feel kind of foolish posting this.. but i can't seem to figure it out for
now..

i have an array, i can do a print_r($foo) and get the following:
Array
(
[bookmark] = 1
[facets] = Array
(
[0] = Array
(
[lastname] = form id=facet-lastname
input type=hidden name=list value= /
input type=hidden name=offset value=0 /
input type=hidden name=orderBy value=username /
input type=hidden name=sort value=asc /
strongName:/strong
input type=text name=_lastname value= style=width: 125px /
input type=submit value=Search /
/form
}

i simply need to know how to get the actual value of an element ('lastname')
to do:
$cat = $foo-facets[0]-['lastname'] (obviously, this doesn't work!!)

i've tried a variety of possible choices, with no luck...

any ideas/thoughts/etc...

thanks

bruce
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] a basic array question!

2005-06-25 Thread Robbert van Andel
If you want to get the lastname value of the array you supplied you would do
this

$value = $foo['facets'][0]['lastname'];

This would give you the HTML form that you have stored in your array.

Robbert

-Original Message-
From: bruce [mailto:[EMAIL PROTECTED] 
Sent: Saturday, June 25, 2005 2:02 PM
To: php-general@lists.php.net
Subject: [PHP] a basic array question!

feel kind of foolish posting this.. but i can't seem to figure it out for
now..

i have an array, i can do a print_r($foo) and get the following:
Array
(
[bookmark] = 1
[facets] = Array
(
[0] = Array
(
[lastname] = form id=facet-lastname
input type=hidden name=list value= /
input type=hidden name=offset value=0 /
input type=hidden name=orderBy value=username /
input type=hidden name=sort value=asc /
strongName:/strong
input type=text name=_lastname value= style=width: 125px /
input type=submit value=Search /
/form
}

i simply need to know how to get the actual value of an element ('lastname')
to do:
$cat = $foo-facets[0]-['lastname'] (obviously, this doesn't work!!)

i've tried a variety of possible choices, with no luck...

any ideas/thoughts/etc...

thanks

bruce
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Strange is_dir() behavior

2005-06-25 Thread Marek Kilimajer

Marcos Mendonça wrote:

Hello

I'm using PHP 4.3.9, under Windows XP with Apache.

I have the following directory structure on a given app, i'm working on.

photos/
   folder1
   folder2
   folder3
   ... and so on

I'm trying the following code to make a list of folder under photos:

  $d = dir('photos/');

while (false !== ($entry = $d-read())) {
if (is_dir($entry)  $entry != '.'  $entry != 
'..')
echo $entry . br /;
}

For some strange reason, that echoes nothing. is_dir is returning
false on every folder (dir)
under photos, except for '.' and '..' dirs. Can someone explain this?


is_dir() is checking for 'folder1', 'folder2' etc. You want it to check 
 'photos/folder1', 'photos/folder2'


Use:
if (is_dir('photos/' . $entry) 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Stop spreading PEAR FUD; WAS Re: [PHP] Re: PHP web archeticture

2005-06-25 Thread Matthew Weier O'Phinney
* Robert Cummings [EMAIL PROTECTED] :
 On Sat, 2005-06-25 at 11:06, Matthew Weier O'Phinney wrote:
  * Robert Cummings [EMAIL PROTECTED] :
   On Sat, 2005-06-25 at 10:32, Matthew Weier O'Phinney wrote:
* Catalin Trifu [EMAIL PROTECTED] :
 I also tend to stay away from PEAR, which is kinda bloated for my
 taste, except the Log package.

rant
I hear that a lot on this list, and I don't understand the reasoning
behind such comments -- perhaps because nobody offers any reasoning,
only the opinion?

I'm a PEAR user, and I've found the packages anything *but* bloated.
Granted, I only use a subset of PEAR, but that subset has made mycoding
easier. I use DB, Log, Mail, Mail_MIME, HTML_QuickForm, Cache_Lite, and
Pager daily; additionally, we use custom PEAR error handlers to catch
errors generated by these packages, log them, and display custom error
pages. If I'd had to write the functionality I have readily available in
these packages, I wouldn't have a job right now. They've helped me meet
numerous deadlines.
  
  It may be my opinion, but I've also given some reasoning for my opinion:
  help in meeting deadlines, centralized error handling, and variety of
  packages. I've helped to *qualify* my opinion. I'll do more of that
  below.

 Your argumentation is flawed, you are using a red-herring technique to
 justify how PEAR is not bloated by giving examples of its usefulness. 

Actually, my argumentation was not specifically about 'PEAR is bloated',
but more along the lines of the many comments I've seen on this list to
the effect of 'PEAR sucks'. But I've also seen many comments like the
one from Catalin about 'PEAR... is kinda bloated', without indicating
why they think so. I should have been more clear in my rant that I'm
tired of hearing generalized negative statements against PEAR that are
then unqualified (i.e. no substative reasons given).

The statement 'PEAR is bloated' doesn't indicate in what way it is
bloated. Unfortunately, many read 'bloated' as a negative, and thus as an
indication that one should stay away from the code; thus may a developer
who has a problem that could be easily solved by PEAR code be turned
away from it.

Additionally, saying 'PEAR is bloated' doesn't take into account the
fact that PEAR is a large group of packages, and that each package
within PEAR should be judged on its own. For instance, I've heard and
read some good arguments as to why the PEAR package itself is bloated;
however, if you've ever taken a look at Cache_Lite, you'd probably agree
that it is anything *but* bloated. (The authors of that package put no
dependency on PEAR.php, and coded with a goal of efficiency and
optimization.) 

snip
  Then explain what you mean by 'bloated'. Just throwing out that phrase
  doesn't give anybody any extra information -- just your opinion. Can you
  give some examples to *qualify* your statement that PEAR is bloated?
  That was the main thrust of my rant -- people throwing out unqualified
  opinion statements like 'PEAR sucks' or 'PEAR is bloated' without
  explaining *why*.

 So far all the reasons you've given to indicate why PEAR is NOT bloated
 have nothing to do with why PEAR is or is not bloated. You have clearly
 indicated a passion for it, a usefulness from it, even established a
 decent amount of superiority in it, but if anything your arguments have
 indicated why it is bloated in many respects:

 - covers all of these special cases (and by virtue probably more)
 - I can see a point in wanting to keep code trimmed to necessary
   cases though
 - rather have all my bases covered

 It is my opinion and the opinion of many others that the fact that PEAR
 covers so many exceptional cases, the fact that PEAR implements such a
 generalize error handling system, the fact that PEAR do so much generic
 everything to make everone happy, that these elements that make it so
 versatile also make it feel bloated. It's like kicking a soccer ball to
 the goal, but rather than take the most direct route, you take the
 fringe route to cover all your bases...ultimately this is generally a
 longer path.

And, as I said, I can completely see your point. But, as noted above,
saying PEAR gives a false impression that *all* code in PEAR is bloated,
which is simply not the case. 

On the other hand, you've also given a very nice overview of *why*
people feel some code in PEAR is bloated -- which is what I've been
driving at. You've qualified the statement, and that's worth much more
than simply tossing the phrase off. Thank you!

I guess the moral of the story is: we now have a thread we can point to
that shows some of the arguments for why some consider code in PEAR
bloated, but also that :

* bloat != lack of usefulness.
* not all code in PEAR is bloated

Thanks for your responses, Rob.

-- 
Matthew Weier O'Phinney   | WEBSITES:
Webmaster and IT Specialist   | http://www.garden.org

Re: [PHP] Stop spreading PEAR FUD; WAS Re: [PHP] Re: PHP web archeticture

2005-06-25 Thread Matthew Weier O'Phinney
* Paul Waring [EMAIL PROTECTED] :
 On Sat, Jun 25, 2005 at 10:32:41AM -0400, Matthew Weier O'Phinney wrote:
  If somebody could offer some *constructive* criticism of PEAR -- PEAR as
  it is TODAY, not 3 years ago, when I last tried it -- these comments
  would have more weight. As it is, I feel they're just FUD based on
  ignorance.

 The documentation for some of the less well known packages is poor or
 non-existant, or at least that's what I've always noticed and has been
 my major bug bear with PEAR for a long time. 

Indeed, the DocBook requirement for PEAR documentation is a major issue
even with PEAR developers.

 For example, I want to use the DB_Pager module but there is *no* end
 user documentation, all I have to work with is some poorly formatted
 information pulled from the API comments.

Just an FYI: Use the Pager package instead. Under doc/Pager/examples in
your PEAR directory is a Pager_Wrapper.php script that shows how to use
it easily with DB. Pager, unlike DB_Pager, is well documented.

 There are also a lot of packages (again, less well known ones) that
 haven't been updated in a long time, in some cases several years. I'm
 not saying that PEAR in general is a stale project, or that it's no good
 (on the contrary, I use several of the packages on my sites and they're
 very useful), but I do get the feeling that the non-core packages have
 been left to rot both in terms of updates and documentation.

This is an issue I've seen PEAR attempt to address this past year
through the introduction of its QA team. But the process is still far
from tuned.

The above are *great* examples of why people might not choose PEAR --
and constructive ones at that. Thanks.

 I've used both PEAR and CPAN for a few years now and I've noticed that
 CPAN tends to win hands down in terms of documentation and updates. That
 might just be down to the particular packages I've happened to use but
 given a choice I know which one I'd rather use.

Ah, a fellow perl developer! CPAN is, for me, *the* reason to code in
perl. The perl culture is one that includes testing and documentation as
the norm -- and that has made for a solid library in CPAN. However, the
TIMTOWDI principle also means that forking is a foundation principle.
This can be seen as either a pro or a con: pro, in that you have choice
in what module to use; con, in that you then have to evaluate a number
of modules.

After having said that, though, I'll continue coding PHP anyday!

-- 
Matthew Weier O'Phinney   | WEBSITES:
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:[EMAIL PROTECTED] | http://vermontbotanical.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Stop spreading PEAR FUD; WAS Re: [PHP] Re: PHP web archeticture

2005-06-25 Thread Chris Shiflett

Matthew Weier O'Phinney wrote:

The perl culture is one that includes testing and documentation as
the norm


You might be interested to know that there is a PHP equivalent for 
Test::More, the CPAN library that prompted the testing revolution that 
Perl seems to have undergone in the past five years or so.


It is packaged as a standard part of Apache-Test (which now has support 
for testing PHP applications):


http://search.cpan.org/dist/Apache-Test/

Hope that helps.

Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Stop spreading PEAR FUD; WAS Re: [PHP] Re: PHP web archeticture

2005-06-25 Thread Colin Ross
I don't think a lot of people think tat PEAR sucks, we are all, as a 
community, just looking for ways to make it better.
C

On 6/25/05, Chris Shiflett [EMAIL PROTECTED] wrote:
 
 Matthew Weier O'Phinney wrote:
  The perl culture is one that includes testing and documentation as
  the norm
 
 You might be interested to know that there is a PHP equivalent for
 Test::More, the CPAN library that prompted the testing revolution that
 Perl seems to have undergone in the past five years or so.
 
 It is packaged as a standard part of Apache-Test (which now has support
 for testing PHP applications):
 
 http://search.cpan.org/dist/Apache-Test/
 
 Hope that helps.
 
 Chris
 
 --
 Chris Shiflett
 Brain Bulb, The PHP Consultancy
 http://brainbulb.com/
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 



[PHP] Re: Stop spreading PEAR FUD; WAS Re: [PHP] Re: PHP web archeticture

2005-06-25 Thread Catalin Trifu
  Hi,


   I feel like I should answer your anger towards my opinion.
First of all I consider PEAR to be bloated for the following reasons;
it's a large library, it tries to cover a very general approach and
please 99% of case one may encounter. It's exception system is overused and
the overhead of it is not to be disregarded.
   Granted, PHP5 brings PEAR into a new light with it's new object model,
but till recently, php4 was in place and it's object model made big class
libraries quite a problem. Let's not forget there are few out there
using php5 in production.
   I, for one, prefer to use highly specialezed libraries, which are
designed for one purpose only and which are carefully coded to achive
that purpose with maximum efficiency and as less overhead as possible.
   I think PEAR is a very good class library and it's code is very nice
and well thought. I use the Log package of PEAR, which does not depend
on the PEAR core and I am very happy with it.
   I don't deny it's usefullness nor do i contest it in any way, I simply
prefer a different approach when building a project.
   If I were to compare PEAR with another well known library from the C++
world I would compare it with MFC and if I am to choose between smaller,
leaner and meaner PHP libraries over PEAR then I will choose them just
as I would choose ATL/WTL over MFC.
   It can be that development time may be a bit longer but the code
quality will be better in my opinion and I for one value more code
quality over a few hours of extra time.
   Btw! I do keep an eye on PEAR as I do on many other PHP libraries and
I do monthly research about what's new and noteworthy in the PHP world. For
example, when the issue of using a database layer and a templating engine
came into the big picture, I tried both PEAR::DB and ADOdb as I tried
PEAR::HTML_* and Smarty. I decided to use ADOdb and Smarty because they were
smaller and faster.
   My decision was based on personal experience and not influenced by opinions
expressed by others; of course I did take the time to see what others have
to say but the decision was mine to make. I may as well have been wrong
in making that decision but for now I am quite happy with it and I don't
consider switching to PEAR as a better alternative.


Catalin

P.S.
   Please forgive me if my opinion offended you in any way.


Matthew Weier O'Phinney wrote:
 * Catalin Trifu [EMAIL PROTECTED] :
 
I also tend to stay away from PEAR, which is kinda bloated for my
taste, except the Log package.
 
 
 rant
 I hear that a lot on this list, and I don't understand the reasoning
 behind such comments -- perhaps because nobody offers any reasoning,
 only the opinion?
 
 I'm a PEAR user, and I've found the packages anything *but* bloated.
 Granted, I only use a subset of PEAR, but that subset has made mycoding
 easier. I use DB, Log, Mail, Mail_MIME, HTML_QuickForm, Cache_Lite, and
 Pager daily; additionally, we use custom PEAR error handlers to catch
 errors generated by these packages, log them, and display custom error
 pages. If I'd had to write the functionality I have readily available in
 these packages, I wouldn't have a job right now. They've helped me meet
 numerous deadlines.
 
 If somebody could offer some *constructive* criticism of PEAR -- PEAR as
 it is TODAY, not 3 years ago, when I last tried it -- these comments
 would have more weight. As it is, I feel they're just FUD based on
 ignorance.
 /rant
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Module testing; WAS Re: [PHP] Stop spreading PEAR FUD; WAS Re: [PHP] Re: PHP web archeticture

2005-06-25 Thread Matthew Weier O'Phinney
* Chris Shiflett [EMAIL PROTECTED] :
 Matthew Weier O'Phinney wrote:
  The perl culture is one that includes testing and documentation as
  the norm

 You might be interested to know that there is a PHP equivalent for 
 Test::More, the CPAN library that prompted the testing revolution that 
 Perl seems to have undergone in the past five years or so.

 It is packaged as a standard part of Apache-Test (which now has support 
 for testing PHP applications):

 http://search.cpan.org/dist/Apache-Test/

I've seen you mention Apache-Test before, but I didn't realize that it
had integrated PHP testing in it. Looks interesting.

I've actually been using phpt tests for a number of months now, and find
them very well suited for most tasks I throw at them (typically API
testing). However, I could see Apache-Test being useful for full
application testing. 

Thanks for pointing this out!

-- 
Matthew Weier O'Phinney   | WEBSITES:
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:[EMAIL PROTECTED] | http://vermontbotanical.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Stop spreading PEAR FUD; WAS Re: [PHP] Re: PHP web archeticture

2005-06-25 Thread Matthew Weier O'Phinney
* Colin Ross [EMAIL PROTECTED] :
 I don't think a lot of people think tat PEAR sucks, we are all, as a
 community, just looking for ways to make it better.

I don't think a lot of people think it sucks; it's just that I often see
statements on this list like 'PEAR sucks' or 'PEAR is bloated' without
the authors of said statements offering any reasons why they think so. I
wanted to address these reasons, instead of just letting the comment
slide on by this time.

-- 
Matthew Weier O'Phinney   | WEBSITES:
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:[EMAIL PROTECTED] | http://vermontbotanical.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] a basic array question!

2005-06-25 Thread Brian V Bonini
On Sat, 2005-06-25 at 17:01, bruce wrote:
 feel kind of foolish posting this.. but i can't seem to figure it out for
 now..
 
 i have an array, i can do a print_r($foo) and get the following:
 Array
 (
 [bookmark] = 1
 [facets] = Array
 (
 [0] = Array
 (
 [lastname] = form id=facet-lastname
 input type=hidden name=list value= /
 input type=hidden name=offset value=0 /
 input type=hidden name=orderBy value=username /
 input type=hidden name=sort value=asc /
 strongName:/strong
   input type=text name=_lastname value= style=width: 125px /
   input type=submit value=Search /
 /form
   }
 
 i simply need to know how to get the actual value of an element ('lastname')
 to do:
 $cat = $foo-facets[0]-['lastname'] (obviously, this doesn't work!!)
 

$lastname = $foo['facets'][0]['lastname'];

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] MySQL-4.1.x support for PHP-4.3.11 under Windows

2005-06-25 Thread Dan

Hi all.

The mysql dlls bundled with php-4.3.11 for Windows are for mysql-3.x.
Are there any pre-compiled dlls for mysql-4.1.x? I kinda need them, 
pronto, and don't have the time / expertise to compile them under Windows.


Dan


--
BEGIN-ANTISPAM-VOTING-LINKS
--If you are not the CanIt 
administrator and you think this
message is spam, please give the id 6682 and magic value
24643275fabf to [EMAIL PROTECTED] to be marked as spam.

Teach CanIt if this mail (ID 6682) is spam:
Spam:http://entropy.homelinux.org/canit/b.php?c=si=6682m=24643275fabf
Not spam:http://entropy.homelinux.org/canit/b.php?c=ni=6682m=24643275fabf
Forget vote: http://entropy.homelinux.org/canit/b.php?c=fi=6682m=24643275fabf
--
END-ANTISPAM-VOTING-LINKS

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP] Best way to use other objects within classes?

2005-06-25 Thread Tom Rogers
Hi,

Here it is for anyone that would like to try it.


?php

if(preg_match('/^win/i',PHP_OS)){
  define('OS_SEP','\\');
  define('OS_JOIN',';');
}else{
  define('OS_SEP','/');
  define('OS_JOIN',':');
}
class classLoader {
  function loadLib($library=''){
if(!empty($library)){
  $file = $GLOBALS['class_dir'].$library.'.lib'; 
  if(!file_exists($file)){
$paths = split(OS_JOIN,ini_get('include_path'));
$found = false;
while(!$found  list($key,$val) = each($paths)){
  $file = $val.OS_SEP.$library.'.lib';
  $found = file_exists($file);
}
  }
  if($found) include($file);
}
$array = get_declared_classes();
foreach($array as $classname){
  if(!isset($GLOBALS['loaded_classes'][$classname])) 
$GLOBALS['loaded_classes'][$classname] = array();
}
if(isset($start_classes)  is_array($start_classes)){
  foreach($start_classes as $class=$info){
$class_name = strtolower($class);
$name = $info['name'];
$hash = mhash(MHASH_TIGER,serialize($info['vars']));
if(isset($GLOBALS['loaded_classes'][$class_name])){
  $varcount = count($info['vars']);
  $vars = '$GLOBALS[\'loaded_classes\'][$class_name][$name][\'class\'] 
= new '.$class.'(';
  if($varcount  0){
for ($i = 0; $i  $varcount; $i++) {
  $vars .= ($i  0)? ',':'';
  $varname = 'variable'.$i;
  $$varname = $info['vars'][$i];
  $vars .= \$$varname;
}
  }
  $vars .= ');';
  eval($vars);
  $GLOBALS['loaded_classes'][$class_name][$name]['hash'] = $hash;
  if(!empty($info['global'])) $GLOBALS[$info['global']] = 
$GLOBALS['loaded_classes'][$class_name][$name]['class'];
}
  }
  unset($start_classes);
}
  }
  function load($class,$name=''){
$class_name = strtolower($class);
$name = (empty($name))? $class:$name;
$num_args = func_num_args();
$arg_list = func_get_args();
$hash = mhash(MHASH_TIGER,serialize($arg_list));
if(isset($GLOBALS['loaded_classes'][$class_name][$name])){
  if($num_args  2  
$GLOBALS['loaded_classes'][$class_name][$name]['hash'] != $hash){
$vars = 
'$GLOBALS[\'loaded_classes\'][$class_name][$name][\'class\']-'.$class.'(';
for ($i = 2; $i  $num_args; $i++) {
  $vars .= ($i  2)? ',':'';
  $varname = 'variable'.$i;
  $$varname = $arg_list[$i];
  $vars .= \$$varname;
}
$vars .= ');';
eval($vars);
$GLOBALS['loaded_classes'][$class_name][$name]['hash'] = $hash;
  }
  return $GLOBALS['loaded_classes'][$class_name][$name]['class'];
}elseif(!isset($GLOBALS['loaded_classes'][$class_name])){
  $file = $GLOBALS['class_dir'].$class.'.inc'; 
  if(!file_exists($file)){
$paths = split(OS_JOIN,ini_get('include_path'));
$found = false;
while(!$found  list($key,$val) = each($paths)){
  $file = $val.OS_SEP.$class.'.inc';
  $found = file_exists($file);
}
  }else $found = true;
  if($found){
include($file);
classLoader::loadLib();
  }
}
if(isset($GLOBALS['loaded_classes'][$class_name])){
  $vars = '$GLOBALS[\'loaded_classes\'][$class_name][$name][\'class\'] = 
new '.$class.'(';
  if($num_args  2) {
for ($i = 2; $i  $num_args; $i++) {
  $vars .= ($i  2)? ',':'';
  $varname = 'variable'.$i;
  $$varname = $arg_list[$i];
  $vars .= \$$varname;
}
  }
  $vars .= ');';
  eval($vars);
  $GLOBALS['loaded_classes'][$class_name][$name]['hash'] = $hash;
  return $GLOBALS['loaded_classes'][$class_name][$name]['class'];
}
return false;
  }
  function remove($class,$name=''){
$r = false;
$class_name = strtolower($class);
$name = (empty($name))? $class:$name;
if(isset($GLOBALS['loaded_classes'][$class_name][$name])){
  unset($GLOBALS['loaded_classes'][$class_name][$name]);
  $r = true;
}
return $r;
  }
  function find($class,$name){
$class_name = strtolower($class);
if(isset($GLOBALS['loaded_classes'][$class_name][$name])){
  return $GLOBALS['loaded_classes'][$class_name][$name]['class'];
}else{
  return false;
}
  }
}
//Usage
// not tested in php5
// all class files end in .inc
// all library files end in .lib
// I don't instanciate the class so uou just
// need to set 2 global variables them call loadLib()
// without any args to get a list of already loaded classes.

$class_dir = '/usr/local/apache/phpinc';
$loaded_classes = array();
classLoader::loadLib();

// The load a class giving it a name and any args that it needs,
// it can pass references without problem
// for example I have a Mysql table class I use just about everywhere
// which needs the db and table to use


$table = classLoader::load('tableClass','members','testdb','test_table');

// now I can get that same 

Re[3]: [PHP] Best way to use other objects within classes?

2005-06-25 Thread Tom Rogers
Hi,

Sunday, June 26, 2005, 12:27:44 PM, you wrote:
TR Hi,

TR Here it is for anyone that would like to try it.


TR ?php

TR if(preg_match('/^win/i',PHP_OS)){
TR   define('OS_SEP','\\');
TR   define('OS_JOIN',';');
TR }else{
TR   define('OS_SEP','/');
TR   define('OS_JOIN',':');
TR }
TR class classLoader {
TR   function loadLib($library=''){
TR if(!empty($library)){
TR   $file = $GLOBALS['class_dir'].$library.'.lib'; 
TR   if(!file_exists($file)){
TR $paths = split(OS_JOIN,ini_get('include_path'));
TR $found = false;
TR while(!$found  list($key,$val) = each($paths)){
TR   $file = $val.OS_SEP.$library.'.lib';
TR   $found = file_exists($file);
TR }
TR   }
TR   if($found) include($file);
TR }
TR $array = get_declared_classes();
TR foreach($array as $classname){
TR   if(!isset($GLOBALS['loaded_classes'][$classname]))
TR $GLOBALS['loaded_classes'][$classname] = array();
TR }
TR if(isset($start_classes)  is_array($start_classes)){
TR   foreach($start_classes as $class=$info){
TR $class_name = strtolower($class);
TR $name = $info['name'];
TR $hash = mhash(MHASH_TIGER,serialize($info['vars']));
TR if(isset($GLOBALS['loaded_classes'][$class_name])){
TR   $varcount = count($info['vars']);
TR   $vars =
TR '$GLOBALS[\'loaded_classes\'][$class_name][$name][\'class\'] =
TR new '.$class.'(';
TR   if($varcount  0){
TR for ($i = 0; $i  $varcount; $i++) {
TR   $vars .= ($i  0)? ',':'';
TR   $varname = 'variable'.$i;
TR   $$varname = $info['vars'][$i];
TR   $vars .= \$$varname;
TR }
TR   }
TR   $vars .= ');';
TR   eval($vars);
TR  
TR $GLOBALS['loaded_classes'][$class_name][$name]['hash'] = $hash;
TR   if(!empty($info['global']))
TR $GLOBALS[$info['global']] =
TR $GLOBALS['loaded_classes'][$class_name][$name]['class'];
TR }
TR   }
TR   unset($start_classes);
TR }
TR   }
TR   function load($class,$name=''){
TR $class_name = strtolower($class);
TR $name = (empty($name))? $class:$name;
TR $num_args = func_num_args();
TR $arg_list = func_get_args();
TR $hash = mhash(MHASH_TIGER,serialize($arg_list));
TR if(isset($GLOBALS['loaded_classes'][$class_name][$name])){
TR   if($num_args  2 
TR $GLOBALS['loaded_classes'][$class_name][$name]['hash'] != $hash){
TR $vars =
TR '$GLOBALS[\'loaded_classes\'][$class_name][$name][\'class\']-'.$class.'(';
TR for ($i = 2; $i  $num_args; $i++) {
TR   $vars .= ($i  2)? ',':'';
TR   $varname = 'variable'.$i;
TR   $$varname = $arg_list[$i];
TR   $vars .= \$$varname;
TR }
TR $vars .= ');';
TR eval($vars);
TR
TR $GLOBALS['loaded_classes'][$class_name][$name]['hash'] = $hash;
TR   }
TR   return
TR $GLOBALS['loaded_classes'][$class_name][$name]['class'];
TR }elseif(!isset($GLOBALS['loaded_classes'][$class_name])){
TR   $file = $GLOBALS['class_dir'].$class.'.inc'; 
TR   if(!file_exists($file)){
TR $paths = split(OS_JOIN,ini_get('include_path'));
TR $found = false;
TR while(!$found  list($key,$val) = each($paths)){
TR   $file = $val.OS_SEP.$class.'.inc';
TR   $found = file_exists($file);
TR }
TR   }else $found = true;
TR   if($found){
TR include($file);
TR classLoader::loadLib();
TR   }
TR }
TR if(isset($GLOBALS['loaded_classes'][$class_name])){
TR   $vars =
TR '$GLOBALS[\'loaded_classes\'][$class_name][$name][\'class\'] =
TR new '.$class.'(';
TR   if($num_args  2) {
TR for ($i = 2; $i  $num_args; $i++) {
TR   $vars .= ($i  2)? ',':'';
TR   $varname = 'variable'.$i;
TR   $$varname = $arg_list[$i];
TR   $vars .= \$$varname;
TR }
TR   }
TR   $vars .= ');';
TR   eval($vars);
TR   $GLOBALS['loaded_classes'][$class_name][$name]['hash'] = $hash;
TR   return
TR $GLOBALS['loaded_classes'][$class_name][$name]['class'];
TR }
TR return false;
TR   }
TR   function remove($class,$name=''){
TR $r = false;
TR $class_name = strtolower($class);
TR $name = (empty($name))? $class:$name;
TR if(isset($GLOBALS['loaded_classes'][$class_name][$name])){
TR   unset($GLOBALS['loaded_classes'][$class_name][$name]);
TR   $r = true;
TR }
TR return $r;
TR   }
TR   function find($class,$name){
TR $class_name = strtolower($class);
TR if(isset($GLOBALS['loaded_classes'][$class_name][$name])){
TR   return
TR $GLOBALS['loaded_classes'][$class_name][$name]['class'];
TR }else{
TR   return false;
TR }
TR   }
TR }
TR //Usage
TR // not tested in php5
TR // all class files end in .inc
TR // all library files end in .lib
TR // I don't instanciate the class so uou just
TR // need to set 2 global variables them call loadLib()

[PHP] css/html expertise??

2005-06-25 Thread bruce
hi

i know this is a php list, but i have a prob/question.

i'm playing around with css (classes/ids/etc...) does anybody here have any
experience with this or could answer a few questions??

thanks

bruce
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: css/html expertise??

2005-06-25 Thread Jasper Bryant-Greene
bruce wrote:
 i'm playing around with css (classes/ids/etc...) does anybody here
 have any experience with this or could answer a few questions??

Email me directly with your issues and I'll try to help you sort it out.

Cheers,
Jasper Bryant-Greene

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] SCORM PHP

2005-06-25 Thread Rodolfo Gonzalez Gonzalez

Hello,

I have searched freshmeat/hotscripts/google/... for some class or simple 
PHP script (not a full LMS) to display SCORM content, without success. 
Does someone know about this topic or if such a class/script exists?, 
thanks a lot in advanced for your help.



Regards.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php