PHP Classes

Friendly class: Provide friend access to protected functions

Recommend this page to a friend!
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2008-11-27 (10 years ago) RSS 2.0 feedStarStarStarStar 64%Total: 617 All time: 4,992 This week: 434Up
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
Name: Rubens Takiguti Ribeiro is available for providing paid consulting. Contact Rubens Takiguti Ribeiro .
Classes: 7 packages by
Country: Brazil Brazil
Age: 35
All time rank: 63047 in Brazil Brazil
Week rank: 735 Down45 in Brazil Brazil Up
Innovation award
Innovation award
Nominee: 3x

  Files folder image Files  
File Role Description
Plain text file friendly_class.class.php Class Main class
Plain text file doc.php Doc. Documentation
Accessible without login Plain text file example.php Example Simple example
Plain text file LICENSE.TXT Lic. License

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:4,992
This week:434Up
 User Ratings  
 All time