AMT Blog

Anchor CMS – Open Source Blogging Platform for Artists

Get Unique Themes for Every Blog Posts with Anchor CMS

Anchor CMS is an open source content management system, written in PHP5, built for art-directed posts. It is extensible, simple and free. There is a powerful, yet simple theming engine behind Anchor, just waiting to give your posts that unique touch.

Since the beginning, Anchor has been written and maintained by an amazing community of web designers and developers, all working to produce a great product, for free. Anchor features a simple, uncluttered admin interface, so you can be writing blog posts with no distractions.

Anchor CMS is available on GitHub under a WTFPL License, and requires PHP 5.3+ and a MySQL database.

Anchorcms_full

Read more…

Like what we post? Share your thoughts on the comments below. If you wish to get regular updates on what we post, do subscribe to our RSS Feed.

Filed under: CMS Open Source PHP

Phalanger - A PHP Compiler for .Net

Phalanger

This article briefly introduced Phalanger – a PHP compiler for .NET – and several scenarios where it can be used to solve important problems in practice. It was written by Tomas Petricek, A Microsoft C# MVP and F# enthusiast & originally appeared on infoq.

Phalanger is a PHP language compiler and a PHP runtime for .NET. It can be used to compile PHP web projects into .NET bytecode and execute them as ASP.NET applications using either IIS on Windows or using Mono and Apache on Linux. However, Phalanger goes beyond just compiling existing PHP applications to .NET.

Phalanger can be used to create solutions that combine .NET and PHP in ways that are not possible with the standard PHP interpreter. Thanks to Phalanger extensions, PHP programs can directly use .NET classes and .NET programs (e.g. written in C#) can dynamically invoke PHP scripts or use functions and classes implemented in PHP [6].

In this article, we’ll briefly introduce Phalanger and then look at three usage scenarios. We’ll discuss how to integrate PHP applications with ASP.NET; how to efficiently run PHP applications on Windows and how to use PHP as a view engine for ASP.NET.

Introducing Phalanger

Phalanger has been around for quite some time. The first version of Phalanger was created as a software project at Charles University in Prague in 2003. The development of version 2.0 started later and was released as open-source project in 2006 on CodePlex. Microsoft supported the project for a while and one of the Phalanger developers later joined Microsoft to work on the Dynamic Language Runtime (DLR).

The activity on Phalanger resumed in 2008 thanks to collaboration with Jadu which used Phalanger to build a .NET version of their CMS developed in PHP [8]. Since 2010, the development of Phalanger has been mainly funded by DEVSENSE, which provides commercial support for Phalanger. Recently released version Phalanger 2.1 [7] improves compatibility with the standard PHP implementation, takes advantage of the DLR in the implementation of dynamic operations and provides better interoperability between PHP and other .NET languages (like C#, F# and Visual Basic).

Components of Phalanger

Phalanger consists of several, partly independent, components that can be used to develop PHP applications running on .NET and to run them using .NET or Mono:

  • Phalanger Compiler. Phalanger compiles PHP source code into .NET assemblies that are executed using .NET JIT (Just-in-time compiler that generates native code for the current platform). Compiled PHP code uses Phalanger Runtime and Dynamic Language Runtime that provides efficient implementation of dynamic features of the PHP language.
  • Phalanger Runtime and Libraries. The Phalanger Runtime provides an implementation of PHP features like arrays. Phalanger also comes with a .NET implementation of standard PHP libraries for I/O, regular expressions and others.
  • Native Extensions. On 32 bit Windows platform, Phalanger is capable of using any existing PHP 4 extension via a native bridge. Despite some runtime overhead, this makes it possible to run some PHP applications without additional effort.
  • Managed Extensions. PHP extensions can be also re-implemented by wrapping similar functionality available in .NET. These extensions can be written in any .NET language and provide great performance. Phalanger comes with several extensions including SPL, JSON, SimpleXML, MySQL and MS SQL providers. Additional extensions such as Memcached, image, or cURL are available from DEVSENSE [9].
  • Visual Studio Integration. Phalanger also integrates with Visual Studio (recently updated to support Visual Studio 2010). The integration adds color highlighting and IntelliSense for PHP files and allows debugging of PHP applications running using Phalanger.

Phalanger Use Cases

Phalanger is largely compatible with PHP 5 and can run a large number of open-source PHP projects including WordPress and MediaWiki. It can be used to integrate these projects in a .NET ecosystem as well as to develop new projects that combine the benefits of PHP and .NET. In the rest of the article, we discuss the following three use cases:

  • Scenario #1: Running PHP Applications Efficiently. The performance of PHP applications compiled using Phalanger on Windows is better than when using a standard PHP interpreter via FastCGI. This makes Phalanger an attractive option for hosting PHP in Windows environment.
  • Scenario #2: Integrating WordPress with ASP.NET. PHP code compiled using Phalanger can call any .NET library. This can be used to share database of users or other data between PHP and ASP.NET applications.
  • Scenario #3: Calling PHP from ASP.NET Applications. The flexibility of PHP is useful for scripting or writing the presentation layer of web applications. Thanks to Phalanger, it is possible to develop an application in .NET and use PHP as a scripting language or a view engine.

The following three sections discuss each of the scenarios in detail. We first give a general overview and then look at some technical details that demonstrate interesting aspects of Phalanger.

Scenario #1: Running PHP Applications Efficiently

Phalanger makes running PHP applications efficient for two reasons. Firstly, it compiles the PHP source code instead of interpreting it and secondly, it runs the application as an ASP.NET application, which provides additional performance benefits on Windows.

Compiling PHP using Phalanger and .NET

The compilation process is shown in Figure 1. As the diagram shows, Phalanger compiles PHP source code to a .NET IL (Intermediate Language), which is a low-level bytecode that is independent of the architecture. The compiled code uses PHP Core Library (a part of Phalanger) and Dynamic Language Runtime (DLR) to perform standard PHP operations. When the application starts, the .NET JIT (Just-in-time) compiler turns all these components into a native code optimized for the current processor architecture.

Figure 1. Compilation of PHP source code to native code using Phalanger

As Phalanger Benchmarks show [10], the performance of WordPress compiled using Phalanger on Windows is significantly better than when using standard PHP interpreter via FastCGI and slightly better than using PHP with WinCache. However, the benchmarks did not test the most recent version of Phalanger that is further optimized using the DLR.

Hosting PHP applications using ASP.NET

Phalanger applications run in the same mode as ASP.NET applications. This gives an important performance advantage, especially on Windows systems where processes are more expensive than threads.

The diagram in Figure 2 shows different options for running PHP applications.

When using the standard CGI mode, the web server starts a new process for every incoming request. On Windows, this is inefficient, but it also prevents sharing state in a shared memory or easy in-process caching. When using FastCGI mode, the web server reuses processes, so it doesn’t have to start new process for every request. However, it is still not possible to share state in memory, because different processes would have different state.

(Click on the image to enlarge it)

Figure 2. Running PHP using CGI, FastCGI and Phalanger

Phalanger behaves just like any ASP.NET application. A single ASP.NET process, called Application Pool handles all incoming requests. It is even possible to configure multiple PHP applications (such as several independent instances of WordPress) in a single process (Application Pool). Inside the process, there are multiple threads that are re-used to handle individual requests. On Windows, threads are more lightweight than processes, so this is more efficient and less memory-consuming solution.

That the application runs in a single process allows further optimizations and other interesting scenarios. For example, Phalanger uses the Dynamic Language Runtime (DLR) for dynamic method invocation. DLR uses a caching mechanism that adapts over time, so after several requests, the DLR “learns” what methods the application uses and becomes faster. This is only possible if requests are handled within a single process.

Running all code in a single process also means the application can store global state in memory. This can be used to implement functionality similar to the User Cache provided by WinCache, but without the overhead of inter-process communication.

Scenario #2: Integrating WordPress with ASP.NET

One of the benefits of PHP is the wide range of excellent open-source CMS systems (WordPress, Joomla, etc.), form applications (phpBB and others) or wikis (MediaWiki and others), many of which have been tested with Phalanger.

These applications often provide more features than similar packages for the .NET platform. A company that develops an ASP.NET based web page may face the following situation:

  • It needs to add wiki, forum or blogs to an existing ASP.NET solution, but the only suitable applications (e.g., free, with all necessary features) are available in PHP.
  • The application may run under a sub-domain, but it should share the user database. Moreover, once the user signs-in on the main page, it should remain signed-in on the wiki, forum or a blog.

ASP.NET applications can use ASP.NET Membership, which is a standardized mechanism for managing users, roles and their profiles. With Phalanger, it is possible to modify any open-source PHP project to use the same mechanism. The next section demonstrates how this works using WordPress.

Implementing ASP.NET Membership Plugin for WordPress

If you’re not interested in code, you can skip this section and look at the third scenario. However, we won’t look at any technical details – just a very brief overview of PHP extensions that allow PHP to call .NET libraries.

Handling of users in WordPress can be easily customized using a plugin. The plugin for managing users’ needs to implement a PHP class with various member functions. One of the expected functions is authenticate, which gets a user name and a password. It should fill information about the current user or set the name to NULL if the user does not exist.

To implement authentication using ASP.NET Membership in .NET, we can use functionality from the System.Web.Security namespace. The static method Membership.ValidateUser tests whether the password is correct and Membership.GetUser returns basic information about the user. Using Phalanger, we can access .NET objects as if they were standard PHP objects, so implementing the authentication is easy. Listing 1 shows a simplified version of the code.

Listing 1. Function implementing authentication in a WordPress plugin

import namespace System:::Web:::Security;
function authenticate(&$username,$password) {  global $errors;  // Test whether the password is correct  if (Membership::ValidateUser($username,$password)) {    // Get information about the user and fill $userarray    $user = Membership::GetUser($username);    $userarray['user_login'] = $user->UserName;    $userarray['user_email'] = $user->Email;    $userarray['display_name'] = $username;    $userarray['user_pass'] = $password;    // Loading of roles & profiles omitted for simplicity    // Update or create the user information in WordPress    if ($id = username_exists($username)) {      $userarray['ID'] = $id;      wp_update_user($userarray);    }    else      wp_insert_user($userarray);  } else {    // Report error if the login failed    $errors->add('user-rejected', 'Log-in failed!');    $username = NULL;  }}

The code starts with an import namespace declaration. This is a non-standard Phalanger extension that imports functionality from a .NET namespace of one of the referenced assemblies (assemblies can be referenced using a web.config file). In a future version, Phalanger will use standard namespaces as supported by PHP 5.3, but this change is not fully implemented yet.

The rest of the code looks like standard PHP code. However, the Membership class is actually a standard .NET class. Phalanger treats PHP classes and .NET classes equally, so we can use standard syntax for calling .NET methods. The functions ValidateUser and GetUser are static functions, so they are called using the :: syntax. The result of GetUser is a .NET object MembershipUser with various properties that contain basic information about the user. Again, we can use the standard notation to access fields of the object (which are implemented as .NET properties).

As you can see, using .NET functionality from PHP is very natural. Since the code is compiled to .NET assembly, there is also no overhead when calling .NET libraries. The next section shows integration in an opposite direction – calling PHP from .NET application.

Scenario #3: Calling PHP from ASP.NET Applications

The main advantage of PHP is its flexibility and simplicity, which makes it a great language for writing scripts or implementing rendering of HTML. However, some people find it easier to implement large-scale applications in statically-typed languages such as Java or C#. Using Phalanger, we can get the best of both worlds.

The scenario discussed in this section demonstrates one way to combine ASP.NET and PHP. It is based on the modern ASP.NET MVC (Model View Controller) Framework that separates the presentation layer, layer responsible for interaction and the business logic of the application. We can develop individual components in different languages:

  • C# Model and Controllers. The model and the controllers will be written in C#. This part of the application implements the business logic, which is often easier to write in a statically-typed language, especially if the logic becomes more complicated. Moreover, it is possible to use technologies like LINQ for data access and Task Parallel Library to implement high-performance calculations using multiple threads.
  • PHP Views. The presentation layer of the application will be written in PHP. This is where the simplicity and flexibility of PHP provides the most benefits. Moreover, it means that this part of application can be written by less experienced developers, because most of web developers and web designers know some PHP.

There are other situations where calling PHP from C# would be useful. For example, you can use PHP as a scripting language in a larger C# project. This is again very useful, because PHP is a widely known language. Another situation is when using PHP library from C# - this is largely simplified thanks to Phalanger’s duck typing mechanism, which can even generate a statically-typed C# interface for calling well documented PHP code.

In the rest of the article, we focus on the scenario that uses PHP to implement presentation layer of an ASP.NET application. You can find references to information about other scenarios (such as scripting) at the end of the article.

Creating Model-View-Controller Application in C# and PHP

Let’s first look at a simple application we could create using a combination of C# and PHP. The Model and Controller of the application is written in C# and are shown in Listing 2. In the example, the model is just a simple C# class representing information about products. In reality, this would be responsible for loading data from a database and might be implemented using LINQ.

Listing 2. Model and Controller of a sample web application (C#)

public class Product {
  public string ProductName { get; set }
  public double Price { get; set }
}
public class HomeController : Controller {  public ActionResult Index() {    ViewData.Model = new Product { ProductName = "John Doe", Price = 99.9 };    return View();  }}

The controller component is implemented by the HomeController class, which inherits from ASP.NET MVC Controller. The class contains a single action representing the index page of the application. The action will be invoked when the user accesses /Home/Index (or just the root URL). It creates the model (instance of Product class) and passes it to the View component.

In a standard ASP.NET MVC application, the View component is typically implemented using ASPX page or using Razor view engine with code written using C# or Visual Basic. Phalanger makes it possible to use PHP in the implementation of the views. Listing 3 shows an example.

Listing 3. View of a sample web application (PHP)

<html><head>
  <title>Sample view written in PHP</title>
</head>
<body>
  <h1>Product Listing using Phalanger</h1>
  Product: <? echo $MODEL->ProductName; ?><br />
  Price: <? echo $MODEL->Price; ?>
</body></html>

The view is rendered using and ASP.NET MVC extension described below. The extension executes the PHP script shown in Listing 3 and defines a global variable named $MODEL that contains the data returned by the controller. In the above example, $MODEL is a reference to a standard .NET class. Phalanger treats .NET classes as equal to PHP objects, so it is very easy to display properties of the product using the echo construct.

The example shows the basic structure of the application, but it is extremely simple, so it doesn’t really show all the benefits we can get by using PHP in the presentation layer:

  • The dynamic nature of PHP makes it easy to render data of any structure. The view is not limited to simple scripts, but can use any existing PHP libraries, including popular templating engines.
  • The view can be structured into multiple files using PHP include, so you have full control over how the page is generated.
  • The developer creating the view doesn’t need to know anything about .NET. This means a company transitioning from PHP to C# can still leverage existing developer skills.

To give you some idea how this scenario works, the following section reveals some technical details about the PHP and C# integration. If you’re not interested in the details, you can go straight to the summary.

Looking Under the Cover

The scenario described in this section is based on the PicoMVC project [4], which allows combining PHP with F#. To keep the examples simpler, I translated them from F# to C#. The core of the PHP integration in PicoMVC is a simple function that takes a file name of a PHP script and runs it using the Phalanger runtime. The function is shown in Listing 4.

Listing 4. Calling PHP script from an ASP.NET web application.

void PhalanagerView(string fileName, object model, HttpContext current) {
  // Initialize PHP request context and output stream
  using(var rc = RequestContext.Initialize(ApplicationContext.Default, current))
  using(var byteOut = HttpContext.Current.Response.OutputStream)
  using(var uftOut = new StreamWriter(byteOut)) {
    // Current context for evaluating PHP scripts     var phpContext = ScriptContext.CurrentContext;    // Redirect PHP output to the HTTP output stream    phpContext.Output = uftOut;    phpContext.OutputStream = byteOut;    // Declare global $MODEL variable (if model is set)    if (model != null)      Operators.SetVariable(phpContext, null, "MODEL",                            ClrObject.WrapDynamic(model));    phpContext.Include(fileName, false);  }}

The PhalangerView method gets a file name (referring to a PHP script), a .NET object that represents the data returned as a model, and a current HTTP context. It first initializes RequestContext, so Phalanger knows it is processing a script as part of HTTP request. Then it ensures all output generated by the PHP script is sent directly as a HTTP response. When running PHP as a script, the output can be redirected to a memory stream and processed in a different way. Finally, the method declares a global variable MODEL and executes the PHP script using the Include method provided by Phalanger.

This example is not a definitive guide on calling PHP scripts from C# - you can find more detailed information in an article on the Phalanger blog. However, it should demonstrate that calling PHP scripts from C# using Phalanger is quite easy. This can be useful in the web programming scenario discussed in this section, but it gives a wide range of other options.

Filed under: .Net Framework PHP

Introducing Laravel - A Classy & Powerful PHP Framework

Laravel-php-framework

Taylor Otwell created Laravel framework during the first half of 2011, which he says "Is an attempt to create a great framework that is as accessible as it is powerful."

Laravel is a clean and classy framework for PHP web development, freeing you from spaghetti code. It helps you create wonderful applications using simple, expressive syntax. Development should be a creative experience that you enjoy, not something that is painful.

Laravel is open-source software available under the MIT License. That means you are free to use, share and enjoy Laravel without restriction. You can even contribute to Laravel on Github.

Read more…

Don't like to miss out any of our posts? Do

Filed under: Open Source PHP

DALMP - Database Abstraction Layer for MySQL using PHP

After many years of web developing with PHP, 99% of my sites are using MySQL so that is why I decided to create DALMP.

I have been using ADOdb, pear DB, Zend DB, etc. they are excellent applications, but many times they are too much for what I need, so that is why I started creating DALMP, a data abstraction layer that just feet my needs , taking the best practice code out there and put it on a single simple file.

%0 fat and extremely easy to use, just one file, define some constants and you are ready to go.

Details

  • redis support (http://code.google.com/p/redis/)
  • memcache single or multiple hosts and socket support (http://code.google.com/p/memcached/)
  • apc support (http://pecl.php.net/package/APC)
  • Group caching cache by groups and flush by groups or individual keys
  • Disk cache support.
  • Prepared statements ready.
  • Ability to use different cache types at the same time.
  • Simple store of session on database (mysql/sqlite) or a cache like redis/memcache/apc.
  • Easy to use/install/adapt DALMP is just a single file.
  • Nested Transactions (SAVEPOINT / ROLLBACK TO SAVEPOINT).
  • Common methods are named exactly like ADOdb in case you want to try DALMP with an existing code that uses ADOdb.
  • sql queue.
  • helpful methods, renumber('table') or renumber('table','uid') - renumbers a table, UUID - create an 'universally unique identifiers'
  • http client + queue (for sending data via http to another server expecting an answer, if expected was ok then proceed other wise queue the http request).
  • trace everything enabling the debugger by just setting something like $db->debug(1).

Read more…

Filed under: Database MYSQL PHP

PHP Quiz

You've been learning PHP for a while, and want to know the progress you've made. You've come to the right place!

Take our PHP Quiz to test your skills.

The Quiz has 10 questions. You'll will be shown full results once you finish the Quiz. The pass percentage is 75 or above.

Good Luck!

Start Our PHP Quiz!

Filed under: AMT Quiz PHP

Open Discussion | Best Practices PHP, HTML & JavaScript

This is an interesting open discussion (originally appeared on Programmers StackExchange) on best practices while working with HTML, JavaScript and PHP in general.

I realized I have to write down a convention specification about HTML, JavaScript and PHP coding for me and my team.

In web development, just like in C++, I'm definitely a fan of indentation and comments.

Nonetheless, often in my work I encounter HTML+JavaScript+PHP code which suddenly brings up the headache.

I'm trying to make my code readable, but what seems to be better to me (to indent & comment) seems not to fascinate my teammates, so I was wondering if there is a best or at least shared good practice when writing "hybrid" documents just like today's web pages, which day by day become more and more complex.

I'm aware of the fact that probably it is in the nature of today's web pages' code to be a little bit intricated, but I wonder if a good convention concerning these aspects already exists.

 

Some general rules I follow:

General

  • Indents are 4 spaces.
  • Indent new levels
  • Comments are < ~80 chars from the indent level. If I'm in two levels (8 spaces) that means the cursor stop will be around 88 characters.
  • Use multi-line comments. I prefer the look, however this is a subjective point.
  • Comment now rather then later when you have no idea what's going on.
  • Allman style braces. It's cleaner and is more readable. Subjective.

JavaScript

  • Use a library. jQuery in particular is very good. It eliminates all cross browser headaches.
  • Understand that ID's are for particular elements, classes are for styles. ID's shouldn't be used more then once per page and they will have particular hooks attached to them. Use classes for things like navigation.
  • Out source into methods. It's tempting to put all the code into the bind call, however putting it in it's own function will increase the flexibility of your code.
  • Use functions instead of evals. That means setTimeout(function(){ /* Do something */ }, 1000); instead of setTimeout('doSomething', 1000);
  • Use local variables with var.

HTML

  • Semantic markup. Use appropriate tags. Don't put <br />'s in there to add space, adjust margins and CSS rules.
  • All tags are lowercase.
  • All tags should end with a closing tag or be self closing.
  • Make use of classes for layout that is similar. Have a couple of predefined classes like hide, clear, error, etc.
  • Everything (scripts included) should go in <head>. Worry about optimizing (moving stuff around) when it presents a problem.
  • External stylesheets and JavaScript source is a must unless it is page specific.

PHP

  • Frameworks are good, I recommend CodeIgniter.
  • If you don't want to use a framework, try to use the latest version of PHP possible. (That means 5.3).
  • Use includes to your advantage.
  • Clear injections or use prepared statements.
  • Perform if checks on preconceived fail-secure values.

    $logged_in = false;if(check_user($user)){     $logged_in = true;     $user = load_user($_SESSION);}
  • Know the difference between single and double quotes. Use single quotes when possible.
  • Don't echo HTML.

Do let us know about the best practices you follow in the comments section below.

Filed under: HTML JavaScript PHP

AMT Staff's Favorite Picks Of the Week

PHP

10 PEAR Packages for Every PHP Developer's Toolbox

An interesting article written by Jason Gilmore on PHP Extension and Application Repository, better known as PEAR, and in this article he tries to shine the spotlight just a bit brighter on this fantastic community resource by highlighting 10 useful PEAR libraries (better known as packages) that has become an indispensable part of his programming toolkit.

PHP as a data source for Flex applications

If you have a RIA as the user interface the server no longer needs to mix the data with the visuals. This means PHP coders no longer need to worry about styling data, surrounding the information with tables, divs and tons of other tags. The only thing they need to do is send the data back in some usable format, and luckily XML is supported by Flex. Let's take a look at some code needed to start communicating Flex with PHP...

Web Design

Create an Elegant Patterned Web Design in Photoshop

This web design tutorial on Design Instruct walks the learner through the creation of a beautiful and trendy web layout using Photoshop. The web design is best used on a personal portfolio site.

A Study of Trends in Mobile Design

The aim of this article is to showcase the variety of methods in which some of today’s most popular websites provide an interactive and (hopefully) useful mobile experience for their end users. There are plenty of big names which were analyzed, such as Facebook and Amazon, and you’ll see plenty of useful graphs to draw some inspiration from. With statistics and some really interesting revelations on the diversity of modern design, you can be excited about the future of mobile Web design!

UX

Designing for the mind

Design is powerful because of the way our brain processes visuals. We might think of vision working by our eyes pulling in images and projecting them in the back of our mind. If this were the case then there would no be design or art. There are in fact 30 areas in the back of your brain that process different aspects of the image. The various vision processing areas of the brain are individually recreating the design. So, in a way, the viewer is also an artist...

Applying Lessons from UML to UX

Software Engineering is typically much more formal than User Experience in they way they model an application before development begins. After pseudo code, the Unified Modeling Language (UML) is probably the most widely used modeling language among software engineers. It has...

Is Realistic UI Design Realistic?

When Apple introduced the iPad, along with it came a set of Human Interface Guidelines. The HIG encourages app developers to “delight people with stunning graphics” and to “add physicality and heightened realism…The more true to life your application looks and behaves, the easier it is for people to understand how it works and the more they enjoy using it.”

jQuery

Quaid - JavaScript Library

Quaid is a JavaScript library that works with jQuery to help you write cleaner, more-robust code. You can think of it as a little framework with which to easily build widgets and other stateful jQuery plugins. Quaid provides two main services: a more modular way to write complex JavaScript applications with jQuery, and a robust way to handle errors from async server requests. Also included for convenience is multi-level, cross-browser logging with failover, a small framework for data formatting, and form handling utilities.

How To Organize a jQuery Application with JavaScriptMVC

Jupiter Consulting, a development outfit and the creators of the JavaScriptMVC framework, has posted a guide on organizing jQuery applications with JavaScriptMVC 3.0. Justin Meyer, the author of the post, felt that other guides to organizing jQuery applications failed to emphasize a crucial aspect: breaking up applications into separate and testable components. "The secret to building large apps is NEVER build large apps," Meyer writes. " Break up your applications into small pieces. Then, assemble those testable, bite-sized pieces into your big application."

WordPress

13-01_wordpress_common_functions_ld_img.png

Beginning WordPress Development: A Look at Common Functions

WordPress is a great blogging and CMS platform. It’s easy to use and customize, and there’s basically nothing you can’t do with it. If you haven’t used WordPress, give it a try by installing it on your own computer using a web server package like xampp or WampServer. You’ll need access to WordPress in order to follow along with this guide.

Using TextMate for WordPress Code Cleanup

A Useful Post written by Ian Stewart a professional designer and WordPress enthusiast, on using TextMate commands for cleaning up wordpress code.

New Features in WordPress.com : Linking, Sorting & Paging

It’s that time of year again, when the folks over at WordPress.org start putting the finishing touches on the next version of WordPress (in this case, version 3.1), and the lucky users of WordPress.com are automatically included in the beta testing, giving you all access to new features about a month before they are officially released...

Filed under: AMT CMS JavaScript PHP UX jQuery

AMT Staff's Favorite Picks Of the Week

PHP Development

8 Experts Break Down the Pros and Cons of Coding With PHP

An Interesting & Insightful article which originally appeared on Mashable Network, on the strengths & weaknesses of coding with PHP. Check out the Opinion of these experts on questions like these: "What makes PHP a good language? What are some of PHP’s drawbacks? And what are the best apps or cleverest hacks you’ve seen made with and/or for PHP?"

10 Productive PHP Tools for Testing and Debugging

Despite the general notion that programming is a profession steeped in discipline and rigor, members of the programming community tend to be rather finicky folks who can be very particular when it comes to tooling. Thankfully PHP developers have a great deal to choose from when it comes to testing and debugging tools, and in this article I'll highlight 10 of my favorites.

PHP snippets to interact with Twitter

Twitter is an awesome tool for website owners, and you should definitely integrate it into your website if you want to attract more traffic and new visitors. Today, let’s take a look at some PHP snippets to interact with Twitter.

Php-mysql

MYSQL

10 Command-line Time savers for MySQL Tasks

Although several great GUI-based MySQL clients exist, among them phpMyAdmin and SQLYog, I've always preferred to use the native mysql command-line client. It does take some time to get acquainted with using a command-line interface (CLI), particularly if you don't regularly work with an operating system offering a robust CLI environment. However, after some practice you'll be able to manage users, navigate your databases, and perform other tasks with incredible ease.

Top 10 MySQL Mistakes Made By PHP Developers

A database is a fundamental component for most web applications. If you’re using PHP, you’re probably using MySQL–an integral part of the LAMP stack. PHP is relatively easy and most new developers can write functional code within a few hours. However, building a solid, dependable database takes time and expertise. Here are ten of the worst MySQL mistakes I’ve made (some apply to any language/database)…

Web Design

520 Grid System: HTML/CSS Framework made for Facebook Page Developers

Nowdays there are milions of Facebook Pages almost about everyting. Facebook Page creators try to impress first-time-visitors but also fans with atractive and useful content in custom made FBML tabs. Because I am one of them also, I always need some quicker and more efficient way to make my FBML content and show it as soon as possible to fans of my Facebook pages.

Three Fresh CSS Frameworks

CSS Frameworks are those marvelous and innovative tools that will speed up your web development process by taking care of the multitude of repetitive processes you would have to cover for every project, and on top of that, they (mostly) take care of any cross-browser compatibility issues. They have also never been as popular, with new frameworks cropping out from week-to-week.

5 Design Trends That Small Businesses Can Use in 2011

In the past 12 months, we’ve seen a lot of changes in the world of web design. Growing popularity in the mobile device space — including smartphones and tablets like the iPad — have refined the way many users access and interact with content. Likewise, the formal adoption of web standards like HTML5, web fonts and CSS3 by browser makers means that more and more users are now able to take advantage of the latest and greatest features on the web.


UX

Decision Architecture: Helping Users Make Better Decisions

"What is it that makes a Web site great? In answering this question, it’s sometimes valuable to take a step back and consider anew why we create Web sites. … For the most part, we create Web sites to get users to do something…."

jQuery

50 Useful jQuery Plugins to Enhance your Forms

Here we present some useful plugins and tutorials that will let you create awesome forms for your websites — whether it’s a sign up form or contact us form. You can enhance its functionality and usefulness with these plugins. Since these forms are used by the visitors of your website to interact with you, they are of great importance and for this reason you cannot just ignore them as they play an important role in the success of your website. So here we have gathered a bunch of jQuery Plugins, Tutorials and Resources which will help you in improving the effectiveness and beauty of these forms

jQuery’s Data Method – How and Why to Use It

jQuery’s data method gives us the ability to associate arbitrary data with DOM nodes and JavaScript objects. This makes our code more concise and clean. As of jQuery 1.4.3 we also have the ability to use the method on regular JavaScript objects and listen for changes, which opens the doors to some quite interesting applications.

Filed under: AMT MYSQL PHP UX jQuery

AMT Staff's Favorite Picks Of the Week

RUBY ON RAILS

How-to send email with a Google account form Ruby On Rails

I have seen many articles in the web that explain how to send an email with a Google account from a Ruby On Rails application. However, I believe there are several faulty or incomplete examples around. That’s why I decided to share a working solution that I used in various projects...

Hacker Slide: Anatomy of a 4 Hour Miniapp

Hacker Slide is a new miniapp I launched this morning after a few hours of development (rounded up to 4 after doing a little design work on this this afternoon). It lets you view the Hacker News front page over time...

Do You Understand Ruby’s Objects, Messages and Blocks?

Ruby is a very elegant and expressive language. Consider the following complete Ruby program (one of the first examples I was exposed to, reconstructed from memory)...

PHP

Parser and lexer generators for PHP

From time to time, I find that I need to put a parser together. Most of the time I find that I need to do this in C for performance, but other times I just want something convenient, like PHP, and ...

Parsing XML with the DOM Extension for PHP 5

DOM (Document Object Model) is a W3C standard based on a set of interfaces, which can be used to represent an XML or HTML document as a tree of objects. A DOM tree defines the logical structure of documents and the way a document is accessed and manipulated...

HTML 5

video + canvas = magic

You’ve already learned about the <video> and <canvas> elements, but did you know that they were designed to be used together? In fact, the two elements are absolutely wondrous when you combine them! I’m going to show off a few super-simple demos using these two elements, which I hope will prompt cool future projects from you fellow web authors...

Aloha Editor - The HTML5 Editor

The world's most advanced browser based Editor lets you experience a whole new way of editing. It’s faster than existing technologies and offers unprecedented functionalities.

MOBILE WEB

How To Build A Mobile Website

Over the past few years, mobile web usage has considerably increased to the point that web developers and designers can no longer afford to ignore it. In wealthy countries, the shift is being fueled by faster mobile broadband connections and cheaper data service. However, a large increase has also been seen in developing nations where people have skipped over buying PCs and gone straight to mobile.

Cnn-regular-vs-mobile1

---

Sent by Taroby - the smarter choice for effective email management.

11
To Posterous, Love Metalab