Notes on using Sphinx with Puma
Tuesday, October 24th, 2006Make sure that the directory that houses your index files (/path/to/sphinx/var/data) is writable by the user that PHP runs as. The index files themselves must be, also.
Make sure that the directory that houses your index files (/path/to/sphinx/var/data) is writable by the user that PHP runs as. The index files themselves must be, also.
Having an understanding of the Puma domain models will make it much easier to write your own plugins. Not that Puma is a particurly difficult to understand application, or that CMSs in general have obscure domain models, but just that every one is so different you’re not likely to want to waste your time translating SQL into understanding.
In case you’ve forgotten your UML, here’s a brief reminder of UML syntax:
That’s the brief rundown. You don’t need to be a UML expert to see what’s going on up there.
A Puma website is a single tree of Page objects and a set of Users. The pages are versioned; each page has at least one Version object associated with it that contains the contents of the page for a particular version of the page. Each User has a permission level which is compared with a given page’s permissions to determine whether that user can edit or view the page. There’s a special user that corresponds to an anonymous user of the website; it’s named Anonymous appropriately enough.
Most pages in a Puma website are HtmlPages, whose versions contain raw HTML. Other subtypes of Page are useful for other purposes—HiddenPages, for example, shouldn’t be listed on any public-facing portion of the website, so you can hide administrative pages like Copyright beneath a HiddenPage.
This article provides a gross overview of the Puma request handling timeline, which is useful if you’re poking around in the Puma internals trying to debug or add something.
PATH_INFO with the dispatcher’s table of registered controllers and their handlers. Puma’s dispatch table is created automatically by the dispatcher when it autoloads the controller classes in the controller/ directory. If you create a new controller and place it in the controller/ directory, the dispatcher will find it and register its handlers without any special action on your part. See the articles on the dispatcher for more information.PATH_INFO. The dispatcher determines which handler to run. The handler performs whatever action is necessary. The dispatcher stashes any information which may be useful in rendering the resulting View in the global Smarty object. If the browser needs to be redirected (for example, after a login step, or after submitting a page edit), the handler accomplishes this by calling the redirect method of the dispatcher object. Unless the handler redirects or aborts abnormally, control eventually returns from the dispatch process. Puma determines which template to render by looking in the Smarty variable stash for a variable called “template” which should have been set by the handler. Typically, if the request was for /page/view/231, the handler PageController:view() will set this variable to “page.view”. Puma looks for a GET variable called “format,” which it appends to the template name if it’s found—for example, /page/view/231?format=xml results in a final template name of “page.view.xml” while /page/view/231 results in a final template name of “page.view.html”. Otherwise, Puma assumes the format is HTML. Puma hands off to Smarty to render the template.That’s it! Once Smarty renders the output, the rest is history.
PumaCMS is a wikilike content management system developed over the course of several years for Creole West Productions. Why didn’t we just use something else? Basically, everything I ran across when evaluating other CMSs was way too bloated, and everything I ran across when evaluating other wikis just didn’t fit the bill. We just wanted a CMS that worked and was exceedingly easy to customize. Since the CMS would form the foundation of several of Creole West Productions’ core websites and products, it was reasonable to build a new CMS from scratch.
Recently, Creole West Productions has decided to release Puma to the rest of the world. We thought it was useful, and maybe someone else out there will too. Having spent most of its life as internal software, there’s not much documentation on how to use it and how to make it work for you. This blog aims to fix that situation with a series of articles about how to customize Puma for your own nefarious purposes, as well as the nitty-gritty details of administering a Puma website, and documenting some of the more important internal features of Puma along the way.
This blog is also a commentary on the nature of Puma and the design patterns that make it tick. It’s an case study in rapid development touching on REST, MVC, object mappers, artificial intelligence (yes, there’s some of that in Puma), and a million other little gems of interest to developers.
I hope you enjoy the content!
Bad Behavior has blocked 22 access attempts in the last 7 days.