• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP M类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中M的典型用法代码示例。如果您正苦于以下问题:PHP M类的具体用法?PHP M怎么用?PHP M使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了M类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: canEval

 public static function canEval($sExtension)
 {
     if (M::PRODUCTION()) {
         return in_array($sExtension, self::$_aEvaledExtensionsProd);
     }
     return in_array($sExtension, self::$_aEvaledExtensionsDev);
 }
开发者ID:apodgorny,项目名称:minimum,代码行数:7,代码来源:class.MimeType.php


示例2: __construct

 public function __construct($p1)
 {
     $this->prop = $p1;
     echo "Inside instance " . __METHOD__ . "\n";
     parent::__construct();
     M::__construct();
     // allowed
     N::__construct();
     // allowed
     $clName = "M";
     $clName::__construct();
     // allowed
     //      "M"::__construct();     // not allowed
     // can call instance and static methods using both -> and ::
     $this->gi();
     // $this explicitly used (and passed)
     P::gi();
     // $this implicitly used (and passed)
     self::gi();
     // $this implicitly used (and passed)
     $this->gs();
     // call to static method, so no $this passed
     P::gs();
     // call to static method, so no $this passed
     self::gs();
     // call to static method, so no $this passed
 }
开发者ID:jeremyadoux,项目名称:hhvm,代码行数:27,代码来源:scope_resolution_operator.php


示例3: doExecApplier

 public function doExecApplier()
 {
     $form = new MyQuickForm('applyform', 'POST', M_Office::URL());
     $opts = M::tablesWithPlugin('tag');
     $opts = array_combine($opts, $opts);
     $form->addElement('select', 'table', 'Table', $opts);
     $form->addElement('textarea', 'clause', 'clause', 'rows="4" cols="60"');
     $form->addElement('text', 'tagname', 'tagname');
     $form->addElement('text', 'tagdel', 'tagdel');
     $form->addElement('checkbox', 'distinct', 'distinct');
     $form->addElement('submit', '__submit__', 'Apply');
     $form->addFormRule(array($this, 'checkApplier'));
     if ($form->validate()) {
         @set_time_limit(0);
         ini_set('memory_limit', '1024M');
         $values = $form->exportValues();
         $t = DB_DataObject::factory($values['table']);
         $query = 'SELECT ' . ($values['distinct'] ? 'DISTINCT ' : ' ') . $values['table'] . '.* FROM ' . $values['table'] . ' ' . $values['clause'];
         $t->query($query);
         while ($t->fetch()) {
             if ($values['tagname']) {
                 $t->addTag($values['tagname']);
             }
             if ($values['tagdel']) {
                 $t->removeTag($values['tagdel']);
             }
             $applied++;
         }
         $this->assign('success', 1);
         $this->assign('applied', $applied);
     }
     $this->assign('form', $form);
 }
开发者ID:demental,项目名称:m,代码行数:33,代码来源:admin.php


示例4: run

 public function run()
 {
     $params = M::getRoot();
     //组装参数
     $params["scope"] = "sliderbar";
     //指定定查询范围
     //获取菜单数组
     $navarr = FrontMenu::getChildMenu($params);
     $this->render('navbar', array('nav' => $navarr));
 }
开发者ID:zwq,项目名称:unpei,代码行数:10,代码来源:WNavbar.php


示例5: conn

 /**
  * 连接数据库
  */
 private function conn()
 {
     require dirname(__FILE__) . '/../config.php';
     $db_name = $dbname;
     $db_encode = 'utf8';
     $this->prefix = 'weixin_';
     $this->link = mysql_connect("{$host}:{$port}", $user, $pwd) or die('数据库服务器连接错误:' . mysql_error());
     M::$wlink = $this->link;
     mysql_select_db($db_name) or die('数据库连接错误:' . mysql_error());
     mysql_query("set names '{$db_encode}'");
 }
开发者ID:renzg,项目名称:wxwall,代码行数:14,代码来源:db.class.php


示例6: getQuotaInfo

 /**
  * Returns available diskspace information 
  * 
  * @return array 
  */
 public function getQuotaInfo()
 {
     $stats = M::stats();
     return array(10000000000.0 - $stats['totalSize'], 10000000000.0);
     /*
     return array(
         disk_total_space($this->path)-disk_free_space($this->path),
         disk_free_space($this->path)
         );
     */
 }
开发者ID:harrydeluxe,项目名称:mongofilesystem,代码行数:16,代码来源:MongoDirectory.php


示例7: setup

 public function setup()
 {
     M_Office_Util::$mainOptions = PEAR::getStaticProperty('m_office', 'options');
     M::addPaths('module', array(APP_ROOT . 'app/_shared/modules/', APP_ROOT . 'app/' . APP_NAME . '/modules/', 'M/Office/modules/'));
     M::addPaths('template', array(OFFICE_TEMPLATES_FOLDER, APP_ROOT . 'app/_shared/templates/', APP_ROOT . 'app/' . APP_NAME . '/templates/'));
     if (Config::getPref('theme')) {
         M::addPaths('template', array(APP_ROOT . 'public/themes/' . Config::getPref('theme') . '/templates/'));
     }
     $tpl = new Mtpl(M::getPaths('template'));
     $tpl->assign('jsdir', SITE_URL . 'js/');
     Mreg::set('tpl', $tpl);
 }
开发者ID:demental,项目名称:m,代码行数:12,代码来源:setup.php


示例8: run

 public function run()
 {
     //获取
     $params = M::getRoot();
     //组装参数
     $params["scope"] = "sliderbar";
     //指定定查询范围
     //获取菜单数组
     $navarr = FrontMenu::getChildMenu($params);
     $service_arr = array('orders' => '订单管理', 'quos' => '查看报价单', 'returns' => '退货管理');
     $dealer_arr = array('orders' => '订单管理', 'quos' => '管理报价单', 'returns' => '退货管理');
     foreach ($navarr as $key => $val) {
         if (Yii::app()->user->isServicer()) {
             if ($val['name'] != '采购管理') {
                 unset($navarr[$key]);
                 continue;
             }
             foreach ($navarr[$key]['children'] as $k => $v) {
                 if ($v['name'] == $service_arr['orders']) {
                     $data['order'] = $v['name'];
                 } else {
                     if ($v['name'] == $service_arr['quos']) {
                         $data['quo'] = $v['name'];
                     } else {
                         if ($v['name'] == $service_arr['returns']) {
                             $data['return'] = $v['name'];
                         }
                     }
                 }
             }
         }
         if (Yii::app()->user->isDealer()) {
             if ($val['name'] != '销售管理') {
                 unset($navarr[$key]);
                 continue;
             }
             foreach ($navarr[$key]['children'] as $k => $v) {
                 if ($v['name'] == $dealer_arr['orders']) {
                     $data['order'] = $v['name'];
                 } else {
                     if ($v['name'] == $dealer_arr['quos']) {
                         $data['quo'] = $v['name'];
                     } else {
                         if ($v['name'] == $dealer_arr['returns']) {
                             $data['return'] = $v['name'];
                         }
                     }
                 }
             }
         }
     }
     $this->render('topnews', array('mesmenu' => $data));
 }
开发者ID:zwq,项目名称:unpei,代码行数:53,代码来源:TopNews.php


示例9: writeinto

function writeinto($info)
{
    $infoarr = json_decode($info, true);
    $flag = new M('flag');
    $count = $flag->find("openid='" . $infoarr['openid'] . "'", '*', 'count');
    $sqlarr = array("nickname" => bin2hex($infoarr['nickname']), "avatar" => $infoarr['headimgurl'], "fakeid" => randStr(), "sex" => $infoarr['sex'], "fromtype" => 'weixin', "datetime" => time(), "flag" => "2");
    if (isset($infoarr['shadyphone'])) {
        $shady = new M('cj_shady');
        $shadyarr = $shady->find("phone=" . $infoarr['shadyphone']);
        if (empty($shadyarr)) {
            $addarr = array('phone' => $infoarr['shadyphone'], 'shady' => $shadyarr['grade']);
            $sqlarr = array_merge($sqlarr, $addarr);
        }
    }
    if ($count) {
        $savve = $flag->update("openid='" . $infoarr['openid'] . "'", $sqlarr);
    }
    if ($savve) {
        echo "ok";
    }
}
开发者ID:renzg,项目名称:wxwall,代码行数:21,代码来源:getuinfo.php


示例10: getData

 static function getData($id)
 {
     PDOSql::$pdobj = pdoConnect();
     $d = PDOSql::select("SELECT name, bg_image, subtitle FROM users WHERE id = ?", array($id));
     if (count($d) > 0) {
         $data['name'] = $d[0]['name'];
         $data['bg_image'] = $d[0]['bg_image'];
         $data['subtitle'] = $d[0]['subtitle'];
         return M::cr(true, $data);
     } else {
         return M::cr(false, array('user' => array()), 'No se encontraron datos del usuario');
     }
 }
开发者ID:scabros,项目名称:scabrosfw,代码行数:13,代码来源:User.php


示例11: testItWorks

 public function testItWorks()
 {
     $mock = M::mock('mindofmicah\\GoodReads\\Curl');
     $mock->shouldReceive('fetchInfo')->once()->andReturn(file_get_contents(__DIR__ . '/stubs/shelves/list.txt'));
     $response = Request::shelves('list', array('id' => 21308373), $mock);
     $this->assertInstanceOf('mindofmicah\\GoodReads\\Response', $response);
     $this->assertInstanceOf('mindofmicah\\GoodReads\\ResponseObj', $response->get('shelves'));
     $this->assertEquals('shelf_list', $response->headers('method'));
     $first_shelf = $response->get('shelves');
     $this->assertInstanceOf('mindofmicah\\GoodReads\\ResponseObj', $first_shelf);
     $first_child = current($first_shelf->child());
     //        print_r($first_child);
     $this->assertEquals('user_shelf', $first_child[0]->getType());
     $this->assertEquals(1, count($response->get('shelves')));
 }
开发者ID:mindofmicah,项目名称:goodreads,代码行数:15,代码来源:MyFirstTest.php


示例12: send_msgc

function send_msgc($msg, $isNotify = true)
{
    global $db;
    if (!is_array($msg)) {
        return;
    }
    $uid = $sql = $mc_sql = array();
    $userService = L::loadClass('UserService', 'user');
    /* @var $userService PW_UserService */
    foreach ($msg as $k => $v) {
        $username = $userService->getUserNameByUserId($v[0]);
        if (!$username) {
            continue;
        }
        M::sendNotice(array($username), array('title' => $v[6], 'content' => $v[7]));
    }
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:17,代码来源:msg.php


示例13: execute

 public function execute($params)
 {
     $db = MDB2::factory(M::getDatabaseDSN());
     $h = $db->dsn['hostspec'];
     $u = $db->dsn['username'];
     $p = $db->dsn['password'];
     $dbn = $db->database_name;
     $mysqlbin = '/usr/bin/env mysql';
     $catbin = '/usr/bin/env cat';
     $file = $this->baseFolder . 'src/tag.sql';
     $sys = "{$catbin} {$file} | {$mysqlbin} --host={$h} --user={$u} --password={$p} {$dbn}";
     system($sys, $return);
     $this->line('Creating tables :');
     $this->line('* tag');
     $this->line('* tag_record');
     $this->line('* tag_history');
 }
开发者ID:demental,项目名称:m,代码行数:17,代码来源:install.php


示例14: sendMessage

 /**
  * 以某个用户的身份给另一个用户发送短消息
  * @param int $userId 发送者uid
  * @param string $receiver 接受者用户名
  * @param string $subject 标题
  * @param string $content 内容
  * return bool
  */
 function sendMessage($userId, $receiver, $subject, $content)
 {
     global $winddb, $winduid, $windid, $groupid, $_G, $SYSTEM;
     $userService = $this->_getUserService();
     $winddb = $userService->get($userId, true, true);
     $winduid = $winddb['uid'];
     $groupid = $winddb['groupid'];
     $windid = $winddb['username'];
     $groupid == '-1' && ($groupid = $winddb['memberid']);
     if (file_exists(D_P . "data/groupdb/group_{$groupid}.php")) {
         extract(pwCache::getData(S::escapePath(D_P . "data/groupdb/group_{$groupid}.php", false)));
     } else {
         extract(pwCache::getData(D_P . 'data/groupdb/group_1.php', false));
     }
     M::sendMessage($userId, array($receiver), array('create_uid' => $winduid, 'create_username' => $windid, 'title' => S::escapeChar(stripslashes($subject)), 'content' => S::escapeChar(stripslashes($content))));
     return new ApiResponse(true);
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:25,代码来源:class_Msg.php


示例15: run

 public function run()
 {
     //获取是经销商还是服务店菜单
     $params = M::getRoot();
     //组装参数
     $params["scope"] = "sliderbar";
     //指定定查询范围
     //获取菜单数组
     $navarr = FrontMenu::getChildMenu($params);
     foreach ($navarr as $key => $val) {
         if ($val['name'] != '信息管理') {
             unset($navarr[$key]);
             continue;
         }
     }
     $this->render('topNav', array('permenu' => $navarr));
 }
开发者ID:zwq,项目名称:unpei,代码行数:17,代码来源:WTopNav.php


示例16: __callStatic

 public static function __callStatic($sTemplate, $aArgs)
 {
     if ($aDirs = M::TEMPLATE_PHP()) {
         foreach ($aDirs as $sDir) {
             $sPath = M::PROJECT_ROOT() . '/' . $sDir . '/tpl.' . $sTemplate . '.php';
             if (file_exists($sPath)) {
                 self::_findJsFile($sTemplate);
                 self::_findCssFile($sTemplate);
                 if (isset($aArgs[0])) {
                     print Processor::evalString(file_get_contents($sPath), $aArgs[0]);
                 }
                 return;
             }
         }
     }
     throw new Exception("Template \"{$sTemplate}\" is not found");
 }
开发者ID:apodgorny,项目名称:minimum,代码行数:17,代码来源:class.T.php


示例17: connect

 public static function connect($sDb = null, $sHost = null, $sUser = null, $sPass = null)
 {
     self::disconnect();
     $sHost = $sHost ? $sHost : M::DB_HOST();
     $sUser = $sUser ? $sUser : M::DB_USER();
     $sPass = $sPass ? $sPass : M::DB_PASSWORD();
     $sDb = $sDb ? $sDb : M::DB_NAME();
     self::$_oDb = new mysqli($sHost, $sUser, $sPass, $sDb);
     self::$_oDb->set_charset('utf8');
     if (self::$_oDb->connect_errno) {
         switch (self::$_oDb->connect_errno) {
             case 2002:
                 throw new Exception('Mysql error: MYSQL SERVER IS DOWN');
             default:
                 throw new Exception('Mysql error: (' . self::$_oDb->connect_errno . ') ' . self::$_oDb->connect_error);
         }
     }
 }
开发者ID:apodgorny,项目名称:minimum,代码行数:18,代码来源:class.Mysql.php


示例18: up2Web

 public static function up2Web($img)
 {
     $msg = array();
     $fname = self::name(DATAROOT, 'up_', pathinfo($img['name']));
     $valid = self::validate($img, $fname);
     if (!$valid->success) {
         return M::cr(false, array(), $valid->msg);
     }
     // final move
     if (!move_uploaded_file($img['tmp_name'], DATAROOT . $fname)) {
         $msg[] = 'Failed to move uploaded file ' . $img['tmp_name'] . ' to ' . $fname;
     }
     // Check if $uploadOk is set to 0 by an error
     if (count($msg) > 0) {
         return M::cr(false, array(), implode(',', $msg));
     } else {
         return M::cr(true, array($fname));
     }
 }
开发者ID:scabros,项目名称:scabrosfw,代码行数:19,代码来源:File.php


示例19: execute

 public function execute($params)
 {
     if (count($params) > 0) {
         $tables = $params;
     } else {
         $tables = M::tablesWithPlugin('tag');
     }
     foreach ($tables as $table) {
         $records = DB_DataObject::factory($table);
         $records->find();
         $records->unloadPlugins();
         $this->line('');
         $this->line("clearing cache on {$table}");
         foreach ($records as $record) {
             $record->getPlugin('tag')->clearTagCache($record);
             echo '.';
         }
     }
 }
开发者ID:demental,项目名称:m,代码行数:19,代码来源:clearcache.php


示例20: run

 public function run()
 {
     //大类子类数据源
     $main = DefaultService::getMainCategorys(0);
     $main = DefaultService::findChild($main, 0);
     $maincate = DefaultService::findsub($main);
     //获取是经销商还是服务店菜单
     $params = M::getRoot();
     //组装参数
     $params["scope"] = "sliderbar";
     //指定定查询范围
     //获取菜单数组
     $navarr = FrontMenu::getChildMenu($params);
     foreach ($navarr as $key => $val) {
         if ($val['name'] != '信息管理') {
             unset($navarr[$key]);
             continue;
         }
     }
     $this->render('topNav', array('MainCategory' => $maincate, 'permenu' => $navarr));
 }
开发者ID:zwq,项目名称:unpei,代码行数:21,代码来源:MTopNav.php



注:本文中的M类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP MAX类代码示例发布时间:2022-05-23
下一篇:
PHP Lookup类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap