Esempio n. 1
0
// | Copyright (c) 2002-2006, Akelos Media, S.L.  & Bermi Ferrer Martinez |
// | Released under the GNU Lesser General Public License, see LICENSE.txt|
// +----------------------------------------------------------------------+

/**
 * @package AkelosFramework
 * @subpackage AkActionMailer
 * @author Bermi Ferrer <bermi a.t akelos c.om>
 * @copyright Copyright (c) 2002-2008, Akelos Media, S.L. http://www.akelos.org
 * @license GNU Lesser General Public License <http://www.gnu.org/copyleft/lesser.html>
 */


defined('AK_ACTION_MAILER_CHARS_NEEDING_QUOTING_REGEX') ? null :
define('AK_ACTION_MAILER_CHARS_NEEDING_QUOTING_REGEX', "/[\\000-\\011\\013\\014\\016-\\037\\177-\\377]/");
ak_define('ACTION_MAILER_EMULATE_IMAP_8_BIT', true);

class AkActionMailerQuoting
{

    /**
     * Convert the given text into quoted printable format, with an instruction
     * that the text be eventually interpreted in the given charset.
     */
    function quotedPrintable($text, $charset = AK_ACTION_MAILER_DEFAULT_CHARSET)
    {
        $text = str_replace(' ','_', preg_replace('/[^a-z ]/ie', 'AkActionMailerQuoting::quotedPrintableEncode("$0")', $text));
        return "=?$charset?Q?$text?=";
    }

    /**
Esempio n. 2
0
/**
 * @package AkelosFramework
 * @subpackage AkActionMailer
 * @author Bermi Ferrer <bermi a.t akelos c.om>
 * @copyright Copyright (c) 2002-2006, Akelos Media, S.L. http://www.akelos.org
 * @license GNU Lesser General Public License <http://www.gnu.org/copyleft/lesser.html>
 */
require_once AK_LIB_DIR . DS . 'AkBaseModel.php';
require_once AK_LIB_DIR . DS . 'AkActionMailer' . DS . 'AkMail.php';
require_once AK_LIB_DIR . DS . 'AkActionMailer' . DS . 'AkMailParser.php';
require_once AK_LIB_DIR . DS . 'AkActionMailer' . DS . 'AkActionMailerQuoting.php';
ak_define('MAIL_EMBED_IMAGES_AUTOMATICALLY_ON_EMAILS', false);
ak_define('ACTION_MAILER_DEFAULT_CHARSET', AK_CHARSET);
ak_define('ACTION_MAILER_EOL', "\r\n");
ak_define('ACTION_MAILER_EMAIL_REGULAR_EXPRESSION', "([a-z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-z0-9\\-]+\\.)+))([a-z]{2,4}|[0-9]{1,3})(\\]?)");
ak_define('ACTION_MAILER_RFC_2822_DATE_REGULAR_EXPRESSION', "(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun), *)?(\\d\\d?) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d\\d\\d\\d) (\\d{2}:\\d{2}(?::\\d\\d)) (UT|GMT|EST|EDT|CST|CDT|MST|MDT|PST|PDT|[A-Z]|(?:\\+|\\-)\\d{4})");
/**
* AkActionMailer allows you to send email from your application using a mailer model and views.
*
* = Mailer Models
*
* To use AkActionMailer, you need to create a mailer model.
*   
*   $ script/generate mailer Notifier
*
* The generated model inherits from AkActionMailer. Emails are defined by creating methods within the model which are then 
* used to set variables to be used in the mail template, to change options on the mail, or 
* to add attachments.
*
* Examples:
*
Esempio n. 3
0
    function Test_of_new_object_instantation()
    {
        $AkTestUser = new AkTestUser();

        $this->assertEqual($AkTestUser->getModelName(), 'AkTestUser');
        $this->assertEqual($AkTestUser->getTableName(), 'ak_test_users');
        $this->assertErrorPattern('/ak_test_user/',$AkTestUser->setTableName('ak_test_user'));

        $this->_createNewTestingModel('AkTestUnavailableDatabase');
        //$AkTestUnavailableDatabase = new AkTestUnavailableDatabase();
        //$this->assertEqual($AkTestUnavailableDatabase->getModelName(), 'AkTestUnavailableDatabase');
        ak_define('AK_ACTIVE_RECORD_VALIDATE_TABLE_NAMES', true);
        //$this->assertErrorPattern('/Ooops! Could not fetch details for the table ak_test_unavailable_database./',$AkTestUnavailableDatabase->getTableName());
    }
Esempio n. 4
0
// +----------------------------------------------------------------------+
// | Akelos Framework - http://www.akelos.org                             |
// +----------------------------------------------------------------------+
// | Copyright (c) 2002-2006, Akelos Media, S.L.  & Bermi Ferrer Martinez |
// | Released under the GNU Lesser General Public License, see LICENSE.txt|
// +----------------------------------------------------------------------+

/**
 * @package ActiveSupport
 * @subpackage Generators
 * @author Bermi Ferrer <bermi a.t akelos c.om>
 * @copyright Copyright (c) 2002-2006, Akelos Media, S.L. http://www.akelos.org
 * @license GNU Lesser General Public License <http://www.gnu.org/copyleft/lesser.html>
 */
ak_define('ACTIVE_RECORD_VALIDATE_TABLE_NAMES', false);

class ScaffoldGenerator extends  AkelosGenerator
{
    var $command_values = array('model_name','controller_name','(array)actions');

    function cast()
    {
        $this->model_name = AkInflector::camelize($this->model_name);
        $this->model_file_path = AkInflector::toModelFilename($this->model_name);
        $this->controller_name = empty($this->controller_name) ? $this->model_name : (AkInflector::camelize($this->controller_name));
        $this->controller_file_path = AkInflector::toControllerFilename($this->controller_name);
        $this->controller_class_name = $this->controller_name.'Controller';
        $this->controller_human_name = AkInflector::humanize($this->controller_name);
        $this->helper_var_name = '$'.AkInflector::underscore($this->controller_name).'_helper';
Esempio n. 5
0
ak_define('ASSET_HOST', '');
if (!defined('AK_ASSET_URL_PREFIX')) {
    ak_define('ASSET_URL_PREFIX', str_replace(array(AK_BASE_DIR, '\\', '//'), array('', '/', '/'), AK_PUBLIC_DIR));
}
ak_define('DEV_MODE', AK_ENVIRONMENT == 'development');
ak_define('AUTOMATICALLY_UPDATE_LANGUAGE_FILES', AK_DEV_MODE);
ak_define('ENABLE_PROFILER', false);
ak_define('PROFILER_GET_MEMORY', false);
$ADODB_CACHE_DIR = AK_CACHE_DIR;
/**
 * Mode types for error reporting and loggin
 */
ak_define('MODE_DISPLAY', 1);
ak_define('MODE_MAIL', 2);
ak_define('MODE_FILE', 4);
ak_define('MODE_DATABASE', 8);
ak_define('MODE_DIE', 16);
ak_define('ROUTES_MAPPING_FILE', AK_CONFIG_DIR . DS . 'routes.php');
ak_define('OS', strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ? 'WINDOWS' : 'UNIX');
ak_define('CHARSET', 'UTF-8');
require_once AK_LIB_DIR . DS . 'Ak.php';
/*
if(!AK_CLI && (AK_DEBUG || AK_ENVIRONMENT == 'setup')){
    include_once(AK_LIB_DIR.DS.'AkDevelopmentErrorHandler.php');
    $__AkDevelopmentErrorHandler = new AkDevelopmentErrorHandler();
    set_error_handler(array(&$__AkDevelopmentErrorHandler, 'raiseError'));
}
*/
ak_define('ACTION_CONTROLLER_DEFAULT_REQUEST_TYPE', 'web_request');
ak_define('ACTION_CONTROLLER_DEFAULT_ACTION', 'index');
require_once AK_LIB_DIR . DS . 'AkActionController.php';