Returns whether a PHP Class or Script has valid Syntax.
@access		public
@param		string		$fileName		File Name of PHP File to check
@return		bool
774565
public function checkFile( $fileName )
	{
		$output = shell_exec('php -l "'.$fileName.'"');
		if( preg_match( "@^No syntax errors detected@", $output	) )
			return TRUE;
		$this->error	= $output;
		return FALSE;
	}
1318914
private function isValidTemplateFile($filename, $isLayout = false)
    {
        $adapter = $this->determineWhichAdapterToUse($filename);
        if (null === $adapter) {
            return false;
        }

        return $adapter->isValidTemplateFile(
            $filename, true === $isLayout ? $this->_layoutdir : $this->_scriptdir
        );
    }
500670
protected function isSuffixValid(string $className): bool
    {
        if ($this->isSourcePluginSuffixValid($className)) {
            return true;
        }

        if ($this->isTestPluginSuffixValid($className)) {
            return true;
        }

        return false;
    }
140557
private function isEnvironmentFilename(string $filename): bool
    {
        $filenameEnding = substr($filename, strpos($filename, '.'));
        foreach ($this->environments as $environment) {
            if ($filenameEnding === '.' . $environment . '.php') {
                return true;
            }
        }
        return false;
    }
803027
protected function compileFileName($className)
    {
        if (!$className) {
            return false;
        }

        $className = str_replace($this->getAppNamespace(), '', $className);
        $className = str_replace('\\', DIRECTORY_SEPARATOR, $className);

        return $className . '.php';
    }
795057
private function isValidShortClassName(string $name): bool
    {
        return empty($name) === false && preg_match(static::VALID_CLASS_NAME_REGEX, $name) === 1;
    }
1009119
public function parseFile($filename)
    {
        // Run the fileEval the string, if it throws an exception, rethrow it
        try {
            $data = require $filename;
        } catch (Exception $exception) {
            throw new ParseException(
                [
                    'message'   => 'PHP file threw an exception',
                    'exception' => $exception,
                ]
            );
        }

        // Complete parsing
        return (array)$this->parse($data, $filename);
    }
572636
public function isValidDriverClass($className)
    {
        if (!class_exists($className)) {
            return false;
        }

        if (!is_subclass_of($className, 'Bex\\Behat\\ExtensionDriverLocator\\DriverInterface')) {
            return false;
        }

        if (!empty($this->parent) && !is_subclass_of($className, $this->parent)) {
            return false;
        }

        return true;
    }
163671
private function isValidWidgetClass($className)
    {
        //====================================================================//
        // Safety Check => Widget Type is String
        if (!is_string($className)) {
            return "Widget Type is Not a String";
        }
        //====================================================================//
        // Safety Check => Class Exists
        if (!class_exists($className)) {
            return "Widget Class Not Found";
        }
        //====================================================================//
        // Safety Check => Class Extends
        if (!is_subclass_of($className, AbstractWidget::class)) {
            return "Widget Class MUST extends ".AbstractWidget::class;
        }

        return true;
    }
733296
public static function valid($filename = null)
	{
		if (!$filename)
		{
			return false;
		}

		if (preg_match("/^\s*http[s]{0,1}:/i", $filename))
		{
			return false;
		}
		if (preg_match("/^\s*[\/]{0,1}index.php\?/i", $filename))
		{
			return false;
		}
		// Disallow windows drive letter
		if (preg_match("/^\s*[.]:/", $filename))
		{
			return false;
		}
		// Disallow \
		if (strpos($filename, '\\'))
		{
			return false;
		}
		// Disallow ..
		if (strpos($filename, '..'))
		{
			return false;
		}

		return true;
	}
146343
function isFile( $filename = false )
    {
        if ( !$filename )
            $filename = $this->FileName;
        return $this->doIsFile( $filename );
    }
39276
private function isValidObjectClass($className)
    {
        //====================================================================//
        // Safety Check => Object Type is String
        if (!is_string($className)) {
            return "Object Type is Not a String";
        }
        //====================================================================//
        // Safety Check => Class Exists
        if (!class_exists($className)) {
            return "Object Class Not Found";
        }
        //====================================================================//
        // Safety Check => Class Extends
        if (!is_subclass_of($className, AbstractObject::class)) {
            return "Object Class MUST extends ".AbstractObject::class;
        }

        return true;
    }
1354654
protected function isSourcePluginSuffixValid(string $className): bool
    {
        $suffix = substr($className, -strlen(static::EXPECTED_CLASS_NAME_SUFFIX));

        return ($suffix === static::EXPECTED_CLASS_NAME_SUFFIX);
    }
20197
public function validNameFile($filename,$ext=true){
        $filename = trim($filename);
        if($filename!="." && $filename!=".." && $filename!=" " && preg_match_all("#^[a-zA-Z0-9-_.\s]+$#",$filename) > 0){
            if($ext) return $this->validExt($filename);
            else return true;
        }else{
            return false;
        }
    }
771745
public function isSupportedImageFormat($filename)
	{
		$info = new ImageInfo($filename);
		if ($info->hasError()) {
			$this->container->getLogger()->error($info->getError());
			return false;
		}

		if ( ! $this->isMimeTypeImage($info->getMime())) {
			return false;
		}

		return ImageProcessor\ImageProcessor::isSupportedImageType($info->getType());
	}
749837
protected function isScripted( $html ) {

		if ( preg_match( '/<script[^>]*>.*?<\/script>/is', $html ) ) {
			return true;
		}

		try {
			$html5 = new HtmlParser( true );
			$doc = $html5->loadHTML( $html );
			foreach ( $doc->getElementsByTagname( '*' ) as $element ) {
				foreach ( iterator_to_array( $element->attributes ) as $name => $attribute ) {
					if ( in_array( $name, $this->javaScriptEvents, true ) ) {
						return true;
					}
				}
			}
		} catch ( \Exception $e ) {
			debug_error_log( $e );
		}

		return false;
	}
193093
public static function isGifFile($filename)
    {
        try {
            $image = new ImageFile($filename);
            if (strtolower($image->getMime()) !== @image_type_to_mime_type(IMAGETYPE_GIF)) {
                return false;
            }

            return true;
        } catch (\RuntimeException $ex) {
            return false;
        }
    }