wiki:waue/2011/1202
cassandra php sample code with icas graph data
cassandra-1.0.1 + thrift-0.7.0 +

前言

  • 原本 icas 所有的圖檔都用資料夾做日期區分,用php 直接撈資料夾內的資料做呈現
  • 此程式碼的作法是:用png_init.php 製作兩個cassandra 的 family,用 png_input.php 匯入所有 png 資料夾內的png圖檔,而因為是將 png 檔的binary 資料直接匯入到 cassandra 內,因此需用 png_out.php 轉換二元碼後呈現該圖, png_show.php 為使用者終端介面

環境

  • php 5
  • cassandra-1.0.1
  • thrift-0.7.0
  • Cassandra-PHP-Client-Library
    • 無版本宣告,僅能從git 下載最新的code
  • jquery_ui 1.8.16
    • png_show.php 用到

使用方法

  • 安裝 cassandra-1.0.1 與 thrift-0.7.0
  • 啟動 cassandra
  • 安裝 Cassandra-PHP-Client-Library 於 apache 網頁目錄
  • 將附件的所有 php 檔放在 與 Cassandra-PHP-Client-Library 同一目錄
  • 將 png_examp.tar.gz 內的 png 資料夾放在 Cassandra-PHP-Client-Library 一起
  • 先後執行
    • png_init.php
    • png_input.php
    • png_show.php

demo

http://secuse.nchc.org.tw/workspace/phpthrift/png_show.php

http://trac.nchc.org.tw/cloud/raw-attachment/wiki/waue/2011/1202/2011-12-02-184206_933x751_scrot.png

Last modified 12 years ago Last modified on Dec 2, 2011, 6:51:08 PM

Attachments (7)