cakephp-1.3

Effective management of data changes

大憨熊 提交于 2019-12-03 11:11:30
I have a table called Bookings. This table contains data representing a booking made for a particular service, with many variables. A while ago I came across a problem with my current data structure whereby any changes to the booking that affected times, dates or prices would affect other associated financial records, bookings lists for dates etc. My solution at the time was to create a Modifications table which would track any changes made to a Booking. Then, whenever the Booking model was asked to return a booking, it would add on Modifications made (in the afterFind() Cake callback) and

Migrating from Cake 1.3 to 2.0 and beyond - migrate existing, or only use for new?

半城伤御伤魂 提交于 2019-12-03 11:07:18
I'm nearling completion of my first CakePHP-driven website and just saw they're already working on CakePHP 2.0 (not the stable release yet). My questions: Is it incredibly time consuming to move to a new version of CakePHP (when it becomes the "stable" release that is)? I know they have migration guides, but - I've never used a framework before, so I've never had to migrate anything. Do you migrate your code for existing projects, or leave it as is and use the new stable version for future projects only? Where can I find what version of CakePHP I currently have installed? I've looked at the

Input value doesn't display. How is that possible?

◇◆丶佛笑我妖孽 提交于 2019-12-03 10:30:03
问题 This must be something utterly stupid that I've done or am doing, but I have an input with a value attribute that simply isn't being displayed: <div class="input text required"> <label for="Product0Make">Make</label> <input name="data[Product][0][make]" type="text" maxlength="255" value="AC Make" id="Product0Make"> </div> Has anyone ever seen this before? Do I have some kind of typo that I'm just blind to? For whatever it may be worth, here's the CakePHP code that's generating this line: <

CakePHP + Facebook

时光毁灭记忆、已成空白 提交于 2019-12-03 10:09:28
I am trying to implement facebook Connect to my cakephp Application. i am using Nick's Facebook Plugin. I wanna implement it this way When a user Visits the Site he should be able to login via Registration on the site or Facebook Connect Existing users should be able to connect their account to their FB account People who first time login to the site using FB Connect and dont have an account on the site. should be redirected to a page where they have to enter details to complete the profile. What i have done - I have followed the instruction of Nick to implement it and when i click Login - it

404 Not Found The requested URL was not found on this server

自古美人都是妖i 提交于 2019-12-03 07:22:57
问题 I'm having small troubles and was wondering if someone can help me over the hump. I pulled a copy of a website down from Hostgator and I'm trying to set it up on my local machine using WAMP but, I keep getting an error when trying to access the site. Here is what I have tried..I went to Apaches httpd.conf file and uncommented the # from LoadModule rewrite_module modules/mod_rewrite.so. Also I have changed the AllowOverride None to All. With that said, Im not sure what else to look for. Please

How to make temporary link for a downloadable file

二次信任 提交于 2019-12-03 06:55:53
I am making a project for a temporary download link for me to protect the file from hotlinkers... I believe that this is possible to do so.. because we all know that many of file sharing site " don't wanna mention any "... their link for the file has expiration... Ex. If I download one file from their site they give a direct link to click it right? but then that link will expire right after a few hours or minutes. How should I know that the link was expired? If I copy the same link on my download manager after one day, it can't download the same file. I already made this possible in htaccess .

Cakephp Upgrade from 1.3 to 2.1

我是研究僧i 提交于 2019-12-03 06:25:39
问题 UPDATE: the question i asked doesn't quite cover how deep i went in doing this upgrade! If you stumble on this, i hope the answer i pushed is useful to you So, in an effort to get the "forum" plugin working, i've decided to upgrade cakephp from 1.3 to 2.1 (This was because the forum plugin uses something called CakeDC utils, and they are already up to cakephp 2.0, and surprise surprise, the 2.3 version of forum isn't clear which utils it works with...) Ok, so I have run the cake upgrader

Retrieving inserted IDs from saveAll() in CakePHP

こ雲淡風輕ζ 提交于 2019-12-03 03:18:18
Using saveAll() to save multiple records in CakePHP, I am able to save them successfully in a table. But the problem arises while retrieving the IDs of those saved rows. LastInsertID() returns only a single last ID here. How can I get all the last inserted IDs which I have inserted using saveAll() ? afterSave function is called after each individual save in a saveAll execution, so you could do: In your AppModel class AppModel extends Model { var $inserted_ids = array(); function afterSave($created) { if($created) { $this->inserted_ids[] = $this->getInsertID(); } return true; } } You can place

How do I use a table other than “Users” for CakePHP's AuthComponent?

大憨熊 提交于 2019-12-03 03:12:35
CakePHP's AuthComponent assumes you have a Users table that contains a username and password. I'd like to find a way to override the default tablename from Users to Accounts. Background Information: The way I have designed my database is to have a Users table and an Accounts table. Accounts : id user_id username password authentication service (for example, my site, Facebook, Google, OpenID , etc.) Users : simply has all the personal information of the user (age, gender, etc.) The reason for this is so that each user can have multiple accounts they can login from so they are not locked into

Cakephp Upgrade from 1.3 to 2.1

Deadly 提交于 2019-12-02 19:48:18
UPDATE: the question i asked doesn't quite cover how deep i went in doing this upgrade! If you stumble on this, i hope the answer i pushed is useful to you So, in an effort to get the "forum" plugin working, i've decided to upgrade cakephp from 1.3 to 2.1 (This was because the forum plugin uses something called CakeDC utils, and they are already up to cakephp 2.0, and surprise surprise, the 2.3 version of forum isn't clear which utils it works with...) Ok, so I have run the cake upgrader magic thing, in accordance with the instructions found here: http://book.cakephp.org/2.0/en/console-and