Re: How to upgrade TLS version in cakePHP

2016-03-14 Thread Борислав Събев Borislav Sabev
This has nothing to do with CakePHP - it is a pure-PHP issue.
Maybe the versions of PHP you use in the CLI (terminal) abd web are 
different? Check which is which and if different see how to configure the 
web-based one.

It really depends on what OS you are running this. Any web application 
could choose a different PHP version (if available on the server) via the 
web server config. For example, if it is Apache, this could change in the 
.htaccess or in the apache config files.

You need to investigate more but one thing is sure - this is not a Cake 
issue.

Hope this helped.
Cheers, Borislav.



On Monday, 14 March 2016 05:33:39 UTC+2, Arun NV wrote:
>
>
> down votefavorite 
> 
>
> I am using *cakePHP2.2.1* and *PHP5.3.10*.And i have updated *curl* and 
> *libcurl* now curl is supporting *TLS 1.2* in *terminal*. But when i am 
> trying to send *curl* request in *cakePHP* it's shows the*TLS* version as 
> *1.1*. Is there anyway to configure *TLS* in *cakePHP*?
>
>

-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Cake 2.5.1 Extremely Slow With MSSQL?

2014-08-15 Thread Борислав Събев Borislav Sabev
I've been following this theme for quite some time now and I need to ask:

Why would anyone want to use MSSQL with PHP? 

And before anyone starts getting evangelist on me:
Yes, MSSQL could be considered an advantage over MySQL and it is. Sure! But 
IT IS NOT THE ONLY OPTION and it is very,very poorly supported if your 
application is hosted on Unix/Linux. 
Historically, PHP was made to work in the Unix/Linux environment and then 
*ported 
to MS Win/IIS*. We all know that Microsoft loves to hate the Penguin.
Has anyone used the FreeTDS driver on Linux? I sure have and not by my own 
choice. It does not support transactions... Yes! Transactions!!

Why does Microsoft NOT produce a good driver for their DB but for 
Linux/Unix?
Why would you want to pay Microsoft's fees if they don't really support 
you? 
Why would you want to run your code with the disadvantages that hosting it 
on MS IIS and still pay them?

The bottom line is: *Microsoft wants to sell their shit* *and for loads of 
cash*. 
They will do this at any cost and the first thing they do is to push us all 
back in the corner - that's why there is no official Unix/Linux driver for 
MSSQL. Because they want us to host our shit on their shitty OS and most 
importantly *NOT BE ABLE TO HAVE THE CHOICE*.

Sure, I am an Open Source advocate and you can say I am biased. But I can 
argue that it is much better for one to be able to have a multitude of 
choices that to be given with only one and no laternatives.
That's the problem, ain't it?

So for me, bottom line is if you want a real RDBMS as of  Edgar Codd's RDB 
theory (and no not MySQL) you still have PGSQL and it goes even further 
than that.
PostgreSQL gives us what MySQL (I think) will never be able to and takes so 
many steps forward. Even from MSSQL. 

A lot of people take the decision to use MSSQL because that's what they've 
used previously but this does not make it the right choice.
Sure, you may not have a choice now but what about in the future?
So please, think about it and don't get evangelist on me. :)

Best Regards,
Borislav Sabev.


On Thursday, 29 May 2014 00:19:09 UTC+3, Jordan Hopfner wrote:

 Hey guys,

 I'm using the latest version of Cake (2.5.1) and am having a problem with 
 extremely slow connections to a MSSQL server. A controller action that only 
 has one simple select statement is taking an upwards of 50 seconds to 
 complete. I don't think it's the select statement itself, I have a created 
 an empty page that connects to MSSQL via PDO and executes the exact same 
 statement and the result is instantaneous, so this leads me to believe it's 
 a problem with the MSSQL data source packaged with Cake. If it was a driver 
 or connection issue I would assume it would happen on the test page as 
 well. Any ideas? I'm on PHP 5.3.x and am connecting to SQL Server 2008 R2.

 Jordan


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: cross tables in cake 1.3

2014-07-01 Thread Борислав Събев Borislav Sabev
I. There should not be a case where you have to load so many models in a 
single controller. As all objects in OOP, it is good that controllers be 
delegated *only one specific task*, not 2, not 3 and not 25...
  Are you sure that there is no way that you can extract so functionality 
and move it to another controller for example?

II. You are using too much deep associations. I can see that you have a lot 
of 'Model groups' which are connected like:
 - 'Photo', 'PhotoFavorite', 'PhotoLike', 'PhotoRating', 'PhotoComment'
 - 'Blog', 'BlogComment', 'BlogFavorite', 'BlogLike'
 - 'Group', 'GroupFavorite', 'GroupDiscussion', 'GroupMember', 
'GroupPhoto', 'GroupLike', 'GroupComment'

These lead to a loot of data being fetched. Especially if you have the 
$recursive property of the 'caller' model set to 2. So for example:
if you try to get 10 records from 'Blog' you will also get all the 
'BlogComments' for each of those 10 and all the 'BlogFavorites' for each of 
those 10.
If you had another 'join model' it could be even worse like: 1 Blog has 
1000 Comments, each Comment has 10 BlogCommentLikes .

You can see how quickly this grows into a problem. It is very important to 
understand that this is not an bug but a tradeoff. This is so because of 
the Model Associations 
http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html
 
in the current Cake ORM. Actually when you understand it it will not be 
an issue - you just have to cope with it 
http://tosbourn.com/cakephp-2-0-read-recursive/.



On Monday, 30 June 2014 10:33:29 UTC+3, Chris wrote:

 hi guys,.. I'm using to many cross tables in a controller,... and getting 
 memory error not enough bites,... 

   var $uses = array('User', 'Friend', 'FriendRequest', 
 'UserInvisiblePoint', 'UserStatusPost', 'StatusLike', 'StatusNotification', 
 'ZodiacType', 'Point', 'ProfileComment', 'Gift', 'Guest', 'Resume', 
 'UserBan', 'Invitation', 'Report', 'Photo', 'PhotoFavorite', 'PhotoLike', 
 'PhotoRating', 'PhotoComment', 'Blog', 'BlogComment', 'BlogFavorite', 
 'BlogLike', 'Group', 'GroupFavorite', 'GroupDiscussion', 'GroupMember', 
 'GroupPhoto', 'GroupLike', 'GroupComment', 'Dba', 'DbaFavorite', 'DbaLike', 
 'Video', 'VideoFavorite', 'VideoLike', 'VideoComment', 'Classified', 
 'Event', 'Notification', 'ProfileNotification', 'Bookmark', 'Message', 
 'Alert', 'Signin', 'Signin');

 how can I avoid this doing from user.php model,...? 

 thanks in advance,... 



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Need help to integrate smary 3.0 with cake PHP 2.0

2014-06-04 Thread Борислав Събев Borislav Sabev
I know this is somewhat of a troll answer, but:
This should be possible with some tweaks  to core variables, but why in the 
world would you want to do that? If your answer is that you know Smarty and 
not CakeViews I'd suggest you take 4 hours of reading and you will be 
pretty comfortable with Cake's Views.

Cake's view layer is much more powerful and made to work with Cake out of 
the box!
Also, doing this would mean that your project will be almost impossible to 
update in the future.
If you have something already done in Smarty and want to migrate it to 
Cake, you should seriously consider rewriting it entirely rather than 
integrating it.
You will not be integrating it - believe me you will end up with a lot of 
hard-coded and hacked-together stuff.
Especially if what you are migrating is big - the bigger the thing the 
bigger the issues you will have in the long run.

Borislav Sabev.

On Monday, 2 June 2014 08:48:45 UTC+3, Vivek Shah wrote:

 Hello,

 I am trying to integrate smarty template with cakePHP and for that I refer 
 http://bakery.cakephp.org/articles/tclineks/2006/10/27/how-to-use-smarty-with-cake-smartyview
  
 document
 and came to know it very old one still i modified some steps and reach 
 till include helpers in app_controller.

 class AppController extends Controller {

 public $view = 'Smarty';
 public $helpers = array(
 'SmartyHtml', 
 'SmartyForm',
 'SmartySession',
 'Html', 'Session'
 );
 }

 After adding this code in app controller my apache serve got crashed, and 
 i am unable to resolve this issue.

 Anyone please help or share document from where i can refer how can we 
 integrate smary with cakePHP.

 Thanks in Advance.


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Integrating Jasper Reports into Cakephp

2014-05-02 Thread Борислав Събев Borislav Sabev
I haven't used Jasper exactly, but you can pretty easily use the 
PHPJavaBridge http://php-java-bridge.sourceforge.net/ to integrate and 
call it's methods.
Here are some examples I found:
https://github.com/tsuyu/jasper-report-php-integration

http://community.jaspersoft.com/questions/522176/php-java-bridge-and-jasperreports-howto

Research the PHPJavaBridge more and you will find your answer.


Oh, yes - for the CakePHP part:
Reporting logic looks and sounds like model logic to me. :))
So you can put it in the Model Layer.
How exactly is up to you and depends on the architecture and entity 
relationships in your application.
You can have table-less models for this or just different methods in 
different models where you need this.

It could also be a vendor library since calling Jasper reporting isn't 
really a get that data and manipulate it-only operation.

Where you put it and how you use it really depends on your needs and 
preferences.

Cheers,
Borislav.

On Thursday, 1 May 2014 02:15:45 UTC+3, Dale Marthaller wrote:

 I have been doing some research about utilizing Jasper reporting for a new 
 Cakephp project I'm about to start. Has anyone else actually done this?
  
 Ideally I would like to be able to programattically run the generation of 
 reports directly from Cakephp logic.


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Recommendation Algorithm in cakePHP

2014-04-16 Thread Борислав Събев Borislav Sabev
Business-related DATA-connected logic is best residing in the Model, yes 
but there are still other considerations.
What if your logic was somehow VIew-related? For example you had to show 
some complex three-like structure and you wanted to pre-process it on the 
server?
A model would do of course, but you could also use a Helper to encapsulate 
the logic.

It all comes down to a developer's decision.
Get to know the life of a typical Cake 
Requesthttp://book.cakephp.org/2.0/en/getting-started/a-typical-cakephp-request.html.
 
It contains the specific implementation details of MVC in CakePHP.

If you're putting your complex algorithm in a Model Class you could do so 
in a separate model - i.e. you do not need to put the logic in any specific 
model if it is not logically connected to only one Model.
You can have a table-less model in Cake just by setting the Model's 
$useTable property to FALSE or 
NULL.http://api.cakephp.org/2.5/class-Model.html#$useTable

Anyway anything is possible of course. 

Cheers, 
Borislav.

On Friday, 11 April 2014 15:27:07 UTC+3, Vitor Vezani wrote:

 Hello guys, I want to do an app that will recommend itens for users, there 
 will be a complex algorithm behind it, and seeing the structure of cake I m 
 a little bit confuse

 Is this possible to do it in cackphp(I mean, any complex's algorithm)? If 
 so, where would I put this algorithm? At the model or controller?

 Thanks guys!


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Using ODBC Data Source in Cake 2.4

2014-04-05 Thread Борислав Събев Borislav Sabev
Well I don't think there is any support out of the box but I may be very 
wrong.
Can someone who knows the core super well answer?

Otherwise you can extend the DboSource and connect throgh a PDO just like 
in this example:

https://gist.github.com/ceeram/3062745

- check the 

function connect() {..


Keep in mind that this example is UNSTABLE and most-probably very outdated 
but it can get you started.

Keep in mind that PDOs http://php.net/manual/en/book.pdo.php have a ODBC 
Driver http://php.net/manual/en/ref.pdo-odbc.php.
There is also a seperate Abstraction Layer (like PDO) but for 
ODBChttp://php.net/manual/en/book.uodbc.phpbut it is know for some issues - 
for example, incompatibility with the 
package php-recode for some reason.

Anyway, in order to connect to your DSN you can use PDO_ODBC 
DSNhttp://php.net/manual/en/ref.pdo-odbc.connection.php

I personally think it is better to access the ODBC DSN through PDO, however 
your usage scenario way dictate otherwise.

I will wait for the others to answer.

On Friday, 4 April 2014 00:29:30 UTC+3, Comrade Raj wrote:

 Hi, I am newbie to Cake. I have a DSN pointing to Teradata.
 How can I configure database.php to use that ODBC DSN. I am currently uing 
 Cake 2.4.6

 Thanks alot.


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Using ODBC Data Source in Cake 2.4

2014-04-05 Thread Борислав Събев Borislav Sabev
Now that i searched a bit more I saw that There is a Datasources plugin for 
CakePHP 2.0 https://github.com/cakephp/datasources/tree/2.0 but the 
`Database/Odbc` data source is still incompatible with CakePhp 2.x.
*So you should definitely start there!*

I also answered your StackOverflow 
Questionhttp://stackoverflow.com/questions/22849479/how-to-use-odbc-datasource-in-cakephp-2-4in
 the same way as here. Posting it as reference.

Cheers, Borislav.

On Friday, 4 April 2014 00:29:30 UTC+3, Comrade Raj wrote:

 Hi, I am newbie to Cake. I have a DSN pointing to Teradata.
 How can I configure database.php to use that ODBC DSN. I am currently uing 
 Cake 2.4.6

 Thanks alot.


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: iOS app development

2014-04-05 Thread Борислав Събев Borislav Sabev
You're talking about json responces so I suppose as an overall service 
pattern you are using REST?

1. For the redirects
Well in that case, REST dictates that you need to use HTTP's facilities. I 
am saying this especially for the redirects.
You don't need to send redirects as information in JSON - just send the 
redirect header and have the iOS application
handle it as a HTTP header.

2. About $this-request-isMobile() and the simulatior

99% it is because of the simulator. Check out the code in isMobile() and 
then make the simulator simulate it better. :D 
Try NOT TO change the code in isMobile() but rather see why the simulator 
is not being recognize. Then try to make to simulator pass whatever is 
needed so it is recognized.

3. The RequestHandler in general

This Component is there to assist you in recognizing properties of 
requests. Generally it is used  to obtain additional information about the 
HTTP requests that are made to your applications.
Think of it as a wrapper that 

5. CakePHP  iOS resources

I don't think there are specific resources for interoperability.
The basic idea is a Client - Server application. Let's say you use REST.
Client is iOS. As far as I know most people use RestKit 
http://code.tutsplus.com/tutorials/restkit_ios-sdk--mobile-4524as a 
service consumer.
On the server side you will always have a Service - doesn't really matter 
if it is CakePHP or .NET.

Client recognition also ties in here. You are not obliged to use only the 
isMobile() method.
I would actually encourage you to add a custom way for your server to know 
that it is your App since you are developing the Server and App at the same 
time.
But this is a big IF.
This way the API is always sure that your App is calling it - isMobile() 
will return true even If you call your API from an Android device.
This could be:
- a custom header that the iOS App always sends in all of your requests
- an extension of RequestHandler in a method like 'isMyApp()' which will 
inspect requests for the header

This tactic could be a double-edged knife and you should always use it in 
conjuction with isMobile().
Watch out how exactly you implement this, because you may end up chaining 
your Service to your App - which is not the envisioned result of this 
approach and should be avoided.

Cheers,
   Borislav.


On Thursday, 3 April 2014 13:28:54 UTC+3, Jeremy Burns wrote:

 We're developing an iOS app alongside a CakePHP web app. At this point the 
 iOS developer is using the XCode simulator. I have some questions about how 
 the PHP code should be altered to handle requests from iOS. We are learning 
 as we go along...

 - When I do a check for $this-request-isMobile() the result is false; is 
 that because we are using the simulator?
 - When the right data is posted from the log in screen the users 
 controller redirects the user to the next page. The iOS app is receiving 
 the full HTML of that page. Do I need to put isMobile() checks throughout 
 my PHP code and return different responses? See the false isMobile check 
 above.
 - What part does the RequestHandler component play in this? I have 
 included it in AppController.
 - The CakePHP app contains al the correct redirects and logic flow. Does 
 the iOS app need to replicate these (in other words, the logic is stored in 
 two places) or can the CakePHP code drive the redirect equivalent 
 statements for iOS?
 - Are there any good resources for co-developing iOS and CakePHP apps?


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: is this a threadsafe code?

2014-03-20 Thread Борислав Събев Borislav Sabev
Well in a sense it is thread safe since the executed php code will NOT 
actually thread itself.

@Gary Kremmer seems to be confusing terms.
Gary, there is no problem here since each and every user will get his own 
execution scope and instance of the code.

The fact that nginx forks itself for each request does not provide 
threading for the PHP script running on the server.

Borislav.

On Thursday, 20 March 2014 11:56:03 UTC+2, nicky wrote:

 I think this is nothing to do with thread safe , dont u think so ?


 On Wed, Mar 19, 2014 at 9:44 PM, Eugenio eugen...@gmail.com javascript:
  wrote:

 Why not;
 $myBoolean=(boolean) something;


 2014-03-18 9:29 GMT-03:00 Kamal Deol kamal...@gmail.com javascript::

 YES It is Thread Safe : 100% Sure


 On Tue, Mar 18, 2014 at 6:33 AM, Gary Kremmer 
 garyk...@gmail.comjavascript:
  wrote:

 class SomeController extends AppController { 

 public function index() {
  if(something) {
$myBoolean=true;
   } else {
 $myBoolean=false;
 } //end of if 
  } //end of method
 } //end of class


 I am using nginx+php FPM. 

 My question is if there are multiple users hitting 
 the SomeController at the same time, is myBoolean threadsafe? 

 Thanks,
 Gary.

 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP

 --- 
 You received this message because you are subscribed to the Google 
 Groups CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to cake-php+u...@googlegroups.com javascript:.
 To post to this group, send email to cake...@googlegroups.comjavascript:
 .
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.


  -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP

 --- 
 You received this message because you are subscribed to the Google 
 Groups CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to cake-php+u...@googlegroups.com javascript:.
 To post to this group, send email to cake...@googlegroups.comjavascript:
 .
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 *May the source be with you.*
  
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP

 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+u...@googlegroups.com javascript:.
 To post to this group, send email to cake...@googlegroups.comjavascript:
 .
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.




-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Is Cake Dead Or Just Catching Up?

2014-03-12 Thread Борислав Събев Borislav Sabev
Here's an interesting thing:
I am not actively developing in Cake for a year now, however I do continue 
to keep up with changes, have some little projects here and there and most 
importantly to try to help.
However I cannot not agree with Jeremy Burns' comments on the types of 
questions being asked here and over at Stack Overflow. Some people just 
don't take care to read a bit of the book first.
These days I am on ZendFramework and Yii, but I haven't stopped trying to 
help out in the Cake community. This is just because of that community!

I am also very confident with the direction in which v3.0 is taking us. An 
I will continue to prefer Cake where it does it's job great.

On Tuesday, 11 March 2014 09:51:15 UTC+2, advantage+ wrote:

 In no way am I putting Cake down, I love Cake and use it for almost every 
 project. I love it!

 I just see lack of fan fare as you can call it over the years. I see 
 familiar names always answering questions for users. That’s great!

  

 But I seem to notice less and less so I was only wondering if people are 
 jumping ship and moving on to other frameworks.

  

 That’s all.

  

 *From:* cake...@googlegroups.com javascript: [mailto:
 cake...@googlegroups.com javascript:] *On Behalf Of *Thomas von Hassel
 *Sent:* Tuesday, March 11, 2014 4:46 AM
 *To:* cake...@googlegroups.com javascript:
 *Subject:* Re: Is Cake Dead Or Just Catching Up?

  

 If you switch frameworks every 6 months you are doing it wrong.

  

 So far CakePHP does what i need it to do, and i see no reason to shop 
 around. Also, with the things coming in 3.0 I’m very optimistic about the 
 direction the dev. team is taking.

  

 In regards to traffic on the list/google group, i suspect a lot of newbies 
 end up on Stack Overflow, and not here.

  

 /thomas

  

  

 On 11 Mar 2014, at 06:13, Advantage+ movep...@gmail.com javascript: 
 wrote:



 Looking at these stats is Cake dead?

  

 http://www.sitepoint.com/best-php-frameworks-2014/

  

 Can it keep up or catch up?

  

 Over the years I would see 50 Cake messages a day, now it's lucky if you 
 see 2 topics with 1 response in the daily abridged update.

 Very few questions hit the inbox, less and less ever day…..

  

 Don’t get me wrong I love Cake but is heading out to the pasture to call 
 it a day?

 Seems no longer a popular framework as others pop up.

  

 Others are much faster, and have everything Cake has to offer and more.

  

 Everyone has an opinion, let's see if anyone replies or too busy with 
 other frameworks J

  

  

 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP

 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com javascript:.
 To post to this group, send email to cake-php@googlegroups.comjavascript:
 .
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

  

 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP

 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+u...@googlegroups.com javascript:.
 To post to this group, send email to cake...@googlegroups.comjavascript:
 .
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3.0 error

2014-03-12 Thread Борислав Събев Borislav Sabev
I can bet some money that this could be somehow related to: 
https://groups.google.com/forum/#!topic/cake-php/hhnJEXDSGzU

Good to know you've solved your issue btw.

On Tuesday, 11 March 2014 19:19:01 UTC+2, André Luis wrote:

 Hi people, I am trying to follow the Blog tutorial from cakephp 3.0 
 website, but i am getting an error wich isnt showed up, also its not on the 
 log...

 The problem is whem i try to retrieve the articles with 
 $this-Articles-find('all');, whem have this line the browser says that 
 this page is not avaliable, but if I remove this line, it shows the content 
 (without the articles)

 What i am doing wrong?

 Thanks


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Can't we use more than 1 paginator per page?

2014-03-11 Thread Борислав Събев Borislav Sabev
It is possible of course but it depends on if you would like to persist the 
pagination - i.e. save the state via URL so that you can access the same 
portion of data later.
In that case you will have to find a nice named-parameter way to persist 
the pagination data.
You will have to use AJAX pagination for this to work. 

Your current problem comes from the fact that the stock paginators use 
named-parameters and when you have 2 on one page they seem to conflict.


On Monday, 10 March 2014 10:27:40 UTC+2, happy wrote:


 http://stackoverflow.com/questions/22291846/how-to-do-multiple-pagination-without-page-not-found-error-in-cakephp

 I have problem with more than 1 paginator in the same page.
 If 1st paginator has page number higher than the 2nd paginator, then It 
 will be page not found error.
 EX. On student detail page(Student model) has paginator of income(Income 
 model) and expanse(Expanse model).
 If Income's paginator  has total 5 pages and Expanse's paginator has total 
 3 pages.
 Then Income page 1, 2, 3 has no problem but income page 4 ,5 will have 
 page not found error .



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: upload compressed image

2014-03-11 Thread Борислав Събев Borislav Sabev
:D

On Monday, 10 March 2014 11:29:04 UTC+2, AD7six wrote:



 On Monday, 10 March 2014 10:06:45 UTC+1, raj kumar Pustela wrote:

 hi all..
  How to implement upload compressed image/video in cakephp 2.3.0.if 
 any one know pls help me.


 It's exactly the same process as to upload an uncompressed image/video.

 AD


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Router redirect pass all parameters to another domian

2014-01-22 Thread Борислав Събев Borislav Sabev
As Reuben said - you will be far better off with a Web Server based 
redirect.
This way your application will not get called at all.



On Monday, 20 January 2014 23:49:09 UTC+2, gonzela2006 wrote:

 Hello,

 I want to use *Router::redirect* to redirect to another domain and pass 
 all parameters to this domain

 Example:
 Redirect this url
 http://domain-*one*.com/posts/view/1
 to
 http://domain-*two*.com/posts/view/1

 I tried the following
 Router::redirect( '/*', 'http://domain-*two*.com/', array('persist' = 
 true) );
 but it redirect to  http://domain-*two*.com/ without parameters.
 Please advise

 Thanks



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Is it possible for a View to access another unrelated Model's data?

2014-01-20 Thread Борислав Събев
As @Reuben explained: binding Models to views directly is bad and should 
not be done at all. Even $this-requestAction() is bad in my mind, however 
there are some cases for it.

Anyway, what you're asking for is possible.However I have the feeling that 
you're not too sure what MVC is, how it should work and especially how this 
ties into CakePHP's structure. Read this:
http://book.cakephp.org/2.0/en/getting-started/a-typical-cakephp-request.html 

and this:
http://book.cakephp.org/2.0/en/getting-started/cakephp-structure.html

Then the answer to your question is:

A controller can use as many models as you like provided that those are 
defined in the Controller's $uses property.
At the head of your controller you should have an:

public $uses = array('ControllerModel','OtherModel');

Now the controller will know which Models to initiate and provide them to 
you in it. This is so because the Controller doesn't need to load all 
models in your app - just those that it needs.
Now in your Controller action:

$myOtherModelData = $this-OtherModel-find('all');
$this-set('myOtherModelData', $myOtherModelData);

Now in the View your data will be in: $myOtherModelData.

So you actually do not bind the Model to the View - you call the model in 
the Controller.

On Monday, 20 January 2014 04:32:05 UTC+2, Sam wrote:

 From what I understand from cakephp, a view is associated to a model and 
 can only access the model's data. Is it possible for a View to access 
 another unrelated Model's data? What I mean is whether it is possible for a 
 view to access any database table's data, even if it is unrelated?


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Is it possible to retrieve webroot folder location in Javascript?

2013-10-31 Thread Борислав Събев
What are you using this for?
If you just want to access files under it from the browser - it will always 
be example.com/file.name.
Also the chance that the webroot location changes inside Cake's layout is 
like limes(0) :D.

On Wednesday, 30 October 2013 01:08:30 UTC+2, Sam wrote:

 I am writing javascript with jquery currently. Is it possible to retrieve 
 webroot folder location in Javascript? This will be good if webroot changes 
 in future.

 Thank you.


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Identical controller names

2013-10-09 Thread Борислав Събев
It would not really affect it in a good way. :D 
Cake is convention based and this will be your first drawback.
Moreover how did you plan on naming the files with the same name?
It is possible on Unix/Linux systems but it is a bad practice - very bad. :)
If they serve similar functionality they are most probably just different 
user roles? :D
You could have different controllers for them, like: Users and Managers. 
This is really an abstract OOP decision but in the context of Cake it'd not 
do much good.

On Thursday, 10 October 2013 08:02:16 UTC+3, CrotchFrog wrote:

 I thought better of the idea. Seems pointless to have identical names when 
 there are so many others to choose from :) I suppose I was more curious 
 about how it would effect the app moreso than actually creating the 
 controllers. 

 Thanks for the reply :)


 On Wed, Oct 9, 2013 at 11:40 PM, Reuben reuben...@gmail.com javascript:
  wrote:

 Without namespaces, I think you might end up with a class name clash, 
 since you would have two UsersController classes trying to occupy the 
 global name space.

 Regards
 Reuben Helms

 On Thursday, 10 October 2013 03:29:49 UTC+10, CrotchFrog wrote:

 Would it be considered bad practice to have two identical controller 
 names? For example I was wondering about having a 'UsersController'  to 
 keep my logic separate from 'UsersController' in one of my plugins, or 
 would it be best to just name one or the other differently? I can foresee 
 one or two issues going this route but am I missing a bigger picture? 

  -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to a topic in the 
 Google Groups CakePHP group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/cake-php/7SvbTm2_MX4/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 cake-php+u...@googlegroups.com javascript:.
 To post to this group, send email to cake...@googlegroups.comjavascript:
 .
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: PhpAcl

2013-09-16 Thread Борислав Събев
Cake has 
ACLhttp://book.cakephp.org/2.0/en/core-libraries/components/access-control-lists.html.
 
How you use it is up to you!
Of course it is possible to create an ACL based menu. However I am 
wondering if it is a good idea to re-calculate permissions every time a 
page is called?
You can change the menu for different user roles when the ACL permissions 
are regenerated in cake and then use if as an element.

On Friday, 13 September 2013 18:27:02 UTC+3, Hugo Fabricio wrote:

 Hi guys,

 It is possible to develop a menu in accordance with the permissions of 
 PhpAcl?

 Thanks


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: RFC: New http://ask.cakephp.org

2013-07-11 Thread Борислав Събев
  Couldn't agree more with the overhead maintenance considerations.
The audience hit is also kind of a big problem and you are right about the 
general `php` questions people tend to mark `cakephp` since that's the 
framework they're using.
  Having agreed with your considerations I can now say that I am against a 
stack sub-site.
Also I think it is a good idea to keep redirecting ask.cakephp.org to the 
stack tag. :) This way stack will also become kind of a repository of 
answers to problems. Interesting questions tend to arise but very rarely.

Borislav.

On Wednesday, 10 July 2013 12:35:22 UTC+3, AD7six wrote:

 Personally I don't see the benefit of a subsite, compared to what's 
 available already on stackoverflow.com.

 There are some rather significant disadvantages to  using a subsite 
 instead of a tag, including:

- Reduces the audience
- Participants have to opt in rather than simply browse stack 
overflow
- The framework is less visible to non-framework users
- Requires maintenance, especially to migrate questions from 
stackoverflow to subsite and vice versa (an ongoing overhead)

 For example: questions frequently appear on stack over flow of the form:

  I need to do something common to any php install - I'm using CakePHP.

 Whereas on stackoverflow answers can come from outside the cakephp 
 community or the question can simply be edited/tagged appropriate - on a 
 subsite the question is invisible to a more appropriate audience (those 
 looking at the php tag on stack overflow) and is effectively off topic on 
 the subsite.

 It would be appropriate to have a subsite where questions were considered 
 in some way offtopic on stackoverflow - but that's not the case for CakePHP.

 AD





 On Wednesday, 10 July 2013 09:50:38 UTC+2, Florian Krämer wrote:

 I think the CakePHP tag is good enough. It is not like there is not 
 already enough to maintain and care about, so if a dedicated stack exchange 
 site takes more resources of any kind don't do it and stay with the tag.

 On Friday, July 5, 2013 4:21:29 AM UTC+2, mark_story wrote:

 A dedicated stackexchange would be great. They take a fair bit of work / 
 community votes to make happen though. That is one reason we're just using 
 the cakephp tag right now.

 -Mark

 On Thursday, 27 June 2013 20:43:38 UTC-4, ravag...@gmail.com wrote:

 [Cross posting this on CakePHP Facebook Group 
 https://www.facebook.com/groups/cake.community/]

 Hello everybody

 I came across an idea which I wanted to share with and hope to spark 
 some discussion.
 Probably - or better said for sure - I'm not even the first one having 
 it.

 First some back story:

 As you may know CakePHP's Question  Answer site 
 http://ask.cakephp.org/ redirects nowadays to cakephp tagged 
 questions on stackoverflow.com.

 http://stackoverflow.com/questions/tagged/cakephp

 I haven't seen any official statement about that from the development 
 team but the Wayback Machine could crawl the page the last time on 
 09.05.2013.

 http://web.archive.org/web/20130509084040/http://ask.cakephp.org

 The CakePHP Questions site before that, http://www.cakeqs.org/(nowadays a 
 japanese blog), was last seen on 02.10.2010.
 Any later request got redirected to http://ask.cakephp.org/.

 http://web.archive.org/web/20101002085134/http://cakeqs.org/

 So back to the idea...

 Recently I came accross one of the many domain/topic specific sub sites 
 of stackoverflow.com.

 http://stackexchange.com/sites#technology

 For example Drupal Answers.

 http://drupal.stackexchange.com/

 And I thought Hey wouldn't it be nicer to redirect CakePHP's Questions 
  Answers site to something like this instead of just the tagged with 
 cakephp site?.

 Like I said I'm not the first one, so this is rather a follow-up on a 
 three years old idea, which time hadn't come yet.


 https://groups.google.com/forum/#!searchin/cake-php/stackexchange/cake-php/pA7q6gddW74/aaCntQer_jEJ

 But I think the time is now right.
 What do you think?
 Should we open a proposal for http://cakephp.stackexchange.com/ called 
 CakePHP Questions  Answers or something like this?

 http://area51.stackexchange.com/faq

 I personally think it would strengthen the CakePHP brand even further...

 Greetings from Switzerland
 Marc



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Re: RFC: New http://ask.cakephp.org

2013-07-10 Thread Борислав Събев
Yes, a dedicated sub-site at stackoverflow would be great but it will take 
a very big amount of work as Mark Story said.
I'd be happy to participate in/dedicate myself to such an initiative 
however I have some considerations.

I've been actively reading and answering questions under the cakephp tags 
and I've noticed that maybe over 60% of the questions are asked by people 
who didn't take care to read the documentation first at all. People are 
just lazy. And this is not only under cakephp in stackoverflow... So at the 
end this may lead to more unnecessary overhead work for the community. I'd 
like us to think of a way to minimize such a practice as the documentation 
already says it? Maybe some clear references etc. I am not talking about 
solutions that consist of several pieces and are referenced in different 
parts of the documentation but rather straight-forward things that are 
clearly stated in the appropriate section of the documentation - Book  
API. In my opinion CakePHP has one of the best documentations out there and 
it would be a total waste to keep answering such questions.

Cheers, 
 Borislav.

Greetings from Bulgaria. :)

On Friday, 28 June 2013 03:43:38 UTC+3, ravag...@gmail.com wrote:

 [Cross posting this on CakePHP Facebook Group 
 https://www.facebook.com/groups/cake.community/]

 Hello everybody

 I came across an idea which I wanted to share with and hope to spark some 
 discussion.
 Probably - or better said for sure - I'm not even the first one having it.

 First some back story:

 As you may know CakePHP's Question  Answer site 
 http://ask.cakephp.org/redirects nowadays to cakephp tagged questions on 
 stackoverflow.com.

 http://stackoverflow.com/questions/tagged/cakephp

 I haven't seen any official statement about that from the development team 
 but the Wayback Machine could crawl the page the last time on 09.05.2013.

 http://web.archive.org/web/20130509084040/http://ask.cakephp.org

 The CakePHP Questions site before that, http://www.cakeqs.org/ (nowadays 
 a japanese blog), was last seen on 02.10.2010.
 Any later request got redirected to http://ask.cakephp.org/.

 http://web.archive.org/web/20101002085134/http://cakeqs.org/

 So back to the idea...

 Recently I came accross one of the many domain/topic specific sub sites of 
 stackoverflow.com.

 http://stackexchange.com/sites#technology

 For example Drupal Answers.

 http://drupal.stackexchange.com/

 And I thought Hey wouldn't it be nicer to redirect CakePHP's Questions  
 Answers site to something like this instead of just the tagged with 
 cakephp site?.

 Like I said I'm not the first one, so this is rather a follow-up on a 
 three years old idea, which time hadn't come yet.


 https://groups.google.com/forum/#!searchin/cake-php/stackexchange/cake-php/pA7q6gddW74/aaCntQer_jEJ

 But I think the time is now right.
 What do you think?
 Should we open a proposal for http://cakephp.stackexchange.com/ called 
 CakePHP Questions  Answers or something like this?

 http://area51.stackexchange.com/faq

 I personally think it would strengthen the CakePHP brand even further...

 Greetings from Switzerland
 Marc


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Memcahce

2013-05-19 Thread Борислав Събев
What are you going to use memcache for?
What do you want to cache there? There may be something better that 
memcache.

On Saturday, 18 May 2013 08:41:14 UTC+3, raj kumar Pustela wrote:

 Hi to all,
   
If any one known about memcache.please help me how to implement 
 *memcache *in cakephp 2.0.3.
 





 Thanks,
 Rajakumar.P


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Using the Global Event Manager

2013-03-11 Thread Борислав Събев
Hey, Jerry.

You could use bootstrap.php for such event attachments.
What I usually do is to create another file, in the Config folder, called 
evenmanagement.php for example, and include it at the end of bootstrap.php.
This way all my events-subscribers etc. logic is in one file.

You could also put it in AppController, but the  method described is 
somewhat cleaner.
You could also attach these bindings just for parts of the applications, 
but you will need to be very careful of what you do.

Borislav.
On Sunday, 10 March 2013 21:57:47 UTC+2, Jerry Kita wrote:

 Hi,

 I'm somewhat new to CakePHP but working to get up to speed quickly.

 I'm trying to understand the Events Systems. I've been able to successful 
 create events, define listeners, attach listeners and receive event objects 
  all within the same Model-Controller-Class. It works well and I've 
 managed to get comfortable with it. I've create a ProductsController and 
 within that class everything works well. 

 What I would like to do is define an event in Model-Controller-Class 'A'  
 (Product) and create a listener in Model-Controller-Class 'B' (Order). The 
 net effect would be that an event object is created as a result of some 
 action within 'A' and that event object is passed to 'B'. 'A' to 'A' or 'B' 
 to 'B' I can manage.

 I've read about the Global Event Manager and that would seem to be the 
 ticket. However, the documentation doesn't provide a newcomer like me 
 sufficient depth to get it right. The documentation suggests the following:

 // In any configuration file or piece of code that executes before the 
 eventApp::uses('CakeEventManager', 
 'Event');CakeEventManager::instance()-attach($aCallback, 
 'Model.Order.beforePlace');

 So what configuration file or piece of code is recommended? AppController? 
 And where does the function go? In the same file? As you can see
 the answer is not obvious enough to me to figure it out and I can't find any 
 examples on the internet.

 Any suggestions of links or tutorials or hints would be appreciated. If I've 
 not provided enough enough information I'm happy to provide
 that too!

 Thanks, Jerry




-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Database scheme question...

2012-09-19 Thread Борислав Събев
Check out the Model Associations:
http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html

On Tuesday, 18 September 2012 05:27:34 UTC+3, Jeff Prater wrote:

 Thanks for the quick reply!

 Where would I be adding this? To the User model or to the Firms model? Or 
 both?

 On Sunday, September 16, 2012 4:30:37 AM UTC-4, Jeremy Burns wrote:

 That would do it. Then you need to set up your model associations.

 public $hasOne = array(
 'Manager' = array(
 'className'= 'User',
 'foreignKey'   = 'manager_user_id'
 ),
 'Contact' = array(
 'className'= 'User',
 'foreignKey'   = 'contact_user_id'
 )
 );

 On 15 Sep 2012, at 21:14, Jeff Prater je...@thoughtreactor.com wrote:

 I'm getting started with v2.2. I'm trying to layout my database, but I'm 
 unsure how to handle the naming conventions. I have a main table, firms, 
 which stores all the companies/firms For each firm, I want to designate a 
 managing user and contact user from the users table. I need to associate a 
 specific user account from the users table. Is this the correct way to name 
 these? After reading the conventions section in the book, I'm still a 
 little confused as how to name these columns. Thanks!

 firms
 -
 id
 firm_name
 manager_user_id  **
 contact_user_id  **

 users
 -
 id
 user_name
 email_address
 etc.



 -- 
 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+u...@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
  
  




-- 
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Barcode

2012-08-22 Thread Борислав Събев
Hi.

Use the CakePdf Plugin https://github.com/ceeram/CakePdf. It is a 
front-end for:

   - DomPdf
   - Mpdf
   - Tcpdf
   - Wkhtmltopdf

This way you will be able to generate the pdf files and also the barcodes. 
Most pdf engines generate barcodes as core functionality. 
I have personally used Tcpdf for barcode generation. It is easy, just check 
the engine documentation. This plugin is for Cake (= 2).
I suggest using Wkhtmltopdf as an engine, but you should check if it 
generates barcodes (it should). 
Ask again if any problems.

Regards,
   Borislav.

On Tuesday, 21 August 2012 11:15:07 UTC+3, Mr. Manager wrote:

 Dear All,

 I am developing application, billing system, with this application I need 
 to function with barcode on invoice, print pdf / print preview and export 
 query data to *.xls format.

 Anyone has an idea please help me.

 This is urgent.

 Sincerely Your,
 Mr. Manager,


-- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Fat CakePHP

2012-08-09 Thread Борислав Събев
@gremlin totally on target!

There is nothing I'd like to add after the discussion went this way, but It 
is really, really, really important to have a nice uplink speed for your 
development.
I for example have a 2 fiber optical connection coming in to my home office 
and it costs me next to nothing (something like $8-9/mo) for 50Mbps down- 
and up- links.
Тhis enables me to have a very good connection and keeps my clients 
satisfied. @gremlin's solution with the Git pulls for the Cake Cores on the 
server is, in my opinion, the best that you cna do for your deployments. 
For example we I have some client servers on a Backbone between Europe and 
North America in Amsterdam and I can tell you that connectivity (hops) is 
amazing.

Cheers, 
   Borislav.


On Thursday, 9 August 2012 00:31:05 UTC+3, gremlin wrote:

 Even using the worst hosting in the world you still should only ever have 
 to upload the core one time. If you have to wait 5 minutes for your isp to 
 move the files to the remote server each time then you are uploading your 
 app and a fresh copy of the core every time you update the site? That is an 
 issue of bad workflow and sloppy development more than any bandwidth issue.

 Second, if you care about being professional with your development you 
 could perhaps invest in digital cable? Learn to keep your core as a 
 submodule and use git on your hosting provider so that you can issue a pull 
 request and update the core at the speed of their network instead of your 
 own. It also helps with keeping your (small by comparison) app files 
 separate and easily uploadable/git pullable as it's own package. Anyone who 
 complains that they have to upload the whole cake package for every site 
 update is advertising to the world that their development cycle is stuck 
 using 90's methodologies.


-- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: stored procedures cakephp

2012-08-03 Thread Борислав Събев
The best place would be in a separate function in the applicable Model. To 
wrap the procedure call in a transaction do something like:
For example if you have a calcUserRep() procedure you should do:

public function getUserRep($someParam,$someOtherParam){

..

$this-begin();
$this-query(CALL calcUserRep(););
$result = $this-query(SELECT something);
$this-commit();



}


On Thursday, 2 August 2012 13:27:57 UTC+3, Milina Udara wrote:

 I found that we can use SP with Cakephp. But there are thing  call   
  transaction,   DataSource,   behaviors and  Events System. 
 My  problem is  where to use those things and SP ?
  I wont answer from architectural  view.




-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Be Aware of Pirated Copy of CakePhp 2.x User Management Plugin

2012-07-30 Thread Борислав Събев
  I've been following up on the discussions around the Eagle User 
Management Plugin which has been directly advertised in the Cake Google 
groups.
I personally do not think that it is okay to directly advertise in these 
discussion group as this is an Open source community that promotes Free 
Software.
My personal opinion is that any such advertisement attempts should be 
rewarded with deletion and immediate exposure - i.e. creating another 
thread to
state that this shall not be tolerated.
  What do you think of these?

Cheers, 
Borislav.

On Saturday, 28 July 2012 17:47:14 UTC+3, PhpNut - Larry E. Masters wrote:

 On Friday, July 27, 2012 at 8:17 PM, euromark wrote:

 is google groups really becoming the new marketplace for software? really?
 there have been quite a few posts now regarding ads to non-free products


 I removed some of the people in this thread. They had only recently 
 started sending messages to the group, none had their own accounts set to 
 receive emails which tells me they are not here to help.

 --
 Larry E. Masters
  

  

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Tool to visualize database schema on cakephp

2012-07-30 Thread Борислав Събев
Hi.

Such a toll cannot be bundled with Cake itself because Cake can use 
different DataSourceshttp://book.cakephp.org/2.0/en/models/datasources.html
.

The best tool I've used (for MySQL) is *MySQL Workbench*. It does design 
and forward/reverse engineering for MySQL only, but for schema 
visualization it will do the trick for all. 
I've incorporated this wonderful piece of software in my dev process and I 
can freely say that there are many benefits, some being:
- An always up to date model of the database
- All changes to the DB are made from MySQL Workbench
- Versioning for DB changes
- Real easiness  for Database Forward/Reverse Engineering
- Generation of SQL divs
- ...

Of course all of its features would work only on MySQL (and its forks maybe 
like MariaDB http://en.wikipedia.org/wiki/MariaDB), but if you would only 
like to visualize then it will do wonders for you. You can also check out 
Dia - the open source diagram editor, with which you can create graphs, but 
you wouldn't have any of the other features, as 
it is not solely a DB design tool. Try Workbench out.

Cheers, 
   Borislav.

On Tuesday, 31 July 2012 05:41:13 UTC+3, Lightee wrote:

 Dear cakephp experts,

 Does anyone know of tools that can help us visualize the database schema 
 on cakephp? Hopefully, it can show the relationship (1 to many, 1 to 1) 
 between different tables.

 Thank  you.


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Debugging tool for cakephp

2012-07-30 Thread Борислав Събев
As @Alejandro said DebugKit is a very good solution that would do the job 
in most cases. If you want to be able to insert breakpoints, right inside 
PHP's ZEnd Engine (while it is executing) you can use XDebug of ZendDebug, 
but this second option will be needed very rarely. It should be used when 
no other options are left. Such a Debugging perspective also provides a 
nice insight on what is happening in the Zend Engine.

Cheers, 
   Borislav.

On Tuesday, 31 July 2012 05:43:01 UTC+3, Lightee wrote:

 Dear cakephp experts,

 I am a newbie to php. Can someone recommend a good debugging tool that 
 they personally use for cakephp? I am open to all because I know nothing at 
 the moment.

 Thank you for your help.


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Cakephp with barcode

2012-07-23 Thread Борислав Събев
This is right. Nowadays almost all (except special-purpose ones) emulate a 
gerenic keyboard device. 
I have personally coded a barcode generation application in CakePHP, but 
the reader part was handled by some Air applications.
Nevertheless barcode readers do just throw the string that they've read to 
the standard input (stdin). This does mean that 
you can have a web frontend with some inputs that gets this string and does 
whatever with it. However there are some things to
consider:

1. Most barcode readers that work like this will throw in a carriage return 
as the last symbol which my result in form submission, if not handled 
properly. (This as may other features is configurable in the scanner 
itself.)
2. You should use an autofocus on the field that the reader will populate 
because otherwise the browser may think that this is an URL to follow and 
it will do so, because of the carriage return at the end.
3. You should see to that the interface design of the application copes 
with the restrictions imposed by the usage of this unusual human interface 
- a barcode scanner.

All Barcode scanners have a ROM with some configuration options in it and 
if you need anything special you should check the documentation for the 
scanners you're going to use.

Regards, 
   Mr. Software Engineer - Barcode Specialist :D

On Saturday, 21 July 2012 16:51:59 UTC+3, Ratty wrote:

  On 05/07/12 17:13, Mr. Manager wrote:
  
 Dear All,

 If everyone know the solution to deal with my issue is that I would like 
 to build an application that manage product with cakephp and also use with 
 barcode, the requirement is that I want to generate barcode for products 
 with respect to their id and also read barcode from barcode scanner and 
 process in the application to show data of the product and calculate the 
 price for invoicing.

 I am looking forward to hearing good news from all of you as soon as 
 possible.

 Best Regard,
 Mr. Manager,
 -- 
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org 
 Check out the new CakePHP Questions site http://ask.cakephp.org and help 
 others with their CakePHP related questions.
  
  
 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


 Do you mean a hand scanner as in a scanner that plugs into a USB ?

 If that is the case, they usually emulate a USB keyboard, so all you need 
 is an input field. I have used this in a book application in which the ISBN 
 or EAN barcode on the back of the book is scanned. The barcode reader 
 decodes the barcode for you as long it is a supported format and sends you 
 the characters it finds. This gives you the flexibility of either entering 
 the barcode characters by hand or scanning them which can be useful if your 
 scanner breaks !

 For Generation there is a helper published at the bakery that looks pretty 
 comprehensive and it just requires the GD php extension.

 http://bakery.cakephp.org/articles/ixu38/2010/04/30/barcode-helper
  

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: CakePDF Change page orientation

2012-07-20 Thread Борислав Събев
It says how to use it in the plugin's documentation:

https://github.com/coisa/CakePDF/blob/master/README.markdown

When initializing the component:

public $components = array(
'CakePdf.CakePdf' = array(
'prefix' = 'pdf',
'layout' = 'CakePdf.pdf',
'filename' = '{name_of_action}.pdf', // this is the name on output pdf 
(when force download occurs)
'orientation' = 'P',  *// accept 'P' for portrait and 'L' for 
landscape*
'paper' = 'A4' // accept all paper types of tcpdf library
)..

So, *P *for Portrait, *L *for Landscape.


On Friday, 20 July 2012 00:59:07 UTC+3, Elisio Leonardo wrote:

 Hi guys,

 How can I change page orientation from portrait to landscape with CakePDF 
 plugin?

 I have looked at the source code and in CakePDF class i can see the 
 $_orientation variable, so the main question is, where should i use the 
 CakePDF class? In my controller or in views?


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Charts - Anyone knows a good valid one?

2012-07-17 Thread Борислав Събев
I can reccomend these three:

http://www.amcharts.com - JS/HTML5 - licensed for commercial use
http://www.pchart.net/  - PHP - licensed for commercial use
http://jpgraph.net/- PHP - licensed for commercial use

On Wednesday, 18 July 2012 00:00:10 UTC+3, Marcelo Santana wrote:

 Hello, all, i'm needing display some charts i tried: 

 http://bakery.cakephp.org/articles/ixu38/2010/04/30/googlechart-api-helper

 show the charts but i can't configure the way i want, the line chart is 
 terrible 
 (or someone who use it successfully can show how... )

 https://github.com/cjsaylor/Google-visualization-api-cakephp
 this one i cound't show no charts at all.

 i've tried this one
 http://www.jqplot.com/index.php
 unsuccessfully too

 so,i guess this day was too long, and i burn my mind off ...
 but anyway, someone knows a good chart for cake 1.3.x or can show me how 
 the above charts works ?

 xxx





-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: how to call one function of one contoller into another controller

2012-07-17 Thread Борислав Събев
requestActoin() is meant to be used in views but as said it will initialize 
a whole request which is not as slow as CakePHP 1.3 but nevertheless
shared controller logic should be packaged in some way. :)

This could be done with a Component or in AppController.
For example if you have a function that utilizes the CakeEmail class to 
send emails I would prefer putting it in AppController as this is a common 
task.
But if you have some computing logic that you will use in only a couple (or 
more) Controllers you should package it in a Component.

This is generic logic packaging and there are best practices when you want 
to be fully MVC.
This example is a bit unrelated but the other day someone over on 
StackOverflow was arguing that it is best to put some global variables 
in `app/webroot/index.php`. Well we should use bootstrap under `Config` for 
this, shouldn't we? :)

@Bharat Maheshwari I can't agree that in order to solve a problem one 
should use the fastest option as this would, in most cases, 
be not as efficient as other options. I can agree that sometimes business 
constraints will efect this dramatically, but in the long run it 
is best to do stuff efficiently. In this specfic example the difference 
between using requestAction() and packaging a Component or a AppController
method is like 30 mins. Cake is mostly objects and performace should always 
be a part of the coding pracise, this for me at least.

Cheers to all,
Borislav.

On Tuesday, 17 July 2012 09:27:16 UTC+3, sneha kulkarni wrote:

 how i can call one function of one controller into another controller.plz 
 help


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Newbie: Problem with Blog tutorial

2012-07-14 Thread Борислав Събев
Shame on you *AD7six* and *Piotr Beschel*! This group is for helping people 
not mocking them!
Yes the question is kinda silly, but this doesn't mean that you should mock 
people. What if 
you end up asking a question that someone better (in Cake) than you 
considers silly?
Would it be nice to get such replies? This is a community not a forum. Man 
up!

On the qestion:
Kunal, *.htaccess* files are Apache configuration files. When the tutorial 
said *Also remove these .htaccess files*
it did so under the *A note on mod_rewite* section. This is to be done if 
you DO NOT have mod_rewrite working at all 
or if you use a different webserver than Apache. So you do not need to do 
this if your application is running
on an Apache instance with mod_rewrite enabled.

What is mod_rewrite? Well take a look 
herehttp://www.workingwith.me.uk/articles/scripting/mod_rewrite
.

How to use pretty urls with Apache and other webservers? Well read 
thishttp://book.cakephp.org/2.0/en/installation/advanced-installation.html#apache-and-mod-rewrite-and-htaccess
.

On your problem: it seems that you've managed to get Cake's built in pretty 
Urls to work.
You are seeing index.php as it is the script being run de facto when you do 
this:

*Configure::write('App.baseUrl', env('SCRIPT_NAME'));*


So this is why what you see happens. Try to get mod_rewrite working, it has 
some advantages.

Borislav.

On Saturday, 14 July 2012 16:16:12 UTC+3, Kunal Bajpai wrote:

 As described in the blog tutorial - 

 Also remove these .htaccess files:

 /.htaccess/app/.htaccess/app/webroot/.htaccess

 This will make your URLs look like 
 www.example.com/index.php/controllername/actionname/param rather than 
 www.example.com/controllername/actionname/param.

 I did the same but still the above mentioned problem exists. My url - *
 blog.com/index.php/posts/ *works, but the  *blog.com/posts/ *shows the 
 error, Url not found on the server

 TIA

 Kbajpai


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: ini_set

2012-07-02 Thread Борислав Събев
It would maybe be best to put such directives in bootstrap.php as to 
separate Cake specific from application specific configurations.
The best option is to choose one. I prefer setting global variables and 
initialization variables in bootstrap.

On Monday, 2 July 2012 00:02:41 UTC+3, Superidea wrote:

 Yes and you can put it in core.php as well. 

 On Fri, Jun 29, 2012 at 7:52 AM, Dr. Tarique Sani 
 tariques...@gmail.comwrote:

 bootstrap.php

 T

 On Fri, Jun 29, 2012 at 10:53 AM, Milina Udara milina...@gmail.com 
 wrote:
  where  we can put
  ini_set(upload_max_filesize, 4M);
  ini_set(post_max_size,10M);
 
   in cakephp?
  is it working for configure the ini file
 
  --
  Our newest site for the community: CakePHP Video Tutorials
  http://tv.cakephp.org
  Check out the new CakePHP Questions site http://ask.cakephp.org and 
 help
  others with their CakePHP related questions.
 
 
  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



 --
 =
 PHP for E-Biz: http://sanisoft.com
 =

 --
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help 
 others with their CakePHP related questions.


 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




-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Autocomplete field to populate a select input example?

2012-07-02 Thread Борислав Събев
Hi there.

I am assuming that you've got he autocomplete working. So what you 
basically need to do is to make an ajax call to retrieve all cities in that 
state once it is entered.
The ajax call should call some controller method that searches for and 
returns the cities (in the selected state) in json for example. Once it has 
completed you populate the select box. 
You will need to do this on every change of the State field.


On Monday, 2 July 2012 16:39:05 UTC+3, Michael wrote:

 So I have an auto-complete field where you can type in the name of a 
 state, and once it fills in the field, I want it to show another select 
 input which is populated by all the cities in that state. Does anyone have 
 a link to a tutorial or example of this? It will save me having to hack it 
 together. Thanks


 ~Michael


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: REST APIs routing issue

2012-07-01 Thread Борислав Събев
Have you tried removing the empty call to Router::parseExtensions(); ?

On Saturday, 30 June 2012 06:46:12 UTC+3, gk wrote:

 My Notes controller looks like this-  http://pastebin.com/ReppRt4t

 And routes.php as- 

 CakePlugin::routes();
 Router::parseExtensions('json');
 Router::mapResources('notes');
 Router::parseExtensions();
 require CAKE . 'Config' . DS . 'routes.php';

 When I make GET call to http://hostname/notes.json I am able to see 
 results as expected. Sample result- http://pastebin.com/pYY3H2Ja

 But when I make GET call as http:// hostname /notes/1234.json I get error-
  {code:404,url:\/notes\/1234.json,name:Action NotesController:: 
 1234() could not be found.}

 Why is that index function is working as expected but not view function? I 
 suspect something is wrong with routing. What could be wrong?

 Thanks,
 GK







-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Pagination with HABTM?

2012-06-24 Thread Борислав Събев
Have you tried configuring the paginator in your Controller with a limit of 
10:

public $paginate = array(
'limit' = 10,
'order' = array(
'Post.title' = 'asc'
)
);



On Monday, 25 June 2012 04:14:32 UTC+3, 42startups wrote:

 Ah ok, so how would I paginate and limit results to 10?...

 $this-loadModel('Tag', $id);
 $tag = $this-Tag-read();

 On Monday, June 25, 2012 6:11:55 AM UTC+10, JonStark wrote:

 I find it easier to use LoadModel to display and sort posts from HABTM...

 Le dimanche 24 juin 2012 10:40:04 UTC+2, 42startups a écrit :

 Wow, CakePHP really hasn't got this problem sorted.

 After hours of searching I came across the solution below (which may or 
 may not be outdated), but I'm having issues applying paginatior 'limit' = 
 10 or other ordering.

 Any ideas what I'm missing?

 My model:

 public $hasAndBelongsToMany = array(
 'Post' = array(
 'className'  = 'Post',
 'joinTable'  = 'tags_posts',
 'foreignKey' = 'tag_id',
 'associationForeignKey'  = 'post_id',  
 'order'  = array('Post.created DESC'),
 'unique' = true
 )
 );

 In my controller in view()

 public function view($id) {
 $this-Tag-bindModel(array('hasOne' = array('TagsPost')), false); 
 $this-set('tag', $this-paginate('Tag', array('TagsPost.tag_id' = 
 $id))); 
 }

 In my view I then had to change:

 foreach ($tag['Post'] as $post)

 to

 foreach ($tag[0]['Post'] as $post)



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: How to do a REST WS?

2012-06-22 Thread Борислав Събев
Hi, Lucas.

Firstly if you're developing a REST service it's best to use Cake 2.x and 
higher - you can just use the latest stable version. The new Cake version 
has a lot of improvements which will come in handy when you're doing a REST 
service.Then how would you go about building your REST sevice? I will try 
to describe this as 
a general overview of how things should all work together:

Firstly you should set up some of the aspects of 
Routinghttp://book.cakephp.org/2.0/en/development/routing.html
.
  Concerning *Router**::mapResources(**);* is the fast way to go - it is 
used to setup a number of default routes for 
RESThttp://book.cakephp.org/2.0/en/development/rest.html#the-simple-setupaccess
 to your controllers.
If you want a more fine grade setup you should consider using custom REST 
routinghttp://book.cakephp.org/2.0/en/development/rest.html#custom-rest-routingwhich
 is what I personally prefer using:

*Router::connect('/:candidates/addrecord', array('controller'= 
'candidates', 'action' = 'addRecord', '[method]' = 'POST'));
Router::connect('/:candidates/editrecord', array('controller'= 
'candidates', 'action' = 'editRecord', '[method]' = 'POST'));
Router::connect('/:candidates/deleterecord', array('controller'= 
'candidates', 'action' = 'deleteRecord', '[method]' = 'POST'));
*
  Once you've configured the routes you can proceed to identifying 
requests. Nevertheless this is still part of the initial Router 
configuration:
*   Router::parseExtensions('xml','json','rss'); *- This will instruct the 
router to parse out file extensions from the URL for e.g.:
*http://www.example.com/articles.xml* would parse a file extension of 
xml. What this will yield is that the parsed file extension will become 
available in the Controller's 
$params property (in *$this-params['ext']*). This property is used 
(runtime) by the RequestHandler component to automatically switch to 
alternate layouts and templates, and load helpers corresponding to the 
given content. So this will greatly help you in the development of a REST 
service, if you set all your layouts/views by the conventions.

So what about handling and serving responses to requests? Firstly you 
should add the 
RequestHandlerhttp://book.cakephp.org/2.0/en/core-libraries/components/request-handling.htmlcomponent.
 If you will be using it in all controllers (which should be the 
case :) ) you should add it the AppController's $components property:

*public $components = array(
'DebugKit.Toolbar',
'Session',
'Auth' = array(
'loginRedirect' = array('controller' = 'users', 'action' 
= 'index'),
'logoutRedirect' = array('controller' = 'users', 'action' 
= 'login')
),
'RequestHandler'
);
*
When the application receives a request for e.g. on: *
http://www.example.com/records.xml* by default this will call* 
RecordsController::**index()*.
Here's an example structure of a add method:
*
public function addRecord() {
if ($this-request-is('post')) {
//Authentication ?
//Validate incoming data
if ($this-RecorisXmld-saveAll($data)){
if($this-RequestHandler-isXml()){
//Serve a Xml responce 
}
if($this-RequestHandler-isRss()){
//Serve RSS
}
}
} 
}*

CakePHP now (since 2.1) has Json and Xml view 
classeshttp://book.cakephp.org/2.0/en/views/json-and-xml-views.html. 
What this will do is that for e.g. After adding 'json' to 
Router::parseExtensions() in your routes file, CakePHP will automatically 
switch view classes when a request is done with the .json extension, or the 
Accept header is application/json.

So this basically is it. By enabling Cake's core features you could be able 
to easily manage a REST service. Hope this helped.

Cheers,
   Borislav.

On Thursday, 21 June 2012 20:26:28 UTC+3, Lucas Simon Rodrigues Magalhaes 
wrote:

 Hello I need to build an application in Webservice to return data for a 
 particular billing.

 First I'm using cakePHP version 1.3, and following the cake book [1].
 According to according to the book I should map the model which give 
 permission to access REST.
 I thought about using REST to provide data json / xml instead of nusoap, 
 but I'm sure how to do it.

 First I'm using cakePHP version 1.3, and following the cake book [1].
 According to according to the book I should map the model which give 
 permission to access REST.

 The problem:
 In this case I need to perform a find in various tables and perform an 
 operation with her results in a foreach, and then send the answer to this 
 operation via JSON / XML.

 What I did:
 I created a controller called ws_billing_controller.php that will manage 
 the requests get to the rest.
 routes.php - Router :: mapResources ('') / / empty do not know what to 
 put here
 routes.php - Router :: parseExtensions ('json', 'xml');
 ws_billing_controller.php - 

Re: How to do a REST WS?

2012-06-22 Thread Борислав Събев
Yes! I am aware. :) I didn't want to use the strict REST model in this 
application - yes some of this is actually copy/paste from an WebService I 
did.
As you can see all requests are POST - I wanted to avoid PUT and DELETE 
requests and implement strong authentication. Anyhow you're right, I didn't 
mention this in the reply.

On Friday, 22 June 2012 13:56:55 UTC+3, the_woodsman wrote:

 Sorry to be pedantic, but unless I don't understand these routes,  it's 
 worth mentioning that this example isn't strictly REST:

 *Router::connect('/:candidates/addrecord', array('controller'= 
 'candidates', 'action' = 'addRecord', '[method]' = 'POST'));
 Router::connect('/:candidates/editrecord', array('controller'= 
 'candidates', 'action' = 'editRecord', '[method]' = 'POST'));
 Router::connect('/:candidates/deleterecord', array('controller'= 
 'candidates', 'action' = 'deleteRecord', '[method]' = 'POST'));*
 *
 *
 REST URLs shouldn't contain any verbs, like add, edit, delete, etc, only 
 nouns. The verbs are implicit in the method, ie. POST vs PUT vs GET vs 
 DELETE, rather than all using POST.

 This is an HTTP based API, and there's nothing wrong with that! But just 
 to be clear about REST vs HTTP, I thought I should mention...


 On Friday, 22 June 2012 10:14:42 UTC+1, Борислав Събев wrote:

 Hi, Lucas.

 Firstly if you're developing a REST service it's best to use Cake 2.x and 
 higher - you can just use the latest stable version. The new Cake version 
 has a lot of improvements which will come in handy when you're doing a REST 
 service.Then how would you go about building your REST sevice? I will try 
 to describe this as 
 a general overview of how things should all work together:

 Firstly you should set up some of the aspects of 
 Routinghttp://book.cakephp.org/2.0/en/development/routing.html
 .
   Concerning *Router**::mapResources(**);* is the fast way to go - it is 
 used to setup a number of default routes for 
 RESThttp://book.cakephp.org/2.0/en/development/rest.html#the-simple-setupaccess
  to your controllers.
 If you want a more fine grade setup you should consider using custom 
 REST 
 routinghttp://book.cakephp.org/2.0/en/development/rest.html#custom-rest-routingwhich
  is what I personally prefer using:

 *Router::connect('/:candidates/addrecord', array('controller'= 
 'candidates', 'action' = 'addRecord', '[method]' = 'POST'));
 Router::connect('/:candidates/editrecord', array('controller'= 
 'candidates', 'action' = 'editRecord', '[method]' = 'POST'));
 Router::connect('/:candidates/deleterecord', array('controller'= 
 'candidates', 'action' = 'deleteRecord', '[method]' = 'POST'));
 *
   Once you've configured the routes you can proceed to identifying 
 requests. Nevertheless this is still part of the initial Router 
 configuration:
 *   Router::parseExtensions('xml','json','rss'); *- This will instruct 
 the router to parse out file extensions from the URL for e.g.:
 *http://www.example.com/articles.xml* would parse a file extension of 
 xml. What this will yield is that the parsed file extension will become 
 available in the Controller's 
 $params property (in *$this-params['ext']*). This property is used 
 (runtime) by the RequestHandler component to automatically switch to 
 alternate layouts and templates, and load helpers corresponding to the 
 given content. So this will greatly help you in the development of a REST 
 service, if you set all your layouts/views by the conventions.

 So what about handling and serving responses to requests? Firstly you 
 should add the 
 RequestHandlerhttp://book.cakephp.org/2.0/en/core-libraries/components/request-handling.htmlcomponent.
  If you will be using it in all controllers (which should be the 
 case :) ) you should add it the AppController's $components property:

 *public $components = array(
 'DebugKit.Toolbar',
 'Session',
 'Auth' = array(
 'loginRedirect' = array('controller' = 'users', 
 'action' = 'index'),
 'logoutRedirect' = array('controller' = 'users', 
 'action' = 'login')
 ),
 'RequestHandler'
 );
 *
 When the application receives a request for e.g. on: *
 http://www.example.com/records.xml* by default this will call* 
 RecordsController::**index()*.
 Here's an example structure of a add method:
 *
 public function addRecord() {
 if ($this-request-is('post')) {
 //Authentication ?
 //Validate incoming data
 if ($this-RecorisXmld-saveAll($data)){
 if($this-RequestHandler-isXml()){
 //Serve a Xml responce 
 }
 if($this-RequestHandler-isRss()){
 //Serve RSS
 }
 }
 } 
 }*

 CakePHP now (since 2.1) has Json and Xml view 
 classeshttp://book.cakephp.org/2.0/en/views/json-and-xml-views.html. 
 What this will do is that for e.g. After adding 'json' to 
 Router::parseExtensions() in your routes file

Re: User Info from Auth Component

2012-06-20 Thread Борислав Събев
This could be the case - a wrongly implemented Authentication system. @Joey 
Hauschildt $this-Auth-user() and the Auth.User Session key should both 
return/contain the full user information - i.e. all fields from the users 
DB table. This behaviour is strange. Can you provide more info on your 
exact implementation.

Cheers, 
   Borislav.


On Wednesday, 20 June 2012 00:36:24 UTC+3, Max Dörfler wrote:

  
 http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#identifying-users-and-logging-them-in

 In 2.0 $this-Auth-login($this-request-data) will log the user in 
 with whatever data is posted, whereas in 1.3 
 $this-Auth-login($this-data) would try to identify the user first and 
 only log in when successful.

 I assume you are yousing 2.x. I guess this is what you are looking for. 
 Call login() without params.

 On 06/19/2012 11:18 PM, Joey Hauschildt wrote: 

 I am. All passwords in the db are hashed. The problem seems to be that 
 instead of getting info from the users table, it is only filling 
 debug($this-Session-read('Auth.User')); 
 and debug($this-Auth-User()) with data from the form. Otherwise the 
 password would be hashed. It has nowhere else to get an unhashed password 
 from. This seems like a pretty poor choice for default behavior. I would 
 prefer that my app didn't store passwords from the form anywhere.

 On Tuesday, June 19, 2012 2:50:45 PM UTC-6, Jeremy Burns wrote: 

 You should be hashing the password before saving it.
  
 Jeremy Burns
 Class Outfit

 http://www.classoutfit.com 

  On 19 Jun 2012, at 19:41:30, Joey Hauschildt wrote:

 debug($this-Session-read('Auth.User')); and debug($this-Auth-User()); 
 both return:

 array(
  'User' = array(
  'password' = '*',
  'email' = 't...@example.com'
  )
 )

 These are the fields that the user uses to log in. The password isn't 
 even hashed. When I print_r, it displays the actual password. I would like 
 to have access to other user info like an ID or role. Do I need to use my 
 own query to get this info or should the Auth Component be grabbing that 
 stuff for me?.
  
  -- 
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org 
 Check out the new CakePHP Questions site http://ask.cakephp.org and help 
 others with their CakePHP related questions.
  
  
 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

  
  -- 
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org 
 Check out the new CakePHP Questions site http://ask.cakephp.org and help 
 others with their CakePHP related questions.
  
  
 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


 

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: User Info from Auth Component

2012-06-20 Thread Борислав Събев
Yup, let me clarify a bit more, you're passing $this-reuqest-data into 
$this-Auth-login():
   $this-Auth-login($this-request-data)
This will always log the user in no matter what is posted!

On Thursday, 21 June 2012 00:37:07 UTC+3, Max Dörfler wrote:

  Like I said: You are passing data into the login function. In 2.0 this 
 will log the user in with whatever data is posted. Thats why only the two 
 fields posted are displayed and the PW isn't hashed. Since you haven't 
 specified what version of cake you are using, I still assume this is the 
 reason. If you say you don't use cake 2.x I'll stop bothering you. ;)

 On 06/20/2012 09:27 PM, Joey Hauschildt wrote: 

 I just followed the tutorial in the book. The only custimization I made 
 was was using the email field instead of the username field.

 Here is my AppController:

 class AppController extends Controller {

  public $uses = array('User');
 
 public $components = array(
 'Session',
 'Auth' = array(
 'loginRedirect' = array('controller' = 'posts', 'action' = 
 'index'),
 'logoutRedirect' = array('controller' = 'pages', 'action' = 
 'display', 'home')
 )
 );

  public function beforeFilter() {
 $this-Auth-allow('index', 'view');
 $this-set('logged_in', $this-Auth-LoggedIn());
 $this-set('current_user', $this-Auth-user());
 //debug($this-Session-read('Auth.User'));
 }

  public function isAuthorized($user) {
 return TRUE;
 }

  }


 And here is my Users/login action:

 public function login() {
 if ($this-request-is('post')) {

  if ($this-Auth-login($this-request-data)) {
 return $this-redirect($this-Auth-redirect());
 } else {
 $this-Session-setFlash(__('Username or password is 
 incorrect'), 'default', array(), 'auth');
 }
 }
 }
  

 The beforeFilter in my Users controller:

 public function beforeFilter() {
 parent::beforeFilter();
 $this-Auth-fields = array('username' = 'email', 'password' = 
 'password');
 $this-Auth-allow('add', 'logout');
 }
  

  
 On Wednesday, June 20, 2012 12:31:35 AM UTC-6, Борислав Събев wrote: 

 This could be the case - a wrongly implemented Authentication system. @Joey 
 Hauschildt $this-Auth-user() and the Auth.User Session key should both 
 return/contain the full user information - i.e. all fields from the users 
 DB table. This behaviour is strange. Can you provide more info on your 
 exact implementation.

 Cheers, 
Borislav.


 On Wednesday, 20 June 2012 00:36:24 UTC+3, Max Dörfler wrote: 

  
 http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#identifying-users-and-logging-them-in

 In 2.0 $this-Auth-login($this-request-data) will log the user in 
 with whatever data is posted, whereas in 1.3 
 $this-Auth-login($this-data) would try to identify the user first 
 and only log in when successful.

 I assume you are yousing 2.x. I guess this is what you are looking for. 
 Call login() without params.

 On 06/19/2012 11:18 PM, Joey Hauschildt wrote: 

 I am. All passwords in the db are hashed. The problem seems to be that 
 instead of getting info from the users table, it is only filling 
 debug($this-Session-read('Auth.User')); 
 and debug($this-Auth-User()) with data from the form. Otherwise the 
 password would be hashed. It has nowhere else to get an unhashed password 
 from. This seems like a pretty poor choice for default behavior. I would 
 prefer that my app didn't store passwords from the form anywhere.

 On Tuesday, June 19, 2012 2:50:45 PM UTC-6, Jeremy Burns wrote: 

 You should be hashing the password before saving it.
  
 Jeremy Burns
 Class Outfit

 http://www.classoutfit.com 

  On 19 Jun 2012, at 19:41:30, Joey Hauschildt wrote:

 debug($this-Session-read('Auth.User')); 
 and debug($this-Auth-User()); both return:

 array(
  'User' = array(
  'password' = '*',
  'email' = 't...@example.com'
  )
 )

 These are the fields that the user uses to log in. The password isn't 
 even hashed. When I print_r, it displays the actual password. I would like 
 to have access to other user info like an ID or role. Do I need to use my 
 own query to get this info or should the Auth Component be grabbing that 
 stuff for me?.
  
  -- 
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org 
 Check out the new CakePHP Questions site http://ask.cakephp.org and 
 help others with their CakePHP related questions.
  
  
 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

  
  -- 
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org 
 Check out the new CakePHP Questions site http://ask.cakephp.org and 
 help others with their CakePHP related questions.
  
  
 To unsubscribe

Re: JsHelper

2012-06-20 Thread Борислав Събев
Well I personally do not use JsHelper as I prefer clean JavaScript but 
after reading this tutorial form the CakePHP 
Bookhttp://book.cakephp.org/2.0/en/core-libraries/helpers/js.htmlthe answer 
would be:

?php$this-Js-get('#select1')-event('change', $eventCode);
?

Where $eventCode should change the value of #select2.


With some clean jQuery code the answer will be:

 $(document).ready(function() {

   $('#select1').change(function(){
 $('#select2').val(NEWVALUEHERE);
   });
 
 });



On Monday, 18 June 2012 09:32:04 UTC+3, Renato Carvalho wrote:

 Hello guys, 

 I am trying to set the 'value' of a select using the cake 2.x 
 JsHelper, but unlucky so far. 

 I`ve managed to change all options of the select, but I have no clue 
 on how to change only the 'value'. 

 I have 2 selects with constant options (the options doesn`t change). 
 I want to set the 'value' of the second select, depending on the 
 'value' of the first select. 

 Does anyone here knows how to do this? 

 Thanks.


On Monday, 18 June 2012 09:32:04 UTC+3, Renato Carvalho wrote:

 Hello guys, 

 I am trying to set the 'value' of a select using the cake 2.x 
 JsHelper, but unlucky so far. 

 I`ve managed to change all options of the select, but I have no clue 
 on how to change only the 'value'. 

 I have 2 selects with constant options (the options doesn`t change). 
 I want to set the 'value' of the second select, depending on the 
 'value' of the first select. 

 Does anyone here knows how to do this? 

 Thanks.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: CakePHP developer in Bologna

2012-06-20 Thread Борислав Събев
You have a private message.

You can check it out.

Cheers, 
   Borislav Sabev.

On Wednesday, 20 June 2012 10:26:45 UTC+3, Cyanto wrote:

 Hi all, 

 I'm searching for a developer or a software house located in Bologna, 
 Italy. 

 Anybody can help me? 

 Thanks in advance. 

 Antonio Fracasso

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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