Shortcut to construct the object and process the failure actions.

@param string $the__file__  Pass `__FILE__` from the loader.
@param array  $requirements The array of requirements.

@return bool True if requirements met.
190259
public static function validate( $the__file__, array $requirements = array() ) {
		$_wpr = new WP_Requirements( $the__file__, $requirements );

		$is_valid = $_wpr->valid();

		if ( ! $is_valid ) {
			$_wpr->process_failure();
		}

		return $is_valid;
	}
605754
private boolean checkFilesExists(String[] requiredFiles, File childResource) {

        File setupFile = null;
        boolean hasMissingSetupFiles = false;

        for (int j = 0; j < requiredFiles.length; j++) {
            setupFile = new File(childResource.getPath() + File.separatorChar + requiredFiles[j]);

            if (!setupFile.exists() || !setupFile.isFile() || !setupFile.canRead()) {
                hasMissingSetupFiles = true;
                System.err.println(
                    "[" + getClass().getName() + "] missing or unreadable database setup file: " + setupFile.getPath());
                break;
            }

            if (!hasMissingSetupFiles) {
                return true;
            }
        }
        return false;
    }
88986
protected function load($filename)
    {
        $success = false;

        if (file_exists($filename)) {
            /** @noinspection PhpIncludeInspection */
            require $filename;
            $success = true;
        }

        return $success;
    }
851274
def requirements(self, requires):
        '''
        
        '''
        if requires:
            if isinstance(requires, basestring) and \
               os.path.isfile(os.path.abspath(requires)):
                self._requirements_file = os.path.abspath(requires)
            else:
                if isinstance(self._requirements, basestring):
                    requires = requires.split()
                self._requirements_file = None
                self._requirements = requires
        else:
            # If the default requirements file is found use that
            if os.path.isfile(self._requirements_file):
                return
            self._requirements, self._requirements_file = None, None
482650
public function isValid() {
		
		$params = $this -> getParameters();
		$file 	= $this -> getFile();
		$info 	= (object) pathinfo($file['name']);
		$params = array_map(function($value) {

			if(false === is_string($value)) {
				return trigger_error(sprintf('Extension passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($value)), E_USER_ERROR);
			}

			return ltrim(strtolower($value), '.');
		}, $params);

		if(true === isset($info -> extension) && false === in_array($info -> extension, $params)) {
			return true;
		}

		return false;
	}
188643
public function hasFailed()
    {
        if($this->failed == false || $this->passed == true)
        {
            $this->failed = true;
            $this->passed = false;
        }
    }
762468
public function run($require = false) {
		foreach($this->const as $name => $val)
			define(self::nameEncode($name, self::NAMESPACE_SEPERATOR), self::encode($val) );
		
		foreach($this->ini as $name => $val)
			ini_set(self::nameEncode($name, self::INI_SEPERATOR), self::encode($val) );
		
		$GLOBALS["constants"] = $this->public;
		
		if($require)
			foreach($this->require as $file)
				require $file;
	}
515263
def do_failures(self, arg):
        
        usable, filename, append = self._redirect_split(arg)
        a = self.tests[self.active]
        args = self.curargs
        splitargs = usable.split()
        if len(splitargs) > 0:
            tfilter = splitargs[0]
        else:
            tfilter = "*"

        outfiles = None
        if len(splitargs) > 1:
            outfiles = splitargs[1:len(splitargs)]

        result = a.failures(outfiles, args["threshold"], tfilter)
        self._redirect_output(result, filename, append, msg.info)
1119284
protected function require_file($file) {
		if (file_exists($this->template_dir . $file)) {
			require_once $this->template_dir . $file;
			return true;
		}
		return false;
	}
695958
public function isValid() {
		
		$params = $this -> getParameters();
		$file 	= $this -> getFile();

		if(false === isset($params[0])) {
			return trigger_error(sprintf('Missing argument 1 for %s', __METHOD__), E_USER_ERROR);
		}

		if(false === ('-' . intval($params[0]) == '-' . $params[0])) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($params[0])), E_USER_ERROR);
		}

		$size = @filesize($file['tmp_name']);

		if(true === is_int($size)) {

			if($size >= $params[0]) {
				return true;
			}
		}

		return false;
	}
501901
public function requireFile($file, $return = false)
    {
        if($this->findFile($file)) {
            if($return !== false) {
                return require($file);
            }
            else {
                require($file);
            }
        }
        else {
            throw new Exception($file." file is missing.");
            exit;
        }
    }
44508
protected function verifyConditionalRequirements()
    {
        if (!isset($this->requiredFieldsConditional)) {
            return;
        }

        $fields = $this->requiredFieldsConditional->getArrayCopy();

        foreach ($fields as $fieldName => $fieldDependencies) {
            if (!isset($this->$fieldName)) {
                continue;
            }

            foreach ($fieldDependencies as $fieldValue => $fieldDependency) {
                if (is_array($fieldDependency)) {
                    if ($this->$fieldName != $fieldValue) {
                        continue;
                    }

                    foreach ($fieldDependency as $field) {
                        if (empty($this->$field)) {
                            $fieldValue =
                                is_bool($this->$fieldName)
                                    ? var_export($this->$fieldName, true)
                                    : $this->$fieldName;

                            throw new \Genesis\Exceptions\ErrorParameter(
                                sprintf(
                                    '%s with value %s is depending on: %s, which is empty (null)!',
                                    $fieldName,
                                    $fieldValue,
                                    $field
                                )
                            );
                        }
                    }
                } elseif (empty($this->$fieldDependency)) {
                    throw new \Genesis\Exceptions\ErrorParameter(
                        sprintf(
                            '%s is depending on: %s, which is empty (null)!',
                            $fieldName,
                            $fieldDependency
                        )
                    );
                }
            }
        }
    }
1041038
final protected function validateFile () : bool
	{
		$file = $this->file;
		// Perform error checking on the file parameter parsed in
		if (!$file || empty($file) || !is_array($file)):
			// Error: nothing uploaded or wrong argument usage
			$this->error = "No file was uploaded.";
			return FALSE;
		endif;
		// Check if file is not empty
		if (!isset($file) || !is_uploaded_file($file['tmp_name'])):
			// Error: in file upload
			$this->error = "Uploaded file is Missing.";
			return FALSE;
		endif;
		// Check if file doesn't contain any error
		if ($file['error'] != 0):
			// Error: report what php says went wrong
			$this->error = $this->fileUploadErrors[$file['error']];
			return FALSE;
		endif;
		return TRUE;
	}
195582
public static function are_requirements_met() {
        if (self::$requirementsmet === null) {
            $requirementsmet = self::test_unoconv_path()->status === self::UNOCONVPATH_OK;
            $requirementsmet = $requirementsmet && self::is_minimum_version_met();
            self::$requirementsmet = $requirementsmet;
        }

        return self::$requirementsmet;
    }
787883
protected function checkRequirements()
    {
        parent::checkRequirements();

        // verify there is at least one item added
        if (empty($this->items) || $this->items->count() === 0) {
            throw new \Genesis\Exceptions\ErrorParameter('Empty (null) required parameter: items');
        }
    }
17018
def read_requirements(fh, resolve=False):
    
    is_temp_file = not hasattr(fh, 'name')
    for num, line in enumerate(iter_lines(fh)):
        line = line.strip()
        if not line:
            # skip empty lines
            continue
        if line.startswith('#') or \
            line.startswith('-i') or \
            line.startswith('--index-url') or \
            line.startswith('--extra-index-url') or \
            line.startswith('-f') or line.startswith('--find-links') or \
            line.startswith('--no-index') or line.startswith('--allow-external') or \
            line.startswith('--allow-unverified') or line.startswith('-Z') or \
            line.startswith('--always-unzip'):
            # skip unsupported lines
            continue
        elif line.startswith('-r') or line.startswith('--requirement'):
            # got a referenced file here, try to resolve the path
            # if this is a tempfile, skip
            if is_temp_file:
                continue
            filename = line.strip("-r ").strip("--requirement").strip()
            # if there is a comment, remove it
            if " #" in filename:
                filename = filename.split(" #")[0].strip()
            req_file_path = os.path.join(os.path.dirname(fh.name), filename)
            if resolve:
                # recursively yield the resolved requirements
                if os.path.exists(req_file_path):
                    with open(req_file_path) as _fh:
                        for req in read_requirements(_fh, resolve=True):
                            yield req
            else:
                yield RequirementFile(path=req_file_path)
        else:
            try:
                parseable_line = line
                # multiline requirements are not parseable
                if "\\" in line:
                    parseable_line = line.replace("\\", "")
                    for next_line in iter_lines(fh, num + 1):
                        parseable_line += next_line.strip().replace("\\", "")
                        line += "\n" + next_line
                        if "\\" in next_line:
                            continue
                        break
                req, = parse_line(parseable_line)
                if len(req.specifier._specs) == 1 and \
                        next(iter(req.specifier._specs))._spec[0] == "==":
                    yield Package(key=req.name, version=next(iter(req.specifier._specs))._spec[1])
                else:
                    try:
                        fname = fh.name
                    except AttributeError:
                        fname = line

                    click.secho(
                        "Warning: unpinned requirement '{req}' found in {fname}, "
                        "unable to check.".format(req=req.name,
                                                  fname=fname),
                        fg="yellow",
                        file=sys.stderr
                    )
            except ValueError:
                continue
11093
public static function are_requirements_met() {
        $issuerid = get_config('fileconverter_googledrive', 'issuerid');
        if (empty($issuerid)) {
            return false;
        }

        $issuer = \core\oauth2\api::get_issuer($issuerid);
        if (empty($issuer)) {
            return false;
        }

        if (!$issuer->get('enabled')) {
            return false;
        }

        if (!$issuer->is_system_account_connected()) {
            return false;
        }

        return true;
    }