Skip to content

Instantly share code, notes, and snippets.

@Bendihossan
Bendihossan / gist:3610275
Created September 3, 2012 16:00
Composer workflow with Git

Composer Workflow

Example of why composer.lock should be version controlled and workflow of how it can be used.

The reason we put ranges in composer.json is so that we can check for updates in our development environment and test our source code works with it BEFORE it goes into production.

The reason we have specific versions of vendors in composer.lock is so that we can version it and install the application into production environments with the versions we have tested while in development. Because of this we never run composer update on a production environment.

Creating an Application

@Bendihossan
Bendihossan / gist:3635985
Created September 5, 2012 12:42
composer update --verbose output
Updating sensio/framework-extra-bundle dev-master (ade2d5 => 1281f6)
Checking out 1281f6218226ddb88df8546f28a3166e2a0cb55d
Pulling in changes:
1281f62 - Fabien Potencier: merged branch franmomu/patch-2 (PR #156)
5c3800d - Fran Moreno: [Doc] Add slash to DateTime class
<project name="your-project-name-goes-here" default="build">
<property name="dir.src" value="${basedir}/src/"/>
<target name="build" depends="prepare,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpunit,phpcb"/>
<target name="build-parallel" depends="prepare,lint,tools-parallel,phpunit,phpcb"/>
<target name="tools-parallel" description="Run tools in parallel">
<parallel threadCount="2">
<sequential>
<antcall target="pdepend"/>
<antcall target="phpmd-ci"/>
@Bendihossan
Bendihossan / composer.json
Created September 28, 2012 12:43
Specify Packages Manually in Composer
{
"repositories": [
{
"type": "package",
"package": {
"name" : "twitter/bootstrap",
"version" : "2.1.0",
"source" : {
"url" : "https://github.com/twitter/bootstrap.git",
"type" : "git",
@Bendihossan
Bendihossan / gist:3879169
Created October 12, 2012 13:20
related content
/**
* @param ArrayCollection $related Related item
*/
public function setRelated(ArrayCollection $related)
{
$this->related = $related;
foreach ($related as $relation) {
if (! $relation->getRelated()->contains($this)) {
$relation->addRelation($this);
[bendihossan@arianrhod ~]$ sudo curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 135 100 135 0 0 251 0 --:--:-- --:--:-- --:--:-- 322
100 1549 100 1549 0 0 1487 0 0:00:01 0:00:01 --:--:-- 1487
\033[0;34mCloning Oh My Zsh...\033[0m
Cloning into '/home/bendihossan/.oh-my-zsh'...
remote: Counting objects: 4479, done.
remote: Compressing objects: 100% (1788/1788), done.
remote: Total 4479 (delta 2642), reused 4067 (delta 2432)
"repositories": [
{
"type" : "git",
"name" : "me/myProject",
"version" : "dev-myFeatureBranch",
"url" : "[email protected]:me/myProject.git"
}
],
@Bendihossan
Bendihossan / ContentController.php
Created December 19, 2012 14:34
AnnotationException: [Semantical Error] The annotation "@fos\RestBundle\Controller\Annotations\View" in method MyProject\Bundle\ContentBundle\Controller\ContentController::indexAction() does not exist, or could not be auto-loaded.
<?php
...
use FOS\RestBundle\Controller\Annotations\View;
...
/**
* Returns all content
*
* [GET] /{_locale}/content
* @View()
*
PHP Fatal error: Declaration of JMS\\DebuggingBundle\\Kernel\\NullProfilerStorage::find() must be compatible with that of Symfony\\Component\\HttpKernel\\Profiler\\ProfilerStorageInterface::find() in /opt/local/apache2/htdocs/symfony-standard/vendor/jms/debugging-bundle/JMS/DebuggingBundle/Kernel/NullProfilerStorage.php on line 25
jekyll serve
WARNING: Could not read configuration. Using defaults (and options).
No such file or directory - /opt/local/apache2/htdocs/jekyll/_config.yml
Building site: /opt/local/apache2/htdocs/jekyll -> serve
YAML Exception reading broken_front_matter2.erb: syntax error on line 2, col 0: `'
YAML Exception reading exploit_front_matter.erb: invalid subclass
Liquid Exception: No such file or directory - /opt/local/apache2/htdocs/jekyll/_includes in 2008-12-13-include.markdown
/opt/local/lib/ruby/gems/1.8/gems/jekyll-0.12.0/bin/../lib/jekyll/tags/include.rb:20:in `chdir'
/opt/local/lib/ruby/gems/1.8/gems/jekyll-0.12.0/bin/../lib/jekyll/tags/include.rb:20:in `render'
/opt/local/lib/ruby/gems/1.8/gems/liquid-2.4.1/lib/liquid/block.rb:94:in `render_all'