modmore / Gitify

Command line toolkit to make managing a MODX site in git a lot easier.
MIT License
122 stars 55 forks source link

Make Gitify windows compatible #106

Open vguna opened 9 years ago

vguna commented 9 years ago

Hi.

Although it is mentioned in the Wiki, Gitify isn't completely runnable under Windows.

E.g. Gitify modx:install needs at least:

It should be easy to replace these linux native calls with an appropriate php function, I guess :)?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/21583902-make-gitify-windows-compatible?utm_campaign=plugin&utm_content=tracker%2F2783338&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F2783338&utm_medium=issues&utm_source=github).
Mark-H commented 9 years ago

My experience developing on windows is fairly limited and definitely outdated as I've been using Macs for the past 4 years or so, but those are pretty standard commands for a terminal/command prompt? Which one(s) is(are) not installed for you, causing what errors?

vguna commented 9 years ago

All of them :). Windows does not provide any of those commands. A shame, I know :). They are all used within the modx install command failing with system error "command not found". But I think each of these commands could be replaced by a simple php call, couldn't it? This way it would be portable across all php supported platforms.

Mark-H commented 9 years ago

Are you using cmd.exe or a slightly more decent command prompt like Git Bash (msysgit)?

Some of those things can definitely be handled with some more code with php, but I'm kinda failing to see how any terminal that doesn't have even something basic like ls has a place in the development world :P

vguna commented 9 years ago

cmd.exe - "dir" would be the synonym for "ls" on linux - but parameters are different of course :).

Beagon commented 9 years ago

I agree with @Mark-H CMD doesn't belong in Gitify. You can get gitify to work by installing git bash (Which should be included in your git installation) and using that instead of cmd. It's a small terminal emulator that has all the necessary functions.

vguna commented 9 years ago

Don't get me wrong - it isn't about how to get Gitify working under Windows :). That works as you describe. It's more about portability and whether one should use native OS calls although that could be done with PHP itself. It would simply reduce/remove the dependencies on the OS system.

Also in my case, I don't use git at all. I use subversion and Gitify works with that too. In that case the git binaries aren't installed. Although GITify sounds like git is mandatory, it isn't - until now ;). And the gitify documentation is using the term SCM instead of git, and that is the right approach :).

Maybe If find time to contribute a PR that removes the OS dependencies.

Mark-H commented 9 years ago

Gotcha. For certain things calling the shell commands seemed like a better approach at the time, but definitely open to making things more portable.

One thing I'd probably try to avoid replacing is the curl command - it has a nice progress indicator that I don't think will be easily replaceable with pure PHP code.

siteleas commented 8 years ago

Here are the Windows dependencies in order to get the script to execute properly. They must be installed and their bin folders have to be added to the Windows PATH environment variable in the Advanced System Settings screen:

Once those are completed, the rest of the instructions do work.

I did run into a snag with the Gitify init feature though. MODx seems to install and setup correctly but then some of the MySQL tables are missing (such as modx_session, modx_content_type, modx_access_policies, modx_access_policies)

Here is the error.log file:

[2016-01-14 07:46:42] (ERROR @ /index.php) Error 42S02 executing statement: 
Array
(
    [0] => 42S02
    [1] => 1146
    [2] => Table 'businessclubs_ca.modx_session' doesn't exist
)

[2016-01-14 07:46:42] (ERROR @ /index.php) Error 42S02 executing statement: 
Array
(
    [0] => 42S02
    [1] => 1146
    [2] => Table 'businessclubs_ca.modx_access_policies' doesn't exist
)

[2016-01-14 07:46:42] (ERROR @ /index.php) Error 42S02 executing statement: 
Array
(
    [0] => 42S02
    [1] => 1146
    [2] => Table 'businessclubs_ca.modx_content_type' doesn't exist
)

[2016-01-14 07:46:42] (FATAL) The requested resource has no valid content type specified.
[2016-01-14 07:46:42] (ERROR @ /index.php) Error 42S02 executing statement: 
Array
(
    [0] => 42S02
    [1] => 1146
    [2] => Table 'businessclubs_ca.modx_session' doesn't exist
)

[2016-01-14 07:46:42] (ERROR @ /index.php) Error 42S02 executing statement:
INSERT INTO `modx_session` (`id`, `access`, `data`) VALUES ('1u9q6ej65bat0bkff8ni3nnl42', 1452757602, '')
Array
(
    [0] => 42S02
    [1] => 1146
    [2] => Table 'businessclubs_ca.modx_session' doesn't exist
)