aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/event/php_exporter.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-04-28 23:39:37 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-04-28 23:52:48 +0200
commit7f90ff70acd036a022db924bb8d0e0d3f64b8ff8 (patch)
tree55f057b5479f21dfa29b971939aa1cc04abf1952 /phpBB/phpbb/event/php_exporter.php
parent2d5bae555d40423c9b687d46e78bad2129b9e014 (diff)
downloadforums-7f90ff70acd036a022db924bb8d0e0d3f64b8ff8.tar
forums-7f90ff70acd036a022db924bb8d0e0d3f64b8ff8.tar.gz
forums-7f90ff70acd036a022db924bb8d0e0d3f64b8ff8.tar.bz2
forums-7f90ff70acd036a022db924bb8d0e0d3f64b8ff8.tar.xz
forums-7f90ff70acd036a022db924bb8d0e0d3f64b8ff8.zip
[ticket/12273] Move $extension to constructor so the path is always set
PHPBB3-12273
Diffstat (limited to 'phpBB/phpbb/event/php_exporter.php')
-rw-r--r--phpBB/phpbb/event/php_exporter.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/phpBB/phpbb/event/php_exporter.php b/phpBB/phpbb/event/php_exporter.php
index 879a7eb5ab..d86ee3c045 100644
--- a/phpBB/phpbb/event/php_exporter.php
+++ b/phpBB/phpbb/event/php_exporter.php
@@ -40,14 +40,21 @@ class php_exporter
/**
* @param string $phpbb_root_path
+ * @param mixed $extension String 'vendor/ext' to filter, null for phpBB core
*/
- public function __construct($phpbb_root_path)
+ public function __construct($phpbb_root_path, $extension = null)
{
$this->root_path = $phpbb_root_path;
$this->path = $phpbb_root_path;
$this->events = $this->file_lines = array();
$this->current_file = $this->current_event = '';
$this->current_event_line = 0;
+
+ $this->path = $this->root_path;
+ if ($extension)
+ {
+ $this->path .= 'ext/' . $extension . '/';
+ }
}
/**
@@ -86,17 +93,10 @@ class php_exporter
/**
* Crawl the phpBB/ directory for php events
- * @param mixed $extension String 'vendor/ext' to filter, null for phpBB core
* @return int The number of events found
*/
- public function crawl_phpbb_directory_php($extension = null)
+ public function crawl_phpbb_directory_php()
{
- $this->path = $this->root_path;
- if ($extension)
- {
- $this->path .= 'ext/' . $extension . '/';
- }
-
$files = $this->get_recursive_file_list();
$this->events = array();
foreach ($files as $file)