cakephp-2.x

Please anyone tell me how i solve this problem.please help someone

牧云@^-^@ 提交于 2021-02-11 04:31:47
问题 Notice (8): Use of undefined constant ankitgir_deshbhakt - assumed 'ankitgir_deshbhakt' [CORE/Cake/Model/ConnectionManager.php, line 69] Code Context include_once APP . 'Config' . DS . 'database.php'; if (class_exists('DATABASE_CONFIG')) { static::$config = new DATABASE_CONFIG(); ``` ConnectionManager::_init() - CORE/Cake/Model/ConnectionManager.php, line 69 ConnectionManager::getDataSource() - CORE/Cake/Model/ConnectionManager.php, line 83 Model::setDataSource() - CORE/Cake/Model/Model.php,

Best way to upgrade a Cakephp project from Cakephp 2.6.2 to 3.8

半腔热情 提交于 2021-02-05 07:54:08
问题 I have been tasked with upgrading a legacy system from Cakephp2.6.2 to Cakephp3.8. Obviously the 2 are drastically different but is there a simple way of getting the old project to work with the new cake version? Or could anyone steer me in the right direction for the best way to do this? 回答1: There is no generic "best way" that fits all. The best way is the easiest way for your specific application that results in a properly working application, but that's something that you need to

How can I set the samesite cookie attribute in CakePHP 2.3?

流过昼夜 提交于 2020-12-15 06:38:34
问题 CakePHP 2.3 sets the Session variables (including cookie attributes) in the core.php file. I need to set samesite=None and Secure=true for the session cookie, but it doesn't appear to have those settings available in the configuration, which shows only the following options: Session.cookie - The name of the cookie to use. Defaults to 'CAKEPHP' Session.timeout - The number of minutes you want sessions to live for. This timeout is handled by CakePHP Session.cookieTimeout - The number of minutes

How can I set the samesite cookie attribute in CakePHP 2.3?

余生长醉 提交于 2020-12-15 06:38:17
问题 CakePHP 2.3 sets the Session variables (including cookie attributes) in the core.php file. I need to set samesite=None and Secure=true for the session cookie, but it doesn't appear to have those settings available in the configuration, which shows only the following options: Session.cookie - The name of the cookie to use. Defaults to 'CAKEPHP' Session.timeout - The number of minutes you want sessions to live for. This timeout is handled by CakePHP Session.cookieTimeout - The number of minutes

CakePHP 2 : Implement CakePDF plugin by Ceeram

陌路散爱 提交于 2020-01-05 04:54:06
问题 I'm trying to implement the CakePDF plugin designed by Ceeram. I'm using CakePHP 2 and I work locally using wamp on windows vista. I followed everything from the readme file but I got stucked at some point. What I'd firstly like to do is converting an HTML link to a PDF using the WkHtmlToPdf engine. I see many people having issues to make it work so I'm gonna detail all the way through in the following different steps. STEP 1: CakePdf plugin by Ceeram I downloaded the plugin at https://github

Cannot use 'Object as class name as it is reserved Cake 2.2.x

一曲冷凌霜 提交于 2019-12-30 14:08:43
问题 I'm having an issue trying to set up a testing copy of a site we have running, I have the files and applications installed under a Mint VM and when I point apache at the directory I get a 500 error and the following- [Thu Oct 25 15:09:39.714201 2018] [php7:error] [pid 8945] [client 192.168.0.14:52237] PHP Fatal error: Cannot use 'Object' as class name as it is reserved in /home/jamesmcgrath/Documents/dashboard/lib/Cake/Core/Object.php on line 30 [Thu Oct 25 15:09:39.714547 2018] [php7:error]

CakePHP: How can I use a “HAVING” operation when building queries with find method?

。_饼干妹妹 提交于 2019-12-20 10:27:29
问题 I'm trying to use the "HAVING" clause in a SQL query using the CakePHP paginate() method. After some searching around it looks like this can't be achieved through Cake's paginate()/find() methods. The code I have looks something like this: $this->paginate = array( 'fields' => $fields, 'conditions' => $conditions, 'recursive' => 1, 'limit' => 10, 'order' => $order, 'group' => 'Venue.id'); One of the $fields is an alias "distance". I want to add a query for when distance < 25 (e.g. HAVING

Auth logout is not working in CakePHP 2.x

别等时光非礼了梦想. 提交于 2019-12-12 16:18:07
问题 When I login from one user account session is set.Then opening the next tab on same browser and enter login url it takes me to the login page.But actually it should redirect to the "dashboard" page(in my case). It can't redirect to loginRedirect (dashboard) page as mentioned in my Auth . When i logout, as per my code session,cookie and cache are deleted. but it's not redirect to logoutRedirect page. My code : App controller public $components = array( 'Session', 'RequestHandler', 'Email',

CakePHP 2.x theme not working

旧街凉风 提交于 2019-12-12 03:44:05
问题 I have a problem with CakePHP (newest version) themes. I have created new theme to /app/View/Themed/Start/ and it contains default.ctp inside the Start folder. I have edited /app/Controller/AppController.php and I placed this code inside it: class ThemeController extends AppController { public $theme = 'Start'; } But it still uses the default layout instead of my own template. What am I doing wrong here? 回答1: That code shouldn't be placed in AppController (Or anywhere for that matter) all you

How to create a join that uses a subquery?

牧云@^-^@ 提交于 2019-12-08 05:27:02
问题 How do you convert the following SQL Query to a CakePhp Find Query? SELECT a.id, a.rev, a.contents FROM YourTable a INNER JOIN ( SELECT id, MAX(rev) rev FROM YourTable GROUP BY id ) b ON a.id = b.id AND a.rev = b.rev I have tried the code below: return $model->find('all', [ 'fields' => $fields, 'joins' => [ [ 'table' => $model->useTable, 'fields' => ['id','MAX(rev) as rev'], 'alias' => 'max_rev_table', 'type' => 'INNER', 'group' => ['id'], 'conditions' => [ $model->name.'.id= max_rev_table.id