php-general Digest 23 Sep 2010 18:26:24 -0000 Issue 6956

Topics (messages 308264 through 308271):

Re: Copying an Object
        308264 by: Carlos Medina

Re: ZipArchive, but without files
        308265 by: Jonathan Mills
        308271 by: [email protected]

module add on Suse 10.3
        308266 by: Patrick Serru
        308267 by: [email protected]
        308268 by: Patrick Serru
        308269 by: [email protected]

Re: Database Administration
        308270 by: tedd

Administrivia:

To subscribe to the digest, e-mail:
        [email protected]

To unsubscribe from the digest, e-mail:
        [email protected]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
Am 23.09.2010 08:24, schrieb Peter Lind:
On 23 September 2010 02:14, Daniel Kolbo<[email protected]>  wrote:

*snip*

On 9/22/2010 9:11 AM, chris h wrote:
Say you have two classes: human and male.  Further, say male extends
human.  Let's say you have a human object.  Then later you want to make
that human object a male object.  This seems to be a pretty reasonable
thing to request of our objects.

Perhaps if you're a C# programmer, but the PHP way of thinking is
radically different.
C#: This object is whatever it was currently cast to (if possible)
PHP: This object is this object, whatever it was created as

If you have a need to make an object switch class in PHP, then there's
a 99% chance you're working against, not with the language.

  This type of thing would especially be
easy if objects of parent classes could be cast as an object of its
extended class.

I'll hazard a guess and say you didn't start programming in PHP but in
something else.

Regards
Peter

Hi,
i think the problem here is the casting posibility in PHP is not implemented yet. Like Java you can not cast objects to others. I found, dass Classes can be casted by using this code:

class ParentClass
{
    public static function cast( ParentClass $object )
    {
        return $object;

    }

    public function tellMee( $value )
    {
        echo $value;
    }
}

class childClass extends ParentClass
{

}

$parent = ParentClass::cast( new childClass());
$parent->tellMee( 'Hallo ');
var_dump($parent);

Well yes you can get the ChildClass by using the parent class and use the methods allowed to use in the parent class (as method of parentClass in childClass). But you can not use inheritance in this construct in PHP. I think the best way to work with PHP classes is by using the Design Patterns for PHP...

Regards

Carlos

--- End Message ---
--- Begin Message ---
> and what if you serialize your String? You can save Objects in it...

True, but the defined format for the item in the database is a zip file
(it gets exported later to another, external, application which eats zip
files) :-(

--- End Message ---
--- Begin Message ---
On Thu, 2010-09-23 at 11:40 +0100, Jonathan Mills wrote:

> > and what if you serialize your String? You can save Objects in it...
> 
> True, but the defined format for the item in the database is a zip file
> (it gets exported later to another, external, application which eats zip
> files) :-(
> 


What about passing it through to the shell to deal with? I'm assuming
you're on a Linux server for this:

zip -r - directory_path | cat > topipe

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
      Hi everybody,

      I am using Open 10.3 with KDE 3.5.10 on an x86_64 system. I want to 
use the function "http_post_data()" from module "pecl_http" (in a script 
called from shell, which could be an important detail...). And did not 
succed!

      Is Open Suse repertories organised such a way that standard 
installation as read on the web (in the http://www.php.net/manual/ pages) 
does not work ?

      I allready gaveup in the past with an other module, that I just wanted 
to evaluate (gtk2). But now, it hangs!

      
> cd /home/me/bin/PHP/php-5.3.3/ext
> pecl download pecl_http
this gives a /home/me/bin/PHP/php-5.3.3/ext/pecl_http-1.7.0.tar file 
(uncompresssed) extraction with xml file inside, then:
> cd /home/me/bin/PHP/php-5.3.3
> rm configure
> ./buildconf --force
> ./configure --with-pecl_http
> make
# make install

(I did not see problem...)Then I try to execute a file containing:

#!/usr/bin/php --interactive
<? /** bla-bla */

  $resp=http_post_data(
... );
...

and the result is:
PHP Fatal error:  Call to undefined function http_post_data() 
in /home/me/Developpements/Mes_scripts_php/essais_post_2_site.php on line 
88

      The computer is personnal and for local developement, which means that 
the module could be installed as part of PHP (cli |& cgi) or as dynamicaly 
loadable  module...

      Thank for the time spent reading my mail
Patrick

NB I dont know since which try I got this mesage, at startup:

« Unable to load dynamic 
library '/usr/lib64/php5/extensions/pecl_http.so' - 
/usr/lib64/php5/extensions/pecl_http.so: 
cannot open shared object file: No such file or directory in Unknown on 
line 0 »

--- End Message ---
--- Begin Message ---
Suse uses yast2 iirc, which you can use to list and install php modules. Search 
for 'php' in yast software manager module.

Thanks,
Ash
http://www.ashleysheridan.co.uk

----- Reply message -----
From: "Patrick Serru" <[email protected]>
Date: Thu, Sep 23, 2010 14:06
Subject: [PHP] module add on Suse 10.3
To: "PHP General" <[email protected]>

      Hi everybody,

      I am using Open 10.3 with KDE 3.5.10 on an x86_64 system. I want to 
use the function "http_post_data()" from module "pecl_http" (in a script 
called from shell, which could be an important detail...). And did not 
succed!

      Is Open Suse repertories organised such a way that standard 
installation as read on the web (in the http://www.php.net/manual/ pages) 
does not work ?

      I allready gaveup in the past with an other module, that I just wanted 
to evaluate (gtk2). But now, it hangs!

      
> cd /home/me/bin/PHP/php-5.3.3/ext
> pecl download pecl_http
this gives a /home/me/bin/PHP/php-5.3.3/ext/pecl_http-1.7.0.tar file 
(uncompresssed) extraction with xml file inside, then:
> cd /home/me/bin/PHP/php-5.3.3
> rm configure
> ./buildconf --force
> ./configure --with-pecl_http
> make
# make install

(I did not see problem...)Then I try to execute a file containing:

#!/usr/bin/php --interactive
<? /** bla-bla */

  $resp=http_post_data(
... );
...

and the result is:
PHP Fatal error:  Call to undefined function http_post_data() 
in /home/me/Developpements/Mes_scripts_php/essais_post_2_site.php on line 
88

      The computer is personnal and for local developement, which means that 
the module could be installed as part of PHP (cli |& cgi) or as dynamicaly 
loadable  module...

      Thank for the time spent reading my mail
Patrick

NB I dont know since which try I got this mesage, at startup:

« Unable to load dynamic 
library '/usr/lib64/php5/extensions/pecl_http.so' - 
/usr/lib64/php5/extensions/pecl_http.so: 
cannot open shared object file: No such file or directory in Unknown on 
line 0 »

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


--- End Message ---
--- Begin Message ---
Le jeudi 23 septembre 2010, [email protected] a écrit :
> Suse uses yast2 iirc, which you can use to list and install php modules.
> Search for 'php' in yast software manager module. 
--------------
      Thanks Ash,

      I id'nt find any "iirc" software / module... I relatively well know 
yast2 (since yast [SüSE 6.x]!). Are you sure about this "iirc" or is it 
a "souvenir". I would like some sowtware to tell me the currently PHP 
installed modules!

      I really dont know where to look. The generated make file is so easy 
to read! I need to know how PHP installs it self. Usualy, the processes 
discripted in a software documentation for installation / modification work 
with open suse, but here... I am ready to reinstall all but this is risky: 
I would like apache to continue running correctly!

Patrick

--- End Message ---
--- Begin Message ---
Iirc isn't the module to look for, it means "if I remember correctly"!

Search for php and you should see the various available modules.

Thanks,
Ash
http://www.ashleysheridan.co.uk

----- Reply message -----
From: "Patrick Serru" <[email protected]>
Date: Thu, Sep 23, 2010 16:47
Subject: [PHP] module add on Suse 10.3
To: <[email protected]>

Le jeudi 23 septembre 2010, [email protected] a écrit :
> Suse uses yast2 iirc, which you can use to list and install php modules.
> Search for 'php' in yast software manager module. 
--------------
      Thanks Ash,

      I id'nt find any "iirc" software / module... I relatively well know 
yast2 (since yast [SüSE 6.x]!). Are you sure about this "iirc" or is it 
a "souvenir". I would like some sowtware to tell me the currently PHP 
installed modules!

      I really dont know where to look. The generated make file is so easy 
to read! I need to know how PHP installs it self. Usualy, the processes 
discripted in a software documentation for installation / modification work 
with open suse, but here... I am ready to reinstall all but this is risky: 
I would like apache to continue running correctly!

Patrick

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


--- End Message ---
--- Begin Message ---
At 9:35 PM +0100 9/22/10, Tom Barrett wrote:
Hmm..

I am familiar with PMA. I would for the purpose of this project consider it
too technical for the target user base. The point is to create a GUI layer
that would manage these things.

For example, the 'add client' screen would ask for four things; name,
description, username and password. Then behind the scenes a database would
be created, the user created, permissions granted and a pre-configure set of
tables built (and populated).

My reservations come from security issues (which, as an aside, are also
discussed about PMA), allowing a normal user account CREATE and GRANT on the
database.

Maybe I'm being too fuddy-duddy cautious.

Tom:

No, but from what you've said, I don't think the end user must have privileges and the ability to create a database and tables. It sounds more like allowing the user to set up his own admin for acceptable users -- there's a big difference.

So, what you need to define is what the client and his users want to do. From that, we can determine what they need.

Cheers,

tedd

--
-------
http://sperling.com/

--- End Message ---

Reply via email to