本文整理汇总了PHP中vmc类的典型用法代码示例。如果您正苦于以下问题:PHP vmc类的具体用法?PHP vmc怎么用?PHP vmc使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了vmc类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: monitor_change
public function monitor_change($theme)
{
$config_file_path = vmc::get_themes_root_dir() . '/' . $theme . '/config.xml';
$last_modify_time = filemtime($config_file_path);
if (!$last_modify_time) {
return false;
}
$exist_last_time = app::get('site')->getConf($theme . '_theme_last_config');
$exist_last_time = $exist_last_time ? $exist_last_time : 0;
if ($exist_last_time - $last_modify_time == 0) {
return true;
} else {
app::get('site')->setConf($theme . '_theme_last_config', $last_modify_time);
}
$config_xml_content = file_get_contents($config_file_path);
if ($config_xml_content) {
$theme_info = vmc::singleton('site_utility_xml')->xml2arrayValues($config_xml_content);
}
if (empty($theme_info)) {
return false;
}
$config = $theme_info;
$theme_sdf = array('theme_id' => $config['theme']['id']['value'], 'theme_dir' => $theme, 'name' => $config['theme']['name']['value'], 'version' => $config['theme']['version']['value'], 'info' => $config['theme']['info']['value'], 'author' => $config['theme']['author']['value'], 'config' => array());
$theme_sdf = vmc_('site', 'theme_install_config', $theme_sdf, $config);
if (!vmc::singleton('site_theme_base')->update_theme($theme_sdf)) {
return false;
}
return $theme_sdf;
}
示例2: create
public function create($intext, $long_touch)
{
$mdl_image = app::get('image')->model('image');
if ($exits_image = $mdl_image->dump(md5($intext . $long_touch))) {
return $exits_image;
}
$tmp_file = tempnam(TMP_DIR, 'qrcode');
wechat_qrcode_QRcode::png($intext, $tmp_file, 'L', 8, 4);
list($w, $h, $type) = getimagesize($tmp_file);
if ($long_touch) {
//加入额外图像
$resize_tmp_file = tempnam(TMP_DIR, 'qrcode_resize');
$image_tool = vmc::singleton('image_tools_gd');
$image_tool->resize($tmp_file, $resize_tmp_file, $w, $h, $type, $w + 180, $h + 220, false, 20);
$water_file = PUBLIC_DIR . '/misc/long_touch.gif';
list($w_w, $w_h, $w_type) = getimagesize($water_file);
$warermark_set = array('wm_opacity' => 100, 'watermark_width' => $w_w, 'watermark_height' => $w_h, 'type' => $w_type, 'src_width' => $w + 180, 'src_height' => $h + 180, 'dest_x' => ($w + 180 - 120) / 2, 'dest_y' => $h + 50);
$image_tool->watermark($resize_tmp_file, $water_file, $warermark_set);
}
$storager = new base_storager();
if ($long_touch) {
list($url, $ident, $storage) = explode('|', $storager->save_upload($resize_tmp_file, 'image', '', $msg, '.png'));
} else {
list($url, $ident, $storage) = explode('|', $storager->save_upload($tmp_file, 'image', '', $msg, '.png'));
}
$tmp_qrcode_image = array('image_id' => md5($intext . $long_touch), 'storage' => $storage, 'image_name' => 'TMP_QRCODE', 'ident' => $ident, 'url' => $url, 'width' => $w, 'height' => $h, 'last_modified' => time());
$mdl_image->save($tmp_qrcode_image);
unlink($tmp_file);
if ($long_touch) {
unlink($resize_tmp_file);
}
return $tmp_qrcode_image;
}
示例3: send
/**
* send
* 必有方法,发送时调用.
*
* config参数为getOptions取得的所有项的配置结果
*
* @param mixed $target ['email']
* @param mixed $title
* @param mixed $config
*/
public function send($target, $title, $content, $config)
{
logger::debug(__CLASS__ . var_export(func_get_args(), 1));
$new_msg = array('member_id' => $target['member_id'], 'target' => $target['email'], 'subject' => $title, 'content' => $content, 'createtime' => time(), 'msg_type' => 'email', 'status' => 'sent');
app::get('b2c')->model('member_msg')->save($new_msg);
if (!($email_to = $target['email'])) {
return false;
}
if ($config['sendway'] == 'mail') {
$this->email = vmc::singleton('desktop_email_email');
}
$this->email->Sender = $this->Sender = $config['usermail'];
$this->email->Subject = $this->Subject = $this->email->inlineCode($title);
$From = $this->email->inlineCode(app::get('site')->getConf('site_name')) . '<' . $config['usermail'] . '>';
$header = array('Return-path' => '<' . $config['usermail'] . '>', 'Date' => date('r'), 'From' => $From, 'MIME-Version' => '1.0', 'Subject' => $this->Subject, 'To' => $email_to, 'Content-Type' => 'text/html; charset=UTF-8; format=flowed', 'Content-Transfer-Encoding' => 'base64');
$body = chunk_split(base64_encode($content));
$header = $this->email->buildHeader($header);
$config['sendway'] = $config['sendway'] ? $config['sendway'] : 'smtp';
switch ($config['sendway']) {
case 'sendmail':
$result = $this->email->SendmailSend($email_to, $header, $body);
break;
case 'mail':
$result = $this->email->MailSend($email_to, $header, $body);
break;
case 'smtp':
$result = $this->email->SmtpSend($email_to, $header, $body, $config);
break;
default:
$result = false;
break;
}
return $result;
}
示例4: exec
public function exec(&$order_sdf, &$msg = '')
{
$pam_data = vmc::singleton('b2c_user_object')->get_pam_data('*', $order_sdf['member_id']);
$env_list = array('order_id' => $order_sdf['order_id'], 'timestr' => date('Y-m-d H:i:s', $order_sdf['last_modify']));
vmc::singleton('b2c_messenger_stage')->trigger('orders-end', $env_list, array('email' => $pam_data['email'] ? $pam_data['email']['login_account'] : $order_sdf['consignee']['email'], 'mobile' => $pam_data['mobile'] ? $pam_data['mobile']['login_account'] : $order_sdf['consignee']['mobile'], 'member_id' => $order_sdf['member_id']));
return true;
}
示例5: login
public function login($userData, $vcode = false, &$msg, $type = 'b2c')
{
$userData = utils::_filter_input($userData);
//过滤xss攻击
//快速登录不用验证码
if ($vcode != 'quick') {
if (!$vcode || !base_vcode::verify('passport', $vcode)) {
$msg = '验证码错误';
return false;
}
}
//如果指定了登录类型,则不再进行获取(邮箱登录,手机号登录,用户名登录)
if (!$userData['login_type']) {
$userPassport = vmc::singleton('b2c_user_passport');
$userData['login_type'] = $userPassport->get_login_account_type($userData['login_account']);
}
$filter = array('login_type' => $userData['login_type'], 'login_account' => $userData['login_account']);
$model = 'members';
$id = 'member_id';
if ($type == 'sellers') {
$model = 'sellers';
$id = 'seller_id';
}
$account = app::get('pam')->model($model)->getList($id . ',password_account,login_password,createtime', $filter);
if (!$account) {
$msg = '不存在的用户';
return false;
}
$login_password = pam_encrypt::get_encrypted_password($userData['login_password'], 'member', array('createtime' => $account[0]['createtime'], 'login_name' => $account[0]['password_account']));
if ($account[0]['login_password'] != $login_password) {
$msg = '登录密码错误';
return false;
}
return $account[0][$id];
}
示例6: get_output
function get_output()
{
$render = $this->app->render();
$act = app::get('desktop')->model('menus')->getList('menu_id,app_id,menu_title,menu_path,workground', array('menu_type' => 'workground', 'disabled' => 'false'));
$user = vmc::singleton('desktop_user');
if ($user->is_super()) {
$aData = $act;
} else {
$group = $user->group();
//print_r($group);
$meuns = app::get('desktop')->model('menus');
$data = array();
foreach ($group as $key => $val) {
$aTmp = $meuns->workgroup($val);
foreach ($aTmp as $val) {
$data[] = $val;
}
}
$aData = $data;
}
$menu_id = array();
$wrokground = array();
foreach ((array) $aData as $value) {
if (!in_array($value['menu_id'], (array) $menu_id)) {
$workground[] = $value;
}
$menu_id[] = $value['menu_id'];
}
$render->pagedata['actions'] = $workground;
$render->pagedata['side'] = "sidepanel";
return $render->fetch('sidepanel.html');
}
示例7: save
function save()
{
$this->begin('index.php?app=b2c&ctl=admin_brand&act=index');
$objBrand = $this->app->model('brand');
$brandname = $objBrand->dump(array('brand_name' => $_POST['brand_name'], 'brand_id'));
if (empty($_POST['brand_id']) && is_array($brandname)) {
$this->end(false, '品牌名重复');
}
$_POST['ordernum'] = intval($_POST['ordernum']);
$data = $this->_preparegtype($_POST);
#↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓记录管理员操作日志@lujy↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
if ($obj_operatorlogs = vmc::service('operatorlog.goods')) {
$olddata = app::get('b2c')->model('brand')->dump($_POST['brand_id']);
}
#↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑记录管理员操作日志@lujy↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
if ($objBrand->save($data)) {
#↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓记录管理员操作日志@lujy↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
if ($obj_operatorlogs = vmc::service('operatorlog.goods')) {
if (method_exists($obj_operatorlogs, 'brand_log')) {
$obj_operatorlogs->brand_log($_POST, $olddata);
}
}
#↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑记录管理员操作日志@lujy↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
$this->end(true, '品牌保存成功');
} else {
$this->end(false, '品牌保存失败');
}
}
示例8: detail_columns_modifier
public function detail_columns_modifier(&$detail_pages)
{
if ($this->app->getConf('site.get_policy.method') == 1 && $detail_pages['detail_point']) {
unset($detail_pages['detail_point']);
}
$objuser = vmc::singleton('desktop_user');
if ($objuser->is_super()) {
return;
}
$perss = $objuser->group();
$get = $_GET;
$menu_path = 'app=' . $_GET['app'] . '&' . 'ctl=' . $_GET['ctl'] . '&' . 'act=' . $_GET['act'];
$menus = app::get('desktop')->model('menus');
$filter = array('menu_type' => 'menu', 'menu_path' => $menu_path);
$row = $menus->getList('*', $filter);
$detail_action = array_keys($detail_pages);
foreach ($row as $key => $v) {
if ($v['addon']) {
$addon = unserialize($v['addon']);
if ($addon['url_params'] && $addon['url_params']['action'] == 'detail') {
if (!in_array($v['permission'], (array) $perss)) {
if ($detail_pages[$addon['url_params']['finderview']]) {
unset($detail_pages[$addon['url_params']['finderview']]);
}
}
}
}
continue;
}
}
示例9: create_ftp_file
public function create_ftp_file($data, $params, $page = 1)
{
$local_file = tempnam(DATA_DIR . "/backup/", $params['model']);
if (is_null($this->remote_file)) {
$this->remote_file = $params['model'] . '.' . $params['post']['_io_type'];
}
$file = fopen($local_file, "w");
$model = app::get($params['app_id'])->model($params['model']);
if (method_exists($model, 'export_csv')) {
$rs = $model->export_csv($data);
} else {
$rs = '';
if (is_array($data)) {
$data = (array) $data;
if (empty($data['title']) && empty($data['contents'])) {
$rs = implode("\n", $data);
} else {
if ($page == 1) {
$rs = $data['title'] . "\n" . implode("\n", (array) $data['contents']);
} else {
$rs = implode("\n", (array) $data['contents']);
}
}
} else {
$rs = (string) $data;
}
}
fwrite($file, $rs);
fclose($file);
$obj_ftp = vmc::singleton('base_ftp');
$resume = $obj_ftp->size($this->remote_file);
$obj_ftp->nb_put($this->remote_file, $local_file, FTP_BINARY, $resume);
unlink($local_file);
return true;
}
示例10: _instance
/**
* 实例化存储方式类.
*/
private function _instance()
{
$params = $this->storage_policy();
$obj_name = 'importexport_policy_' . $params['policy'];
$this->policy_obj = vmc::singleton($obj_name);
return true;
}
示例11: parse_url
public function parse_url(&$url)
{
$val = vmc::singleton('routeplus_rstatics')->get_genurl($url);
if ($val) {
$url = $val;
}
}
示例12: watch_login
public function watch_login()
{
if ($member_id = vmc::singleton('b2c_user_object')->get_member_session()) {
vmc::singleton('b2c_frontpage')->bind_member($member_id);
echo 'success';
}
}
示例13: install
public final function install()
{
$modules = $this->parse_moduels_params($this->current);
$this->insert_modules($modules);
vmc::singleton('mobile_module_base')->create_site_config();
//生成config文件
}
示例14: __construct
function __construct($app)
{
$act = vmc::singleton('base_component_request')->get_get('act');
if ($act == 'index') {
$this->column_edit = '操作';
}
}
示例15: detail_payments
/**
* 下拉参数数据的展示的实现
* @param string payment id支付单序号
* @return string 详情内容
*/
public function detail_payments($payment_id)
{
$payment = $this->app->model('payments');
if ($_POST['payment_id']) {
$sdf = $_POST;
unset($_POST['_method']);
if ($payment->save($sdf)) {
echo 'ok';
}
} else {
$sdf_payment = $payment->dump($payment_id, '*', array('orders' => '*'));
if ($sdf_payment) {
$render = $this->app->render();
$render->pagedata['payments'] = $sdf_payment;
if (isset($render->pagedata['payments']['op_id']) && $render->pagedata['payments']['op_id']) {
$arr_pam['login_name'] = vmc::singleton('b2c_user_object')->get_member_name(null, $render->pagedata['payments']['op_id']);
if (!$arr_pam['login_name']) {
$obj_pam = app::get('pam')->model('account');
$arr_pam = $obj_pam->dump(array('account_id' => $render->pagedata['payments']['op_id']), 'login_name');
}
$render->pagedata['payments']['op_id'] = $arr_pam['login_name'] ? $arr_pam['login_name'] : '-';
} else {
$render->pagedata['payments']['op_id'] = '-';
}
if (isset($render->pagedata['payments']['orders']) && $render->pagedata['payments']['orders']) {
foreach ($render->pagedata['payments']['orders'] as $key => $arr_order_bills) {
$render->pagedata['payments']['order_id'] = $key;
}
}
return $render->fetch('payments/payments.html', $this->app->app_id);
} else {
return '无内容';
}
}
}