I want to run this command on cron but I don't want to run all the cron tasks.
I added this command to run only this task with drush.
It's only a wrapper to execute the session_expire_cron function.
Attached drush.inc file
Regards

CommentFileSizeAuthor
#2 patch.diff758 bytesyhurtado
session_expire.drush_.txt564 bytesyhurtado

Comments

yhurtado created an issue. See original summary.

yhurtado’s picture

StatusFileSize
new758 bytes

Attaching patch version

shrop’s picture

I tested this functionality and it does work. I really like the concept. Thanks for working on this!

  1. Coder does report a few items that should be fixed up. I have listed those below. I used this command to get the Coder report: phpcs --standard=Drupal,DrupalPractice --extensions='php,module,inc,install,test,profile,theme,js,css,info,txt' --ignore='*.features.*.inc'
  2. I would consider changing the Drush command description from "Drush command to call the session_expire_cron function from the session_expire module." to something more like this: "Execute the session_expire_cron function from the Session expire module.". Just a bit shorter.
  3. Your work gave me a thought on an additional Drush command. It would be really neat if we had a drush command that would expire sessions even if the cron schedule requirements were not satisfied. Might be handy to expire sessions at anytime, but this would take breaking up the session_expire_cron function up.

FILE: ...l7/web/sites/all/modules/session_expire/session_expire.drush.inc
----------------------------------------------------------------------
FOUND 12 ERRORS AFFECTING 12 LINES
----------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
6 | ERROR | [x] Missing function doc comment, only found file
| | comment
7 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
| | 4
8 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
| | 4
9 | ERROR | [x] Array indentation error, expected 6 spaces but
| | found 8
10 | ERROR | [x] Array indentation error, expected 6 spaces but
| | found 8
11 | ERROR | [x] Array indentation error, expected 6 spaces but
| | found 8
12 | ERROR | [x] Array indentation error, expected 6 spaces but
| | found 8
14 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
| | 4
18 | ERROR | [x] Doc comment short description must end with a full
| | stop
21 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
| | 4
22 | ERROR | [x] Expected 1 newline at end of file; 2 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 105ms; Memory: 6Mb

Chris Charlton’s picture

Status: Active » Needs review

This is fine for a v1.0. The code looks fine.