Commit graph

134 commits

Author SHA1 Message Date
Joshua Sherman
9dadc1c821 Removed finally keyword, bringing back 5.4 2014-01-16 17:45:42 -05:00
Joshua Sherman
62133dc1ca Hacking away to get coverage up
Finished up all the low hanging fruit (working the classes I already started
that were just shy of 100% coverage). Just shy of 80% coverage at this point.
2014-01-12 18:20:30 -05:00
Joshua Sherman
8db383601e More tests and 100% coverage achievements!
Also fixed a few minor bugs and reworked Browser class to not use the constant
UNIT_TESTING so I could get the class to 100% coverage. Adds a dependency of
testing_helpers which I believe is available on Travis CI by default. Up to 75%
coverage, w00t w00t!
2014-01-12 16:09:48 -05:00
Joshua Sherman
8fc726b983 Updated copyright date.
It's a new year, figured it would be nice to get this done before summer time
like most years.
2014-01-05 13:44:25 -05:00
Joshua Sherman
9b1feda909 Added support for custom maintenance templates. 2013-12-31 10:56:31 -05:00
Joshua Sherman
5a15c791c5 Finished up Controller tests for existing functionality 2013-12-31 10:39:21 -05:00
Joshua Sherman
c0dbb39bda More tests
Also, found that damn newline that was being output.
2013-12-30 17:13:22 -05:00
Joshua Sherman
64dc006b5f Documented some stuff, refactoring some other stuff
Moved re-used object instances to the Object class and added object loader logic to the constructor.
2013-12-30 15:47:13 -05:00
Joshua Sherman
54471c361b So much refactoring... 2013-12-30 00:38:13 -05:00
Joshua Sherman
7f37abc527 Cleaned up test includes a bit
Probably want to include an autoloader at some point. Also added PHP 5.3 and 5.4 to the test list, 5.3 outta fail, unsure about 5.4
2013-12-29 13:16:21 -05:00
Joshua Sherman
19a211cf6a More refactoring, ditching old code
Added a new 404 system which checks for templates/__shared/404.phtml (module-less bare in mind) and falls back to a generic Apache-ish Not found page with PICKLES shout out. Added some more assumptions (login page is always /login a/k/a the login.php module) also there's no way to customize which template is used for the 404. Removed some code that was no longer used in the Security class.
2013-12-29 12:52:13 -05:00
Joshua Sherman
09d1744910 Refactoring old code
More like removing old code. Added some memento notes for myself in there.
2013-12-28 18:41:56 -05:00
Joshua Sherman
064b4d9f55 Reworked Controller around new Display class 2013-12-28 16:23:42 -05:00
Josh Sherman
07a95a7508 Built out new Display class with tests
Not hooked up to the Controller yet, wanted to get Travis setup.
2013-12-28 01:13:02 -05:00
Josh Sherman
d96181c60f Q4 2013, seemed like a good time to update the copyright notices 2013-11-04 17:36:04 -05:00
Josh Sherman
dca62b82d1 Removed unnecessary sanity checks when calling Log 2013-09-15 12:02:07 -04:00
Josh Sherman
4d9eb54b13 Dropped dot syntax
Too much juggling to make sure the proper assets were loaded. Opened up a security issue that allowed some pages to be accessed even if data was missing, just a headache, best to move away from it and allow users to defining custom routing in inde.php. Perhaps down the road allowing a Route class that the user can define everything in.
2013-09-12 17:59:29 -04:00
Josh Sherman
2ac7790385 Cleaned up some old code.
Still had some <br />'s in there and updated some of the redirects to use the Browser class.
2013-09-09 16:08:10 -04:00
Josh Sherman
1a0f66cc9c Dot syntax URIs weren't erroring correctly
Instead of routing to a 404 or home, was just returning [] (empty JSON array). Updated to redirect home for the time being. 404 handling needs to be addressed soon anyway, it's kinda junk right now
2013-09-09 16:05:52 -04:00
Josh Sherman
ae188a82a6 Added third option to determine if regex needs to match or not match.
Also fixed a bug where errors were overwriting eachother
2013-09-08 14:31:55 -04:00
Josh Sherman
94a9e08661 In module input validation logic 2013-09-08 13:56:07 -04:00
Josh Sherman
650c16efae Removed session_start in controller, removed exception from Security class
Security class doesn't need to bark so much, just fail and move on
2013-02-20 11:38:16 -05:00
Josh Sherman
cbb75e7064 Added @geoffoliver attributes.
Geoff likes to exploit the URI and inject key/value pairs into it. It's not something I do, but I was intrigued enough to implement it. Basic usage is /path/to/page/id:123/spam:eggs. The variables are removed from the request variable as to not bork module loading and are made available via Browser::get('variable');
2013-02-04 23:34:09 -05:00
Josh Sherman
340b336a49 Controller bug and Distance class
Fixed a bug in the Controller that was throwing some notices when a module didn't return any data. Also finished up the calculateDistance() method in the Distance class. Seems I left it in somewhat of a bug filled incomplete state last week.
2012-12-18 13:24:19 -05:00
Josh Sherman
33bbcc014b Updated to allow for both object variables and explicit module returns to be merged into $__module 2012-12-08 15:38:05 -05:00
Josh Sherman
f75862fabd Added dot notation magic for URIs
Used to be very rigid in that each URI had to map to a single module. Now the inclusion of dots in the URI allow you to have multiple end points in a single file. /user/edit and /user/edit.save both resolve to /modules/user/edit.php
2012-11-30 17:33:53 -05: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
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
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
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
df5a2e2aaa Removed logic to load /__pickles/(js|css)/*.(js|css) files. It didn't work in nginx without trickery and it was a fundamentally ignorant approach since it caused PHP overload just to load a static file. The inclusion of the boilerplate will allow users to fork said project and have all files readily available. 2011-08-28 18:00:30 -04:00
Josh Sherman
3a89586eb1 Added configuration variable to disable logging. Currently it is a boolean value, but eventually it will probably be broken out into an array with key/value pairs to correspond with the different logging options within the PICKLES core. 2011-06-15 21:13:28 -04:00
Josh Sherman
7fba0d231d Added File class. 2011-06-12 18:08:59 -04:00
Josh Sherman
5d63e032f5 Added sanity check to _REQUEST['request'] when redirecting to the login page. Alleviates an issue when securing the default module. 2011-05-14 21:38:06 -04:00
Josh Sherman
996241debb Updated headers to have 2011 in the copyright date. Also updated copyright to my name as the LLC is currently defunct. 2011-05-09 22:14:55 -04:00
Josh Sherman
d9436919bd Fixed missing Content-Type headers when loading internal static assets (e.g. /__pickles/css/reset.css) 2011-04-09 16:34:49 -04:00
Josh Sherman
b2047bd0cb Fixed issue with request method and security hash validation. 2011-01-28 23:21:44 -05:00
Josh Sherman
95e75226d3 Return authentication error as JSON when script was POSTed to instead of performing a redirect to the login page. 2011-01-26 23:42:16 -05:00
Josh Sherman
04471d607a Added database session handling. 2011-01-16 15:40:59 -05:00
Josh Sherman
bef224d5ec Removed logic that interacted with passed IDs. This logic belongs in the .htaccess file (assuming it's even necessary for the site). 2010-12-26 14:27:45 -05:00
Josh Sherman
261b2546e7 Added better support for hyphens in a URI. 2010-12-17 23:55:28 -05:00
Josh Sherman
346c93e393 Added some comments. 2010-12-17 22:38:40 -05:00
Josh Sherman
25e78fc569 Updated replacement logic to be strict, just in case there is a scenario where the string could be replaced more than once. 2010-12-17 22:30:55 -05:00
Josh Sherman
e008ffcf2b Added redirect to force URI to be lowercase. 2010-12-17 22:18:25 -05:00
Josh Sherman
8fa5471aa7 Added private module functionality. 2010-12-09 22:52:26 -05:00
Josh Sherman
89e2c3db19 Cleaned up stray whitespace. 2010-12-09 20:12:05 -05:00
Josh Sherman
4c366d72a8 Auto start session from main file (before Controller is loaded) if session is enabled in the config. 2010-12-05 17:07:55 -05:00