Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Zablokowanie dostępu do klasy na jakiś czas, lub blok dostępu do klasy 1, klasie 2
tuner
post
Post #1





Grupa: Zarejestrowani
Postów: 55
Pomógł: 0
Dołączył: 10.12.2004

Ostrzeżenie: (0%)
-----


Chciałbym na jakiś czas zablokować dostęp do klasy "engine" lub zablokować dostęp do tej klasy, klasie "module". Nie chcę by klasa "module" czytała/modyfikowała/zapisywała dane klasy "engine". Inne klasy takie jak "template" muszą mieć do danych "engine" dostęp.

Ktoś wie jak coś takiego rozwiązać?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
hwao
post
Post #2


Developer


Grupa: Moderatorzy
Postów: 2 844
Pomógł: 20
Dołączył: 25.11.2003
Skąd: Olkusz




Wewnatrz kalsy, hmmm
Mysle ze jest pare rozwiazan (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) ale to zalezy od tego jak rozumiesz dostep (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) prawdopodbnie i tak bedzie sie dalo uzystac ale mozesz probowac tak.
+ mala edycja (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Wiec (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
http://wiki.php.pl/index.php/Singleton
  1. <?php
  2. final class Singleton {
  3. private static $oInstance = null;
  4.  
  5. public static function getInstance( $class = null ) {
  6. if( is_null( self::$oInstance ) ) {
  7.  self::$oInstance = new Singleton();
  8. }
  9. if( !is_object( $class ) ) return false;
  10. if( get_class( $class ) == 'zakazana' ) return false;
  11. return self::$oInstance;
  12. }
  13.  
  14. private function __construct() {}
  15. }
  16. ?>


Mozna np tak probowac;)
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 8.10.2025 - 07:33