Re: Twist on multirecord forms.
Hi, $model-updateAll might be your friend in this case. You could do something like: $this-Task-updateAll(Task.date = $value); Richard On Mon, Mar 16, 2009 at 9:02 PM, gc1155 gc1...@gmail.com wrote: I've read up on multirecord forms and I think I have the basics down using Cake 1.2. However, what if I want to make one modification and have it apply to several records? For instance, given a Task model with a Day field. I'd like to be able to pick a day and submit the form. The day field would then be applied to all the records in the submit. Is there a cake way of doing this by convention? My hunch is that I'll have to manipulate the data in the controller to apply the change to all the records before calling save. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
xml element to create the format
hey, i am trying to create an xml formal like media:content url= http:/www.abc.com type= video /media:content i am using the xml elem to do so like.. $xml-elem('content',array('namespace'='media')); and it generates me the output as media:content /media:content how to put the url and type values in media:content... if i try to put it as a new array in elem then i dont get any output.. anyone can please guide me through this,,??? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Syntax for find()
Untested, but this should do the trick: $this-Place-find(all, array(order = array(account_status, name)); On Mon, Mar 16, 2009 at 11:47 PM, Chris M cmcclel...@yahoo.com.au wrote: Can someone provide the syntax for the find if I want to accomplish this: select * from places order by account_status, name A very basic question, but I'm only a newbie Cheers :) -- Stay connected to the people that matter most with a smarter inbox. Take a lookhttp://au.rd.yahoo.com/galaxy/mail/tagline2/*http://au.docs.yahoo.com/mail/smarterinbox . --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Easy way to import Models with their Controllers or vica versa
Hello, I have an controller with a model and no table and want to access other controllers and their models from it. This controller doesn't have any relation to these other controllers. Like so public function generate() { /* access other controllers and gather data */ } I tried using uses[] but I only got the models. If I try and import the controller via App::import I don't get the models with the controller and it feels a bit wrong. Is there a nice way to do such a thing? I want to access from one controller several other controllers methods which then access their models. Or is it better to just leave the other controllers alone and focus on the one big controller which uses several models? best regards --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
RSS with html tags using RssHelper?
I am trying to put together a feed containing images in the description of each item along with some p tags and other simple html. Just entering the html into the description will work for Safari and NetNewsWire but I can't figure out how to get Firefox to get it (I haven't looked at IE or any other reader yet). I can't get CDATA in there correctly since it will be escaped along with the rest of the tags. Anyone know how to get past this seemingly simple problem? I have been at it for a while now and I am running out of ideas. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Easy way to import Models with their Controllers or vica versa
$controller-constructClasses(); worked nicely --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Like search
I want to add multiple columns in or option, eg. select * from blog where (keyword like '%xyz%' or title like '%xyz%') and is_active = 'Y'; How to arrange it in condition array? On Mar 12, 11:13 am, Miles J mileswjohn...@gmail.com wrote: $this-Model-find('all', array( 'conditions' = array('Model.column LIKE' = '%keyword%') )); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: containable and (left/inner) JOINS
I built something real quick a short while ago. It does basic joins using syntax similar to Containable and other model definitions. It has not been tested or taken to its limits at all. It just does what I needed at the time but there is room to expand on it. If any of you are interested in taking a look, be my guest: http://bin.cakephp.org/view/1685750747 /Martin On Mar 17, 2:31 am, joshua josh...@gmail.com wrote: Yeah, I replace $conditions['join'] with manual query in my application for the bad performance and some unreachable function when use cake join. [?] On Wed, Jan 21, 2009 at 8:04 AM, Mark (Germany) dereurom...@googlemail.comwrote: well, great idea :) i dont know the model things in cake all too well so i have no idea why cake avoids the useful joins.. in my opinion, almost 99% of the queries could be left joins and then it would be totally easy to just change it to inner, where needed till now, i really did not care - as i had only up to 50-100 entries, maybe 300 at the most this resulted in only 300-500 queries, depending on how many other tables connected to it^^ but with more than thousand entries and maybe 3 BelongsTo/HasMany connections the number explodes up to many thousand queries - my database goes mad about that (understandable) this is the first time i use custom queries because i have no idea how to manage that problem - so far. On 20 Jan., 17:54, Bernardo Vieira bvieira.li...@gmail.com wrote: Maybe that's the queue to develop a new 'Joinable' behavior based on the Containable behavior. Mark (Germany) wrote: i guess i did forget to mention that i already tried that but it gets totally ignored. and besides this fact, i would already be happy if it would do any (e.g. left) join instead of producing many thousand queries where it would be only one... do you have a simple approach to that one? with this trick conditions-array(Model1.id=Model2._model1_id) inside the containable arrays it does not work either (sql errors) On 19 Jan., 19:01, rtconner rtcon...@gmail.com wrote: I think you misunderstand what the containable does. Your complaint is with model bindings in general, and not with this behavior. In any case, I'll leave you to expiriment and learn, but I wanted to tell you, to do an inner join in cake you use the config.. 'type'='INNER' in your binding definition. -- Thanks Joshua 340.png 1KViewDownload --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Ajax check
I want to add ajax check of username in sign up form onblur action. How to use ajaxhelper for this functionality? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
simpleSAML and CAKEPHP
Is it someone that use simpleSAML with CAKEPHP? I have some questions about it --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Why Rendering CORE\cake\libs\view\elements\dump.ctp 6.635090 (debugkit timer result)?
Below is my debugkit result of one page in my application. Timers *Total Request Time:* 9.850548 (seconds) Message time in secondsComponent initialization and startup 0.181480 Controller Action 0.062440 Render Controller Action 6.819140 Rendering View 6.816620 Rendering APP\views\users\activity_management.ctp 0.109310 Rendering APP\views\elements\active_search_box.ctp 0.001040 Rendering APP\views\elements\tab_header.ctp 0.001030 Rendering APP\views\elements\pagination.ctp 0.003490 Rendering CORE\cake\libs\view\elements\dump.ctp 6.635090 Rendering APP\views\layouts\default.ctp 0.065750 Any body can me some optimize suggestions about this? Appreciate for your help or reply! Joshua --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Custom admin routing and pagination
I am struggling to get custom admin routing to work with pagination. I have a custom admin route called 'courseadmin'. This works fine, but when I try to do pagination in a view (courseadmin/students/index) the pagination link links to /students/courseadmin_index. I suppose I could fix it with a route, but I'm not sure how, any suggestions. Walther --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Display a blob in a view
Hi, I have going through all the discussions looking for an easy way to show a blob in a view. I have got to what I think is the most simple way of doing it. Controller: function display($id) { Configure::write('debug', 0); $file = $this-Image-findById($id); $type = $file['Image']['type']; $data = base64_decode($file['Image']['image']); header(Content-type: $type); echo $data; exit(); } View: echo 'img src=/images/display/'.$image['Image']['id'].' title='. $image['Image']['name'].' alt='.$image['Image']['name'].' /'; All I get in FF is the alt tag and in IE I get the gobligook. Any thoughts? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: User to User request
On Mar 17, 12:16 am, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: How would you build a Table to handle messages from user to user? So user 27 wants to send a message to user 56... when user 56 logins in he can see his message from user 27. [snip] I usually uses the following ER model User --- is sender of 0..* - Message User --- has corresponded 0..* - Correspondence Message --- is part of 1..* - Correspondence So three tables: User, Message and Correspondence Hope this is useful to you, enjoy :) John, LV --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Syntax for find()
beginner too :P this page may help: http://book.cakephp.org/view/73/Retrieving-Your-Data On Tue, Mar 17, 2009 at 4:24 PM, Richard rclay...@gmail.com wrote: Untested, but this should do the trick: $this-Place-find(all, array(order = array(account_status, name)); On Mon, Mar 16, 2009 at 11:47 PM, Chris M cmcclel...@yahoo.com.au wrote: Can someone provide the syntax for the find if I want to accomplish this: select * from places order by account_status, name A very basic question, but I'm only a newbie Cheers :) Stay connected to the people that matter most with a smarter inbox. Take a look. -- catha...@gmail.com http://blog.cathayan.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Setting 'host' value in database configuration corrupts bytea data saving
Trying to save data into a bytea field in a PostrgreSQL (i.e. a photo upload, storing the photo into the db) I encountered a problem: retrieving saved data later those data ended up to be corrupted. In particular investingating within those files I found that the character ' have been doubled. Removing 'host' parameter from config/database.php file data were saved correctly and I was able to retrieve them and creating my files without any problem. The database configuration for our web application contained the value 'host' = 'localhost' in the config/database.php file. Now the problem is that we can not use a DB on a different server than localhost from the moment we can not specify any values for 'host' key in database configuration. Did anyone of you encounter the same issue? How did you manage it? Greetings, Marco --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Like search
Cake defaults to AND but you can specify any hierarchy of AND and OR or AND or OR... until you get dizzy in the head :) Your search could probably be formatted like: 'conditions' = array( 'Model.is_active' = 'Y', 'or' = array( 'Model.column1 LIKE' = '%keyword%', 'Model.column2 LIKE' = '%keyword', ... ... ) On Mar 17, 11:11 am, kaushik kaushikwo...@gmail.com wrote: I want to add multiple columns in or option, eg. select * from blog where (keyword like '%xyz%' or title like '%xyz%') and is_active = 'Y'; How to arrange it in condition array? On Mar 12, 11:13 am, Miles J mileswjohn...@gmail.com wrote: $this-Model-find('all', array( 'conditions' = array('Model.column LIKE' = '%keyword%') )); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: $ajax-observeField() problem
try this code for drowp down functionality echo $form-create('PopularFirm',array('url'=array('controller'='dashboards','action'='popular_firms'),'div'=false)); echo $form-input('name', array('label'=false,'div'=false,'style'='margin-left:0;width:150px','type'='select','options'=$firmlist ,'id'='popularlist','empty'='All')); echo $ajax-observeField('popularlist', array('with'='Form.Element.serialize(\'popularlist\')','url'='popular_firms','update'='popular_info','complete'=Effect.Appear('popularlist');,'onChange'=true)); echo $form-end(); On Mon, Mar 16, 2009 at 4:54 PM, Manisha P pmanisha1...@gmail.com wrote: Hello All, I am using $ajax-observeField() It is showing me error 'Form is not defined' in javascript console. Does anyone has some solution for this? Thanks in advance Manisha. -- Regards, Gayatri, IT Associate, IEG, Hyderabad. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Ajax Validation
I have this form: form . input type=test name=username/ . /form I want to call a ajax function onblur action of username field which will call a method of UsersController which will check its validity using database. In case of invalid username, it will give an alert massage. how to do that using ajaxhelper? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: paginateCount and SELECT DISTINCT
Anyone? On Mar 16, 3:15 pm, Fibra fabricio.sod...@gmail.com wrote: Hello everyone, how are you? If you ever had the misfortune of finding yourself in the need of using the $paginate variable with a DISTINCT operation, you must have found out that the returned amount of records is not correct! It returns the COUNT of all the records (ignoring the DISTINCT in the fields array) instead of the COUNT(DISTINCT id), for example. I've been looking all over the web for a solution to this particular case of pagination but they all involved rewriting the paginateCount method for a particular case of pagination, which is not what I want (I want cake to keep doing all the magic for me :D ). So, I've been playing with the cake lib, and found a way to solve it, however... I assume it might have side effects, and would like your opinion on the matter, whether this can be implemented in a cleaner way or if I'm totally off track. So, in the controller.php find method, I've placed (REplaced, actually) this code (Line 1030): if (method_exists($object, 'paginateCount')) { $count = $object-paginateCount($conditions, $recursive, $extra); } else { $parameters = compact('conditions'); if ($recursive != $object-recursive) { $parameters['recursive'] = $recursive; } //$count = $object-find('count', array_merge($parameters, $extra)); //OLD LINE $count = $object-find('count', $fields); //NEW LINE } In my controller, the code for the paginate variable is as follows: var $paginate = array( 'limit' = 25, 'order' = array( 'User.created' = 'desc' ), 'joins' = array( 'LEFT JOIN user_areas AS Areas ON User.id = Areas.user_id', 'LEFT JOIN user_tools AS Tools ON User.id = Tools.user_id', 'LEFT JOIN user_careers AS Careers ON User.id = Careers.user_id' ), 'fields' = array( 'DISTINCT User.id', 'User.dni', 'User.name', 'User.email', 'User.password', 'User.interviewed', 'User.keywords', 'User.birthday', 'User.cv', 'User.filetype', 'User.comment', 'User.province_id', 'User.town', 'User.remuneration', 'User.created', 'User.modified', 'User.admin', 'Province.id', 'Province.country_id', 'Province.name', 'UserSecondary.id', 'UserSecondary.user_id', 'UserSecondary.secondary_id', 'UserSecondary.institute', 'UserSecondary.status_id' ) ); So, I would like to hear some thoughts please. Thanks in advance! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Why Rendering CORE\cake\libs\view\elements\dump.ctp 6.635090 (debugkit timer result)?
I try to print the debug trace in file dump.ctp. But there is nothing output. I am sure the cache has been deleted. On Tue, Mar 17, 2009 at 7:14 PM, joshua josh...@gmail.com wrote: Below is my debugkit result of one page in my application. Timers *Total Request Time:* 9.850548 (seconds) Message time in secondsComponent initialization and startup 0.181480 Controller Action 0.062440 Render Controller Action 6.819140 Rendering View 6.816620 Rendering APP\views\users\activity_management.ctp 0.109310 Rendering APP\views\elements\active_search_box.ctp 0.001040 Rendering APP\views\elements\tab_header.ctp 0.001030 Rendering APP\views\elements\pagination.ctp 0.003490 Rendering CORE\cake\libs\view\elements\dump.ctp 6.635090 Rendering APP\views\layouts\default.ctp 0.065750 Any body can me some optimize suggestions about this? Appreciate for your help or reply! Joshua -- Thanks Joshua --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: RSS with html tags using RssHelper?
Hey Martin, I don't do anything special for this. Just assign the HTML to the description. I don't escape it or wrap it as cdata...cake handles the escaping automatically. If it helps here's one of my feeds generated w/ the RssHelper that has html/images and looks good in FF: http://rsstalker.com/feed/amazon/25percent -Matt http://www.pseudocoder.com On Mar 17, 5:14 am, Martin Westin martin.westin...@gmail.com wrote: I am trying to put together a feed containing images in the description of each item along with some p tags and other simple html. Just entering the html into the description will work for Safari and NetNewsWire but I can't figure out how to get Firefox to get it (I haven't looked at IE or any other reader yet). I can't get CDATA in there correctly since it will be escaped along with the rest of the tags. Anyone know how to get past this seemingly simple problem? I have been at it for a while now and I am running out of ideas. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Check Session at Login with Auth/Sessions prüfen bei Login mit Auth-Komponente
Hi, I need help with the enlargement of the Auth component. The following problem or scenario, I would like to bind: User can login with two browsers on my website twice, since each browser writes a cookie. I want to teach the login-action before Login to check whether the IP address has a valid session exists. If yes, the old one should be deleted, would be most useful. Whether the sessions in a file or in the DB is placed I do not care, I'm looking just for a idea. Greeting daThy - wrestlegame.de Hallo zusammen, ich benötige Hilfe bei der Erweiterung der Auth-Komponente. Folgendes Problem bzw. Szenario möchte ich unterbinden: User können sich mit zwei Browsern auf meiner Website doppelt einloggen, da jeder Browser einen eigenen Cookie schreibt. Ich möchte der Login-Action beibringen vor Login zu prüfen ob unter der IP-Adresse schon eine gültige Session besteht. Wenn ja, müsste die alte gelöscht werden, wäre am sinnvollsten. Ob die Sessions in einer Datei oder in der DB untergebracht werden ist mir egal, ich suche nur nach einer zündenden Idee. Gruß daThy - wrestlegame.de --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Overloading AppModel constructor
We're in the same boat, I would also like to hear an explanation as to why we're not supposed to do it. But the developer is mostly right, bug tracking is not a support forum, so that's the reason why I went and posted on google groups, hoping may be one of them will actually explain the reason. :-) On Mar 16, 2:21 pm, Alfredo Quiroga-Villamil laww...@gmail.com wrote: I am not sure if there is an alternative; but to me overlading the constructor sounds perfectly fine. I would be interested in hearing reasons why not to. I did see the comment posted in the bug and I personally disagree with the comment: 2) Do not override model constructors. I would think there is a good reason why not to do that since that was the response to your issue. It would be interesting to get more details and not simply say Don't do it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Setting 'host' value in database configuration corrupts bytea data saving
Ok, after further tests now I know that I was wrong: now even dropping the 'hos' value from database config the generated files are corrupted. The problem seems to be the same: the characters ' appers twice instead of one. Any ideas? Marco On Mar 17, 12:46 pm, Morail marco.frass...@gmail.com wrote: Trying to save data into a bytea field in a PostrgreSQL (i.e. a photo upload, storing the photo into the db) I encountered a problem: retrieving saved data later those data ended up to be corrupted. In particular investingating within those files I found that the character ' have been doubled. Removing 'host' parameter from config/database.php file data were saved correctly and I was able to retrieve them and creating my files without any problem. The database configuration for our web application contained the value 'host' = 'localhost' in the config/database.php file. Now the problem is that we can not use a DB on a different server than localhost from the moment we can not specify any values for 'host' key in database configuration. Did anyone of you encounter the same issue? How did you manage it? Greetings, Marco --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Overloading AppModel constructor
On Mar 16, 2:42 pm, AD7six andydawso...@gmail.com wrote: On Mar 16, 8:12 pm,yaman666yaman...@gmail.com wrote: Show what you've got and why, and someone will probably point you in the right direction. probably: do it with a behavior and var $actsAs = array('Foo'); in your app model. I have not looked into $actsAs, will research it as soon as I can. Basically models have a custom xml component to store highly customizable data without continuously changing table structure. For example a model table has only id, xml and created_at fields. AppModel has a DOMDocument property. On model load it would load xml into dom document. On model save it would save dom document into xml field. And any customizable data can be accessed via xpath through the dom document. class AppModel extends Model { public $dom; public function __construct($id = false, $table = null, $ds = null) { parent::__construct($id, $table, $ds); $this-dom = new DOMDocument; if (isset($this-data[get_class($this)][xml])) { $this-dom-LoadXML($this-data[get_class($this)][xml]); } } public function beforeSave() { if (isset($this-data[get_class($this)][xml])) { $this-data[get_class($this)][xml] = $this-dom-SaveXML (); } return true; } } If you can offer another way to do it I'd be really interested to know. Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Display a blob in a view
On Tue, Mar 17, 2009 at 2:04 AM, Rufus rufusp...@gmail.com wrote: Hi, I have going through all the discussions looking for an easy way to show a blob in a view. I have got to what I think is the most simple way of doing it. Controller: function display($id) { Configure::write('debug', 0); $file = $this-Image-findById($id); $type = $file['Image']['type']; $data = base64_decode($file['Image']['image']); header(Content-type: $type); echo $data; exit(); } View: echo 'img src=/images/display/'.$image['Image']['id'].' title='. $image['Image']['name'].' alt='.$image['Image']['name'].' /'; All I get in FF is the alt tag and in IE I get the gobligook. It looks like you need to set $autoRender $autoLayout = false --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Jake question: rewrite problem?
Umm...what? You just went from having issues using Jake, a connector for CakePHP and Joomla, to a completely different application issue. If it is upgrade problems, I'm of the mindset that if you can't do it yourself, someone should be hired to do it for you. Anyhow, I took a look at Joomla (v1.5) and Jake (v1.0.3.38b for Joomla 1.5), running CakePHP v1.2.0.7962 (as it was the latest I happened to have, already downloaded). The primary step that Jake ignores, is that it *assumes* your CakePHP application is ALREADY installed, configured, and running. The configuration of Jake is then to simply point to where you have it installed. I misunderstood how Jake integrated Joomla and CakePHP. You install Joomla on its own. You also install CakePHP on its own. My (test) directory structure was as follows: - htdocs/ --- joomla/ -- joomla related files... --- cake/ - app/ --- webroot/ - cake/ - vendors/ After following the instructions on Jake's site, after importing the Jake ZIP archive and reading that I needed to configure the jake.ini file, I came to realize it expected the app to have already been baked, and all it was asking for was the full (or relative) path to the CakePHP application. As for Magnik.com's application, I'm not familiar with that, nor do I really want to be. Hopefully you can get that working on your own. Supposedly it uses a version of Cake v1.2, so the routing and htaccess rules should be the same, so it seems the Jake configuration is (hopefully) simply the problem here. On Mar 16, 5:21 pm, Robin madsa...@gmail.com wrote: Thanks Brendon. Definitely appreciate your help. Maybe you can use the exact cake application I am using so that to reproduce what I am seeing right now. Here is the link:http://www.magnik.com/api/files/magnik%201.2.4.zip. It is a amazon script written in cakephp. I do think the version matters since I can use the latest version of cake with no problem, although I don't have the capability to upgrade that application to latest cake. Thanks again! On Mar 16, 10:19 am, Brendon Kozlowski brendon...@hotmail.com wrote: Whoops, Smelly Eddie is right. I think below as being outside the document root, not within. I'm back from my trip, I'll see if I can install Joomla withJakesupport on a test server later tonight to see what the issue is. On Mar 15, 1:23 pm, Robin madsa...@gmail.com wrote: I realized that this might be a completely different problem. Since the mainframe of joomla wasn't displayed after I calledjakecomponent with index.php?option=com_jake. It might be a problem thatjakecalls joomla files, including css files. If that's the case, it is the handling of joomla url be wrong. Since the cake\app path is defined relative to joomla folder, the path will be wrong as well. But I still cannot locate howjakecould mess up with the joomla url writing. Anyone please? On Mar 14, 1:18 pm, Robin madsa...@gmail.com wrote: Thanks Smelly. Actually, I did try both, and they gave me the same result. The way I avoided the mixing of index.php page is that I renamed index.php in cakephp to cakephp.php, and call that page injakecomponent. But still exactly the same symptom. I actually tried a few other ways, like put joomla files in a folder named joomla and put it under webroot rather than directly copying joomla files to webroot, etc. They all give the same error and symptom. One thing I almost forgot and I guess is important: I suppose any cakephp link originally in my cake application should be rewrite to a joomla component link, right? So, in my original question, I said the link is supposed to be http://localhost/cake/about_us;, that's not correct! It should actually be http://localhost/joomla/index.php? option=com_jake.../about_us. It seems to me that this simply indicatesjake'srewriting is wrong. Still in need of help. Please Robin On Mar 14, 9:10 am, Smelly Eddie ollit...@gmail.com wrote: I have to disagree with Brennen about one thing. For security reasons, it is recommended to have most of CakePHPs file (the core) *above* the webroot. Your servers (site's) document root should point to cake/app/webroot. That is where you should drop Joomla. visiting localhost/ would then show cake localhost/about_us would show your static page visiting localhost/joomla would then show Joomla. Just mixing joomla files into the webroot directory (as your second example above) would be troublesome because both the cake index and the joomla index will be competing. In your case it looks like you completing wrote over the cake index, which would explain the trouble. On Mar 13, 4:28 pm, Robin madsa...@gmail.com wrote: Anybody can help please? Thanks so much! Robin On Mar 13, 1:08 am, Robin madsa...@gmail.com wrote: Hi Brendon,
Re: My first CakePHP website launched
Davy, for some reason IE (version 6 anyway, not sure about 7) won't allow me to click in the text boxes (inputs) of the contact form. I can click on the labels to get focus, and I can use the keyboard to FORCE focus (and then I can click on the text within the inputs after typing, after focus), and I can click on the left-most border of the input to get focus...but I cannot click in the open space of the text inputs (or the textarea). I'm guessing it's a CSS thing, but I can't say for sure. Thought you might want to know. :) On Mar 16, 1:35 pm, Davy davyvandenbr...@gmail.com wrote: Thanks Robin, this is fixed now! On Mar 16, 6:30 pm, MrSensitive robin...@telenet.be wrote: Hi Davy, nice site, Robin here.. Thank You for your help on the UltraGenda Webserver ;) in your portfolio, the link on Davy Van Den Bremt (v2) points towww.bartschepens.be which is probably a typo..- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Custom admin routing and pagination
On Tue, Mar 17, 2009 at 8:37 AM, Walther waltherl...@gmail.com wrote: I am struggling to get custom admin routing to work with pagination. I have a custom admin route called 'courseadmin'. This works fine, but when I try to do pagination in a view (courseadmin/students/index) the pagination link links to /students/courseadmin_index. I suppose I could fix it with a route, but I'm not sure how, any suggestions. function admin_index() { ... } Router::connect( '/courseadmin/students/index', array( 'controller' = 'students', 'action' = 'index', 'admin' = 1 ) ); $html-link( 'link text here', array( 'controller' = 'students', 'action' = 'index', 'admin' = 1 ), array('title' = '...') ); The thing with routes is you should start with your desired URL, then define the controller, action, etc. When you use HtmlHelper to create links, just use the array definition from the route and it should return your desired URL. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Why Rendering CORE\cake\libs\view\elements\dump.ctp 6.635090 (debugkit timer result)?
Why are you printing debug info at the same time as profiling your application? Unless you plan on leaving the dump in there for the public to see, do one or the other. On Tue, Mar 17, 2009 at 10:30 AM, joshua josh...@gmail.com wrote: I try to print the debug trace in file dump.ctp. But there is nothing output. I am sure the cache has been deleted. On Tue, Mar 17, 2009 at 7:14 PM, joshua josh...@gmail.com wrote: Below is my debugkit result of one page in my application. Timers Total Request Time: 9.850548 (seconds) Message time in seconds Component initialization and startup 0.181480 Controller Action 0.062440 Render Controller Action 6.819140 Rendering View 6.816620 Rendering APP\views\users\activity_management.ctp 0.109310 Rendering APP\views\elements\active_search_box.ctp 0.001040 Rendering APP\views\elements\tab_header.ctp 0.001030 Rendering APP\views\elements\pagination.ctp 0.003490 Rendering CORE\cake\libs\view\elements\dump.ctp 6.635090 Rendering APP\views\layouts\default.ctp 0.065750 Any body can me some optimize suggestions about this? Appreciate for your help or reply! Joshua -- Thanks Joshua --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Setting 'host' value in database configuration corrupts bytea data saving
Your data is being escaped. Have a look at DboSource to see if there's a way to stop certain fields from being escaped. On Tue, Mar 17, 2009 at 11:52 AM, Morail marco.frass...@gmail.com wrote: Ok, after further tests now I know that I was wrong: now even dropping the 'hos' value from database config the generated files are corrupted. The problem seems to be the same: the characters ' appers twice instead of one. Any ideas? Marco On Mar 17, 12:46 pm, Morail marco.frass...@gmail.com wrote: Trying to save data into a bytea field in a PostrgreSQL (i.e. a photo upload, storing the photo into the db) I encountered a problem: retrieving saved data later those data ended up to be corrupted. In particular investingating within those files I found that the character ' have been doubled. Removing 'host' parameter from config/database.php file data were saved correctly and I was able to retrieve them and creating my files without any problem. The database configuration for our web application contained the value 'host' = 'localhost' in the config/database.php file. Now the problem is that we can not use a DB on a different server than localhost from the moment we can not specify any values for 'host' key in database configuration. Did anyone of you encounter the same issue? How did you manage it? Greetings, Marco --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Retrieve Associated Count
I have a simple hasMany relationship set up with CakePHP and I want to retrieve a couple of fields from the parent table based on the count of the child. The scenario: I have boxes that hold 81 aliquots each. (Each box is 9X9.) I want to retrieve the id and description from the boxes table of boxes that have fewer than 81 aliquots to generate a list. In other words, I want a list of boxes that are not full. My models: class Box extends AppModel { var $name = 'Box'; var $hasMany = array('Aliquot'); var $belongsTo = 'Freezer'; } class Aliquot extends AppModel { var $name = 'Aliquot'; var $belongsTo = array('Box','Specimen'); } I can't seem to work out the best way to get a count of the aliquots for each box. I haven't been working with CakePHP all that long, so I'm hoping there's a relatively simple way to do this that I'm missing. It doesn't seem like a very complicated thing to do, yet I've spent the better part of my morning working on it with not success. This seems like it would work: http://book.cakephp.org/view/75/Saving-Your-Data#counterCache-Cache-your-count-490 Except that my tables are already populated, so creating the aliquot_count field in my boxes table just leaves me with a bunch of empty fields. Does anyone have some advice that will point me in the right direction? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Find the page owner
What's is the easiest way to compare the logged in Auth user id against the owner of the page they are viewing? I am trying to restrict actions based on who is logged in. Thanks Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Retrieve Associated Count
The counterCache field is updated with each insert or delete (maybe more often), so if your boxes are changing allt he time, it will not be a problem. If it isn't the case, you can fetch all the boxes and their count and take only the count81 using a foreach loop. On Mar 17, 5:17 pm, Tony Thomas truet...@gmail.com wrote: I have a simple hasMany relationship set up with CakePHP and I want to retrieve a couple of fields from the parent table based on the count of the child. The scenario: I have boxes that hold 81 aliquots each. (Each box is 9X9.) I want to retrieve the id and description from the boxes table of boxes that have fewer than 81 aliquots to generate a list. In other words, I want a list of boxes that are not full. My models: class Box extends AppModel { var $name = 'Box'; var $hasMany = array('Aliquot'); var $belongsTo = 'Freezer'; } class Aliquot extends AppModel { var $name = 'Aliquot'; var $belongsTo = array('Box','Specimen'); } I can't seem to work out the best way to get a count of the aliquots for each box. I haven't been working with CakePHP all that long, so I'm hoping there's a relatively simple way to do this that I'm missing. It doesn't seem like a very complicated thing to do, yet I've spent the better part of my morning working on it with not success. This seems like it would work: http://book.cakephp.org/view/75/Saving-Your-Data#counterCache-Cache-y... Except that my tables are already populated, so creating the aliquot_count field in my boxes table just leaves me with a bunch of empty fields. Does anyone have some advice that will point me in the right direction? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Setting 'host' value in database configuration corrupts bytea data saving
I supposed it too since I tried with a MySQL db and there's no problem in that case. So the problem must be somewhere in the DboSource related to PostgreSQL On Mar 17, 5:17 pm, brian bally.z...@gmail.com wrote: Your data is being escaped. Have a look at DboSource to see if there's a way to stop certain fields from being escaped. On Tue, Mar 17, 2009 at 11:52 AM, Morail marco.frass...@gmail.com wrote: Ok, after further tests now I know that I was wrong: now even dropping the 'hos' value from database config the generated files are corrupted. The problem seems to be the same: the characters ' appers twice instead of one. Any ideas? Marco On Mar 17, 12:46 pm, Morail marco.frass...@gmail.com wrote: Trying to save data into a bytea field in a PostrgreSQL (i.e. a photo upload, storing the photo into the db) I encountered a problem: retrieving saved data later those data ended up to be corrupted. In particular investingating within those files I found that the character ' have been doubled. Removing 'host' parameter from config/database.php file data were saved correctly and I was able to retrieve them and creating my files without any problem. The database configuration for our web application contained the value 'host' = 'localhost' in the config/database.php file. Now the problem is that we can not use a DB on a different server than localhost from the moment we can not specify any values for 'host' key in database configuration. Did anyone of you encounter the same issue? How did you manage it? Greetings, Marco --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Layouts and Elements
Hi Just thinking how i can organise my layouts and elements. If i have some specific functions e.g. a comments form which can only be completed by the post owner, how should i place this in the post view? Should i create a separate layout or create an element and have a conditional statement. I shouldn't add conditional statements to the view right? So the only thing i can think of is creating a variable using set in the controller function and adding the relevant element name which i'm sure is the wrong way to go. Any help would be appreciated. R --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: My first CakePHP website launched
Brendon, thanks a lot for the heads up! This has been fixed now. I haven't given ie6 any special care though. So you won't get the full design experience in it. Davy On Mar 17, 5:09 pm, Brendon Kozlowski brendon...@hotmail.com wrote: Davy, for some reason IE (version 6 anyway, not sure about 7) won't allow me to click in the text boxes (inputs) of the contact form. I can click on the labels to get focus, and I can use the keyboard to FORCE focus (and then I can click on the text within the inputs after typing, after focus), and I can click on the left-most border of the input to get focus...but I cannot click in the open space of the text inputs (or the textarea). I'm guessing it's a CSS thing, but I can't say for sure. Thought you might want to know. :) On Mar 16, 1:35 pm, Davy davyvandenbr...@gmail.com wrote: Thanks Robin, this is fixed now! On Mar 16, 6:30 pm, MrSensitive robin...@telenet.be wrote: Hi Davy, nice site, Robin here.. Thank You for your help on the UltraGenda Webserver ;) in your portfolio, the link on Davy Van Den Bremt (v2) points towww.bartschepens.be which is probably a typo..- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Cake bake and views.
I'm new to cakephp and just trying to get a basic site going using scaffolding and bake from a completely fresh install of cakephp. It works ok--as in the scaffolds do what they should do--but when I go to make a change in any of the views, that change never appears on the pages. I can even remove/rename the views folder and it makes absolutely no difference, as if cake isn't using that folder for anything. The page loads just like always. I guess it's caching somewhere, though I cannot figure out where, or why caching would be on by default (the manual claims it isn't). Any help? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Self-referencing foreign key
How do I make a self-referencing association in my model and then in my add/edit actions in my controller and respective views? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
strange behavior of renderElement
Hi all! Here is my code: Controller: == ?php class NewsController extends AppController { var $name = 'News'; var $helpers = array('Html', 'Form'); function newsLeft() { $news = $this-News-findAll(); if(isset($this-params['requested'])) { return $news; } $this-set('news', $news); } } ? Element: = ?php $a = $this-requestAction('news/newsLeft'); foreach ($a as $key = $val) { echo $val['News']['short']; } //die('='); ? Problem is: if die(); commented out displays nothing else displays normal P.S. Sorry for my bad english --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
RFC 6160
Hello. Please comment on this: https://trac.cakephp.org/ticket/6160 Best regards, B. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Jake question: rewrite problem?
Hi Brendon, I appreciate your help. I am under the impression that it's not just the jake.ini configuration problem. I tried the latest cakephp version and it works like a charm. But using exactly the same configuration file, while using the script I mentioned written in an earlier version of cake 1.2, I am having the problem. So, I guess either between the two versions, there has been something leading to the problem, or it is the application-building process broke some connections. I thought that the building of the application will not break the relationship between jake and cake, since it should not touch the cake core, but I may well be wrong. But that was the reason I suspected it was the version difference. I am not trying to talk you into guiding me through the upgrading process, I am just trying to identify my problem. Is there a way I can get a cakephp 1.2.0.5427alpha version, so that I can try and see whether it is application-related or version-related? I searched online for long time and found nowhere to download such earlier version of cakephp. Do you have any resources, maybe a backup of earlier files? Again, thanks so much and have a good one! Robin On Mar 17, 12:03 pm, Brendon Kozlowski brendon...@hotmail.com wrote: Umm...what? You just went from having issues using Jake, a connector for CakePHP and Joomla, to a completely different application issue. If it is upgrade problems, I'm of the mindset that if you can't do it yourself, someone should be hired to do it for you. Anyhow, I took a look at Joomla (v1.5) and Jake (v1.0.3.38b for Joomla 1.5), running CakePHP v1.2.0.7962 (as it was the latest I happened to have, already downloaded). The primary step that Jake ignores, is that it *assumes* your CakePHP application is ALREADY installed, configured, and running. The configuration of Jake is then to simply point to where you have it installed. I misunderstood how Jake integrated Joomla and CakePHP. You install Joomla on its own. You also install CakePHP on its own. My (test) directory structure was as follows: - htdocs/ --- joomla/ -- joomla related files... --- cake/ - app/ --- webroot/ - cake/ - vendors/ After following the instructions on Jake's site, after importing the Jake ZIP archive and reading that I needed to configure the jake.ini file, I came to realize it expected the app to have already been baked, and all it was asking for was the full (or relative) path to the CakePHP application. As for Magnik.com's application, I'm not familiar with that, nor do I really want to be. Hopefully you can get that working on your own. Supposedly it uses a version of Cake v1.2, so the routing and htaccess rules should be the same, so it seems the Jake configuration is (hopefully) simply the problem here. On Mar 16, 5:21 pm, Robin madsa...@gmail.com wrote: Thanks Brendon. Definitely appreciate your help. Maybe you can use the exact cake application I am using so that to reproduce what I am seeing right now. Here is the link:http://www.magnik.com/api/files/magnik%201.2.4.zip. It is a amazon script written in cakephp. I do think the version matters since I can use the latest version of cake with no problem, although I don't have the capability to upgrade that application to latest cake. Thanks again! On Mar 16, 10:19 am, Brendon Kozlowski brendon...@hotmail.com wrote: Whoops, Smelly Eddie is right. I think below as being outside the document root, not within. I'm back from my trip, I'll see if I can install Joomla withJakesupport on a test server later tonight to see what the issue is. On Mar 15, 1:23 pm, Robin madsa...@gmail.com wrote: I realized that this might be a completely different problem. Since the mainframe of joomla wasn't displayed after I calledjakecomponent with index.php?option=com_jake. It might be a problem thatjakecalls joomla files, including css files. If that's the case, it is the handling of joomla url be wrong. Since the cake\app path is defined relative to joomla folder, the path will be wrong as well. But I still cannot locate howjakecould mess up with the joomla url writing. Anyone please? On Mar 14, 1:18 pm, Robin madsa...@gmail.com wrote: Thanks Smelly. Actually, I did try both, and they gave me the same result. The way I avoided the mixing of index.php page is that I renamed index.php in cakephp to cakephp.php, and call that page injakecomponent. But still exactly the same symptom. I actually tried a few other ways, like put joomla files in a folder named joomla and put it under webroot rather than directly copying joomla files to webroot, etc. They all give the same error and symptom. One thing I almost forgot and I guess is important: I suppose any cakephp link originally in my cake application should be rewrite to a joomla component link, right? So, in my original
Re: Cake bake and views.
Maybe ur using scaffold go to controller see if put function index () { } Sent from my iPod On Mar 17, 2009, at 9:39 AM, locust locustmoti...@gmail.com wrote: I'm new to cakephp and just trying to get a basic site going using scaffolding and bake from a completely fresh install of cakephp. It works ok--as in the scaffolds do what they should do--but when I go to make a change in any of the views, that change never appears on the pages. I can even remove/rename the views folder and it makes absolutely no difference, as if cake isn't using that folder for anything. The page loads just like always. I guess it's caching somewhere, though I cannot figure out where, or why caching would be on by default (the manual claims it isn't). Any help? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cake bake and views.
http://book.cakephp.org/view/105/Scaffolding ..so Scaffolding or Controller/Action + View =) On 17 мар, 19:39, locust locustmoti...@gmail.com wrote: I'm new to cakephp and just trying to get a basic site going using scaffolding and bake from a completely fresh install of cakephp. It works ok--as in the scaffolds do what they should do--but when I go to make a change in any of the views, that change never appears on the pages. I can even remove/rename the views folder and it makes absolutely no difference, as if cake isn't using that folder for anything. The page loads just like always. I guess it's caching somewhere, though I cannot figure out where, or why caching would be on by default (the manual claims it isn't). Any help? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cake bake and views.
oh my bad i forgot to say ur useing the scaffold not the actual views run the console bake the controller when u say cake bake press c choese ur controller form the list when it say would you like to build your controller interactively ? say no and then it will say would you like to include some basics methods (index() add() view() say yes admin routhing is option the it will bake the controller whith functions the u have to run bake agian to bake the views locust wrote: I'm new to cakephp and just trying to get a basic site going using scaffolding and bake from a completely fresh install of cakephp. It works ok--as in the scaffolds do what they should do--but when I go to make a change in any of the views, that change never appears on the pages. I can even remove/rename the views folder and it makes absolutely no difference, as if cake isn't using that folder for anything. The page loads just like always. I guess it's caching somewhere, though I cannot figure out where, or why caching would be on by default (the manual claims it isn't). Any help? -- View this message in context: http://n2.nabble.com/Cake-bake-and-views.-tp2492759p2492847.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: RFC 6160
You go first. Please provide some context instead of just dumping a link. On Tue, Mar 17, 2009 at 1:46 PM, Braulio brau...@solsoft.co.cr wrote: Hello. Please comment on this: https://trac.cakephp.org/ticket/6160 Best regards, B. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Keeping session alive when loading images from database
Cake version: 1.1 CAKE_SECURITY level: high Hello everyone. I hope this question is not too complicated. I've been struggling with an issue for a couple of days. I have an image upload script that uploads images to a MySQL database, storing it as a BLOB, also creating a thumbnail for the image when it does this. I developed this with the help of the following sites: 1. http://cakebaker.42dh.com/2006/04/15/file-upload-with-cakephp/ 2. http://www.phpro.org/tutorials/Storing-Images-in-MySQL-with-PHP.html#1 Downloading an image works fine (using Content-Disposition header) but when trying to load more than one thumbnail in a view, my Cake session is destroyed and the user is automatically logged out when they attempt to load another page. I don't have this problem when the Cake security level is set to MEDIUM, but I'm trying to keep it working with a security level of HIGH. Here is my controller: = // this is for image uploading. function add() { // Read person from ID from session variable $lastPerson = $this-Session-read('lastPersonId'); // is_uploaded_file is used for security. // getimagesize is to verify the user uploads an image file type, also for security. if (!empty($this-params['form']) is_uploaded_file($this- params['form']['ImageUpload']['tmp_name']) getimagesize($this-params['form']['ImageUpload'] ['tmp_name']) != false) { $fileData = fread(fopen($this-params['form']['ImageUpload'] ['tmp_name'], r), $this-params['form'] ['ImageUpload']['size']); // get the thumb image info. $thumb = getimagesize($this-params['form']['ImageUpload'] ['tmp_name']); // assign thumb variables. $image_type = $thumb['mime']; $imgfp = fread(fopen($this-params['form']['ImageUpload'] ['tmp_name'], 'rb'), $this-params['form']['ImageUpload']['size']); $image_width = $thumb[0]; $image_height = $thumb[1]; $image_size = $thumb[3]; // create a second variable for the thumbnail. $thumb_data = file_get_contents($this-params['form'] ['ImageUpload']['tmp_name']); // get the aspect ratio for the thumbnail (height / width). $aspectRatio=(float)($thumb[0] / $thumb[1]); // thumbnail height. $thumb_height = 100; // the thumb width is the thumb height/aspect ratio. $thumb_width = $thumb_height * $aspectRatio; // get the image source, apply to variable $src. $src = imagecreatefromstring($thumb_data); // create the destination image. $destImage = ImageCreateTrueColor($thumb_width, $thumb_height); // copy and resize the $src image to the destination image. ImageCopyResampled($destImage, $src, 0,0,0,0, $thumb_width, $thumb_height, $thumb[0], $thumb[1]); // start output buffering. ob_start(); // export the image. imageJPEG($destImage); // stick the image content in the variable $image_thumb $image_thumb = ob_get_contents(); // clean up the output buffer and turn off the output buffering. ob_end_clean(); $this-params['form']['ImageUpload']['thumb'] = $image_thumb; // $size = size of the image file. Set a maximum size. $size = $this-params['form']['ImageUpload']['size']; // 200 = 2MB. $maxsize = 200; // is the image less than this max value? If so, continue with the save. if($size $maxsize) { $this-params['form']['ImageUpload']['data'] = $fileData; // insert the user's ID into the file upload table so we know who it belongs to. $this-params['form']['ImageUpload']['person_id'] = $lastPerson; $this-ImageUpload-save($this-params['form'] ['ImageUpload']); // save successful, so let's confirm the upload and redirect the user. $this-Session-setFlash('Upload successful.'); $this-redirect('tongue_uploads/add'); } else { // if the image is too big, show this error. $this-Session-setFlash('The file was too big.'); } } elseif (!empty($this-params['form']) getimagesize($this- params['form']['ImageUpload']['tmp_name']) == false) { // if the file is not an image type, show this error. $this-Session-setFlash('Please upload the correct file type.'); } $conditions =
Re: Display a blob in a view
I agree with Brian. Using exit is bad style (if you care) disabling rendering is nicer and lets Cake clean up after the controller has run. Your code looks ok. It should display (or force-download) a file for you. If you see crap, or nothing at all, than check that $type really is a mime-type and that the binary data really is an image. The first can of-course be checked by just debugging out the variable to see if it really reads image/jpg and just just jpg or something like that. The last part can be done by reading it and dumping the data to a file and checking it. One thing I have noticed is that sometimes you can help the browser along by setting the src to /path/to/image/12/filename.jpg or something like it. Saying that is is a jpeg in the filename is good when the header has no filename specified. (you only set content type) You might try: header(Content-Transfer-Encoding: binary) or any number of good file-transfer headers. /Martin On Mar 17, 5:00 pm, brian bally.z...@gmail.com wrote: On Tue, Mar 17, 2009 at 2:04 AM, Rufus rufusp...@gmail.com wrote: Hi, I have going through all the discussions looking for an easy way to show a blob in a view. I have got to what I think is the most simple way of doing it. Controller: function display($id) { Configure::write('debug', 0); $file = $this-Image-findById($id); $type = $file['Image']['type']; $data = base64_decode($file['Image']['image']); header(Content-type: $type); echo $data; exit(); } View: echo 'img src=/images/display/'.$image['Image']['id'].' title='. $image['Image']['name'].' alt='.$image['Image']['name'].' /'; All I get in FF is the alt tag and in IE I get the gobligook. It looks like you need to set $autoRender $autoLayout = false --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: RSS with html tags using RssHelper?
Thanks Matt, That tells me that my problem might be that FF needs some more headers to understand that my dynamically generated images really are images. They work fine for html viewing but in the feed the same url is used but no images. /Martin On Mar 17, 3:47 pm, Matt Curry m...@mcurry.net wrote: Hey Martin, I don't do anything special for this. Just assign the HTML to the description. I don't escape it or wrap it as cdata...cake handles the escaping automatically. If it helps here's one of my feeds generated w/ the RssHelper that has html/images and looks good in FF:http://rsstalker.com/feed/amazon/25percent -Matthttp://www.pseudocoder.com On Mar 17, 5:14 am, Martin Westin martin.westin...@gmail.com wrote: I am trying to put together a feed containing images in the description of each item along with some p tags and other simple html. Just entering the html into the description will work for Safari and NetNewsWire but I can't figure out how to get Firefox to get it (I haven't looked at IE or any other reader yet). I can't get CDATA in there correctly since it will be escaped along with the rest of the tags. Anyone know how to get past this seemingly simple problem? I have been at it for a while now and I am running out of ideas. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Keeping session alive when loading images from database
From core.php CakePHP session IDs are also regenerated between requests if 'Security.level' is set to 'high'. That's expected behavior. Setting it to medium is what I've done in my app since I make heavy use of concurrent ajax calls. Regards, Alfredo On Tue, Mar 17, 2009 at 2:03 PM, Daffy jon.bennet...@gmail.com wrote: Cake version: 1.1 CAKE_SECURITY level: high Hello everyone. I hope this question is not too complicated. I've been struggling with an issue for a couple of days. I have an image upload script that uploads images to a MySQL database, storing it as a BLOB, also creating a thumbnail for the image when it does this. I developed this with the help of the following sites: 1. http://cakebaker.42dh.com/2006/04/15/file-upload-with-cakephp/ 2. http://www.phpro.org/tutorials/Storing-Images-in-MySQL-with-PHP.html#1 Downloading an image works fine (using Content-Disposition header) but when trying to load more than one thumbnail in a view, my Cake session is destroyed and the user is automatically logged out when they attempt to load another page. I don't have this problem when the Cake security level is set to MEDIUM, but I'm trying to keep it working with a security level of HIGH. Here is my controller: = // this is for image uploading. function add() { // Read person from ID from session variable $lastPerson = $this-Session-read('lastPersonId'); // is_uploaded_file is used for security. // getimagesize is to verify the user uploads an image file type, also for security. if (!empty($this-params['form']) is_uploaded_file($this- params['form']['ImageUpload']['tmp_name']) getimagesize($this-params['form']['ImageUpload'] ['tmp_name']) != false) { $fileData = fread(fopen($this-params['form']['ImageUpload'] ['tmp_name'], r), $this-params['form'] ['ImageUpload']['size']); // get the thumb image info. $thumb = getimagesize($this-params['form']['ImageUpload'] ['tmp_name']); // assign thumb variables. $image_type = $thumb['mime']; $imgfp = fread(fopen($this-params['form']['ImageUpload'] ['tmp_name'], 'rb'), $this-params['form']['ImageUpload']['size']); $image_width = $thumb[0]; $image_height = $thumb[1]; $image_size = $thumb[3]; // create a second variable for the thumbnail. $thumb_data = file_get_contents($this-params['form'] ['ImageUpload']['tmp_name']); // get the aspect ratio for the thumbnail (height / width). $aspectRatio=(float)($thumb[0] / $thumb[1]); // thumbnail height. $thumb_height = 100; // the thumb width is the thumb height/aspect ratio. $thumb_width = $thumb_height * $aspectRatio; // get the image source, apply to variable $src. $src = imagecreatefromstring($thumb_data); // create the destination image. $destImage = ImageCreateTrueColor($thumb_width, $thumb_height); // copy and resize the $src image to the destination image. ImageCopyResampled($destImage, $src, 0,0,0,0, $thumb_width, $thumb_height, $thumb[0], $thumb[1]); // start output buffering. ob_start(); // export the image. imageJPEG($destImage); // stick the image content in the variable $image_thumb $image_thumb = ob_get_contents(); // clean up the output buffer and turn off the output buffering. ob_end_clean(); $this-params['form']['ImageUpload']['thumb'] = $image_thumb; // $size = size of the image file. Set a maximum size. $size = $this-params['form']['ImageUpload']['size']; // 200 = 2MB. $maxsize = 200; // is the image less than this max value? If so, continue with the save. if($size $maxsize) { $this-params['form']['ImageUpload']['data'] = $fileData; // insert the user's ID into the file upload table so we know who it belongs to. $this-params['form']['ImageUpload']['person_id'] = $lastPerson; $this-ImageUpload-save($this-params['form'] ['ImageUpload']); // save successful, so let's confirm the upload and redirect the user. $this-Session-setFlash('Upload successful.'); $this-redirect('tongue_uploads/add'); } else { // if the image is too big, show this error. $this-Session-setFlash('The file was too big.');
Re: Display a blob in a view
Our ways are similar. What is the base64_decode for? This is how I do it. Controller: function display($id) { Configure::write('debug', 0); $file = $this-ImageUpload-findById($id); echo $file['ImageUpload']['thumb']; header('Content-type: ' . $file['ImageUpload']['type']); exit(); } View: img src=/image_uploads/display/?php echo $ImageUpload['ImageUpload'] ['id']; ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: RFC 6160
On Mar 17, 6:46 pm, Braulio brau...@solsoft.co.cr wrote: Hello. Please comment on this:https://trac.cakephp.org/ticket/6160 Best regards, B. I have a comment: what kind of lame idea is it to put spaces in field names --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Keeping session alive when loading images from database
Thanks for your swift response. I'm still relatively new to Cake so this might be a stupid question, but, is it possible to tell CakePHP to use a medium security for one section of the web site, and high security for the rest of it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Anywhere to get Previous release of cakephp
Because I am having problems upgrading and would like to compare both the alpha version and the new version file-by-file. Unfortunately, I didn't backup my original cakephp 1.2 alpha. Could anybody help? Thanks! On Mar 10, 7:24 pm, mscdex msc...@gmail.com wrote: On Mar 10, 2:24 pm, Robin madsa...@gmail.com wrote: Is there anyway I can download a 1.2 alphaversionof the cake? I am trying to upgrade my previous-built 1.2-alpha application to the new build, somehow lost my backup. Anyone knows where I can download the earlierversions? Thanks a lot! Why are you wanting the alpha If you are upgrading to the latest stable? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Keeping session alive when loading images from database
Ummm, not that I know of. Regards, Alfredo On Tue, Mar 17, 2009 at 2:38 PM, Daffy jon.bennet...@gmail.com wrote: Thanks for your swift response. I'm still relatively new to Cake so this might be a stupid question, but, is it possible to tell CakePHP to use a medium security for one section of the web site, and high security for the rest of it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Edit only your entry
Can someone point me in the direction on how I would check if a logged in user could access specific actions in a controller. I am using ACL and AUTH (ACL has 3 groups admin, managers, employers, ) Now when a user is created they are either a manager or employer as admin is not an option obviously Now using ACL employers can access view action and edit action for example...but i want to set it up so they only view or edit their ownsame goes for the other parts of the site in different areas. I just need some help starting on determining if the page belongs to the current logged in user, if so allow, if not deny type of thing. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Jake question: rewrite problem?
At this point, I'd suggest contacting Magnik. http://www.magnik.com/api/terms_and_conditions See if it's compatible with the current version of CakePHP. If they do any URL rewriting of their own (or custom routes) it *may* break the default setup of Jake. If that's the case, you'd then need to compare and contrast the routes. As for an older version of CakePHP, I don't know how to get access to it without using an SVN client - and since I don't use SVN, I still wouldn't know for sure if it's available via that method either. Have you tried creating a store from scratch using Magnik and a current build of CakePHP? If you can get that working, the Jake interoperability can come after. On Mar 17, 1:48 pm, Robin madsa...@gmail.com wrote: Hi Brendon, I appreciate your help. I am under the impression that it's not just the jake.ini configuration problem. I tried the latest cakephp version and it works like a charm. But using exactly the same configuration file, while using the script I mentioned written in an earlier version of cake 1.2, I am having the problem. So, I guess either between the two versions, there has been something leading to the problem, or it is the application-building process broke some connections. I thought that the building of the application will not break the relationship between jake and cake, since it should not touch the cake core, but I may well be wrong. But that was the reason I suspected it was the version difference. I am not trying to talk you into guiding me through the upgrading process, I am just trying to identify my problem. Is there a way I can get a cakephp 1.2.0.5427alpha version, so that I can try and see whether it is application-related or version-related? I searched online for long time and found nowhere to download such earlier version of cakephp. Do you have any resources, maybe a backup of earlier files? Again, thanks so much and have a good one! Robin On Mar 17, 12:03 pm, Brendon Kozlowski brendon...@hotmail.com wrote: Umm...what? You just went from having issues using Jake, a connector for CakePHP and Joomla, to a completely different application issue. If it is upgrade problems, I'm of the mindset that if you can't do it yourself, someone should be hired to do it for you. Anyhow, I took a look at Joomla (v1.5) and Jake (v1.0.3.38b for Joomla 1.5), running CakePHP v1.2.0.7962 (as it was the latest I happened to have, already downloaded). The primary step that Jake ignores, is that it *assumes* your CakePHP application is ALREADY installed, configured, and running. The configuration of Jake is then to simply point to where you have it installed. I misunderstood how Jake integrated Joomla and CakePHP. You install Joomla on its own. You also install CakePHP on its own. My (test) directory structure was as follows: - htdocs/ --- joomla/ -- joomla related files... --- cake/ - app/ --- webroot/ - cake/ - vendors/ After following the instructions on Jake's site, after importing the Jake ZIP archive and reading that I needed to configure the jake.ini file, I came to realize it expected the app to have already been baked, and all it was asking for was the full (or relative) path to the CakePHP application. As for Magnik.com's application, I'm not familiar with that, nor do I really want to be. Hopefully you can get that working on your own. Supposedly it uses a version of Cake v1.2, so the routing and htaccess rules should be the same, so it seems the Jake configuration is (hopefully) simply the problem here. On Mar 16, 5:21 pm, Robin madsa...@gmail.com wrote: Thanks Brendon. Definitely appreciate your help. Maybe you can use the exact cake application I am using so that to reproduce what I am seeing right now. Here is the link:http://www.magnik.com/api/files/magnik%201.2.4.zip. It is a amazon script written in cakephp. I do think the version matters since I can use the latest version of cake with no problem, although I don't have the capability to upgrade that application to latest cake. Thanks again! On Mar 16, 10:19 am, Brendon Kozlowski brendon...@hotmail.com wrote: Whoops, Smelly Eddie is right. I think below as being outside the document root, not within. I'm back from my trip, I'll see if I can install Joomla withJakesupport on a test server later tonight to see what the issue is. On Mar 15, 1:23 pm, Robin madsa...@gmail.com wrote: I realized that this might be a completely different problem. Since the mainframe of joomla wasn't displayed after I calledjakecomponent with index.php?option=com_jake. It might be a problem thatjakecalls joomla files, including css files. If that's the case, it is the handling of joomla url be wrong. Since the cake\app path is defined relative to joomla folder, the path will be wrong as well. But I still cannot locate
Re: Jake question: rewrite problem?
That was what I meant by upgrade in my previous posts. But I guess I should call it migrating the application to the newer version instead, if that's what you are suggesting. I would very much like to do that. But I have the most slimest idea about cakephp. I can use the scripts made by others, do some search/ modify of php to suit my needs on the very basic level. I know basic php. Would you be able to point me to the right direction as to where to start building the store on new version? I tried to use the complete new version of cake, and use the the magnik app folder to merged into the app folder, so that I have a new core (\cake), and modified \app folder, hopefully with all the files to suit the new core. But obviously, it was not easy since a lot of modifications have been made between the two versions, plus magnik app has a lot more code in it. My php level is simply not enough to manage it. Is that what you would do to create a store from scrach using magnik and a current build of cakephp? Or am I just using a completely wrong way and driving myself crazy? Your advice will be greatly appreciated! On Mar 17, 3:37 pm, Brendon Kozlowski brendon...@hotmail.com wrote: At this point, I'd suggest contacting Magnik.http://www.magnik.com/api/terms_and_conditions See if it's compatible with the current version of CakePHP. If they do any URL rewriting of their own (or custom routes) it *may* break the default setup ofJake. If that's the case, you'd then need to compare and contrast the routes. As for an older version of CakePHP, I don't know how to get access to it without using an SVN client - and since I don't use SVN, I still wouldn't know for sure if it's available via that method either. Have you tried creating a store from scratch using Magnik and a current build of CakePHP? If you can get that working, theJake interoperability can come after. On Mar 17, 1:48 pm, Robin madsa...@gmail.com wrote: Hi Brendon, I appreciate your help. I am under the impression that it's not just thejake.ini configuration problem. I tried the latest cakephp version and it works like a charm. But using exactly the same configuration file, while using the script I mentioned written in an earlier version of cake 1.2, I am having the problem. So, I guess either between the two versions, there has been something leading to the problem, or it is the application-building process broke some connections. I thought that the building of the application will not break the relationship betweenjakeand cake, since it should not touch the cake core, but I may well be wrong. But that was the reason I suspected it was the version difference. I am not trying to talk you into guiding me through the upgrading process, I am just trying to identify my problem. Is there a way I can get a cakephp 1.2.0.5427alpha version, so that I can try and see whether it is application-related or version-related? I searched online for long time and found nowhere to download such earlier version of cakephp. Do you have any resources, maybe a backup of earlier files? Again, thanks so much and have a good one! Robin On Mar 17, 12:03 pm, Brendon Kozlowski brendon...@hotmail.com wrote: Umm...what? You just went from having issues usingJake, a connector for CakePHP and Joomla, to a completely different application issue. If it is upgrade problems, I'm of the mindset that if you can't do it yourself, someone should be hired to do it for you. Anyhow, I took a look at Joomla (v1.5) andJake(v1.0.3.38b for Joomla 1.5), running CakePHP v1.2.0.7962 (as it was the latest I happened to have, already downloaded). The primary step thatJakeignores, is that it *assumes* your CakePHP application is ALREADY installed, configured, and running. The configuration ofJakeis then to simply point to where you have it installed. I misunderstood howJakeintegrated Joomla and CakePHP. You install Joomla on its own. You also install CakePHP on its own. My (test) directory structure was as follows: - htdocs/ --- joomla/ -- joomla related files... --- cake/ - app/ --- webroot/ - cake/ - vendors/ After following the instructions onJake'ssite, after importing the JakeZIP archive and reading that I needed to configure the jake.ini file, I came to realize it expected the app to have already been baked, and all it was asking for was the full (or relative) path to the CakePHP application. As for Magnik.com's application, I'm not familiar with that, nor do I really want to be. Hopefully you can get that working on your own. Supposedly it uses a version of Cake v1.2, so the routing and htaccess rules should be the same, so it seems theJakeconfiguration is (hopefully) simply the problem here. On Mar 16, 5:21 pm, Robin madsa...@gmail.com wrote: Thanks Brendon. Definitely appreciate your help. Maybe you
Re: Jake question: rewrite problem?
By the way, unfortunately, Magnik is not providing support. That's why I am seeking help from you guys. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
action parameters lost after data validation
Hi, I am fairly new to cake and I'm making some fixes for a client on a CMS tool someone developed for them using cake. I am trying to add a custom validation rule on one of the forms but if it fails the ID parameter in the URL is being lost and the edit fails to update. Do I have to explicitly pass the ID back along? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Find the page owner
function view($user_id) { $user = $this-User-findById($user_id); // viewing profile if ($user['User']['id'] == $this-Auth-user('id')) { // your own profile } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Little performance trick on cake 1.1.x
Today I was playing with xdebug profiler and found probably not necessary bit of code which have been taking quite a lot of whole script execution time. The thing is in Model::setSource (files /cake/lib/model/model_php5.php: 523 and model_php4.php:529) [cake 1.1.16.5421 - I know that's little bit old, but development started quite a time ago ;)] This part of code is for checking if there is any table for specific model: if (is_array($sources) !in_array(low($prefix . $tableName), array_map('low', $sources))) { But there is some unnecessary protection against bad table names I suppose. If one is bear to the Cake conventions - that protection is not needed. I changed this line to: if (is_array($sources) !in_array($prefix . $tableName, $sources)) { I've got little better performance, because I had almost 50 model constructions, and 150 tables, so array_map did almost 750 strtolower () on one site refresh. But this is some serious project and I need confirmation from Cake devels if this line was doing what I think it was doing or not? TIA, Greg --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Validation - file empty
So I was taking a look at the validation class, and it seems the file () method has been commented out in 1.2.1.8004 Stable. Anyone know why? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Access find array by key
Hello, Model relationship: Page has many PageSnippet I have this code: [code] $page = $this-Page-find('first', array( 'conditions' = array('Page.key' = 'home'), )); [/code] It's outputting this array: [code] Array ( [Page] = Array ( [id] = 1 [key] = home ) [PageSnippet] = Array ( [0] = Array ( [id] = 2 [page_id] = 1 [key] = big_tagline_body [text] = We deal with the hassles and keep up with the changes in the timeshare industry. So you don't have to. ) [1] = Array ( [id] = 1 [page_id] = 1 [key] = big_tagline_head [text] = Finally!... You can simply take your family on vacation! ) ) ) [/code] But I want to access a page snippet using something like this in the view: [code] ?=$page['PageSnippet'][$page_snippet_key]? [/code] So I need an array that looks like this: [code] Array ( [Page] = Array ( [id] = 1 [key] = home ) [PageSnippet] = Array ( [big_tagline_body] = Array ( [id] = 2 [page_id] = 1 [key] = big_tagline_body [text] = We deal with the hassles and keep up with the changes in the timeshare industry. So you don't have to. ) [big_tagline_head] = Array ( [id] = 1 [page_id] = 1 [key] = big_tagline_head [text] = Finally!... You can simply take your family on vacation! ) ) ) [/code] Is this possible? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: changing $useDbConfig 'on-the-fly' ?
Gwoo's response is just what you need to set the dbconfig from a controller based on params. If you just mean based on the URL (dev vs prod) then I would like to add the following resource. http://edwardawebb.com/programming/php-programming/cakephp/automatically-choose-database-connections-cakephp On Mar 16, 6:25 pm, Gwoo gwoo.cake...@gmail.com wrote: http://api.cakephp.org/class/model#method-ModelsetDataSource --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Self-referencing foreign key
For a self-reference do something like: class MyModel extends AppModel { ... var $belongsTo = array('SelfReferenceName' = array('className' = 'MyModel', 'foreignKey' = 'self_reference_fields_id', ...)); ... } On 17 mar, 12:00, Miguel miguelarc...@gmail.com wrote: How do I make a self-referencing association in my model and then in my add/edit actions in my controller and respective views? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Edit only your entry
Hey, try this: debug($this-Auth-user()); die; it will print out everything about the current user, so I am pretty sure you will find out how to adjust your application. Cheers, Faifas On Tue, Mar 17, 2009 at 21:42, Dave d...@widepixels.com wrote: Can someone point me in the direction on how I would check if a logged in user could access specific actions in a controller. I am using ACL and AUTH (ACL has 3 groups admin, managers, employers, ) Now when a user is created they are either a manager or employer as admin is not an option obviously Now using ACL employers can access view action and edit action for example...but i want to set it up so they only view or edit their ownsame goes for the other parts of the site in different areas. I just need some help starting on determining if the page belongs to the current logged in user, if so allow, if not deny type of thing. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Keeping session alive when loading images from database
Hey, Why not trying this: Configure::write('security', 'medium')? I believe it would work. Best wishes, Faifas On Tue, Mar 17, 2009 at 20:52, Alfredo Quiroga-Villamil laww...@gmail.comwrote: Ummm, not that I know of. Regards, Alfredo On Tue, Mar 17, 2009 at 2:38 PM, Daffy jon.bennet...@gmail.com wrote: Thanks for your swift response. I'm still relatively new to Cake so this might be a stupid question, but, is it possible to tell CakePHP to use a medium security for one section of the web site, and high security for the rest of it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Why Rendering CORE\cake\libs\view\elements\dump.ctp 6.635090 (debugkit timer result)?
I want get the invoke trace for dump.ctp. As you can see it wast 6.635090 seconds. Any one can give me something suggestion about this file? What's the usage of this file? On Wed, Mar 18, 2009 at 12:15 AM, brian bally.z...@gmail.com wrote: Why are you printing debug info at the same time as profiling your application? Unless you plan on leaving the dump in there for the public to see, do one or the other. On Tue, Mar 17, 2009 at 10:30 AM, joshua josh...@gmail.com wrote: I try to print the debug trace in file dump.ctp. But there is nothing output. I am sure the cache has been deleted. On Tue, Mar 17, 2009 at 7:14 PM, joshua josh...@gmail.com wrote: Below is my debugkit result of one page in my application. Timers Total Request Time: 9.850548 (seconds) Message time in seconds Component initialization and startup 0.181480 Controller Action 0.062440 Render Controller Action 6.819140 Rendering View 6.816620 Rendering APP\views\users\activity_management.ctp 0.109310 Rendering APP\views\elements\active_search_box.ctp 0.001040 Rendering APP\views\elements\tab_header.ctp 0.001030 Rendering APP\views\elements\pagination.ctp 0.003490 Rendering CORE\cake\libs\view\elements\dump.ctp 6.635090 Rendering APP\views\layouts\default.ctp 0.065750 Any body can me some optimize suggestions about this? Appreciate for your help or reply! Joshua -- Thanks Joshua -- Thanks Joshua --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Blob image display problem solved
Hi, I was trying to get an image to display using the following: function display($id) { Configure::write('debug', 0); $file = $this-Image-findById($id); $data = $file['Image']['image']; $type = $file['Image']['type'] header(Content-type: .$type); echo $data; } obviously (but not to me) you cant set the variable off the array value or something? - i r noob This fixed it: function display($id) { Configure::write('debug', 0); $file = $this-Image-findById($id); header(Content-type: .$file['Image']['type']); echo $file['Image']['image']; } Anyway echo out the array value and it worked perfectly. Hope this helps somebody else. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Display a blob in a view
Yes Daffy you have the ticket. It seems you cant set a variable off the array like i tried to do: this is bad: $type = $file['ImageUpload']['type']; header('Content-type: ' . $type); this is good: $type = $file['ImageUpload']['type']; here is a follow-up post: http://groups.google.com/group/cake-php/browse_thread/thread/d9fe1b765325667e?hl=en# On Mar 18, 5:36 am, Daffy jon.bennet...@gmail.com wrote: Our ways are similar. What is the base64_decode for? This is how I do it. Controller: function display($id) { Configure::write('debug', 0); $file = $this-ImageUpload-findById($id); echo $file['ImageUpload']['thumb']; header('Content-type: ' . $file['ImageUpload']['type']); exit(); } View: img src=/image_uploads/display/?php echo $ImageUpload['ImageUpload'] ['id']; ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cakeapp.com
Oh my. This is a wonderful tool - thank you so much for the effort you've put into creating it. I'd love to see it available as a plugin for CakePHP ... this would allow the output to be straightforwardly integrated into a site. I don't mind the unzipping and uploading, but it would be easier. Thank you again, and do continue the wonderful work. ::Leigh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 'cake bake' having mysql connection problem with MAMP
I have a similar problem cake baking with WAMP. In my situation the warnings in bearlee's message were caused by the password encryption change that happened in MySQL 4.1.1, and they were easily overcome. Now I just have the one issue: Error: Your database does not have any tables. Because it's all my ISP provides, I'm using older versions of PHP and MySQL. Still, CakePHP seems quite happy. The default page tells me it can connect to my database. Everything else is sweet ... but still cake bake insists I have no tables in the database (there are several). Any thoughts on how to address this would be appreciated. It's really putting a damper on my migration to CakePHP. ::Leigh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: RFC 6160
I second AD7six!! On Tue, Mar 17, 2009 at 8:37 PM, AD7six andydawso...@gmail.com wrote: On Mar 17, 6:46 pm, Braulio brau...@solsoft.co.cr wrote: Hello. Please comment on this:https://trac.cakephp.org/ticket/6160 Best regards, B. I have a comment: what kind of lame idea is it to put spaces in field names -- http://phpirate.net --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Why Rendering CORE\cake\libs\view\elements\dump.ctp 6.635090 (debugkit timer result)?
It's the layout for a controller dump. It's only used when debug = 3, which is the last thing you want if you're profiling your app. On Tue, Mar 17, 2009 at 8:08 PM, joshua josh...@gmail.com wrote: I want get the invoke trace for dump.ctp. As you can see it wast 6.635090 seconds. Any one can give me something suggestion about this file? What's the usage of this file? On Wed, Mar 18, 2009 at 12:15 AM, brian bally.z...@gmail.com wrote: Why are you printing debug info at the same time as profiling your application? Unless you plan on leaving the dump in there for the public to see, do one or the other. On Tue, Mar 17, 2009 at 10:30 AM, joshua josh...@gmail.com wrote: I try to print the debug trace in file dump.ctp. But there is nothing output. I am sure the cache has been deleted. On Tue, Mar 17, 2009 at 7:14 PM, joshua josh...@gmail.com wrote: Below is my debugkit result of one page in my application. Timers Total Request Time: 9.850548 (seconds) Message time in seconds Component initialization and startup 0.181480 Controller Action 0.062440 Render Controller Action 6.819140 Rendering View 6.816620 Rendering APP\views\users\activity_management.ctp 0.109310 Rendering APP\views\elements\active_search_box.ctp 0.001040 Rendering APP\views\elements\tab_header.ctp 0.001030 Rendering APP\views\elements\pagination.ctp 0.003490 Rendering CORE\cake\libs\view\elements\dump.ctp 6.635090 Rendering APP\views\layouts\default.ctp 0.065750 Any body can me some optimize suggestions about this? Appreciate for your help or reply! Joshua -- Thanks Joshua -- Thanks Joshua --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Layouts and Elements
If you set a var in the controller you'd still need to test in the view whether or not to include the element, so it wouldn't be much different than checking the User.id from session. I suppose you could also create 2 views and call render() on the appropriate one from the controller. Not very DRY, though. Unless both views just included elements--one with, and one without the comments stuff and both including a Post display element. On Tue, Mar 17, 2009 at 1:01 PM, ross.hagg...@googlemail.com ross.hagg...@googlemail.com wrote: Hi Just thinking how i can organise my layouts and elements. If i have some specific functions e.g. a comments form which can only be completed by the post owner, how should i place this in the post view? Should i create a separate layout or create an element and have a conditional statement. I shouldn't add conditional statements to the view right? So the only thing i can think of is creating a variable using set in the controller function and adding the relevant element name which i'm sure is the wrong way to go. Any help would be appreciated. R --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: strange behavior of renderElement
On Tue, Mar 17, 2009 at 12:41 PM, furionn furi...@gmail.com wrote: Element: = ?php $a = $this-requestAction('news/newsLeft'); foreach ($a as $key = $val) { echo $val['News']['short']; } //die('='); ? Problem is: if die(); commented out displays nothing else displays normal That's because elements are parsed, then included into the view which, in turn, is rolled into the layout. When die() is encountered, processing stops before the view has been completed for display. Think of it like a recipe: the layout is the serving plate, the view is the type of pot used for cooking, the data are the ingredients, and elements are ... more ingredients. If you reach in the cupboard for an element and it tells you to stop cooking immediately, then you're not going to end up with anything on your plate. OK, that was a bit dumb but maybe it makes sense. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: action parameters lost after data validation
On Tue, Mar 17, 2009 at 4:12 PM, koala kid alexhob...@gmail.com wrote: Hi, I am fairly new to cake and I'm making some fixes for a client on a CMS tool someone developed for them using cake. I am trying to add a custom validation rule on one of the forms but if it fails the ID parameter in the URL is being lost and the edit fails to update. Do I have to explicitly pass the ID back along? I doubt that validation has anything directly to do with it. I'm guessing your action/method has an $id as a parameter and the form action does not include it. If you're using $form-create() can you post that? Also the method itself. It's possible that it's being set the first time around but, when validation fails and the form is re-displayed, the ID var isn't set again. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Access find array by key
Looks like a job for the Set class. Have a look through its methods (note that not all of them are represented here so check the API, too). http://book.cakephp.org/view/640/Set That's about as much as I can tell you, though. Anything I suggest could probably be done much simpler. On Tue, Mar 17, 2009 at 5:29 PM, mattalexx mattal...@gmail.com wrote: Hello, Model relationship: Page has many PageSnippet I have this code: [code] $page = $this-Page-find('first', array( 'conditions' = array('Page.key' = 'home'), )); [/code] It's outputting this array: [code] Array ( [Page] = Array ( [id] = 1 [key] = home ) [PageSnippet] = Array ( [0] = Array ( [id] = 2 [page_id] = 1 [key] = big_tagline_body [text] = We deal with the hassles and keep up with the changes in the timeshare industry. So you don't have to. ) [1] = Array ( [id] = 1 [page_id] = 1 [key] = big_tagline_head [text] = Finally!... You can simply take your family on vacation! ) ) ) [/code] But I want to access a page snippet using something like this in the view: [code] ?=$page['PageSnippet'][$page_snippet_key]? [/code] So I need an array that looks like this: [code] Array ( [Page] = Array ( [id] = 1 [key] = home ) [PageSnippet] = Array ( [big_tagline_body] = Array ( [id] = 2 [page_id] = 1 [key] = big_tagline_body [text] = We deal with the hassles and keep up with the changes in the timeshare industry. So you don't have to. ) [big_tagline_head] = Array ( [id] = 1 [page_id] = 1 [key] = big_tagline_head [text] = Finally!... You can simply take your family on vacation! ) ) ) [/code] Is this possible? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Why Rendering CORE\cake\libs\view\elements\dump.ctp 6.635090 (debugkit timer result)?
Thanks, I will double check the debug level. I remember I set it 2. Hope it is the slow reason. On Wed, Mar 18, 2009 at 8:31 AM, brian bally.z...@gmail.com wrote: It's the layout for a controller dump. It's only used when debug = 3, which is the last thing you want if you're profiling your app. On Tue, Mar 17, 2009 at 8:08 PM, joshua josh...@gmail.com wrote: I want get the invoke trace for dump.ctp. As you can see it wast 6.635090 seconds. Any one can give me something suggestion about this file? What's the usage of this file? On Wed, Mar 18, 2009 at 12:15 AM, brian bally.z...@gmail.com wrote: Why are you printing debug info at the same time as profiling your application? Unless you plan on leaving the dump in there for the public to see, do one or the other. On Tue, Mar 17, 2009 at 10:30 AM, joshua josh...@gmail.com wrote: I try to print the debug trace in file dump.ctp. But there is nothing output. I am sure the cache has been deleted. On Tue, Mar 17, 2009 at 7:14 PM, joshua josh...@gmail.com wrote: Below is my debugkit result of one page in my application. Timers Total Request Time: 9.850548 (seconds) Message time in seconds Component initialization and startup 0.181480 Controller Action 0.062440 Render Controller Action 6.819140 Rendering View 6.816620 Rendering APP\views\users\activity_management.ctp 0.109310 Rendering APP\views\elements\active_search_box.ctp 0.001040 Rendering APP\views\elements\tab_header.ctp 0.001030 Rendering APP\views\elements\pagination.ctp 0.003490 Rendering CORE\cake\libs\view\elements\dump.ctp 6.635090 Rendering APP\views\layouts\default.ctp 0.065750 Any body can me some optimize suggestions about this? Appreciate for your help or reply! Joshua -- Thanks Joshua -- Thanks Joshua -- Thanks Joshua --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Testing: Fixtures on related tables
Hi! I want to use fixtures for my tests, I have a Model User which hasAndBelongToMany Languages So I created the fixtures: user_fixture.php languages_user_fixture.php language_fixture.php But as soon as I add following to users_controller.test.php var $fixtures = array( 'user'); or var $fixtures = array( 'user', 'language'); I get the error message: Missing Database Table Error: Database table test_suite_languages for model Language was not found. What do I have to do? thx Aurelius --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
RE: Edit only your entry
Thanks guys. Using what you sent I got it going in the right direction now. Dave _ From: Aivaras [mailto:faifas1...@gmail.com] Sent: March-17-09 9:04 PM To: cake-php@googlegroups.com Subject: Re: Edit only your entry Hey, try this: debug($this-Auth-user()); die; it will print out everything about the current user, so I am pretty sure you will find out how to adjust your application. Cheers, Faifas On Tue, Mar 17, 2009 at 21:42, Dave d...@widepixels.com wrote: Can someone point me in the direction on how I would check if a logged in user could access specific actions in a controller. I am using ACL and AUTH (ACL has 3 groups admin, managers, employers, ) Now when a user is created they are either a manager or employer as admin is not an option obviously Now using ACL employers can access view action and edit action for example...but i want to set it up so they only view or edit their ownsame goes for the other parts of the site in different areas. I just need some help starting on determining if the page belongs to the current logged in user, if so allow, if not deny type of thing. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Performance different between cakephp 1.1 and 1.2
it is just the localhost with apache, mysql, and php5, each query is just cost about 20ms, also I have greater problem when put my web into a web hosting, the loading speed is very slow , sometime it would take about 20s to load a page as I have been set the debug mode to 0 on production server and trun off the firewall server but I also still need to take about 6s to load a page. I just have no idea how would I improve the performance of the web, this problem related to the model or any others things ?? On 3月16日, 下午5時01分, Miles J mileswjohn...@gmail.com wrote: It seems all your views are loading rather quickly, how long on average do your sql queries take? Also is this a local host or online server? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Performance different between cakephp 1.1 and 1.2
I find the interface and helpers in 1.2 is really very helpful, and coding required in Cake 1.2 is less than 1.1, also improve the flexibility for me . but the performance problem make me would not move all the project to 1.2 . On 3月16日, 下午10時16分, joshua josh...@gmail.com wrote: There is the same problem in my application. It takes 8 sec to load a page. The ACL authentication sql will take 17 ms. 2009/3/16 WyriHaximus webmas...@wyrihaximus.net Just curious how did you create that report? On Mar 16, 4:49 am, namsouth namso...@gmail.com wrote: Miles, Thank for you advice, as your advice, I have been installed the debug tools, try to find out which process cause the generate time is so slow, but I just cannot identify which module cause this problem , since from the timer session time used in render the element is so little, can you give me an suggestion which part of the report I need to focus on ? really thanks for your advice. * cakePHP * Session Session o Config + userAgent + time1237714705 + rand731973688 + timeout10 o targeturlproducts_cats/showDetail/1 * Request Request Cake Params o pass + 01 o named(empty) o controllerproducts_cats o actionshowDetail o plugin(null) o form(empty) o url + urlproducts_cats/showDetail/1 o isAjax(false) $_GET o urlproducts_cats/showDetail/1 Cookie To view Cookies, add CookieComponent to Controller Current Route o 0/:controller/:action/* o 1#^(?:/([^\/]+))?(?:/([^\/]+))?(?:/(.*))?[\/]*$# o 2 + 0controller + 1action o 3 + plugin(null) + controller(null) + actionindex o 4(empty) * Sql Log Sql Logs default (default) 0 query took ms Nr Query Error Affected Num. rows Took (ms) * Timer Timers Total Request Time: 5.431110 (seconds) Message time in seconds Component initialization and startup 0.151990 Controller Action 0.252230 Render Controller Action 0.236420 Rendering View 0.133010 Rendering APP\views\products_cats\show_detail.ctp 0.129450 Rendering APP\views\elements\main_header.ctp 0.016530 Rendering APP\views\elements\navigation.ctp 0.010920 Rendering APP\views\elements\breadcrumb.ctp 0.001250 Rendering APP\views\elements\section_header.ctp 0.002200 Rendering APP\views\elements\left_col.ctp 0.001660 Rendering APP\views\elements\right_col_detail_product.ctp 0.002130 Rendering APP\views\elements\footer.ctp 0.000450 Rendering APP\views\layouts\blank.ctp 0.001770 * Log Logs error.log Time Message 2009-04-12 09:15:46 Warning: Warning (2): unlink(E:\AppServ\www \project\workspace\jkchem\app\tmp\cache\persistent \cake_core_core_paths) [function.unlink]: Permission denied in [CORE \cake\libs\file.php, line 279] 2009-04-12 09:15:46 Warning: Warning (2): unlink(E:\AppServ\www \project\workspace\jkchem\app\tmp\cache\persistent \cake_core_core_paths) [function.unlink]: Permission denied in [CORE \cake\libs\file.php, line 279] 2009-04-12 09:24:12 Warning: Warning (2): unlink(E:\AppServ\www \project\workspace\jkchem\app\tmp\cache\models \cake_model_default_jk_chem_list) [function.unlink]: Permission denied in [CORE\cake\libs\file.php, line 279] 2009-04-12 09:24:12 Warning: Warning (2): unlink(E:\AppServ\www \project\workspace\jkchem\app\tmp\cache\models \cake_model_default_jk_chem_list) [function.unlink]: Permission denied in [CORE\cake\libs\file.php, line 279] 2009-04-12 09:25:07 Warning: Warning (2): unlink(E:\AppServ\www \project\workspace\jkchem\app\tmp\cache\persistent \cake_core_core_paths) [function.unlink]: Permission denied in [CORE \cake\libs\file.php, line 279] debug.log Time Message 2009-04-12 09:25:16 Debug: Notice (8): Undefined variable: title in [APP\views\elements\breadcrumb.ctp, line 27] 2009-04-12 09:25:17 Debug: Notice (8): Undefined variable: title in [APP\views\elements\breadcrumb.ctp, line 27] 2009-04-12 09:25:17 Debug: Notice (8): Undefined variable: title in [APP\views\elements\breadcrumb.ctp, line 27] 2009-04-12 09:25:24 Debug: Notice (8): Undefined variable: title in
inputfield error?
Why doesn't that work: echo $form-input('Validate.s_address', array( 'type' = 'checkbox', 'label' = __(Other address,true), 'id' = 's_address', 'value' = 1)); It generates: div class=input checkbox input type=hidden name=data[Validate][s_address] id=s_address_ value=0 / input type=checkbox name=data[Validate][s_address] id=s_address value=1 / label for=s_addressOther address/label /div But It should generate only one inputfield! thx for tips Gaius --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Why Rendering CORE\cake\libs\view\elements\dump.ctp 6.635090 (debugkit timer result)?
On Tue, Mar 17, 2009 at 9:23 PM, joshua josh...@gmail.com wrote: Thanks, I will double check the debug level. I remember I set it 2. Hope it is the slow reason. It *is* the slow reason. Once again: don't profile your app while debugging. Set it to 0 before attempting to gauge how fast/slow your site is running. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: inputfield error?
On Tue, Mar 17, 2009 at 10:35 PM, Aurelius aurel...@temporaryinbox.com wrote: Why doesn't that work: echo $form-input('Validate.s_address', array( 'type' = 'checkbox', 'label' = __(Other address,true), 'id' = 's_address', 'value' = 1)); It generates: div class=input checkbox input type=hidden name=data[Validate][s_address] id=s_address_ value=0 / input type=checkbox name=data[Validate][s_address] id=s_address value=1 / label for=s_addressOther address/label /div But It should generate only one inputfield! Note that one of them is hidden and its name begins with an underscore. That element is created so that FormHelper can decide how to set the checkbox value if you submit and for some reason (eg. validation fails) and your form is re-displayed. FormHelper needs to know what the default value was. Or something like that. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
$ajax-observeForm()
Hi! Is it posible to get the data what/which field has changed for the condition-function? How can I work with the returned data, if I want to return them in a function? lg Aurelius --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: inputfield error?
ok, thx On 18 Mrz., 04:03, brian bally.z...@gmail.com wrote: On Tue, Mar 17, 2009 at 10:35 PM, Aurelius aurel...@temporaryinbox.com wrote: Why doesn't that work: echo $form-input('Validate.s_address', array( 'type' = 'checkbox', 'label' = __(Other address,true), 'id' = 's_address', 'value' = 1)); It generates: div class=input checkbox input type=hidden name=data[Validate][s_address] id=s_address_ value=0 / input type=checkbox name=data[Validate][s_address] id=s_address value=1 / label for=s_addressOther address/label /div But It should generate only one inputfield! Note that one of them is hidden and its name begins with an underscore. That element is created so that FormHelper can decide how to set the checkbox value if you submit and for some reason (eg. validation fails) and your form is re-displayed. FormHelper needs to know what the default value was. Or something like that. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: is $id already secure inside a function?
is it been validated in the Model, e.g. when this us called: $whatever = $this-User-read( null, $id); Is that enought so I can be sure that its an int? if( bccomp($id, intval($id), 3) != 0 ) die( __ ( We couldn't find this Shop.,true) ); thx Aurelius On 16 Mrz., 05:36, Dr. Loboto drlob...@gmail.com wrote: No one checked your $id. It is insecure. Anyone can call your action ashttp://domain.com/controller/editorhttp://domain.com/controller/edit/013 orhttp://domain.com/controller/edit/kill%20your%20app On Mar 16, 1:04 am, Aurelius aurel...@temporaryinbox.com wrote: Hi! When I have a function like function edit($id = null) { ... } is the $id already checked against hacking and can only be a integer or is it unsecure? thx Aurelius --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---