Validates relation name parameter.

@param string $name Module name
@param string $path Modules root path
@return void
176974
private function validate(string $name, string $path) : void
    {
        if (! ctype_alpha($name)) {
            $this->abort(sprintf('Invalid Relation name provided: %s', $name));
        }

        if (in_array($name, Utility::findDirs($path))) {
            $this->abort(sprintf('Relation %s already exists', $name));
        }
    }
1067578
protected function validateContainerName($name)
    {
        if (empty($name)
            || (false !== strpos($name, '/'))
            || strlen($name) > CONTAINER_NAME_LIMIT) {
            throw new Exceptions\InvalidContainerName();
        }
    }
11774
protected function doesRelationNameConflict($name)
    {
        // relationships
        $relationships = array_merge(
            $this->data['relationships']['normal'],
            $this->data['relationships']['reverse'],
            $this->data['relationships']['image'],
            $this->data['relationships']['file'],
            $this->data['relationships']['checkbox']
        );

        if (array_key_exists($name, $relationships)) return true;

        // attributes
        $attributes = array_merge(
            $this->data->normal_attributes,
            $this->data->translated_attributes
        );

        if (in_array(snake_case($name), $attributes)) return true;

        return false;
    }
974163
protected function checkNameIsNotBlacklisted(string $name): void
    {
        if (Str::contains($name, $this->blacklisted)) {
            throw new InvalidArgumentException("Invalid character in driver name [{$name}].");
        }
    }
431121
public static function register($name, $path, $controller, $methods=null, $restrictTo=null, $defaultResponse, $options=array()) {
		if( $methods && !is_array($methods) ) {
			$methods = array($methods);
		}
		foreach( static::$knownMethods as $method ) {
			if( (!$methods && !empty(static::$routes[$name][$method])) || ($methods && !in_array($method, $methods)) ) {
				continue;
			}
			static::$routes[$name][$method] = new static($name, $path, $controller, $method, $restrictTo, $defaultResponse, $options);
		}
	}
757055
private function validateTagName(string $name): void
    {
        if (! preg_match('/^' . StandardTagFactory::REGEX_TAGNAME . '$/u', $name)) {
            throw new \InvalidArgumentException(
                'The tag name "' . $name . '" is not wellformed. Tags may only consist of letters, underscores, '
                . 'hyphens and backslashes.'
            );
        }
    }
323697
public static function delete($name, $path = "/") {
		if (isset ( $_COOKIE [$name] )) {
			unset ( $_COOKIE [$name] );
		}
		\setcookie ( $name, "", \time () - 3600, $path );
	}
1341564
public static function SetExtensionName($name)
    {
        self::CheckBackend();

        $name = trim($name);

        self::$backend->Set("name", $name);
    }
328094
public function rename($nameold,$namenew,$path){
        if($this->validNameFile($nameold,false) && $this->validNameFile($namenew,false)){
            $fullpath = $this->getFullPath().$path;
            $nameold = $this->clearNameFile($nameold);
            $namenew = $this->clearNameFile($namenew);

            $file = new Filesystem;
            if($file->exists($fullpath.$nameold)){
                if( $this->config['debug'] ) $this->_log('$fullpath.$nameold - '.$fullpath.$nameold);
                if(is_dir($fullpath.$nameold)){
                    $namenew = $this->sanitizeNameFolder($namenew);
                    if($file->exists($fullpath.$namenew)==false){
                        $file->rename($fullpath.$nameold,$fullpath.$namenew);
                        $result = array("query"=>"BE_RENAME_MODIFIED","params"=>array());
                        $this->setInfo(array("msg"=>$result,"data"=>array("namefile" => $namenew )));

                    }else{
                        $result = array("query"=>"BE_RENAME_EXISTED","params"=>array());
                        $this->setInfo(array("msg"=>$result,"status"=>0));
                    }
                }elseif(is_file($fullpath.$nameold)){
                    if($this->validExt($nameold)){
                        $extold = $this->getExtension($nameold);
                        $namenew = $namenew.'.'.$extold;
                        if($file->exists($fullpath.$namenew)==false){
                            $file2 = new \SplFileInfo($fullpath.$nameold);
                            if(in_array($file2->getExtension(), $this->config['images']['images_ext'])){
                                $filename = $file2->getFilename();
                                foreach ($this->config['images']['resize'] as $key => $value) {
                                    $image_info = $this->imageSizeName($path,$filename,$value);
                                    $filename_old = $image_info['name'];
                                    $fullpaththumb_name = $this->getFullPath().'/'.$this->config['folder_thumb'].$path.$filename_old;
                                    $file->remove($fullpaththumb_name);
                                }
                            }
                            $file->rename($fullpath.$nameold,$fullpath.$namenew);
                            $file3 = new \SplFileInfo($fullpath.$namenew);
                            $this->createThumb($file3,$path);
                            $result = array("query"=>"BE_RENAME_MODIFIED","params"=>array());
                            $this->setInfo(array("msg"=>$result,"data"=>array("namefile" => $namenew )));
                        }else{
                            $result = array("query"=>"BE_RENAME_EXISTED","params"=>array());
                            $this->setInfo(array("msg"=>$result,"status"=>0));
                        }
                    }else{
                        $result = array("query"=>"BE_RENAME_FILENAME_NOT_VALID","params"=>array());
                        $this->setInfo(array("msg"=>$result, "status"=>0));
                    }
                }
            }else{
                $result = array("query"=>"BE_RENAME_NOT_EXISTS","params"=>array());
                $this->setInfo(array("msg"=>$result, "status"=>0));
            }
        }else{
           $result = array("query"=>"BE_RENAME_FILENAME_NOT_VALID","params"=>array());
           $this->setInfo(array("msg"=>$result, "status"=>0));
       }
   }
228285
public function offsetSet($name, $path)
    {
        if($path instanceof \Exedra\Path)
        {
            $this->pathRegistry[$name] = $path;

            return;
        }

        $path = $this->basePath.'/'.ltrim($path, '/\\');

        $this->pathRegistry[$name] = new static($path);
    }
1121789
private function validateAsToOneRelationship(int $index, string $name, $mightBeRelationship): void
    {
        if (is_array($mightBeRelationship) === true &&
            array_key_exists(DI::KEYWORD_DATA, $mightBeRelationship) === true &&
            ($parsed = $this->parseSingleRelationship($mightBeRelationship[DI::KEYWORD_DATA])) !== false
        ) {
            // All right we got something. Now pass it to a validation rule.
            $this->executeBlock($parsed, $index);
        } else {
            $title   = $this->formatMessage(Messages::INVALID_VALUE);
            $details = $this->formatMessage(Messages::INVALID_RELATIONSHIP);
            $status  = JsonApiResponse::HTTP_UNPROCESSABLE_ENTITY;
            $this->getJsonApiErrorCollection()->addRelationshipError($name, $title, $details, (string)$status);
            $this->addErrorStatus($status);
        }
    }
987162
protected function handleRouteRequirements($pathinfo, $name, Route $route)
    {
        // expression condition
        if ($route->getCondition() && !$this->getExpressionLanguage()->evaluate($route->getCondition(), ['context' => $this->context, 'request' => $this->request ?: $this->createRequest($pathinfo)])) {
            return [self::REQUIREMENT_MISMATCH, null];
        }

        return [self::REQUIREMENT_MATCH, null];
    }
825027
public void validateName(final String name) {
        Validate.validState(
                TENANT_NAME_VALIDATOR_PATTERN.matcher(name).matches(),
                "Invalid tenant name '%s'  -- names must match %s .",
                name,
                TENANT_NAME_VALIDATOR_REGEX);
    }
492948
protected function _mkfile($path, $name) {
		return $this->make($path, $name, 'text/plain') ? $this->_joinPath($path, $name) : false;
	}
1219598
private function validateName($name) {
        if (!is_string($name))    throw new IllegalTypeException('Illegal type of parameter $name: '.gettype($name));
        if ($name != trim($name)) throw new InvalidArgumentException('Invalid parameter $name: "'.$name.'" (enclosing white space)');

        if (strlen($name) && !preg_match('/^[^\s:]+(:[^\s:]+)*$/', $name))
            throw new InvalidArgumentException('Invalid parameter $name: "'.$name.'" (not a command name)');
        return $this;
    }
328855
protected function isNameValid($name)
    {
        if (is_string($name) === false) {
            return false;
        }

        $match = preg_match(self::PATTERN_VALIDATE_NAME, $name);
        if ($name === '' || $match === false || $match <= 0) {
            return false;
        } else {
            return true;
        }
    }
109598
public static function map( $name, $path = null ) 
	{
		if ( is_array( $name ) ) 
		{
			static::$namespaces = array_merge( static::$namespaces, $name ); return;
		}
		static::$namespaces[$name] = $path;
	}