Compare commits
20 Commits
Author | SHA1 | Date | |
---|---|---|---|
ef4818356c | |||
85ed1def88 | |||
7228e530b8 | |||
92c057ad26 | |||
feea409ac7 | |||
7518461cb9 | |||
233565dcd2 | |||
bfd23ecfe1 | |||
67f5dabfa6 | |||
1f720693d1 | |||
77988e612e | |||
3691c60590 | |||
d6a8f56f7d | |||
bbde55881e | |||
c2d7755ab7 | |||
ce77bdd1ac | |||
5cc61666fe | |||
79f21773c6 | |||
d9f0e86ce1 | |||
5b823f02f1 |
49
.gitlab-ci.yml
Normal file
49
.gitlab-ci.yml
Normal 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/
|
@ -15,7 +15,6 @@ namespace TheTempusProject\Bedrock\Classes;
|
||||
|
||||
use PDO;
|
||||
use PDOException;
|
||||
use TheTempusProject\Houdini\Classes\Pagination;
|
||||
use TheTempusProject\Canary\Bin\Canary as Debug;
|
||||
|
||||
class Database {
|
||||
|
@ -9,7 +9,7 @@
|
||||
* @link https://TheTempusProject.com/Core
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
namespace TheTempusProject\Houdini\Classes;
|
||||
namespace TheTempusProject\Bedrock\Classes;
|
||||
|
||||
use TheTempusProject\Houdini\Classes\Template;
|
||||
use TheTempusProject\Hermes\Functions\Route as Routes;
|
||||
@ -17,6 +17,7 @@ use TheTempusProject\Bedrock\Functions\Input;
|
||||
use TheTempusProject\Bedrock\Classes\Config;
|
||||
use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Canary\Bin\Canary as Debug;
|
||||
use TheTempusProject\Houdini\Classes\Components;
|
||||
|
||||
class Pagination extends Template {
|
||||
//The settings that will not change
|
||||
|
@ -120,40 +120,6 @@
|
||||
if (!defined('BEDROCK_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
|
||||
if (!defined('COMPOSER_JSON_LOCATION')) {
|
||||
define('COMPOSER_JSON_LOCATION', APP_ROOT_DIRECTORY . 'composer.json');
|
||||
|
@ -21,14 +21,17 @@ class Session {
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function exists( $name ) {
|
||||
if ( !Check::sessionName( $name ) ) {
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
if ( ! Check::sessionName( $name ) ) {
|
||||
return false;
|
||||
}
|
||||
$sessionName = DEFAULT_SESSION_PREFIX . $name;
|
||||
if ( isset( $_SESSION[$sessionName] ) ) {
|
||||
if ( isset( $_SESSION[ $sessionName ] ) ) {
|
||||
return true;
|
||||
}
|
||||
Debug::info("Session::exists - Session not found: $sessionName");
|
||||
Debug::info( "Session::exists - Session not found: $sessionName" );
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -39,14 +42,14 @@ class Session {
|
||||
* @return {string|bool} - Returns the data from the session or false if nothing is found..
|
||||
*/
|
||||
public static function get( $name ) {
|
||||
if ( !Check::sessionName( $name ) ) {
|
||||
if ( ! Check::sessionName( $name ) ) {
|
||||
return false;
|
||||
}
|
||||
$sessionName = DEFAULT_SESSION_PREFIX . $name;
|
||||
if ( self::exists( $name ) ) {
|
||||
$sessionName = DEFAULT_SESSION_PREFIX . $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;
|
||||
}
|
||||
|
||||
@ -58,12 +61,15 @@ class Session {
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function put( $name, $data ) {
|
||||
if ( !Check::sessionName( $name ) ) {
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
if ( ! Check::sessionName( $name ) ) {
|
||||
return false;
|
||||
}
|
||||
$sessionName = DEFAULT_SESSION_PREFIX . $name;
|
||||
$_SESSION[$sessionName] = $data;
|
||||
Debug::info("Session: Created: $sessionName");
|
||||
$_SESSION[ $sessionName ] = $data;
|
||||
Debug::info( "Session::get - Created/Updated: $sessionName" );
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -74,16 +80,16 @@ class Session {
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function delete( $name ) {
|
||||
if ( !Check::sessionName( $name ) ) {
|
||||
if ( ! Check::sessionName( $name ) ) {
|
||||
return false;
|
||||
}
|
||||
$sessionName = DEFAULT_SESSION_PREFIX . $name;
|
||||
if ( self::exists( $name ) ) {
|
||||
$sessionName = DEFAULT_SESSION_PREFIX . $name;
|
||||
unset( $_SESSION[$sessionName] );
|
||||
Debug::info("Session::deleted: $sessionName");
|
||||
Debug::info( "Session::delete - Deleted $sessionName" );
|
||||
return true;
|
||||
}
|
||||
Debug::error("Session::delete - Session not found.");
|
||||
Debug::error( "Session::delete - Session not found." );
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -97,7 +103,7 @@ class Session {
|
||||
* @return bool|string - Returns bool if creating, and a string if the check is successful.
|
||||
*/
|
||||
public static function checkFlash( $name ) {
|
||||
if ( !Check::sessionName( $name ) ) {
|
||||
if ( ! Check::sessionName( $name ) ) {
|
||||
return false;
|
||||
}
|
||||
if ( self::exists( $name ) ) {
|
||||
@ -110,10 +116,10 @@ class Session {
|
||||
}
|
||||
|
||||
public static function flash( $name, $data = null ) {
|
||||
if ( !Check::sessionName( $name ) ) {
|
||||
if ( ! Check::sessionName( $name ) ) {
|
||||
return false;
|
||||
}
|
||||
if ( !empty( $data ) ) {
|
||||
if ( ! empty( $data ) ) {
|
||||
self::put( $name, $data );
|
||||
Debug::info("Session::flash - Session created.");
|
||||
return true;
|
||||
|
14
composer.lock
generated
14
composer.lock
generated
@ -12,7 +12,7 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://git.thetempusproject.com/the-tempus-project/canary",
|
||||
"reference": "7746eb4af73f3eaba040d547904a251bbdab6977"
|
||||
"reference": "7ce988fbd95c0d9b975e7647f2e4d7ee3d5e3aad"
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1.0"
|
||||
@ -48,7 +48,7 @@
|
||||
"thetempusproject",
|
||||
"tools"
|
||||
],
|
||||
"time": "2024-08-09T04:35:45+00:00"
|
||||
"time": "2024-08-10T18:58:57+00:00"
|
||||
},
|
||||
{
|
||||
"name": "thetempusproject/hermes",
|
||||
@ -56,7 +56,7 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://git.thetempusproject.com/the-tempus-project/hermes",
|
||||
"reference": "9d6a79d80be98d0e598ce08c47a98d37814d1105"
|
||||
"reference": "171183c0abdbbdf12b3b577821636dd1c51ec752"
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1.0"
|
||||
@ -92,7 +92,7 @@
|
||||
"thetempusproject",
|
||||
"tools"
|
||||
],
|
||||
"time": "2024-08-08T05:24:32+00:00"
|
||||
"time": "2024-08-13T02:56:27+00:00"
|
||||
},
|
||||
{
|
||||
"name": "thetempusproject/houdini",
|
||||
@ -100,7 +100,7 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://git.thetempusproject.com/the-tempus-project/houdini",
|
||||
"reference": "3de98733ac32c0a6e1a3230cbccfa33263e399be"
|
||||
"reference": "4d2ccfb1c5f18dba9886405e7e6e2264e04e1f89"
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1.0",
|
||||
@ -137,7 +137,7 @@
|
||||
"thetempusproject",
|
||||
"tools"
|
||||
],
|
||||
"time": "2024-08-09T04:56:06+00:00"
|
||||
"time": "2024-08-13T03:43:46+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
@ -150,5 +150,5 @@
|
||||
"php": ">=8.1.0"
|
||||
},
|
||||
"platform-dev": [],
|
||||
"plugin-api-version": "2.3.0"
|
||||
"plugin-api-version": "2.6.0"
|
||||
}
|
||||
|
Reference in New Issue
Block a user