Technical

VTemplate: a web project boilerplate which combines various industry standards

You’re about to start setting up the delivery mechanism for a web-based project. What do you do?

First, let’s fetch ourselves a framework. Not just any framework, but one which supports PSR-0 and encourages freedom in our domain code architecture. Kohana fits the bill nicely.

Let’s set up our infrastructure now: add Composer and Phing. After setting them up, let’s configure Composer to pull in PHPSpec2 and Behat along with Mink so we can do BDD. Oh yes, and Swiftmailer too, because what web-app nowadays doesn’t need a mailing library?

Still not yet done, let’s pull in Mustache so that we can do sane frontend development, and merge it in with KOstache. Now we can pull the latest HTML5BoilerPlate and shift its files to the appropriate template directories.

Finally, let’s set up some basic view auto loading and rendering for rapid frontend development convenience, and various drivers to hook up to our domain logic. As a finishing touch let’s convert those pesky CSS files into Stylus.

Phew! Wouldn’t it be great if all this was done already for us? Here’s where I introduce vtemplate – a web project boilerplate which combines various industry standards. You can check it out on GitHub.

It’s a little setup I use myself and is project agnostic enough that I can safely use it as a starting point for any of my current projects. Fully open-source, guaranteed by 100s of frontend designers, and by good PHP developers – so go ahead and check it out!

Life & much, much more

Architecture’s existential crisis pt 4: Timeless frameworks, and where do we go from here?

In part 1: Architecture is not a Profession, I outlined architecture’s distraction with competitive theories rather than acting as a professional discipline and serving society.

In part 2: The Foundations of Architecture, I talked about what architecture is currently based upon, and how to unify these into a governing framework that encompasses all architectural ideologies based off Vitruvius.

In part 3: Goals, ethics, and the people element, I placed the framework within society and introduced aspects of a professional ethical responsibility to serve other people.

In this final conclusion, I talk about future proofing the efforts of an architectural profession, and hint at what where we go from here. What did this (very long) series conclude? Now what have we learned? What can we now set out to tackle?

The final element: Resolving timelessness

The architectural framework has addressed a need for a foundation as well as the need for professional goals. There is still one thing missing: the ability to solve these goals.

The world is complex. As architecture is a justified solution to a predefined problem using the world as its medium, many of architecture’s goals will also be complex.

Complex goals take time to solve. There isn’t much use in introducing a framework to solve larger issues if we don’t have time to solve these issues past a certain number of years or generations. We need time to understand the nuances of the world, test our solutions, and figure out where we went wrong.

This does not suggest that time is all that is needed to work the world out, if that is possible at all. It merely suggests that prolonged effort may be a good thing towards achieving goals.

To support complex goals that may bridge theories and allow us to carefully consider when we choose to advance a theory, I propose a final element to bind the first four. I propose time.

The word time refers not to itself, but its effects. This may be impermanence, permanence, change, conditions and their propagation.

  • It is encompassing. It is based upon time, the flip-side of built form, which is equally a universal constant for all built forms.
  • It is descriptive. It does not dictate an effect of time or a belief of how time works, but simply an awareness of its existence.
  • It is agnostic. As people and built forms all are part of physical phenomena, they are all subject to time, regardless of psychological belief.

Again, many theories have already considered time, such as metabolism, who felt the urgency to adapt, Nazism, who modeled a 100-year Reich after Roman’s “eternal classical architecture”, and sustainable architecture, who thought about future effects. Theories which are neo, post or somehow reactionary or a revival towards an older theory or even future-looking are all addressing issues of time. All consider that time happens.

The reason time binds the first four is because it helps us frame the era where theories are valid. It makes us state exactly how universal our proposals are trying to be. This influences theories to be seen not as standalone items but as part of an ongoing process. This awareness of a larger process helps share traits across theories that tackle the same goals, giving us a little push towards spending longer on a goal before giving up.

Nature of a framework

The final framework: firmness, commodity, delight, ethic and time is nothing new. By definition it has to have existed, been practised and seem blindingly obvious to the profession in order to work. This is the final proof of its validity as a binding force to the profession and to its three outlined characteristics.

Although the framework is presented rather dogmatically, it is designed to be extended and interpreted by its users. The only restriction is in the way it is extended: in the form of theories which state their position on each of the considered elements before elaborating into detail.

If extensions of the five elements are considered, they should be considered being well aware of their goals. For example, this framework differs from the original intentions of Vitruvius, and the later famous extensions by Alberti. Whilst Vitruvius tells how buildings are built, and Alberti tells how buildings are to be built[1], this framework’s goals falls somewhere in between. It is created neither to establish a new discipline or open a new epoch, as Alberti did, nor to be a custodian of tradition, as Vitruvius did. It is a guide between the two to solve an existential crisis.

As a guide, the framework is designed into architectural education. Instead of assuming a guidance of inspiration and genius, a framework provides a rational base. This ensures not only that architects are theorising and building, but join the two in a way that they are in full intellectual command of what they are designing[2].

Current architectural mentality - a timeline of ideologies

The current mentality. A time-focused view with each theory dominating. This model creates periods of existential crises.

A new view based on a framework, where ideologies are linked to society and seen as assets - strategic tools to use.

Architecture’s foundation – a framework to achieve goals. Theories are no longer marked as irrelevant after a certain time period, but may be reapplied depending on the society. Existential crises can no longer exist as long as everything is described against the framework.

Architectural discipline is its true value: as a tool and indicator to help define architectural goals that are larger than individual theories. It converts theoretical argument into a greater synergy across the profession.

A framework is also a declaration. It declares an understanding that we cannot predict the world, but can’t ignore it either. Even if we choose to ignore elements in the framework, it will have to be a conscious decision.

Finally, perhaps the most important nature of a framework is its communicability. Its simplicity allows it to be understood by those outside the profession and quickly empathised by those entering it. This concreteness helps form the basis of any abstractions used in the industry and distils it to useful, beneficial applications. Because we can once again connect to society on disciplined, measured and focused foundation, we can once again serve it as a profession.

Where to from here?

With an army of theories at our command, hundreds of tested implementations, and a framework to generate new ones should we need to, the only thing left is to actually define goals.

The question is, does architecture have a political meaning? The answer is, self-evidently yes. Should architects, like Le Corbusier or anyone else, today, try and change the world? The answer is also yes. Should architects have a blindness to who the client is? The answer is no.

Ricky Burdett, London School of Economics[3]

While the framework cannot prescribe goals, I can propose some as an individual. But what long-term, with high ethical standards, widely recognised, measurable, focused, disciplined, world changing goals are appropriate for the needs of society and the interests of others?

[The eight Millennium Development Goals] form a blueprint agreed to by all the world’s countries and all the world’s leading development institutions.

United Nations[4]

Is it possible? Certainly not at the current state of the industry. Not with focus on theory and undisciplined schisms. Not without foundation. Not without society oriented goals and time to solve them. But perhaps it could be, just perhaps, if we became professionals.

  • [1] Alberti, L. B., Rywert, J, 1988, On the Art of Building in Ten Books, typeset Asco Typsetting, Hong Kong, printed USA.
  • [2] Breitschmid, M, Architecture \& Philosophy: Thoughts on Building, Blacksburg, Virginia, USA
  • [3] Barbican Five Points for An Ethical Architecture, Architecture Foundation London, viewed 4 October 2012, http://vimeo.com/29281095
  • [4] Background, United Nations Millennium Development Goals, viewed 20 October 2012, http://www.un.org/millenniumgoals/bkgd.shtml
Life & much, much more

Architecture’s existential crisis pt 3: Goals, ethics, and the people element

In part 1: Architecture is not a Profession, I outlined architecture’s distraction with competitive theories rather than acting as a professional discipline and serving society.

In part 2: The Foundations of Architecture, I talked about what architecture is currently based upon, and how to unify these into a governing framework that encompasses all architectural ideologies based off Vitruvius.

In this part, I will extend the framework to hint at the goals and responsibilities of a professional discipline.

The role of a framework in determining goals

Whilst outlining the framework gives us a foundation as a profession, it says nothing about the precedence of welfare, health and safety of the community as needed in a profession. To do this, we need to refine the architectural framework to pinpoint goals in society.

I use the phrase “pinpoint in society” because a framework does not prescribe goals. It is descriptive. It doesn’t claim that the profession knows everything about the world and is authorised to make decisions for it. However, by outlining elemental considerations when people decide on a goal, it is able to influence these goals (This is still the case even if an element is marked as unimportant.).

The current framework has three elements: structure/firmness, commodity/function, and delight/design/beauty. The first tackles built form itself whereas the latter two tackles community reactions towards built form. Whilst these latter two elements may tackle some aspects of the welfare, health and safety of the community, I believe the addition (Unlike previous attempts to extend Vitruvius’ statement[1], this adds a new element rather than providing detail about existing elements. This is because providing detail converts the framework into a theory.) of a fourth community element may pinpoint this.

A new element: People are as important as built form

Architecture is a discipline where it is impossible to escape values. It’s radically value-laden. I think it’s possible that you can become an architect and see it as somewhat autonomous and not as a political act, which is incredibly naive. I try to make students aware of the radical, political, cultural, social nature of our work and how it’s impossible to escape those responsibilities.

-Thom Mayne, Morphosis

The element outlined above comes in the form of values and responsibilities. What governs our values and how to respond to these responsibilities are ethics (Ethics, morality and ethos (original Greek) can be used interchangeably.). As ethics also fits the requirements of a framework, I propose for ethics to be added as a fourth element:

  • It is encompassing. It is based upon people, which is a universal constant for all built forms. Whilst Vitruvius already targets the aesthetic judgement (when people react to firmness), the moral judgement (when people react to commodity) is left unconsidered. Whether or not we are consciously making decisions based on ethics, it will have effects nonetheless.
  • It is descriptive. It does not dictate the alignment of the moral compass but instead just highlights its presence as a quality of an architecture.
  • It is agnostic. All cultures have a moral compass, and as such, applies to all cultures. Ethics also covers the relation between groups and individuals, which won’t exclude individualistic cultures or the third architectural body who does what they please.

To further prove ethics as an element, we can list some theories who highlight their consideration to ethics: sustainability, where the primary value is that our decisions should not inhibit the opportunities of the future, modernism, where the moral value of truth was translated into an aesthetic quality, and then post-modernism, where the populist ethic was rejected[2]. As for older examples of theories, any theory governed by religious or political ideas has by definition shown consideration of ethics.

Ethics is also a useful addition as it fills a gap left by the original three elements (Vitruvius did mention aspects of ethics[3], such as relationships between men, politics, and precepts, but treats it in the form of a prescribed theory, not a framework). The original three elements either consider the built form itself or the relations between people and built form. Noticeably missing is people themselves. A recognition of people themselves is needed to highlight the distinction between the roles buildings play and the roles people play. Ethics covers both people themselves and the relationships to built form.

This coverage of people themselves and relationships to architecture cover societal aspects: aspects such as politics, environment / sustainability, humanitarian needs, urban planning, right down to individual clients. Including ethics as an element clearly strengthens the link to the welfare, health and safety of the community – one step closer to an architectural profession.

All architects have two clients whenever they work – one is the person that actually pays the bills, and the other is society in general. I think an architect that doesn’t see they are working for society in general doesn’t know his job.

-Joseph Rykwert, Architectural Historian[4]

Understanding of the interests of society is a prerequisite for ethics to be considered. This means that adding ethics as an element helps encourage consideration of our actions in the interests of others.

Although it is not the job of a framework to govern the application of its elements, it’s important to make sure that it can be applied in the first place. ie. to ensure that ethics is not “good in theory but not in practice”. This allows the element to be carried into architectural theories, and then implemented in architectural styles. We can prove this by citing religion, as well as agnostic hierarchies of ethical systems[5]. This practical side of the element means not only can it seed theories, it can fulfil the frameworks goals as a measurement tool.

Ethics is also complex. The inability to create a set of non-conflicting simple rules to govern ethics[5] over humanity’s history suggests a NP-complete nature. This means not only can it be applied in practice, it can also take many different forms that will continue to change over time.

This consideration of the interests of others, nature, welfare, health, and safety changes Vitruvius’ framework into a professional framework, ie. a framework pinpointed in society. We now have a framework consisting of firmness, commodity, delight, and ethics.

  • [1] Watkin, D, 2005, A History of Western Architecture, Laurence King Publishing, London, UK
  • [2] Boje, D. M., Toward a Narrative Ethics for Modern and Postmodern Organization Science, viewed 10 October 2012, http://business.nmsu.edu/~dboje/papers/toward_a_narrative_ethics_for_mo.htm
  • [3] Wotton, H, 1651, The elements of architecture (translated from De Architectura, Vitruvius), Thomas Maxey, London, UK
  • [4] Barbican Five Points for An Ethical Architecture, Architecture Foundation London, viewed 4 October 2012, http://vimeo.com/29281095
  • [5] Singer, P, 2011, Practical Ethics, Cambridge University Press, New York, USA
Life & much, much more

Architecture’s existential crisis pt 2: The foundations of architecture

In part 1, I outlined architecture’s distraction with competitive theories rather than acting as a professional discipline and serving society. In this part, I will talk a bit about the categories of architectural theories and styles, and how we can unify these.

Why theories and styles are inappropriate

Goals and foundation are equally important to a functioning profession. However, although we have plenty of candidates for goals as offered by theories over the years, we only have a few candidates for architecture’s foundation. As of now, we seem to mainly compete over architectural theories and architectural styles. These become our two initial foundational candidates.

An architectural style describes the physical characteristics of an era. This may be as specific as pointed arches in Gothic architecture, or as vague as chaotic forms in Deconstructivist architecture.

An architectural theory is a set of ideas that outline an approach towards architecture. These ideas are non-arbitrary, which may be implemented in one or more architectural styles. For example, modernism’s “form follows function” is a theoretical approach towards architecture, and one stylistic implementation is by removing ornamentation from a building.

Creating this distinction between style and theory is important as it reveals that styles are insignificant. They are merely a single manifestation of an idea that people copied. They are fleeting, superficial, and aesthetically subjective–but more importantly, they represent a lack of understanding of the discipline behind a building (This has been identified in the second group of the architectural schism.). These are not hallmarks of a good foundation to base the architectural profession upon.

In contrast, an architectural theory is normally based on the religious, political, social, technological and ethical ideas of the time. This encompasses more aspects of our total experience of the world and thus makes it a better candidate for an architectural foundation.

Theories have been described as that which identifies the practices, production and related challenges of architecture. They re-evaluate architecture’s intentions and relevance\cite{newagenda_. Although it shares the same intentions as a foundation, the fact remains that theories die and have a short-lived existence compared to architecture’s full lifespan.

If theories and styles are both inappropriate, a third route is to consider that theories are simply strategies executed underneath a global and timeless architectural framework. The theory is not the foundation of architecture, but an instance which tackles the issues that the framework proposes. This is in the same way that a style is an instance which tackles the issues that a theory proposes. Identifying this global and timeless architectural framework, and in turn, foundation, is the first step to resolving architecture’s crisis.

Characteristics of a framework

A framework is a basic structure underlying a system or concept. Rather than attempt to elaborate on this phrase, I will instead immediately present an architectural framework:

[in Architecture, an operative art] the end must direct the operation. The end is to build well.

Well [an ideal] building hath three conditions: firmness [sturdy], commodity [useful], and delight [beautiful].

-Vitruvius[1]

For a quote which has survived more than 2000 years, it seems to remain relevant and encompasses all architectural theories. No matter how different each theory is, each theory first prioritises these three elements, and then prescribes a strategy to showcase their prioritisation. For example, Gothic architecture may be seen as prioritising firmness and delight, or Modernism may prioritise firmness (technology) and commodity. Some believe all are equal (Vitruvius), but all theories form a stance in relation to these three.

We also notice that the framework’s elements are neither prescriptive, proscriptive, affirmative or critical of anything. It is a listing of attributes which must be considered for a building, but offers no more guidance. It is a description, not an arguing point.

These elements are also agnostic. They do not rely on a culture, religion or belief. All physical forms have an element of structure (firmness). All living beings all have an intent (commodity). And when living beings are put together with structure, we give an aesthetic judgement (delight). This characteristic has given it a timeless nature.

These three characteristics (encompassing, descriptive, and agnostic) upheld by three elements (firmness, commodity, and delight) form an unquestionable architectural framework. Architects are now free to juggle different theories as strategies governed by the framework, but must consider all elements of the framework. They are also still free to implement a theory as an architectural style. Each style considers a theory, and each theory considers the framework.

A new hierarchy of Framework > Theory > Style shifts the focus of architecture away from the details of theories towards a set of commonalities. This allows us to treat theories as just another item in our toolkit towards solving bigger problems. It’s no longer about getting caught up in the details and their changing natures, it’s about selecting the right tool for the job.

This means that theories can be marketed as what they truly are: an approach towards a defined society, not a law unto itself. This helps prevent arguments about details and encourages speculation over the elements in the architectural framework as a root for theoretical strategies.

A resulting increased emphasis on society as a specific audience per theory allows us to be more aware of society’s needs. This allows us to tackle multiple types of societies simultaneously with each theoretical solution tailored towards their interests. This satisfies the professional requirement of working for the benefit of society.

Because of the framework’s characteristics, it may always be applied in all situations at all times without prescribing goals–a simple, agreeable outline that has always affected what we had done in the past, without restricting what we do in the future.

In part 3, I will explain how this architectural framework is incomplete without a compass to guide its application, and introduce the question of architectural ethics.

  • [1] Wotton, H, 1651, The elements of architecture (translated from De Architectura, Vitruvius), Thomas Maxey, London, UK
Uncategorized

CodeIgniter – Simple, clean, MVC framework for PHP.

People learning PHP go through the wonderful stages of <?php echo 'Hello, world!'; ?>, the then branch off into either: 1) Wow! It’s so dynamic! Let’s create everything right here right now! or 2) Wow! It’s so messed up I don’t know $int from $char! Unfortunately, the people who belong in (1) tend to spend the next couple years in an ignorant bliss, spewing out hundreds of lines of non-OOP code with a structure somewhat like this:

<?php
include './inc/template/header.php';
if ( $p == '' )
{
include './inc/pages/index.php';
}
elseif ( $p == 'about')
{
include './inc/pages/about.php';
}
[... etc ...]
else
{
include './inc/template/404.php';
}
include 'footer.php';
?>

Well. Look familiar to anybody? (or even worse examples!) Hah! My good sir, you have just missed out on the programming epiphany of the century. Any script kiddy with the guts to program before learning OOP should have their guts removed, quartered, and stuck up as a warning to other coders. So, if you are doing PHP, but you don’t know what OOP or MVC is – here is your cue to fricassé your arse and get ready for some late nights of programming ecstasy.

This post is somewhat a half-rant about the disadvantages of coding without any OOP or proper framework, and also a sort of happy unrelated babble talk brought about by me recently opening up (g)Vim again to code some very simple PHP, then taking a look at POSE2. For those that don’t know, POSE2 was the project to basically make E2 as open as possible. It’s an MVC (Model-View-Controller) framework, with no built-in helper classes. It’s extremely minimalistic. It was used to construct VisionBin, and E2-Productions.com currently runs on it too.

Hilariously enough, I fell into the common programmer trap of recreating the wheel. That’s why now, instead of advertising my oh-so-awesome POSE2 system, I’m going to be recommending you CodeIgniter. CI is a fast, clean, superbly documented MVC PHP framework. Or so I say before trying it out properly. Let’s actually see how awesome it is. I will type this post out live as I convert the extremely simple E2 site from POSE2 to CI.

Ok, apparently my connection hates me as it keeps on failing to download the tiny CI source files. After several retries, I finally am ready to start …. ok, uploading onto E2. This is great as I don’t get a lot of extra unneeded files in the / directory (except for index.php, obviously!), so everything is nicely tucked away in the system directory. Ok, quite a lot of files being uploaded here, but compared to other frameworks, this is slim. Let’s try visiting it without bothering to read any installation documents. Yep, already, it’s working without any needed config. I don’t see any installation docs (perhaps I’m just blur) but I do notice a config/ directory. It’s wonderfully documented and there’s quite a minimal amount to setup. .htaccess is a pain to setup due to specific server configurations (took quite a bit of debugging, but the option to fix it was hidden in the configuration), but other than that, it worked flawlessly. Easy to create new views, models, and controllers. Lots of helper classes – perfect, looks like exactly what anybody needs. Embeddable views to enable for templating…perfect.

First impression: wonderful, fast, user-friendly and amazingly well documented. Will give future updates on how I find it as I use it more. Meanwhile, I definitely recommend it to people.

Uncategorized

Learn how to make a basic website framework.

This will teach you how to setup one page for all pages! So it’ll be a lot easier when changing layouts!
Not only that, say GOODBYE to /index.php?page=contact…now you can just have /contact without actually making the directory!
This will ALSO teach you how to have a site which you can easily switch version (like when running parallel systems) when you are working on a new version and you don’t want others to know. It will have password protection which will allow only authorized users to test the version.
Say goodbye to “coming soon” pages!

Ok, first we want a layout…Let’s be simple (just forget validation temporarily, this just an example):

My title.<br />
<a href=”http://site.com”>Home</a><br />
<a href=”http://site.com/asdf”>asdf</a><br />
content will go here<br />
Copyright.

Let’s save that file as index.php. Save it in a directory called “versionname” (you can change this, but remember to change the rest of the code as well) Now, replace “content will go here” with this:

<?php
if($page == “”) {
include “/home/username/public_html/versionname/home.php”;
} elseif($page == “asdf”) {
include “/home/username/public_html/versionname/asdf.php”;
} else {
echo “error”;
}
?>

Basically, it will see what the value of the variable $page is and accordingly, it will display the correct page.
Create a new page called home.php (you can put whatever you want in it), and save it in the “versionname” directory. Then create a new page called asdf.php and put whatever you want in it and save it in the “versionname” directory.

Now try and go to yoursite.com/versionname. It will display your home page. Then go to yoursite.com/versionname/?page=asdf. It will display your asdf page. Let’s say in the future you decide to change your layout…you only need to change one page…the index.php page.

Ok. now instead of ?page=asdf, lets turn it into just /asdf. Go into your public_html folder (or your equivalent of it) and search for .htaccess. Open it up. This is apache server scripting. Won’t go into much detail though. You’re probably annoyed because you want your homepage to be in yoursite.com and not yoursite.com/versionname. Simple, add this code in .htaccess:

RewriteEngine on
RewriteBase /

ReWriteRule ^/$ versionname/index.php
ReWriteRule ^$ versionname/index.php

Now, try to go to yoursite.com. Amazing! The URL didn’t even change! Now to change into /asdf. add this:

ReWriteRule ^asdf/$ versionname/index.php?page=asdf
ReWriteRule ^asdf$ versionname/index.php?page=asdf

Now, go to yoursite.com/asdf. Amazing! It showed the ?page=asdf page!
Ok, now that you’ve done all that, let’s say you want a new version, but you don’t want to delete everything and setup a coming soon page. Create your new version in a directory called “versionname2”.
Now, you want people to be able to access your new version, but not all people. So here’s what you do. Add this to the top of your versionname (not 2) index.php:

<?php
session_start();
header(“Cache-control: private”);
if( $_POST[beta] ) {
if( $_POST[pass] == “yourpassword” ) {
$_SESSION[“beta”] = “1”;
}}
if( $_SESSION[beta] == 1 ) {
include “/home/username/public_html/versionname2/index.php”;
} else {
?>

And now, add the form below to wherever you want the verification to be:

<form method=”post” action=””><br />
<input name=”pass” type=”password” class=”input”>
<input name=”beta” type=”submit” value=”betatest”>
</form>

So now, when you type in the password “yourpassword” in the form, you will be browsing your new version, with no edited URLs! Of course, to make it fully compatible you need to add the if $page=”” statements to your versionname2 index.php, but that’s simple to do.
Ok, you’ve finished coding your new version. Simple, just go to your .htaccess, and replace all the /versionname to /versionname2. Done! You’ve succesfully upgraded your site.

Note: this is very basic but I hope it has helped some of you.