Perform the evaluation of the rule

@param array $ini Configuration settings (from php.ini)
@return boolean Pass/fail of evaluation
548299
public function evaluate(array $ini)
	{
		// See which type we're working with
		$handler = $this->findValue('session.save_handler', $ini);
		switch(strtolower($handler)) {
			case 'file':
			case 'files':
				return $this->evaluateFile($ini);
				break;
			case 'memcache':
				return $this->evaluateMemcache($ini);
				break;
		}
		return false;
	}
1202293
public function init($ini) {
		/*
		 * 是否使用自定义配置
		 */
		$config = parse_ini_file(false === $ini ? __DIR__ . '/../etc/client.ini' : $ini, true);

		$config[$this->service] = array_merge($config['global'], $config[$this->service]);
		unset($config['global']);
		
		/*
		 * 设置运行模式与socket方式
		 */
		foreach ($config as $key => $value) {
			if (true === empty($value)) {
				continue 1;
			}
			if (self::SWOOLE_SOCKET_SYNC == $value['sync']) {
				$value['sync'] = SWOOLE_SOCK_SYNC;
			} else {
				$value['sync'] = SWOOLE_SOCK_ASYNC;
				$value['timeout'] = 0;
			}
			
			switch ($value['socket']) {
				case self::SWOOLE_SOCKET_TCP6:
					$value['socket'] = SWOOLE_TCP6;
					break;
				case self::SWOOLE_SOCKET_UDP:
					$value['socket'] = SWOOLE_UDP;
					break;
				case self::SWOOLE_SOCKET_UDP6:
					$value['socket'] = SWOOLE_UDP6;
					break;
				case self::SWOOLE_SOCKET_TCP:
				default:
					$value['socket'] = SWOOLE_TCP;
					break;
			}
			
			/*
			 * 设置连接的key
			 */
			if (self::SWOOLE_RANDOM_KEY == $value[$key . '.key']) {
				$value['key'] = uniqId(self::SWOOLE_KEY_PREFIX, true);
			} else {
				$value['key'] = $value['host'] . ':' . $value['port'];
			}
			
			/*
			 * 设置on off
			 */
			
			array_walk($value, function (& $item, $key) {
				$item = strtolower($item);
				if (self::SWOOLE_CONFIG_ON == $item) {
					$item = true;
				} else if (self::SWOOLE_CONFIG_OFF == $item) {
					$item = false;
				}
			});
			
			$this->config[$key] = $value;
		}
	}
1005094
private function validate(MethodInvocation $invocation, \ReflectionMethod $onValidate, \ReflectionMethod $onFailure = null)
    {
        $validation = $onValidate->invokeArgs($invocation->getThis(), (array) $invocation->getArguments());
        if ($validation instanceof Validation && $validation->getMessages()) {
            /* @var $validation Validation */
            $validation->setInvocation($invocation);
            $failure = $this->getFailure($invocation, $validation, $onFailure);
            if ($failure instanceof \Exception) {
                throw $failure;
            }

            return [false, $failure];
        }

        return [true, null];
    }
801335
public function runValidate(array $rules = null)
    {
        // skip validation on empty rules
        if ($rules === null) {
            return true;
        }

        $success = true;
        // list each rule as single one
        foreach ($rules as $rule) {
            // 0 = field (property) name, 1 = filter name, 2 = filter value
            if ($rule[0] === null || $rule[1] === null) {
                continue;
            }

            $propertyName = $rule[0];
            $validationRule = $rule[1];
            $validationValue = null;
            if (isset($rule[2])) {
                $validationValue = $rule[2];
            }

            // check if target field defined as array and make recursive validation
            if (Any::isArray($propertyName)) {
                $cumulateValidation = true;
                foreach ($propertyName as $attrNme) {
                    // end false condition
                    if (!$this->validateRecursive($attrNme, $validationRule, $validationValue)) {
                        $cumulateValidation = false;
                    }
                }
                // assign total
                $validate = $cumulateValidation;
            } else {
                $validate = $this->validateRecursive($propertyName, $validationRule, $validationValue);
            }

            // do not change condition on "true" check's (end-false-condition)
            if ($validate === false) {
                $success = false;
            }
        }

        return $success;
    }
312146
public function init($ini) {
		/*
		 * 是否使用自定义配置
		 */
		$config = parse_ini_file(false === $ini ? __DIR__ . '/../etc/server.ini' : $ini, true);
		
		/*
		 * 如果指定服务，则合并该服务下的配置与全局配置
		 */
		if (false === empty($this->service) && true === isset($config[$this->service])) {
			$config[$this->service] = array_merge($config['global'], $config[$this->service]);
			unset($config['global']);
		}
		
		/*
		 * 设置运行模式与socket方式
		 */
		foreach ($config as $key => $value) {
			if (true === empty($value)) {
				continue 1;
			}
			if (self::SWOOLE_MODE_PROCESS == $value['mode']) {
				$value['mode'] = SWOOLE_PROCESS;
			} else {
				$value['mode'] = SWOOLE_BASE;
			}
			
			switch ($value['socket']) {
				case self::SWOOLE_SOCKET_TCP6:
					$value['socket'] = SWOOLE_TCP6;
					break;
				case self::SWOOLE_SOCKET_UDP:
					$value['socket'] = SWOOLE_UDP;
					break;
				case self::SWOOLE_SOCKET_UDP6:
					$value['socket'] = SWOOLE_UDP6;
					break;
				case self::SWOOLE_SOCKET_DGRAM:
					$value['socket'] = SWOOLE_UNIX_DGRAM;
					break;
				case self::SWOOLE_SOCKET_STREAM:
					$value['socket'] = SWOOLE_UNIX_STREAM;
					break;
				case self::SWOOLE_SOCKET_TCP:
				default:
					$value['socket'] = SWOOLE_TCP;
					break;
			}
			$this->config[$key] = $value;
		}
	}
767927
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $path = $input->getOption('path');

        // if we're not given a path at all, try to figure it out
        if ($path === null) {
            $path = php_ini_loaded_file();
        }

        if (!is_file($path)) {
            throw new \Exception('Path is null or not accessible: "'.$path.'"');
        }
        $ini = parse_ini_file($path, true);

        $output->writeLn('Current PHP.ini settings from '.$path);
        $output->writeLn('##########');

        foreach ($ini as $section => $data) {
            $output->writeLn('<info>:: '.$section.'</info>');
            if (empty($data)) {
                $output->writeLn("\t<fg=yellow>No settings</fg=yellow>");
            } else {
                foreach ($data as $path => $value) {
                    $output->writeLn("\t".$path.' => '.var_export($value, true));
                }
            }
            $output->writeLn("-----------------\n");
        }

    }
139130
function readMIMETypeQualitySettingFromINI( $iniFile = false )
    {
        if ( !$iniFile )
            $iniFile = 'image.ini';
        $ini = eZINI::instance( $iniFile );
        if ( !$ini )
            return false;
        if ( !$ini->hasVariable( 'MIMETypeSettings', 'Quality' ) )
            return false;
        $values = $ini->variable( 'MIMETypeSettings', 'Quality' );
        foreach ( $values as $value )
        {
            $elements = explode( ';', $value );
            $mimeType = $elements[0];
            $qualityValue = $elements[1];
            $this->appendQualityValue( $mimeType, $qualityValue );
        }
    }
1175683
public function invoke(MethodInvocation $invocation)
    {
        list($onValidate, $onFailure) = $this->getOnValidate($invocation->getMethod());
        list($isValid, $failure) = $this->validate($invocation, $onValidate, $onFailure);
        if ($isValid === true) {
            // validation success
            return $invocation->proceed();
        }

        // onFailure
        return $failure;
    }
1133879
function readConversionRuleSettingsFromINI( $iniFile = false )
    {
        if ( !$iniFile )
            $iniFile = 'image.ini';
        $ini = eZINI::instance( $iniFile );
        if ( !$ini )
            return false;
        if ( $ini->hasVariable( 'MIMETypeSettings', 'ConversionRules' ) )
        {
            $conversionRules = array();
            $rules = $ini->variable( 'MIMETypeSettings', 'ConversionRules' );
            foreach ( $rules as $ruleString )
            {
                $ruleItems = explode( ';', $ruleString );
                if ( count( $ruleItems ) >= 2 )
                {
                    $conversionRule = array( 'from' => $ruleItems[0],
                                             'to' => $ruleItems[1] );
                    $this->appendConversionRule( $conversionRule );
                }
            }
        }
    }
1362286
public function evaluate($variable = array())
    {
        $returnValue = (bool) false;

        
        
        common_Logger::i('Evaluating Expression uri: '. $this->getUri(), array('Generis Expression'));
        common_Logger::i('Evaluating Expression name: '. $this->getLabel(), array('Generis Expression'));
		if ($this->getUri() == RulesRdf::INSTANCE_EXPRESSION_TRUE) {
			return true;
		}
    	if ($this->getUri() == RulesRdf::INSTANCE_EXPRESSION_FALSE) {
			return false;
		}
		$returnValue = $this->expEval($variable);
		$logValue = $returnValue ? ' TRUE ' : ' FALSE ';
		common_Logger::i('Value : '. $logValue, array('Generis Expression'));
        

        return (bool) $returnValue;
    }
167305
protected function processIni(Exception $exception)
    {
        $message = $exception->getMessage();

        /*
         * Expecting: syntax error, unexpected '!' in Unknown on line 4
         */
        if (!starts_with($message, 'syntax error')) {
            return false;
        }
        if (strpos($message, 'Unknown') === false) {
            return false;
        }
        if (strpos($exception->getFile(), 'Ini.php') === false) {
            return false;
        }

        /*
         * Line number from parse_ini_string() error.
         * The last word should contain the line number.
         */
        $parts = explode(' ', $message);
        $line = array_pop($parts);
        $this->line = (int)$line;

        // Find where the ini settings section begins
        $offsetArray = SectionParser::parseOffset($this->compoundObject->getContent());
        $this->line += $offsetArray['settings'];

        $this->message = $message;

        // Account for line 0
        $this->line--;

        return true;
    }
653569
public function readParams($filename)
    {

        //We will only parse the file if it has not already been parsed!;
        if (!array_key_exists($filename, $this->namespace)) {
            if (file_exists($filename)) {
                if (($this->namespace[$filename] = parse_ini_file($filename, true)) === FALSE) {
                    throw new Exception("Could not Parse the ini file {$filename}");
                    return false;
                } else {
                    //Add the iniParams to $this->params;
                    return $this->namespace[$filename];
                }
            } else {
                // throw new Exception( sprintf("The configuration file (%s) does not exists",$filename ) );
                return [];
            }
        } else {
            return $this->namespace[$filename];
        }
    }
414203
public function evaluate($values)
    {
        $returnValue = (bool) false;


        if (is_array($values) && count($values) == 2) {
        	list($first, $second) = $values;
        	$returnValue = $first == $second;

        } elseif ($this->hasOption('password2_ref')) {
			$secondElement = $this->getOption('password2_ref');
			if (is_null($secondElement) || ! $secondElement instanceof tao_helpers_form_FormElement) {
				throw new common_Exception("Please set the reference of the second password element");
			}
			if($values == $secondElement->getRawValue() && trim($values) != ''){
				$returnValue = true;
			}
        } else {
            throw new common_Exception("Please set the reference of the second password element or provide array of 2 elements");
        }



        return (bool) $returnValue;
    }
1023
public static function parseFile($ini) {
		if (!file_exists($ini)) {
			throw new Exception(sprintf('Missing TinyAuth config file (%s)', $ini));
		}

		if (function_exists('parse_ini_file')) {
			$iniArray = parse_ini_file($ini, true);
		} else {
			$content = file_get_contents($ini);
			if ($content === false) {
				throw new Exception('Cannot load INI file.');
			}
			$iniArray = parse_ini_string($content, true);
		}

		if (!is_array($iniArray)) {
			throw new Exception(sprintf('Invalid TinyAuth config file (%s)', $ini));
		}
		return $iniArray;
	}
41176
public function evaluateContexts(array $provided = []) {

    $this->activeContexts = [];

    /** @var \Drupal\context\ContextInterface $context */
    foreach ($this->getContexts() as $context) {
      if ($this->evaluateContextConditions($context, $provided) && !$context->disabled()) {
        $this->activeContexts[$context->id()] = $context;
      }
    }

    $this->contextConditionsEvaluated = TRUE;
  }
249758
public function initialize(array $config = []) {
		$config = $this->_config;

		if (empty($config['bits'])) {
			$config['bits'] = Inflector::variable(Inflector::pluralize($config['field']));
		}

		$entity = $this->_table->newEntity();

		if (is_callable($config['bits'])) {
			$config['bits'] = call_user_func($config['bits']);
		} elseif (is_string($config['bits']) && method_exists($entity, $config['bits'])) {
			$method = $config['bits'];
			$config['bits'] = version_compare(PHP_VERSION, '7.0', '<') ? $entity->$method() : $entity::$method();
		} elseif (is_string($config['bits']) && method_exists($this->_table, $config['bits'])) {
			$table = $this->_table;
			$method = $config['bits'];
			$config['bits'] = version_compare(PHP_VERSION, '7.0', '<') ? $table->$method() : $table::$method();
		} elseif (!is_array($config['bits'])) {
			$config['bits'] = false;
		}
		if (empty($config['bits'])) {
			$method = Inflector::variable(Inflector::pluralize($config['field'])) . '()';
			throw new RuntimeException('Bits not found for field ' . $config['field'] . ', expected pluralized static method ' . $method . ' on the entity.');
		}
		ksort($config['bits'], SORT_NUMERIC);

		$this->_config = $config;
	}
443181
public function checkRule(TypoScriptFrontendController $frontendController, string $uri, array &$explanation, bool &$skipProcessing)
    {
        if ($frontendController->isINTincScript()) {
            foreach ((array)$frontendController->config['INTincScript'] as $key => $configuration) {
                $explanation[__CLASS__ . ':' . $key] = 'The page has a INTincScript: ' . \implode(', ', $this->getInformation($configuration));
            }
        }
    }