This is about getting rid of Dependency Injection Container and DI practices taken from Java. Good bye Java, viva la PHP!
We start with common example. Session.
<?php
class SessionStorage {
function __construct() | # 2009 Copyright Susan Potter <me at susanpotter dot net> | |
| # You can read her software development rants at: https://www.susanpotter.net/software/ | |
| # Released under CreativeCommons-attribution-noncommercial-sharealike license: | |
| # http://creativecommons.org/licenses/by-nc-sa/1.0/ | |
| namespace :git do | |
| namespace :submodule do | |
| desc "Initializes submodules" | |
| task :init, :roles => :app do | |
| invoke_command "cd #{current_path} && git submodule init", :via => run_method | |
| end |
| # How to echobot with XMPP, BOSH, and Strophe | |
| 1. Setup ejabberd(http://www.ejabberd.im/) server and setup account admin@localhost.local | |
| NOTE: localhost should be enough. If you setup something else, make sure you add it at /etc/hosts like this | |
| #/etc/hosts | |
| 127.0.0.1 localhost.local | |
| NOTE: Also download Psi(http://psi-im.org/), and make sure you can connect to your ejabberd server. | |
| 2. Download strophe(http://code.stanziq.com/strophe/) and place it (eg: /Users/makoto/work/sample/strophejs-1.0) |
| <? | |
| // VIN API decoder for PHP 4.x+ | |
| define('ELEMENT_CONTENT_ONLY', true); | |
| define('ELEMENT_PRESERVE_TAGS', false); | |
| function getXML($vin) { | |
| $curl = curl_init(); | |
| curl_setopt ($curl, CURLOPT_URL, 'http://vinapi.skizmo.com/vins/'. $vin.'.xml'); | |
| curl_setopt ($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/xml', 'X-VinApiKey: #YOURAPIKEYGOESHERE#')); //use your API key here |
| <?xml version="1.0" encoding="utf-8" ?> | |
| <project name="Webads"> | |
| <!--This target runs the phpcs--> | |
| <target name="phpcs"> | |
| <!--unix--> | |
| <exec dir="${basedir}" executable="phpcs" failonerror="false" osfamily="unix"> | |
| <arg line="--standard=Cake --extensions=php,module,inc ${basedir}"/> | |
| </exec> | |
| </target> |
| alias ack='ack-grep --type-set twig=.twig' |
| $audience = new Zend_Form_Element_MultiCheckbox('audience', array( | |
| 'label' => 'Target Audience', | |
| 'required' => true, | |
| 'multiOptions' => array( | |
| 'students' => 'Students', | |
| 'faculty' => 'Faculty', | |
| 'staff' => 'Staff', | |
| 'stustaf' => 'Student Employees', | |
| 'retiree' => 'Emeritus/Retiree'), | |
| 'validators' => array( |
| <?php | |
| use Symfony\Component\HttpFoundation\File\File; | |
| use Symfony\Component\HttpFoundation\File\UploadedFile; | |
| /** | |
| * @Entity | |
| */ | |
| class Document | |
| { |
This is about getting rid of Dependency Injection Container and DI practices taken from Java. Good bye Java, viva la PHP!
We start with common example. Session.
<?php
class SessionStorage {
function __construct() | <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Capture Photo</title> | |
| <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1"/> | |
| <script type="text/javascript" charset="utf-8" src="js/phonegap.js"></script> | |
| <script type="text/javascript" charset="utf-8"> | |
| var pictureSource; // picture source | |
| var destinationType; // sets the format of returned value |
| # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 | |
| # $Id: Portfile 89615 2012-02-04 05:28:00Z ryandesign@macports.org $ | |
| PortSystem 1.0 | |
| name php5 | |
| conflicts php5-devel php52 | |
| # Keep version of php5 in sync with bundled php5 extension ports. | |
| # Increment revision of php5-eaccelerator when updating version of php5. | |
| epoch 1 |