C:\MyProject\link>php symfony link:access user01 111.111.111.111

#accessTask.class.php
<?php

class accessTask extends sfBaseTask
{
 public function configure()
 {
  $this->namespace = 'link';
  $this->name   = 'access';
  $this->addArgument('username', sfCommandArgument::OPTIONAL);
  $this->addArgument('ip', sfCommandArgument::OPTIONAL);
 }

 public function execute($arguments = array(), $options = array())
 {

  $access = new Accesslog();
  $access->setUsername($arguments['username']);
  $access->setIp($arguments['ip']);
  $access->save();
  $this->log('access from '. $arguments['ip']);
 }
}