Re: [PHP] Class Auto-Assigning to Variable

2013-08-07 Thread Ashley Sheridan
On Wed, 2013-08-07 at 19:02 -0600, Brian Smither wrote: > >Your example does _not_ show this, it works > >as expected and throws a notice, from which can be inferred there is other > >code doing this > > Or relevant code having a side-effect not currently realized. No, you just didn't post rele

Re: [PHP] Class Auto-Assigning to Variable

2013-08-07 Thread Brian Smither
>Your example does _not_ show this, it works >as expected and throws a notice, from which can be inferred there is other >code doing this Or relevant code having a side-effect not currently realized. >Is your class maybe inheriting from another one and that contains the code >causing this issue?

Re: [PHP] Class Auto-Assigning to Variable

2013-08-07 Thread Ashley Sheridan
>I have two dozen classes in this application. In every case, there will >be a variable, the name of which is a lowercase variant of the class >name, to which is assigned an instance of the class, when the class's >construct() function completes. The example informs you of this. > Actually, as

Re: [PHP] Class Auto-Assigning to Variable

2013-08-07 Thread Brian Smither
> $hello = $clsHello; If that conceptual statement (or any occurance of the conceptual $hello) were in the code, then my (really good) Find feature of my code editor would have found it. > There are only a few variables that get assigned as side effects of > functions, but they have very spe

Re: [PHP] Class Auto-Assigning to Variable

2013-08-07 Thread Ashley Sheridan
On Wed, 2013-08-07 at 21:02 +0100, Stuart Dallas wrote: > On 7 Aug 2013, at 20:45, "Brian Smither" wrote: > > >> I cannot replicate this. > > > > I don't expect anyone to be able to replicate this behavior. The example > > shows an extraordinarily stripped-down sequence of statements that info

Re: [PHP] Class Auto-Assigning to Variable

2013-08-07 Thread Stuart Dallas
On 7 Aug 2013, at 20:45, "Brian Smither" wrote: >> I cannot replicate this. > > I don't expect anyone to be able to replicate this behavior. The example > shows an extraordinarily stripped-down sequence of statements that informs > what should work, but do to some unknown agent, which, therefo

Re: [PHP] Class Auto-Assigning to Variable

2013-08-07 Thread Brian Smither
>I cannot replicate this. I don't expect anyone to be able to replicate this behavior. The example shows an extraordinarily stripped-down sequence of statements that informs what should work, but do to some unknown agent, which, therefore, cannot be included in the example, produces unexpected

Re: [PHP] Class Auto-Assigning to Variable

2013-08-07 Thread Ashley Sheridan
On Wed, 2013-08-07 at 13:11 -0600, Brian Smither wrote: > Second go around: > > I have a situation where, for some unknown reason, where each class that > finishes its __contruct{} function, that class gets automatically assigned to > a variable - other than the variable I specify. > > Concept

Re: [PHP] Class Auto-Assigning to Variable

2013-08-07 Thread Brian Smither
Second go around: I have a situation where, for some unknown reason, where each class that finishes its __contruct{} function, that class gets automatically assigned to a variable - other than the variable I specify. Conceptually (a little bit better on the conceptualizing): class Hello { priv

Re: [PHP] Class Auto-Assigning to Variable

2013-08-07 Thread Sebastian Krebs
vate $_world = 'World'; __construct(){} } > This isn't even valid PHP $ php -a Interactive shell php > class Hello { private $_world = 'World'; __construct(){} } PHP Parse error: syntax error, unexpected '__construct' (T_STRING), expecting function (T_FUNCTION

[PHP] Class Auto-Assigning to Variable

2013-08-07 Thread Brian Smither
I have a situation where, for some unknown reason, where each class that finishes its __contruct{} function, that class gets automatically assigned to a variable - other than the variable I specify. Conceptually: class Hello { private $_world = 'World'; __construct(){} } $clsHello = new Hello(

Re: [PHP] class method visibility

2012-03-15 Thread Matijn Woudt
2012/3/15 Jeremy Wei : > I read the manual about  method visibility, but i can't understand the > code below: > class Bar > { >    public function test() { >        $this->testPrivate(); >        $this->testPublic(); >    } > >    public function testPublic() { >        echo "Bar::testPublic\n"; >

Re: Re: [PHP] Class instance pointers

2011-11-29 Thread Tim Streater
On 29 Nov 2011 at 17:01, cimodev wrote: > Am 29.11.2011 16:56, schrieb Tim Streater: >> Is there any benefit to setting a pointer to a class instance to null before >> returning from a function? As in: >> >> function myfunc () >> { >> $p = new myclass (); >> // do stuff >> $p

Re: [PHP] Class instance pointers

2011-11-29 Thread Jim Lucas
On 11/29/2011 7:56 AM, Tim Streater wrote: > Is there any benefit to setting a pointer to a class instance to null before > returning from a function? As in: > > function myfunc () > { > $p = new myclass (); > // do stuff > $p = null; > } > > Thanks. > > -- > Cheers --

Re: [PHP] Class instance pointers

2011-11-29 Thread cimodev
Am 29.11.2011 16:56, schrieb Tim Streater: > Is there any benefit to setting a pointer to a class instance to null before > returning from a function? As in: > > function myfunc () > { > $p = new myclass (); > // do stuff > $p = null; > } > > Thanks. > > No! In this case

[PHP] Class instance pointers

2011-11-29 Thread Tim Streater
Is there any benefit to setting a pointer to a class instance to null before returning from a function? As in: function myfunc () { $p = new myclass (); // do stuff $p = null; } Thanks. -- Cheers -- Tim -- PHP General Mailing List (http://www.php.net/) To unsubscrib

Re: [PHP] Class not used as an object (Scope Resolution Operator)

2011-06-13 Thread George Langley
Thanks all. Assuming is best then to add the static in this case. But it isn't required if I birthed an object first and referenced the object, correct? Am wanting to add some variables to the class so not calling the same query so many times... Thanks again. George On 2011-06-

Re: [PHP] Class not used as an object (Scope Resolution Operator)

2011-06-09 Thread David Harkness
All of the above with a clarification: they are instance methods which you are calling statically. The object is not instantiated in this case. PHP allows this but will issue an E_STRICT warning. To remove the warning just add "static" before each of them, assuming they are only ever called statica

Re: [PHP] Class not used as an object (Scope Resolution Operator)

2011-06-09 Thread Paul M Foster
On Thu, Jun 09, 2011 at 03:42:49PM -0600, George Langley wrote: > Hi all. Am fixing some inherited code, and the previous coder created a > class, ie: > > class myClass { > function &doThis($passedVar) { > doSomething; > } > > function &doThat($anotherVar)

Re: [PHP] Class not used as an object (Scope Resolution Operator)

2011-06-09 Thread Richard Quadling
On 9 June 2011 22:42, George Langley wrote: >        Hi all. Am fixing some inherited code, and the previous coder created > a class, ie: > > class myClass { >        function &doThis($passedVar) { >                doSomething; >        } > >        function &doThat($anotherVar) { >              

[PHP] Class not used as an object (Scope Resolution Operator)

2011-06-09 Thread George Langley
Hi all. Am fixing some inherited code, and the previous coder created a class, ie: class myClass { function &doThis($passedVar) { doSomething; } function &doThat($anotherVar) { doSomethingElse; } } BUT, I don't see anywhere

Re: [PHP] Class Constants

2011-04-13 Thread Richard Quadling
On 13 April 2011 19:04, Floyd Resler wrote: > That didn't quite work.  Here's what I did: > $const=$argv[1]; > $value=email::$const; > > When I run it I get an "Access to undeclared static property" error. > > Thanks! > Floyd > > On Apr 13, 2011, at 1:16 PM, Richard Quadling wrote: > >> On 13 Apri

Re: [PHP] Class Constants

2011-04-13 Thread Floyd Resler
David, That worked great! Thanks! Floyd On Apr 13, 2011, at 2:25 PM, David Harkness wrote: > On Wed, Apr 13, 2011 at 11:04 AM, Floyd Resler wrote: > >> That didn't quite work. Here's what I did: >> $const=$argv[1]; >> $value=email::$const; >> > > Instead try this: > > $const = $argv

Re: [PHP] Class Constants

2011-04-13 Thread David Harkness
On Wed, Apr 13, 2011 at 11:04 AM, Floyd Resler wrote: > That didn't quite work. Here's what I did: > $const=$argv[1]; > $value=email::$const; > Instead try this: $const = $argv[1]; $reflector = new ReflectionClass('email'); $value = $reflector->getConstant($const); David

Re: [PHP] Class Constants

2011-04-13 Thread Floyd Resler
That didn't quite work. Here's what I did: $const=$argv[1]; $value=email::$const; When I run it I get an "Access to undeclared static property" error. Thanks! Floyd On Apr 13, 2011, at 1:16 PM, Richard Quadling wrote: > On 13 April 2011 17:45, Floyd Resler wrote: >> I'm doing some testing fro

Re: [PHP] Class Constants

2011-04-13 Thread Richard Quadling
On 13 April 2011 17:45, Floyd Resler wrote: > I'm doing some testing from the command line and would like to be able = > to pass along a constant from a class.  For example: > php emailTest.,php OrderConfirmation > > OrderConfirmation is a constant in a class.  Is there any way I can take = > the

[PHP] Class Constants

2011-04-13 Thread Floyd Resler
I'm doing some testing from the command line and would like to be able = to pass along a constant from a class. For example: php emailTest.,php OrderConfirmation OrderConfirmation is a constant in a class. Is there any way I can take = the value passed on the command line and have PHP figure out

Re: [PHP] Class and interface location

2011-01-20 Thread David Harkness
Larry, I suggested the docblock tag because it seemed you didn't want to mandate that plugins that extend other plugins be forced to include the interface in an actual PHP implements clause. Duplicating the implements clause doesn't cause any problems for PHP as you said, so that's one route. Adv

RE: [PHP] Class and interface location

2011-01-20 Thread Tommy Pham
> -Original Message- > From: Steve Staples [mailto:sstap...@mnsi.net] > Sent: Thursday, January 20, 2011 5:16 AM > To: Larry Garfield > Cc: php-general@lists.php.net > Subject: Re: [PHP] Class and interface location > > On Wed, 2011-01-19 at 21:46 -0600, Larr

Re: [PHP] Class and interface location

2011-01-20 Thread Steve Staples
On Wed, 2011-01-19 at 21:46 -0600, Larry Garfield wrote: > On Wednesday, January 19, 2011 8:56:50 pm Tommy Pham wrote: > > > > And actually, thinking about it, I wonder if requiring the explicit > > declaration > > > is a good thing anyway because then it's immediately obvious and > > > greppable

Re: [PHP] Class and interface location

2011-01-20 Thread Richard Quadling
On 20 January 2011 03:46, Larry Garfield wrote: > Does that make it clearer what I'm trying to do? Some ideas. I've no idea if any of them are any good. 1 - All plugins implement a self-registration mechanism. A analogy to this in the Windows world would be an ActiveX component. All ActiveX com

RE: [PHP] Class and interface location

2011-01-19 Thread Tommy Pham
> -Original Message- > From: Larry Garfield [mailto:la...@garfieldtech.com] > Sent: Wednesday, January 19, 2011 7:47 PM > To: php-general@lists.php.net > Subject: Re: [PHP] Class and interface location > > On Wednesday, January 19, 2011 8:56:50 pm Tommy Pham wrote:

Re: [PHP] Class and interface location

2011-01-19 Thread Larry Garfield
On Wednesday, January 19, 2011 8:56:50 pm Tommy Pham wrote: > > And actually, thinking about it, I wonder if requiring the explicit > declaration > > is a good thing anyway because then it's immediately obvious and > > greppable what the class does. :-) > > > > --Larry Garfield > > You mean requ

RE: [PHP] Class and interface location

2011-01-19 Thread Tommy Pham
> -Original Message- > From: la...@garfieldtech.com [mailto:la...@garfieldtech.com] > Sent: Wednesday, January 19, 2011 2:21 PM > To: php-general@lists.php.net > Subject: Re: [PHP] Class and interface location > > On 1/19/11 3:44 PM, David Harkness wrote: > > W

Re: [PHP] Class and interface location

2011-01-19 Thread Peter Lind
How often would this profiling have to happen? Seems to me that if it's a "once per build" or "once per someone pressing the button", then go for the more expensive analysis checking through the files. Just build up a tree that shows which classes implement what or inherit from where, save that alo

Re: [PHP] Class and interface location

2011-01-19 Thread la...@garfieldtech.com
On 1/19/11 3:44 PM, David Harkness wrote: What about creating your own docblock tag such as @plugin-interface? While it still requires each plugin to explicitly define the interface(s) it implements, it won't be in the class declaration. This would be very easy to nab for a tree of files using gr

Re: [PHP] Class and interface location

2011-01-19 Thread David Harkness
What about creating your own docblock tag such as @plugin-interface? While it still requires each plugin to explicitly define the interface(s) it implements, it won't be in the class declaration. This would be very easy to nab for a tree of files using grep, removing the need to do any static analy

Re: [PHP] Class and interface location

2011-01-19 Thread la...@garfieldtech.com
On 1/19/11 10:52 AM, Richard Quadling wrote: There is a pecl extension called inclued [1]&[2] which could be used I think. It can be used to produce a list of all the relationships between included files, so a one off pass of all the class files (simply include them) and then retrieve the a

Re: [PHP] Class and interface location

2011-01-19 Thread la...@garfieldtech.com
On 1/19/11 11:16 AM, Adam Richardson wrote: As long as the static analysis tool builds a composite of class hierarchy established in all the files (project wide, at least in terms of the plugin), you wouldn't have to double declare interfaces so they could be detected. Adam That is essentia

Re: [PHP] Class and interface location

2011-01-19 Thread Adam Richardson
On Wed, Jan 19, 2011 at 11:23 AM, la...@garfieldtech.com < la...@garfieldtech.com> wrote: > On 1/19/11 10:09 AM, Adam Richardson wrote: > >> On Wed, Jan 19, 2011 at 8:21 AM, Richard Quadling> >wrote: >> >> On 19 January 2011 07:46, Adam Richardson wrote: >>> On Wed, Jan 19, 2011 at 2:07 AM,

Re: [PHP] Class and interface location

2011-01-19 Thread Richard Quadling
On 19 January 2011 16:23, la...@garfieldtech.com wrote: > On 1/19/11 10:09 AM, Adam Richardson wrote: >> >> On Wed, Jan 19, 2011 at 8:21 AM, Richard >> Quadlingwrote: >> >>> On 19 January 2011 07:46, Adam Richardson  wrote: On Wed, Jan 19, 2011 at 2:07 AM, Larry Garfield>>> wrote: >

Re: [PHP] Class and interface location

2011-01-19 Thread la...@garfieldtech.com
On 1/19/11 10:09 AM, Adam Richardson wrote: On Wed, Jan 19, 2011 at 8:21 AM, Richard Quadlingwrote: On 19 January 2011 07:46, Adam Richardson wrote: On Wed, Jan 19, 2011 at 2:07 AM, Larry Garfield 3) Static analysis. Instead of reflection, either tokenize or string parse all files to deter

Re: [PHP] Class and interface location

2011-01-19 Thread Adam Richardson
On Wed, Jan 19, 2011 at 8:21 AM, Richard Quadling wrote: > On 19 January 2011 07:46, Adam Richardson wrote: > > On Wed, Jan 19, 2011 at 2:07 AM, Larry Garfield >wrote: > > > >> 3) Static analysis. Instead of reflection, either tokenize or string > parse > >> all files to determine what classes

Re: [PHP] Class and interface location

2011-01-19 Thread Steve Staples
On Wed, 2011-01-19 at 01:07 -0600, Larry Garfield wrote: > Hi all. I'm trying to come up with a solution to an architectural problem I > could use some extra eyes on. > > I have (or will have) a large code base with lots of classes, spread out over > many optional plugin components. These clas

Re: [PHP] Class and interface location

2011-01-19 Thread Richard Quadling
On 19 January 2011 07:46, Adam Richardson wrote: > On Wed, Jan 19, 2011 at 2:07 AM, Larry Garfield wrote: > >> 3) Static analysis.  Instead of reflection, either tokenize or string parse >> all files to determine what classes implement what interfaces and then >> cache >> that information.  We are

Re: [PHP] Class and interface location

2011-01-18 Thread Adam Richardson
On Wed, Jan 19, 2011 at 2:07 AM, Larry Garfield wrote: > 3) Static analysis. Instead of reflection, either tokenize or string parse > all files to determine what classes implement what interfaces and then > cache > that information. We are actually using this method now to locate classes, > and

[PHP] Class and interface location

2011-01-18 Thread Larry Garfield
Hi all. I'm trying to come up with a solution to an architectural problem I could use some extra eyes on. I have (or will have) a large code base with lots of classes, spread out over many optional plugin components. These classes, of course, will have interfaces on them. These classes will,

Re: [PHP] class object vs array for db table model

2010-10-12 Thread chris h
s should be a > > fast solution, while still giving you the power of encapsulation, getters > > and setters. > > > > Hope that helps! > > Chris. > > > > Hi Chris, > > Thanks for the reply. The sample I made is just for simplicity and > comparison.

Re: [PHP] class object vs array for db table model

2010-10-12 Thread Tommy Pham
rs and > setters would key off that element of the master array.  This should be a > fast solution, while still giving you the power of encapsulation, getters > and setters. > > Hope that helps! > Chris. > Hi Chris, Thanks for the reply. The sample I made is just for simplicity and c

Re: [PHP] class object vs array for db table model

2010-10-12 Thread chris h
On Tue, Oct 12, 2010 at 2:38 AM, Tommy Pham wrote: > Hi everyone, > > It's been a couple years since I've did a project in PHP. The current > project I'm working on is for PHP 5.3 and I noticed a performance issue. > Is > it just me or is there a BIG difference in performance between class obje

[PHP] class object vs array for db table model

2010-10-11 Thread Tommy Pham
Hi everyone, It's been a couple years since I've did a project in PHP. The current project I'm working on is for PHP 5.3 and I noticed a performance issue. Is it just me or is there a BIG difference in performance between class object vs array for PHP 5.3? Below is the sample: class MyTable {

Re: [PHP] Class mysqli not found

2010-10-07 Thread sueandant
ctober 06, 2010 9:09 PM Subject: Re: [PHP] Class mysqli not found On Wed, 2010-10-06 at 21:00 +0100, sueandant wrote: I'm still fighting a losing battle in my attempts to get PHP speak to mysqli. I can access MySql via the prompt. Apache and PHP are installed and working. In Apache&#

RE: [PHP] Class mysqli not found

2010-10-06 Thread Tommy Pham
> -Original Message- > From: chris h [mailto:chris...@gmail.com] > Sent: Wednesday, October 06, 2010 1:44 PM > To: Alejandro Michelin Salomon > Cc: sueandant; php-general@lists.php.net > Subject: Re: [PHP] Class mysqli not found > > mysqli is set of functions

Re: RES: [PHP] Class mysqli not found

2010-10-06 Thread sueandant
I'm running phpinfo from my browser under localhost. - Original Message - From: chris h To: sueandant Cc: PHP Sent: Wednesday, October 06, 2010 10:12 PM Subject: Re: RES: [PHP] Class mysqli not found Are you doing phpinfo() off the CLI or via apache mod? Is it the

Re: RES: [PHP] Class mysqli not found

2010-10-06 Thread chris h
mysqli.max_persistent Unlimited Unlimited > mysqli.reconnect Off Off > > - Original Message - From: "Simon J Welsh" > To: "Alejandro Michelin Salomon" > Cc: "'sueandant'" ; < > php-general@lists.php.net> > Sent: We

Re: RES: [PHP] Class mysqli not found

2010-10-06 Thread sueandant
mysqli.max_links Unlimited Unlimited mysqli.max_persistent Unlimited Unlimited mysqli.reconnect Off Off - Original Message - From: "Simon J Welsh" To: "Alejandro Michelin Salomon" Cc: "'sueandant'" ; Sent: Wednesday, October 06, 2010 9:43 PM Subjec

Re: [PHP] Class mysqli not found

2010-10-06 Thread sueandant
I've tried this and get the same error message. - Original Message - From: "Alejandro Michelin Salomon" To: "'sueandant'" Cc: Sent: Wednesday, October 06, 2010 9:33 PM Subject: RES: [PHP] Class mysqli not found Sueandant : mysqli is set of

Re: [PHP] Class mysqli not found

2010-10-06 Thread sueandant
Yes, I've run phpinfo() and mysqli is listed in the detailed output. - Original Message - From: "Jay Blanchard" To: "sueandant" ; Cc: "PHP" Sent: Wednesday, October 06, 2010 9:31 PM Subject: RE: [PHP] Class mysqli not found [snip] When I run thi

Re: [PHP] Class mysqli not found

2010-10-06 Thread chris h
t; printf("Host information: %s\n", mysqli_get_host_info($mysqli)); > } > > > Try adodb lib for php ( http://adodb.sourceforge.net/ ), is great layer on > top of php db functions. > > Alejandro M.S. > > -Mensagem original- > De: sueandant [mailto:hollandsath...@ti

Re: RES: [PHP] Class mysqli not found

2010-10-06 Thread Simon J Welsh
> Alejandro M.S. > > -Mensagem original- > De: sueandant [mailto:hollandsath...@tiscali.co.uk] > Enviada em: quarta-feira, 6 de outubro de 2010 17:27 > Para: sstap...@mnsi.net > Cc: PHP > Assunto: Re: [PHP] Class mysqli not found > > Thanks Steve. Her

RES: [PHP] Class mysqli not found

2010-10-06 Thread Alejandro Michelin Salomon
x27;php-general@lists.php.net' Assunto: RES: [PHP] Class mysqli not found Sueandant : mysqli is set of functions not a class. The name to connect is mysqli_connect /** * * * @version $Id$ * @copyright 2010 */ $mysqli = mysqli_connect ("localhost", "root", "woodcote",

RES: [PHP] Class mysqli not found

2010-10-06 Thread Alejandro Michelin Salomon
sueandant [mailto:hollandsath...@tiscali.co.uk] Enviada em: quarta-feira, 6 de outubro de 2010 17:27 Para: sstap...@mnsi.net Cc: PHP Assunto: Re: [PHP] Class mysqli not found Thanks Steve. Here's the php file: When I run this small program I get a Fatal Error: Class mysqli not found er

RE: [PHP] Class mysqli not found

2010-10-06 Thread Jay Blanchard
[snip] When I run this small program I get a Fatal Error: Class mysqli not found error message. [/snip] Have you run a simple phpinfo(); to see if you have the mysqli module? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Class mysqli not found

2010-10-06 Thread sueandant
Thanks Steve. Here's the php file: When I run this small program I get a Fatal Error: Class mysqli not found error message. - Original Message - From: "Steve Staples" To: "sueandant" Cc: "PHP" Sent: Wednesday, October 06, 2010 9:09 PM

Re: [PHP] Class mysqli not found

2010-10-06 Thread Steve Staples
On Wed, 2010-10-06 at 21:00 +0100, sueandant wrote: > I'm still fighting a losing battle in my attempts to get PHP speak to mysqli. > I can access MySql via the prompt. Apache and PHP are installed and > working. In Apache's config file PHPIniDir is set to "C:\php", which is > where I unzipp

[PHP] Class mysqli not found

2010-10-06 Thread sueandant
I'm still fighting a losing battle in my attempts to get PHP speak to mysqli. I can access MySql via the prompt. Apache and PHP are installed and working. In Apache's config file PHPIniDir is set to "C:\php", which is where I unzipped the binary download files, and set LoadModule php5_module

Re: [PHP] Class constants

2010-04-20 Thread Nathan Rixham
Gary . wrote: > On Mon, Apr 19, 2010 at 3:12 PM, Ashley Sheridan wrote: >> On 19 April 2010 14:24, Gary wrote: > >>> Okay. Why not? > ... >> Class constants must be defined with static values, not variables. They are >> constants after all! If they relied on the value of a variable, surely that

Re: [PHP] Class constants

2010-04-19 Thread David Harkness
On Mon, Apr 19, 2010 at 7:25 AM, Peter Lind wrote: > Per the PHP manual: "The value must be a constant expression". Is > something that depends on other classes, variables or functions > constant? > When I came up against this problem myself, I read "a constant expression" to mean "an expression

Re: [PHP] Class constants

2010-04-19 Thread Adam Richardson
On Mon, Apr 19, 2010 at 10:25 AM, Peter Lind wrote: > On 19 April 2010 16:18, Gary . wrote: > > On Mon, Apr 19, 2010 at 2:37 PM, Peter Lind > wrote: > >> On 19 April 2010 14:24, Gary wrote: > >>> On Mon, Apr 19, 2010 at 10:36 AM, Peter Lind wrote: > > > So no, you shouldn't be able to do t

Re: [PHP] Class constants

2010-04-19 Thread Peter Lind
On 19 April 2010 16:18, Gary . wrote: > On Mon, Apr 19, 2010 at 2:37 PM, Peter Lind wrote: >> On 19 April 2010 14:24, Gary wrote: >>> On Mon, Apr 19, 2010 at 10:36 AM, Peter Lind wrote: > So no, you shouldn't be able to do that. >>> >>> Okay. Why not? >> >> Hate to ask, but did you at any po

Re: [PHP] Class constants

2010-04-19 Thread Gary .
On Mon, Apr 19, 2010 at 3:12 PM, Ashley Sheridan wrote: > On 19 April 2010 14:24, Gary wrote: > > Okay. Why not? ... > Class constants must be defined with static values, not variables. They are > constants after all! If they relied on the value of a variable, surely that > would mean that their

Re: [PHP] Class constants

2010-04-19 Thread Gary .
On Mon, Apr 19, 2010 at 2:37 PM, Peter Lind wrote: > On 19 April 2010 14:24, Gary wrote: >> On Mon, Apr 19, 2010 at 10:36 AM, Peter Lind wrote: >>> So no, you shouldn't be able to do that. >> >> Okay. Why not? > > Hate to ask, but did you at any point consider to read the PHP docs on > this? The

Re: [PHP] Class constants

2010-04-19 Thread Ashley Sheridan
On Mon, 2010-04-19 at 14:37 +0200, Peter Lind wrote: > On 19 April 2010 14:24, Gary . wrote: > > On Mon, Apr 19, 2010 at 10:36 AM, Peter Lind wrote: > >> On 19 April 2010 10:30, Gary wrote: > >>> Should I be able to do this: > >>> > >>> class X > >>> { > >>> const FOO = 'foo'; > >>> const FOOBA

Re: [PHP] Class constants

2010-04-19 Thread Peter Lind
On 19 April 2010 14:24, Gary . wrote: > On Mon, Apr 19, 2010 at 10:36 AM, Peter Lind wrote: >> On 19 April 2010 10:30, Gary wrote: >>> Should I be able to do this: >>> >>> class X >>> { >>>  const FOO = 'foo'; >>>  const FOOBAR = X::FOO . 'bar'; >>> >>> ... >>> } > >> So no, you shouldn't be able

Re: [PHP] Class constants

2010-04-19 Thread Gary .
On Mon, Apr 19, 2010 at 10:36 AM, Peter Lind wrote: > On 19 April 2010 10:30, Gary wrote: >> Should I be able to do this: >> >> class X >> { >>  const FOO = 'foo'; >>  const FOOBAR = X::FOO . 'bar'; >> >> ... >> } > So no, you shouldn't be able to do that. Okay. Why not? -- PHP General Mailing L

Re: [PHP] Class constants

2010-04-19 Thread Peter Lind
On 19 April 2010 10:30, Gary . wrote: > Should I be able to do this: > > class X > { >  const FOO = 'foo'; >  const FOOBAR = X::FOO . 'bar'; > > ... > } > > ? > > Because I can't. I get "syntax error, unexpected '.', expecting ',' or > ';'". I assume this is because the constants are like statics

[PHP] Class constants

2010-04-19 Thread Gary .
Should I be able to do this: class X { const FOO = 'foo'; const FOOBAR = X::FOO . 'bar'; ... } ? Because I can't. I get "syntax error, unexpected '.', expecting ',' or ';'". I assume this is because the constants are like statics which can't be initialised by functions etc. but is there rea

Re: [PHP] class attributes and __construct

2010-04-15 Thread Larry Garfield
On Thursday 15 April 2010 08:37:40 am Ashley Sheridan wrote: > I know I could move it to __construct and give it a default value in the > arguments list, but that brings it's own problems. What if the argument > list grows too big, and which attribute would be deemed more important > than another

RE: [PHP] class attributes and __construct

2010-04-15 Thread Tommy Pham
> -Original Message- > From: Fernando [mailto:ferna...@ggtours.ca] > Sent: Thursday, April 15, 2010 10:24 AM > To: php-general@lists.php.net > Subject: Re: [PHP] class attributes and __construct > > Hello Ashely, > > I would initialize the variable when I&#

Re: [PHP] class attributes and __construct

2010-04-15 Thread Fernando
5/04/2010 11:54, Ashley Sheridan wrote: On Thu, 2010-04-15 at 07:42 -0700, Tommy Pham wrote: Hi Ashley, -Original Message- From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] Sent: Thursday, April 15, 2010 6:38 AM To: PHP General List Subject: [PHP] class attributes and __con

RE: [PHP] class attributes and __construct

2010-04-15 Thread Ashley Sheridan
On Thu, 2010-04-15 at 07:42 -0700, Tommy Pham wrote: > Hi Ashley, > > > -Original Message- > > From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] > > Sent: Thursday, April 15, 2010 6:38 AM > > To: PHP General List > > Subject: [PHP] class attribu

RE: [PHP] class attributes and __construct

2010-04-15 Thread Tommy Pham
Hi Ashley, > -Original Message- > From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] > Sent: Thursday, April 15, 2010 6:38 AM > To: PHP General List > Subject: [PHP] class attributes and __construct > > I think this is probably going to end up as one of those

[PHP] class attributes and __construct

2010-04-15 Thread Ashley Sheridan
I think this is probably going to end up as one of those coders' preference type of things, but I was wondering what was considered the general best approach. When creating a class, you can define default values for the object in the class itself, and within the __construct function. Now, while I

Re: [PHP] Class not functioning (RESOLVED)

2009-12-18 Thread Allen McCabe
I looked into registries (singleton registries), and while I can see the advantage they provide, most every article I read advised AGAINST using singleton registries because it creates extra dependencies (ie. a file needs the database class AND the registry class instead of just the database class)

Re: [PHP] Class not functioning

2009-12-16 Thread Wouter van Vliet / Interpotential
Allen, Before you go with my static-approach, please do consider Shawn's registry pattern suggestion. That's pretty sweet too ;-). A little response to your long text, before I help you fix the bug. A static property is basically the same as a regular property on an object. Only difference is tha

Re: [PHP] Class not functioning

2009-12-15 Thread Shawn McKenzie
Sorry, and then I didn't keep it on list :-( Shawn McKenzie wrote: > Please reply to the list. Just google for "php registry pattern". Here is a > very basic example. There are better OOP people here than I. > > class Registry { > protected $_objects = array(); > > function set($name,

Re: [PHP] Class not functioning

2009-12-15 Thread Allen McCabe
Wouter, Implementing your static idea was pretty easy, I was already referencing Notifier with the :: operator in my other methods, however I am running into trouble assigning new values to the static array. I am getting a "syntax error, unexpected '[' " on this line of my Notifier class: Notifi

Re: [PHP] Class not functioning

2009-12-15 Thread Wouter van Vliet / Interpotential
teSingle($id, 1); // This completes a function within > Meetgreet class. That function needs to be able to use the Notifier > function > addtoQ(), how would this be accomplished? > > ?> > ... > ... > > printQ() ?> > > On Mon, Dec 14, 2009 at 6:07 PM,

Re: [PHP] Class not functioning

2009-12-15 Thread Shawn McKenzie
Allen McCabe wrote: > Hey all (and Nirmalya, thanks for the help!), > > > I have a question that I just can't seem to find via Google. > > I want to be able to add messages to a qeue whenever my classes complete (or > fail to complete) specific functions. I think have a call within my html to >

Re: [PHP] Class not functioning

2009-12-15 Thread Allen McCabe
be accomplished? ?> ... ... printQ() ?> On Mon, Dec 14, 2009 at 6:07 PM, Nirmalya Lahiri wrote: > --- On Tue, 12/15/09, Allen McCabe wrote: > > > From: Allen McCabe > > Subject: [PHP] Class not functioning > > To: "phpList" > > Date: Tuesday, Dec

Re: [PHP] Class not functioning

2009-12-14 Thread Nirmalya Lahiri
--- On Tue, 12/15/09, Allen McCabe wrote: > From: Allen McCabe > Subject: [PHP] Class not functioning > To: "phpList" > Date: Tuesday, December 15, 2009, 6:17 AM > Hey everyone, I just delved into > classes recently and have been having > moderate success so fa

[PHP] Class not functioning

2009-12-14 Thread Allen McCabe
Hey everyone, I just delved into classes recently and have been having moderate success so far. I have a puzzler though. I have the following class decalred and instantiated: class Notify { var $q = array(); public function addtoQ($string, $class) { $message = ''. $string .''; $this->q[]

[PHP] Class not returning value

2009-11-25 Thread Pieter du Toit
Hi This is my first class and it does not work, i do a return $this->responseArray; with the public function getResult() method, but get nothing. Can someone please help me. Thsi is how i create the object $number = new Smsgate($cell_numbers, $message, "27823361602", "27"); $result = $number->g

Re: [PHP] class to generate Javascript Object ??

2009-10-04 Thread Michael A. Peters
Tom Worster wrote: On 10/4/09 9:39 AM, "Michael A. Peters" wrote: I wrote a php class to generate flowplayer/html5 media code for my site: http://www.shastaherps.org/xml_MMmediaClass.phps The "buildFlashvars()" function in it is really ugly and will be a pain to update a

RE: [PHP] class to generate Javascript Object ??

2009-10-04 Thread Andrea Giammarchi
> I'm thinking (hoping) there is already a php class somewhere for > generating JavaScript object strings that I can instead of my ugly > easily breakable way of doing it. > > Anyone know of one? json_encode http://uk3.php.net/manual/en/function.json

Re: [PHP] class to generate Javascript Object ??

2009-10-04 Thread Tom Worster
On 10/4/09 9:39 AM, "Michael A. Peters" wrote: > I wrote a php class to generate flowplayer/html5 media code for my site: > > http://www.shastaherps.org/xml_MMmediaClass.phps > > The "buildFlashvars()" function in it is really ugly and will be a pain >

[PHP] class to generate Javascript Object ??

2009-10-04 Thread Michael A. Peters
I wrote a php class to generate flowplayer/html5 media code for my site: http://www.shastaherps.org/xml_MMmediaClass.phps The "buildFlashvars()" function in it is really ugly and will be a pain to update as I modify the class in the future. What it does is generate a JavaScript obj

[PHP] Class variable value lost

2009-09-09 Thread Sumit Sharma
Hi, I have developed a listing site which is totally class based. Now when it authenticates a user login and set appropriate class variables to true and set user info in user class variables, value of all the set variables are lost when I forward the user to members page. When I check the the valu

Re: [PHP] Class Problems

2009-08-11 Thread la...@garfieldtech.com
Ashley Sheridan wrote: On Tue, 2009-08-11 at 17:57 +0200, Aschwin Wesselius wrote: Ashley Sheridan wrote: And I really would use a PHP 5 server given the choice. I've tried speaking to the hosting company a few times, but they brush me off! Hi Ashley, And how is their SLA then? Do you take

Re: [PHP] Class Problems

2009-08-11 Thread Ashley Sheridan
On Tue, 2009-08-11 at 17:57 +0200, Aschwin Wesselius wrote: > Ashley Sheridan wrote: > > And I really would use a PHP 5 server given the choice. I've tried > > speaking to the hosting company a few times, but they brush me off! > > > Hi Ashley, > > And how is their SLA then? Do you take full re

  1   2   3   4   5   6   >