Check if the current directory is of a valid extension.
@return boolean
508612
public static function ValidExtension()
    {
        $dir = self::GetCwd();

        if(
            // Templates
            is_dir($dir . "/templates") &&
            
            // Peg configuration file
            (file_exists($dir . "/peg.conf") || file_exists($dir . "/peg.json"))
        )
        {
            return true;
        }

        return false;
    }
45461
public function isValid() {
		
		$file = $this -> getFile();

		$messages = [

			UPLOAD_ERR_FORM_SIZE 	=> 'File exceeds the maximum file size that was specified in the HTML form',
			UPLOAD_ERR_PARTIAL 		=> 'File was only partially uploaded',
			UPLOAD_ERR_NO_FILE		=> 'No file was uploaded',
			UPLOAD_ERR_NO_TMP_DIR	=> 'Missing a temporary folder',
			UPLOAD_ERR_CANT_WRITE	=> 'Failed to write file to disk',
			UPLOAD_ERR_EXTENSION	=> 'An extension stopped the file upload'
		];

		if(false === isset($messages[$file['error']])) {
			return true;
		}

		$this -> setMessage($messages[$file['error']]);

		return false;
	}
327122
public function validateStoragePath()
    {
        if (!$this->files->exists($this->storage)) {
            return $this->files->makeDirectory($this->storage);
        }

        return true;
    }
519118
public function isValidExtension()
    {
        return !count($this->allowedExtensions)
            || in_array($this->getFileExtension(), $this->allowedExtensions, true);
    }
394040
public function valid()
	{
		if( $this->next() )
			return TRUE;
		if( is_resource( $this->filePointer ) )
			fclose( $this->filePointer );
		return FALSE;
	}
617482
protected function isValidArchive()
    {
        $isValid = false;
        $zip = new ZipArchive();
        //check the archive opening and the consistency
        if ($zip->open($this->getExtractedSource(), ZIPARCHIVE::CHECKCONS) !== false) {
            //check if the manifest is there
            if ($zip->locateName("index.html") !== false) {
                $isValid = true;
            } else {
                $this->addError(__("An Open Web Item package must contain an index.html file at the root of the archive."));
            }
        } else {
            $this->addError(__("The ZIP archive containing the Open Web Item could not be open."));
        }

        return $isValid;
    }
194443
public function valid()
    {
        if ($this->_buffer->offsetExists($this->_index)) {
            $current = $this->_buffer->offsetGet($this->_index);
            $this->_current = $current['value'];
            $this->_key = $current['key'];

            return true;
        }

        $valid = parent::valid();

        if ($valid) {
            $this->_current = parent::current();
            $this->_key = parent::key();
            $this->_buffer->push([
                'key' => $this->_key,
                'value' => $this->_current
            ]);
        }

        $this->_finished = !$valid;

        return $valid;
    }
1201179
public function isValid()
	{
		return isset($this->path)
			|| isset($this->params)
			|| isset($this->anchor)
			|| isset($this->secure)
			|| isset($this->host)
			|| isset($this->port)
			|| isset($this->user)
			|| isset($this->pass);
	}
10932
def _is_valid_extension(extension):
    
    if not cfg.CONF.valid_extensions:
        return True

    valid = False
    for cext in cfg.CONF.valid_extensions:
        if not cext.startswith('.'):
            cext = '.%s' % cext
        if extension == cext:
            valid = True
            break

    return valid
526404
private function _get_file_extension()
    {

        if (empty($this->u_mime_type)) return false;

        $tmp                  = explode('/', $this->u_mime_type);
        $this->file_extension = array_pop($tmp);

        unset($tmp);

        return true;
    }
414324
public function is_valid() {
        $ret = false;

        if (is_null($this->deleteInsteadOfAppend) === false && is_null($this->subscriberIds) === false &&
            is_null($this->emails) === false
        ) {
            $ret = true;
        }

        return $ret;
    }
1048262
public function isAbsolutePathReference():bool{
		return $this->getScheme() === '' && $this->getAuthority() === '' && isset($this->getPath()[0]) && $this->getPath()[0] === '/';
	}
1177560
public function isValid(): bool
    {
        $uris = [];
        foreach ($this->members as $member) {
            $uri = $member->uri;
            if ($uri) {
                if (isset($uris[$uri])) {
                    return false;
                } else {
                    $uris[$uri] = true;
                }
            }
        }
        return true;
    }
1032695
public function checkDirectory(): bool
    {
        if ($this->directory == null) {
            throw new LoggerException('Log directory is not defined yet');
        }

        self::$directoryChecked = self::$directoryChecked ?: is_dir($this->directory);
        if (!self::$directoryChecked) {
            self::$directoryChecked = (bool) @mkdir($this->directory, 0644, true);
            if (self::$directoryChecked === false) {
                throw new LoggerException(sprintf('Cannot make directory, error[%s]',
                    error_get_last()['message'] ?? 'Unknown'));
            }
        }

        return self::$directoryChecked;
    }
789312
protected function _isExtensionsActive()
    {
        $aModuleExtensions = $this->getExtensions();

        $aInstalledExtensions = \OxidEsales\Eshop\Core\Registry::getConfig()->getModulesWithExtendedClass();
        $iModuleExtensionsCount = $this->_countExtensions($aModuleExtensions);
        $iActivatedModuleExtensionsCount = $this->_countActivatedExtensions($aModuleExtensions, $aInstalledExtensions);

        return $iModuleExtensionsCount > 0 && $iActivatedModuleExtensionsCount == $iModuleExtensionsCount;
    }
856138
protected function checkDirectory()
    {
        $directoryPath = $this
            ->directory
            ->getDirectoryPath();

        if (!is_dir($directoryPath)) {

            mkdir($directoryPath);
        }

        return $this;
    }
1157046
protected function isDir($dir)
    {
        try {
            $this->doChangeDir($dir);
            $this->doCdUp();

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

        return false;
    }