Customizing phpBB3 the Smart Way: Feature-Driven Configuration

phpBB
Customizing phpBB3 the Smart Way: Feature-Driven Configuration
Image generated by ChatGPT (DALL·E)

Let’s assume you have installed phpBB3 to run forums on the web-project you are working on. The forum system was re-skinned and your project manager, seems, is pretty happy for the first. But later he requests some changes, e.g. to prevent users from sending emails to each other within the board. This one is easy; you can disable it globally via ACP. However, the project manager wants only registered users not be able sending emails, when administrators and global moderators are still able to do it. Again, it is not a problem, because phpBB3 provides permissions roles which can be assigned to user groups. So, you go to ACP and create and a new role, e.g. ProjectX Registered User Features, based on existing one (All Features). Now you can set false ‘Can send e-mails’ option of Misc tab in User permissions panel and apply this role for all the registered users. Everything is fine so far, but only until the project manager requests something like ‘user search form in UCP has to be removed for unprivileged users’. You cannot find this feature in role options. We need custom option for user roles.

Drupal Meets MVC: A Smarter Way to Build Websites

Drupal
Drupal Meets MVC: A Smarter Way to Build Websites
Image generated by ChatGPT (DALL·E)

If you ought to build a new site and don’t have time to develop a CMS, you’ll likely take an open source solution. And likely it will be Joomla or Drupal. They seem as most popular. Actually they are similar in many ways. Both provide basic content management frameworks, extensible through plug-ins and customizable via themes. Both focused on block-designed sites which can be often built without any programming at all, just using downloaded theme and configurable set of extensions. So it’s personal what to choose. I prefer Drupal. Its component model seems clearer to me. The documentation is much more explicit then Joomla’s and gallery of ready-to-use modules is really impressive.


MVC on command line

PHP
MVC on command line
Image generated by ChatGPT (DALL·E)

If you work with Zend Framework, you likely tried ZF Console (Zend_Tool on command line). But have you tried to extend it? Why? To have common interface for all your Cli-scripts related to ZF-base project. How do you find the idea to program Cli-scripts in MVC? Zend Framework provides us with the tool to do it.


Real-Time Updates with HTML5: Unlocking Server-Sent Events

Real-Time Web
Real-Time Updates with HTML5: Unlocking Server-Sent Events
Image generated by ChatGPT (DALL·E)

Besides, already noted bidirectional communication channel, known as WebSocket, HTML5 propositions include also comet communication pattern by defining Server-Sent Events (SSE). WebSocket widely discussed by now, tons of server implementations are available and you can play already with fluent browser implementation under Chrome. However the second server-push technology of HTML5 yet stays in shadow.

YUI3 vs jQuery

JavaScript
YUI3 vs jQuery
Image generated by ChatGPT (DALL·E)

Everybody time to time comes to the dilemma which JS library to choose for further development. I used to work with prototype coupled with script.aculo.us and now use YUI3 in the office and jQuery at home. I like both of them, though finding each as the best one sui generis. YUI3 is a classical framework that provides design patterns and development philosophy as well as tool. jQuery is meant as a rapid, lightweight, flexible and pretty easy to start library. Its like Ruby on Rails and Python. Ruby and Python as languages are comparable (conceptual elegance against explicit consistency) and you will find APIs of both YUI3 and jQuery are quite similar.

From Chaos to Control: Improving Your PHP Error Handling Workflow

How to
From Chaos to Control: Improving Your PHP Error Handling Workflow
Image generated by ChatGPT (DALL·E)

However fondly you treat your application, errors happen and they happen often when it is being developed. That’s obvious you want to get all the tracing information during the development stage and something like ‘Application Error’ page if the error occurs on the production.

Everybody knows error handler can be set in PHP through set_error_handler. The same about exceptions for which set_exception_handler is used. But it really works only for user-defined errors and uncaught exceptions. It doesn’t affect any of fatal error for instance. Well, PHP has such stuff as register_shutdown_function to deal with them. We can create ErrorHandler class and subscribe the handlers in the beginning of the script

Anonymous Functions and Closures in PHP

PHP
Anonymous Functions and Closures in PHP
Image generated by ChatGPT (DALL·E)

If you are used to switch between JS and PHP programming, it obviously happened to you to miss some of JS flexibility in PHP. I felt it every time when declaring a callback function , being eager to apply something from JS like that...

Source Code Analysis: Code Sniffer

How to
Source Code Analysis: Code Sniffer
Image generated by ChatGPT (DALL·E)

In the previous article we examined the only way of code analysis – PHP tokinizer. But digging deeper you’ll find many of options. Well-known expert of the subject Sebasitan Bergmann points out following.

As far as you see, with such a set of tools you can do whatever you want. But here we are going to discuss the only application, which is known as code sniffing.

Ok, you have some team, working on the projects and, obviously, you have some code convention to adhere. The lead, making code review, checks the compliance with standards by sight. Common, tell me you are not fond of it. There is an amazing tool but again by Sebastian Bergmann so-called PHP CodeSniffer.

Image Slider: Comparing JS, JQuery and YUI3 Implementations

JavaScript
Image Slider: Comparing JS, JQuery and YUI3 Implementations
Image generated by ChatGPT (DALL·E)

First I decided rewrite my old BlogSlideShow JS-class. In fact I have a plan to rewrite all of my old works gaining to update functionally and appearance regarding to nowadays fashion and make better their code. So, after I finished with implementation on fluent JS, without use of any external library I ported it on jQuery. After that I wrote also implementation on YUI3. I’m fond of both those frameworks and found that is a good practice top have the same task solved thrice in different ways. So here is my observations experienced the task.

From Code to Content: Measuring Translation Coverage in Your Project

How to
From Code to Content: Measuring Translation Coverage in Your Project
Image generated by ChatGPT (DALL·E)

Let’s assume our application has a UI translation module. We created dictionary and use terms from there within the code of application components. Everything is clear so far. But one day we begin to suspect that not all of the terms presented in the dictionary are really used within the application. Besides, probably some of terms which are used in components are not available in the dictionary. So we need a script to traverse all the source code files searching translation module use occurrences. Having the list of all encountered terms the script can compare it with the terms of the dictionary.


Persistent Full Duplex Client-Server Connection via Web Socket

Real-Time Web
Persistent Full Duplex Client-Server Connection via Web Socket
Image generated by ChatGPT (DALL·E)

RIA is considered as one of the mostly particular to the modern Web feature, and often stands for the trend, according to which web-applications tend to desktop applications. Nonetheless the approach is very relative. Overwhelming majority of “rich” web-applications is still built on the “request-response” model. I.e. events of the client side can be reflected on the sever side, but not vice-versa. In order to make such a trivial thing as a chat, you have to go with tricks. There are different techniques to emulate bi-directional connections. Usually solutions of the kind are called Comet, thanks to Alex Russell of Dojo.