Download the PHP package a3gz/chubby without Composer

On this page you can find all versions of the php package a3gz/chubby. 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 chubby

Chubby

Adding some fat to Slim Framework.

Chubby provides a working Slim application template around which additional fat is added in two ways: (1) useful classes under the fat directory and (2) as modules.

The first of these modules is Chubby View, a renderer that proposes a very convenient way of organizing code.

Install via Composer

Go to the directory where you want the new application to sit, then create the project:

composer create-project a3gz/chubby -s dev

This will create a new project called chubby.

Once the project has been created you can safely delete the chubby/composer.json file and the chubby/vendor directory. Don't delete the file chubby/private/composer.json thought, this one is wher you add your dependencies.

Chubby needs all required dependencies to sit on the private directory:

> cd chubby/private
> composer install

Finally go to your browser and request:

.../chubby/hello/world

It's very unlikely that you'll want your application to be called chubby, so you may want to rename that directory.

It is also possible to do this when you create the project:

composer create-project a3gz/chubby my-app -s dev

Now your application is in ./my-app.

Running with Docker Compose

docker-compose up [-d]

The provided docker-compose.yml maps to the host's 9999 port so you should be able to see the site in the following local address:

http://localhost:9999

Console request

php console.php path/to/resource

Why Chubby at all?

Chubby is a working application template that offers one possible way to organize a Slim application.

Around that idea Chubby sets the foundations to split the application files in a way that the code can be placed outside the public_html directory, among other things.

Configuration

Chubby assumes the existence of a private/app/config directory containing two directories: config/container and config/settings. Under config/container there must extist at least one file called main.php. This file should return an associateive array with settings that will be injected in the container.

Optionally we can inject additional dependencies by adding more files inside the config/container directory. Each file must return one dependency. Take the provided logger.php for instance:

return function ($c) {
  $time = time();
  $year = date('Y', $time);
  $month = date('m', $time);
  $day = date('d', $time);
  $hour = date('H', $time);
  $baseDir = \Fat\Helpers\Path::makePrivatePath('/logs'
    . '/' . $year
    . '/' . $month
    . '/' . $day
  );
  if (!is_dir($baseDir)) {
    mkdir($baseDir, 0777, true);
  }
  $fileName = "{$year}m{$month}d{$day}h{$hour}.log";
  $logFileName = "{$baseDir}/{$fileName}";

  $logger = new \Monolog\Logger($appName);
  $file_handler = new \Monolog\Handler\StreamHandler($logFileName);
  $logger->pushHandler($file_handler);
  return $logger;
};

Chubby will inject the dependency in the container under the same name as the file, in this case: logger: $container['logger'].

Slim 4

Chubby version ^3 depends on Slim 4.3.0 to keep PHP requirement down to PHP 7.1. If a higher version of PHP is available, changing Slim dependency version to ^4 should work since we are still in the same major version... but I haven't tried this yet.

This version is more opinionated that Chubby ^1 because some of the things that were taken care of by Slim are now under our control. The new directory src/fat contains classes that help with:

Hooks

Version 3 includes hooks and plugins support. Plugins are expected to extist under private/app/plugins. Each plugin must have a file called the same as the plugin's directory. This file must include a header section with at least one entry: type which value must be Plugin for the plugins loader to recognize it as such. Check the demo plugin to see how it works.

Built-in hooks

Name Description
chubby_fallback_theme The name of the fallback theme. If this filter isn't implemented, the falback theme name is default.
chubby_theme Name of the applied theme. Fallbacks to the fallback theme.

Themes

Version 3 includes themes support. Themes can be customized in two levels: styles and views. We can create different stylesheets to change a Web site theme and use the default views. A step further would be to also create custom views for each theme.

In most situations creating stylesheets would be enough but if we also want to change the layout of a view then we need to create specific views for each theme. Note that we only need to create theme specific views for the views we want to override. If we don't override a view, the default one is automatically used.

Check the demo to see hot this works.

Contact the author

I would welcome comments, suggestions and brainstorming-like ideas.

[email protected]


All versions of chubby with dependencies

PHP Build Version
Package Version
No informations.
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 a3gz/chubby contains the following files

Loading the files please wait ....