Nature of Ajax

1. Ajax is …

 

Asynchronous JavaScript and XML

 


 

2. Defined by ?

 

Jesse James Garrett

 


 

3. Group of Technologies !

 

HTML / XHTML + CSS

DOM

Plain Text, XML, JSON …

XMLHttpRequest

JavaScript, VBScript …

PHP, JSP, ASP, Ruby …

 


 

4. DOM is …

 

Document Object Model

 

var value = document.getElementById("some_id").value;

 


 

5. XMLHttpRequest is …

 

API between browsers’ scripting languages (JavaScript, VBScript …) and web servers

 

[codesyntax lang=”javascript”]

function getXMLHttpRequest()
{
var xmlhttp = false;
if (typeof XMLHttpRequest != "undefined") {
//FireFox Mozillar Opera Safari IE7 IE8
xmlhttp = new XMLHttpRequest();
//For Mozillar Bugs
if (xmlhttp.overrideMimeType) {
xmlhttp.overrideMimeType("text/xml");
}
} else {
//IE 5.x-6.x:
//Microsoft.XMLHTTP points to Msxml2.XMLHTTP.3.0 and is redundant
try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch (e) {}
try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.4.0"); } catch (e) {}
try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch (e) {}
try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}
try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}
if (!xmlhttp) {
throw new Error("This browser does not support XMLHttpRequest.");
}
};
return xmlhttp;
}

[/codesyntax]

 


 

6. XML is …

 

Extensible Markup Language

 

[codesyntax lang=”xml”]

<?xml version='1.0' standalone='yes'?>
<movies>
<body>
<title>PHP: Behind the Parser</title>
<characters>
<character>
<name>Ms. Coder</name>
<actor>Onlivia Actora</actor>
</character>
<character>
<name>Mr. Coder</name>
<actor>El Act&#211;r</actor>
</character>
</characters>
<plot>
So, this language. It's like, a programming language. Or is it a scripting language? All is revealed in this thrilling horror spoof of a documentary.
</plot>
<great-lines>
<line>PHP solves all my web problems</line>
</great-lines>
<rating type="thumbs">7</rating>
<rating type="stars">5</rating>
</movie>
</movies>

[/codesyntax]

 


 

7. JSON is …

 

JavaScript Object Notation

 

[codesyntax lang=”javascript”]

var json = {
"a":[
"a1",
"a2"
],
"b":["b1"],
"c":"c1",
"d":{"d1":"JSON text"}
};

[/codesyntax]

 


 

8. PHP and Json

 

@since PHP 5.2.0

 

JSON Functions

 


 

9. Example

 

@see XMLHttpRequest.js

@see history.js

@see history.html

 

[codesyntax lang=”php”]

<?php
switch ($_GET['dataFormat']) {
case 'plain':
echo 'Time is now :' . time();
die;
case 'XML':
$xml = <<<XML
<?xml version="1.0" encoding="utf-8"?>
<nodes>
<node>
<text_one>
This is XML text 1
</text_one>
<text_two>
This is XML text 2
</text_two>
</node>
</nodes>
XML
;
echo $xml;
die;
case 'JSON':
$json = array (
'a' => array('a1', 'a2'),
'b' => array('b1'),
'c' => 'c1',
'd' => array(
'd1' => 'JSON text'
)
);
// {"a":["a1","a2"],"b":["b1"],"c":"c1","d":{"d1":"JSON text"}}
echo json_encode($json);
die;

default:
break;
}
?>

[/codesyntax]

  

[codesyntax lang=”html4strict”]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="XMLHttpRequest.js" type="text/javascript"></script>
<script src="history.js" type="text/javascript"></script>
<script type="text/javascript">
function getPlainText() {
try {
var xmlhttp = getXMLHttpRequest();
xmlhttp.onreadystatechange = function () {
// finished ?
if (xmlhttp.readyState == 4) {
// successful ?
if (xmlhttp.status == 200) {
document.getElementById("ajax_id").innerHTML = xmlhttp.responseText;
saveHistory();
}
}
}
xmlhttp.open("GET", "index.php?dataFormat=plain&amp;t=" + ((new Date()).valueOf()), true);
xmlhttp.send(null);
} catch (ex) { }
}
function getXMLText() {
try {
var xmlhttp = getXMLHttpRequest();
xmlhttp.onreadystatechange = function () {
// finished ?
if (xmlhttp.readyState == 4) {
// successful ?
if (xmlhttp.status == 200) {
// all nodes
var responseXML = xmlhttp.responseXML;
// for ie 5.x-6.x
if (!responseXML.documentElement && xmlhttp.responseStream) {
responseXML.load(xmlhttp.responseStream);
}
// get nodes
nodes = responseXML.documentElement;
// find data
var text = nodes.getElementsByTagName('text_one')[0].firstChild.data;
document.getElementById("ajax_id").innerHTML = text;
saveHistory();
}
}
}
xmlhttp.open("GET", "index.php?dataFormat=XML&amp;t=" + ((new Date()).valueOf()), true);
xmlhttp.send(null);
} catch (ex) { }
}
function getJSONText() {
try {
var xmlhttp = getXMLHttpRequest();
xmlhttp.onreadystatechange = function () {
// finished ?
if (xmlhttp.readyState == 4) {
// successful ?
if (xmlhttp.status == 200) {
var responseJSON = eval('(' + xmlhttp.responseText + ')');
document.getElementById("ajax_id").innerHTML = responseJSON.d['d1'];
saveHistory();
}
}
}
xmlhttp.open("GET", "index.php?dataFormat=JSON&amp;t=" + ((new Date()).valueOf()), true);
xmlhttp.send(null);
} catch (ex) { }
}
</script>
</head>
<body>
<div id="ajax_id">
<p>
<h1>Here is an ajax test</h1>
</p>
</div>
<p>
<a href="javascript:;" onclick="getPlainText();">Ajax get plain text</a>
</p>
<p>
<a href="javascript:;" onclick="getXMLText();">Ajax get XML text</a>
</p>
<p>
<a href="javascript:;" onclick="getJSONText();">Ajax get JSON text</a>
</p>
<p>
<iframe id="history" src="history.html?0"></iframe>
</p>
</body>
</html>

[/codesyntax]

 


 

10. Skills

 

(1) To avoid caching:

 

xmlhttp.open("GET", "server_script?t=" + ((new Date()).valueOf()), true);

 

(2) To make Backward / Forward button works

 

@javascript history.js

 

[codesyntax lang=”javascript”]

var h_list = new Array(10);
var h_index = 0;
function saveHistory()
{
if (document.getElementById('history')) {
if (h_index == 9) {
h_index = 0;
} else {
h_index++;
}
h_list[h_index] = document.getElementById('ajax_id').innerHTML;
document.getElementById('history').src = 'history.html?' + h_index;
}
}

function getHisStory(curIndex)
{
if (curIndex != h_index) {
if (h_list[curIndex]) {
h_index = curIndex;
document.getElementById('ajax_id').innerHTML = h_list[curIndex];
}
}
}

[/codesyntax]

 

@html history.html

 

[codesyntax lang=”html4strict”]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<h1>history</h1>
<script type="text/javascript">
var url = window.location.href;
if (url.indexOf('?') > -1) {
parent.getHisStory(url.substr(url.indexOf('?') + 1));
document.write(window.location.search.substr(1));
}
</script>
</body>
</html>

[/codesyntax]

 

to be continue …

 


 

Posted in Ajax | Tagged | Leave a comment

Using Memcache

1. About memcached

 

See http://en.wikipedia.org/wiki/Memcached

 


 

2. About memcache (the php extension)

 

See http://www.php.net/manual/en/book.memcache.php

 


 

3. Different between memcached and memcache

 

(1) What’s memcached?

Free & open source, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.

 

(2) What’s memcache?

Memcache module provides handy procedural and object oriented interface to memcached, highly effective caching daemon, which was especially designed to decrease database load in dynamic web applications. The Memcache module also provides a session handler (memcache).

 


 

4. Installation for windows

 

(1) Download memcached for Win32 : http://jehiah.cz/projects/memcached-win32/ .

The latest version is http://jehiah.cz/projects/memcached-win32/files/memcached-1.2.1-win32.zip

 

(2) Unzip the binaries in your desired directory (eg. c:\memcached) and see the help by using command:

c:\memcached\memcached.exe -h

 

(3) Install memcached service using command (optional):

c:\memcached\memcached.exe -d install

 

(4) Start the service using command:

c:\memcached\memcached.exe -d start

 

(5) Use ‘netstat -an‘ to see if port 11211 is being used, and check if memcached.exe is list in task manager

 

 

 

 

(6) Download memcache.dll for PHP from http://downloads.php.net (right now I am using PHP5.3.1) :

http://downloads.php.net/pierre/php_memcache-cvs-20090703-5.3-VC6-x86.zip

 

(7) Place your memcache.dll under php\ext\

 

 

(8) Open your php.ini and put "extension=php_memcache.dll" under extensions section, usually named [PECL]

 

 

(9) Restart apache and check phpinfo() whether you can see the memcache section


 

5. Installation for linux (Debian / Ubuntu)

 

(1) Install memcached service by

sudo apt-get install memcached

 

(2) Install libevent (though this is usually done for you automaticly by apt above) by

sudo apt-get install libevent

 

(3) Start memcached (normally installed on /usr/bin/memcached and started by default after apt installation)

memcached -d -m 64 -l 127.0.0.1 -p 11211 -u nobody

 

 

(4) Install memcache.so extension for your php

sudo apt-get install php5-memcache

cat /etc/php5/conf.d/memcache.ini

 

 

(5) Restart apache

sudo /etc/init.d/apache2 restart

 

(6) Check phpinfo() (usually by creating a phpinfo.php under /var/www/)

  


 

6. Security of memcached

 

(1) Local area network (listen web server 192.168.0.2)

memcached -d -m 1024 -u root -l 192.168.0.2 -p 11211 -c 1024 -P /tmp/memcached.pid

 

(2) iptables (firewall, allow 192.168.0.3 to be the only one who can access the memcached server)

iptables -F
iptables -P INPUT DROP
iptables -A INPUT -p tcp -s 192.168.0.3 –dport 11211 -j ACCEPT
iptables -A INPUT -p udp -s 192.168.0.3 –dport 11211 -j ACCEPT

 


 

7. Memcached Cluster (example on memcache)

 

To make memcache works as cluster is as simple as one function below : 

 

[codesyntax lang=”php”]

$mem = new Memcache();
$mem->addServer('192.168.1.2', '11211');
$mem->addServer('192.168.1.3', '11212');
$mem->addServer('192.168.1.4', '11213');
$mem->addServer('192.168.1.5', '11214');
// add more servers

[/codesyntax]

 


 

8. Testing memcache

 

To check whether your memcache is working, see this example: 

 

$mem = new Memcache();
$mem->connect('localhost', 11211);
$mem->set('key', 'This is the first test!', 0, 60);
if ($val = $mem->get('key')) {
echo $val;
} else {
echo 'fail!';
}

 


 

9. Memcache functions

 

<?php
$servers = array(
array('host' => '192.168.1.4', 'port' => '11211'),
array('host' => '192.168.1.3', 'port' => '11211'),
array('host' => '192.168.1.2', 'port' => '11211'),
array('host' => 'localhost', 'port' => '11211'),

);
/**
* init memcache obj
*/

$mem = new Memcache();

/**
* open the memcache debug
*/

memcache_debug(true);
/**
* add servers
*/

foreach ($servers as $s) {
$mem->addServer($s['host'], $s['port']);
}

/**
* print the server status
*/

foreach ($servers as $s) {
if ($mem->getServerStatus($s['host'], $s['port']) == 2) {
echo 'server : ' . $s['host'] . ':' . $s['port'] . ' is running!<br />';
} else {
echo 'server : ' . $s['host'] . ':' . $s['port'] . ' is not running!<br />';
}
}

/**
* print the current version of memcache
*/

echo '<p>current version : ' . $mem->getVersion() . '</p>';

/**
* print current stats of all server
*/

$stats = $mem->getextendedstats();
echo 'servers stats : <pre>' . print_r($stats, true) . '</pre>';

/**
* get current stats of current server
*/

$stats = $mem->getstats();
echo 'current server stats : <pre>' . print_r($stats, true) . '</pre>';

/**
* set first value
*/

$mem->set('key', 1, 0, 60);
echo '<p>original value of "key" : ' . $mem->get('key') . '<br />';

/**
* try to add a value using the same key
*/

if (!$mem->add('key', 'another value')) {
echo 'try to add "key" : value "key" already exists!</p>';

/**
* second value
*/

$mem->add('key2', 2);

/**
* third value
*/

$mem->add('key3', 3);
echo '<p>original value of "key3" : ' . $mem->get('key3') . '<br />';
$mem->delete('key3');
if (!$mem->get('key3')) {
echo 'value of "key3" is deleted!</p>';
}
}

/**
* increase the value
*/

$mem->increment('key', 3);
echo 'after "key" increased by 3 : ' . $mem->get('key') . '<br />';

/**
* decrease the value
*/

$mem->decrement('key', 2);
echo 'after "key" decreased by 2 : ' . $mem->get('key') . '<br />';

/**
* replace the value for some seconds
*/

$mem->replace('key', 100, false, 1);
echo '<br />"key" is replaced by : ' . $mem->get('key') . '<br />';

sleep(1);
if (!$mem->get('key')) {
echo '"key" expired!<br />';
}

$mem->flush();
if (!$mem->get('key') and !$mem->get('key2') and !$mem->get('key3')) {
echo '<p>data all flush</p>';
}

$mem->close();

/**
* get current stats of current server
*/

if (!$stats = $mem->getstats()) {
echo '<p>server is closed</p>';
}

 

 


 

10. Memcache in real world practise

 

(1) As session handler 

 

<?php
/**
* we use memcache for session handler
*/

ini_set('session.save_handler', 'memcache');
ini_set('session.save_path', "tcp://localhost:11211?persistent=1&amp;weight=1&amp;timeout=1&amp;retry_interval=15");
session_start();

/**
* set a random user
*/

if (!isset($_SESSION['randomUser'])) {
$_SESSION['randomUser'] = rand(1, 10) . '_' . time();
}

/**
* set a normal user
*/

$_SESSION['normalUser'] = 'X_' . time();

/**
* print the users info
*/

echo 'random user : ' . $_SESSION['randomUser'] . '<br />';
echo 'normal user : ' . $_SESSION['normalUser'] . '<br />';

/**
* print session id
*/

echo 'session id : ' . session_id() . '<br />';

/**
* check whether we can get the user info from memcache (instead of session)
*/

$memcache = memcache_connect('localhost', 11211);
var_dump($memcache->get(session_id()));

 

(2) Caching database

 

class  db
{
public $memcache;

public function __construct()
{
$this->memcache = new Memcache();
$this->memcache->connect('localhost', 11211) or die ("memcache Could not connect");
}

/**
* get value
*/

public function query($sql, $time)
{
$key = md5($sql);
$data = array();
if (!$data = $this->memcache->get($key)) {
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$data[] = $row;
}
$this->memcache->set($key, $data, false, $time);
}
return $data;
}
}

 


 

11. Memcache in symfony and doctrine

 

@see http://www.doctrine-project.org/documentation/manual/1_2/en/caching

@see http://www.symfony-project.org/gentle-introduction/1_4/en/12-Caching

 

in /config/ProjectConfiguration.class.php (or /apps/myapp/config/myappConfiguration.class.php) : 

 

/**
* myproject/config/ProjectConfiguration.class.php
*/

class ProjectConfiguration extends sfProjectConfiguration
{
/**
* configurations of doctrine
*/

public function configureDoctrine(Doctrine_Manager $manager)
{
// memcached server options
$servers = array(
'host' => 'localhost',
'port' => 11211,
'persistent' => true
);
// memcache driver
$cacheDriver = new Doctrine_Cache_Memcache(array(
'servers' => $servers,
'compression' => false
));
// get doctrine manager
$manager = Doctrine_Manager::getInstance();

// cache all queries automatically
$manager->setAttribute(Doctrine::ATTR_QUERY_CACHE, $cacheDriver);
$manager->setAttribute(Doctrine::ATTR_QUERY_CACHE_LIFESPAN, 3600);

// set result cache later by using useResultCache()
$manager->setAttribute(Doctrine::ATTR_RESULT_CACHE, $cacheDriver);
$manager->setAttribute(Doctrine::ATTR_RESULT_CACHE_LIFESPAN, 3600);
}
}

 

add useResultCache() to query :

 

/**
* example function
*/

public static function getResult()
{
// set query
$query = Doctrine::getTable('user')
->createQuery('u')
->select('u.*')
->useResultCache(true);
// get result
$result = $query->execute();
$query->free();
return $result;
}

 


 

12. Monitor memcached

 

(1) telnet 127.0.0.1 11211

stats

rate  = get_hits/cmd_get * 100%

 

(2) cacti

 

(3) memcache.php

 


 

13. Hit Rate 

 

(1) Value Size

(2) Page Size

(3) Growth Factor (memcached -f)



 

14. Slab, Page and Chunk

 


 

15. Resources

http://code.google.com/p/memcached/

http://tech.idv2.com/2008/08/17/memcached-pdf/

 

 

That’s all …

Posted in Optimization | Tagged | 5 Comments

Xmarks Hosts

# Xmarks Hosts
173.239.65.20   www.xmarks.com
173.239.65.21   api.xmarks.com
173.239.65.22   login.xmarks.com
173.239.65.23   sync.xmarks.com
173.239.65.20   static.xmarks.com
173.239.65.20   download.xmarks.com
173.239.65.20   my.xmarks.com
Posted in Uncategorized | Leave a comment

Google DNS

203.208.39.22 www.google.com
203.208.39.22 mail.google.com
203.208.39.22 www.google.com.hk
203.208.39.22 webcache.googleusercontent.com


66.249.89.104 encrypted.google.com

66.249.89.99 code.google.com
74.125.155.99 docs.google.com

74.125.155.99 spreadsheet.google.com
74.125.155.99 spreadsheets.google.com

209.85.225.101 docs.google.com
209.85.225.101 docs0.google.com
209.85.225.101 docs1.google.com
209.85.225.101 docs2.google.com
209.85.225.101 docs3.google.com
209.85.225.101 docs4.google.com
209.85.225.101 docs5.google.com
209.85.225.101 docs6.google.com
209.85.225.101 docs7.google.com
209.85.225.101 docs8.google.com

74.125.227.2 spreadsheets.google.com

74.125.227.2 spreadsheets0.google.com

74.125.227.2 spreadsheets1.google.com

74.125.227.2 spreadsheets2.google.com

74.125.227.2 spreadsheets3.google.com

74.125.227.2 spreadsheets4.google.com

74.125.227.2 spreadsheets5.google.com

209.85.147.109 pop.gmail.com
209.85.147.109 smtp.gmail.com

209.85.225.102 groups.google.com
74.125.127.139 spreadsheets.google.com
74.125.127.100 services.google.com
74.125.127.100 writely.google.com
74.125.127.100 sites.google.com
209.85.225.104 reader.google.com
74.125.127.101 calendar.google.com

Posted in Uncategorized | 1 Comment

Zend Framework 2.0 Roadmap Review

Being one of the most famous PHP frameworks in the world, Zend Framework has set up its roadmap for version 2.0. As ZF 1.10 may certainly be the final release of 1.x branch, we are now going to be focused on ZF 2.0.


The strikingly attractive and interesting thing is that ZF 2.0 will turn to be fully PHP 5.3 supportted, that means we can make use of many new language features such as :


1. namespaces
2. __invoke()
3. closures
4. goto
5. Late Static Bindings (LSB)
etc.


Other important features are listed below :


1. Unified constructor


This means every constructor of component will be based on “options”, for example :
[codesyntax lang=”php”]

$options = array('bar' => 'baz');
// to initialize object using :
$foo = new Foo($options);
// or :
$foo = new Foo();
$foo->setOptions($options);

[/codesyntax]


This allows for more flexibility to add new configurations and is a good technique for allowing Dependency Injection.


2. Options


Option keys will become all_lowercase_underscore_keys
[codesyntax lang=”php”]

$options = array(
    'first_lowercase_underscore_key' => 'first',
    'second_lowercase_underscore_key' => 'second'
);

[/codesyntax]


3. Exceptions


Now Zend_Exception becomes an interface, and its position will be replaced by custom exceptions and SPL exceptions.
[codesyntax lang=”php”]

interface Exception
{
    // Exception becomes interface
}
class myException extends InvalidArgumentException implements Exception
{
    // myException extends from SPL exception and implements Exception interface
}

[/codesyntax]


4. Design By Contract


In one word, number of interfaces would be used for ease maintenance and testing. The dispatcher will works more faster by following standard use cases.


Basically saying, the DBC let you “always think about interface and testing before class”. See Design by contract for more details.


5. Elimination of most singletons


Zend_Controller_Front will be probably unsingled in the future.
Indiscriminate use of singletons will disappear (I hope).


Think about the truth meaning of the code listing below :
[codesyntax lang=”php”]

protected function __construct() {}

/**
 * Enforce singleton; disallow cloning
 *
 * @return void
 */
private function __clone() {}

/**
 * Singleton instance
 */
public static function getInstance()
{
    if (null === self::$_instance) {
        self::$_instance = new self();
    }
    return self::$_instance;
}

[/codesyntax]


In fact, in most cases, we have to create a “reset” function to clean up the object for testing, Such as Zend_Controller_Front::resetInstance(). I think it’s time to think about “Do we really need it?”


6. Creation of components for general-purpose, cross-functional actions


Common APIs will be set up for those components which got duplicate code, such as :
Plugins/Helpers
Decorators
Factories
Cache
[codesyntax lang=”php”]

// Something like this (I guess)
interface Common_Helper_Interface
{
    public function getHelper($type);
    // ......
}

[/codesyntax]


7. Usage of new language features within plugin architectures


The usage of strategy pattern for plugins will be replaced by using __invoke() and closures.
This is really a big improvement of performance.


So these code would be propably removed :

[codesyntax lang=”php”]

interface Zend_Application_Resource_Resource
{
    /**
     * Strategy pattern: initialize resource
     *
     * @return mixed
     */
    public function init();
}

[/codesyntax]


And Zend_Application_Resource_View::init() would be propably replaced from :

[codesyntax lang=”php”]

class Zend_Application_Resource_View extends Zend_Application_Resource_ResourceAbstract
{
    /**
     * Defined by Zend_Application_Resource_Resource
     *
     * @return Zend_View
     */
    public function init()
    {
        ......
        return $view;
    }
}

[/codesyntax]

To :

[codesyntax lang=”php”]

class Zend_Application_Resource_View extends Zend_Application_Resource_ResourceAbstract
{
    /**
     * init() is replaced by _invoke()
     *
     * @return Zend_View
     */
    public function _invoke()
    {
        ......
        return $view;
    }
}

[/codesyntax]


8. Autoload-only

No require_once, clean and neat, something like in Symfony.


9. Namespaces

The first PHP framework using namespace, though it’s still not so perfect in PHP.
[codesyntax lang=”php”]

class Zend_Controller_Front
{
    ......
}
// would propably becomes :
namespace ZendController
class Front
{
    ......
}

[/codesyntax]

10. Goto
It’s evil …

The current MVC implementation of ZF is very slow. But the team has make up their mind to solve the problem in 2.0. Techniques are designed to faster the whole MVC layer :

1. Strict interfaces

2. Explicit route

Inspired by ROR and Python Routes Project, it’s something similar to symfony’s routing.yml?
see Zend_Controller_Router 2.0

3. State machine of front controller

Zend_Controller_Front::dispatch() may be simplified by using goto :

[codesyntax lang=”php”]

// just imagine this
public function dispatch(Zend_Controller_Request_Abstract $request = null, Zend_Controller_Response_Abstract $response = null)
{
    if (!$this->getParam('noErrorHandler')) goto A;
    ......
    if (!$this->getParam('noViewRenderer')) goto B;
    ......
    if (null !== $request) goto C;
    ......
    if (null !== $response) goto D;
    ......
    if (!$this->_request->isDispatched()) goto XXX;
    ......
}

[/codesyntax]


Details in Zend_Controller 2.0
For more details about what’s new in 2.0, see here

Posted in Zend Framework | Tagged | Leave a comment