We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38925
    • 38 Posts
    Hi all !

    I tried this code in a plugin to check my snippet :

    switch($modx->event->name)
        {
          case 'OnBeforeSnipFormSave':
          $s = $modx->event->params;
          $o = $s['id'];
          $object = $modx->getObject('modSnippet',$o);
          $content = $object->get('snippet');
          $file = fopen('check.php','a+');
          fputs($file, $content);
          $exec = 'php -l check.php';
          $modx->event->output(shell_exec($exec));
              break;
        }


    With an ssh client I get this :
    No syntax errors detected in check.php

    But in the output window :
    X-Powered-By: PHP/4.4.9 Content-type: text/html
    Parse error: syntax error, unexpected T_DOUBLE_ARROW, expecting '(' in /homepages/23/d409970354/htdocs/modx/connectors/index.php on line 30

    I also tried to create check.php outside the modx directory but it always returns me this.

    Do anyone know why ?

    Thanks !