Ben her yerde yapılandırma değişkenler erişmek için kullanabileceğiniz bir yapılandırma sınıfı var varsayarsak (Config::X).
Bu özellikleri ekler ve / veya değiştirir sınıfın dışında denebilecek bir işlevi uygulamak mümkün mü?
Böyle bir şey ben düşünüyorum budur:
class Config
{
const myVar = 'blah';
public static function write( $name, $value )
{
//....
}
}
echo Config::myVar; // Clear
Config::write( 'test', 'foo' );
echo Config::test; // Should be foo
I've seen something similiar in CakePHP but couldn't figure out the solution. My goal would be being able to write to the base Config class from different files, e.g.: store Database information in a separate file.