├── README.md ├── php ├── .htaccess ├── 404.html ├── Application │ ├── Common │ │ ├── Common │ │ │ └── index.html │ │ ├── Conf │ │ │ ├── config.php │ │ │ └── index.html │ │ └── index.html │ ├── Home │ │ ├── Common │ │ │ └── index.html │ │ ├── Conf │ │ │ ├── config.php │ │ │ └── index.html │ │ ├── Controller │ │ │ ├── BaseController.class.php │ │ │ ├── FeedbackController.class.php │ │ │ ├── UserController.class.php │ │ │ └── index.html │ │ ├── Model │ │ │ └── index.html │ │ ├── View │ │ │ └── index.html │ │ └── index.html │ └── index.html ├── Public │ └── README.md ├── ThinkPHP │ ├── Common │ │ └── functions.php │ ├── Conf │ │ ├── convention.php │ │ └── debug.php │ ├── LICENSE.txt │ ├── Lang │ │ ├── en-us.php │ │ ├── pt-br.php │ │ ├── zh-cn.php │ │ └── zh-tw.php │ ├── Library │ │ ├── Behavior │ │ │ ├── AgentCheckBehavior.class.php │ │ │ ├── BorisBehavior.class.php │ │ │ ├── BrowserCheckBehavior.class.php │ │ │ ├── BuildLiteBehavior.class.php │ │ │ ├── CheckActionRouteBehavior.class.php │ │ │ ├── CheckLangBehavior.class.php │ │ │ ├── ChromeShowPageTraceBehavior.class.php │ │ │ ├── ContentReplaceBehavior.class.php │ │ │ ├── CronRunBehavior.class.php │ │ │ ├── FireShowPageTraceBehavior.class.php │ │ │ ├── ParseTemplateBehavior.class.php │ │ │ ├── ReadHtmlCacheBehavior.class.php │ │ │ ├── RobotCheckBehavior.class.php │ │ │ ├── ShowPageTraceBehavior.class.php │ │ │ ├── ShowRuntimeBehavior.class.php │ │ │ ├── TokenBuildBehavior.class.php │ │ │ ├── UpgradeNoticeBehavior.class.php │ │ │ └── WriteHtmlCacheBehavior.class.php │ │ ├── Org │ │ │ ├── Net │ │ │ │ ├── Http.class.php │ │ │ │ └── IpLocation.class.php │ │ │ └── Util │ │ │ │ ├── ArrayList.class.php │ │ │ │ ├── CodeSwitch.class.php │ │ │ │ ├── Date.class.php │ │ │ │ ├── Rbac.class.php │ │ │ │ ├── Stack.class.php │ │ │ │ └── String.class.php │ │ ├── Think │ │ │ ├── App.class.php │ │ │ ├── Auth.class.php │ │ │ ├── Behavior.class.php │ │ │ ├── Build.class.php │ │ │ ├── Cache.class.php │ │ │ ├── Cache │ │ │ │ └── Driver │ │ │ │ │ ├── Apachenote.class.php │ │ │ │ │ ├── Apc.class.php │ │ │ │ │ ├── Db.class.php │ │ │ │ │ ├── Eaccelerator.class.php │ │ │ │ │ ├── File.class.php │ │ │ │ │ ├── Memcache.class.php │ │ │ │ │ ├── Memcached.class.php │ │ │ │ │ ├── Memcachesae.class.php │ │ │ │ │ ├── Redis.class.php │ │ │ │ │ ├── Shmop.class.php │ │ │ │ │ ├── Sqlite.class.php │ │ │ │ │ ├── Wincache.class.php │ │ │ │ │ └── Xcache.class.php │ │ │ ├── Controller.class.php │ │ │ ├── Controller │ │ │ │ ├── HproseController.class.php │ │ │ │ ├── JsonRpcController.class.php │ │ │ │ ├── RestController.class.php │ │ │ │ ├── RpcController.class.php │ │ │ │ └── YarController.class.php │ │ │ ├── Crypt.class.php │ │ │ ├── Crypt │ │ │ │ └── Driver │ │ │ │ │ ├── Base64.class.php │ │ │ │ │ ├── Crypt.class.php │ │ │ │ │ ├── Des.class.php │ │ │ │ │ ├── Think.class.php │ │ │ │ │ └── Xxtea.class.php │ │ │ ├── Db.class.php │ │ │ ├── Db │ │ │ │ ├── Driver.class.php │ │ │ │ ├── Driver │ │ │ │ │ ├── Firebird.class.php │ │ │ │ │ ├── Mongo.class.php │ │ │ │ │ ├── Mysql.class.php │ │ │ │ │ ├── Oracle.class.php │ │ │ │ │ ├── Pgsql.class.php │ │ │ │ │ ├── Sqlite.class.php │ │ │ │ │ └── Sqlsrv.class.php │ │ │ │ └── Lite.class.php │ │ │ ├── Dispatcher.class.php │ │ │ ├── Exception.class.php │ │ │ ├── Hook.class.php │ │ │ ├── Image.class.php │ │ │ ├── Image │ │ │ │ └── Driver │ │ │ │ │ ├── GIF.class.php │ │ │ │ │ ├── Gd.class.php │ │ │ │ │ └── Imagick.class.php │ │ │ ├── Log.class.php │ │ │ ├── Log │ │ │ │ └── Driver │ │ │ │ │ ├── File.class.php │ │ │ │ │ └── Sae.class.php │ │ │ ├── Model.class.php │ │ │ ├── Model │ │ │ │ ├── AdvModel.class.php │ │ │ │ ├── MergeModel.class.php │ │ │ │ ├── MongoModel.class.php │ │ │ │ ├── RelationModel.class.php │ │ │ │ └── ViewModel.class.php │ │ │ ├── Page.class.php │ │ │ ├── Route.class.php │ │ │ ├── Session │ │ │ │ └── Driver │ │ │ │ │ ├── Db.class.php │ │ │ │ │ ├── Memcache.class.php │ │ │ │ │ └── Mysqli.class.php │ │ │ ├── Storage.class.php │ │ │ ├── Storage │ │ │ │ └── Driver │ │ │ │ │ ├── File.class.php │ │ │ │ │ └── Sae.class.php │ │ │ ├── Template.class.php │ │ │ ├── Template │ │ │ │ ├── Driver │ │ │ │ │ ├── Ease.class.php │ │ │ │ │ ├── Lite.class.php │ │ │ │ │ ├── Mobile.class.php │ │ │ │ │ ├── Smart.class.php │ │ │ │ │ └── Smarty.class.php │ │ │ │ ├── TagLib.class.php │ │ │ │ └── TagLib │ │ │ │ │ ├── Cx.class.php │ │ │ │ │ └── Html.class.php │ │ │ ├── Think.class.php │ │ │ ├── Upload.class.php │ │ │ ├── Upload │ │ │ │ └── Driver │ │ │ │ │ ├── Bcs.class.php │ │ │ │ │ ├── Bcs │ │ │ │ │ ├── bcs.class.php │ │ │ │ │ ├── mimetypes.class.php │ │ │ │ │ └── requestcore.class.php │ │ │ │ │ ├── Ftp.class.php │ │ │ │ │ ├── Local.class.php │ │ │ │ │ ├── Qiniu.class.php │ │ │ │ │ ├── Qiniu │ │ │ │ │ └── QiniuStorage.class.php │ │ │ │ │ ├── Sae.class.php │ │ │ │ │ └── Upyun.class.php │ │ │ ├── Verify.class.php │ │ │ ├── Verify │ │ │ │ ├── bgs │ │ │ │ │ ├── 1.jpg │ │ │ │ │ ├── 2.jpg │ │ │ │ │ ├── 3.jpg │ │ │ │ │ ├── 4.jpg │ │ │ │ │ ├── 5.jpg │ │ │ │ │ ├── 6.jpg │ │ │ │ │ ├── 7.jpg │ │ │ │ │ └── 8.jpg │ │ │ │ └── ttfs │ │ │ │ │ ├── 1.ttf │ │ │ │ │ ├── 2.ttf │ │ │ │ │ ├── 3.ttf │ │ │ │ │ ├── 4.ttf │ │ │ │ │ ├── 5.ttf │ │ │ │ │ └── 6.ttf │ │ │ └── View.class.php │ │ └── Vendor │ │ │ ├── Boris │ │ │ ├── Boris.php │ │ │ ├── CLIOptionsHandler.php │ │ │ ├── ColoredInspector.php │ │ │ ├── Config.php │ │ │ ├── DumpInspector.php │ │ │ ├── EvalWorker.php │ │ │ ├── ExportInspector.php │ │ │ ├── Inspector.php │ │ │ ├── ReadlineClient.php │ │ │ └── ShallowParser.php │ │ │ ├── EaseTemplate │ │ │ ├── template.core.php │ │ │ └── template.ease.php │ │ │ ├── Hprose │ │ │ ├── HproseClassManager.php │ │ │ ├── HproseClient.php │ │ │ ├── HproseCommon.php │ │ │ ├── HproseFormatter.php │ │ │ ├── HproseHttpClient.php │ │ │ ├── HproseHttpServer.php │ │ │ ├── HproseIO.php │ │ │ ├── HproseIOStream.php │ │ │ ├── HproseReader.php │ │ │ ├── HproseTags.php │ │ │ └── HproseWriter.php │ │ │ ├── README.txt │ │ │ ├── SmartTemplate │ │ │ ├── class.smarttemplate.php │ │ │ ├── class.smarttemplatedebugger.php │ │ │ └── class.smarttemplateparser.php │ │ │ ├── Smarty │ │ │ ├── Smarty.class.php │ │ │ ├── SmartyBC.class.php │ │ │ ├── debug.tpl │ │ │ ├── plugins │ │ │ │ ├── block.textformat.php │ │ │ │ ├── function.counter.php │ │ │ │ ├── function.cycle.php │ │ │ │ ├── function.fetch.php │ │ │ │ ├── function.html_checkboxes.php │ │ │ │ ├── function.html_image.php │ │ │ │ ├── function.html_options.php │ │ │ │ ├── function.html_radios.php │ │ │ │ ├── function.html_select_date.php │ │ │ │ ├── function.html_select_time.php │ │ │ │ ├── function.html_table.php │ │ │ │ ├── function.mailto.php │ │ │ │ ├── function.math.php │ │ │ │ ├── modifier.capitalize.php │ │ │ │ ├── modifier.date_format.php │ │ │ │ ├── modifier.debug_print_var.php │ │ │ │ ├── modifier.escape.php │ │ │ │ ├── modifier.regex_replace.php │ │ │ │ ├── modifier.replace.php │ │ │ │ ├── modifier.spacify.php │ │ │ │ ├── modifier.truncate.php │ │ │ │ ├── modifiercompiler.cat.php │ │ │ │ ├── modifiercompiler.count_characters.php │ │ │ │ ├── modifiercompiler.count_paragraphs.php │ │ │ │ ├── modifiercompiler.count_sentences.php │ │ │ │ ├── modifiercompiler.count_words.php │ │ │ │ ├── modifiercompiler.default.php │ │ │ │ ├── modifiercompiler.escape.php │ │ │ │ ├── modifiercompiler.from_charset.php │ │ │ │ ├── modifiercompiler.indent.php │ │ │ │ ├── modifiercompiler.lower.php │ │ │ │ ├── modifiercompiler.noprint.php │ │ │ │ ├── modifiercompiler.string_format.php │ │ │ │ ├── modifiercompiler.strip.php │ │ │ │ ├── modifiercompiler.strip_tags.php │ │ │ │ ├── modifiercompiler.to_charset.php │ │ │ │ ├── modifiercompiler.unescape.php │ │ │ │ ├── modifiercompiler.upper.php │ │ │ │ ├── modifiercompiler.wordwrap.php │ │ │ │ ├── outputfilter.trimwhitespace.php │ │ │ │ ├── shared.escape_special_chars.php │ │ │ │ ├── shared.literal_compiler_param.php │ │ │ │ ├── shared.make_timestamp.php │ │ │ │ ├── shared.mb_str_replace.php │ │ │ │ ├── shared.mb_unicode.php │ │ │ │ ├── shared.mb_wordwrap.php │ │ │ │ └── variablefilter.htmlspecialchars.php │ │ │ └── sysplugins │ │ │ │ ├── smarty_cacheresource.php │ │ │ │ ├── smarty_cacheresource_custom.php │ │ │ │ ├── smarty_cacheresource_keyvaluestore.php │ │ │ │ ├── smarty_config_source.php │ │ │ │ ├── smarty_internal_cacheresource_file.php │ │ │ │ ├── smarty_internal_compile_append.php │ │ │ │ ├── smarty_internal_compile_assign.php │ │ │ │ ├── smarty_internal_compile_block.php │ │ │ │ ├── smarty_internal_compile_break.php │ │ │ │ ├── smarty_internal_compile_call.php │ │ │ │ ├── smarty_internal_compile_capture.php │ │ │ │ ├── smarty_internal_compile_config_load.php │ │ │ │ ├── smarty_internal_compile_continue.php │ │ │ │ ├── smarty_internal_compile_debug.php │ │ │ │ ├── smarty_internal_compile_eval.php │ │ │ │ ├── smarty_internal_compile_extends.php │ │ │ │ ├── smarty_internal_compile_for.php │ │ │ │ ├── smarty_internal_compile_foreach.php │ │ │ │ ├── smarty_internal_compile_function.php │ │ │ │ ├── smarty_internal_compile_if.php │ │ │ │ ├── smarty_internal_compile_include.php │ │ │ │ ├── smarty_internal_compile_include_php.php │ │ │ │ ├── smarty_internal_compile_insert.php │ │ │ │ ├── smarty_internal_compile_ldelim.php │ │ │ │ ├── smarty_internal_compile_nocache.php │ │ │ │ ├── smarty_internal_compile_private_block_plugin.php │ │ │ │ ├── smarty_internal_compile_private_function_plugin.php │ │ │ │ ├── smarty_internal_compile_private_modifier.php │ │ │ │ ├── smarty_internal_compile_private_object_block_function.php │ │ │ │ ├── smarty_internal_compile_private_object_function.php │ │ │ │ ├── smarty_internal_compile_private_print_expression.php │ │ │ │ ├── smarty_internal_compile_private_registered_block.php │ │ │ │ ├── smarty_internal_compile_private_registered_function.php │ │ │ │ ├── smarty_internal_compile_private_special_variable.php │ │ │ │ ├── smarty_internal_compile_rdelim.php │ │ │ │ ├── smarty_internal_compile_section.php │ │ │ │ ├── smarty_internal_compile_setfilter.php │ │ │ │ ├── smarty_internal_compile_while.php │ │ │ │ ├── smarty_internal_compilebase.php │ │ │ │ ├── smarty_internal_config.php │ │ │ │ ├── smarty_internal_config_file_compiler.php │ │ │ │ ├── smarty_internal_configfilelexer.php │ │ │ │ ├── smarty_internal_configfileparser.php │ │ │ │ ├── smarty_internal_data.php │ │ │ │ ├── smarty_internal_debug.php │ │ │ │ ├── smarty_internal_filter_handler.php │ │ │ │ ├── smarty_internal_function_call_handler.php │ │ │ │ ├── smarty_internal_get_include_path.php │ │ │ │ ├── smarty_internal_nocache_insert.php │ │ │ │ ├── smarty_internal_parsetree.php │ │ │ │ ├── smarty_internal_resource_eval.php │ │ │ │ ├── smarty_internal_resource_extends.php │ │ │ │ ├── smarty_internal_resource_file.php │ │ │ │ ├── smarty_internal_resource_php.php │ │ │ │ ├── smarty_internal_resource_registered.php │ │ │ │ ├── smarty_internal_resource_stream.php │ │ │ │ ├── smarty_internal_resource_string.php │ │ │ │ ├── smarty_internal_smartytemplatecompiler.php │ │ │ │ ├── smarty_internal_template.php │ │ │ │ ├── smarty_internal_templatebase.php │ │ │ │ ├── smarty_internal_templatecompilerbase.php │ │ │ │ ├── smarty_internal_templatelexer.php │ │ │ │ ├── smarty_internal_templateparser.php │ │ │ │ ├── smarty_internal_utility.php │ │ │ │ ├── smarty_internal_write_file.php │ │ │ │ ├── smarty_resource.php │ │ │ │ ├── smarty_resource_custom.php │ │ │ │ ├── smarty_resource_recompiled.php │ │ │ │ ├── smarty_resource_uncompiled.php │ │ │ │ └── smarty_security.php │ │ │ ├── TemplateLite │ │ │ ├── class.compiler.php │ │ │ ├── class.config.php │ │ │ ├── class.template.php │ │ │ └── internal │ │ │ │ ├── compile.compile_config.php │ │ │ │ ├── compile.compile_custom_block.php │ │ │ │ ├── compile.compile_custom_function.php │ │ │ │ ├── compile.compile_if.php │ │ │ │ ├── compile.generate_compiler_debug_output.php │ │ │ │ ├── compile.include.php │ │ │ │ ├── compile.parse_is_expr.php │ │ │ │ ├── compile.section_start.php │ │ │ │ ├── debug.tpl │ │ │ │ ├── template.build_dir.php │ │ │ │ ├── template.config_loader.php │ │ │ │ ├── template.destroy_dir.php │ │ │ │ ├── template.fetch_compile_include.php │ │ │ │ └── template.generate_debug_output.php │ │ │ ├── jsonRPC │ │ │ ├── jsonRPCClient.php │ │ │ └── jsonRPCServer.php │ │ │ ├── phpRPC │ │ │ ├── bigint.php │ │ │ ├── compat.php │ │ │ ├── dhparams.php │ │ │ ├── dhparams │ │ │ │ ├── 1024.dhp │ │ │ │ ├── 128.dhp │ │ │ │ ├── 1536.dhp │ │ │ │ ├── 160.dhp │ │ │ │ ├── 192.dhp │ │ │ │ ├── 2048.dhp │ │ │ │ ├── 256.dhp │ │ │ │ ├── 3072.dhp │ │ │ │ ├── 4096.dhp │ │ │ │ ├── 512.dhp │ │ │ │ ├── 768.dhp │ │ │ │ └── 96.dhp │ │ │ ├── pecl │ │ │ │ └── xxtea │ │ │ │ │ ├── CREDITS │ │ │ │ │ ├── INSTALL │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README │ │ │ │ │ ├── config.m4 │ │ │ │ │ ├── config.w32 │ │ │ │ │ ├── php_xxtea.c │ │ │ │ │ ├── php_xxtea.dsp │ │ │ │ │ ├── php_xxtea.h │ │ │ │ │ ├── php_xxtea.sln │ │ │ │ │ ├── php_xxtea.vcproj │ │ │ │ │ ├── test │ │ │ │ │ └── test.php │ │ │ │ │ ├── xxtea.c │ │ │ │ │ └── xxtea.h │ │ │ ├── phprpc_client.php │ │ │ ├── phprpc_date.php │ │ │ ├── phprpc_server.php │ │ │ └── xxtea.php │ │ │ └── spyc │ │ │ ├── COPYING │ │ │ ├── README.md │ │ │ ├── Spyc.php │ │ │ ├── composer.json │ │ │ ├── examples │ │ │ ├── yaml-dump.php │ │ │ └── yaml-load.php │ │ │ ├── php4 │ │ │ ├── 5to4.php │ │ │ ├── spyc.php4 │ │ │ └── test.php4 │ │ │ ├── spyc.yaml │ │ │ └── tests │ │ │ ├── DumpTest.php │ │ │ ├── IndentTest.php │ │ │ ├── ParseTest.php │ │ │ ├── RoundTripTest.php │ │ │ ├── comments.yaml │ │ │ ├── failing1.yaml │ │ │ ├── indent_1.yaml │ │ │ └── quotes.yaml │ ├── Mode │ │ ├── Api │ │ │ ├── App.class.php │ │ │ ├── Controller.class.php │ │ │ ├── Dispatcher.class.php │ │ │ └── functions.php │ │ ├── Lite │ │ │ ├── App.class.php │ │ │ ├── Controller.class.php │ │ │ ├── Dispatcher.class.php │ │ │ ├── Model.class.php │ │ │ ├── View.class.php │ │ │ ├── convention.php │ │ │ └── functions.php │ │ ├── Sae │ │ │ └── convention.php │ │ ├── api.php │ │ ├── common.php │ │ ├── lite.php │ │ └── sae.php │ ├── ThinkPHP.php │ ├── Tpl │ │ ├── dispatch_jump.tpl │ │ ├── page_trace.tpl │ │ └── think_exception.tpl │ └── logo.png └── index.php ├── sql └── easy_admin_2017-11-08.sql └── web ├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .postcssrc.js ├── build ├── build.js ├── check-versions.js ├── dev-client.js ├── dev-server.js ├── utils.js ├── vue-loader.conf.js ├── webpack.base.conf.js ├── webpack.dev.conf.js └── webpack.prod.conf.js ├── config ├── dev.env.js ├── index.js └── prod.env.js ├── index.html ├── package.json ├── src ├── App.vue ├── assets │ └── logo.png ├── components │ ├── admin │ │ ├── admin.vue │ │ ├── feedback.vue │ │ └── feedbacklist.vue │ └── common │ │ ├── 404.vue │ │ ├── login.vue │ │ └── reg.vue ├── main.js ├── router │ └── index.js ├── store │ └── store.js └── util │ └── api.js └── static └── .gitkeep /README.md: -------------------------------------------------------------------------------- 1 | ### 2 | 更稳定的vue管理台请移步: 3 | * [管理台前端部分](https://github.com/HJaycee/app_admin) 4 | * [管理台后台部分](https://github.com/HJaycee/app_admin_api) 5 | 6 | 7 | ### 介绍 8 | `前后端分离`后台小网站 9 | >- 前端使用vue+vue-router+element-ui+npm+webpack 10 | >- 后台接口使用php 11 | 12 | ![预览](http://img2.ph.126.net/IQs28wtCmb3iVjjAI416cQ==/6632691744373838870.gif) 13 | 14 | ### 安装 15 | 16 | ``` 17 | git clone https://github.com/HJaycee/SimpleAdmin.git 18 | cd SimpleAdmin 19 | npm install 20 | ``` 21 | 22 | ### 启动 23 | 24 | ``` 25 | npm run dev 26 | ``` 27 | 28 | ### 部署到服务器 29 | 30 | ``` 31 | cd SimpleAdmin 32 | npm run build 33 | // 编译完成后,将dist目录下的文件上传到服务器目录下 34 | ``` 35 | 36 | ``` 37 | // 因为使用vue-router的hitory模式,服务器需要做相关配置自动重定向到index.html 38 | // apache下创建隐藏文件.htaccess,填以下内容 39 | 40 | RewriteEngine On 41 | RewriteBase / 42 | RewriteRule ^index\.html$ - [L] 43 | RewriteCond %{REQUEST_FILENAME} !-f 44 | RewriteCond %{REQUEST_FILENAME} !-d 45 | RewriteRule . /index.html [L] 46 | 47 | ``` 48 | 49 | 50 | 51 | ### 前端部分 52 | 53 | 已实现功能 54 | >- 登录/注册 55 | >- 留言 56 | >- 留言列表 57 | >- 身份过期处理 58 | 59 | 相关配置 60 | 61 | ``` 62 | /config/index.js // 反向代理 63 | /src/router/index.js // 路由 64 | /url/api.js // 请求接口 65 | ``` 66 | 67 | ### 后台部分 68 | 69 | >- 环境要求php5 70 | >- 使用ThinkPHP3.2.3 71 | >- 提供前端需要的相关接口:登录接口返回token,其它接口效验token是否过期 72 | 73 | ### 数据库 74 | 75 | ``` 76 | user // 用户表 77 | feedback // 留言表 78 | ``` 79 | 80 | -------------------------------------------------------------------------------- /php/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | RewriteEngine on 3 | RewriteCond %{REQUEST_FILENAME} !-d 4 | RewriteCond %{REQUEST_FILENAME} !-f 5 | RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] 6 | 7 | 8 | Options -Indexes 9 | -------------------------------------------------------------------------------- /php/404.html: -------------------------------------------------------------------------------- 1 | cannot find path -------------------------------------------------------------------------------- /php/Application/Common/Common/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /php/Application/Common/Conf/config.php: -------------------------------------------------------------------------------- 1 | '404.html', // 404页面 5 | 'DB_TYPE' => 'mysql', 'DB_HOST' => '127.0.0.1', // 服务器地址 6 | 'DB_NAME' => 'easy_admin', // 数据库名 7 | 'DB_USER' => 'root', // 用户名 8 | 'DB_PWD' => '', // 密码 9 | 'DB_PORT' => 3306, // 端口 10 | 'DB_PREFIX' => '', // 数据库表前缀 11 | 'DB_CHARSET' => 'utf8', // 字符集 12 | 'DB_DEBUG' => false, // 数据库调试模式 开启后可以记录SQL日志 3.2.3新增 13 | 'SHOW_PAGE_TRACE' => false, // 调试工具显示 14 | 'SESSION_AUTO_START' => true, // 开启SESSION 15 | ); -------------------------------------------------------------------------------- /php/Application/Common/Conf/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /php/Application/Common/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /php/Application/Home/Common/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /php/Application/Home/Conf/config.php: -------------------------------------------------------------------------------- 1 | '配置值' 4 | ); -------------------------------------------------------------------------------- /php/Application/Home/Conf/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /php/Application/Home/Controller/BaseController.class.php: -------------------------------------------------------------------------------- 1 | is_empty(I('token'))) { 23 | $this->jsonReturn(1000, '身份过期,请重新登录', null); 24 | } 25 | 26 | $result = M('user')->where(['token' => I('token')])->find(); 27 | 28 | if (!$result) { 29 | $this->jsonReturn(1000, '身份过期,请重新登录', null); 30 | } 31 | } 32 | 33 | protected function is_empty($value) { 34 | if ($value == null || 35 | $value == '') { 36 | return true; 37 | } else { 38 | return false; 39 | } 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /php/Application/Home/Controller/FeedbackController.class.php: -------------------------------------------------------------------------------- 1 | validToken(); 12 | 13 | if ($this->is_empty(I('content'))) { 14 | $this->jsonReturn(-1, '留言内容不能为空', null); 15 | } 16 | 17 | $user = M('user')->where(['token' => I('token')])->find(); 18 | 19 | $data['content'] = I('content'); 20 | $data['user_id'] = $user['id']; 21 | $data['username'] = $user['username']; 22 | $data['create_at'] = time(); 23 | 24 | $result = M('feedback')->add($data); 25 | 26 | if (!$result) { 27 | $this->jsonReturn(-1, '未知错误', null); 28 | } else { 29 | $this->jsonReturn(0, '留言成功', null); 30 | } 31 | } 32 | 33 | public function records() { 34 | $this->validToken(); 35 | 36 | if (is_null(I('page')) || 37 | is_null(I('size'))) { 38 | $this->jsonReturn(-1, '参数错误', null); 39 | } 40 | 41 | $from = I('page') * I('size'); 42 | 43 | $result = M('feedback')->order('create_at desc')->limit($from, I('size'))->select(); 44 | 45 | $arr = []; 46 | 47 | foreach ($result as $item) { 48 | $name = substr($item['username'], 0, strlen($item['username']) - 2) . '**'; 49 | array_push($arr, ['create_at' => date("Y-m-d H:i:s", $item['create_at']), 50 | 'username' => $name, 51 | 'content' => $item['content']]); 52 | } 53 | 54 | $count = M('feedback')->count(); 55 | 56 | $data['list'] = $arr; 57 | $data['pages'] = ceil($count / I('size')); 58 | 59 | $this->jsonReturn(0, '查询成功', $data); 60 | } 61 | } -------------------------------------------------------------------------------- /php/Application/Home/Controller/UserController.class.php: -------------------------------------------------------------------------------- 1 | is_empty(I('username')) || 14 | $this->is_empty(I('password'))) { 15 | $this->jsonReturn(-1, '参数错误', null); 16 | } 17 | 18 | $result = M('user')->where(['username' => I('username')])->find(); 19 | 20 | if (!$result) { 21 | $this->jsonReturn(-1, '账号不存在', null); 22 | } 23 | 24 | if ($result['password'] != I('password')) { 25 | $this->jsonReturn(-1, '登录密码错误', null); 26 | } else { 27 | $token = md5($result['username'] . $result['password'] . time()); // 返回token 28 | 29 | $ret = M('user')->where(['username' => I('username')])->save(['token' => $token]); 30 | 31 | if ($ret) { 32 | $this->jsonReturn(0, '登录成功', ['token' => $token]); 33 | } else { 34 | $this->jsonReturn(-1, '未知错误', null); 35 | } 36 | } 37 | 38 | } 39 | 40 | public function reg () { 41 | 42 | if ($this->is_empty(I('username')) || 43 | $this->is_empty(I('password')) || 44 | $this->is_empty(I('password2'))) { 45 | $this->jsonReturn(-1, '参数错误', null); 46 | } 47 | 48 | if (I('password') != I('password2')) { 49 | $this->jsonReturn(-1, '密码不一致', null); 50 | } 51 | 52 | $result = M('user')->where(['username' => I('username')])->find(); 53 | 54 | if ($result) { 55 | $this->jsonReturn(-1, '账号已存在', null); 56 | } 57 | 58 | $data['username'] = I('username'); 59 | $data['password'] = I('password'); 60 | $data['phone'] = I('phone'); 61 | $data['email'] = I('email'); 62 | $data['create_at'] = time(); 63 | 64 | $add_ret = M('user')->add($data); 65 | 66 | if (!$add_ret) { 67 | $this->jsonReturn(-1, '未知错误', null); 68 | } else { 69 | $this->jsonReturn(0, '注册成功', null); 70 | } 71 | } 72 | } -------------------------------------------------------------------------------- /php/Application/Home/Controller/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /php/Application/Home/Model/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /php/Application/Home/View/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /php/Application/Home/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /php/Application/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /php/Public/README.md: -------------------------------------------------------------------------------- 1 | 资源文件目录 -------------------------------------------------------------------------------- /php/ThinkPHP/Conf/debug.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | /** 13 | * ThinkPHP 默认的调试模式配置文件 14 | */ 15 | defined('THINK_PATH') or exit(); 16 | // 调试模式下面默认设置 可以在应用配置目录下重新定义 debug.php 覆盖 17 | return array( 18 | 'LOG_RECORD' => true, // 进行日志记录 19 | 'LOG_EXCEPTION_RECORD' => true, // 是否记录异常信息日志 20 | 'LOG_LEVEL' => 'EMERG,ALERT,CRIT,ERR,WARN,NOTIC,INFO,DEBUG,SQL', // 允许记录的日志级别 21 | 'DB_FIELDS_CACHE' => false, // 字段缓存信息 22 | 'DB_DEBUG' => true, // 开启调试模式 记录SQL日志 23 | 'TMPL_CACHE_ON' => false, // 是否开启模板编译缓存,设为false则每次都会重新编译 24 | 'TMPL_STRIP_SPACE' => false, // 是否去除模板文件里面的html空格与换行 25 | 'SHOW_ERROR_MSG' => true, // 显示错误信息 26 | 'URL_CASE_INSENSITIVE' => false, // URL区分大小写 27 | ); -------------------------------------------------------------------------------- /php/ThinkPHP/LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | ThinkPHP遵循Apache2开源协议发布,并提供免费使用。 3 | 版权所有Copyright © 2006-2014 by ThinkPHP (http://thinkphp.cn) 4 | All rights reserved。 5 | ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。 6 | 7 | Apache Licence是著名的非盈利开源组织Apache采用的协议。 8 | 该协议和BSD类似,鼓励代码共享和尊重原作者的著作权, 9 | 允许代码修改,再作为开源或商业软件发布。需要满足 10 | 的条件: 11 | 1. 需要给代码的用户一份Apache Licence ; 12 | 2. 如果你修改了代码,需要在被修改的文件中说明; 13 | 3. 在延伸的代码中(修改和有源代码衍生的代码中)需要 14 | 带有原来代码中的协议,商标,专利声明和其他原来作者规 15 | 定需要包含的说明; 16 | 4. 如果再发布的产品中包含一个Notice文件,则在Notice文 17 | 件中需要带有本协议内容。你可以在Notice中增加自己的 18 | 许可,但不可以表现为对Apache Licence构成更改。 19 | 具体的协议参考:http://www.apache.org/licenses/LICENSE-2.0 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | POSSIBILITY OF SUCH DAMAGE. 33 | -------------------------------------------------------------------------------- /php/ThinkPHP/Lang/zh-cn.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | /** 13 | * ThinkPHP 简体中文语言包 14 | */ 15 | return array( 16 | /* 核心语言变量 */ 17 | '_MODULE_NOT_EXIST_' => '无法加载模块', 18 | '_CONTROLLER_NOT_EXIST_' => '无法加载控制器', 19 | '_ERROR_ACTION_' => '非法操作', 20 | '_LANGUAGE_NOT_LOAD_' => '无法加载语言包', 21 | '_TEMPLATE_NOT_EXIST_' => '模板不存在', 22 | '_MODULE_' => '模块', 23 | '_ACTION_' => '操作', 24 | '_MODEL_NOT_EXIST_' => '模型不存在或者没有定义', 25 | '_VALID_ACCESS_' => '没有权限', 26 | '_XML_TAG_ERROR_' => 'XML标签语法错误', 27 | '_DATA_TYPE_INVALID_' => '非法数据对象!', 28 | '_OPERATION_WRONG_' => '操作出现错误', 29 | '_NOT_LOAD_DB_' => '无法加载数据库', 30 | '_NO_DB_DRIVER_' => '无法加载数据库驱动', 31 | '_NOT_SUPPORT_DB_' => '系统暂时不支持数据库', 32 | '_NO_DB_CONFIG_' => '没有定义数据库配置', 33 | '_NOT_SUPPORT_' => '系统不支持', 34 | '_CACHE_TYPE_INVALID_' => '无法加载缓存类型', 35 | '_FILE_NOT_WRITABLE_' => '目录(文件)不可写', 36 | '_METHOD_NOT_EXIST_' => '方法不存在!', 37 | '_CLASS_NOT_EXIST_' => '实例化一个不存在的类!', 38 | '_CLASS_CONFLICT_' => '类名冲突', 39 | '_TEMPLATE_ERROR_' => '模板引擎错误', 40 | '_CACHE_WRITE_ERROR_' => '缓存文件写入失败!', 41 | '_TAGLIB_NOT_EXIST_' => '标签库未定义', 42 | '_OPERATION_FAIL_' => '操作失败!', 43 | '_OPERATION_SUCCESS_' => '操作成功!', 44 | '_SELECT_NOT_EXIST_' => '记录不存在!', 45 | '_EXPRESS_ERROR_' => '表达式错误', 46 | '_TOKEN_ERROR_' => '表单令牌错误', 47 | '_RECORD_HAS_UPDATE_' => '记录已经更新', 48 | '_NOT_ALLOW_PHP_' => '模板禁用PHP代码', 49 | '_PARAM_ERROR_' => '参数错误或者未定义', 50 | '_ERROR_QUERY_EXPRESS_' => '错误的查询条件', 51 | ); 52 | -------------------------------------------------------------------------------- /php/ThinkPHP/Lang/zh-tw.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | /** 13 | * ThinkPHP 繁体中文語言包 14 | */ 15 | return array( 16 | /* 核心語言變數 */ 17 | '_MODULE_NOT_EXIST_' => '無法載入模組', 18 | '_CONTROLLER_NOT_EXIST_' => '無法載入控制器', 19 | '_ERROR_ACTION_' => '非法操作', 20 | '_LANGUAGE_NOT_LOAD_' => '無法載入語言包', 21 | '_TEMPLATE_NOT_EXIST_' => '模板不存在', 22 | '_MODULE_' => '模組', 23 | '_ACTION_' => '操作', 24 | '_MODEL_NOT_EXIST_' => '模型不存在或者沒有定義', 25 | '_VALID_ACCESS_' => '沒有權限', 26 | '_XML_TAG_ERROR_' => 'XML標籤語法錯誤', 27 | '_DATA_TYPE_INVALID_' => '非法資料物件!', 28 | '_OPERATION_WRONG_' => '操作出現錯誤', 29 | '_NOT_LOAD_DB_' => '無法載入資料庫', 30 | '_NO_DB_DRIVER_' => '無法載入資料庫驅動', 31 | '_NOT_SUPPORT_DB_' => '系統暫時不支援資料庫', 32 | '_NO_DB_CONFIG_' => '沒有定義資料庫設定', 33 | '_NOT_SUPPORT_' => '系統不支援', 34 | '_CACHE_TYPE_INVALID_' => '無法載入快取類型', 35 | '_FILE_NOT_WRITABLE_' => '目錄(檔案)不可寫', 36 | '_METHOD_NOT_EXIST_' => '方法不存在!', 37 | '_CLASS_NOT_EXIST_' => '實例化一個不存在的類別!', 38 | '_CLASS_CONFLICT_' => '類別名稱衝突', 39 | '_TEMPLATE_ERROR_' => '模板引擎錯誤', 40 | '_CACHE_WRITE_ERROR_' => '快取檔案寫入失敗!', 41 | '_TAGLIB_NOT_EXIST_' => '標籤庫未定義', 42 | '_OPERATION_FAIL_' => '操作失敗!', 43 | '_OPERATION_SUCCESS_' => '操作成功!', 44 | '_SELECT_NOT_EXIST_' => '記錄不存在!', 45 | '_EXPRESS_ERROR_' => '運算式錯誤', 46 | '_TOKEN_ERROR_' => '表單權限錯誤', 47 | '_RECORD_HAS_UPDATE_' => '記錄已經更新', 48 | '_NOT_ALLOW_PHP_' => '模板禁用PHP代碼', 49 | '_PARAM_ERROR_' => '參數錯誤或者未定義', 50 | '_ERROR_QUERY_EXPRESS_' => '錯誤的查詢條件', 51 | ); 52 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Behavior/AgentCheckBehavior.class.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | namespace Behavior; 12 | /** 13 | * 行为扩展:代理检测 14 | */ 15 | class AgentCheckBehavior { 16 | public function run(&$params) { 17 | // 代理访问检测 18 | $limitProxyVisit = C('LIMIT_PROXY_VISIT',null,true); 19 | if($limitProxyVisit && ($_SERVER['HTTP_X_FORWARDED_FOR'] || $_SERVER['HTTP_VIA'] || $_SERVER['HTTP_PROXY_CONNECTION'] || $_SERVER['HTTP_USER_AGENT_VIA'])) { 20 | // 禁止代理访问 21 | exit('Access Denied'); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Behavior/BorisBehavior.class.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | namespace Behavior; 12 | use Think\Think; 13 | /** 14 | * Boris行为扩展 15 | */ 16 | class BorisBehavior { 17 | public function run(&$params) { 18 | if(IS_CLI){ 19 | if(!function_exists('pcntl_signal')) 20 | E("pcntl_signal not working.\nRepl mode based on Linux OS or PHP for OS X(http://php-osx.liip.ch/)\n"); 21 | Think::addMap(array( 22 | 'Boris\Boris' => VENDOR_PATH . 'Boris/Boris.php', 23 | 'Boris\Config' => VENDOR_PATH . 'Boris/Config.php', 24 | 'Boris\CLIOptionsHandler' => VENDOR_PATH . 'Boris/CLIOptionsHandler.php', 25 | 'Boris\ColoredInspector' => VENDOR_PATH . 'Boris/ColoredInspector.php', 26 | 'Boris\DumpInspector' => VENDOR_PATH . 'Boris/DumpInspector.php', 27 | 'Boris\EvalWorker' => VENDOR_PATH . 'Boris/EvalWorker.php', 28 | 'Boris\ExportInspector' => VENDOR_PATH . 'Boris/ExportInspector.php', 29 | 'Boris\Inspector' => VENDOR_PATH . 'Boris/Inspector.php', 30 | 'Boris\ReadlineClient' => VENDOR_PATH . 'Boris/ReadlineClient.php', 31 | 'Boris\ShallowParser' => VENDOR_PATH . 'Boris/ShallowParser.php', 32 | )); 33 | $boris = new \Boris\Boris(">>> "); 34 | $config = new \Boris\Config(); 35 | $config->apply($boris, true); 36 | $options = new \Boris\CLIOptionsHandler(); 37 | $options->handle($boris); 38 | $boris->onStart(sprintf("echo 'REPL MODE FOR THINKPHP \nTHINKPHP_VERSION: %s, PHP_VERSION: %s, BORIS_VERSION: %s\n';", THINK_VERSION, PHP_VERSION, $boris::VERSION)); 39 | $boris->start(); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Behavior/BrowserCheckBehavior.class.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | namespace Behavior; 12 | /** 13 | * 浏览器防刷新检测 14 | */ 15 | class BrowserCheckBehavior { 16 | public function run(&$params) { 17 | if($_SERVER['REQUEST_METHOD'] == 'GET') { 18 | // 启用页面防刷新机制 19 | $guid = md5($_SERVER['PHP_SELF']); 20 | // 浏览器防刷新的时间间隔(秒) 默认为10 21 | $refleshTime = C('LIMIT_REFLESH_TIMES',null,10); 22 | // 检查页面刷新间隔 23 | if(cookie('_last_visit_time_'.$guid) && cookie('_last_visit_time_'.$guid)>time()-$refleshTime) { 24 | // 页面刷新读取浏览器缓存 25 | header('HTTP/1.1 304 Not Modified'); 26 | exit; 27 | }else{ 28 | // 缓存当前地址访问时间 29 | cookie('_last_visit_time_'.$guid, $_SERVER['REQUEST_TIME']); 30 | //header('Last-Modified:'.(date('D,d M Y H:i:s',$_SERVER['REQUEST_TIME']-C('LIMIT_REFLESH_TIMES'))).' GMT'); 31 | } 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Behavior/ContentReplaceBehavior.class.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | namespace Behavior; 12 | /** 13 | * 系统行为扩展:模板内容输出替换 14 | */ 15 | class ContentReplaceBehavior { 16 | 17 | // 行为扩展的执行入口必须是run 18 | public function run(&$content){ 19 | $content = $this->templateContentReplace($content); 20 | } 21 | 22 | /** 23 | * 模板内容替换 24 | * @access protected 25 | * @param string $content 模板内容 26 | * @return string 27 | */ 28 | protected function templateContentReplace($content) { 29 | // 系统默认的特殊变量替换 30 | $replace = array( 31 | '__ROOT__' => __ROOT__, // 当前网站地址 32 | '__APP__' => __APP__, // 当前应用地址 33 | '__MODULE__' => __MODULE__, 34 | '__ACTION__' => __ACTION__, // 当前操作地址 35 | '__SELF__' => htmlentities(__SELF__), // 当前页面地址 36 | '__CONTROLLER__'=> __CONTROLLER__, 37 | '__URL__' => __CONTROLLER__, 38 | '__PUBLIC__' => __ROOT__.'/Public',// 站点公共目录 39 | ); 40 | // 允许用户自定义模板的字符串替换 41 | if(is_array(C('TMPL_PARSE_STRING')) ) 42 | $replace = array_merge($replace,C('TMPL_PARSE_STRING')); 43 | $content = str_replace(array_keys($replace),array_values($replace),$content); 44 | return $content; 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Behavior/RobotCheckBehavior.class.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | namespace Behavior; 12 | /** 13 | * 机器人检测 14 | * @author liu21st 15 | */ 16 | class RobotCheckBehavior { 17 | 18 | public function run(&$params) { 19 | // 机器人访问检测 20 | if(C('LIMIT_ROBOT_VISIT',null,true) && self::isRobot()) { 21 | // 禁止机器人访问 22 | exit('Access Denied'); 23 | } 24 | } 25 | 26 | static private function isRobot() { 27 | static $_robot = null; 28 | if(is_null($_robot)) { 29 | $spiders = 'Bot|Crawl|Spider|slurp|sohu-search|lycos|robozilla'; 30 | $browsers = 'MSIE|Netscape|Opera|Konqueror|Mozilla'; 31 | if(preg_match("/($browsers)/", $_SERVER['HTTP_USER_AGENT'])) { 32 | $_robot = false ; 33 | } elseif(preg_match("/($spiders)/", $_SERVER['HTTP_USER_AGENT'])) { 34 | $_robot = true; 35 | } else { 36 | $_robot = false; 37 | } 38 | } 39 | return $_robot; 40 | } 41 | } -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Behavior/WriteHtmlCacheBehavior.class.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | namespace Behavior; 12 | use Think\Storage; 13 | /** 14 | * 系统行为扩展:静态缓存写入 15 | */ 16 | class WriteHtmlCacheBehavior { 17 | 18 | // 行为扩展的执行入口必须是run 19 | public function run(&$content) { 20 | //2014-11-28 修改 如果有HTTP 4xx 3xx 5xx 头部,禁止存储 21 | //2014-12-1 修改 对注入的网址 防止生成,例如 /game/lst/SortType/hot/-e8-90-8c-e5-85-94-e7-88-b1-e6-b6-88-e9-99-a4/-e8-bf-9b-e5-87-bb-e7-9a-84-e9-83-a8-e8-90-bd/-e9-a3-8e-e4-ba-91-e5-a4-a9-e4-b8-8b/index.shtml 22 | if (C('HTML_CACHE_ON') && defined('HTML_FILE_NAME') 23 | && !preg_match('/Status.*[345]{1}\d{2}/i', implode(' ', headers_list())) 24 | && !preg_match('/(-[a-z0-9]{2}){3,}/i',HTML_FILE_NAME)) { 25 | //静态文件写入 26 | Storage::put(HTML_FILE_NAME, $content, 'html'); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Org/Util/Stack.class.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | namespace Org\Util; 12 | 13 | /** 14 | * Stack实现类 15 | * @category ORG 16 | * @package ORG 17 | * @subpackage Util 18 | * @author liu21st 19 | */ 20 | class Stack extends ArrayList { 21 | 22 | /** 23 | * 架构函数 24 | * @access public 25 | * @param array $values 初始化数组元素 26 | */ 27 | public function __construct($values = array()) { 28 | parent::__construct($values); 29 | } 30 | 31 | /** 32 | * 将堆栈的内部指针指向第一个单元 33 | * @access public 34 | * @return mixed 35 | */ 36 | public function peek() { 37 | return reset($this->toArray()); 38 | } 39 | 40 | /** 41 | * 元素进栈 42 | * @access public 43 | * @param mixed $value 44 | * @return mixed 45 | */ 46 | public function push($value) { 47 | $this->add($value); 48 | return $value; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Behavior.class.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | namespace Think; 12 | /** 13 | * ThinkPHP Behavior基础类 14 | */ 15 | abstract class Behavior { 16 | /** 17 | * 执行行为 run方法是Behavior唯一的接口 18 | * @access public 19 | * @param mixed $params 行为参数 20 | * @return void 21 | */ 22 | abstract public function run(&$params); 23 | 24 | } -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Controller/HproseController.class.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | namespace Think\Controller; 12 | /** 13 | * ThinkPHP Hprose控制器类 14 | */ 15 | class HproseController { 16 | 17 | protected $allowMethodList = ''; 18 | protected $crossDomain = false; 19 | protected $P3P = false; 20 | protected $get = true; 21 | protected $debug = false; 22 | 23 | /** 24 | * 架构函数 25 | * @access public 26 | */ 27 | public function __construct() { 28 | //控制器初始化 29 | if(method_exists($this,'_initialize')) 30 | $this->_initialize(); 31 | //导入类库 32 | Vendor('Hprose.HproseHttpServer'); 33 | //实例化HproseHttpServer 34 | $server = new \HproseHttpServer(); 35 | if($this->allowMethodList){ 36 | $methods = $this->allowMethodList; 37 | }else{ 38 | $methods = get_class_methods($this); 39 | $methods = array_diff($methods,array('__construct','__call','_initialize')); 40 | } 41 | $server->addMethods($methods,$this); 42 | if(APP_DEBUG || $this->debug ) { 43 | $server->setDebugEnabled(true); 44 | } 45 | // Hprose设置 46 | $server->setCrossDomainEnabled($this->crossDomain); 47 | $server->setP3PEnabled($this->P3P); 48 | $server->setGetEnabled($this->get); 49 | // 启动server 50 | $server->start(); 51 | } 52 | 53 | /** 54 | * 魔术方法 有不存在的操作的时候执行 55 | * @access public 56 | * @param string $method 方法名 57 | * @param array $args 参数 58 | * @return mixed 59 | */ 60 | public function __call($method,$args){} 61 | } 62 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Controller/JsonRpcController.class.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | namespace Think\Controller; 12 | /** 13 | * ThinkPHP JsonRPC控制器类 14 | */ 15 | class JsonRpcController { 16 | 17 | /** 18 | * 架构函数 19 | * @access public 20 | */ 21 | public function __construct() { 22 | //控制器初始化 23 | if(method_exists($this,'_initialize')) 24 | $this->_initialize(); 25 | //导入类库 26 | Vendor('jsonRPC.jsonRPCServer'); 27 | // 启动server 28 | \jsonRPCServer::handle($this); 29 | } 30 | 31 | /** 32 | * 魔术方法 有不存在的操作的时候执行 33 | * @access public 34 | * @param string $method 方法名 35 | * @param array $args 参数 36 | * @return mixed 37 | */ 38 | public function __call($method,$args){} 39 | } 40 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Controller/RpcController.class.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | namespace Think\Controller; 12 | /** 13 | * ThinkPHP RPC控制器类 14 | */ 15 | class RpcController { 16 | 17 | protected $allowMethodList = ''; 18 | protected $debug = false; 19 | 20 | /** 21 | * 架构函数 22 | * @access public 23 | */ 24 | public function __construct() { 25 | //控制器初始化 26 | if(method_exists($this,'_initialize')) 27 | $this->_initialize(); 28 | //导入类库 29 | Vendor('phpRPC.phprpc_server'); 30 | //实例化phprpc 31 | $server = new \PHPRPC_Server(); 32 | if($this->allowMethodList){ 33 | $methods = $this->allowMethodList; 34 | }else{ 35 | $methods = get_class_methods($this); 36 | $methods = array_diff($methods,array('__construct','__call','_initialize')); 37 | } 38 | $server->add($methods,$this); 39 | 40 | if(APP_DEBUG || $this->debug ) { 41 | $server->setDebugMode(true); 42 | } 43 | $server->setEnableGZIP(true); 44 | $server->start(); 45 | echo $server->comment(); 46 | } 47 | 48 | /** 49 | * 魔术方法 有不存在的操作的时候执行 50 | * @access public 51 | * @param string $method 方法名 52 | * @param array $args 参数 53 | * @return mixed 54 | */ 55 | public function __call($method,$args){} 56 | } 57 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Controller/YarController.class.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | namespace Think\Controller; 12 | /** 13 | * ThinkPHP Yar控制器类 14 | */ 15 | class YarController { 16 | 17 | /** 18 | * 架构函数 19 | * @access public 20 | */ 21 | public function __construct() { 22 | //控制器初始化 23 | if(method_exists($this,'_initialize')) 24 | $this->_initialize(); 25 | //判断扩展是否存在 26 | if(!extension_loaded('yar')) 27 | E(L('_NOT_SUPPORT_').':yar'); 28 | //实例化Yar_Server 29 | $server = new \Yar_Server($this); 30 | // 启动server 31 | $server->handle(); 32 | } 33 | 34 | /** 35 | * 魔术方法 有不存在的操作的时候执行 36 | * @access public 37 | * @param string $method 方法名 38 | * @param array $args 参数 39 | * @return mixed 40 | */ 41 | public function __call($method,$args){} 42 | } 43 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Crypt.class.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | namespace Think; 12 | /** 13 | * 加密解密类 14 | */ 15 | class Crypt { 16 | 17 | private static $handler = ''; 18 | 19 | public static function init($type=''){ 20 | $type = $type?:C('DATA_CRYPT_TYPE'); 21 | $class = strpos($type,'\\')? $type: 'Think\\Crypt\\Driver\\'. ucwords(strtolower($type)); 22 | self::$handler = $class; 23 | } 24 | 25 | /** 26 | * 加密字符串 27 | * @param string $str 字符串 28 | * @param string $key 加密key 29 | * @param integer $expire 有效期(秒) 0 为永久有效 30 | * @return string 31 | */ 32 | public static function encrypt($data,$key,$expire=0){ 33 | if(empty(self::$handler)){ 34 | self::init(); 35 | } 36 | $class = self::$handler; 37 | return $class::encrypt($data,$key,$expire); 38 | } 39 | 40 | /** 41 | * 解密字符串 42 | * @param string $str 字符串 43 | * @param string $key 加密key 44 | * @return string 45 | */ 46 | public static function decrypt($data,$key){ 47 | if(empty(self::$handler)){ 48 | self::init(); 49 | } 50 | $class = self::$handler; 51 | return $class::decrypt($data,$key); 52 | } 53 | } -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Exception.class.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | namespace Think; 12 | /** 13 | * ThinkPHP系统异常基类 14 | */ 15 | class Exception extends \Exception { 16 | } -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Log/Driver/File.class.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace Think\Log\Driver; 13 | 14 | class File { 15 | 16 | protected $config = array( 17 | 'log_time_format' => ' c ', 18 | 'log_file_size' => 2097152, 19 | 'log_path' => '', 20 | ); 21 | 22 | // 实例化并传入参数 23 | public function __construct($config=array()){ 24 | $this->config = array_merge($this->config,$config); 25 | } 26 | 27 | /** 28 | * 日志写入接口 29 | * @access public 30 | * @param string $log 日志信息 31 | * @param string $destination 写入目标 32 | * @return void 33 | */ 34 | public function write($log,$destination='') { 35 | $now = date($this->config['log_time_format']); 36 | if(empty($destination)){ 37 | $destination = $this->config['log_path'].date('y_m_d').'.log'; 38 | } 39 | // 自动创建日志目录 40 | $log_dir = dirname($destination); 41 | if (!is_dir($log_dir)) { 42 | mkdir($log_dir, 0755, true); 43 | } 44 | //检测日志文件大小,超过配置大小则备份日志文件重新生成 45 | if(is_file($destination) && floor($this->config['log_file_size']) <= filesize($destination) ){ 46 | rename($destination,dirname($destination).'/'.time().'-'.basename($destination)); 47 | } 48 | error_log("[{$now}] ".$_SERVER['REMOTE_ADDR'].' '.$_SERVER['REQUEST_URI']."\r\n{$log}\r\n", 3,$destination); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Log/Driver/Sae.class.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace Think\Log\Driver; 13 | 14 | class Sae { 15 | 16 | protected $config = array( 17 | 'log_time_format' => ' c ', 18 | ); 19 | 20 | // 实例化并传入参数 21 | public function __construct($config=array()){ 22 | $this->config = array_merge($this->config,$config); 23 | } 24 | 25 | /** 26 | * 日志写入接口 27 | * @access public 28 | * @param string $log 日志信息 29 | * @param string $destination 写入目标 30 | * @return void 31 | */ 32 | public function write($log,$destination='') { 33 | static $is_debug=null; 34 | $now = date($this->config['log_time_format']); 35 | $logstr="[{$now}] ".$_SERVER['REMOTE_ADDR'].' '.$_SERVER['REQUEST_URI']."\r\n{$log}\r\n"; 36 | if(is_null($is_debug)){ 37 | preg_replace('@(\w+)\=([^;]*)@e', '$appSettings[\'\\1\']="\\2";', $_SERVER['HTTP_APPCOOKIE']); 38 | $is_debug = in_array($_SERVER['HTTP_APPVERSION'], explode(',', $appSettings['debug'])) ? true : false; 39 | } 40 | if($is_debug){ 41 | sae_set_display_errors(false);//记录日志不将日志打印出来 42 | } 43 | sae_debug($logstr); 44 | if($is_debug){ 45 | sae_set_display_errors(true); 46 | } 47 | 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Session/Driver/Memcache.class.php: -------------------------------------------------------------------------------- 1 | lifeTime = C('SESSION_EXPIRE') ? C('SESSION_EXPIRE') : $this->lifeTime; 17 | // $this->sessionName = $sessName; 18 | $options = array( 19 | 'timeout' => C('SESSION_TIMEOUT') ? C('SESSION_TIMEOUT') : 1, 20 | 'persistent' => C('SESSION_PERSISTENT') ? C('SESSION_PERSISTENT') : 0 21 | ); 22 | $this->handle = new \Memcache; 23 | $hosts = explode(',', C('MEMCACHE_HOST')); 24 | $ports = explode(',', C('MEMCACHE_PORT')); 25 | foreach ($hosts as $i=>$host) { 26 | $port = isset($ports[$i]) ? $ports[$i] : $ports[0]; 27 | $this->handle->addServer($host, $port, true, 1, $options['timeout']); 28 | } 29 | return true; 30 | } 31 | 32 | /** 33 | * 关闭Session 34 | * @access public 35 | */ 36 | public function close() { 37 | $this->gc(ini_get('session.gc_maxlifetime')); 38 | $this->handle->close(); 39 | $this->handle = null; 40 | return true; 41 | } 42 | 43 | /** 44 | * 读取Session 45 | * @access public 46 | * @param string $sessID 47 | */ 48 | public function read($sessID) { 49 | return $this->handle->get($this->sessionName.$sessID); 50 | } 51 | 52 | /** 53 | * 写入Session 54 | * @access public 55 | * @param string $sessID 56 | * @param String $sessData 57 | */ 58 | public function write($sessID, $sessData) { 59 | return $this->handle->set($this->sessionName.$sessID, $sessData, 0, $this->lifeTime); 60 | } 61 | 62 | /** 63 | * 删除Session 64 | * @access public 65 | * @param string $sessID 66 | */ 67 | public function destroy($sessID) { 68 | return $this->handle->delete($this->sessionName.$sessID); 69 | } 70 | 71 | /** 72 | * Session 垃圾回收 73 | * @access public 74 | * @param string $sessMaxLifeTime 75 | */ 76 | public function gc($sessMaxLifeTime) { 77 | return true; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Storage.class.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | namespace Think; 12 | // 分布式文件存储类 13 | class Storage { 14 | 15 | /** 16 | * 操作句柄 17 | * @var string 18 | * @access protected 19 | */ 20 | static protected $handler ; 21 | 22 | /** 23 | * 连接分布式文件系统 24 | * @access public 25 | * @param string $type 文件类型 26 | * @param array $options 配置数组 27 | * @return void 28 | */ 29 | static public function connect($type='File',$options=array()) { 30 | $class = 'Think\\Storage\\Driver\\'.ucwords($type); 31 | self::$handler = new $class($options); 32 | } 33 | 34 | static public function __callstatic($method,$args){ 35 | //调用缓存驱动的方法 36 | if(method_exists(self::$handler, $method)){ 37 | return call_user_func_array(array(self::$handler,$method), $args); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Template/Driver/Ease.class.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | namespace Think\Template\Driver; 12 | /** 13 | * EaseTemplate模板引擎驱动 14 | */ 15 | class Ease { 16 | /** 17 | * 渲染模板输出 18 | * @access public 19 | * @param string $templateFile 模板文件名 20 | * @param array $var 模板变量 21 | * @return void 22 | */ 23 | public function fetch($templateFile,$var) { 24 | $templateFile = substr($templateFile,strlen(THEME_PATH),-5); 25 | $CacheDir = substr(CACHE_PATH,0,-1); 26 | $TemplateDir = substr(THEME_PATH,0,-1); 27 | vendor('EaseTemplate.template#ease'); 28 | $config = array( 29 | 'CacheDir' => $CacheDir, 30 | 'TemplateDir' => $TemplateDir, 31 | 'TplType' => 'html' 32 | ); 33 | if(C('TMPL_ENGINE_CONFIG')) { 34 | $config = array_merge($config,C('TMPL_ENGINE_CONFIG')); 35 | } 36 | $tpl = new \EaseTemplate($config); 37 | $tpl->set_var($var); 38 | $tpl->set_file($templateFile); 39 | $tpl->p(); 40 | } 41 | } -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Template/Driver/Lite.class.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | namespace Think\Template\Driver; 12 | /** 13 | * TemplateLite模板引擎驱动 14 | */ 15 | class Lite { 16 | /** 17 | * 渲染模板输出 18 | * @access public 19 | * @param string $templateFile 模板文件名 20 | * @param array $var 模板变量 21 | * @return void 22 | */ 23 | public function fetch($templateFile,$var) { 24 | vendor("TemplateLite.class#template"); 25 | $templateFile = substr($templateFile,strlen(THEME_PATH)); 26 | $tpl = new \Template_Lite(); 27 | $tpl->template_dir = THEME_PATH; 28 | $tpl->compile_dir = CACHE_PATH ; 29 | $tpl->cache_dir = TEMP_PATH ; 30 | if(C('TMPL_ENGINE_CONFIG')) { 31 | $config = C('TMPL_ENGINE_CONFIG'); 32 | foreach ($config as $key=>$val){ 33 | $tpl->{$key} = $val; 34 | } 35 | } 36 | $tpl->assign($var); 37 | $tpl->display($templateFile); 38 | } 39 | } -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Template/Driver/Mobile.class.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | namespace Think\Template\Driver; 12 | /** 13 | * MobileTemplate模板引擎驱动 14 | */ 15 | class Mobile { 16 | /** 17 | * 渲染模板输出 18 | * @access public 19 | * @param string $templateFile 模板文件名 20 | * @param array $var 模板变量 21 | * @return void 22 | */ 23 | public function fetch($templateFile,$var) { 24 | $templateFile=substr($templateFile,strlen(THEME_PATH)); 25 | $var['_think_template_path']=$templateFile; 26 | exit(json_encode($var)); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Template/Driver/Smart.class.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | namespace Think\Template\Driver; 12 | /** 13 | * Smart模板引擎驱动 14 | */ 15 | class Smart { 16 | /** 17 | * 渲染模板输出 18 | * @access public 19 | * @param string $templateFile 模板文件名 20 | * @param array $var 模板变量 21 | * @return void 22 | */ 23 | public function fetch($templateFile,$var) { 24 | $templateFile = substr($templateFile,strlen(THEME_PATH)); 25 | vendor('SmartTemplate.class#smarttemplate'); 26 | $tpl = new \SmartTemplate($templateFile); 27 | $tpl->caching = C('TMPL_CACHE_ON'); 28 | $tpl->template_dir = THEME_PATH; 29 | $tpl->compile_dir = CACHE_PATH ; 30 | $tpl->cache_dir = TEMP_PATH ; 31 | if(C('TMPL_ENGINE_CONFIG')) { 32 | $config = C('TMPL_ENGINE_CONFIG'); 33 | foreach ($config as $key=>$val){ 34 | $tpl->{$key} = $val; 35 | } 36 | } 37 | $tpl->assign($var); 38 | $tpl->output(); 39 | } 40 | } -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Template/Driver/Smarty.class.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | namespace Think\Template\Driver; 12 | /** 13 | * Smarty模板引擎驱动 14 | */ 15 | class Smarty { 16 | 17 | /** 18 | * 渲染模板输出 19 | * @access public 20 | * @param string $templateFile 模板文件名 21 | * @param array $var 模板变量 22 | * @return void 23 | */ 24 | public function fetch($templateFile,$var) { 25 | $templateFile = substr($templateFile,strlen(THEME_PATH)); 26 | vendor('Smarty.Smarty#class'); 27 | $tpl = new \Smarty(); 28 | $tpl->caching = C('TMPL_CACHE_ON'); 29 | $tpl->template_dir = THEME_PATH; 30 | $tpl->compile_dir = CACHE_PATH ; 31 | $tpl->cache_dir = TEMP_PATH ; 32 | if(C('TMPL_ENGINE_CONFIG')) { 33 | $config = C('TMPL_ENGINE_CONFIG'); 34 | foreach ($config as $key=>$val){ 35 | $tpl->{$key} = $val; 36 | } 37 | } 38 | $tpl->assign($var); 39 | $tpl->display($templateFile); 40 | } 41 | } -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Verify/bgs/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/SimpleAdmin/28226f44d572dd29e6f8a788c974bbcb9ed98e45/php/ThinkPHP/Library/Think/Verify/bgs/1.jpg -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Verify/bgs/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/SimpleAdmin/28226f44d572dd29e6f8a788c974bbcb9ed98e45/php/ThinkPHP/Library/Think/Verify/bgs/2.jpg -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Verify/bgs/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/SimpleAdmin/28226f44d572dd29e6f8a788c974bbcb9ed98e45/php/ThinkPHP/Library/Think/Verify/bgs/3.jpg -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Verify/bgs/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/SimpleAdmin/28226f44d572dd29e6f8a788c974bbcb9ed98e45/php/ThinkPHP/Library/Think/Verify/bgs/4.jpg -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Verify/bgs/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/SimpleAdmin/28226f44d572dd29e6f8a788c974bbcb9ed98e45/php/ThinkPHP/Library/Think/Verify/bgs/5.jpg -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Verify/bgs/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/SimpleAdmin/28226f44d572dd29e6f8a788c974bbcb9ed98e45/php/ThinkPHP/Library/Think/Verify/bgs/6.jpg -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Verify/bgs/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/SimpleAdmin/28226f44d572dd29e6f8a788c974bbcb9ed98e45/php/ThinkPHP/Library/Think/Verify/bgs/7.jpg -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Verify/bgs/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/SimpleAdmin/28226f44d572dd29e6f8a788c974bbcb9ed98e45/php/ThinkPHP/Library/Think/Verify/bgs/8.jpg -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Verify/ttfs/1.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/SimpleAdmin/28226f44d572dd29e6f8a788c974bbcb9ed98e45/php/ThinkPHP/Library/Think/Verify/ttfs/1.ttf -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Verify/ttfs/2.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/SimpleAdmin/28226f44d572dd29e6f8a788c974bbcb9ed98e45/php/ThinkPHP/Library/Think/Verify/ttfs/2.ttf -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Verify/ttfs/3.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/SimpleAdmin/28226f44d572dd29e6f8a788c974bbcb9ed98e45/php/ThinkPHP/Library/Think/Verify/ttfs/3.ttf -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Verify/ttfs/4.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/SimpleAdmin/28226f44d572dd29e6f8a788c974bbcb9ed98e45/php/ThinkPHP/Library/Think/Verify/ttfs/4.ttf -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Verify/ttfs/5.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/SimpleAdmin/28226f44d572dd29e6f8a788c974bbcb9ed98e45/php/ThinkPHP/Library/Think/Verify/ttfs/5.ttf -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Think/Verify/ttfs/6.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/SimpleAdmin/28226f44d572dd29e6f8a788c974bbcb9ed98e45/php/ThinkPHP/Library/Think/Verify/ttfs/6.ttf -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Boris/CLIOptionsHandler.php: -------------------------------------------------------------------------------- 1 | $value) { 20 | switch ($option) { 21 | /* 22 | * Sets files to load at startup, may be used multiple times, 23 | * i.e: boris -r test.php,foo/bar.php -r ba/foo.php --require hey.php 24 | */ 25 | case 'r': 26 | case 'require': 27 | $this->_handleRequire($boris, $value); 28 | break; 29 | 30 | /* 31 | * Show Usage info 32 | */ 33 | case 'h': 34 | case 'help': 35 | $this->_handleUsageInfo(); 36 | break; 37 | 38 | /* 39 | * Show version 40 | */ 41 | case 'v': 42 | case 'version': 43 | $this->_handleVersion(); 44 | break; 45 | } 46 | } 47 | } 48 | 49 | // -- Private Methods 50 | 51 | private function _handleRequire($boris, $paths) { 52 | $require = array_reduce( 53 | (array) $paths, 54 | function($acc, $v) { return array_merge($acc, explode(',', $v)); }, 55 | array() 56 | ); 57 | 58 | $boris->onStart(function($worker, $scope) use($require) { 59 | foreach($require as $path) { 60 | require $path; 61 | } 62 | 63 | $worker->setLocal(get_defined_vars()); 64 | }); 65 | } 66 | 67 | private function _handleUsageInfo() { 68 | echo <<_cascade = $cascade; 38 | $this->_searchPaths = $searchPaths; 39 | } 40 | 41 | /** 42 | * Searches for configuration files in the available 43 | * search paths, and applies them to the provided 44 | * boris instance. 45 | * 46 | * Returns true if any configuration files were found. 47 | * 48 | * @param Boris\Boris $boris 49 | * @return bool 50 | */ 51 | public function apply(Boris $boris) { 52 | $applied = false; 53 | 54 | foreach($this->_searchPaths as $path) { 55 | if (is_readable($path)) { 56 | $this->_loadInIsolation($path, $boris); 57 | 58 | $applied = true; 59 | $this->_files[] = $path; 60 | 61 | if (!$this->_cascade) { 62 | break; 63 | } 64 | } 65 | } 66 | 67 | return $applied; 68 | } 69 | 70 | /** 71 | * Returns an array of files that were loaded 72 | * for this Config 73 | * 74 | * @return array 75 | */ 76 | public function loadedFiles() { 77 | return $this->_files; 78 | } 79 | 80 | // -- Private Methods 81 | 82 | private function _loadInIsolation($path, $boris) { 83 | require $path; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Boris/DumpInspector.php: -------------------------------------------------------------------------------- 1 | '1', //缓存ID 27 | 'TplType' =>'htm', //模板格式 28 | 'CacheDir' =>'cache', //缓存目录 29 | 'TemplateDir'=>'template' , //模板存放目录 30 | 'AutoImage' =>'on' , //自动解析图片目录开关 on表示开放 off表示关闭 31 | 'LangDir' =>'language' , //语言文件存放的目录 32 | 'Language' =>'default' , //语言的默认文件 33 | 'Copyright' =>'off' , //版权保护 34 | 'MemCache' =>'' , //Memcache服务器地址例如:127.0.0.1:11211 35 | ) 36 | ){ 37 | 38 | parent::ETCoreStart($set); 39 | } 40 | 41 | } 42 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Hprose/HproseClassManager.php: -------------------------------------------------------------------------------- 1 | * 20 | * * 21 | \**********************************************************/ 22 | 23 | class HproseClassManager { 24 | private static $classCache1 = array(); 25 | private static $classCache2 = array(); 26 | public static function register($class, $alias) { 27 | self::$classCache1[$alias] = $class; 28 | self::$classCache2[$class] = $alias; 29 | } 30 | public static function getClassAlias($class) { 31 | if (array_key_exists($class, self::$classCache2)) { 32 | return self::$classCache2[$class]; 33 | } 34 | $alias = str_replace('\\', '_', $class); 35 | self::register($class, $alias); 36 | return $alias; 37 | } 38 | public static function getClass($alias) { 39 | if (array_key_exists($alias, self::$classCache1)) { 40 | return self::$classCache1[$alias]; 41 | } 42 | if (!class_exists($alias)) { 43 | $class = str_replace('_', '\\', $alias); 44 | if (class_exists($class)) { 45 | self::register($class, $alias); 46 | return $class; 47 | } 48 | eval("class " . $alias . " { }"); 49 | } 50 | return $alias; 51 | } 52 | } 53 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Hprose/HproseFormatter.php: -------------------------------------------------------------------------------- 1 | * 20 | * * 21 | \**********************************************************/ 22 | 23 | require_once('HproseIOStream.php'); 24 | require_once('HproseReader.php'); 25 | require_once('HproseWriter.php'); 26 | 27 | class HproseFormatter { 28 | public static function serialize(&$var, $simple = false) { 29 | $stream = new HproseStringStream(); 30 | $hproseWriter = ($simple ? new HproseSimpleWriter($stream) : new HproseWriter($stream)); 31 | $hproseWriter->serialize($var); 32 | return $stream->toString(); 33 | } 34 | public static function &unserialize($data, $simple = false) { 35 | $stream = new HproseStringStream($data); 36 | $hproseReader = ($simple ? new HproseSimpleReader($stream) : new HproseReader($stream)); 37 | return $hproseReader->unserialize(); 38 | } 39 | } 40 | ?> 41 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Hprose/HproseIO.php: -------------------------------------------------------------------------------- 1 | * 20 | * * 21 | \**********************************************************/ 22 | 23 | require_once('HproseTags.php'); 24 | require_once('HproseClassManager.php'); 25 | require_once('HproseReader.php'); 26 | require_once('HproseWriter.php'); 27 | require_once('HproseFormatter.php'); 28 | 29 | ?> 30 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Hprose/HproseTags.php: -------------------------------------------------------------------------------- 1 | * 20 | * * 21 | \**********************************************************/ 22 | 23 | class HproseTags { 24 | /* Serialize Tags */ 25 | const TagInteger = 'i'; 26 | const TagLong = 'l'; 27 | const TagDouble = 'd'; 28 | const TagNull = 'n'; 29 | const TagEmpty = 'e'; 30 | const TagTrue = 't'; 31 | const TagFalse = 'f'; 32 | const TagNaN = 'N'; 33 | const TagInfinity = 'I'; 34 | const TagDate = 'D'; 35 | const TagTime = 'T'; 36 | const TagUTC = 'Z'; 37 | const TagBytes = 'b'; 38 | const TagUTF8Char = 'u'; 39 | const TagString = 's'; 40 | const TagGuid = 'g'; 41 | const TagList = 'a'; 42 | const TagMap = 'm'; 43 | const TagClass = 'c'; 44 | const TagObject = 'o'; 45 | const TagRef = 'r'; 46 | /* Serialize Marks */ 47 | const TagPos = '+'; 48 | const TagNeg = '-'; 49 | const TagSemicolon = ';'; 50 | const TagOpenbrace = '{'; 51 | const TagClosebrace = '}'; 52 | const TagQuote = '"'; 53 | const TagPoint = '.'; 54 | /* Protocol Tags */ 55 | const TagFunctions = 'F'; 56 | const TagCall = 'C'; 57 | const TagResult = 'R'; 58 | const TagArgument = 'A'; 59 | const TagError = 'E'; 60 | const TagEnd = 'z'; 61 | } 62 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/README.txt: -------------------------------------------------------------------------------- 1 | 第三方类库包目录 -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/function.counter.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: counter
13 | * Purpose: print out a counter value 14 | * 15 | * @author Monte Ohrt 16 | * @link http://www.smarty.net/manual/en/language.function.counter.php {counter} 17 | * (Smarty online manual) 18 | * @param array $params parameters 19 | * @param Smarty_Internal_Template $template template object 20 | * @return string|null 21 | */ 22 | function smarty_function_counter($params, $template) 23 | { 24 | static $counters = array(); 25 | 26 | $name = (isset($params['name'])) ? $params['name'] : 'default'; 27 | if (!isset($counters[$name])) { 28 | $counters[$name] = array( 29 | 'start'=>1, 30 | 'skip'=>1, 31 | 'direction'=>'up', 32 | 'count'=>1 33 | ); 34 | } 35 | $counter =& $counters[$name]; 36 | 37 | if (isset($params['start'])) { 38 | $counter['start'] = $counter['count'] = (int)$params['start']; 39 | } 40 | 41 | if (!empty($params['assign'])) { 42 | $counter['assign'] = $params['assign']; 43 | } 44 | 45 | if (isset($counter['assign'])) { 46 | $template->assign($counter['assign'], $counter['count']); 47 | } 48 | 49 | if (isset($params['print'])) { 50 | $print = (bool)$params['print']; 51 | } else { 52 | $print = empty($counter['assign']); 53 | } 54 | 55 | if ($print) { 56 | $retval = $counter['count']; 57 | } else { 58 | $retval = null; 59 | } 60 | 61 | if (isset($params['skip'])) { 62 | $counter['skip'] = $params['skip']; 63 | } 64 | 65 | if (isset($params['direction'])) { 66 | $counter['direction'] = $params['direction']; 67 | } 68 | 69 | if ($counter['direction'] == "down") 70 | $counter['count'] -= $counter['skip']; 71 | else 72 | $counter['count'] += $counter['skip']; 73 | 74 | return $retval; 75 | 76 | } 77 | 78 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/modifier.date_format.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: date_format
14 | * Purpose: format datestamps via strftime
15 | * Input:
16 | * - string: input date string 17 | * - format: strftime format for output 18 | * - default_date: default date if $string is empty 19 | * 20 | * @link http://www.smarty.net/manual/en/language.modifier.date.format.php date_format (Smarty online manual) 21 | * @author Monte Ohrt 22 | * @param string $string input date string 23 | * @param string $format strftime format for output 24 | * @param string $default_date default date if $string is empty 25 | * @param string $formatter either 'strftime' or 'auto' 26 | * @return string |void 27 | * @uses smarty_make_timestamp() 28 | */ 29 | function smarty_modifier_date_format($string, $format = SMARTY_RESOURCE_DATE_FORMAT, $default_date = '',$formatter='auto') 30 | { 31 | /** 32 | * Include the {@link shared.make_timestamp.php} plugin 33 | */ 34 | require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php'); 35 | if ($string != '') { 36 | $timestamp = smarty_make_timestamp($string); 37 | } elseif ($default_date != '') { 38 | $timestamp = smarty_make_timestamp($default_date); 39 | } else { 40 | return; 41 | } 42 | if($formatter=='strftime'||($formatter=='auto'&&strpos($format,'%')!==false)) { 43 | if (DS == '\\') { 44 | $_win_from = array('%D', '%h', '%n', '%r', '%R', '%t', '%T'); 45 | $_win_to = array('%m/%d/%y', '%b', "\n", '%I:%M:%S %p', '%H:%M', "\t", '%H:%M:%S'); 46 | if (strpos($format, '%e') !== false) { 47 | $_win_from[] = '%e'; 48 | $_win_to[] = sprintf('%\' 2d', date('j', $timestamp)); 49 | } 50 | if (strpos($format, '%l') !== false) { 51 | $_win_from[] = '%l'; 52 | $_win_to[] = sprintf('%\' 2d', date('h', $timestamp)); 53 | } 54 | $format = str_replace($_win_from, $_win_to, $format); 55 | } 56 | return strftime($format, $timestamp); 57 | } else { 58 | return date($format, $timestamp); 59 | } 60 | } 61 | 62 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/modifier.regex_replace.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: regex_replace
14 | * Purpose: regular expression search/replace 15 | * 16 | * @link http://smarty.php.net/manual/en/language.modifier.regex.replace.php 17 | * regex_replace (Smarty online manual) 18 | * @author Monte Ohrt 19 | * @param string $string input string 20 | * @param string|array $search regular expression(s) to search for 21 | * @param string|array $replace string(s) that should be replaced 22 | * @return string 23 | */ 24 | function smarty_modifier_regex_replace($string, $search, $replace) 25 | { 26 | if(is_array($search)) { 27 | foreach($search as $idx => $s) { 28 | $search[$idx] = _smarty_regex_replace_check($s); 29 | } 30 | } else { 31 | $search = _smarty_regex_replace_check($search); 32 | } 33 | return preg_replace($search, $replace, $string); 34 | } 35 | 36 | /** 37 | * @param string $search string(s) that should be replaced 38 | * @return string 39 | * @ignore 40 | */ 41 | function _smarty_regex_replace_check($search) 42 | { 43 | // null-byte injection detection 44 | // anything behind the first null-byte is ignored 45 | if (($pos = strpos($search,"\0")) !== false) { 46 | $search = substr($search,0,$pos); 47 | } 48 | // remove eval-modifier from $search 49 | if (preg_match('!([a-zA-Z\s]+)$!s', $search, $match) && (strpos($match[1], 'e') !== false)) { 50 | $search = substr($search, 0, -strlen($match[1])) . preg_replace('![e\s]+!', '', $match[1]); 51 | } 52 | return $search; 53 | } 54 | 55 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/modifier.replace.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: replace
13 | * Purpose: simple search/replace 14 | * 15 | * @link http://smarty.php.net/manual/en/language.modifier.replace.php replace (Smarty online manual) 16 | * @author Monte Ohrt 17 | * @author Uwe Tews 18 | * @param string $string input string 19 | * @param string $search text to search for 20 | * @param string $replace replacement text 21 | * @return string 22 | */ 23 | function smarty_modifier_replace($string, $search, $replace) 24 | { 25 | if (SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 26 | require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php'); 27 | return smarty_mb_str_replace($search, $replace, $string); 28 | } 29 | 30 | return str_replace($search, $replace, $string); 31 | } 32 | 33 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/modifier.spacify.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: spacify
13 | * Purpose: add spaces between characters in a string 14 | * 15 | * @link http://smarty.php.net/manual/en/language.modifier.spacify.php spacify (Smarty online manual) 16 | * @author Monte Ohrt 17 | * @param string $string input string 18 | * @param string $spacify_char string to insert between characters. 19 | * @return string 20 | */ 21 | function smarty_modifier_spacify($string, $spacify_char = ' ') 22 | { 23 | // well… what about charsets besides latin and UTF-8? 24 | return implode($spacify_char, preg_split('//u', $string, -1, PREG_SPLIT_NO_EMPTY)); 25 | } 26 | 27 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/modifier.truncate.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: truncate
14 | * Purpose: Truncate a string to a certain length if necessary, 15 | * optionally splitting in the middle of a word, and 16 | * appending the $etc string or inserting $etc into the middle. 17 | * 18 | * @link http://smarty.php.net/manual/en/language.modifier.truncate.php truncate (Smarty online manual) 19 | * @author Monte Ohrt 20 | * @param string $string input string 21 | * @param integer $length length of truncated text 22 | * @param string $etc end string 23 | * @param boolean $break_words truncate at word boundary 24 | * @param boolean $middle truncate in the middle of text 25 | * @return string truncated string 26 | */ 27 | function smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_words = false, $middle = false) { 28 | if ($length == 0) 29 | return ''; 30 | 31 | if (SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 32 | if (mb_strlen($string, SMARTY_RESOURCE_CHAR_SET) > $length) { 33 | $length -= min($length, mb_strlen($etc, SMARTY_RESOURCE_CHAR_SET)); 34 | if (!$break_words && !$middle) { 35 | $string = preg_replace('/\s+?(\S+)?$/u', '', mb_substr($string, 0, $length + 1, SMARTY_RESOURCE_CHAR_SET)); 36 | } 37 | if (!$middle) { 38 | return mb_substr($string, 0, $length, SMARTY_RESOURCE_CHAR_SET) . $etc; 39 | } 40 | return mb_substr($string, 0, $length / 2, SMARTY_RESOURCE_CHAR_SET) . $etc . mb_substr($string, - $length / 2, $length, SMARTY_RESOURCE_CHAR_SET); 41 | } 42 | return $string; 43 | } 44 | 45 | // no MBString fallback 46 | if (isset($string[$length])) { 47 | $length -= min($length, strlen($etc)); 48 | if (!$break_words && !$middle) { 49 | $string = preg_replace('/\s+?(\S+)?$/', '', substr($string, 0, $length + 1)); 50 | } 51 | if (!$middle) { 52 | return substr($string, 0, $length) . $etc; 53 | } 54 | return substr($string, 0, $length / 2) . $etc . substr($string, - $length / 2); 55 | } 56 | return $string; 57 | } 58 | 59 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/modifiercompiler.cat.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: cat
14 | * Date: Feb 24, 2003
15 | * Purpose: catenate a value to a variable
16 | * Input: string to catenate
17 | * Example: {$var|cat:"foo"} 18 | * 19 | * @link http://smarty.php.net/manual/en/language.modifier.cat.php cat 20 | * (Smarty online manual) 21 | * @author Uwe Tews 22 | * @param array $params parameters 23 | * @return string with compiled code 24 | */ 25 | function smarty_modifiercompiler_cat($params, $compiler) 26 | { 27 | return '('.implode(').(', $params).')'; 28 | } 29 | 30 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/modifiercompiler.count_characters.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: count_characteres
14 | * Purpose: count the number of characters in a text 15 | * 16 | * @link http://www.smarty.net/manual/en/language.modifier.count.characters.php count_characters (Smarty online manual) 17 | * @author Uwe Tews 18 | * @param array $params parameters 19 | * @return string with compiled code 20 | */ 21 | function smarty_modifiercompiler_count_characters($params, $compiler) 22 | { 23 | if (!isset($params[1]) || $params[1] != 'true') { 24 | return 'preg_match_all(\'/[^\s]/u\',' . $params[0] . ', $tmp)'; 25 | } 26 | if (SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 27 | return 'mb_strlen(' . $params[0] . ', SMARTY_RESOURCE_CHAR_SET)'; 28 | } 29 | // no MBString fallback 30 | return 'strlen(' . $params[0] . ')'; 31 | } 32 | 33 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/modifiercompiler.count_paragraphs.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: count_paragraphs
14 | * Purpose: count the number of paragraphs in a text 15 | * 16 | * @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php 17 | * count_paragraphs (Smarty online manual) 18 | * @author Uwe Tews 19 | * @param array $params parameters 20 | * @return string with compiled code 21 | */ 22 | function smarty_modifiercompiler_count_paragraphs($params, $compiler) 23 | { 24 | // count \r or \n characters 25 | return '(preg_match_all(\'#[\r\n]+#\', ' . $params[0] . ', $tmp)+1)'; 26 | } 27 | 28 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/modifiercompiler.count_sentences.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: count_sentences 14 | * Purpose: count the number of sentences in a text 15 | * 16 | * @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php 17 | * count_sentences (Smarty online manual) 18 | * @author Uwe Tews 19 | * @param array $params parameters 20 | * @return string with compiled code 21 | */ 22 | function smarty_modifiercompiler_count_sentences($params, $compiler) 23 | { 24 | // find periods, question marks, exclamation marks with a word before but not after. 25 | return 'preg_match_all("#\w[\.\?\!](\W|$)#uS", ' . $params[0] . ', $tmp)'; 26 | } 27 | 28 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/modifiercompiler.count_words.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: count_words
14 | * Purpose: count the number of words in a text 15 | * 16 | * @link http://www.smarty.net/manual/en/language.modifier.count.words.php count_words (Smarty online manual) 17 | * @author Uwe Tews 18 | * @param array $params parameters 19 | * @return string with compiled code 20 | */ 21 | function smarty_modifiercompiler_count_words($params, $compiler) 22 | { 23 | if (SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 24 | // return 'preg_match_all(\'#[\w\pL]+#u\', ' . $params[0] . ', $tmp)'; 25 | // expression taken from http://de.php.net/manual/en/function.str-word-count.php#85592 26 | return 'preg_match_all(\'/\p{L}[\p{L}\p{Mn}\p{Pd}\\\'\x{2019}]*/u\', ' . $params[0] . ', $tmp)'; 27 | } 28 | // no MBString fallback 29 | return 'str_word_count(' . $params[0] . ')'; 30 | } 31 | 32 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/modifiercompiler.default.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: default
14 | * Purpose: designate default value for empty variables 15 | * 16 | * @link http://www.smarty.net/manual/en/language.modifier.default.php default (Smarty online manual) 17 | * @author Uwe Tews 18 | * @param array $params parameters 19 | * @return string with compiled code 20 | */ 21 | function smarty_modifiercompiler_default ($params, $compiler) 22 | { 23 | $output = $params[0]; 24 | if (!isset($params[1])) { 25 | $params[1] = "''"; 26 | } 27 | 28 | array_shift($params); 29 | foreach ($params as $param) { 30 | $output = '(($tmp = @' . $output . ')===null||$tmp===\'\' ? ' . $param . ' : $tmp)'; 31 | } 32 | return $output; 33 | } 34 | 35 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/modifiercompiler.from_charset.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: from_charset
14 | * Purpose: convert character encoding from $charset to internal encoding 15 | * 16 | * @author Rodney Rehm 17 | * @param array $params parameters 18 | * @return string with compiled code 19 | */ 20 | function smarty_modifiercompiler_from_charset($params, $compiler) 21 | { 22 | if (!SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 23 | // FIXME: (rodneyrehm) shouldn't this throw an error? 24 | return $params[0]; 25 | } 26 | 27 | if (!isset($params[1])) { 28 | $params[1] = '"ISO-8859-1"'; 29 | } 30 | 31 | return 'mb_convert_encoding(' . $params[0] . ', SMARTY_RESOURCE_CHAR_SET, ' . $params[1] . ')'; 32 | } 33 | 34 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/modifiercompiler.indent.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: indent
13 | * Purpose: indent lines of text 14 | * 15 | * @link http://www.smarty.net/manual/en/language.modifier.indent.php indent (Smarty online manual) 16 | * @author Uwe Tews 17 | * @param array $params parameters 18 | * @return string with compiled code 19 | */ 20 | 21 | function smarty_modifiercompiler_indent($params, $compiler) 22 | { 23 | if (!isset($params[1])) { 24 | $params[1] = 4; 25 | } 26 | if (!isset($params[2])) { 27 | $params[2] = "' '"; 28 | } 29 | return 'preg_replace(\'!^!m\',str_repeat(' . $params[2] . ',' . $params[1] . '),' . $params[0] . ')'; 30 | } 31 | 32 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/modifiercompiler.lower.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: lower
13 | * Purpose: convert string to lowercase 14 | * 15 | * @link http://www.smarty.net/manual/en/language.modifier.lower.php lower (Smarty online manual) 16 | * @author Monte Ohrt 17 | * @author Uwe Tews 18 | * @param array $params parameters 19 | * @return string with compiled code 20 | */ 21 | 22 | function smarty_modifiercompiler_lower($params, $compiler) 23 | { 24 | if (SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 25 | return 'mb_strtolower(' . $params[0] . ',SMARTY_RESOURCE_CHAR_SET)' ; 26 | } 27 | // no MBString fallback 28 | return 'strtolower(' . $params[0] . ')'; 29 | } 30 | 31 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/modifiercompiler.noprint.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: noprint
14 | * Purpose: return an empty string 15 | * 16 | * @author Uwe Tews 17 | * @param array $params parameters 18 | * @return string with compiled code 19 | */ 20 | function smarty_modifiercompiler_noprint($params, $compiler) 21 | { 22 | return "''"; 23 | } 24 | 25 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/modifiercompiler.string_format.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: string_format
14 | * Purpose: format strings via sprintf 15 | * 16 | * @link http://www.smarty.net/manual/en/language.modifier.string.format.php string_format (Smarty online manual) 17 | * @author Uwe Tews 18 | * @param array $params parameters 19 | * @return string with compiled code 20 | */ 21 | function smarty_modifiercompiler_string_format($params, $compiler) 22 | { 23 | return 'sprintf(' . $params[1] . ',' . $params[0] . ')'; 24 | } 25 | 26 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/modifiercompiler.strip.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: strip
14 | * Purpose: Replace all repeated spaces, newlines, tabs 15 | * with a single space or supplied replacement string.
16 | * Example: {$var|strip} {$var|strip:" "}
17 | * Date: September 25th, 2002 18 | * 19 | * @link http://www.smarty.net/manual/en/language.modifier.strip.php strip (Smarty online manual) 20 | * @author Uwe Tews 21 | * @param array $params parameters 22 | * @return string with compiled code 23 | */ 24 | 25 | function smarty_modifiercompiler_strip($params, $compiler) 26 | { 27 | if (!isset($params[1])) { 28 | $params[1] = "' '"; 29 | } 30 | return "preg_replace('!\s+!u', {$params[1]},{$params[0]})"; 31 | } 32 | 33 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/modifiercompiler.strip_tags.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: strip_tags
14 | * Purpose: strip html tags from text 15 | * 16 | * @link http://www.smarty.net/manual/en/language.modifier.strip.tags.php strip_tags (Smarty online manual) 17 | * @author Uwe Tews 18 | * @param array $params parameters 19 | * @return string with compiled code 20 | */ 21 | function smarty_modifiercompiler_strip_tags($params, $compiler) 22 | { 23 | if (!isset($params[1])) { 24 | $params[1] = true; 25 | } 26 | if ($params[1] === true) { 27 | return "preg_replace('!<[^>]*?>!', ' ', {$params[0]})"; 28 | } else { 29 | return 'strip_tags(' . $params[0] . ')'; 30 | } 31 | } 32 | 33 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/modifiercompiler.to_charset.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: to_charset
14 | * Purpose: convert character encoding from internal encoding to $charset 15 | * 16 | * @author Rodney Rehm 17 | * @param array $params parameters 18 | * @return string with compiled code 19 | */ 20 | function smarty_modifiercompiler_to_charset($params, $compiler) 21 | { 22 | if (!SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 23 | // FIXME: (rodneyrehm) shouldn't this throw an error? 24 | return $params[0]; 25 | } 26 | 27 | if (!isset($params[1])) { 28 | $params[1] = '"ISO-8859-1"'; 29 | } 30 | 31 | return 'mb_convert_encoding(' . $params[0] . ', ' . $params[1] . ', SMARTY_RESOURCE_CHAR_SET)'; 32 | } 33 | 34 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/modifiercompiler.unescape.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: unescape
14 | * Purpose: unescape html entities 15 | * 16 | * @author Rodney Rehm 17 | * @param array $params parameters 18 | * @return string with compiled code 19 | */ 20 | function smarty_modifiercompiler_unescape($params, $compiler) 21 | { 22 | if (!isset($params[1])) { 23 | $params[1] = 'html'; 24 | } 25 | if (!isset($params[2])) { 26 | $params[2] = "SMARTY_RESOURCE_CHAR_SET"; 27 | } else { 28 | $params[2] = "'" . $params[2] . "'"; 29 | } 30 | 31 | switch (trim($params[1], '"\'')) { 32 | case 'entity': 33 | return 'mb_convert_encoding(' . $params[0] . ', ' . $params[2] . ', \'HTML-ENTITIES\')'; 34 | case 'htmlall': 35 | if (SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 36 | return 'mb_convert_encoding(' . $params[0] . ', ' . $params[2] . ', \'HTML-ENTITIES\')'; 37 | } 38 | return 'html_entity_decode(' . $params[0] . ', ENT_QUOTES, ' . $params[2] . ')'; 39 | 40 | case 'html': 41 | return 'htmlspecialchars_decode(' . $params[0] . ', ENT_QUOTES)'; 42 | 43 | default: 44 | return $params[0]; 45 | } 46 | } 47 | 48 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/modifiercompiler.upper.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: lower
14 | * Purpose: convert string to uppercase 15 | * 16 | * @link http://smarty.php.net/manual/en/language.modifier.upper.php lower (Smarty online manual) 17 | * @author Uwe Tews 18 | * @param array $params parameters 19 | * @return string with compiled code 20 | */ 21 | function smarty_modifiercompiler_upper($params, $compiler) 22 | { 23 | if (SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 24 | return 'mb_strtoupper(' . $params[0] . ',SMARTY_RESOURCE_CHAR_SET)' ; 25 | } 26 | // no MBString fallback 27 | return 'strtoupper(' . $params[0] . ')'; 28 | } 29 | 30 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/modifiercompiler.wordwrap.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: wordwrap
14 | * Purpose: wrap a string of text at a given length 15 | * 16 | * @link http://smarty.php.net/manual/en/language.modifier.wordwrap.php wordwrap (Smarty online manual) 17 | * @author Uwe Tews 18 | * @param array $params parameters 19 | * @return string with compiled code 20 | */ 21 | function smarty_modifiercompiler_wordwrap($params, $compiler) 22 | { 23 | if (!isset($params[1])) { 24 | $params[1] = 80; 25 | } 26 | if (!isset($params[2])) { 27 | $params[2] = '"\n"'; 28 | } 29 | if (!isset($params[3])) { 30 | $params[3] = 'false'; 31 | } 32 | $function = 'wordwrap'; 33 | if (SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 34 | if ($compiler->tag_nocache | $compiler->nocache) { 35 | $compiler->template->required_plugins['nocache']['wordwrap']['modifier']['file'] = SMARTY_PLUGINS_DIR .'shared.mb_wordwrap.php'; 36 | $compiler->template->required_plugins['nocache']['wordwrap']['modifier']['function'] = 'smarty_mb_wordwrap'; 37 | } else { 38 | $compiler->template->required_plugins['compiled']['wordwrap']['modifier']['file'] = SMARTY_PLUGINS_DIR .'shared.mb_wordwrap.php'; 39 | $compiler->template->required_plugins['compiled']['wordwrap']['modifier']['function'] = 'smarty_mb_wordwrap'; 40 | } 41 | $function = 'smarty_mb_wordwrap'; 42 | } 43 | return $function . '(' . $params[0] . ',' . $params[1] . ',' . $params[2] . ',' . $params[3] . ')'; 44 | } 45 | 46 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/shared.escape_special_chars.php: -------------------------------------------------------------------------------- 1 | =')) { 10 | /** 11 | * escape_special_chars common function 12 | * 13 | * Function: smarty_function_escape_special_chars
14 | * Purpose: used by other smarty functions to escape 15 | * special chars except for already escaped ones 16 | * 17 | * @author Monte Ohrt 18 | * @param string $string text that should by escaped 19 | * @return string 20 | */ 21 | function smarty_function_escape_special_chars($string) 22 | { 23 | if (!is_array($string)) { 24 | $string = htmlspecialchars($string, ENT_COMPAT, SMARTY_RESOURCE_CHAR_SET, false); 25 | } 26 | return $string; 27 | } 28 | } else { 29 | /** 30 | * escape_special_chars common function 31 | * 32 | * Function: smarty_function_escape_special_chars
33 | * Purpose: used by other smarty functions to escape 34 | * special chars except for already escaped ones 35 | * 36 | * @author Monte Ohrt 37 | * @param string $string text that should by escaped 38 | * @return string 39 | */ 40 | function smarty_function_escape_special_chars($string) 41 | { 42 | if (!is_array($string)) { 43 | $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string); 44 | $string = htmlspecialchars($string); 45 | $string = str_replace(array('%%%SMARTY_START%%%', '%%%SMARTY_END%%%'), array('&', ';'), $string); 46 | } 47 | return $string; 48 | } 49 | } 50 | 51 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/shared.literal_compiler_param.php: -------------------------------------------------------------------------------- 1 | 11 | * Purpose: used by other smarty functions to make a timestamp from a string. 12 | * 13 | * @author Monte Ohrt 14 | * @param DateTime|int|string $string date object, timestamp or string that can be converted using strtotime() 15 | * @return int 16 | */ 17 | function smarty_make_timestamp($string) 18 | { 19 | if (empty($string)) { 20 | // use "now": 21 | return time(); 22 | } elseif ($string instanceof DateTime) { 23 | return $string->getTimestamp(); 24 | } elseif (strlen($string) == 14 && ctype_digit($string)) { 25 | // it is mysql timestamp format of YYYYMMDDHHMMSS? 26 | return mktime(substr($string, 8, 2),substr($string, 10, 2),substr($string, 12, 2), 27 | substr($string, 4, 2),substr($string, 6, 2),substr($string, 0, 4)); 28 | } elseif (is_numeric($string)) { 29 | // it is a numeric string, we handle it as timestamp 30 | return (int) $string; 31 | } else { 32 | // strtotime should handle it 33 | $time = strtotime($string); 34 | if ($time == -1 || $time === false) { 35 | // strtotime() was not able to parse $string, use "now": 36 | return time(); 37 | } 38 | return $time; 39 | } 40 | } 41 | 42 | ?> 43 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/shared.mb_str_replace.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/shared.mb_unicode.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/plugins/variablefilter.htmlspecialchars.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_compile_append.php: -------------------------------------------------------------------------------- 1 | required_attributes = array('var', 'value'); 32 | $this->shorttag_order = array('var', 'value'); 33 | $this->optional_attributes = array('scope', 'index'); 34 | // check and get attributes 35 | $_attr = $this->getAttributes($compiler, $args); 36 | // map to compile assign attributes 37 | if (isset($_attr['index'])) { 38 | $_params['smarty_internal_index'] = '[' . $_attr['index'] . ']'; 39 | unset($_attr['index']); 40 | } else { 41 | $_params['smarty_internal_index'] = '[]'; 42 | } 43 | $_new_attr = array(); 44 | foreach ($_attr as $key => $value) { 45 | $_new_attr[] = array($key => $value); 46 | } 47 | // call compile assign 48 | return parent::compile($_new_attr, $compiler, $_params); 49 | } 50 | 51 | } 52 | 53 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_compile_debug.php: -------------------------------------------------------------------------------- 1 | getAttributes($compiler, $args); 32 | 33 | // compile always as nocache 34 | $compiler->tag_nocache = true; 35 | 36 | // display debug template 37 | $_output = "smarty->loadPlugin('Smarty_Internal_Debug'); Smarty_Internal_Debug::display_debug(\$_smarty_tpl); ?>"; 38 | return $_output; 39 | } 40 | 41 | } 42 | 43 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_compile_eval.php: -------------------------------------------------------------------------------- 1 | required_attributes = array('var'); 52 | $this->optional_attributes = array('assign'); 53 | // check and get attributes 54 | $_attr = $this->getAttributes($compiler, $args); 55 | if (isset($_attr['assign'])) { 56 | // output will be stored in a smarty variable instead of beind displayed 57 | $_assign = $_attr['assign']; 58 | } 59 | 60 | // create template object 61 | $_output = "\$_template = new {$compiler->smarty->template_class}('eval:'.".$_attr['var'].", \$_smarty_tpl->smarty, \$_smarty_tpl);"; 62 | //was there an assign attribute? 63 | if (isset($_assign)) { 64 | $_output .= "\$_smarty_tpl->assign($_assign,\$_template->fetch());"; 65 | } else { 66 | $_output .= "echo \$_template->fetch();"; 67 | } 68 | return ""; 69 | } 70 | 71 | } 72 | 73 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_compile_ldelim.php: -------------------------------------------------------------------------------- 1 | getAttributes($compiler, $args); 31 | if ($_attr['nocache'] === true) { 32 | $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno); 33 | } 34 | // this tag does not return compiled code 35 | $compiler->has_code = true; 36 | return $compiler->smarty->left_delimiter; 37 | } 38 | 39 | } 40 | 41 | ?> 42 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_compile_nocache.php: -------------------------------------------------------------------------------- 1 | getAttributes($compiler, $args); 32 | if ($_attr['nocache'] === true) { 33 | $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno); 34 | } 35 | // enter nocache mode 36 | $compiler->nocache = true; 37 | // this tag does not return compiled code 38 | $compiler->has_code = false; 39 | return true; 40 | } 41 | 42 | } 43 | 44 | /** 45 | * Smarty Internal Plugin Compile Nocacheclose Class 46 | * 47 | * @package Smarty 48 | * @subpackage Compiler 49 | */ 50 | class Smarty_Internal_Compile_Nocacheclose extends Smarty_Internal_CompileBase { 51 | 52 | /** 53 | * Compiles code for the {/nocache} tag 54 | * 55 | * This tag does not generate compiled output. It only sets a compiler flag. 56 | * 57 | * @param array $args array with attributes from parser 58 | * @param object $compiler compiler object 59 | * @return bool 60 | */ 61 | public function compile($args, $compiler) 62 | { 63 | $_attr = $this->getAttributes($compiler, $args); 64 | // leave nocache mode 65 | $compiler->nocache = false; 66 | // this tag does not return compiled code 67 | $compiler->has_code = false; 68 | return true; 69 | } 70 | 71 | } 72 | 73 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_compile_private_function_plugin.php: -------------------------------------------------------------------------------- 1 | has_output = true; 49 | 50 | // check and get attributes 51 | $_attr = $this->getAttributes($compiler, $args); 52 | if ($_attr['nocache'] === true) { 53 | $compiler->tag_nocache = true; 54 | } 55 | unset($_attr['nocache']); 56 | // convert attributes into parameter array string 57 | $_paramsArray = array(); 58 | foreach ($_attr as $_key => $_value) { 59 | if (is_int($_key)) { 60 | $_paramsArray[] = "$_key=>$_value"; 61 | } else { 62 | $_paramsArray[] = "'$_key'=>$_value"; 63 | } 64 | } 65 | $_params = 'array(' . implode(",", $_paramsArray) . ')'; 66 | // compile code 67 | $output = "\n"; 68 | return $output; 69 | } 70 | 71 | } 72 | 73 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_compile_rdelim.php: -------------------------------------------------------------------------------- 1 | getAttributes($compiler, $args); 31 | if ($_attr['nocache'] === true) { 32 | $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno); 33 | } 34 | // this tag does not return compiled code 35 | $compiler->has_code = true; 36 | return $compiler->smarty->right_delimiter; 37 | } 38 | 39 | } 40 | 41 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_compile_setfilter.php: -------------------------------------------------------------------------------- 1 | variable_filter_stack[] = $compiler->template->variable_filters; 31 | $compiler->template->variable_filters = $parameter['modifier_list']; 32 | // this tag does not return compiled code 33 | $compiler->has_code = false; 34 | return true; 35 | } 36 | 37 | } 38 | 39 | /** 40 | * Smarty Internal Plugin Compile Setfilterclose Class 41 | * 42 | * @package Smarty 43 | * @subpackage Compiler 44 | */ 45 | class Smarty_Internal_Compile_Setfilterclose extends Smarty_Internal_CompileBase { 46 | 47 | /** 48 | * Compiles code for the {/setfilter} tag 49 | * 50 | * This tag does not generate compiled output. It resets variable filter. 51 | * 52 | * @param array $args array with attributes from parser 53 | * @param object $compiler compiler object 54 | * @return string compiled code 55 | */ 56 | public function compile($args, $compiler) 57 | { 58 | $_attr = $this->getAttributes($compiler, $args); 59 | // reset variable filter to previous state 60 | if (count($compiler->variable_filter_stack)) { 61 | $compiler->template->variable_filters = array_pop($compiler->variable_filter_stack); 62 | } else { 63 | $compiler->template->variable_filters = array(); 64 | } 65 | // this tag does not return compiled code 66 | $compiler->has_code = false; 67 | return true; 68 | } 69 | 70 | } 71 | 72 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_get_include_path.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_nocache_insert.php: -------------------------------------------------------------------------------- 1 | assign('{$_assign}' , {$_function} (" . var_export($_attr, true) . ",\$_smarty_tpl), true);?>"; 41 | } else { 42 | $_output .= "echo {$_function}(" . var_export($_attr, true) . ",\$_smarty_tpl);?>"; 43 | } 44 | $_tpl = $_template; 45 | while ($_tpl->parent instanceof Smarty_Internal_Template) { 46 | $_tpl = $_tpl->parent; 47 | } 48 | return "/*%%SmartyNocache:{$_tpl->properties['nocache_hash']}%%*/" . $_output . "/*/%%SmartyNocache:{$_tpl->properties['nocache_hash']}%%*/"; 49 | } 50 | 51 | } 52 | 53 | ?> 54 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_write_file.php: -------------------------------------------------------------------------------- 1 | _file_perms !== null) { 31 | $old_umask = umask(0); 32 | } 33 | 34 | $_dirpath = dirname($_filepath); 35 | // if subdirs, create dir structure 36 | if ($_dirpath !== '.' && !file_exists($_dirpath)) { 37 | mkdir($_dirpath, $smarty->_dir_perms === null ? 0777 : $smarty->_dir_perms, true); 38 | } 39 | 40 | // write to tmp file, then move to overt file lock race condition 41 | $_tmp_file = $_dirpath . DS . uniqid('wrt'); 42 | if (!file_put_contents($_tmp_file, $_contents)) { 43 | error_reporting($_error_reporting); 44 | throw new SmartyException("unable to write file {$_tmp_file}"); 45 | return false; 46 | } 47 | 48 | // remove original file 49 | @unlink($_filepath); 50 | 51 | // rename tmp file 52 | $success = rename($_tmp_file, $_filepath); 53 | if (!$success) { 54 | error_reporting($_error_reporting); 55 | throw new SmartyException("unable to write file {$_filepath}"); 56 | return false; 57 | } 58 | 59 | if ($smarty->_file_perms !== null) { 60 | // set file permissions 61 | chmod($_filepath, $smarty->_file_perms); 62 | umask($old_umask); 63 | } 64 | error_reporting($_error_reporting); 65 | return true; 66 | } 67 | 68 | } 69 | 70 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_resource_recompiled.php: -------------------------------------------------------------------------------- 1 | filepath = false; 30 | $compiled->timestamp = false; 31 | $compiled->exists = false; 32 | } 33 | 34 | } 35 | 36 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_resource_uncompiled.php: -------------------------------------------------------------------------------- 1 | filepath = false; 38 | $compiled->timestamp = false; 39 | $compiled->exists = false; 40 | } 41 | 42 | } 43 | 44 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.compile_config.php: -------------------------------------------------------------------------------- 1 | _var_bracket_regexp . ')|\.\$?\w+|\S+!', $variable, $_match); 18 | $variable = $_match[0]; 19 | $var_name = array_shift($variable); 20 | 21 | $_result = "\$this->_confs['$var_name']"; 22 | foreach ($variable as $var) 23 | { 24 | if ($var{0} == '[') 25 | { 26 | $var = substr($var, 1, -1); 27 | if (is_numeric($var)) 28 | { 29 | $_result .= "[$var]"; 30 | } 31 | elseif ($var{0} == '$') 32 | { 33 | $_result .= "[" . $object->_compile_variable($var) . "]"; 34 | } 35 | elseif ($var{0} == '#') 36 | { 37 | $_result .= "[" . $object->_compile_config($var) . "]"; 38 | } 39 | else 40 | { 41 | $_result .= "['$var']"; 42 | } 43 | } 44 | else if ($var{0} == '.') 45 | { 46 | if ($var{1} == '$') 47 | { 48 | $_result .= "[\$this->_TPL['" . substr($var, 2) . "']]"; 49 | } 50 | else 51 | { 52 | $_result .= "['" . substr($var, 1) . "']"; 53 | } 54 | } 55 | else if (substr($var,0,2) == '->') 56 | { 57 | if(substr($var,2,2) == '__') 58 | { 59 | $object->trigger_error('call to internal object members is not allowed', E_USER_ERROR, __FILE__, __LINE__); 60 | } 61 | else if (substr($var, 2, 1) == '$') 62 | { 63 | $_output .= '->{(($var=$this->_TPL[\''.substr($var,3).'\']) && substr($var,0,2)!=\'__\') ? $_var : $this->trigger_error("cannot access property \\"$var\\"")}'; 64 | } 65 | } 66 | else 67 | { 68 | $object->trigger_error('#' . $var_name.implode('', $variable) . '# is an invalid reference', E_USER_ERROR, __FILE__, __LINE__); 69 | } 70 | } 71 | return $_result; 72 | } 73 | 74 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.compile_custom_block.php: -------------------------------------------------------------------------------- 1 | _plugin_exists($function, "block")) 22 | { 23 | if ($start_tag) 24 | { 25 | $_args = $object->_parse_arguments($arguments); 26 | foreach($_args as $key => $value) 27 | { 28 | if (is_bool($value)) 29 | { 30 | $value = $value ? 'true' : 'false'; 31 | } 32 | if (is_null($value)) 33 | { 34 | $value = 'null'; 35 | } 36 | $_args[$key] = "'$key' => $value"; 37 | } 38 | $_result = "_tag_stack[] = array('$function', array(".implode(',', (array)$_args).")); "; 39 | $_result .= $function . '(array(' . implode(',', (array)$_args) .'), null, $this); '; 40 | $_result .= 'ob_start(); ?>'; 41 | } 42 | else 43 | { 44 | $_result .= '_block_content = ob_get_contents(); ob_end_clean(); '; 45 | $_result .= '$this->_block_content = ' . $function . '($this->_tag_stack[count($this->_tag_stack) - 1][1], $this->_block_content, $this); '; 46 | if (!empty($modifiers)) 47 | { 48 | $_result .= '$this->_block_content = ' . $object->_parse_modifier('$this->_block_content', $modifiers) . '; '; 49 | } 50 | $_result .= 'echo $this->_block_content; array_pop($this->_tag_stack); ?>'; 51 | } 52 | return true; 53 | } 54 | else 55 | { 56 | return false; 57 | } 58 | } 59 | 60 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.compile_custom_function.php: -------------------------------------------------------------------------------- 1 | _plugin_exists($function, "function")) 12 | { 13 | $_args = $object->_parse_arguments($arguments); 14 | foreach($_args as $key => $value) 15 | { 16 | if (is_bool($value)) 17 | { 18 | $value = $value ? 'true' : 'false'; 19 | } 20 | if (is_null($value)) 21 | { 22 | $value = 'null'; 23 | } 24 | $_args[$key] = "'$key' => $value"; 25 | } 26 | $_result = '_parse_modifier($function . '(array(' . implode(',', (array)$_args) . '), $this)', $modifiers) . '; '; 30 | } 31 | else 32 | { 33 | $_result .= $function . '(array(' . implode(',', (array)$_args) . '), $this);'; 34 | } 35 | $_result .= '?>'; 36 | return true; 37 | } 38 | else 39 | { 40 | return false; 41 | } 42 | } 43 | 44 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.generate_compiler_debug_output.php: -------------------------------------------------------------------------------- 1 | _vars;\n"; 12 | $debug_output .= "ksort(\$assigned_vars);\n"; 13 | $debug_output .= "if (@is_array(\$this->_config[0])) {\n"; 14 | $debug_output .= " \$config_vars = \$this->_config[0];\n"; 15 | $debug_output .= " ksort(\$config_vars);\n"; 16 | $debug_output .= " \$this->assign('_debug_config_keys', array_keys(\$config_vars));\n"; 17 | $debug_output .= " \$this->assign('_debug_config_vals', array_values(\$config_vars));\n"; 18 | $debug_output .= "} \n"; 19 | 20 | $debug_output .= "\$included_templates = \$this->_templatelite_debug_info;\n"; 21 | 22 | $debug_output .= "\$this->assign('_debug_keys', array_keys(\$assigned_vars));\n"; 23 | $debug_output .= "\$this->assign('_debug_vals', array_values(\$assigned_vars));\n"; 24 | $debug_output .= "\$this->assign('_debug_tpls', \$included_templates);\n"; 25 | 26 | $debug_output .= "\$this->_templatelite_debug_loop = true;\n"; 27 | $debug_output .= "\$this->_templatelite_debug_dir = \$this->template_dir;\n"; 28 | $debug_output .= "\$this->template_dir = TEMPLATE_LITE_DIR . 'internal/';\n"; 29 | $debug_output .= "echo \$this->_fetch_compile('debug.tpl');\n"; 30 | $debug_output .= "\$this->template_dir = \$this->_templatelite_debug_dir;\n"; 31 | $debug_output .= "\$this->_templatelite_debug_loop = false; \n"; 32 | return $debug_output; 33 | } 34 | 35 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.include.php: -------------------------------------------------------------------------------- 1 | _parse_arguments($arguments); 12 | 13 | $arg_list = array(); 14 | if (empty($_args['file'])) 15 | { 16 | $object->trigger_error("missing 'file' attribute in include tag", E_USER_ERROR, __FILE__, __LINE__); 17 | } 18 | 19 | foreach ($_args as $arg_name => $arg_value) 20 | { 21 | if ($arg_name == 'file') 22 | { 23 | $include_file = $arg_value; 24 | continue; 25 | } 26 | else if ($arg_name == 'assign') 27 | { 28 | $assign_var = $arg_value; 29 | continue; 30 | } 31 | if (is_bool($arg_value)) 32 | { 33 | $arg_value = $arg_value ? 'true' : 'false'; 34 | } 35 | $arg_list[] = "'$arg_name' => $arg_value"; 36 | } 37 | 38 | if (isset($assign_var)) 39 | { 40 | $output = '_vars;' . 41 | "\n\$this->assign(" . $assign_var . ", \$this->_fetch_compile_include(" . $include_file . ", array(".implode(',', (array)$arg_list).")));\n" . 42 | "\$this->_vars = \$_templatelite_tpl_vars;\n" . 43 | "unset(\$_templatelite_tpl_vars);\n" . 44 | ' ?>'; 45 | } 46 | else 47 | { 48 | $output = '_vars;' . 49 | "\necho \$this->_fetch_compile_include(" . $include_file . ", array(".implode(',', (array)$arg_list)."));\n" . 50 | "\$this->_vars = \$_templatelite_tpl_vars;\n" . 51 | "unset(\$_templatelite_tpl_vars);\n" . 52 | ' ?>'; 53 | } 54 | return $output; 55 | } 56 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.parse_is_expr.php: -------------------------------------------------------------------------------- 1 | _parse_variable($expr_arg) . "))"; 30 | } 31 | else 32 | { 33 | $expr = "!(1 & $is_arg)"; 34 | } 35 | break; 36 | 37 | case 'odd': 38 | if (isset($_args[$expr_end]) && $_args[$expr_end] == 'by') 39 | { 40 | $expr_end++; 41 | $expr_arg = $_args[$expr_end++]; 42 | $expr = "(1 & ($is_arg / " . $object->_parse_variable($expr_arg) . "))"; 43 | } 44 | else 45 | { 46 | $expr = "(1 & $is_arg)"; 47 | } 48 | break; 49 | 50 | case 'div': 51 | if (@$_args[$expr_end] == 'by') 52 | { 53 | $expr_end++; 54 | $expr_arg = $_args[$expr_end++]; 55 | $expr = "!($is_arg % " . $object->_parse_variable($expr_arg) . ")"; 56 | } 57 | else 58 | { 59 | $object->trigger_error("expecting 'by' after 'div'", E_USER_ERROR, __FILE__, __LINE__); 60 | } 61 | break; 62 | 63 | default: 64 | $object->trigger_error("unknown 'is' expression - '$expr_type'", E_USER_ERROR, __FILE__, __LINE__); 65 | break; 66 | } 67 | 68 | if ($negate_expr) { 69 | $expr = "!($expr)"; 70 | } 71 | 72 | array_splice($_args, 0, $expr_end, $expr); 73 | 74 | return $_args; 75 | } 76 | 77 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/TemplateLite/internal/template.build_dir.php: -------------------------------------------------------------------------------- 1 | _get_dir($dir); 15 | } 16 | $_result = $object->_get_dir($dir); 17 | foreach($_args as $value) 18 | { 19 | $_result .= $value.DIRECTORY_SEPARATOR; 20 | if (!is_dir($_result)) 21 | { 22 | @mkdir($_result, 0777); 23 | } 24 | } 25 | return $_result; 26 | } 27 | 28 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/TemplateLite/internal/template.destroy_dir.php: -------------------------------------------------------------------------------- 1 | template_dir = $object->_get_dir($object->template_dir); 32 | 33 | $name = ($object->encode_file_name) ? md5($object->template_dir.$file).'.php' : str_replace(".", "_", str_replace("/", "_", $file)).'.php'; 34 | @unlink($dir.$name); 35 | } 36 | else 37 | { 38 | $_args = ""; 39 | foreach(explode('|', $id) as $value) 40 | { 41 | $_args .= $value.DIRECTORY_SEPARATOR; 42 | } 43 | template_rm_dir($dir.DIRECTORY_SEPARATOR.$_args); 44 | } 45 | } 46 | } 47 | 48 | function template_rm_dir($dir) 49 | { 50 | if (is_file(substr($dir, 0, -1))) 51 | { 52 | @unlink(substr($dir, 0, -1)); 53 | return; 54 | } 55 | if ($d = opendir($dir)) 56 | { 57 | while(($f = readdir($d)) !== false) 58 | { 59 | if ($f != '.' && $f != '..') 60 | { 61 | template_rm_dir($dir.$f.DIRECTORY_SEPARATOR, $object); 62 | } 63 | } 64 | @rmdir($dir.$f); 65 | } 66 | } 67 | 68 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/TemplateLite/internal/template.fetch_compile_include.php: -------------------------------------------------------------------------------- 1 | debugging) 12 | { 13 | $object->_templatelite_debug_info[] = array('type' => 'template', 14 | 'filename' => $_templatelite_include_file, 15 | 'depth' => ++$object->_inclusion_depth, 16 | 'exec_time' => array_sum(explode(' ', microtime())) ); 17 | $included_tpls_idx = count($object->_templatelite_debug_info) - 1; 18 | } 19 | 20 | $object->_vars = array_merge($object->_vars, $_templatelite_include_vars); 21 | $_templatelite_include_file = $object->_get_resource($_templatelite_include_file); 22 | if(isset($object->_confs[0])) 23 | { 24 | array_unshift($object->_confs, $object->_confs[0]); 25 | $_compiled_output = $object->_fetch_compile($_templatelite_include_file); 26 | array_shift($object->_confs); 27 | } 28 | else 29 | { 30 | $_compiled_output = $object->_fetch_compile($_templatelite_include_file); 31 | } 32 | 33 | $object->_inclusion_depth--; 34 | 35 | if ($object->debugging) 36 | { 37 | $object->_templatelite_debug_info[$included_tpls_idx]['exec_time'] = array_sum(explode(' ', microtime())) - $object->_templatelite_debug_info[$included_tpls_idx]['exec_time']; 38 | } 39 | return $_compiled_output; 40 | } 41 | 42 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/TemplateLite/internal/template.generate_debug_output.php: -------------------------------------------------------------------------------- 1 | _vars; 12 | ksort($assigned_vars); 13 | if (@is_array($object->_config[0])) 14 | { 15 | $config_vars = $object->_config[0]; 16 | ksort($config_vars); 17 | $object->assign("_debug_config_keys", array_keys($config_vars)); 18 | $object->assign("_debug_config_vals", array_values($config_vars)); 19 | } 20 | 21 | $included_templates = $object->_templatelite_debug_info; 22 | 23 | $object->assign("_debug_keys", array_keys($assigned_vars)); 24 | $object->assign("_debug_vals", array_values($assigned_vars)); 25 | $object->assign("_debug_tpls", $included_templates); 26 | $object->assign("_templatelite_debug_output", ""); 27 | 28 | $object->_templatelite_debug_loop = true; 29 | $object->_templatelite_debug_dir = $object->template_dir; 30 | $object->template_dir = TEMPLATE_LITE_DIR . "internal/"; 31 | $debug_output = $object->fetch("debug.tpl"); 32 | $object->template_dir = $object->_templatelite_debug_dir; 33 | $object->_templatelite_debug_loop = false; 34 | return $debug_output; 35 | } 36 | 37 | ?> -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/CREDITS: -------------------------------------------------------------------------------- 1 | XXTEA PHP extension 2 | Ma Bingyao (andot@coolcode.cn) 3 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/INSTALL: -------------------------------------------------------------------------------- 1 | Installing of XXTEA PHP package. 2 | 3 | There are many ways to build the package. Below you can find details for most 4 | useful ways of package building: 5 | 6 | 1. with PHP 7 | 2. with phpize utility 8 | 3. under Windows using Microsoft Visual C (.NET or VC6) 9 | 10 | ----------------------------------------------------------------------------- 11 | Way 1: Building the package with PHP 12 | ----------------------------------------------------------------------------- 13 | 14 | 1. Create ext/xxtea folder in the php-source-folder. Copy all files 15 | from the package into created folder. 16 | 17 | 2. Run 18 | ./buildconf 19 | to rebuild PHP's configure script. 20 | 21 | 3. Compile php with option: 22 | --enable-xxtea to build bundled into PHP module 23 | --enable-xxtea=shared to build dinamycally loadable module 24 | 25 | ----------------------------------------------------------------------------- 26 | Way 2: Building the package with phpize utility 27 | ----------------------------------------------------------------------------- 28 | 29 | 1. Unpack contents of the package. 30 | 31 | 2. Run 32 | phpize 33 | script, which will prepare environment for building XXTEA package. 34 | 35 | 3. Run 36 | ./configure --enable-xxtea=shared 37 | to generate makefile 38 | 39 | 4. Run 40 | make 41 | to build XXTEA extension library. It will be placed into 42 | ./modules folder. 43 | 44 | 5. Run 45 | make install 46 | to install XXTEA extension library into PHP 47 | 48 | ----------------------------------------------------------------------------- 49 | Way 3: Building the package under Windows using Microsoft Visual C (.NET or VC6) 50 | ----------------------------------------------------------------------------- 51 | 1. Create ext/xxtea folder in the php-source-folder. Copy all files 52 | from the package into created folder. 53 | 54 | 2. Copy php4ts.lib (for PHP4) or php5ts.lib (for PHP5) static library from 55 | your version of PHP into ext/xxtea folder. 56 | 57 | 3. Open php_xxtea.sln - solution file under MSVC.NET or php_xxtea.dsw - 58 | workspace file under MSVC6. Try to build Release_php4 (for PHP4) or Release_php5 59 | (for PHP5) configuration. 60 | 61 | 4. Copy php_xxtea.dll from ext/xxtea/Release_php4 or ext/xxtea/Release_php5 62 | into {extension_dir} folder. Path to {extension_dir} can be found in php.ini 63 | 64 | 5. Add line 65 | extension=php_xxtea.dll 66 | into php.ini 67 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/README: -------------------------------------------------------------------------------- 1 | XXTEA PHP extension 2 | 3 | What is it? 4 | ----------------------------------------------- 5 | This extension based on xxtea library, which provides a set of functions 6 | for encrypt or decrypt data with XXTEA algorithm. 7 | 8 | 9 | 10 | How to install it? 11 | ----------------------------------------------- 12 | See INSTALL for installation instructions. 13 | 14 | 15 | 16 | How to use it? 17 | ----------------------------------------------- 18 | string xxtea_encrypt(string data, string key) 19 | 20 | Encrypt data using XXTEA algorithm. The key is a 16 bytes(128 bits) string. 21 | 22 | string xxtea_decrypt(string data, string key) 23 | 24 | Decrypt data using XXTEA algorithm. The key is a 16 bytes(128 bits) string. 25 | 26 | string xxtea_info() 27 | 28 | Get the version information. -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/config.m4: -------------------------------------------------------------------------------- 1 | PHP_ARG_ENABLE(xxtea, xxtea module, 2 | [ --enable-xxtea Enable xxtea module.]) 3 | 4 | if test "$PHP_XXTEA" != "no"; then 5 | PHP_NEW_EXTENSION(xxtea, php_xxtea.c xxtea.c, $ext_shared) 6 | AC_DEFINE(HAVE_XXTEA, 1, [Have XXTEA library]) 7 | fi 8 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/config.w32: -------------------------------------------------------------------------------- 1 | ARG_ENABLE("xxtea", "xxtea module", "no"); 2 | 3 | if (PHP_XXTEA != "no") { 4 | EXTENSION("xxtea", "php_xxtea.c xxtea.c"); 5 | } 6 | 7 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/php_xxtea.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | 3 | Copyright 2006-2007 Ma Bingyao 4 | 5 | These sources is free software. Redistributions of source code must 6 | retain the above copyright notice. Redistributions in binary form 7 | must reproduce the above copyright notice. You can redistribute it 8 | freely. You can use it with any free or commercial software. 9 | 10 | These sources is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY. Without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | 14 | You may contact the author by: 15 | e-mail: andot@coolcode.cn 16 | 17 | *************************************************************************/ 18 | 19 | #ifndef PHP_XXTEA_H 20 | #define PHP_XXTEA_H 21 | 22 | #ifdef HAVE_CONFIG_H 23 | #include "config.h" 24 | #endif 25 | 26 | #if HAVE_XXTEA 27 | extern zend_module_entry xxtea_module_entry; 28 | #define phpext_xxtea_ptr &xxtea_module_entry 29 | 30 | #define XXTEA_MODULE_NAME "xxtea" 31 | #define XXTEA_BUILD_DATE __DATE__ " " __TIME__ 32 | #define XXTEA_VERSION "1.0.3" 33 | #define XXTEA_AUTHOR "Ma Bingyao" 34 | #define XXTEA_HOMEPAGE "http://www.coolcode.cn/?p=209" 35 | 36 | ZEND_MINIT_FUNCTION(xxtea); 37 | ZEND_MSHUTDOWN_FUNCTION(xxtea); 38 | ZEND_MINFO_FUNCTION(xxtea); 39 | 40 | /* declaration of functions to be exported */ 41 | ZEND_FUNCTION(xxtea_encrypt); 42 | ZEND_FUNCTION(xxtea_decrypt); 43 | ZEND_FUNCTION(xxtea_info); 44 | 45 | #else /* if HAVE_XXTEA */ 46 | #define phpext_xxtea_ptr NULL 47 | #endif 48 | 49 | #endif /* ifndef PHP_XXTEA_H */ 50 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/php_xxtea.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 9.00 2 | # Visual Studio 2005 3 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "php_xxtea", "php_xxtea.vcproj", "{71165FA5-1EBC-4021-AA17-0CCBC7CD5204}" 4 | EndProject 5 | Global 6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 7 | Debug_php4|Win32 = Debug_php4|Win32 8 | Debug_php5|Win32 = Debug_php5|Win32 9 | Release_php4|Win32 = Release_php4|Win32 10 | Release_php5|Win32 = Release_php5|Win32 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {71165FA5-1EBC-4021-AA17-0CCBC7CD5204}.Debug_php4|Win32.ActiveCfg = Debug_php4|Win32 14 | {71165FA5-1EBC-4021-AA17-0CCBC7CD5204}.Debug_php4|Win32.Build.0 = Debug_php4|Win32 15 | {71165FA5-1EBC-4021-AA17-0CCBC7CD5204}.Debug_php5|Win32.ActiveCfg = Debug_php5|Win32 16 | {71165FA5-1EBC-4021-AA17-0CCBC7CD5204}.Debug_php5|Win32.Build.0 = Debug_php5|Win32 17 | {71165FA5-1EBC-4021-AA17-0CCBC7CD5204}.Release_php4|Win32.ActiveCfg = Release_php4|Win32 18 | {71165FA5-1EBC-4021-AA17-0CCBC7CD5204}.Release_php4|Win32.Build.0 = Release_php4|Win32 19 | {71165FA5-1EBC-4021-AA17-0CCBC7CD5204}.Release_php5|Win32.ActiveCfg = Release_php5|Win32 20 | {71165FA5-1EBC-4021-AA17-0CCBC7CD5204}.Release_php5|Win32.Build.0 = Release_php5|Win32 21 | EndGlobalSection 22 | GlobalSection(SolutionProperties) = preSolution 23 | HideSolutionNode = FALSE 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/test/test.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/xxtea.c: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | 3 | Copyright 2006-2007 Ma Bingyao 4 | 5 | These sources is free software. Redistributions of source code must 6 | retain the above copyright notice. Redistributions in binary form 7 | must reproduce the above copyright notice. You can redistribute it 8 | freely. You can use it with any free or commercial software. 9 | 10 | These sources is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY. Without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | 14 | You may contact the author by: 15 | e-mail: andot@coolcode.cn 16 | 17 | *************************************************************************/ 18 | #include "xxtea.h" 19 | 20 | void xxtea_long_encrypt(xxtea_long *v, xxtea_long len, xxtea_long *k) { 21 | xxtea_long n = len - 1; 22 | xxtea_long z = v[n], y = v[0], p, q = 6 + 52 / (n + 1), sum = 0, e; 23 | if (n < 1) { 24 | return; 25 | } 26 | while (0 < q--) { 27 | sum += XXTEA_DELTA; 28 | e = sum >> 2 & 3; 29 | for (p = 0; p < n; p++) { 30 | y = v[p + 1]; 31 | z = v[p] += XXTEA_MX; 32 | } 33 | y = v[0]; 34 | z = v[n] += XXTEA_MX; 35 | } 36 | } 37 | 38 | void xxtea_long_decrypt(xxtea_long *v, xxtea_long len, xxtea_long *k) { 39 | xxtea_long n = len - 1; 40 | xxtea_long z = v[n], y = v[0], p, q = 6 + 52 / (n + 1), sum = q * XXTEA_DELTA, e; 41 | if (n < 1) { 42 | return; 43 | } 44 | while (sum != 0) { 45 | e = sum >> 2 & 3; 46 | for (p = n; p > 0; p--) { 47 | z = v[p - 1]; 48 | y = v[p] -= XXTEA_MX; 49 | } 50 | z = v[n]; 51 | y = v[0] -= XXTEA_MX; 52 | sum -= XXTEA_DELTA; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/xxtea.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | 3 | Copyright 2006-2007 Ma Bingyao 4 | 5 | These sources is free software. Redistributions of source code must 6 | retain the above copyright notice. Redistributions in binary form 7 | must reproduce the above copyright notice. You can redistribute it 8 | freely. You can use it with any free or commercial software. 9 | 10 | These sources is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY. Without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | 14 | You may contact the author by: 15 | e-mail: andot@coolcode.cn 16 | 17 | *************************************************************************/ 18 | 19 | #ifndef XXTEA_H 20 | #define XXTEA_H 21 | 22 | #include /* for size_t & NULL declarations */ 23 | 24 | #if defined(_MSC_VER) 25 | 26 | typedef unsigned __int32 xxtea_long; 27 | 28 | #else 29 | 30 | #if defined(__FreeBSD__) && __FreeBSD__ < 5 31 | /* FreeBSD 4 doesn't have stdint.h file */ 32 | #include 33 | #else 34 | #include 35 | #endif 36 | 37 | typedef uint32_t xxtea_long; 38 | 39 | #endif /* end of if defined(_MSC_VER) */ 40 | 41 | #define XXTEA_MX (z >> 5 ^ y << 2) + (y >> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z) 42 | #define XXTEA_DELTA 0x9e3779b9 43 | 44 | void xxtea_long_encrypt(xxtea_long *v, xxtea_long len, xxtea_long *k); 45 | void xxtea_long_decrypt(xxtea_long *v, xxtea_long len, xxtea_long *k); 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/spyc/COPYING: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2011 Vladimir Andersen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/spyc/README.md: -------------------------------------------------------------------------------- 1 | **Spyc** is a YAML loader/dumper written in pure PHP. Given a YAML document, Spyc will return an array that 2 | you can use however you see fit. Given an array, Spyc will return a string which contains a YAML document 3 | built from your data. 4 | 5 | **YAML** is an amazingly human friendly and strikingly versatile data serialization language which can be used 6 | for log files, config files, custom protocols, the works. For more information, see http://www.yaml.org. 7 | 8 | Spyc supports YAML 1.0 specification. 9 | 10 | ## Using Spyc 11 | 12 | Using Spyc is trivial: 13 | 14 | ``` 15 | =5.3.1" 18 | }, 19 | "autoload": { 20 | "files": [ "Spyc.php" ] 21 | }, 22 | "extra": { 23 | "branch-alias": { 24 | "dev-master": "0.5.x-dev" 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/spyc/examples/yaml-dump.php: -------------------------------------------------------------------------------- 1 | 'A sequence','second' => 'of mapped values'); 18 | $array['Mapped'] = array('A sequence','which is mapped'); 19 | $array['A Note'] = 'What if your text is too long?'; 20 | $array['Another Note'] = 'If that is the case, the dumper will probably fold your text by using a block. Kinda like this.'; 21 | $array['The trick?'] = 'The trick is that we overrode the default indent, 2, to 4 and the default wordwrap, 40, to 60.'; 22 | $array['Old Dog'] = "And if you want\n to preserve line breaks, \ngo ahead!"; 23 | $array['key:withcolon'] = "Should support this to"; 24 | 25 | $yaml = Spyc::YAMLDump($array,4,60); 26 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/spyc/examples/yaml-load.php: -------------------------------------------------------------------------------- 1 | spyc.yaml loaded into PHP:
'; 15 | print_r($array); 16 | echo ''; 17 | 18 | 19 | echo '
YAML Data dumped back:
'; 20 | echo Spyc::YAMLDump($array); 21 | echo '
'; 22 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/spyc/php4/5to4.php: -------------------------------------------------------------------------------- 1 | ', $code); 13 | $f = fopen ($dest, 'w'); 14 | fwrite($f, $code); 15 | fclose ($f); 16 | print "Written to $dest.\n"; 17 | } -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/spyc/tests/IndentTest.php: -------------------------------------------------------------------------------- 1 | Y = Spyc::YAMLLoad("indent_1.yaml"); 11 | } 12 | 13 | public function testIndent_1() { 14 | $this->assertEquals (array ('child_1' => 2, 'child_2' => 0, 'child_3' => 1), $this->Y['root']); 15 | } 16 | 17 | public function testIndent_2() { 18 | $this->assertEquals (array ('child_1' => 1, 'child_2' => 2), $this->Y['root2']); 19 | } 20 | 21 | public function testIndent_3() { 22 | $this->assertEquals (array (array ('resolutions' => array (1024 => 768, 1920 => 1200), 'producer' => 'Nec')), $this->Y['display']); 23 | } 24 | 25 | public function testIndent_4() { 26 | $this->assertEquals (array ( 27 | array ('resolutions' => array (1024 => 768)), 28 | array ('resolutions' => array (1920 => 1200)), 29 | ), $this->Y['displays']); 30 | } 31 | 32 | public function testIndent_5() { 33 | $this->assertEquals (array (array ( 34 | 'row' => 0, 35 | 'col' => 0, 36 | 'headsets_affected' => array ( 37 | array ( 38 | 'ports' => array (0), 39 | 'side' => 'left', 40 | ) 41 | ), 42 | 'switch_function' => array ( 43 | 'ics_ptt' => true 44 | ) 45 | )), $this->Y['nested_hashes_and_seqs']); 46 | } 47 | 48 | public function testIndent_6() { 49 | $this->assertEquals (array ( 50 | 'h' => array ( 51 | array ('a' => 'b', 'a1' => 'b1'), 52 | array ('c' => 'd') 53 | ) 54 | ), $this->Y['easier_nest']); 55 | } 56 | 57 | public function testIndent_space() { 58 | $this->assertEquals ("By four\n spaces", $this->Y['one_space']); 59 | } 60 | 61 | public function testListAndComment() { 62 | $this->assertEquals (array ('one', 'two', 'three'), $this->Y['list_and_comment']); 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/spyc/tests/comments.yaml: -------------------------------------------------------------------------------- 1 | foo: 'bar' #Comment 2 | arr: ['x', 'y', 'z'] # Comment here 3 | bar: kittens -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/spyc/tests/failing1.yaml: -------------------------------------------------------------------------------- 1 | MyObject: 2 | Prop1: {key1:val1} -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/spyc/tests/indent_1.yaml: -------------------------------------------------------------------------------- 1 | root: 2 | child_1: 2 3 | 4 | child_2: 0 5 | child_3: 1 6 | 7 | root2: 8 | child_1: 1 9 | # A comment 10 | child_2: 2 11 | 12 | displays: 13 | - resolutions: 14 | 1024: 768 15 | - resolutions: 16 | 1920: 1200 17 | 18 | display: 19 | - resolutions: 20 | 1024: 768 21 | 1920: 1200 22 | producer: "Nec" 23 | 24 | nested_hashes_and_seqs: 25 | - { row: 0, col: 0, headsets_affected: [{ports: [0], side: left}], switch_function: {ics_ptt: true} } 26 | 27 | easier_nest: { h: [{a: b, a1: b1}, {c: d}] } 28 | 29 | one_space: | 30 | By four 31 | spaces 32 | 33 | steps: 34 | - step: &id001 35 | instrument: Lasik 2000 36 | pulseEnergy: 5.4 37 | pulseDuration: 12 38 | repetition: 1000 39 | spotSize: 1mm 40 | - step: 41 | <<: *id001 42 | spotSize: 2mm 43 | 44 | death masks are: 45 | sad: 2 46 | <<: {magnificent: 4} 47 | 48 | login: &login 49 | adapter: mysql 50 | host: localhost 51 | 52 | development: 53 | database: rails_dev 54 | <<: *login 55 | 56 | "key": "value:" 57 | colon_only: ":" 58 | 59 | list_and_comment: [one, two, three] # comment 60 | kai: 61 | -example: value 62 | kai_list_of_items: 63 | - -item 64 | - '-item' 65 | -item -------------------------------------------------------------------------------- /php/ThinkPHP/Library/Vendor/spyc/tests/quotes.yaml: -------------------------------------------------------------------------------- 1 | html_tags: 2 | -
3 | -

4 | html_content: 5 | -

hello world

6 | - hello
world 7 | text_content: 8 | - hello world -------------------------------------------------------------------------------- /php/ThinkPHP/Mode/Sae/convention.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | /** 13 | * SAE模式惯例配置文件 14 | * 该文件请不要修改,如果要覆盖惯例配置的值,可在应用配置文件中设定和惯例不符的配置项 15 | * 配置名称大小写任意,系统会统一转换成小写 16 | * 所有配置参数都可以在生效前动态改变 17 | */ 18 | defined('THINK_PATH') or exit(); 19 | $st = new SaeStorage(); 20 | return array( 21 | //SAE下固定mysql配置 22 | 'DB_TYPE' => 'mysql', // 数据库类型 23 | 'DB_DEPLOY_TYPE' => 1, 24 | 'DB_RW_SEPARATE' => true, 25 | 'DB_HOST' => SAE_MYSQL_HOST_M.','.SAE_MYSQL_HOST_S, // 服务器地址 26 | 'DB_NAME' => SAE_MYSQL_DB, // 数据库名 27 | 'DB_USER' => SAE_MYSQL_USER, // 用户名 28 | 'DB_PWD' => SAE_MYSQL_PASS, // 密码 29 | 'DB_PORT' => SAE_MYSQL_PORT, // 端口 30 | //更改模板替换变量,让普通能在所有平台下显示 31 | 'TMPL_PARSE_STRING' => array( 32 | // __PUBLIC__/upload --> /Public/upload -->http://appname-public.stor.sinaapp.com/upload 33 | '/Public/upload' => $st->getUrl('public','upload') 34 | ), 35 | 'LOG_TYPE' => 'Sae', 36 | 'DATA_CACHE_TYPE' => 'Memcachesae', 37 | 'CHECK_APP_DIR' => false, 38 | 'FILE_UPLOAD_TYPE' => 'Sae', 39 | ); 40 | -------------------------------------------------------------------------------- /php/ThinkPHP/Mode/api.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | /** 13 | * ThinkPHP API模式定义 14 | */ 15 | return array( 16 | // 配置文件 17 | 'config' => array( 18 | THINK_PATH.'Conf/convention.php', // 系统惯例配置 19 | CONF_PATH.'config'.CONF_EXT, // 应用公共配置 20 | ), 21 | 22 | // 别名定义 23 | 'alias' => array( 24 | 'Think\Exception' => CORE_PATH . 'Exception'.EXT, 25 | 'Think\Model' => CORE_PATH . 'Model'.EXT, 26 | 'Think\Db' => CORE_PATH . 'Db'.EXT, 27 | 'Think\Cache' => CORE_PATH . 'Cache'.EXT, 28 | 'Think\Cache\Driver\File' => CORE_PATH . 'Cache/Driver/File'.EXT, 29 | 'Think\Storage' => CORE_PATH . 'Storage'.EXT, 30 | ), 31 | 32 | // 函数和类文件 33 | 'core' => array( 34 | MODE_PATH.'Api/functions.php', 35 | COMMON_PATH.'Common/function.php', 36 | MODE_PATH . 'Api/App'.EXT, 37 | MODE_PATH . 'Api/Dispatcher'.EXT, 38 | MODE_PATH . 'Api/Controller'.EXT, 39 | CORE_PATH . 'Behavior'.EXT, 40 | ), 41 | // 行为扩展定义 42 | 'tags' => array( 43 | ), 44 | ); 45 | -------------------------------------------------------------------------------- /php/ThinkPHP/Mode/lite.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | /** 13 | * ThinkPHP Lite模式定义 14 | */ 15 | return array( 16 | // 配置文件 17 | 'config' => array( 18 | MODE_PATH.'Lite/convention.php', // 系统惯例配置 19 | CONF_PATH.'config'.CONF_EXT, // 应用公共配置 20 | ), 21 | 22 | // 别名定义 23 | 'alias' => array( 24 | 'Think\Exception' => CORE_PATH . 'Exception'.EXT, 25 | 'Think\Model' => CORE_PATH . 'Model'.EXT, 26 | 'Think\Db' => CORE_PATH . 'Db'.EXT, 27 | 'Think\Cache' => CORE_PATH . 'Cache'.EXT, 28 | 'Think\Cache\Driver\File' => CORE_PATH . 'Cache/Driver/File'.EXT, 29 | 'Think\Storage' => CORE_PATH . 'Storage'.EXT, 30 | ), 31 | 32 | // 函数和类文件 33 | 'core' => array( 34 | MODE_PATH.'Lite/functions.php', 35 | COMMON_PATH.'Common/function.php', 36 | CORE_PATH . 'Hook'.EXT, 37 | CORE_PATH . 'App'.EXT, 38 | CORE_PATH . 'Dispatcher'.EXT, 39 | //CORE_PATH . 'Log'.EXT, 40 | CORE_PATH . 'Route'.EXT, 41 | CORE_PATH . 'Controller'.EXT, 42 | CORE_PATH . 'View'.EXT, 43 | ), 44 | // 行为扩展定义 45 | 'tags' => array( 46 | ), 47 | ); 48 | -------------------------------------------------------------------------------- /php/ThinkPHP/Tpl/dispatch_jump.tpl: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 跳转提示 11 | 21 | 22 | 23 |
24 | 25 |

:)

26 |

27 | 28 |

:(

29 |

30 | 31 |

32 |

33 | 页面自动 跳转 等待时间: 34 |

35 |
36 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /php/ThinkPHP/Tpl/think_exception.tpl: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 系统发生错误 10 | 26 | 27 | 28 |
29 |

:(

30 |

31 |
32 | 33 |
34 |
35 |

错误位置

36 |
37 |
38 |

FILE:  LINE:

39 |
40 |
41 | 42 | 43 |
44 |
45 |

TRACE

46 |
47 |
48 |

49 |
50 |
51 | 52 |
53 |
54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /php/ThinkPHP/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/SimpleAdmin/28226f44d572dd29e6f8a788c974bbcb9ed98e45/php/ThinkPHP/logo.png -------------------------------------------------------------------------------- /php/index.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | // 应用入口文件 13 | 14 | // 检测PHP环境 15 | if(version_compare(PHP_VERSION,'5.3.0','<')) die('require PHP > 5.3.0 !'); 16 | 17 | // 开启调试模式 建议开发阶段开启 部署阶段注释或者设为false 18 | //define('APP_DEBUG',True); 19 | 20 | // 定义应用目录 21 | define('APP_PATH','./Application/'); 22 | 23 | // 这样访问地址里不需要输入Home 24 | define('BIND_MODULE', 'Home'); 25 | 26 | // 引入ThinkPHP入口文件 27 | require './ThinkPHP/ThinkPHP.php'; 28 | 29 | // 亲^_^ 后面不需要任何代码了 就是如此简单 -------------------------------------------------------------------------------- /sql/easy_admin_2017-11-08.sql: -------------------------------------------------------------------------------- 1 | # ************************************************************ 2 | # Sequel Pro SQL dump 3 | # Version 4541 4 | # 5 | # http://www.sequelpro.com/ 6 | # https://github.com/sequelpro/sequelpro 7 | # 8 | # Host: 127.0.0.1 (MySQL 5.6.20) 9 | # Database: easy_admin 10 | # Generation Time: 2017-11-08 05:56:20 +0000 11 | # ************************************************************ 12 | 13 | 14 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 15 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 16 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 17 | /*!40101 SET NAMES utf8 */; 18 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 19 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 20 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 21 | 22 | 23 | # Dump of table feedback 24 | # ------------------------------------------------------------ 25 | 26 | DROP TABLE IF EXISTS `feedback`; 27 | 28 | CREATE TABLE `feedback` ( 29 | `id` int(11) unsigned NOT NULL AUTO_INCREMENT, 30 | `user_id` int(11) DEFAULT NULL, 31 | `username` varchar(20) DEFAULT NULL, 32 | `create_at` int(11) DEFAULT NULL, 33 | `content` varchar(200) DEFAULT NULL, 34 | PRIMARY KEY (`id`) 35 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 36 | 37 | 38 | 39 | # Dump of table user 40 | # ------------------------------------------------------------ 41 | 42 | DROP TABLE IF EXISTS `user`; 43 | 44 | CREATE TABLE `user` ( 45 | `id` int(11) unsigned NOT NULL AUTO_INCREMENT, 46 | `username` varchar(20) DEFAULT NULL, 47 | `password` varchar(32) DEFAULT NULL, 48 | `phone` int(11) DEFAULT NULL, 49 | `email` varchar(40) DEFAULT NULL, 50 | `create_at` int(11) DEFAULT NULL, 51 | `token` varchar(32) DEFAULT NULL, 52 | PRIMARY KEY (`id`) 53 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 54 | 55 | 56 | 57 | 58 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 59 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 60 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 61 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 62 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 63 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 64 | -------------------------------------------------------------------------------- /web/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { 4 | "modules": false, 5 | "targets": { 6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] 7 | } 8 | }], 9 | "stage-2" 10 | ], 11 | "plugins": ["transform-runtime"], 12 | "env": { 13 | "test": { 14 | "presets": ["env", "stage-2"], 15 | "plugins": ["istanbul"] 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /web/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /web/.eslintignore: -------------------------------------------------------------------------------- 1 | build/*.js 2 | config/*.js 3 | -------------------------------------------------------------------------------- /web/.eslintrc.js: -------------------------------------------------------------------------------- 1 | // https://eslint.org/docs/user-guide/configuring 2 | 3 | module.exports = { 4 | root: true, 5 | parser: 'babel-eslint', 6 | parserOptions: { 7 | sourceType: 'module' 8 | }, 9 | env: { 10 | browser: true, 11 | }, 12 | // https://github.com/standard/standard/blob/master/docs/RULES-en.md 13 | extends: 'standard', 14 | // required to lint *.vue files 15 | plugins: [ 16 | 'html' 17 | ], 18 | // add your custom rules here 19 | 'rules': { 20 | // allow paren-less arrow functions 21 | 'arrow-parens': 0, 22 | // allow async-await 23 | 'generator-star-spacing': 0, 24 | // allow debugger during development 25 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /web/.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | // to edit target browsers: use "browserslist" field in package.json 6 | "autoprefixer": {} 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /web/build/build.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | require('./check-versions')() 3 | 4 | process.env.NODE_ENV = 'production' 5 | 6 | const ora = require('ora') 7 | const rm = require('rimraf') 8 | const path = require('path') 9 | const chalk = require('chalk') 10 | const webpack = require('webpack') 11 | const config = require('../config') 12 | const webpackConfig = require('./webpack.prod.conf') 13 | 14 | const spinner = ora('building for production...') 15 | spinner.start() 16 | 17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { 18 | if (err) throw err 19 | webpack(webpackConfig, function (err, stats) { 20 | spinner.stop() 21 | if (err) throw err 22 | process.stdout.write(stats.toString({ 23 | colors: true, 24 | modules: false, 25 | children: false, 26 | chunks: false, 27 | chunkModules: false 28 | }) + '\n\n') 29 | 30 | if (stats.hasErrors()) { 31 | console.log(chalk.red(' Build failed with errors.\n')) 32 | process.exit(1) 33 | } 34 | 35 | console.log(chalk.cyan(' Build complete.\n')) 36 | console.log(chalk.yellow( 37 | ' Tip: built files are meant to be served over an HTTP server.\n' + 38 | ' Opening index.html over file:// won\'t work.\n' 39 | )) 40 | }) 41 | }) 42 | -------------------------------------------------------------------------------- /web/build/check-versions.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const chalk = require('chalk') 3 | const semver = require('semver') 4 | const packageConfig = require('../package.json') 5 | const shell = require('shelljs') 6 | function exec (cmd) { 7 | return require('child_process').execSync(cmd).toString().trim() 8 | } 9 | 10 | const versionRequirements = [ 11 | { 12 | name: 'node', 13 | currentVersion: semver.clean(process.version), 14 | versionRequirement: packageConfig.engines.node 15 | } 16 | ] 17 | 18 | if (shell.which('npm')) { 19 | versionRequirements.push({ 20 | name: 'npm', 21 | currentVersion: exec('npm --version'), 22 | versionRequirement: packageConfig.engines.npm 23 | }) 24 | } 25 | 26 | module.exports = function () { 27 | const warnings = [] 28 | for (let i = 0; i < versionRequirements.length; i++) { 29 | const mod = versionRequirements[i] 30 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 31 | warnings.push(mod.name + ': ' + 32 | chalk.red(mod.currentVersion) + ' should be ' + 33 | chalk.green(mod.versionRequirement) 34 | ) 35 | } 36 | } 37 | 38 | if (warnings.length) { 39 | console.log('') 40 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 41 | console.log() 42 | for (let i = 0; i < warnings.length; i++) { 43 | const warning = warnings[i] 44 | console.log(' ' + warning) 45 | } 46 | console.log() 47 | process.exit(1) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /web/build/dev-client.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | 'use strict' 3 | require('eventsource-polyfill') 4 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 5 | 6 | hotClient.subscribe(function (event) { 7 | if (event.action === 'reload') { 8 | window.location.reload() 9 | } 10 | }) 11 | -------------------------------------------------------------------------------- /web/build/utils.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const config = require('../config') 4 | const ExtractTextPlugin = require('extract-text-webpack-plugin') 5 | 6 | exports.assetsPath = function (_path) { 7 | const assetsSubDirectory = process.env.NODE_ENV === 'production' 8 | ? config.build.assetsSubDirectory 9 | : config.dev.assetsSubDirectory 10 | return path.posix.join(assetsSubDirectory, _path) 11 | } 12 | 13 | exports.cssLoaders = function (options) { 14 | options = options || {} 15 | 16 | const cssLoader = { 17 | loader: 'css-loader', 18 | options: { 19 | minimize: process.env.NODE_ENV === 'production', 20 | sourceMap: options.sourceMap 21 | } 22 | } 23 | 24 | // generate loader string to be used with extract text plugin 25 | function generateLoaders (loader, loaderOptions) { 26 | const loaders = [cssLoader] 27 | if (loader) { 28 | loaders.push({ 29 | loader: loader + '-loader', 30 | options: Object.assign({}, loaderOptions, { 31 | sourceMap: options.sourceMap 32 | }) 33 | }) 34 | } 35 | 36 | // Extract CSS when that option is specified 37 | // (which is the case during production build) 38 | if (options.extract) { 39 | return ExtractTextPlugin.extract({ 40 | use: loaders, 41 | fallback: 'vue-style-loader' 42 | }) 43 | } else { 44 | return ['vue-style-loader'].concat(loaders) 45 | } 46 | } 47 | 48 | // https://vue-loader.vuejs.org/en/configurations/extract-css.html 49 | return { 50 | css: generateLoaders(), 51 | postcss: generateLoaders(), 52 | less: generateLoaders('less'), 53 | sass: generateLoaders('sass', { indentedSyntax: true }), 54 | scss: generateLoaders('sass'), 55 | stylus: generateLoaders('stylus'), 56 | styl: generateLoaders('stylus') 57 | } 58 | } 59 | 60 | // Generate loaders for standalone style files (outside of .vue) 61 | exports.styleLoaders = function (options) { 62 | const output = [] 63 | const loaders = exports.cssLoaders(options) 64 | for (const extension in loaders) { 65 | const loader = loaders[extension] 66 | output.push({ 67 | test: new RegExp('\\.' + extension + '$'), 68 | use: loader 69 | }) 70 | } 71 | return output 72 | } 73 | -------------------------------------------------------------------------------- /web/build/vue-loader.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const config = require('../config') 4 | const isProduction = process.env.NODE_ENV === 'production' 5 | 6 | module.exports = { 7 | loaders: utils.cssLoaders({ 8 | sourceMap: isProduction 9 | ? config.build.productionSourceMap 10 | : config.dev.cssSourceMap, 11 | extract: isProduction 12 | }), 13 | transformToRequire: { 14 | video: 'src', 15 | source: 'src', 16 | img: 'src', 17 | image: 'xlink:href' 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /web/build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const utils = require('./utils') 4 | const config = require('../config') 5 | const vueLoaderConfig = require('./vue-loader.conf') 6 | 7 | function resolve (dir) { 8 | return path.join(__dirname, '..', dir) 9 | } 10 | 11 | module.exports = { 12 | entry: { 13 | app: './src/main.js' 14 | }, 15 | output: { 16 | path: config.build.assetsRoot, 17 | filename: '[name].js', 18 | publicPath: process.env.NODE_ENV === 'production' 19 | ? config.build.assetsPublicPath 20 | : config.dev.assetsPublicPath 21 | }, 22 | resolve: { 23 | extensions: ['.js', '.vue', '.json'], 24 | alias: { 25 | 'vue$': 'vue/dist/vue.esm.js', 26 | '@': resolve('src') 27 | } 28 | }, 29 | module: { 30 | rules: [ 31 | { 32 | test: /\.(js|vue)$/, 33 | loader: 'eslint-loader', 34 | enforce: 'pre', 35 | include: [resolve('src'), resolve('test')], 36 | options: { 37 | formatter: require('eslint-friendly-formatter') 38 | } 39 | }, 40 | { 41 | test: /\.vue$/, 42 | loader: 'vue-loader', 43 | options: vueLoaderConfig 44 | }, 45 | { 46 | test: /\.js$/, 47 | loader: 'babel-loader', 48 | include: [resolve('src'), resolve('test')] 49 | }, 50 | { 51 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 52 | loader: 'url-loader', 53 | options: { 54 | limit: 10000, 55 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 56 | } 57 | }, 58 | { 59 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, 60 | loader: 'url-loader', 61 | options: { 62 | limit: 10000, 63 | name: utils.assetsPath('media/[name].[hash:7].[ext]') 64 | } 65 | }, 66 | { 67 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 68 | loader: 'url-loader', 69 | options: { 70 | limit: 10000, 71 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 72 | } 73 | } 74 | ] 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /web/build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const webpack = require('webpack') 4 | const config = require('../config') 5 | const merge = require('webpack-merge') 6 | const baseWebpackConfig = require('./webpack.base.conf') 7 | const HtmlWebpackPlugin = require('html-webpack-plugin') 8 | const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') 9 | 10 | // add hot-reload related code to entry chunks 11 | Object.keys(baseWebpackConfig.entry).forEach(function (name) { 12 | baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name]) 13 | }) 14 | 15 | module.exports = merge(baseWebpackConfig, { 16 | module: { 17 | rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap }) 18 | }, 19 | // cheap-module-eval-source-map is faster for development 20 | devtool: '#cheap-module-eval-source-map', 21 | plugins: [ 22 | new webpack.DefinePlugin({ 23 | 'process.env': config.dev.env 24 | }), 25 | // https://github.com/glenjamin/webpack-hot-middleware#installation--usage 26 | new webpack.HotModuleReplacementPlugin(), 27 | new webpack.NoEmitOnErrorsPlugin(), 28 | // https://github.com/ampedandwired/html-webpack-plugin 29 | new HtmlWebpackPlugin({ 30 | filename: 'index.html', 31 | template: 'index.html', 32 | inject: true 33 | }), 34 | new FriendlyErrorsPlugin() 35 | ] 36 | }) 37 | -------------------------------------------------------------------------------- /web/config/dev.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const merge = require('webpack-merge') 3 | const prodEnv = require('./prod.env') 4 | 5 | module.exports = merge(prodEnv, { 6 | NODE_ENV: '"development"' 7 | }) 8 | -------------------------------------------------------------------------------- /web/config/index.js: -------------------------------------------------------------------------------- 1 | 2 | 'use strict' 3 | // Template version: 1.1.3 4 | // see http://vuejs-templates.github.io/webpack for documentation. 5 | 6 | const path = require('path') 7 | 8 | module.exports = { 9 | build: { 10 | env: require('./prod.env'), 11 | index: path.resolve(__dirname, '../dist/index.html'), 12 | assetsRoot: path.resolve(__dirname, '../dist'), 13 | assetsSubDirectory: 'static', 14 | assetsPublicPath: '/', 15 | productionSourceMap: true, 16 | // Gzip off by default as many popular static hosts such as 17 | // Surge or Netlify already gzip all static assets for you. 18 | // Before setting to `true`, make sure to: 19 | // npm install --save-dev compression-webpack-plugin 20 | productionGzip: false, 21 | productionGzipExtensions: ['js', 'css'], 22 | // Run the build command with an extra argument to 23 | // View the bundle analyzer report after build finishes: 24 | // `npm run build --report` 25 | // Set to `true` or `false` to always turn it on or off 26 | bundleAnalyzerReport: process.env.npm_config_report 27 | }, 28 | dev: { 29 | env: require('./dev.env'), 30 | port: process.env.PORT || 8080, 31 | autoOpenBrowser: true, 32 | assetsSubDirectory: 'static', 33 | assetsPublicPath: '/', 34 | proxyTable: { 35 | '/interface': { 36 | target: 'http://www.signxx.com/interface', 37 | changeOrigin: true, 38 | pathRewrite: { 39 | '^/interface': '/' 40 | } 41 | } 42 | }, 43 | // CSS Sourcemaps off by default because relative paths are "buggy" 44 | // with this option, according to the CSS-Loader README 45 | // (https://github.com/webpack/css-loader#sourcemaps) 46 | // In our experience, they generally work as expected, 47 | // just be aware of this issue when enabling this option. 48 | cssSourceMap: false 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /web/config/prod.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | module.exports = { 3 | NODE_ENV: '"production"' 4 | } 5 | -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | my-project 6 | 7 | 8 |
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simple_admin", 3 | "version": "1.0.0", 4 | "description": "A Vue.js project", 5 | "author": "HJaycee <>", 6 | "private": true, 7 | "scripts": { 8 | "dev": "node build/dev-server.js", 9 | "start": "npm run dev", 10 | "build": "node build/build.js", 11 | "lint": "eslint --ext .js,.vue src" 12 | }, 13 | "dependencies": { 14 | "vue": "^2.5.2", 15 | "vue-router": "^3.0.1", 16 | "element-ui": "2.0", 17 | "axios": "0.17", 18 | "js-md5": "^0.4.2", 19 | "vuex": "^3.0.0" 20 | }, 21 | "devDependencies": { 22 | "autoprefixer": "^7.1.2", 23 | "axios": "0.17", 24 | "babel-core": "^6.22.1", 25 | "babel-eslint": "^7.1.1", 26 | "babel-loader": "^7.1.1", 27 | "babel-plugin-transform-runtime": "^6.22.0", 28 | "babel-preset-env": "^1.3.2", 29 | "babel-preset-stage-2": "^6.22.0", 30 | "babel-register": "^6.22.0", 31 | "chalk": "^2.0.1", 32 | "connect-history-api-fallback": "^1.3.0", 33 | "copy-webpack-plugin": "^4.0.1", 34 | "css-loader": "^0.28.0", 35 | "element-ui": "2.0", 36 | "eslint": "^3.19.0", 37 | "eslint-config-standard": "^10.2.1", 38 | "eslint-friendly-formatter": "^3.0.0", 39 | "eslint-loader": "^1.7.1", 40 | "eslint-plugin-html": "^3.0.0", 41 | "eslint-plugin-import": "^2.7.0", 42 | "eslint-plugin-node": "^5.2.0", 43 | "eslint-plugin-promise": "^3.4.0", 44 | "eslint-plugin-standard": "^3.0.1", 45 | "eventsource-polyfill": "^0.9.6", 46 | "express": "^4.14.1", 47 | "extract-text-webpack-plugin": "^3.0.0", 48 | "file-loader": "^1.1.4", 49 | "friendly-errors-webpack-plugin": "^1.6.1", 50 | "html-webpack-plugin": "^2.30.1", 51 | "http-proxy-middleware": "^0.17.3", 52 | "node-sass": "^4.6.0", 53 | "opn": "^5.1.0", 54 | "optimize-css-assets-webpack-plugin": "^3.2.0", 55 | "ora": "^1.2.0", 56 | "portfinder": "^1.0.13", 57 | "rimraf": "^2.6.0", 58 | "semver": "^5.3.0", 59 | "shelljs": "^0.7.6", 60 | "url-loader": "^0.5.8", 61 | "vue-loader": "^13.3.0", 62 | "vue-style-loader": "^3.0.1", 63 | "vue-template-compiler": "^2.5.2", 64 | "webpack": "^3.6.0", 65 | "webpack-bundle-analyzer": "^2.9.0", 66 | "webpack-dev-middleware": "^1.12.0", 67 | "webpack-hot-middleware": "^2.18.2", 68 | "webpack-merge": "^4.1.0" 69 | }, 70 | "engines": { 71 | "node": ">= 4.0.0", 72 | "npm": ">= 3.0.0" 73 | }, 74 | "browserslist": [ 75 | "> 1%", 76 | "last 2 versions", 77 | "not ie <= 8" 78 | ] 79 | } 80 | -------------------------------------------------------------------------------- /web/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 18 | -------------------------------------------------------------------------------- /web/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/SimpleAdmin/28226f44d572dd29e6f8a788c974bbcb9ed98e45/web/src/assets/logo.png -------------------------------------------------------------------------------- /web/src/components/admin/feedback.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 75 | 76 | -------------------------------------------------------------------------------- /web/src/components/admin/feedbacklist.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | -------------------------------------------------------------------------------- /web/src/components/common/404.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 25 | 26 | -------------------------------------------------------------------------------- /web/src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from './App' 5 | import router from './router' 6 | import {store} from './store/store' 7 | import ElementUI from 'element-ui' 8 | import 'element-ui/lib/theme-chalk/index.css' 9 | 10 | Vue.config.productionTip = false 11 | Vue.use(ElementUI) 12 | 13 | /* eslint-disable no-new */ 14 | new Vue({ 15 | el: '#app', 16 | router, 17 | store, 18 | template: '', 19 | components: { App } 20 | }) 21 | -------------------------------------------------------------------------------- /web/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | import notFound from '@/components/common/404' 4 | import admin from '@/components/admin/admin' 5 | import feedback from '@/components/admin/feedback' 6 | import feedbacklist from '@/components/admin/feedbacklist' 7 | import reg from '@/components/common/reg' 8 | import login from '@/components/common/login' 9 | Vue.use(Router) 10 | 11 | export default new Router({ 12 | routes: [ 13 | { 14 | path: '/admin', 15 | title: '管理台', 16 | name: 'admin', 17 | component: admin, 18 | children: [ 19 | { 20 | path: 'feedback', 21 | title: '留言', 22 | name: 'feedback', 23 | component: feedback 24 | }, 25 | { 26 | path: 'feedbacklist', 27 | title: '留言列表', 28 | name: 'feedbacklist', 29 | component: feedbacklist 30 | } 31 | ] 32 | }, 33 | { 34 | path: '/login', 35 | title: '登录', 36 | name: 'login', 37 | component: login 38 | }, 39 | { 40 | path: '/reg', 41 | title: '注册', 42 | name: 'reg', 43 | component: reg 44 | }, 45 | { 46 | path: '/', 47 | title: '管理台', 48 | component: admin, 49 | name: 'admin' 50 | }, 51 | { 52 | path: '/404', 53 | component: notFound, 54 | name: 'notFound', 55 | hidden: true 56 | }, 57 | { 58 | path: '*', 59 | hidden: true, 60 | redirect: { path: '/404' } 61 | } 62 | ], 63 | mode: 'history' 64 | }) 65 | -------------------------------------------------------------------------------- /web/src/store/store.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | Vue.use(Vuex) 4 | 5 | export const store = new Vuex.Store({ 6 | }) 7 | -------------------------------------------------------------------------------- /web/src/util/api.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | import md5 from 'js-md5' 3 | import router from '../router' 4 | 5 | const request = (url, data, callback) => { 6 | axios.post('/interface/' + url, data) 7 | .then((response) => { 8 | if (response && 9 | response.status === 200 && 10 | response.data.code === 1000) { 11 | // need login 12 | router.push({ 13 | name: 'login' 14 | }) 15 | } 16 | callback(response) 17 | }) 18 | } 19 | 20 | /** 21 | * reg 22 | */ 23 | const reg = (params, callback) => { 24 | var data = new URLSearchParams() 25 | data.append('username', params.username) 26 | data.append('password', md5(params.password)) 27 | data.append('password2', md5(params.password2)) 28 | data.append('phone', params.phone) 29 | data.append('email', params.email) 30 | 31 | request('user/reg', data, (response) => { 32 | callback(response) 33 | }) 34 | } 35 | 36 | /** 37 | * login 38 | */ 39 | const login = (params, callback) => { 40 | var data = new URLSearchParams() 41 | data.append('username', params.username) 42 | data.append('password', md5(params.password)) 43 | 44 | request('user/login', data, (response) => { 45 | if (response && 46 | response.status === 200 && 47 | response.data.code === 0) { 48 | localStorage.token = response.data.data.token // save token to localStorage 49 | } 50 | callback(response) 51 | }) 52 | } 53 | 54 | /** 55 | * submit feedback 56 | */ 57 | const feedbackSubmit = (params, callback) => { 58 | var data = new URLSearchParams() 59 | data.append('content', params.content) 60 | data.append('token', localStorage.token) 61 | 62 | request('feedback/submit', data, (response) => { 63 | callback(response) 64 | }) 65 | } 66 | 67 | /** 68 | * 留言列表 69 | */ 70 | const feedbackList = (params, callback) => { 71 | var data = new URLSearchParams() 72 | data.append('page', params.page) 73 | data.append('size', params.size) 74 | data.append('token', localStorage.token) 75 | 76 | request('feedback/records', data, (response) => { 77 | callback(response) 78 | }) 79 | } 80 | 81 | const api = { 82 | reg: reg, 83 | login: login, 84 | feedbackSubmit: feedbackSubmit, 85 | feedbackList: feedbackList 86 | } 87 | 88 | export default api 89 | -------------------------------------------------------------------------------- /web/static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/SimpleAdmin/28226f44d572dd29e6f8a788c974bbcb9ed98e45/web/static/.gitkeep --------------------------------------------------------------------------------