Username
Forgot password?
Welcome to our site!
Or Join with FTTF

Latest update

2

767 views
Just pushed latest update to github

Bug fix:
When country was not found based on IP address during "Login with Facebook, Twitter, FriendConnect" the
registration would fail because GeoIP object would not be created.
It is not created with all values (country, state, city etc. ) set to null
Bug Fix: Count of words was not performed correctly
during posting of question and answer in certain situations.
Bug Fix: Registration was not working correctly. It works now.
Bug fix in Add Youtube video button - it now works with old and new Youtube "Share" urls
also works consistently with all browsers and works correctly when more than one video
is added in a single post.

Added extra file that stored names and descriptions of Mongo Collections
That file is not a class but just a file that defines each Collection as
a constant. File is in /lib/Lampcms/Mongo/Collections.php
What this does is it adds a degree of protection against accidentally
typing in the misspelled Mongo Collection name while writing the code.
Since Mongo does not require Collection to exist and will create one automatically
when collection does not exist, misspelled collection names nevere cause proglems -
the new collection is just created. This behaviour while very convenient, could be
a source of frustration when you misspell collection name, for example, if you write
USER instead of USERS - mongo will happily use USER table instead of what you expect - USERS
Having the Mongo class use these constants to resolve names to actual collections adds this
extra checking that would not allow you to use Collection that has not been defined.
Another benefit of having this file is I can include descriptions in the comments block
for each collection to describe the collection, what is stored in it, how and when it's used
and stuff like that. Since MongoDB does not have shema definitions, this comments block
can serve a purpose of providing some inside info to other developers so they can get
better idea of database structure.


Now what about the situation when you, as a developer, write a custom module that requires
to use your own collection name?
I thought of this too. There is another file in the root dir callse Mycollections.php.dist
You would have to rename it to Mycollections.php and then you can add your own collection names
there in the form of const NAME = "COLLECTION_NAME";


This way when you upgrade to latest version your own custom collections file is not overritten.
You don't have to worry about modifying the Collections.php file - it's part of the program
and I take care of this file when it needs to be edited.


One more thing about Mongo config: I have now included the setting "prefix" in the !config.ini.dist
Normally this is just an empty string but it could be set to any string and will be used
as a prefix for all collection names. This is useful if you already have existing Mongo
Database and want to use it also for Lampcms project and it may already have collections
with the same name - for example - USERS collection.
In such case you just have to set value of prefix to something like "lampcms"
Then request for USERS collection will actually be using the lampcmsUSERS collection.
This is a pretty standard trick for many open source projects where you may be using
an existing database and need to avoid names collision.

 
asked May 31, 2011 at 7:59 AM

 US

0 Answers

Be the first to answer this question

Join with account you already have

FTTF

Preview

Alert