TestLog.php 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: stanley-king
  5. * Date: 2018/5/7
  6. * Time: 下午9:16
  7. */
  8. define('BASE_ROOT_PATH',str_replace('/test','',dirname(__FILE__)));
  9. require_once(BASE_ROOT_PATH . '/fooder.php');
  10. require_once(BASE_ROOT_PATH . '/helper/statistics/stlog.php');
  11. class TestLog extends PHPUnit_Framework_TestCase
  12. {
  13. public static function setUpBeforeClass()
  14. {
  15. Base::run_util();
  16. }
  17. public function testPairlog()
  18. {
  19. $checker = new scope_trace(__METHOD__);
  20. $input = '0';
  21. $ret = empty($input);
  22. if('0' === false) {
  23. $ret = 10;
  24. }
  25. }
  26. public function testLoc()
  27. {
  28. $path = '/Users/stanley-king/tmp/20180506.log';
  29. $stlog = new statistics\stlog($path);
  30. $stlog->daily();
  31. }
  32. public function testStart()
  33. {
  34. $line = '[28785 2018-05-06 00:08:47] DEBUG: content=act=login&op=status';
  35. $command = '/\[(\d*)\s+(.*)\]\s+DEBUG:\s+(.*)/ui';
  36. $val = preg_match_all($command,$line,$match);
  37. $trdid = intval($match[1][0]);
  38. $stime = strtotime($match[2][0]);
  39. $content = $match[3][0];
  40. }
  41. public function testUrl()
  42. {
  43. $json = '{
  44. "tag": "classesInSession",
  45. "success": 1,
  46. "error": 0,
  47. "class_counts": 80,
  48. "classes": [{
  49. "class_id": 139,
  50. "seesion_id": 7,
  51. "title": "\u7b2c1\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u8fdb\u5165\u5f53\u4e0b",
  52. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/1.mp3",
  53. "created_at": "2017-03-23 13:58:06",
  54. "updated_at": "2017-03-23 13:58:06",
  55. "author_name": "\u777f\u5fc3\u7075\u7280",
  56. "duration": "13:36",
  57. "play_times": 8156
  58. }, {
  59. "class_id": 140,
  60. "seesion_id": 7,
  61. "title": "\u7b2c2\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u6709\u610f\u8bc6\u7684\u653e\u677e",
  62. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/2.mp3",
  63. "created_at": "2017-03-23 13:58:06",
  64. "updated_at": "2017-03-23 13:58:06",
  65. "author_name": "\u777f\u5fc3\u7075\u7280",
  66. "duration": "13:20",
  67. "play_times": 5330
  68. }, {
  69. "class_id": 141,
  70. "seesion_id": 7,
  71. "title": "\u7b2c3\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u56de\u5230\u4f60\u7684\u4e94\u611f",
  72. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/3.mp3",
  73. "created_at": "2017-03-23 13:58:06",
  74. "updated_at": "2017-03-23 13:58:06",
  75. "author_name": "\u777f\u5fc3\u7075\u7280",
  76. "duration": "11:12",
  77. "play_times": 3661
  78. }, {
  79. "class_id": 142,
  80. "seesion_id": 7,
  81. "title": "\u7b2c4\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u53cb\u5584\u7684\u6001\u5ea6",
  82. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/4.mp3",
  83. "created_at": "2017-03-23 13:58:06",
  84. "updated_at": "2017-03-23 13:58:06",
  85. "author_name": "\u777f\u5fc3\u7075\u7280",
  86. "duration": "13:37",
  87. "play_times": 4227
  88. }, {
  89. "class_id": 143,
  90. "seesion_id": 7,
  91. "title": "\u7b2c5\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u6b63\u5ff5\u547c\u5438",
  92. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/5.mp3",
  93. "created_at": "2017-03-23 13:58:06",
  94. "updated_at": "2017-03-23 13:58:06",
  95. "author_name": "\u777f\u5fc3\u7075\u7280",
  96. "duration": "09:44",
  97. "play_times": 1651
  98. }, {
  99. "class_id": 424,
  100. "seesion_id": 7,
  101. "title": "\u7b2c6\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u4f34\u968f\u547c\u5438\u7684\u5e73\u9759\u548c\u7a33\u5b9a",
  102. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/6.mp3",
  103. "created_at": "2017-03-23 18:03:13",
  104. "updated_at": "2017-03-23 18:03:13",
  105. "author_name": "\u777f\u5fc3\u7075\u7280",
  106. "duration": "10:00",
  107. "play_times": 2021
  108. }, {
  109. "class_id": 425,
  110. "seesion_id": 7,
  111. "title": "\u7b2c7\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u6570\u547c\u5438",
  112. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/7.mp3",
  113. "created_at": "2017-03-23 18:03:13",
  114. "updated_at": "2017-03-23 18:03:13",
  115. "author_name": "\u777f\u5fc3\u7075\u7280",
  116. "duration": "10:00",
  117. "play_times": 1631
  118. }, {
  119. "class_id": 426,
  120. "seesion_id": 7,
  121. "title": "\u7b2c8\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u6df1\u5165\u4e13\u6ce8\u529b",
  122. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/8.mp3",
  123. "created_at": "2017-03-23 18:03:13",
  124. "updated_at": "2017-03-23 18:03:13",
  125. "author_name": "\u777f\u5fc3\u7075\u7280",
  126. "duration": "10:00",
  127. "play_times": 1927
  128. }, {
  129. "class_id": 427,
  130. "seesion_id": 7,
  131. "title": "\u7b2c9\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u8eab\u4f53\u7684\u6b63\u5ff5",
  132. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/9.mp3",
  133. "created_at": "2017-03-23 18:03:13",
  134. "updated_at": "2017-03-23 18:03:13",
  135. "author_name": "\u777f\u5fc3\u7075\u7280",
  136. "duration": "10:00",
  137. "play_times": 1773
  138. }, {
  139. "class_id": 428,
  140. "seesion_id": 7,
  141. "title": "\u7b2c10\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u7531\u5185\u800c\u5916\u7684\u611f\u53d7",
  142. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/10.mp3",
  143. "created_at": "2017-03-23 18:03:13",
  144. "updated_at": "2017-03-23 18:03:13",
  145. "author_name": "\u777f\u5fc3\u7075\u7280",
  146. "duration": "10:00",
  147. "play_times": 1633
  148. }, {
  149. "class_id": 429,
  150. "seesion_id": 7,
  151. "title": "\u7b2c11\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u8eab\u4f53\u626b\u63cf",
  152. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/11.mp3",
  153. "created_at": "2017-03-23 18:03:13",
  154. "updated_at": "2017-03-23 18:03:13",
  155. "author_name": "\u777f\u5fc3\u7075\u7280",
  156. "duration": "10:00",
  157. "play_times": 1739
  158. }, {
  159. "class_id": 430,
  160. "seesion_id": 7,
  161. "title": "\u7b2c12\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u547d\u540d\u611f\u53d7",
  162. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/12.mp3",
  163. "created_at": "2017-03-23 18:03:13",
  164. "updated_at": "2017-03-23 18:03:13",
  165. "author_name": "\u777f\u5fc3\u7075\u7280",
  166. "duration": "10:00",
  167. "play_times": 1395
  168. }, {
  169. "class_id": 431,
  170. "seesion_id": 7,
  171. "title": "\u7b2c13\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u5e94\u5bf9\u5f3a\u70c8\u7684\u611f\u53d7",
  172. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/13.mp3",
  173. "created_at": "2017-03-23 18:03:13",
  174. "updated_at": "2017-03-23 18:03:13",
  175. "author_name": "\u777f\u5fc3\u7075\u7280",
  176. "duration": "10:00",
  177. "play_times": 1568
  178. }, {
  179. "class_id": 432,
  180. "seesion_id": 7,
  181. "title": "\u7b2c14\u5929 - \u60c5\u5546 | \u6b63\u5ff5\u548c\u60c5\u7eea",
  182. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/14.mp3",
  183. "created_at": "2017-03-23 18:03:13",
  184. "updated_at": "2017-03-23 18:03:13",
  185. "author_name": "\u777f\u5fc3\u7075\u7280",
  186. "duration": "10:00",
  187. "play_times": 1549
  188. }, {
  189. "class_id": 433,
  190. "seesion_id": 7,
  191. "title": "\u7b2c15\u5929 - \u60c5\u5546 | \u547d\u540d\u60c5\u7eea\t",
  192. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/15.mp3",
  193. "created_at": "2017-03-23 18:03:13",
  194. "updated_at": "2017-03-23 18:03:13",
  195. "author_name": "\u777f\u5fc3\u7075\u7280",
  196. "duration": "10:00",
  197. "play_times": 939
  198. }, {
  199. "class_id": 434,
  200. "seesion_id": 7,
  201. "title": "\u7b2c16\u5929 - \u60c5\u5546 | \u5e94\u5bf9\u56f0\u96be\u60c5\u7eea",
  202. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/16.mp3",
  203. "created_at": "2017-03-23 18:03:13",
  204. "updated_at": "2017-03-23 18:03:13",
  205. "author_name": "\u777f\u5fc3\u7075\u7280",
  206. "duration": "10:00",
  207. "play_times": 1466
  208. }, {
  209. "class_id": 435,
  210. "seesion_id": 7,
  211. "title": "\u7b2c17\u5929 - \u60c5\u5546 | \u57f9\u517b\u79ef\u6781\u60c5\u7eea",
  212. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/17.mp3",
  213. "created_at": "2017-03-23 18:03:13",
  214. "updated_at": "2017-03-23 18:03:13",
  215. "author_name": "\u777f\u5fc3\u7075\u7280",
  216. "duration": "10:00",
  217. "play_times": 1490
  218. }, {
  219. "class_id": 436,
  220. "seesion_id": 7,
  221. "title": "\u7b2c18\u5929 - \u60c5\u5546 | \u8ba4\u51fa\u5ff5\u5934\u7684\u4e0d\u65ad\u4ea7\u751f",
  222. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/18.mp3",
  223. "created_at": "2017-03-23 18:03:13",
  224. "updated_at": "2017-03-23 18:03:13",
  225. "author_name": "\u777f\u5fc3\u7075\u7280",
  226. "duration": "10:00",
  227. "play_times": 1286
  228. }, {
  229. "class_id": 437,
  230. "seesion_id": 7,
  231. "title": "\u7b2c19\u5929 - \u60c5\u5546 | \u548c\u5ff5\u5934\u7684\u667a\u6167\u5173\u7cfb",
  232. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/19.mp3",
  233. "created_at": "2017-03-23 18:03:13",
  234. "updated_at": "2017-03-23 18:03:13",
  235. "author_name": "\u777f\u5fc3\u7075\u7280",
  236. "duration": "10:00",
  237. "play_times": 1326
  238. }, {
  239. "class_id": 438,
  240. "seesion_id": 7,
  241. "title": "\u7b2c20\u5929 - \u60c5\u5546 | \u5ff5\u5934\u4e0b\u7684\u751f\u6d3b",
  242. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/20.mp3",
  243. "created_at": "2017-03-23 18:03:14",
  244. "updated_at": "2017-03-23 18:03:14",
  245. "author_name": "\u777f\u5fc3\u7075\u7280",
  246. "duration": "10:00",
  247. "play_times": 1171
  248. }, {
  249. "class_id": 439,
  250. "seesion_id": 7,
  251. "title": "\u7b2c21\u5929 - \u60c5\u5546 | \u8d85\u8d8a\u5ff5\u5934",
  252. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/21.mp3",
  253. "created_at": "2017-03-23 18:03:14",
  254. "updated_at": "2017-03-23 18:03:14",
  255. "author_name": "\u777f\u5fc3\u7075\u7280",
  256. "duration": "10:00",
  257. "play_times": 1135
  258. }, {
  259. "class_id": 440,
  260. "seesion_id": 7,
  261. "title": "\u7b2c22\u5929 - \u97e7\u6027\uff0c\u7597\u6108\u548c\u5185\u5728\u7684\u81ea\u7531 | \u6b63\u5ff5\u6838\u5fc3\u7ec3\u4e60",
  262. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/22.mp3",
  263. "created_at": "2017-03-23 18:03:14",
  264. "updated_at": "2017-03-23 18:03:14",
  265. "author_name": "\u777f\u5fc3\u7075\u7280",
  266. "duration": "10:00",
  267. "play_times": 1809
  268. }, {
  269. "class_id": 441,
  270. "seesion_id": 7,
  271. "title": "\u7b2c23\u5929 - \u97e7\u6027\uff0c\u7597\u6108\u548c\u5185\u5728\u7684\u81ea\u7531 | \u81ea\u6211\u8bc4\u5224\u548c\u81ea\u6211\u5173\u6000",
  272. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/23.mp3",
  273. "created_at": "2017-03-23 18:03:14",
  274. "updated_at": "2017-03-23 18:03:14",
  275. "author_name": "\u777f\u5fc3\u7075\u7280",
  276. "duration": "10:00",
  277. "play_times": 1276
  278. }, {
  279. "class_id": 442,
  280. "seesion_id": 7,
  281. "title": "\u7b2c24\u5929 - \u97e7\u6027\uff0c\u7597\u6108\u548c\u5185\u5728\u7684\u81ea\u7531 | RAIN",
  282. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/24.mp3",
  283. "created_at": "2017-03-23 18:03:14",
  284. "updated_at": "2017-03-23 18:03:14",
  285. "author_name": "\u777f\u5fc3\u7075\u7280",
  286. "duration": "10:00",
  287. "play_times": 1004
  288. }, {
  289. "class_id": 443,
  290. "seesion_id": 7,
  291. "title": "\u7b2c25\u5929 - \u97e7\u6027\uff0c\u7597\u6108\u548c\u5185\u5728\u7684\u81ea\u7531 | \u60c5\u7eea\u548c\u5185\u5728\u8d44\u6e90",
  292. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/25.mp3",
  293. "created_at": "2017-03-23 18:03:14",
  294. "updated_at": "2017-03-23 18:03:14",
  295. "author_name": "\u777f\u5fc3\u7075\u7280",
  296. "duration": "10:00",
  297. "play_times": 1002
  298. }, {
  299. "class_id": 444,
  300. "seesion_id": 7,
  301. "title": "\u7b2c26\u5929 - \u97e7\u6027\uff0c\u7597\u6108\u548c\u5185\u5728\u7684\u81ea\u7531 | \u521d\u5b66\u8005\u7684\u5fc3",
  302. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/26.mp3",
  303. "created_at": "2017-03-23 18:03:14",
  304. "updated_at": "2017-03-23 18:03:14",
  305. "author_name": "\u777f\u5fc3\u7075\u7280",
  306. "duration": "10:00",
  307. "play_times": 827
  308. }, {
  309. "class_id": 445,
  310. "seesion_id": 7,
  311. "title": "\u7b2c27\u5929 - \u97e7\u6027\uff0c\u7597\u6108\u548c\u5185\u5728\u7684\u81ea\u7531 | \u65e0\u8fb9\u65e0\u9645\u7684\u89c9\u77e5",
  312. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/27.mp3",
  313. "created_at": "2017-03-23 18:03:14",
  314. "updated_at": "2017-03-23 18:03:14",
  315. "author_name": "\u777f\u5fc3\u7075\u7280",
  316. "duration": "10:00",
  317. "play_times": 932
  318. }, {
  319. "class_id": 446,
  320. "seesion_id": 7,
  321. "title": "\u7b2c28\u5929 - \u97e7\u6027\uff0c\u7597\u6108\u548c\u5185\u5728\u7684\u81ea\u7531 | \u5e73\u7b49\u5fc3",
  322. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/28.mp3",
  323. "created_at": "2017-03-23 18:03:14",
  324. "updated_at": "2017-03-23 18:03:14",
  325. "author_name": "\u777f\u5fc3\u7075\u7280",
  326. "duration": "10:00",
  327. "play_times": 769
  328. }, {
  329. "class_id": 447,
  330. "seesion_id": 7,
  331. "title": "\u7b2c29\u5929 - \u97e7\u6027\uff0c\u7597\u6108\u548c\u5185\u5728\u7684\u81ea\u7531 | \u5bf9\u89c9\u77e5\u7684\u6b63\u5ff5",
  332. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/29.mp3",
  333. "created_at": "2017-03-23 18:03:14",
  334. "updated_at": "2017-03-23 18:03:14",
  335. "author_name": "\u777f\u5fc3\u7075\u7280",
  336. "duration": "10:00",
  337. "play_times": 769
  338. }, {
  339. "class_id": 448,
  340. "seesion_id": 7,
  341. "title": "\u7b2c30\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u540c\u7406\u5fc3\u548c\u6148\u60b2\u5fc3",
  342. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/30.mp3",
  343. "created_at": "2017-03-23 18:03:14",
  344. "updated_at": "2017-03-23 18:03:14",
  345. "author_name": "\u777f\u5fc3\u7075\u7280",
  346. "duration": "10:00",
  347. "play_times": 882
  348. }, {
  349. "class_id": 449,
  350. "seesion_id": 7,
  351. "title": "\u7b2c31\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u5bbd\u6055",
  352. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/31.mp3",
  353. "created_at": "2017-03-23 18:03:14",
  354. "updated_at": "2017-03-23 18:03:14",
  355. "author_name": "\u777f\u5fc3\u7075\u7280",
  356. "duration": "10:00",
  357. "play_times": 809
  358. }, {
  359. "class_id": 450,
  360. "seesion_id": 7,
  361. "title": "\u7b2c32\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u770b\u89c1\u5584\u6027",
  362. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/32.mp3",
  363. "created_at": "2017-03-23 18:03:14",
  364. "updated_at": "2017-03-23 18:03:14",
  365. "author_name": "\u777f\u5fc3\u7075\u7280",
  366. "duration": "10:00",
  367. "play_times": 749
  368. }, {
  369. "class_id": 451,
  370. "seesion_id": 7,
  371. "title": "\u7b2c33\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u610f\u56fe",
  372. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/33.mp3",
  373. "created_at": "2017-03-23 18:03:14",
  374. "updated_at": "2017-03-23 18:03:14",
  375. "author_name": "\u777f\u5fc3\u7075\u7280",
  376. "duration": "10:00",
  377. "play_times": 690
  378. }, {
  379. "class_id": 452,
  380. "seesion_id": 7,
  381. "title": "\u7b2c34\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u51b2\u7a81",
  382. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/34.mp3",
  383. "created_at": "2017-03-23 18:03:14",
  384. "updated_at": "2017-03-23 18:03:14",
  385. "author_name": "\u777f\u5fc3\u7075\u7280",
  386. "duration": "10:00",
  387. "play_times": 680
  388. }, {
  389. "class_id": 453,
  390. "seesion_id": 7,
  391. "title": "\u7b2c35\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u503e\u542c",
  392. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/35.mp3",
  393. "created_at": "2017-03-23 18:03:14",
  394. "updated_at": "2017-03-23 18:03:14",
  395. "author_name": "\u777f\u5fc3\u7075\u7280",
  396. "duration": "10:00",
  397. "play_times": 671
  398. }, {
  399. "class_id": 454,
  400. "seesion_id": 7,
  401. "title": "\u7b2c36\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u6b63\u5ff5\u7684\u8bf4",
  402. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/36.mp3",
  403. "created_at": "2017-03-23 18:03:14",
  404. "updated_at": "2017-03-23 18:03:14",
  405. "author_name": "\u777f\u5fc3\u7075\u7280",
  406. "duration": "10:00",
  407. "play_times": 695
  408. }, {
  409. "class_id": 455,
  410. "seesion_id": 7,
  411. "title": "\u7b2c37\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u4fe1\u4efb\u548c\u5b58\u5728\u4e8e\u4f60\u7684\u5b58\u5728",
  412. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/37.mp3",
  413. "created_at": "2017-03-23 18:03:14",
  414. "updated_at": "2017-03-23 18:03:14",
  415. "author_name": "\u777f\u5fc3\u7075\u7280",
  416. "duration": "10:00",
  417. "play_times": 771
  418. }, {
  419. "class_id": 456,
  420. "seesion_id": 7,
  421. "title": "\u7b2c38\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u6177\u6168\u548c\u670d\u52a1",
  422. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/38.mp3",
  423. "created_at": "2017-03-23 18:03:14",
  424. "updated_at": "2017-03-23 18:03:14",
  425. "author_name": "\u777f\u5fc3\u7075\u7280",
  426. "duration": "10:00",
  427. "play_times": 577
  428. }, {
  429. "class_id": 457,
  430. "seesion_id": 7,
  431. "title": "\u7b2c39\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u57f9\u80b2\u611f\u6069\u7684\u5fc3",
  432. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/39.mp3",
  433. "created_at": "2017-03-23 18:03:14",
  434. "updated_at": "2017-03-23 18:03:14",
  435. "author_name": "\u777f\u5fc3\u7075\u7280",
  436. "duration": "10:00",
  437. "play_times": 631
  438. }, {
  439. "class_id": 458,
  440. "seesion_id": 7,
  441. "title": "\u7b2c40\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u671f\u8bb8\u548c\u613f\u666f",
  442. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/40.mp3",
  443. "created_at": "2017-03-23 18:03:14",
  444. "updated_at": "2017-03-23 18:03:14",
  445. "author_name": "\u777f\u5fc3\u7075\u7280",
  446. "duration": "10:00",
  447. "play_times": 643
  448. }, {
  449. "class_id": 459,
  450. "seesion_id": 7,
  451. "title": "1 Arriving in Presence",
  452. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/1e.mp3",
  453. "created_at": "2017-03-23 20:04:29",
  454. "updated_at": "2017-03-23 20:04:29",
  455. "author_name": "\u777f\u5fc3\u7075\u7280",
  456. "duration": "10:00",
  457. "play_times": 381
  458. }, {
  459. "class_id": 460,
  460. "seesion_id": 7,
  461. "title": "2 Conscious Relaxing",
  462. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/2e.mp3",
  463. "created_at": "2017-03-23 20:04:29",
  464. "updated_at": "2017-03-23 20:04:29",
  465. "author_name": "\u777f\u5fc3\u7075\u7280",
  466. "duration": "10:00",
  467. "play_times": 193
  468. }, {
  469. "class_id": 493,
  470. "seesion_id": 7,
  471. "title": "3 Coming Back to your Senses",
  472. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/3e.mp3",
  473. "created_at": "2017-03-23 20:27:41",
  474. "updated_at": "2017-03-23 20:27:41",
  475. "author_name": "\u777f\u5fc3\u7075\u7280",
  476. "duration": "10:00",
  477. "play_times": 181
  478. }, {
  479. "class_id": 494,
  480. "seesion_id": 7,
  481. "title": "4 Attitude of Friendliness",
  482. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/4e.mp3",
  483. "created_at": "2017-03-23 20:27:41",
  484. "updated_at": "2017-03-23 20:27:41",
  485. "author_name": "\u777f\u5fc3\u7075\u7280",
  486. "duration": "10:00",
  487. "play_times": 160
  488. }, {
  489. "class_id": 495,
  490. "seesion_id": 7,
  491. "title": "5 Mindfulness of Breath",
  492. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/5e.mp3",
  493. "created_at": "2017-03-23 20:27:41",
  494. "updated_at": "2017-03-23 20:27:41",
  495. "author_name": "\u777f\u5fc3\u7075\u7280",
  496. "duration": "10:00",
  497. "play_times": 155
  498. }, {
  499. "class_id": 496,
  500. "seesion_id": 7,
  501. "title": "6 Calming and Steadying with the Breath",
  502. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/6e.mp3",
  503. "created_at": "2017-03-23 20:27:41",
  504. "updated_at": "2017-03-23 20:27:41",
  505. "author_name": "\u777f\u5fc3\u7075\u7280",
  506. "duration": "10:00",
  507. "play_times": 163
  508. }, {
  509. "class_id": 497,
  510. "seesion_id": 7,
  511. "title": "7 Counting the Breath",
  512. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/7e.mp3",
  513. "created_at": "2017-03-23 20:27:41",
  514. "updated_at": "2017-03-23 20:27:41",
  515. "author_name": "\u777f\u5fc3\u7075\u7280",
  516. "duration": "10:00",
  517. "play_times": 136
  518. }, {
  519. "class_id": 498,
  520. "seesion_id": 7,
  521. "title": "8 Deepening the Focus",
  522. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/8e.mp3",
  523. "created_at": "2017-03-23 20:27:41",
  524. "updated_at": "2017-03-23 20:27:41",
  525. "author_name": "\u777f\u5fc3\u7075\u7280",
  526. "duration": "10:00",
  527. "play_times": 143
  528. }, {
  529. "class_id": 499,
  530. "seesion_id": 7,
  531. "title": "9 Mindfulness of the Body",
  532. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/9e.mp3",
  533. "created_at": "2017-03-23 20:27:41",
  534. "updated_at": "2017-03-23 20:27:41",
  535. "author_name": "\u777f\u5fc3\u7075\u7280",
  536. "duration": "10:00",
  537. "play_times": 135
  538. }, {
  539. "class_id": 500,
  540. "seesion_id": 7,
  541. "title": "10 Feeling from the Inside Out",
  542. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/10e.mp3",
  543. "created_at": "2017-03-23 20:27:41",
  544. "updated_at": "2017-03-23 20:27:41",
  545. "author_name": "\u777f\u5fc3\u7075\u7280",
  546. "duration": "10:00",
  547. "play_times": 138
  548. }, {
  549. "class_id": 501,
  550. "seesion_id": 7,
  551. "title": "11 Body Scan",
  552. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/11e.mp3",
  553. "created_at": "2017-03-23 20:27:41",
  554. "updated_at": "2017-03-23 20:27:41",
  555. "author_name": "\u777f\u5fc3\u7075\u7280",
  556. "duration": "10:00",
  557. "play_times": 129
  558. }, {
  559. "class_id": 502,
  560. "seesion_id": 7,
  561. "title": "12 Naming Sensations",
  562. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/12e.mp3",
  563. "created_at": "2017-03-23 20:27:41",
  564. "updated_at": "2017-03-23 20:27:41",
  565. "author_name": "\u777f\u5fc3\u7075\u7280",
  566. "duration": "10:00",
  567. "play_times": 129
  568. }, {
  569. "class_id": 503,
  570. "seesion_id": 7,
  571. "title": "13 Working with Intense Sensations",
  572. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/13e.mp3",
  573. "created_at": "2017-03-23 20:27:41",
  574. "updated_at": "2017-03-23 20:27:41",
  575. "author_name": "\u777f\u5fc3\u7075\u7280",
  576. "duration": "10:00",
  577. "play_times": 130
  578. }, {
  579. "class_id": 504,
  580. "seesion_id": 7,
  581. "title": "14 Mindfulness and Emotions",
  582. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/14e.mp3",
  583. "created_at": "2017-03-23 20:27:41",
  584. "updated_at": "2017-03-23 20:27:41",
  585. "author_name": "\u777f\u5fc3\u7075\u7280",
  586. "duration": "10:00",
  587. "play_times": 120
  588. }, {
  589. "class_id": 505,
  590. "seesion_id": 7,
  591. "title": "15 Naming Emotions",
  592. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/15e.mp3",
  593. "created_at": "2017-03-23 20:27:41",
  594. "updated_at": "2017-03-23 20:27:41",
  595. "author_name": "\u777f\u5fc3\u7075\u7280",
  596. "duration": "10:00",
  597. "play_times": 121
  598. }, {
  599. "class_id": 506,
  600. "seesion_id": 7,
  601. "title": "16 Working with Difficult Emotions",
  602. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/16e.mp3",
  603. "created_at": "2017-03-23 20:27:41",
  604. "updated_at": "2017-03-23 20:27:41",
  605. "author_name": "\u777f\u5fc3\u7075\u7280",
  606. "duration": "10:00",
  607. "play_times": 120
  608. }, {
  609. "class_id": 507,
  610. "seesion_id": 7,
  611. "title": "17 Fostering Positive Emotions",
  612. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/17e.mp3",
  613. "created_at": "2017-03-23 20:27:42",
  614. "updated_at": "2017-03-23 20:27:42",
  615. "author_name": "\u777f\u5fc3\u7075\u7280",
  616. "duration": "10:00",
  617. "play_times": 117
  618. }, {
  619. "class_id": 508,
  620. "seesion_id": 7,
  621. "title": "18 Recognizing Thinking",
  622. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/18e.mp3",
  623. "created_at": "2017-03-23 20:27:42",
  624. "updated_at": "2017-03-23 20:27:42",
  625. "author_name": "\u777f\u5fc3\u7075\u7280",
  626. "duration": "10:00",
  627. "play_times": 123
  628. }, {
  629. "class_id": 509,
  630. "seesion_id": 7,
  631. "title": "19 Wise Relationship to Thoughts",
  632. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/19e.mp3",
  633. "created_at": "2017-03-23 20:27:42",
  634. "updated_at": "2017-03-23 20:27:42",
  635. "author_name": "\u777f\u5fc3\u7075\u7280",
  636. "duration": "10:00",
  637. "play_times": 114
  638. }, {
  639. "class_id": 510,
  640. "seesion_id": 7,
  641. "title": "20 Life Under Thoughts",
  642. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/20e.mp3",
  643. "created_at": "2017-03-23 20:27:42",
  644. "updated_at": "2017-03-23 20:27:42",
  645. "author_name": "\u777f\u5fc3\u7075\u7280",
  646. "duration": "10:00",
  647. "play_times": 117
  648. }, {
  649. "class_id": 511,
  650. "seesion_id": 7,
  651. "title": "21 Beyond Thoughts",
  652. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/21e.mp3",
  653. "created_at": "2017-03-23 20:27:42",
  654. "updated_at": "2017-03-23 20:27:42",
  655. "author_name": "\u777f\u5fc3\u7075\u7280",
  656. "duration": "10:00",
  657. "play_times": 117
  658. }, {
  659. "class_id": 512,
  660. "seesion_id": 7,
  661. "title": "22 Mindfulness: The Core Practice",
  662. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/22e.mp3",
  663. "created_at": "2017-03-23 20:27:42",
  664. "updated_at": "2017-03-23 20:27:42",
  665. "author_name": "\u777f\u5fc3\u7075\u7280",
  666. "duration": "10:00",
  667. "play_times": 124
  668. }, {
  669. "class_id": 513,
  670. "seesion_id": 7,
  671. "title": "23 Self-judgement and Self-Compassion",
  672. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/23e.mp3",
  673. "created_at": "2017-03-23 20:27:42",
  674. "updated_at": "2017-03-23 20:27:42",
  675. "author_name": "\u777f\u5fc3\u7075\u7280",
  676. "duration": "10:00",
  677. "play_times": 118
  678. }, {
  679. "class_id": 514,
  680. "seesion_id": 7,
  681. "title": "24 RAIN",
  682. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/24e.mp3",
  683. "created_at": "2017-03-23 20:27:42",
  684. "updated_at": "2017-03-23 20:27:42",
  685. "author_name": "\u777f\u5fc3\u7075\u7280",
  686. "duration": "10:00",
  687. "play_times": 117
  688. }, {
  689. "class_id": 515,
  690. "seesion_id": 7,
  691. "title": "25 Emotions and Inner Resources",
  692. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/25e.mp3",
  693. "created_at": "2017-03-23 20:27:42",
  694. "updated_at": "2017-03-23 20:27:42",
  695. "author_name": "\u777f\u5fc3\u7075\u7280",
  696. "duration": "10:00",
  697. "play_times": 113
  698. }, {
  699. "class_id": 516,
  700. "seesion_id": 7,
  701. "title": "26 Beginner\'s Mind",
  702. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/26e.mp3",
  703. "created_at": "2017-03-23 20:27:42",
  704. "updated_at": "2017-03-23 20:27:42",
  705. "author_name": "\u777f\u5fc3\u7075\u7280",
  706. "duration": "10:00",
  707. "play_times": 116
  708. }, {
  709. "class_id": 517,
  710. "seesion_id": 7,
  711. "title": "27 Spacious Awareness",
  712. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/27e.mp3",
  713. "created_at": "2017-03-23 20:27:42",
  714. "updated_at": "2017-03-23 20:27:42",
  715. "author_name": "\u777f\u5fc3\u7075\u7280",
  716. "duration": "10:00",
  717. "play_times": 120
  718. }, {
  719. "class_id": 518,
  720. "seesion_id": 7,
  721. "title": "28 Equanimity",
  722. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/28e.mp3",
  723. "created_at": "2017-03-23 20:27:42",
  724. "updated_at": "2017-03-23 20:27:42",
  725. "author_name": "\u777f\u5fc3\u7075\u7280",
  726. "duration": "10:00",
  727. "play_times": 115
  728. }, {
  729. "class_id": 519,
  730. "seesion_id": 7,
  731. "title": "29 Who am I?(Mindfulness of Awareness)",
  732. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/29e.mp3",
  733. "created_at": "2017-03-23 20:27:42",
  734. "updated_at": "2017-03-23 20:27:42",
  735. "author_name": "\u777f\u5fc3\u7075\u7280",
  736. "duration": "10:00",
  737. "play_times": 116
  738. }, {
  739. "class_id": 520,
  740. "seesion_id": 7,
  741. "title": "30 Empathy and Compassion",
  742. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/30e.mp3",
  743. "created_at": "2017-03-23 20:27:42",
  744. "updated_at": "2017-03-23 20:27:42",
  745. "author_name": "\u777f\u5fc3\u7075\u7280",
  746. "duration": "10:00",
  747. "play_times": 111
  748. }, {
  749. "class_id": 521,
  750. "seesion_id": 7,
  751. "title": "31 Forgiveness",
  752. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/31e.mp3",
  753. "created_at": "2017-03-23 20:27:42",
  754. "updated_at": "2017-03-23 20:27:42",
  755. "author_name": "\u777f\u5fc3\u7075\u7280",
  756. "duration": "10:00",
  757. "play_times": 108
  758. }, {
  759. "class_id": 522,
  760. "seesion_id": 7,
  761. "title": "32 Seeing Goodness",
  762. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/32e.mp3",
  763. "created_at": "2017-03-23 20:27:42",
  764. "updated_at": "2017-03-23 20:27:42",
  765. "author_name": "\u777f\u5fc3\u7075\u7280",
  766. "duration": "10:00",
  767. "play_times": 110
  768. }, {
  769. "class_id": 523,
  770. "seesion_id": 7,
  771. "title": "33 Intention",
  772. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/33e.mp3",
  773. "created_at": "2017-03-23 20:27:42",
  774. "updated_at": "2017-03-23 20:27:42",
  775. "author_name": "\u777f\u5fc3\u7075\u7280",
  776. "duration": "10:00",
  777. "play_times": 116
  778. }, {
  779. "class_id": 524,
  780. "seesion_id": 7,
  781. "title": "34 Conflict",
  782. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/34e.mp3",
  783. "created_at": "2017-03-23 20:27:42",
  784. "updated_at": "2017-03-23 20:27:42",
  785. "author_name": "\u777f\u5fc3\u7075\u7280",
  786. "duration": "10:00",
  787. "play_times": 113
  788. }, {
  789. "class_id": 525,
  790. "seesion_id": 7,
  791. "title": "35 Listening",
  792. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/35e.mp3",
  793. "created_at": "2017-03-23 20:27:42",
  794. "updated_at": "2017-03-23 20:27:42",
  795. "author_name": "\u777f\u5fc3\u7075\u7280",
  796. "duration": "10:00",
  797. "play_times": 119
  798. }, {
  799. "class_id": 526,
  800. "seesion_id": 7,
  801. "title": "36 Mindful Speaking",
  802. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/36e.mp3",
  803. "created_at": "2017-03-23 20:27:42",
  804. "updated_at": "2017-03-23 20:27:42",
  805. "author_name": "\u777f\u5fc3\u7075\u7280",
  806. "duration": "10:00",
  807. "play_times": 115
  808. }, {
  809. "class_id": 527,
  810. "seesion_id": 7,
  811. "title": "37 Trusting and Inhabiting your Being",
  812. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/37e.mp3",
  813. "created_at": "2017-03-23 20:27:42",
  814. "updated_at": "2017-03-23 20:27:42",
  815. "author_name": "\u777f\u5fc3\u7075\u7280",
  816. "duration": "10:00",
  817. "play_times": 122
  818. }, {
  819. "class_id": 528,
  820. "seesion_id": 7,
  821. "title": "38 Generosity and Service",
  822. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/38e.mp3",
  823. "created_at": "2017-03-23 20:27:42",
  824. "updated_at": "2017-03-23 20:27:42",
  825. "author_name": "\u777f\u5fc3\u7075\u7280",
  826. "duration": "10:00",
  827. "play_times": 116
  828. }, {
  829. "class_id": 529,
  830. "seesion_id": 7,
  831. "title": "39 Nourishing a Grateful Heart",
  832. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/39e.mp3",
  833. "created_at": "2017-03-23 20:27:42",
  834. "updated_at": "2017-03-23 20:27:42",
  835. "author_name": "\u777f\u5fc3\u7075\u7280",
  836. "duration": "10:00",
  837. "play_times": 122
  838. }, {
  839. "class_id": 530,
  840. "seesion_id": 7,
  841. "title": "40 Aspiration and Vision",
  842. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/40e.mp3",
  843. "created_at": "2017-03-23 20:27:42",
  844. "updated_at": "2017-03-23 20:27:42",
  845. "author_name": "\u777f\u5fc3\u7075\u7280",
  846. "duration": "10:00",
  847. "play_times": 125
  848. }]
  849. }';
  850. $y = '{
  851. "tag": "classesInSession",
  852. "success": 1,
  853. "error": 0,
  854. "class_counts": 24,
  855. "classes": [{
  856. "class_id": 13,
  857. "seesion_id": 3,
  858. "title": "1-1 \u5230\u8fbe\u6211\u4eec\u6240\u5728\u4e4b\u5904 - \u9648\u5fb7\u4e2d",
  859. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/1-1 \u5230\u8fbe\u6211\u4eec\u6240\u5728\u4e4b\u5904 - \u9648\u5fb7\u4e2d.mp3",
  860. "created_at": "2016-09-27 18:47:55",
  861. "updated_at": "2016-09-27 18:47:55",
  862. "author_name": "\u9648\u5fb7\u4e2d",
  863. "duration": "08:36",
  864. "play_times": 19569
  865. }, {
  866. "class_id": 14,
  867. "seesion_id": 3,
  868. "title": "1-2 \u6b63\u5ff5\u547c\u5438 - \u9648\u5fb7\u4e2d",
  869. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/1-2 \u6b63\u5ff5\u547c\u5438 - \u9648\u5fb7\u4e2d.mp3",
  870. "created_at": "2016-09-27 18:52:54",
  871. "updated_at": "2016-09-27 18:52:54",
  872. "author_name": "\u9648\u5fb7\u4e2d",
  873. "duration": "07:31",
  874. "play_times": 10634
  875. }, {
  876. "class_id": 16,
  877. "seesion_id": 3,
  878. "title": "2-1 \u4e0e\u6211\u4eec\u7684\u8eab\u4f53\u8054\u63a5 - \u7ae5\u6167\u7426",
  879. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/2-1 \u4e0e\u6211\u4eec\u7684\u8eab\u4f53\u8054\u63a5 - \u7ae5\u6167\u7426.mp3",
  880. "created_at": "2016-09-27 18:52:54",
  881. "updated_at": "2016-09-27 18:52:54",
  882. "author_name": "\u7ae5\u6167\u7426",
  883. "duration": "07:38",
  884. "play_times": 7747
  885. }, {
  886. "class_id": 17,
  887. "seesion_id": 3,
  888. "title": "2-2 \u8bc6\u522b\u611f\u5b98\u611f\u53d7 - \u7ae5\u6167\u7426",
  889. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/2-2 \u8bc6\u522b\u611f\u5b98\u611f\u53d7 - \u7ae5\u6167\u7426.mp3",
  890. "created_at": "2016-09-27 18:52:54",
  891. "updated_at": "2016-09-27 18:52:54",
  892. "author_name": "\u7ae5\u6167\u7426",
  893. "duration": "07:01",
  894. "play_times": 5223
  895. }, {
  896. "class_id": 18,
  897. "seesion_id": 3,
  898. "title": "3-1 20\u5206\u949f\u6b63\u5ff5\u6838\u5fc3\u7ec3\u4e60 - \u9648\u5fb7\u4e2d",
  899. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/3-1 20\u5206\u949f\u6b63\u5ff5\u6838\u5fc3\u7ec3\u4e60 - \u9648\u5fb7\u4e2d.mp3",
  900. "created_at": "2016-10-24 10:48:22",
  901. "updated_at": "2016-10-24 10:48:22",
  902. "author_name": "\u9648\u5fb7\u4e2d",
  903. "duration": "20:46",
  904. "play_times": 12187
  905. }, {
  906. "class_id": 19,
  907. "seesion_id": 3,
  908. "title": "3-2 30\u5206\u949f\u6b63\u5ff5\u6838\u5fc3\u7ec3\u4e60 - \u9648\u5fb7\u4e2d",
  909. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/3-2 30\u5206\u949f\u6b63\u5ff5\u6838\u5fc3\u7ec3\u4e60 - \u9648\u5fb7\u4e2d.mp3",
  910. "created_at": "2016-10-24 10:48:24",
  911. "updated_at": "2016-10-24 10:48:24",
  912. "author_name": "\u9648\u5fb7\u4e2d",
  913. "duration": "31:31",
  914. "play_times": 8758
  915. }, {
  916. "class_id": 20,
  917. "seesion_id": 3,
  918. "title": "3-3 \u60c5\u611f\u7684\u89c9\u77e5 - \u9648\u5fb7\u4e2d",
  919. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/3-3 \u60c5\u611f\u7684\u89c9\u77e5 - \u9648\u5fb7\u4e2d.mp3",
  920. "created_at": "2016-09-27 18:52:54",
  921. "updated_at": "2016-09-27 18:52:54",
  922. "author_name": "\u9648\u5fb7\u4e2d",
  923. "duration": "10:23",
  924. "play_times": 4588
  925. }, {
  926. "class_id": 21,
  927. "seesion_id": 3,
  928. "title": "3-4 \u60c5\u611f\u7684\u6b63\u5ff5 - \u9648\u5fb7\u4e2d",
  929. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/3-4 \u60c5\u611f\u7684\u6b63\u5ff5 - \u9648\u5fb7\u4e2d.mp3",
  930. "created_at": "2016-09-27 18:52:54",
  931. "updated_at": "2016-09-27 18:52:54",
  932. "author_name": "\u9648\u5fb7\u4e2d",
  933. "duration": "12:01",
  934. "play_times": 3687
  935. }, {
  936. "class_id": 22,
  937. "seesion_id": 3,
  938. "title": "4-1 \u5bf9\u4e8e\u60f3\u6cd5\u7684\u6b63\u5ff5 - \u7ae5\u6167\u7426",
  939. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/4-1 \u5bf9\u4e8e\u60f3\u6cd5\u7684\u6b63\u5ff5 - \u7ae5\u6167\u7426.mp3",
  940. "created_at": "2016-09-27 18:52:54",
  941. "updated_at": "2016-09-27 18:52:54",
  942. "author_name": "\u7ae5\u6167\u7426",
  943. "duration": "03:11",
  944. "play_times": 3602
  945. }, {
  946. "class_id": 23,
  947. "seesion_id": 3,
  948. "title": "4-2 \u601d\u7ef4\u7684\u4ea7\u751f - \u7ae5\u6167\u7426",
  949. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/4-2 \u601d\u7ef4\u7684\u4ea7\u751f - \u7ae5\u6167\u7426.mp3",
  950. "created_at": "2016-09-27 18:52:54",
  951. "updated_at": "2016-09-27 18:52:54",
  952. "author_name": "\u7ae5\u6167\u7426",
  953. "duration": "05:12",
  954. "play_times": 3156
  955. }, {
  956. "class_id": 24,
  957. "seesion_id": 3,
  958. "title": "4-3 \u4e86\u89e3\u4fe1\u5ff5 - \u7ae5\u6167\u7426",
  959. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/4-3 \u4e86\u89e3\u4fe1\u5ff5 - \u7ae5\u6167\u7426.mp3",
  960. "created_at": "2016-09-27 18:52:54",
  961. "updated_at": "2016-09-27 18:52:54",
  962. "author_name": "\u7ae5\u6167\u7426",
  963. "duration": "03:30",
  964. "play_times": 2522
  965. }, {
  966. "class_id": 25,
  967. "seesion_id": 3,
  968. "title": "5-1 R.A.I.N\u51a5\u60f3 - \u7ae5\u6167\u7426",
  969. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/5-1 R.A.I.N\u51a5\u60f3 - \u7ae5\u6167\u7426.mp3",
  970. "created_at": "2016-10-24 00:31:02",
  971. "updated_at": "2016-10-24 00:31:02",
  972. "author_name": "\u7ae5\u6167\u7426",
  973. "duration": "08:30",
  974. "play_times": 3371
  975. }, {
  976. "class_id": 26,
  977. "seesion_id": 3,
  978. "title": "5-2 \u6269\u5c55\u5bf9\u81ea\u6211\u6148\u60b2\u7684\u80fd\u529b - \u7ae5\u6167\u7426",
  979. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/5-2 \u6269\u5c55\u5bf9\u81ea\u6211\u6148\u60b2\u7684\u80fd\u529b - \u7ae5\u6167\u7426.mp3",
  980. "created_at": "2016-10-24 00:31:02",
  981. "updated_at": "2016-10-24 00:31:02",
  982. "author_name": "\u7ae5\u6167\u7426",
  983. "duration": "13:06",
  984. "play_times": 4046
  985. }, {
  986. "class_id": 27,
  987. "seesion_id": 3,
  988. "title": "6-1 \u63d0\u4f9b\u8d44\u6e90 - \u7ae5\u6167\u7426",
  989. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/6-1 \u63d0\u4f9b\u8d44\u6e90 - \u7ae5\u6167\u7426.mp3",
  990. "created_at": "2016-10-24 00:31:02",
  991. "updated_at": "2016-10-24 00:31:02",
  992. "author_name": "\u7ae5\u6167\u7426",
  993. "duration": "06:54",
  994. "play_times": 2228
  995. }, {
  996. "class_id": 28,
  997. "seesion_id": 3,
  998. "title": "7-1 \u6148\u7231\u7ec3\u4e60 - \u9648\u5fb7\u4e2d",
  999. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/7-1 \u6148\u7231\u7ec3\u4e60 - \u9648\u5fb7\u4e2d.mp3",
  1000. "created_at": "2016-10-24 00:31:02",
  1001. "updated_at": "2016-10-24 00:31:02",
  1002. "author_name": "\u9648\u5fb7\u4e2d",
  1003. "duration": "09:41",
  1004. "play_times": 2931
  1005. }, {
  1006. "class_id": 29,
  1007. "seesion_id": 3,
  1008. "title": "7-2 \u5bbd\u6055\u7ec3\u4e60 - \u9648\u5fb7\u4e2d",
  1009. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/7-2 \u5bbd\u6055\u7ec3\u4e60 - \u9648\u5fb7\u4e2d.mp3",
  1010. "created_at": "2016-10-24 00:31:02",
  1011. "updated_at": "2016-10-24 00:31:02",
  1012. "author_name": "\u9648\u5fb7\u4e2d",
  1013. "duration": "10:54",
  1014. "play_times": 2665
  1015. }, {
  1016. "class_id": 30,
  1017. "seesion_id": 3,
  1018. "title": "8-1 \u5bf9\u4ed6\u4eba\u7684\u6148\u5fc3\u7ec3\u4e60 - \u7ae5\u6167\u7426",
  1019. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/8-1 \u5bf9\u4ed6\u4eba\u7684\u6148\u5fc3\u7ec3\u4e60 - \u7ae5\u6167\u7426.mp3",
  1020. "created_at": "2016-10-24 00:31:02",
  1021. "updated_at": "2016-10-24 00:31:02",
  1022. "author_name": "\u7ae5\u6167\u7426",
  1023. "duration": "18:12",
  1024. "play_times": 2374
  1025. }, {
  1026. "class_id": 31,
  1027. "seesion_id": 3,
  1028. "title": "8-2 \u6269\u5c55\u6148\u60b2\u5fc3\u7684\u8303\u56f4 - \u7ae5\u6167\u7426",
  1029. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/8-2 \u6269\u5c55\u6148\u60b2\u5fc3\u7684\u8303\u56f4 - \u7ae5\u6167\u7426.mp3",
  1030. "created_at": "2016-10-24 00:31:02",
  1031. "updated_at": "2016-10-24 00:31:02",
  1032. "author_name": "\u7ae5\u6167\u7426",
  1033. "duration": "08:28",
  1034. "play_times": 1705
  1035. }, {
  1036. "class_id": 32,
  1037. "seesion_id": 3,
  1038. "title": "9-1 \u4e0d\u52a0\u9009\u62e9\u7684\u89c9\u5bdf - \u9648\u5fb7\u4e2d",
  1039. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/9-1 \u4e0d\u52a0\u9009\u62e9\u7684\u89c9\u5bdf - \u9648\u5fb7\u4e2d.mp3",
  1040. "created_at": "2016-10-24 00:31:02",
  1041. "updated_at": "2016-10-24 00:31:02",
  1042. "author_name": "\u9648\u5fb7\u4e2d",
  1043. "duration": "05:34",
  1044. "play_times": 2096
  1045. }, {
  1046. "class_id": 33,
  1047. "seesion_id": 3,
  1048. "title": "9-2 \u4f11\u61a9\u4e8e\u65e0\u8fb9\u9645\u89c9\u77e5 - \u9648\u5fb7\u4e2d",
  1049. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/9-2 \u4f11\u61a9\u4e8e\u65e0\u8fb9\u9645\u89c9\u77e5 - \u9648\u5fb7\u4e2d.mp3",
  1050. "created_at": "2016-10-24 00:31:02",
  1051. "updated_at": "2016-10-24 00:31:02",
  1052. "author_name": "\u9648\u5fb7\u4e2d",
  1053. "duration": "10:51",
  1054. "play_times": 3217
  1055. }, {
  1056. "class_id": 34,
  1057. "seesion_id": 3,
  1058. "title": "11-1 \u611f\u6069\u7ec3\u4e60 - \u7ae5\u6167\u7426",
  1059. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/11-1 \u611f\u6069\u7ec3\u4e60 - \u7ae5\u6167\u7426.mp3",
  1060. "created_at": "2016-10-24 00:31:02",
  1061. "updated_at": "2016-10-24 00:31:02",
  1062. "author_name": "\u7ae5\u6167\u7426",
  1063. "duration": "05:14",
  1064. "play_times": 2150
  1065. }, {
  1066. "class_id": 35,
  1067. "seesion_id": 3,
  1068. "title": "11-2 \u7ad9\u7acb\u7ec3\u4e60 - \u7ae5\u6167\u7426",
  1069. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/11-2 \u7ad9\u7acb\u7ec3\u4e60 - \u7ae5\u6167\u7426.mp3",
  1070. "created_at": "2016-10-24 00:31:02",
  1071. "updated_at": "2016-10-24 00:31:02",
  1072. "author_name": "\u7ae5\u6167\u7426",
  1073. "duration": "07:18",
  1074. "play_times": 1673
  1075. }, {
  1076. "class_id": 36,
  1077. "seesion_id": 3,
  1078. "title": "12-1 \u732e\u51fa\u6211\u4eec\u7684\u5929\u8d4b - \u9648\u5fb7\u4e2d",
  1079. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/12-1 \u732e\u51fa\u6211\u4eec\u7684\u5929\u8d4b - \u9648\u5fb7\u4e2d.mp3",
  1080. "created_at": "2016-10-24 00:31:02",
  1081. "updated_at": "2016-10-24 00:31:02",
  1082. "author_name": "\u9648\u5fb7\u4e2d",
  1083. "duration": "03:49",
  1084. "play_times": 1952
  1085. }, {
  1086. "class_id": 37,
  1087. "seesion_id": 3,
  1088. "title": "12-2 \u5c06\u6211\u4eec\u7684\u5929\u8d4b\u5e26\u5230\u4e16\u754c\u4e2d\u53bb - \u9648\u5fb7\u4e2d",
  1089. "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/12-2 \u5c06\u6211\u4eec\u7684\u5929\u8d4b\u5e26\u5230\u4e16\u754c\u4e2d\u53bb - \u9648\u5fb7\u4e2d.mp3",
  1090. "created_at": "2016-10-24 00:31:03",
  1091. "updated_at": "2016-10-24 00:31:03",
  1092. "author_name": "\u9648\u5fb7\u4e2d",
  1093. "duration": "07:15",
  1094. "play_times": 2202
  1095. }]
  1096. }';
  1097. $datas = json_decode($y,true);
  1098. $path = '/Users/stanley-king/Documents/jz';
  1099. $i = 1;
  1100. foreach ($datas['classes'] as $item)
  1101. {
  1102. $url = "http://{$item['file_url']}";
  1103. $info = pathinfo($url);
  1104. if(empty($info['extension'])) continue;
  1105. $title = "{$i}.{$info['extension']}";
  1106. $file = "{$path}/{$title}";
  1107. $this->download($url,$file);
  1108. $i++;
  1109. }
  1110. }
  1111. private function download($url,$path)
  1112. {
  1113. $info = pathinfo($url);
  1114. if(!file_exists($path)) {
  1115. $pic_url = $info['dirname'] . '/' . str_replace(' ','%20',$info['basename']);
  1116. exec("wget -O $path $pic_url");
  1117. }
  1118. if(file_exists($path))
  1119. {
  1120. if(filesize($path) > 0) {
  1121. return true;
  1122. } else {
  1123. unlink($path);
  1124. return false;
  1125. }
  1126. } else {
  1127. return false;
  1128. }
  1129. }
  1130. public function testPathlog()
  1131. {
  1132. $path_file = BASE_DATA_PATH . '/log/' . date('Ymd', time()) . '_path.log';
  1133. $fd = @fopen($path_file, "r");
  1134. $stdout = fopen('php://stdout', 'w');
  1135. while (!feof($fd))
  1136. {
  1137. $line = fgets($fd,1024);
  1138. if ($line !== false && !empty($line)) {
  1139. fwrite($stdout,"{$line}\n\n");
  1140. }
  1141. }
  1142. fclose($fd);
  1143. }
  1144. public function testMonitor()
  1145. {
  1146. $fd = @fopen(BASE_ROOT_PATH . "/data/log/20180831.log", "c+");
  1147. $stdout = fopen('php://stdout', 'w');
  1148. while (true)
  1149. {
  1150. $line = fread($fd,1024);
  1151. if ($line !== false && !empty($line)) {
  1152. fwrite($stdout,$line);
  1153. }
  1154. else {
  1155. fwrite($stdout,"fread empty line\n");
  1156. usleep(1000000);
  1157. }
  1158. }
  1159. }
  1160. public function testMonitorSelect()
  1161. {
  1162. $fd = @fopen(BASE_ROOT_PATH . "/data/log/20180831.log", "c+");
  1163. $stdout = fopen('php://stdout', 'w');
  1164. while (true)
  1165. {
  1166. $wfds = null;
  1167. $xfds = null;
  1168. $rfds = [$fd];
  1169. $timeout = 2;
  1170. $number = stream_select($rfds, $wfds, $xfds, $timeout, 0);
  1171. if($number > 0)
  1172. {
  1173. if(!empty($rfds))
  1174. {
  1175. $line = fread($fd,1024);
  1176. if ($line !== false && !empty($line)) {
  1177. fwrite($stdout,$line);
  1178. }
  1179. else {
  1180. fwrite($stdout,"fread empty line\n");
  1181. usleep(1000000);
  1182. }
  1183. }
  1184. else {
  1185. fwrite($stdout,"no content to read\n");
  1186. }
  1187. }
  1188. else {
  1189. fwrite($stdout,"ret = {$number}\n");
  1190. }
  1191. fwrite($stdout,"ret = {$number}\n");
  1192. }
  1193. }
  1194. public function testStat()
  1195. {
  1196. $date = date("Ymd");
  1197. $file_name = BASE_DATA_PATH. DS. 'log'. DS. $date. ".log";
  1198. $fd = @fopen($file_name, 'r+');
  1199. $stat_temp = @fstat($fd);
  1200. $size_temp = $stat_temp['size'];
  1201. while (true)
  1202. {
  1203. $stat = @fstat($fd);
  1204. $size_now = $stat['size'];
  1205. if ($size_now != $size_temp) {
  1206. echo "stat now: {$stat}";
  1207. $size_temp = $size_now;
  1208. }
  1209. usleep(1000000);
  1210. }
  1211. }
  1212. public function testMini()
  1213. {
  1214. $from = 'YWN0PWdvb2RzX2NvbW1vbiZvcD1pbmRleCZnb29kc19pZD00NTUwJmNsaWVudF90eXBlPW1pbmk';
  1215. $from = urldecode($from);
  1216. $from = base64_decode($from);
  1217. $x = 'act=goods_common&op=index&goods_id=1234&client_type=mini';
  1218. $x = base64_encode($x);
  1219. $x = urlencode($x);
  1220. }
  1221. }