concrete/src/System/Mutex/MutexTrait.php
protected function getFilenameForMutexKey($mutexKey)
    {
        $mutexKeyString = (is_string($mutexKey) || is_int($mutexKey)) ? (string) $mutexKey : '';
        if ($mutexKeyString === '') {
            throw new InvalidMutexKeyException($mutexKey);
        }
        if (preg_match('/^[a-zA-Z0-9_\-]{1,50}$/', $mutexKeyString)) {
            $filenameChunk = $mutexKeyString;
        } else {
            $filenameChunk = sha1($mutexKeyString);
        }

        return $this->temporaryDirectory . '/mutex-' . md5(DIR_APPLICATION) . '-' . $filenameChunk . '.lock';
    }
protected function getFilenameForMutexKey($mutexKey)
    {
        $mutexKeyString = (is_string($mutexKey) || is_int($mutexKey)) ? (string) $mutexKey : '';
        if ($mutexKeyString === '') {
            throw new InvalidMutexKeyException($mutexKey);
        }
        if (preg_match('/^[a-zA-Z0-9_\-]{1,50}$/', $mutexKeyString)) {
            $filenameChunk = $mutexKeyString;
        } else {
            $filenameChunk = sha1($mutexKeyString);
        }

        return $this->temporaryDirectory . '/mutex-' . md5(DIR_APPLICATION) . '-' . $filenameChunk . '.lock';
    }
protected function getFilenameForMutexKey ( $ mutexKey ) { $ mutexKeyString = ( is_string ( $ mutexKey ) || is_int ( $ mutexKey ) ) ? ( string ) $ mutexKey : '' ; if ( $ mutexKeyString === '' ) { throw new InvalidMutexKeyException ( $ mutexKey ) ; } if ( preg_match ( '/^[a-zA-Z0-9_\-]{1,50}$/' , $ mutexKeyString ) ) { $ filenameChunk = $ mutexKeyString ; } else { $ filenameChunk = sha1 ( $ mutexKeyString ) ; } return $ this -> temporaryDirectory . '/mutex-' . md5 ( DIR_APPLICATION ) . '-' . $ filenameChunk . '.lock' ; }
Get the full path of a temporary file that's unique for the concrete5 application and for the specified mutex key.

@param string $key The mutex key
@param mixed $mutexKey

@throws InvalidMutexKeyException

@return string
Get the full path of a temporary file that s unique for the concrete5 application and for the specified mutex key .