當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。