Category: PHP

  • PhalconPHP: Not Just For High-load Apps

    I hope you’ve enjoyed this brief overview of PhalconPHP’s killing features and the accompanying simple example of a Phalcon project. Obviously, I didn’t cover all the possibilities of this framework since it’s impossible to describe all of them in one article, but fortunately Phalcon has brilliantly detailed documentation with seven marvelous tutorials which help you understand almost everything about…

  • Disadvantages

    As you can see, Phalcon is really cool, but like other frameworks, it has its disadvantages, the first of which is the same as its main advantage—it’s a compiled C extension. That’s why there is no way for you to change its code easily. Well, if you know C, you can try to understand its…

  • Creating Models with Phalcon Dev Tools

    If you use a contemporary IDE, you’re probably used to code highlighting and completion. Likewise, in a typical PHP framework, you can include a folder with a framework to go to a function declaration just in one click. Seeing as Phalcon is an extension, we don’t get this option automatically. Fortunately, there is a tool…

  • Implementing a RESTful Core

    What makes a web project RESTful? According to Wikipedia, there are three main parts to a RESTful application: – A base URL – An internet media type that defines state transition data elements – Standard HTTP methods (GET, POST, PUT, DELETE) and standard HTTP response codes (200, 403, 400, 500, etc). In our project, base URLs will be placed…

  • Project Structure and Configuration

    First of all, create the initial project structure. While Phalcon lets you use any structure you like, the structure I chose for this exercise partly implements an MVC-pattern. We have no views because it’s a RESTful project, but we have controllers and models, each with their own folder, and services. Services are the classes that…

  • Building a RESTful API

    Almost all permutations of a RESTful application have one thing in common: a User entity. So, for our example project, we will create a tiny REST application to create, read, update, and delete users, (also known as CRUD). You can see this project fully completed at my GitLab repository. There are two branches there because I decided to divide…

  • Two Types of Phalcon Projects: Full-stack and Micro

    Generally, there are two types of MVC frameworks: full-stack frameworks (like Symfony, Yii) and micro frameworks (like Lumen, Slim, Silex). Full-stack frameworks are a good choice for a big project since they provide more functionality, but they need a bit more qualification and time to run. Micro frameworks allow you to create lightweight prototypes very…

  • PhalconPHP Benchmarks

    The official benchmarks are five years old—too old to be valid now, but even then you can see dramatically what distinguishes PhalconPHP. Let’s look at something newer. In a 2016 comparison, Phalcon places top five—an obvious leader among the professional frameworks, and conceding only to raw PHP and some micro frameworks. So, Phalcon is fast. Raw PHP is…

  • What Is PhalconPHP?

    PhalconPHP is an MVC framework for PHP written in C and supplied as a compiled PHP extension. This is what makes it one of the fastest frameworks available (to be completely honest the fastest one is Yaf, but it is a micro framework and has much, much more limited functionality than Phalcon). PhalconPHP doesn’t need…