icash365_com源码本机调试

本文介绍了一种详细的步骤来部署基于CakePHP的应用程序。包括数据库配置、文件结构调整、缓存清理及验证码组件集成等内容。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. copy一份到htdocs\icash365_com下

2. 导入sql

3. 访问http://localhost/icash365_com/ 应为空白页面

4. 修改app\config\database.php $test
[quote]'prefix' => 'icash365_',[/quote]

5. 修改app\app_model.php

<?php
class AppModel extends Model {
var $useDbConfig = 'test';
}


6. 修改htdocs文件夹名字为 webroot

7. 修改.htaccess

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>


8. 删除app\tmp\cache

9. 修改app\config\core.php

Configure::write('debug', 2);
Configure::write('Cache.disable', true);


10. webroot\js\ckeditor 和 ckfinder 修改config.js

$baseUrl = '/icash365_com/upload/';
$baseDir = 'D:/xampp/htdocs/icash365_com/webroot/upload/';


10.1 view ctp 文件中使用 echo $ckeditor->input('body', array('rows' => '10', 'cols' => '70'));

10.2 controller 中加入 var $helpers = array('Ckeditor');

10.3 app\views\helpers\ckeditor.php 中修改

return $this->Javascript->codeBlock('CKFinder.SetupCKEditor(null, \'/icash365_com/js/ckfinder/\');');


11. vcode验证码 view中增加

echo $form->input('password_confirm', array('type' => 'password'));

<p><label for="UserVcodeConfirm">验证码:</label>
<input id="UserVcodeConfirm" type="text" value="" name="data[User][vcode_confirm]" style="width:50px;" />
<img id="vcode" onclick="document.getElementById('vcode').src='/icash365_com/users/vcode?'+Math.random();" style="cursor: pointer;margin-top:-6px;" src="/icash365_com/users/vcode" title="看不清楚?换一张试试" /></p>


11.1 controller中增加

//增加
var $components=array('Session', 'Vcode');

//action中增加
if ($this->data['User']['password'] == $this->Auth->password($this->data['User']['password_confirm']) && $this->data['User']['vcode_confirm'] == $_SESSION['vcode']) {
...
} else {
$this->Session->setFlash(__('Please correct your input.', true));
}
unset($_SESSION['vcode']);

//增加action
function vcode(){
$this->Vcode->render();
}

//增加到action
$auth_allow = array('vcode');



11.2 增加 app\controllers\components\vcode.php 组件文件

11.3 导入库 app\vendors\vcode\vcode.php 类库文件
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值