123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263 |
- <?php
- /**
- * Created by PhpStorm.
- * User: stanley-king
- * Date: 2018/5/7
- * Time: 下午9:16
- */
- use PHPUnit\Framework\TestCase;
- define('APP_ID', 'test');
- define('BASE_ROOT_PATH', str_replace('/test', '', dirname(__FILE__)));
- require_once(BASE_ROOT_PATH . '/global.php');
- require_once(BASE_CORE_PATH . '/lrlz.php');
- require_once(BASE_ROOT_PATH . '/fooder.php');
- require_once(BASE_ROOT_PATH . '/helper/statistics/stlog.php');
- class TestLog extends TestCase
- {
- public static function setUpBeforeClass() : void
- {
- Base::run_util();
- }
- public function testLogNormal()
- {
- Log::record("hello world",Log::DEBUG);
- Log::record("hello world",Log::ERR);
- }
- public function testPairlog()
- {
- $checker = new scope_trace(__METHOD__);
- $input = '0';
- $ret = empty($input);
- if('0' === false) {
- $ret = 10;
- }
- }
- public function testLoc()
- {
- $path = '/Users/stanley-king/tmp/20180506.log';
- $stlog = new statistics\stlog($path);
- $stlog->daily();
- }
- public function testStart()
- {
- $line = '[28785 2018-05-06 00:08:47] DEBUG: content=act=login&op=status';
- $command = '/\[(\d*)\s+(.*)\]\s+DEBUG:\s+(.*)/ui';
- $val = preg_match_all($command,$line,$match);
- $trdid = intval($match[1][0]);
- $stime = strtotime($match[2][0]);
- $content = $match[3][0];
- }
- public function testUrl()
- {
- $json = '{
- "tag": "classesInSession",
- "success": 1,
- "error": 0,
- "class_counts": 80,
- "classes": [{
- "class_id": 139,
- "seesion_id": 7,
- "title": "\u7b2c1\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u8fdb\u5165\u5f53\u4e0b",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/1.mp3",
- "created_at": "2017-03-23 13:58:06",
- "updated_at": "2017-03-23 13:58:06",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "13:36",
- "play_times": 8156
- }, {
- "class_id": 140,
- "seesion_id": 7,
- "title": "\u7b2c2\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u6709\u610f\u8bc6\u7684\u653e\u677e",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/2.mp3",
- "created_at": "2017-03-23 13:58:06",
- "updated_at": "2017-03-23 13:58:06",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "13:20",
- "play_times": 5330
- }, {
- "class_id": 141,
- "seesion_id": 7,
- "title": "\u7b2c3\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u56de\u5230\u4f60\u7684\u4e94\u611f",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/3.mp3",
- "created_at": "2017-03-23 13:58:06",
- "updated_at": "2017-03-23 13:58:06",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "11:12",
- "play_times": 3661
- }, {
- "class_id": 142,
- "seesion_id": 7,
- "title": "\u7b2c4\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u53cb\u5584\u7684\u6001\u5ea6",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/4.mp3",
- "created_at": "2017-03-23 13:58:06",
- "updated_at": "2017-03-23 13:58:06",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "13:37",
- "play_times": 4227
- }, {
- "class_id": 143,
- "seesion_id": 7,
- "title": "\u7b2c5\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u6b63\u5ff5\u547c\u5438",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/5.mp3",
- "created_at": "2017-03-23 13:58:06",
- "updated_at": "2017-03-23 13:58:06",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "09:44",
- "play_times": 1651
- }, {
- "class_id": 424,
- "seesion_id": 7,
- "title": "\u7b2c6\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u4f34\u968f\u547c\u5438\u7684\u5e73\u9759\u548c\u7a33\u5b9a",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/6.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 2021
- }, {
- "class_id": 425,
- "seesion_id": 7,
- "title": "\u7b2c7\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u6570\u547c\u5438",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/7.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1631
- }, {
- "class_id": 426,
- "seesion_id": 7,
- "title": "\u7b2c8\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u6df1\u5165\u4e13\u6ce8\u529b",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/8.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1927
- }, {
- "class_id": 427,
- "seesion_id": 7,
- "title": "\u7b2c9\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u8eab\u4f53\u7684\u6b63\u5ff5",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/9.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1773
- }, {
- "class_id": 428,
- "seesion_id": 7,
- "title": "\u7b2c10\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u7531\u5185\u800c\u5916\u7684\u611f\u53d7",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/10.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1633
- }, {
- "class_id": 429,
- "seesion_id": 7,
- "title": "\u7b2c11\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u8eab\u4f53\u626b\u63cf",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/11.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1739
- }, {
- "class_id": 430,
- "seesion_id": 7,
- "title": "\u7b2c12\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u547d\u540d\u611f\u53d7",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/12.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1395
- }, {
- "class_id": 431,
- "seesion_id": 7,
- "title": "\u7b2c13\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u5e94\u5bf9\u5f3a\u70c8\u7684\u611f\u53d7",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/13.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1568
- }, {
- "class_id": 432,
- "seesion_id": 7,
- "title": "\u7b2c14\u5929 - \u60c5\u5546 | \u6b63\u5ff5\u548c\u60c5\u7eea",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/14.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1549
- }, {
- "class_id": 433,
- "seesion_id": 7,
- "title": "\u7b2c15\u5929 - \u60c5\u5546 | \u547d\u540d\u60c5\u7eea\t",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/15.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 939
- }, {
- "class_id": 434,
- "seesion_id": 7,
- "title": "\u7b2c16\u5929 - \u60c5\u5546 | \u5e94\u5bf9\u56f0\u96be\u60c5\u7eea",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/16.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1466
- }, {
- "class_id": 435,
- "seesion_id": 7,
- "title": "\u7b2c17\u5929 - \u60c5\u5546 | \u57f9\u517b\u79ef\u6781\u60c5\u7eea",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/17.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1490
- }, {
- "class_id": 436,
- "seesion_id": 7,
- "title": "\u7b2c18\u5929 - \u60c5\u5546 | \u8ba4\u51fa\u5ff5\u5934\u7684\u4e0d\u65ad\u4ea7\u751f",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/18.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1286
- }, {
- "class_id": 437,
- "seesion_id": 7,
- "title": "\u7b2c19\u5929 - \u60c5\u5546 | \u548c\u5ff5\u5934\u7684\u667a\u6167\u5173\u7cfb",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/19.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1326
- }, {
- "class_id": 438,
- "seesion_id": 7,
- "title": "\u7b2c20\u5929 - \u60c5\u5546 | \u5ff5\u5934\u4e0b\u7684\u751f\u6d3b",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/20.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1171
- }, {
- "class_id": 439,
- "seesion_id": 7,
- "title": "\u7b2c21\u5929 - \u60c5\u5546 | \u8d85\u8d8a\u5ff5\u5934",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/21.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1135
- }, {
- "class_id": 440,
- "seesion_id": 7,
- "title": "\u7b2c22\u5929 - \u97e7\u6027\uff0c\u7597\u6108\u548c\u5185\u5728\u7684\u81ea\u7531 | \u6b63\u5ff5\u6838\u5fc3\u7ec3\u4e60",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/22.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1809
- }, {
- "class_id": 441,
- "seesion_id": 7,
- "title": "\u7b2c23\u5929 - \u97e7\u6027\uff0c\u7597\u6108\u548c\u5185\u5728\u7684\u81ea\u7531 | \u81ea\u6211\u8bc4\u5224\u548c\u81ea\u6211\u5173\u6000",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/23.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1276
- }, {
- "class_id": 442,
- "seesion_id": 7,
- "title": "\u7b2c24\u5929 - \u97e7\u6027\uff0c\u7597\u6108\u548c\u5185\u5728\u7684\u81ea\u7531 | RAIN",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/24.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1004
- }, {
- "class_id": 443,
- "seesion_id": 7,
- "title": "\u7b2c25\u5929 - \u97e7\u6027\uff0c\u7597\u6108\u548c\u5185\u5728\u7684\u81ea\u7531 | \u60c5\u7eea\u548c\u5185\u5728\u8d44\u6e90",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/25.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1002
- }, {
- "class_id": 444,
- "seesion_id": 7,
- "title": "\u7b2c26\u5929 - \u97e7\u6027\uff0c\u7597\u6108\u548c\u5185\u5728\u7684\u81ea\u7531 | \u521d\u5b66\u8005\u7684\u5fc3",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/26.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 827
- }, {
- "class_id": 445,
- "seesion_id": 7,
- "title": "\u7b2c27\u5929 - \u97e7\u6027\uff0c\u7597\u6108\u548c\u5185\u5728\u7684\u81ea\u7531 | \u65e0\u8fb9\u65e0\u9645\u7684\u89c9\u77e5",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/27.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 932
- }, {
- "class_id": 446,
- "seesion_id": 7,
- "title": "\u7b2c28\u5929 - \u97e7\u6027\uff0c\u7597\u6108\u548c\u5185\u5728\u7684\u81ea\u7531 | \u5e73\u7b49\u5fc3",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/28.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 769
- }, {
- "class_id": 447,
- "seesion_id": 7,
- "title": "\u7b2c29\u5929 - \u97e7\u6027\uff0c\u7597\u6108\u548c\u5185\u5728\u7684\u81ea\u7531 | \u5bf9\u89c9\u77e5\u7684\u6b63\u5ff5",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/29.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 769
- }, {
- "class_id": 448,
- "seesion_id": 7,
- "title": "\u7b2c30\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u540c\u7406\u5fc3\u548c\u6148\u60b2\u5fc3",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/30.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 882
- }, {
- "class_id": 449,
- "seesion_id": 7,
- "title": "\u7b2c31\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u5bbd\u6055",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/31.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 809
- }, {
- "class_id": 450,
- "seesion_id": 7,
- "title": "\u7b2c32\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u770b\u89c1\u5584\u6027",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/32.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 749
- }, {
- "class_id": 451,
- "seesion_id": 7,
- "title": "\u7b2c33\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u610f\u56fe",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/33.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 690
- }, {
- "class_id": 452,
- "seesion_id": 7,
- "title": "\u7b2c34\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u51b2\u7a81",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/34.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 680
- }, {
- "class_id": 453,
- "seesion_id": 7,
- "title": "\u7b2c35\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u503e\u542c",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/35.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 671
- }, {
- "class_id": 454,
- "seesion_id": 7,
- "title": "\u7b2c36\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u6b63\u5ff5\u7684\u8bf4",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/36.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 695
- }, {
- "class_id": 455,
- "seesion_id": 7,
- "title": "\u7b2c37\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u4fe1\u4efb\u548c\u5b58\u5728\u4e8e\u4f60\u7684\u5b58\u5728",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/37.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 771
- }, {
- "class_id": 456,
- "seesion_id": 7,
- "title": "\u7b2c38\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u6177\u6168\u548c\u670d\u52a1",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/38.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 577
- }, {
- "class_id": 457,
- "seesion_id": 7,
- "title": "\u7b2c39\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u57f9\u80b2\u611f\u6069\u7684\u5fc3",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/39.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 631
- }, {
- "class_id": 458,
- "seesion_id": 7,
- "title": "\u7b2c40\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u671f\u8bb8\u548c\u613f\u666f",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/40.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 643
- }, {
- "class_id": 459,
- "seesion_id": 7,
- "title": "1 Arriving in Presence",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/1e.mp3",
- "created_at": "2017-03-23 20:04:29",
- "updated_at": "2017-03-23 20:04:29",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 381
- }, {
- "class_id": 460,
- "seesion_id": 7,
- "title": "2 Conscious Relaxing",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/2e.mp3",
- "created_at": "2017-03-23 20:04:29",
- "updated_at": "2017-03-23 20:04:29",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 193
- }, {
- "class_id": 493,
- "seesion_id": 7,
- "title": "3 Coming Back to your Senses",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/3e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 181
- }, {
- "class_id": 494,
- "seesion_id": 7,
- "title": "4 Attitude of Friendliness",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/4e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 160
- }, {
- "class_id": 495,
- "seesion_id": 7,
- "title": "5 Mindfulness of Breath",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/5e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 155
- }, {
- "class_id": 496,
- "seesion_id": 7,
- "title": "6 Calming and Steadying with the Breath",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/6e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 163
- }, {
- "class_id": 497,
- "seesion_id": 7,
- "title": "7 Counting the Breath",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/7e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 136
- }, {
- "class_id": 498,
- "seesion_id": 7,
- "title": "8 Deepening the Focus",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/8e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 143
- }, {
- "class_id": 499,
- "seesion_id": 7,
- "title": "9 Mindfulness of the Body",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/9e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 135
- }, {
- "class_id": 500,
- "seesion_id": 7,
- "title": "10 Feeling from the Inside Out",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/10e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 138
- }, {
- "class_id": 501,
- "seesion_id": 7,
- "title": "11 Body Scan",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/11e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 129
- }, {
- "class_id": 502,
- "seesion_id": 7,
- "title": "12 Naming Sensations",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/12e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 129
- }, {
- "class_id": 503,
- "seesion_id": 7,
- "title": "13 Working with Intense Sensations",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/13e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 130
- }, {
- "class_id": 504,
- "seesion_id": 7,
- "title": "14 Mindfulness and Emotions",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/14e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 120
- }, {
- "class_id": 505,
- "seesion_id": 7,
- "title": "15 Naming Emotions",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/15e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 121
- }, {
- "class_id": 506,
- "seesion_id": 7,
- "title": "16 Working with Difficult Emotions",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/16e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 120
- }, {
- "class_id": 507,
- "seesion_id": 7,
- "title": "17 Fostering Positive Emotions",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/17e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 117
- }, {
- "class_id": 508,
- "seesion_id": 7,
- "title": "18 Recognizing Thinking",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/18e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 123
- }, {
- "class_id": 509,
- "seesion_id": 7,
- "title": "19 Wise Relationship to Thoughts",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/19e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 114
- }, {
- "class_id": 510,
- "seesion_id": 7,
- "title": "20 Life Under Thoughts",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/20e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 117
- }, {
- "class_id": 511,
- "seesion_id": 7,
- "title": "21 Beyond Thoughts",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/21e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 117
- }, {
- "class_id": 512,
- "seesion_id": 7,
- "title": "22 Mindfulness: The Core Practice",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/22e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 124
- }, {
- "class_id": 513,
- "seesion_id": 7,
- "title": "23 Self-judgement and Self-Compassion",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/23e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 118
- }, {
- "class_id": 514,
- "seesion_id": 7,
- "title": "24 RAIN",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/24e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 117
- }, {
- "class_id": 515,
- "seesion_id": 7,
- "title": "25 Emotions and Inner Resources",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/25e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 113
- }, {
- "class_id": 516,
- "seesion_id": 7,
- "title": "26 Beginner\'s Mind",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/26e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 116
- }, {
- "class_id": 517,
- "seesion_id": 7,
- "title": "27 Spacious Awareness",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/27e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 120
- }, {
- "class_id": 518,
- "seesion_id": 7,
- "title": "28 Equanimity",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/28e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 115
- }, {
- "class_id": 519,
- "seesion_id": 7,
- "title": "29 Who am I?(Mindfulness of Awareness)",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/29e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 116
- }, {
- "class_id": 520,
- "seesion_id": 7,
- "title": "30 Empathy and Compassion",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/30e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 111
- }, {
- "class_id": 521,
- "seesion_id": 7,
- "title": "31 Forgiveness",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/31e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 108
- }, {
- "class_id": 522,
- "seesion_id": 7,
- "title": "32 Seeing Goodness",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/32e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 110
- }, {
- "class_id": 523,
- "seesion_id": 7,
- "title": "33 Intention",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/33e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 116
- }, {
- "class_id": 524,
- "seesion_id": 7,
- "title": "34 Conflict",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/34e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 113
- }, {
- "class_id": 525,
- "seesion_id": 7,
- "title": "35 Listening",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/35e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 119
- }, {
- "class_id": 526,
- "seesion_id": 7,
- "title": "36 Mindful Speaking",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/36e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 115
- }, {
- "class_id": 527,
- "seesion_id": 7,
- "title": "37 Trusting and Inhabiting your Being",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/37e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 122
- }, {
- "class_id": 528,
- "seesion_id": 7,
- "title": "38 Generosity and Service",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/38e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 116
- }, {
- "class_id": 529,
- "seesion_id": 7,
- "title": "39 Nourishing a Grateful Heart",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/39e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 122
- }, {
- "class_id": 530,
- "seesion_id": 7,
- "title": "40 Aspiration and Vision",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/40e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 125
- }]
- }';
- $y = '{
- "tag": "classesInSession",
- "success": 1,
- "error": 0,
- "class_counts": 24,
- "classes": [{
- "class_id": 13,
- "seesion_id": 3,
- "title": "1-1 \u5230\u8fbe\u6211\u4eec\u6240\u5728\u4e4b\u5904 - \u9648\u5fb7\u4e2d",
- "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",
- "created_at": "2016-09-27 18:47:55",
- "updated_at": "2016-09-27 18:47:55",
- "author_name": "\u9648\u5fb7\u4e2d",
- "duration": "08:36",
- "play_times": 19569
- }, {
- "class_id": 14,
- "seesion_id": 3,
- "title": "1-2 \u6b63\u5ff5\u547c\u5438 - \u9648\u5fb7\u4e2d",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/1-2 \u6b63\u5ff5\u547c\u5438 - \u9648\u5fb7\u4e2d.mp3",
- "created_at": "2016-09-27 18:52:54",
- "updated_at": "2016-09-27 18:52:54",
- "author_name": "\u9648\u5fb7\u4e2d",
- "duration": "07:31",
- "play_times": 10634
- }, {
- "class_id": 16,
- "seesion_id": 3,
- "title": "2-1 \u4e0e\u6211\u4eec\u7684\u8eab\u4f53\u8054\u63a5 - \u7ae5\u6167\u7426",
- "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",
- "created_at": "2016-09-27 18:52:54",
- "updated_at": "2016-09-27 18:52:54",
- "author_name": "\u7ae5\u6167\u7426",
- "duration": "07:38",
- "play_times": 7747
- }, {
- "class_id": 17,
- "seesion_id": 3,
- "title": "2-2 \u8bc6\u522b\u611f\u5b98\u611f\u53d7 - \u7ae5\u6167\u7426",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/2-2 \u8bc6\u522b\u611f\u5b98\u611f\u53d7 - \u7ae5\u6167\u7426.mp3",
- "created_at": "2016-09-27 18:52:54",
- "updated_at": "2016-09-27 18:52:54",
- "author_name": "\u7ae5\u6167\u7426",
- "duration": "07:01",
- "play_times": 5223
- }, {
- "class_id": 18,
- "seesion_id": 3,
- "title": "3-1 20\u5206\u949f\u6b63\u5ff5\u6838\u5fc3\u7ec3\u4e60 - \u9648\u5fb7\u4e2d",
- "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",
- "created_at": "2016-10-24 10:48:22",
- "updated_at": "2016-10-24 10:48:22",
- "author_name": "\u9648\u5fb7\u4e2d",
- "duration": "20:46",
- "play_times": 12187
- }, {
- "class_id": 19,
- "seesion_id": 3,
- "title": "3-2 30\u5206\u949f\u6b63\u5ff5\u6838\u5fc3\u7ec3\u4e60 - \u9648\u5fb7\u4e2d",
- "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",
- "created_at": "2016-10-24 10:48:24",
- "updated_at": "2016-10-24 10:48:24",
- "author_name": "\u9648\u5fb7\u4e2d",
- "duration": "31:31",
- "play_times": 8758
- }, {
- "class_id": 20,
- "seesion_id": 3,
- "title": "3-3 \u60c5\u611f\u7684\u89c9\u77e5 - \u9648\u5fb7\u4e2d",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/3-3 \u60c5\u611f\u7684\u89c9\u77e5 - \u9648\u5fb7\u4e2d.mp3",
- "created_at": "2016-09-27 18:52:54",
- "updated_at": "2016-09-27 18:52:54",
- "author_name": "\u9648\u5fb7\u4e2d",
- "duration": "10:23",
- "play_times": 4588
- }, {
- "class_id": 21,
- "seesion_id": 3,
- "title": "3-4 \u60c5\u611f\u7684\u6b63\u5ff5 - \u9648\u5fb7\u4e2d",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/3-4 \u60c5\u611f\u7684\u6b63\u5ff5 - \u9648\u5fb7\u4e2d.mp3",
- "created_at": "2016-09-27 18:52:54",
- "updated_at": "2016-09-27 18:52:54",
- "author_name": "\u9648\u5fb7\u4e2d",
- "duration": "12:01",
- "play_times": 3687
- }, {
- "class_id": 22,
- "seesion_id": 3,
- "title": "4-1 \u5bf9\u4e8e\u60f3\u6cd5\u7684\u6b63\u5ff5 - \u7ae5\u6167\u7426",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/4-1 \u5bf9\u4e8e\u60f3\u6cd5\u7684\u6b63\u5ff5 - \u7ae5\u6167\u7426.mp3",
- "created_at": "2016-09-27 18:52:54",
- "updated_at": "2016-09-27 18:52:54",
- "author_name": "\u7ae5\u6167\u7426",
- "duration": "03:11",
- "play_times": 3602
- }, {
- "class_id": 23,
- "seesion_id": 3,
- "title": "4-2 \u601d\u7ef4\u7684\u4ea7\u751f - \u7ae5\u6167\u7426",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/4-2 \u601d\u7ef4\u7684\u4ea7\u751f - \u7ae5\u6167\u7426.mp3",
- "created_at": "2016-09-27 18:52:54",
- "updated_at": "2016-09-27 18:52:54",
- "author_name": "\u7ae5\u6167\u7426",
- "duration": "05:12",
- "play_times": 3156
- }, {
- "class_id": 24,
- "seesion_id": 3,
- "title": "4-3 \u4e86\u89e3\u4fe1\u5ff5 - \u7ae5\u6167\u7426",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/4-3 \u4e86\u89e3\u4fe1\u5ff5 - \u7ae5\u6167\u7426.mp3",
- "created_at": "2016-09-27 18:52:54",
- "updated_at": "2016-09-27 18:52:54",
- "author_name": "\u7ae5\u6167\u7426",
- "duration": "03:30",
- "play_times": 2522
- }, {
- "class_id": 25,
- "seesion_id": 3,
- "title": "5-1 R.A.I.N\u51a5\u60f3 - \u7ae5\u6167\u7426",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/5-1 R.A.I.N\u51a5\u60f3 - \u7ae5\u6167\u7426.mp3",
- "created_at": "2016-10-24 00:31:02",
- "updated_at": "2016-10-24 00:31:02",
- "author_name": "\u7ae5\u6167\u7426",
- "duration": "08:30",
- "play_times": 3371
- }, {
- "class_id": 26,
- "seesion_id": 3,
- "title": "5-2 \u6269\u5c55\u5bf9\u81ea\u6211\u6148\u60b2\u7684\u80fd\u529b - \u7ae5\u6167\u7426",
- "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",
- "created_at": "2016-10-24 00:31:02",
- "updated_at": "2016-10-24 00:31:02",
- "author_name": "\u7ae5\u6167\u7426",
- "duration": "13:06",
- "play_times": 4046
- }, {
- "class_id": 27,
- "seesion_id": 3,
- "title": "6-1 \u63d0\u4f9b\u8d44\u6e90 - \u7ae5\u6167\u7426",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/6-1 \u63d0\u4f9b\u8d44\u6e90 - \u7ae5\u6167\u7426.mp3",
- "created_at": "2016-10-24 00:31:02",
- "updated_at": "2016-10-24 00:31:02",
- "author_name": "\u7ae5\u6167\u7426",
- "duration": "06:54",
- "play_times": 2228
- }, {
- "class_id": 28,
- "seesion_id": 3,
- "title": "7-1 \u6148\u7231\u7ec3\u4e60 - \u9648\u5fb7\u4e2d",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/7-1 \u6148\u7231\u7ec3\u4e60 - \u9648\u5fb7\u4e2d.mp3",
- "created_at": "2016-10-24 00:31:02",
- "updated_at": "2016-10-24 00:31:02",
- "author_name": "\u9648\u5fb7\u4e2d",
- "duration": "09:41",
- "play_times": 2931
- }, {
- "class_id": 29,
- "seesion_id": 3,
- "title": "7-2 \u5bbd\u6055\u7ec3\u4e60 - \u9648\u5fb7\u4e2d",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/7-2 \u5bbd\u6055\u7ec3\u4e60 - \u9648\u5fb7\u4e2d.mp3",
- "created_at": "2016-10-24 00:31:02",
- "updated_at": "2016-10-24 00:31:02",
- "author_name": "\u9648\u5fb7\u4e2d",
- "duration": "10:54",
- "play_times": 2665
- }, {
- "class_id": 30,
- "seesion_id": 3,
- "title": "8-1 \u5bf9\u4ed6\u4eba\u7684\u6148\u5fc3\u7ec3\u4e60 - \u7ae5\u6167\u7426",
- "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",
- "created_at": "2016-10-24 00:31:02",
- "updated_at": "2016-10-24 00:31:02",
- "author_name": "\u7ae5\u6167\u7426",
- "duration": "18:12",
- "play_times": 2374
- }, {
- "class_id": 31,
- "seesion_id": 3,
- "title": "8-2 \u6269\u5c55\u6148\u60b2\u5fc3\u7684\u8303\u56f4 - \u7ae5\u6167\u7426",
- "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",
- "created_at": "2016-10-24 00:31:02",
- "updated_at": "2016-10-24 00:31:02",
- "author_name": "\u7ae5\u6167\u7426",
- "duration": "08:28",
- "play_times": 1705
- }, {
- "class_id": 32,
- "seesion_id": 3,
- "title": "9-1 \u4e0d\u52a0\u9009\u62e9\u7684\u89c9\u5bdf - \u9648\u5fb7\u4e2d",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/9-1 \u4e0d\u52a0\u9009\u62e9\u7684\u89c9\u5bdf - \u9648\u5fb7\u4e2d.mp3",
- "created_at": "2016-10-24 00:31:02",
- "updated_at": "2016-10-24 00:31:02",
- "author_name": "\u9648\u5fb7\u4e2d",
- "duration": "05:34",
- "play_times": 2096
- }, {
- "class_id": 33,
- "seesion_id": 3,
- "title": "9-2 \u4f11\u61a9\u4e8e\u65e0\u8fb9\u9645\u89c9\u77e5 - \u9648\u5fb7\u4e2d",
- "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",
- "created_at": "2016-10-24 00:31:02",
- "updated_at": "2016-10-24 00:31:02",
- "author_name": "\u9648\u5fb7\u4e2d",
- "duration": "10:51",
- "play_times": 3217
- }, {
- "class_id": 34,
- "seesion_id": 3,
- "title": "11-1 \u611f\u6069\u7ec3\u4e60 - \u7ae5\u6167\u7426",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/11-1 \u611f\u6069\u7ec3\u4e60 - \u7ae5\u6167\u7426.mp3",
- "created_at": "2016-10-24 00:31:02",
- "updated_at": "2016-10-24 00:31:02",
- "author_name": "\u7ae5\u6167\u7426",
- "duration": "05:14",
- "play_times": 2150
- }, {
- "class_id": 35,
- "seesion_id": 3,
- "title": "11-2 \u7ad9\u7acb\u7ec3\u4e60 - \u7ae5\u6167\u7426",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/11-2 \u7ad9\u7acb\u7ec3\u4e60 - \u7ae5\u6167\u7426.mp3",
- "created_at": "2016-10-24 00:31:02",
- "updated_at": "2016-10-24 00:31:02",
- "author_name": "\u7ae5\u6167\u7426",
- "duration": "07:18",
- "play_times": 1673
- }, {
- "class_id": 36,
- "seesion_id": 3,
- "title": "12-1 \u732e\u51fa\u6211\u4eec\u7684\u5929\u8d4b - \u9648\u5fb7\u4e2d",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/12-1 \u732e\u51fa\u6211\u4eec\u7684\u5929\u8d4b - \u9648\u5fb7\u4e2d.mp3",
- "created_at": "2016-10-24 00:31:02",
- "updated_at": "2016-10-24 00:31:02",
- "author_name": "\u9648\u5fb7\u4e2d",
- "duration": "03:49",
- "play_times": 1952
- }, {
- "class_id": 37,
- "seesion_id": 3,
- "title": "12-2 \u5c06\u6211\u4eec\u7684\u5929\u8d4b\u5e26\u5230\u4e16\u754c\u4e2d\u53bb - \u9648\u5fb7\u4e2d",
- "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",
- "created_at": "2016-10-24 00:31:03",
- "updated_at": "2016-10-24 00:31:03",
- "author_name": "\u9648\u5fb7\u4e2d",
- "duration": "07:15",
- "play_times": 2202
- }]
- }';
- $datas = json_decode($y,true);
- $path = '/Users/stanley-king/Documents/jz';
- $i = 1;
- foreach ($datas['classes'] as $item)
- {
- $url = "http://{$item['file_url']}";
- $info = pathinfo($url);
- if(empty($info['extension'])) continue;
- $title = "{$i}.{$info['extension']}";
- $file = "{$path}/{$title}";
- $this->download($url,$file);
- $i++;
- }
- }
- private function download($url,$path)
- {
- $info = pathinfo($url);
- if(!file_exists($path)) {
- $pic_url = $info['dirname'] . '/' . str_replace(' ','%20',$info['basename']);
- exec("wget -O $path $pic_url");
- }
- if(file_exists($path))
- {
- if(filesize($path) > 0) {
- return true;
- } else {
- unlink($path);
- return false;
- }
- } else {
- return false;
- }
- }
- public function testPathlog()
- {
- $path_file = BASE_DATA_PATH . '/log/' . date('Ymd', time()) . '_path.log';
- $fd = @fopen($path_file, "r");
- $stdout = fopen('php://stdout', 'w');
- while (!feof($fd))
- {
- $line = fgets($fd,1024);
- if ($line !== false && !empty($line)) {
- fwrite($stdout,"{$line}\n\n");
- }
- }
- fclose($fd);
- }
- public function testMonitor()
- {
- $fd = @fopen(BASE_ROOT_PATH . "/data/log/20180831.log", "c+");
- $stdout = fopen('php://stdout', 'w');
- while (true)
- {
- $line = fread($fd,1024);
- if ($line !== false && !empty($line)) {
- fwrite($stdout,$line);
- }
- else {
- fwrite($stdout,"fread empty line\n");
- usleep(1000000);
- }
- }
- }
- public function testMonitorSelect()
- {
- $fd = @fopen(BASE_ROOT_PATH . "/data/log/20180831.log", "c+");
- $stdout = fopen('php://stdout', 'w');
- while (true)
- {
- $wfds = null;
- $xfds = null;
- $rfds = [$fd];
- $timeout = 2;
- $number = stream_select($rfds, $wfds, $xfds, $timeout, 0);
- if($number > 0)
- {
- if(!empty($rfds))
- {
- $line = fread($fd,1024);
- if ($line !== false && !empty($line)) {
- fwrite($stdout,$line);
- }
- else {
- fwrite($stdout,"fread empty line\n");
- usleep(1000000);
- }
- }
- else {
- fwrite($stdout,"no content to read\n");
- }
- }
- else {
- fwrite($stdout,"ret = {$number}\n");
- }
- fwrite($stdout,"ret = {$number}\n");
- }
- }
- public function testStat()
- {
- $date = date("Ymd");
- $file_name = BASE_DATA_PATH. DS. 'log'. DS. $date. ".log";
- $fd = @fopen($file_name, 'r+');
- $stat_temp = @fstat($fd);
- $size_temp = $stat_temp['size'];
- while (true)
- {
- $stat = @fstat($fd);
- $size_now = $stat['size'];
- if ($size_now != $size_temp) {
- echo "stat now: {$stat}";
- $size_temp = $size_now;
- }
- usleep(1000000);
- }
- }
- public function testMini()
- {
- $from = 'YWN0PWdvb2RzX2NvbW1vbiZvcD1pbmRleCZnb29kc19pZD00NTUwJmNsaWVudF90eXBlPW1pbmk';
- $from = urldecode($from);
- $from = base64_decode($from);
- $x = 'act=goods_common&op=index&goods_id=1234&client_type=mini';
- $x = base64_encode($x);
- $x = urlencode($x);
- }
- }
|