How does PB use the file system?

We have had on-going issues with our hosting keeping the app servers in sync with the shared file system. Usually, things fall over and go out of sync during a “snapshot” of a book (which is essentially a clone) and sometimes during import/export of books in various formats.

I’m curious if these processes write to the file system. And if it does, are the files temporary and deleted later? Are there ways of outsourcing those processes or not writing to the file system? I’m digging into the code and it isn’t completely clear, and figured I’d ask the community and developers who may be closer to the code and during what processes PB writes to the file system.

All help and insight welcome. Thank you!

Bryan

Is this external to Pressbooks? You need to bust the cache:

There are other smaller caches, like user options, but that’s the main one and it handles most everything. Look for wp_cache_delete for the other places things are cached.

In terms of actual file I/O everything we do (is supposed to go through):

\Pressbooks\Utility\put_contents
\Pressbooks\Utility\get_contents

Look for those in pressbooks/inc/utility/namespace.php External dependencies will do their own I/O their own way… (Example: Prince, SAXON-HE, …) and I can’t speak for those.

Hope this helps.

1 Like

Yeah, snapshots is a whole separate plugin. Hoping we can just replace it with PB Clone soon so it’s one less thing to think about/work around. I’ll do some digging. Thank you!