本文整理汇总了PHP中Horde::getTempdir方法的典型用法代码示例。如果您正苦于以下问题:PHP Horde::getTempdir方法的具体用法?PHP Horde::getTempdir怎么用?PHP Horde::getTempdir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Horde
的用法示例。
在下文中一共展示了Horde::getTempdir方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
/**
* Returns an appropriate Horde_Image object based on Horde's configuration.
*
* @param array $params An array of image parameters. @see
* Horde_Image_Base
*
* @return Horde_Image
* @throws Horde_Exception
*/
public function create(array $params = array())
{
global $conf;
$driver = $conf['image']['driver'];
$class = $this->_getDriverName($driver, 'Horde_Image');
$context = array('tmpdir' => Horde::getTempdir(), 'logger' => $this->_injector->getInstance('Horde_Log_Logger'));
switch ($driver) {
case 'Im':
$context['convert'] = $conf['image']['convert'];
$context['identify'] = $conf['image']['identify'];
break;
}
return new $class($params, $context);
}
示例2: array
<?php
/**
* @package Image
*/
require_once __DIR__ . '/../lib/Application.php';
Horde_Registry::appInit('horde', array('authentication' => 'none', 'session_control' => 'none'));
$image = new Horde_Image_Svg(array('height' => 400, 'width' => 400), array('tmpdir' => Horde::getTempdir()));
$image->rectangle(30, 30, 100, 60, 'black', 'yellow');
$image->roundedRectangle(30, 30, 100, 60, 15, 'black', 'red');
$image->circle(30, 30, 30, 'black', 'blue');
$image->polygon(array(array('x' => 30, 'y' => 50), array('x' => 40, 'y' => 60), array('x' => 50, 'y' => 40)), 'green', 'green');
$image->arc(100, 100, 100, 0, 70, 'black', 'green');
$image->brush(100, 300, 'red', 'circle');
$image->line(0, 200, 500, 200, 'darkblue', 2);
$image->line(200, 200, 200, 500, 'darkblue', 2);
$image->polyline(array(array('x' => 130, 'y' => 150), array('x' => 140, 'y' => 160), array('x' => 150, 'y' => 140)), 'black', 5);
$image->text('Hello World', 100, 100, 'arial', 'purple');
$image->display();
示例3: getImageObject
/**
* Obtain a Horde_Image object
*
* @param array $params Any additional parameters
*
* @return Horde_Image_Base The image object.
*/
function getImageObject($params = array())
{
global $convert, $driver, $identify;
$context = array('tmpdir' => Horde::getTempdir());
if ($driver == 'Im') {
$context['convert'] = $convert;
$context['identify'] = $identify;
}
// Use the default
$class = 'Horde_Image_' . $driver;
if (class_exists($class)) {
return new $class($params, $context);
}
throw new Horde_Exception('Invalid Image driver specified: ' . $class . ' not found.');
}