Geschrieben in PHP-Dokumentation am 12. Januar 2010 0 Kommentare »
Global space Without any namespace definition, all class and function definitions are placed into the global space – as it was in PHP before namespaces were supported. Prefixing a name with \ will specify that the name is required from the global space even in the context of the namespace. Beispiel #1 Using global space [...]
Geschrieben in PHP-Dokumentation am 12. Januar 2010 0 Kommentare »
Beispiel #1 Java Beispiel <?php// Instanziere Java Klasse java.lang.System in PHP$system = new Java(‘java.lang.System’); // Beispiele für Propertyzugriffeecho ’Java version=’ . $system->getProperty(‘java.version’) . ’<br />’;echo ’Java vendor=’ . $system->getProperty(‘java.vendor’) . ’<br />’;echo ’OS=’ . $system->getProperty(‘os.name’) . ’ ’ . $system->getProperty(‘os.version’) . ’ on ’ . $system->getProperty(‘os.arch’) . ’ <br />’; // java.util.Date example$formatter = new Java(‘java.text.SimpleDateFormat’, ”EEEE, MMMM dd, yyyy ’at’ h:mm:ss a zzzz”); echo $formatter->format(new Java(‘java.util.Date’));?> Beispiel #2 AWT Example <?php// This example is only intended to be run as a CGI. $frame = new Java(‘java.awt.Frame’, ’PHP’);$button = new Java(‘java.awt.Button’, ’Hello Java World!’); $frame->add(‘North’, $button);$frame->validate();$frame->pack();$frame->visible = True; $thread = new Java(‘java.lang.Thread’);$thread->sleep(10000); $frame->dispose();?> Notes: new Java() will create an instance of a class if a suitable constructor is available. If no parameters are passed and the default constructor is useful as it provides access to classes like java.lang.System which expose most [...]
Geschrieben in PHP-Dokumentation am 12. Januar 2010 0 Kommentare »
Einführung The swish extension provides the bindings for Swish-e API. Swish-e stands for "Simple Web Indexing System for Humans – Enhanced" and is an open source system for indexing and search. Swish-e itself is licensed under GPL license, but uses a clause that allows applications to link against the library if every copy of the [...]
Geschrieben in PHP-Dokumentation am 12. Januar 2010 0 Kommentare »
Einführung The runkit extension provides means to modify constants, user-defined functions, and user-defined classes. It also provides for custom superglobal variables and embeddable sub-interpreters via sandboxing. This package is meant as a feature added replacement for the » classkit package. When compiled with the –enable-runkit=classkit option to ./configure, it will export classkit compatible function definitions [...]