We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9207 ☆ A M B ☆
    • 2,475 Posts
    Found this in 2.2.8-pl:

    $ php -l core/model/modx/processors/system/filesys/file/unzip.php
    PHP Fatal error:  Can't use method return value in write context in core/model/modx/processors/system/filesys/file/unzip.php on line 9
    Errors parsing core/model/modx/processors/system/filesys/file/unzip.php


    And here:

    $ php -l core/model/modx/processors/system/filesys/folder/create.php
    PHP Fatal error:  Can't use method return value in write context in core/model/modx/processors/system/filesys/folder/create.php on line 19
    Errors parsing core/model/modx/processors/system/filesys/folder/create.php


    Are those processors used anymore?

    Tested this on PHP 5.4.16 and 5.4.10.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      I'm using 5.4.10 and don't see these errors.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 9207 ☆ A M B ☆
        • 2,475 Posts
        Odd. I double-checked it with a fresh download. Tried this on 2 different servers even (one CentOS, one MAMP), same result. What would cause syntax errors in one environment and not another?
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          What exactly are you doing to get these errors?
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 3749
            • 24,544 Posts
            Those are the old non-class-based processors. They could very well be in use because there are no class-based processors in those directories (which runProcessor() would use instead if they were there).

            The fix for the first one would be (lines 9 and 10 of core/model/modx/processors/system/filesys/file/unzip.php):

            $nfp = $modx->getOption('new_folder_permissions');
            $amode = !empty($nfp) ? octdec($modx->getOption('new_folder_permissions')) : 0777;


            For the second one (lines 19 and 20 of core/model/modx/processors/system/filesys/folder/create.php):


            $nfp = $modx->getOption('new_folder_permissions');
            $amode = !empty($nfp) ? octdec($modx->getOption('new_folder_permissions')) : 0777;


            Good old PhpStorm flags both as errors.

            unzip.php also has some funkiness in its return statements and a deprecated function (dl()) that you may hear about depending on the error settings. dl() has been disabled in many SAPIs as of PHP 5.3, except in CLI and Embed.

            Could you do a bug report on these?
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 9207 ☆ A M B ☆
              • 2,475 Posts
              Yeah, did a bug report: http://tracker.modx.com/issues/10035

              To get these errors I just was doing a syntax check on all files and those popped up. "php -l" from the command line (as pictured above).