diff --git a/Bin/Bedrock.php b/Bin/Bedrock.php index da8295a..e09acd6 100644 --- a/Bin/Bedrock.php +++ b/Bin/Bedrock.php @@ -1,15 +1,15 @@ - * @link https://TheTempusProject.com/Core + * @link https://TheTempusProject.com/libraries/Bedrock * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ namespace TheTempusProject\Bedrock\Bin; diff --git a/Bin/autoload.php b/Bin/autoload.php index da148b8..c487b31 100644 --- a/Bin/autoload.php +++ b/Bin/autoload.php @@ -4,9 +4,9 @@ * * Handles the initial setup like autoloading, basic functions, constants, etc. * - * @version 3.0 + * @version 1.1.2 * @author Joey Kimsey - * @link https://TheTempusProject.com/Core + * @link https://TheTempusProject.com/libraries/Bedrock * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ namespace TheTempusProject\Bedrock; diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index 2725688..0000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,46 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at webmaster@thetempusproject.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 161cfab..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,87 +0,0 @@ -# Contribution Guidelines for Bedrock -Contributing to Bedrock is completely voluntary and should follow all of the guidelines listed here in order to ensure the highest probability of acceptance. It is highly recommended to use a php linter to automate more of this process. The project is maintained on github and all contributions need to be submitted via pull request to their specific repository under the `dev` branch. In order to contribute, simply follow the instructions for [creating a pull request](#creating-a-pull-request) below. - -## Pull Request Requirements -- All revisions must follow TTP naming conventions (see [Naming Conventions](#naming-conventions) Section) -- Include a clear and concise explanation of the features or changes included in your revision listed by file. -- All code must follow [PSR 2](http://www.php-fig.org/psr/psr-2/) standards -- prefer the use of [] for arrays over array() -- All functions must be documented with the exception of controller methods (see [Documentation](#documentation) Section) -- Controller methods may be doc-blocked when necessary for clarity (see [Documentation](#documentation) Section) -- All new Classes must include a class level doc-block (see [Documentation](#documentation) Section) -- Any new dependencies will have a longer validation process and should be accompanied by the required information (see [Dependencies](#dependencies) Section) - -## Naming Conventions -- File names are to be lower case -- All class names must be upper case -- Any data being stored as a file must be saved in the app directory (with the exception of config which should be stored under config/) -- Controllers must have a constructor and destructor using the constructor and destructor methods found in resources/ -- Views must be named using lowerCamelCase - -## Dependencies -Whenever a dependency is updated or added, pull requests must include a section that answers the following questions. -- Why is this dependency required -- Could this be reasonably accomplished within the app by implementing new features in a later version? explain. -- What is the latest stable version that can be used -- What features are absolutely necessary for your feature or modification to work - -## Documentation -### Classes - -New classes must be prefaced with a doc-block following this style: -``` -/** - * Controllers/admin.php - * - * This is the admin controller. - * - * @version 3.0 - * @author Joey Kimsey - * @link https://TheTempusProject.com/Core - * @license https://opensource.org/licenses/MIT [MIT LICENSE] - */ -``` - -From top to bottom: -- Filename on the second line -- A description for the file -- The TTP version this file was built for -`@version 1.0` -- The Authors name or alias and email -`@author first last ` -- A copy of the MIT license -`@license https://opensource.org/licenses/MIT [MIT LICENSE]` -- May include a link for more information -`@link http://link.com` - -### Functions -Functions must be prefaced with a doc-block following this style: -``` -/** - * Intended as a self-destruct session. If the specified session does not - * exist, it is created. If the specified session does exist, it will be - * destroyed and returned. - * - * @param string $name - Session name to be created or checked - * @param string $string - The string to be used if session needs to be - * created. (optional) - * - * @return bool|string - Returns bool if creating, and a string if the - * check is successful. - */ -``` - -From top to bottom: -- There must be a description of the functions intended usage on the second line -- All parameters should be documented like this -`@param [type] $name - description` -- Any function with a return statement must also be documented as such -`@return [type] - description` - -## Creating a Pull Request -This is a simple explanation of how to create a pull request for changes to Bedrock. You can find a detailed walk-through on how to [create a pull request](https://help.github.com/articles/creating-a-pull-request/) on github. - -1. First ensure you have followed all the contributing guidelines -2. Squash your merge into a single revision. This will make it easier to view the changes as a whole. -3. You can submit a pull request [here](https://github.com/TheTempusProject/Bedrock/compare) -4. Please submit all pull requests to the dev branch or they will be ignored. \ No newline at end of file diff --git a/Classes/Config.php b/Classes/Config.php index 84a20a7..b3ba8e3 100644 --- a/Classes/Config.php +++ b/Classes/Config.php @@ -4,9 +4,9 @@ * * This class handles all the hard-coded configurations. * - * @version 3.0 + * @version 1.1.2 * @author Joey Kimsey - * @link https://TheTempusProject.com/Core + * @link https://TheTempusProject.com/libraries/Bedrock * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ namespace TheTempusProject\Bedrock\Classes; diff --git a/Classes/Controller.php b/Classes/Controller.php index ee2eeab..41dd993 100644 --- a/Classes/Controller.php +++ b/Classes/Controller.php @@ -1,15 +1,15 @@ - * @link https://TheTempusProject.com/Core + * @link https://TheTempusProject.com/libraries/Bedrock * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ namespace TheTempusProject\Bedrock\Classes; diff --git a/Classes/Database.php b/Classes/Database.php index 207ded7..1e4d9a7 100644 --- a/Classes/Database.php +++ b/Classes/Database.php @@ -6,9 +6,9 @@ * * @todo - Add more than just MySQL * - * @version 3.0 + * @version 1.1.2 * @author Joey Kimsey - * @link https://TheTempusProject.com/Core + * @link https://TheTempusProject.com/libraries/Bedrock * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ namespace TheTempusProject\Bedrock\Classes; diff --git a/Classes/DatabaseModel.php b/Classes/DatabaseModel.php index d61561e..d6e55c8 100644 --- a/Classes/DatabaseModel.php +++ b/Classes/DatabaseModel.php @@ -1,13 +1,13 @@ - * @link https://TheTempusProject.com/Core + * @link https://TheTempusProject.com/libraries/Bedrock * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ namespace TheTempusProject\Bedrock\Classes; diff --git a/Classes/Model.php b/Classes/Model.php index 043cdfa..4d5291e 100644 --- a/Classes/Model.php +++ b/Classes/Model.php @@ -1,12 +1,12 @@ - * @link https://TheTempusProject.com/Core + * @link https://TheTempusProject.com/libraries/Bedrock * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ namespace TheTempusProject\Bedrock\Classes; diff --git a/Classes/Pagination.php b/Classes/Pagination.php index f097e6c..a3392df 100644 --- a/Classes/Pagination.php +++ b/Classes/Pagination.php @@ -1,12 +1,12 @@ - * @link https://TheTempusProject.com/Core + * @link https://TheTempusProject.com/libraries/Bedrock * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ namespace TheTempusProject\Bedrock\Classes; diff --git a/Functions/Check.php b/Functions/Check.php index cb61c10..b92935e 100644 --- a/Functions/Check.php +++ b/Functions/Check.php @@ -4,9 +4,9 @@ * * This class is used to test various inputs. * - * @version 3.0 + * @version 1.1.2 * @author Joey Kimsey - * @link https://TheTempusProject.com/Core + * @link https://TheTempusProject.com/libraries/Bedrock * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ namespace TheTempusProject\Bedrock\Functions; diff --git a/Functions/Code.php b/Functions/Code.php index 2f6c176..5a408e8 100644 --- a/Functions/Code.php +++ b/Functions/Code.php @@ -6,9 +6,9 @@ * * @todo Better code generation. * - * @version 3.0 + * @version 1.1.2 * @author Joey Kimsey - * @link https://TheTempusProject.com/Core + * @link https://TheTempusProject.com/libraries/Bedrock * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ namespace TheTempusProject\Bedrock\Functions; diff --git a/Functions/Cookie.php b/Functions/Cookie.php index 81adf99..27917fc 100644 --- a/Functions/Cookie.php +++ b/Functions/Cookie.php @@ -4,9 +4,9 @@ * * This class is used for manipulation of cookies. * - * @version 3.0 + * @version 1.1.2 * @author Joey Kimsey - * @link https://TheTempusProject.com/Core + * @link https://TheTempusProject.com/libraries/Bedrock * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ namespace TheTempusProject\Bedrock\Functions; diff --git a/Functions/Date.php b/Functions/Date.php index 3347a1e..d4edb75 100644 --- a/Functions/Date.php +++ b/Functions/Date.php @@ -4,9 +4,9 @@ * * This class is used to manage date inputs in a site-wide repeatable way. * - * @version 3.0 + * @version 1.1.2 * @author Joey Kimsey - * @link https://TheTempusProject.com/Core + * @link https://TheTempusProject.com/libraries/Bedrock * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ namespace TheTempusProject\Bedrock\Functions; diff --git a/Functions/Hash.php b/Functions/Hash.php index 5dc0b4b..e54bcd8 100644 --- a/Functions/Hash.php +++ b/Functions/Hash.php @@ -4,9 +4,9 @@ * * This class is used to salt, hash, and check passwords. * - * @version 3.0 + * @version 1.1.2 * @author Joey Kimsey - * @link https://TheTempusProject.com/Core + * @link https://TheTempusProject.com/libraries/Bedrock * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ namespace TheTempusProject\Bedrock\Functions; diff --git a/Functions/Input.php b/Functions/Input.php index c5b1cc8..0835908 100644 --- a/Functions/Input.php +++ b/Functions/Input.php @@ -4,9 +4,9 @@ * * This class manages and returns GET, FILE, and POST variables. * - * @version 3.0 + * @version 1.1.2 * @author Joey Kimsey - * @link https://TheTempusProject.com/Core + * @link https://TheTempusProject.com/libraries/Bedrock * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ namespace TheTempusProject\Bedrock\Functions; diff --git a/Functions/Sanitize.php b/Functions/Sanitize.php index e700fd7..5210b3d 100644 --- a/Functions/Sanitize.php +++ b/Functions/Sanitize.php @@ -4,9 +4,9 @@ * * This class is used to sanitize user input. * - * @version 3.0 + * @version 1.1.2 * @author Joey Kimsey - * @link https://TheTempusProject.com/Core + * @link https://TheTempusProject.com/libraries/Bedrock * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ namespace TheTempusProject\Bedrock\Functions; diff --git a/Functions/Session.php b/Functions/Session.php index c61aac6..9b7d5dd 100644 --- a/Functions/Session.php +++ b/Functions/Session.php @@ -4,9 +4,9 @@ * * This class is used for management of session data. * - * @version 3.0 + * @version 1.1.2 * @author Joey Kimsey - * @link https://TheTempusProject.com/Core + * @link https://TheTempusProject.com/libraries/Bedrock * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ namespace TheTempusProject\Bedrock\Functions; diff --git a/Functions/Token.php b/Functions/Token.php index dce101e..a59723f 100644 --- a/Functions/Token.php +++ b/Functions/Token.php @@ -4,9 +4,9 @@ * * This class handles form tokens. * - * @version 3.0 + * @version 1.1.2 * @author Joey Kimsey - * @link https://TheTempusProject.com/Core + * @link https://TheTempusProject.com/libraries/Bedrock * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ namespace TheTempusProject\Bedrock\Functions; diff --git a/Functions/Upload.php b/Functions/Upload.php index 8f740ea..92ca2bd 100644 --- a/Functions/Upload.php +++ b/Functions/Upload.php @@ -6,9 +6,9 @@ * * @todo Add the config switches. * - * @version 3.0 + * @version 1.1.2 * @author Joey Kimsey - * @link https://TheTempusProject.com/Core + * @link https://TheTempusProject.com/libraries/Bedrock * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ namespace TheTempusProject\Bedrock\Functions; diff --git a/LICENSE b/LICENSE index c32ae1d..7c6f5af 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 Joey Kimsey +Copyright (c) 2025 Joey Kimsey Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 0f2917b..aa21069 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,70 @@ # Bedrock -## Developer(s): Joey Kimsey - -This library utilizes the MVC architecture in addition to a custom templating engine designed to make building web applications fast and simple. - Bedrock is the core functionality used by [The Tempus Project](https://github.com/TheTempusProject/TheTempusProject) a rapid prototyping framework. It provides database support, configuration, base models, and base controller functionality a in addition to a host of other integrated functions. This Library can be utilized outside of TheTempusProject, but the functionality has not been tested well as a stand-alone library. -**Notice: This Library is provided as is, please use at your own risk.** +## Installation -## Installation and Use +To install simply use the composer command: -The easiest way to use Bedrock in your application is to install it via composer and extend the main app inside of the bin folder. +`php composer.phar require thetempusproject/bedrock` -`Composer.json` +## Usage -```json -"require": { - "TheTempusProject/Bedrock": "*", -}, - -"autoload": { - "psr-4": { - "TheTempusProject\\Bedrock\\": "vendor/thetempusproject/bedrock", - } -} -``` - -`app.php` +Typical usage would be through including the package via composer. ```php - + ``` -If you prefer to handle auto-loading via other means, you can simply clone this repository wherever you need it. +If you would like to use hermes own autoloading, simply inclode the constants file and the autoload file inside `/bin/`. + +```php + +use TheTempusProject\Bedrock\Bin\Bedrock; + +// Bedrock Constants +if ( ! defined( 'BEDROCK_CONSTANTS_LOADED' ) ) { + if ( defined( 'BEDROCK_CONFIG_DIRECTORY' ) ) { + require_once BEDROCK_CONFIG_DIRECTORY . 'constants.php'; + } +} + +// Bedrock Autoloader (Autoloader) +if ( ! defined( 'BEDROCK_AUTOLOADED' ) ) { + if ( defined( 'BEDROCK_ROOT_DIRECTORY' ) ) { + require_once BEDROCK_ROOT_DIRECTORY . 'bin' . DIRECTORY_SEPARATOR . 'autoload.php'; + } +} + +class MyApp extends Bedrock { + // "Stuff", "Things", and "What-not" +} + +``` ### To-Do - [ ] Expansion of PDO to allow different database types - [ ] Updates for configs and models to re-build based on a delta model, to make version changes simpler. (Migration system) - [ ] Implement better uniformity in terms of error reporting, exceptions, logging. + +## Issues / Bugs / Contact + +If anyone actually uses this library and runs into any issues, feel free to contact me and I'll look into it. + +[Joey Kimsey](mailto:Joey@thetempusproject.com) - _Lead Developer_ + +[JoeyKimsey.com](https://JoeyKimsey.com) diff --git a/composer.json b/composer.json index 6479a55..47b4e45 100644 --- a/composer.json +++ b/composer.json @@ -6,10 +6,12 @@ "minimum-stability": "dev", "keywords": [ + "thetempusproject", + "php", "mvc", "framework" ], - "homepage": "https://git.thetempusproject.com/the-tempus-project/bedrock", + "homepage": "https://thetempusproject.com/libraries/bedrock", "authors": [ { @@ -22,9 +24,9 @@ "require": { "php": ">=8.1.0", - "thetempusproject/canary": "1.0.6", - "thetempusproject/hermes": "1.0.3", - "thetempusproject/houdini": "2.0.2" + "thetempusproject/canary": "1.0.7", + "thetempusproject/hermes": "1.0.5", + "thetempusproject/houdini": "2.0.3" }, "autoload": { diff --git a/composer.lock b/composer.lock index 1d75a2a..ea2c5fe 100644 --- a/composer.lock +++ b/composer.lock @@ -4,15 +4,15 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6621b1244b732ba3424ec89affa7161e", + "content-hash": "a5baf978df78c7223d6c2f4bf2421050", "packages": [ { "name": "thetempusproject/canary", - "version": "1.0.6", + "version": "1.0.7", "source": { "type": "git", "url": "https://git.thetempusproject.com/the-tempus-project/canary", - "reference": "44b2ad688cff933964ec2ff50b408d94c7f51e40" + "reference": "9c48e66bf54e63ba5ad2d4af90306c87b69f7048" }, "require": { "php": ">=8.1.0" @@ -40,22 +40,23 @@ } ], "description": "Functionality for tracking, logging, and sending log messages to chrome for debugging.", - "homepage": "https://git.thetempusproject.com/the-tempus-project/canary", + "homepage": "https://thetempusproject.com/libraries/canary", "keywords": [ "debugging", + "logging", "php", "thetempusproject", "tools" ], - "time": "2025-01-22T01:39:34+00:00" + "time": "2025-02-02T23:02:51+00:00" }, { "name": "thetempusproject/hermes", - "version": "1.0.3", + "version": "1.0.5", "source": { "type": "git", "url": "https://git.thetempusproject.com/the-tempus-project/hermes", - "reference": "4b4e06a98f0f01695bda18de240bb3294d096ef4" + "reference": "802581b1d2d70877ccc75d8954b33efcc05d9371" }, "require": { "php": ">=8.1.0" @@ -82,28 +83,29 @@ "role": "Lead Developer" } ], - "description": "Php functions that aid in routing and redirecting; requests and responses.", - "homepage": "https://git.thetempusproject.com/the-tempus-project/hermes", + "description": "This library handles redirects, provides a common backbone for routing, and can handle autoloading in cases where composer is unavailable.", + "homepage": "https://thetempusproject.com/libraries/hermes", "keywords": [ + "autoloader", "php", "routing", "thetempusproject", "tools" ], - "time": "2025-01-22T01:43:15+00:00" + "time": "2025-02-02T23:22:15+00:00" }, { "name": "thetempusproject/houdini", - "version": "2.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://git.thetempusproject.com/the-tempus-project/houdini", - "reference": "fb027a4ebc327e709ad3da29a4cf112894c2b7e6" + "reference": "4c9c9b60233c4dd7a366758c8436560098761eb5" }, "require": { "php": ">=8.1.0", - "thetempusproject/canary": "1.0.6", - "thetempusproject/hermes": "1.0.3" + "thetempusproject/canary": "1.0.7", + "thetempusproject/hermes": "1.0.5" }, "type": "library", "autoload": { @@ -126,15 +128,15 @@ "role": "Lead Developer" } ], - "description": "Php functions that aid in creating, managing, and displaying frontend components.", - "homepage": "https://git.thetempusproject.com/the-tempus-project/houdini", + "description": "This library handles creating, managing, and displaying frontend components.", + "homepage": "https://thetempusproject.com/libraries/houdini", "keywords": [ "frontend", "php", "thetempusproject", "tools" ], - "time": "2025-01-27T05:02:14+00:00" + "time": "2025-02-02T23:31:11+00:00" } ], "packages-dev": [],