Re: [PHP] php dev environment

2009-05-24 Thread Lester Caine
Paul M Foster wrote: On Sun, May 24, 2009 at 10:32:23AM +0100, Nathan Rixham 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 r

Re: [PHP] php dev environment

2009-05-24 Thread Paul M Foster
On Sun, May 24, 2009 at 10:32:23AM +0100, Nathan Rixham 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 simply.

Re: [PHP] Comparing strings (revisited)

2009-05-24 Thread Paul M Foster
On Mon, May 25, 2009 at 12:46:16PM +1000, 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;Federati

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. http://us2.php.n

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. On

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 wrote: That's great but how to do this? On Mon, May 25, 2009

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 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 wrote: > >> Yes, I works on w

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 wrote: > Yes, I works on windows as well well. Was looking for india time zone found > it as putenv("TZ=Asia/Calcutta");. Thanks a

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 bootstrapp

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

[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 9901;;i...@arintji.com.a

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 hardl

[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 goin

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)) call_user_func_array(arra

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 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 > Eclipse, so wh

[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) . " " . $interval[$product_width_inch-i

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 susp

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 f

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] 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] 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 wrote:

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 go

[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 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 scr

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 whic

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 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 simp

Re: [PHP] php dev environment

2009-05-24 Thread Eric Butera
On Sun, May 24, 2009 at 5:32 AM, Nathan Rixham 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 simply. > > > Ecl

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 rul

Re: [PHP] templating engine options

2009-05-24 Thread Nathan Rixham
Stuart wrote: 2009/5/24 Nathan Rixham : LinuxManMikeC wrote: On Sun, May 24, 2009 at 11:09 AM, tedd 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

Re: [PHP] templating engine options

2009-05-24 Thread Stuart
2009/5/24 Nathan Rixham : > LinuxManMikeC wrote: >> >> On Sun, May 24, 2009 at 11:09 AM, tedd 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

Re: [PHP] fgets function for very large files

2009-05-24 Thread Lars Torben Wilson
2009/5/24 shahrzad khorrami : > :-o > I want to divide this large csv file with programming to small one! If you're on *nix: % man split Regards, Torben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] templating engine options

2009-05-24 Thread Nathan Rixham
LinuxManMikeC wrote: On Sun, May 24, 2009 at 11:09 AM, tedd 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 in my

[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 (contextu

Re: [PHP] Container or Calling Class

2009-05-24 Thread Nathan Rixham
Stuart wrote: 2009/5/24 phphelp -- kbk : 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 operator, but either that

Re: [PHP] templating engine options

2009-05-24 Thread Stuart
2009/5/23 Nathan Rixham : > 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 at least

Re: [PHP] templating engine options

2009-05-24 Thread LinuxManMikeC
On Sun, May 24, 2009 at 11:09 AM, tedd 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 in my se

Re: [PHP] Container or Calling Class

2009-05-24 Thread Stuart
2009/5/24 phphelp -- kbk : > Hey -- folks -- -- - > > I am trying to figure out one aspect of PHP's object model. > > Is it good practice to have a class be a property of another class? In other > words: > > class foo_handler { >        function add_bar() { >                include bar_class.inc; >

[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 Fran

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 re

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 3

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 bells

[PHP] Container or Calling Class

2009-05-24 Thread phphelp -- kbk
Hey -- folks -- -- - I am trying to figure out one aspect of PHP's object model. Is it good practice to have a class be a property of another class? In other words: class foo_handler { function add_bar() { include bar_class.inc; $this->bar_handler = ne

Re: [PHP] conditional classes

2009-05-24 Thread kranthi
ohh. sorry. what i intend to write is __autoload function... http://in.php.net/autoload moreover __autoload function is highly useful(especially when i hav one class per file) and i use it nearly every time i use a class. i dont think the scope of class definition 'included' within a function is

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 ba

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 only

[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: my re

Re: [PHP] fgets function for very large files

2009-05-24 Thread Nathan Rixham
shahrzad khorrami wrote: :-o I want to divide this large csv file with programming to small one! 1: http://php.net/fgetcsv 2: if( ($row % 1) == 0 ) { 3: http://php.net/fputcsv csv split in to multiple csv's of 10k rows each -- PHP General Mailing List (http://www.php.net/) To unsubscribe

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

2009-05-24 Thread Robert Cummings
On Sun, 2009-05-24 at 12:04 +0100, Ashley Sheridan wrote: > 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 interfa

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!

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
How to divide a large csv file to small ones? Thanks, Shahrzad

Re: [PHP] Re: -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

[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 http://wiki.voom.me/wiki/Eclipse-PDT2-Perfec

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

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 Lester Caine
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 (contextual

Re: [PHP] General Web Development Editor/IDE

2009-05-24 Thread kranthi
one of the most frequently asked question... assuming your platform is windows.. my recommendation is a combo of phpDesigner and CS4. phpDesigner is best IDE i hav seen till date (for PHP), but its not suited do ny CSS/HTML coding Notepad++ will be helpful to debug HTML errors(like closing tags

Re: [PHP] conditional classes

2009-05-24 Thread kranthi
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 extends PDO { }

[PHP] General Web Development Editor/IDE

2009-05-24 Thread Casey
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 (contextual syntax colorin

Re: [PHP] change server time

2009-05-24 Thread Michael A. Peters
Sumit Sharma wrote: Hi, Whenever I am using date('r') function It shows time in GMT instead of local time set on my machine. Do I need to configure the time separately. I am using WAMP server locally. Thanks, Sumit Not sure about windows - but putenv("TZ=America/Los_Angeles");