利用adsutil.vbs关闭。打开菜单“开始” 》》》“运行”,输入“cmd” 打开命令行模式。
进入到目录cd C:\inetpub\adminscripts。
运行如下命令,关闭端口
cscript adsutil.vbs set w3svc/
其中ID,可查看IIS属性,开始》》》运行,输入 “inetmgr”打开Internet信息服务,右击你的站点,点属性。

进入属性对话框。

点击日志部分的属性,进入扩展日志记录属性。

查看日志文件名,W3SVC后面的数字即为ID,如我的机器输入如下命令:
cscript adsutil.vbs set w3svc/1/securebindings ""
恢复打开的端口需要输入如下命令:
abstract class ttt{
protected $_vals = array ();
abstract function sayhi();
public function __set($name, $value) {
$this->_vals [$name] = $value;
}
public function __get($name) {
return array_key_exists ( $name, $this->_vals ) ? $this->_vals [$name] : null;
}
}
class test extends ttt {
//private $a='';
function sayhi(){
$this->aa = 'a';
echo $this->aa; // ccc
var_dump( empty($this) ); // false
var_dump( empty($this->aa) ); // true
}
}
$tt = new test();
$tt->sayhi();
这是整个代码,
不重载__get, __set没事,先声明也没事,难道是bug?
cakephp的代码,放到服务器上就报“Missing Database Table”错。
Missing Database Table
Error: Database table sipusers for model Sipuser was not found.
Notice: If you want to customize this error message, create app/views/errors/missing_table.ctp
在本地运行的好好的,这个比较晕。
经过测试,修改,把服务器上的Sipuser.php文件名改为小写。把$useTable变量的表名也改为:var $useTable = 'subscriber';。这样就可以了。
其他$default配置中的表也有同样的问题。呵呵,其他几个文件我是用cake bake生成的。
主要是大小写不匹配的问题。欢迎大家讨论。
附上多库连接的方法:
1、database.php中新建一个连接配置。
2、model中使用使用如下方法引入即可:
var $useDbConfig = 'sipdb';
var $useTable = 'subscriber';
private function Generate($min = 600000, $max = 700000) {
global $conn, $tbl_users;
static $depth = 0;
if ($depth > 3) {
return FALSE;
}
$depth ++;
$userid = mt_rand ( $min, $max );
$query = "SELECT `userid` FROM {$tbl_users} WHERE userid='{$userid}' LIMIT 1;";
if (FALSE != ($result = mysql_query ( $query, $conn ))) {
if (mysql_num_rows ( $result ) < 1) {
mysql_free_result ( $result );
} else {
mysql_free_result ( $result );
$this->Generate ( $min, $max );
}
} else {
使用DreamweaverCS4编辑Cakephp的CTP文件示例:
Poedit的使用
1、设置首选项
使Poedit支持Cakephp的*.ctp文件。
打开“文件”菜单,“首选项”,“解析器”,“新建立。”
使用CTP文件的解析器命令:
xgettext --language=PHP --force-po -o %o %C %K %F

没设置好会出现这样的错误:xgettext: warning: file ‘.ctp’ extension ‘ctp’ is unknown; will try C.
2、新建项目
打开“文件”菜单,“新建消息目录文档”,全进入设置对话框,

复数形式可设置为:nplurals=2; plural=n==1?0:1;
源文件编码可不设置,如果设置一定要设置正确,如utf-8。
路径设置为你的源代码路径:

关键字设置为函数名之类的即可,如图:
MS微软所有产品下载地址
Subscriber Downloads | Search and download thousands of Microsoft products and get Product Keys
https://msdn.microsoft.com/en-us/subscriptions/downloads/default.aspx
装的是ApacheFriends XAMPP (Basispaket) version 1.7.1的组件。php执行如下代码,apache崩溃,原因未知。
<?php
function foo($str) {
static $i = 0;
print "$str : $i";
++ $i;
}
register_tick_function ( 'foo', 'count' );
declare ( ticks = 6 ) {
for($i = 0; $i < 20; ++ $i) {
echo "$i";
}
}
?>
1、html跳转:
< meta http-equiv="refresh" content="5; url=http://www.yong3g.com/" / >
2、js跳转:
window.location.href = "http://www.yong3g.com";
3、php跳转:
1).htaccess
redirect 301 /old.htm http://www.yong3g.com
或
RewriteEngine On
RewriteRule ^(.*)$ http://www.yong3g.com/ [R=301,L]
2)header
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.yong3g.com/");
exit();
?>
4、asp跳转:
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www.yong3g.com/"
Response.End
%>
5、JSP跳转:
最新评论
4 周 4 天之前
1 年 22 周之前
1 年 25 周之前