Events

Configuration

config|<path>

config|<path>($config)

A configuration file is loaded.

Parameters:
  • &$config (array) – The loaded array from the file
<?php

// Listening to the event
Event::register_function('config|nos::controller/admin/page/page', function(&$config)
{
    // ...
}
// Triggering the event
$config = Config::load('nos::controller/admin/page/page', true);

Also works with absolute paths :

<?php

// Listening to the event
Event::register_function('config|/data/www/novius-os/local/config/test.php', function(&$config)
{
    // ...
}
// Triggering the event (file must exists)
$config = Config::load('/data/www/novius-os/local/config/test.php', true);

config|<group>

config|<group>($config)

A configuration array is loaded.

Parameters:
  • &$config (array) – The loaded array
<?php

// Listening to the event
Event::register_function('config|group', function(&$config)
{
    // ...
}
// Triggering the event
Config::load(array(), 'group');

Front-office (website)

front.start

front.start($params)

An .html page is requested.

Parameters:
  • $params (array) –
    &$url:string Current URL (without leading domain, with trailing .html)
    &$cache_path:string Which entry should be checked / written in the cache
<?php

Event::register_function('front.start', function($params)
{
    $url =& $params['url'];
    $cache_path =& $params['cache_path'];
    // ...
});

front.parse_wysiwyg

front.parse_wysiwyg($html)

Additional processing on a WYSIWYG (HTML content).

Parameters:
  • $html (string) – HTML content, already pre-processed by the core
<?php

Event::register_function('front.parse_wysiwyg', function(&$content)
{
    // ...
});

front.display

front.display($html)

Additional processing on the page (HTML content).

Parameters:
  • $html (string) – HTML content of the page (will be written in the cache)
<?php

Event::register_function('front.display', function(&$html)
{
    // ...
});

front.pageFound

front.pageFound($params)

Page to display have been found.

Parameters:
<?php

Event::register('front.pageFound', function($params)
{
    $page = $params['page'];
    // ...
});

front.response

front.response($params)

Before that the response be sended.

Parameters:
  • $params (array) –
    &$content:string The response body
    &$status:int The HTTP response status for this response
    &$headers:array HTTP headers for this response
<?php

Event::register_function('front.response', function($params)
{
    $content =& $params['content'];
    $status =& $params['status'];
    $headers =& $params['headers'];
    // ...
});

front.404NotFound

front.404NotFound($params)

An .html page was requested, but not found.

Parameters:
  • $params (array) –
    $url:string Current URL (without leading domain, with trailing .html)
<?php

Event::register('front.404NotFound', function($params)
{
    $url = $params['url'];
    // ...
});

404 entry point

New in version 0.2.0.2.

404.start

404.start($params)

A inexistant file is requested. Can be media or attachment file.

Parameters:
  • $params (array) –
    &$url:string URL requested (without leading domain)
<?php

Event::register_function('404.start', function($params)
{
    $url =& $params['url'];
    // ...
});

404.mediaFound

404.mediaFound($params)

Media to send have been found.

Parameters:
  • $params (array) –
    $url:string The requested URL
    $media:Nos\Media\Model_Media
    &$send_file:string The path of the file to be sent
<?php

Event::register_function('404.mediaFound', function($params)
{
    $url = $params['url'];
    $media = $params['media'];
    $send_file =& $params['send_file'];
    // ...
});

404.mediaNotFound

404.mediaNotFound($url)
A inexistant media file is requested.
Parameters:
  • $url (string) – URL requested (without leading domain)
<?php

Event::register('404.mediaNotFound', function($url)
{
    // ...
});

404.attachmentFound

404.attachmentFound($params)

Attachment file to send have been found.

Parameters:
  • $params (array) –
    $url:string The requested URL
    $attachement:Nos\Attachment
    &$send_file:string The path of the file to be sent
<?php

Event::register_function('404.attachmentFound', function($params)
{
    $url = $params['url'];
    $attachement = $params['attachement'];
    $send_file =& $params['send_file'];
    // ...
});

404.attachmentNotFound

404.attachmentNotFound($url)
A inexistant attachment file is requested.
Parameters:
  • $url (string) – URL requested (without leading domain)
<?php

Event::register('404.attachmentNotFound', function($url)
{
    // ...
});

404.end

404.end($url)
A inexistant file is requested. No attachment or media file matched the URL.
Parameters:
  • $url (string) – URL requested (without leading domain)
<?php

Event::register('404.end', function($url)
{
    // ...
});

Back-office

admin.launchers

admin.launchers()

Triggered after recuperation and before parsing of installed launchers.

Parameters:
  • $launchers (array) – Associative array of installed launchers
<?php

Event::register_function('admin.launchers', function(&$launchers)
{
    // ...
});

New in version 4.2.

admin.loginSuccess

admin.loginSuccess()

A user just successfully connected to the back-office.

<?php

Event::register('admin.loginSuccess', function()
{
    // ...
});

admin.loginFail

admin.loginFail()

A user is trying to connect to the back-office with an email or an invalid password.

<?php

Event::register('admin.loginFail', function()
{
    // ...
});

admin.loginSuccessWithCookie

admin.loginSuccessWithCookie()

A user just successfully re-connected to the back-office using the cookie.

<?php

Event::register('admin.loginSuccessWithCookie', function()
{
    // ...
});

admin.loginFailWithCookie

admin.loginFailWithCookie()

A user has failed to connect to the back-office using the cookie.

<?php

Event::register('admin.loginFailWithCookie', function()
{
    // ...
});

Emails

email.before_send

email.before_send($email)

Before sending an email.

Parameters:
  • $email (object) – Email_Driver instance
<?php

Event::register('email.before_send', function($email)
{
    // ...
}

email.after_send

email.after_send($email)

After a mail was sent.

Parameters:
  • $email (object) – Email_Driver instance
<?php

Event::register('email.after_send', function($email)
{
    // ...
}

email.error

email.error($params)

On email send error.

Parameters:
  • $params (object) –

    Email_Driver instance

    $email:The email driver object
    $exception:The exception object
    <?php
    
    Event::register('email.error', function($params)
    {
        $email = $params['email'];
        $exception = $params['exception'];
        // ...
    }
    

Deprecated

nos.deprecated

nos.deprecated($params)

A deprecated message will be write in log.

Parameters:
  • $params (array) –
    $message:The message to log.
    $since:The version since deprecation.
    $debug_backtrace:
     The debug_backtrace
<?php

Event::register('nos.deprecated', function($params)
{
    $message = $params['message'];
    $since = $params['since'];
    $debug_backtrace = $params['debug_backtrace'];
    // ...
});

Migration

migrate.exception

migrate.exception($params)

A migration throw an exception. Exception propagation can be stopped.

Parameters:
  • $params (array) –
    $e:The exception object
    &$ignore:boolean If the event change is value to true, the exception will not be propagated.
    $migration:array The migration array
<?php

Event::register_function('migrate.exception', function($params)
{
    $e = $params['e'];
    $ignore = $params['ignore'];
    $migration =& $params['migration'];
    // ...

    $ignore = true; // The exception will not be propagated
});
Read the Docs v: elche
Versions
latest
stable
elche
dubrovka
chiba.2
chiba.1
Downloads
pdf
htmlzip
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.