Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

when will php support alias name?

 
   Database Forums (Home) -> PHP RSS
Next:  Installing PrinceXML on a windows machine  
Author Message
Yarco

External


Since: Jul 07, 2007
Posts: 3



(Msg. 1) Posted: Tue Jul 24, 2007 5:56 am
Post subject: when will php support alias name?
Archived from groups: comp>lang>php (more info?)

When using c++, we could do:
using abc = xxx.yyy; // am i right?

When using python we could do:
import abc.efg as efg

When will php support:

class My_Best_Class
{
}
define('MyClass', 'My_Best_Class');
$o = new MyClass; // use MyClass as aliasname of My_Best_Class?

It is very useful to me.
Or do you have any good ideas to do such name alias?

 >> Stay informed about: when will php support alias name? 
Back to top
Login to vote
Yarco

External


Since: Jul 07, 2007
Posts: 3



(Msg. 2) Posted: Tue Jul 24, 2007 9:26 am
Post subject: Re: when will php support alias name? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hey, friend. Do you know any good websites/forumns related to php6?
News and details.

On Jul 24, 4:46 pm, gosha bine wrote:
> On 24.07.2007 10:36 Yarco wrote:
>
>
>
> > When using c++, we could do:
> > using abc = xxx.yyy; // am i right?
>
> > When using python we could do:
> > import abc.efg as efg
>
> > When will php support:
>
> > class My_Best_Class
> > {
> > }
> > define('MyClass', 'My_Best_Class');
> > $o = new MyClass; // use MyClass as aliasname of My_Best_Class?
>
> > It is very useful to me.
> > Or do you have any good ideas to do such name alias?
>
> Yes. Wait till php6 comes out. Wink
>
> --
> gosha bine
>
> makrell ~http://www.tagarga.com/blok/makrell
> php done right ;)http://code.google.com/p/pihipi

 >> Stay informed about: when will php support alias name? 
Back to top
Login to vote
gosha bine

External


Since: Apr 19, 2007
Posts: 27



(Msg. 3) Posted: Tue Jul 24, 2007 10:46 am
Post subject: Re: when will php support alias name? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 24.07.2007 10:36 Yarco wrote:
> When using c++, we could do:
> using abc = xxx.yyy; // am i right?
>
> When using python we could do:
> import abc.efg as efg
>
> When will php support:
>
> class My_Best_Class
> {
> }
> define('MyClass', 'My_Best_Class');
> $o = new MyClass; // use MyClass as aliasname of My_Best_Class?
>
> It is very useful to me.
> Or do you have any good ideas to do such name alias?
>

Yes. Wait till php6 comes out. Wink


--
gosha bine

makrell ~ http://www.tagarga.com/blok/makrell
php done right Wink http://code.google.com/p/pihipi
 >> Stay informed about: when will php support alias name? 
Back to top
Login to vote
ZeldorBlat

External


Since: Jun 11, 2007
Posts: 37



(Msg. 4) Posted: Tue Jul 24, 2007 12:58 pm
Post subject: Re: when will php support alias name? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Jul 24, 4:36 am, Yarco wrote:
> When using c++, we could do:
> using abc = xxx.yyy; // am i right?
>
> When using python we could do:
> import abc.efg as efg
>
> When will php support:
>
> class My_Best_Class
> {}
>
> define('MyClass', 'My_Best_Class');
> $o = new MyClass; // use MyClass as aliasname of My_Best_Class?
>
> It is very useful to me.
> Or do you have any good ideas to do such name alias?

It sounds like you want the ability to change which class you use for
something by just changing it in one place. So, you might have
something like this:

define('DatabaseConnection', 'MySQLDatabaseConnection');

which could then later be easily changed to:

define('DatabaseConnection', 'OracleDatabaseConnection');

Without modifying the rest of your code. Is that what you're trying
to achieve? If so you should use the factory pattern:

class DatabaseConnection {

public static function factory() {
return new MySQLDatabaseConnection();
}
}

class MySQLDatabaseConnection extends DatabaseConnection {

....

}

etc.
 >> Stay informed about: when will php support alias name? 
Back to top
Login to vote
Yarco

External


Since: Jul 07, 2007
Posts: 3



(Msg. 5) Posted: Wed Jul 25, 2007 3:04 am
Post subject: Re: when will php support alias name? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I find one:
http://oss.backendmedia.com/PhP60

On Jul 24, 5:26 pm, Yarco wrote:
> Hey, friend. Do you know any good websites/forumns related to php6?
> News and details.
>
> On Jul 24, 4:46 pm, gosha bine wrote:
>
> > On 24.07.2007 10:36 Yarco wrote:
>
> > > When using c++, we could do:
> > > using abc = xxx.yyy; // am i right?
>
> > > When using python we could do:
> > > import abc.efg as efg
>
> > > When will php support:
>
> > > class My_Best_Class
> > > {
> > > }
> > > define('MyClass', 'My_Best_Class');
> > > $o = new MyClass; // use MyClass as aliasname of My_Best_Class?
>
> > > It is very useful to me.
> > > Or do you have any good ideas to do such name alias?
>
> > Yes. Wait till php6 comes out. Wink
>
> > --
> > gosha bine
>
> > makrell ~http://www.tagarga.com/blok/makrell
> > php done right ;)http://code.google.com/p/pihipi
 >> Stay informed about: when will php support alias name? 
Back to top
Login to vote
Willem Bogaerts

External


Since: Oct 25, 2006
Posts: 18



(Msg. 6) Posted: Wed Jul 25, 2007 9:20 am
Post subject: Re: when will php support alias name? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> When will php support:
>
> class My_Best_Class
> {
> }
> define('MyClass', 'My_Best_Class');
> $o = new MyClass; // use MyClass as aliasname of My_Best_Class?

Never, I hope. If you cannot even trust your identifiers, all hope of
maintaining code is gone forever.

Especially the example is stunning. This has nothing to do with object
orientation. If you do this the object-oriented way, you can use
factories, interfaces and subclasses.
Off course, a factory is a method (or a function), so you can SEE that
it is defined elsewhere. And you can even pass it parameters.

Best regards,
--
Willem Bogaerts

Application smith
Kratz B.V.
http://www.kratz.nl/
 >> Stay informed about: when will php support alias name? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Problem with jpg support in gd... - I've a problem using gd to generate jpegs...i did gd_info and found that it's not enabled: { ["GD Version"]=> string(27) "bundled (2.0.28 compatible)" ["FreeType Support"]=> bool(false) ["T1Lib Support"]=&...

Tokenizer Support -

MySQL timezone support - setting from PHP - I am using the MySQL date and time functions and they save a lot of my time. But the server is located in a time zone 2 hours away. I read in the SQL docs how to set the timezone on a per-connection basis, but how would I do that from PHP ? bill

json and special chars - Hi! In my DB table I've chars like עטלש but when I generate json file I show \u00e0\u00f2\u00e8\u00ec\u00f9 is it right this change in my char? Thanks

Simple question?? PHP..ODBC..and...dBASE - Ok this may be a dumb question to some but for the first time this evening I have to access dBASE file through ODBC.. I'm trying to do simple queries of SELECT * FROM ??? however I can't for the life of me figure out what to put in place of the ???. Any....
   Database Forums (Home) -> PHP All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]