[PHP] accessing a property the static way

2002-09-12 Thread Wolfram Kriesing

how can i access a property statically (without creating an object)?
is that possible at all?

i.e.

class foo
{
   var $prop = array('some','defines','are','here');
}

$myVar = foo::prop;
   OR
$myVar = foo::prop[0];

how can this be realized?
can someone help? is that possible with php?

-- 
Wolfram

... translating template engine 
   http://sf.net/projects/simpletpl

... authentication system 
   http://sf.net/projects/auth


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




[PHP] using HTTP-PUT-Method problem

2002-06-09 Thread Wolfram Kriesing

does someone have an example of a _working_ PUT-script?
i was trying $PHP_PUT_FILENAME and even trying to dump all the GLOBALS
but i couldnt find a filename which points to the PUT'-filename
how does it work? obviously not as it is in the manual :-(
copy(  $PHP_PUT_FILENAME , $PATH_TRANSLATED );
$PHP_PUT_FILENAME is always empty.
i am using the amaya to PUT, apache 1.3.19 and php 4.2.1

any ideas?

-- 
Wolfram

 ... translating template system ...
http://sourceforge.net/projects/simpletpl

... authentication system 
  http://sf.net/projects/auth




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




Re: [PHP] Tellwhich browser

2002-05-16 Thread Wolfram Kriesing

Justin French wrote:

>A simple looks around at phpbuilder.com will result in an article on browser
>detection & CSS... the browser detection function he writes can be used for
>many things, including what you want.
>
>Justin French
>
>
>on 16/05/02 12:09 AM, Diana Castillo ([EMAIL PROTECTED])
>wrote:
>
>  
>
>>What is the code to tell whether the user is on IE or Netscape?
>>
>>
checkout PEAR::Net_UserAgent
get it from pear.php.net
or cvs.php.net/cvs.php/pear

-- 
Wolfram

... translating template engine 
  http://sf.net/projects/simpletpl

... authentication system 
  http://sf.net/projects/auth




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




Re: [PHP] session variables

2002-04-04 Thread Wolfram Kriesing

On Thursday 04 April 2002 19:15, Lee, Ford wrote:
> I seem to have configuration problemsi just can't seem to get
> session variables written to in files under win2000, NTFS w/ Apache and
> PHP..i've already done everything from session_start() on every page
> to making var globalanybody can help??  thanksbtw, i got the
> same system on a Linux box running apache and php and it works fine

this is a bug in PHP 4.1.2 on win
   http://bugs.php.net/?id=16423
i am also looking for a workaround  :-(
-- 
Wolfram

... translating template engine 
  http://sf.net/projects/simpletpl

... authentication system 
  http://sf.net/projects/auth

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




Re: [PHP] Re: preventing "back" button usage?

2002-04-02 Thread Wolfram Kriesing

On Tuesday 02 April 2002 16:59, Erik Price wrote:
> On Thursday, March 28, 2002, at 06:50  PM, Michael Virnstein wrote:
> > This is not possible. You cannot force the browser
> > not to go back in its history, don't even trie to find a solution for
> > this...
> > the question you should ask yourself is not how to disable the browser
> > history
> > but how you can prevent your page by getting screwed by multiple posts.
>
> I see.  Then, when I try to do something similar to this on FedEx.com or
> Amazon.com, is it JavaScript that redirects me to an error page?  If so
> then I will have to use both tactics -- preventing a form from being
> resubmit, and JavaScript to "disable" the back button (unethical as it
> may be).

i dont know if this really would solve your problem, but what i am using 
sometimes is:
if( $save_data )
{
$id = save( $_REQUEST['data'] );
if( $id != false ) // is it a valid id?
{
header('Location:'.$_SERVER['PHP_SELF'].'?id='.$id );
die();
}
}
explaination: what it does is saving the $_REQUEST['data'] and on success, it 
reloads the same page again but without the posted data to show exactly the 
data that had been saved i use the $id returned by the 'save'-method, which 
is the id of the data set that was saved

so reload or back buttons wont disturb
on reload, simply the same page with the GET-param is reloaded
and back button goes to the page before, since it seems the 
"header"-redirection is not saved in the history

this only works for special cases:
- if you load the same page again, and want to show the entered data, it has 
to be the same page for showing and editing the data
- showing data also has to work using $_GET-parameters, as this is what the 
"header" function does

drawbacks are:
- only useful in some special cases
- browser gets contacted once more, than actually necessary ('header')


-- 
Wolfram

... translating template engine 
  http://sf.net/projects/simpletpl

... authentication system 
  http://sf.net/projects/auth

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




Re: [PHP] help please - strange session behaviour on IIS with php4.1.2

2002-04-02 Thread Wolfram Kriesing

On Tuesday 02 April 2002 15:34, Stephen Phillips wrote:
> Hi,
> It sounds like you are experiencing a similar problem to one I had.  It
> seems there are some problems with setting cookies when using IIS, and as I
> understand it one of the ways that sessions work is by storing the data in
> a cookie on the clients machine.  On the page at www.php.net it suggests
> appending the session id to the url, go here to look at that
> http://www.php.net/manual/en/ref.session.php,

i can definitely say, that the session-ID is always appended on the links etc.
session.use_trans_sid is on, so all links etc. are extended by the SID 
automatically, so it should not be the problem with the cookies :-(

any other suggestions?

-- 
Wolfram

... translating template engine 
  http://sf.net/projects/simpletpl

... authentication system 
  http://sf.net/projects/auth

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




[PHP] help please - strange session behaviour on IIS with php4.1.2

2002-04-02 Thread Wolfram Kriesing

i've written a simple script, which tests the session behaviour on the IIS,
since it didnt seem to work
the following script should increase the session-var $testVar and display it
but it always stays at the same value
can someone explain that? is that a bug?

also if i would increase $_SESSION['testVar'] it doesnt work.

i have been looking at the server and the session-file is also updated, but
not with the new values, only the timestamp is updated, it seems

session_start();
// make the session variable globally available
// we have register_globals = Off
$testVar = &$_SESSION['testVar'];

// init testVar to 1 or increase it
if( !isset($testVar) )
{
print 'set testVar to 1';
$testVar = 1;
}
else
{
print 'increase';
$testVar++;
}

// i can put session_register before
// or after the 'if' it always happens the same
session_register('testVar');

print $testVar;


the environment:
- IIS-Server5.0, WIN2k
- PHP4.1.2
- session.auto_start = 0
- register_globals = Off

i am using the recommended-php.ini, that's why register_globals is off

thanks for help
--
Wolfram

... translating template engine 
  http://sf.net/projects/simpletpl

... authentication system 
  http://sf.net/projects/auth

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




Re: [PHP] $PHP_SELF on include file

2002-03-20 Thread Wolfram Kriesing

On Wednesday 20 March 2002 10:12, José León Serna wrote:
> Hello:
> > try it with __FILE__
> > you might have to work a little on the resulting string, but it at least
> > delivers the current file's name
>
> What is __FILE__, a global var, an environment variable? Could you put a
> simple example?

print( __FILE__ );
echo __FILE__;
will show the current file name

-- 
Wolfram

... translating template engine 
  http://sf.net/projects/simpletpl

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




[PHP] rating system

2002-03-19 Thread Wolfram Kriesing

does anyone know a very flexible rating system, written in php of
course?
i have an application where i want to rate different data that the
application saves and may relate the data to each other.
I.e. a very active/known/famous/any-attribute user rates an item,
then this vote might weigh more than a vote of one who is "unknown"
by the system.
This means you might also be able to rate a user and have some
algorithm to show the result in a weighted way.
And besides it should also do things like: let every user only vote
once a day/month/hour/..., and all this common stuff.
or something like the freshmeat rating system.

thanks for the help

--
Wolfram

 ... translating template system ...
http://sourceforge.net/projects/simpletpl

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




[PHP] rating system

2002-02-09 Thread Wolfram Kriesing

does anyone know a very flexible rating system, written in php of
course?
i have an application where i want to rate different data that the
application saves and may relate the data to each other.
I.e. a very active/known/famous/any-attribute user rates an item,
then this vote might weigh more than one who is "unknown" to the
system.
This means you might also be able to rate a user and have some
algorithm to show the result in a weighed way.
And besides it should also do things like: let every user only vote
once a day/month/hour/..., and all this common stuff.

thanks for the help

--
Wolfram

 ... translating template system ...
http://freshmeat.net/projects/simpletemplateii

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




Re: [PHP] Caching in php?

2002-02-06 Thread Wolfram Kriesing

> is this possible using php? what can i do to use
> caching on my website which is totally database
> driven?

try PEAR::Cache
http://pear.php.net

-- 
Wolfram

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




Re: [PHP] Out of the box algorithms

2002-02-06 Thread Wolfram Kriesing

> users: username "username with spaces" anotherusername
>
> I need to parse that into a structure like
> $users = array(
>   'username',
>   'username with spaces',
>   'anotherusername'
> );

try preg_match
i think the expression could look something like this:

'/users:\s*(^\s+)"(.*)"\s*(.*)\n/'
this should let you get 
'username' in $1
'username with spaces' in $2 
'anotherusername' in $3

i didnt test it, but it could work :-)

-- 
Wolfram

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




Re: [PHP] Sessions and Classes

2002-02-06 Thread Wolfram Kriesing

> What is the proper way to transfer class properties through-out my
> pages...
>
> if (!session_is_registered("myCart")){
> $myCart = new ShoppingCart();
>  (some other stuffs...)
> session_register("myCart");
> }

you dont need to do this, 

> else {
> $myCart = new ShoppingCart();
> }
as far as i have experienced.
the type of the session variable is saved in the session too, so php 
automatically realizes that "myCart" is an instance of  
"ShoppingCart", you only need to be sure to have the class 
"ShoppingCart" defined before you start the session, if i remember 
right
that's at least how i do it and it works already for quite a while 
very well :-)

-- 
Wolfram

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




[PHP] SimpleTemplate, each template configurable individually

2002-01-22 Thread Wolfram Kriesing

just to announce that SimpleTemplate is also capable now of 
configuring each template individually
you either write a block like this:









in your template file or in a seperate config-file, which can be 
laying in the path to this template
this gives designers (template creators) the choice to use settings 
of their preference

this feature is realized using the Tree-class which can handle XML 
structures

have a look at
http://wolfram.kriesing.de/programming

by the way: this template can also translate your templates, without 
using a function call around every string ... have a look
examples are also avaiable at the url given above


-- 
Wolfram

-- 
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]




Re: [PHP] RE: Printing structure and data of array

2002-01-22 Thread Wolfram Kriesing

if you are using it for debugging try 
   print_r()
OR
   var_dump()


-- 
Wolfram


> function debugPrint($mVar, $bHtml) {
>  global $HTTP_REFERER;
>  if (is_array($mVar)){
>   $sTemp = "Array";
>  }
>  if (is_bool($mVar)){
>   $sTemp = "Bool";
>  }
> [snip]
> ...
>  $sFunction = "debugPrint$sTemp"; //getting the function to
> call to $sFunction($sTemp,$mVar,$bHtml); //calls the fuction
> }
>
>
> function debugPrintArray($sTemp,$mVar,$bHtml){
>  $sInfo = "type: " . $sTemp;
>  if ($bHtml){
>   echo "key=>value";
>   foreach($mVar as $sKey => $sValue) {
>$aFormData[$sKey] = $sValue;
>echo "".$sKey . " => ";
>echo "".$sValue . "";
>debugPrint($sValue,1);
>   }
>  } else {
>  $sInfo = "\ntype: " . $sTemp;
>   echo "key  --  value\n";
>   foreach($mVar as $sKey => $sValue) {
>$aFormData[$sKey] = $sValue;
>echo "\n".$sKey . " = ";
>echo $sValue;
>debugPrint($sValue,1);
>   }
>  }
> echo $sInfo;
> }
>
> function debugPrintBool($sTemp,$mVar,$bHtml){
>  if ($bHtml){
> [snip]
>
> I'm not sure, the output 100% right but it should show how to use
> it. I attached the .php file.
>
> Greets
>
> - Original Message -
> From: "Sandeep Murphy" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; "PHP List"
> <[EMAIL PROTECTED]> Sent: Tuesday, January 22, 2002 1:51 PM
> Subject: RE: [PHP] RE: Printing structure and data of array
>
> > hi,
> >
> > Thnx for the info but this is what I am using right now... It
> > prints the contents of array one below the other... is not
> > showing the format of the contents as i want...:(
> >
> > any more suggestions??
> >
> > thnx,
> > sands
> >
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: terça-feira, 22 de Janeiro de 2002 12:43
> > To: PHP List
> > Subject: Re: [PHP] RE: Printing structure and data of array
> >
> >
> > Use this:
> >
> >
> > function debugPrint($mVar, $bHtml) {
> >  if ($bHtml){
> >   echo "";
> >   print_r ($mVar);
> >   echo "";
> >  } else {
> >   print_r ($mVar);
> >  }
> > }
> >
> > call it like this:
> >
> > debugPrint($yourVariable,1);
> >
> >
> > This will print out any type (object,array,ressource,string...)
> >
> > - Original Message -
> > From: "Sandeep Murphy" <[EMAIL PROTECTED]>
> > To: "'Tim Ward'" <[EMAIL PROTECTED]>; "PHP List"
> > <[EMAIL PROTECTED]>
> > Sent: Tuesday, January 22, 2002 1:00 PM
> > Subject: RE: [PHP] RE: Printing structure and data of array
> >
> > > hi,
> > >
> > > how can I display the array exactly as it is the format
> > > specified???
>
> like
>
> > if
> >
> > > their exists sub elements of elements, how could I represent
> > > them in a multidimensional format??
> > >
> > > I went thru most of the array functions but unable to adapt any
> > > of
>
> them..
>
> > > pl help..
> > >
> > > TIA,
> > > sands
> > >
> > > -Original Message-
> > > From: Tim Ward [mailto:[EMAIL PROTECTED]]
> > > Sent: segunda-feira, 21 de Janeiro de 2002 10:24
> > > To: PHP List; Daniel Alsén
> > > Subject: [PHP] RE: Printing structure and data of array
> > >
> > >
> > > Foreach($array as $key=>$value) ech0("$key=>$value");
> > >
> > > Tim
> > > www.chessish.com 
> > >
> > > --
> > > From:  Daniel Alsén [SMTP:[EMAIL PROTECTED]]
> > > Sent:  20 January 2002 19:33
> > > To:  PHP List
> > > Subject:  Printing structure and data of array
> > >
> > > Hi,
> > >
> > > i know i have this answered before. But i can´t find that mail
> > > in the
> > > archive.
> > >
> > > How do i print an array to see both the structure and the data
> > > within?
> > > ("test" => "value", "test2" => "value2")...
> > >
> > > # Daniel Alsén| www.mindbash.com #
> > > # [EMAIL PROTECTED]  | +46 704 86 14 92 #
> > > # ICQ: 63006462   | +46 8 694 82 22  #
> > > # PGP: http://www.mindbash.com/pgp/  #
> > >
> > >
> > > --
> > > 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 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 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 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 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 PROTECTE

[PHP] Tree class that can read/write/access/... DB and XML data

2002-01-21 Thread Wolfram Kriesing

as i had announced a while ago on pear-dev that i have a tree class 
which works on DB-data, now it is more enhanced and also works on XML 
(for now it can only read but within a week or something it will also 
be able to write)

short description:
-
this class reads data from either a db or xml file saves them in an 
internal (array) structure (sounds kinda like DOM, doesnt it? i dont 
know if it is alike, havent checked the PHP-DOM yet) and you can work 
on those data
you can read navigate through the tree from ever point to any other 
since every element has references to all its "neighbours" i.e.
   $treeData [$id] ['parent'] ['next'] ['next'] ['child']
takes you to the parent's 2nd next element's child ... well just look 
at the example page where you can try it
for navigation one can use ['next'], ['previous'], ['parent'], 
['child'], ['children']  i think that's it
every element has an unique identifier, it's id, by which you can 
refer to it and get information or data or apply functions to it i.e.

   $tree->getPath( $id )

   // very useful for navigating inside XML-structures
   $id = $tree->getIdByPath( 'XMLNode / SubNode / SubSubNode' )

   // or do it relative starting at $id
   $tree->getIdByPath( 'SubNode3/SubNode4' , $id );

   $tree->hasChildren( $id )
   $tree->getChildren( $id )
    and many more

to manipulate the structure you can use methods like
'add', 'remove', 'move'   ... 'update' and 'copy' are not done yet
or even 'addNode' which can add an entire tree under a given element

i think that's mainly what it can do
it makes some stuff much easier, now tree structures are no problem 
anymore for me, as it used to be a couple months ago
AND i can read XML(-config) files and simply retreive their data 
without much action, see SimpleTemplate class for examples, it uses 
XML-files/data to configure the settings for each template if wanted

please note,
that actually the class was meant to work on a DB-tree structure, 
that's why its not optimized all the way for XML, but it works

extending the class to access nested-db-tables should be no problem 
either

all those files can be found at 
http://wolfram.kriesing.de/programming

might be useful in PEAR, i guess

-- 
Wolfram

-- 
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] compiling and *translating* template class

2002-01-15 Thread Wolfram Kriesing

a stable version of the template class
and other stuff PEAR-like-made are available at

http://wolfram.kriesing.de/programming


especially the   _template_class_   which can also *translate* your
templates without the need of wrapping every string in a function
call or something
the translation can also be used with other template engines, like
smarty i guess

see example at:
http://wolfram.kriesing.de/libs/php/examples/SimpleTemplate/fullFeatured/


--
Wolfram

-- 
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] Template class

2001-12-10 Thread Wolfram Kriesing

(just in case any of the people on PEAR-DEV will read this at all,
since everyone must be tired of the template class debates :-)  )

i just wanted to say what i had to write, because i didnt see any of
the existing template classes/engines provide me with that

the main features are:
# compiling template class which (almost) only replaces '{' by , with pre and post filters
# uses indention to create the '{' and '}' for php-code inside the
template, so clean code is a requirement and no closing tags like:
{/if} are needed
# leaves all the power of php to you, not only the functionality the
template engine implements
# nothing to learn, just use '{' and '}' instead of the php-tags in
your template and indent your code properly
# the seperation of source and representation is all up to the
programmer (either this is good or bad)
# provides some default filter


a possible template
-
{if(sizeof($disadvantages))}
{foreach($disadvantages as $aDisadvantage)}
{$aDisadvantage}
{else}
no disadvantages registered yet :-)
-

the compiled code is nothing more than this
-




no disadvantages registered yet :-)

-
so you can see - easy to use, nothing to learn and should be fast :-)

feel free to have a look at
http://wolfram.kriesing.de/programming/



PS: BTW what was the decision on a multiple classes in PEAR
which do the same thing?

--
Wolfram

-- 
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]




Re: [PHP] Saving Dynamically Generated Pages

2001-11-09 Thread Wolfram Kriesing

> I’m considering writing all the update information to a datafile
> before displaying it to the user, say through an include(); What I
> would like to do is direct the output (all my prints) to that
> report file. It seems though that I might have to go through my
> code and explicitly use fputs to accomplish this task.

have a look at "output buffering"
   http://www.php.net/manual/en/function.ob-start.php
this way you can send output you actually send to the browser save in 
a buffer and do with it whatever u want :-)

-- 
Wolfram

-- 
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] help please: exec/pasthru/system/popen problem

2001-11-09 Thread Wolfram Kriesing

i was now trying all the examples from the docs but no success yet
can someone please help?

i want to convert an image to another format i was fread-ing the one
image into
$image1
so they are binary in there
and i want to pass that to imagemagick's convert, using:
convert gif:- jpg:-
which reads from stdin and outputs the result to stdout
how can i pass the _binary_ $image1 to convert and retreive the
$convertedImage
reason, i want to insert the image as a blob and i dont want to mess
with files

thank you

--
Wolfram

-- 
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] session screw up - any experience/hints for me?

2001-09-19 Thread Wolfram Kriesing

i am saving data in the session
lets say every page relates to specific session data, like:
page 1 sets sess_x=1,
page 2 sets sess_x=2
but if i use the history.back or the browsers back-button i can go from page 
2 back to page 1 WITHOUT updating the session
so what i finally have is "page 2 where sess_x=1" and that screws up the 
logic at some point, since the session could not be updated because the page 
the user sees came from the browser cache, which didnt necessitate an 
interaction with the server, so the server "thinks" that the user sees 
another page 

how can i handle this stuff? or prevent it from happening?
or is my way of session handling weird?

thanks in advance

Wolfram

-- 
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]




Re: [PHP] Re: [PEAR] problem with a global variable as class reference

2001-09-15 Thread Wolfram Kriesing

> My answer may be not well thought but ... from my knowledge,
> problems with php-gtk you can't assign references to global vars
> because this particaular declared global variable is a local
> reference to the global var.

as you say, i guess the "local reference to the global var"
is the problem

at least i also forgot to define the "${$classNameY}" as global
if i do so then the following happens (see comments in code)

class temp
{
   function temp()
   {
     global $curClass,${"y"};
 
     $curClass = &${"y"};  # this doenst work
     $curClass = ${"y"};  # this works, but it's not a reference :-(
   }
 }
 -

$curClass = &${"x"};
$tempi = new temp();

Wolfram Kriesing

-- 
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] problem with a global variable as class reference

2001-09-15 Thread Wolfram Kriesing

i am using a global variable (curClass), 
which is a reference to some class, 
inside another class i want to change 
the value of this global variable, to
"point" or refer to another class.
but that doesnt work.
am i doing something wrong???

here my code

--
class temp
{
  function temp()
  {
    global $curClass;
    $curClass = &${$classNameY};
  }
}
-

$curClass = &${classNameX};
$tempi = new temp();
# at this point $curClass still points
# to the class with the name "classNameX"
# not to "classNameY" as i would suppose
# if i used: $curClass = $classNameY; 
# inside the class temp
# $curClass would have the expected value
# but with the "&${}" around it doenst work

thanks 4 your help

Wolfram Kriesing

-- 
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] global variables as reference

2001-09-14 Thread Wolfram Kriesing

i am using a global variable (curClass), 
which is a reference to some class, 
inside another class i want to change 
the value of this global variable, to
"point" or refer to another class.
but that doesnt work.
am i doing something wrong???

here my code

--
class temp
{
  function temp()
  {
global $curClass;
$curClass = &${$classNameY};
  }
}
-
$curClass = &${classNameX};
$tempi = new temp();
# at this point $curClass still points
# to the class with the name "classNameX"
# not to "classNameY" as i would suppose
# if i used: $curClass = $classNameY; 
# inside the class temp
# $curClass would have the expected value
# but with the "&${}" around it doenst work

thanks 4 your help

Wolfram Kriesing
___
1.000.000 DM gewinnen - kostenlos tippen - http://millionenklick.web.de
[EMAIL PROTECTED], 8MB Speicher, Verschluesselung - http://freemail.web.de



-- 
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]