iPhone的通讯录以拼音排序

Posted on 10月 6, 2007 - Filed Under MacosX, php, shell | 1 Comment

在iphone中安装php
将代码保存为py.php
ssh 登陆iphone或者在iphone安装Term-vt100
执行 php py.php 等待重启完成
结束
支持的中文貌似很有限,拼音表的处理看来要自己搞一个了,这个在网上找的。
py.php
<?php
/**
* @desc 将iPhone的通讯录以拼音排序, 需要安装PHP
* @author Kafeifei <http://www.nimab.org>
* @version 0.2beta
*/
error_reporting(0);
$sqlite_file = '/private/var/root/Library/AddressBook/AddressBook.sqlitedb'; // 1.1.3 以前的版本
$sqlite_file = '/private/var/mobile/Library/AddressBook/AddressBook.sqlitedb'; // 1.1.3 以后的版本
if (!file_exists($sqlite_file)) {
println("SQLiteDB:File Notfound.");
die;
}
$dsn = "sqlite:{$sqlite_file}";
try {
$dbh = new PDO($dsn);
println("Open {$dsn} OK.");
} catch (Exception $e) {
[...]

Read More..>>