kohana / minion

Everyone loves having a minion they can boss around
113 stars 76 forks source link

Windows users have problems with kohana minion #48

Closed alexeyco closed 13 years ago

alexeyco commented 13 years ago

Hi!

First, it is not clear why there is no bat-script for Windows users? Ok... Take it:

@echo off

@setlocal
set TASK=""
if not "%*"=="" set TASK=--task=%*
set KOHANA_PATH=%~dp0
"php" "%KOHANA_PATH%index.php" --uri=minion %TASK%
@endlocal

I have no problems with this bat file, but I think - it need more tests. Ok...

But I have more problems... see Minion_Util class. Somethink about 70 line:

$file = substr($file, strrpos($file, '/') + 1);

If you leave everything as is, in Windows is nonsense. Like this:

> minion

Minion is a cli tool for performing tasks

Usage 

    php index.php --uri=minion/{task}

Where {task} is one of the following:

  * task\addadmin
  * task\cache:task\cache\purge
  * task\install
  * task\media:task\media\purge
  * task\migrations:task\migrations\new
  * task\migrations:task\migrations\run
  * task\migrations:task\migrations\status
  * task\uninstall

For more information on what a task does and usage details execute 

    php index.php --uri=minion/help/{task}

Need to change this line to:

$file = substr($file, strrpos($file, DIRECTORY_SEPARATOR) + 1);

Best regards

PS If you used HMVС - make changes would be much easier! Why you don't use HMVC?

alexeyco commented 13 years ago

I added a pull request

zeelot commented 13 years ago

What do you mean by use HMVC?

zeelot commented 13 years ago

The pull request has been merged, thanks.