Commit graph

38 commits

Author SHA1 Message Date
phpnut
d44a364285 merging all changes done in sandbox for next release into the trunk
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1057 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-03 04:48:00 +00:00
phpnut
3fb93807a9 Merging [920] [922] [929]
[920]
Small bugfix for after condition in AjaxHelper::remoteFunction

[922]
Fixed Ticket #224
Added patch from Ticket #221
Added patch from Ticket #222
Renamed renderMethod() to requestAction() the name fits better since we are really requesting another objects response.
Added a default setting to turn of autoRender for the class you are requesting the action from, 
this will allow you to request an action and use the return how you like, instead of letting the object output the content
directly to the browser if it would normally do so.

[929]
Adding fix for Itcket #225.

Moved code for beforeFilters to first section of Controller::constructClasses().
Removed current implementaion of  beforeFilters. This will be changed to pass
a reference of the object to the filters through a core filters class.
The core filter class will then load the filters and perform all request on the object in the order the
filters are arranged in var $beforeFilters, each beforeFilter needs to be a class that the core filter class will create
an instance of. If one of the filters fails, it will return the object, untouched and not try to process other filters, an 
failed var will be set on the controller.

This will be done before data base is initialized for the current object that is being filtered.

Modifed the requestAction() changes are noted below

        Using inside of a controller.
        Default
        $this->requestAction('/controller/action/argument/');
        Request Object to render output directly
        $this->requestAction('/controller/action/argument/', a('render'));

        Using a helper object to make request inside of a view:
        Default
        $helpername->requestAction('/controller/action/argument/');
        Request Object to render output directly
        $helpername->requestAction('/controller/action/argument/', a('render'));

        Using the View object "$this" in a view to make request:
        $this->requestAction('/controller/action/argument/');
        Request Object to render output directly
        $this->requestAction('/controller/action/argument/', a('render'));




git-svn-id: https://svn.cakephp.org/repo/trunk/cake@930 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-09-21 05:48:09 +00:00
phpnut
ea2058256a Merging following revisions to trunk
[913]
Refactoring Dispatcher and Scaffold classes.
Removed Dispatcher::scaffoldView() and added it to
Scaffold::_scaffoldView() less coupling between the 2 classes now

[914]
Adding settings to fix issue when using get_class() in PHP 4.
If value of var $casedClas is set in controller this name will be Inflected to the proper table name if underscores are used
in the database.

[915]
Added suggestion from ticket #220

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@917 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-09-19 22:59:06 +00:00
phpnut
92d2625186 merging change from [911]
Refactoring Dispatcher::dispatch() created a private Dispatcher::_invoke().
Removed code that was no longer used by Dispatcher
Refactored duplicate code in Object::renderMethod();

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@912 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-09-19 20:07:16 +00:00
phpnut
59af4d3258 Merging changes from:
[905]
Refactoring renderMethod() moving to object class to make it available to whole system

[908]
Bug fixes to ticket #219.
Added bug fixes I found in code.
Fixed Router::parse(); which only checked lower case strings
Refactored renderAction method. Moved to object class to allow all classes to access the method now.
This will allow a User object to make a request to a Permsissions object checking.
For example: You have a User object that needs to check its permission to access
User object would make are request to Permission object.
$accces = $this->renderAction('/permission/allow/userid/');

You would then be able to use the results of $access in your controller.
To check this in the view
$accces = $html->renderAction('/permission/allow/userid/');

Simple as that.

[906]
Added sortable() to AjaxHelper as a method of creating sortables,
and refactored a fair amount of the code.

[907]
Coding standard corrections.

removed blank line at end of paths.php file

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@910 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-09-19 17:20:24 +00:00
phpnut
1a93ab942f merging changes made in sandboxes
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@893 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-09-18 18:58:45 +00:00
phpnut
a86866a7a1 merging [880] [881] [882] and [883] fixes
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@884 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-09-18 13:25:20 +00:00
phpnut
00aa3c66d2 merging fixes into trunk from [869]
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@870 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-09-17 12:37:05 +00:00
phpnut
29a1ee9043 merging fixes into trunk from [857] [858] [859] [860] [861]
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@862 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-09-17 07:56:32 +00:00
phpnut
1dce095546 merging changes from sandboxes
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@856 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-09-17 02:22:07 +00:00
phpnut
6019c0d98d merging changes and bug fixes from sandboxes
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@757 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-09-07 01:52:45 +00:00
phpnut
4c5e5ec9a2 Merging changes from [714] [715]
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@716 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-08-26 04:03:51 +00:00
phpnut
fbf4d9ee27 merging code from sandboxes since [430]
preparing for release .0.9.2

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@606 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-08-21 06:49:02 +00:00
phpnut
9d1d0201ec merging from source:whiteboard/sandbox/phpnut/pre_0.9.2 at [404]
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@405 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-07-21 04:02:32 +00:00
phpnut
6460f6e83f Merging changes from revisions [337] [338] [339] [340] [341]
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@342 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-07-10 05:08:19 +00:00
phpnut
6ca443861d more cleanup for API docs to be generated without errors
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@323 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-07-04 04:16:20 +00:00
phpnut
3500ca272c more cleanup for API docs to be generated without errors
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@322 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-07-04 02:59:39 +00:00
phpnut
c9d9cb8287 cleaning up the file headers so API docs can be created properly
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@320 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-07-04 02:07:21 +00:00
phpnut
8a806d7fc5 going thru trunk and cleaning up the file headers so API docs can be created properly
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@309 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-07-04 01:07:14 +00:00
phpnut
301731fb1a Corrected the use of View class instance.
It looks like the way you where coding it was to be used as a Singleton.
In Controller::render() I am setting all View() attributed by pass reference.
I do not think it will effect other parts of the system.

You can see why I did this by uncommenting the print_r function in View::render().
Reload url in browser.
Then in Controller::render() remove the & from:
$view->autoRender =& $this->autoRender;
This is the only one that seems to cause array to print.

This may also caused in the Router::connect().
Look at this if you get time.
I noticed that each setting in the conf/routes.php file calls outer::connect();
Tee profiler show this happening 6 times on current install from trunk
Router::parse() is called 2 times.


We really need to get some good unit test in place.

Also speeded things up a little.

Profiler test:

Before changes on default install from trunk

Between:
Total Request Time: 13013.4 Milliseconds
Total Request Time: 13065.84 Milliseconds
28 files

After changes
Between:
Total Request Time: 10230.99 Milliseconds
Total Request Time: 10511.59 Milliseconds
27 files



git-svn-id: https://svn.cakephp.org/repo/trunk/cake@304 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-07-03 07:07:47 +00:00
brego
38ddea527e Ok, this one is very big. Firstly, I've outsourced (:]) helper methods like linkTo etc into separate files, located in /libs/helpers/*.
I am not finished with copying methods out of template.php, but it will come - also data validation would not be a problem helpers inclusion happens in the Template::_render().

Also, there was a bug with error functions (as Controller::missingView) - on linux, calling $this->render('../errors/missingController'); rsulted in an error - beacouse apparently is_file() cannot work with '..'. I added a simple fix in Template::_getViewFn.

I've also made some cleanups. Will continue to work tonight.



git-svn-id: https://svn.cakephp.org/repo/trunk/cake@264 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-06-21 23:44:49 +00:00
pies
b717167c4f - changed NeatArray to Narray, it's shorter, easier to use,
- Time::daysAsSql returns SQL limits for a set of days, perhaps should be in DBO,
- cleanups

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@259 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-06-20 23:08:59 +00:00
pies
37e42105c6 I've merged in the changes by scharfie@gmail.com. For more information please see http://www.bluemargin.com/cake_custom_errors.zip. Olle, can you extract some information from the app/views/pages/home.thtml of that file?
The point is to provide custom error messages for Cake. As you will see, the quality of documentation is astounding.

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@255 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-06-19 06:45:55 +00:00
pies
da79dff7d7 - merged in Brego's SimpleTest implementation, fixed some of the tests (the Folder test fails to delete one of the test directories on my system, so it's not perfectly clean yet)
- Dispatcher sets a Controller::here variable with the real URL used to access the page, so that tag generators can that use an url (linkTo and formTag for example) use the real url, not guess it from the controller and action names which often fails
- Log class works more reliably and a LogError() shortcut function was added
- Nstring class added, to store string-related functions (there are just four yet, including a random password generator and an string-to-array splitter
- SimpleTest library (with Rephlux) included in /vendors; I've tweaked SimpleScorer::inCli() function, because it didn't work on my setup, it should work everywhere now (it checks for empty REQUEST_METHOD, which should only be empty in CLI)

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@248 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-06-18 23:26:35 +00:00
pies
39132f9bcf - I've rebuilt the startup a bit, more libraries are explicitly loaded at startup. They were loaded anyway (Object, Inflector), but implicitly thru uses() calls. I did it to untangle the relationships between files.
- Link tag generator fixed for compatibility with XHTML (& => &)
- prepare() and tables() methods renamed to prepareField() and tablesList() in database layers, prepare() and tables() meta-methods created in Model. The first one so that prepare() can accept both strings and arrays, the second one to fix Ticket #26 (case-sensitive table names didn't work for DB2).
- Few minor changes of includes() to requires() and the other way, to prevent unnecessary program terminations, and potential crashes.
- Time::toAtom() and Time::toRss() to format dates for XML feeds.
- Some code cleanups (unnecessary __construct()'s), also, I'm changing the parentheses into:

if (true)
{
}

I hope that's ok with everybody? I find it easier to understand code with that formatting. Does anyone know a highly configurable tool that would format PHP code automatically?

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@241 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-06-11 03:45:31 +00:00
pies
3f10d747b7 - Cake didn't work without mod_rewrite, fixed (/index.php, /libs/router.php).
- Controller accepts $params as a constructor parameter (for Larry).
- DBO::prepare() returned an array even when a string was passed to it, fixed.
- Flay and Folder tests fixed, DBO_Factory test disabled (no database config by default, so do database access to test).
- 

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@238 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-06-05 19:42:54 +00:00
pies
443a702376 I've merged in Olle's changes.
Larry, I've merged in _some_ of your changes, I'll merge in the scaffolding and joins code when you tell me it's ready. But I don't want to break how the Controller class works, can't we really do without the constructClasses() method call? Which reminds me, with your joins code, will we be able to use constructs like $user->post->findAll() and $user->post->save()?

Also, what are your changes to the DBO_MySQL class? I mean the mysqlResultSet(), and fetchResult() methods. I didn't see any MySQL-specific code inside them, perhaps they belong to the DBO class itself? 

- I've changed the headers on user-editable files in /app and /config. I hope they will constitute a compromise between readability and legality. I've left file Id, copyright, and licence notices.

- /libs/basic.php::uses() function logs included files in global $loaded. Please, consider it a note to myself. Also, I've moved the NeatArray class out of the /libs/basics.php (into /libs/neat_array.php).
- Some cleanups in the Controller and Dispatcher classes.
- DBO::Prepare() accepts strings _and_ arrays now. It's a step towards a unified params theory.
- I think I've added some comments to DBO sub-classes, but it might have been Olle.
- A fix in Model class (findAll didn't work properly)
- Object's constructor sets $this->db to &DBO, which means all Object-descendand classes have default access to the database if it's connected. We need to clean up the code accordingly (some classes set their own $this->db references).

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@236 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-06-05 11:05:24 +00:00
pies
065131205d Merged in Olle's changes (comments). Olle, can you sync with the trunk? It's up to half an hour ago.
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@213 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-06-02 19:37:06 +00:00
pies
9bbe275903 (I don't know what's happening:/ )
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@207 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-05-31 23:18:22 +00:00
pies
4234bc9488 I've added some fixes and new methods, hope this gets to be in the today's release. If not, at least the fixes should get in as soon as possible.
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@192 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-05-29 19:43:59 +00:00
pies
4a87a75332 - Two standard controllers -- PageController and TestsController
- Helpers for controllers -- each controller has it's own helper in the /app/helpers directory
- /logs and /modules directories
- The application runs just fine without /config/database.php if controllers don't ask for db access
- Changed the name of /public/dispatch.php to /public/index.php, it's nicer and more standard, won't you agree? Kamil's fix for no-mod_rewrite needs to be re-implemented
- Cleanups, fixes, and even one or two comments ;)

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@158 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-05-22 23:24:09 +00:00
pies
b5f6dba58e git-svn-id: https://svn.cakephp.org/repo/trunk/cake@148 3807eeeb-6ff5-0310-8944-8be069107fe0 2005-05-21 22:40:51 +00:00
pies
b92f61d3a7 Removed some empty comment lines.
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@134 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-05-17 22:23:22 +00:00
phpnut
ce08562f5d modifying file headers
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@131 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-05-17 21:39:28 +00:00
pies
ae6c6d0a36 Bugfixes, cleanups and a new DbFactory class to generate DBO objects according to the db configuration.
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@129 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-05-17 20:55:27 +00:00
pies
a778f3c3c3 Merging my changes into trunk. This should give us a nice clean trunk to continue with. It's strongly recommended that you merge this version with your sandboxes -- I've added all the phpdoc fields and changed a lot.
I've removed the author/licence information from some files -- such as app/app_controller.php and config/database.php -- as they are not our code and those files need to remain as clean as possible for people not to get lost in them.

I've run the tests on this one, but the tests are not as extensive as they should be. If you want to get the test controller etc. check out the version in my sandbox. But we'll probably be moving to SimpleTest  soon anyway.

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@114 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-05-16 23:14:37 +00:00
phpnut
bb71238ec1 change license to The MIT License
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@109 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-05-16 00:52:42 +00:00
phpnut
cd86555549 moving cake to a sub directory
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@106 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-05-15 21:41:38 +00:00