1--TEST-- 2ldap_get_option() - More ldap_get_option() operations 3--CREDITS-- 4Patrick Allaert <patrickallaert@php.net> 5# Belgian PHP Testfest 2009 6--SKIPIF-- 7<?php require_once('skipif.inc'); ?> 8--FILE-- 9<?php 10require "connect.inc"; 11 12$link = ldap_connect($host, $port); 13$option = null; 14 15$controls = array( 16 array("oid" => "1.2.752.58.10.1", "iscritical" => true), 17 array("oid" => "1.2.752.58.1.10", "value" => "magic"), 18); 19 20ldap_set_option($link, LDAP_OPT_DEREF, LDAP_DEREF_NEVER); 21ldap_set_option($link, LDAP_OPT_SIZELIMIT, 123); 22ldap_set_option($link, LDAP_OPT_TIMELIMIT, 33); 23ldap_set_option($link, LDAP_OPT_NETWORK_TIMEOUT, 44); 24ldap_set_option($link, LDAP_OPT_TIMEOUT, 55); 25ldap_set_option($link, LDAP_OPT_REFERRALS, false); 26ldap_set_option($link, LDAP_OPT_SERVER_CONTROLS, $controls); 27ldap_set_option($link, LDAP_OPT_CLIENT_CONTROLS, $controls); 28ldap_set_option($link, LDAP_OPT_RESTART, false); 29 30var_dump( 31 ldap_get_option($link, LDAP_OPT_DEREF, $option), 32 $option, 33 ldap_get_option($link, LDAP_OPT_SIZELIMIT, $option), 34 $option, 35 ldap_get_option($link, LDAP_OPT_TIMELIMIT, $option), 36 $option, 37 ldap_get_option($link, LDAP_OPT_NETWORK_TIMEOUT, $option), 38 $option, 39 ldap_get_option($link, LDAP_OPT_TIMEOUT, $option), 40 $option, 41 ldap_get_option($link, LDAP_OPT_REFERRALS, $option), 42 $option, 43 ldap_get_option($link, LDAP_OPT_RESTART, $option), 44 $option, 45 ldap_get_option($link, LDAP_OPT_SERVER_CONTROLS, $option), 46 $option, 47 ldap_get_option($link, LDAP_OPT_CLIENT_CONTROLS, $option), 48 $option 49); 50?> 51===DONE=== 52--EXPECT-- 53bool(true) 54int(0) 55bool(true) 56int(123) 57bool(true) 58int(33) 59bool(true) 60int(44) 61bool(true) 62int(55) 63bool(true) 64int(0) 65bool(true) 66int(0) 67bool(true) 68array(2) { 69 [0]=> 70 array(2) { 71 ["oid"]=> 72 string(15) "1.2.752.58.10.1" 73 ["iscritical"]=> 74 bool(true) 75 } 76 [1]=> 77 array(3) { 78 ["oid"]=> 79 string(15) "1.2.752.58.1.10" 80 ["iscritical"]=> 81 bool(false) 82 ["value"]=> 83 string(5) "magic" 84 } 85} 86bool(true) 87array(2) { 88 [0]=> 89 array(2) { 90 ["oid"]=> 91 string(15) "1.2.752.58.10.1" 92 ["iscritical"]=> 93 bool(true) 94 } 95 [1]=> 96 array(3) { 97 ["oid"]=> 98 string(15) "1.2.752.58.1.10" 99 ["iscritical"]=> 100 bool(false) 101 ["value"]=> 102 string(5) "magic" 103 } 104} 105===DONE=== 106