Re: 'Site under maintenance' option

2014-02-20 Thread web developer
You can look into
https://github.com/awebdeveloper/cakephp-maintenance-mode

On Tuesday, 6 September 2011 01:15:20 UTC+5:30, Xoubaman wrote:

 I'm trying to implement a system to disable the site temporaly for 
 maintenance purposes or whatever. If the site is disabled, only logged 
 users can navigate through it, non-logged users are redirected to a Site 
 under maintenance layout.

 Currently (o As of now), my approach is to allow a secret url that 
 will lead to the login form, check in AppController::beforefilter if the 
 current url is the allowed one and, if it isn't, set the maintenance 
 layout. Trying to figure out how to allow only one url to log in, I came to 
 define it as a constant in bootstrap and add the route in config/routes 
 pointing to UsersController::login.

 It would be nice to save the secret url into the database and change it 
 without editing bootstrap.php, though.

 Any suggestion?




-- 
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: CakePHP 1.3.8 and 1.2.10 released

2011-04-19 Thread web developer
when can we expect 2.0.   What percent is remaining according to 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


Getting data from level 2

2011-04-19 Thread web developer
Look at this Task(id,name,user_id) belongsTo User(id,name,country_id) which 
belongsTo Country(id,name)

Now in Task Controller i want all the tasks with their user(id,name) and 
users  countries(name)

How can i achieve without recursive 2 or without firing more than 2 queries. 
 

Hope the above example is clear  



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


Cakephp Model Testing

2010-09-15 Thread web developer
I am using cakephp 1.2 and would like to know how to do/use testing in
cakephp.I went through book.cakephp.org on testing (till model
testing). I hit a roadblock when i tried model testing.

This is what i did

A. Downloaded simpletest and added it in vendors folder
B. Created test connection in database.php
C. Set debug level to 2 in core
D. Copied core test files from cake git's /cake/tests to my app's /
cake/tests
E. Created Fixture

 ?php
   class AirlineFixture extends CakeTestFixture {
  var $name = 'Airline';
  var $import = 'Airline';
  var $records = array(
  array ('id' = 1, 'name' = 'First  Airline', 'type' =
'all'),
  array ('id' = 2, 'name' = 'Secd Airline', 'type' =
'all'),
  array ('id' = 3, 'name' = 'Third  Airline', 'type' =
'all')
  );
   }
 ?

F. Wrote test case

 ?php
App::import('Model', 'Airline');
class AirlineTestCase extends CakeTestCase {
var $fixtures = array( 'app.Airline' );

function testPublished() {
$this-Airline = ClassRegistry::init('Airline');
$result = $this-Airline-published(array('id', 'name'));
$expected =  array(
  array ('id' = 1, 'name' = 'First  Airline', 'type' =
'all'),
  array ('id' = 2, 'name' = 'Secd Airline', 'type' =
'all'),
  array ('id' = 3, 'name' = 'Third  Airline', 'type' =
'all')
  );
  $this-assertEqual($result, $expected);
}
}
?

G. I executes http://localhost/fsd/test.php . when i did it i got the
following error

Fatal error: Call to undefined function CakePHPTestHeader() in /var/
www/fsd/app/webroot/test.php on line 141

What wrong am i doing

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en


Re: Cakephp Model Testing

2010-09-15 Thread web developer
Any answers/solutions ???

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en