VaultWiki

VaultWiki [Paid] 4.1.7 Patch Level 1

No permission to buy ($15.00)
No, extras like branding removal affect the overall subscription price, so you would have an increased monthly price for as long as you keep branding removal turned on. Also, the terms for some extras are slightly different. Even though you are allowed to keep using the software after your subscription is over, you must keep your subscription current in order to maintain the branding removal.
 
No, extras like branding removal affect the overall subscription price, so you would have an increased monthly price for as long as you keep branding removal turned on. Also, the terms for some extras are slightly different. Even though you are allowed to keep using the software after your subscription is over, you must keep your subscription current in order to maintain the branding removal.
I bought your addon and failed to install addon caused error:
Code:
[root@root httpdocs]$ php cmd.php xf-addon:install vw/vw
Please confirm that you want to install the following add-on: (VaultWiki 4.1.9) (y/n)y

In Process.php line 144:

  Symfony\Component\Process\Process::__construct(): Argument #1 ($command) must be of type array, string g
  iven, called in /var/www/vhosts/domain.com/httpdocs/src/addons/vw/vw/Setup/ProcessHelper/ProcessHelper
  Base.php on line 41


In Process.php line 144:

  Symfony\Component\Process\Process::__construct(): Argument #1 ($command) must be of type array, string g
  iven, called in /var/www/vhosts/domain.com/httpdocs/src/addons/vw/vw/Setup/ProcessHelper/ProcessHelper
  Base.php on line 41


xf:addon-install [-f|--force] [--] <id>

Code:
Server error log
[LIST]
[*]XF\Mvc\Reply\Exception: Batch install error: 
[*]src/addons/vw/vw/Setup.php:752
[*]Generated by: Yenxji
[*]Jun 12, 2025 at 17:08
[/LIST]
[HEADING=2]Stack trace[/HEADING]
#0 src/addons/vw/vw/Setup.php(420): vw\vw\Setup->vwHandleBrowserInteractions(Object(vw\vw\Setup\View), Array)
#1 src/addons/vw/vw/Setup.php(378): vw\vw\Setup->vwHandleInteractions(Object(vw\vw\Setup\View), Array)
#2 src/addons/vw/vw/Setup.php(362): vw\vw\Setup->vwHandleException(Object(vw\vw\Setup\Exception), Object(vw\vw\Setup\Caller\Install), Array)
#3 src/addons/vw/vw/Setup.php(268): vw\vw\Setup->vwRunStep('install', Object(vw_Install_Full_Steps_Controller_XF2), Array, 10)
#4 src/XF/Job/AddOnInstallBatch.php(299): vw\vw\Setup->install(Array)
#5 src/XF/Job/AddOnInstallBatch.php(95): XF\Job\AddOnInstallBatch->stepAction(Object(XF\Timer))
#6 src/XF/Job/Manager.php(275): XF\Job\AddOnInstallBatch->run(8)
#7 src/XF/Job/Manager.php(205): XF\Job\Manager->runJobInternal(Array, 8)
#8 src/XF/Job/Manager.php(121): XF\Job\Manager->runJobEntry(Array, 8)
#9 src/XF/Admin/Controller/ToolsController.php(146): XF\Job\Manager->runByIds(Array, 8)
#10 src/XF/Mvc/Dispatcher.php(362): XF\Admin\Controller\ToolsController->actionRunJob(Object(XF\Mvc\ParameterBag))
#11 src/XF/Mvc/Dispatcher.php(264): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'RunJob', Object(XF\Mvc\RouteMatch), Object(SV\UserMentionsImprovements\XF\Admin\Controller\Tools), NULL)
#12 src/XF/Mvc/Dispatcher.php(121): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\UserMentionsImprovements\XF\Admin\Controller\Tools), NULL)
#13 src/XF/Mvc/Dispatcher.php(63): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#14 src/XF/App.php(2826): XF\Mvc\Dispatcher->run()
#15 src/XF.php(806): XF\App->run()
#16 admin.php(15): XF::runApp('XF\\Admin\\App')
#17 {main}
[HEADING=2]Request state[/HEADING]
array(4) {
  ["url"] => string(24) "/admin.php?tools/run-job"
  ["referrer"] => string(44) "https://domain.com/admin.php?tools/run-job"
  ["_GET"] => array(1) {
    ["tools/run-job"] => string(0) ""
  }
  ["_POST"] => array(3) {
    ["_xfRedirect"] => string(80) "https://domain.com/admin.php?add-ons/install-from-archive-complete&batch_id=38"
    ["_xfToken"] => string(8) "********"
    ["only_ids"] => string(6) "665757"
  }
}
 
It looks like installing the add-on directly from the archive using CLI is not working and we will need to do some investigation.

We typically do not recommend this type of installation process for VaultWiki anyway.
Please follow the recommended installation instructions: https://www.vaultwiki.org/pages/Help/VaultWiki-4-Manual/VW4:Running-the-VaultWiki-Install-Script
Here is what I started from first. I went to AdminCP to install the addon, but it failed to install. Then I decided to use the second CLI to install the add-on again, and still same failed
 
Batch install error: [*]src/addons/vw/vw/Setup.php:752
You received the error message above because VaultWiki is having trouble being installed using XenForo's batch installer. It looks like the batch installer has changed in more recent XenForo versions, and VaultWiki's installer needs to be updated for it to work again.

In the mean time, VaultWiki asks you questions during install, which need to be answered. Currently, XenForo's batch installer sees these questions as errors and prevents it from moving forward. Line 752 is the installer asking a question to the admin. Please use the recommended installation process in our manual which involves uploading the add-on manually and using the Install button once the add-on appears in your add-ons list. Then you will see the installer's question and be able to respond, rather than an error message.
 
You received the error message above because VaultWiki is having trouble being installed using XenForo's batch installer. It looks like the batch installer has changed in more recent XenForo versions, and VaultWiki's installer needs to be updated for it to work again.

In the mean time, VaultWiki asks you questions during install, which need to be answered. Currently, XenForo's batch installer sees these questions as errors and prevents it from moving forward. Line 752 is the installer asking a question to the admin. Please use the recommended installation process in our manual which involves uploading the add-on manually and using the Install button once the add-on appears in your add-ons list. Then you will see the installer's question and be able to respond, rather than an error message.
Your addon installation still has an issue on XF 2.3.6

I have fixed your addon of installation issue, so here

src\addons\vw\vw\Setup\ProcessHelper\ProcessHelperBase.php
Diff:
--- ProcessHelperBase.php (original)
+++ ProcessHelperBase.php (fixed)
@@ -30,6 +30,11 @@
 
                 if (\vw_Compat::is('2.3.0 Alpha 0'))
                 {
+                    // For XF 2.3+, convert command string to array format
+                    if (is_string($script)) {
+                        // Split the command string into an array
+                        // Handle quoted arguments properly
+                        $script = $this->parseCommandString($script);
+                    }
                     $newProcess = new Process($script, $cwd, $env, $input, $timeout);
                 }
                 else
@@ -50,4 +55,54 @@
 
         return $this->vwInput;
     }
+
+    /**
+     * Parse a command string into an array of arguments
+     * Handles quoted arguments properly
+     */
+    private function parseCommandString($command)
+    {
+        if (is_array($command)) {
+            return $command;
+        }
+
+        // Use shell argument parsing if available
+        if (function_exists('str_getcsv')) {
+            // Use str_getcsv to parse shell-like arguments
+            return str_getcsv($command, ' ', '"');
+        }
+
+        // Fallback: simple space split (may not handle quoted args perfectly)
+        $args = [];
+        $current = '';
+        $inQuotes = false;
+        $quoteChar = null;
+        $len = strlen($command);
+
+        for ($i = 0; $i < $len; $i++) {
+            $char = $command[$i];
+
+            if (!$inQuotes && ($char === '"' || $char === "'")) {
+                $inQuotes = true;
+                $quoteChar = $char;
+            } elseif ($inQuotes && $char === $quoteChar) {
+                $inQuotes = false;
+                $quoteChar = null;
+            } elseif (!$inQuotes && $char === ' ') {
+                if ($current !== '') {
+                    $args[] = $current;
+                    $current = '';
+                }
+            } else {
+                $current .= $char;
+            }
+        }
+
+        if ($current !== '') {
+            $args[] = $current;
+        }
+
+        return $args;
+    }
 }

src\addons\vw\vw\Setup\ProcessHelper\ProcessHelper23.php
Diff:
--- ProcessHelper23.php (original)
+++ ProcessHelper23.php (fixed)
@@ -13,5 +13,5 @@
 
 class ProcessHelper23 extends ProcessHelperBase
 {
-    public function mustRun(OutputInterface $output, $cmd, $error = null, callable $callback = null) : \Symfony\Component\Process\Process
+    public function mustRun(OutputInterface $output, $cmd, $error = null, callable $callback = null): \Symfony\Component\Process\Process
     {
         return $this->vwMustRun($output, $cmd, $error, $callback);
     }

ProcessHelperBase.php - Diff: Shows the fix changes made to fix the XF 2.3.6 compatibility issue
ProcessHelper23.php - Diff: Shows the minor formatting fix (space before colon in return type) ( : )

The error addon of install is completely gone and works perfectly without issue
 
1749828957006.webp

By the way, this is very important for a safe user to prevent issues in the future.

I’ve updated the Setup.php file in your addon to prevent issues caused by users who don’t read the FAQ manual without the knowledge that may cause the database to become corrupt if they proceed without a backup. Many users may have to report your addon that caused problems. You should prevent CLI installations for now until you identify and fix the underlying CLI issue, then you can safely re-enable CLI support, allowing even less experienced users to install the addon without causing problems.

Diff:
--- 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);
 
Last edited:
Back
Top Bottom