本文整理汇总了PHP中getClass函数的典型用法代码示例。如果您正苦于以下问题:PHP getClass函数的具体用法?PHP getClass怎么用?PHP getClass使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getClass函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: applyRule
public function applyRule(ISC_QUOTE $quote)
{
if (!customerIsSignedIn()) {
return null;
}
$customerId = getClass('ISC_CUSTOMER')->getCustomerId();
$query = "
SELECT COUNT(*)
FROM [|PREFIX|]orders
WHERE ordcustid='".$customerId."' AND ordstatus > 0 AND deleted = 0
LIMIT 1
";
$orderCount = $GLOBALS['ISC_CLASS_DB']->fetchOne($query);
// Discount does not apply
if($orderCount <= $this->orders) {
return false;
}
$items = $quote->getItems();
$totalDiscount = 0;
// The discount needs to come off each item, so that tax is also affected.
foreach($items as $item) {
$discountAmount = $item->getDiscountedBaseTotal() * ($this->amount / 100);
$item->addDiscount($this->getDbId(), $discountAmount);
$totalDiscount += $discountAmount;
}
$quote->addDiscount($this->getDbId(), $totalDiscount);
$this->banners[] = sprintf(getLang($this->getName().'DiscountMessage'), $this->amount);
return true;
}
示例2: setUp
public function setUp()
{
parent::setUp();
$this->_engine = getClass('ISC_ADMIN_ENGINE');
$this->_engine->LoadLangFile('settings.emailintegration');
$this->_log = $GLOBALS['ISC_CLASS_LOG'];
}
示例3: autoSaltUserPassword
public function autoSaltUserPassword()
{
$query = '
SELECT
pk_userid, salt, userpass
FROM
`[|PREFIX|]users`
WHERE
salt = ""
';
$result = $GLOBALS['ISC_CLASS_DB']->query($query);
$total = $GLOBALS['ISC_CLASS_DB']->countResult($result);
$count = 0;
while ($user = $GLOBALS['ISC_CLASS_DB']->fetch($result)) {
// auto salt md5-ed user password with a 15 len salt
$updatedUser = $user;
$updatedUser['salt'] = substr(md5(uniqid()), 0, 15);
$updatedUser['userpass'] = getClass('ISC_ADMIN_USER')->generatePasswordHash($user['userpass'], $updatedUser['salt']);
$GLOBALS['ISC_CLASS_DB']->updateQuery('users', $updatedUser, "pk_userid='".$GLOBALS['ISC_CLASS_DB']->quote($user['pk_userid'])."'");
$count++;
}
echo "\tAuto-salted password for $count/$total user(s)\n";
if ($count == $total) {
return true;
}
return false;
}
示例4: proc
/**
* @brief 위젯의 실행 부분
*
* ./widgets/위젯/conf/info.xml 에 선언한 extra_vars를 args로 받는다
* 결과를 만든후 print가 아니라 return 해주어야 한다
**/
function proc($args)
{
$oDocument =& getClass('document');
$site_module_info = Context::get('site_module_info');
Context::set('widget_info', $widget_info);
$args->site_srl = (int) $site_module_info->site_srl;
// 회원수 추출
$output = executeQuery('widgets.site_info.getMemberCount', $args);
$widget_info->member_count = $output->data->cnt;
// 새글 추출
$args->regdate = date("YmdHis", time() - 24 * 60 * 60);
$output = executeQuery('widgets.site_info.getNewDocument', $args);
$widget_info->new_documents = $output->data->cnt;
// 개설일
$output = executeQuery('widgets.site_info.getCreatedDate', $args);
$widget_info->created = $output->data->regdate;
// 가입 여부
$logged_info = Context::get('logged_info');
if (count($logged_info->group_list)) {
$widget_info->joined = true;
} else {
$widget_info->joined = false;
}
Context::set('widget_info', $widget_info);
Context::set('colorset', $args->colorset);
// 템플릿 컴파일
$tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
$tpl_file = 'site_info';
$oTemplate =& TemplateHandler::getInstance();
return $oTemplate->compile($tpl_path, $tpl_file);
}
示例5: getBoardAdminSimpleSetup
/**
* Get the board module admin simple setting page
* @return void
*/
public function getBoardAdminSimpleSetup($moduleSrl, $setupUrl)
{
if (!$moduleSrl) {
return;
}
Context::set('module_srl', $moduleSrl);
// default module info setting
$oModuleModel = getModel('module');
$moduleInfo = $oModuleModel->getModuleInfoByModuleSrl($moduleSrl);
$moduleInfo->use_status = explode('|@|', $moduleInfo->use_status);
if ($moduleInfo) {
Context::set('module_info', $moduleInfo);
}
// get document status list
$oDocumentModel = getModel('document');
$documentStatusList = $oDocumentModel->getStatusNameList();
Context::set('document_status_list', $documentStatusList);
// set order target list
foreach ($this->order_target as $key) {
$order_target[$key] = Context::getLang($key);
}
$order_target['list_order'] = Context::getLang('document_srl');
$order_target['update_order'] = Context::getLang('last_update');
Context::set('order_target', $order_target);
// for advanced language & url
$oAdmin = getClass('admin');
Context::set('setupUrl', $setupUrl);
// Extract admin ID set in the current module
$admin_member = $oModuleModel->getAdminId($moduleSrl);
Context::set('admin_member', $admin_member);
$oTemplate =& TemplateHandler::getInstance();
$html = $oTemplate->compile($this->module_path . 'tpl/', 'board_setup_basic');
return $html;
}
示例6: onlineMapRenderCallback
function onlineMapRenderCallback($data, $x, $y)
{
$imgX = 16;
$imgY = 16;
$x = round($x - $imgX / 2, 0);
$y = round($y - $imgY / 2, 0);
$gender = $data['gender'];
$class = $data['class'];
$race = $data['race'];
$level = $data['level'];
$faction = getPlayerFaction($race);
$map_name = getMapName($data['map']);
$area_name = getAreaNameFromPoint($data['map'], $data['position_x'], $data['position_y'], $data['position_z']);
$img = $faction == 0 ? "gps_icon1.png" : "gps_icon.png";
$text = "<table class=online_map>";
$text .= "<tr><td class=" . ($faction == 0 ? "aname" : "hname") . ">" . $data['name'] . "</td></<tr>";
if ($area_name) {
$text .= "<tr><td align=center>{$area_name}<br>";
}
$text .= "<tr><td align=center>";
$text .= "<img width=20 src=" . getRaceImage($race, $gender) . "> <img width=20 src=" . getClassImage($class) . "><br>";
$text .= getRace($race) . "<br>";
$text .= getClass($class) . "<br>";
$text .= "Level - {$level}<br>";
$text .= "</td></tr>";
$text .= "</table>";
return '<img src="images/map_points/' . $img . '" class=point style="left: ' . $x . '; top: ' . $y . ';" ' . addTooltip($text) . '>' . "\n";
}
示例7: sms
public function sms()
{
$model = M('Sms_mb');
$mb = $model->where('model="Student"')->find();
if ($mb) {
$map['id'] = array('in', $_POST['ids']);
$name = $this->getActionName();
$model = M($name);
$vo = $model->where($map)->select();
if ($vo > getSmsNum()) {
$this->error('您的短信剩余条数不足以完成本次发送,剩余条数' . getSmsNum());
} else {
foreach ($vo as $key => $value) {
$name = getStudentinfo($value['id'], 'nickname');
$xuehao = getStudentinfo($value['id'], 'account');
$class = getClass(getStudentinfo($value['id'], 'class_id'));
$gender = getStudentinfo($value['id'], 'gender');
$tel = getStudentinfo($value['id'], 'tel');
$content = str_replace('{name}', $name, $mb['content']);
$content = str_replace('{xuehao}', $xuehao, $content);
$content = str_replace('{class}', $class, $content);
$content = str_replace('{gender}', $gender, $content);
$content = str_replace('{tel}', $tel, $content);
sendSms($tel, $content);
}
$this->success('发送成功!');
}
} else {
$this->error('请先设置模板');
}
}
示例8: ClassData
private static function ClassData($class)
{
$fields = Request::getRequest('page', 'int');
$page = isset($fields) && $fields > 0 ? $fields : 1;
$article = self::$models->Article;
$mem = self::$models->Memcache;
$configclass = getClass();
$meunclass = $configclass['menu_class'];
$articleclass = $configclass['article_class'];
if (empty($meunclass[$class]) && empty($articleclass[$class])) {
View::AdminErrorMessage('goback', '入口错误误误!');
}
$ret = $mem->get('classController_ClassData_' . $class . $page);
$memc = $class;
if (!empty($meunclass[$class]) && is_array($meunclass[$class])) {
$class = $meunclass[$class];
array_shift($class);
$class = array_flip($class);
}
if (empty($ret)) {
$ret = array();
$ret['articleClassList'] = $article->getArticleClassList($class, $page);
$ret['pageNav'] = @array_pop($ret['articleClassList']);
$mem->set('classController_ClassData_' . $memc . $page, $ret);
}
$ret['meunclass'] = $meunclass;
$ret['articleclass'] = $articleclass;
$ret['nav'] = $class;
View::Transmit('newclassshow', $ret);
}
示例9: dispLicenseAdminConfig
function dispLicenseAdminConfig()
{
$oLicenseModel =& getModel('license');
$oModuleModel =& getModel('module');
$config = $oLicenseModel->getModuleConfig();
Context::set('config', $config);
$products = array();
// 'nstore', 'nstore_digital', 'elearning');
if (getClass('nstore')) {
$products[] = 'nstore';
}
if (getClass('nstore_digital')) {
$products[] = 'nstore_digital';
}
if (getClass('elearning')) {
$products[] = 'elearning';
}
Context::set('products', $products);
foreach ($products as $key => $prodid) {
$has_license = TRUE;
$expiration = NULL;
if ($oLicenseModel->getLicenseFromAgency($prodid, $has_license, $expiration)) {
$oLicenseModel->getLicenseFromAgency($prodid, $has_license, $expiration);
}
Context::set(sprintf('%s_expiration', $prodid), $expiration);
}
$this->setTemplateFile('index');
}
示例10: styleClasses
function styleClasses($settings)
{
function getClass($settings, $property)
{
return $settings->{$property} ? $property : "";
}
return getClass($settings, "caption-italic") . " " . getClass($settings, "caption-caps");
}
示例11: procAdminRecompileCacheFile
/**
* Regenerate all cache files
* @return void
*/
function procAdminRecompileCacheFile()
{
// rename cache dir
Rhymix\Framework\Storage::move(\RX_BASEDIR . 'files/cache', \RX_BASEDIR . 'files/cache_' . time());
Rhymix\Framework\Storage::createDirectory(\RX_BASEDIR . 'files/cache');
// remove module extend cache
Rhymix\Framework\Storage::delete(RX_BASEDIR . 'files/config/module_extend.php');
// remove debug files
Rhymix\Framework\Storage::delete(RX_BASEDIR . 'files/_debug_message.php');
Rhymix\Framework\Storage::delete(RX_BASEDIR . 'files/_debug_db_query.php');
Rhymix\Framework\Storage::delete(RX_BASEDIR . 'files/_db_slow_query.php');
$oModuleModel = getModel('module');
$module_list = $oModuleModel->getModuleList();
// call recompileCache for each module
foreach ($module_list as $module) {
$oModule = NULL;
$oModule = getClass($module->module);
if (method_exists($oModule, 'recompileCache')) {
$oModule->recompileCache();
}
}
// remove object cache
if (!in_array(Rhymix\Framework\Cache::getDriverName(), array('file', 'sqlite', 'dummy'))) {
Rhymix\Framework\Cache::clearAll();
}
// remove old cache dir
$tmp_cache_list = FileHandler::readDir(\RX_BASEDIR . 'files', '/^(cache_[0-9]+)/');
if ($tmp_cache_list) {
foreach ($tmp_cache_list as $tmp_dir) {
if (strval($tmp_dir) !== '') {
$tmp_dir = \RX_BASEDIR . 'files/' . strval($tmp_dir);
if (!Rhymix\Framework\Storage::isDirectory($tmp_dir)) {
continue;
}
// If possible, use system command to speed up recursive deletion
if (function_exists('exec') && !preg_match('/(?<!_)exec/', ini_get('disable_functions'))) {
if (strncasecmp(\PHP_OS, 'win', 3) == 0) {
@exec('rmdir /S /Q ' . escapeshellarg($tmp_dir));
} else {
@exec('rm -rf ' . escapeshellarg($tmp_dir));
}
}
// If the directory still exists, delete using PHP.
Rhymix\Framework\Storage::deleteDirectory($tmp_dir);
}
}
}
// remove duplicate indexes (only for CUBRID)
$db_type = Context::getDBType();
if ($db_type == 'cubrid') {
$db = DB::getInstance();
$db->deleteDuplicateIndexes();
}
// check autoinstall packages
$oAutoinstallAdminController = getAdminController('autoinstall');
$oAutoinstallAdminController->checkInstalled();
$this->setMessage('success_updated');
}
示例12: procAdminRecompileCacheFile
/**
* Regenerate all cache files
* @return void
*/
function procAdminRecompileCacheFile()
{
// rename cache dir
$temp_cache_dir = './files/cache_' . $_SERVER['REQUEST_TIME'];
FileHandler::rename('./files/cache', $temp_cache_dir);
FileHandler::makeDir('./files/cache');
// remove module extend cache
FileHandler::removeFile(_XE_PATH_ . 'files/config/module_extend.php');
// remove debug files
FileHandler::removeFile(_XE_PATH_ . 'files/_debug_message.php');
FileHandler::removeFile(_XE_PATH_ . 'files/_debug_db_query.php');
FileHandler::removeFile(_XE_PATH_ . 'files/_db_slow_query.php');
$oModuleModel = getModel('module');
$module_list = $oModuleModel->getModuleList();
// call recompileCache for each module
foreach ($module_list as $module) {
$oModule = NULL;
$oModule = getClass($module->module);
if (method_exists($oModule, 'recompileCache')) {
$oModule->recompileCache();
}
}
// remove cache
$truncated = array();
$oObjectCacheHandler = CacheHandler::getInstance('object');
$oTemplateCacheHandler = CacheHandler::getInstance('template');
if ($oObjectCacheHandler->isSupport()) {
$truncated[] = $oObjectCacheHandler->truncate();
}
if ($oTemplateCacheHandler->isSupport()) {
$truncated[] = $oTemplateCacheHandler->truncate();
}
if (count($truncated) && in_array(FALSE, $truncated)) {
return new Object(-1, 'msg_self_restart_cache_engine');
}
// remove cache dir
$tmp_cache_list = FileHandler::readDir('./files', '/(^cache_[0-9]+)/');
if ($tmp_cache_list) {
foreach ($tmp_cache_list as $tmp_dir) {
if ($tmp_dir) {
FileHandler::removeDir('./files/' . $tmp_dir);
}
}
}
// remove duplicate indexes (only for CUBRID)
$db_type = Context::getDBType();
if ($db_type == 'cubrid') {
$db = DB::getInstance();
$db->deleteDuplicateIndexes();
}
// check autoinstall packages
$oAutoinstallAdminController = getAdminController('autoinstall');
$oAutoinstallAdminController->checkInstalled();
$this->setMessage('success_updated');
}
示例13: __get
public function __get($name)
{
if (array_key_exists($name, $this->data)) {
if (in_array($name, $this->serializable)) {
return unserialize($this->data[$name]);
}
return $this->data[$name];
}
$class = getClass($this);
throw new Exception("Invalid property {$name} for {$class}");
}
示例14: showPlayerTalents
function showPlayerTalents($guid, $class, $level, $spec)
{
global $lang;
$bild = generateCharacterBild($guid, $class, $spec);
$calc = array('none', 'warrior', 'paladin', 'hunter', 'rogue', 'priest', 'FUTURE_1', 'shaman', 'mage', 'warlock', 'FUTURE_2', 'druid');
echo '<div id="talent"></div>';
echo '<a href="?talent=' . $calc[$class] . '" id=talent_bild_link>' . $lang['player_talent_calc'] . '</a><br>';
includeTalentScript($class, -1, $level, getClass($class));
echo '<script type="text/javascript">tc_bildFromStr("' . $bild['calc_bild'] . '");</script>';
echo '<script type="text/javascript">tc_renderTree("talent");</script>';
}
示例15: skills
/**
* Returns the list fo all skills available to a ninja.
**/
function skills($username)
{
if (!$username) {
$username = get_username();
}
if (false && DEBUG && $username == 'glassbox') {
$skills = $this->skill_map['Blue'] + $this->skill_map['White'] + $this->skill_map['Red'] + $this->skill_map['Black'] + $this->skill_map['All'];
return $skills;
}
return $this->skill_map[getClass($username)] + $this->skill_map['All'];
}