Phpstorm Phalcon



Phalcon framework released. PhpStorm is released with support for Xdebug, PHPUnit, and Zend Framework. PHP 6 officially abandoned. OOP frameworks like Phalcon mainly use this class to encapsulate this functionality and provide information back to the developer or user. Despite being written in C, Phalcon executes methods in the PHP userland, providing the same debugging capabilities as other PHP based frameworks offer.

These tools are a collection of useful scripts to generate skeleton code. Core components of your application can be generated witha simple command, allowing you to easily develop applications using Phalcon.

PhpStorm is written in Java. Users can extend the IDE by installing plugins created for PhpStorm or write their own plugins. The software also communicates with external sources like XDebug. All features available in WebStorm are included in PhpStorm, which adds support for PHP and databases. $ phalcon project -help Phalcon DevTools (4.0.0) Help: Creates a project Usage: project name type directory enable-webtools Arguments: help Shows this help text Example phalcon project store simple Options: -name = s Name of the new project -enable-webtools Determines if webtools should be enabled optional -directory = s Base path. Since Phalcon runs as a PHP extension, its classes are preloaded once you start php-fpm service. Even if Laravel takes advantage of HHVM, its JIT would fall a bit behind a native extension. Of course, the final result depends on how much business logic you throw in, and what other factors are involved in content generation.

Important: Phalcon Framework version 0.5.0 or greater is needed to use developer tools. It is highly recommendedto use PHP 5.3.6 or greater. If you prefer to use the web version instead of the console, this blog post offers more information.

Download¶

You can download or clone a cross platform package containing the developer tools from Github.

Installation¶

Phpstorm Phalcon 10

These are detailed instructions on how to install the developer tools on different platforms:

Getting Available Commands¶

You can get a list of available commands in Phalcon tools by typing: phalcon commands

Generating a Project Skeleton¶

You can use Phalcon tools to generate pre-defined project skeletons for your applications with Phalcon framework. By default theproject skeleton generator will use mod_rewrite for Apache. Type the following command on your web server document root:

The above recommended project structure was generated:

You could add the parameter –help to get help on the usage of a certain script:

Accessing the project from the web server will show you:

Generating Controllers¶

The command “create-controller” generates controller skeleton structures. It’s important to invoke this command inside a directorythat already has a Phalcon project.

The following code is generated by the script:

Preparing Database Settings¶

When a project is generated using developer tools. A configuration file can be found in app/config/config.ini To generate modelsor scaffold, you will need to change the settings used to connect to your database.

Change the database section in your config.ini file:

Generating Models¶

There are several ways to create models. You can create all models from the default database connection or some selectively. Modelscan have public attributes for the field representations or setters/getters can be used. The simplest way to generate a model is:

All table fields are declared public for direct access.

By adding the –get-set you can generate the fields with protected variables and public setter/getter methods. Those methodscan help in business logic implementation within the setter/getter methods.

A nice feature of the model generator is that it keeps changes made by the developer between code generations. This allows theaddition or removal of fields and properties, without worrying about losing changes made to the model itself.The following screencast shows you how it works:

Scaffold a CRUD¶

Scaffolding is a quick way to generate some of the major pieces of an application. If you want to create the models, views, andcontrollers for a new resource in a single operation, scaffolding is the tool for the job.

Once the code is generated, it will have to be customized to meet your needs. Many developers avoid scaffolding entirely, optingto write all or most of their source code from scratch. The generated code can serve as a guide to better understand of how theframework works or develop prototypes. The screenshot below shows a scaffold based on the table “products”:

The scaffold generator will build several files in your application, along with some folders. Here’s a quick overview of what will be generated:

FilePurpose
app/controllers/ProductsController.phpThe Products controller
app/models/Products.phpThe Products model
app/views/layout/products.phtmlController layout for Products
app/views/products/new.phtmlView for the action “new”
app/views/products/edit.phtmlView for the action “edit”
app/views/products/search.phtmlView for the action “search”
app/views/products/edit.phtmlView for the action “edit”

When browsing the recently generated controller, you will see a search form and a link to create a new Product:

The “create page” allows you to create products applying validations on the Products model. Phalcon will automatically validatenot null fields producing warnings if any of them is required.

After performing a search, a pager component is available to show paged results. Use the “Edit” or “Delete” links in front of each result to perform such actions.

Web Interface to Tools¶

Also, if you prefer, it’s possible to use Phalcon Developer Tools from a web interface. Check out the following screencast to figure out how it works:

Integrating Tools with PhpStorm IDE¶

The screencast below shows how to integrate developer tools with the PhpStorm IDE. The configuration steps could be easily adapted to other IDEs for PHP.

Conclusion¶

Phalcon Developer Tools provides an easy way to generate code for your application, reducing development time and potential coding errors.

The Lightning-Smart PHP IDE

PhpStorm deeply
understands your code.

Major frameworks support

PhpStorm is perfect for working with Symfony, Laravel, Drupal, WordPress, Zend Framework, Magento, Joomla!, CakePHP, Yii, and other frameworks.

All the PHP tools

The editor actually 'gets' your code and deeply understands its structure, supporting all the PHP language features for modern and legacy projects. It provides the best code completion, refactorings, on-the-fly error prevention, and more.

Front-end technologies included

Make the most of the cutting edge front-end technologies, such as HTML 5, CSS, Sass, Less, Stylus, CoffeeScript, TypeScript, Emmet, and JavaScript, with refactorings, debugging, and unit testing available. See the changes instantly in the browser thanks to Live Edit.

Built-in developer tools

Perform many routine tasks right from the IDE, thanks to the Version Control Systems integration, support for remote deployment, databases/SQL, command-line tools, Docker, Composer, REST Client, and many other tools.

PhpStorm = WebStorm + PHP + DB/SQL

All the features in WebStorm are included into PhpStorm, with full-fledged support for PHP and Databases/SQL support added on top.

Intelligent Coding Assistance

Hundreds of inspections take care of verifying your code as you type, analyzing the whole project. PHPDoc support, code (re)arranger and formatter, quick-fixes, and other features help you write neat code that is easy to maintain.

Smart Code Navigation

Be the master of your codebase thanks to the efficient, lightning-fast navigation features. The IDE understands where you want to go and gets you there instantly.

Fast and Safe Refactoring

Refactor your code reliably with the safe Rename, Move, Delete, Extract Method, Inline Variable, Push members Up / Pull members Down, Change Signature, and many other refactorings. Language-specific refactorings help you perform project-wide changes in a matter of clicks, which can​ all be safely undone.

Easy Debugging and Testing

PhpStorm is renowned for its zero-configuration Visual Debugger, providing extraordinary insight into what goes on in your application at every step. It works with Xdebug and Zend Debugger, and can be used both locally and remotely. Unit Testing with PHPUnit, BDD with Behat and profiler integration are all also available.

What’s new in PhpStorm 2021.1

Code With Me for pair programming

Code With Me, a new JetBrains service for collaborative development and pair programming, is now bundled with PhpStorm. It allows you to share the project you currently have open in your IDE with others and work on it together in real time.

Built-in preview for HTML and PHP files

With PhpStorm 2021.1, you can get a live-edit experience out of the box, there is no need to set anything up. It works for HTML and linked CSS, JS files, as well as for simple PHP files which will be rendered with a local PHP interpreter.

New inspections to help detect bugs

Phpstorm Phalcon Stubs

PhpStorm adds 20+ new inspections to help prevent possible bugs at early stages. It also comes with quick-fixes to make adjustments to code and small refactorings with one use of Alt+Enter.

Phpstorm

Meet the PhpStorm community

@geeh @phpstorm I'm hooked mate. I've been so productive lately it's silly. Keep up the great work.
@phpstorm's code completion is incredibly useful.
@phpstorm is magical... in a good way. I find myself saying 'oh that's convenient' over and over.

Phpstorm Phalcon Crack

If you are developing in PHP and are not using PhpStorm, you are working too hard.

Phpstorm Phalcon Support

'I'm so spoiled by PhpStorm!'

Phalcon Phpstorm Integration

Join over 600,000
happy PhpStorm users
worldwide!