[PHP] Constant Scope

2006-02-26 Thread Adrian Cid Almaguer
Can I give visibility to a class constan.

some thing like this

class foo
{

}

--
***
   Si se encuentra bien, no se preocupe. Se le pasarĂ¡.


[PHP] Constant Scope

2006-02-26 Thread Adrian Cid Almaguer
Can I give visibility to a class constant.

something like this

class foo
{
  private const = aaa;
  protected const = bbb;
  public const = ccc;
}

I dont want the user of my class can access to the constant.
and I cant use public static fields because I dont want the content can be
modified even inside the class.


Re: [PHP] Computer name?

2005-08-26 Thread Adrian Cid Almaguer
You can find the IP and find with it the name.

On 25/08/05, Chris Shiflett [EMAIL PROTECTED] wrote:
 Gustav Wiberg wrote:
  Is it possible to retrieve (view) the computers name from the client in
  PHP?
 
 If you mean the client, then no - this is not a standard part of an HTTP
 request.
 
 Chris
 
 --
 Chris Shiflett
 Brain Bulb, The PHP Consultancy
 http://brainbulb.com/
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
***
   Si se encuentra bien, no se preocupe. Se le pasarĂ¡.

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



[PHP] Call to Static Method PHP5

2005-08-19 Thread Adrian Cid Almaguer
Hi:

I had the fallowing trouble while using a static method call on php5. Here's 
my solution, i will really apreciate if anyone else can find another way 
around..

The problem:

I have a fuction wich get a parameter that's an objetc, and that objetc 
belongs to a class wich has a static method ( several class's may have the 
same method, that's the reason for i never know for sure wich class the 
objetc belongs to...) it has to be call inside the fuction... the solution i 
found was:

?
class Class1 {
static function do_static() { echo 'ok'; }
}

function use_static($object1) {
$class1 = get_class($object1);
$method = new ReflectionMethod($class1, 'do_static');
$method-invoke(null);
// First, I thinks do that
// $class1 = get_class($object1);
// $class1::do_static;
// But, I recieve an error

}

$object1 = new Class1;
use_static($object1);

?

gretings

Adrian