File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 1+ #### 2.5.2
2+ * Remove PHP7 function and replace with PHP5+ function for backwards compatibility.
3+
14#### 2.5.1
25* Fix single site issue
36
Original file line number Diff line number Diff line change 44 *
55 * @author Seth Carstens
66 * @package abtract-plugin-base
7- * @version 2.5.0
7+ * @version 2.5.1
88 * @license GPL 2.0 - please retain comments that express original build of this file by the author.
99 */
1010
@@ -238,8 +238,8 @@ public function autoload( $class ) {
238238 protected function configure_defaults () {
239239 $ this ->modules = new \stdClass ();
240240 $ this ->modules ->count = 0 ;
241- $ this ->installed_dir = dirname ( static ::$ current_file , 1 );
242- $ this ->plugin_basedir = dirname ( static ::$ current_file , 2 );
241+ $ this ->installed_dir = static :: dirname ( static ::$ current_file , 1 );
242+ $ this ->plugin_basedir = static :: dirname ( static ::$ current_file , 2 );
243243 $ assumed_plugin_name = basename ( $ this ->plugin_basedir );
244244 $ this ->plugin_file = $ this ->plugin_basedir . '/ ' . $ assumed_plugin_name . '.php ' ;
245245 $ this ->wp_plugin_slug = $ assumed_plugin_name . '/ ' . $ assumed_plugin_name . '.php ' ;
@@ -283,6 +283,22 @@ public static function deactivate() {
283283 */
284284 abstract protected function defines_and_globals ();
285285
286+ /**
287+ * Dirname function that mimics PHP7 dirname() enhancements so that we can enable PHP5.6 support.
288+ *
289+ * @param $path
290+ * @param int $count
291+ *
292+ * @return string
293+ */
294+ public static function dirname ($ path , $ count =1 ){
295+ if ($ count > 1 ){
296+ return dirname (static ::dirname ($ path , --$ count ));
297+ }else {
298+ return dirname ($ path );
299+ }
300+ }
301+
286302 /**
287303 * Utility function to get class name from filename if you follow this abstract plugin's naming standards
288304 *
You can’t perform that action at this time.
0 commit comments