News Feed
Sections




News Archive
feed this:

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

Michelangelo van Dam:
Bootstrapping ZF1 application in Apigilty
March 11, 2014 @ 10:42:27

Michelangelo van Dam has a new post sharing a method he's come up with for boostrapping Zend Framework v1 components inside of an Apigility-based application.

Apigility is a Zend Framework 2 tool that provides a REST API management interface, which is very useful if you want to build an API. Apigility can directly connect with your database and offer a full REST API for your application, but in most cases you already have an application build with Zend Framework 1.x (ZF1). Let's assume you have incorporated a lot of business logic in this application so it would be a waste not to use it building a rich REST API.

He uses the gitmodules functionality to bring his entire ZF1 application into the Apigility app's structure (or, alternatively, Subversion). He shows how to use Composer to install the actual Zend Framework v1 copy and how to pull in other third-party libraries. He includes the code you'll need to use to create a "ZF2APP_PATH" constant to get to the application path of Zend Framework v2 instance. He then gets into the main part - the actual autoloading and bootstrapping of the ZF1 classes/services. He gives a brief introduction to working with Apigility to make a new service and shows the update to the resource class.

0 comments voice your opinion now!
bootstrap application apigility zendframework2 zendframework

Link: http://www.dragonbe.com/2014/03/bootstrapping-zf1-application-in.html

SitePoint PHP Blog:
Building a Web App With Symfony 2 Bootstrapping
October 16, 2013 @ 12:00:59

On the SitePoint PHP blog today Taylor Ren has started up a new series about building web applications with the Symfony 2 framework. In this first post he looks at one of the initial steps - bootstrapping (setting up) the framework and application.

In this series, I will capture a few key steps and some advanced techniques (image manipulation, pagination, dynamic contents, NativeQuery, etc) to help anyone who is considering using Symfony (note, to avoid future confusion, Symfony here refers to the Symfony 2, not the obsolete Symfony 1) as their PHP framework to develop a website.

This first part helps you get everything all set up - the latest version of the framework, Composer and checking for the default page to make sure everything's configured correctly. From there he starts to get into the "guts" of the application, introducing the MVC elements (entities), routing concepts and database configuration/integration.

0 comments voice your opinion now!
symfony2 series building application tutorial bootstrap

Link: http://www.sitepoint.com/building-a-web-app-with-symfony-2-bootstrapping/

Rob Allen:
Configuring a ZF2 view helper before rendering
July 31, 2013 @ 09:57:52

Rob Allen has a quick new post with details about configuring a view helper for a Zend Framework 2 application prior to its results being rendered.

When I was reading the documentation for the currencyFormat view helper, I discovered that you could configure the currency code and locale once rather than in every call. [...] This is obviously useful, but even more useful would be if we could set it once by default and then override if we need to in a specific call. The easiest way to do this is to use an event listener on the renderer.post View event within a modules's onBootstrap method.

He includes code to illustrate the process, configuring the renderer in the bootstrap of the application to use the GBP currency code and the "en_GB" locale for formatting its output. You can find out more about what the currencyFormatter can do in Rob's previous post.

0 comments voice your opinion now!
view helper zendframework2 configuration bootstrap

Link: http://akrabat.com/zend-framework-2/configuring-a-zf2-view-helper-before-rendering

VG Tech:
Using PHP's Built-in Web Server in Your Test Suites
July 22, 2013 @ 10:47:33

PHP introduced a handy built-in web server that makes it much simpler to test applications quickly and locally than having to have a full Apache+PHP install sitting on you machine. In this new post to the VG Tech blog, they take it one step further. They suggest that you can use it for testing too.

As of PHP-5.4.0 the CLI SAPI provides a built-in web server. The web server is designed for development purposes, and serves requests sequentially. This web server can come in really handy when the need for an httpd arises during (integration) tests. In this post I'll use PHPUnit as the testing framework, and I'll show you how to start the web server during the bootstrap process, and how to shut it down when the test suite is finished.

His example shows the creation of a basic phpunit.xml configuration file, but the bootstrap is a little different than some you've seen. With the help of a few constants and a command-line call to start the web server, he gets things up and running and ready for testing. A shutdown command is also included as a registered shutdown function to clean up after the testing is done.

0 comments voice your opinion now!
webserver builtin phpunit unittest integration bootstrap tutorial

Link: http://tech.vg.no/2013/07/19/using-phps-built-in-web-server-in-your-test-suites

Fabien Potencier:
Packing a Symfony full-stack Framework Application in one File - Bootstrapping
June 18, 2013 @ 09:06:46

Fabien Potencier has posted the second part of his "packing a Symfony app in one file" series with this look at the bootstrapping of the application. You can find the start of the series (including his intentions) in part one.

The most common way to create a Symfony project is to start with the Symfony Standard Edition: it defines a sensible directory structure for your project and it make things a lot easier when someone want to take over an existing project as he knows where the templates, the controllers, or the configuration are stored.

This part of the series looks at some of the configurations and settings you'll need to get the application up and working in a minimal way. This includes moving everything into one YAML configuration file including routing information. He shows how some bundles, bootstrap code and things to remove from the composer config.

0 comments voice your opinion now!
symfony2 fullstack singlefile application bootstrap process configuration

Link: http://fabien.potencier.org/article/70/packing-a-symfony-full-stack-framework-application-in-one-file-bootstrapping

Kevin Schroeder:
Would this be a dumb idea for PHP core?
February 19, 2013 @ 09:26:55

In this new post to his site Kevin Schroeder thinks out loud and wonders if an idea of his is "a dumb idea" to be included into the PHP core - engine state caching.

I was consulting and I would see significant server resources consumed by bootstrapping the apps. Loading config files, loading dependent classes, setting up dependencies, initializing ACL's, and the list goes on and on. One of the ways to negate the effect would be to cache a bootstrap object and then pull that object from the cache at the start of the request. However, the problem is that unserialization can actually end up taking more time than the bootstrap process itself.

He wonders if, after the initial bootstrapping happened, a method could be called (his example is "init_engine_state") that would cache the Zend Engine's current state and pass that to a callback function. This would cache everything - objects, variables, classes, etc - all pre-interpreted into memory and make them easy to reuse on future executions. What do you think? Share your thoughts in the comments of the post.

0 comments voice your opinion now!
engine state cache zendengine bootstrap callback


ScreenFony.com:
Work with bootstrap, assetic and less
September 25, 2012 @ 10:36:20

On the ScreenFony.com site there's a quick tutorial showing you how to get started with Symfony2+Twitter Bootstrap+Assetic+LESS in a basic application. Assetic is a library that helps with asset management and use and LESS is a CSS pre-processor that makes it simpler to work with your site's CSS.

Bootstrap is a well known and powerful front-end framework for fast prototyping, it uses LESS and it can be easily integrate in your Symfony applications with the help of assetic. In this post I'll show how to: Install bootstrap in you Symfony application, load it using assetic, and compile bootstrap LESS files with lessphp.

Using Composer, creating a new Symfony2 project is just a single command away. The just update the "composer.json" and run the install to get the other needed libraries (LESS and the Twitter Bootstrap). They help you set up some Assetic filters for LESS and provide a simple page to output the Bootstrap in your header.

0 comments voice your opinion now!
symfony2 assetic twitter bootstrap less css tutorial composer


Zumba Engineering Blog:
Creating a testing interface for your API
August 16, 2012 @ 09:56:36

In a new post to the Zumba Engineering blog, they share an interface they use for testing on their API (after working with something similar from another company).

They provide the documentation to the methods and I saw they have a simple interface to test their methods: Ooyala API Scratchpad. This interface was very useful while we integrate with them and I thought: "Why we don't have one interface like that for our API?" I started a page with Twitter Bootstrap to have a similar functionality, which the goal was to get an interface easy to developers see the response for multiple HTTP protocols, set the parameters, etc.

The interface uses Javascript to make requests over to a RESTful API and returns the response JSON directly to the page. It's a little bit customized to how their API works, but it's a good foundation for anyone looking to implement something similar. You can get the full code for it over on github.

0 comments voice your opinion now!
testing interface bootstrap rest api javascript


Matt Cockayne:
Bootstrapping ZF2 Forms
July 23, 2012 @ 11:07:00

In this recent post to his site, Matt Cockayne shows you how to bootstrap your forms in a Zend Framework 2 application (as defined in a class).

A brand spanking new Forms component has been rolled out with ZF2. The long and the short of this new component meant that I had the opportunity to hand roll a new way of making my forms work with Twitter Bootstrap. So, a little tinkering, a quick pull request to ZF2 to allow the definition of arbitrary options and I came up with some useful View Helpers that can be dropped into a project and used.

He includes the code for the sample class ("MyForm") and highlights the "bootstrap" portions of each element's configuration and walks you through some other handy features of his helpers: auto-rendering forms, a "row" helper and a "collection" helper to help organize the form structure.

0 comments voice your opinion now!
zendframework2 form tutorial bootstrap twitter view helper


VG Tech Blog:
Lazy Loading Resources with Zend Framework Bootstrap
June 01, 2012 @ 14:48:23

On the VG Tech blog today André Roaldseth has a new post showing how to lazy load in the Zend Framework bootstrap using two handy methods you can drop into your applications initialization.

The Bootstrapping process in Zend Framework isn't perfect. You'll often end up bootstrapping a lot of resources that you don't need to complete the request. Depending on the resources this can be really expensive and hurt your overall performance. The worst kind are resources that open connections to external services [...], even worse, if the services are down they will end up blocking the execution.

Using his modified "getResource" and "lazyload" methods, he shows you how to modify your resource requests to put them in a temporary state that is only initialized when the resource is needed. You can find the code for this example in this gist.

0 comments voice your opinion now!
zendframework resource lazyload bootstrap



Community Events





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


api list framework community laravel introduction language interview configure threedevsandamaybe podcast library release developer application wordpress series code install bugfix

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