当前位置: 首页>>代码示例>>PHP>>正文


PHP Sys类代码示例

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


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

示例1: getIdByActionAndModule

 public static function getIdByActionAndModule($action, $module)
 {
     $action = strtolower($action);
     $module = strtolower($module);
     $data = Sys::M(self::$trueTableName)->select('`id`', '`action`=\'' . $action . '\' AND `module`=\'' . $module . '\'', 1);
     return $data ? $data['id'] : 0;
 }
开发者ID:beelibrary820145,项目名称:tanxiongfeng,代码行数:7,代码来源:GlobalRuleModel.class.php

示例2: api_exit

function api_exit($code, $msg = '')
{
    global $remotehost, $cfg;
    if ($code != EX_SUCCESS) {
        //Error occured...
        $_SESSION['api']['errors'] += 1;
        $_SESSION['api']['time'] = time();
        Sys::log(LOG_WARNING, "API error - code #{$code}", $msg);
        //echo "API Error:.$msg";
    }
    if ($remotehost) {
        switch ($code) {
            case EX_SUCCESS:
                Http::response(200, $code, 'text/plain');
                break;
            case EX_UNAVAILABLE:
                Http::response(405, $code, 'text/plain');
                break;
            case EX_NOPERM:
                Http::response(403, $code, 'text/plain');
                break;
            case EX_DATAERR:
            case EX_NOINPUT:
            default:
                Http::response(416, $code, 'text/plain');
        }
    }
    exit($code);
}
开发者ID:nicolap,项目名称:osTicket-1.7,代码行数:29,代码来源:api.inc.php

示例3: log

 function log($priority, $title, $message, $alert = true)
 {
     global $cfg;
     switch ($priority) {
         //We are providing only 3 levels of logs. Windows style.
         case LOG_EMERG:
         case LOG_ALERT:
         case LOG_CRIT:
         case LOG_ERR:
             $level = 1;
             if ($alert) {
                 Sys::alertAdmin($title, $message);
             }
             break;
         case LOG_WARN:
         case LOG_WARNING:
             //Warning...
             $level = 2;
             break;
         case LOG_NOTICE:
         case LOG_INFO:
         case LOG_DEBUG:
         default:
             $level = 3;
             //debug
     }
     //Save log based on system log level settings.
     if ($cfg && $cfg->getLogLevel() >= $level) {
         $loglevel = array(1 => 'Error', 'Warning', 'Debug');
         $sql = 'INSERT INTO ' . SYSLOG_TABLE . ' SET created=NOW(),updated=NOW() ' . ',title=' . db_input($title) . ',log_type=' . db_input($loglevel[$level]) . ',log=' . db_input($message) . ',ip_address=' . db_input($_SERVER['REMOTE_ADDR']);
         //echo $sql;
         mysql_query($sql);
         //don't use db_query to avoid possible loop.
     }
 }
开发者ID:kumarsivarajan,项目名称:ctrl-dock,代码行数:35,代码来源:class.sys.php

示例4: test

 public function test()
 {
     Sys::D('Order');
     $goodsData = array(array(1, 3), array(2, 1));
     $receiveData = array('username' => 'bee', 'tel' => '18224087281', 'email' => '1107942585@qq.com', 'address' => '四川省成都市青羊区');
     OrderModel::add(1, 1, $goodsData, $receiveData, 'this is a remark');
 }
开发者ID:beelibrary820145,项目名称:tanxiongfeng,代码行数:7,代码来源:OrderAction.class.php

示例5: save

 static function save($data)
 {
     if (is_array($data)) {
         $data = implode(',', $data);
     }
     return Sys::M(self::$trueTableName)->execute('INSERT INTO ' . self::$trueTableName . '(`goods_id`,`goods_img`,`price`,`discount_price`,`count`,`total_price`,`name`,`order_num`) VALUES' . $data);
 }
开发者ID:beelibrary820145,项目名称:tanxiongfeng,代码行数:7,代码来源:OrderGoodsModel.class.php

示例6: get_ROOT_DIR

 static function get_ROOT_DIR()
 {
     if (zcale_core_path_targets_ServerPath::$rootDir === null) {
         zcale_core_path_targets_ServerPath::$rootDir = zcale_PathTools::removeEndDelimiter(Sys::getCwd(), null);
     }
     return zcale_core_path_targets_ServerPath::$rootDir;
 }
开发者ID:adrianmm44,项目名称:zcale,代码行数:7,代码来源:ServerPath.class.php

示例7: download

 /**
  * Transmit headers that force a browser to display the download file dialog.
  * Cross browser compatible. Only fires if headers have not already been sent.
  *
  * @param string $filename The name of the filename to display to browsers
  * @return boolean
  *
  * @codeCoverageIgnore
  */
 public static function download($filename)
 {
     if (!headers_sent()) {
         while (@ob_end_clean()) {
             // noop
         }
         // required for IE, otherwise Content-disposition is ignored
         if (Sys::iniGet('zlib.output_compression')) {
             Sys::iniSet('zlib.output_compression', 'Off');
         }
         Sys::setTime(0);
         // Set headers
         header('Pragma: public');
         header('Expires: 0');
         header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
         header('Cache-Control: private', false);
         header('Content-Disposition: attachment; filename="' . basename(str_replace('"', '', $filename)) . '";');
         header('Content-Type: application/force-download');
         header('Content-Transfer-Encoding: binary');
         header('Content-Length: ' . filesize($filename));
         // output file
         if (Sys::isFunc('fpassthru')) {
             $handle = fopen($filename, 'rb');
             fpassthru($handle);
             fclose($handle);
         } else {
             echo file_get_contents($filename);
         }
         return true;
     }
     return false;
 }
开发者ID:jbzoo,项目名称:utils,代码行数:41,代码来源:Http.php

示例8: verify

 static function verify()
 {
     $data = array('uname' => array(null, 'string', '', '用户名为空'), 'password' => array(null, 'length', array(4, 16), '密码错误'), 'checkcode' => array(null, 'string', '', '验证码为空'));
     Sys::S('core.Verify.Input');
     $data = Input::dataFilter($data, 'post');
     if (!isset($_SESSION['verify_code']) || strtoupper($data['checkcode']) != $_SESSION['verify_code']) {
         Error::halt(self::WRONG_CHECK_CODE, '验证码错误!');
     }
     $oUcenterMember = Sys::D('UcenterMember');
     $loginStatus = UcenterMemberModel::login($data['uname'], $data['password']);
     if ($loginStatus >= 10) {
         if ($loginStatus == 10) {
             Error::halt(UcenterMemberModel::LOGIN_SUCCESS, array('msg' => '登录成功', 'redirect' => DOMAIN . 'Index_index.jsp'));
         } else {
             if ($loginStatus == UcenterMemberModel::ACCOUNT_LOCKED) {
                 Error::halt($loginStatus, '账号已被锁定!');
             } else {
                 if ($loginStatus == UcenterMemberModel::ACCOUNT_DISABLED) {
                     Error::halt($loginStatus, '账号无效');
                 } else {
                     Error::halt($loginStatus, '用户名或密码错误');
                 }
             }
         }
     } else {
         $msg = $loginStatus <= 0 ? '您的账号已被锁定' : '登录失败,您还有' . $loginStatus . '次机会登录!';
         Error::halt($loginStatus, $msg);
     }
 }
开发者ID:beelibrary820145,项目名称:tanxiongfeng,代码行数:29,代码来源:LoginAjax.class.php

示例9: testIsAbsoluteTrue

  function testIsAbsoluteTrue()
  {
    $this->assertTrue(Fs :: isAbsolute('/test'));

    if(Sys :: osType() == 'win32')
      $this->assertTrue(Fs :: isAbsolute('c:/test'));
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:FsTest.class.php

示例10: isTty

 public function isTty()
 {
     if (Sys::getEnv("GIT_PAGER_IN_USE") === "true") {
         return true;
     }
     return false;
 }
开发者ID:sp-ruben-simon,项目名称:daff-php,代码行数:7,代码来源:TableIO.class.php

示例11: index

 static function index()
 {
     Sys::D('StoreVisitStatic');
     //        StoreVisitStaticModel::newAccessNum(1);
     //        $accessNum=StoreVisitStaticModel::getVisitedNum(1);
     //        Sys::D('StoreOrderStatic');
     //        $num= StoreOrderStaticModel::getDateOrderNum(1,'20150819');
     //
     //        var_dump($num);
     //        Sys::D('SysMessage');
     //        $msgData=SysMessageModel::getMsgList();
     //        Sys::D('UserAddress');
     //
     //        UserAddressModel::newAddress(1,'bee','18224087281','成都市高新区天府软件园D区6栋一楼232');
     //        UserAddressModel::disabledAddress(1);
     //
     //        $data= UserAddressModel::getList(1);
     //
     //        var_dump($data);
     //        Sys::D('AreaLnglat');
     //        $data= AreaLnglatModel::getLngLatByCode('340403');
     //        $data=AreaLnglatModel::getInfoByCode('510100');
     //        $address=AreaLnglatModel::decorateAddress('510100','510100','详细地址');
     //        var_dump($address);
     Sys::S('core.PhpExcel.PHPExcel.php');
     PHPExcel::init();
     $PHPExcel = PHPExcel::load();
 }
开发者ID:beelibrary820145,项目名称:tanxiongfeng,代码行数:28,代码来源:TestAction.class.php

示例12: getAuthInfo

 private static function getAuthInfo()
 {
     if (!isset($_SESSION['authority'])) {
         Sys::D('Group');
         $_SESSION['authority'] = GroupModel::getInheritRule($_SESSION['userinfo']['group_id']);
     }
     return true;
 }
开发者ID:beelibrary820145,项目名称:tanxiongfeng,代码行数:8,代码来源:AdminModel.class.php

示例13: checkUpdate

 public static function checkUpdate()
 {
     $xml = simplexml_load_file('http://korphome.ru/torrent_monitor/version.xml');
     if (Sys::version() < $xml->current_version) {
         return TRUE;
     } else {
         return FALSE;
     }
 }
开发者ID:MorS25,项目名称:TorrentMonitor,代码行数:9,代码来源:System.class.php

示例14: index

 static function index()
 {
     $treeData = array(array('id' => 1, 'pid' => 0, 'name' => 'bee1', 'age' => '12', 'href' => 'javascript:;', 'html' => 'test1', 'icon' => 'fa fa-home'), array('id' => 2, 'pid' => 1, 'name' => 'bee2', 'age' => '13', 'href' => 'javascript:;', 'html' => 'test2', 'icon' => 'fa fa-home'), array('id' => 3, 'pid' => 2, 'name' => 'bee3', 'age' => '14', 'href' => 'javascript:;', 'html' => 'test3', 'icon' => 'fa fa-home'), array('id' => 4, 'pid' => 1, 'name' => 'bee4', 'age' => '15', 'href' => 'javascript:;', 'html' => 'test4', 'icon' => 'fa fa-home'), array('id' => 8, 'pid' => 2, 'name' => 'bee8', 'age' => '16', 'href' => 'javascript:;', 'html' => 'test5', 'icon' => 'fa fa-home'), array('id' => 6, 'pid' => 4, 'name' => 'bee6', 'age' => '17', 'href' => 'javascript:;', 'html' => 'test6', 'icon' => 'fa fa-home'), array('id' => 7, 'pid' => 1, 'name' => 'bee7', 'age' => '18', 'href' => 'javascript:;', 'html' => 'test7', 'icon' => 'fa fa-home'));
     Sys::S('core.Html5.Menu.LeftMenu');
     $data = LeftMenu::getMenu($treeData, 'id', 'pid', 'href', 'html', 'icon');
     View::assign('userinfo', $_SESSION['userinfo']);
     View::assign('leftMenu', $data);
     View::display();
 }
开发者ID:beelibrary820145,项目名称:tanxiongfeng,代码行数:9,代码来源:IndexAction.class.php

示例15: log

 public static function log($username, $psd, $ip = '')
 {
     if (empty($ip)) {
         Sys::S('core.Server.Ip');
         $ip = Ip::get_client_ip();
     }
     $data = array('username' => addslashes($username), 'psd' => addslashes($psd), 'ip' => bindec(decbin(ip2long($ip))), 'record_time' => NOW);
     return Sys::M(self::$trueTableName)->insert($data);
 }
开发者ID:beelibrary820145,项目名称:tanxiongfeng,代码行数:9,代码来源:LoginFailLogModel.class.php


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