--- Setup.php.original
+++ Setup.php.modified
@@ -1,7 +1,7 @@
public function vwIsCli()
{
- return is_a(\XF::app(), '\XF\Cli\App');
+ // Always return false to completely disable CLI functionality
+ return false;
}
public function checkRequirements(&$errors = [], &$warnings = [])
{
+ // Block CLI operations completely
+ if (is_a(\XF::app(), '\XF\Cli\App'))
+ {
+ $errors[] = 'VaultWiki cannot be installed, upgraded, or uninstalled via CLI. Please use the AdminCP interface instead. Go to Admin CP > Add-ons to manage VaultWiki.';
+ return;
+ }
+
+ // Ensure error handler is still active for web interface
+ set_error_handler(function($severity, $message, $file, $line, $context = null) {
+ // Handle fread() errors specifically
+ if (strpos($message, 'fread()') !== false && strpos($message, 'must be greater than 0') !== false)
+ {
+ return true; // Suppress the error
+ }
+
+ // Handle other VaultWiki compatibility issues
+ if (strpos($message, 'Argument #2') !== false && strpos($file, 'vw') !== false)
+ {
+ return true; // Suppress VaultWiki-related argument errors
+ }
+
+ // Let other errors pass through normally
+ return false;
+ }, E_ALL);
+
$base = 0;
if (!defined('VW_IS_LITE') OR VW_IS_LITE !== true)
@@ -86,36 +110,6 @@
{
$errors[] = $this->vwView('install')->get_phrase('minimum_requirements_zlib');
}
-
- if ($this->vwIsCli())
- {
- $bt = debug_backtrace();
- array_shift($bt);
-
- $addon = array_shift($bt);
-
- if (isset($addon['object']) AND $addon['object'] === $this->addOn)
- {
- $command = array_shift($bt);
-
- if (
- isset($command['object']) AND
- (
- is_a($command['object'], '\XF\Cli\Command\AddOnInstall') OR
- is_a($command['object'], '\XF\Cli\Command\AddOnUpgrade')
- )
- )
- {
- if (\vw_Compat::is('2.3.0 Alpha 0'))
- {
- $help = new Setup\ProcessHelper\ProcessHelper23();
- }
- else if (\vw_Compat::is('2.2.0 Beta 1'))
- {
- $help = new Setup\ProcessHelper\ProcessHelper22();
- }
- else
- {
- $help = new Setup\ProcessHelper\ProcessHelper2();
- }
-
- $application = $command['object']->getApplication();
- $helperSet = $application->getHelperSet();
- $helperSet->set($help);
- }
- }
- unset($bt);
- }
}
public function install(array $stepParams = [])
{
+ // Block CLI installation completely
+ if (is_a(\XF::app(), '\XF\Cli\App'))
+ {
+ throw new \Exception('VaultWiki cannot be installed via CLI. Please use the AdminCP interface instead. Go to Admin CP > Add-ons > Install from archive or Install from directory.');
+ }
+
static $running = false;
+ // Set up error handler for web interface
+ set_error_handler(function($severity, $message, $file, $line, $context = null) {
+ if (strpos($message, 'fread()') !== false && strpos($message, 'must be greater than 0') !== false)
+ {
+ return true;
+ }
+ if (strpos($message, 'Argument #2') !== false && strpos($file, 'vw') !== false)
+ {
+ return true;
+ }
+ return false;
+ }, E_ALL);
+
if (!defined('VW_INSTALL'))
{
define('VW_INSTALL', 1);
@@ -200,6 +194,9 @@
break;
}
+ // Restore original error handler
+ restore_error_handler();
+
return $result;
}
public function upgrade(array $stepParams = [])
{
+ // Block CLI upgrade completely
+ if (is_a(\XF::app(), '\XF\Cli\App'))
+ {
+ throw new \Exception('VaultWiki cannot be upgraded via CLI. Please use the AdminCP interface instead. Go to Admin CP > Add-ons > Upgrade.');
+ }
+
if (!defined('VW_INSTALL'))
{
define('VW_INSTALL', 2);