bcompiler_write_class -- 以字节码形式写出一个定义好的类
描述
警告 |
这个函数是
试验性质的。 这意味着基于这些函数上的所有操作,这些函数名,包括所有发布在这里的文档都有可能在不做任何提示的情况下在将来正式发布时发生变动。如果要使用这个模块,请自负风险。 |
从一个已经存在的 PHP 类中读出字节码并将他们写入一个打开的文件管理器中。它并不执行可靠性检查,因此你必须确信按顺序写入这些类——不然当你加载时会出现“未定义的类”的警告。
例 1. bcompiler_write_class() 举例 <?php
$fh = fopen("/tmp/example","w");
bcompiler_write_header($fh);
bcompiler_write_class($fh,"DB");
// you must write DB_common before DB_mysql, as DB_mysql extends DB_common.
bcompiler_write_class($fh,"DB_common");
bcompiler_write_class($fh,"DB_mysql");
bcompiler_write_footer($fh);
fclose($fh);
?> |
|
请参阅: bcompiler_write_header(), bcompiler_write_footer().