function SessionHelper::checkPath
Same name in other branches
- 8.x-1.x stream_wrapper_example/src/SessionHelper.php \Drupal\stream_wrapper_example\SessionHelper::checkPath()
- 4.0.x modules/stream_wrapper_example/src/SessionHelper.php \Drupal\stream_wrapper_example\SessionHelper::checkPath()
Does path exist?
Parameters
string $path: Path into the store.
Return value
bool Existed or not.
1 call to SessionHelper::checkPath()
- SessionHelper::clearPath in modules/
stream_wrapper_example/ src/ SessionHelper.php - Clear a path into our store.
File
-
modules/
stream_wrapper_example/ src/ SessionHelper.php, line 218
Class
- SessionHelper
- Helper to manage file wrapper data stored in the session object.
Namespace
Drupal\stream_wrapper_exampleCode
public function checkPath($path) {
$path_info = $this->getParentPath($path);
$store_info = $this->processPath($path_info['dirname']);
if (empty($store_info)) {
// Containing directory did not exist.
return FALSE;
}
// Check if we are at the root of a directory.
if ($path_info['basename'] === '') {
return TRUE;
}
return isset($store_info['tip'][$path_info['basename']]);
}