$m because user could bypass property setter by: $x = & $obj->property; $x = 'new value'; $val = $_this->$m(); return $val; } $m = 'is' . $name; if (isset(self::$methods[$class][$m])) { $val = $_this->$m(); return $val; } $type = isset(self::$methods[$class]['set' . $name]) ? 'a write-only' : 'an undeclared'; $name = func_get_arg(1); throw new MemberAccessException("Cannot read $type property $class::\$$name."); } /** * Sets value of a property. * @param object * @param string property name * @param mixed property value * @return void * @throws MemberAccessException if the property is not defined or is read-only */ public static function set($_this, $name, $value) { $class = get_class($_this); if ($name === '') { throw new MemberAccessException("Cannot write to a class '$class' property without name."); } if (!isset(self::$methods[$class])) { self::$methods[$class] = array_flip(get_class_methods($class)); } // property setter support $name[0] = $name[0] & "\xDF"; // case-sensitive checking, capitalize first character $m = 'set' . $name; if (isset(self::$methods[$class][$m])) { $_this->$m($value); return; } $type = isset(self::$methods[$class]['get' . $name]) || isset(self::$methods[$class]['is' . $name]) ? 'a read-only' : 'an undeclared'; $name = func_get_arg(1); throw new MemberAccessException("Cannot write to $type property $class::\$$name."); } }
WebSVN - freenet-router - Blame - Rev 2 - /trunk/freenet-router/var/www/freenet-router/Framework/Core/ObjectMixin.php
Català-Valencià - Catalan
Česky - Cesky
Dansk - Dansk
Dutch - Dutch
English - English
Finnish - Finnish
Français - Francais
Deutsch - German
עברית - Hebrew
Magyar - Hungarian
Bahasa Indonesia - Indonesian
Italiano - Italian
日本語 - Japanese
한국어 - Korean
Norsk - Norwegian
Polski - Polish
Português - Portuguese
Português - Brazilian Portuguese
Русский - Russian
中文 - Simplified Chinese
Slovenčina - Slovak
Slovenčina - Slovenian
Español - Spanish
Svenska - Swedish
中文 - Traditional Chinese
Türkçe - Turkish
Oëzbekcha - Uzbek
freenet-router
Subversion Repositories:
banderdyn
centos.prosek.czf
crusader
czf4bfu
czf4bfu.prosek.czf
czfcentos
czfgmap
discover
fedora.prosek.czf
freenet-router
ftth
getonlineclouds
hotsanic
internet.prosek.czf
is
mapstats
meteolinger
netmap
qos
sedlo
sedlo.prosek.czf
switches
vbtobb
vlubnt
weathermap
weatherstats
websvn
wifidashboard
wifimon
www.prosek.czf
xenstats
[
/
] [
trunk/
] [
freenet-router/
] [
var/
] [
www/
] [
freenet-router/
] [
Framework/
] [
Core/
] [
ObjectMixin.php
] - Blame information for rev
2
Line No.
Rev
Author
Line
Powered by
WebSVN
2.2.1