Re: Hi
The SQL debug table is removed when debug is set to 0. This is done in config/core.php On 01/01/2010, at 6:28 PM, Saran wrote: > I raise my question first: > > How to remove the query table that is below of all my page, it shows > some query and " NrQueryErrorAffectedNum. rows > Took (ms)" like > that. > I built my first blog application and i was wondering how to remove > the below table, > > I am very new to cakePHP, but I know my question is very easy. > I didn't know the correct name of it, i searched for "default remove > table query" and similars but no help. > > can you help me? > > Saran > > Check out the new CakePHP Questions site http://cakeqs.org and help > others with their CakePHP related questions. > > 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 out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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: git and cake2
Hi euromark, CakePHP 2.x is still in development, and we're not stable yet. As you can see, cloning is possible, but with all the coding changes that we're making, using the CakePHP 2.0 codebase for app building at this stage is not suggested. Its frequently merging with CakePHP 1.3 head, which means that fixes we make to enable this for PHP 5.2 strict mode break fairly frequently. Watch the repository for updates, as its being working on all the time. Also feel free to contribute. We love contributors. Cheers, Graham Weldon e. gra...@grahamweldon.com w. http://grahamweldon.com On 17/12/2009, at 10:46 AM, euromark wrote: > for some reason i liked svn a lot better.. > > i tried to download the git files of cake2.0 for testing purposes > and used the url "git://github.com/cakephp/cakephp2x.git" for it > > 762 files have been downloaded (including an example app folder) > but when i browse to .../app > i only get > "Fatal error: Class 'Cache' not found in ...\tests\cake2\cakephp2x\cake > \libs\configure.php on line 695" > > anybode some idea what happens? > > PS: i still cant find the 1.3 git rep - only the packaged version from > 2009-11-03 at cakephp.org > but it must be somewhere - 1.1 and 1.2 as well as 2.0 are there too > > thx > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > 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 out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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: Auth forgot password question
Just one small change will fix this. You're hashing the password, and sending that via email. Change this part: > Your new password: {$user['User']['password']}"; to use ['tmp_password'] instead of ['password'] since tmp_password isn't hashed. Cheers, Graham Weldon e. gra...@grahamweldon.com w. http://grahamweldon.com On 18/11/2009, at 9:41 PM, appel268576 wrote: > Hi there. > > I have made use of this very handy tutorial that helped me set up a > user authentication system within about 10 mins. > > I added an extra function which is basically the ability to allow > users to request a new password, user receives an email with the new > password, however this password is the already hashed password, NOT > WHAT I WANT. > > Do you know where I could be going wrong? > > Below is the code > > VIEW > > echo $form->create('User', array('action' => 'forgotpassword')); > echo $form->input('email', array('label' => '')); > echo $form->end('Reset Password'); > ?> > > CONTROLLER > > function forgotpassword() { > if(!empty($this->data)) { > $this->User->recursive = 0; > $user = > $this->User->findByEmail($this->data['User']['email']); > if($user) { > $user['User']['tmp_password'] = > $this->User->createTempPassword > (7); > $user['User']['password'] = > $this->Auth->password($user['User'] > ['tmp_password']); > > if($this->User->save($user, false)) { > // send a mail to finish the > registration > $this->Email->to = $this->data['User']['email']; > $this->Email->subject = 'XYZ new password'; > $this->Email->replyTo = 'nore...@xyz.com'; > $this->Email->from = 'XYZ New Password > '; > $this->Email->sendAs = 'text'; > $this->Email->charset = 'utf-8'; > $body = "Please visit > http://localhost:/xyz/users/login. > Your new password: {$user['User']['password']}"; > > if ($this->Email->send($body)) { > $this->Session->setFlash(__('Your new password > has been sent, please check your inbox', true), 'warning'); > } else { > $this->Session->setFlash(__('Failed to send the > confirmation email. Please contact the administrator at supp...@xxx', > true), 'error'); > } > $this->redirect(array('controller' => 'users', > 'action' => 'login')); > } > } else { > $this->Session->setFlash('No user was found > with the submitted > email address.'); > } > } > } > > MODEL > > function createTempPassword($len) { > $pass = ''; > $lchar = 0; > $char = 0; > for($i = 0; $i < $len; $i++) { > while($char == $lchar) { > $char = rand(48, 109); > if($char > 57) $char += 7; > if($char > 90) $char += 6; > } > $pass .= chr($char); > $lchar = $char; > } > return $pass; > } > > -- > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-...@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=. > > -- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-...@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=.
Re: addons.mozilla.org soon will leave CakePHP..
Hey all, Hearing Mozilla's announcement about their intent to move away from CakePHP as the framework for their AMO (addons.mozilla.org) site was unfortunate. For a couple of years now, Mozilla's AMO site has been one of the largest publicly known deployments of CakePHP. I'd like to respond to this announcement both as a core developer (currently co-leading the 2.0 development) as well as an open source software user, and long time CakePHP user. With regard to people having concerns about projects moving away from CakePHP and this having an impact on the frameworks future or suitability for development of private and commercial projects, I don't feel this is an issue. The development undertaken by the volunteers that comprise the CakePHP core development team is unaffected by this move by Mozilla. While mozilla used CakePHP to operate addons.mozilla.org, they were not involved in contributing to the core of CakePHP either through code contributions or financial donations. So at this stage, the only loss to CakePHP as a project is a link on the home page we'll need to remove once they make a change. Our roadmap is set out, and we have a clear plan for the future. We intend to take CakePHP to greater heights, providing as easy an upgrade path as is possible without compromising advancement. We've got two teams working on two major branches, being 1.3 and 2.0 at the moment. Both teams are working closely together to ensure that the 1.3 to 2.0 move is as easy as possible. The motivation in the development team at the moment is high, and we're all excited about what has already been accomplished in the 1.3 branch (http://code.cakephp.org/wiki/1.3/new-features and http://code.cakephp.org/wiki/1.3/migration-guide), as well as the possibilities we've opened up for speed and optimisation through PHP5 only code in CakePHP 2.0. This post is getting long enough already... One last thing I will say is that I feel that Mozilla's concerns, in my opinion, are for the most part resolved in 1.2 and further improvements are made throughout the core in 1.3. They'd certainly benefit from an upgrade to one of the more recent versions. However, it appears as though a decision has been made, and we wish the Mozilla AMO team all the best as they migrate to django. Cheers, Graham Weldon e. gra...@grahamweldon.com w. http://grahamweldon.com On 18/11/2009, at 7:25 PM, jburns wrote: > Really good response - thank you. I like Cake and see myself using it > for the long haul. I am aware that you only get out what you put in. I > want to contribute but - like a lot of other people (I guess) I am > still in the naive wide-eyed looking up to the experts stage, so am > taking more than I can give. Honestly I didn't even know (care?) that > Mozilla used it. I just don't want to adopt something that becomes far > inferior to other frameworks due to starvation or a lack or attention. > If that is not the case, then great. It makes you think, a bit, when a > large corporation like Mozilla take a strategic decision to move away > from what you have adopted. I don't want to regret my choice. It's a > good choice now, I want it to stay that way. Don't let me be the guy > wandering the streets in flares and long sideburns thinking I am still > cool! > > On Nov 18, 8:09 am, Martin Westin wrote: >> A lot of their reasoning is solid but part of it sound like classic >> 1.1 issues. They note some of it in their google spreadsheet. >> >> Reading partly between the lines it sounds like they don't like >> Simpletest, the cake shell and php4 limitations (=ORM with array- >> data). With that one has to understand that they compare Cake's >> roadmap with other frameworks and feel that they will be better served >> by a framework with, for example, object-based ORM today and not at >> some point in the future. >> >> @jburns, @Okto >> I have been building stuff with CakePHP for almost 4 years (on and >> off) and I can still recognize the worry you guys express. "Will Cake >> survive?", "Is everyone abandoning the sinking ship?" and thoughts >> like that can easily crop up when you hear things like this. Back in >> 2006 the question was wether a "rails ripoff" could survive at all... >> Cake is still here among numerous "competitors" more or less inspired >> by Rails. >> >> Just remember... The Mozilla team are not (afaik) the driving force >> behind CakePHP. They have been big users and probably quite big >> contributors. They have provided a real-world showcase and test-case >> for big deployments that have probably helped find optimization >> bottlenecks and things like that. >> >> Also, in rela
Re: invalidFields isUnique return existing id?
On 18/11/2009, at 12:07 PM, Jas wrote: > Is it possible when using isUnique Validation to return the id of the > existing field, so that it can be used instead of asking the user to > create something unique? > > -- > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-...@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=. > > Sounds like you want to edit, if the user enters in the same ID as an existing entry. This is a somewhat special case. 1) Disable your validation. At the moment its operating like an add, since there is no ID in the form submission and your isUnique is screwing things up. 2) You are going to have to do some in-controller processing to deal with the data submitted: - Check the ID supplied - if it exists, load the data, overwrite with supplied data, and save - if it didnt exist, save new record. I would be ensuring validation on the fields you need with the exception of the ID. Cheers, Graham Weldon e. gra...@grahamweldon.com p. +61 407 017 293 w. http://grahamweldon.com -- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-...@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=.
CakeFest IV - America - Help us pick a location!
Hi all, The CakePHP team has been considering the location for the next upcoming CakeFest. We've decided to bring it back home to the United Sates of America. Thus far we haven't chosen a location for the event, but to ensure we reach as many people as possible, we'd like your opinion on where we should host the event. Essentially, our choices are: - USA East Coast - USA West Coast - USA Central If I have missed another location that you feel might be more popular or accessible to interested attendees, feel free to suggest it. We're keen to hear peoples thoughts on it. Cheers, Graham Weldon (AKA: Predominant) e. gra...@grahamweldon.com w. http://grahamweldon.com -- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-...@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=.
Re: thoughts on CakePHP and revision control
On starting a new project I normally do the following: Clone (or update existing) CakePHP repository. Bake a new project to a new directory. Initialize that as a new git repository. Push to remote server. Thus, rather than versioning a whole CakePHP distribution, I am only tracking changes to my app. Cheers, Graham Weldon e. gra...@grahamweldon.com p. +61 407 017 293 w. http://grahamweldon.com On 13/11/2009, at 2:11 PM, James P. Howard, II wrote: > I am about to start a new project based on CakePHP and would like to > know about others' experiences using CakePHP (or similar tools) with > version control software. > > I have a couple of options, as I see it: > > 1. I can create a new repository in my choice of software and check > in >a base install of CakePHP. > 2. I can use git to checkout CakePHP and make my project a local >branch. > > I am sure there are others, but I'd like to know the best approach > based > on the experience of others. > > Thank you, James > > -- > James P. Howard, II, MPA MBCS > j...@jameshoward.us > -- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-...@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=.
Re: CakePHP Questions - Now out of beta!
We're planning to add this to the top links on the other Cake Software Foundation websites to ensure everyone is able to reach the site. This should be happening very soon. Thanks for the positive feedback :-) Cheers, Graham Weldon e. gra...@grahamweldon.com w. http://grahamweldon.com On 12/11/2009, at 12:58 AM, Crazy wrote: > Will this site be mentioned on cakephp.org? > > Looks like the members are growing, and I really like the way it > works. > > Personally I would like that site better then the google groups. > It's not that I hate the google groups, but they're just., google > groups... > They just don't have any usability. > > Might use cakeqs.org more then these groups if enough people use it. > > > On 11 nov, 00:33, "Larry E. Masters aka PhpNut" > wrote: >> CakePHP Questionshttp://cakeqs.orghas just come out of beta testing >> and >> registration is open to all users of CakePHP. This is the first >> step in >> unifying the community applications that are currently available. >> We will >> continue to keep everyone informed over the next few weeks as more >> of the >> sites are updated and content monitoring of these sites put in the >> the hands >> of our user base. We have listened to your feedback and think you >> should >> have more control over what you find useful. >> >> CakePHP Questions is a multilingual site and if you are interested in >> helping us translate the static content of the site please contact >> us: >> cak...@cakephp.org >> >> -- >> /** >> * @author Larry E. Masters >> * @var string $userName >> * @param string $realName >> * @returns string aka PhpNut >> * @access public >> */ > > -- > > You received this message because you are subscribed to the Google > Groups "CakePHP" group. > To post to this group, send email to cake-...@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= > . > > -- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-...@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=.
Re: CakePHP Questions - Now out of beta!
Thanks for that. We're aware of the issue with some people not being sent out emails from the site. For the moment, if you can email me directly, I can sort out getting your account enabled. This is a DNS issue that we have made steps to resolve, and we should see this issue resolved very soon. Cheers, Graham Weldon e. gra...@grahamweldon.com w. http://grahamweldon.com On 12/11/2009, at 12:25 AM, keymaster wrote: > Not sure where best to post this, but ... there needs to be a "Resend > Verification Email" link on the new questions site or people whose > verification email is lost in transit are up a creek with no paddle. > > > > On Nov 11, 2:44 pm, Graham Weldon wrote: >> Cool :-) Lots of signups happening. Nice to see. >> >> Cheers, >> >> Graham Weldon >> e. gra...@grahamweldon.com >> w.http://grahamweldon.com >> >> On Nov 11, 10:33 am, "Larry E. Masters aka PhpNut" >> wrote: >> >>> CakePHP Questionshttp://cakeqs.orghasjust come out of beta testing >>> and >>> registration is open to all users of CakePHP. This is the first >>> step in >>> unifying the community applications that are currently available. >>> We will >>> continue to keep everyone informed over the next few weeks as more >>> of the >>> sites are updated and content monitoring of these sites put in the >>> the hands >>> of our user base. We have listened to your feedback and think you >>> should >>> have more control over what you find useful. >> >>> CakePHP Questions is a multilingual site and if you are interested >>> in >>> helping us translate the static content of the site please contact >>> us: >>> cak...@cakephp.org >> >>> -- >>> /** >>> * @author Larry E. Masters >>> * @var string $userName >>> * @param string $realName >>> * @returns string aka PhpNut >>> * @access public >>> */ > > -- > > You received this message because you are subscribed to the Google > Groups "CakePHP" group. > To post to this group, send email to cake-...@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= > . > > -- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-...@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=.
Re: CakePHP Questions - Now out of beta!
Cool :-) Lots of signups happening. Nice to see. Cheers, Graham Weldon e. gra...@grahamweldon.com w. http://grahamweldon.com On Nov 11, 10:33 am, "Larry E. Masters aka PhpNut" wrote: > CakePHP Questionshttp://cakeqs.orghas just come out of beta testing and > registration is open to all users of CakePHP. This is the first step in > unifying the community applications that are currently available. We will > continue to keep everyone informed over the next few weeks as more of the > sites are updated and content monitoring of these sites put in the the hands > of our user base. We have listened to your feedback and think you should > have more control over what you find useful. > > CakePHP Questions is a multilingual site and if you are interested in > helping us translate the static content of the site please contact us: > cak...@cakephp.org > > -- > /** > * @author Larry E. Masters > * @var string $userName > * @param string $realName > * @returns string aka PhpNut > * @access public > */ -- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-...@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=.
Re: Play Audio in PHP
Hey, I would use something like this: http://www.schillmania.com/projects/soundmanager2/ But as other have suggested, for easing your users experience, be minimal with sounds if you can. They are great for band sites.. and for audible notifications. Thats about it ;-) Cheers, Graham Weldon e. gra...@grahamweldon.com w. http://grahamweldon.com On 11/11/2009, at 3:13 PM, Pat wrote: > AFAIK - PHP doesn't actually play any media content itself. What it > can do is output the html that will inturn play media. The actual > loading and playing of the song files can be done by plugins (flash, > java applet, quicktime etc...) or even natively in the broswer with > HTML. Its probably beyond the scope of this google group so your next > best step is to google "Play sound in webpage" or something similar. > > > > > > On Nov 11, 12:10 am, Ramya Arumugam wrote: >> Hi All, >> >> Is it possible to play audio file in php? >> >> If yes, then how will we embeded it in the php file. >> >> Thanks, >> Ramya > > -- > > You received this message because you are subscribed to the Google > Groups "CakePHP" group. > To post to this group, send email to cake-...@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= > . > > -- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-...@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=.
cake-php@googlegroups.com
You might need to do: 1) URL encode your category names Or 2) refactor to allow category name slugs for URL access to avoid use of special characters Cheers Graham On 10/11/2009, at 11:56 AM, "ashok.b" wrote: > > Hi, I'm trying to pass values having an ampersand... like > http://localhost/cake/cat/TV & Music where "TV & Music" is the > category name and the /cat is actually passed to /Categories/display/ > TV & Music. > > I added the following in routes.php to achieve the above: >Router::connect('/cat/*', array('controller' => 'Categories', > 'action' => 'display')); > > For all category names without &, this works fine. But categories > having & fails. In the above example, query happens only for "TV" and > not for "TV & Music". Can some one help me with 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: Strange Error
If this fails, I'll get you to tar up your files and and them to me to check... Are you editing on a windows machine? It's possible that some line endings are being screwed up. Remove all unnecessary whitespace just to eliminate any issues there. Gentoo's latest Php is 5.2.11-p0. So I mightbe a good opportunity to upgrade also. Cheers Graham On 10/11/2009, at 11:05 AM, dtirer wrote: > > Note: Outside of Cake, this server has no problem deal with OOP and > classes > > On Nov 9, 6:53 pm, dtirer wrote: >> So I've been toying with Cake apps on my local server for a little >> while now. Now, Im working with developing one on live server. The >> install/setup went fine. >> >> As a test, I create a simple table called 'cases' with just an 'id' >> field in it (primary key, auto_increment) >> >> I then created a cases_controller.php file and put it in the >> Controllers folder. The content of that file is: >> >> > >> class CasesController extends AppController >> { >> >> } >> >> ?> >> >> I then created a case.php file and put it in the Models folder. The >> content of that file is: >> >> > >> class Case extends AppModel >> { >> >> } >> >> ?> >> >> When I try to navigate to the /cases controller in the browser, I get >> the following error: >> >> Parse error: syntax error, unexpected T_CASE, expecting T_STRING in / >> data/www/safepassagenm.com/htdocs/admin/app/models/case.php on line 3 >> >> There is no problem on line 3 of the case.php file that i can see. >> This same system works fine locally on my machine. >> >> The live server is running PHP Version 5.2.10-pl0-gentoo >> >> Any 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: can a custom validation function return an error message or just true/false?
Rather than trying to return an error message from your validation functions, split up your validation into smaller single purpose validations. Each smaller validation method can be assigned a message to report on failure. $validate = array( 'field_name' => array( 'length' => array( 'rule' => 'vLength', 'message' => 'Length does not meet requirements' ), 'characters' => array( 'rule' => 'vAllowedCharacters', 'message' => 'Only certain characters are allowed' ), 'something' => array( 'rule' => 'vSomethingElse', 'message' => 'Something Else is wrong.' ) ) ); function vLength($data) { /// -- implementation } function vAllowedCharacters($data) { /// -- implementation } function vSomethingElse($data) { /// -- implementation } Cheers, Graham Weldon e. gra...@grahamweldon.com p. +61 407 017 293 w. http://grahamweldon.com On 27/08/2009, at 2:08 PM, JamesF wrote: > > var $validate = array( > 'username' => array( > 'customFunction' => array('rule'=> > 'customFunction', > 'message'=>'user name error', ), > ), > ); > > function customFunction($data) { > > if($data['username'] == $someConditions) { >return true; > } > else if ($data['username'] == $someOtherConditions) { > > return false; > } > //otherwise failed > return false; > } > > instead of return false can i return the specific reason why it failed > in the form of an error message? > > > --~--~-~--~~~---~--~~ 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: How to inheirt form other controllers?
Try something like: if (!class_exists('ParentController')) { App::import('Controller', 'ParentController'); } class ChildController extends ParentController { // Imeplement controller as normal } Cheers, Graham Weldon e. gra...@grahamweldon.com p. +61 407 017 293 w. http://grahamweldon.com On 27/07/2009, at 8:22 PM, Michael Gaiser wrote: > I want to have my UserAdmin controller inherit from my User > controller instead of AppController. but it cannot seem to find it. > Is there a special way to do this in cake or can I just use and > include statment? Thanks. > > ~MJG > > > --~--~-~--~~~---~--~~ 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: modify home page
Paulos23 wrote: > Hello people, > I am having a weird issue.I build a home page,which i placed it in > pages folder.All work fine but there are 2 links appear which refer to > cakephp.I dont have any link for cakephp in my home layout,so i guess > something else affect the layout.Does any1 know what i should do to > make them disappear? > > Any help would be nice! > Hey, Ideally you would leave the links in place to provide some backlinks to CakePHP. But should you want to remove them, edit the default layout: app/views/layouts/default.ctp If the file doesnt exist, you can create one. You can copy the standard one from: cake/libs/views/layouts/default.ctp Let us know how you go, and if you need anything else. Cheers, Graham Weldon http://grahamweldon.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: grr help with cron/shell tabs
Ensure that your environment variable PATH includes the path to the php executable. Cheers, Graham Weldon http://grahamweldon.com Miles J wrote: > I found out that my CLI was PHP 4, so I changed it to PHP 5. I can run > the cron through SSH manually, but when I run through cron I now get > this error: > > TERM environment variable not set. > /home/mileswj/cake/console/cake: line 30: exec: php: not found > > > --~--~-~--~~~---~--~~ 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: How can I remove the 'app/websroot' from the link $html-->link() creates?
Sounds like you have your web server documentroot for that host set to the folder containing "app". http://book.cakephp.org/view/34/Production That link describes a production installation, and that your documentroot should be made as the "app/webroot" directory. Once this is done, your URLs will no longer be prefixed with app/webroot". Let us know how you go. Cheers, Graham maf wrote: > I'm a new cake user. I've run the blog tutorial and am not trying some > custom stuff. > > Why does $html-->link create the extraneous dirs (app/webroot/) in the > link url? > > Thanks for any help on this. > -Michael > > > > --~--~-~--~~~---~--~~ 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: CSS
Hi Dave, You can use addScript to ensure it gets added to the head block at the top of the page like so: $this->addScript($html->css('my_file')); Cheers, Graham Dave Maharaj :: WidePixels.com wrote: > Can you include CSS per view as you do js? > > I need sifr css on only 1 view. Is there a way to include it in the > specific view? > > 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: OS X cake bake woes
Create the directory. mkdir /var/mysql ln -s /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock /var/mysql/mysql.sock Note that I switched the ln command arguments around. I made a mistake before. Try that. Cheers, Graham harrzack wrote: > Hmm - I'd seen the ln trick elswhere but forgot! Gave it at try > > ln -s /var/mysql/mysql.sock /Applications/XAMPP/xamppfiles/var/mysql/ > mysql.sock > ln says: > ln: /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock: File exists > > I went to /var and there is no mysql directory there either! > WTF?? :-) > > being a bit rusty with my unix-stuff, what is ln telling me? > > On May 14, 6:53 am, Graham Weldon wrote: > >> You can always create a symlink to solve your issues. >> >> ln -s /var/mysql/mysql.sock >> /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock >> >> That will create a symlink to the location that PHP is looking for the >> MySQL socket. >> And it means you can revert to the default settings for php.ini and >> my.cnf as they were. >> >> Try that, and again, let me know how you go. >> >> Cheers, >> Graham >> >> harrzack wrote: >> >>> Graham - >>> >>> Thanks - but still no joy! :-( >>> When I cd to the app directory, do 'cake bake', the do a C for >>> Controller I still get the flood of warnings that start: >>> >>> "Warning: mysql_connect(): Can't connect to local MySQL server through >>> socket '/var/mysql/mysql.sock' " >>> >>> My undersandting is that message-stream says cake is using the OS X >>> CLI php >>> There must be yet another burried .ini/cfg file I'm missing. >>> I am using virtual host and the Apache httpd-vhosts.cnf but pretty >>> sure that has no effect on this stuff. >>> >>> php.ini is now set to: >>> ; Default socket name for local MySQL connects. If empty, uses the >>> built-in >>> ; MySQL defaults. >>> mysql.default_socket = /Applications/XAMPP/xamppfiles/var/mysql/ >>> mysql.sock >>> >>> and my.cnf.ini has: >>> >>> # The following options will be passed to all MySQL clients >>> [client] >>> #password = your_password >>> password = xyzzy >>> port = 3306 >>> socket = /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock >>> >>> On May 14, 2:35 am, Graham Weldon wrote: >>> >>>> Hey, >>>> >>>> What is your php.ini value for "mysql.default_socket" set to? >>>> This will tell PHP where your socket file is for MySQL, and help get you >>>> connected. >>>> >>>> You can check this file location by looking in your MySQL my.cnf file >>>> for the line indicating "socket = " >>>> >>>> For example, a MAMP install has the following socket definition in my.cnf >>>> socket = /Applications/MAMP/tmp/mysql/mysql.sock >>>> >>>> Hope this helps. Do let us know how you go >>>> >>>> Cheers, >>>> Graham >>>> >>>> harrzack wrote: >>>> >>>>> This is on OS X 10.4.11 with latest XAMPP install. >>>>> >>>>> Having probs getting cake bake to use the correct PHP. When I try to >>>>> bake a contoller I'm getting the famous error message(s): >>>>> >>>>> "Warning: mysql_connect(): Can't connect to local MySQL server >>>>> through socket '/var/mysql/mysql.sock' (2) in /WebDev/site.IOI/IOI/ >>>>> cake/libs/model/datasources/dbo/dbo_mysql.php on line 375" >>>>> >>>>> I've searched the web, seen most answers - it is still broke. Have set >>>>> my paths in .profile, edited php.ini to have the xampp path to php, >>>>> and still cake seems to want to use the built-in PHP which uses the >>>>> wrong socket. I've p**sed away several hours and nothing I do seems to >>>>> fix this. >>>>> >>>>> I've cd'd to the app directory, cake is showing the correct path... >>>>> there must be some other config file I need to edit to get cake to >>>>> stop using the built-in CLI PHP. >>>>> >>>>> Any new clues to this PITA issue? >>>>> > > > --~--~-~--~~~---~--~~ 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: OS X cake bake woes
You can always create a symlink to solve your issues. ln -s /var/mysql/mysql.sock /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock That will create a symlink to the location that PHP is looking for the MySQL socket. And it means you can revert to the default settings for php.ini and my.cnf as they were. Try that, and again, let me know how you go. Cheers, Graham harrzack wrote: > Graham - > > Thanks - but still no joy! :-( > When I cd to the app directory, do 'cake bake', the do a C for > Controller I still get the flood of warnings that start: > > "Warning: mysql_connect(): Can't connect to local MySQL server through > socket '/var/mysql/mysql.sock' " > > My undersandting is that message-stream says cake is using the OS X > CLI php > There must be yet another burried .ini/cfg file I'm missing. > I am using virtual host and the Apache httpd-vhosts.cnf but pretty > sure that has no effect on this stuff. > > php.ini is now set to: > ; Default socket name for local MySQL connects. If empty, uses the > built-in > ; MySQL defaults. > mysql.default_socket = /Applications/XAMPP/xamppfiles/var/mysql/ > mysql.sock > > and my.cnf.ini has: > > # The following options will be passed to all MySQL clients > [client] > #password = your_password > password = xyzzy > port = 3306 > socket= /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock > > > On May 14, 2:35 am, Graham Weldon wrote: > >> Hey, >> >> What is your php.ini value for "mysql.default_socket" set to? >> This will tell PHP where your socket file is for MySQL, and help get you >> connected. >> >> You can check this file location by looking in your MySQL my.cnf file >> for the line indicating "socket = " >> >> For example, a MAMP install has the following socket definition in my.cnf >> socket = /Applications/MAMP/tmp/mysql/mysql.sock >> >> Hope this helps. Do let us know how you go >> >> Cheers, >> Graham >> >> harrzack wrote: >> >>> This is on OS X 10.4.11 with latest XAMPP install. >>> >>> Having probs getting cake bake to use the correct PHP. When I try to >>> bake a contoller I'm getting the famous error message(s): >>> >>> "Warning: mysql_connect(): Can't connect to local MySQL server >>> through socket '/var/mysql/mysql.sock' (2) in /WebDev/site.IOI/IOI/ >>> cake/libs/model/datasources/dbo/dbo_mysql.php on line 375" >>> >>> I've searched the web, seen most answers - it is still broke. Have set >>> my paths in .profile, edited php.ini to have the xampp path to php, >>> and still cake seems to want to use the built-in PHP which uses the >>> wrong socket. I've p**sed away several hours and nothing I do seems to >>> fix this. >>> >>> I've cd'd to the app directory, cake is showing the correct path... >>> there must be some other config file I need to edit to get cake to >>> stop using the built-in CLI PHP. >>> >>> Any new clues to this PITA issue? >>> > > > --~--~-~--~~~---~--~~ 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: OS X cake bake woes
Hey, What is your php.ini value for "mysql.default_socket" set to? This will tell PHP where your socket file is for MySQL, and help get you connected. You can check this file location by looking in your MySQL my.cnf file for the line indicating "socket = " For example, a MAMP install has the following socket definition in my.cnf socket = /Applications/MAMP/tmp/mysql/mysql.sock Hope this helps. Do let us know how you go Cheers, Graham harrzack wrote: > This is on OS X 10.4.11 with latest XAMPP install. > > Having probs getting cake bake to use the correct PHP. When I try to > bake a contoller I'm getting the famous error message(s): > > "Warning: mysql_connect(): Can't connect to local MySQL server > through socket '/var/mysql/mysql.sock' (2) in /WebDev/site.IOI/IOI/ > cake/libs/model/datasources/dbo/dbo_mysql.php on line 375" > > I've searched the web, seen most answers - it is still broke. Have set > my paths in .profile, edited php.ini to have the xampp path to php, > and still cake seems to want to use the built-in PHP which uses the > wrong socket. I've p**sed away several hours and nothing I do seems to > fix this. > > I've cd'd to the app directory, cake is showing the correct path... > there must be some other config file I need to edit to get cake to > stop using the built-in CLI PHP. > > Any new clues to this PITA issue? > > > > --~--~-~--~~~---~--~~ 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: Good star rating tutorial
Hey, There are quite a few out there. I just googled "cakephp star rating" and found a bunch. Try there first, and report back if you have any specific implementation issues that you need help with. Cheers, Graham Weldon http://grahamweldon.com jwerd wrote: > Hey there fellow Bakers > > Looking for a good, easy to follow star rating tutorial that is Cake- > PHP friendly (preferably one that is based around Cake-PHP). You can > also post code samples if you already have one going... > > TIA! > > > --~--~-~--~~~---~--~~ 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: Email Component, cc and bcc not working?
Hi Louie, I believe the cc and bcc variables need to be arrays. Try wrapping them in an array and see how that goes for you. Cheers, Graham Weldon http://grahamweldon.com Louie Miranda wrote: > Hi, I have setup the email component properly on cakephp. I can send > and it's ok for both html and text. > > I tried adding the cc and bcc option, however. It seems to be not working. > http://api.cakephp.org/class/email-component > > $this->Email->to = 'u...@example.com <mailto:u...@example.com>, > lmira...@example.com <mailto:lmira...@example.com>'; > $this->Email->cc = 'us...@example.com <mailto:us...@example.com>'; > $this->Email->bcc = 'bcc...@example.com <mailto:bcc...@example.com>'; > > I am using CakePHP... > > cat VERSION.txt > /// > // > +---+ > > // > // + $Id: VERSION.txt 7962 2008-12-25 23:30:33Z gwoo $ > // + Last Modified: $Date: 2008-12-25 17:30:33 -0600 (Thu, 25 Dec 2008) $ > // + Modified By: $LastChangedBy: gwoo $ > // > +---+ > > // > /// > > *1.2.0.7962* > > any ideas? > -- > Louie Miranda (lmira...@gmail.com <mailto:lmira...@gmail.com>) > http://www.louiemiranda.net > > Quality Web Hosting - www.axishift.com <http://www.axishift.com> > Pinoy Web Hosting, Web Hosting Philippines > > > --~--~-~--~~~---~--~~ 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: CakePHP and web services support
I think that if the book page linked doesnt help you to achieve what you need, perhaps being a little more specific with what you are trying to achieve will allow us to assist you in a more effective manner. Cheers, Graham Ma'moon wrote: > O.K, thats my false for not mentioning that i have already RTFMed & > googled it and i couldn't find any good examples! > Any other resources? i appreciate all the help! > > On Wed, Apr 22, 2009 at 6:25 AM, Graham Weldon > mailto:gra...@grahamweldon.com>> wrote: > > > I'm going to say it... RTFM. > > http://book.cakephp.org/view/476/REST > > Cheers, > Graham > > > Ma'moon wrote: > > Hello guys, > > Any one knows a good example usage for creating RESTfull web > services > > in CakePHP 1.2? > > > > -- > > http://phpirate.net > > > > > > > > > > > > -- > 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: CakePHP and web services support
I'm going to say it... RTFM. http://book.cakephp.org/view/476/REST Cheers, Graham Ma'moon wrote: > Hello guys, > Any one knows a good example usage for creating RESTfull web services > in CakePHP 1.2? > > -- > 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: cakephp.org homepage
You can use a method like this one: http://jqueryfordesigners.com/coda-slider-effect/ hope that helps. Cheers, Graham Gwoo wrote: > Jquery > > > --~--~-~--~~~---~--~~ 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-PHP friendly social network software?
Try this: http://noserub.com Cheers, Graham jwerd wrote: > I am building a Cake-PHP based project but I feel instead of > reinventing the wheel, I'd like to just integrate an existing open > source social networking solution that is Cake-PHP friendly. > > What I mean by friendly is: You have integrated it in your projects > and it works wonderfully. > > Please let me know of any solutions you may have used. > > TIA :) > > > --~--~-~--~~~---~--~~ 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: Sub Controller
The only reasnon I can think you would want to so this is to either group functionality or to make your URL's look pretty. In the case you at trying to group functionality, look into creating plugins for your controllers. If you are simply trying to control URL presentation, then you need to look into routing. Cheers Graham On 25/03/2009, at 12:21 PM, Ranju wrote: > > Hello > > I want to create sub controller like create admin panel.within > controller folder create admin folder then create admin controller. > which type possible this. > > > > 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: limit access to a site?
class AppController extends Controller { var $allowedHosts = array('127.0.0.1', '::1', '85.127.249.210'); var $accessDeniedRedirect = ... // Define your action to redirect to here. function beforeFilter() { if (!in_array(env('REMOTE_ADDR'), $this->allowedHosts)) { $this->redirect($this->accessDeniedRedirect); die(); } } } That would cover it. The only thing I have not considered is that you need to allow anyone access to the $accessDeniedRedirect address. So you will need a check in or around your if statement in the beforeFilter there to ensure unrestricted access to whatever you set $accessDeniedRedirect is set to. But I will leave that for you to sort out. Can't give you all the solutions. That would be boring! Cheers, Graham Aurelius wrote: > Hi! > > I Would like to limit the access to a controller function in the same > way as .htaccess would do it with these lines: > Order deny,allow > Deny from all > Allow from 85.127.249.210 > > How can I achieve that? > > 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: What does 'Error Affected' stand for?
"Error" and "Affected" are two separate results. Throw some CSS into your page to style up the table generated by cake, and it will make it all a little clearer. Affected is the number of rows affected by the query that was run. Cheers, Graham Joshua wrote: > What does 'Error Affected' stand for? > There is a query in my application: > > Error AffectedNum. rows Took (ms) > 52 521 > > It took about 8 second to load this page. > Is there any body can give me some suggestions? > > > --~--~-~--~~~---~--~~ 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: Cakephp Developers Required
Hi Rajesh, I'm interested to know what your project is and what time you need allocated to the development. Cheers Graham Weldon On 13/03/2009, at 11:48 AM, Rajesh wrote: > > I need cakephp developer for a new project. If any one interested let > me know. > > --~--~-~--~~~---~--~~ 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: RegEx: Dash Problem
Hey, Try escaping the hyphen: \- That should work out for you. Cheers, Graham Weldon w. http://grahamweldon.com e. gra...@grahamweldon.com p. +61 407 017 293 On Sat, 7 Mar 2009 16:02:58 -0800 (PST), KS wrote: > Hi there, > > This might not be a cakePHP issue, but here goes... > > I use CakePHP + WAMP on Windows. > My problem is that whenever there is a dash in a pattern and an input > string has a dash, no match occurs. > As a result, validation fails (like the built in e-mail and phone > number validations). > > I have tried using a custom validation method with the following > code: > > function valid_phone($data) { > $pattern = "^[0-9]{3}-[0-9]{4}$"; > $phone_no = trim($data['phone']); > if (ereg($pattern, $phone_no)) > return 1; > else > return 0; > } > > If I remove the dash from the pattern and input 7 digits, everything > works fine. > If I add the dash and input something like "123-45657", validation > fails. > > This is not the only pattern I've tried, all with the same results. > > Any ideas? > > Thank you! > > --~--~-~--~~~---~--~~ 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: Submit using image
Hey, The method I use workds really well on all browsers, and is achieved with CSS: .save_btn { background: #fff url(../img/myimage.png) top left no-repeat; width: 70px; height: 20px; padding-top: 20px; overflow: hidden; } If your image is a 70 pixel by 20 pixel button for a single sprite, this essentially shows the backgorund image in place, while hiding overflow, and pushing your text outside its display area. This is also a useful image replacement technique for headings and such too. Give it a go, and let me know how it works out. Cheers, Graham Weldon. On Tue, 24 Feb 2009 18:56:47 -0800 (PST), WidePixels wrote: > What I have been trying to do is use an image to submit the AJAX form. > Thing is I am using a CSS sprite as the image so i have the hover and > other button states in the CSS. the actual image(s) are in the CSS and > not physically linked to the submit. I have the class added fine to > the submit link, but the 'SAVE' text shows up over my CSS button. > > So basically i need to have the $caption for the link not display. > > link: > submit('save', array( > 'url' =>'.', > 'update' => '..', > 'class' => 'save_btn', > 'loading'=> '....', > 'complete' => '..' > ));?> > > Ideas, suggestions? > > Thanks, > Dave > -- Cheers, Graham Weldon w. http://grahamweldon.com e. gra...@grahamweldon.com p. +61 407 017 293 --~--~-~--~~~---~--~~ 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 bug?
You can bet on the 1.3 branch already being well underway, probably the 2.0 branch too.. If its not yet public, chances are its not really ready for us to use. The Cake team ensure that what we get our hands on is a correct representation of where the framework is heading. Often its best to hold back a bit while things are shaping up, before letting the dogs loose on it. (This is also true of CakeBot implementations! tee hee) Cheers, Graham On Tue, 24 Feb 2009 05:54:08 -0800 (PST), mradosta wrote: > It's going to be fixed in 1.3. > https://trac.cakephp.org/ticket/5864 > > By the way, does anybody know when the 1.3 branch will be started? > > > On Feb 24, 9:57 am, Nextri wrote: >> I'm getting a lot of extra queries when doing certain contains. >> Cakeversion: 1.2.0.7962 >> >> I've got three Models >> >> Member >> Item >> Itemrating >> >> Itemrating belongsTo Item >> Item BelongsTo Member >> >> I'm trying to do a find on Itemrating and contain Item and Member >> >> Here is the code to do the find: >> >> $this->Itemrating->contain(array('Item'=>array('fields'=>array >> ('id','slug','member_id'),'Member'=>array('fields'=>array >> ('id','username','slug','gender_id','birth'); >> $data = $this->Itemrating->find('all',array('conditions'=>array >> ('date'=>date('Y-m-d'),'Item.type_id'=>1, 'Itemrating.votes >> >> >'=>0),'order'=>array('Itemrating.rating'=>'DESC'),'limit'=>20)); >> >> It should be possible for cake to get all this info in one query. But >> instead I get 1 query that gets the data from itemratings and member, >> then for each result from that query, two additional queries are >> generated, one to get the member data, and one to get the item data. >> Is this a bug? Or am I doing something wrong? >> >> Here are the queries being built: >> >> Nr Query Error Affected Num. rows Took >> (ms) >> 1 SELECT `Itemrating`.`id`, `Itemrating`.`item_id`, >> `Itemrating`.`date`, `Itemrating`.`votes`, `Itemrating`.`rating`, >> `Item`.`id`, `Item`.`slug`, `Item`.`member_id` FROM `itemratings` AS >> `Itemrating` LEFT JOIN `items` AS `Item` ON (`Itemrating`.`item_id` = >> `Item`.`id`) WHERE `date` = '2009-02-24' AND `Item`.`type_id` = 1 AND >> `Itemrating`.`votes` > 0 ORDER BY `Itemrating`.`rating` DESC LIMIT 20 >> 3 3 10 >> 2 SELECT `Item`.`id`, `Item`.`slug`, `Item`.`member_id` FROM >> `items` >> AS `Item` WHERE `Item`.`id` = 3 1 1 >> 0 >> 3 SELECT `Member`.`id`, `Member`.`username`, `Member`.`slug`, >> `Member`.`gender_id`, `Member`.`birth` FROM `members` AS `Member` >> WHERE `Member`.`id` = 2 1 1 0 >> 4 SELECT `Item`.`id`, `Item`.`slug`, `Item`.`member_id` FROM >> `items` >> AS `Item` WHERE `Item`.`id` = 253 1 1 >> 0 >> 5 SELECT `Member`.`id`, `Member`.`username`, `Member`.`slug`, >> `Member`.`gender_id`, `Member`.`birth` FROM `members` AS `Member` >> WHERE `Member`.`id` = 2 1 1 0 >> 6 SELECT `Item`.`id`, `Item`.`slug`, `Item`.`member_id` FROM >> `items` >> AS `Item` WHERE `Item`.`id` = 1 1 1 >> 0 >> 7 SELECT `Member`.`id`, `Member`.`username`, `Member`.`slug`, >> `Member`.`gender_id`, `Member`.`birth` FROM `members` AS `Member` >> WHERE `Member`.`id` = 2 1 1 0 > -- Cheers, Graham Weldon w. http://grahamweldon.com e. gra...@grahamweldon.com p. +61 407 017 293 --~--~-~--~~~---~--~~ 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: Autocomplete search on users table
My first disclaimer is that I dont use jQuery nearly as much as I want to. I tend towards prototype. However.. http://docs.jquery.com/Plugins/Autocomplete This looks like a pretty good Autocomplete plugin for jQuery. It just wants an array of data that it is supposed to match to. Not sure how this works in searching all your data, and matching to a user. But as a starting point, you could return names to begin with: // Controller Code $names = implode('|', Set::extract('/MyModel/name', $this->MyModel->find('all', array('conditions' => array( ... ); $this->set(compact('names')); // Javascript code var names = ""; $("#my_input").autocomplete(names.split('|')); Of course, the cooler, more hip options are to postback after observing a change on the input, and AJAX/JSON look for data, only returning back strings containing the information you have partially entered. This could potentially be more powerful, allowing you to pass back more information like ID's to link to, as well as doing SQL "WHERE LIKE" matches, for mid-string matching. Hope this gets you started. Cheers, Graham Weldon w. http://grahamweldon.com e. gra...@grahamweldon.com p. +61 407 017 293 On Mon, 23 Feb 2009 19:59:02 -0800 (PST), Mike wrote: > Hi everyone, > > I'd like to know if there is out there a component or helper using > JQuery to help me build a search autocomplete functionnality on a > users table. > > I'd like the end user to be able to search a user by firstname, > lastname, email and phone number, everything using an autocomplete > text field. > > Any help or start point ? > > Thx > -- --~--~-~--~~~---~--~~ 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 core is throwing unlink warnings
Ensure the full app/tmp/ directory skeleton is in place, from the cake install, and that premissions are set such that the web server is able to read / write those directories completely. If in doubt, copy the app/tmp/ directory from the tarball, over your applications tmp directory, and set the permissions. This should solve the problem. Let us know how you go. Cheers, Graham Weldon w. http://grahamweldon.com e. gra...@grahamweldon.com p. +61 407 017 293 On Mon, 23 Feb 2009 12:51:07 -0800 (PST), RyOnLife wrote: > I am getting this (and other similar) warnings: > > Warning (2): unlink(/web/php/app/tmp/cache/persistent/cake_core_core_paths) > [function.unlink]: No such file or directory [CORE/cake/libs/file.php, line > 292] > > Code > > unlink - [internal], line ?? > File::delete() - CORE/cake/libs/file.php, line 292 > FileEngine::read() - CORE/cake/libs/cache/file.php, line 171 > Cache::read() - CORE/cake/libs/cache.php, line 306 > Configure::corePaths() - CORE/cake/libs/configure.php, line 489 > Configure::buildPaths() - CORE/cake/libs/configure.php, line 591 > Configure::__loadBootstrap() - CORE/cake/libs/configure.php, line 695 > Configure::getInstance() - CORE/cake/libs/configure.php, line 137 > include - CORE/cake/bootstrap.php, line 43 > [main] - APP/webroot/index.php, line 81 > > I checked, and the "cake_core_core_paths" file does exist at the specified > path. > > Anyone know how to deal with this? Although "no such file or directory" > indicates it's not the problem, I double checked my tmp folder permissions > just to be safe. -- --~--~-~--~~~---~--~~ 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: How to login with username only ?
Hey, I am really not sure why you would want this.. but not knowing your project, I am sure you have your reasons. One method that comes to mind is forcing the password. Essentially, assign a common password to all users on creation, and use the callbacks to force the password to something on login, or use a hidden field (since you dont really need passwords, making the password completely readable, but hidden on the form, would not pose a security risk, really). So, on the UsersController, afterSave() update the password to be some generic password. And on your login form: input('password', array('type' => 'hidden', 'value' => 'genericpassword')); ?> That should cover you :-) I dont recommend only requiring a username to login... unless the stored data is completely trivial. Cheers -- Cheers, Graham Weldon w. http://grahamweldon.com e. gra...@grahamweldon.com On Thu, 5 Feb 2009 17:49:48 -0800 (PST), datgs wrote: > Hi everybody, > > I've had to rewrite code in AuthComponent class to login with username > only. > > Was it the best way for my purpose. Is there any way without changing > the code in AuthComponent. > > 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: Use the dreaded requestAction()... or use something else?
If some association exists between these objects, you can do something like: $this->User->save($this->data); $this->User->Site->save(array('Site' => array( 'user_id' => $this->User->id, // --- any other data ))); $this->User->Site->SitePage->save(array('SitePage' => array( 'site_id' => $this->User->Site->id, // --- any other data ))); Tada! Associationes from User to Site, and Site to SitePages need to exist for that to work. Cheers, Graham On Mon, 2 Feb 2009 04:14:48 -0800 (PST), Turgs wrote: > Hello all > > What's an appropriate use of requestAction()? > > I have 3 controllers: >* UsersController >* SiteController >* SitePagesController > > Within the add() function of UsersController, I want to (a) create a > new user (b) create a new site for that user with (c) one new page for > that site. > > What's the best way to do this? > > I was thinking of: > > ## > > if ($this->User->save($this->data)) > { ># create site >$this->requestAction('/sites/add'); > ># add a page (homepage) for this site >$this->requestAction('/sitepages/add'); > ># Login the user and redirect to the dashboard >// login code here >$this->Session->setFlash(SOTF_MSG_USER_WELCOME); >$this->redirect(array('controller' => 'users' ,'action' => > 'dashboard')); > } > > ## > > While the code for this looks clean, what I've read seems to indicate > this isn't such a good idea due to performance issues. > > What else would I do? > > Thanks > Turgs > -- Cheers, Graham Weldon w. http://grahamweldon.com e. gra...@grahamweldon.com p. +61 407 017 293 --~--~-~--~~~---~--~~ 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: Cache not configured properly on Mac OS X
On OS X, you should drop-in the CakePHP directories, and leave them as is. Unless you are running your Apache webserver under a different user than the one you login as. If you have chmod'd the tmp directory recursively to 666, you have removed the execute bit, which is needed for directory traversal. Try this: $ cd /directory/to/my_project/app/ $ find . -type d -exec chmod 755 {} \; This will find all directories under the TMP directory, and set permissions to 755, which is sufficient for the apache server, if running as your logged in user. if its running as some other user, then just change them to 777 instead of 755 in the above command. Hope this helps. Cheers, Graham On Thu, 29 Jan 2009 02:57:11 -0800 (PST), leo wrote: > Try 777. It's the only way I could get it to work. > Fwiw, I don't enable the cache on my dev server as it can lead to > confusion trying to debug. > > On Jan 28, 9:26 pm, Rick wrote: >> Version 1.2.1.8004 >> >> I downloaded and installed Cake in my Apache document directory in new >> "Test" Directory. I can run cake and get the "Release" screen >> successfully. However I'm getting a warning "Cache not configured >> properly". I have not touched anything other than to chmod the tmp >> directories to 666. >> >> I thought this was supposed to be a "drop in" install. >> >> willirl >> Rick > -- Cheers, Graham Weldon w. http://grahamweldon.com e. gra...@grahamweldon.com p. +61 407 017 293 --~--~-~--~~~---~--~~ 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: svn or git?
The Chaw supports both SVN and Git. You will find the core team move around between SVN ang Git for various projects. This question can probably be answered by looking at the key differences between Git and Svn. The most significant, and most obvious, being the distributed nature of Git. I suggest you dive into the documentation for Git, and for Subversion, and see which best suits your needs. If you still cant decide, just jump in and try one. Better to be versioning code with the wrong system than with no system at all. Lastly, try discussing it on the git or SVN mailing lists. Thats probably the right spot for discussing it. Cheers, Graham On Wed, 28 Jan 2009 03:00:30 -0800 (PST), leo wrote: > This has probably been discussed before, but I can't find anything > specific. > > Why does CakePHP use SVN, while The Chaw appears to use GIT? > > Should I be using one rather than the other? > > Will CakePHP eventually migrate to GIT? > -- Cheers, Graham Weldon w. http://grahamweldon.com e. gra...@grahamweldon.com p. +61 407 017 293 --~--~-~--~~~---~--~~ 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: Closing $ajax->form()
$ajax->submit() will create a submit button. However, it will not end your form. You need to also end your form with $form->end(). $ajax->submit() will work, as indicated previously: >> $ajax->form(); >> $form->inputs(); >> $ajax->submit(); >> $form->end(); Cheers, Graham On Tue, 27 Jan 2009 06:21:45 -0800 (PST), Pyrite wrote: > I can't get $ajax->submit() to work, only $form->end('Submit'). > > What's the difference between the two? > > On Jan 26, 7:59 am, Graham Weldon wrote: >> $ajax->submit() creates an ajax submit element. >> $form->end('something') creates a submit button, and ends the form. >> >> $ajax->form() starts a form. >> Your usage will depends very much on your implementation, and >> requirements. >> >> The simple reason for there not being an $ajax->formEnd() is because its >> super easy to do: $form->end(). >> Both output . >> >> here are some options to illustrate usage: >> >> $form->create(); >> $form->inputs(); >> $form->end('submit'); >> >> $ajax->form(); >> $form->inputs(); >> $form->end('submit'); >> >> $ajax->form(); >> $form->inputs(); >> $ajax->submit(); >> $form->end(); >> >> On Mon, 26 Jan 2009 05:55:02 -0800 (PST), Pyrite >> wrote: >> >> >> >> > So what is the point/usage of $ajax->submit() then if it does not >> > actually submit the form created with $ajax->form() ? >> >> > On Jan 23, 8:05 am, Mono wrote: >> >> When u use the ajax->form, the only difference with a normal form is >> >> the first line. >> >> >> Normal Form: >> >> >> $form->create (...) >> >> $form->input () >> >> $form->input () >> >> $form->end ('Send') >> >> >> Ajax Form: >> >> >> $ajax->form (...) >> >> $form->input () >> >> $form->input () >> >> $form->end ('Send') >> >> >> On 22 Jan., 22:47, Pyrite wrote: >> >> >> > How do you put the close tag in a form created by $ajax->form() ?? >> >> > Why >> >> > is there not an $ajax->formEnd() similar to the FormHelper's >> $form->end >> >> > () ? >> >> >> > Also, when I create a form with $ajax->form(), and I add a submit >> >> > with >> >> > $ajax->submit(), it does not submit the form. A usage example would >> >> > be >> >> > great. I can only get it to submit the form if I use $form->end >> >> > ('Submit') instead of $ajax->submit().- Hide quoted text - >> >> >> - Show quoted text -- Hide quoted text - >> >> - Show quoted text - > -- Cheers, Graham Weldon w. http://grahamweldon.com e. gra...@grahamweldon.com p. +61 407 017 293 --~--~-~--~~~---~--~~ 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: Closing $ajax->form()
$ajax->submit() creates an ajax submit element. $form->end('something') creates a submit button, and ends the form. $ajax->form() starts a form. Your usage will depends very much on your implementation, and requirements. The simple reason for there not being an $ajax->formEnd() is because its super easy to do: $form->end(). Both output . here are some options to illustrate usage: $form->create(); $form->inputs(); $form->end('submit'); $ajax->form(); $form->inputs(); $form->end('submit'); $ajax->form(); $form->inputs(); $ajax->submit(); $form->end(); On Mon, 26 Jan 2009 05:55:02 -0800 (PST), Pyrite wrote: > So what is the point/usage of $ajax->submit() then if it does not > actually submit the form created with $ajax->form() ? > > On Jan 23, 8:05 am, Mono wrote: >> When u use the ajax->form, the only difference with a normal form is >> the first line. >> >> Normal Form: >> >> $form->create (...) >> $form->input () >> $form->input () >> $form->end ('Send') >> >> Ajax Form: >> >> $ajax->form (...) >> $form->input () >> $form->input () >> $form->end ('Send') >> >> On 22 Jan., 22:47, Pyrite wrote: >> >> >> >> > How do you put the close tag in a form created by $ajax->form() ?? Why >> > is there not an $ajax->formEnd() similar to the FormHelper's $form->end >> > () ? >> >> > Also, when I create a form with $ajax->form(), and I add a submit with >> > $ajax->submit(), it does not submit the form. A usage example would be >> > great. I can only get it to submit the form if I use $form->end >> > ('Submit') instead of $ajax->submit().- 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: Anyone built a forum system yet?
Have you released / are you planning to release source for this? Cheers, Graham On Mon, 19 Jan 2009 13:43:05 -0800 (PST), Miles J wrote: > www.sc2armory.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: $id = null and $id
Provision of = in a function call for PHP means that if the value is not provided, the specified is used as a default. Example: function foo($b = "World") { echo "Hello " . $b; } foo(); foo("CakePHP"); Output: Hello World Hello CakePHP hope that explains it for you. Cheers, Graham On Sun, 18 Jan 2009 02:30:52 -0800 (PST), Delirium tremens wrote: > What is it for? > > http://book.cakephp.org/view/336/Creating-Post-Views > # function view($id = null) { > > http://book.cakephp.org/view/337/Adding-Posts > function view($id) { > = null removed!!! > function add() { > > http://book.cakephp.org/view/339/Deleting-Posts > 1. function delete($id) { > no = null!!! > > http://book.cakephp.org/view/340/Editing-Posts > 1. function edit($id = null) { > --~--~-~--~~~---~--~~ 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: A new discussion about "controllers which extend another-controller-other-than-AppController"
Hey, Better than including php files, use the CakePHP App::import() and ClassRegistry::init() methods. These locate, include and in the case of the ClassRegistry, instantiate and return the object for you. You would in this case, do something like: App::import('Controller', 'RemotingController'); class RemotingUsersController extends RemotingController { /// implementation } Run a few tests with that, but its my understanding that this method should make the components available for the RemotingUsersController class. If not, ensuring that the __construct() passes back to the parent should ensure that the parent class is processed properly, but this should happen by default. Try the App::import() and let me know how you go with the components. Cheers, Graham On Thu, 15 Jan 2009 12:47:58 -0800 (PST), caminante wrote: > Being released 1.2 final version of CakePHP, I opened this discussion > to try to bring some light together to this issue. > > My need: > What's in the subject of this discussion; I have a couple of "special" > controllers to be called from flash (through cakeswxphp). What I need > is those controllers extending a "RemotingController" (with it's set > of thingies for communication with flash) which in turn extends > AppController. Sounded easy when I thought it, it's a common practice > in OOP and I cannot see why it wouldn't be implemented in an OOP > framework as CakePHP. Let's see: > > 1) class RemotingController extends AppController {} // dir: app/ or > app/controllers/ > 2) class RemotingUsersController extends RemotingController {} // > dir: app/controllers/ > > When I make a request to an action in RemotingUsersController, "Class > 'RemotingController' not found", either putting it at app/ or app/ > controllers/. Ok, CakePHP didn't noticed RemotingController class > existed. > > There are a couple of (old or even antique) discussions on the > subject: > > http://groups.google.com/group/cake-php/browse_thread/thread/83bad7a3498001c7 > (from 2005) > and a more recent one: > http://groups.google.com/group/cake-php/browse_thread/thread/f3c62f08147fcfe9/ > (from mid 2007) > > Neither seemed to found a (nice?) way to do this and according to > dates, they were discussing on different stages in the evolution of > the framework. > I applied something said in the first one, suggesting the following: > > require_once('parent_controller.php'); > class ChildController extends ParentController {} > > The requirement for the php file with my RemotingController class > would work fine (though not being a pretty/frameworkian solution, but > I can live with that). Now my class seems to be recognized by Cake but > I have another problem: The components I declare for this class don't > work ("Call to a member function requestedWith() on a non-object", for > example). Seems that leaving a little bit the CakePHP "rigorous- > mechanics/convention-over-configuration" of Cake, there are some > things that stop working "automagically", such as automatic components > initialization. > > My questions: > How, then, can I initialize components? (and maybe why there's nothing > in the book on this subject?) > What can be the most practical and conventional way of doing what I > need? > Are others there that achieved good results with 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: mod_rewrite problems
Hey, I know its a basic thing, so don't get annoyed at me for asking.. But are you restarting the webserver after these changes? You'll need to restart or reload your apache config in order for changes to take effect. Cheers, Graham On Thu, 15 Jan 2009 10:15:38 -0800 (PST), neridaj wrote: > I tried adding that line in the 1.2.x.x .htaccess file as well as the / > app .htaccess file with no luck. > > On Jan 15, 8:53 am, Smelly_Eddie wrote: >> Try adding >> RewriteBase / >> >> just after >> RewriteEngine On >> >> in your htaccess files. >> >> When I was on godaddy i found this to be a requirement to get things >> working. >> >> On Jan 14, 4:14 pm,neridaj wrote: >> >> > Hello, >> >> > I've edited my httpd.conf file as instructed and can't get mod_rewrite >> > working. Any suggestions? >> >> > /etc/httpd/httpd.conf: >> >> > LoadModule rewrite_module libexec/httpd/mod_rewrite.so >> >> > DocumentRoot "/Library/WebServer/Documents" >> >> > >> >> > # >> > # This may also be "None", "All", or any combination of "Indexes", >> > # "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews". >> > # >> > # Note that "MultiViews" must be named *explicitly* --- "Options All" >> > # doesn't give it to you. >> > # >> > Options Indexes FollowSymLinks MultiViews >> >> > # >> > # This controls which options the .htaccess files in directories can >> > # override. Can also be "All", or any combination of "Options", >> > "FileInfo", >> > # "AuthConfig", and "Limit" >> > # >> > AllowOverride All >> >> > # >> > # Controls who can get stuff from this server. >> > # >> > Order allow,deny >> > Allow from all >> > >> >> > Thanks, >> >> > Jason > --~--~-~--~~~---~--~~ 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: Creating a "Does not Equal To" SQL Statement
Hey, 'conditions' => array( 'OpportunityCategory.id !=' => 1) That should do it for you. Cheers. On Thu, 15 Jan 2009 05:13:20 -0800 (PST), exo_duz wrote: > Hi all, > > Simple question. I want to create a "Does Not Equal To" SQL statement > within the Controller. The SQL statement would just get me back all > data when "OpportunityCategory.id" <> 1. > > $findOtherOpportunities = $this->OpportunityCategory->find('all', array > ( > > 'conditions' => array( > > 'OpportunityCategory.id' => '1' > ), > > 'order' => array( > > 'OpportunityCategory.id ASC', > ) > ) > ); > $this->set('other_opportunities', > $findOtherOpportunities); > > Is there a way to do it using the Model::find function? Or would I > have to create a custom SQL within the model? > > Thanks for your 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: Can a webpage tell the source IP of a message? (no-ip.com like appliction)
$_SERVER['REMOTE_ADDR'] should tell you what you need. Cheers, Graham Aus wrote: > I'm writing an application like no-ip.com , the user will send a _POST > message includes the domain name to the website, and the website > should map the domain name in the message with the source IP of the > message. and update it in the database. > > so when someone have a computer at home with dynamic IP and he want to > access it remotely, he can always know his new IP from this website. > > is it possible for a Webpage installed on a webhost server to > determine the source IP of a packet? > > any advise from where should i start? where should i search about the > subject? > > > thanks alot ! > > > * i know how to do it if it's on my computer, i'll just make some C > script to capture the packets and tell. but first, that's an over > kill, second, it doesn't work in this case, i'm use a webhost server, > not my own. > > > --~--~-~--~~~---~--~~ 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: HABTM naming convention messed up?
This is actually the expected behavior. Consider the join table (when modelised, like you are doing) to be a simple name. The inflector will look at the plural string (as is the convention) and remove the 's' at the end of the last word detected. Table: teams_untils Model: TeamsUnit Cheers, Graham On Jan 5, 11:47 am, gearvOsh wrote: > Ok I have a users and teams system. Users are part of a team. Here is > the naming conventions: > > Model: Team, User > DB: teams, users > HABTM: teams_users (TeamUser model) > > But when I set my HABTM relationships I get errors because it says > that the model TeamsUser does not exist. Shouldnt it be TeamUser? > Thats what all the documentation says. > > I fail to see how this setup is better then having a table, model, > controller, etc all called Teams or Users. --~--~-~--~~~---~--~~ 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: Can i compile the PHP webpage instead of leaving the source code on the server?
You can, through using an optimiser / byte code generator, for example: - Zend Optimiser http://zend.com/store/products/zend-optimizer.php - eAccelerator http://eaccelerator.net/ Cheers, Graham On Jan 5, 2:10 pm, Aus wrote: > I've designed a PHP webpage, but i don't want to keep it on the server > as a source code, > is there any way to compile 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: new benchmarks of PHP frameworks
Your benchmarks are still "Hello World" examples, from what I can see there. Great as a benchmark for those using static only pages with their frameworks, but I suggest that the majority of developers out there are doing something more complex. Cheers, Graham Weldon kiang wrote: > You could have a look at the result I did. ;) > > --- > kiang > > On 1月2日, 上午6時37分, Graham Weldon wrote: > >> I won't say I have looked extensively through the code provided for all >> frameworks, but the CakePHP 1.2 BenchmarkController is far from thorough. >> >> Its bypassing view parsing, by putting a die() call in the controller >> action: >> >> http://code.google.com/p/phpmark/source/browse/tags/20081226/cakephp-... >> >> Benchmark testing should be done with non-trivial code, and given these >> frameworks abstract databases, and that abstraction can affect >> performance, it should probably include tests that include database access. >> >> Cheers, >> Graham Weldon >> >> kiang wrote: >> >>> Yii project had updated their Performance Comparison page: >>> http://www.yiiframework.com/performance >>> >>> The core developer of Yii also created a project to host the code >>> needed for benchmarks: >>> http://code.google.com/p/phpmark/ >>> >>> Based on that project, I did some tests on my computer and the result >>> is here: >>> http://code.google.com/p/twpug/downloads/detail?name=framework_benchm... >>> >>> The difference I did was putting the output in view instead of in >>> controller. And the tool I used is siege with following command: >>> siege -c 100 -r 3 >>> >>> With the 'Transaction rate' result, I also make a bar chart with >>> OpenOffice.org. >>> >>> The good news is CakePHP 1.2 is faster than Symfony 1.2.1 on my >>> computer. ;) >>> >>> ps. I didn't use APC, just comparing the execution time in one simple >>> request. >>> >>> --- >>> kiang >>> > > > --~--~-~--~~~---~--~~ 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: Modifying a String
http://www.php.net/strings You can do either basic string searching with strpos(), or you can use regular expressions. // - // Method 1 // - $str = 'This is MyString and it will be altered'; $find = 'MyString'; if (strpos($str, $find) { $newStr = substr($str, strpos($str, $find) + strlen($find)); echo $newStr; // Output: ' and it will be altered' } else { echo 'String not found'; } // - // Method 2 - Regular Expressions // - $str = 'This is MyString and it will be altered'; $pattern = '/(mystring)/i'; if (preg_match($pattern, $str, $matches, PREG_OFFSET_CAPTURE)) { $newStr = substr($str, $matches[0][1] + strlen($matches[0][0])); echo $newStr; // output: ' and it will be altered' } else { echo 'String not found'; } I havent tested the above, but its just basic String manipulation, you shouldnt have any issues modifying it. Best of luck with it. Cheers, Graham Weldon Kyle Decot wrote: > How would I find the first occurrence of a word or phrase in a string > and then strip off everything after that? > > I know that I will probably need to use regex but I am unsure how to > write it. > > Any help would be most appreciated. > > > --~--~-~--~~~---~--~~ 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: new benchmarks of PHP frameworks
I won't say I have looked extensively through the code provided for all frameworks, but the CakePHP 1.2 BenchmarkController is far from thorough. Its bypassing view parsing, by putting a die() call in the controller action: http://code.google.com/p/phpmark/source/browse/tags/20081226/cakephp-1.2.0/app/controllers/benchmark_controller.php Benchmark testing should be done with non-trivial code, and given these frameworks abstract databases, and that abstraction can affect performance, it should probably include tests that include database access. Cheers, Graham Weldon kiang wrote: > Yii project had updated their Performance Comparison page: > http://www.yiiframework.com/performance > > The core developer of Yii also created a project to host the code > needed for benchmarks: > http://code.google.com/p/phpmark/ > > Based on that project, I did some tests on my computer and the result > is here: > http://code.google.com/p/twpug/downloads/detail?name=framework_benchmark.zip > > The difference I did was putting the output in view instead of in > controller. And the tool I used is siege with following command: > siege -c 100 -r 3 > > With the 'Transaction rate' result, I also make a bar chart with > OpenOffice.org. > > The good news is CakePHP 1.2 is faster than Symfony 1.2.1 on my > computer. ;) > > ps. I didn't use APC, just comparing the execution time in one simple > request. > > --- > kiang > > > --~--~-~--~~~---~--~~ 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: HTML 4 specific CakePHP?
Everyone has reasons for and against various technologies. Thankfully, CakePHP provides you a complete fantastic framework without limiting you to something as specific as only being able to use xhtml. You should be able to extend the html helper for all (most?) the tags you want to produce. Perhaps create a html4 helper: App::import('Helper', 'Html'); class Html4Helper extends HtmlHelper { // Implement code here, maybe sometimes as simple as replacing $tags values. } Good luck with it. If you do create something that you feel does the job, submit an article to the bakery, and share your helper with the community! Cheers, Graham (Predominant) gearvOsh wrote: > Honestly I really dislike the "xhtml" type of tags in CakePHP. There > are no reasons for that, I think it would be a better idea to make it > html 4 strict. > > Heres an article on why xhtml is retarded. > > http://www.webdevout.net/articles/beware-of-xhtml > > > --~--~-~--~~~---~--~~ 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: Advanced Routes
You should be able to do something like: Router::connect('/:username/:controller/:action/*', array(), array('username' => '[a-z0-9]*')) Read through this: http://book.cakephp.org/view/542/Defining-Routes The most relevant examples are down the bottom, but work your way from the top, and try some similar routing examples that are relevant to your particular app. Best fo luck, and be sure to let us know how you go. Cheers, Graham BeroFX wrote: > Hi guys! > > Imagine you have a standard social network with users who can have > blogs, pictures and videos. > > I need to setup my routes like this: > > http://www.mysite.com/michael --> this is like / > users/view/123 > http://www.mysite.com/michael/videos/123 --> this would show > michaels video number 123 > http://www.mysite.com/michael/pictures/ --> this would be like > michaels /pictures/index > > Any suggestions? > > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: forget password
Hey Ranjana, I would make the following suggestion: Make it a password reset system instead of a reminder system. This allows you to keep your password encrypted, and still email users with information, without compromising security. Once a user requests a password reset (via the website) send them off an email with a unique key that is stored against their user id in the Users table. This key field will be left empty or null if there is no password reset request in progress. Then create an action on your users controller that the user will go to when they have the key in their email. This action should check the email address, username, key, and if all match successfully, provide a password reset input, where they can choose their own new password. I hope this gives you a little direction on what you need to be doing, and how to achieve it. Cheers, Graham On Wed, Sep 3, 2008 at 1:35 PM, Ranjana Sriavastava <[EMAIL PROTECTED]>wrote: > hello > > I wnat to forget passord via email id and send email to user email id with > cakephp. > > > On Wed, Sep 3, 2008 at 4:48 AM, Graham Weldon <[EMAIL PROTECTED]>wrote: > >> Hey Ranjana, >> Were you looking to create a password reminder feature for a site you are >> building? >> Provide a little more detail about what you are trying to achieve, and >> someone will be able to provide some direction or assistance. >> >> Cheers, >> Graham >> >> >> On Tue, Sep 2, 2008 at 5:18 PM, Ranjana Sriavastava < >> [EMAIL PROTECTED]> wrote: >> >>> I am new with cakphp. I want forget password with cakepho. so pls help >>> me. >>> >>> >>> >> >> >> > > > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: forget password
Hey Ranjana, Were you looking to create a password reminder feature for a site you are building? Provide a little more detail about what you are trying to achieve, and someone will be able to provide some direction or assistance. Cheers, Graham On Tue, Sep 2, 2008 at 5:18 PM, Ranjana Sriavastava <[EMAIL PROTECTED]>wrote: > I am new with cakphp. I want forget password with cakepho. so pls help me. > > > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---