Better Your Future with Tech Knowledge

Category PHP

Logging Service levels – How it should be in Your Application

Logging Service Objective: Logging in an application should not be just for the sake of logging so it should not lack coverage, consistency, and purpose. It should be the center point of any functionality. A good/proper logging implementation tells the story… Continue Reading →

Using APC(Caching Mechanism) with PHP.

What is PHP APC: Alternative PHP Cache, one of the most popular caching mechanism for PHP’s op-code caching. Once activated, it starts caching PHP codes automatically. Stores PHP pages in RAM and reduces hard disk activity. Works nicely with W3… Continue Reading →

File upload via SFTP using php

Download and Extract the PHP library to the same directory level of PHP script to be used for connecting to a remote server via SFTP: Use the below code to upload the files to the remote server:

Instead… Continue Reading →

PHP Built-in web server

What is PHP Built-in web server: As of PHP 5.4.0, PHP provides a built-in web server. It allows to launch a basic web server for development purposes via the command line, test your code and then shut it down when… Continue Reading →

Style attribute of html editor lost in Codeigniter

Sometimes user copy pastes complete HTML content having CSS styles and HTML elements inside a HTML editor(CKEditor or TinyMCE etc) but CodeIgniter by default filters the styles from the posted data. This style filtering is done in method “_remove_evil_attributes” of… Continue Reading →

PHP Gearman

What is Gearman: Gearman provides a distributed application framework for work with multiple machines or processes. It allows applications to complete tasks in parallel so that large tasks can be done more quickly. A simple example is like a railway… Continue Reading →

SOAP: looks like we got no XML document

Sometimes while doing soap call, it does not return the response result due to an invalid character “” in XML response and throws soap error as “looks like we got no XML document”. Below code snippet is a simple workaround… Continue Reading →

Using DATE_FORMAT in Zend_DB query in Zend Framework

It is very easy to use DATE_FORMAT in simple MySQL query like: $sql = select DATE_FORMAT(STR_TO_DATE(DateTime,’%Y%m%d’),’%Y%m%d’) from table; But to use DATE_FORMAT using Zend_DB query format, query needs to be written in below format in zend framework.  new Zend_Db_Expr (‘DATE_FORMAT(… Continue Reading →

Using usort in php OOPS

Create a static function for sort inside class: private static function merchantSort($a,$b) {        return …// the sort } Call the sort function using below code: $array = $this->someThingThatReturnAnArray(); usort($array, array(‘ClassName’,’merchantSort’));

Fix Page not found error for Zend Framework

If Nothing Works Except the Home Page of ZF1 and ZF2 projects and display 404 error for a page not found Example: Below home page URL is working: http://test/quickstartzf1/public/ But calling any other page like below-mentioned module ‘guestbook’ is not… Continue Reading →

© 2020 Technolize Your Future — Powered by WordPress

Theme by Anders NorenUp ↑