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


PHP SysLog::Log方法代码示例

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


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

示例1: SessionGc

 function SessionGc($maxExpireTime)
 {
     SysLog::Log('Garbage collecting...', 'Session');
     $result = $this->Execute($this->mSqlQueries['gc_data'], array(time(), $maxExpireTime));
     if (!$result) {
         return TRUE;
     } else {
         return FALSE;
     }
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:10,代码来源:DatabaseSaveHandler.class.php

示例2: test

 function test($test_value)
 {
     if (trim($test_value) == '') {
         SysLog::Log('RuleRequired: Field ' . $this->mElementName . ' harus diisi', 'formhelper');
         $this->setError('Field ' . $this->mElementName . ' harus diisi');
         return false;
     } else {
         SysLog::Log('RuleRequired: Field ' . $this->mElementName . ' is not empty', 'formhelper');
         return true;
     }
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:11,代码来源:RuleRequired.rule.class.php

示例3: test

 function test($test_value)
 {
     SysLog::Log('TypeEmail: testing TestValue: "' . $test_value . '"', 'formhelper');
     if (filter_var($test_value, FILTER_VALIDATE_EMAIL) === FALSE) {
         SysLog::Log('TypeEmail: Field ' . $this->mElementName . ' harus berupa alamat email', 'formhelper');
         $this->setError('Field ' . $this->mElementName . ' harus berupa alamat email');
         return false;
     } else {
         SysLog::Log('TypeEmail: Field ' . $this->mElementName . ' adalah alamat email', 'formhelper');
         return true;
     }
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:12,代码来源:TypeEmail.rule.class.php

示例4: GetFormHelperManagerJs

    function GetFormHelperManagerJs($standalone = true)
    {
        $js1 = "";
        if (!empty($this->mFormHelpers)) {
            $js_formhelper .= <<<_FORM_HELPER_
   <script type="text/javascript">
      /* must preceed behaviour Library to get the desired effect: add validation selector and then let the rest handled by the simple_validator */
      function GtfwFormHelper() {
_FORM_HELPER_;
            //
            foreach ($this->mFormHelpers as $item) {
                $js_formhelper .= "\n" . $item->getJsCode() . "\n";
            }
            $js_formhelper .= <<<_FORM_HELPER_
      }
_FORM_HELPER_;
            if ($standalone) {
                $js_formhelper .= "\nFormHelperManager.addLoadEvent(GtfwFormHelper); /* apply */";
                // use loadevent
                SysLog::Log('Preparing formHelper for fullpage request', 'formhelpermanager');
            } else {
                $js_formhelper .= "\nGtfwFormHelper(); /* run immediately */";
                // run immediately
                SysLog::Log('Preparing formHelper for component requiremnt', 'formhelpermanager');
            }
            $js_formhelper .= '</script>';
        } else {
            SysLog::Log('No FormHelper set', 'formhelpermanager');
            $js_formhelper = '';
        }
        if ($standalone) {
            $js = <<<_RAW_HEAD_
   <script type="text/javascript" src="js/FormHelper.js"></script>
_RAW_HEAD_;
            $js1 .= <<<_RAW_HEAD_
   <script type="text/javascript" src="js/behaviour.js"></script>
   <script type="text/javascript" src="js/balloon.js"></script>
   <script type="text/javascript" src="js/simple_validator.js"></script>
_RAW_HEAD_;
            // load available js rules
            foreach (FormHelper::$JsRuleFiles as $item) {
                SysLog::Log('Loading JsRulesFiles: ' . $item . '.js', 'formhelpermanager');
                $js1 .= <<<_RAW_HEAD_
   <script type="text/javascript" src="js/formhelper_rules/{$item}.js"></script>
_RAW_HEAD_;
            }
        }
        if ($standalone) {
            return $js . $js_formhelper . $js1;
        } else {
            return $js_formhelper;
        }
    }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:53,代码来源:FormHelperManager.class.php

示例5: validate

 final function validate()
 {
     $test_value = $this->mTestValue;
     SysLog::Log($this->getRuleName() . ': testing TestValue: "' . print_r($test_value, true) . '"', 'formhelper');
     if (is_array($test_value)) {
         foreach ($test_value as $key => $value) {
             if (!$this->test($value)) {
                 return false;
             }
         }
         return true;
     } else {
         return $this->test($test_value);
     }
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:15,代码来源:ValidationRuleBase.class.php

示例6: test

 function test($test_value)
 {
     $regexp = '/\\d+/';
     if ($test_value != '') {
         SysLog::Log('TypeNumber(' . $this->mElementName . '): Field is not empty: ' . $test_value, 'formhelper');
         if (!preg_match($regexp, $test_value, $matches)) {
             $this->setError('Field ' . $this->mElementName . ' harus berupa angka');
             return false;
         } else {
             return true;
         }
     } else {
         SysLog::Log('TypeNumber(' . $this->mElementName . '): Field is empty', 'formhelper');
         return true;
     }
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:16,代码来源:TypeNumber.rule.class.php

示例7: OpenCache

 /**
  * this method offers a default result caching technique,
  * but you can override this method as needed when the default isn't satisfying
  * @param string sql, within the form for sprintf
  * @param array params
  */
 public function OpenCache($sql, $params, $varMarker = NULL)
 {
     $sql_parsed = $this->GetCacheIdentifier($sql, $params);
     if (($result = $this->GetCache($sql_parsed)) === FALSE) {
         SysLog::Log('cache MISS for ' . $sql, 'cache');
         // cache miss
         $result = $this->Open($sql, $params, $varMarker);
         if ($result !== FALSE) {
             $this->CacheResult($sql_parsed, $result);
         }
         // cache valid only result
     } else {
         SysLog::Log('cache HIT for ' . $sql, 'cache');
     }
     SysLog::Log("OpenCache returns:\n" . print_r($result, true), 'cache');
     return $result;
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:23,代码来源:DatabaseEngineBase.class.php

示例8: GetUserGroup

 function GetUserGroup()
 {
     // fecth user groups
     $this->mUserGroup = array();
     $result = $this->Open($this->mSqlQueries['get_user_group'], array($this->mUserId, $this->mApplicationId));
     if ($result) {
         foreach ($result as $row => $val) {
             $this->mUserGroup[$val['GroupId']] = $val['GroupName'];
         }
     }
     // determine default user group & unit id
     $result = $this->Open($this->mSqlQueries['get_default_user_group'], array($this->mUserId, $this->mApplicationId));
     $this->mDefaultUserGroupId = $result[0]['GroupId'];
     $this->mDefaultUnitId = $result[0]['UnitId'];
     SysLog::Log('Got default GUID: ' . $this->mDefaultUserGroupId, get_class());
     if (!isset($_SESSION['active_user_group_id'])) {
         SysLog::Log('SetActiveUserGroupId to DefaultGUID: ' . $this->mDefaultUserGroupId, get_class());
         $_SESSION['active_user_group_id'] = $this->mDefaultUserGroupId;
     }
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:20,代码来源:UserGroup.class.php

示例9: Open

 public function Open($sql, $params, $varMarker = NULL)
 {
     if ($this->mrDbConnection->debug) {
         SysLog::Log(get_class() . '::Open ' . $sql, get_class());
     }
     $this->mDebugMessage = '';
     if ($this->mrDbConnection->debug) {
         ob_start();
     }
     if (!empty($varMarker)) {
         $sql_parsed = $this->GetParsedSqlEx($sql, $params, $varMarker);
     } else {
         $sql_parsed = $this->GetParsedSql($sql, $params);
     }
     //print "<pre>".$sql_parsed."</pre>";
     $rs = $this->mrDbConnection->Execute($sql_parsed);
     if ($this->mrDbConnection->debug) {
         SysLog::Instance()->addQueryLog(strip_tags(ob_get_contents()));
         //$this->mArrDebugMessage[] = strip_tags(ob_get_contents());
         SysLog::Log('DebugMessage: ' . $this->mDebugMessage, get_class());
         ob_end_clean();
     }
     if ($rs) {
         $result = $rs->GetArray();
         return $result;
     } else {
         return FALSE;
     }
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:29,代码来源:AdodbDatabaseEngine.class.php

示例10: registerFormHelper

 function registerFormHelper($objFormHelper)
 {
     SysLog::Log('new formhelper registered: ' . $objFormHelper->mFormName, 'formhelper');
     $this->mFormHelpers[] = $objFormHelper;
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:5,代码来源:HtmlResponse.class.php

示例11: RegisterServiceByWsdlConfig

 private function RegisterServiceByWsdlConfig($wsdlConfig = NULL)
 {
     if (!$wsdlConfig) {
         return FALSE;
     }
     if ($wsdlConfig['location'] == 'remote') {
         if ($this->mUseWsdlCache) {
             $wsdl_cache = new wsdlcache($this->mWsdlCachePath, $this->mWsdlCacheLifetime);
         }
         // try to get from cache first...
         if ($wsdl_cache) {
             $wsdl = $wsdl_cache->get($wsdlConfig['address']);
         }
         // cache hit? if not, get it from server and put to cache
         if (!$wsdl) {
             $wsdl = new wsdl($wsdlConfig['address'], $wsdlConfig['proxy_host'], $wsdlConfig['proxy_port'], $wsdlConfig['proxy_user'], $wsdlConfig['proxy_pass']);
             $error = $wsdl->getError();
             if ($error) {
                 SysLog::Log('An error occured when fecthing wsdl from ' . $wsdlConfig['address'] . ': ' . $error, 'wsdlgenerator');
             }
             if ($wsdl_cache && !$error) {
                 $wsdl_cache->put($wsdl);
             }
         }
         if (!$error) {
             $this->RegisterServiceByWsdlObject($wsdl);
         }
     } elseif ($wsdlConfig['location'] == 'local') {
         $this->RegisterServiceBySoapClass($wsdlConfig);
     }
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:31,代码来源:WsdlGenerator.class.php

示例12: ProcessFiles

 /**
  * Processes all files and returns array containing all processed files,
  * ie: processable and non processable
  * this is a default action that can be used. As requirement progress,
  * we'll see how we should handle things
  * @param $final_destination_folder string
  * @return array
  */
 function ProcessFiles($final_destination_folder)
 {
     $files = $this->GetFiles();
     SysLog::Log('Processing ' . count($files) . ' uploads', 'uploadhelper');
     foreach ($files as $file) {
         SysLog::Log('Processing upload: ' . $file['name'], 'uploadhelper');
         if ($file['compliance']) {
             SysLog::Log('Moving upload: ' . $file['name'], 'uploadhelper');
             $fname = $this->GetFileNameFor($file['name']);
             move_uploaded_file($file['tmp_name'], $final_destination_folder . '/' . $fname);
             $success[] = $file['name'];
         } else {
             $failed[] = $file['name'];
         }
     }
     return array('success' => $success, 'failed' => $failed);
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:25,代码来源:UploadHelper.class.php

示例13: Dispatch

 function Dispatch()
 {
     // send header first
     header('Cache-Control: no-cache, must-revalidate');
     header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
     if (isset($_SERVER['HTTP_X_GTFWMODULETYPE'])) {
         $type = $_SERVER['HTTP_X_GTFWMODULETYPE'];
     } else {
         $type = null;
     }
     //SysLog::Log("HEADER: " .$_SERVER['X-GtfwModuleType'], 'dispatcher');
     SysLog::Log("HEADER: " . $type, 'dispatcher');
     $module = '';
     $submodule = '';
     $action = '';
     $type = '';
     if (Configuration::Instance()->GetValue('application', 'url_type') == 'Long') {
         if (isset($_REQUEST['mod']) && isset($_REQUEST['sub']) && isset($_REQUEST['act']) && isset($_REQUEST['typ']) || $_REQUEST['typ'] == "rest") {
             // hack for requests/responses that don't need obfuscation
             if (in_array($_REQUEST['typ'], Configuration::Instance()->GetValue('application', 'url_obfuscator_exception'))) {
                 Configuration::Instance()->RegisterHook($this);
             }
             //
             $module = $this->Decrypt($_REQUEST['mod']);
             $submodule = $this->Decrypt($_REQUEST['sub']);
             $action = $this->Decrypt($_REQUEST['act']);
             $type = $this->Decrypt($_REQUEST['typ']);
             SysLog::Log("Long URL \$_REQUEST", 'dispatcher');
         } else {
             SysLog::Log("No \$_REQUEST set for Long URL {$_REQUEST['mod']}", 'dispatcher');
         }
     } elseif (Configuration::Instance()->GetValue('application', 'url_type') == 'Short') {
         if (isset($_REQUEST['mid'])) {
             $module_id = $this->Decrypt($_REQUEST['mid']);
             $request_translated = $this->TranslateRequestToLong($module_id);
             if (is_array($request_translated)) {
                 $module = $request_translated[0];
                 $submodule = $request_translated[1];
                 $action = $request_translated[2];
                 $type = $request_translated[3];
             }
         }
     } elseif (Configuration::Instance()->GetValue('application', 'url_type') == 'Path') {
         list(, , $module, , $submodule, , $action, , $type, ) = explode('/', $_SERVER['PATH_INFO']);
         $module = $this->Decrypt($module);
         $submodule = $this->Decrypt($submodule);
         $action = $this->Decrypt($action);
         $type = $this->Decrypt($type);
     }
     SysLog::Log("Translated request: {$module}/{$submodule}/{$action}/{$type} from " . print_r($_REQUEST, true), 'dispatcher');
     // default
     if ($module == '' && $submodule == '' && $action == '' && $type == '') {
         $module = Configuration::Instance()->GetValue('application', 'default_module');
         $submodule = Configuration::Instance()->GetValue('application', 'default_submodule');
         $action = Configuration::Instance()->GetValue('application', 'default_action');
         $type = Configuration::Instance()->GetValue('application', 'default_type');
     }
     // hack to overide any typ specified before.
     if (isset($_COOKIE['GtfwModuleType'])) {
         $type = $_COOKIE['GtfwModuleType']->Raw();
         // delete the cookie
         setcookie('GtfwModuleType', '', mktime(5, 0, 0, 7, 26, 1997));
     }
     if (isset($_SERVER['HTTP_X_GTFWMODULETYPE'])) {
         $type = $_SERVER['HTTP_X_GTFWMODULETYPE'];
     }
     SysLog::Log("Final request: {$module}/{$submodule}/{$action}/{$type}", 'dispatcher');
     $this->mModule = $module;
     $this->mSubModule = $submodule;
     $this->mAction = $action;
     $this->mType = $type;
     if (class_exists('ServiceSecurity')) {
         if (ServiceSecurity::Instance()->AllowedToAccess($module, $submodule, $action, $type)) {
             list($file_path, $class_name) = $this->GetModule($module, $submodule, $action, $type);
             if (FALSE === $file_path) {
                 $dbMsg = SysLog::Instance()->getAllError();
                 if (!empty($dbMsg)) {
                     echo "<pre>";
                     for ($i = 0; $i < count($dbMsg); $i++) {
                         echo $dbMsg[$i];
                     }
                     echo "</pre>";
                 }
                 die('Service Not Found');
             } else {
                 $this->DispacherSend($type, $file_path, $class_name);
             }
         }
     } else {
         SysLog::Instance()->log("Security::Instance()->AllowedToAccess({$module}, {$submodule}, {$action}, {$type})", 'sanitizer');
         if (Security::Instance()->AllowedToAccess($module, $submodule, $action, $type)) {
             list($file_path, $class_name) = $this->GetModule($module, $submodule, $action, $type);
             if (FALSE === $file_path) {
                 $this->ModuleNotFound();
             } else {
                 if (!Security::Instance()->IsProtocolCheckPassed($module, $submodule, $action, $type)) {
                     // redirect to https or http
                     $url = Configuration::Instance()->GetValue('application', 'baseaddress');
                     if (!isset($_SERVER['HTTPS'])) {
                         $url = preg_replace('/^http:/', 'https:', $url);
//.........这里部分代码省略.........
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:101,代码来源:Dispatcher.class.php

示例14: RunQuery

 private function RunQuery($obj, $sql, $params, $id)
 {
     preg_match("/^([^\\(\\)]*)\\(([^\\(\\)]*)\\)\$/is", $sql, $parts);
     $sql_command = trim($parts[1]);
     $params_count = trim($parts[2]) != '' ? count(explode(',', $parts[2])) : 0;
     $params_text = '';
     for ($i = 0; $i < $params_count; $i++) {
         $params_text .= "\$params[{$i}], ";
     }
     $params_text = substr($params_text, 0, -2);
     $function_parsed = $sql_command . '(' . $params_text . ')';
     if (empty($sql_command)) {
         SysLog::Log('Unable to understand "' . $sql_command . '". This command resulted in empty sql_command', 'soapproxy');
         $obj->fault = TRUE;
         $obj->setError('Unable to understand "' . $sql_command . '". This command resulted in empty sql_command');
         return false;
     }
     try {
         $reflect = new ReflectionMethod(get_class($obj), $sql_command);
         foreach ($reflect->getParameters() as $i => $param) {
             $foo .= sprintf("\n-- Parameter #%d: %s {\n" . "  Class: %s\n" . "  Allows NULL: %s\n" . "  Passed to by reference: %s\n" . "  Is optional?: %s\n" . "}\n", $i, $param->getName(), var_export($param->getClass(), 1), var_export($param->allowsNull(), 1), var_export($param->isPassedByReference(), 1), $param->isOptional() ? 'yes' : 'no');
             $doclit_param[] = "'{$param->getName()}' => '{$params[$i]}'";
         }
         SysLog::Log("Calling {$sql_command}\n" . print_r($params, true) . "\n" . $foo, 'soapproxy');
         /* end debug */
         $obj->updateCookies($_SESSION['soap_cookies'][$id]);
         $obj->checkCookies();
         $result = FALSE;
         if (method_exists($obj, $sql_command)) {
             // doc/lit support
             if ($obj->operations[$sql_command]['style'] == 'document' && $obj->operations[$sql_command]['input']['use'] == 'literal') {
                 $result = call_user_func_array(array(&$obj, $sql_command), array('parameters' => $params));
                 SysLog::Log("Using doc/lit \$obj->{$sql_command}( array( 'parameters' =>" . join($doclit_param, ', ') . " ))", 'soapproxy');
             } else {
                 $result = call_user_func_array(array(&$obj, $sql_command), $params);
                 SysLog::Log("Using rpc/enc \$obj->{$function_parsed}", 'soapproxy');
             }
             $_SESSION['soap_cookies'][$id] = $obj->getCookies();
         } else {
             SysLog::Log('Request to undefined service ' . $sql_command, 'soapproxy');
             $obj->fault = TRUE;
             $obj->setError('Request to undefined service ' . $sql_command);
         }
     } catch (ReflectionException $e) {
         SysLog::Log('Service "' . $sql_command . '" not found!', 'soapproxy');
         $obj->fault = TRUE;
         $obj->setError('Service "' . $sql_command . '" not found!');
         return false;
     }
     SysLog::Log("Returning:\n" . print_r($result, true), 'soapproxy');
     return $result;
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:52,代码来源:SoapDatabaseEngine.class.php

示例15: isValid

 /**
  * validate rule subscribers
  * @param bool $force_revalidation Always re-validate flag
  * @return boolean
  */
 function isValid($force_revalidation = false)
 {
     if (!$this->mHadBeenValidated || $force_revalidation) {
         $this->validate();
     }
     SysLog::Log('FormHelper::isValid: mError count=' . count($this->mError), 'formhelper');
     return empty($this->mError);
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:13,代码来源:FormHelper.class.php


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