Subversion Repositories php_utils

Rev

Rev 11 | Rev 77 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 11 Rev 24
Line 23... Line 23...
23
        protected $conn = null;
23
        protected $conn = null;
24
 
24
 
25
        private static function _L($str, ...$sprintfArgs) {
25
        private static function _L($str, ...$sprintfArgs) {
26
                if (function_exists('_L')) {
26
                if (function_exists('_L')) {
27
                        return _L($str, $sprintfArgs);
27
                        return _L($str, $sprintfArgs);
28
                } else {
28
                } else if (function_exists('my_vsprintf')) {
29
                        return my_vsprintf($str, $sprintfArgs);
29
                        return my_vsprintf($str, $sprintfArgs);
-
 
30
                } else {
-
 
31
                        $n = 1;
-
 
32
                        foreach ($sprintfArgs as $val) {
-
 
33
                                $str = str_replace("%$n", $val, $str);
-
 
34
                                $n++;
-
 
35
                        }
-
 
36
                        $str = str_replace("%%", "%", $str);
-
 
37
                        return $str;
30
                }
38
                }
31
        }
39
        }
32
 
40
 
33
        public static function getString($ldap_userinfo, $attributeName) {
41
        public static function getString($ldap_userinfo, $attributeName) {
34
                $ary = self::getArray($ldap_userinfo, $attributeName);
42
                $ary = self::getArray($ldap_userinfo, $attributeName);