• I’m trying to use the wpmvc utility that came with the WP-MVC plugin. The example works fine, but I can’t seem to get my own implementation going.
    I try ./wpmvc generate plugin mynewplugin

    and I get “Please provide the name of the shell as the first argument.” on line 18 (from mvc_shell_dispatcher.php) and it fails. I’ve tried running the exact commands outside the utility and it still fails.

    What am I doing wrong?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hm, you might check to see if register_argc_argv is disabled, which would prevent arguments from being passed when calling a PHP script. Try running the following command:

    php -i | grep register_argc_argv

    If the output says that register_argc_argv is Off, that’s probably the issue, and you’ll want to set that to be On in your php.ini (you can find the location of this with php -i | grep "php.ini"), if you have privileges to modify that. Let me know what you find, and I’ll see if there’s a way around this without having to have register_argc_argv on.

    Thread Starter HapiDjus

    (@hapidjus)

    My php.ini say it’s on.
    “register_argc_argv => On => On” (btw, my host is HostGator)

    Any other ideas?

    Same here. register_argc_argv is On. ./wpmvc generate doesn’t generate anything.

    In my case, the hard-coded path in core/wpmvc.php is wrong. The code assumes the plugin is installed in a standard WP environment. I’m using something a bit different, i.e.

    webroot/
      assets/
        plugins/
        themes/
        uploads/
      wordpress/ (core)
        wp-content -> ../assets (via WP_CONTENT_DIR, not a symlink)

    Once I hard-coded the correct path in core/wpmvc.php, the code generation utility worked.

    Would be nice if the plugin could either 1) load wp-config.php to get WP_CONTENT_DIR and use that or 2) allow me to configure the path for the $wp_root var used in this file.

    HapiDjus, apologies for the huge delay; I had been a bit swamped. If you’re still looking to get this working, could you try adding print_r($argv); at the top of wp-mvc/core/wpmvc.php, run ./wpmvc generate plugin mynewplugin, and let me know what the output is?

    jevets, thanks for catching this. AFAICT, there isn’t a way for wpmvc to determine where wp-config.php is if it’s in a non-standard location, so I’ve added a way to set a custom path to the WordPress directory in an environment variable. See “Setting a custom path to the WordPress directory” here:
    https://wpmvc.org/documentation/90/using-the-code-generation-utility/

    For example, you would run something like this before running any wpmvc commands:

    export WPMVC_WORDPRESS_PATH="/my/path/to/webroot/wordpress/"

    That should work, but let me know if not.

    I need some help.
    I’ve downloaded and installed WP MVC and the example works fine for me as well. I wanted to start creating my own plugin with the wpmvc and it drops an error. I’m running WP on a WAMP environment and tried many things for example checking and setting (C:\wamp\bin\php\php5.3.8\php.exe – system variable) path to make it work, but I’ve stocked.
    In the console I gave the following: wpmvc.bat generate plugin MyPlugin and it says the “php is not recognized as an internal or external command, operable program or batch file”.
    I’ve also tried CygWin to run the commands, but got an error ./wpmvc: line 7: php:
    Do you have any idea what’s wrong?
    Thanks in advance

    I first got this issue as well when I execute:
    ./wpmvc generate plugin MyPlugin

    It was silently finish without any error, nor creating the folder structure.

    Finally I found out following issue:
    – I have run that on WordPress Multisite, WP-MVC is not supported for console running, so I switch to use normal WordPress
    – I have setup two environment variables before running:
    . export WPMVC_WORDPRESS_PATH=”My wordpress path”
    . export WPMVC_PHP=”/install/wamp/bin/php/php5.2.5/php.exe”

    Then it solved when executed, I got successful as:
    ←[35;1m←[4mWelcome to WP MVC Console!←[0m←[0m
    ←[1m[Running Generate::plugin]←[0m
    ←[1m[Complete]←[0m

    Note: I run on Windows XP by using Cygwin (even with DOS) should work the same way.

    Is there anyway to get it working on WP Multisite? I’m having the same issue. I’m using the direct path to the WordPress install.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘WP MVC code generation failing. Shell arguement?’ is closed to new replies.