Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it work in CLI #1

Open
2called-chaos opened this issue Jun 10, 2013 · 0 comments
Open

Make it work in CLI #1

2called-chaos opened this issue Jun 10, 2013 · 0 comments

Comments

@2called-chaos
Copy link

I've made a dirty hack so that I can use your cool script on command line. That way I can generate the images for my non-PHP-site in the background.

Maybe it is useful for somebody...

Just insert the snippet so that your 3d.php begins like this:

<?php
  # Console hack to make it work on CLI
  foreach ($argv as $key => $value) {
    if($key > 0) {
      $c = explode("=", $value);
      $_GET[$c[0]] = $c[1];
    }
  }

  /*
  * Copyright (c) 2012, Pierre Gros

Then call it like this:

~$ php 3d.php a=-25 w=35 format=png  login=supermamie > supermamie.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant