php/kohana - auto script execute every X time« Wróć do listy pytań

php/kohana - auto script execute every X time
Wysłane przez mrmucha
Zadane przez 27/08/2015 21:15
0

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
Wysłane przez mrmucha
Odpowiedziane 27/08/2015 21:18