コード例 #1
0
ファイル: runtime.php プロジェクト: im286er/hobby
<?php

require_once "global.func.php";
require_once "dispatch.php";
require_once "control.php";
require_once "model.php";
require_once "dao.php";
Dispatch::init();
Dispatch::start();
コード例 #2
0
ファイル: dispatch-test.php プロジェクト: hmmbug/unbindery
    {
        $color = array_pop($this->colors);
        return $color;
    }
}
$colors = new Colors();
// Get next available item function
function getNextAvailable($params)
{
    global $colors;
    return $colors->getNextColor();
}
// Test code
$dispatch = new Dispatch();
$dispatch->register('getNextAvailable');
$dispatch->init(array('colors' => $colors));
echo "Getting next item: ";
$color = $dispatch->next();
echo $color ? $color : 'end of list';
echo "\nGetting next item: ";
$color = $dispatch->next();
echo $color ? $color : 'end of list';
echo "\nGetting next item: ";
$color = $dispatch->next();
echo $color ? $color : 'end of list';
echo "\nGetting next item: ";
$color = $dispatch->next();
echo $color ? $color : 'end of list';
echo "\nGetting next item: ";
$color = $dispatch->next();
echo $color ? $color : 'end of list';