background preloader

PHP

Facebook Twitter

PHP. Server-side scripting language PHP: Hypertext Preprocessor (or simply PHP) is a server-side scripting language designed for Web development.

PHP

It was originally created by Rasmus Lerdorf in 1994;[4] the PHP reference implementation is now produced by The PHP Group.[5] PHP originally stood for Personal Home Page,[4] but it now stands for the recursive initialism PHP: Hypertext Preprocessor.[6] The standard PHP interpreter, powered by the Zend Engine, is free software released under the PHP License. PHP has been widely ported and can be deployed on most web servers on almost every operating system and platform, free of charge.[8] The PHP language evolved without a written formal specification or standard until 2014, with the original implementation acting as the de facto standard which other implementations aimed to follow. History[edit] Early history[edit] PHP/FI could be used to build simple, dynamic web applications. Less PHP Database Code Using The Factory Design Pattern. It's PHP design pattern time again!

Less PHP Database Code Using The Factory Design Pattern

Today I'll show a simple way to Encapsulate database access in a classMake queries return objects rather than records or arraysReduce code to process database results All this is achieved by using the factory pattern. Read on! It usually is a good idea to encapsulate database access into a class. If you start to wrap db code fragments into a class, however, you'll notice that having hidden MySQL inside a neat little class, you still have code like while ($record = mysql_fetch_array($dbHandle)) doSomething($record); spread all over your application.

Well, not necessarily. The idea of the factory pattern is to use a function to create an instance of a class rather than calling the constructor using new. Let's start with a simple class like this one: PHP: Hypertext Preprocessor.

DeBugging

Geolocation. Compile and Publish. PHP: Get Download. Date. Most spreadsheet programs have a rather nice little built-in function called NETWORKDAYS to calculate the number of business days (i.e.

date

Monday-Friday, excluding holidays) between any two given dates. I couldn't find a simple way to do that in PHP, so I threw this together. It replicates the functionality of OpenOffice's NETWORKDAYS function - you give it a start date, an end date, and an array of any holidays you want skipped, and it'll tell you the number of business days (inclusive of the start and end days!) Between them. I've tested it pretty strenuously but date arithmetic is complicated and there's always the possibility I missed something, so please feel free to check my math. The function could certainly be made much more powerful, to allow you to set different days to be ignored (e.g. <? Function networkdays($s, $e, $holidays = array()) { if ($s > $e) return networkdays($e, $s, $holidays); $sd = date("N", $s); $ed = date("N", $e); // Calculate net working days. Return $nwd; } ? Installing Zend framework with PHPUnit test (Kick Start) Today i am exploring heavily in linux and deeply fall in love with this OS, and believe command line is friend. well so this is how i install ZF and PHPUnit test,sudo apt-get install zend-framework to confirm about installation with version check, zf show version it will show the current version of zf. now we need to install the PHPUnit test to run zf command without any error, sudo apt-get install phpunit sudo pear upgrade pearsudo pear channel-discover pear.phpunit.de sudo pear channel-discover components.ez.no sudo pear channel-discover pear.symfony-project.com sudo pear install –alldeps phpunit/PHPUnit verify that phpunit is works!

Installing Zend framework with PHPUnit test (Kick Start)

Phpunit –version it will show the current phpunit version. so now we are ready to create project. Zend-framework-bin_1.11.11-0ubuntu1_all.deb Ubuntu 12.04.1 LTS Download. Php - Zend framework installation errror. Installing Zend + PHPUnit on Mac OS x with MAMP « unexpected[it] Cd /Applications/MAMP/bin/php5.3/bin sudo chmod 0554 *

Installing Zend + PHPUnit on Mac OS x with MAMP « unexpected[it]

WebDevbyJoss: Easy start with Jenkins for PHP developer. Lets look into the quick and minimal Jenkins setup for middle sized fast growing PHP project.

WebDevbyJoss: Easy start with Jenkins for PHP developer

In order to easy follow this article you should at least:have PEAR installed on serveruse phpUnit for unit testsbuild your app with Phing On my Ubuntu 12.04 LTS its only four CLI commands: # wget -q -O - | sudo apt-key add - # sudo sh -c 'echo deb binary/ > /etc/apt/sources.list.d/jenkins.list'