本文整理汇总了PHP中Import::M方法的典型用法代码示例。如果您正苦于以下问题:PHP Import::M方法的具体用法?PHP Import::M怎么用?PHP Import::M使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Import
的用法示例。
在下文中一共展示了Import::M方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Adodb
public function Adodb($clone = false)
{
static $mysql;
if (is_object($mysql)) {
return $clone ? clone $mysql : $mysql;
}
$cfg = parse_url(__CFG::MYSQL);
if ($mdlClass = Import::M("mysql/{$cfg['scheme']}")) {
list($cfg["dbname"], $cfg["tablepre"], $cfg["charset"]) = explode("/", trim($cfg["path"], "/"));
$mysql = new $mdlClass($cfg["host"], $cfg["user"], $cfg["pass"], $cfg["dbname"], $cfg["port"]);
$mysql->_tablepre = $this->_tablepre = $cfg["tablepre"];
$this->db = $mysql;
return $mysql;
}
return false;
}
示例2: exit
<?php
/**
* Copy Right IJH.CC
* Each engineer has a duty to keep the code elegant
* Author @shzhrui<Anhuike@gmail.com>
* $Id: view.mdl.php 3909 2014-03-17 03:08:57Z langzhong $
*/
if (!defined('__CORE_DIR')) {
exit("Access Denied");
}
Import::M('member/base');
class Mdl_member_View extends Mdl_member_Base
{
public function member($u, $l = 'uid')
{
$l = strtolower($l);
switch ($l) {
case 'uid':
$field = 'uid';
break;
case 'name':
case 'uname':
$field = 'uname';
break;
case 'mail':
case 'email':
$field = 'mail';
break;
case 'mobile':
$field = 'mobile';
示例3: __construct
<?php
/**
* Copy Right IJH.CC
* Each engineer has a duty to keep the code elegant
* Author @shzhrui<Anhuike@gmail.com>
* $Id: image.mdl.php 2034 2013-12-07 03:08:33Z langzhong $
*/
Import::M('image/gd');
class Mdl_Image_Image extends Model
{
protected static $_oimg = null;
public function __construct(&$system)
{
parent::__construct($system);
self::$_oimg = new Mdl_Image_Image();
self::$_oimg->params = $system->config->get('attach');
}
public function thumb()
{
}
}
示例4: create_cfg
<?php
/**
* Copy Right IJH.CC
* Each engineer has a duty to keep the code elegant
* Author @shzhrui<Anhuike@gmail.com>
* $Id: config.mdl.php 2034 2013-12-07 03:08:33Z langzhong $
*/
Import::M('developer/base');
class Mdl_Developer_Config extends Mdl_Developer_Base
{
public function create_cfg($cfg)
{
if (empty($cfg['k'])) {
$this->err->add('没有填写配置标识', 201);
} else {
if (K::$system->config->add($cfg['k'], $cfg['title'])) {
if ($cfg['module_id']) {
//ctl,act,title,visible,parent_id,orderby
$ctl = array('ctl' => 'system/config', 'act' => $cfg['k'], 'visible' => 1);
$ctl['parent_id'] = $cfg['module_id'];
$ctl['title'] = $cfg['title'];
K::M('module/handler')->create($ctl);
}
return true;
}
}
return false;
}
public function create_tmpl($cfg, $schema)
{
示例5: exit
<?php
/**
* Copy Right IJH.CC
* Each engineer has a duty to keep the code elegant
* Author @shzhrui<Anhuike@gmail.com>
* $Id: view.mdl.php 2444 2013-12-23 07:23:01Z langzhong $
*/
if (!defined('__CORE_DIR')) {
exit("Access Denied");
}
Import::M('article/base');
class Mdl_article_View extends Mdl_article_Base
{
public function detail($article_id, $closed = false)
{
if (!($article_id = intval($article_id))) {
return false;
}
$where = "a.article_id='{$article_id}'";
if ($closed) {
$where .= " AND a.closed=0";
}
$sql = "SELECT c.*,a.* FROM " . $this->table($this->_table) . " a LEFT JOIN " . $this->table('article_content') . " c ON a.article_id=c.article_id WHERE {$where} LIMIT 1";
if ($detail = $this->db->GetRow($sql)) {
$cate = K::M('article/cate')->cate($detail['cat_id']);
$detail['cat_title'] = $cate['title'];
}
return $detail;
}
public function up_item($article_id)
示例6: exit
<?php
/**
* Copy Right IJH.CC
* Each engineer has a duty to keep the code elegant
* Author shzhrui<anhuike@gmail.com>
* $Id: menu.mdl.php 2034 2013-12-07 03:08:33Z langzhong $
*/
if (!defined('__CORE_DIR')) {
exit("Access Denied");
}
Import::M('module/base');
class Mdl_Module_Menu extends Mdl_Module_Base
{
public function create($data, $checked = false)
{
if (!$checked && !($data = $this->_check($data))) {
return false;
}
$data['orderby'] = $data['orderby'] ? $data['orderby'] : 50;
$data['dateline'] = __CFG::TIME;
if ($ID = $this->db->insert($this->_table, $data, true)) {
$this->flush();
}
return $ID;
}
public function update($ID, $data, $checked = false)
{
if (!$checked && !($data = $this->_check($data, $ID))) {
return false;
}
示例7:
<?php
/**
* Copy Right IJH.CC
* Each engineer has a duty to keep the code elegant
* Author @shzhrui<anhuike@gmail.com>
* $Id: mdl.handler.php 2034 2013-12-07 03:08:33Z langzhong $
*/
Import::M('#base#/base');
class Mdl_
{
}
示例8: exit
<?php
/**
* Copy Right IJH.CC
* Each engineer has a duty to keep the code elegant
* Author @shzhrui<Anhuike@gmail.com>
* $Id: handler.mdl.php 2034 2013-12-07 03:08:33Z langzhong $
*/
if (!defined('__CORE_DIR')) {
exit("Access Denied");
}
Import::M('order/base');
class Mdl_order_Handler extends Mdl_order_Base
{
public function create($data, $checked = false)
{
if (!$checked && !($data = $this->_check_schema($data))) {
return false;
}
$data['clientip'] = $data['clientip'] ? $data['clientip'] : __IP;
$data['dateline'] = $data['dateline'] ? $data['dateline'] : __CFG::TIME;
return $this->db->insert($this->_table, $data, true);
}
public function update($pk, $data, $checked = false)
{
$this->_checkpk();
if (!$checked && !($data = $this->_check_schema($data, $pk))) {
return false;
}
return $this->db->update($this->_table, $data, $this->field($this->_pk, $pk));
}
示例9: exit
<?php
/**
* Copy Right IJH.CC
* Each engineer has a duty to keep the code elegant
* Author shzhrui<anhuike@gmail.com>
* $Id: msgbox.mdl.php 2034 2013-12-07 03:08:33Z langzhong $
*/
if (!defined('__CORE_DIR')) {
exit("Access Denied");
}
Import::M('helper/error');
class Mdl_Magic_Msgbox extends Mdl_Helper_Error
{
public function response()
{
$request = K::$system->request;
$objctl =& K::$system->objctl;
if (!($tmpl = $objctl->tmpl)) {
$tmpl = $objctl->pagedata['_OO_'];
}
if ($request['MINI'] == 'load') {
if ($tmpl) {
$objctl->output();
} else {
$this->show($request['referer'], 'HTML');
}
} else {
if ($request['XREQ']) {
if ($tmpl) {
$this->_data['html'] = $objctl->output(false);
示例10: exit
<?php
/**
* Copy Right IJH.CC
* Each engineer has a duty to keep the code elegant
* Author shzhrui<anhuike@gmail.com>
* $Id: mysql.mdl.php 3237 2014-02-11 03:36:35Z langzhong $
*/
if (!defined('__CORE_DIR')) {
exit("Access Denied");
}
Import::M('mysql/safecheck');
class Mdl_Mysql_Mysql
{
public $_QSQL = array();
public $_ERR = array();
public $cfg = array();
public $_tablepre = '';
public $link = null;
public function __construct($host, $user, $passwd, $dbname = null, $port = 3306, $socket = null)
{
$this->cfg['host'] = $host;
$this->cfg['user'] = $user;
$this->cfg['passwd'] = $passwd;
$this->cfg['dbname'] = $dbname;
$this->cfg['port'] = $port;
$this->cfg['socket'] = $socket;
}
public function connect()
{
if ($this->link === null) {