Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Classes and dependenices
Old 04-23-2010, 08:12 PM Classes and dependenices
Experienced Talker

Posts: 44
Trades: 0
I'm writing my own PHP framework with typehandler, image methods, paypal, sql etc etc.. But can I prevent other scripts from initialize those subclasses? Only Framework.php should be able to be initialized.

The only solution I can think of is extend and abstract:

Image is abstract
SQL is abstract
Framework extends Image and SQL

but that would require a lot classes to be extended everytime you load Framework.
Onkel E is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-23-2010, 09:04 PM Re: Classes and dependenices
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
Can you be a bit more clear about what you are trying to do?

PHP does not support multiple inheritance of abstract classes so having framework extend image and sql isn't even possible. A class can implement multiple interfaces however.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Reply     « Reply to Classes and dependenices
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.17793 seconds with 12 queries