Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Hacking Neos - How to extend and customize Neos...

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →

Hacking Neos - How to extend and customize Neos and Flow - InspiringCon 2016

This presentation has given by Christian Müller and Sebastian Kurfürst @InspiringCon 2016 in Kolbermoor.

Sebastian Kurfürst

April 22, 2016

Transcript

67 slides
  1. Flow Framework Content Repository Custom Packages Rendering Engine Neos User

    Interface Media (Images, ...) MVC / Fluid HTTP Object Management / Dependency Injection / Aspect Oriented Programming
  2. Flow Framework Content Repository Custom Packages Rendering Engine Neos User

    Interface Media (Images, ...) MVC / Fluid HTTP Object Management / Dependency Injection / Aspect Oriented Programming
  3. Flow Framework Content Repository Custom Packages Rendering Engine Neos User

    Interface Media (Images, ...) MVC / Fluid HTTP Object Management / Dependency Injection / Aspect Oriented Programming
  4. Check the Flow Settings.yaml PHP Exception Handler Logger Doctrine Filters

    Custom Database Mapping Types Resource Handling Authentication Providers
  5. TYPO3:
 
 Flow:
 
 aop:
 
 # Registers global objects

    to be evaluated for dynamic pointcut expressions
 globalObjects:
 
 securityContext: TYPO3\Flow\Security\Context
 
 compatibility:
 
 uriBuilder:
 
 # A compatibility flag that affects the behavior of the UriBuilder when creating relative URIs:
 # TRUE: The UriBuilder creates relative path like "some/path", a base tag is required in the respective HTML head
 # FALSE: The UriBuilder prefixes the path with the scripts request path: "/document/root/some/path", no base tag will be required
 #
 # NOTE: This flag will be obsolete with version 2.2 and removed in version 3.0 of Flow
 createRelativePaths: FALSE
 
 core:
 
 # Flow's application context
 # This setting is automatically set by the configuration manager and can't be set manually.
 context: ''
 
 # Key of the "main" package of the application. This package's meta data is used for displaying the application
 # name, version etc. in the ./flow command line help and where else needed.
 applicationPackageKey: 'TYPO3.Flow'
 
 # Path and filename of the PHP binary
 # The constant PHP_BINDIR usually contains the path, but on Windows this doesn't work reliably
 phpBinaryPathAndFilename: '%PHP_BINDIR%/php'
 
 # optional list of variables (key: value) that will be set for all Flow CLI sub requests
 subRequestEnvironmentVariables: []
 
 # Set which php.ini file should be used for the CLI sub requests.
 # If not set (that is value equals NULL) the php.ini file of the executing process (usually the web server's) is used.
 # If set to a path and filename, the specified php.ini file is loaded.
 # If set to boolean FALSE, Flow does not try to specify any php.ini file to the sub process.
 subRequestPhpIniPathAndFilename: NULL
 
 # optional list of INI entries (entry: value) to set for all Flow CLI sub requests.
 # This equals to the -d argument of the php CLI
 # Example:
 # subRequestIniEntries:
 # 'date.timezone': 'UTC'
 subRequestIniEntries: []
 
 error:
 
 exceptionHandler:
 
 # Defines the global, last-resort exception handler.
 # The specified class must implement \TYPO3\Flow\Error\ExceptionHandlerInterface
 className: TYPO3\Flow\Error\ProductionExceptionHandler
 
 # default options for all rendering groups (see below). Options can be overridden in the respective rendering group
 defaultRenderingOptions:
 renderTechnicalDetails: FALSE
 logException: TRUE
 
 # Rendering groups can define special renderings depending on status code or class of the
 # thrown exception.
 renderingGroups:
 
 notFoundExceptions:
 matchingStatusCodes: [404]
 options:
 logException: FALSE
 templatePathAndFilename: 'resource://TYPO3.Flow/Private/Templates/Error/Default.html'
 variables:
 errorDescription: 'Sorry, the page you requested was not found.'
 
 databaseConnectionExceptions:
 matchingExceptionClassNames: ['TYPO3\Flow\Persistence\Doctrine\Exception\DatabaseException']
 options:
 templatePathAndFilename: 'resource://TYPO3.Flow/Private/Templates/Error/Default.html'
 variables:
 errorDescription: 'Sorry, the database connection couldn''t be established.'
 
 errorHandler:
 
 # Defines which errors should result in an exception thrown - all other error
 # levels will be silently ignored. Only errors that can be handled in an
 # user-defined error handler are affected, of course.
 exceptionalErrors: ['%E_USER_ERROR%', '%E_RECOVERABLE_ERROR%']
 
 debugger:
 
 # List of regular expressions classes are matched against in the debugger
 # to prevent them from being expanded.
 ignoredClasses:
 'TYPO3\\Flow\\Aop.*': TRUE
 'TYPO3\\Flow\\Cac.*': TRUE
 'TYPO3\\Flow\\Core\\.*': TRUE
 'TYPO3\\Flow\\Con.*': TRUE
 'TYPO3\\Flow\\Http\\RequestHandler': TRUE
 'TYPO3\\Flow\\Uti.*': TRUE
 'TYPO3\\Flow\\Mvc\\Routing.*': TRUE
 'TYPO3\\Flow\\Log.*': TRUE
 'TYPO3\\Flow\\Obj.*': TRUE
 'TYPO3\\Flow\\Pac.*': TRUE
 'TYPO3\\Flow\\Persistence\\(?!Doctrine\\Mapping).*': TRUE
 'TYPO3\\Flow\\Pro.*': TRUE
 'TYPO3\\Flow\\Ref.*': TRUE
 'TYPO3\\Flow\\Sec.*': TRUE
 'TYPO3\\Flow\\Sig.*': TRUE
 'TYPO3\\Flow\\.*ResourceManager': TRUE
 'TYPO3\\Fluid\\.*': TRUE
 '.+Service$': TRUE
 '.+Repository$': TRUE
 'PHPUnit_Framework_MockObject_InvocationMocker': TRUE
 
 mvc:
 # Defines routes that should be included after existing routes defined in the main Routes.yaml (if any)
 # Note: This only allows to include existing Routes.yaml files from other packages, you can't adjust the routes via Settings.
 #
 # Syntax:
 # 'Some.Package': TRUE
 # 'SomeOther.Package':
 # position: 'after Some.Package'
 #
 routes: []
 
 http:
 # Defines an explicit base URI that should be used. This affects
 # resource management, routing and all other parts accessing
 # "Http\Request->getBaseUri()".
 #
 # If this setting is NULL, the base URI will be detected from the current
 # request (default).
 baseUri: NULL
 
 # Defines the workflow of one request from bootstrap to the HTTP response
 #
 # By default this workflow is devided in three sub-chains "preprocess", "process" and "postprocess" but the chain can be restructured as needed
 #
 chain:
 
 'preprocess':
 position: 'before process'
 chain: []
 
 'process':
 chain:
 'routing':
 position: 'start'
 component: 'TYPO3\Flow\Mvc\Routing\RoutingComponent'
 'dispatching':
 component: 'TYPO3\Flow\Mvc\DispatchComponent'
 
 'postprocess':
 chain:
 'standardsCompliance':
 position: 'end'
 component: 'TYPO3\Flow\Http\Component\StandardsComplianceComponent'
 
 log:
 
 # Settings for Flow's default loggers
 systemLogger:
 logger: TYPO3\Flow\Log\Logger
 backend: TYPO3\Flow\Log\Backend\FileBackend
 backendOptions:
 logFileURL: '%FLOW_PATH_DATA%Logs/System.log'
 createParentDirectories: TRUE
 severityThreshold: '%LOG_INFO%'
 maximumLogFileSize: 10485760
 logFilesToKeep: 1
 logMessageOrigin: FALSE
 
 securityLogger:
 backend: TYPO3\Flow\Log\Backend\FileBackend
 backendOptions:
 logFileURL: '%FLOW_PATH_DATA%Logs/Security.log'
 createParentDirectories: TRUE
 severityThreshold: '%LOG_INFO%'
 maximumLogFileSize: 10485760
 logFilesToKeep: 1
 logIpAddress: TRUE
 
 sqlLogger:
 backend: TYPO3\Flow\Log\Backend\FileBackend
 backendOptions:
 logFileURL: '%FLOW_PATH_DATA%Logs/Query.log'
 createParentDirectories: TRUE
 severityThreshold: '%LOG_INFO%'
 maximumLogFileSize: 10485760
 logFilesToKeep: 1
 
 i18nLogger:
 backend: TYPO3\Flow\Log\Backend\FileBackend
 backendOptions:
 logFileURL: '%FLOW_PATH_DATA%Logs/I18n.log'
 createParentDirectories: TRUE
 severityThreshold: '%LOG_INFO%'
 maximumLogFileSize: 1048576
 logFilesToKeep: 1
 
 i18n:
 
 # The default locale identifier.
 defaultLocale: en
 
 # The fallback rule to use for locale resolution
 fallbackRule:
 # Strictly use the defined order (without implicit locale fallback)
 strict: FALSE
 # The locales identifiers to use in their desired order
 order: []
 
 object:
 
 # If enabled, the Object Manager will - additionally to the class files found
 # in the "Classes" directory - also register class files found in the directory
 # "Tests/Functional/". Enabling this feature obviously only makes sense in a
 # testing context.
 registerFunctionalTestClasses: FALSE
 
 # Explicitly include classes to object management (Reflection and Configuration building).
 # Sequence of package keys with an array of regular expressions.
 # The package key must match the key found in PackageStates.php regarding case.
 #
 # Each regular expression will be tested against the list of fully qualified
 # class names in the package and classes will be included if matching.
 #
 # For Flow packages (type = "typo3-flow-*") this setting is not required as they're
 # reflected by default. You can however exclude specific (or all) classes from Flow packages
 # by specifying corresponding regular expressions that don't match classes to exclude.
 #
 # Note: The previous setting "excludeClasses" has been deprecated with Flow 3.0
 includeClasses: []
 
 package:
 
 # This can be used to make packages inactive, even though they would be
 # activated automatically otherwise.
 inactiveByDefault:
 - 'neos.composerplugin'
 - 'Composer.Installers'
 # Option for the PackageManager::Create to map the packagesPath by package type
 packagesPathByType:
 'typo3-flow-package': 'Application'
 'typo3-flow-framework': 'Framework'
 
 persistence:
 
 # Options for the default Doctrine persistence
 backendOptions:
 driver: 'pdo_mysql'
 host: '127.0.0.1'
 dbname: NULL
 user: NULL
 password: NULL
 charset: 'utf8'
 cacheAllQueryResults: FALSE
 
 doctrine:
 # By default Doctrine proxy compilation is done in the Flow bootstrap
 enable: TRUE
 sqlLogger: NULL
 filters:
 Flow_Security_Entity_Filter: 'TYPO3\Flow\Security\Authorization\Privilege\Entity\Doctrine\SqlFilter'
 
 # DBAL custom mapping types can be registered here
 dbal:
 mappingTypes:
 'flow_json_array':
 dbType: 'json_array'
 className: 'TYPO3\Flow\Persistence\Doctrine\DataTypes\JsonArrayType'
 'objectarray':
 dbType: 'array'
 className: 'TYPO3\Flow\Persistence\Doctrine\DataTypes\ObjectArray'
 
 # Doctrine ORM Lifecycle events and their subscribers and listeners.
 # See Flow manual, chapter "Persistence" for further information on how to subscribe to Doctrine events.
 eventSubscribers: []
 eventListeners: []
 
 reflection:
 
 # A list of tags to be ignored during reflection

  6. Flow Framework Content Repository Custom Packages Rendering Engine Neos User

    Interface Media (Images, ...) MVC / Fluid HTTP Object Management / Dependency Injection / Aspect Oriented Programming
  7. Signals / Slots PHP /**
 * @Flow\Signal
 */
 public function

    emitObjectUpdated($object)
 { // method filled automatically by AOP (see later.)
 }
  8. Flow Framework Content Repository Custom Packages Rendering Engine Neos User

    Interface Media (Images, ...) MVC / Fluid HTTP Object Management / Dependency Injection / Aspect Oriented Programming
  9. Flow Framework Content Repository Custom Packages Rendering Engine Neos User

    Interface Media (Images, ...) MVC / Fluid HTTP Object Management / Dependency Injection / Aspect Oriented Programming
  10. Flow Framework Content Repository Custom Packages Rendering Engine Neos User

    Interface Media (Images, ...) MVC / Fluid HTTP Object Management / Dependency Injection / Aspect Oriented Programming
  11. class MySource extends AbstractDataSource implements DataSourceInterface { protected static $identifier

    = ‘your-datahandler-identifier’; public function getData( NodeInterface $node = null, array $arguments) { // Implementation follows here } }

More Decks by Sebastian Kurfürst

Other Decks in Technology