{"id":26062085,"url":"https://github.com/thorbenkuck/was","last_synced_at":"2026-05-30T22:32:05.019Z","repository":{"id":144576581,"uuid":"55611113","full_name":"ThorbenKuck/WAS","owner":"ThorbenKuck","description":"A base foundation, to create scalable php applications","archived":false,"fork":false,"pushed_at":"2017-09-13T10:21:19.000Z","size":7770,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-08T15:50:19.956Z","etag":null,"topics":["eoe","mod","php","theme"],"latest_commit_sha":null,"homepage":"https://github.com/ThorbenKuck/WAS","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/ThorbenKuck.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":"2016-04-06T14:06:44.000Z","updated_at":"2021-01-24T23:18:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"4e8d2ec6-f73c-4f37-be73-ee5f48964271","html_url":"https://github.com/ThorbenKuck/WAS","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ThorbenKuck/WAS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThorbenKuck%2FWAS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThorbenKuck%2FWAS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThorbenKuck%2FWAS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThorbenKuck%2FWAS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThorbenKuck","download_url":"https://codeload.github.com/ThorbenKuck/WAS/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThorbenKuck%2FWAS/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33712579,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["eoe","mod","php","theme"],"created_at":"2025-03-08T15:49:34.235Z","updated_at":"2026-05-30T22:32:05.014Z","avatar_url":"https://github.com/ThorbenKuck.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WAS\n##*What is the WAS*\nWAS stands for WebApplicationSystem und is a framework designed to strictly separate multiple things.\nIt is split up into 4 levels:\n\n1. socket-level.\n\n    * The socket-level contains one socket which acts like the \"BIOS\" of this system. It coordinates the other\n    levels and provides functionality for them. It should only contain basic functionality, like for example\n    a way to debug stuff.\n \n2. package-level.\n\n    * This Level is meant to be used for logic. For example: If you wanted to use a database inside this puppy,\n    you would create a db.package, which provides either functions or classes for the mods and the theme.\n\n    * The package-level contains folders written as *\u003cpackage_name\u003e.package*. You could add more information to the name,\n    like *\u003cpackage_name\u003e.\u003cpackage_version\u003e.\u003c...\u003e.package* as long as it contains \"*.package\".\n    \n    * Every package has to meet certain requirements. These are collected in the \"packages/requirements/\"-folder.\n    But you can change the location of the requirements in the settings.ini file, which will be explained later.\n    \n3. mod-level.\n\n    * This level is meant to be used for (mostly) independent applications. They can still contain requirements,\n    like \"foo.package\", but the should be independent to the theme\n    \n    * The mod-level contains the mods, that will be dynamically loaded into an call of the index.php of the WAS.\n    Everything else is the same as with the package-level, except that this folders will have to end at \"*.mod\".\n    \n4. theme-level\n\n    * The theme level is different than the mod- or package-level. It contains your actual theme. While the requirements\n    may alter from socket to socket, i will later explain it based on the example socket, this WAS comes with.\n\n## Example run through with the main.socket\n\n*Since i am not providing an example-theme, this might be a bit boring. However, if you are willing to see a example\nin a different language (german), the [wasVPM](https://github.com/ThorbenKuck/wasVPM) might be something for you*\n\nWe start with opening the browser. This calls the index.php of the WAS.\nThere is not much going on here. It start by starting the session and output buffering.\nIt then simply requires the Main.class.php file, which includes the \"Main\"-Class\n(i could not come up with a better name ... sorry). This class might, in the eye of someone, who only programs\nin an oop-manner, be very ugly, since it only contains static methods. However this comes very handy at certain points!\n\nWe then call the \u003ccode\u003eloadSocket()\u003c/code\u003e-method. This will load the \u003ccode\u003emain.socket/index.php\u003c/code\u003e file.\nIf you wanted to change the name, of the socket, you would have to change it inside this Class or by using\nthe \u003ccode\u003eMain::changeSocketName()\u003c/code\u003e method. Afterwards it calls the \u003ccode\u003e\\Main\\main()\u003c/code\u003e function.\n\nInside this function we find the basic scheme of the WAS. It looks like this:\n\n\u003ccode\u003einit ();\u003cbr\u003e\nload_all_packages ();\u003cbr\u003e\nload_mods ();\u003cbr\u003e\nload_theme ();\u003cbr\u003e\neoe ();\n\u003c/code\u003e\n\nSo inside the Socket it works like this:\n\u003ccode\u003eload_packages -\u003e load_mods -\u003e load_theme\u003c/code\u003e\n\nFrom this you can already take, how they depend on each other. The \"packages\" are stand-alone's, while the \"mods\"\nare able to use all \"packages\" and the \"theme\" can use all \"packages\" and \"mods\".\n\nFor the packages and mods there are 2 hooks (requirements) for the socket (in this example).\n\n1. The config.json.\n\n    The config  contains some information's. For example, wheter or not the mod / package is active, or if it\n    only is usable by administrator or what else (package or mod) is required for this to be implemented.\n    \n    Let's say, for example, we have mod A and package B. Mod a has inside his config stated that he needs package C.\n    Wile package B would be used and included, the mod A would not.\n    \n2. The index.php\n\n    This is a hook, which should resolve all mod-/package-internal dependencies, so that the socket (or \n    anything for that matter) can simply include the index.php and be up and running.\n    \n    Example: The Mod A uses a file called 'uberfile.php'. Inside the index.php he would than state:\n    \u003ccode\u003erequire dirname(\\_\\_FILE__) . '/uberfile.php';\u003c/code\u003e.\n    \n    Please note, that you can never be certain, from where this is called. So you should not be using relative\n    paths!\n\nBut back to the scheme!\nFirst of there is init(). Init creates internal dependencies of the socket. For example the structure of the\n'System'-session, which is used for path-information's, debug, so on and so forth.\n\nSecond of, it calls the load_all_packages() function. This algorithm is a bit longer. If you want to look into it\nyou can, by going into \u003ccode\u003esocket/main.socket/main.packages.functions.php\u003c/code\u003e, but i am not going to explain\nit in detail here. The same counts for the load_mods() function.\n\nAs we come to the load_theme() function, it gets a bit more interesting. You can install several themes\nsimultaneously, but only one can be active. This can be changed via the settings.ini file.\n\nThe current algorithm is trying to include 4 parts. The theme-config, the header, the body and the navigation.\nDon't panic! This is not complicated. It basically looks for 4 files inside the active-theme-folder:\n\n1. config.php\n2. header.php\n3. index.php (as the body ... didn't i already say, that i am bad with word?)\n4. nav.php\n\nHowever! You could tweak the system a bit. By default, it looks for a bit more like this:\n\n1. config.php\n2. header\n    1. header_logd_in.php if you are logdin or header_not_logd_in.php if you aren't\n    2. header.php if the needed file does not exist.\n3. index\n    1. index_logd_in.php if you are logdin or index_not_logd_in.php if you aren't\n    2. index.php if the needed file does not exist.\n4. nav\n    1. nav_logd_in.php if you are logdin or nav_not_logd_in.php if you aren't\n    2. nav.php if the needed file does not exist.\n    \nSo there is no need to create a complex system for login, it already is on.\n\nNow, let's assume we just take this empty project and start it. We don't have anything else, than the socket.\nIf we now run it, in (let's say) an apache2-server, it wouldn't work. If we now take a look at the \neoe()-function, we will know more about debugging. \n\nThe first thing we should look into is the settings.ini file. By default it looks something like this:\n\n\u003ccode\u003e[modes]\u003c/br\u003e\ndebug_mode = on\u003c/br\u003e\ndev_mode = on\u003c/br\u003e\u003c/br\u003e\n[mods]\u003c/br\u003e\nmod_usage = on\u003c/br\u003e\u003c/br\u003e\n[debug_window]\u003c/br\u003e\nopen_debug_window = yes\u003c/br\u003e\nadmin_only_debug_window = no\u003c/br\u003e\u003c/br\u003e\n[info_window]\u003c/br\u003e\nopen_info_window = yes\u003c/br\u003e\nadmin_only_info_window = no\u003c/br\u003e\u003c/br\u003e\n[debug_stacktrace]\u003c/br\u003e\nempty_debug_stacktrace_after_execution = no\u003c/br\u003e\u003c/br\u003e\n[packages]\u003c/br\u003e\npackage_usage = on\u003c/br\u003e\npackage_requirement_folder = packages/requirements/\u003c/br\u003e\npackage_folder = packages/\u003c/br\u003e\u003c/br\u003e\n[theme]\u003c/br\u003e\nactive_theme = example\u003c/br\u003e\u003c/br\u003e\n[test]\u003c/br\u003e\nuse_test_file = true\n\u003c/code\u003e\n\nThe debug-mode enables the debug and info windows. If both of these are set to \u003ccode\u003eopen_*_window = yes\u003c/code\u003e\n(and optional to \u003ccode\u003eadmin_only_info_window = no\u003c/code\u003e), the eoe function from the socket will kick in and\nopen a window, with manual-debug-stacktrace and all set info's / settings.\n\nIf we turn the dev_mode on, we will see php warnings/errors and everything else the compiler spits out.\n\nYou can also turn on / off multiple other things, like mods / packages, set the requirement-folders to different\nlocations an so on.\n\n##Motivation\nI created a website for controlling monitors via the internet. The problem was, that after i tested an let\nit run for a couple of weeks i wanted to change the behavior of certain parts. This took me so long, that\ni rather started from scratch. I looked for a framework that provided an easy adjustable while stile strong\nrule-set.\n\nI decided to create this system after i had to program a gigantic project with multiple colleges at the university. \nIt was a pain in the ass to maintain anything that does not follow a strict style-rule (like MVP). So, after\ni came up with an system for java, i decided to do the same for php.\n\nThe monitor-automation-project ca be found here: [wasVPM](https://github.com/ThorbenKuck/wasVPM) and is still\nbeing developed.\n\nI want the WAS to become an community based framework, that you can lean towards for gigantic and/or very complicated\nprojects, while still having all control over it, what it does and how it does that. Just like an operating system.\n\n##Why should i use the WAS?\nThis system is designed to strictly split up dependency's. It can be a powerful tool for creating complicated\nand / or gigantic projects, since you can enable / disable / add / remove /debug certain mods / packages \"on the fly\".\nSimilar to the MVP or MCP pattern, you will, at the long run, benefit from splitting dependency's, whether you\nuse this framework or anything else.\n\nIf you are now thinking \"*this just makes things way more complicated*\" you are partly right.\nSetting this up and get it running after a fresh start __might__ be a bit more time intensive. But from there on\nit just becomes way more easy to maintain and expand the project.\n\n**Do not confuse this with a dependency injection (DI) framework**\n\nThe WAS will take care of some dependency's and analyse requirements (dependency's) for mods and packages and include them.\nHowever, this system is mostly optimised for asynchronous projects. I guess you could write a mod or socket,\nthat provides you with a way for synchronous projects, but i am focusing at the asynchronous part here.\n\nIf you are willing, you could change this to anything you want. Like, for example, a DI-framework for a synchronous\nproject.\n##Current version\n\n__(ALPHA) v.0.1__\n\n## Latest changelog:\n\n####legend\n\\+ = added following\n\n\\* = changed following\n\n\\- = removed following\n\n__(ALPHA) v.0.1__\n* **structure**\n    * \\+ logs-folder\n    * \\+ mods-folder\n        * \\+ requirements-folder\n            * \\+ config.json as requirement for all mods\n            * \\+ index.php as requirement for all mods\n    * \\+ packages-folder\n        * \\+ requirements-folder\n            * \\+ config.json as requirement for all mods\n            * \\+ index.php as requirement for all mods\n    * \\+ socket-folder\n        * \\+ main.socket-folder (many files inside)\n* **main.socket**\n    * \\+ (Main)class for coordinate functionality with the socket\n    * \\+ logs compatibility\n    * \\+ package-support and analytics\n    * \\+ mod-support and analytics\n    * \\+ theme-support\n    * \\+ settings-support\n    * \\+ info-support\n    * \\+ debug-support\n    * \\+ user/login-pseudo-support (just some basic login-features, which can be expanded by packages)\n\n\n## For whom this is\n\nAnyone who want's to create and maintain large and/or complicated projects\n\n## For whom this isn't\n\nSomeone who just want's to create a simple website. In this case, it will be way more complicated, than it\nhas to be!\n\n##Installation ...\n\nSince this is (nearly) plain php, you can just clone this project and run it in any web-server (like apache2).\nHowever, i have to admit, that i never tested it inside of an Windows-environment..\n\n### ... of mods\n\nSimply put the *.mod folder inside your \u003ccode\u003emods/\u003c/code\u003e folder. Done. (Well, maybe you will have to install\nanother requirement for that mod or change it to active. For that look into the config.json)\n\nIf you are looking to create a mod, simply create a *.mod folder in \u003ccode\u003emods/\u003c/code\u003e, so that is looks like\nthis: \u003ccode\u003epath/to/project/mods/example.mod\u003c/code\u003e and run the project (\u003ccode\u003epath/to/project/index.php\u003c/code\u003e) once. It will include\nall dependency's for you (like the index.php and config.json).\n\nAfterwards you can upload it to anything and provide the mod for anyone who want's to use it.\n\n### ... of packages\n\nSimply put the *.package folder inside your \u003ccode\u003epackages/\u003c/code\u003e folder. Done. (Well, maybe you will have to install\nanother requirement for that package or change it to active. For that look into the config.json)\n\nIf you are looking to create a package, simply create a *.package folder in \u003ccode\u003epackage/\u003c/code\u003e, so that is looks like\nthis: \u003ccode\u003epath/to/project/packages/example.package\u003c/code\u003e and run the project (\u003ccode\u003epath/to/project/index.php\u003c/code\u003e) once. It will include\nall dependency's for you (like the index.php and config.json).\n\nAfterwards you can upload it to anything and provide the mod for anyone who want's to use it.\n\n### ... of sockets\n\n__WARNING!__ The socket has to be installed with care. The socket is the Heard of the whole System!\nIf, for example, a socket is installed, wich does not provide certain functions, which you packages or mods need\nor just has different function-names or something, it might take you a while to figure out the exact error! \nI recommend starting with a Socket and building everything else around it, as long as socket-dependency's \naren't implemented.\n\nSimply put the *.socket folder inside your \u003ccode\u003esocket/\u003c/code\u003e folder (\u003ccode\u003epath/to/project/socket/\u003c/code\u003e). Done.\n\n### ... of themes\n\nAgain, simply put the folder of the theme inside the themes-folder (\u003ccode\u003epath/to/project/themes/\u003c/code\u003e). If\nyou want to use it, change the name of \u003ccode\u003eactive_theme\u003c/code\u003e in the \u003ccode\u003esettings.ini\u003c/code\u003e the folder-name.\n\nTo create a theme, you should look into the load_theme()-algorithm, or at [wasVPM](https://github.com/ThorbenKuck/wasVPM)\nfor an example. I will, sometime in the future provide an example theme with explanation.\n\n##Contributors\n\nIf you want to dive into the project, just check out the WIKI for coding-standards. If there is anything\nunclear, i am sorry. This is one of my first github-projects and english is only my second language.\n\n##TODO\n\n* custom_error_handler\n* requirements (dependency) for the socket\n    * This is an idea and i am not sure if this is going to become a thing!\n* package-/mod-requirement for a certain mod\n* Enhance the debug of the main.socket\n* Documentation (as always... sorry)\n\n## Known bugs\n* Because the WAS is based on Sessions, if you have your session-time-settings to low, you might encounter\nproblems along the line\n\n## License\nMIT License","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthorbenkuck%2Fwas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthorbenkuck%2Fwas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthorbenkuck%2Fwas/lists"}