2013-10-15 11 views

回答

2

命令僅在其自身工作時查找文件更改。那麼你停止命令 - 沒有更多的自動再生資產。

在Linux其典型CTRL + C或CTRL + X

P.S.從DumpCommand

while (true) { 
    try { 
     foreach ($this->am->getNames() as $name) { 
      if ($this->checkAsset($name, $previously)) { 
       $this->dumpAsset($name, $output); 
      } 
     } 

     // reset the asset manager 
     $prop->setValue($this->am, array()); 
     $this->am->load(); 

     file_put_contents($cache, serialize($previously)); 
     $error = ''; 
    } catch (\Exception $e) { 
     if ($error != $msg = $e->getMessage()) { 
      $output->writeln('<error>[error]</error> '.$msg); 
      $error = $msg; 
     } 
    } 
    sleep($input->getOption('period')); 
} 
+0

我在Linux控制檯上也使用他的方式。 – pbenard

+0

@GottliebNotschnabel我添加了一些命令的代碼,我認爲它非常清晰 –

+0

這是你的事。我無法說服你,但想想代碼中無限循環的含義。 –

1

一些代碼,就像@forgottenbas指出的代碼在無限循環中運行,所以它不是真的一個後臺工作,而只是佔據你的shell,直到外力介入工人。

通常開發人員可以終止進程或佔用的shell會話。

在OSX CTRL + Ç發送SIGKILL,例如。

在Windows中它似乎在窗口炮彈不同的工作有點:http://en.wikipedia.org/wiki/Kill_(command)#Microsoft_Windows

這絕對OS,或者更準確地說,外殼依賴。

1

如果已經催生了一個Linux的後臺進程,例如:

$ php app/console assetic:dump --watch & 

你必須殺死即您使用的是* nix中像shell中運行