Skip to content

Instantly share code, notes, and snippets.

View hhamon's full-sized avatar

Hugo Hamon hhamon

View GitHub Profile
@hhamon
hhamon / ci.yml
Last active October 1, 2022 15:28
Github Actions PHP CI
name: '[PROJECT NAME]'
'on':
push:
branches:
- master
- develop
- 'releases/**'
pull_request: null
env:
working_directory: ./application
<?php
require __DIR__.'/vendor/autoload.php';
$loader = new Twig_Loader_Filesystem(__DIR__.'/views');
$twig = new Twig_Environment($loader, array(
//'cache' => __DIR__.'/cache',
));
return $twig;
<?php
namespace Todo\Persistence;
class TodoGateway
{
private $dbh;
private $hostname;
private $username;
private $password;
@hhamon
hhamon / PdoLoader.php
Created August 11, 2012 07:06 — forked from havvg/PdoDumper.php
PdoLoader as translation resource for Symfony2
<?php
namespace Ormigo\Bundle\TranslationBundle\Translation\Loader;
use Symfony\Component\Config\Resource\ResourceInterface;
use Symfony\Component\Translation\Loader\LoaderInterface;
use Symfony\Component\Translation\MessageCatalogue;
use Symfony\Component\Translation\Translator;
/**
@hhamon
hhamon / gist:2900910
Created June 9, 2012 13:04
Weaver Life as a Git History
cd weaver/
git add single.php
git commit -m'Ryan is a single man'
git add leanna.php
git commit -m"Added Leanna to Ryan's life"
git mv single.php engaged.php
git commit -m'Ryan & Leanna are engaged'
git mv engaged.php married.php
git commit -m'Congratz!'
git push
phpunit --bootstrap tests/bootstrap.php --coverage-html ./coverage tests/Propel/Tests/Generator/Model/
PHP Deprecated: /Users/hugo.hamon/Development/Propel2/vendor/.composer/autoload.php is deprecated, please use vendor/autoload.php or vendor/composer/autoload_* instead
See https://groups.google.com/forum/#!msg/composer-dev/fWIs3KocwoA/nU3aLko9LhQJ for details in /Users/hugo.hamon/Development/Propel2/vendor/.composer/autoload.php on line 3
PHP Stack trace:
PHP 1. {main}() /opt/local/bin/phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() /opt/local/bin/phpunit:46
PHP 3. PHPUnit_TextUI_Command->run() /opt/local/lib/php/PHPUnit/TextUI/Command.php:130
PHP 4. PHPUnit_TextUI_Command->handleArguments() /opt/local/lib/php/PHPUnit/TextUI/Command.php:139
PHP 5. PHPUnit_TextUI_Command->handleBootstrap() /opt/local/lib/php/PHPUnit/TextUI/Command.php:562
@hhamon
hhamon / Module.php
Created April 27, 2012 15:52
Listenning to the bootstrap MVC event
<?php
namespace NewModule;
use Zend\EventManager\StaticEventManager;
use Zend\EventManager\EventDescription as Event;
use Zend\EventManager\StaticEventManager;
class Module
{
@hhamon
hhamon / gist:1974593
Created March 4, 2012 20:07
Optional arguments in JS
Reversi.prototype.getNewCell = function (row, col) {
var cell = { 'row': 0, 'col': 0 };
if (undefined !== row) {
cell.row = parseInt(row);
}
if (undefined !== col) {
cell.col = parseInt(col);
Building fixtures in tests/Fixtures/bookstore OK
Building fixtures in tests/Fixtures/bookstore-packaged Execution of target "insert-sql" failed for the following reason: /Users/hugo.hamon/Development/Propel2/tools/generator/build-propel.xml:191:1: You haven't provided an sqldbmap, or the one you specified doesn't exist: /Users/hugo.hamon/Development/Propel2/tests/Fixtures/bookstore-packaged/build/sql/sqldb.map
[phing] /Users/hugo.hamon/Development/Propel2/tools/generator/build-propel.xml:191:1: You haven't provided an sqldbmap, or the one you specified doesn't exist: /Users/hugo.hamon/Development/Propel2/tests/Fixtures/bookstore-packaged/build/sql/sqldb.map
OK
Building fixtures in tests/Fixtures/namespaced OK
Building fixtures in tests/Fixtures/reverse/mysql [phing] SQLSTATE[42S02]: Base table or view not found: 1051 Unknown table 'book'
OK
Building fixtures in tests/Fixtures/schemas [phing] SQLSTATE[42000]: Syntax error or access
<?php
------ Symfony2 API ---------------
interface UserInterface
{
// ...
public function equals(UserInterface $user);
}