Re: [PHP] Tip For The Day

2004-01-27 Thread Alex Pilson
At 1:40 PM -0500 1/27/04, Robert Cummings wrote:
On Tue, 2004-01-27 at 09:19, Jay Blanchard wrote:
 When constructing arrays where you are meddling with fixed width
 substrings in a larger file make sure that the array item does not
 contain a tab or you will certainly get unexpected results;
 $arrBadInfo (
'AMARILLOHOUSE   ',
'KJONES  HOUSE   ', --- 16 characters wide, or is it?
'DCOLLINSCUSTSVC ',
'LAWTON  JCOLEMAN',
};
 Both above appear to be 16 characters wide in the editor of your choice
 (I am using Zend at the moment). However, if there is a tab between
 KJONES and HOUSE, the HOUSE is moved to the right the appropriate number
 of characters (or inappropriate as it were) and produce undesired
 results. I have been working on this issue since 5 am this morning when
 I finally decided to print_r() the array (consisting of 192 elements).
 Lo and behold (and slapping my forehead thusly) we saw that there were
 tabs in the result. Replacing the tabs with the proper number of spaces
 fixed the result.
 Actually this tip applies to all strings in which you expect there to be
 a fixed width. Beware the tab, especially if you are bring in the data
 from a source (cuttin' n' pastin') outside of your editor.
Event better... turn your editor's tab character to 4 spaces, then your
code never contains those despicable tab characters and you won't
accidentally insert tabs into strings :)
Couldn't you trim the items before placing into an array?
--
---
Alex Pilson
FlagShip Interactive, Inc.
[EMAIL PROTECTED]
---
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PHP FuseBox

2004-01-21 Thread Alex Pilson
I am migrating my development from Lasso 6 to PHP, and I have used 
the FuseBox methodology pretty extensively on some sites. It works 
very well. I was wondering, how prevalent is the FuesBox methodology 
in the PHP developer community? If not, is there a common coding 
practice (structure) that most use?

Any insight would be greatly appreciated.
--
---
Alex Pilson
FlagShip Interactive, Inc.
[EMAIL PROTECTED]
---
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHP FuseBox

2004-01-21 Thread Alex Pilson
At 3:01 PM -0500 1/21/04, Ben Ramsey wrote:
As far as I can tell, there isn't a common coding practice among PHP 
developers.  What I mean is: there is no standard as in ANSI 
Standard C++.  However, I believe that there beginning to be a move 
toward a more standardized way of coding, and I would greatly 
support and like to be involved in helping create this standard.

Nonetheless, some good coding practices for PHP are in the PEAR 
manual (as this is the standard way that PEAR developers request 
that you code PEAR packages).  These standards may be found at:
http://pear.php.net/manual/en/standards.php
Thanks, that was my next question...I was told to look at PEAR from 
the beginning. All I can say is PEAR looks very exciting for me.

Some good coding structure ideas that have been brought into the 
Lasso developer circles over the years:

1) FrameWork...(incredible piece of work) I have friend that is 
working on porting it to PHP.
http://www.fwpro.com/

2) Corral (basically a cascading includes system)
Appear to be offline at the moment: http://www.corralmethodology.com/
3) One-File (basically similar to FuseBox, but without the black 
box) Stems from corral. I know I have seen a lot of PHP developers 
develop with this style, such as ?page=1, etc...
--
---
Alex Pilson
FlagShip Interactive, Inc.
[EMAIL PROTECTED]
---

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


[PHP] Schedule an Event with PHP

2004-01-16 Thread Alex Pilson
Say I want a MySQL database to have a table that holds certain 
events, the Event table. And in the event table, one of the records 
is an event that has a startdate of today, I want to check against 
that date, if it equals now, then do this

Besides using CRON to hit that particular event table, is there any 
other method I am not thinking of that can be used with PHP? I want 
to check that event table every 5 minutes.

Thanks!
--
---
Alex Pilson
FlagShip Interactive, Inc.
[EMAIL PROTECTED]
---
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Schedule an Event with PHP

2004-01-16 Thread Alex Pilson
At 9:44 AM -0500 1/16/04, John W. Holmes wrote:
Alex Pilson wrote:
Say I want a MySQL database to have a table that holds certain 
events, the Event table. And in the event table, one of the records 
is an event that has a startdate of today, I want to check against 
that date, if it equals now, then do this

Besides using CRON to hit that particular event table, is there any 
other method I am not thinking of that can be used with PHP? I want 
to check that event table every 5 minutes.
I guess you could write a PHP script that'll run continuously and 
check the database every 5 minutes, but you'd be better off (and 
probably use less resources) if you just used Cron/Task Scheduler.


Awesome feedback guys. And quick too. No I am not opposed to using 
cron, just was curious if there was anything else to use. With 
regards to ISPs that host PHP clients, what is the common practice to 
allow users to run cron scripts?

BTW. I didn't get what Stuart said about replying to an existing 
thread, did something screw up when I sent to the list?

Thanks for the help.
--
---
Alex Pilson
FlagShip Interactive, Inc.
[EMAIL PROTECTED]
---
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php