From 4c96efe1c78fcc4c1d94e0c1584ddea1b995cbc7 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 17 Aug 2012 22:56:24 +0200 Subject: [PATCH] Minor refactorings. --- makefile.js | 2 +- src/_h5ai/php/inc/Entry.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/makefile.js b/makefile.js index cc86ac42..b641cc2d 100644 --- a/makefile.js +++ b/makefile.js @@ -6,7 +6,7 @@ var path = require('path'), child_process = require('child_process'); -var version = '0.22-dev-8', +var version = '0.22-dev-11', root = path.resolve(__dirname), src = path.join(root, 'src'), diff --git a/src/_h5ai/php/inc/Entry.php b/src/_h5ai/php/inc/Entry.php index d9aab195..eafdcfb1 100644 --- a/src/_h5ai/php/inc/Entry.php +++ b/src/_h5ai/php/inc/Entry.php @@ -8,7 +8,7 @@ class Entry { private static $cache = array(); - private static function startsWith($sequence, $part) { + private static function starts_with($sequence, $part) { return (substr($sequence, 0, strlen($part)) === $part); } @@ -22,7 +22,7 @@ class Entry { public static function get($h5ai, $absPath, $absHref) { - if (!Entry::startsWith($absHref, $h5ai->getRootAbsHref())) { + if (!Entry::starts_with($absHref, $h5ai->getRootAbsHref())) { error_log("ILLEGAL REQUEST: " . $absHref . ", " . $absPath . ", " . $h5ai->getRootAbsHref()); return null; } @@ -75,7 +75,7 @@ class Entry { $this->parent = null; $parentAbsHref = H5ai::normalize_path(dirname($this->absHref), true); - if ($this->absHref !== "/" && Entry::startsWith($parentAbsHref, $h5ai->getRootAbsHref())) { + if ($this->absHref !== "/" && Entry::starts_with($parentAbsHref, $h5ai->getRootAbsHref())) { $this->parent = Entry::get($this->h5ai, H5ai::normalize_path(dirname($this->absPath)), $parentAbsHref); }