Browse files

Remove bug in autorun management in PHAR.

  • Loading branch information...
1 parent bb42327 commit 9694f619cb890a8fe9771978d56e0b11b715269c @mageekguy mageekguy committed Oct 8, 2012
Showing with 4 additions and 4 deletions.
  1. +2 −2 classes/scripts/runner.php
  2. +1 −1 scripts/phar/resources/stub.php
  3. +1 −1 scripts/runner.php
View
4 classes/scripts/runner.php
@@ -269,9 +269,9 @@ public function testMethod($class, $method)
return $this;
}
- public static function autorunIsEnabled()
+ public static function autorunMustBeEnabled()
{
- return (static::$autorunner !== false);
+ return (static::$autorunner !== false && static::$autorunner === true);
}
public static function enableAutorun($name)
View
2 scripts/phar/resources/stub.php
@@ -25,7 +25,7 @@
define(__NAMESPACE__ . '\scripts\runner', __FILE__);
}
-if (phar\stub::autorunIsEnabled() === true)
+if (phar\stub::autorunMustBeEnabled() === true)
{
phar\stub::enableAutorun(constant(__NAMESPACE__ . '\scripts\runner'));
}
View
2 scripts/runner.php
@@ -13,7 +13,7 @@
define(__NAMESPACE__ . '\scripts\runner', __FILE__);
}
-if (scripts\runner::autorunIsEnabled() === true)
+if (scripts\runner::autorunMustBeEnabled() === true)
{
scripts\runner::enableAutorun(constant(__NAMESPACE__ . '\scripts\runner'));
}

0 comments on commit 9694f61

Please sign in to comment.