Friendly class: Provide friend access to protected functions

Recommend this page to a friend!
  Info   View files (4)   Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
64%Total: 618 All time: 5,025 This week: 370
Version License PHP version Categories
friendly_class 1.0GNU Lesser Genera...5.0PHP 5, Language
Description Author

This class can be used to provide access to protected or private functions from friend classes.

It is a base class that provides alternative methods prefixed with the name friend_ .

When a function is called with that prefix, the base class calls the function with the name after the prefix, if it is considered a friend method.

Innovation Award
PHP Programming Innovation award nominee
August 2008
Number 3

Prize: One book of choice by Packt
Certain packages consist of multiple classes that are used in cooperation. Such classes usually need to access each other protected variables or functions.

In other languages there are friend classes like in C++ or package classes like in Java that allow restricting the access to variables of functions to cooperating classes.

Even with the enhancements of version 5 object model, there is no PHP support to this concept similar to C++ friend or Java package classes.

This class provides an emulation of such concept that works under PHP 5.

Manuel Lemos
Picture of Rubens Takiguti Ribeiro
Name: Rubens Takiguti Ribeiro is available for providing paid consulting. Contact Rubens Takiguti Ribeiro .
Classes: 7 packages by
Country: Brazil Brazil
Age: 36
All time rank: 63547 in Brazil Brazil
Week rank: 694 38 in Brazil Brazil
Innovation award
Innovation award
Nominee: 3x

File Role Description
friendly_class.class.php Class Main class
doc.php Doc. Documentation
example.php Example Simple example
LICENSE.TXT Lic. License

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:5,025
This week:370
 User Ratings  
 All time

For more information send a message to info at phpclasses dot org.