Please refer to http://tomschlick.com/2012/11/01/composer-with-fuelphp/ for a better writeup on how to add Composer support to FuelPHP 1.x.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function array_sort($array, $key, $order = 'asc', $sort_flags = SORT_REGULAR) | |
{ | |
if( ! is_array($array)) | |
{ | |
return FALSE; | |
} | |
foreach($array as $k=>$v) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Input array | |
$user = array( | |
'name' => 'Bob Smith', | |
'age' => 43, | |
'address' => array( | |
'city' => 'Houston', | |
'state' => 'TX', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$data = array( | |
array( | |
'info' => array( | |
'pet' => array( | |
'type' => 'dog' | |
) | |
), | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#allows a single uri through the .htaccess password protection | |
SetEnvIf Request_URI "/testing_uri$" test_uri | |
#allows everything if its on a certain host | |
SetEnvIf HOST "^testing.yoursite.com" testing_url | |
SetEnvIf HOST "^yoursite.com" live_url | |
Order Deny,Allow | |
AuthName "Restricted Area" | |
AuthType Basic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"keys": ["super+alt+left"], | |
"command": "set_layout", | |
"args": | |
{ | |
"cols": [0.0, 0.33, 1.0], | |
"rows": [0.0, 1.0], | |
"cells": [[0, 0, 1, 1], [1, 0, 2, 1]] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"config": { | |
"vendor-dir": "fuel/vendor" | |
}, | |
"minimum-stability": "dev", | |
"require": { | |
"php": ">=5.3.6", | |
"mexitek/phpcolors": "*", | |
"nategood/httpful": "*", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Composer | |
require dirname(COREPATH).'/vendor/autoload.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Before posting this article I sent it out to a few friends to give me a reality check. I got enough thumbs up to feel confident posting it, but Chris Hartjes asked me to check outside for the "wahmbulance". I understand that this article is pointless, which to be fair - is the point. | |
PHP is well known for having an inconsistent API when it comes to PHP functions. Anyone with an anti-PHP point of view will use this as one of their top 3 arguments for why PHP sucks, while most PHP developers will point out that they don't really care. This is mostly because we're either used to it, have a god-like photographic memory or our IDE handles auto-complete so it's a moot point. For me I'm not too fussed because I spend more time trying Googling words like recepie (see, I got that wrong) recipe than I ever spend looking up PHP functions. | |
Another big thing that anti-PHP folks laugh about is the lack of scalar objects, so instead of $string->length() you have to do strlen($string). | |
ANOTHER thing that people often joke |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$string = 'TS'; | |
$imagine = new Imagine\Gd\Imagine(); | |
$size = new Imagine\Image\Box($imgsize, $imgsize); | |
$color = new Imagine\Image\Color('#333', 100); | |
$image = $imagine->create($size, $color); |