News Feed
Jobs Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Getting Started with Assetic
April 14, 2014 @ 10:37:00

The SitePoint PHP blog has a new post from Lukas White today looking at the Assetic asset management library and how you can get started using it in your application.

There was a time when asset management meant little more than inserting a <link> tag or two and a couple of <script> tags into your HTML. Nowadays, though, that approach just won't cut it. There's performance, for one thing. [...] Also, as client-side applications have become more and more sophisticated, managing dependencies amongst scripts and libraries has become increasingly complex. Furthermore, technologies such as Less, Compass and Coffeescript require assets to be compiled, adding yet another step to the process of managing assets. In this article I'm going to look at a PHP package called Assetic which helps manage, compile and optimize assets such as scripts, stylesheets and images.

He briefly discusses asset management first, just to get everyone on the same page as far as what "assets" are and some considerations about their use. Next is an introduction to the Assetic library itself and the install/usage of a simple "AssetCollection" object. He also shows how to add assets to the object and how to configure compression and generation of the files (like with LESS). He also shows how to use the AssetManager and FilterManager object types along with the AssetFactory handler. Finally, he talks about some of the sample output and caching the tool can do with file-based cache handling.

0 comments voice your opinion now!
assetic introduction asset tutorial javascript css less compress

Link: http://www.sitepoint.com/getting-started-assetic

LineshJose.com:
How To Create A Simple CSS Compressor Using PHP
June 06, 2012 @ 08:44:26

In this recent post to his blog Linesh Jose shows you how to create a simple PHP-based compressor for your CSS (using some string replacement methods and a regex or two).

CSS or Cascading Style Sheets is a language used to describe the presentation of a document written in a markup language. If you're developing a very complex design for your site, CSS scripts become very long, and takes too much time to load. But a compressed CSS script can help your website load faster and easily maintain its functionality. Here, I've created a very simple CSS compressor using PHP to compress or reduce CSS script size.

You can read through the example code and see how it all works or you can download the code and see a live demo of it in action. His script does the compression on the fly, but it's not a far stretch to get it set up as a part of a build to output to a file on deployment.

0 comments voice your opinion now!
css compress tutorial strreplace pregreplace


PHPMaster.com:
Automatic CSS3 Prefixer and Compressor
March 20, 2012 @ 12:38:30

On PHPMaster.com today there's a new tutorial showing how to use a little PHP magic to compress your CSS automatically.

There are many ways to compress CSS files or automatically generate browser-specific CSS3 prefixes, but usually extra tools are used which is very annoying. I'd like to show you how such tasks can be done using only PHP.

Complete code for this small script is included in the article. It uses some regular expressions to parse the CSS and does some replacement and removal of things from the CSS content to slim it down and format it all as one line. There are some images illustrating the process also included.

0 comments voice your opinion now!
css compress tutorial prefixer automatic


DZone.com:
Phar PHP libraries included with a single file
September 23, 2011 @ 11:30:40

On DZone.com today Giorgio Sironi has a new post looking at an interesting, if seldom used, feature of recent PHP releases - packaging applications with phar archives.

Phar is a php extensions that provides the means for distributing code as a single archive, that does not have to be extracted to a folder before usage. The concept is similar to JVM Jars: each archive becomes a virtual directory where files can be accessed. However, the virtual folder is not limited to class loading, but you can open and read internal files as if it were decompresse into a directory.

He includes a brief "hello world" example of packaging up a script into a phar archive and executing it via PHP. He also shows how easy it is to create an archive from current code, making an archive containing the latest Doctrine 2 release for simple inclusion. Phars also allow compression and hashing but has issues with resource management and access external files.

0 comments voice your opinion now!
phar archive file compress doctrine2 tutorial


NetTuts.com:
How to Use the Nettuts+ Phing Build Script
August 22, 2011 @ 11:50:40

NetTuts.com has come up with a Phing (the automated build tool written in PHP) build script that designers can drop in as a part of their deployment process to compress, concatenate and Prefixize all of their stylesheets and scripts.

We've created a build script for Phing that will give designers the ability to automatically compress, concatenate, and Prefixize all of their stylesheets and scripts - simply by typing five characters. I'll show you how to use it in this quick tip video.

The post includes a screencast showing you how to get it all set up and working with the rest of your Phing install. They don't help you set up Phing - you'll need that already set up and running to use the task. You can grab teh script directly from github.

0 comments voice your opinion now!
build script phing compress stylesheet designer prefixize tutorial screencast


Sander Marechal's Blog:
A YuiCompressorFilter for Phing
August 02, 2011 @ 09:16:37

Sander Marechal has been working with Phing in some of his recent development and has created something useful for compressing Javascript and CSS files on the deployment of your application - a YuiCompressor task.

I am going to write several useful extensions, the first of which is a YuiCompressorFilter. Phing already has support for a JavaScrip minifier in the form of the JsMinTask, but the yui-compressor is more useful. Not only does it usually compress better than JsMin, it can also compress CSS files. Also, because my YuiCompressor extension is implemented as a filter instead of a task you can do fancy things like minifying and concatenating files in a single step.

He includes both a sample of the task and it's configuration (the XML) in the post as well as a link to its source over on github.

0 comments voice your opinion now!
javascript compress phing task css


SitePoint PHP Blog:
How to Roll Your Own JavaScript Compressor with PHP and the Closure Compiler
August 31, 2010 @ 12:51:08

On the SitePoint PHP blog today there's a quick new post showing you how to create a Javascript compressor tool with PHP that uses the Closure Compiler from Google.

In my previous post, I discussed the Closure Compiler's REST API. In this article, we'll develop a small PHP program that shows how the API can be used to compress JavaScript code whenever you need it.

He shows how to compress three "script" tags down into one that defines multiple files for the engine to grab and compress. This is passed into a PHP file that grabs the file and passes the data off to the Closure Compiler for handling (via curl). The result is then passed back and served up with a content type of "text/javascript" back to the browser.

1 comment voice your opinion now!
closure compiler google javascript compress tutorial curl


Thomas Weidner's Blog:
Compression and Decompression for ZF
September 23, 2009 @ 10:26:40

As Thomas Weidner mentions in a new blog post, starting with the 1.10 release of the Zend Framework there'll be a new component to help with compressing and decompressing files - Zend_Filter_Compress/Decompress.

The new components Zend_Filter_Compress and Zend_Filter_Decompress provide a unified API for several compression formats. Actually the formats BZ2, GZ, LZF, RAR, TAR and ZIP are implemented: You can not only work with Strings, but also with Files and also with complete Directories.

He includes a quick example of how it will work with both data (like a string) and writing out the information to a compressed file. You can find out more about the component from Thomas' proposal on the Zend Framework wiki.

0 comments voice your opinion now!
zendframework compress decompress


Zend Developer Zone:
Zend Platform Performance Tuning on IBM i
February 19, 2009 @ 13:49:03

The Zend Developer Zone has a new article posted looking to help you squeeze the most performance you can out of the Zend Platform application from Zend on your IBM i machine.

Zend Platform on IBM I provides many benefits including monitoring and advanced debugging. One of the more confusing issues that customers face with Zend Platform on IBM i is the impact on development machines. Most will try out Zend Platform in a development environment or on a development LPAR.

There's three things they suggest to tweak to help you get the most out of Platform - code acceleration, dynamic content caching and code compression.

0 comments voice your opinion now!
zend platform performance tuning ibmi ibm acceleration content cache compress


Michael Caplan's Blog:
Don't Forget to Flush
January 08, 2009 @ 12:09:15

In this recent post to his blog Michael Caplan looks at a feature of PHP that's sometimes forgotten when pushing out larger chunks of data - flushing.

As a recluse who prefers hiding behind servers rather than dancing around your web browser's canvas, I was intrigued with their server side recommendations - however sparse they may be. In particular, flushing generated head content early to speed up overall page delivery and rending time was a technique new to me.

Michael looks at what "flushing generated head content" means and includes a scenario - pulling the top palettes from the COLOURlovers site - and some performance stats on page load time and response time directly from the server (complete with graphs).

0 comments voice your opinion now!
flush chunk compress head content load time statistics response



Community Events











Don't see your event here?
Let us know!


series release install framework security hack unittest package composer database symfony2 language facebook opinion performance component introduction hhvm application podcast

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework