Re: CakePHP Session lost / Facebook SDK / Cookies

2014-01-19 Thread AuB BuSTA


 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: Console Shells on sub-domains

2014-01-19 Thread Reuben
Running the console from within the specific site app directory 
(/var/www/vhosts/mydomain.com/site1/app) looks like the right thing to do, 
however, because it's picking up a different site at run time, it would go 
looking for the include_path setting in the php.ini. It looks like the path 
for site2 could be hardcoded in that setting.  

I'm not sure that putting /usr/share/cakephp2 on the PATH is desired, 
because CakePHP 2.x installations have Console/cake under the app directory 
anyway, and would rely on the include_path to pick up the correct lib 
directory for CakePHP Core.

As a side note, in CakePHP 3, each CakePHP application is expected to have 
it's own installation of CakePHP Core installed via composer, possibly 
existing under the vendors directory. With a CakePHP 2.x installation using 
composer, the CakePHP Core, using a pear package, would exist under 
app/Vendor/pear-pear.cakephp.org, and composer would take care of setting 
up the include_path via the autoload.php in app/Vendor.  If you're starting 
out with a new multi-domain set up, I would strong recommend using composer 
with CakePHP 2.x, so you're used to it if/when you should upgrade to 
CakePHP 3.  You will also relieve yourself of the burden of having to 
upgrade all the sites at the same time, should you need to upgrade CakePHP 
versions for minor releases.

Regards
Reuben Helms

On Sunday, 19 January 2014 09:39:48 UTC+10, April DeRossett wrote:

 I don't know why I can't wrap my head around this. 

 *Situation:*
 I have multiple cake applications located as subdomains with my domain 
 being organized as follows:

 mydomain.com

- *site1*.mydomain.com
   - *site2*.mydomain.com
   - site3.mydomain.com
   - etc...

 I have installed my CakePHP Console under /usr/share/cakephp2.  I modified 
 my .bash_profile to include this path for export PATH.  When I run cake 
 from any location I get the Welcome to CakePHP message.

 I have created a HelloShell.php following the instruction on the Cake 
 website and placed it in 
 /var/www/vhosts/mydomain.com/*site1*/app/Console/Command.  
 then I run the following:

 # cd /site1/app

 # Console/cake hello

 and get the following:

- PHP Warning:  strtotime(): It is not safe to rely on the system's 
timezone settings. You are *required* to use the date.timezone setting or 
the date_default_timezone_set() function. In case you used any of those 
methods and you are still getting this warning, you most likely misspelled 
the timezone identifier. We selected 'America/Denver' for 'MST/-7.0/no 
 DST' 
instead in 
 /var/www/vhosts/mydomain.com/*site2*/lib/Cake/Cache/CacheEngine.php 
on line 60
- Error: Shell class HelloShell could not be found.
#0 
 /var/www/vhosts/mydomain.com/*site2*/lib/Cake/Console/ShellDispatcher.php(190):
  
ShellDispatcher-_getShell('ba')
#1 
 /var/www/vhosts/mydomain.com/*site2*/lib/Cake/Console/ShellDispatcher.php(68):
  
ShellDispatcher-dispatch()
#2 /var/www/vhosts/mydomain.com/*site2*/lib/Cake/Console/cake.php(51): 
ShellDispatcher::run(Array)
#3 {main}

 *Question:*

1. Why is the ShellDispatcher looking in the site2 directory when I am 
running from the site1 app?
2. If I place the same HelloShell.php in the /var/www/vhosts/
mydomain.com/*site2*/app/Console/Command -- It runs without issue.  


 *Goal:* My goal is to be able to run CRON jobs using shells from each of 
 the subdomains.  

 Any help you can give will be greatly appreciated.  


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


Pros and cons of Cakephp versus Laravel

2014-01-19 Thread Sam
Dear Cakephp gurus,

I have used cakephp in a past project (simple one) and I would like to 
continue using cakephp in a new project. There are some voices which 
advocate using Laravel which is an up-and-coming php framework. 

For experienced programmers who know something about both frameworks, could 
you tell me what are the pros and cons?

Since I use cakephp before, here are my comments about cakephp;
Pros
- It uses convention over configuration
I like this because I am forgetful. If the framework uses configuration 
over convention, I may miss out things to configure when things are changed 
or added to the code.

Cons
- It does quite a bit of magic in the background(can be good or bad) and 
loses flexibility in the process. If the programmer wants to do special 
things, he may have to fight cakephp.

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


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

2014-01-19 Thread Sam
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 for a View to access another unrelated Model's data?

2014-01-19 Thread Reuben
Generally, it's bad practice for a View to perform direct finds against a 
Model.  Even when the model is related to a view via convention, it is 
usually the controller that has performed the find, and executed a 
$this-set(compact('modelData')) or similar to expose the model data to a 
view.

With that in mind, you can expose any model to the view via the controller, 
by finding the data in the controller, and exposing via $this-set().  You 
just may need to the unrelated models in the controller via 
$this-loadModel(), or in the $uses variable of the controller, if it is 
used often.

In the View or in Elements, you may be able to use $this-requestAction() 
to call a specific controller action to get data to display in a View or 
Element, however, this is not something I do, so someone else or the 
CakePHP Book may have better guidelines on actual usage.

Regards
Reuben Helms

On Monday, 20 January 2014 12:32:05 UTC+10, 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: Pros and cons of Cakephp versus Laravel

2014-01-19 Thread Reuben
I've not had experience with Laravel, but with regards to the magic being 
a con, specifically when it comes to the convention of models, table names 
and controllers, I've had plenty of experience with using legacy databases 
that don't conform to the convention, and have still been able to use them, 
without changing the database to suit. 

That flexibility one of the reasons I use CakePHP.  

You can override $name on the controller, and use a controller name that 
doesn't conform to the convention.

You can override $useTable 
[http://book.cakephp.org/2.0/en/models/model-attributes.html#usetable] on 
the model, to map to a table that doesn't use the plural convention. And 
you can use $useTable to suppress mapping to a table altogether (for 
implementing web services via the model).

The only time I've had to fight CakePHP is when I want to extend the 
FormHelper to add additional types, or override existing types for 
alternate output and convenience.  However, that doesn't happen very often.

With a minor modification to the core (index.php), I've never had success 
in integrating CakePHP Sessions into legacy applications so I can gradually 
migrate and introduce new functionality using CakePHP to the legacy 
application.

If there are specific cases of magic that you're concerned with, let us 
know, and someone could probably tell you if what you're wanting to do 
would be a problem or not.

Regards
Reuben Helms


On Monday, 20 January 2014 12:17:27 UTC+10, Sam wrote:

 Dear Cakephp gurus,

 I have used cakephp in a past project (simple one) and I would like to 
 continue using cakephp in a new project. There are some voices which 
 advocate using Laravel which is an up-and-coming php framework. 

 For experienced programmers who know something about both frameworks, 
 could you tell me what are the pros and cons?

 Since I use cakephp before, here are my comments about cakephp;
 Pros
 - It uses convention over configuration
 I like this because I am forgetful. If the framework uses configuration 
 over convention, I may miss out things to configure when things are changed 
 or added to the code.

 Cons
 - It does quite a bit of magic in the background(can be good or bad) and 
 loses flexibility in the process. If the programmer wants to do special 
 things, he may have to fight cakephp.


-- 
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: Pros and cons of Cakephp versus Laravel

2014-01-19 Thread Cesar Felipe
The thing that I like more about cakephp is it is simple for a beginner 
programmer like me, before I had tried many frameworks but cakephp I was 
the only that made sense for me. (I'm not  a programmer genius)  

2 months ago I tried laravel and it was simple to understand like cakephp 
plus had many features never seen before in PHP like the ORM system. Now 
I'm using laravel in all my new projects. 






On Sunday, January 19, 2014 7:17:27 PM UTC-7, Sam wrote:

 Dear Cakephp gurus,

 I have used cakephp in a past project (simple one) and I would like to 
 continue using cakephp in a new project. There are some voices which 
 advocate using Laravel which is an up-and-coming php framework. 

 For experienced programmers who know something about both frameworks, 
 could you tell me what are the pros and cons?

 Since I use cakephp before, here are my comments about cakephp;
 Pros
 - It uses convention over configuration
 I like this because I am forgetful. If the framework uses configuration 
 over convention, I may miss out things to configure when things are changed 
 or added to the code.

 Cons
 - It does quite a bit of magic in the background(can be good or bad) and 
 loses flexibility in the process. If the programmer wants to do special 
 things, he may have to fight cakephp.


-- 
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: Pros and cons of Cakephp versus Laravel

2014-01-19 Thread Reuben Helms
I just had a quick gander at the doco. Whilst ORMs aren't never seen
before features in PHP (looking at you, Doctrine), it certainly seems like
Laravel is at a place where CakePHP 3 is going to take existing CakePHP
users. PHP 5.4 using namespaces, location services implemented at static
functions on the model (CakePHP 3 will split the 2.x Model into
Table/Entity) and a fluent API.

The big difference might be that Laravel is built using Symphony
components, so it's a framework on a framework, where as CakePHP doesn't
depend on other PHP components, other than composer (as does Laravel).

Had Laravel existed in late 2008 when I went looking for a PHP MVC
framework that I could integrate with legacy applications, then I might
have easily gone with Laravel instead.  Although, from memory, Symphony was
a little bit all or nothing back then, and I'm not sure that any other
framework built on top of it would have been any more flexible.



On Mon, Jan 20, 2014 at 3:40 PM, Cesar Felipe cesarfel...@gmail.com wrote:

 The thing that I like more about cakephp is it is simple for a beginner
 programmer like me, before I had tried many frameworks but cakephp I was
 the only that made sense for me. (I'm not  a programmer genius)

 2 months ago I tried laravel and it was simple to understand like cakephp
 plus had many features never seen before in PHP like the ORM system. Now
 I'm using laravel in all my new projects.






 On Sunday, January 19, 2014 7:17:27 PM UTC-7, Sam wrote:

 Dear Cakephp gurus,

 I have used cakephp in a past project (simple one) and I would like to
 continue using cakephp in a new project. There are some voices which
 advocate using Laravel which is an up-and-coming php framework.

 For experienced programmers who know something about both frameworks,
 could you tell me what are the pros and cons?

 Since I use cakephp before, here are my comments about cakephp;
 Pros
 - It uses convention over configuration
 I like this because I am forgetful. If the framework uses configuration
 over convention, I may miss out things to configure when things are changed
 or added to the code.

 Cons
 - It does quite a bit of magic in the background(can be good or bad) and
 loses flexibility in the process. If the programmer wants to do special
 things, he may have to fight cakephp.

  --
 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/KvA7AYFLx6g/unsubscribe.
 To unsubscribe from this group and all its topics, 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.


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