本文整理汇总了PHP中Loader::includeLibrary方法的典型用法代码示例。如果您正苦于以下问题:PHP Loader::includeLibrary方法的具体用法?PHP Loader::includeLibrary怎么用?PHP Loader::includeLibrary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Loader
的用法示例。
在下文中一共展示了Loader::includeLibrary方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($context)
{
Loader::includeLibrary('phpmailer5.2/class.phpmailer.php');
$this->mailer = new PHPMailer();
$this->mailer->CharSet = AppConfig::CHARSET;
parent::__construct($context);
}
示例2: createThumbs
/**
*
* @example
*
* $this->createThumbs(
* array('best', '[programa]/{random[10]}_{width}x{height}.{ext}' 300, 500),
* array('width', '[programa]/{random[10]}_width.{ext}', 110),
* array('square', '[programa]/{random[10]}_square.{ext}', 80),
* array('crop', '[programa]/{random[10]}_crop_{width}x{height}.{ext}', 300, 500),
* array('height', '[programa]/{random[10]}_height.{ext}', 180),
* array('filled', '[programa]/{random[10]}_filled.{ext}', 365),
* array('original','[programa]/{random[10]}.{ext}')
* );
*
* @return array
*/
function createThumbs()
{
if (!$this->hasFile()) {
return false;
}
$thumbs = func_get_args();
#No thumbs specified
if (!count($thumbs)) {
return false;
}
#Save temporarily the original image in the tmp directory
$path = APPD_TMP . DS . '{random}.{ext}';
$source = $this->saveFileAs($path);
if (!$source) {
trigger_error("Could not create temporary thumbnail.", E_USER_WARNING);
return false;
}
Loader::includeLibrary('phaxsithumb/PhaxsiThumb.php');
$fk_thumb = new PhaxsiThumb($source);
if ($fk_thumb->isError()) {
@unlink($source);
return false;
}
#Generate filenames if needed. $names will be returned.
$names = array();
for ($i = 0; $i < count($thumbs); $i++) {
$info = pathinfo($this->_value['name']);
$replacements = array('size' => isset($thumbs[$i][2]) ? $thumbs[$i][2] : '', 'width' => isset($thumbs[$i][2]) ? $thumbs[$i][2] : '', 'height' => isset($thumbs[$i][3]) ? $thumbs[$i][3] : '', 'name' => $info['filename'], 'ext' => $info['extension']);
$thumbs[$i][1] = PathHelper::replaceUploadsDir($thumbs[$i][1]);
$thumbs[$i][1] = PathHelper::parse($thumbs[$i][1], $replacements);
$dir = dirname($thumbs[$i][1]);
if (!file_exists($dir)) {
$old = umask(0);
mkdir($dir, 0777, true);
umask($old);
}
$names[$i] = $thumbs[$i][1];
}
$success = call_user_func_array(array(&$fk_thumb, 'batchCreateThumbs'), $thumbs);
@unlink($source);
if (!$success) {
return false;
}
return $names;
}
示例3: decode
static function decode($string)
{
Loader::includeLibrary('json/json.php');
$json = new Services_Json();
return $json->decode($string);
}
示例4: __construct
function __construct($context)
{
Loader::includeLibrary('feedwriter/FeedWriter.php');
$this->feed = new FeedWriter(RSS2);
parent::__construct($context);
}