Mimesis - Our code monkeys are former test pilots.

Tutorials

March 26, 2011 by Grim Pirate

Added a Voting Poll script to the Tutorials page.

Tutorials

March 25, 2011 by Grim Pirate

Added an IP Logger script to the Tutorials page.

Site Fix

March 24, 2011 by Grim Pirate

Fixed a code error in the Source page that was causing repeated entries on download, everything should appear as expected now.

Secondly and IMPORTANT, redownload Mimesis v3.0 if you've downloaded it before today. The trigger_error functions present within it were all issuing E_USER_ERROR for debugging purposes, when in fact they should now all be E_USER_WARNINGS (this change has been made to the source).

Tutorials

March 20, 2011 by Grim Pirate

Uploaded the Latin Word (or Lipsum) Generator script to the Tutorials section.

Mimesis 3.0

March 19, 2011 by Grim Pirate

The long awaited v3.0 has been released. Whether or not it will stand the test of time is as yet to be determined, but here it is. Get your hands dirty and enjoy.

Under Construction

March 18, 2011 by Grim Pirate

Still working on 3.0 and updating the site to work with it. In the meantime two scripts have been posted on the Tutorial page, Geolocation and Hit Counter.

URL Change

March 03, 2011 by Grim Pirate

There was an error with the server that prevented any sort of file read/write operations and thus prevented updates to the site. The site is now available but I have decided to use an exterior domain name to prevent future mishaps. Please update your bookmarks accordingly. The new URL will be http://www.mimesis.cz.cc/

CRITICAL NOTICE

Oct 03, 2010 by Grim Pirate

As mentioned before it has now been confirmed that v2.15 is BROKEN. It WILL eventually produce errors in data insertion and retrieval. It's possible that you may by chance avoid them, but the probability is high that it will eventually alter the database in an irreparable way. Please discontinue further use of v2.15 and wait for v3.0. The error that was present in v2.15 has been addressed in v3.0 and will not be an issue.

v3.0 Testing

Oct 03, 2010 by Grim Pirate

The site is currently undergoing a v3.0 upgrade and testing process so you may see rampant errors every now and again. No need to be alarmed. Certain sections of the site are also not functioning as yet. These are the hit counter, geolocation, and shoutbox. I devoted my time first to getting the source page running so people could still download the old versions of Mimesis for curiosity's sake. You can also note that they numbers on the source page have changed and are incorrect, as the database I transformed into a key-value store was from an older date. It will take a moment before I transform the most recent. Thanks for your patience whilst I remodel.

NOTICE

Oct 02, 2010 by Grim Pirate

This update is to inform visitors and current users to the future of Mimesis. I've currently started work on Mimesis v3.0. It will be radically different. A lot of the methods used by the class will be different (some won't even be present) and binary structure of the files will also change. Mimesis is no longer to be considered a flat file database. Rather I am taking it in the direction of a key-value data store. Mimesis is an ongoing/evolving project that changes as much as any new idea that I happen to come up with. The frequency of that is random.

That said, while working on the new version I uncovered an overlooked algorithmic bug in the previous version; one that a Mimesis user has unknowingly confirmed. v2.15 and previous versions (don't recall down to which version) use packed 32-bit integers in order to locate certain things within the files. However, Mimesis also performs substitutions of certain special characters within the files. Unwittingly I failed to take into account that an 4 byte integer could turn into as large as an 8 byte segment of data when this substitution takes place. Which means that some portions of packed data in Mimesis could return errors because they are being retrieved erroneously. Mimesis v3.0 will not suffer that same problem as I've now come to understand and realize its occurrence.

I will no longer be updating v2.15 on the site so these errors will persist. However, I don't want to leave whatever few and possibly faithful Mimesis users there are up the creek without paddle. So for the Mimesis::entries method which I know can produce one of the errors I am supplying a workaround. Simply copy this portion of code over the existing method into the Mimesis source. It SHOULD work. Any future workarounds for bugs in v2.15 will also be listed here so be sure to keep a look out. Once I release v3.0 previous versions will be abandoned so please consider carefully what you're going to use Mimesis for.

The differences in the new version and previous versions file-wise are too different to manipulate with a patch, so it will be necessary to reinput the data from previous versions into the new version to recreate your tables.

function entries(){ // Code if(false === $tableStruct = file_cull_contents($this->struct, -30, 26, SEEK_END)) return !trigger_error('[' . basename(__FILE__) . '] < ' . __LINE__ . ' >', E_USER_WARNING); while(FALSE !== $temp = strpos($tableStruct, P_SSEP)){ $tableStruct = substr($tableStruct, $temp + 2); } $tableStruct = unpack('N*', desanitize($tableStruct)); return array( 'history' => $tableStruct[2] + $tableStruct[3], 'unique' => $tableStruct[2] ); }

Version 2.15

Sep 16, 2010 by Grim Pirate

Mimesis aficionado ilmich has pointed out another Mimesis incongruency. The Mutex class makes use of the sleep function. However, this function's elapsed time is not counted towards the execution time of a script on *nix systems. Therefore, on *nix systems Mimesis scripts will hang virutally indefinitely if they encounter a defunct lock.

This update solves that problem by using the 'max_execution_time' setting from the php_ini file. It adds one second to that time and basically attempts to obtain a lock every subsequent second the script is running until the maximum time. If no lock can be obtained after that amount of time, the Mutex class will return a boolean false and the Mimesis class will issue a fatal error.

Some internal polishing has also been done to the Mimesis class and Polarizer class. All changes to this version are seamless so no changes to your code are necessary and the documentation for v2.14 is applicable to this version as well. Tutorials are also unaffected by this change.

Version 2.14

Sep 14, 2010 by Grim Pirate

A user by the name of cheako pointed out this article. Accordingly, I have modified the behavior of the Mutex class. Instead of creating a file for the locking mechanism Mimesis will now use directory creation as the mutex. This should work consistently across all file systems. Locking and unlocking still take place just as before. The only difference is that there is no longer a $timeout parameter present, and the lockTime method has been removed from the Mutex class. Some other minor but seamless changes occurred to a few of the classes.

Tutorials will be updated shortly to allow for this code change.

Version 2.13

Sep 7, 2010 by Grim Pirate

Bug fix to the refresh method of the Mimesis class. This is a CRITICAL bug fix as the error caused could affect an important offset parameter within the database. Please upgrade as soon as possible and ensure your database works appropriately. Make backups before testing.

Also a parameter checking piece of code was added to the Mimesis class in order to prevent another sort of error from occurring (this one would be due to erroneous data being input rather than a malfunction of the Mimesis code).

Finally, did away with the η designation. The η was originally added because I was working under the assumption that this new version of Mimesis would never work because it was so radically different from the previous one. It does and I am satisfied in its stability so I have removed the η for good.

Version 2.12η

Aug 19, 2010 by Grim Pirate

While reviewing and updating/optimizing the code for 2.11η a bug in the regular expression search of the getRow method was found and has been fixed. Some other seamless code changes were made as well for optimization purposes.

Tutorials and documentation from 2.1η are still applicable.

Version 2.11η

Aug 17, 2010 by Grim Pirate

A seamless change has occurred to the Mimesis class which does not affect file structure. It provides an optimization to increase the speed and efficiency of the getRow, insertRow, and deleteRow methods.

All tutorials and documentation from v2.1η are applicable without a need for update.

Special recognition and thanks go out to a site visitor under the moniker ilmich who brought this code and optimization to my attention.

Version 2.1η

Mar 23, 2010 by Grim Pirate

Changed the Mutex and Mimesis lock and acquireLock methods, respectively, to allow the timeout value to be set without needing to alter the Mutex source file. All code functions as before as this is a seamless change. No changes to database structure either.

All tutorials and documentation have been updated to reflect these changes.

Version 2.0η

Jan 21, 2010 by Grim Pirate

Lots and lots of changes to the new version. Most importantly, a file/database change. Namely, the data that the structural files store has been modified so be sure to check the patch on the Source page.

The methods tableExists, structExists, deleteTable, and renameRow have all been removed. Any old code that utilized these methods will need to be revised before updating.

All other changes to the code are internal and will function just as before.

Version 1.06η

Jan 5, 2010 by Grim Pirate

Happy New Year, and along with it a new release.

The current change is seamless. Therefore, no changes will be incurred to your database. However, there are some important differences to take note of. Firstly, the singularID function and thusly the related source file are no longer included with the Mimesis package.

Despite the seamless change the version number was incremented to .06 because the Mutex class has been altered to a significant degree, which caused a cascade effect in the Mimesis source. Namely, the Mutex class no longer attempts to delete a lock if there is an abnormal exit condition. Rather, the lock is allowed to persist and will now be up to the programmer to decide how to deal with. Furthermore, locks are no longer assigned an ID within them (this is why singularID is now excluded).

Does this open up a can of worms? Possibly. The fact of the matter is your PHP server could crash at any moment so some unfortunate conditions could happen that mess with the atomicity of your locks. These conditions have always and will always be present. A server crash at a critical moment is much like your PS3 turning off at a moment when its saving data (you don't want it to happen, but it can and you may suffer data loss or corruption). Writing or not writing an ID to a file, viewed from the perspective of a server crash, is futile. If the timeout is corrupt or write processes didn't finish another process would still have to override it. In other words, there is no need for a lock to check its own ID or that of another process, as when the Mimesis class creates a Mutex object its self aware of that.

The documentation and tutorials will be modified to reflect the current version change, but as it stands they SHOULD work just the same. Otherwise the change wouldn't be seamless now would it?

Version 1.052η

August 12, 2009 by Grim Pirate

This newest update changes how the singularID function generates the ids. Three souce files have been altered as a result:

The change is transparent and incurs no change to either the database or any updated code you might have currently running. Furthermore, the _cache directory is no longer necessary for Mimesis to operate.

Version 1.051η

August 3, 2009 by Grim Pirate

A minor bug has been fixed that affected the Mimesis class. This bug would cause errors in certain methods when row labels whose types are integer were modified/deleted. Integer keys are allowed in insertion/retrieval operations and therefore need to be allowed for modification/deletion.

Thanks go out to D. Ryabkov for pointing this bug out. I appreciate the help.

The documentation will reflect this minor change eventually. However, for now the 1.05η documentation is still very much applicable. There is no change whatsoever to the tutorials.

Version 1.05η

July 26, 2009 by Grim Pirate

The experimental trials are over. The new version appears stable and the majority of bugs have been fixed. Remember that this new version has incurred a database change. A patch has been provided to update from the versions prior up to this new version. Of important note is that before overwriting the old version of Mimesis with the new source files you should perform a refresh of all your tables with whichever version you were using prior to 1.05η. Only then should you apply the patch.

Of further notice, some of the older source files will no longer be necessary at all. Specifically the files str_offsets.php and str_r_pos.php. The code was revamped to make them obsolete thus shrinking the Mimesis source code even further.

Specifically, v1.05n improves the stability of how operations for insertion and deletion are performed to the tables. It also improves the speed at which they are performed. Also, there were some bugs present in the entries() method that have also been addressed.

Remember to update or start over, because with the new database changes errors will occur if you attempt to keep using an older version. This is not a superfluous change, but an important critical alteration to the code and inner workings of Mimesis. Remember to back up your tables and keep a copy of the version of Mimesis you were using prior to 1.05η and only then proceed with the update.

Enjoy the new changes and as always contact the Grim Pirate should you encounter any bugs or issues.

Testing Version 1.05η

July 10, 2009 by Grim Pirate

Experimentally testing the newest version of Mimesis. It just so happened that upon creating the most recent version (1.04η) it came to my attention that some revisions were necessary to the code. In particular these revisions incur a database change. Specifically to the structural files used to control the database, no changes to the table files. I will be testing it here on the site to see if any errors are produced, and if not I will release to the public domain shortly.

Version 1.04η

July 08, 2009 by Grim Pirate

New version of Mimesis. An unused method has been removed from the Mutex class, and an update has been made to the singularID function.

This version incurs a directory location change for the _cache directory. Be sure to create the _cache directory within the mimesis directory for this version to operate properly.

Changes will be made shortly to the available documentation.

Documentation

May 03, 2009 by Grim Pirate

The Quick Function Reference and Complete Function Reference documentation have been updated to reflect the changes in v1.03η.

Version 1.03η

May 03, 2009 by Grim Pirate

New version of Mimesis. This version does not incur any changes to the previous source code. The alteration is that of the Mutex class. An extra method named lockOverride has been incorporated and a parameter has been added to the acquireLock method. This has been added in order to facilitate for the testing and removal of defunct locks that may not have been properly removed due to server problems. Tutorials on how to make use of it will be added in the future. This change also carries through to the Mimesis lock method.

Changes will be made shortly to the available documentation.

A change has also been made to the Mimesis copyright notice and disclaimer present within the source code.

Tutorials

April 27, 2009 by Grim Pirate

The Geolocation tutorial has been updated.

Tutorials

April 23, 2009 by Grim Pirate

Updates have been made to all tutorials except the Geolocation tutorial. All tutorials save that exception have been repaired/updated and fully tested to work without error. Again, file permissions on your server may cause errors, you need to ensure that your scripts are using the correct permissions when creating the Mimesis flat file databases. Mimesis is developed/tested on a Windows machine running XAMPP, so this is typically not an issue.

Tutorials and Documentation

April 22, 2009 by Grim Pirate

Updates have been made to the Ad Rotator and File Inclusion tutorial to make the compatible with v1.02η of Mimesis. The source code provided within these was broken but has now been tested, repaired and proven to work, sorry for the inconvenience. The Quick Function Reference and Complete Function Reference documentation for the newest version have also been updated.

Version 1.02η

April 22, 2009 by Grim Pirate

New version of Mimesis. However, this new version does not incur any database changes. Code written prior to this incarnation will require some modification as Mimesis no longer accepts file permission settings. These settings are too varied dependent upon server configurations. Therefore, it is left up to the user to determine how to chmod (if at all) the files created by the Mimesis database. Secondly, there was a minor alteration to the Polarizer class that does not at all modify the outputs, simply a seamless code change. Tutorials and documentation will be modified periodically to reflect these changes. Usability notes are still in development.

Tutorials

January 3, 2008 by Grim Pirate

Posted a new snippet for web publishers to generate random latin filler text for their sites. A lipsum generator.

Tutorials

November 27, 2008 by Grim Pirate

Posted two new pieces of code that utilize the Mimesis database. A Shout Box (the exact same one used here) and an IRC Chat Logger.

New URL

November 21, 2008 by Grim Pirate

Got ourselves a fancy new URL. So from now on the site will be found at http://mimesys.co.cc/

ShoutBox

September 3, 2008 by Grim Pirate

ShoutBox fixed and no longer utilizes JavaScript.

ShoutBox

August 23, 2008 by Grim Pirate

Added a ShoutBox to the Contact page (powered by a Mimesis of course). This gives visitor(s) to the site another alternative way of contacting me. Whilst I generally look down on the practice of using Javascript, the concept of a shoutbox wouldn't really function too well without client-side scripting in order to avoid full page reloads. This way the ShoutBox refreshes dynamically.

Tutorials

August 20, 2008 by Grim Pirate

A geolocation tutorial/snippet has been provided that functions in the exact same way as on the main page.

Version 1.01η

August 20, 2008 by Grim Pirate

New version of Mimesis. However, this new version does not incur any database changes nor does any code written with the previous version, 1.0η, require modification. This is a purely internal change to the package which affects only the file_cull_contents function and source file, and the Mimesis class and source file. Please upgrade accordingly.

Tutorials

August 4, 2008 by Grim Pirate

The voting poll and guest book tutorials have been updated to compatible code for v1.0η.

Tutorials

August 4, 2008 by Grim Pirate

The hit counter, file inclusion, and ad rotator tutorials have been updated to reflect the new version of Mimesis. The voting poll and guest book are still pending.

Version 1.0η

August 3, 2008 by Grim Pirate

A complete remake of the Mimesis script. This update incurs non-compatibility issues with previous versions. No patch will be given. The table creation and storage methodologies have been completely redesigned. Now only two files will be put into use rather than multiple files as before. This makes Mimesis much more user-friendly (in terms of fewer methods for the class) and exponentially faster than before.

If you wish to preserve your previous data I suggest serializing the table contents after performing a full table query. Then, unserialize and reinsert using the new Mimesis version.

Tutorials and Documentation will reflect the new version shortly.

The site itself is now running on v1.0η

Version 1.3e

July 24, 2008 by Grim Pirate

Updated Mimesis once more. This code modification incurred a change to the database. Therefore, v1.3e is incompatible with the database created by v1.2e. However, in the Source page I've provided a patch file that will modify v1.2e databases to work with v1.3e. Instructions on the patch's usage are located within the source code.

The Mimesis version upgrade does not trigger any changes in your source code. Therefore, there is no need to revise any code written with v1.2e.

Version 1.2e

July 22, 2008 by Grim Pirate

The file_retrieve_contents function has been removed altogether. Changes were made to the Mutex and Mimesis class as a result. Hence the version number update. This should improve the speed of Mimesis by using the familiar file_get_contents function from PHP. By upgrading to this Mimesis release you can do away with the file_retrieve_contents source file. Tutorials and documentation will reflect this change shortly.

Version 1.11e

July 22, 2008 by Grim Pirate

Made an update to the file_retrieve_contents function. Designed to improve file reading operations. This is a transparent change that does not affect the database.

New Tutorial

July 21, 2008 by Grim Pirate

A Voting Poll tutorial has been added to the Tutorials page.

Documentation

July 21, 2008 by Grim Pirate

Uploaded the complete Function Reference Documentation for Mimesis v1.1e on the Docs page.

Version 1.1e

July 19, 2008 by Grim Pirate

Unearthed some bugs in the Polarizer class and file_retrieve_contents function. Didn't bother changing the version number. Instead, I overwrote the previous package with a new zip package. Be sure to obtain a new copy if you've already downloaded v1.1e.

Version 1.1 Experimental

July 18, 2008 by Grim Pirate

v1.1e has been officially released. You can find it at the Source page. A discussion of its features will be posted shortly in the new Documentation page.

Site Undergoing Changes

July 18, 2008 by Grim Pirate

The site will be experiencing intermediary changes as it transitions over to the v1.1e release. The tutorials have been updated to reflect what will be the new Mimesis release. The previous tutorials, setup info, and phpdocs have been zipped and archived and are now available in the Documentation page.

Site Modification

July 17, 2008 by Grim Pirate

The Mimesis related features of the site were temporarily shut down in order to transition from Mimesis v2.0 to a new experimental Mimesis v1.0e. The features: random quote display, hit counter, and source distribution. The shutdown was necessary because a change in flat file storage method also occurred. The new experimental version of Mimesis is not backwards compatible with the stable version. However, the loss in backwards compatibility was a result of cleaner code, eliminated overhead, faster query times, and less complex error tracking. This new experimental version of Mimesis will be released shortly to the public. For now it will simply operate behind the scenes on the site to serve content as before.

Version 2.0

June 10, 2008 by Grim Pirate

Testing was performed to see if the speed of the queryTable method could be improved. However, no solution was found but a code bug was unearthed within the Mutex class. No version change for Mimesis necessary.

IRC Channel

June 8, 2008 by Grim Pirate

An IRC channel for Mimesis has been opened on freenode. More details at the Contact page.

Site Modification

June 5, 2008 by Grim Pirate

Added a new Listings link to the main menu. This page also includes info on how to link back to Mimesis.

New Tutorial

June 4, 2008 by Grim Pirate

The Hit Counter has been added to the Tutorials page.

Miscellaneous

June 3, 2008 by Grim Pirate

Pando will no longer be used to distribute the source code. Furthermore, a Mimesis database is actually functioning behind the scenes to distribute the source code, and to track the number of unique visits to the site.

Version 2.0

June 2, 2008 by Grim Pirate

Fixed some bugs that were present due to the name changes, added a missing piece of code to the Mimesis::deleteRow method, and added a parameter to the Mimesis::cols method.

Site redesign, still trying to determine where to place the Mimesis logo.

Version 1.9

May 29, 2008 by Grim Pirate

The changes to the new version of Mimesis are purely for aesthetic reasons. Rather than retaining the cryptic method names that were in use, more "standard" database method calls have been employed. You can see these changes in the phpDocs.

Version 1.8

May 29, 2008 by Grim Pirate

Mimesis 1.8 released. This version of Mimesis addressed the following concerns:

New Tutorial

May 19, 2008 by Grim Pirate

The Guest Book has been added to the Example page.

Version 1.7

May 17, 2008 by Grim Pirate

Mimesis 1.7 released. This version of Mimesis addressed the following concerns:

Version 1.6

May 15, 2008 by Grim Pirate

Mimesis 1.6 released. This version of Mimesis addressed the following concerns:

In order to provide the reordering of columnar headings within a table a separate function array_restructure has been provided. However, this function should only be used to operate on a Mimesis object. It is not an internal Mimesis method.

Version 1.5

May 15, 2008 by Grim Pirate

Mimesis 1.5 released. This version of Mimesis addressed the following concerns:

Capabilities still pending:

Tutorials have also been updated to reflect the new changes.

Version 1.4

May 13, 2008 by Grim Pirate

Mimesis 1.4 released. This version of Mimesis addressed the following concerns:

Capabilities still pending:

Version 1.3

Apr 1, 2008 by Grim Pirate

Mimesis 1.3 released. This version of Mimesis fixed the following errors:

The next version release of Mimesis should include the following:

New Tutorial

Mar 26, 2008 by Grim Pirate

The File Inclusion Tutorial has been added to the Example page.

Version 1.2

Feb 26, 2008 by Grim Pirate

Mimesis v1.2 released. Tutorial updated along with it. phpDocs updated as well.

Tutorial

Feb 15, 2008 by Grim Pirate

An ad rotator tutorial has now been made available to give an example of what Mimesis can do.

Version 1.1

Feb 15, 2008 by Grim Pirate

Mimesis v1.1 released.

Documentation

Feb 14, 2008 by Grim Pirate

phpDocs for Mimesis are now available via the phpDocs link.

Launch

Jan 25, 2008 by Grim Pirate

Launch of the official Mimesis website.