Skip to content
ateliee edited this page Oct 27, 2015 · 1 revision

その他

FTP Manager(class_ftp.php)

$FTP = new class_ftp;
$FTP->ftp_server = "localhost";
$FTP->user_name = "user_name";
$FTP->user_pass = "password";
$FTP->pasv(true);
// connect FTP
$result = $FTP->connect();
// connect SSL
$result = $FTP->ssl_connect();
// close
$FTP->close();

File Manager(class_file.php)

$FILE = new class_file;
$FILE->setDir($DIR);
// read
$FILE->readArray($filename);
$FILE->readAll($filename);
$FILE->readDirAll($filename);

APNS Server Side(class_apns.php)

  • APNS is iPhone App Push Notifications On Server Side.
  • single push support(multible is next update)
$APNS = new class_apns;
// setting
$APNS->init($APNS_ID,$APNS_PASS);
// set debug mode
$APNS->setDebug(true);
// send device token
$APNS->setDeviceToken($token);
// set message(options)
$APNS->setBody(array(
    'alert' => $message,
    "badge" => 1,
    'sound' => 'default',
    'content-available' => 1
));
// send
$APNS->pushMessage();

GCM Server Side(class_gcm.php)

  • single and multible Push Notifications
$GCM = new class_gcm;
// setting
$GCM->init($API_KEY);
// send device
$GCM->setRegistrationIDs($IDS);
// options
$GCM->setData(array(
    'collapse_key' => "update",  //  オンライン復活時に表示する文字列
    'time_to_live' => 60 * 60 * 24 * 28,  // クライアント端末がオフラインであった場合に、いつまでメッセージを保持するか。秒単位で指定。
    'delay_while_idle' => false,  // 端末がidle時はactiveになるまで送信を待つ
    'dry_run' => false,  //  true:実際にはメッセージを送信しない。開発時のテスト用。
    'data' => array('message' => $message)       // ペイロード
));
// send message
$GCM->pushMessage();

Functions(/func/)

// user agent check
is_mobile_docomo_agent();
is_mobile_kddi_agent();
is_mobile_softbank_agent();
is_mobile_willcom_agent();
is_iphone_agent();
is_ipad_agent();
is_ipod_agent();
is_android_agent();
is_tablet_agent();
// ip to mobile carrier
$carrier_id = get_ip_carrier();
// Basic Auth For PHP
AuthenticateUser(array("sample" => "sample"));
// checked put html
$html = htmlChecked(true);    // output checked="checked"
$html = htmlDisabled(true);    // output disabled="disabled"
$html = htmlReadonly(true);    // output readonly="readonly"
// select options output
$options = makeValueOpts(array("1" => "Tokyo"));
// pnkz html making
$pnkz = array();
$pnkz[] = makePnkz("home","http://sample.com/");
$pnkz[] = makePnkz("about","http://sample.com/about/");
$html = getPnkz($pnkz,array("mode" => "list"));
// function
d($value);   // <pre> and print_r()
h($value);   // html htmlspecialchars()
m($value);   // mysql mysql_real_escape_string()
m_pathinfo($value);  // pathinfo for php4,5
// array function
$first_key = get_first_key($ary);   // get array first key
$first_val = get_first_value($ary);   // get array first value
$last_key = get_last_key($ary);   // get array last key
$last_val = get_last_value($ary);   // get array last value

Other Class View

  • Social Plugins(Facebook/Twitter)
  • Blog Post(Wordpress/Ameba/FC2)
  • Create Calender
  • Flickr API
  • IMAP Class
  • Mobile Class
  • PDF Class
  • Rakuten API
  • RSS Class
  • wiki API
  • XML Class
  • YAhoo API
  • Zip Class
  • validation Class