php-general Digest 9 Oct 2004 17:25:31 -0000 Issue 3043

Topics (messages 199050 through 199076):

Re: Securing Servers
        199050 by: Curt Zirzow
        199051 by: Curt Zirzow
        199062 by: John Nichel

Re: MYSQL_VERSION_ID?
        199052 by: Curt Zirzow
        199071 by: Minuk Choi

Re: Safe mode & imagecreatefromjpeg
        199053 by: Curt Zirzow

Dose this tool exist
        199054 by: Dave Carrera
        199056 by: M. Sokolewicz
        199057 by: Martin Rozmus

Static variable reflection
        199055 by: Benjamin Dischinger

Re: **[SPAM]** RE: [PHP] Newsgroups Space
        199058 by: Chris Dowell

Re: Sessions not destroyed
        199059 by: Chris Dowell

Re: Grab an array from a cookie without throwing errors?
        199060 by: Chris Dowell
        199064 by: Chris Dowell

Re: Callback functions inside classes - how to?
        199061 by: Chris Dowell

help me to get out of this mass mailing
        199063 by: suneel
        199065 by: Matt M.
        199068 by: Greg Donald

PHP and FORM
        199066 by: php mysql
        199067 by: Greg Donald

Problem with a time comparison loop
        199069 by: Shaun
        199070 by: Greg Donald

Re: Function declaration failing on return value
        199072 by: Jason Wong

extending built in classes?
        199073 by: dc
        199074 by: M. Sokolewicz

GD
        199075 by: Gerben
        199076 by: Simas Toleikis

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 ---
* Thus wrote M Saleh EG:
> 
> but plz Radhita, don't bring your biased opinions about MS vs
> Opensource or Linux vs Windows over here. It's so subjective and plus
> gets an off-topic topic more off !

I can install BSD apache/php/mysql w/firewall and totally locked
down in 15 minutes and know its secure. it takes windows 15 minutes
to prepare the installation..  before I can even choose what I want
to do.

Opinions are always welcome here, expecially when they concern
security issues related to internet activities. Instead of avoiding
the  topic, a better comment would be to say that it is possible to
make windows just as secure as any other system.  Knowledge on
security differs greatly depending on what system your running.




Curt
-- 
The above comments may offend you. flame at will.

--- End Message ---
--- Begin Message ---
* Thus wrote Stephen Craton:
> Hello,
> 
> I'm in the process of hooking up my own personal web server for use by
> certain clients to view the progress on work I'm doing for them. However,
> I'm on a shared network that is behind a firewall and some computers on the
> network need to stay secure as possible. I've heard that if you gain access
> to one computer, the whole thing is vulnerable.

If you have an existing webserver on the outside of the firewall, I
would suggest that, if possible, to set up that webserver to proxy
stuff directly to your server. As the simple diagram shows below.


*internet*
 | 
 |
*public webserver* (proxy via internal network)
 |
 |
----- firewall ----
 | <-internal network
 | 
*your computer*

With this method, no security whole is opened at the firewall. Only
at the web server, which is transparent to the normal user.  And
since the public webserver only makes direct contact with your
computer, the entire network isn't compromised.

 

Curt
-- 
The above comments may offend you. flame at will.

--- End Message ---
--- Begin Message ---
Curt Zirzow wrote:

* Thus wrote M Saleh EG:

but plz Radhita, don't bring your biased opinions about MS vs
Opensource or Linux vs Windows over here. It's so subjective and plus
gets an off-topic topic more off !


I can install BSD apache/php/mysql w/firewall and totally locked
down in 15 minutes and know its secure. it takes windows 15 minutes
to prepare the installation..  before I can even choose what I want
to do.

Opinions are always welcome here, expecially when they concern
security issues related to internet activities. Instead of avoiding
the  topic, a better comment would be to say that it is possible to
make windows just as secure as any other system.  Knowledge on
security differs greatly depending on what system your running.




Curt

Like we're going to listen to you on anything security releated. ;)

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
* Thus wrote Minuk Choi:
> I've a Redhat9 and installed MySQL 4.0 from source and Apache 1.3 from source.

>From my expirence, at this  point you probably have 2 versions of
mysql and 2 versions of apache on your system.

Your new versions, depending on how you compile them will default
to the paths of:

  /usr/local/mysql/
  /usr/local/apache/

The default installations will be spread accross:
  /etc/*
  /usr/include/*
  /usr/lib/*
  ...

> I also downloaded the PHP5.0.2 source and attempted to compile it.
> 
> Apache and MySQL are installed successfully, as they all work without any noticeable 
> errors.
> 
> 
> This is how I configured PHP5
> 
> ./configure --prefix=/PHP5 --with-mysql=<mysql path> 

what exactly is that mysql path you issue?

> 
> when I ran "make", I got an error.  It was regarding one of the functions, make 
> tried to compile mysql_create_db and mysql_drop_db(functions that are no longer 
> provided by the MySQL4.0 client).

If this is the case then the configuration of php picked up the
headers for the  old version of mysql, but the libraries that php
tried to use where mysql4. Causing the errors. If you provide the
exact errors you got when compiling, it might be insightful.

> 
> When I checked the source code(the c and h files), there was this line,
> 
> #if MYSQL_VERSION_ID < 40000
> 
> which was enclosed in the declaration of the function prototypes
> 
> PHP_FUNCTION(mysql_create_db)
> PHP_FUNCTION(mysql_drop_db)
> 
> in php_mysql.h
> 
> and also around the implemention of the functions
> 
> PHP_FUNCTION(mysql_create_db)
> PHP_FUNCTION(mysql_drop_db)
> 
> in php_mysql.c

This is correct behaviour.

> 
> The problem I seem to have is that MYSQL_VERSION_ID is never defined?  Perhaps this 
> is due to the fact that I compiled MySQL 4.0 from source and may have skipped a 
> step... but where is MYSQL_VERSION_ID supposed to be defined or retrieved?  
> 
> typing 
> 
> echo $MYSQL_VERSION_ID
> 
> in bash got me a blank line.

the #if MYSQL_VERSION_ID is not defined in your environment but in
the header file of mysql_version.h

if at your shell prompt you type:
  locate mysql_version.h

You should get a minimum of 2 or possibly 3 files resulted:
  /path/to/php/src/ext/mysql/libmysql/mysql_version.h
  /usr/local/mysql/include/mysql_version.h
  /usr/include/mysql_version.h

That is where MYSQL_VERSION_ID is defined.

> 
> I managed to comment out those functions in the header and the c files and "make" 
> and "make install" ran flawlessly.

This may work, but dont expect mysql_thread_id() to work and you
might run into other side effects depending on what version php is
thinking mysql is.

> 
> Could this be a bug?

Doesn't look like it.


Curt
-- 
The above comments may offend you. flame at will.

--- End Message ---
--- Begin Message --- I wouldn't be too surprised if that is the case. I tried my best to remove the rpm installations and as for the compilation options, I believe I specified them correctly, since I got them to install insto the directories I specified.

The more important question to me is how PHP5 gets the value for MYSQL_VERSION_ID, though.


----- Original Message ----- From: "Curt Zirzow" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, October 09, 2004 2:46 AM
Subject: Re: [PHP] MYSQL_VERSION_ID?



* Thus wrote Minuk Choi:
I've a Redhat9 and installed MySQL 4.0 from source and Apache 1.3 from source.

From my expirence, at this point you probably have 2 versions of mysql and 2 versions of apache on your system.

Your new versions, depending on how you compile them will default
to the paths of:

 /usr/local/mysql/
 /usr/local/apache/

The default installations will be spread accross:
 /etc/*
 /usr/include/*
 /usr/lib/*
 ...

I also downloaded the PHP5.0.2 source and attempted to compile it.

Apache and MySQL are installed successfully, as they all work without any noticeable errors.


This is how I configured PHP5

./configure --prefix=/PHP5 --with-mysql=<mysql path>

what exactly is that mysql path you issue?


when I ran "make", I got an error. It was regarding one of the functions, make tried to compile mysql_create_db and mysql_drop_db(functions that are no longer provided by the MySQL4.0 client).

If this is the case then the configuration of php picked up the headers for the old version of mysql, but the libraries that php tried to use where mysql4. Causing the errors. If you provide the exact errors you got when compiling, it might be insightful.


When I checked the source code(the c and h files), there was this line,

#if MYSQL_VERSION_ID < 40000

which was enclosed in the declaration of the function prototypes

PHP_FUNCTION(mysql_create_db)
PHP_FUNCTION(mysql_drop_db)

in php_mysql.h

and also around the implemention of the functions

PHP_FUNCTION(mysql_create_db)
PHP_FUNCTION(mysql_drop_db)

in php_mysql.c

This is correct behaviour.


The problem I seem to have is that MYSQL_VERSION_ID is never defined? Perhaps this is due to the fact that I compiled MySQL 4.0 from source and may have skipped a step... but where is MYSQL_VERSION_ID supposed to be defined or retrieved?


typing

echo $MYSQL_VERSION_ID

in bash got me a blank line.

the #if MYSQL_VERSION_ID is not defined in your environment but in the header file of mysql_version.h

if at your shell prompt you type:
 locate mysql_version.h

You should get a minimum of 2 or possibly 3 files resulted:
 /path/to/php/src/ext/mysql/libmysql/mysql_version.h
 /usr/local/mysql/include/mysql_version.h
 /usr/include/mysql_version.h

That is where MYSQL_VERSION_ID is defined.


I managed to comment out those functions in the header and the c files and "make" and "make install" ran flawlessly.

This may work, but dont expect mysql_thread_id() to work and you might run into other side effects depending on what version php is thinking mysql is.


Could this be a bug?

Doesn't look like it.


Curt -- The above comments may offend you. flame at will.

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


--- End Message ---
--- Begin Message ---
* Thus wrote Paulo JF Silva:
> Hi,
> 
> I have PHP 4.3.5 and safe mode on. When I create a new image with 
> imagecreatefromjpeg(), the image owner is 'httpd' and not my ftp user. 
> [this is in a shared host].
> 
> I would like to know if there is any way to create the image with my 
> user... I can workaround mkdir & stuff with ftp access but i can't 
> figure out a workaround this 'problem' caused by safe mode.

You'll have to request to the hosting company to make it possible
that your ftp user can have 'rwx' permissions  to the files that
the webserver creates.

The security implications will have to be up to them.


Curt
-- 
The above comments may offend you. flame at will.

--- End Message ---
--- Begin Message ---
Hi List,

Is there a GUI tool that can help make relationships between MySQL tables ?

I saw a tool somewhere that you dragged the relevant table into a kind of
workspace and selected what rows you wanted and it made the necessary sql
for select.

I also saw somewhere a tool that made it easy to make forms for php from
MySql tables  but I cant locate a good one anywhere

Any pointers / urls will be most appreciated.

Sorry if this is OT.

Dave C


-- 
UK Web Hosting @ http://www.ephgroup.com  

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.775 / Virus Database: 522 - Release Date: 08/10/2004
 

--- End Message ---
--- Begin Message --- Dave Carrera wrote:
Hi List,

Is there a GUI tool that can help make relationships between MySQL tables ?

I saw a tool somewhere that you dragged the relevant table into a kind of
workspace and selected what rows you wanted and it made the necessary sql
for select.

I also saw somewhere a tool that made it easy to make forms for php from
MySql tables  but I cant locate a good one anywhere

Any pointers / urls will be most appreciated.

Sorry if this is OT.

Dave C


phpmyadmin can
--- End Message ---
--- Begin Message ---
Am Sa, den 09.10.2004 schrieb Dave Carrera um 8:46:
> Hi List,
> 
> Is there a GUI tool that can help make relationships between MySQL tables ?
> 

Look at: http://www.fabforce.net/dbdesigner4/
-- 
Martin Rozmus <[EMAIL PROTECTED]>

--- End Message ---
--- Begin Message ---
I have been using and experimenting with PHP 5's reflection API and
have ran into a wall.  I am trying to access static variables through
reflection but it seems as though they cannot be set.  The following
is some code that reproduces the problem.  Thanks to anyone that has
insight into my problem.

class ReflectionTest {
        public static $x=5;
}

$refl = new ReflectionClass('ReflectionTest');
$prop = $refl->getProperty('x');
//$prop->getValue(NULL); not valid!  need object
$obj = $refl->newInstance();
echo $prop->getValue($obj);

$prop->setValue($obj,8);//Won't work!  Static variables can't be set!
echo $prop->getValue($obj); 

Output:
5
Fatal error: Uncaught exception 'ReflectionException' with message
'Cannot access non-public member' in C:\Program
Files\eclipse\workspace\PHPFlux\test.php:13 Stack trace: #0 {main}
thrown in C:\Program Files\eclipse\workspace\PHPFlux\test.php on line
13

Thank you,

Ben Dischinger

--- End Message ---
--- Begin Message ---
Matthew Sims wrote:

Nice idea, but you want to be "future-proof", don't you?

Once alt.binaries.vr.animals.lobster starts filling up with 5 hour
Virtual Reality ROMs you're looking at needing a lot more than that. I'd
go with about 6 YB if I were you, and that's only because there aren't
any SI prefixes higher than Yotta (10^24).

Yeah, that Super Turbo Lobster Fighter Alpha EX2 Special is freakin' huge.


Mmmm. I wasn't actually talking about games, but I guess you could use it for that too.
--- End Message ---
--- Begin Message ---
As Marek has stated a number of times, the session options in php.ini
are meant to be set to reasonable values for the usage pattern for your
server, in order that you can achieve a balance between a /tmp or
/var/tmp of several zillion kilobytes, and a constant 100% cpu usage as
the gc routine runs again and again.

That's all it is. If you wish to time out your sessions for security
purposes, you need to handle that security in your application. Security
is the responsibility of the developer, and should always remain that
way. Anything else is leaving you open to trouble.

To restate, the session.gc_maxlifetime defines how long the session must
have been inactive in order for it to be SAFE to be gc'ed. That's why
it's session.*GC*_maxlifetime and not session.security_maxlifetime. The
setting has no bearing on when a session MUST be gc'ed. That is up to
the developer to deal with - hell, with session.gc_divisor = 0, you can
have session files which are never deleted if you desire - that doesn't
mean your users should never be logged out, now does it?

Hope this clears things up a little.

Cheers

Chris
--- End Message ---
--- Begin Message ---
<pedantry>

Of course, you're running unserialize() twice.

What about

if (empty($_COOKIE['bookmarks']) || !($bookmarks = unserialize($_COOKIE['bookmarks'])))
{
$bookmarks = array();
}


Does the same with only one call to a potentially weighty function.

</pedantry>

Cheers

Chris

John Nichel wrote:

Brian Dunning wrote:

I've got a cookie that's either non-existent or a serialized array. I'm trying all sorts of different code combinations to retrieve it into an array variable, but everything I try throws up some combination of notices and/or warnings. Here is my latest & greatest:

$cookie = $_COOKIE['bookmarks'];
if(unserialize($cookie) == true) {
    $bookmarks = unserialize($cookie);
} else {
    $bookmarks = array();
}


Use isset

if ( isset ( $_COOKIE['bookmarks'] ) && unserialize ( $_COOKIE['bookmarks'] ) ) {
$bookmarks = unserialize ( $_COOKIE['bookmarks'] );
} else {
$bookmarks = array();
}



--- End Message ---
--- Begin Message ---
<pedantry>

Of course, you're running unserialize() twice.

What about

if (empty($_COOKIE['bookmarks']) || !($bookmarks = unserialize($_COOKIE['bookmarks'])))
{
$bookmarks = array();
}


Does the same with only one call to a potentially weighty function.

</pedantry>

Cheers

Chris

John Nichel wrote:

Brian Dunning wrote:

I've got a cookie that's either non-existent or a serialized array. I'm trying all sorts of different code combinations to retrieve it into an array variable, but everything I try throws up some combination of notices and/or warnings. Here is my latest & greatest:

$cookie = $_COOKIE['bookmarks'];
if(unserialize($cookie) == true) {
    $bookmarks = unserialize($cookie);
} else {
    $bookmarks = array();
}


Use isset

if ( isset ( $_COOKIE['bookmarks'] ) && unserialize ( $_COOKIE['bookmarks'] ) ) {
$bookmarks = unserialize ( $_COOKIE['bookmarks'] );
} else {
$bookmarks = array();
}



--- End Message ---
--- Begin Message ---
From the manual:

http://uk.php.net/manual/en/language.pseudo-types.php#language.types.callback

If you want to change things in the callback, the function (or method) should accept its parameters by reference.

e.g.

class A
{
 function name(&$a, $b, $c)
 {
   $a = $b . $c;
   return;
 }

 function parse()
 {
   // whatever
   // then (calls $this->name())
   $parser->set_handler( "root/page/title", array($this, 'name') );
   // or (calls A::name())
   $parser->set_handler( "root/page/title", array('A', 'name') );
   // more whatever
 }

}

Hope this helps

Cheers

Chris

Thomas Hochstetter wrote:

Hi again,

I have always been wondering how this is done properly:

Here is an example:

[snip]
class A {
  function name( $a, $b, $c) {
     $tmp = array();
     $tmp[a] = $a;
     .
    array_push( $GLOBALS['XMLStack'], $tmp );
 }

 function parse() {
   .. some definitions .
   $parser->set_handler( "root/page/title", "name" );
  . some more stuff here .
 }
}
[/snip]

What I want is to have the callback function name as it is in the above
example. But, obviously, the above code won't work. So, how do I tell the
set_handler function that it must use the name function from the class?
Using:
"A::name" or "$this->name" (if instantiated) . how do these callback
function calls work, because the same issue is with the xml handler
functions in php4 (have not as yet been to v5).

Also, how can I get the data from the callback function out without using
$GLOBALS? I cannot just return an array, can I?

Any ideas.

Thanks so  long.

Thomas



--- End Message ---
--- Begin Message ---
Hi guys....

I'm implementing mass mailing program...as there are hundred's of users that receive 
mails...as a result i'm getting this error...

Fatal error: Maximum execution time of 30 seconds exceeded in 
d:\phpsites\ac\asc\acendo on line 42

Help meeeeeee!

regards,
ss





--- End Message ---
--- Begin Message ---
> I'm implementing mass mailing program...as there are hundred's of users that receive 
> mails...as a result i'm getting this error...
> 
> Fatal error: Maximum execution time of 30 seconds exceeded in 
> d:\phpsites\ac\asc\acendo on line 42

take a look at 

http://us4.php.net/manual/en/ref.info.php#ini.max-execution-time

you need to bump it up

--- End Message ---
--- Begin Message ---
On Sat, 9 Oct 2004 16:41:28 +0530, suneel <[EMAIL PROTECTED]> wrote:
> I'm implementing mass mailing program...as there are hundred's of users that receive 
> mails...as a result i'm getting this error...
> 
> Fatal error: Maximum execution time of 30 seconds exceeded in 
> d:\phpsites\ac\asc\acendo on line 42

This was just discussed in great detail like 2 or 3 days ago.  Did you
try searching the mailing list archives?

http://marc.theaimsgroup.com/?l=php-general


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

--- End Message ---
--- Begin Message ---
I'm writing form using PHP and HTML. The form is submited only if user
clicks on submit button. However, it's not possible to submit form
when I press "enter".  Is it possible to submit form pressing on
enter? If so how?

TH

--- End Message ---
--- Begin Message ---
On Sat, 9 Oct 2004 08:41:38 -0400, php mysql <[EMAIL PROTECTED]> wrote:
> I'm writing form using PHP and HTML. The form is submited only if user
> clicks on submit button. However, it's not possible to submit form
> when I press "enter".  Is it possible to submit form pressing on
> enter? If so how?

You can submit the form with pressing enter if the field you are
focusing on when you press enter is inside your <form> tags.  The
thing then is that on the parsing side you must actually test for that
field of the $_POST array, like so:

<?php
if(isset($_POST['my_text_field']) || isset($_POST['submit'])){
  // do whatever
}
?>

<form method="post" action="index.php">
<input type="text" name="my_text_field">
<input type="submit" name="sumit" value="Submit">
</form>


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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

I am trying to create an outlook style day view calendar. I loop through the 
hours in the day (00:00 - 23:00) and compare it to a diary table for the 
user. If the users 1st appointment isnt until 10:00 then the hours print out 
until that appointment then continue looking for the next appointment.

However if the user has no appointments in the day then the table layout 
doesnt work because of this line:

<?php if (date("H:i", strtotime(@mysql_result($qid, $i, 
Booking_Start_Date))) == $hours[$x].':'.$minutes[$y]){ ?>

With no entries for that day this results in the following:

date("H:i", strtotime(@mysql_result($qid, $i, Booking_Start_Date))) = 00:00
$hours[$x].':'.$minutes[$y] = 00:00

My question is therefore how can i get this line ' date("H:i", 
strtotime(@mysql_result($qid, $i, Booking_Start_Date))) ' to output nothing 
if there is no entry in the database?

Thanks for your help 

--- End Message ---
--- Begin Message ---
On Sat, 9 Oct 2004 14:51:01 +0100, Shaun <[EMAIL PROTECTED]> wrote:
> I am trying to create an outlook style day view calendar. I loop through the
> hours in the day (00:00 - 23:00) and compare it to a diary table for the
> user. If the users 1st appointment isnt until 10:00 then the hours print out
> until that appointment then continue looking for the next appointment.
> 
> However if the user has no appointments in the day then the table layout
> doesnt work because of this line:
> 
> <?php if (date("H:i", strtotime(@mysql_result($qid, $i,
> Booking_Start_Date))) == $hours[$x].':'.$minutes[$y]){ ?>
> 
> With no entries for that day this results in the following:
> 
> date("H:i", strtotime(@mysql_result($qid, $i, Booking_Start_Date))) = 00:00
> $hours[$x].':'.$minutes[$y] = 00:00
> 
> My question is therefore how can i get this line ' date("H:i",
> strtotime(@mysql_result($qid, $i, Booking_Start_Date))) ' to output nothing
> if there is no entry in the database?

Wrap it with:

if(mysql_num_rows($qid)){

}


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

--- End Message ---
--- Begin Message ---
On Tuesday 05 October 2004 06:20, Whil Hentzen wrote:

> I cut this directly out of the online manual and put it into my PHP page.
> If I've got a typo, then there's an error in the manual.
>
> I also cut the entire PHP page into my email. Nothing missing or hidden.
>
> I'm stumped.
>
> I retyped everything in.... changed all the names... now it works. Looks
> like there are hidden chars in the html that I cut out from the online
> manual.
>
> "That's weird".

Cut and paste from some browsers could lead to the inclusion of 'hidden' 
characters in your code (usually the TAB character).

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
The least useful horse in your barn will eat the most, require shoes every 
four weeks and need the vet at least once a month
                -- Murphy's Horse Laws n4
*/

--- End Message ---
--- Begin Message --- Hi -

I am trying to extend a built in class, but cannot seem to get my
subclass methods called.

class movObj extends SWFMovie {
function init() {
echo("init");
}
}

$m = new movObj();
$m->init();

Gives:::
Fatal error: Call to undefined method SWFMovie::init() ...

This method call i would have hoped would pass up to the baseclass.

But if I add a constructor to my own subclass, the init method can be
called. BUT i can now not call any of the SWFMovie methods. Like, it
is not really extending the built in class, or there is no hierarchy.

I messed with various versiosn of trying to call the super myself:

parent::method
$this->parent->method()

without much success.

Is this a limitation of phps classes? We cannot subclass built in types
(perhaps they were built/not compatible with php5 object model)?

thanks!

--- End Message ---
--- Begin Message ---
Dc wrote:
> Hi -
> 
> I am trying to extend a built in class, but cannot seem to get my
> subclass methods called.
> 
> class movObj extends SWFMovie {
>     function init() {
>        echo("init");
>     }
> }
> 
> $m = new movObj();
> $m->init();
> 
> Gives:::
> Fatal error: Call to undefined method SWFMovie::init() ...
> 
> This method call i would have hoped would pass up to the baseclass.
> 
> But if I add a constructor to my own subclass, the init method can be
> called. BUT i can now not call any of the SWFMovie methods. Like, it
> is not really extending the built in class, or there is no hierarchy.
> 
> I messed with various versiosn of trying to call the super myself:
> 
>    parent::method
>    $this->parent->method()
> 
> without much success.
> 
> Is this a limitation of phps classes? We cannot subclass built in types
> (perhaps they were built/not compatible with php5 object model)?
> 
> thanks!
> 
are you using php 4 or 5?

--- End Message ---
--- Begin Message ---
how can i find out in PHP which version of GD is installed. I tried checking 
for function-existence of imagecreatetruecolor and imagecopyresampled, but 
these functions exist in older GD versions, but aren't implemented.
I want to know if I can use the functions imagecreatetruecolor() and 
imagecopyresampled() ? 

--- End Message ---
--- Begin Message ---
Gerben wrote:

how can i find out in PHP which version of GD is installed. I tried checking for function-existence of imagecreatetruecolor and imagecopyresampled, but these functions exist in older GD versions, but aren't implemented.
I want to know if I can use the functions imagecreatetruecolor() and imagecopyresampled() ?



gd_info()

--- End Message ---

Reply via email to