PHP Classes
elePHPant
Icontem

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 (7 years ago) RSS 2.0 feedStarStarStarStar 64%Total: 607 All time: 4,911 This week: 923Up
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 <contact>
Classes: 7 packages by
Country: Brazil Brazil
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  
 0%
Total:607
This week:0
All time:4,911
This week:923Up
 User Ratings  
 
 All time
Utility:75%StarStarStarStar
Consistency:91%StarStarStarStarStar
Documentation:91%StarStarStarStarStar
Examples:91%StarStarStarStarStar
Tests:-
Videos:-
Overall:64%StarStarStarStar
Rank:710