Skip to content

Instantly share code, notes, and snippets.

Jeroen Desloovere jeroendesloovere

Block or report user

Report or block jeroendesloovere

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jeroendesloovere
jeroendesloovere / sitemap_generator.php
Last active Jul 13, 2018
Sitemap generator: new version
View sitemap_generator.php
<?php
/**
* NOTE: the code below was a brainstorm session.
* You should check out https://github.com/jeroendesloovere/sitemap-bundle for the latest code
*/
/**
* CORE
*/
View translation_helper.php
<?php
$document = new DOMDocument();
$document->load($argv[1]);
$existingTranslations = [];
function getUserInput() {
return readline("\nTranslation PT: ");
}
View fork_cms_core_rules.md

Fork CMS core rules

PHP

  • Vendor namespace ForkCMS
  • We follow the PSR-2 coding style guide
  • Class names in PascalCase, f.e.: class Url{}, class FirstName{} - All abbreviations need to be PascalCased
  • Method names in camelCase, f.e.: function getUrl(){}, function getFirstName(){}- All abbreviations need to be camelCased

Symfony service-ids

@jeroendesloovere
jeroendesloovere / structure.md
Last active Feb 6, 2018
Fork CMS structure
View structure.md
- src
  - Console
    - Core
    - Locale
    - Thumbnails
  - Component
    - Asset
      - Asset.php
      - AssetCollection.php
View MediaLibraryImporter.md

MediaLibraryImporter

/**

  • Creating */

// Creating the media group

@jeroendesloovere
jeroendesloovere / README.md
Last active Mar 10, 2017
MediaLibrary + external Amazon, Dropbox, ...
View README.md

Fork CMS MediaLibrary module + external storage type (Amazon, Dropbox, ...)

The idea

Backend thumbnails

What happens in the MediaLibrary module

When somebody uploads a source to the website. => A MediaItemCreated event is triggered.

View doctrine-reverse-engineering.md

Doctrine Reverse Engineering

Doctrine Source

How to create Entity files from database tables?

1. Creating .orm.yml files in /Resources/config/...

php app/console doctrine:mapping:import --force AcmeBlogBundle yml --env=prod
View php-cs-fixer.md

PHP-CS-FIXER

This tool checks for PSR code styling. More info

Usage

Installation

We download it to /usr/local/bin/

View DataGridDoctrine.php
<?php
// Filename: src/Backend/Core/Engine/DataGridDoctrine.php
namespace Backend\Core\Engine;
/*
* This file is part of Fork CMS.
*
* For the full copyright and license information, please view the license
* file that was distributed with this source code.
*/
View BackendHelper.php
<?php
// Backend MediaGroups Helper
$this->media = $this->get('media_library.helper.backend')->create(
$this->frm,
$this->tpl,
$this->header,
array(
// create new with specified MediaGroup type
$this->get('media_library.factory.backend.group')->create(
You can’t perform that action at this time.