本文整理汇总了PHP中Driver::Run方法的典型用法代码示例。如果您正苦于以下问题:PHP Driver::Run方法的具体用法?PHP Driver::Run怎么用?PHP Driver::Run使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Driver
的用法示例。
在下文中一共展示了Driver::Run方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CanvasGraph
$this->iFromColor = $aFrom;
$this->iToColor = $aTo;
$this->iStyle = $aStyle;
$this->graph = new CanvasGraph($aWidth, $aHeight);
$this->grad = new Gradient($this->graph->img);
$this->grad->FilledRectangle(0, 0, $this->iWidth, $this->iHeight, $this->iFromColor, $this->iToColor, $this->iStyle);
if ($aFileName != "") {
$this->graph->Stroke($aFileName);
echo "Image file '{$aFileName}' created.";
} else {
$this->graph->Stroke();
}
}
function Run()
{
global $HTTP_POST_VARS;
// Two modes:
// 1) If the script is called with no posted arguments
// we show the input form.
// 2) If we have posted arguments we naivly assume that
// we are called to do the image.
if (@$_POST['ok'] === ' Ok ') {
$this->GenGradImage();
} else {
$this->iForm->Run();
}
}
}
$driver = new Driver();
$driver->Run();
示例2: ParseArgs
$e = BackendFactory::Create(BACKEND_PS, $encoder);
set_exception_handler(array('Driver', 'ErrHandlerPS'));
break;
case 2:
$e = BackendFactory::Create(BACKEND_PS, $encoder);
$e->SetEPS();
set_exception_handler(array('Driver', 'ErrHandlerPS'));
break;
}
$e->SetHeight($aParams['height']);
$e->SetVertical($aParams['rotate']);
$e->SetModuleWidth($aParams['modulewidth']);
$e->SetScale($aParams['scale']);
$e->HideText($aParams['hide']);
if ($aParams['output'] === 0) {
$err = $e->Stroke($aParams['data'], $aParams['filename']);
} else {
$s = $e->Stroke($aParams['data'], $aParams['filename']);
if ($aParams['filename'] == '') {
// If no filename specified then return the generated postscript
echo $s;
}
}
}
}
$pa = new ParseArgs();
$params = $pa->Get();
$driver = new Driver();
$driver->Run($params);
// Successfull termination
exit(0);
示例3: strtok
global $HTTP_COOKIE_VARS;
$this->iDB = DBFactory::InitDB();
$this->iProjname = strtok(@$HTTP_COOKIE_VARS['ddda_project'], ':');
if ($this->iProjname != '') {
$this->iProjidx = strtok(':');
} else {
die('No project specified.');
}
}
function Run($aClass, $aFlags = 0)
{
$dbremove = new RemoveDBClass($this->iDB);
if ($dbremove->Run($this->iProjname, $aClass, $aFlags)) {
echo "Class <b>{$aClass}</b> has been removed from JpGraph Database.";
} else {
Utils::Error("Can't remove class <b>{$aClass}</b> from JpGRaph Database.");
}
}
}
//==========================================================================
// Script entry point
// Read URL argument and create Driver
//==========================================================================
if (!isset($HTTP_GET_VARS['class'])) {
Utils::Error("Must specify class to remove from db. Use syntax class=<class-name>");
} else {
$class = urldecode($HTTP_GET_VARS['class']);
}
$driver = new Driver();
$driver->Run($class);