icash365_com源码本机调试

1. copy一份到htdocs\icash365_com下

2. 导入sql

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

4. 修改app\config\database.php $test
引用
'prefix' => 'icash365_',


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 类库文件




你可能感兴趣的:(JavaScript,sql,PHP,cache)