我必須缺少Capistrano的東西,因爲我剛剛開始編寫capfiles,而且我正在查看噸重複代碼。考慮這個 role :dev, "dev1", "dev2"
role :prod, "prod1", "prod2"
desc "Deploy the app in dev"
task :deploy_dev, :roles => :dev do
run "sudo instal
我正在使用Symfony2和Doctrine,我在我的控制器的幾乎所有方法中都有幾行重複。 在這裏,他們是: $this->expense = $this->expenseRepository->findByExpenseId($id);
if(!$this->expense){
echo 'There is no expense with such id...';