NYCPHP Meetup

NYPHP.org

[nycphp-talk] Search function

(Margaret) Michele Waldman mmwaldman at optonline.net
Fri Sep 19 18:14:20 EDT 2008


*small

 

  _____  

From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of (Margaret) Michele Waldman
Sent: Friday, September 19, 2008 6:14 PM
To: 'NYPHP Talk'
Subject: RE: [nycphp-talk] Search function

 

It's a fairly slow site.  I try the php get_file_contents, etc and if too
slow exec grep.

 

Thanks,

 

Michele

 

  _____  

From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of Joseph Crawford
Sent: Friday, September 19, 2008 6:10 PM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Search function

 

You could probably use that however it would be a lot slower than the exec
with grep.  Also it will depend on how many files you have in the site.  I
guess you could try it and if you run into the issue of the script taking
longer than allowed to execute just up the time with ini_set();

 

Joseph Crawford

 

On Sep 19, 2008, at 6:07 PM, (Margaret) Michele Waldman wrote:

 

Would instr get_file_contents be too slow?

 

Michele

 

  _____  

From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of Joseph Crawford
Sent: Friday, September 19, 2008 5:52 PM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Search function

 

If you have SSH access you could use grep, if not write a php script that
will exec() the grep command.  This is providing the hosts security allows
for exec()

 

On Sep 19, 2008, at 5:49 PM, (Margaret) Michele Waldman wrote:





Does anyone know of a function or code I could use to quickly search my site
for a document?

 

I was thinking I could write a php function to open all of the files and
search for a specific string.

 

But, I'm guessing it's already been done with a better implementation.

 

Thanks,

 

Michele

_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

 

_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20080919/3e3f4d97/attachment.html>


More information about the talk mailing list