Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
Complex classes like ServerXmlConfiguration often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use ServerXmlConfiguration, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 35 | class ServerXmlConfiguration implements ServerConfigurationInterface |
||
| 36 | { |
||
| 37 | |||
| 38 | /** |
||
| 39 | * The configured rewrite rules |
||
| 40 | * |
||
| 41 | * @var array |
||
| 42 | */ |
||
| 43 | protected $rewrites = array(); |
||
| 44 | |||
| 45 | /** |
||
| 46 | * The configured locations. |
||
| 47 | * |
||
| 48 | * @var array |
||
| 49 | */ |
||
| 50 | protected $locations = array(); |
||
| 51 | |||
| 52 | /** |
||
| 53 | * The configured headers |
||
| 54 | * |
||
| 55 | * @var array |
||
| 56 | */ |
||
| 57 | protected $headers = array(); |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Holds the environmentVariables array |
||
| 61 | * |
||
| 62 | * @var array |
||
| 63 | */ |
||
| 64 | protected $environmentVariables = array(); |
||
| 65 | |||
| 66 | /** |
||
| 67 | * The server name for internal purposes. |
||
| 68 | * |
||
| 69 | * @var string |
||
| 70 | */ |
||
| 71 | protected $name = 'httpsServer'; |
||
| 72 | |||
| 73 | /** |
||
| 74 | * The server class name. |
||
| 75 | * |
||
| 76 | * @var string |
||
| 77 | */ |
||
| 78 | protected $type = '\\AppserverIo\\Server\\Servers\\MultiThreadedServer'; |
||
| 79 | |||
| 80 | /** |
||
| 81 | * The worker class name. |
||
| 82 | * |
||
| 83 | * @var string |
||
| 84 | */ |
||
| 85 | protected $workerType = '\\AppserverIo\\Server\\Workers\\ThreadWorker'; |
||
| 86 | |||
| 87 | /** |
||
| 88 | * The socket class name. |
||
| 89 | * |
||
| 90 | * @var string |
||
| 91 | */ |
||
| 92 | protected $socketType = '\\AppserverIo\\Server\\Sockets\\StreamSocket'; |
||
| 93 | |||
| 94 | /** |
||
| 95 | * The stream context class name. |
||
| 96 | * |
||
| 97 | * @var string |
||
| 98 | */ |
||
| 99 | protected $streamContextType = '\\AppserverIo\\Server\\Contexts\\StreamContext'; |
||
| 100 | |||
| 101 | /** |
||
| 102 | * The server context class name. |
||
| 103 | * |
||
| 104 | * @var string |
||
| 105 | */ |
||
| 106 | protected $serverContextType = '\\AppserverIo\\Server\\Contexts\\ServerContext'; |
||
| 107 | |||
| 108 | /** |
||
| 109 | * The request context class name. |
||
| 110 | * |
||
| 111 | * @var string |
||
| 112 | */ |
||
| 113 | protected $requestContextType = '\\AppserverIo\\Server\\Contexts\\RequestContext'; |
||
| 114 | |||
| 115 | /** |
||
| 116 | * The logger name for internal purposes. |
||
| 117 | * |
||
| 118 | * @var string |
||
| 119 | */ |
||
| 120 | protected $loggerName = 'System'; |
||
| 121 | |||
| 122 | /** |
||
| 123 | * The server admin's email addres. |
||
| 124 | * |
||
| 125 | * @var string |
||
| 126 | */ |
||
| 127 | protected $admin = '[email protected]'; |
||
| 128 | |||
| 129 | /** |
||
| 130 | * The server software name. |
||
| 131 | * |
||
| 132 | * @var string |
||
| 133 | */ |
||
| 134 | protected $software = 'phpWebServer/7.0.0'; |
||
| 135 | |||
| 136 | /** |
||
| 137 | * The number of workers to start. |
||
| 138 | * |
||
| 139 | * @var integer |
||
| 140 | */ |
||
| 141 | protected $workerNumber = 64; |
||
| 142 | |||
| 143 | /** |
||
| 144 | * The minimum number of requests a worker handles. |
||
| 145 | * |
||
| 146 | * @var integer |
||
| 147 | */ |
||
| 148 | protected $workerAcceptMin = 16; |
||
| 149 | |||
| 150 | /** |
||
| 151 | * The maximum number of requests a worker handles. |
||
| 152 | * |
||
| 153 | * @var integer |
||
| 154 | */ |
||
| 155 | protected $workerAcceptMax = 64; |
||
| 156 | |||
| 157 | /** |
||
| 158 | * The transport protocol to use. |
||
| 159 | * |
||
| 160 | * @var string |
||
| 161 | */ |
||
| 162 | protected $transport = 'tcp'; |
||
| 163 | |||
| 164 | /** |
||
| 165 | * The IP address to use. |
||
| 166 | * |
||
| 167 | * @var string |
||
| 168 | */ |
||
| 169 | protected $address = '0.0.0.0'; |
||
| 170 | |||
| 171 | /** |
||
| 172 | * The port to use. |
||
| 173 | * |
||
| 174 | * @var string |
||
| 175 | */ |
||
| 176 | protected $port = 9080; |
||
| 177 | |||
| 178 | /** |
||
| 179 | * Socket flags used for socket initialization. |
||
| 180 | * |
||
| 181 | * @var string |
||
| 182 | */ |
||
| 183 | protected $flags = null; |
||
| 184 | |||
| 185 | /** |
||
| 186 | * The server's document root. |
||
| 187 | * |
||
| 188 | * @var string |
||
| 189 | */ |
||
| 190 | protected $documentRoot = 'var/www'; |
||
| 191 | |||
| 192 | /** |
||
| 193 | * Directory index files to be used. |
||
| 194 | * |
||
| 195 | * @var string |
||
| 196 | */ |
||
| 197 | protected $directoryIndex = 'index.php index.html index.htm'; |
||
| 198 | |||
| 199 | /** |
||
| 200 | * The maximum requests to be handled for a keep alive connection. |
||
| 201 | * |
||
| 202 | * @var integer |
||
| 203 | */ |
||
| 204 | protected $keepAliveMax = 64; |
||
| 205 | |||
| 206 | /** |
||
| 207 | * The timeout for the keep alive connection. |
||
| 208 | * |
||
| 209 | * @var integer |
||
| 210 | */ |
||
| 211 | protected $keepAliveTimeout = 5; |
||
| 212 | |||
| 213 | /** |
||
| 214 | * Flag to enable/disable auto index functionality. |
||
| 215 | * |
||
| 216 | * @var boolean |
||
| 217 | */ |
||
| 218 | protected $autoIndex = false; |
||
| 219 | |||
| 220 | /** |
||
| 221 | * The path to the error page template. |
||
| 222 | * |
||
| 223 | * @var string |
||
| 224 | */ |
||
| 225 | protected $errorsPageTemplatePath = 'resources/templates/www/error.phtml'; |
||
| 226 | |||
| 227 | /** |
||
| 228 | * The path to the welcome page template. |
||
| 229 | * |
||
| 230 | * @var string |
||
| 231 | */ |
||
| 232 | protected $welcomePageTemplatePath = 'resources/templates/www/welcome.phtml'; |
||
| 233 | |||
| 234 | /** |
||
| 235 | * The path to the auto index template. |
||
| 236 | * |
||
| 237 | * @var string |
||
| 238 | */ |
||
| 239 | protected $autoIndexTemplatePath = 'resources/templates/www/auto_index.phtml'; |
||
| 240 | |||
| 241 | /** |
||
| 242 | * The file handlers. |
||
| 243 | * |
||
| 244 | * @var array |
||
| 245 | */ |
||
| 246 | protected $handlers = array(); |
||
| 247 | |||
| 248 | /** |
||
| 249 | * The rewrite maps. |
||
| 250 | * |
||
| 251 | * @var array |
||
| 252 | */ |
||
| 253 | protected $rewriteMaps = array(); |
||
| 254 | |||
| 255 | /** |
||
| 256 | * The path to the SSL certificate. |
||
| 257 | * |
||
| 258 | * @var string |
||
| 259 | */ |
||
| 260 | protected $certPath = 'etc/webserver.pem'; |
||
| 261 | |||
| 262 | /** |
||
| 263 | * The path to the SSL certificate's private key file. |
||
| 264 | * |
||
| 265 | * @var string |
||
| 266 | */ |
||
| 267 | protected $privateKeyPath = null; |
||
| 268 | |||
| 269 | /** |
||
| 270 | * The path to the Diffie Hellmann param file. |
||
| 271 | * |
||
| 272 | * @var string |
||
| 273 | */ |
||
| 274 | protected $dhParamPath = null; |
||
| 275 | |||
| 276 | /** |
||
| 277 | * The SSL certificate's passphrase. |
||
| 278 | * |
||
| 279 | * @var string |
||
| 280 | */ |
||
| 281 | protected $passphrase = null; |
||
| 282 | |||
| 283 | /** |
||
| 284 | * The crypto method(s) to use. |
||
| 285 | * |
||
| 286 | * @var string |
||
| 287 | */ |
||
| 288 | protected $cryptoMethod = 'STREAM_CRYPTO_METHOD_TLS_SERVER'; |
||
| 289 | |||
| 290 | /** |
||
| 291 | * The peer name. |
||
| 292 | * |
||
| 293 | * @var string |
||
| 294 | */ |
||
| 295 | protected $peerName = null; |
||
| 296 | |||
| 297 | /** |
||
| 298 | * Flag to enable/disable peer verification. |
||
| 299 | * |
||
| 300 | * @var boolean |
||
| 301 | */ |
||
| 302 | protected $verifyPeer = false; |
||
| 303 | |||
| 304 | /** |
||
| 305 | * The flag to enable/disable peer name verification. |
||
| 306 | * |
||
| 307 | * @var boolean |
||
| 308 | */ |
||
| 309 | protected $verifyPeerName = false; |
||
| 310 | |||
| 311 | /** |
||
| 312 | * Flag to allow/disallow self signed SSL certificates. |
||
| 313 | * |
||
| 314 | * @var boolean |
||
| 315 | */ |
||
| 316 | protected $allowSelfSigned = true; |
||
| 317 | |||
| 318 | /** |
||
| 319 | * The flag to disable TLS compression. This can help mitigate the CRIME attack vector. |
||
| 320 | * |
||
| 321 | * @var boolean |
||
| 322 | */ |
||
| 323 | protected $disableCompression = true; |
||
| 324 | |||
| 325 | /** |
||
| 326 | * The flag to control cipher ordering preferences during negotiation has to be allowed. |
||
| 327 | * |
||
| 328 | * @var boolean |
||
| 329 | */ |
||
| 330 | protected $honorCipherOrder = true; |
||
| 331 | |||
| 332 | /** |
||
| 333 | * The curve to use with ECDH ciphers, if not specified prime256v1 will be used. |
||
| 334 | * |
||
| 335 | * @var string |
||
| 336 | */ |
||
| 337 | protected $ecdhCurve = 'prime256v1'; |
||
| 338 | |||
| 339 | /** |
||
| 340 | * The flag to enable/disable new key pair has to be created in scenarios where ECDH cipher suites are negotiated (instead of the preferred ECDHE ciphers). |
||
| 341 | * @var boolean |
||
| 342 | */ |
||
| 343 | protected $singleEcdhUse = true; |
||
| 344 | |||
| 345 | /** |
||
| 346 | * The flag to enable/disable new key pair creation when using DH parameters (improves forward secrecy). |
||
| 347 | * |
||
| 348 | * @var boolean |
||
| 349 | */ |
||
| 350 | protected $singleDhUse = true; |
||
| 351 | |||
| 352 | /** |
||
| 353 | * The list of available ciphers. |
||
| 354 | * |
||
| 355 | * @var string |
||
| 356 | * @link http://php.net/manual/en/context.ssl.php#context.ssl.ciphers |
||
| 357 | * @link https://www.openssl.org/docs/manmaster/apps/ciphers.html#CIPHER_LIST_FORMAT |
||
| 358 | */ |
||
| 359 | protected $ciphers = 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:ECDHE-RSA-RC4-SHA:ECDHE-ECDSA-RC4-SHA:AES128:AES256:RC4-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!3DES:!MD5:!PSK'; |
||
| 360 | |||
| 361 | /** |
||
| 362 | * Constructs config |
||
| 363 | * |
||
| 364 | * @param \SimpleXMLElement $node The simple xml element used to build config |
||
| 365 | */ |
||
| 366 | public function __construct($node) |
||
| 416 | |||
| 417 | /** |
||
| 418 | * Prepares the headers array based on a simple xml element node |
||
| 419 | * |
||
| 420 | * @param \SimpleXMLElement $node The xml node |
||
| 421 | * |
||
| 422 | * @return array |
||
| 423 | */ |
||
| 424 | public function prepareHeaders(\SimpleXMLElement $node) |
||
| 453 | |||
| 454 | /** |
||
| 455 | * Prepares the modules array based on a simple xml element node |
||
| 456 | * |
||
| 457 | * @param \SimpleXMLElement $node The xml node |
||
| 458 | * |
||
| 459 | * @return array |
||
| 460 | */ |
||
| 461 | public function prepareModules(\SimpleXMLElement $node) |
||
| 471 | |||
| 472 | /** |
||
| 473 | * Prepares the connectionHandlers array based on a simple xml element node |
||
| 474 | * |
||
| 475 | * @param \SimpleXMLElement $node The xml node |
||
| 476 | * |
||
| 477 | * @return array |
||
| 478 | */ |
||
| 479 | public function prepareConnectionHandlers(\SimpleXMLElement $node) |
||
| 490 | |||
| 491 | /** |
||
| 492 | * Prepares the handlers array based on a simple xml element node |
||
| 493 | * |
||
| 494 | * @param \SimpleXMLElement $node The xml node |
||
| 495 | * |
||
| 496 | * @return array |
||
| 497 | */ |
||
| 498 | public function prepareHandlers(\SimpleXMLElement $node) |
||
| 519 | |||
| 520 | /** |
||
| 521 | * Prepares the virtual hosts array based on a simple xml element node |
||
| 522 | * |
||
| 523 | * @param \SimpleXMLElement $node The xml node |
||
| 524 | * |
||
| 525 | * @return array |
||
| 526 | */ |
||
| 527 | public function prepareVirtualHosts(\SimpleXMLElement $node) |
||
| 557 | |||
| 558 | /** |
||
| 559 | * Prepares the rewrite maps based on a simple xml element node |
||
| 560 | * |
||
| 561 | * @param \SimpleXMLElement $node The xml node |
||
| 562 | * |
||
| 563 | * @return array |
||
| 564 | */ |
||
| 565 | View Code Duplication | public function prepareRewriteMaps(\SimpleXMLElement $node) |
|
| 582 | |||
| 583 | /** |
||
| 584 | * Prepares the rewrites array based on a simple xml element node |
||
| 585 | * |
||
| 586 | * @param \SimpleXMLElement $node The xml node |
||
| 587 | * |
||
| 588 | * @return array |
||
| 589 | */ |
||
| 590 | public function prepareRewrites(\SimpleXMLElement $node) |
||
| 602 | |||
| 603 | /** |
||
| 604 | * Prepares the certificates array based on a simple xml element node |
||
| 605 | * |
||
| 606 | * @param \SimpleXMLElement $node The xml node |
||
| 607 | * |
||
| 608 | * @return array |
||
| 609 | */ |
||
| 610 | public function prepareCertificates(\SimpleXMLElement $node) |
||
| 625 | |||
| 626 | /** |
||
| 627 | * Prepares the locations array based on a simple xml element node |
||
| 628 | * |
||
| 629 | * @param \SimpleXMLElement $node The xml node |
||
| 630 | * |
||
| 631 | * @return array |
||
| 632 | */ |
||
| 633 | public function prepareLocations(\SimpleXMLElement $node) |
||
| 649 | |||
| 650 | /** |
||
| 651 | * Prepares the environmentVariables array based on a simple xml element node |
||
| 652 | * |
||
| 653 | * @param \SimpleXMLElement $node The xml node |
||
| 654 | * |
||
| 655 | * @return array |
||
| 656 | */ |
||
| 657 | public function prepareEnvironmentVariables(\SimpleXMLElement $node) |
||
| 669 | |||
| 670 | /** |
||
| 671 | * Prepares the authentications array based on a simple xml element node |
||
| 672 | * |
||
| 673 | * @param \SimpleXMLElement $node The xml node |
||
| 674 | * |
||
| 675 | * @return array |
||
| 676 | */ |
||
| 677 | View Code Duplication | public function prepareAuthentications(\SimpleXMLElement $node) |
|
| 693 | |||
| 694 | /** |
||
| 695 | * Prepares the access array based on a simple xml element node |
||
| 696 | * |
||
| 697 | * @param \SimpleXMLElement $node The xml node |
||
| 698 | * |
||
| 699 | * @return array |
||
| 700 | */ |
||
| 701 | View Code Duplication | public function prepareAccesses(\SimpleXMLElement $node) |
|
| 718 | |||
| 719 | /** |
||
| 720 | * Prepares the analytics array based on a simple XML element node |
||
| 721 | * |
||
| 722 | * @param \SimpleXMLElement $node The XML node |
||
| 723 | * |
||
| 724 | * @return array |
||
| 725 | */ |
||
| 726 | public function prepareAnalytics(\SimpleXMLElement $node) |
||
| 760 | |||
| 761 | /** |
||
| 762 | * Return's name |
||
| 763 | * |
||
| 764 | * @return string |
||
| 765 | */ |
||
| 766 | public function getName() |
||
| 770 | |||
| 771 | /** |
||
| 772 | * Return's type |
||
| 773 | * |
||
| 774 | * @return string |
||
| 775 | */ |
||
| 776 | public function getType() |
||
| 780 | |||
| 781 | /** |
||
| 782 | * Return's logger name |
||
| 783 | * |
||
| 784 | * @return string |
||
| 785 | */ |
||
| 786 | public function getLoggerName() |
||
| 790 | |||
| 791 | /** |
||
| 792 | * Return's transport |
||
| 793 | * |
||
| 794 | * @return string |
||
| 795 | */ |
||
| 796 | public function getTransport() |
||
| 800 | |||
| 801 | /** |
||
| 802 | * Returns rewrites |
||
| 803 | * |
||
| 804 | * @return array |
||
| 805 | */ |
||
| 806 | public function getRewrites() |
||
| 810 | |||
| 811 | /** |
||
| 812 | * Return's address |
||
| 813 | * |
||
| 814 | * @return string |
||
| 815 | */ |
||
| 816 | public function getAddress() |
||
| 820 | |||
| 821 | /** |
||
| 822 | * Return's port |
||
| 823 | * |
||
| 824 | * @return int |
||
| 825 | */ |
||
| 826 | public function getPort() |
||
| 830 | |||
| 831 | /** |
||
| 832 | * Return's flags |
||
| 833 | * |
||
| 834 | * @return string |
||
| 835 | */ |
||
| 836 | public function getFlags() |
||
| 840 | |||
| 841 | /** |
||
| 842 | * Return's software |
||
| 843 | * |
||
| 844 | * @return string |
||
| 845 | */ |
||
| 846 | public function getSoftware() |
||
| 850 | |||
| 851 | /** |
||
| 852 | * Return's admin |
||
| 853 | * |
||
| 854 | * @return string |
||
| 855 | */ |
||
| 856 | public function getAdmin() |
||
| 860 | |||
| 861 | /** |
||
| 862 | * Return's analytics |
||
| 863 | * |
||
| 864 | * @return string |
||
| 865 | */ |
||
| 866 | public function getAnalytics() |
||
| 870 | |||
| 871 | /** |
||
| 872 | * Return's keep-alive max connection |
||
| 873 | * |
||
| 874 | * @return int |
||
| 875 | */ |
||
| 876 | public function getKeepAliveMax() |
||
| 880 | |||
| 881 | /** |
||
| 882 | * Return's keep-alive timeout |
||
| 883 | * |
||
| 884 | * @return int |
||
| 885 | */ |
||
| 886 | public function getKeepAliveTimeout() |
||
| 890 | |||
| 891 | /** |
||
| 892 | * Return's template path for errors page |
||
| 893 | * |
||
| 894 | * @return string |
||
| 895 | */ |
||
| 896 | public function getErrorsPageTemplatePath() |
||
| 900 | |||
| 901 | /** |
||
| 902 | * Returns template path for possible configured welcome page |
||
| 903 | * |
||
| 904 | * @return string |
||
| 905 | */ |
||
| 906 | public function getWelcomePageTemplatePath() |
||
| 910 | |||
| 911 | /** |
||
| 912 | * Returns template path for possible configured auto index page |
||
| 913 | * |
||
| 914 | * @return string |
||
| 915 | */ |
||
| 916 | public function getAutoIndexTemplatePath() |
||
| 920 | |||
| 921 | /** |
||
| 922 | * Return's worker number |
||
| 923 | * |
||
| 924 | * @return int |
||
| 925 | */ |
||
| 926 | public function getWorkerNumber() |
||
| 930 | |||
| 931 | /** |
||
| 932 | * Return's worker's accept min count |
||
| 933 | * |
||
| 934 | * @return int |
||
| 935 | */ |
||
| 936 | public function getWorkerAcceptMin() |
||
| 940 | |||
| 941 | /** |
||
| 942 | * Return's worker's accept max count |
||
| 943 | * |
||
| 944 | * @return int |
||
| 945 | */ |
||
| 946 | public function getWorkerAcceptMax() |
||
| 950 | |||
| 951 | /** |
||
| 952 | * Return's the auto index configuration |
||
| 953 | * |
||
| 954 | * @return boolean |
||
| 955 | */ |
||
| 956 | public function getAutoIndex() |
||
| 960 | |||
| 961 | /** |
||
| 962 | * Return's server context type |
||
| 963 | * |
||
| 964 | * @return string |
||
| 965 | */ |
||
| 966 | public function getServerContextType() |
||
| 970 | |||
| 971 | /** |
||
| 972 | * Returns stream context type |
||
| 973 | * |
||
| 974 | * @return string |
||
| 975 | */ |
||
| 976 | public function getStreamContextType() |
||
| 980 | |||
| 981 | /** |
||
| 982 | * Return's server context type |
||
| 983 | * |
||
| 984 | * @return string |
||
| 985 | */ |
||
| 986 | public function getRequestContextType() |
||
| 990 | |||
| 991 | /** |
||
| 992 | * Return's socket type |
||
| 993 | * |
||
| 994 | * @return string |
||
| 995 | */ |
||
| 996 | public function getSocketType() |
||
| 1000 | |||
| 1001 | /** |
||
| 1002 | * Return's worker type |
||
| 1003 | * |
||
| 1004 | * @return string |
||
| 1005 | */ |
||
| 1006 | public function getWorkerType() |
||
| 1010 | |||
| 1011 | /** |
||
| 1012 | * Return's document root |
||
| 1013 | * |
||
| 1014 | * @return string |
||
| 1015 | */ |
||
| 1016 | public function getDocumentRoot() |
||
| 1020 | |||
| 1021 | /** |
||
| 1022 | * Return's directory index definition |
||
| 1023 | * |
||
| 1024 | * @return string |
||
| 1025 | */ |
||
| 1026 | public function getDirectoryIndex() |
||
| 1030 | |||
| 1031 | /** |
||
| 1032 | * Return's the connection handlers |
||
| 1033 | * |
||
| 1034 | * @return array |
||
| 1035 | */ |
||
| 1036 | public function getConnectionHandlers() |
||
| 1040 | |||
| 1041 | /** |
||
| 1042 | * Returns the headers used by the server |
||
| 1043 | * |
||
| 1044 | * @return array |
||
| 1045 | */ |
||
| 1046 | public function getHeaders() |
||
| 1050 | |||
| 1051 | /** |
||
| 1052 | * Returns the certificates used by the server |
||
| 1053 | * |
||
| 1054 | * @return array |
||
| 1055 | */ |
||
| 1056 | public function getCertificates() |
||
| 1060 | |||
| 1061 | /** |
||
| 1062 | * Return's the virtual hosts |
||
| 1063 | * |
||
| 1064 | * @return array |
||
| 1065 | */ |
||
| 1066 | public function getVirtualHosts() |
||
| 1070 | |||
| 1071 | /** |
||
| 1072 | * Return's the authentication information's |
||
| 1073 | * |
||
| 1074 | * @return array |
||
| 1075 | */ |
||
| 1076 | public function getAuthentications() |
||
| 1080 | |||
| 1081 | /** |
||
| 1082 | * Return's modules |
||
| 1083 | * |
||
| 1084 | * @return array |
||
| 1085 | */ |
||
| 1086 | public function getModules() |
||
| 1090 | |||
| 1091 | /** |
||
| 1092 | * Return's array |
||
| 1093 | * |
||
| 1094 | * @return array |
||
| 1095 | */ |
||
| 1096 | public function getHandlers() |
||
| 1100 | |||
| 1101 | /** |
||
| 1102 | * Return's cert path |
||
| 1103 | * |
||
| 1104 | * @return string |
||
| 1105 | */ |
||
| 1106 | public function getCertPath() |
||
| 1110 | |||
| 1111 | /** |
||
| 1112 | * Return's passphrase |
||
| 1113 | * |
||
| 1114 | * @return string |
||
| 1115 | */ |
||
| 1116 | public function getPassphrase() |
||
| 1120 | |||
| 1121 | /** |
||
| 1122 | * Returns the environment variable configuration |
||
| 1123 | * |
||
| 1124 | * @return array |
||
| 1125 | */ |
||
| 1126 | public function getEnvironmentVariables() |
||
| 1130 | |||
| 1131 | /** |
||
| 1132 | * Returns the access configuration. |
||
| 1133 | * |
||
| 1134 | * @return array |
||
| 1135 | */ |
||
| 1136 | public function getAccesses() |
||
| 1140 | |||
| 1141 | /** |
||
| 1142 | * Returns the locations. |
||
| 1143 | * |
||
| 1144 | * @return array |
||
| 1145 | */ |
||
| 1146 | public function getLocations() |
||
| 1150 | |||
| 1151 | /** |
||
| 1152 | * Returns the rewrite maps. |
||
| 1153 | * |
||
| 1154 | * @return array |
||
| 1155 | */ |
||
| 1156 | public function getRewriteMaps() |
||
| 1160 | |||
| 1161 | /** |
||
| 1162 | * Return's DH param path |
||
| 1163 | * |
||
| 1164 | * @return string |
||
| 1165 | */ |
||
| 1166 | public function getDhParamPath() |
||
| 1170 | |||
| 1171 | /** |
||
| 1172 | * Return's private key path |
||
| 1173 | * |
||
| 1174 | * @return string |
||
| 1175 | */ |
||
| 1176 | public function getPrivateKeyPath() |
||
| 1180 | |||
| 1181 | /** |
||
| 1182 | * Return's the crypto method to use |
||
| 1183 | * |
||
| 1184 | * @return string |
||
| 1185 | */ |
||
| 1186 | public function getCryptoMethod() |
||
| 1190 | |||
| 1191 | /** |
||
| 1192 | * Return's the peer name to be used, if this value is not set, then the name is guessed based on the hostname used when opening the stream |
||
| 1193 | * |
||
| 1194 | * @return string |
||
| 1195 | */ |
||
| 1196 | public function getPeerName() |
||
| 1200 | |||
| 1201 | /** |
||
| 1202 | * Return's TRUE it the verification of use SSL certificate has to be required |
||
| 1203 | * |
||
| 1204 | * @return boolean |
||
| 1205 | */ |
||
| 1206 | public function getVerifyPeer() |
||
| 1210 | |||
| 1211 | /** |
||
| 1212 | * Return's TRUE it the peer name has to be verified |
||
| 1213 | * |
||
| 1214 | * @return boolean |
||
| 1215 | */ |
||
| 1216 | public function getVerifyPeerName() |
||
| 1220 | |||
| 1221 | /** |
||
| 1222 | * Return's TRUE to disable TLS compression. This can help mitigate the CRIME attack vector |
||
| 1223 | * |
||
| 1224 | * @return boolean |
||
| 1225 | */ |
||
| 1226 | public function getDisableCompression() |
||
| 1230 | |||
| 1231 | /** |
||
| 1232 | * Return's TRUE if self-signed certificates has to be allowed, but requires verify_peer to be FALSE |
||
| 1233 | * |
||
| 1234 | * @return boolean |
||
| 1235 | */ |
||
| 1236 | public function getAllowSelfSigned() |
||
| 1240 | |||
| 1241 | /** |
||
| 1242 | * Return's TRUE if control cipher ordering preferences during negotiation has to be allowed |
||
| 1243 | * |
||
| 1244 | * @return boolean |
||
| 1245 | */ |
||
| 1246 | public function getHonorCipherOrder() |
||
| 1250 | |||
| 1251 | /** |
||
| 1252 | * Return's the curve to use with ECDH ciphers, if not specified prime256v1 will be used |
||
| 1253 | * |
||
| 1254 | * @return string |
||
| 1255 | */ |
||
| 1256 | public function getEcdhCurve() |
||
| 1260 | |||
| 1261 | /** |
||
| 1262 | * Return's TRUE if a new key pair has to be created in scenarios where ECDH cipher suites are negotiated (instead of the preferred ECDHE ciphers) |
||
| 1263 | * |
||
| 1264 | * @return boolean |
||
| 1265 | */ |
||
| 1266 | public function getSingleEcdhUse() |
||
| 1270 | |||
| 1271 | /** |
||
| 1272 | * Return's TRUE if new key pair has to be created when using DH parameters (improves forward secrecy) |
||
| 1273 | * |
||
| 1274 | * @return boolean |
||
| 1275 | */ |
||
| 1276 | public function getSingleDhUse() |
||
| 1280 | |||
| 1281 | /** |
||
| 1282 | * Return's the list of available ciphers. |
||
| 1283 | * |
||
| 1284 | * @return string |
||
| 1285 | * @link http://php.net/manual/en/context.ssl.php#context.ssl.ciphers |
||
| 1286 | * @link https://www.openssl.org/docs/manmaster/apps/ciphers.html#CIPHER_LIST_FORMAT |
||
| 1287 | */ |
||
| 1288 | public function getCiphers() |
||
| 1292 | } |
||
| 1293 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: