Batteries for Phalcon PHP framework

adhocore

Jitendra

Posted on August 26, 2018

Batteries for Phalcon PHP framework

So you use phalconphp and like the speed and simplicity of it but miss some cool things and neat ways to do something? I did too. So I ended up writing a thin plug and play wrapper for phalcon that does basically many of the things you wished were in phalcon already.

GitHub logo adhocore / phalcon-ext

Foundations, adapters, extensions, middlewares and utilities for Phalcon

adhocore/phalcon-ext

Useful phalcon adapters, middlewares, extensions and utilities!

Travis Build Latest Version Scrutinizer CI Codecov branch StyleCI Software License Donate 15 Donate 25 Donate 50 Tweet

Installation

composer require adhocore/phalcon-ext
Enter fullscreen mode Exit fullscreen mode

What's included

Cache

Cli

Db

Di

Http

Logger

Mail

Util

Validation

View


Cache.Redis

Extends Phalcon\Cache\Backend\Redis to allow access over the underlying redis binding.

Setup

$di->setShared('redis', function () {
    return new \PhalconExt\Cache\Redis(new \Phalcon\Cache\Frontend\None(['lifetime' => 0]));
});

// Call native \Redis methods like:
$di->get('redis')->getConnection()->hGet();
$di->get('redis')->getConnection()->info();
Enter fullscreen mode Exit fullscreen mode

Cli.Extension

Definitely check how it works in adhocore/cli and how it is integrated & used in example/cli, example/MainTask.php

Setup

Enter fullscreen mode Exit fullscreen mode

Ignite your phalcon app with this multipurpose library. It is a collection of extensions/adapters/middlewares and utilities to make development with phalcon fun, elegant and easy. You can also build cool console interfaces and schedule tasks like a pro :)

What's included

  • powerful dynamic di resolver
  • common middlewares (cache, auth, cors, throttle ...) for the web and console
  • a well architected middlware pattern common for both micro+mvc app
  • extra logging utilities
  • mailer on top of swiftmailer
  • easy to use validation: the same way we all did in laravel before and loved it
  • thin twig bridge so you can use twig template natively alongside volt
  • neat, powerful argv parser for cli and task scheduler
  • jwt auth for APIs (as middleware) if you like
  • query logger with full control of traces

Besides, It has fully covered test cases, complete documentation and illustrative examples for many usecases. And not to mention it gracefully mediates the parity of doing things in mvc or micro mode presenting you one consistent common approach.

Scrutinizer score: 10/10

Thanks for reading, please try out and give some feedbacks. Any contribution would be received with thanks.

Happy hacking. :)

/Ahc

💖 💪 🙅 🚩
adhocore
Jitendra

Posted on August 26, 2018

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related