Ejemplo n.º 1
0
    /**
     * Checks if xdebug.max_nesting_level is set 200 or more
     * @return array
     */
    private function checkXDebugNestedLevel()
    {
        $data = [];
        $error = false;

        $currentExtensions = $this->phpInformation->getCurrent();
        if (in_array('xdebug', $currentExtensions)) {

            $currentXDebugNestingLevel = intval(ini_get('xdebug.max_nesting_level'));
            $minimumRequiredXDebugNestedLevel = $this->phpInformation->getRequiredMinimumXDebugNestedLevel();

            if ($minimumRequiredXDebugNestedLevel > $currentXDebugNestingLevel) {
                $error = true;
            }

            $message = sprintf(
                'Your current setting of xdebug.max_nesting_level=%d.
                 Magento 2 requires it to be set to %d or more.
                 Edit your config, restart web server, and try again.',
                $currentXDebugNestingLevel,
                $minimumRequiredXDebugNestedLevel
            );

            $data['xdebug_max_nesting_level'] = [
                'message' => $message,
                'error' => $error
            ];
        }

        return $data;
    }
Ejemplo n.º 2
0
 /**
  * Verifies php verifications
  *
  * @return JsonModel
  */
 public function phpExtensionsAction()
 {
     try {
         $required = $this->phpInformation->getRequired();
         $current = $this->phpInformation->getCurrent();
     } catch (\Exception $e) {
         return new JsonModel(['responseType' => ResponseTypeInterface::RESPONSE_TYPE_ERROR, 'data' => ['error' => 'phpExtensionError', 'message' => 'Cannot determine required PHP extensions: ' . $e->getMessage()]]);
     }
     $responseType = ResponseTypeInterface::RESPONSE_TYPE_SUCCESS;
     $missing = array_values(array_diff($required, $current));
     if ($missing) {
         $responseType = ResponseTypeInterface::RESPONSE_TYPE_ERROR;
     }
     $data = ['responseType' => $responseType, 'data' => ['required' => $required, 'missing' => $missing]];
     return new JsonModel($data);
 }