Example #1
0
 public function isMysqlEnabled()
 {
     if ($this->container->getParameter('disable_mysql')) {
         return false;
     }
     return extension_loaded('mysql');
 }
Example #2
0
 public function __construct(MWP_ServiceContainer_Interface $container)
 {
     $this->container = $container;
     $this->dispatcher = $container->getEventDispatcher();
     $this->requestStack = $container->getRequestStack();
     // We will need master response callback for fatal error handling.
     $this->responseCallback = $container->getResponseCallback();
 }
 public function isOpenSslLibraryEnabled()
 {
     if ($this->container->getParameter('prefer_phpseclib')) {
         return false;
     }
     if (!extension_loaded('openssl')) {
         return false;
     }
     $context = $this->container->getWordPressContext();
     $openSslParameters = $context->optionGet('mwp_openssl_parameters');
     if (isset($openSslParameters['time']) && time() - $openSslParameters['time'] < 86400) {
         return !empty($openSslParameters['working']);
     }
     $context->optionSet('mwp_openssl_parameters', array('time' => time(), 'working' => false));
     $workingOpenSsl = $this->verifyIsOpenSslWorking();
     $context->optionSet('mwp_openssl_parameters', array('time' => time(), 'working' => $workingOpenSsl));
     return $workingOpenSsl;
 }