Git methodology

Intro
Git, one of the big known versioning systems, has been in the last couple of years steadily impose itself as the standard solution, slowly overtaking the more traditional SVN.
Github.com has certainly done a great job in providing a stable environment and a community hub where Git could spread. But that alone doesn't explain git's popularity. One particular feature makes Git diffrent from the traditional SVN: it is a distributed system. That might not sound like much, but it's opening the way to more flexibility and ease of use.
However, git can seem a bit hairy to the typical programmer familiarized only to the very basics of versioning systems (skills necessary to work on a project).
I have experimenting a little with git, my purpose being to use git as a fully functional automated production-staging-development workflow.

Codelobster review

Free PHP, HTML, CSS, JavaScript editor (IDE) - Codelobster PHP Edition

Free PHP, HTML, CSS, JavaScript editor (IDE) - Codelobster PHP Edition

For valuable work on creation of sites you need a good comfortable editor necessarily.

Htpasswd Generator

Drupal login externally

Suppose we have a Drupal site and an external application, and we want to use the same login for both. For example, we have an application which does something, but we have our users handled by Drupal, and we need to pass over to the application the information about the current user.

Basically we need to tap into our Drupal's user database table. We also need to use Drupal's $_SESSION, but Drupal stores its sessions in the database by default, and the $_SESSION superglobal remains empty. Instead, we need to use the global $user variable.

Taking this one step further, why not synchronize the logins? By synchronize I mean if we log in into Drupal, we get logged automatically into the application, and vice-versa, when we log in the application, we get logged into the Drupal site automatically . That way, if we navigate from app to Drupal, we don't have to relogin.

speedometer chart

If you want a simple speedometer chart, and google's chart is just not what you want, here's a simple custom solution written in PHP. This should allow you to make any customizations you want.

Bad-Words Validation for Drupal

If you're in the need of a bad-words validation, you might have thought first about an input filter, since Drupal is so into that. To put it simply, it's better to educate the users instead of having them censored.

using JasperReports with php

Installation
  • install JasperServer - bundles java based applications (tomcat, ant) but also mySQL and iReports (don't need to install those on the server)
  • to work with the reports, you'll need to install it locally as well
  • to generate scheduled reports from php, enable SOAP extension for php (php.ini)
  • install SOAP and Net_Dime PEAR libraries for php
Generating a report
  • open IReports: add/create the SQL query, design & build the report
  • start jasper server (tomcat)
  • open jasper

Boost your site speed: server side

If you host your site on a VPS or dedicated server, then you are able to tweak your server and make your site load significantly faster. The fallowing considers a LAMP platform but some parts might be useful for other platforms as well.

The first thing to consider is a PHP accelerator. I recommended eAccelerator. It will not make your site go significantly faster, but is one of those things that you have to have.

Second thing to do is a little database optimization.

Simplest PHP login

If you want to restrict access to a directory, then think .htaccess and http authentication.
This is a solution when http authentication is not an option or if you want to restrict access to a single php script file.
It emulates regular http authentication with all the power & flexibility you get from php.
<?php $username = 'admin'; $password = 'pass'; if ( !isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']) || $_SERVER['PHP_AUTH_USER'] != $username || $_SERVER['PHP_AUTH_PW'] != $password ) { Header("WWW-Authenticate: Basic realm=\"My Protected Page\""); Header("HTTP/1.0 401 Unauthorized"); echo '<html><body> <h1>Rejected!</h1> <big>Wrong Username or Password!</big> </body></html>'; exit; } ?>
Syndicate content