Commit graph

384 commits

Author SHA1 Message Date
Josh Sherman
29c0dbad1f Added number utility class and a method to add ordinal indicators to a number (and without the need of PHP 5.3 which has some new class for that) 2012-11-17 12:27:00 -05:00
Josh Sherman
6f80fb51df Added a way to queue records and do a mass INSERT 2012-11-16 17:48:05 -05:00
Josh Sherman
dbcf427616 Added string method to generate a URL slug 2012-11-13 22:40:09 -05:00
Josh Sherman
de89ef85d1 Disabled debug_backtrace logging for PHP < 5.3.6 2012-11-08 13:54:35 -05:00
Josh Sherman
6c7d48278c REPLACE syntax was still using SET even though the way variables were set has changed 2012-11-07 19:53:09 -05:00
Josh Sherman
a36d51bb1a Fixed Cache::delete() when passing an array of keys
Since get() allows you to pass an array and get all of the keys back, I assumed delete worked the same way. It does not.
2012-11-07 19:28:44 -05:00
Josh Sherman
a0ad85e8e9 Added ability to turn off database auto-cache from the config
Probably should make it a part of the model as well, assuming it doesn't already do that, pretty sure it doesn't. Would help me as one of my sites I need to migrate a ton of code, so being able to flip models on one by one would be excellent.
2012-11-06 11:21:02 -05:00
Josh Sherman
b41f2c12e9 Updated to check if the supposed column names are integers
Simplified logic by only checking one variable. Since "1" is a string but also returns true for being an integer, I swapped the is_string out for an !is_int
2012-11-06 09:13:55 -05:00
Josh Sherman
b2037343d9 Added ability to pass in an array of integers assumed to be ID's
Previously new Model(array(1, 2, 3)); would results in a query like SELECT * FROM table WHERE 1 AND 2 AND 3; which would typically result in an out of memory error depending on the number of rows in the table (as all would be returned). Added detection for an array of integers and forces that to be considered new Model(array('id' => array(1, 2, 3))). As I type this I think I need to go back and make an additional change.
2012-11-06 09:03:03 -05:00
Josh Sherman
e420e3ad72 Moved Gravatar hash function to a dedicated Gravatar class 2012-11-06 08:32:09 -05:00
Josh Sherman
8e7a8f15c7 Fixed issue with pulling multiple keys
Namespace / uppercasing the key wasn't taking into consideration that sometimes array's can be present.
2012-10-23 23:55:57 -04:00
Josh Sherman
99aa78b6fa Built in caching for primary key queries
Selects done against a primary key will automatically cache to Memcached (haven't tried it, but it should fail gracefully) indexed by the model name and the primary key ([NAMESPACE-]MODEL-PKEY). Any updates or deletes against the same primary key will purge the cache automatically. The major caveat here is the case of mass updates which would result in stale data. As it stands the data is being cached for a mere 5 minutes, so this multiple row update scenario would be short lived but ideally, I'll be pushing back the time to live on the cache and/or making it something that's configurable. If you have to do mass updates, you're probably doing them with a cronjob and should just be flushing all of the cache in that scenario (as it would be nearly impossible to detect the affected keys and purge them all).
2012-10-23 23:30:04 -04:00
Josh Sherman
dc0d98906f Added Model and configuration overrides for the column mapping
Also obliterated the getters and setters in the Database class after running some tests against their speed in comparison to getting and setting the variables directly
2012-10-22 10:23:10 -04:00
Josh Sherman
8e0fe3dc3d Added sanity check to class index of backtrace return
Seems there's a scenario within PICKLES that provides a backtrace report that lacks a class name (even though the file being referenced is a class). If no class is set it's simply omitted.
2012-10-15 22:36:03 -04:00
Josh Sherman
4a41a07635 Added namespace/prefix to the caching class
Closes #3 taking the issues down to zero :-O
2012-10-15 21:51:56 -04:00
Josh Sherman
1154a1d901 LESSed up the minification logic 2012-10-14 20:05:03 -04:00
Josh Sherman
b31746b1c2 Added role based default methods
One of @geoffoliver's suggestions, default methods that are exclusive to the user's permission level. Named __default_ROLE(). No more conditionals in the code since you can now isolate the logic
2012-10-14 18:46:29 -04:00
Josh Sherman
8fb7622061 If the module doesn't return anything, pass the return array instead
Now you can set variables in the module itself and have them returned to the template instead of needing to explicitly return the data. Will come in handy in scenarios where you've extended another module and want to retain it's return data. Previously you had to set a variable and then add to that and return it from the child class.
2012-10-14 18:08:27 -04:00
Josh Sherman
3c2c936cee Added fluid variable to the Module class
As a developer you still need to code for it (it's shown at work in the bootstrap) but you can use the variable to toggle fluid and fixed right from the module itself
2012-10-14 17:53:23 -04:00
Josh Sherman
b05a1691f2 Added support for LESS
Dynamic class detects less files, compiles them to CSS then minifies it
2012-10-14 16:33:48 -04:00
Josh Sherman
c72a4b76a3 Dropped PECL files
I never use them, there's a link for the JSON one in the convert class if anyone really needed it. Mongo support's been dropped for a while so there was no need for that one either.
2012-10-14 14:22:28 -04:00
Josh Sherman
2795abf531 Added isMobile() function to the Browser class 2012-10-14 14:01:56 -04:00
Josh Sherman
ed52ebe529 Added Browser Utility class
Only 2 methods right now, redirect() and status().
2012-10-14 13:56:59 -04:00
Josh Sherman
553f70fdb8 Fixed issue with setting the template to false
Magic getter was overwriting the value because it was == null. Updated Module to check if the value isset() and if not, try to load from the config or set to false.
2012-10-13 12:04:02 -04:00
Josh Sherman
521deddc44 Added injection of is_deleted when doing a query 2012-10-13 11:02:02 -04:00
Josh Sherman
d76e2e71e9 Implemented created, updated, deleted logic.
Automatically inject the creation, update, and delete timestamps as well as which user performed the action. Rows can now be logically deleted and there are no more named parameters just question mark syntax.
2012-10-13 10:18:07 -04:00
Josh Sherman
482f77c10b Set _REQUEST['request'] by default
Should alleviate some redundant isset()s throughout a site's code
2012-10-11 22:50:32 -04:00
Josh Sherman
e05dd7c79e Added check that the table variable is actually set 2012-10-11 21:35:28 -04:00
Josh Sherman
ce61f797f3 Added automatic injection of timestamps 2012-10-11 21:27:22 -04:00
Josh Sherman
a595d85857 Dropped ID variable for Columns
The ID variable was used to map the table's UID so the model could inject it in properly. Added a new variable named columns that is an array of the key columns. Currently contains ID, Created at and Updated at columns. The timestamp columns will soon be injected into the queries and if the value is set to false, will skip it.
2012-10-11 18:56:15 -04:00
Josh Sherman
252ad2fe7b Dropped MongoDB support
There wasn't much to drop as it was never fully integrated. Unfortunately the only things that end up being fully integrated are the things that I actually use. Maybe someday MongoDB, maybe someday.
2012-10-11 17:35:02 -04:00
Josh Sherman
7ed16d9a56 Working on bootstrap
Got Apache config and .htaccess back. PICKLES minified CSS files. Updated Time's static variables to be class constants
2012-10-11 15:27:00 -04:00
Josh Sherman
9eb2d438a8 Added backtrace comment to SQL queries
Just a dump of the data from debug_backtrace in reverse order, Class:Line#

Closes #4
2012-10-11 09:51:01 -04:00
Josh Sherman
9fbc4171d7 Added timestamp method
Returns a UT timestamp in the specified format. Defaults to everyone's favorite format Y-m-d H:i:s
2012-10-10 22:30:21 -04:00
Josh Sherman
f884a2e45e Time class
Left Date class for the time being for the time being, aliased the method over to the Time class. Added interval constants as well. Closes #6
2012-10-10 22:09:37 -04:00
Josh Sherman
8dc808330c Removed memcached session option
Memcached is considered a bad choice for sessions as when it's full, it purges old keys and could end up purging user sessions. You can solve this with more memory, but it's a ton easier to keep it on disk in a single server setup and in the database when running a cluster.
2012-10-10 19:23:06 -04:00
Josh Sherman
a843589855 Added new hashing functions and updated random string generator to only use lowercase letters. 2012-10-07 10:00:09 -04:00
Josh Sherman
54372d24b7 Updated the last few URL's that were wrong, also generated a new copy of the documentation
Should probably made the documentation piece pre-commit hook or something
2012-10-03 17:46:27 -04:00
Josh Sherman
c27fbf8694 Fixed issue with _SERVER['HTTPS'] being set on nginx 2012-10-01 22:49:49 -04:00
Josh Sherman
6f114361bd Updated copyright, website and contact email 2012-09-30 12:40:29 -04:00
Josh Sherman
3e58cd89bf Emptied the JAR and cleaned up some whitespace 2012-09-30 12:26:32 -04:00
Josh Sherman
92fcfee986 PostgreSQL support 2012-09-30 12:18:25 -04:00
Josh Sherman
761caf52cf Random string generator couldn't generate strings that exceeded the number of available characters. This resolves that and allows for characters to show up more than once in the string itself. 2012-07-22 21:43:49 -04:00
Josh Sherman
9cd9304cf8 Moved meta data to be after the module execution
Modules were unable to override the meta data because the values were pulled before the module was being executed.
2012-05-18 21:10:01 -04:00
Josh Sherman
ee175f4923 Added fuzzy environment match (via @geoffoliver) 2012-04-08 16:39:26 -04:00
Josh Sherman
28c35c9869 Fixed variable scope error 2012-04-08 13:45:39 -04:00
Josh Sherman
d312d92033 Minification is now a configuration option, off by default 2012-02-24 23:22:27 -05:00
Josh Sherman
dc916622bb Added *_PRIORITY and IGNORE syntax
Expanded Model class to support queries with priorities as well as the ignore syntax. Priority can be set to LOW or HIGH and will be added to the appropriate queries with the appended _PRIORITY syntax. Ignore is boolean like the Delayed variable.
2011-11-20 13:32:35 -05:00
Josh Sherman
7f52efdbde Skip session start from CLI
Added check of the IS_CLI constant to determine if we should start the session or not.
2011-11-20 11:19:27 -05:00
Josh Sherman
dd4fb702eb Ripped out Mongo code, it's not being used and not being developed against at this time. 2011-11-06 20:53:48 -05:00