test.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?php
  2. /*
  3. function a($name) {
  4. echo 'i am a';
  5. var_dump($name);
  6. return true;
  7. }
  8. function b($name) {
  9. echo 'i am b';
  10. var_dump($name);
  11. include_once 'GXG.php';
  12. }
  13. spl_autoload_register('b');
  14. spl_autoload_register('a');
  15. //print_r(spl_autoload_functions());
  16. new GXG();
  17. echo 'azzz';
  18. */
  19. define('KIF_PATH', '/export/manager/KIF');
  20. require_once KIF_PATH . '/init.php';
  21. use KIF\Core\Request;
  22. use KIF\Dao\AbstractDao;
  23. function test ($memc, $key, & $val) {
  24. var_dump('i am test');
  25. $val = microtime(true);
  26. return true;
  27. }
  28. use KIF\Cache\Memcached;
  29. use KIF\Core\Config;
  30. Config::load(dirname(dirname(__FILE__)) . DS . 'config/config.inc.php');
  31. $objMemcached = new Memcached();
  32. //$tmpResult = $objMemcached->set('ttkey', 'takbkbk', 60*5);
  33. $tmpResult = $objMemcached->get('ttzu', 'test', $cas_token);
  34. //$tmpResult = $objMemcached->get(123333);
  35. //$tmpResult = $objMemcached->delete(123333);
  36. var_dump($tmpResult);
  37. var_dump($cas_token);
  38. echo "<br /><br />";
  39. echo Request::rootDomain('backend.localhost.com.cn');
  40. echo "<br /><br />";
  41. use KIF\Db\MySQLi;
  42. class ProductIndex extends AbstractDao {
  43. protected $tableName = 'product_index';
  44. protected $primaryKey = 'productid';
  45. }
  46. $objProductIndex = new ProductIndex();
  47. $result = $objProductIndex->gets(array(291110, '291109', '2911107'));
  48. //$objProductIndex->update(array('ename' => ''), array('productid' => 291109));
  49. print_r($result);
  50. /*
  51. $dsn = 'mysqli://root:@kimiss@10.15.200.181/product?charset=utf8&name=gxg';
  52. $objMysqli = new MySQLi($dsn);
  53. $sql = "select * from product_index limit 1;";
  54. $arr = $objMysqli->fetchOne($sql);
  55. print_r($arr);
  56. $sql = "select * from product_review_index limit 1;";
  57. $arr = $objMysqli->fetchOne($sql);
  58. print_r($arr);
  59. */
  60. use KIF\Debug\Debug;
  61. /*
  62. # 邮箱服务器与帐号定义
  63. define("SMTP_HOSTNAME", "smtp.qq.com");
  64. //define("SMTP_SERVER", "27.131.221.229");
  65. define("SMTP_PORT", 25);
  66. define("SMTP_USERNAME", "husserl");
  67. define("SMTP_FROM", "husserl@qq.com");
  68. define("SMTP_FROMNAME", "高街时尚网");
  69. define("SMTP_PASSWORD", "lulu851031");
  70. define("SMTP_CHARSET", "UTF8");
  71. define("SMTP_TIMEOUT", 20);
  72. Debug::time('send mail start');
  73. use KIF\Mail\Mail;
  74. $objMail = new Mail();
  75. $result = $objMail->send(array(
  76. 'address' => 'husserl@qq.com',
  77. 'subject' => '你好,测试邮件啊哈哈',
  78. ));
  79. Debug::time('send mail end');
  80. Debug::log('mail send result', $result);
  81. */