Overview
  • Namespace
  • Class

Namespaces

  • rpf
    • api
      • module
    • extension
      • module
    • system
      • module

Classes

  • rpf\api\api
  • rpf\api\apiModule
  • rpf\api\bbRpc
  • rpf\api\module\bbCustomer_getFreeOrdNr
  • rpf\api\module\bbCustomer_readAddress
  • rpf\api\module\bbCustomer_readDiscount
  • rpf\api\module\bbCustomer_readEntry
  • rpf\api\module\bbCustomer_readPayment
  • rpf\api\module\bbCustomer_readTitle
  • rpf\api\module\bbCustomer_saveAdress
  • rpf\api\module\bbCustomer_validateAddress
  • rpf\api\module\bbCustomer_validateEntry
  • rpf\api\module\bbCustomer_validatePayinfo
  • rpf\api\module\bbDomain_readEntry
  • rpf\api\module\bbDomain_readFrontpage
  • rpf\api\module\bbDomain_readHandles
  • rpf\api\module\bbDomain_readPhpini
  • rpf\api\module\bbDomain_readSettings
  • rpf\api\module\bbDomain_readSubdomain
  • rpf\api\module\bbDomain_readWebalizerSettings
  • rpf\api\module\bbDomain_searchEntry
  • rpf\api\module\bbEmail_readAccount
  • rpf\api\module\bbMysql_inuseEntry
  • rpf\api\module\bbMysql_makeBackup
  • rpf\api\module\bbMysql_readEntry
  • rpf\api\module\bbOrder_readAccountAddress
  • rpf\api\module\bbOrder_readAccountEntry
  • rpf\api\module\bbOrder_readDisposition
  • rpf\api\module\bbOrder_readEntry
  • rpf\api\module\bbQuota_readEntry
  • rpf\api\module\customer
  • rpf\api\module\email
  • rpf\api\module\order
  • rpf\api\module\placeholder
  • rpf\api\module\user
  • rpf\extension\extension
  • rpf\extension\extensionModule
  • rpf\extension\invoiceTextExport
  • rpf\extension\mailExport
  • rpf\extension\module\domainExport
  • rpf\extension\module\index
  • rpf\extension\module\mgntRatioExport
  • rpf\system\module
  • rpf\system\module\log
  • rpf\system\module\moduleManager
  • rpf\system\rpf

Exceptions

  • rpf\system\module\exception
 1 <?php
 2 
 3 namespace rpf\system\module;
 4 
 5 class log
 6 {
 7     protected static function add($level, $desc, $context = NULL, $param = NULL)
 8     {
 9         $dir = __DIR__.'/../../../logs/';
10         $file = $dir.'syslog_'.date("ymd").'_1SRV.log';
11 
12         $text = str_pad('['.date("r",time())."] [$level]", 41);
13         if (RPF_DEBUG == true)
14         {
15             $context = strpos($context, ')') === false ? $context.'()' : $context;
16             $text = str_pad("$text $context;", 120)."// $desc";
17 
18             if (\is_array($param) && count($param) == 1)
19             {
20                 foreach ($param as $name => $value)
21                 {
22                     $text .= " | $name: $value";
23                 }
24             }
25             elseif (is_array($param) || is_object($param))
26             {
27                 //$text .= ' | '.json_encode($param);
28                 //$text .= "\n".print_r($param, 1)."\n";
29             }
30             elseif (!empty($param))
31             {
32                 $text .= " | $param";
33             }
34         }
35         else
36         {
37             $text .= $desc;
38         }
39         $text .= "\n";
40 
41         $fp = fopen($file, 'a');
42         fwrite($fp, $text);
43         fclose($fp);
44         return true;
45     }
46 
47     public static function debug($desc, $context, $array = NULL)
48     {
49         if (RPF_DEBUG == true)
50         {
51             return self::add(__FUNCTION__, $desc, $context, $array);
52         }
53         else
54         {
55             return true;
56         }
57     }
58 
59     public static function notice($desc, $context, $array = NULL)
60     {
61         return self::add(__FUNCTION__, $desc, $context, $array);
62     }
63 
64     public static function info($desc, $context, $array = NULL)
65     {
66         return self::add(__FUNCTION__, $desc, $context, $array);
67     }
68 
69     public static function warning($desc, $context, $array = NULL)
70     {
71         return self::add(__FUNCTION__, $desc, $context, $array);
72     }
73 
74     public static function error($desc, $context, $array = NULL)
75     {
76         return self::add(__FUNCTION__, $desc, $context, $array);
77     }
78 }
API documentation generated by ApiGen