21 Commits
1.0.1 ... 1.0.7

Author SHA1 Message Date
85ed1def88 session bugfixes 2024-08-13 02:25:11 -04:00
7228e530b8 bugfix for pagination 2024-08-13 01:16:12 -04:00
92c057ad26 Merge remote-tracking branch 'origin/update_PHP_deps_20240813035025' 2024-08-12 23:53:07 -04:00
feea409ac7 Update PHP dependencies [20240813035025] 2024-08-13 03:50:27 +00:00
7518461cb9 prevent runaway 2024-08-12 23:39:43 -04:00
233565dcd2 Merge remote-tracking branch 'origin/update_PHP_deps_20240813033415' 2024-08-12 23:39:32 -04:00
bfd23ecfe1 Update PHP dependencies [20240813033415] 2024-08-13 03:34:17 +00:00
67f5dabfa6 prevent runaway dependency branching 2024-08-12 23:31:15 -04:00
1f720693d1 Merge remote-tracking branch 'origin/update_PHP_deps_20240813024539' 2024-08-12 22:46:17 -04:00
77988e612e Update PHP dependencies [20240813024539] 2024-08-13 02:45:40 +00:00
3691c60590 Merge remote-tracking branch 'origin/update_PHP_deps_20240813024120' 2024-08-12 22:45:31 -04:00
d6a8f56f7d Update PHP dependencies [20240813024120] 2024-08-13 02:41:21 +00:00
bbde55881e Merge remote-tracking branch 'origin/update_PHP_deps_20240813023702' 2024-08-12 22:41:14 -04:00
c2d7755ab7 Update PHP dependencies [20240813023702] 2024-08-13 02:37:04 +00:00
ce77bdd1ac add gitlab pipeline 2024-08-12 22:36:55 -04:00
5cc61666fe bugfixes 2024-08-12 22:32:44 -04:00
79f21773c6 canary and houdini updates 2024-08-09 17:18:24 -04:00
d9f0e86ce1 bugfix + composer version bumps 2024-08-09 02:22:58 -04:00
5b823f02f1 remove dumb constants 2024-08-09 02:04:04 -04:00
f80f7bed6b more fixes for composer use 2024-08-09 01:35:47 -04:00
e3cf6beebb code fixes to support composer 2024-08-09 01:00:02 -04:00
19 changed files with 119 additions and 93 deletions

49
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,49 @@
stages:
- update
variables:
TIMEZONE: "America/New_York" # For the system in general
DATE_TIMEZONE: ${TIMEZONE} # For PHP
GIT_DEPTH: 1
GITLAB_API_URL: ${CI_API_V4_URL}
TARGET_BRANCH: ${CI_COMMIT_REF_NAME} # This is the branch chosen in the `Pipeline Schedule`
TARGET_REMOTE: "https://${GITLAB_USERNAME}:${GITLAB_ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}.git"
# These could/should be overridden in an extending job:
UPDATE_BRANCH_PREFIX: "update_PHP_deps_" # Used for the update branch name, it will be followed by the datetime
GIT_USER: "DependBot" # Used for the update commit
GIT_EMAIL: "webmaster@thetempusproject.com" # Used for the update commit
GITLAB_USERNAME: "root" # Used for pushing the new branch and opening the MR
GITLAB_ACCESS_TOKEN: "glpat-PKEmivGtBfbz4DVPdhzk" # Used for pushing the new branch and opening the MR
MERGE_IF_SUCCESSFUL: "true" # Set to true, to merge automatically if the pipeline succeeds
SECONDS_BETWEEN_POOLING: 10 # Nbr of seconds between checking if the MR pipeline is successful, so then it will merge
JOB_GIT_FLAGS: ""
JOB_CURL_FLAGS: ""
JOB_COMPOSER_FLAGS: ""
composer_update:
stage: update
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
image: composer:latest
interruptible: true # allows to stop the job if a newer pipeline starts, saving resources and allowing new jobs to start because job concurrency is limited
script:
- git ${JOB_GIT_FLAGS} fetch origin ${TARGET_BRANCH}
- git ${JOB_GIT_FLAGS} checkout ${TARGET_BRANCH}
- git reset --hard origin/main
- export DATE_TIME="$(date '+%Y%m%d%H%M%S')"
- export MR_BRANCH="${UPDATE_BRANCH_PREFIX}${DATE_TIME}"
- git ${JOB_GIT_FLAGS} checkout -b "${MR_BRANCH}"
- composer update ${JOB_COMPOSER_FLAGS}
- if [ "$(git diff)" == "" ]; then echo "No updates needed!"; exit 0; fi
- export TITLE="Update PHP dependencies [${DATE_TIME}]"
- git ${JOB_GIT_FLAGS} commit -a -m "${TITLE}"
- git ${JOB_GIT_FLAGS} push "${TARGET_REMOTE}" "${MR_BRANCH}"
artifacts:
paths:
- vendor/
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- vendor/

View File

@ -14,7 +14,7 @@
*/ */
namespace TheTempusProject\Bedrock\Bin; namespace TheTempusProject\Bedrock\Bin;
use TheTempusProject\Canary\Canary as Debug; use TheTempusProject\Canary\Bin\Canary as Debug;
use TheTempusProject\Hermes\Functions\Route as Routes; use TheTempusProject\Hermes\Functions\Route as Routes;
use TheTempusProject\Bedrock\Functions\Input; use TheTempusProject\Bedrock\Functions\Input;
use TheTempusProject\Bedrock\Functions\Check; use TheTempusProject\Bedrock\Functions\Check;
@ -46,8 +46,8 @@ class Bedrock {
Debug::group( 'Bedrock Application' ); Debug::group( 'Bedrock Application' );
ob_start(); ob_start();
self::$activeConfig = new Config( CONFIG_JSON ); self::$activeConfig = new Config( CONFIG_JSON );
set_error_handler( [ 'TheTempusProject\\Canary\\Canary', 'handle_error' ] ); set_error_handler( [ BEDROCK_DEFAULT_ERROR_HANDLER, 'handle_error' ] );
set_exception_handler( [ 'TheTempusProject\\Canary\\Canary', 'handle_exception' ] ); set_exception_handler( [ BEDROCK_DEFAULT_EXCEPTION_HANDLER, 'handle_exception' ] );
self::$controllerName = DEFAULT_CONTROLLER_CLASS; self::$controllerName = DEFAULT_CONTROLLER_CLASS;
self::$methodName = DEFAULT_CONTROLLER_METHOD; self::$methodName = DEFAULT_CONTROLLER_METHOD;
$this->setUrl( $url ); $this->setUrl( $url );

View File

@ -11,7 +11,7 @@
*/ */
namespace TheTempusProject\Bedrock\Classes; namespace TheTempusProject\Bedrock\Classes;
use TheTempusProject\Canary\Canary as Debug; use TheTempusProject\Canary\Bin\Canary as Debug;
use TheTempusProject\Bedrock\Functions\Check; use TheTempusProject\Bedrock\Functions\Check;
use TheTempusProject\Bedrock\Functions\Input; use TheTempusProject\Bedrock\Functions\Input;

View File

@ -14,7 +14,7 @@
*/ */
namespace TheTempusProject\Bedrock\Classes; namespace TheTempusProject\Bedrock\Classes;
use TheTempusProject\Canary\Canary as Debug; use TheTempusProject\Canary\Bin\Canary as Debug;
use TheTempusProject\Bedrock\Functions\Session; use TheTempusProject\Bedrock\Functions\Session;
use TheTempusProject\Houdini\Classes\Issues; use TheTempusProject\Houdini\Classes\Issues;

View File

@ -16,7 +16,7 @@ namespace TheTempusProject\Bedrock\Classes;
use Exception; use Exception;
use TheTempusProject\Hermes\Functions\Redirect; use TheTempusProject\Hermes\Functions\Redirect;
use TheTempusProject\Canary\Canary as Debug; use TheTempusProject\Canary\Bin\Canary as Debug;
class CustomException extends Exception { class CustomException extends Exception {
private $originFunction = null; private $originFunction = null;

View File

@ -15,8 +15,7 @@ namespace TheTempusProject\Bedrock\Classes;
use PDO; use PDO;
use PDOException; use PDOException;
use TheTempusProject\Houdini\Classes\Pagination; use TheTempusProject\Canary\Bin\Canary as Debug;
use TheTempusProject\Canary\Canary as Debug;
class Database { class Database {
public static $instance = null; public static $instance = null;

View File

@ -12,7 +12,7 @@
*/ */
namespace TheTempusProject\Bedrock\Classes; namespace TheTempusProject\Bedrock\Classes;
use TheTempusProject\Canary\Canary as Debug; use TheTempusProject\Canary\Bin\Canary as Debug;
use TheTempusProject\Bedrock\Functions\Check; use TheTempusProject\Bedrock\Functions\Check;
use TheTempusProject\Bedrock\Bedrock; use TheTempusProject\Bedrock\Bedrock;

View File

@ -11,7 +11,7 @@
*/ */
namespace TheTempusProject\Bedrock\Classes; namespace TheTempusProject\Bedrock\Classes;
use TheTempusProject\Canary\Canary as Debug; use TheTempusProject\Canary\Bin\Canary as Debug;
use TheTempusProject\Bedrock\Classes\Config; use TheTempusProject\Bedrock\Classes\Config;
use TheTempusProject\Bedrock\Classes\Database; use TheTempusProject\Bedrock\Classes\Database;

View File

@ -9,14 +9,14 @@
* @link https://TheTempusProject.com/Core * @link https://TheTempusProject.com/Core
* @license https://opensource.org/licenses/MIT [MIT LICENSE] * @license https://opensource.org/licenses/MIT [MIT LICENSE]
*/ */
namespace TheTempusProject\Houdini\Classes; namespace TheTempusProject\Bedrock\Classes;
use TheTempusProject\Houdini\Classes\Template; use TheTempusProject\Houdini\Classes\Template;
use TheTempusProject\Hermes\Functions\Route as Routes; use TheTempusProject\Hermes\Functions\Route as Routes;
use TheTempusProject\Bedrock\Functions\Input; use TheTempusProject\Bedrock\Functions\Input;
use TheTempusProject\Bedrock\Classes\Config; use TheTempusProject\Bedrock\Classes\Config;
use TheTempusProject\Bedrock\Functions\Check; use TheTempusProject\Bedrock\Functions\Check;
use TheTempusProject\Canary\Canary as Debug; use TheTempusProject\Canary\Bin\Canary as Debug;
class Pagination extends Template { class Pagination extends Template {
//The settings that will not change //The settings that will not change

View File

@ -65,6 +65,12 @@
if (!defined('CANARY_ENABLED')) { if (!defined('CANARY_ENABLED')) {
define('CANARY_ENABLED', false); define('CANARY_ENABLED', false);
} }
if (!defined('BEDROCK_DEFAULT_ERROR_HANDLER')) {
define('BEDROCK_DEFAULT_ERROR_HANDLER', 'TheTempusProject\\Canary\\Bin\\Canary');
}
if (!defined('BEDROCK_DEFAULT_EXCEPTION_HANDLER')) {
define('BEDROCK_DEFAULT_EXCEPTION_HANDLER', 'TheTempusProject\\Canary\\Bin\\Canary');
}
if (!defined('DEBUG_EMAIL')) { if (!defined('DEBUG_EMAIL')) {
define('DEBUG_EMAIL', 'webmaster@' . $_SERVER['HTTP_HOST']); define('DEBUG_EMAIL', 'webmaster@' . $_SERVER['HTTP_HOST']);
} }
@ -114,40 +120,6 @@
if (!defined('BEDROCK_CONFIG_JSON')) { if (!defined('BEDROCK_CONFIG_JSON')) {
define('BEDROCK_CONFIG_JSON', BEDROCK_CONFIG_DIRECTORY . 'config.json'); define('BEDROCK_CONFIG_JSON', BEDROCK_CONFIG_DIRECTORY . 'config.json');
} }
// Shared Directories
if (!defined('APP_ROOT_DIRECTORY')) {
define('APP_ROOT_DIRECTORY', BEDROCK_ROOT_DIRECTORY);
}
if (!defined('CONFIG_DIRECTORY')) {
define('CONFIG_DIRECTORY', BEDROCK_CONFIG_DIRECTORY);
}
if (!defined('BIN_DIRECTORY')) {
define('BIN_DIRECTORY', BEDROCK_BIN_DIRECTORY);
}
if (!defined('VIEW_DIRECTORY')) {
define('VIEW_DIRECTORY', BEDROCK_VIEW_DIRECTORY);
}
if (!defined('ERRORS_DIRECTORY')) {
define('ERRORS_DIRECTORY', BEDROCK_ERRORS_DIRECTORY);
}
if (!defined('CLASSES_DIRECTORY')) {
define('CLASSES_DIRECTORY', BEDROCK_CLASSES_DIRECTORY);
}
if (!defined('FUNCTIONS_DIRECTORY')) {
define('FUNCTIONS_DIRECTORY', BEDROCK_FUNCTIONS_DIRECTORY);
}
if (!defined('RESOURCES_DIRECTORY')) {
define('RESOURCES_DIRECTORY', BEDROCK_RESOURCES_DIRECTORY);
}
if (!defined('TEMPLATE_DIRECTORY')) {
define('TEMPLATE_DIRECTORY', BEDROCK_ROOT_DIRECTORY . 'templates' . DIRECTORY_SEPARATOR);
}
if (!defined('UPLOAD_DIRECTORY')) {
define('UPLOAD_DIRECTORY', BEDROCK_ROOT_DIRECTORY . 'uploads' . DIRECTORY_SEPARATOR);
}
if (!defined('IMAGE_UPLOAD_DIRECTORY')) {
define('IMAGE_UPLOAD_DIRECTORY', BEDROCK_ROOT_DIRECTORY . 'images' . DIRECTORY_SEPARATOR);
}
// Files // Files
if (!defined('COMPOSER_JSON_LOCATION')) { if (!defined('COMPOSER_JSON_LOCATION')) {
define('COMPOSER_JSON_LOCATION', APP_ROOT_DIRECTORY . 'composer.json'); define('COMPOSER_JSON_LOCATION', APP_ROOT_DIRECTORY . 'composer.json');

View File

@ -12,7 +12,7 @@
namespace TheTempusProject\Bedrock\Functions; namespace TheTempusProject\Bedrock\Functions;
use TheTempusProject\Bedrock\Classes\Config; use TheTempusProject\Bedrock\Classes\Config;
use TheTempusProject\Canary\Canary as Debug; use TheTempusProject\Canary\Bin\Canary as Debug;
class Check { class Check {
private static $formValidator = null; private static $formValidator = null;

View File

@ -13,7 +13,7 @@
*/ */
namespace TheTempusProject\Bedrock\Functions; namespace TheTempusProject\Bedrock\Functions;
use TheTempusProject\Canary\Canary as Debug; use TheTempusProject\Canary\Bin\Canary as Debug;
class Code { class Code {
/** /**

View File

@ -11,7 +11,7 @@
*/ */
namespace TheTempusProject\Bedrock\Functions; namespace TheTempusProject\Bedrock\Functions;
use TheTempusProject\Canary\Canary as Debug; use TheTempusProject\Canary\Bin\Canary as Debug;
class Cookie { class Cookie {
/** /**

View File

@ -11,7 +11,7 @@
*/ */
namespace TheTempusProject\Bedrock\Functions; namespace TheTempusProject\Bedrock\Functions;
use TheTempusProject\Canary\Canary as Debug; use TheTempusProject\Canary\Bin\Canary as Debug;
class Hash { class Hash {
/** /**

View File

@ -11,7 +11,7 @@
*/ */
namespace TheTempusProject\Bedrock\Functions; namespace TheTempusProject\Bedrock\Functions;
use TheTempusProject\Canary\Canary as Debug; use TheTempusProject\Canary\Bin\Canary as Debug;
class Input { class Input {
/** /**

View File

@ -11,7 +11,7 @@
*/ */
namespace TheTempusProject\Bedrock\Functions; namespace TheTempusProject\Bedrock\Functions;
use TheTempusProject\Canary\Canary as Debug; use TheTempusProject\Canary\Bin\Canary as Debug;
class Session { class Session {
/** /**
@ -21,6 +21,9 @@ class Session {
* @return {bool} * @return {bool}
*/ */
public static function exists( $name ) { public static function exists( $name ) {
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
if ( ! Check::sessionName( $name ) ) { if ( ! Check::sessionName( $name ) ) {
return false; return false;
} }
@ -42,11 +45,11 @@ class Session {
if ( ! Check::sessionName( $name ) ) { if ( ! Check::sessionName( $name ) ) {
return false; return false;
} }
if ( self::exists( $name ) ) {
$sessionName = DEFAULT_SESSION_PREFIX . $name; $sessionName = DEFAULT_SESSION_PREFIX . $name;
if ( self::exists( $name ) ) {
return $_SESSION[ $sessionName ]; return $_SESSION[ $sessionName ];
} }
Debug::info("Session::get - Session not found: $name"); Debug::info( "Session::get - Session not found: $sessionName" );
return false; return false;
} }
@ -58,12 +61,15 @@ class Session {
* @return {bool} * @return {bool}
*/ */
public static function put( $name, $data ) { public static function put( $name, $data ) {
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
if ( ! Check::sessionName( $name ) ) { if ( ! Check::sessionName( $name ) ) {
return false; return false;
} }
$sessionName = DEFAULT_SESSION_PREFIX . $name; $sessionName = DEFAULT_SESSION_PREFIX . $name;
$_SESSION[ $sessionName ] = $data; $_SESSION[ $sessionName ] = $data;
Debug::info("Session: Created: $sessionName"); Debug::info( "Session::get - Created/Updated: $sessionName" );
return true; return true;
} }
@ -77,10 +83,10 @@ class Session {
if ( ! Check::sessionName( $name ) ) { if ( ! Check::sessionName( $name ) ) {
return false; return false;
} }
if ( self::exists( $name ) ) {
$sessionName = DEFAULT_SESSION_PREFIX . $name; $sessionName = DEFAULT_SESSION_PREFIX . $name;
if ( self::exists( $name ) ) {
unset( $_SESSION[$sessionName] ); unset( $_SESSION[$sessionName] );
Debug::info("Session::deleted: $sessionName"); Debug::info( "Session::delete - Deleted $sessionName" );
return true; return true;
} }
Debug::error( "Session::delete - Session not found." ); Debug::error( "Session::delete - Session not found." );

View File

@ -12,7 +12,7 @@
namespace TheTempusProject\Bedrock\Functions; namespace TheTempusProject\Bedrock\Functions;
use TheTempusProject\Bedrock\Classes\Config; use TheTempusProject\Bedrock\Classes\Config;
use TheTempusProject\Canary\Canary as Debug; use TheTempusProject\Canary\Bin\Canary as Debug;
class Token { class Token {
private static $tokenName; private static $tokenName;

View File

@ -13,7 +13,7 @@
*/ */
namespace TheTempusProject\Bedrock\Functions; namespace TheTempusProject\Bedrock\Functions;
use TheTempusProject\Canary\Canary as Debug; use TheTempusProject\Canary\Bin\Canary as Debug;
class Upload { class Upload {
public static $lastUpload = null; public static $lastUpload = null;

14
composer.lock generated
View File

@ -12,7 +12,7 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://git.thetempusproject.com/the-tempus-project/canary", "url": "https://git.thetempusproject.com/the-tempus-project/canary",
"reference": "7746eb4af73f3eaba040d547904a251bbdab6977" "reference": "7ce988fbd95c0d9b975e7647f2e4d7ee3d5e3aad"
}, },
"require": { "require": {
"php": ">=8.1.0" "php": ">=8.1.0"
@ -48,7 +48,7 @@
"thetempusproject", "thetempusproject",
"tools" "tools"
], ],
"time": "2024-08-09T04:35:45+00:00" "time": "2024-08-10T18:58:57+00:00"
}, },
{ {
"name": "thetempusproject/hermes", "name": "thetempusproject/hermes",
@ -56,7 +56,7 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://git.thetempusproject.com/the-tempus-project/hermes", "url": "https://git.thetempusproject.com/the-tempus-project/hermes",
"reference": "9d6a79d80be98d0e598ce08c47a98d37814d1105" "reference": "171183c0abdbbdf12b3b577821636dd1c51ec752"
}, },
"require": { "require": {
"php": ">=8.1.0" "php": ">=8.1.0"
@ -92,7 +92,7 @@
"thetempusproject", "thetempusproject",
"tools" "tools"
], ],
"time": "2024-08-08T05:24:32+00:00" "time": "2024-08-13T02:56:27+00:00"
}, },
{ {
"name": "thetempusproject/houdini", "name": "thetempusproject/houdini",
@ -100,7 +100,7 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://git.thetempusproject.com/the-tempus-project/houdini", "url": "https://git.thetempusproject.com/the-tempus-project/houdini",
"reference": "008d7d90230f9eee87d8dbe982e55fae433e1337" "reference": "4d2ccfb1c5f18dba9886405e7e6e2264e04e1f89"
}, },
"require": { "require": {
"php": ">=8.1.0", "php": ">=8.1.0",
@ -137,7 +137,7 @@
"thetempusproject", "thetempusproject",
"tools" "tools"
], ],
"time": "2024-08-09T04:38:04+00:00" "time": "2024-08-13T03:43:46+00:00"
} }
], ],
"packages-dev": [], "packages-dev": [],
@ -150,5 +150,5 @@
"php": ">=8.1.0" "php": ">=8.1.0"
}, },
"platform-dev": [], "platform-dev": [],
"plugin-api-version": "2.3.0" "plugin-api-version": "2.6.0"
} }