[Fwd: Re: [PHP] Returning a reference]

2003-10-09 Thread Fabrizio Balliano
 Do as follows:

   9 function SomeThing() {
  10 $this-Changed = sure;
  11 }

Regards
-- 
Fabrizio Balliano


CREALABS
Viale dei Mughetti, 13/A - 10151 Torino - Italy
Tel. +39-011-735645 - Fax +39-011-735645
http://www.crealabs.it - mailto:[EMAIL PROTECTED]

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



Re: [PHP] Committing OO Sin

2003-10-03 Thread Fabrizio Balliano
I suggest you should use MerlinWork ;-)

It does these things for you.

Fabrizio Balliano

Il ven, 2003-10-03 alle 16:23, Gerard Samuel ha scritto:
 Or is there such a thing.  ;)
 I have a small collection of utility classes, and it seems like the
more 
 I add,
 the more cumbersome things seem to get.
 A brief synopsis of code execution.
 1.  Start DB class
 2.  Start Smarty class, passing reference of DB class to Smarty
 3.  When needed start Date-Time class
 4.  When needed start Text-Format class, passing reference of Smarty 
 class to Text-Format class,
 which also has a reference to the DB class.  (Im using both within the
 Text-Format class)
 
 Currently, I have a file of functions that handle user management, a 
 possible candidate for a class.
 If I were to convert it, it would go between steps 1 and 2, and would 
 need a reference to the DB class.
 Then the Smarty class is going to need a reference of the proposed
user 
 management class.
 By that time, Smarty contains itself, a reference to the DB class, 
 reference to the user management class which
 in turn contains a reference to the DB class.
 All these references, are beginning to worry me, to the point where Im
 second guessing myself, that
 Im going about this the wrong way.
 Making utility classes are somewhat straight forward, but getting
them 
 to work together,
 seems like a pain.
 
 So I was thinking, if a class was started in the global space, is it a
sin,
 to use the $GLOBALS array to access it, instead of tying in all these 
 references??
 
 Thanks for any input you may provide.
-- 
Fabrizio Balliano


CREALABS
Viale dei Mughetti, 13/A - 10151 Torino - Italy
Tel. +39-011-735645 - Fax +39-011-735645
http://www.crealabs.it - mailto:[EMAIL PROTECTED]

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



[PHP] MerlinWork PHP Framework

2003-09-29 Thread Fabrizio Balliano
Hi to all,
I'd like to present show you a PHP framework written by my company:
MerlinWork.

Its built with the concept of allowing developers to build a web
application like they would do with a client application developing
environment.

The result is a stateful application, managed by events.
Developer has a set of widget to use, like tables, fields, buttons etc.

It's distribuited under the GPL licence and it's available at
http://merlinwork.sourceforge.net.

An interactive (easy development) demo is available at
http://merlinwork-demo.crealabs.it.

Its core features are:
- strongly object oriented
- stateful
- many usable and customizable objects
- self installing
- no database required

Feel free to download and try it and make me know what do you think
about it.
Regards

-- 
Fabrizio Balliano


CREALABS
Viale dei Mughetti, 13/A - 10151 Torino - Italy
Tel. +39-011-735645 - Fax +39-011-735645
http://www.crealabs.it - mailto:[EMAIL PROTECTED]

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



[PHP] (To Rasmus and/or Developers) PHP as CGI env variables

2002-01-10 Thread fabrizio

Hi,
I'm trying to let Webmin execute a script where I can use php as scripting 
language... (It will be good to work with a language as php in a remote administration 
server, as root!)

Now the STRANGE problem:

When I execute a test.cgi program from Webmin, it's executed as root, as it was from 
command line... that's good. The problem is that Webmin execute well _every_ program I 
tried , EXCEPT php !

It seems that php needs some env variables to work well, and these variables aren't 
provided from the Webmin program, so to solve the problem I've to first understand WHY 
php does not work...

Here are some tests:

1) Executing a php that produce some output, or create a file works only when called 
from a login shell, not in Webmin
2) Executing a script that invoke at with the previous script doesn't work as 
well... from atq the scheduled processes are the same, but the one invoked from a 
login shell works, the invoked from Webmin not at all...

... what to do ?!?

thanx very much,
prakash





Re: [PHP] (To Rasmus and/or Developers) PHP as CGI env variables

2002-01-10 Thread fabrizio

Thank you for your prompt reply...

The problems seem to be some env variables (maybe I'm wrong) when
executing PHP as CGI...
I better explain with 2 samples:

file aaa.cgi

#!/bin/bash
echo Content-type: text/plain
echo
echo aaa
touch /home/test.txt

file bbb.cgi

#!/usr/local/bin/php -q
?php
echo Content-type: text/plain\n\n;
echo aaa\n;
$fd = fopen(/home/test.txt,w);
fclose($fd);
?

Now, the 2 programs are quite the same... (if test.txt does not exist...)
But, the 2 programs behave the same way only if you execute them _from
command line_.
If you execute them from the Webmin interface (very good for remote
administration, that lets execute programs with user root), they behave
differently:
aaa.cgi is the same, displays aaa on the remote web-browser, and creates
(well, if text.txt doesn't exist) a local file.
bbb.cgi does nothing, sends no http headers, no aaa, and does not create the
file...

It seems that PHP needs some env variables, and without them, it suddenly
stops without parsing the file... am I right ?!?

I've also tried to escape from this problem (until understood and solved)
with a third program:

file ccc.cgi

#!/bin/bash
/usr/bin/at -f /path/bbb.cgi now+1minute
touch /home/test2.txt

If I call ccc.cgi from Webmin and then from command line, the 2 executions
are scheduled properly, and look really the same (root user,same
program,...) but the task scheduled from Webmin is not executed properly...
the php seems to stop with no output.

Also with a file like this:

file ddd.cgi

#!/bin/bash
/path/bbb.cgi 21  test3.txt

show that php really has no output on stdout or stderr (test3.txt is
created, but 0 bytes long when invoked from Webmin!)

So, the BIG problem is: if Webmin can execute all programs, running them as
root, WHY doesn't work well with php scripts ?!?
I think that the PHP need something, and not having it it suddenly stops...
but what ?!?

Are there some developer that can help ?!?

(Writing Webmin modules in perl is not good, if you work mainly with php,
and webmin can be the best remote administration utility...)

thanks to all,
waiting for some news...
prakash



 Ok, this is not really clear to me. Does it do anything? perharps give an
error ??
 Did you try writing all output to a file, so you can actually see the
error ??

 for example:

 ls  21  /tmp/out

 will write 'ls' his stdout AND stderr to /tmp/out

 Maybe, do you need to include the full path to your php binary ??


 Hi,
 I'm trying to let Webmin execute a script where I can use php as
scripting language... (It will be good to work with a language as php in a
remote administration server, as root!)
 
 Now the STRANGE problem:
 
 When I execute a test.cgi program from Webmin, it's executed as root, as
it was from command line... that's good. The problem is that Webmin execute
well _every_ program I tried , EXCEPT php !
 
 It seems that php needs some env variables to work well, and these
variables aren't provided from the Webmin program, so to solve the problem
I've to first understand WHY php does not work...
 
 Here are some tests:
 
 1) Executing a php that produce some output, or create a file works only
when called from a login shell, not in Webmin
 2) Executing a script that invoke at with the previous script doesn't
work as well... from atq the scheduled processes are the same, but the one
invoked from a login shell works, the invoked from Webmin not at all...
 
 ... what to do ?!?
 
 thanx very much,
 prakash
 
 
 





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] this is a test. Plz ignore.

2002-01-09 Thread fabrizio

...



[PHP] PHP env variables... ?

2002-01-09 Thread fabrizio

Hi,
I'm trying to let Webmin execute a script where I can use php as scripting 
language... (It will be good to work with a language as php in a remote administration 
server, as root!)

Now the STRANGE problem:

When I execute a test.cgi program from Webmin, it's executed as root, as it was from 
command line... that's good. The problem is that Webmin execute well _every_ program I 
tried , EXCEPT php !

It seems that php needs some env variables to work well, and these variables aren't 
provided from the Webmin program, so to solve the problem I've to first understand WHY 
php does not work...

Here are some tests:

1) Executing a php that produce some output, or create a file works only when called 
from a login shell, not in Webmin
2) Executing a script that invoke at with the previous script doesn't work as 
well... from atq the scheduled processes are the same, but the one invoked from a 
login shell works, the invoked from Webmin not at all...

... what to do ?!?

thanx very much,
prakash