Re: [PHP] conditional classes

2009-05-24 Thread Nathan Rixham
kranthi wrote: thanks for the comments, what i m planning to do is function _autoload($class) { if($class == 'Database') { if(class_exis('PDO') { include_once('Database_PDO.php'); } else { include_once('Database.php'); } } where in Database_PDO.php contains class Database

Re: [PHP] General Web Development Editor/IDE

2009-05-24 Thread Nathan Rixham
Lester Caine wrote: Casey wrote: Hi list, I'm looking for a nice, user (i.e. me) friendly general-purpose IDE, where most of my work will be done in PHP. I'm considering using Dreamweaver CS4 as my IDE, where I will disable most of the WYSIWYG elements and use all of the other features that I

[PHP] php dev environment

2009-05-24 Thread Nathan Rixham
Hi All, A recent post just reminded me of something I did a while ago that may be of use to many of you (and its sitting doing nothing), it's a kind of how to for getting a full development environment up and running simply. Eclipse PDT 2 + extras

Re: [PHP] Re: table-less layouts; Ideas welcome

2009-05-24 Thread Ashley Sheridan
On Sat, 2009-05-23 at 22:23 -0700, Michael A. Peters wrote: Paul M Foster wrote: I wish someone had thought of a similar thing for databases. From the beginning, there should have been a spreadsheet-like interface for databases. This could have saved endless trouble, since for lack of

Re: [PHP] fgets function for very large files

2009-05-24 Thread shahrzad khorrami
How to divide a large csv file to small ones? Thanks, Shahrzad

Re: [PHP] fgets function for very large files

2009-05-24 Thread kranthi
1. open that in a text editor 2. copy a few lines 3. create a new text file 4. paste the copied lines 5. save with the extension .csv but i doubt this process works i faced exactly same problem few months back and i found http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/ to

Re: [PHP] fgets function for very large files

2009-05-24 Thread shahrzad khorrami
:-o I want to divide this large csv file with programming to small one!

[PHP] help : getting float max

2009-05-24 Thread Nathan Rixham
Afternoon all, This is a quick survey, think it would be useful to have the values of MAX_FLOAT for each platform, and indeed see if it does differ. to do this can you please run the following code (bc* required) and reply back with the output (and your platform / php version) code: ?php

Re: [PHP] conditional classes

2009-05-24 Thread LinuxManMikeC
If you do it that way, you will also have to construct an object and return it from that function. By including the class definitions within a function, they will only be available within that function. You will have to use the function as a factory for building objects. In most cases I could

Re: [PHP] help : getting float max

2009-05-24 Thread Robert Cummings
On Sun, 2009-05-24 at 14:33 +0100, Nathan Rixham wrote: Afternoon all, This is a quick survey, think it would be useful to have the values of MAX_FLOAT for each platform, and indeed see if it does differ. to do this can you please run the following code (bc* required) and reply back

Re: [PHP] templating engine options

2009-05-24 Thread tedd
At 12:01 AM +0100 5/24/09, Nathan Rixham wrote: LinuxManMikeC wrote: I was recently researching template engines for a small in-house project, with a bias toward simple and lightweight. I found this interesting article in my search. I think its worth considering if you don't need all the

Re: [PHP] templating engine options

2009-05-24 Thread kranthi
i use smarty (a templating engine) for two important reasons... 1. in most of my projects, templates are designed by a third party and i dont want them to access all my php variables. 2. smarty is meant to do html coding and in many cases i can get the job done in single sentence, while it takes

Re: [PHP] templating engine options

2009-05-24 Thread Richard Heyes
... For a long time I used require(), simply because I worked in an environment where the web people could either cope with PHP or were programmers. But then I succumbed to the lure and wrote RTemplate (http://www.phpguru.org/rtemplate) - a simple caching template doobry. And now I still use

[PHP] Startup Stuff in the san Francisco/Bay Area

2009-05-24 Thread bruce
Hi guys... Before you start flaming/shouting.. thought I'd post this here, as I'm at my wit's end, and this might help others as well. And yeah, this has nothing to do with solving a php coding issue!! I'm trying to figur eout if there are guys/gals/groups/etc.. of developers here in the San

Re: [PHP] templating engine options

2009-05-24 Thread LinuxManMikeC
On Sun, May 24, 2009 at 11:09 AM, tedd tedd.sperl...@gmail.com wrote: At 12:01 AM +0100 5/24/09, Nathan Rixham wrote: LinuxManMikeC wrote: I was recently researching template engines for a small in-house project, with a bias toward simple and lightweight.  I found this interesting article

Re: [PHP] templating engine options

2009-05-24 Thread Stuart
2009/5/23 Nathan Rixham nrix...@gmail.com: Hi All, Just a quick one, can anybody recommend any decent templating engines other than smarty. I've got no problem with smarty and it does the job - but if there is something newer and lighter out there that I'm missing then I'd be a fool not to

Re: [PHP] Container or Calling Class

2009-05-24 Thread Nathan Rixham
Stuart wrote: 2009/5/24 phphelp -- kbk phph...@comcast.net: If so, can the bar_handler-bar_toast() function call a function in the container class (foo_handler)? Parent is used in some OOP languages for this type of hierarchy, but not PHP. I have fooled around with the scope resolution

[PHP] Re: General Web Development Editor/IDE

2009-05-24 Thread Al
Casey wrote: Hi list, I'm looking for a nice, user (i.e. me) friendly general-purpose IDE, where most of my work will be done in PHP. I'm considering using Dreamweaver CS4 as my IDE, where I will disable most of the WYSIWYG elements and use all of the other features that I need/want

Re: [PHP] templating engine options

2009-05-24 Thread Nathan Rixham
Stuart wrote: 2009/5/24 Nathan Rixham nrix...@gmail.com: LinuxManMikeC wrote: On Sun, May 24, 2009 at 11:09 AM, tedd tedd.sperl...@gmail.com wrote: At 12:01 AM +0100 5/24/09, Nathan Rixham wrote: LinuxManMikeC wrote: I was recently researching template engines for a small in-house project,

Re: [PHP] templating engine options

2009-05-24 Thread tedd
At 9:43 PM +0100 5/24/09, Nathan Rixham wrote: and now I'm questioning myself - not on the client scenario based decisions - but on my own personal projects and things only I work on.. why do I use a template engine? habit? some old logical decision I made based on abstraction which somehow

Re: [PHP] php dev environment

2009-05-24 Thread Eric Butera
On Sun, May 24, 2009 at 5:32 AM, Nathan Rixham nrix...@gmail.com wrote: Hi All, A recent post just reminded me of something I did a while ago that may be of use to many of you (and its sitting doing nothing), it's a kind of how to for getting a full development environment up and running

Re: [PHP] php dev environment

2009-05-24 Thread Nathan Rixham
Eric Butera wrote: On Sun, May 24, 2009 at 5:32 AM, Nathan Rixham nrix...@gmail.com wrote: Hi All, A recent post just reminded me of something I did a while ago that may be of use to many of you (and its sitting doing nothing), it's a kind of how to for getting a full development environment

Re: [PHP] templating engine options

2009-05-24 Thread Nathan Rixham
tedd wrote: At 9:43 PM +0100 5/24/09, Nathan Rixham wrote: and now I'm questioning myself - not on the client scenario based decisions - but on my own personal projects and things only I work on.. why do I use a template engine? habit? some old logical decision I made based on abstraction

Re: [PHP] templating engine options

2009-05-24 Thread tedd
At 1:54 PM -0600 5/24/09, LinuxManMikeC wrote: You're missing the point just because he threw in some old HTML styling attributes. The main issue is the overhead of added parsing layers to find where content goes in the HTML. I may be missing the point, but I know where content goes in my

[PHP] Fractions

2009-05-24 Thread Ron Piggott
Is there a way to remove the trailing '0'? Also is there a way to have the original fraction display (1/4), as well as have provision for 1/8 and 3/8 and 1/2, etc. display? Width: 2.250 x Height: 6.250 Ron

Re: [PHP] templating engine options

2009-05-24 Thread Nathan Rixham
tedd wrote: At 1:54 PM -0600 5/24/09, LinuxManMikeC wrote: You're missing the point just because he threw in some old HTML styling attributes. The main issue is the overhead of added parsing layers to find where content goes in the HTML. I may be missing the point, but I know where content

Re: [PHP] Container or Calling Class

2009-05-24 Thread Eddie Drapkin
You can call methods from a classes's parents like so class foo { protected method bar() { echo in foo!; } } class foobar extends foo { public function bar() { parent::bar(); } } $fb = new foobar(); $fb-bar(); will output in foo!; On Sun, May 24, 2009 at 3:58 PM, Nathan Rixham

Re: [PHP] Re: General Web Development Editor/IDE

2009-05-24 Thread Eddie Drapkin
I use Zend Studip (I coughed up the fee, and it's worth it) for PHP, JS, HTML and CSS THere's a WYSIWYG HTML editor built in, and that's the only drawback I hear from a lot of people about PHP IDE's. And, it's built on Eclipse, so while I work on WIndows at work, I can keep the exact same setup

Re: [PHP] Fractions

2009-05-24 Thread Mark Kelly
Hi. On Sunday 24 May 2009, Ron Piggott wrote: Is there a way to remove the trailing '0'? $width = number_format($width,2); Also is there a way to have the original fraction display (1/4), as well as have provision for 1/8 and 3/8 and 1/2, etc. display? On this one I suspect you'd have to

Re: [PHP] Container or Calling Class

2009-05-24 Thread Nathan Rixham
Eddie Drapkin wrote: You can call methods from a classes's parents like so class foo { protected method bar() { echo in foo!; } } class foobar extends foo { public function bar() { parent::bar(); } } $fb = new foobar(); $fb-bar(); will output in foo!; wrong way round.. he's asking for:

Re: [PHP] Fractions

2009-05-24 Thread Nathan Rixham
Mark Kelly wrote: Hi. On Sunday 24 May 2009, Ron Piggott wrote: Is there a way to remove the trailing '0'? $width = number_format($width,2); Also is there a way to have the original fraction display (1/4), as well as have provision for 1/8 and 3/8 and 1/2, etc. display? On this one I

[PHP] Re: Fractions

2009-05-24 Thread Ron Piggott
This is what I came up with, it may help some of you working with US measurements. $interval = array(0.125 = '1/8', 0.25 = '1/4', 0.375 = '3/8', 0.5 = '1/2', 0.625 = '5/8', 0.75 = '3/4', 0.875 = '7/8'); echo Width: . intval($product_width_inch) . .

Re: [PHP] Re: General Web Development Editor/IDE

2009-05-24 Thread Eric Butera
On Sun, May 24, 2009 at 7:47 PM, Eddie Drapkin oorza...@gmail.com wrote: I use Zend Studip (I coughed up the fee, and it's worth it) for PHP, JS, HTML and CSS  THere's a WYSIWYG HTML editor built in, and that's the only drawback I hear from a lot of people about PHP IDE's.  And, it's built on

Re: [PHP] Container or Calling Class

2009-05-24 Thread Eddie Drapkin
That's containment, not inheritence, must have misread the email. Oops :) The easiest way to do this would be something like: class contrived { private $parent; private $otherparent; public function __call($func, $params) { if(is_callable(array($this-parent, $func))

[PHP] Comparing strings (revisited)

2009-05-24 Thread Clancy
For some time I have been working on a text based database, in which each entry contains one or more lines of data, with the various fields delimited by semicolons, e.g. A;b;20GM;Restaurant;090508 n;;;Arintji;; a;Federation Square;;; p;9663 9900;;;9663 9901;;i...@arintji.com.au; All was

Re: [PHP] Comparing strings (revisited)

2009-05-24 Thread Eddie Drapkin
With the initial explode, I may be wrong but I don't think it's possible to force every entry to be string-typed. However, this little snippet could help: $foo = explode(';', $db); foreach($foo as $bar) { $bar = settype($bar, 'string); } which will set each element's type to string, but is

[PHP] Re: Comparing strings (revisited)

2009-05-24 Thread Nathan Rixham
Clancy wrote: For some time I have been working on a text based database, in which each entry contains one or more lines of data, with the various fields delimited by semicolons, e.g. A;b;20GM;Restaurant;090508 n;;;Arintji;; a;Federation Square;;; p;9663 9900;;;9663

Re: [PHP] change server time

2009-05-24 Thread Sumit Sharma
Yes, I works on windows as well well. Was looking for india time zone found it as putenv(TZ=Asia/Calcutta);. Thanks a lot, but this function does not change the server time permanently. Any Idea about any function which does so. Thanks, Sumit On Sun, May 24, 2009 at 12:33 PM, Michael

Re: [PHP] Container or Calling Class

2009-05-24 Thread Eddie Drapkin
No problem mate :) As a general rule, it seems that PHP just copied Java's OOP model - and outside of the quirks in the way it works internally - it's a pretty damn good implementation of object orientation. THe only issue I have with it is that it's not possible to lose the procedural

Re: [PHP] change server time

2009-05-24 Thread Eddie Drapkin
If you want to change the server time ocmpletely and independent of PHP, you're going to have to do it from the shell. On Sun, May 24, 2009 at 11:36 PM, Sumit Sharma sumitp...@gmail.com wrote: Yes, I works on windows as well well. Was looking for india time zone found it as

Re: [PHP] change server time

2009-05-24 Thread Sumit Sharma
That's great but how to do this? On Mon, May 25, 2009 at 9:11 AM, Eddie Drapkin oorza...@gmail.com wrote: If you want to change the server time ocmpletely and independent of PHP, you're going to have to do it from the shell. On Sun, May 24, 2009 at 11:36 PM, Sumit Sharma

Re: Re: [PHP] change server time

2009-05-24 Thread oorza2k5
In windows? I have no idea. I use linux for my server stacks. You'll have to ask Dr. Google! I'd expect it's just like with normal windows, in the date properties in the control panel. On May 24, 2009 11:44pm, Sumit Sharma sumitp...@gmail.com wrote: That's great but how to do this?

Re: Re: [PHP] change server time

2009-05-24 Thread Sumit Sharma
In my windows I have already selected the local time and its working fine for window but by default WAMP server is picking GMT time so I have to use putenv() function to change it for that page where I am using date function. It seems there is some misunderstanding between the server and OS.

Re: Re: [PHP] change server time

2009-05-24 Thread kranthi
what do you mean by ..does not change the server time permanently... as far as i can understand you want your wamp server to take the time specified by your operating sys. as a mater of fact it is doing that. but it is not taking the timezone specified by your operating system.