TestLog.php 43 KB

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