Forum

php/kohana - auto s...
 
Notifications
Clear all

php/kohana - auto script execute every X time

1 Posty
1 Users
0 Reactions
2,114 Widok
0
Topic starter

php/kohana - auto script execute every X time

1 Answer
0
Topic starter

1. enable minion module inside bootstrap.php ( http://muszak.eu/answers/phpkohana-please-enable-the-minion-module-for-cli-support/ )
2. follow instructions https://kohanaframework.org/3.3/guide/minion/tasks

Create demo.php file inside application/classes/Task/Demo.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 'bar',
        'bar' => NULL,
    );
 
    /**
     * This is a demo task
     *
     * @return null
     */
    protected function _execute(array $params)
    {
        var_dump($params);
        echo 'foobar';
        Request::factory('MyController/DoSomething')->execute();
 
    }
}
 'bar',
        'bar' => NULL,
    );
 
    /**
     * This is a demo task
     *
     * @return null
     */
    protected function _execute(array $params)
    {
        var_dump($params);
        echo 'foobar';
        Request::factory('MyController/DoSomething')->execute();

    }
}

3. (WIN) Open taskschd.msc and addo script:

1
php.exe index.php --task=Demo
php.exe index.php --task=Demo

Odpowiedź

Author Name

Author Email

Your question *

 
Preview 0 Revisions Saved
Share: