]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Renamed ElggPlugin->canIncludeFile() to ->canReadFile() and am using is_readable...
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 25 Apr 2011 14:46:28 +0000 (14:46 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 25 Apr 2011 14:46:28 +0000 (14:46 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@9021 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/classes/ElggPlugin.php

index 34e8e6732c64fae865110df5792e9217c5a77a4b..f8a6d9b5ce95498ab5761eb874bd1e4187739c5f 100644 (file)
@@ -640,7 +640,7 @@ class ElggPlugin extends ElggObject {
                        // if there are any on_enable functions, start the plugin now and run them
                        // Note: this will not run re-run the init hooks!
                        if ($return) {
-                               if ($this->canIncludeFile('activate.php')) {
+                               if ($this->canReadFile('activate.php')) {
                                        $flags = ELGG_PLUGIN_INCLUDE_START | ELGG_PLUGIN_REGISTER_CLASSES
                                                        | ELGG_PLUGIN_REGISTER_LANGUAGES | ELGG_PLUGIN_REGISTER_VIEWS;
 
@@ -682,7 +682,7 @@ class ElggPlugin extends ElggObject {
 
                // run any deactivate code
                if ($return) {
-                       if ($this->canIncludeFile('deactivate.php')) {
+                       if ($this->canReadFile('deactivate.php')) {
                                $return = $this->includeFile('deactivate.php');
                        }
                }
@@ -750,7 +750,7 @@ class ElggPlugin extends ElggObject {
 
                $filepath = "$this->path/$filename";
 
-               if (!$this->canIncludeFile($filename)) {
+               if (!$this->canReadFile($filename)) {
                        $msg = elgg_echo('ElggPlugin:Exception:CannotIncludeFile',
                                                        array($filename, $this->getID(), $this->guid, $this->path));
                        throw new PluginException($msg);
@@ -765,8 +765,8 @@ class ElggPlugin extends ElggObject {
         * @param string $filename The name of the file
         * @return bool
         */
-       protected function canIncludeFile($filename) {
-               return file_exists($this->path.'/'.$filename);
+       protected function canReadFile($filename) {
+               return is_readable($this->path . '/' . $filename);
        }
 
        /**