Intense flares that occur at late times relative to the prompt phase have been observed by the Swift satellite in the X-ray afterglows of gamma-ray bursts (GRBs). Here, we present a detailed analysis on the fall back accretion process to explain the intense flare phase in the very early X-ray afterglow light curves. To reproduce the afterglow at late times, we resort to the external shock by engaging energy injections. By applying our model to GRBs 080810, 081028 and 091029, we show that their X-ray afterglow light curves can be reproduced well. We then apply our model to the ultralong Swift GRB 111209A, which is the longest burst ever observed. The very early X-ray afterglow of GRB 111209A showed many interesting features, such as a significant bump observed at around 2000 s after the Swift/BAT trigger. We assume two constant energy injection processes in our model. These can explain the observed plateau at X-ray wavelength in the relatively early stage (8.0 × 103 s) and a second X-ray plateau and optical rebrightening at about 105 s. Our analysis supports the scenario that a significant amount of material may fall back towards the central engine after the prompt phase, causing an enhanced and long-lived mass accretion rate powering a Poynting-flux-dominated outflow.