opt
/
cpanel
/
ea-wappspector
/
vendor
/
rector
/
rector
/
src
/
Skipper
➕ New
📤 Upload
✎ Editing:
RealpathMatcher.php
← Back
<?php declare (strict_types=1); namespace Rector\Skipper; use Rector\Skipper\FileSystem\PathNormalizer; final class RealpathMatcher { public function match(string $matchingPath, string $filePath) : bool { /** @var string|false $realPathMatchingPath */ $realPathMatchingPath = \realpath($matchingPath); if ($realPathMatchingPath === \false) { return \false; } /** @var string|false $realpathFilePath */ $realpathFilePath = \realpath($filePath); if ($realpathFilePath === \false) { return \false; } $normalizedMatchingPath = PathNormalizer::normalize($realPathMatchingPath); $normalizedFilePath = PathNormalizer::normalize($realpathFilePath); // skip define direct path if (\is_file($normalizedMatchingPath)) { return $normalizedMatchingPath === $normalizedFilePath; } // ensure add / suffix to ensure no same prefix directory if (\is_dir($normalizedMatchingPath)) { $normalizedMatchingPath = \rtrim($normalizedMatchingPath, '/') . '/'; } return \strncmp($normalizedFilePath, $normalizedMatchingPath, \strlen($normalizedMatchingPath)) === 0; } }
💾 Save Changes
Cancel
📤 Upload File
×
Select File
Upload
Cancel
➕ Create New
×
Type
📄 File
📁 Folder
Name
Create
Cancel
✎ Rename Item
×
Current Name
New Name
Rename
Cancel
🔐 Change Permissions
×
Target File
Permission (e.g., 0755, 0644)
0755
0644
0777
Apply
Cancel