本文整理汇总了PHP中lang::group方法的典型用法代码示例。如果您正苦于以下问题:PHP lang::group方法的具体用法?PHP lang::group怎么用?PHP lang::group使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lang
的用法示例。
在下文中一共展示了lang::group方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: VeriWord
function VeriWord()
{
// Get Font-Files
$handle = opendir($this->dir_font);
$pre = 'captcha_';
while ($file = readdir($handle)) {
if ($file != "." && $file != ".." && !is_dir($this->dir_font . $file)) {
$nfo = pathinfo($this->dir_font . $file);
$prefix = substr($nfo['basename'], 0, strlen($pre));
if ($nfo['extension'] == 'ttf' && $prefix == $pre) {
$this->fonts[] = $nfo['basename'];
}
}
}
// Get Noise-Files
$handle = opendir($this->dir_noise);
while ($file = readdir($handle)) {
if ($file != "." && $file != ".." && !is_dir($this->dir_noise . $file)) {
$nfo = pathinfo($this->dir_noise . $file);
if ($nfo['extension'] == 'jpg' || $nfo['extension'] == 'jpeg') {
$this->noises[] = $nfo['basename'];
}
}
}
ImageTypes();
$lang = new lang();
$lang->group("thumbnail.class");
$this->lang = $lang->return_array();
if (function_exists('imagejpeg') && IMG_JPEG) {
define('IMAGEJPEG', true);
} else {
define('IMAGEJPEG', false);
}
if (function_exists('imagegif') && IMG_GIF) {
define('IMAGEGIF', true);
} else {
define('IMAGEGIF', false);
}
if (function_exists('imagepng') && IMG_PNG) {
define('IMAGEPNG', true);
} else {
define('IMAGEPNG', false);
}
srand((double) microtime() * time());
mt_srand((double) microtime() * 1000000);
}
示例2: thumbnail
function thumbnail()
{
ImageTypes();
$lang = new lang();
$lang->group("thumbnail.class");
$this->lang = $lang->return_array();
$this->path = '';
$this->mime = array();
if (function_exists('imagejpeg') && IMG_JPEG) {
define('IMAGEJPEG', true);
} else {
define('IMAGEJPEG', false);
}
if (function_exists('imagegif') && IMG_GIF) {
define('IMAGEGIF', true);
} else {
define('IMAGEGIF', false);
}
if (function_exists('imagepng') && IMG_PNG) {
define('IMAGEPNG', true);
} else {
define('IMAGEPNG', false);
}
}
示例3: lang
/**
* Gets the correct error message.
*
* Methoed tries to use $lang-Object. If not available, hardcoded english phrases will be used.
*
* @return string error message
*/
function get_error()
{
if ($this->error == null) {
return false;
}
$lang = new lang();
$lang->group("classes");
switch ($this->error) {
case UPLOAD_ERR_FILE_INDEX:
$message = $lang->phrase('upload_error_noupload');
break;
case UPLOAD_ERR_FILE_SIZE:
$lang->assign('mfs', formatFilesize($this->max_filesize));
$message = $lang->phrase('upload_error_maxfilesize');
break;
case UPLOAD_ERR_IMAGE_WIDTH:
case UPLOAD_ERR_IMAGE_HEIGHT:
$lang->assign('mih', $this->max_image_height > 0 ? numbers($this->max_image_height) : $lang->phrase('upload_unspecified'));
$lang->assign('miw', $this->max_image_width > 0 ? numbers($this->max_image_width) : $lang->phrase('upload_unspecified'));
$message = $lang->phrase('upload_error_maximagesize');
break;
case UPLOAD_ERR_FILE_TYPE:
$lang->assign('aft', implode(', ', $this->file_types));
$message = $lang->phrase('upload_error_wrongfiletype');
break;
case UPLOAD_ERR_COPY:
$message = $lang->phrase('upload_error_noaccess');
break;
case UPLOAD_ERR_FILE_EXISTS:
$message = $lang->phrase('upload_error_fileexists');
break;
default:
$message = $lang->phrase('upload_error_default');
}
if (!empty($this->file['name'])) {
return "{$this->file['name']}: {$message}";
} else {
return $message;
}
}