Re: Script protection

2008-06-08 Thread David C. Zentgraf

On 9 Jun 2008, at 14:24, Dr. Tarique Sani wrote:

>> No body wanna share his knowledge?
>
> 5. Stop writing PHP code is the best one in my opinion


But even switching to compiled apps doesn't guarantee code protection.  
Think about all the resource hackers!
Oh noes! :-O

--~--~-~--~~~---~--~~
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: Strict or Pretty? We're looking for a few good opinions

2008-06-08 Thread soosa
I second this motion.
i vote for strict as well.
Soosa


On Sun, Jun 8, 2008 at 12:29 PM, b logica <[EMAIL PROTECTED]> wrote:

>
> Very stupid things are *often* done in the quest for pretty.
>
> On Sun, Jun 8, 2008 at 5:29 AM, phpjoy <[EMAIL PROTECTED]> wrote:
> >
> > Point your heads up towards PHP6, leave standards but not too far.
> > Sometimes very stupid things can be done in the quest for standards..
> >
>
> >
>

--~--~-~--~~~---~--~~
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: Script protection

2008-06-08 Thread soosa
If no body wants to share his/her knowledge you won't be able to use CakePHP
nor even having this thread on this mailing list!

Soosa

On Mon, Jun 9, 2008 at 1:19 AM, koko <[EMAIL PROTECTED]> wrote:

>
> No body wanna share his knowledge?
>
> On Jun 8, 8:02 pm, koko <[EMAIL PROTECTED]> wrote:
> > Hey,
> >
> > I didn't find a better place to discuss this topic than this group of
> > bakers ;-) , because CakePHP offers a very customizable and reusable
> > code !!
> >
> > I bake sites always and always have the same fears, "stealing my
> > scripts"  of course you know that it's very easy to steal Cake's
> > scripts or reuse them without your permission ... all you have to do
> > is to edit database.php file and some new CSS and go !! you have a new
> > site without having to pay !!!
> >
> > I have many things in my mind to prevent this:
> >
> > 1- Write a Contract with the client with some statements to prevent
> > him from reusing it (EULA)
> > 2- Tracing the stolen scripts and open a case in the court.
> > 3- Using Zend Encoder to encode it (but it's breakable !!)
> > 4- Some PHP tricks like passing a parameter to delete some files if
> > the script is stolen
> >
> > You maybe have the same problem, so let's share them
> >
>

--~--~-~--~~~---~--~~
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: Build #s for CakePHP Applications

2008-06-08 Thread Grant Cox

I have the major and minor numbers hardcoded in my application
configuration file, and the actual revision appended using AD7Six's
snippet
http://bakery.cakephp.org/articles/view/using-your-application-svn-revision-number


On Jun 9, 5:22 am, Ken <[EMAIL PROTECTED]> wrote:
> Like a good developer I want to set up a continuous integration
> process for my cake app. I can make ant work for me, but what do
> people recommend as far as tagging each deployment with a build #? I
> would like to use a scheme like:
>
> 1.00.bbb.p (where bbb is build and p is patch)
>
> ...and I would like my build/deployment process to label the build in
> SVN and then somehow get the version/build # onto the default layout.
>
> Thoughts?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Trouble with multipple database configs in RC1

2008-06-08 Thread Guillaume

Hello,
I don't have time to test if deeper now (going to work!) but I
encountered strange problems with a Shell script using Models
belonging to different databases.
My Shell script aims at migrating data from an old database named
"popnews_old" to a new one named "popnews" so it uses models belonging
to different databases.

$this->Model->find('all') with a Model pointing toward the old
database issues a query to the wrong database.

It used to work perfectly before.

Here are some excerpts of my code :

//{app}/config/database.php
var $default = array('driver' => 'mysql',
'connect' => 
'mysql_connect',
'host' => 
'127.0.0.1',
'login' => 
'xx',
'password' => 
'x',
'database' => 
'popnews',
'prefix' => '',
'port' => 8889);

var $oldLocalDatabase = array('driver' => 'mysql',
'connect' => 
'mysql_connect',
'host' => '127.0.0.1',
'port' => 8889,
'login' => '',
'password' => 'x',
'database' => 
'popnews_old',
'prefix' => '');

//{app}/models/old_redacteur.php

class OldRedacteur extends AppModel {

var $name = 'OldRedacteur';

var $useDbConfig = 'oldLocalDatabase';

var $useTable = 'REDACTEURS';

var $primaryKey = 'REDID';

}

//{app}/vendors/shells/recup_users.php
class RecupUsersShell extends Shell {
var $uses = array ('OldRedacteur', 'User');
var $tasks = array('DbConfig');

function main($rundry = false) {
// this line outputs the right db config !
$this->out('db config '.$this->OldRedacteur-
>useDbConfig);
// this line doesn't work anymore
$redacteurs = $this->OldRedacteur->find('all');
...

The last line generates this error :
the query (with the good fields from the table the model relates to) +
SQL Error: 1146: Table 'popnews.REDACTEURS' doesn't exist
which indicates that the query is executed on the wrong database
("popnews" and not "popnews_old").

I don't have the time to fill in a ticket for the moment, but does
someone have this strange problem?


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



About lost session value

2008-06-08 Thread langdu_hn_ngheo

Please find to the end of function __initSession in /cake/libs/
session.php and add following code:

if (isset($_SESSION) == false) {
@session_start();
}

Goodluck everybody

--~--~-~--~~~---~--~~
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: Script protection

2008-06-08 Thread Dr. Tarique Sani
On Mon, Jun 9, 2008 at 10:49 AM, koko <[EMAIL PROTECTED]> wrote:

>
> No body wanna share his knowledge?
>

5. Stop writing PHP code is the best one in my opinion


Tarique

-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Script protection

2008-06-08 Thread koko

No body wanna share his knowledge?

On Jun 8, 8:02 pm, koko <[EMAIL PROTECTED]> wrote:
> Hey,
>
> I didn't find a better place to discuss this topic than this group of
> bakers ;-) , because CakePHP offers a very customizable and reusable
> code !!
>
> I bake sites always and always have the same fears, "stealing my
> scripts"  of course you know that it's very easy to steal Cake's
> scripts or reuse them without your permission ... all you have to do
> is to edit database.php file and some new CSS and go !! you have a new
> site without having to pay !!!
>
> I have many things in my mind to prevent this:
>
> 1- Write a Contract with the client with some statements to prevent
> him from reusing it (EULA)
> 2- Tracing the stolen scripts and open a case in the court.
> 3- Using Zend Encoder to encode it (but it's breakable !!)
> 4- Some PHP tricks like passing a parameter to delete some files if
> the script is stolen
>
> You maybe have the same problem, so let's share them
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



cakephp 1.2rc1 getting error on scaffolding!!!

2008-06-08 Thread kknd

after i used console.php and create a controller on table and using
scaffolding, it show error

Notice (8): Undefined index:  id [APP\views\payments\index.ctp, line
47]

and i cannot edit or view or delete the data row on the table.

I try the same thing in 1.91 for bake.php, and it work fine...

what happen?


--~--~-~--~~~---~--~~
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: Strict or Pretty? We're looking for a few good opinions

2008-06-08 Thread Dr. Tarique Sani
On Sun, Jun 8, 2008 at 9:59 PM, b logica <[EMAIL PROTECTED]> wrote:

>
> Very stupid things are *often* done in the quest for pretty.


Very true

I vote for strict

Tarique


-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: a bit confused (n00b warning)

2008-06-08 Thread winter



On Jun 7, 9:18 am, Joel Perras <[EMAIL PROTECTED]> wrote:
> Ok, I'll attempt to re-iterate what you are attempting to do, because
> it is not completely clear to me:
>
> 1) You want to be able to 'add items to an apartment', where items <-
> HABTM-> apartments.
> 2) This should be accomplished through an HTML select drop-down, which
> would be populated with all the items contained within your items
> table.

Well, like I said, I'm not sure if that is the correct way to do it.

> ** The above point seems odd to me, since I'm guessing you would like
> to have the ability to input many different items (of various
> quantities) for each apartment.

Yes, that exactly what I'm trying to do. So at first, I had three
tables: 1. items; 2. units; 3. inventory;

The inventory table holds records with unit, item, and amount. So then
I can run a query where unit = ? and show everything in a certain
unit. Seems the most straight forward way to go about it. Then I
realized CakePHP is much more structured than other "frameworks" I've
used, and I wanted to use what methods CakePHP provided me with.

Thanks for your advice. BTW, there's no rush on this one.
--~--~-~--~~~---~--~~
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: Please include CakeBaker on the blog list

2008-06-08 Thread Julio Protzek
Congratulations to the core team for being so open to the community
requests.
This is only proves how mature is the relation with the community.

Julio Vinicius Protzek

--~--~-~--~~~---~--~~
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: dual pagination

2008-06-08 Thread Dani

I had the same problem and solved it the same way.

It would be cool to have two paginated lists on the same page without
using AJAX



On May 21, 3:27 pm, "Mantas K." <[EMAIL PROTECTED]> wrote:
> I've made it with ajax. solving this problem with out it was to hard
> for me :)
>
> On May 21, 6:28 pm, leo <[EMAIL PROTECTED]> wrote:
>
> > Then I'd be looking at subclassing the paginator or defining my own
> > custom paginate method on the model - not difficult to do using LIMIT
> > and offsets. And it'll take a lot less time than casting around trying
> > to find a solution using what's there already.
>
> > On 21 Maig, 17:13, "Mantas K." <[EMAIL PROTECTED]> wrote:
>
> > > of course it works, but problem with this is that i cann't paginate
> > > them separatly
>
> > > On May 21, 5:53 pm, leo <[EMAIL PROTECTED]> wrote:
>
> > > > You can try this - no idea if it'll work and no time to try it ;)
>
> > > > $this->set('men', $this->paginate(null,array('gender'=>'1')));
> > > > $this->set('women', $this->paginate(null,array('gender'=>'2')));
>
> > > > On 21 Maig, 16:45, "Mantas K." <[EMAIL PROTECTED]> wrote:
>
> > > > > I have one table, but in view I show it as two. One one side there are
> > > > > men, on other women. They must have separate paginations.
> > > > > Is there solution how i can do 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: ACL schema

2008-06-08 Thread aranworld

In the context of the AuthComponent, you cannot use anything but the
alias in the second param.  The logic for this is in the
Auth::action() method.

-Aran

On Jun 8, 9:52 am, mbavio <[EMAIL PROTECTED]> wrote:
> The question is: can I use the same syntax for ACOS instead of alias.
> I mean the second param...
>
> Cheers,
> mbavio
>
> On Jun 7, 9:11 am, aranworld <[EMAIL PROTECTED]> wrote:
>
> > For some reason, I thought the AuthComponent used the username in it's
> > call to check but I can now see that in it's first parameter it is
> > using the array representing data from the User model.   For some
> > reason I thought that it used to use only the username alias?
>
> > On Jun 6, 12:30 pm, mbavio <[EMAIL PROTECTED]> wrote:
>
> > > Aran,
>
> > > I agree with your opinion about "crud" being cleaner, but, why do you
> > > say what only with:
>
> > > check('username', 'CamelCaseController', 'crudmappedaction');
>
> > > will work? You can use:
>
> > > check(array('model' => 'Model', 'foreign_key' => 'anID'),
> > > 'CamelCaseController', 'crudmappedaction');
>
> > > and complement it with Acl Behavior, that not set Alias by default.
>
> > > Just my two cents.
>
> > > Cheers,
> > > mbavio
>
> > > On May 27, 11:29 am, aranworld <[EMAIL PROTECTED]> wrote:
>
> > > > The Auth component has very specific rules for how it checks access.
> > > > In 'actions' mode, it will do:
> > > > check( 'username', 'CamelCaseController/action', *);
>
> > > > In 'crud' mode it will do:
> > > > check('username', 'CamelCaseController', 'crudmappedaction');
>
> > > > In light of this, your schema looks like it is meant to go with
> > > > 'actions' mode and you would have to have a controller X with actions
> > > > like approve_member, post_forum, remove_member, which sounds messy to
> > > > me, becuase the controllers are starting to just become catch-all
> > > > function repositories rather than Classes.
>
> > > > One thing you could do is have acos like this and use 'crud' mode:
>
> > > > ClubXForums
> > > > ClubXMembers
> > > > ClubYForums
> > > > ClubYMembers
> > > > ClubZForums
> > > > ClubZMembers
>
> > > > These would all map to controllers with the standard add, edit,
> > > > delete, view, index actions.  However, they would actually all be
> > > > empty controllers and would merely extend a more generic Forums and
> > > > Members controller.
>
> > > > So you have Tristan, who is a member of ClubX, but participates in the
> > > > admin of ClubY:
>
> > > > Acl->grant('Tristan', 'ClubXForums', array('read', 'create');
> > > > Acl->grant('Tristan', 'ClubXMembers', array('read');
> > > > Acl->grant('Tristan', 'ClubYForums', *);
> > > > Acl->grant('Tristan', 'ClubYMembers', *);
>
> > > > I have tried both crud and actions mode, and found that in the long
> > > > run it is much easier to manage crud mode, due to the reduced number
> > > > of ACO nodes.
>
> > > > -Aran
>
> > > > On May 27, 3:04 am, dmadruga <[EMAIL PROTECTED]> wrote:
>
> > > > > Hi folks!
> > > > > I'm trying to come up with a descent schema for the ACL of a tennis
> > > > > association website.
> > > > > Basically there are several tennis clubs, each club has several
> > > > > regular members and a committee of 3 to 5 members responsible for
> > > > > managing the club and accepting/rejecting new members. One person may
> > > > > be a member of several clubs, and may be in different positions in
> > > > > each one (for ex: Tom's a member of the club's X committee and a
> > > > > regular member of the club Y).
> > > > > The web system will centralize the management of all the clubs related
> > > > > to the association.
> > > > > A Guest will be allowed to sign up to the association and become a
> > > > > Member.
> > > > > A Member will be allowed to join a club.
> > > > > A Member of the committee will be allowed to edit information related
> > > > > to his club, approve/reject new members requests, among other
> > > > > operations.
> > > > > As soon as a new member is accepted to a club he'll be able to view
> > > > > information related to this club, post messages in the club's forum,
> > > > > and so on...
>
> > > > > The ACL schema that first came to my mind was something like this:
>
> > > > > _AROs_
> > > > > Admin (the group of site admins, those who will have full access to
> > > > > everything)
> > > > > Guests
> > > > > Members
> > > > > ---> Bob
> > > > > ---> Tom
> > > > > ---> John
>
> > > > > _ACOs_
> > > > > create_account (maps to the create_account method in the users
> > > > > controller)
> > > > > join_club (maps to the join_club method in the clubs controller)
> > > > > club
> > > > > ---> X
> > > > > --- ---> view
> > > > > --- ---> edit
> > > > > --- ---> delete
> > > > > --- ---> approve_member
> > > > > --- ---> post_forum
> > > > > --- ---> remove_member
> > > > > ---> Y
> > > > > --- ---> view
> > > > > --- ---> edit
> > > > > ...
> > > > > --- ---> remove_member
> > > > > ---> Z
> > > > > ...
>
> > > > > (X, Y, and Z are the clubs).
>
> >

Re: LIKE operator with a function

2008-06-08 Thread Dardo Sordi Bogado
From where are you obtainig the parameters for the query?

If from the URL, put this at the top of the view
$paginator->options(array('url' => $this->params['pass']));

2008/6/8 igorp <[EMAIL PROTECTED]>:
>
> Thanks,
>
> it works in CR1 but not with pagination. First page is OK but the next
> is empty because the query is different:
>
> first page is OK:
> 2   SELECT COUNT(*) AS `count` FROM `elilibs` AS `Elilib` WHERE
> `Elilib`.`nazev` LIKE CONVERT( _utf8 '%74AC1%' USING ASCII)
> 3   SELECT `Elilib`.`id`, `Elilib`.`nazev`, `Elilib`.`pouzdro`,
> `Elilib`.`sirka`, `Elilib`.`vyska`, `Elilib`.`knihovna` FROM `elilibs`
> AS `Elilib` WHERE `Elilib`.`nazev` LIKE CONVERT( _utf8 '%74AC1%' USING
> ASCII) ORDER BY `Elilib`.`nazev` asc LIMIT 50
>
>
> second page:
> 2   SELECT COUNT(*) AS `count` FROM `elilibs` AS `Elilib` WHERE
> `Elilib`.`nazev` LIKE CONVERT( _utf8 '' USING ASCII)
> 3   SELECT `Elilib`.`id`, `Elilib`.`nazev`, `Elilib`.`pouzdro`,
> `Elilib`.`sirka`, `Elilib`.`vyska`, `Elilib`.`knihovna` FROM `elilibs`
> AS `Elilib` WHERE `Elilib`.`nazev` LIKE CONVERT( _utf8 '' USING ASCII)
> ORDER BY `Elilib`.`nazev` asc LIMIT 50
>
> I do know I am getting boring but I didn't find how to insert my
> condition to next pages.
>
> On 4 Čen, 20:27, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
>> > Thanks for your help, but using -! didn't help much. Cakephp wrongly
>> > inserted a = before the LIKE.
>>
>> Then if you are using a version from SVN,
>>
>> $cond=array("Elilib.nazev LIKE"=> "-! CONVERT( _utf8
>> "."'".$this->data['Elilib']['nazev']."' USING ASCII)");
>>
>> Regards,
>> - Dardo Sordi.
>>
>> > = LIKE CONVERT( _utf8 '%74%' USING ASCII)
>>
>> > Regards
>>
>> > Igor
>>
>> > Dardo Sordi Bogado wrote:
>>
>> >>> It's wrong and I don't get any data. Is it a bug in cakephp or I a am
>> >>> doing something wrong?
>>
>> >> Cake is escaping your data, prepend "-!" to the condition.
>>
>> >> $cond=array("Elilib.nazev"=> "-! LIKE CONVERT( _utf8
>> >> "."'".$this->data['Elilib']['nazev']."' USING ASCII)");
>>
>> >> HTH,
>> >> - Dardo Sordi.
>>
>> > --
>> > View this message in 
>> > context:http://www.nabble.com/LIKE-operator-with-a-function-tp17631202p176496...
>> > Sent from the CakePHP mailing list archive at Nabble.com.
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Cookies in CakePHP

2008-06-08 Thread Stinkbug

Here is some test code that I used to test cookies with.

Session->check('user_id')) {
echo $this->Cookie->read('password');
$this->Session->setFlash('You are logged in!');
}
}

function getstarted() {
$password = Security::generateAuthKey();
$this->Cookie->write('password', $password);
if ($this->Study->User->save(array('password' => $password))) {
$this->Session->write('user_id', 
$this->Study->User->id);
}
//echo $this->Cookie->read('password');
$this->redirect('/studies');
}
}
?>

If I call the getstarted method first, after the redirect to the index
method I'm trying to read the cookie that I previously wrote and it's
not showing up.  Any ideas why?  I'm assuming I'm doing something
wrong.

--~--~-~--~~~---~--~~
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: LIKE operator with a function

2008-06-08 Thread igorp

Thanks,

it works in CR1 but not with pagination. First page is OK but the next
is empty because the query is different:

first page is OK:
2   SELECT COUNT(*) AS `count` FROM `elilibs` AS `Elilib` WHERE
`Elilib`.`nazev` LIKE CONVERT( _utf8 '%74AC1%' USING ASCII)
3   SELECT `Elilib`.`id`, `Elilib`.`nazev`, `Elilib`.`pouzdro`,
`Elilib`.`sirka`, `Elilib`.`vyska`, `Elilib`.`knihovna` FROM `elilibs`
AS `Elilib` WHERE `Elilib`.`nazev` LIKE CONVERT( _utf8 '%74AC1%' USING
ASCII) ORDER BY `Elilib`.`nazev` asc LIMIT 50


second page:
2   SELECT COUNT(*) AS `count` FROM `elilibs` AS `Elilib` WHERE
`Elilib`.`nazev` LIKE CONVERT( _utf8 '' USING ASCII)
3   SELECT `Elilib`.`id`, `Elilib`.`nazev`, `Elilib`.`pouzdro`,
`Elilib`.`sirka`, `Elilib`.`vyska`, `Elilib`.`knihovna` FROM `elilibs`
AS `Elilib` WHERE `Elilib`.`nazev` LIKE CONVERT( _utf8 '' USING ASCII)
ORDER BY `Elilib`.`nazev` asc LIMIT 50

I do know I am getting boring but I didn't find how to insert my
condition to next pages.

On 4 Čen, 20:27, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> > Thanks for your help, but using -! didn't help much. Cakephp wrongly
> > inserted a = before the LIKE.
>
> Then if you are using a version from SVN,
>
> $cond=array("Elilib.nazev LIKE"=> "-! CONVERT( _utf8
> "."'".$this->data['Elilib']['nazev']."' USING ASCII)");
>
> Regards,
> - Dardo Sordi.
>
> > = LIKE CONVERT( _utf8 '%74%' USING ASCII)
>
> > Regards
>
> > Igor
>
> > Dardo Sordi Bogado wrote:
>
> >>> It's wrong and I don't get any data. Is it a bug in cakephp or I a am
> >>> doing something wrong?
>
> >> Cake is escaping your data, prepend "-!" to the condition.
>
> >> $cond=array("Elilib.nazev"=> "-! LIKE CONVERT( _utf8
> >> "."'".$this->data['Elilib']['nazev']."' USING ASCII)");
>
> >> HTH,
> >> - Dardo Sordi.
>
> > --
> > View this message in 
> > context:http://www.nabble.com/LIKE-operator-with-a-function-tp17631202p176496...
> > Sent from the CakePHP mailing list archive at Nabble.com.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: From sql query to XML

2008-06-08 Thread Kurto

I'm begginer of cakephp, I don't know very much so i need a step by
step help to produce an XML document, what I need to do in the
controller and what in the view etc.
Thks
Kurto




On 8 Giu, 20:33, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> > I haven't found any documentation for produce XML document in
> > cakePHP.
> > Someone can help me?
>
> How is producing XML in cake harder than producing XHTML ?
>
> > Thks Kurto

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Build #s for CakePHP Applications

2008-06-08 Thread Ken

Like a good developer I want to set up a continuous integration
process for my cake app. I can make ant work for me, but what do
people recommend as far as tagging each deployment with a build #? I
would like to use a scheme like:

1.00.bbb.p (where bbb is build and p is patch)

...and I would like my build/deployment process to label the build in
SVN and then somehow get the version/build # onto the default layout.

Thoughts?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Please include CakeBaker on the blog list

2008-06-08 Thread villas

Thanks Cake Team for reviewing the Blog List so quickly. It seems more
relevant now and that means a better "shop window" for Cake.  It's
nice to belong to a community where people can put their differences
aside in favour of what's best for all.  Thanks to Nate for taking the
time to take on board the comments,  I'm already a regular visitor to
debuggable.com so it will be great to also see him there.

With RC1 also now on the Cake website,  things are looking great!


On Jun 5, 12:43 pm, villas <[EMAIL PROTECTED]> wrote:
> @TommyO
>
> The main points are really that (a) the featured blog list should
> contain the best blogs, (b) the community could have some input to
> recommend the ones they like.
>
> A featured blog doesn't have to be the "highest" quality,  but simply
> amongst the best ones that exist. It is a relative measure.  Some of
> the currently featured blogs hardly mention Cake at all,  and that
> cannot be right.
>
> As with anything else which has been found lacking with Cake,  the
> Team will no doubt eventually address it.  That's why the project has
> become so good,  and why the bloggers have something to write about.
>
> On Jun 4, 3:47 pm, TommyO <[EMAIL PROTECTED]> wrote:
>
> > Seems a lot of people took up this argument for the sake of argument.
> > My two cents does not care about personal relations between the Daniel
> > and the core team.
>
> > My opinion is that although prolific,CakeBaker'sposts are NOT "of
> > the highest quality".  I often have to tell noobs "don't do it that
> > way" or "that's not true" when they insist on following one of the
> > articles.  Sorry, Daniel, but since it's been put out there and the
> > arguments are about people's right to voice...
>
> > I'm also of the opinion that good contributions belong in the Bakery,
> > not scattered haphazardly about the net.  So blog all you want, but
> > the project shouldn't be obligated to send Blogger Joe traffic to
> > increase his AdSense returns.
>
> > My "vote" then is a sound No.
--~--~-~--~~~---~--~~
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: how to switch DB config settings?

2008-06-08 Thread Dardo Sordi Bogado

Google has stopped working?

http://cakebaker.42dh.com/2006/02/24/switch-your-database-configuration-based-on-some-criteria/
http://bin.cakephp.org/saved/32

On Sun, Jun 8, 2008 at 6:17 PM, K3 <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> How can i switch/set different DB config variable depending on value
> in $_ENV["COMPUTERNAME"]? I need this so the same DB setting file can
> be used on local development and remote production server without any
> changed.
>
> Thanks in advance.
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



how to switch DB config settings?

2008-06-08 Thread K3

Hi,

How can i switch/set different DB config variable depending on value
in $_ENV["COMPUTERNAME"]? I need this so the same DB setting file can
be used on local development and remote production server without any
changed.

Thanks in advance.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: DateFormat and date in TimeStamp

2008-06-08 Thread foxmask

i found a solution :
in my CalendarController i did :
function edit {
[...]
if (empty($this->data)) {
$this->data = $this->Calendar->read(null, $id);
}
#as CakePHP does not "understand" a unix timestamp i force the type to
integer thus Cake will see
#it correctly to transform the timestamp in 3 arrays for the date;
$this->data['Calendar']['date'] = (integer) $this->data['Calendar']
['date'];
}



On 8 juin, 18:47, "b logica" <[EMAIL PROTECTED]> wrote:
> I think that you might be mixing up timestamps and date strings.
> mktime() returns a UNIX timestamp, which is an integer, being the
> number of seconds elapsed since Ken Thompson & Dennis Ritchie say so.
> While you may have a timestamp column in your DB, it's probably
> serving the data up formatted as a date string, much like a DATETIME
> column.
>
> "2008-06-08 12:25:32" (or "20080608122532") vs "1212942514"
>
> strtotime() can use the former but the latter needs to be converted
> into some kind of date string first.
>
> In any case, I can't quite understand what it is you need to do.
> Perhaps all of this is unnecessary.
>
> On Sun, Jun 8, 2008 at 6:57 AM, foxmask <[EMAIL PROTECTED]> wrote:
>
> > Hello,
> > my database table contain a date in integer to store a timestamp.
>
> > When , in my form i write this in my form :
> >  >>input('date',array('type'=>'date','label'=>false,'dateFormat'=>'DMY'));?
>
> > i can get the data like this to store them in my date column:
>
> > $m = (integer) $this->data['Calendar']['date']['month'];
> > $d = (integer) $this->data['Calendar']['date']['day'];
> > $y = (integer) $this->data['Calendar']['date']['year'];
> > if ( !checkdate ($m,$d,$y) ) {
> >$common_warning = __('the date is not a valid',true);
> > }
> > else
> >$this->data['Calendar']['date'] = 
> > mktime(0,0,0,$this->data['Calendar']
> > ['date']['month'],
> >
> > $this->data['Calendar']['date']['day'],
> >
> > $this->data['Calendar']['date']['year']);
>
> > My problem is : when i edit the data from my form,
> > instead of displaying 08 june 2008
> > i read :1 january 2028 !
>
> > this is the fault of the strtotime function used in the function year
> > of the form helper...
>
> > My Question is : how can i give the Cake the correct format of my date
> > before displaying the edit form .?
>
> > i have tried $this->data['Calendar']['date']  = date("Y-m-d",$this-
> >>data['Calendar']['date']) ;
> > but that does not do the trick.
>
> > Regards.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Help me to merge wamp with cakephp

2008-06-08 Thread Dardo Sordi Bogado

http://manual.cakephp.org

On Sun, Jun 8, 2008 at 2:21 PM, pradeep S <[EMAIL PROTECTED]> wrote:
>
> Hello,
>i am brand new to cakephp.. i was working wamp server to
> handle my
> php projects.. now i am insisted to change to cake by my project
> providers.
> I tried configuring it.. donno where to start with..
> i have downloaded cake_1.2.0.6311-beta. Extracted to the existing web
> root
> folder www name as cake..
> changed the database.php for database settings..
> changed the value for security salt..
> Every error that showed on the webroot index was cleared but still i
> could
> start with my new project
> Plz some one let me know how to configure the wamp for cakephp..
> Thanks in advance!!!
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: From sql query to XML

2008-06-08 Thread Dardo Sordi Bogado

> I haven't found any documentation for produce XML document in
> cakePHP.
> Someone can help me?

How is producing XML in cake harder than producing XHTML ?


> Thks Kurto
>
> >
>

--~--~-~--~~~---~--~~
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: From sql query to XML

2008-06-08 Thread Dardo Sordi Bogado

> I haven't found any documentation for produce XML document in
> cakePHP.
> Someone can help me?

How is producing XML in cake harder than producing XHTML ?


> Thks Kurto
>
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Help me to merge wamp with cakephp

2008-06-08 Thread pradeep S

Hello,
i am brand new to cakephp.. i was working wamp server to
handle my
php projects.. now i am insisted to change to cake by my project
providers.
I tried configuring it.. donno where to start with..
i have downloaded cake_1.2.0.6311-beta. Extracted to the existing web
root
folder www name as cake..
changed the database.php for database settings..
changed the value for security salt..
Every error that showed on the webroot index was cleared but still i
could
start with my new project
Plz some one let me know how to configure the wamp for cakephp..
Thanks in advance!!!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



From sql query to XML

2008-06-08 Thread Kurto

Hi everybody, I need to output an XML file from an sql query over an
database table.
Simply I execute the action  $this->Person->findAll() for get all
record of my table 'people' and I want to put the result in ad XML
file.

I haven't found any documentation for produce XML document in
cakePHP.
Someone can help me?

Thks Kurto

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Script protection

2008-06-08 Thread koko

Hey,

I didn't find a better place to discuss this topic than this group of
bakers ;-) , because CakePHP offers a very customizable and reusable
code !!

I bake sites always and always have the same fears, "stealing my
scripts"  of course you know that it's very easy to steal Cake's
scripts or reuse them without your permission ... all you have to do
is to edit database.php file and some new CSS and go !! you have a new
site without having to pay !!!

I have many things in my mind to prevent this:

1- Write a Contract with the client with some statements to prevent
him from reusing it (EULA)
2- Tracing the stolen scripts and open a case in the court.
3- Using Zend Encoder to encode it (but it's breakable !!)
4- Some PHP tricks like passing a parameter to delete some files if
the script is stolen


You maybe have the same problem, so let's share them


--~--~-~--~~~---~--~~
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: Update from 1.2 beta to rc leads to huge perfomance drop

2008-06-08 Thread NOSLOW

"I'm trying to write a enterprise resource planning Software wirth
cake."

You mean you're using Cake to write something that's not a blog
application?? Well there's your problem. 

All kidding aside, I'm also using Cake to write an enterprise system
that manages loan underwriting for community banks. With over 60
tables (so far, another 60 are in the works for the next phase) I'm
experiencing similar performance problems with debug on. The problem
appears to be the creating/writing of the 60 cache files inside app\tmp
\cache\models with each request. During development, I'm suffering
through 3+ second response times!!  The good news is that on the
dedicated beefy production server (with debug=0), the response times
are sub-second and feels real snappy to the user. The data is served
fresh each request (no caching there...not wanted either), and the
files in app\tmp\cache\models don't change. This must be where the
performance hit is.

The interesting thing is that bulk of the performance hit takes place
prior the app controller's "beforeFilter". I traced it through a while
back and it was in the dispatcher.php, $controller->constructClasses()
where it was traversing through all the relationships defined in the
models. Even though I have $recursive = 0 and use the new Containable
behavior (was previously using the bindable behavior), it appears to
be too late. I guess contructClasses ignores $recursive = 0...or am I
missing something?

Again, performance is more than adequate on good server hardware with
debug=0, but the performance hit during development is quite
noticeable. The only solution I see is to start removing all the
default relationships defined in the model and use bindModel before
every call. I hope to learn otherwise in this thread.
--~--~-~--~~~---~--~~
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: ACL schema

2008-06-08 Thread mbavio

The question is: can I use the same syntax for ACOS instead of alias.
I mean the second param...

Cheers,
mbavio

On Jun 7, 9:11 am, aranworld <[EMAIL PROTECTED]> wrote:
> For some reason, I thought the AuthComponent used the username in it's
> call to check but I can now see that in it's first parameter it is
> using the array representing data from the User model.   For some
> reason I thought that it used to use only the username alias?
>
> On Jun 6, 12:30 pm, mbavio <[EMAIL PROTECTED]> wrote:
>
> > Aran,
>
> > I agree with your opinion about "crud" being cleaner, but, why do you
> > say what only with:
>
> > check('username', 'CamelCaseController', 'crudmappedaction');
>
> > will work? You can use:
>
> > check(array('model' => 'Model', 'foreign_key' => 'anID'),
> > 'CamelCaseController', 'crudmappedaction');
>
> > and complement it with Acl Behavior, that not set Alias by default.
>
> > Just my two cents.
>
> > Cheers,
> > mbavio
>
> > On May 27, 11:29 am, aranworld <[EMAIL PROTECTED]> wrote:
>
> > > The Auth component has very specific rules for how it checks access.
> > > In 'actions' mode, it will do:
> > > check( 'username', 'CamelCaseController/action', *);
>
> > > In 'crud' mode it will do:
> > > check('username', 'CamelCaseController', 'crudmappedaction');
>
> > > In light of this, your schema looks like it is meant to go with
> > > 'actions' mode and you would have to have a controller X with actions
> > > like approve_member, post_forum, remove_member, which sounds messy to
> > > me, becuase the controllers are starting to just become catch-all
> > > function repositories rather than Classes.
>
> > > One thing you could do is have acos like this and use 'crud' mode:
>
> > > ClubXForums
> > > ClubXMembers
> > > ClubYForums
> > > ClubYMembers
> > > ClubZForums
> > > ClubZMembers
>
> > > These would all map to controllers with the standard add, edit,
> > > delete, view, index actions.  However, they would actually all be
> > > empty controllers and would merely extend a more generic Forums and
> > > Members controller.
>
> > > So you have Tristan, who is a member of ClubX, but participates in the
> > > admin of ClubY:
>
> > > Acl->grant('Tristan', 'ClubXForums', array('read', 'create');
> > > Acl->grant('Tristan', 'ClubXMembers', array('read');
> > > Acl->grant('Tristan', 'ClubYForums', *);
> > > Acl->grant('Tristan', 'ClubYMembers', *);
>
> > > I have tried both crud and actions mode, and found that in the long
> > > run it is much easier to manage crud mode, due to the reduced number
> > > of ACO nodes.
>
> > > -Aran
>
> > > On May 27, 3:04 am, dmadruga <[EMAIL PROTECTED]> wrote:
>
> > > > Hi folks!
> > > > I'm trying to come up with a descent schema for the ACL of a tennis
> > > > association website.
> > > > Basically there are several tennis clubs, each club has several
> > > > regular members and a committee of 3 to 5 members responsible for
> > > > managing the club and accepting/rejecting new members. One person may
> > > > be a member of several clubs, and may be in different positions in
> > > > each one (for ex: Tom's a member of the club's X committee and a
> > > > regular member of the club Y).
> > > > The web system will centralize the management of all the clubs related
> > > > to the association.
> > > > A Guest will be allowed to sign up to the association and become a
> > > > Member.
> > > > A Member will be allowed to join a club.
> > > > A Member of the committee will be allowed to edit information related
> > > > to his club, approve/reject new members requests, among other
> > > > operations.
> > > > As soon as a new member is accepted to a club he'll be able to view
> > > > information related to this club, post messages in the club's forum,
> > > > and so on...
>
> > > > The ACL schema that first came to my mind was something like this:
>
> > > > _AROs_
> > > > Admin (the group of site admins, those who will have full access to
> > > > everything)
> > > > Guests
> > > > Members
> > > > ---> Bob
> > > > ---> Tom
> > > > ---> John
>
> > > > _ACOs_
> > > > create_account (maps to the create_account method in the users
> > > > controller)
> > > > join_club (maps to the join_club method in the clubs controller)
> > > > club
> > > > ---> X
> > > > --- ---> view
> > > > --- ---> edit
> > > > --- ---> delete
> > > > --- ---> approve_member
> > > > --- ---> post_forum
> > > > --- ---> remove_member
> > > > ---> Y
> > > > --- ---> view
> > > > --- ---> edit
> > > > ...
> > > > --- ---> remove_member
> > > > ---> Z
> > > > ...
>
> > > > (X, Y, and Z are the clubs).
>
> > > > As far as I understood I'll be able to allow an specific user (say
> > > > Bob) to perform an specific operation (say club/Y/approve_member).
> > > > Am I wrong?
> > > > Then, in the method that performs this operation I can check if Bob
> > > > (the logged user) is allowed to perform the operation for the current
> > > > club (say .../clubs/approve_member/).
> > > > Right?
>
> > > > I also though about creating

Re: DateFormat and date in TimeStamp

2008-06-08 Thread b logica

I think that you might be mixing up timestamps and date strings.
mktime() returns a UNIX timestamp, which is an integer, being the
number of seconds elapsed since Ken Thompson & Dennis Ritchie say so.
While you may have a timestamp column in your DB, it's probably
serving the data up formatted as a date string, much like a DATETIME
column.

"2008-06-08 12:25:32" (or "20080608122532") vs "1212942514"

strtotime() can use the former but the latter needs to be converted
into some kind of date string first.

In any case, I can't quite understand what it is you need to do.
Perhaps all of this is unnecessary.

On Sun, Jun 8, 2008 at 6:57 AM, foxmask <[EMAIL PROTECTED]> wrote:
>
> Hello,
> my database table contain a date in integer to store a timestamp.
>
> When , in my form i write this in my form :
> >input('date',array('type'=>'date','label'=>false,'dateFormat'=>'DMY'));?
>>
>
> i can get the data like this to store them in my date column:
>
> $m = (integer) $this->data['Calendar']['date']['month'];
> $d = (integer) $this->data['Calendar']['date']['day'];
> $y = (integer) $this->data['Calendar']['date']['year'];
> if ( !checkdate ($m,$d,$y) ) {
>$common_warning = __('the date is not a valid',true);
> }
> else
>$this->data['Calendar']['date'] = mktime(0,0,0,$this->data['Calendar']
> ['date']['month'],
>
> $this->data['Calendar']['date']['day'],
>
> $this->data['Calendar']['date']['year']);
>
>
> My problem is : when i edit the data from my form,
> instead of displaying 08 june 2008
> i read :1 january 2028 !
>
> this is the fault of the strtotime function used in the function year
> of the form helper...
>
>
> My Question is : how can i give the Cake the correct format of my date
> before displaying the edit form .?
>
> i have tried $this->data['Calendar']['date']  = date("Y-m-d",$this-
>>data['Calendar']['date']) ;
> but that does not do the trick.
>
> Regards.
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Strict or Pretty? We're looking for a few good opinions

2008-06-08 Thread b logica

Very stupid things are *often* done in the quest for pretty.

On Sun, Jun 8, 2008 at 5:29 AM, phpjoy <[EMAIL PROTECTED]> wrote:
>
> Point your heads up towards PHP6, leave standards but not too far.
> Sometimes very stupid things can be done in the quest for standards..
>

--~--~-~--~~~---~--~~
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: reset Session variables without any visible cause

2008-06-08 Thread b logica

On Sun, Jun 8, 2008 at 4:34 AM, Mike52 <[EMAIL PROTECTED]> wrote:
>
> I noticed this problem after upgrading from 1.2.0.6311 beta to
> 1.2.0.7125 RC1
>
> My captcha check did not work after upgrading.
> I am using this captcha http://captcha.ru/en/kcaptcha/ in the vendors
> directory.
> The render method for the image does this:
>  $this->controller->Session->write('captcha', $kcaptcha-
>>getKeyString());
>
> In the controller action (user registration) the value entered by the
> user is checked against the value in the session:
>  if ($this->data['User']['captchaCode'] != $_SESSION['captcha']) {
>
> In the beta version of CakePHP,  this works fine.
>
> In the RC version, $_SESSION['captcha'] is not set.
>
> This is a clear and reproducable difference between the 2 Cakephp
> versions.
> Any suggestions where to look next?

$this->controller->Session != $_SESSION

Also, if Security.level set to 'high' you might want to bring it down
a notch. That's known to cause this sort of problem, as well.

Configure::write('Security.level', 'medium');

--~--~-~--~~~---~--~~
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: paginator options newbie question

2008-06-08 Thread b logica

It's in the source:

http://api.cakephp.org/1.2/paginator_8php-source.html#l00069

You have to scroll back up to see it because the ID is in the wrong
place in the HTML.

On Sat, Jun 7, 2008 at 9:53 PM, . <[EMAIL PROTECTED]> wrote:
> I am using cake rc1
>
> In the following link, i am trying to find the list of keys for the
> 'options' variable, but can't find it. does any one have the link to all of
> the available keys?
>
> http://api.cakephp.org/1.2/class_paginator_helper.html#9c836737a166d2cdb2c0f666add5d845
>
> 2) I am trying to set up the paginator so that when it reaches the last
> page, the Next button will return to the first page.
>
> Something like this:
> echo $paginator->next('Next', array(), 'Next', array('page'=>1));
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: duplicate URL's Getting Indexed

2008-06-08 Thread Simon COURTOIS

Kyle Decot wrote On 06/08/2008 05:14 PM:
> I looked on google today and I noticed that both:
>
> www.affinityskateboards.com/app/webroot/team/
> www.affinityskateboards.com/team/
>
> are getting indexed by google. Is there a way to set a redirect to
> prevent this from happening? Thanks as alway
Hi,

It's like if you have a development configuration...
Is it normal ?
The DocumentRoot should be on /app/webroot if it's a production 
configuration.

-- 
Simon COURTOIS
{EPITECH.} tek4 | (LINAGORA) Developer | [ADITAM] Project Manager
10, rue Brillat-Savarin 75013 Paris | 01 45 42 72 30 - 06 72 44 67 81
http://www.happynoff.fr


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



duplicate URL's Getting Indexed

2008-06-08 Thread Kyle Decot

I looked on google today and I noticed that both:

www.affinityskateboards.com/app/webroot/team/
www.affinityskateboards.com/team/

are getting indexed by google. Is there a way to set a redirect to
prevent this from happening? Thanks as always


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



DateFormat and date in TimeStamp

2008-06-08 Thread foxmask

Hello,
my database table contain a date in integer to store a timestamp.

When , in my form i write this in my form :
input('date',array('type'=>'date','label'=>false,'dateFormat'=>'DMY'));?
>

i can get the data like this to store them in my date column:

$m = (integer) $this->data['Calendar']['date']['month'];
$d = (integer) $this->data['Calendar']['date']['day'];
$y = (integer) $this->data['Calendar']['date']['year'];
if ( !checkdate ($m,$d,$y) ) {
$common_warning = __('the date is not a valid',true);
}
else
$this->data['Calendar']['date'] = mktime(0,0,0,$this->data['Calendar']
['date']['month'],

$this->data['Calendar']['date']['day'],

$this->data['Calendar']['date']['year']);


My problem is : when i edit the data from my form,
instead of displaying 08 june 2008
i read :1 january 2028 !

this is the fault of the strtotime function used in the function year
of the form helper...


My Question is : how can i give the Cake the correct format of my date
before displaying the edit form .?

i have tried $this->data['Calendar']['date']  = date("Y-m-d",$this-
>data['Calendar']['date']) ;
but that does not do the trick.

Regards.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Select or text field depending on another select

2008-06-08 Thread Mário Jorge

dandreta, search for "ajax observe field" on this group that you will
find a answer. ok...

On Jun 7, 5:02 am, dandreta <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am doing searchs in my cake application. I have a select with
> options and a text field. I want that if in this select is chosen
> option 1 or option 2, the text field is kept to introduce the text to
> search, but if the selected option is 3, I want that the text field is
> replaced by another new select with 2 options.
>
> Has anyone made something similar? How can I do that?
>
> Thanks and regards.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: newbie pagination

2008-06-08 Thread Dardo Sordi Bogado

Can you post your complete controller code ?

use bin.cakephp.org

On Sun, Jun 8, 2008 at 4:52 AM, . <[EMAIL PROTECTED]> wrote:
> When using cake 1.2 RC1 pagination, how would I dynamically start at
> different pages
>
> I have this at the top of my controller:
> var $paginate = array('List'=>array('limit'=>10, 'page'=>1));
>
> However, I want to be able to change this in my methods. The following does
> not work, does anybody know how to get this to work?
>
> function index($startAt)
> {
> $this->paginate = array('List'=>array('limit'=>10, 'page'=>$startAt));
> }
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: controller paginate method

2008-06-08 Thread Dardo Sordi Bogado

I don't know why I've searched in the source since it's well
documented in the manual:
http://book.cakephp.org/view/165/controller-setup

doh!

On Sun, Jun 8, 2008 at 10:30 AM, Dardo Sordi Bogado
<[EMAIL PROTECTED]> wrote:
> Right after line 106 of controller.php,
> http://api.cakephp.org/libs_2controller_2controller_8php-source.html#l00106
>
> 
> The keys that can be included in this array are: 'conditions',
> 'fields', 'order', 'limit', 'page', and 'recursive',
> similar to the parameters of Model->findAll().
> 
>
> Also if you are using the Containable behavior you can pass it 'contain'.
>
> On Sun, Jun 8, 2008 at 12:30 AM, . <[EMAIL PROTECTED]> wrote:
>> in cake RC1 1.2, what are the options available for the controller method
>> $this->paginate(model, options, ? ? ? )
>>
>> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: controller paginate method

2008-06-08 Thread Dardo Sordi Bogado

Right after line 106 of controller.php,
http://api.cakephp.org/libs_2controller_2controller_8php-source.html#l00106


The keys that can be included in this array are: 'conditions',
'fields', 'order', 'limit', 'page', and 'recursive',
similar to the parameters of Model->findAll().


Also if you are using the Containable behavior you can pass it 'contain'.

On Sun, Jun 8, 2008 at 12:30 AM, . <[EMAIL PROTECTED]> wrote:
> in cake RC1 1.2, what are the options available for the controller method
> $this->paginate(model, options, ? ? ? )
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Strict or Pretty? We're looking for a few good opinions

2008-06-08 Thread phpjoy

Point your heads up towards PHP6, leave standards but not too far.
Sometimes very stupid things can be done in the quest for standards..

On Jun 7, 5:14 am, Nate <[EMAIL PROTECTED]> wrote:
> So, we all love the simplicity and magic that Cake gives us.  It's
> wonderful that we've even been able to deliver these things with
> relative consistency and transparency across both major versions (and
> many minor versions) of PHP.  It's these things that make Cake what it
> is.  In order to get these things to work the way they do, we've had
> to pull quite a few tricks and it wasn't all very easy.
>
> As we all know, the next major version of CakePHP will only have to
> worry about supporting one PHP version.  This is going to open up new
> worlds of possibility for streamlining your code and development
> processes, and creating simple, pretty syntax constructs.
>
> We're currently in the exploratory phases of figuring out what some of
> the API constructs for Cake 2.0 might look like, and have come to
> somewhat of an empasse in several key areas.  In these areas (and
> undoubtedly other similar ones down the road) taking advantage of
> certain functionality that would help us keep Cake simple while taking
> advantage of more advanced object oriented features means breaking
> strict mode compatibility.
>
> Now, rather than give specifics and turn this into a discussion about
> semantics, I've decided to pose this as a general question, which we
> can use as a guideline moving forward: assuming we follow the "spirit
> of the law" in all other areas (i.e. using proper visibility modifiers
> in classes, cleaning up object handling to comply with PHP5, etc.),
> would you consider it acceptable to break strict mode in a few key
> (forward-compatible) areas if it meant significantly simplifying code
> and/or eliminating extra work you would otherwise have to do?  As a
> "feature", how important is absolute compliance with strict-mode
> standards?
>
> We may at some point set up a polling system and put the issue to an
> actual vote, but for now, we're just looking for opinions one way or
> the other, so let us know what you think.
--~--~-~--~~~---~--~~
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: dynamic variable names?

2008-06-08 Thread Simon COURTOIS

Dave wrote On 06/08/2008 02:33 AM:
> ok I got this array from the facebook API:
>
> [...]
>
> now i wrote a function split_vars() that should write the value of
> nid, name, type, status and year into one variable. since there are
> more than one arrays (2 in this case) it would be good if i could have
> the number of the array in the name of the variable so that
> $affiliations_1_name should echo "Luxembourg".
>
> I wrote this:
>
> function split_vars(){
> //This is just a part of the function, $user_info is the "big" array
> where all the user_info data is
> global $user_info, $affiliations, ${'affiliations_'.$i.'_nid'}, $
> {'affiliations_'.$i.'_name'}, ${'affiliations_'.$i.'_type'}, $
> {'affiliations_'.$i.'_status'}, ${'affiliations_'.$i.'_year'};
>
>   for($i=0;$i   $affiliations = $user_info[0]['affiliations'][$i];
>   ${'affiliations_'.$i.'_nid'} = $affiliations['nid'];
>   ${'affiliations_'.$i.'_name'} = $affiliations['name'];
>   ${'affiliations_'.$i.'_type'} = $affiliations['type'];
>   ${'affiliations_'.$i.'_status'} = 
> $affiliations['status'];
>   ${'affiliations_'.$i.'_year'} = $affiliations['year'];
>   }
> }
>
> and outside of the variable I need to echo all these variable
> variables.
>
> But I get a Parse error:  syntax error, unexpected ',' in line where
> globals are declared.
>   
Ok there is the thing.

with php you don't declare a global variable with global $var. when you 
use global you say 'I wanna use this $var in my function even if it has 
been declared in superior scope'.
For example :

function say_hello()
{
global $hello;
echo $hello;
}

say_hello();
$hello = 'hi';
say_hello();

This script will echo nothing and hi, because the second time the 
variable has a value.
I think you see this in a C/C++ way. That's not PHP's way.

another thing. when you write global ${'affiliations_'.$i.'_nid'}, it 
can't be good, $i is not even declared at this point.

-- 
Simon COURTOIS
{EPITECH.} tek4 | (LINAGORA) Developer | [ADITAM] Project Manager
10, rue Brillat-Savarin 75013 Paris | 01 45 42 72 30 - 06 72 44 67 81
http://www.happynoff.fr


--~--~-~--~~~---~--~~
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: reset Session variables without any visible cause

2008-06-08 Thread Mike52

I noticed this problem after upgrading from 1.2.0.6311 beta to
1.2.0.7125 RC1

My captcha check did not work after upgrading.
I am using this captcha http://captcha.ru/en/kcaptcha/ in the vendors
directory.
The render method for the image does this:
  $this->controller->Session->write('captcha', $kcaptcha-
>getKeyString());

In the controller action (user registration) the value entered by the
user is checked against the value in the session:
  if ($this->data['User']['captchaCode'] != $_SESSION['captcha']) {

In the beta version of CakePHP,  this works fine.

In the RC version, $_SESSION['captcha'] is not set.

This is a clear and reproducable difference between the 2 Cakephp
versions.
Any suggestions where to look next?

-- Mike

On Jun 6, 12:09 am, francky06l <[EMAIL PROTECTED]> wrote:
> What I have noticed is, in case of Debug > 0, if you have error in
> your code that generates warning or error before you render the view,
> usually you loose yoursession. Basically you can make an error in
> view, you will be ok, in model or controller yoursessionis lost.
> Maybe I am wrong, and this was base to the 1.2 branch few weeks ago. I
> will make some more tests.
> As Chris said, I am using checkAgent => false, and security.Level to
> medium.
> hth
>
> On Jun 5, 9:36 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
>
> > On Thu, Jun 5, 2008 at 3:27 PM, Jeff <[EMAIL PROTECTED]> wrote:
> > > But, the question is, why does it happen sometimes (randomly) and not
> > > other times.  I
> > > know exactly what the others are going through, because it is
> > > happening
> > > on my site too. I can do the exact same steps that killed mysession,
> > > and it will
> > > work.  If it was a coding error, then it would be reproducible by
> > > doing the exact
> > > same thing that caused it to fail the first time.
>
> > When things happen randomly, there are usually two possible problems:
>
> > 1) the framework is wrong
> > 2) your own code is wrong
>
> > While I will concede that from time to time, the framework is wrong,
> > more often than not it is your own code that is wrong.  This is not
> > meant as a slight, this is simply reality.  I write shitty code all
> > the time and when the app goes kablooey it is my fault, not the
> > framework.
>
> > None of the people who complained in the thread about having problems
> > bothered to provide code samples, so who the hell knows what the
> > problem really is.  Show us a sample inhttp://bin.cakephp.orgofyour
> > code that is not working properly and that might point these people in
> > the right direction.
>
> > --
> > Chris Hartjes
> > Internet Loudmouth
> > Motto for 2008: "Moving from herding elephants to handling snakes..."
> > @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
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: dynamic variable names?

2008-06-08 Thread Joe

You could do

$Varname = 'test';
$test = 'Hello';
echo $$Varname;

Should echo 'Hello'

On Jun 7, 7:54 pm, Dave <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> first post :)
>
> my question: is it possible to have dynamic variable names, I mean
> something like this:
>
> for($i=0;$i $y_$i = blabla;
>
> }
>
> in other words I want the number of the loop to be displayer in the
> name of the variable.
>
> Thanks for 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



newbie pagination

2008-06-08 Thread .
When using cake 1.2 RC1 pagination, how would I dynamically start at
different pages

I have this at the top of my controller:
var $paginate = array('List'=>array('limit'=>10, 'page'=>1));

However, I want to be able to change this in my methods. The following does
not work, does anybody know how to get this to work?

function index($startAt)
{
$this->paginate = array('List'=>array('limit'=>10, 'page'=>$startAt));
}

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---