├── .htaccess
├── LICENSE
├── README.md
├── application
├── .htaccess
├── cache
│ └── index.html
├── config
│ ├── autoload.php
│ ├── config.php
│ ├── constants.php
│ ├── database.php
│ ├── doctypes.php
│ ├── foreign_chars.php
│ ├── hooks.php
│ ├── index.html
│ ├── memcached.php
│ ├── migration.php
│ ├── mimes.php
│ ├── profiler.php
│ ├── routes.php
│ ├── site_config.simple.php
│ ├── smileys.php
│ └── user_agents.php
├── controllers
│ ├── Dcache.php
│ ├── Home.php
│ ├── Post.php
│ ├── Welcome.php
│ └── index.html
├── core
│ └── index.html
├── helpers
│ └── index.html
├── hooks
│ └── index.html
├── index.html
├── language
│ ├── english
│ │ └── index.html
│ └── index.html
├── libraries
│ ├── Get_data.php
│ └── index.html
├── logs
│ └── index.html
├── models
│ └── index.html
├── third_party
│ └── index.html
└── views
│ ├── default
│ ├── footer.php
│ ├── header.php
│ ├── home.php
│ ├── index.php
│ └── post.php
│ ├── errors
│ ├── cli
│ │ ├── error_404.php
│ │ ├── error_db.php
│ │ ├── error_exception.php
│ │ ├── error_general.php
│ │ ├── error_php.php
│ │ └── index.html
│ ├── html
│ │ ├── error_404.php
│ │ ├── error_db.php
│ │ ├── error_exception.php
│ │ ├── error_general.php
│ │ ├── error_php.php
│ │ └── index.html
│ └── index.html
│ ├── index.html
│ └── welcome_message.php
├── favicon.ico
├── index.php
├── static
├── caomei
│ ├── Read Me.txt
│ ├── fonts
│ │ ├── strawberryicon.eot
│ │ ├── strawberryicon.svg
│ │ ├── strawberryicon.ttf
│ │ └── strawberryicon.woff
│ ├── selection.json
│ └── style.css
├── embed.js
├── katelog
│ ├── katelog.min.js
│ └── style.css
├── layui
│ ├── css
│ │ ├── layui.css
│ │ ├── layui.mobile.css
│ │ └── modules
│ │ │ ├── code.css
│ │ │ ├── laydate
│ │ │ └── default
│ │ │ │ └── laydate.css
│ │ │ └── layer
│ │ │ └── default
│ │ │ ├── icon-ext.png
│ │ │ ├── icon.png
│ │ │ ├── layer.css
│ │ │ ├── loading-0.gif
│ │ │ ├── loading-1.gif
│ │ │ └── loading-2.gif
│ ├── font
│ │ ├── iconfont.eot
│ │ ├── iconfont.svg
│ │ ├── iconfont.ttf
│ │ └── iconfont.woff
│ ├── images
│ │ └── face
│ │ │ ├── 0.gif
│ │ │ ├── 1.gif
│ │ │ ├── 10.gif
│ │ │ ├── 11.gif
│ │ │ ├── 12.gif
│ │ │ ├── 13.gif
│ │ │ ├── 14.gif
│ │ │ ├── 15.gif
│ │ │ ├── 16.gif
│ │ │ ├── 17.gif
│ │ │ ├── 18.gif
│ │ │ ├── 19.gif
│ │ │ ├── 2.gif
│ │ │ ├── 20.gif
│ │ │ ├── 21.gif
│ │ │ ├── 22.gif
│ │ │ ├── 23.gif
│ │ │ ├── 24.gif
│ │ │ ├── 25.gif
│ │ │ ├── 26.gif
│ │ │ ├── 27.gif
│ │ │ ├── 28.gif
│ │ │ ├── 29.gif
│ │ │ ├── 3.gif
│ │ │ ├── 30.gif
│ │ │ ├── 31.gif
│ │ │ ├── 32.gif
│ │ │ ├── 33.gif
│ │ │ ├── 34.gif
│ │ │ ├── 35.gif
│ │ │ ├── 36.gif
│ │ │ ├── 37.gif
│ │ │ ├── 38.gif
│ │ │ ├── 39.gif
│ │ │ ├── 4.gif
│ │ │ ├── 40.gif
│ │ │ ├── 41.gif
│ │ │ ├── 42.gif
│ │ │ ├── 43.gif
│ │ │ ├── 44.gif
│ │ │ ├── 45.gif
│ │ │ ├── 46.gif
│ │ │ ├── 47.gif
│ │ │ ├── 48.gif
│ │ │ ├── 49.gif
│ │ │ ├── 5.gif
│ │ │ ├── 50.gif
│ │ │ ├── 51.gif
│ │ │ ├── 52.gif
│ │ │ ├── 53.gif
│ │ │ ├── 54.gif
│ │ │ ├── 55.gif
│ │ │ ├── 56.gif
│ │ │ ├── 57.gif
│ │ │ ├── 58.gif
│ │ │ ├── 59.gif
│ │ │ ├── 6.gif
│ │ │ ├── 60.gif
│ │ │ ├── 61.gif
│ │ │ ├── 62.gif
│ │ │ ├── 63.gif
│ │ │ ├── 64.gif
│ │ │ ├── 65.gif
│ │ │ ├── 66.gif
│ │ │ ├── 67.gif
│ │ │ ├── 68.gif
│ │ │ ├── 69.gif
│ │ │ ├── 7.gif
│ │ │ ├── 70.gif
│ │ │ ├── 71.gif
│ │ │ ├── 8.gif
│ │ │ └── 9.gif
│ ├── lay
│ │ └── modules
│ │ │ ├── carousel.js
│ │ │ ├── code.js
│ │ │ ├── colorpicker.js
│ │ │ ├── element.js
│ │ │ ├── flow.js
│ │ │ ├── form.js
│ │ │ ├── jquery.js
│ │ │ ├── laydate.js
│ │ │ ├── layedit.js
│ │ │ ├── layer.js
│ │ │ ├── laypage.js
│ │ │ ├── laytpl.js
│ │ │ ├── mobile.js
│ │ │ ├── rate.js
│ │ │ ├── slider.js
│ │ │ ├── table.js
│ │ │ ├── tree.js
│ │ │ ├── upload.js
│ │ │ └── util.js
│ ├── layui.all.js
│ └── layui.js
└── style.css
└── system
├── .htaccess
├── core
├── Benchmark.php
├── CodeIgniter.php
├── Common.php
├── Config.php
├── Controller.php
├── Exceptions.php
├── Hooks.php
├── Input.php
├── Lang.php
├── Loader.php
├── Log.php
├── Model.php
├── Output.php
├── Router.php
├── Security.php
├── URI.php
├── Utf8.php
├── compat
│ ├── hash.php
│ ├── index.html
│ ├── mbstring.php
│ ├── password.php
│ └── standard.php
└── index.html
├── database
├── DB.php
├── DB_cache.php
├── DB_driver.php
├── DB_forge.php
├── DB_query_builder.php
├── DB_result.php
├── DB_utility.php
├── drivers
│ ├── cubrid
│ │ ├── cubrid_driver.php
│ │ ├── cubrid_forge.php
│ │ ├── cubrid_result.php
│ │ ├── cubrid_utility.php
│ │ └── index.html
│ ├── ibase
│ │ ├── ibase_driver.php
│ │ ├── ibase_forge.php
│ │ ├── ibase_result.php
│ │ ├── ibase_utility.php
│ │ └── index.html
│ ├── index.html
│ ├── mssql
│ │ ├── index.html
│ │ ├── mssql_driver.php
│ │ ├── mssql_forge.php
│ │ ├── mssql_result.php
│ │ └── mssql_utility.php
│ ├── mysql
│ │ ├── index.html
│ │ ├── mysql_driver.php
│ │ ├── mysql_forge.php
│ │ ├── mysql_result.php
│ │ └── mysql_utility.php
│ ├── mysqli
│ │ ├── index.html
│ │ ├── mysqli_driver.php
│ │ ├── mysqli_forge.php
│ │ ├── mysqli_result.php
│ │ └── mysqli_utility.php
│ ├── oci8
│ │ ├── index.html
│ │ ├── oci8_driver.php
│ │ ├── oci8_forge.php
│ │ ├── oci8_result.php
│ │ └── oci8_utility.php
│ ├── odbc
│ │ ├── index.html
│ │ ├── odbc_driver.php
│ │ ├── odbc_forge.php
│ │ ├── odbc_result.php
│ │ └── odbc_utility.php
│ ├── pdo
│ │ ├── index.html
│ │ ├── pdo_driver.php
│ │ ├── pdo_forge.php
│ │ ├── pdo_result.php
│ │ ├── pdo_utility.php
│ │ └── subdrivers
│ │ │ ├── index.html
│ │ │ ├── pdo_4d_driver.php
│ │ │ ├── pdo_4d_forge.php
│ │ │ ├── pdo_cubrid_driver.php
│ │ │ ├── pdo_cubrid_forge.php
│ │ │ ├── pdo_dblib_driver.php
│ │ │ ├── pdo_dblib_forge.php
│ │ │ ├── pdo_firebird_driver.php
│ │ │ ├── pdo_firebird_forge.php
│ │ │ ├── pdo_ibm_driver.php
│ │ │ ├── pdo_ibm_forge.php
│ │ │ ├── pdo_informix_driver.php
│ │ │ ├── pdo_informix_forge.php
│ │ │ ├── pdo_mysql_driver.php
│ │ │ ├── pdo_mysql_forge.php
│ │ │ ├── pdo_oci_driver.php
│ │ │ ├── pdo_oci_forge.php
│ │ │ ├── pdo_odbc_driver.php
│ │ │ ├── pdo_odbc_forge.php
│ │ │ ├── pdo_pgsql_driver.php
│ │ │ ├── pdo_pgsql_forge.php
│ │ │ ├── pdo_sqlite_driver.php
│ │ │ ├── pdo_sqlite_forge.php
│ │ │ ├── pdo_sqlsrv_driver.php
│ │ │ └── pdo_sqlsrv_forge.php
│ ├── postgre
│ │ ├── index.html
│ │ ├── postgre_driver.php
│ │ ├── postgre_forge.php
│ │ ├── postgre_result.php
│ │ └── postgre_utility.php
│ ├── sqlite
│ │ ├── index.html
│ │ ├── sqlite_driver.php
│ │ ├── sqlite_forge.php
│ │ ├── sqlite_result.php
│ │ └── sqlite_utility.php
│ ├── sqlite3
│ │ ├── index.html
│ │ ├── sqlite3_driver.php
│ │ ├── sqlite3_forge.php
│ │ ├── sqlite3_result.php
│ │ └── sqlite3_utility.php
│ └── sqlsrv
│ │ ├── index.html
│ │ ├── sqlsrv_driver.php
│ │ ├── sqlsrv_forge.php
│ │ ├── sqlsrv_result.php
│ │ └── sqlsrv_utility.php
└── index.html
├── fonts
├── index.html
└── texb.ttf
├── helpers
├── array_helper.php
├── captcha_helper.php
├── cookie_helper.php
├── date_helper.php
├── directory_helper.php
├── download_helper.php
├── email_helper.php
├── file_helper.php
├── form_helper.php
├── html_helper.php
├── index.html
├── inflector_helper.php
├── language_helper.php
├── number_helper.php
├── path_helper.php
├── security_helper.php
├── smiley_helper.php
├── string_helper.php
├── text_helper.php
├── typography_helper.php
├── url_helper.php
└── xml_helper.php
├── index.html
├── language
├── english
│ ├── calendar_lang.php
│ ├── date_lang.php
│ ├── db_lang.php
│ ├── email_lang.php
│ ├── form_validation_lang.php
│ ├── ftp_lang.php
│ ├── imglib_lang.php
│ ├── index.html
│ ├── migration_lang.php
│ ├── number_lang.php
│ ├── pagination_lang.php
│ ├── profiler_lang.php
│ ├── unit_test_lang.php
│ └── upload_lang.php
└── index.html
└── libraries
├── Cache
├── Cache.php
├── drivers
│ ├── Cache_apc.php
│ ├── Cache_dummy.php
│ ├── Cache_file.php
│ ├── Cache_memcached.php
│ ├── Cache_redis.php
│ ├── Cache_wincache.php
│ └── index.html
└── index.html
├── Calendar.php
├── Cart.php
├── Driver.php
├── Email.php
├── Encrypt.php
├── Encryption.php
├── Form_validation.php
├── Ftp.php
├── Image_lib.php
├── Javascript.php
├── Javascript
├── Jquery.php
└── index.html
├── Migration.php
├── Pagination.php
├── Parser.php
├── Profiler.php
├── Session
├── Session.php
├── SessionHandlerInterface.php
├── Session_driver.php
├── drivers
│ ├── Session_database_driver.php
│ ├── Session_files_driver.php
│ ├── Session_memcached_driver.php
│ ├── Session_redis_driver.php
│ └── index.html
└── index.html
├── Table.php
├── Trackback.php
├── Typography.php
├── Unit_test.php
├── Upload.php
├── User_agent.php
├── Xmlrpc.php
├── Xmlrpcs.php
├── Zip.php
└── index.html
/.htaccess:
--------------------------------------------------------------------------------
1 | RewriteEngine On
2 | RewriteCond %{REQUEST_FILENAME} -s [OR]
3 | RewriteCond %{REQUEST_FILENAME} -l [OR]
4 | RewriteCond %{REQUEST_FILENAME} -d
5 | RewriteRule ^.*$ - [NC,L]
6 | RewriteRule ^.*$ index.php [NC,L]
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # YQdoc
2 |
3 | YQdoc是一个基于语雀API开发的文档系统,使用PHP开发。
4 |
5 | 
6 |
7 | 
8 |
9 | ### 主要功能
10 |
11 | * 基于语雀API生成文档
12 | * 支持页面缓存,提高加载速度,降低API调用
13 | * 支持文档TOC(目录列表)
14 | * 完全开源,可定制性强
15 |
16 | ### 帮助文档
17 |
18 | 在使用之前务必参考帮助文档:[https://www.xiaoz.me/doc/doc-yqdoc/](https://www.xiaoz.me/doc/doc-yqdoc/)
19 |
20 | ### Demo
21 | * [https://www.xiaoz.me/doc/](https://www.xiaoz.me/doc/)
22 |
23 | ### 请我喝一杯咖啡
24 | 
25 |
26 | ### 鸣谢
27 |
28 | YQdoc的诞生离不开以下项目,在此表示感谢。
29 | * [语雀](https://www.yuque.com)
30 | * [LayUI](https://github.com/sentsin/layui)
31 | * [CodeIgniter](https://github.com/bcit-ci/CodeIgniter)
32 | * [jQuery](https://github.com/jquery/jquery)
33 | * [katelog](https://github.com/KELEN/katelog)
34 | * [InstantClick](http://instantclick.io/)
35 |
36 | ### 联系我
37 | * Blog:[https://www.xiaoz.me/](https://www.xiaoz.me/)
38 | * 社区支持:[https://ttt.sh/](https://ttt.sh/)
39 | * QQ:337003006
40 |
--------------------------------------------------------------------------------
/application/.htaccess:
--------------------------------------------------------------------------------
1 |
Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/config/doctypes.php: -------------------------------------------------------------------------------- 1 | '', 6 | 'xhtml1-strict' => '', 7 | 'xhtml1-trans' => '', 8 | 'xhtml1-frame' => '', 9 | 'xhtml-basic11' => '', 10 | 'html5' => '', 11 | 'html4-strict' => '', 12 | 'html4-trans' => '', 13 | 'html4-frame' => '', 14 | 'mathml1' => '', 15 | 'mathml2' => '', 16 | 'svg10' => '', 17 | 'svg11' => '', 18 | 'svg11-basic' => '', 19 | 'svg11-tiny' => '', 20 | 'xhtml-math-svg-xh' => '', 21 | 'xhtml-math-svg-sh' => '', 22 | 'xhtml-rdfa-1' => '', 23 | 'xhtml-rdfa-2' => '' 24 | ); 25 | -------------------------------------------------------------------------------- /application/config/foreign_chars.php: -------------------------------------------------------------------------------- 1 | 'ae', 14 | '/ö|œ/' => 'oe', 15 | '/ü/' => 'ue', 16 | '/Ä/' => 'Ae', 17 | '/Ü/' => 'Ue', 18 | '/Ö/' => 'Oe', 19 | '/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ|Α|Ά|Ả|Ạ|Ầ|Ẫ|Ẩ|Ậ|Ằ|Ắ|Ẵ|Ẳ|Ặ|А/' => 'A', 20 | '/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª|α|ά|ả|ạ|ầ|ấ|ẫ|ẩ|ậ|ằ|ắ|ẵ|ẳ|ặ|а/' => 'a', 21 | '/Б/' => 'B', 22 | '/б/' => 'b', 23 | '/Ç|Ć|Ĉ|Ċ|Č/' => 'C', 24 | '/ç|ć|ĉ|ċ|č/' => 'c', 25 | '/Д/' => 'D', 26 | '/д/' => 'd', 27 | '/Ð|Ď|Đ|Δ/' => 'Dj', 28 | '/ð|ď|đ|δ/' => 'dj', 29 | '/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě|Ε|Έ|Ẽ|Ẻ|Ẹ|Ề|Ế|Ễ|Ể|Ệ|Е|Э/' => 'E', 30 | '/è|é|ê|ë|ē|ĕ|ė|ę|ě|έ|ε|ẽ|ẻ|ẹ|ề|ế|ễ|ể|ệ|е|э/' => 'e', 31 | '/Ф/' => 'F', 32 | '/ф/' => 'f', 33 | '/Ĝ|Ğ|Ġ|Ģ|Γ|Г|Ґ/' => 'G', 34 | '/ĝ|ğ|ġ|ģ|γ|г|ґ/' => 'g', 35 | '/Ĥ|Ħ/' => 'H', 36 | '/ĥ|ħ/' => 'h', 37 | '/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ|Η|Ή|Ί|Ι|Ϊ|Ỉ|Ị|И|Ы/' => 'I', 38 | '/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı|η|ή|ί|ι|ϊ|ỉ|ị|и|ы|ї/' => 'i', 39 | '/Ĵ/' => 'J', 40 | '/ĵ/' => 'j', 41 | '/Ķ|Κ|К/' => 'K', 42 | '/ķ|κ|к/' => 'k', 43 | '/Ĺ|Ļ|Ľ|Ŀ|Ł|Λ|Л/' => 'L', 44 | '/ĺ|ļ|ľ|ŀ|ł|λ|л/' => 'l', 45 | '/М/' => 'M', 46 | '/м/' => 'm', 47 | '/Ñ|Ń|Ņ|Ň|Ν|Н/' => 'N', 48 | '/ñ|ń|ņ|ň|ʼn|ν|н/' => 'n', 49 | '/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ|Ο|Ό|Ω|Ώ|Ỏ|Ọ|Ồ|Ố|Ỗ|Ổ|Ộ|Ờ|Ớ|Ỡ|Ở|Ợ|О/' => 'O', 50 | '/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º|ο|ό|ω|ώ|ỏ|ọ|ồ|ố|ỗ|ổ|ộ|ờ|ớ|ỡ|ở|ợ|о/' => 'o', 51 | '/П/' => 'P', 52 | '/п/' => 'p', 53 | '/Ŕ|Ŗ|Ř|Ρ|Р/' => 'R', 54 | '/ŕ|ŗ|ř|ρ|р/' => 'r', 55 | '/Ś|Ŝ|Ş|Ș|Š|Σ|С/' => 'S', 56 | '/ś|ŝ|ş|ș|š|ſ|σ|ς|с/' => 's', 57 | '/Ț|Ţ|Ť|Ŧ|τ|Т/' => 'T', 58 | '/ț|ţ|ť|ŧ|т/' => 't', 59 | '/Þ|þ/' => 'th', 60 | '/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ|Ũ|Ủ|Ụ|Ừ|Ứ|Ữ|Ử|Ự|У/' => 'U', 61 | '/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ|υ|ύ|ϋ|ủ|ụ|ừ|ứ|ữ|ử|ự|у/' => 'u', 62 | '/Ƴ|Ɏ|Ỵ|Ẏ|Ӳ|Ӯ|Ў|Ý|Ÿ|Ŷ|Υ|Ύ|Ϋ|Ỳ|Ỹ|Ỷ|Ỵ|Й/' => 'Y', 63 | '/ẙ|ʏ|ƴ|ɏ|ỵ|ẏ|ӳ|ӯ|ў|ý|ÿ|ŷ|ỳ|ỹ|ỷ|ỵ|й/' => 'y', 64 | '/В/' => 'V', 65 | '/в/' => 'v', 66 | '/Ŵ/' => 'W', 67 | '/ŵ/' => 'w', 68 | '/Ź|Ż|Ž|Ζ|З/' => 'Z', 69 | '/ź|ż|ž|ζ|з/' => 'z', 70 | '/Æ|Ǽ/' => 'AE', 71 | '/ß/' => 'ss', 72 | '/IJ/' => 'IJ', 73 | '/ij/' => 'ij', 74 | '/Œ/' => 'OE', 75 | '/ƒ/' => 'f', 76 | '/ξ/' => 'ks', 77 | '/π/' => 'p', 78 | '/β/' => 'v', 79 | '/μ/' => 'm', 80 | '/ψ/' => 'ps', 81 | '/Ё/' => 'Yo', 82 | '/ё/' => 'yo', 83 | '/Є/' => 'Ye', 84 | '/є/' => 'ye', 85 | '/Ї/' => 'Yi', 86 | '/Ж/' => 'Zh', 87 | '/ж/' => 'zh', 88 | '/Х/' => 'Kh', 89 | '/х/' => 'kh', 90 | '/Ц/' => 'Ts', 91 | '/ц/' => 'ts', 92 | '/Ч/' => 'Ch', 93 | '/ч/' => 'ch', 94 | '/Ш/' => 'Sh', 95 | '/ш/' => 'sh', 96 | '/Щ/' => 'Shch', 97 | '/щ/' => 'shch', 98 | '/Ъ|ъ|Ь|ь/' => '', 99 | '/Ю/' => 'Yu', 100 | '/ю/' => 'yu', 101 | '/Я/' => 'Ya', 102 | '/я/' => 'ya' 103 | ); 104 | -------------------------------------------------------------------------------- /application/config/hooks.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/config/memcached.php: -------------------------------------------------------------------------------- 1 | array( 15 | 'hostname' => '127.0.0.1', 16 | 'port' => '11211', 17 | 'weight' => '1', 18 | ), 19 | ); 20 | -------------------------------------------------------------------------------- /application/config/migration.php: -------------------------------------------------------------------------------- 1 | migration->current() this is the version that schema will 69 | | be upgraded / downgraded to. 70 | | 71 | */ 72 | $config['migration_version'] = 0; 73 | 74 | /* 75 | |-------------------------------------------------------------------------- 76 | | Migrations Path 77 | |-------------------------------------------------------------------------- 78 | | 79 | | Path to your migrations folder. 80 | | Typically, it will be within your application path. 81 | | Also, writing permission is required within the migrations path. 82 | | 83 | */ 84 | $config['migration_path'] = APPPATH.'migrations/'; 85 | -------------------------------------------------------------------------------- /application/config/profiler.php: -------------------------------------------------------------------------------- 1 | my_controller/index 50 | | my-controller/my-method -> my_controller/my_method 51 | */ 52 | $route['default_controller'] = 'home'; 53 | $route['404_override'] = ''; 54 | $route['translate_uri_dashes'] = FALSE; 55 | //重写路由 56 | $route['del'] = 'dcache/index'; 57 | $route['doc-(:any)'] = 'post/doc/$1'; 58 | $route['doc-(:any)/(:any)'] = 'post/doc/$1/$2'; 59 | -------------------------------------------------------------------------------- /application/config/site_config.simple.php: -------------------------------------------------------------------------------- 1 | array('grin.gif', '19', '19', 'grin'), 21 | ':lol:' => array('lol.gif', '19', '19', 'LOL'), 22 | ':cheese:' => array('cheese.gif', '19', '19', 'cheese'), 23 | ':)' => array('smile.gif', '19', '19', 'smile'), 24 | ';-)' => array('wink.gif', '19', '19', 'wink'), 25 | ';)' => array('wink.gif', '19', '19', 'wink'), 26 | ':smirk:' => array('smirk.gif', '19', '19', 'smirk'), 27 | ':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'), 28 | ':-S' => array('confused.gif', '19', '19', 'confused'), 29 | ':wow:' => array('surprise.gif', '19', '19', 'surprised'), 30 | ':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'), 31 | ':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'), 32 | '%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'), 33 | ';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'), 34 | ':P' => array('raspberry.gif', '19', '19', 'raspberry'), 35 | ':blank:' => array('blank.gif', '19', '19', 'blank stare'), 36 | ':long:' => array('longface.gif', '19', '19', 'long face'), 37 | ':ohh:' => array('ohh.gif', '19', '19', 'ohh'), 38 | ':grrr:' => array('grrr.gif', '19', '19', 'grrr'), 39 | ':gulp:' => array('gulp.gif', '19', '19', 'gulp'), 40 | '8-/' => array('ohoh.gif', '19', '19', 'oh oh'), 41 | ':down:' => array('downer.gif', '19', '19', 'downer'), 42 | ':red:' => array('embarrassed.gif', '19', '19', 'red face'), 43 | ':sick:' => array('sick.gif', '19', '19', 'sick'), 44 | ':shut:' => array('shuteye.gif', '19', '19', 'shut eye'), 45 | ':-/' => array('hmm.gif', '19', '19', 'hmmm'), 46 | '>:(' => array('mad.gif', '19', '19', 'mad'), 47 | ':mad:' => array('mad.gif', '19', '19', 'mad'), 48 | '>:-(' => array('angry.gif', '19', '19', 'angry'), 49 | ':angry:' => array('angry.gif', '19', '19', 'angry'), 50 | ':zip:' => array('zip.gif', '19', '19', 'zipper'), 51 | ':kiss:' => array('kiss.gif', '19', '19', 'kiss'), 52 | ':ahhh:' => array('shock.gif', '19', '19', 'shock'), 53 | ':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'), 54 | ':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'), 55 | ':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'), 56 | ':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'), 57 | ':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'), 58 | ':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'), 59 | ':vampire:' => array('vampire.gif', '19', '19', 'vampire'), 60 | ':snake:' => array('snake.gif', '19', '19', 'snake'), 61 | ':exclaim:' => array('exclaim.gif', '19', '19', 'exclaim'), 62 | ':question:' => array('question.gif', '19', '19', 'question') 63 | 64 | ); 65 | -------------------------------------------------------------------------------- /application/controllers/Dcache.php: -------------------------------------------------------------------------------- 1 | input->get('uri',TRUE); 17 | if( ($uri == '') OR (!isset($uri))){ 18 | exit('参数不能为空!'); 19 | exit; 20 | } 21 | if($uri == '*'){ 22 | $this->output->delete_cache(); 23 | echo '已清理所有缓存!'; 24 | } 25 | else{ 26 | $this->output->delete_cache($uri); 27 | echo $uri.'缓存已清理!'; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /application/controllers/Home.php: -------------------------------------------------------------------------------- 1 | token = $this->config->item('token'); 22 | $this->login = $this->config->item('login'); 23 | $this->template = $this->config->item('template'); 24 | $this->cache = $this->config->item('cache'); 25 | } 26 | //默认首页 27 | public function index() { 28 | //获取图片域名 29 | $this->load->helper('url'); 30 | $pic_domain = site_url('').'post/img?path='; 31 | //判断是否开启缓存 32 | if($this->cache == TRUE){ 33 | //首页缓存15分钟 34 | $this->output->cache(15); 35 | } 36 | $token = $this->config->item('token'); 37 | //加载类库 38 | $params = array( 39 | 'api_token' => $token, 40 | 'login' => $this->config->item('login') 41 | ); 42 | $this->load->library('get_data',$params); 43 | //获取用户信息 44 | $user = $this->get_data->user(); 45 | //如果执行不成功,再次执行 46 | if( ! $user) { 47 | $user = $this->get_data->user(); 48 | } 49 | //获取repos仓库列表 50 | $repos = $this->get_data->repos(); 51 | //如果执行不成功,再次执行 52 | if( ! $repos) { 53 | $repos = $this->get_data->repos(); 54 | } 55 | //调用类方法 56 | $data = array( 57 | "title" => $this->config->item('title'), 58 | "subtitle" => $this->config->item('subtitle'), 59 | "keywords" => $this->config->item('keywords'), 60 | "description" => $this->config->item('description'), 61 | "user" => $user, 62 | "repos" => $repos, 63 | "site" => $this->config->item('site'), 64 | "weibo" => $this->config->item('weibo'), 65 | "github" => $this->config->item('github'), 66 | "qq" => $this->config->item('qq'), 67 | 'pic_doamin' => $pic_domain 68 | ); 69 | //var_dump($data['repos']); 70 | //var_dump($data); 71 | //加载视图 72 | $this->load->view($this->template.'/header',$data); 73 | $this->load->view($this->template.'/home',$data); 74 | $this->load->view($this->template.'/footer',$data); 75 | } 76 | } -------------------------------------------------------------------------------- /application/controllers/Welcome.php: -------------------------------------------------------------------------------- 1 | 19 | * @see https://codeigniter.com/user_guide/general/urls.html 20 | */ 21 | public function index() 22 | { 23 | $this->load->view('welcome_message'); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /application/controllers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/core/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/helpers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/hooks/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/language/english/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/language/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/libraries/Get_data.php: -------------------------------------------------------------------------------- 1 | api_url = "https://www.yuque.com/api/v2"; 22 | $this->api_token = $params['api_token']; 23 | $this->login = $params['login']; 24 | } 25 | 26 | //获取个人信息 27 | public function user(){ 28 | $token = $this->api_token; 29 | $url = $this->api_url."/user"; 30 | $data = $this->curl($token,$url); 31 | return $data; 32 | } 33 | //获取文档列表 34 | public function repos(){ 35 | $token = $this->api_token; 36 | $url = $this->api_url."/users/{$this->login}/repos"; 37 | $data = $this->curl($token,$url); 38 | return $data; 39 | } 40 | //获取某个文档的目录列表,需要传入一个slug参数,也就是文档名 41 | public function toc($name){ 42 | //对传入的参数进行过滤 43 | $name = trim($name); 44 | $name = htmlspecialchars($name); 45 | $token = $this->api_token; 46 | $url = $this->api_url."/repos/{$this->login}/{$name}/toc"; 47 | $data = $this->curl($token,$url); 48 | //echo $url; 49 | //exit; 50 | return $data; 51 | } 52 | //获取某篇文章的详细数据 53 | public function doc($name,$slug){ 54 | ///repos/:namespace/docs/:slug 55 | $name = trim($name); 56 | $name = htmlspecialchars($name); 57 | $name = $this->login.'/'.$name; 58 | $slug = trim($slug); 59 | $slug = htmlspecialchars($slug); 60 | $token = $this->api_token; 61 | $url = $this->api_url."/repos/{$name}/docs/{$slug}"; 62 | //echo $url; 63 | //exit; 64 | $data = $this->curl($token,$url); 65 | //echo $url; 66 | //exit; 67 | return $data; 68 | } 69 | //curl 70 | protected function curl($token,$url){ 71 | $headers = array(); 72 | $headers[] = 'X-Auth-Token: '.$token; 73 | $curl = curl_init($url); 74 | 75 | curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36"); 76 | curl_setopt($curl, CURLOPT_FAILONERROR, true); 77 | curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); 78 | curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 79 | curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); 80 | curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); 81 | curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); 82 | #设置超时时间,最小为1s(可选) 83 | curl_setopt($curl , CURLOPT_TIMEOUT, 1); 84 | 85 | $html = curl_exec($curl); 86 | curl_close($curl); 87 | $data = json_decode($html)->data; 88 | //var_dump($data); 89 | // exit; 90 | return $data; 91 | } 92 | } -------------------------------------------------------------------------------- /application/libraries/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/logs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/models/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/third_party/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/views/default/footer.php: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |