-
Are you familiar with the tools we're given in PHP 5.4 to write Object Oriented code?
We can manipulate scope, have interfaces, abstract classes, traits, namespaces… -
What's the difference between
Public
,Protected
andPrivate
?
Public ensures a class method/variable is available everywhere, from any instance of the class. Protected makes the method/variable only available to the class itself and extending classes. Private makes the method/var only accessible to the class itself. -
Do you know any of these acronyms?
- DRY "Don't Repeat Yourself"
This file contains hidden or 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
public function timeAgo(\Datetime $then) | |
{ | |
$now = new \Datetime('now'); | |
$interval = $then->diff($now); | |
$points = array( | |
'y' => array('year', 'years'), | |
'm' => array('month', 'months'), | |
'd' => array('day', 'days'), |
This file contains hidden or 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
/* | |
In security.yml I declared a parameter (for the life of me, I can't remember if this was important): | |
# security.yml | |
parameters: | |
security.acl.permission.map.class: Acme\DemoBundle\Security\Acl\Permission\PermissionMap | |
In services.yml I redeclare the acl collection cache service: |
This file contains hidden or 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 | |
namespace Smoovi\CoreBundle\Security; | |
use Symfony\Component\Security\Acl\Model\AclProviderInterface, | |
Symfony\Component\Security\Acl\Domain\ObjectIdentity, | |
Symfony\Component\Security\Acl\Domain\UserSecurityIdentity; | |
use Smoovi\CoreBundle\Security\Acl\Permission\MaskBuilder; |
This file contains hidden or 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
#logger.level = Logger::MAX_LEVEL | |
#default_run_options[:pty] = true | |
set :application, "moovly" | |
set :stage, "staging" | |
set :branch, "develop" | |
set :domain, "#{stage}.#{application}.com" | |
set :deploy_to, "/var/www/html/sites/#{domain}" | |
set :app_path, "app" |