thisbythem / stag

The Statamic CLI
37 stars 4 forks source link

php errors on MAMP #12

Closed jeremydouglas closed 9 years ago

jeremydouglas commented 9 years ago

I'm trying out stag, using MAMP 3.

I have this config file:

servers:
  production: production
    host: {my site url is here}
    webroot: /home/{dir_name}/public
    user: forge
    port: 22
    forward_agent: false
    strategy: rsync
  pull_content:
    commit_message: "Content update from production"
    content_directories:
      - _content
      - assets
      - _forms

When I run any command, I receive php errors, but the command does eventually run. Is there any way to get this to run without showing the errors?

This is what outputs:

jeremy$ stag clear_cache

PHP Strict standards:  Static function Command::helpSummary() should not be abstract in /Users/jeremy/Sites/immerspa.com/_add-ons/stag/command.php on line 6
PHP Stack trace:
PHP   1. {main}() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/bin/stag:0
PHP   2. API_stag->run() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/bin/stag:52
PHP   3. Tasks_stag->run() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/api.stag.php:8
PHP   4. spl_autoload_call() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/api.stag.php:18
PHP   5. autoload_stag() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/api.stag.php:0

Strict standards: Static function Command::helpSummary() should not be abstract in /Users/jeremy/Sites/immerspa.com/_add-ons/stag/command.php on line 6

Call Stack:
    0.0002     235712   1. {main}() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/bin/stag:0
    0.0196    2083056   2. API_stag->run() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/bin/stag:52
    0.0196    2083168   3. Tasks_stag->run() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/api.stag.php:8
    0.0203    2156592   4. spl_autoload_call() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/api.stag.php:18
    0.0205    2156656   5. autoload_stag() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/api.stag.php:0

PHP Strict standards:  Static function Command::helpDetail() should not be abstract in /Users/jeremy/Sites/immerspa.com/_add-ons/stag/command.php on line 7
PHP Stack trace:
PHP   1. {main}() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/bin/stag:0
PHP   2. API_stag->run() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/bin/stag:52
PHP   3. Tasks_stag->run() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/api.stag.php:8
PHP   4. spl_autoload_call() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/api.stag.php:18
PHP   5. autoload_stag() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/api.stag.php:0

Strict standards: Static function Command::helpDetail() should not be abstract in /Users/jeremy/Sites/immerspa.com/_add-ons/stag/command.php on line 7

Call Stack:
    0.0002     235712   1. {main}() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/bin/stag:0
    0.0196    2083056   2. API_stag->run() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/bin/stag:52
    0.0196    2083168   3. Tasks_stag->run() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/api.stag.php:8
    0.0203    2156592   4. spl_autoload_call() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/api.stag.php:18
    0.0205    2156656   5. autoload_stag() /Users/jeremy/Sites/immerspa.com/_add-ons/stag/api.stag.php:0

_cache/_app has been cleared.

_cache/_add-ons has been cleared.
nobodyiscertain commented 9 years ago

Hey @jeremydouglas

It sounds like you have a newer version of PHP on your command line. I'll need to address these issues for newer versions, but in the meantime, there's a couple of things you can do.

In your php.ini file, change the error reporting to not show strict warnings. Find the error_reporting directive and change it to be:

error_reporting = E_ALL & ~E_STRICT & ~E_NOTICE

This will change it for all PHP using that config file though. The other option would be to turn off error_reporting in stag. Go to /stag/autoload_stag.php and add this to the top of the file.

error_reporting(0);

That should do it.

On a side note, you'll need the pull_content block of your config nested under your server config. Like so:

servers:
  production: production
    host: {my site url is here}
    webroot: /home/{dir_name}/public
    user: forge
    port: 22
    forward_agent: false
    strategy: rsync

    pull_content:
      commit_message: "Content update from production"
      content_directories:
        - _content
        - assets
        - _forms

Hope that helps!

jeremydouglas commented 9 years ago

Thanks it does!