Re: [PHP] Replacing special characters with their HTML equivalents

2008-12-21 Thread Larry Garfield
so that it will understand what I'm trying to do? > > Thanks! > > James You may find this useful: http://www.garfieldtech.com/blog/unicode-8-vs-16 -- Larry Garfield la...@garfieldtech.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] MERRY XMAS

2008-12-24 Thread Larry Garfield
Happy '. $holiday->name() .', '. $subscriber->name() .'!'. PHP_EOL; } } -- Larry Garfield la...@garfieldtech.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Decorator with public methods

2008-12-26 Thread Larry Garfield
mance. #1 can largely be solved by both directly implementing F *and* implementing __call(), but we're still left with the performance problems of #2. While for some uses cases that is OK, it can add up to unpleasant microseconds lost. Can anyone suggest an alternate solution that h

Re: [PHP] Do defined variables exist at application scope, or session scope?

2008-12-26 Thread Larry Garfield
er, if someone goes to help.php then the line in index.php is never executed (why would it be, since the file was never included?), so the constant is not defined. Does that make sense? -- Larry Garfield la...@garfieldtech.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Decorator with public methods

2008-12-26 Thread Larry Garfield
at defeats the purpose of decorators if I can't come up with a new one a month from now and not have to modify any of the existing code. -- Larry Garfield la...@garfieldtech.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Decorator with public methods

2008-12-27 Thread Larry Garfield
the performance cost of __call() and the extra call stack layers that are my concern at the moment. -- Larry Garfield la...@garfieldtech.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Architecture patterns in PHP

2008-12-27 Thread Larry Garfield
ad approach to take. Find an existing system that "feels right" to you and run with that. You'll almost certainly get a better system out of it than trying to write everything yourself. (I've done that before, too, and it was generally a disaster.) [1] http://www.gar

Re: [PHP] Re: Problem with fetching values...

2008-12-29 Thread Larry Garfield
of the standard install for PHP5, and there is simply no excuse for a web host to not support it. You can try contacting them first to ask them to enable it, and if they say no, you say "go away". Really, that's simply irresponsible on their part. -- Larry Garfield la...

Re: [PHP] Thank you everyone, What a wonderful world

2009-01-03 Thread Larry Garfield
On Saturday 03 January 2009 1:17:07 pm Dotan Cohen wrote: > 2009/1/3 Behzad : > > since you have modern weapons, equipped > > with lasers! > > Did somebody say sharks with frigin' lasers? No, but we have some ill-tempered sea-bass. -- Larry Garfield la...@garfiel

Re: [PHP] old HTTP variables

2009-01-18 Thread Larry Garfield
n/ini.core.php#ini.register-long-arrays Although you should probably take the time to upgrade the app anyway, as those variables are deprecated and won't be around forever. -- Larry Garfield la...@garfieldtech.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Doc standard for methods?

2009-01-26 Thread Larry Garfield
such documentation? Is there a standard in PHPDoc that I don't know about? Any other projects doing something like that? -- Larry Garfield la...@garfieldtech.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP Content Management

2009-01-29 Thread Larry Garfield
ercial development and support as well if you are so inclined. For e-commerce, check out the "Ubercart" suite of modules: http://drupal.org/project/ubercart Disclaimer: I am a Drupal core developer and build sites with it professionally, so I am hardly an unbiased source. :-) -- La

Re: [PHP] PHP Enclosing Tags? Do You Close Your PHP Declarations?

2009-02-02 Thread Larry Garfield
for the same reason: It avoids a host of problems with whitespace handling and is just one less thing to have to deal with. http://drupal.org/coding-standards --Larry Garfield -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] DB Comparisons

2009-02-05 Thread Larry Garfield
ll-tuned MySQL database will blow the crap out of a default config PostgreSQL server, but a well-tuned PostgreSQL server will wipe the floor with a badly configured mySQL database. Your knowledge of the underlying tool and how to get the most out of it will matter more than which vendor you go

Re: [PHP] PHP OOP

2009-02-09 Thread Larry Garfield
irst in C++. Force them to do the hard stuff so they appreciate what the runtime is doing for them in higher level languages. It also means you can teach procedural and OOP in the same syntax. Then once they've gotten a few bruises in C++, expose them to Java, Javascript, PHP, etc. to l

Re: [PHP] Re: PHP includes

2009-03-09 Thread Larry Garfield
ad software. Your config file with passwords and such, sure, keep that locked down tight. But don't rely on security through obscurity. -- Larry Garfield la...@garfieldtech.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Too many open files

2009-04-05 Thread Larry Garfield
how to respond? Cheers. -- Larry Garfield la...@garfieldtech.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: PHP6 return by reference deprecation

2009-05-02 Thread Larry Garfield
t, as that would be incredibly short sighted and stupid. There are plenty of use cases for returning by reference besides making PHP 4 objects behave correctly. -- Larry Garfield la...@garfieldtech.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: PHP6 return by reference deprecation

2009-05-02 Thread Larry Garfield
On Saturday 02 May 2009 3:20:24 pm Colin Guthrie wrote: > 'Twas brillig, and Larry Garfield at 02/05/09 20:00 did gyre and gimble: > > On Saturday 02 May 2009 9:30:09 am Colin Guthrie wrote: > >> 'Twas brillig, and Paul M Foster at 02/05/09 06:07 did gyre and gimble:

Re: [PHP] Web application design considerations - a good reference ?

2009-06-01 Thread Larry Garfield
..it's the flow and organization of the > code. > > Can anybody point me to a good book or tutorial that lays down the > principles and gives some suggestions for integrating the many subroutines > of a large application? I want to make the code readable and logical

Re: [PHP] php applications

2009-06-08 Thread Larry Garfield
; Cheers, > Rob. Mind if I use that quote elsewhere (credited if you prefer)? -- Larry Garfield la...@garfieldtech.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP programming strategy

2009-08-01 Thread Larry Garfield
a noticeable performance difference. It was only barely noticeable, but it just barely registered as more than random sampling jitter. I actually concluded that if cutting the file *in half* was only just barely noticeable, then it really wasn't worth the effort. Just install an opcode c

Re: [PHP] PHP programming strategy

2009-08-02 Thread Larry Garfield
pressors like that are commonplace because you have to transfer the entire file over the network repeatedly, which is a few orders of magnitude slower than system memory. Compressors and aggregators there make sense. PHP code never leaves the server, so those benefits don't exist.

[PHP] ODBC and long text fields

2007-01-07 Thread Larry Garfield
eld rather than a varchar or int? I am confused, and would appreciate assistance in becoming less confused. :-) Thanks. -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 "If nature has made any one thing less susceptible than all others of excl

Re: [PHP] ODBC and long text fields

2007-01-07 Thread Larry Garfield
on to the MSSQL server as well as making the issue go > away. I don't believe the client allows direct MSSQL connections. Besides, the MSSQL functions still require an ODBC driver underneath, so if the problem is with the ODBC driver then that won't change anything. -- Larry

Re: [PHP] multidimensional array problems

2007-01-13 Thread Larry Garfield
gt; (`user_id`, `user_level`, `list_order`, `user_name`, `password`, `email`, > `country`, `game`, `rank`, `qoute`, `config`, `map`, `gun`, `brand`, `cpu`, > `ram`, `video`, `sound`, `monitor`, `mouse`) VALUES (2, 1, 1, 'raze', > 'itsme', '[EMAIL PROTECTED]', &#x

Re: [PHP] multidimensional array problems

2007-01-13 Thread Larry Garfield
kup table and member table. Do > you think it would be better possably to do seperate querys and then match > them in php? would that be possable the given the setup i have? > > >From: Larry Garfield <[EMAIL PROTECTED]> > >To: php-general@lists.php.net > >Subject:

Re: [PHP] Stripslashes

2007-01-13 Thread Larry Garfield
g a web host that doesn't let you do so, get a real web host. -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 "If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking

Re: [PHP] Stripslashes

2007-01-14 Thread Larry Garfield
> > > > > > if(!empty($_POST)){ > > > > foreach($_POST as $x => $y){ > > > > $_POST[$x] = stripslashes($y); > > > > } > > > > } > > > > > > > > This came about after someone tried to enter O'Toole in a >

Re: [PHP] Stripslashes

2007-01-14 Thread Larry Garfield
re a special way this needs > to be done? > > Thanks > > > Thanks > > > > > -Original Message- > > > From: Larry Garfield [mailto:[EMAIL PROTECTED] > > > Sent: January 14, 2007 4:39 PM > > > To: php-general@lists.php.net > > >

Re: [PHP] Mailing list combined with PHP based forum

2007-01-15 Thread Larry Garfield
e off with some tips as to how, and if, this might be > possible? > > Thanks for any advice or informaiton. > > -- > Dave M G > Ubuntu 6.06 LTS > Kernel 2.6.17.7 > Pentium D Dual Core Processor > PHP 5, MySQL 5, Apache 2 -- Larry Garfield AIM: LOLG4

Re: [PHP] What makes a PHP expert

2007-01-19 Thread Larry Garfield
nization, documentation, and > consistency. Is the programmer published (articles, books, etc) which > may not count against expertise? > > An expert encompasses so much more than skills. For instance, I could be > an expert on football because I understand history of the

Re: [PHP] What makes a PHP expert

2007-01-19 Thread Larry Garfield
, is > the 'PHP way' > > unless there are seriously obvious flaws with an approach, you can often > have different approaches of solving a problem that pretty much lead to the > same result.. > > peace... > > > > -Original Message- > From: Larry Garf

Re: [PHP] multidimensional array problems

2007-01-19 Thread Larry Garfield
l_fetch_object($memrosterresults)) { > $roster[$record->game][] = $record; > } > ksort($roster); > foreach ($roster as $game => $records) { >print "\n"; >print "{$game}\n"; >print "Name Rank Country Email\n"; >fo

Re: [PHP] most powerful php editor

2007-01-21 Thread Larry Garfield
C Silva [mailto:[EMAIL PROTECTED] > Sent: Sunday, January 21, 2007 2:54 AM > To: php-general@lists.php.net > Subject: [PHP] most powerful php editor > > hi everyone! > > i'd like to ask something maybe commonly asked here. what is the most > powerful php editor? -- Larry G

Re: [PHP] most powerful php editor

2007-01-21 Thread Larry Garfield
other PHP plugin for Eclipse, and that one behavied like you > describe, therefore my change to SourceForge PHP Eclipse Plugin. > > Best regards, > Peter Lauri > > www.dwsasia.com - company web site > www.lauri.se - personal web site > www.carbonfree.org.uk - become Carbon

Re: [PHP] Encoding issue with £

2007-01-23 Thread Larry Garfield
ds I am getting, > for example, £7 rather than £. Is this an encoding issue? > > Many thanks in advance... Yep, sounds like encoding to me. This article talks more about smart quotes than the £ sign, but the recommendation applies for that as well. http://www.garfieldtech.com/blog/stupid-qu

Re: [PHP] most powerful php editor

2007-01-24 Thread Larry Garfield
So, optimize your style for readability. Readability is, of course, partially subjective so your style will differ from my style, but the key point is still to optimize the code for when you come back in 3-6 months to add a feature or find an obscure bug and don't remember what the frel yo

Re: [PHP] most powerful php editor

2007-01-24 Thread Larry Garfield
r. - Real-time debugger. The only one I've found that works for me so far is Zend's. I cannot overstate how useful a real-time debugger is for tracking down bugs in complex applications. -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012

Re: [PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-26 Thread Larry Garfield
en in the wild. Not only is it easier to read, but the task of > > adding > > or removing selected fields is trivial. > > I meant ONLY the SELECT part on a single line. > > Only a moron would cram the FROM and all that into the same line. > > :-) > > $query = "SELECT

Re: [PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-27 Thread Larry Garfield
On Saturday 27 January 2007 7:43 am, Jochem Maas wrote: > Larry Garfield wrote: > > I have long since given up on raw insert/update/delete statements as the > > syntax is all kinds nasty. These days I just do this, which is even > > easier and more powerful: > > >

Re: [PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-27 Thread Larry Garfield
which technically gives you values 0-9. And yes, I agree that MySQL has fairly decent date manipulation routines. But at work we do try for database independence when possible, so except on specific projects we try to avoid it. -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED]

Re: [PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-28 Thread Larry Garfield
ey are intrinsically atomic (in the sense > that database transaction 'should' be). > > rgds :-) Well, business reasons dictate that we keep our code portable when possible at work. I'm not the business person. I just write the code. :-) -- Larry Garfield

Re: [PHP] Select record by ID

2007-01-28 Thread Larry Garfield
;t wrong > neither, simply optional. Actually, I believe they are wrong in some database engines but not others. MySQL doesn't care. Some others do. Yes, it sucks. :-( -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 "If nature has made

Re: [PHP] Select record by ID

2007-01-29 Thread Larry Garfield
#x27;s some reason for it deep in the bowels of SQL engines as they existed in the early '80s, but for anyone trying to not hand-write every frickin' SQL query and automate common tasks it makes life considerably more annoying. -- Larry Garfield AIM: LOLG42 [EMAIL PROT

Re: [PHP] Suggestions of GPL plugin-system?

2007-01-29 Thread Larry Garfield
there is some good GPL modular > software around (such as Joomla, PHP-Nuke, PHPbb, etc, etc.) that you have > been working with as a coder. Could any of you suggest a certain GPL > application that has a great module setup that I could take a look at? > > Thanks a lot for your time!

Re: [PHP] Suggestions of GPL plugin-system?

2007-01-29 Thread Larry Garfield
On Monday 29 January 2007 8:37 pm, Robert Cummings wrote: > On Mon, 2007-01-29 at 20:02 -0600, Larry Garfield wrote: > > I was looking for a similar good-example about 2 years ago. What I found > > was Drupal (http://drupal.org/), and it's hook system. I have since > >

Re: [PHP] include file identifier

2007-02-03 Thread Larry Garfield
hat is not dependent on other variables. realpath(__FILE__) will give you the absolute path on the server of the current file, which is unique. Why you want that for what you're doing I have no idea, but it's the only unique identifier I can think of that isn't a variable or constan

Re: [PHP] un include?

2007-02-10 Thread Larry Garfield
($fileToInclude, 'r'); > $str = fread($fr, filesize($fileToInclude)) > fclose($fr); > // make alterations to $str > // reopen file and write the changes > // done but in test function I have written changes have not been made > } > looked through the O'Reilly book Progr

Re: [PHP] un include?

2007-02-11 Thread Larry Garfield
Copying back to the list where it belongs... On Sunday 11 February 2007 11:01 am, jekillen wrote: > On Feb 10, 2007, at 8:58 PM, Larry Garfield wrote: > > You need to rearchitect your system. > > > > When you include a file, its code executes. Once it has been > > ex

Re: [PHP] GET doesn't work as POST

2007-02-24 Thread Larry Garfield
t works fine this way, as soon as I change the form to > method="get" it looses the parameter "kind" when I change e.g. the > second parameter from "-Alle-" to "Gültig". Has anybody an idea why it > works with POST but not with GET? > > > ...

Re: [PHP] best framework (pear vs zend framework)

2007-03-01 Thread Larry Garfield
ough with the one-form-per-page limitation. That is my opinion from not actually building anything with it yet, at least. :-) -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 "If nature has made any one thing less susceptible than all others of exclu

Re: [PHP] Holes in mysql primary key and other db issues...

2007-03-04 Thread Larry Garfield
)) { $records[] = $record; } array_shuffle($records); for ($i=0; $i < 3; ++$i) { $use[] = $records[$i]; } Now you have an array, $use, that is 3 random entries from the last 10, ordered by a time field. The unique ID is irrelevant to that, as it should be. -- Larry Garfield

Re: [PHP] Re: [PHP-DB] array field type

2007-03-04 Thread Larry Garfield
ot SO BIG > deal (for now of course). > > My db expertise covers a bit mysql and mysql does not have any array type > field (enum just so simple). > > I just want to know is there any way to keep array data type natively in a > sql field. > > Regards. > > Sancar -- L

Re: [PHP] Is there a way to un include a file

2007-03-07 Thread Larry Garfield
be doing some experimentation. > Thanks in advance; > Jeff K -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 "If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called

Re: [PHP] Array mysteries

2007-03-11 Thread Larry Garfield
ay each > time, as compared to a switch statement? Just another thought... > > Ed That's why you can just declare it static: function convert_from_weekday ($weekday) { static $wdays = array( 0 => "Sonntag", 1 => "Montag&

Re: [PHP] php 4 and 5

2007-03-11 Thread Larry Garfield
ation isn't already presented to you on a silver platter. -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 "If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called

Re: [PHP] different and logic between PHP4 and PHP5

2007-03-13 Thread Larry Garfield
start with. :-) Find whoever you inherited the code from and shoot him. (Really, I know how badly inherited code can suck.) -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 "If nature has made any one thing less susceptible than all others of

Re: [PHP] register_globals and passing variables

2007-03-14 Thread Larry Garfield
t they use suPHP to parse php > files and I have the option of using custom php.ini files. That I could > create a .htaccess file or put individual php.ini files in the folder that > contains the files im running. In other words do it myself. > > > So I created this file: &

Re: [PHP] Preventing unwanted chars from outputting

2007-03-18 Thread Larry Garfield
tech.com/blog/unicode-8-vs-16 -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 "If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may

Re: [PHP] Preventing unwanted chars from outputting

2007-03-18 Thread Larry Garfield
On Sunday 18 March 2007 2:17 pm, Robert Cummings wrote: > On Sun, 2007-03-18 at 13:58 -0500, Larry Garfield wrote: > > On Sunday 18 March 2007 5:57 am, Don Don wrote: > > > Hi all, > > > my program outputs some characters along with text from the database, > > &

[PHP] PDO and buffered queries

2007-03-28 Thread Larry Garfield
roughly confused at this point, and the manual is quite unclear on all of the important details I care about. :-) -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 "If nature has made any one thing less susceptible than all others of exclusiv

Re: [PHP] PDO and buffered queries

2007-03-31 Thread Larry Garfield
So there's no PDO experts out there, eh? :-( On Wednesday 28 March 2007 11:14 pm, Larry Garfield wrote: > HI all. The PHP.net manual is somewhat unclear on this point, so I thought > I'd ask here. Does PDO automatically buffer queries the way that the > mysql_* extension does

Re: [PHP] PDO and buffered queries

2007-04-01 Thread Larry Garfield
On Sunday 01 April 2007 3:42 am, Tijnema ! wrote: > > On Wednesday 28 March 2007 11:14 pm, Larry Garfield wrote: > > > HI all. The PHP.net manual is somewhat unclear on this point, so I > > > thought I'd ask here. Does PDO automatically buffer queries the way >

Re: [PHP] PDO and buffered queries

2007-04-01 Thread Larry Garfield
On Sunday 01 April 2007 3:09 pm, Jürgen Wind wrote: > Larry Garfield wrote: > > ...segfaults under PHP 5.1.6 ... > > php 5.1.5/6 was the source for many segfaults (f.e. using phpmyadmin) > better don't use it any more. See also: > http://bugs.php.net/bug.php?id=39

Re: [PHP] Question on Portfoilo's

2007-04-09 Thread Larry Garfield
s that > your provide to a potential employer? What things do you feel I should > avoid when putting this kinda of thing together? -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 "If nature has made any one thing less susceptible than all oth

Re: [PHP] php5 oop question

2007-04-12 Thread Larry Garfield
, they can make PHP code more intuitive > for people who weren't the ones who created it. I don't think they > make code execution any faster (or slower, for that matter). It's > worth knowing about them, but they probably shouldn't change your day > to day practices. As wit

Re: [PHP] isset

2007-04-15 Thread Larry Garfield
t, regardless of the language. If you want your syntax to be a bit simpler, I frequently use helper functions along these lines: function http_get_int($var, $default=0) { return isset($_GET[$var]) ? (int) $_GET[$var] : $default; } if (http_get_int('var') ==5) { // Do stuff } Clean to read,

Re: [PHP] CSS vs. Tables OT

2007-04-17 Thread Larry Garfield
rden.com/ > > Only with hacks. Using tables for layout *is* a hack. A common one, but still a hack. -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 "If nature has made any one thing less susceptible than all others of exclusive property, it

Re: [PHP] CSS vs. Tables OT

2007-04-17 Thread Larry Garfield
On Tuesday 17 April 2007 8:14 pm, Robert Cummings wrote: > On Tue, 2007-04-17 at 18:53 -0500, Larry Garfield wrote: > > On Tuesday 17 April 2007 3:40 pm, Robert Cummings wrote: > > > > BTW, any web developer worth his or her salt with a reasonable amount > > > >

Re: [PHP] CSS vs. Tables OT

2007-04-17 Thread Larry Garfield
On Tuesday 17 April 2007 9:54 pm, Robert Cummings wrote: > On Tue, 2007-04-17 at 21:21 -0500, Larry Garfield wrote: > > On Tuesday 17 April 2007 8:14 pm, Robert Cummings wrote: > > > On Tue, 2007-04-17 at 18:53 -0500, Larry Garfield wrote: > > > > On Tuesday 17 April

Re: [PHP] php exception handling

2009-10-11 Thread Larry Garfield
Print user friendly message. // Log detailed information or whatever you're going to do. } -- Larry Garfield la...@garfieldtech.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Classes and Functions

2009-11-01 Thread Larry Garfield
nstants http://www.php.net/get_declared_classes http://www.php.net/get_declared_interfaces http://www.php.net/get_included_files -- Larry Garfield la...@garfieldtech.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Good SQL builder class

2009-12-05 Thread Larry Garfield
ay like : > > $home["street"] = test2; > $home["housenr"] = 2; > > > but the idea stays the same = the index is the name of the DB fields > and the assigned value the element > > > > I have looked on hotscripts and phpclasses but I have no idea how

Re: [PHP] OOP Design Question

2009-12-20 Thread Larry Garfield
g all 60 classes even when you're only going to use 2; you're still loading up roughly the same amount of code. Parsing it as one mega class or one big parent with a few small child classes is about a break-even as far as performance goes, but the mega class is much poorer architecture. -- Larry Garfield la...@garfieldtech.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] efficiency of include()

2009-12-20 Thread Larry Garfield
#x27;m pretty sure that PHP will recognize that it's already parsed that file and keep the opcode caches in memory, so it needn't hit disk again. I've not checked into that part of the engine, though, so I may be wrong there. -- Larry Garfield la...@garfieldtech.com -- PHP Gen

Re: [PHP] OOP Design Question

2009-12-20 Thread Larry Garfield
art on your specific use case. The most important aspect of a good autoload mechanism, though, is that it's fast and extensible. Use spl_autoload_register() instead of __autoload(), and make sure that you keep the runtime of your autoload callbacks to an absolute minimum. (A DB hit

Re: [PHP] Multiple Inheritance Concern

2009-12-25 Thread Larry Garfield
g checks against the interfaces rather than the classes themselves. If they don't, you should file a bug against that base library as They're Doing It Wrong(tm). -- Larry Garfield la...@garfieldtech.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Accessing Objects - Object to Object Communication

2009-12-26 Thread Larry Garfield
ction or factory object: function create_page($root) { $db = create_your_db(); $notifier = create_your_notifier(); return new Page($db, $notifier, $root); } $new_page = create_page($my_root); And the db and notifier routines can be as simple or complex as needed for your use case. The

Re: [PHP] Multiple Inheritance Needed in OOP?

2009-12-28 Thread Larry Garfield
around, and wrap the compiler's head around. What you're looking for is composition, which can do pretty much what you're looking for. See my last reply to you on this list from Christmas day. There's been some discussion of implementing "traits" in later versions of

Re: [PHP] If design patterns are not supposed to produce reusable code then why use them?

2009-12-31 Thread Larry Garfield
Meant to send this to the list, sorry. -- Forwarded Message -- Subject: Re: [PHP] If design patterns are not supposed to produce reusable code then why use them? Date: Thursday 31 December 2009 From: Larry Garfield To: "Tony Marston" On Wednesday 30 December 200

Re: [PHP] If design patterns are not supposed to produce reusable code then why use them?

2010-01-01 Thread Larry Garfield
stupid. Blindly ignoring established "solved problems" just for the sake of avoiding those pointless design patterns is just as stupid. Remember, code is irrelevant. You don't sell code. You sell ideas and concepts, implemented in code. By not having to re-invent th

Re: [PHP] Open Source CMS

2010-01-21 Thread Larry Garfield
tp://www.packtpub.com/drupal-6-module-development/book Disclaimer: The author used to work with me, and I'm a Drupal core developer so I am admittedly biased. :-) --Larry Garfield -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] SQL insert () values (),(),(); how to get auto_increments properly?

2010-02-14 Thread Larry Garfield
and every insert as they only need to be rebuilt once. 3) If you're on InnoDB, using transactions can sometimes give you a performance boost because the writes hit disk all at once when you commit. There may be other side effects and trade offs here, though, so take with a grain of salt. --Larry Garfield -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] array conversion

2010-02-18 Thread Larry Garfield
aved_key = $a[$i]; > } > elseif ($i % 2 == 1) { > $b[$saved_key] = $a[$i]; > } > } > > Code is crude and untested, but you get the idea. > > Paul This would be even shorter, I think: foreach ($items as $i => $value) { $temp[$i % 2][] = $value; } $done = array_combine($temp[0], $temp[1]); (Also untested, just off the cuff...) --Larry Garfield -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Memory investigation

2010-03-02 Thread Larry Garfield
ts memory usage be? I just have no idea how to do that. Anyone have a suggestion for how to accomplish that? --Larry Garfield -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Code samples in OOo Presenter

2010-03-21 Thread Larry Garfield
to have a custom text region or format or something that is "take this and highlight it properly", but I don't know if such a plugin exists. I could be talked into using KPresenter / KOffice instead if that would be easier, but as I am on Linux I have no access to KeyNote or PowerPoi

Re: [PHP] Code samples in OOo Presenter

2010-03-21 Thread Larry Garfield
it properly", but I don't know > > if such a plugin exists. > > > > I could be talked into using KPresenter / KOffice instead if that would > > be easier, but as I am on Linux I have no access to KeyNote or > > PowerPoint. > > > > Any suggestion

Re: [PHP] Will PHP ever "grow up" and have threading?

2010-03-22 Thread Larry Garfield
Perhaps if you asked a question you'd get an answer rather than coming off as an angry immature crybaby in your last paragraph... No, I'm not going to dignify your post with a real answer. Come back when you can ask a real question and maybe you'll get a real answer. --Lar

Re: [PHP] Will PHP ever "grow up" and have threading?

2010-03-22 Thread Larry Garfield
ng" design is very deliberate. It has design trade-offs like anything else. PHP is a web-centric language. It's not really intended for building tier-1 daemon processes, just like you'd be an idiot to try and code your entire web app in C from the start. --Larry Garfield -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Will PHP ever "grow up" and have threading?

2010-03-23 Thread Larry Garfield
uld be useful is for lots of very small writes on rapidly changing data. I would never want to write, say, the World of Warcraft servers without threading and a persistent runtime, but then I wouldn't want to write them in PHP to begin with. Insert that old saying about hammers and nails here. --Larry Garfield -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Constructor usage

2010-04-04 Thread Larry Garfield
tered, and was it worth it? --Larry Garfield -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Constructor usage

2010-04-04 Thread Larry Garfield
Sounds overly complicated, but whatever works. :-) In my experience so far I find that a well-designed factory is sufficient, but it may not be in larger or more involved OO frameworks than I've used to date. --Larry Garfield -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] class attributes and __construct

2010-04-15 Thread Larry Garfield
tting to anything. OK, I'm a little OCD, but it works. :-) --Larry Garfield -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] iCal parsing and processing

2010-05-25 Thread Larry Garfield
Hm. Thanks, but it looks like that's all in Python. I'm not a parcel tongue so that wouldn't be much use to me in a PHP app. :-) Thanks though. --Larry Garfield On Tuesday 25 May 2010 06:43:30 pm Jason Pruim wrote: > Hi Larry, > > Take a look at: http://trac.calen

Re: [PHP] CakePHP, alternatives?

2010-06-05 Thread Larry Garfield
s already very solid in PHP at the time, but it made me even better.) --Larry Garfield On Saturday 05 June 2010 12:51:47 am Shreyas wrote: > @ All - Points duly noted. Thanks for all the mighty advice. > > As the owner of the thread, I consider the thread closed for now unless

Re: [PHP] the state of the PHP community

2010-07-28 Thread Larry Garfield
that group has pretty well died. > Are there any efforts, projects or initiatives which are floating your > boat right now and that your watching eagerly (or getting involved with)? Just lots of stuff within the Drupal world, which is large enough to keep me busy. I won't bore you with details. Come to DrupalCon Copenhagen next month if you want such details. :-) --Larry Garfield -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] the state of the PHP community

2010-07-29 Thread Larry Garfield
ar with Scor. I've talked with him before about a project I'm working on that is using the amorphous, ill-defined beast known as RDF. :-) --Larry Garfield -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] CMS plugin support

2010-10-22 Thread Larry Garfield
arge community of people who can support me in writing more is one of the key reasons that virtually all of my web work these days uses Drupal. AFAIK there is no cross-CMS plugin system in PHP, and given how architecturally different various systems are I don't know that one would

[PHP] Disk IO performance

2010-11-28 Thread Larry Garfield
or hard benchmarks, profiling, or writeups of how OS (Linux specifically if it matters) file caching works in 2010, not in 1998. Modernizing what "everyone knows" is important for the general community, and the quality of our code. --Larry Garfield -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

  1   2   3   4   5   >