Download the PHP package gcgov/framework without Composer

On this page you can find all versions of the php package gcgov/framework. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package framework

gcgov/framework

A PHP framework for Garrett County Government, Maryland, USA applications.

The framework can be used to generate a full SSR app or as a rest API. It is primarily used internally to generate APIs. Using the available extensions, a full-fledged API with Microsoft Oauth authentication can be created with no custom code.

Getting Started

The easiest way to start is to use the framework scaffolding project to start a new api and the frontend app template to start a corresponding front end application.

Requirements

Framework package requirements from composer.json:

Install dependencies with Composer:

Minimum Application Contract

The framework expects these app classes/files to exist in your /app directory:

Controllers should implement \gcgov\framework\interfaces\controller.

Required configuration files:

If either file is missing, the framework throws a config exception during request handling.

System Architecture

Application File System

All apps utilizing the framework for an entire lifecycle should use this file structure.

When you start with the framework scaffolding project, you'll automatically start with some extra folders and tools.

Core Files and Application Namespacing

The webserver should point requests to /www/index.php. URL rewriting should route application paths to this file.

gcgov\framework\router routes using $_SERVER['REQUEST_URI'] and $_SERVER['REQUEST_METHOD']. Rewrite rules should preserve the original request path in REQUEST_URI.

CLI requests should point to /app/cli/index.php.

The framework will register namespace \app to the /app directory and requires three core files in the root of /app:

Components

Controllers

\app\controllers

A controller method called by the router must return one of the following supported types. It should always provide a response and never end code execution manually to ensure that the entire application lifecycle is executed.

New controller response types may be added to the framework to support new scenarios by adding the type and setting up rendering methods in \gcgov\framework\renderer

Models

\app\models

Interfaces

\app\interfaces

Exceptions

\app\exceptions

Traits

\app\traits

Services

\app\services

Routing

\app\router method getRoutes() must return an array of \gcgov\framework\models\route that maps the URL path to the controller and defines authentication requirements.

The following route will map incoming GET requests to /structure to controller \app\controllers\structure method getAll. The route requires authentication and the user must have the role Structure.Read to execute the request.

When loading the app via CLI, the method will be CLI instead of a normal HTTP method. CLI routes do not support authentication.

Request Lifecycle

  1. \www\index.php
  2. \app\app::_before()
  3. \app\app::__construct()
  4. \app\router::_before()
  5. \app\router::__construct()
  6. \app\router::route()
  7. \app\router::_after()
  8. \app\renderer::_before()
  9. \app\controllers\{route-controller}::_before()
  10. \app\controllers\{route-controller}::__construct()
  11. \app\controllers\{route-controller}::{route-method}()
  12. \app\controllers\{route-controller}::_after()
  13. \app\renderer::_after()
  14. \app\app::_after()

CLI

Using the framework scaffolding project, you can run the app from CLI with > app/cli/{env}.bat {url-path} Ex: > app/cli/local.bat /structure/cleanup

To enable XDebug on the CLI execution, run > app/cli/local-debug.bat {url-path} Ex: > app/cli/local-debug.bat /structure/cleanup

Framework Services

Formatting

  1. Sanitize file name: \gcgov\framework\services\formatting::fileName( string $fileName, string $replacementForIllegalChars = '-', bool $forceLowerCase = true ): string
  2. Sanitize Excel tab name: \gcgov\framework\services\formatting::xlsxTabName( string $tabName, string $replacementForIllegalChars = ' ', bool $forceLowerCase = false ) : string
  3. Format DateInterval to human readable string: \gcgov\framework\services\formatting::getDateIntervalHumanText( \DateInterval $interval ) : string

GUID

Create a GUID \gcgov\framework\services\guid::create()

HTTP

Get status text for HTTP code \gcgov\framework\services\http::statusText( int $code )

Logging

\gcgov\framework\services\log will automatically create and append a log in /logs with a filename equal to the channel

JWT Auth & Certificates

\gcgov\framework\services\jwtAuth\jwtAuth() provides all JWT authentication mechanisms. Explore the Oauth Server Service and Microsoft Auth Token Exchange extensions before rolling a new solution for authentication.

Microsoft Services

Deprecated - use https://github.com/andrewsauder/microsoftServices instead

MongoDB

Comprehensive database modeling system \gcgov\framework\services\mongodb.

Use this service by defining classes in \app\models that extend \gcgov\framework\services\mongodb\model (top-level collection documents) or \gcgov\framework\services\mongodb\embeddable (nested documents that are not stored as their own collection).

How Models Work

The Mongo model stack is layered like this:

  1. embeddable handles BSON and JSON serialization/deserialization, typemaps, _meta, and validation helpers.
  2. dispatcher handles embedded-model propagation (insert/update/delete in parent collections) and cascade deletion behavior.
  3. factory provides static data access and persistence APIs.
  4. model is the base class your top-level collection models extend.

Every class extending \gcgov\framework\services\mongodb\model must define a public $_id field of type \MongoDB\BSON\ObjectId.

By default, a model's collection name is the class name. You can override this and user-facing names with constants:

Core Model APIs (Static)

Available through any model class (for example \app\models\inspection):

Save and delete operations are transaction-aware. If you do not pass a \MongoDB\Driver\Session, the service opens and manages one for the operation.

Serialization, Typemaps, and _meta

embeddable provides the serialization pipeline used by all models and embedded documents:

Embedded Model Dispatch and Cascading

When saving a model, dispatcher can automatically propagate changes to embedded copies in other collections:

This behavior is driven by typemap + attribute metadata, enabling denormalized Mongo document patterns while keeping embedded data synchronized.

Additional Features Provided by the Mongo Service

For full reference, configuration options, attributes, and detailed examples, see:

PDODB

Initiate PDO connections using SQL connection details in app/config/environment.json. It is only a small wrapper around the native PDO class.

Read user connection: new gcgov\framework\services\pdodb\pdodb(true, $databaseName)

Write user connection: new gcgov\framework\services\pdodb\pdodb(false, $databaseName)

Extensions

Extensions add service or app level functionality to the app that registers them. Extensions may expose new endpoints.


All versions of framework with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
nikic/fast-route Version ^1.3
phpmailer/phpmailer Version ^6.2
mongodb/mongodb Version ^2.1
monolog/monolog Version ^3.4
microsoft/microsoft-graph Version ^1.25
lcobucci/jwt Version ^5.6
lcobucci/clock Version ^2.0
thenetworg/oauth2-azure Version ^2.1
guzzlehttp/guzzle Version ^7.0
andrewsauder/json-deserialize Version ^3.0
chrome-php/chrome Version ^1.16
symfony/validator Version ^7.1
symfony/expression-language Version ^7.1
symfony/property-access Version ^7.1
symfony/console Version ^7.1
symfony/process Version ^7.1
zircote/swagger-php Version ^6.1
hybridauth/hybridauth Version ^3.13
swaggest/json-diff Version ^3.11
google/cloud-kms Version ^2.1
ext-mongodb Version *
ext-fileinfo Version *
ext-pdo Version *
ext-sodium Version *
ext-openssl Version *
spatie/typescript-transformer Version ^2.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package gcgov/framework contains the following files

Loading the files please wait ...