Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I put up a customised solution to this issue.</p> <p>After a whole morning of pain and a desperate trying to find a good solution, below the answer to your question.</p> <p>1) Create a file <em>.bat</em> into the web dir like here:</p> <p><code>your_symfony_dir/www/web/console.bat</code></p> <p>This is the file <em>console.bat</em> content:</p> <pre><code>set cmd=%~1 cd .. php app/console %cmd% </code></pre> <p>2) Create a file <em>.php</em> into the web dir like here:</p> <p><code>your_symfony_dir/www/web/console.php</code></p> <p>This is the file <em>console.php</em> content:</p> <pre><code>&lt;?php if (!preg_match('/^192\.168\.(1)\.[0-9]+$/', $_SERVER['REMOTE_ADDR'])) { die("Access Denied!"); } ?&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="UTF-8"&gt; &lt;title&gt;Console&lt;/title&gt; &lt;/head&gt; &lt;body style='font-family: monospace;'&gt; &lt;h1&gt;Console&lt;/h1&gt; &lt;form method='POST'&gt; &lt;fieldset&gt; &lt;legend&gt;Comandi base&lt;/legend&gt; &lt;p&gt;&lt;button name='pre_cmd[]' value='cache:clear'&gt;Clear Cache&lt;/button&gt;&lt;/p&gt; &lt;p&gt;&lt;button name='pre_cmd[]' value='assets:install'&gt;Install Assets&lt;/button&gt;&lt;/p&gt; &lt;/fieldset&gt; &lt;fieldset&gt; &lt;legend&gt;Comando personalizzato&lt;/legend&gt; &lt;p&gt;php app/console &lt;input type='text' name='cmd' value='' /&gt;&lt;input type='submit' value='Esegui' name='submit' /&gt; &lt;input type='reset' value='Annulla' /&gt;&lt;/p&gt; &lt;/fieldset&gt; &lt;/form&gt; &lt;?php if ($_POST) { $cmd = $_POST['cmd'] ? $_POST['cmd'] : (is_array($_POST['pre_cmd']) ? $_POST['pre_cmd'][0] : false); if ($cmd) { echo "&lt;div style='color:white;background:black;padding:10px'&gt;"; echo "&lt;pre&gt;"; $output = array(); exec($_SERVER['DOCUMENT_ROOT'] . '\console.bat "' . $cmd . '"', $output); foreach ($output as $o) { echo htmlspecialchars($o); echo PHP_EOL; } echo "&lt;/pre&gt;"; echo "&lt;/div&gt;"; } else { echo "&lt;p&gt;Comando vuoto&lt;/p&gt;"; } } ?&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Where summary, i get the post values (the command-line input e.g. "cache:clear") and i execut it into the <em>.bat</em> file through the command:</p> <pre><code>exec($_SERVER['DOCUMENT_ROOT'] . '\console.bat "' . $cmd . '"', $output); </code></pre> <p>3) When you'll execute the url <em>www.tuodominio.it/console.php</em> you'll see the form where you can input your command (like cache:clear). For my comfort, into the bat file i have already set up the "app/console" part, so i have to digit just "cache:clear" or "assets:install", etc</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload