cvs: phpweb / style.css zend-engine-2.php
| From: | Gabor Hojtsy | Date: | Sun, 03 Aug 2003 10:17:07 +0000 |
| Subject: | cvs: phpweb / style.css zend-engine-2.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-19774@lists.php.net to get a copy of this message | ||
goba Sun Aug 3 06:17:07 2003 EDT
Modified files:
/phpweb style.css zend-engine-2.php
Log:
Add support for highlighting PHP code with CSS classes used, and
use it on the new zend engine 2 page (code idea from livedocs)
Index: phpweb/style.css
diff -u phpweb/style.css:1.49 phpweb/style.css:1.50
--- phpweb/style.css:1.49 Tue Jul 29 07:31:21 2003
+++ phpweb/style.css Sun Aug 3 06:17:06 2003
@@ -253,3 +253,24 @@
input.max, textarea.max, select.max {
width: 100%;
}
+
+/* PHP code syntax highlighting */
+div.phpcode span.html {
+ color: black;
+}
+
+div.phpcode span.comment {
+ color: #FF8000;
+}
+
+div.phpcode span.default {
+ color: #0000BB;
+}
+
+div.phpcode span.keyword {
+ color: #007700;
+}
+
+div.phpcode span.string {
+ color: #DD0000;
+}
Index: phpweb/zend-engine-2.php
diff -u phpweb/zend-engine-2.php:1.12 phpweb/zend-engine-2.php:1.13
--- phpweb/zend-engine-2.php:1.12 Sat Aug 2 10:25:00 2003
+++ phpweb/zend-engine-2.php Sun Aug 3 06:17:06 2003
@@ -1,5 +1,5 @@
<?php
-// $Id: zend-engine-2.php,v 1.12 2003/08/02 14:25:00 goba Exp $
+// $Id: zend-engine-2.php,v 1.13 2003/08/03 10:17:06 goba Exp $
$_SERVER['BASE_PAGE'] = 'zend-engine-2.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
commonHeader("Changes in PHP 5/Zend Engine 2.0");
@@ -41,7 +41,7 @@
by the class they belong to.
</p>
<p>
-<?php highlight_string('<?php
+<?php highlight_php('<?php
class MyClass {
private $Hello = "Hello, World!\n";
protected $Bar = "Hello, Foo!\n";
@@ -86,7 +86,7 @@
<h3>Example</h3>
<p>
-<?php highlight_string('<?php
+<?php highlight_php('<?php
class Foo {
private function aPrivateMethod() {
echo "Foo::aPrivateMethod() called.\n";
@@ -123,7 +123,7 @@
</p>
<h3>Example</h3>
<p>
-<?php highlight_string('<?php
+<?php highlight_php('<?php
abstract class AbstractClass {
abstract public function test();
}
@@ -153,7 +153,7 @@
<h3>Example</h3>
<p>
-<?php highlight_string('<?php
+<?php highlight_php('<?php
interface Throwable {
public function getMessage();
}
@@ -178,7 +178,7 @@
</p>
<h3>Example</h3>
<p>
-<?php highlight_string('<?php
+<?php highlight_php('<?php
interface Foo {
function a(Foo $foo);
}
@@ -210,7 +210,7 @@
</p>
<p>
<?php
-highlight_string('<?php
+highlight_php('<?php
function foo(ClassName $object) {
// ...
}
@@ -222,7 +222,7 @@
</p>
<p>
<?php
-highlight_string('<?php
+highlight_php('<?php
function foo($object) {
if (!($object instanceof ClassName)) {
die("Argument 1 must be an instance of ClassName");
@@ -241,7 +241,7 @@
</p>
<h3>Example</h3>
<p>
-<?php highlight_string('<?php
+<?php highlight_php('<?php
class Foo {
final function bar() {
// ...
@@ -274,7 +274,7 @@
An object copy is created by calling the object's <code>__clone()</code> method:
</p>
<p>
-<?php highlight_string('<?php
+<?php highlight_php('<?php
$copy_of_object = $object->__clone();
?>'); ?>
</p>
@@ -290,7 +290,7 @@
</p>
<h3>Example</h3>
<p>
-<?php highlight_string('<?php
+<?php highlight_php('<?php
class MyCloneable {
static $id = 0;
@@ -342,7 +342,7 @@
</p>
<h3>Example</h3>
<p>
-<?php highlight_string('<?php
+<?php highlight_php('<?php
class BaseClass {
function __construct() {
print "In BaseClass constructor\n";
@@ -384,7 +384,7 @@
</p>
<h3>Example</h3>
<p>
-<?php highlight_string('<?php
+<?php highlight_php('<?php
class MyDestructableClass {
function __construct() {
print "In constructor\n";
@@ -410,7 +410,7 @@
PHP 5 introduces per-class constants:
</p>
<p>
-<?php highlight_string('<?php
+<?php highlight_php('<?php
class Foo {
const constant = "constant";
}
@@ -424,7 +424,7 @@
rely on runtime information.
</p>
<p>
-<?php highlight_string('<?php
+<?php highlight_php('<?php
class Bar {
const a = 1<<0;
const b = 1<<1;
@@ -444,7 +444,7 @@
</p>
<h3>Example</h3>
<p>
-<?php highlight_string('<?php
+<?php highlight_php('<?php
class MyExceptionFoo extends Exception {
function __construct($exception) {
parent::__construct($exception);
@@ -470,7 +470,7 @@
Engine 2, the following is now possible:
</p>
<p>
-<?php highlight_string('<?php
+<?php highlight_php('<?php
class Circle {
function draw() {
print "Circle\n";
@@ -500,7 +500,7 @@
<h2>Static member variables of static classes can now be initialized</h2>
<h3>Example</h3>
<p>
-<?php highlight_string('<?php
+<?php highlight_php('<?php
class foo {
static $my_static = 5;
}
@@ -516,7 +516,7 @@
</p>
<h3>Example</h3>
<p>
-<?php highlight_string('<?php
+<?php highlight_php('<?php
class Foo {
public static function aStaticMethod() {
// ...
@@ -539,7 +539,7 @@
</p>
<h3>Example</h3>
<p>
-<?php highlight_string('<?php
+<?php highlight_php('<?php
class baseClass { }
$a = new baseClass;
@@ -561,7 +561,7 @@
<h2>Parameters that are passed by reference to a function may now have default
values</h2>
<h3>Example</h3>
<p>
-<?php highlight_string('<?php
+<?php highlight_php('<?php
function my_function(&$var = null) {
if ($var === null) {
die("$var needs to have a value");
@@ -578,7 +578,7 @@
</p>
<h3>Example</h3>
<p>
-<?php highlight_string('<?php
+<?php highlight_php('<?php
function __autoload($className) {
include_once $className . ".php";
}
@@ -595,7 +595,7 @@
</p>
<h3>Example: __get() and __set()</h3>
<p>
-<?php highlight_string('<?php
+<?php highlight_php('<?php
class Setter {
public $n;
public $x = array("a" => 1, "b" => 2, "c" => 3);
@@ -634,7 +634,7 @@
</p>
<h3>Example: __call()</h3>
<p>
-<?php highlight_string('<?php
+<?php highlight_php('<?php
class Caller {
var $x = array(1, 2, 3);
@@ -651,6 +651,4 @@
?>'); ?>
</p>
-<?php
-commonFooter();
-?>
+<?php commonFooter(); ?>