It can't work from the Shoe model as Shoe hasMany Size so it will run
one find for Shoe and another for Size. However with your associations
you could run $this->Shoe->Size-
>find('all',array('conditions'=>array('Size.size'=>10))); and it would
pull all the data you want.
But you need to back up a
No one can access the files unless they get in through your FTP or
cpanel. Make sure everything is protected safely: FTP, SSH, etc.
On Mar 8, 11:27 pm, "toka...@gmail.com" wrote:
> Hi,
> How can I protect my (cake) PHP code when putting my app on
> webhosting?
>
> I need to be sure:
>
> 1) that
Hi,
How can I protect my (cake) PHP code when putting my app on
webhosting?
I need to be sure:
1) that nobody can steal/modify the source
2) the security salt value and database.config are somehow
protected...
any idea? I dont have any experience in this area.
Thanks
Tomas
Check out the n
__construct() is used in Model.php (http://api.cakephp.org/class/
model#method-Model__construct). So either you will need to override
it correctly (calling the parent with the correct parameters) or
you'll need to review what it does and maintain that contract in your
custom __construct().
Hope t
Need a little more information to help you. How does it not work? Any
error messages? What is the SQL it generates? Maybe you have a
cached model schema? Set your debug to > 0 in core.php and try again.
Hope that helps,
Nick
On Mar 8, 8:49 am, vasion wrote:
> hey guys!
>
> i am having trouble
Hi, i am trying to use constructor in models. my code is that
array('rule' => 'notEmpty', 'message' => 'Not Empty')
);
function __construct(){
// parent::$this->useTable=null;
//set the $generic variable for enabling the functions defined
in
AppModel
I use UUIDs in place of Integers for many of my table IDs. Don't think
that is what Micheal is after though.
What I occasionally use is a 2 character identifier combined with an
incrementing hex number. That would result in something like TI-05A2,
then TI-05A3, etc.
Gary
On Mon, Mar 8, 2010 at
IWe're working on an upgrade to 1.26 stable and are finding a lot of
references to issues in the pagination helper in which parameter #2 to
array_merge is not an array. var_dump shows they are indeed arrays,
and this is usually on the url parameter.
See refs to url lines 258 and 344 in the paginat
The first thing that comes to my mind is using smarty. You can direct it to
use a database field instead of a file. In which case, you'll have a new
set of issues to deal with which are related to passing the $html object
into the template.
Also, if you trust the code then you can do a few other
I think that would best be left to the controller. Think of what the C
in ACL stands for.
To avoid repeating code, create a protected method _changeStatus() and
check there if the User is allowed.
On Mar 8, 3:39 pm, sawa wrote:
> Hi,
> I was wondering if it's possible to use ACL in model instead
Allow php code inside the pages is a very very bad idea (from the security
point of view)
I discourage you from doing that. If you need to include links on your
content you should use an alternative markup language like markdown or html
(there are a lot of wysiwyg plugins out there)
Regards
Pabl
Hi, I have a CMS application and would like to include link() ?> and other such tags inside the content of pages that
are stored in the database. However, when I view the pages, the php
tags are displayed as text. Is there a way to parse PHP code from
database content in a view?
Thanks
Check out
I inserted that but still when I go to blog.mysite.com and do $this-
>Session->read(); in my app_controller.php's beforeRender() It doesn't
contain my user information. Any other ideas or suggestions?
On Mar 8, 3:05 pm, Bernardo Vieira wrote:
> I have it in my beforeFilter callback in app_control
That seems a bit redundant as saveAll cycles through all of the
records and (depending on options sent via saveAll) may check each
record for valid data. Obviously if I validated each of them first I
would disable validation during the saveAll, but it's still a
magnitude in the order of 2x. I'm cu
Hi,
I was wondering if it's possible to use ACL in model instead of the
controller.
Let's say I have fat models and I have model method change_status.
Now, in my controllers I may invoke $mymodel->change_status on couple
of places and I don't want to check if user is authorized to do
change_status
I've looked at the array I am passing when the post gets entered and
its fine. I am saving correctly using $this->Post and the post data
saves to the post table fine.
My models look like this.
User
var $actsAs = array('Searchable' => array(
'fields' => array('username', 'first_nam
I have it in my beforeFilter callback in app_controller:
$this->Cookie->domain = '.mydomain.tld';
Note that the '.' before your domain name is what tells the browser that the
cookie is valid for *.mydomain.tld.
On Mon, Mar 8, 2010 at 4:50 PM, Kyle Decot wrote:
> Where do I set the realm for the
Where do I set the realm for the session cookie? The security level in
my core.php file is set to low.
On Mar 8, 6:47 am, Bernardo Vieira wrote:
> You also need to set the realm of the session cookie to your domain
> (it defaults to the hostname) and set the security level of the
> security compo
Hi,
In my cake application (1.2, apache, mysql), I need to export a large
amount of data (tens of thousands of records or more) in XML format.
The query itself is heavy but nothing the application/database
shouldn't handle reasonably (it takes ~1-2 seconds to complete the
query itself).
I first
Did you try logging $data? Or check that you're not doing $this->User-
>save(...) instead of $this->Post->save(...)
This is how I have my models set up. You should ignore the 'fields'
array in the behavior settings. I made a bunch of modifications to it.
User:
public $hasMany = array(
'P
Hi
I have a question about saving data.
I describe my situation.
I have a web application where a user can send document to other
users.
Now a user can send only to certain users.
A user send a document through an "add" action where I do a save where
the data to save is :
$this->data['Send']['send
Just to chip in on the subject of benchmarking as well. I'm not a
huge fan of apache ab. I've run into issues with it in the past when
testing php based sites. Results like those indicating that a
framework can outperform a simple php script make me question its
truthfulness. I find that siege g
This is a brand new install. I was just trying to access the default
index.php page and I received this:
Fatal error: session_start() [function.session-start]: Failed to initialize storage
module: user (path: C:\Temp) in C:\Program Files\Apache Software
Foundation\Apache2.2\htdocs\cakephp\cake\lib
Hi all,
I'm not sure if it's possible or if I have to write my own regex, but
my input data fails on the decimal validation when I enter a whole
value such as 100. I would like to accept integer values but also
floats eg. 100, 100.0, 100.1, 100.2 etc. I couldn't see any way to do
this without my ow
For MySql 5.0 and above
Add approved boolean column to book table.
Create a database triggers on book table for before insert and before
update
The user that save the data will always send approved = 0
Both triggers check for the approved value, if it's 0 the trigger will not
save the data and ins
Hi!
I'm sorry I couldn't see your answers until today!
Thank you for your answers!
I tried the solution of nurvzy which was really interesting for me but
unfortunatly it is still saving in the "book" table...
I also tried the LunarDraco solution so I just tried this:
$this->data['Book']['temp_
hey guys!
i am having trouble figuring out how i can impose search conditions in
my model pertaining to associated models.
Lets say i have a model Shoe and a model Size.
Shoe(id,name,price,discount) hasMany Size(id, shoe_id, size,
quantity).
And Size belongsTo Shoe.
What i want to do is this:
Hello! I am a Japanese who is new for cakePHP. I am looking for a
person who want to learn Japanese and teach me CakePHP(basic level) in
return via skype. I can get up early to set up convenient time if you
live outside Japan.
I started learning PHP which is my first programing language about 6
I am not able to load any plugin specific images using image('/'.$this->plugin.'/img/cake.power.gif'); ?> I have all
the images in "vendors" folder under the plugins root folder. I am
using Windows/IIS. I have this setting turned on to configure cakephp
to not use mod_rewrite. Configure::write('App
Hi all, Triple Smart (http://www.triplesmart.com) is looking for
CakePHP programmers for freelance projects or a full/part-time jpb in
Córdoba, Argentina.
The workplace would be our offices near ciudad universitaria, and you
should also have experience with XHTML/CSS and jQuery, and be open to
lea
Hi,
> going on with my project I am looking for a way to generate unique
> ident-codes for some entries.
> I.e. if a customer adds a request to the system I have the internal
> index model_id for internal use.
> To have a better look and feel for customers and staff I would like to
> have somethin
hi, i've customized some functions into tasks in cakephp's libs and
have been succesful, relationships, views, forms, helpers even
datepicker.
now that i'm trying to do is this:
creating some function like "mass", take any array containing all
tables in DB to be baked and load only once all schem
Hi there,
going on with my project I am looking for a way to generate unique
ident-codes for some entries.
I.e. if a customer adds a request to the system I have the internal
index model_id for internal use.
To have a better look and feel for customers and staff I would like to
have something more
I thought so after I wrote it out, but when I removed the hasOne
association I still get the same result. For some reason when I
create a post, the post gets added with no problem but the seachable
fails and kicks an error.
Query: INSERT INTO `search_index` (`model`, `association_key`, `data`,
`m
> User - hasMany Post and hasMany Comment
>
> Post - belongsTo User and hasMany Comment
>
> Comment - belongsTo User and belongsTo Post and hasOne User
Last one looks wrong to me, I'd expect:
Comment belongsTo Post, User
Post belongsTo User
Post hasMany Comment
User hasMany Comment, Post
cheers,
All three models have the same $actAs array var $actsAs =
array('Searchable');
Each model saves its data properly using if ($this->Model->save($this-
>data)) {
Where it falls apart is after the model data save and prior to the
search_index save.
I have tracked the issue down to something in my m
Hi all,
do you have an idea for the next cakefest's dates?
Hard to get approved for a business travel if we can't book 3 months
before the event.( we have to plan current project)
Thanks for answers,
Regards,
Jeremy
Check out the new CakePHP Questions site http://cakeqs.org and help others with
You also need to set the realm of the session cookie to your domain
(it defaults to the hostname) and set the security level of the
security component below 2
On 3/8/10, Kyle Decot wrote:
> Well my sessions.save is set to database in my core.php file. Also, I
> did $session->read() on my www page
You're correct, I did end up defining the relationship within the
plugin and that does indeed make it less app-agnostic. It's a
balancing act, ideally you want your plugin to be completely self
reliant, but if that's not the goal of your app you need to decide how
much is too much? My InstantMe
Yes,
thans a lot, thats what i'm looking for
On 7 Mrz., 17:40, cricket wrote:
> if ($session->read('Auth.User')) {
>
> And to get the username use $session->read('Auth.User.username')
>
> (or whatever the field is)
>
> On Mar 6, 11:19 am, amarradi wrote:
>
> > Hello together,
>
> > i tryed this
> Gee! Now I am really confused... Ferrari 599 is 1.2.6 and Prius is
> 1.3.0-RC1?
Lol, not quite, I compared your test to testing the newest model of a
Ferrari against the outgoing model but using the criteria that we
would use to test the Toyota. Made sense to me :)
> Anyway, the whole idea of
I think that the time to develop is much more important then the
requests per second performance. Simply because hardware is magnitudes
cheaper then development time.
On Mar 7, 5:20 pm, Dérico Filho wrote:
> Gee! Now I am really confused... Ferrari 599 is 1.2.6 and Prius is
> 1.3.0-RC1?
>
> Anywa
Interesting alternative :)
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
T
Sam is right in that you should be running $this->City->find('list');
That will automatically pull the id and name columns from your cities
table, if you do not have a name column then you need to supply a
fields array to tell it which alternative field to use for name.
http://book.cakephp.org/vi
Andy is asking you to remove your className and foreign_key
definitions to allow cake to try and define that relationship for you,
but as I believe your definitions to completely follow convention I'm
not sure how that will help in this case.
I run MilesJ's forum plugin in my site and from that I
45 matches
Mail list logo