z_file_mtime (zotonic_core v1.0.0-rc.11)

Keep a registration of file modification times, especially for z_template

Link to this section Summary

Functions

Convert process state when code is changed
Return the (universal) modification time of file, 0 on enoent
Invalidate all templates of a whole site
Initiates the server.
Insert a template and its dependencies
Check if a template is marked as modified
Mark a file as modified
Return the modification time of a file
Starts the server. IsScannerEnabled is set if inotify, fswatch or the periodic directory scanner is enabled. If not then the cached mtimes are periodically flushed.

Link to this section Functions

Link to this function

code_change(OldVsn, State, Extra)

Convert process state when code is changed
Link to this function

file_mtime(File)

-spec file_mtime(file:filename_all()) -> calendar:datetime() | 0.
Return the (universal) modification time of file, 0 on enoent
Link to this function

flush_site(Site)

Invalidate all templates of a whole site
Link to this function

handle_call(Message, From, State)

Link to this function

handle_cast(Message, State)

Link to this function

handle_info(Info, State)

-spec init(list()) -> {ok, #state{}}.
Initiates the server.
Link to this function

insert_template(Module, CompileTime)

Insert a template and its dependencies
Link to this function

is_template_modified(Module, Site)

Check if a template is marked as modified
-spec modified(string() | binary()) -> ok.
Mark a file as modified
-spec mtime(file:filename_all()) -> {ok, calendar:datetime()} | {error, notfound}.
Return the modification time of a file
-spec start_link() -> {ok, pid()} | {error, term()}.
Link to this function

start_link(IsScannerEnabled)

-spec start_link(boolean()) -> {ok, pid()} | {error, term()}.
Starts the server. IsScannerEnabled is set if inotify, fswatch or the periodic directory scanner is enabled. If not then the cached mtimes are periodically flushed.
Link to this function

terminate(Reason, State)