{"id":20008581,"url":"https://github.com/nlr-devteam/wdk","last_synced_at":"2026-05-13T00:04:34.670Z","repository":{"id":167532598,"uuid":"640490353","full_name":"NLR-DevTeam/WDK","owner":"NLR-DevTeam","description":"WDK（WebDevelopmentKit），基于PHP，是一个Web开发工具包，集成了许多的方法，解放双手，避免繁杂的代码","archived":false,"fork":false,"pushed_at":"2023-09-02T04:28:30.000Z","size":18,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-12T14:26:46.523Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NLR-DevTeam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-14T09:10:09.000Z","updated_at":"2023-09-02T07:15:15.000Z","dependencies_parsed_at":"2025-01-12T14:25:15.572Z","dependency_job_id":"640efc7c-db95-480a-b21c-45c390d9cfc8","html_url":"https://github.com/NLR-DevTeam/WDK","commit_stats":null,"previous_names":["nlr-devteam/wdk"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NLR-DevTeam%2FWDK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NLR-DevTeam%2FWDK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NLR-DevTeam%2FWDK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NLR-DevTeam%2FWDK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NLR-DevTeam","download_url":"https://codeload.github.com/NLR-DevTeam/WDK/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241447032,"owners_count":19964249,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T07:10:44.392Z","updated_at":"2026-05-13T00:04:34.644Z","avatar_url":"https://github.com/NLR-DevTeam.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WDK\nWDK（WebDevelopmentKit），基于PHP开发，是一个Web开发工具包，集成了许多的方法，解放双手，避免繁杂的代码\n## 序言\n欢迎各位开发者使用 WDK（全称WebDevelopmentKit），本程序使用 MIT 开源协议，请根据协议内容来使用 WDK\n有关于 v1.0.0.0 的可使用性已经过验证，但Bug的可能性未经考量，请暂时不要将 WDK 用于大型生产环境中\n关于 WDK 的文档稍后您会在 README.md 看到，不排除之后迁移到 ```docs.atomunite.cn``` 的可能\n请合理使用，如果喜欢请点个 Star\n\n# 使用文档\n## 关于初始化\n您可以使用以下代码初始化您的 WDK，请注意，不同的功能区有不同的初始化代码，类别如下：\n```\nWDK_Web\nWDK_CheckTools\nWDK_SQL\n```\n关于初始化，下面以SQL类为例：\n```\nrequire(\"{path}/wdk-v1.0.php\");\n$SQL = new WDK_SQL;\n```\n此代码可以让您初始化一个 WDK_SQL，来访问 SQL 类的功能，关于其他的初始化，只需要将 ```WDK_SQL``` 换成其他类名即可\n\n## Web 类的使用\n需要初始化 Web 类，我们为您提供了以下方法：\n\n### 1.页面跳转：\n使用方法：```$Class-\u003eHeaderJump($URL)```\n\n变量解释：\n```\n$URL：跳转的 URL 地址\n```\n此方法可以快速的使用Header Location的方式跳转到一个新的网页\n\n### 2.文字转unicode：\n使用方法：```$Class-\u003estringToUnicode($Text)```\n\n变量解释：\n```\n$Text：要编码的文字\n```\n此方法可以将文字转化为Unicode代码\n### 3.unicode转文字：\n使用方法：```$Class-\u003eunicodeEncode($Unicode)```\n\n变量解释：\n```\n$Unicode：被Unicode的文字\n```\n此方法可以将Unicode代码转化为文字\n## SQL 类的使用\n需要初始化 SQL 类，我们为您提供了以下方法：\n\n### 1.获取新的 MySQLi 连接：\n使用方法：```$Class-\u003eGetConnection($UseSQLSetting, $RequireArray)```\n\n变量解释：\n```\n$UseSQLSetting：是否使用默认配置文件，布尔值\n$RequireArray：请求数组，如果第一项为true，则不启用此项，直接调用配置文件，如果第一项为false，则调用此变量，内容为键值对，键包括：Address,Port,Username,Password,DataBaseName\n```\n此方法可以快速的获取一个 MySQLi 连接对象，如果错误返回错误信息，如果正确返回 Object\n\n### 读数据表：\n使用方法：```$Class-\u003eRead_List($Connection, $TableName, $RequireArray{可不填，默认为所有项})```\n\n变量解释：\n```\n$Connection：SQL连接\n$TableName：数据表名称\n$RequireArray：筛选规则，选择读哪些项，为数组键值对，例：array(\"username\" =\u003e \"Helloworld\")\n```\n此方法可以对某一个SQL连接中的数据表进行读取操作，返回一个SQL Object（别着急，还有更简单的Fetch_Assoc方法可以使用）\n\n### 写数据表：\n使用方法：```$Class-\u003eAdd_Data($Connection, $TableName, $RequireArray)```\n\n变量解释：\n```\n$Connection：SQL连接\n$TableName：数据表名称\n$RequireArray：数据键值对(JSON)\n```\n此方法可以对某一个SQL连接中的数据表进行写入操作\n\n### 从数据表中寻找数据匹配的数据：\n使用方法：```$Class-\u003eFind_Data($Connection, $TableName, $RequireArray)```\n\n变量解释：\n```\n$Connection：SQL连接\n$TableName：数据表名称\n$RequireArray：匹配规则，为数组键值对，例：array(\"score\" =\u003e \"114514\")\n```\n此方法可以对某一个SQL连接中的数据表中符合匹配规则的项进行读取操作，返回一个SQL Object（别着急，还有简单的Fetch_Assoc方法可以使用）\n\n### 从数据表中更新数据：\n使用方法：```$Class-\u003eUpdate_Data($Connection, $TableName, $RequireArray, $UpdateArray)```\n\n变量解释：\n```\n$Connection：SQL连接\n$TableName：数据表名称\n$RequireArray：匹配规则，为数组键值对，例：array(\"score\" =\u003e \"114514\")\n$UpdateArray：更新规则，为数组键值对，例：array(\"score\" =\u003e \"1919810\")\n```\n此方法可以对某一个SQL连接中的数据表中符合匹配规则的项进行更新操作，返回一个SendQuery后的结果\n\n### 从数据表中删除数据：\n使用方法：```$Class-\u003eDelete_Data($Connection, $TableName, $RequireArray)```\n\n变量解释：\n```\n$Connection：SQL连接\n$TableName：数据表名称\n$RequireArray：匹配规则，为数组键值对，例：array(\"score\" =\u003e \"114514\")\n```\n此方法可以对某一个SQL连接中的数据表中符合匹配规则的项进行删除操作，一般没有返回，有错误返回错误信息\n\n### 对 SQL Object 进行解析并整合到 List 中：\n使用方法：```$Class-\u003eFetch_Assoc($SQLObject)```\n\n变量解释：\n```\n$SQLObject：SQL Object，前几个方法返回的\n```\n此方法可以对某一个SQL连接Query返回的Object进行解析，返回一个JSONObject，例：\n```\n[\n  {\"hello\":\"world\"},\n  {\"hello\":\"php\"}\n]\n```\n\n### 发送自定义SQL请求：\n使用方法：```$Class-\u003eSendQuery($Connection, $Sqls)```\n\n变量解释：\n```\n$Connection：SQL连接\n$Sqls：执行的SQL语句\n```\n此方法可以对某一个SQL连接执行一个SQL语句，正确返回SQL Object，错误返回错误信息\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnlr-devteam%2Fwdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnlr-devteam%2Fwdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnlr-devteam%2Fwdk/lists"}