echo($post->getContent()); $comments = new Comments($post->getComments()); foreach ($comments as $comment) { echo($comment->getAuthor()); echo($comment->getContent()); } }*/ /*---------- Design Patterns: Observer Pattern ----------*/ $postmonitor = new Observable(); $ym = new YMNotifier(); $em = new EmailNotifier2(); $s = new stdClass(); $postmonitor->register($ym); $postmonitor->register($em); $postmonitor->register($s); $postmonitor->stateChange(); /*---------- Design Patterns: Proxy Pattern or Lazy Loading ----------*/ /*$client = new IXR_Client('http://localhost/exercises/php_exercises/chapter4/server.php'); if (!$client->query('time.getGMTTime')) { die("Something went wrong - " . $client->getErrorCode() . $client->getErrorMessage()); } echo($client->getResponse());*/ /*---------- Design Patterns: Decorator Pattern ----------*/ print "<br/><br/>"; $bbcode_enabled = 0; $emoticon_enabled = 1; $post = new Post(); $comment = new Comment(); $post->filter("Test Title: A Test", "Lorem Ipsum Amet"); $comment->filter("Dolot avenus persina olatus");