Category: Other



Aspect-oriented programming & PHP

Other
Aspect-oriented programming & PHP

Aspect-oriented programming (AOP) is a programming paradigm that allow to increase modularity by provide better options regarding the separation of cross-cutting concerns.

PHP currently hasn't native support for AOP, but from PHP v5.4 are at least are few solutions provided by community that can support AOP usage in PHP.

Read More

Concrete5 a CMS easy to use, suitable for small and medium websites!

Other
Concrete5 a CMS easy to use, suitable for small and medium websites!

Concrete5 is a relative new CMS on the market, written in PHP and even if first beginnings are somewhere in 2003, only from 2012 was started to be updated with regularity

From the beginning was design to be very user friendly CMS, to require small level of knowledge in order to be able to use it

Read More

PHP coding standards

Other
PHP coding standards

Coding standards are very important in any programming language. Until now was developed all kinds of coding standard conventions by major php application communities like Zend, Symfony, Drupal and so on. But PHP as language had no any type of standard regarding coding style.

 

Read More

PHP countdown timer

Other
PHP countdown timer

I had to made ​​a few days ago, a php countdown timer, which runs from the command line, for educational purposes.

Script receive as input a number of seconds that converts then in days, hours, minutes, seconds, and display time. If receive another parameter t after display time it starts to countdown.

Read More

Url encoding

Other

URL(s) can only be sent over the Internet using the ASCII character-set. Often especial when we generate when automatically generating url(s) we need to make sure that contains only ASCII character-set

To ensure that our url(s) contain all the time only allowed characters we can encode url(s). For this PHP has few handy functions (like urlencode, rawurlencode) that make all work for us.

Read More

Get User IP Address

Other

The simplest way to get ip address of is to use server variable $_SERVER['REMOTE_ADDR']. Ip address of user can be used for logging, statistics, geo-targeting or ban systems.

Anyway sometimes $_SERVER['REMOTE_ADDR']. is not real IP address, when user for example using a proxy. So for more accurate detection of user IP address we need a little bit more code.

Read More

PHP Magic Constants

Other

In developing process, if you want to store a value that will remain the same along your script’s execution, you can define a constant.

Also PHP has some magic constants like PHP_VERSION, __LINE__, __FILE__, E_ERROR, __DIR__, __FUNCTION__, __CLASS__, and __METHOD__, E_ALL and others wixh can help you in your application development.

Read More

PHP Data Types

Other

A data type is defined as a set of entities and the allowable operations on those values. Almost all programming languages explicitly include the notion of data type, though other languages may use different terminology.

And PHP has defined several data types.

Read More

PHP 5.4 - what,s new?

Other

This article contains few words about what is new and what was changed in PHP 5.4.

Here are some main features of php 5.4:

Read More

About TDD

Other

Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle: first the developer writes a failing automated test case that defines a desired improvement or new function, then produces code to pass that test and finally refactors the new code to acceptable standards.

In test-driven development a developer creates automated unit tests that define code requirements then immediately writes the code itself. The tests contain assertions that are either true or false. Passing the tests confirms correct behavior as developers evolve and refactor the code. Developers often use testing frameworks, such as xUnit, to create and automatically run sets of test cases.

Read More

PHPUnit Annotations

Other
An annotation is a special form of syntactic metadata that can be added to the source code of some programming languages. While PHP has no dedicated language feature for annotating source code, the usage of tags such as @annotation arguments in documentation block has been established in the PHP community to annotate source code.
With PHPUnit annotations you can write PHPUnit tests in a simle and unconventional way.

Read More

PHP Security Guide: Overview

Other

What Is Security?

Security is an important aspect to take into consideration for any web application. Security must be balanced with expense, usability. Security increase the value of your application and spares you of possible future problems.

Read More

PHP Developing Guide

Other

Even if nowadays most of web php application are written using various frameworks, or platforms for a beginner i consider that first of all he should learn to develop application in pure PHP code. For those who continue to develop, web application using pure PHP code i present below some usefull functions/ piece of code used in developing php application from scratch. 1. Function that connect to db.

        

Read More

PHP Intro

Other
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.

PHP is an open-source program, which means it's available for free on the Web. PHP can also be used across many platforms, such as Linux, many variations of the Unix system, Mac OS X and Microsoft Windows. PHP is a complete programming language and can be used for functions such as server-side scripting (using a web server to fulfill a user's request by running a script directly on the web server to generate dynamic HTML pages) or even writing desktop applications.

Read More