function beforeFilter() { $this->RequestHandler->setContent('json', 'text/html'); $user = $this->Auth->user(); if ($user['User']['role'] !== '1') { $this->Auth->authError = 'You must be authorized as administrator to have acces to this page.'; return false; } $this->Security->validatePost = false; Inflector::rules('transliteration', array('/А/' => 'A', '/а/' => 'a', '/Б/' => 'B', '/б/' => 'b', '/В/' => 'V', '/в/' => 'v', '/Г/' => 'G', '/г/' => 'g', '/Д/' => 'D', '/д/' => 'd', '/Е|Ё/' => 'e', '/е|ё/' => 'e', '/Ж/' => 'Zh', '/ж/' => 'zh', '/З/' => 'Z', '/з/' => 'z', '/И|Й/' => 'I', '/и|й/' => 'i', '/К/' => 'K', '/к/' => 'k', '/Л/' => 'L', '/л/' => 'l', '/М/' => 'M', '/м/' => 'm', '/Н/' => 'N', '/н/' => 'n', '/О/' => 'O', '/о/' => 'o', '/П/' => 'P', '/п/' => 'p', '/Р/' => 'R', '/р/' => 'r', '/С/' => 'S', '/с/' => 's', '/Т/' => 'T', '/т/' => 't', '/У/' => 'U', '/у/' => 'u', '/Ф/' => 'F', '/ф/' => 'f', '/Х/' => 'Kh', '/х/' => 'kh', '/Ц/' => 'Ts', '/ц/' => 'ts', '/Ч/' => 'Ch', '/ч/' => 'ch', '/Ш/' => 'Sh', '/ш/' => 'sh', '/Щ/' => 'Shch', '/щ/' => 'shch', '/Ъ/' => '""', '/ъ/' => '"', '/Ы/' => 'Y', '/ы/' => 'y', '/Ь/' => '\'\'', '/ь/' => '\'', '/Э/' => 'E', '/э/' => 'e', '/Ю/' => 'Yu', '/ю/' => 'yu', '/Я/' => 'Ya', '/я/' => 'ya')); }
<?php /** * Ajustes das inflections para português * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource * @author Juan Basso <*****@*****.**> * @license http://www.opensource.org/licenses/mit-license.php The MIT License * @link http://wiki.github.com/jrbasso/cake_ptbr/inflections */ // Alteração do inflector $_uninflected = array('atlas', 'lapis', 'onibus', 'pires', 'virus', 'cnaes', '.*x'); $_pluralIrregular = array('abdomens' => 'abdomen', 'alemao' => 'alemaes', 'artesa' => 'artesaos', 'as' => 'ases', 'bencao' => 'bencaos', 'cao' => 'caes', 'capelao' => 'capelaes', 'capitao' => 'capitaes', 'chao' => 'chaos', 'charlatao' => 'charlataes', 'cidadao' => 'cidadaos', 'consul' => 'consules', 'cristao' => 'cristaos', 'dificil' => 'dificeis', 'email' => 'emails', 'escrivao' => 'escrivaes', 'fossel' => 'fosseis', 'germens' => 'germen', 'grao' => 'graos', 'hifens' => 'hifen', 'irmao' => 'irmaos', 'liquens' => 'liquen', 'mal' => 'males', 'mao' => 'maos', 'orfao' => 'orfaos', 'pais' => 'paises', 'pai' => 'pais', 'pao' => 'paes', 'perfil' => 'perfis', 'projetil' => 'projeteis', 'reptil' => 'repteis', 'sacristao' => 'sacristaes', 'sotao' => 'sotaos', 'tabeliao' => 'tabeliaes', 'rg' => 'rgs', 'pf' => 'pfs', 'uf' => 'ufs', 'funcao_exercida' => 'funcoes_exercidas', 'pais' => 'paises'); Inflector::rules('singular', array('rules' => array('/^(.*)(oes|aes|aos)$/i' => '\\1ao', '/^(.*)(a|e|o|u)is$/i' => '\\1\\2l', '/^(.*)e?is$/i' => '\\1il', '/^(.*)(r|s|z)es$/i' => '\\1\\2', '/^(.*)ns$/i' => '\\1m', '/^(.*)s$/i' => '\\1'), 'uninflected' => $_uninflected, 'irregular' => array_flip($_pluralIrregular)), true); Inflector::rules('plural', array('rules' => array('/^(.*)ao$/i' => '\\1oes', '/^(.*)(r|s|z)$/i' => '\\1\\2es', '/^(.*)(a|e|o|u)l$/i' => '\\1\\2is', '/^(.*)il$/i' => '\\1is', '/^(.*)(m|n)$/i' => '\\1ns', '/^(.*)$/i' => '\\1s'), 'uninflected' => $_uninflected, 'irregular' => $_pluralIrregular), true); Inflector::rules('transliteration', array('/À|Ã�|Â|Ã|Ä|Ã…/' => 'A', '/È|É|Ê|Ë/' => 'E', '/ÃŒ|Ã�|ÃŽ|Ã�/' => 'I', '/Ã’|Ó|Ô|Õ|Ö|Ø/' => 'O', '/Ù|Ú|Û|Ãœ/' => 'U', '/Ç/' => 'C', '/Ã�/' => 'D', '/Ñ/' => 'N', '/Å /' => 'S', '/Ã�|Ÿ/' => 'Y', '/Ž/' => 'Z', '/Æ/' => 'AE', '/ß/' => 'ss', '/Å’/' => 'OE', '/à |á|â|ã|ä|Ã¥|ª/' => 'a', '/è|é|ê|ë|&/' => 'e', '/ì|Ã|î|ï/' => 'i', '/ò|ó|ô|õ|ö|ø|º/' => 'o', '/ù|ú|û|ü/' => 'u', '/ç/' => 'c', '/ð/' => 'd', '/ñ/' => 'n', '/Å¡/' => 's', '/ý|ÿ/' => 'y', '/ž/' => 'z', '/æ/' => 'ae', '/Å“/' => 'oe', '/Æ’/' => 'f')); unset($_uninflected, $_pluralIrregular);
<?php Inflector::rules('plural', ['irregular' => ['Animl.core' => 'Animl.core', 'Animl.data' => 'Animl.data']]);
Inflector::rules('transliteration', array( '/À|Á|Â|Ã|Ä|Å/' => 'A', '/È|É|Ê|Ë/' => 'E', '/Ì|Í|Î|Ï/' => 'I', '/Ò|Ó|Ô|Õ|Ö|Ø/' => 'O', '/Ù|Ú|Û|Ü/' => 'U', '/Ç/' => 'C', '/Ð/' => 'D', '/Ñ/' => 'N', '/Š/' => 'S', '/Ý|Ÿ/' => 'Y', '/Ž/' => 'Z', '/Æ/' => 'AE', '/ß/'=> 'ss', '/Œ/' => 'OE', '/à|á|â|ã|ä|å|ª/' => 'a', '/è|é|ê|ë|&/' => 'e', '/ì|í|î|ï/' => 'i', '/ò|ó|ô|õ|ö|ø|º/' => 'o', '/ù|ú|û|ü/' => 'u', '/ç/' => 'c', '/ð/' => 'd', '/ñ/' => 'n', '/š/' => 's', '/ý|ÿ/' => 'y', '/ž/' => 'z', '/æ/' => 'ae', '/œ/' => 'oe', '/ƒ/' => 'f' ));
/** * testCustomSingularRule method * * @access public * @return void */ function testCustomSingularRule() { Inflector::rules('singular', array('/(eple)r$/i' => '\\1', '/(jente)r$/i' => '\\1')); $this->assertEqual(Inflector::singularize('epler'), 'eple'); $this->assertEqual(Inflector::singularize('jenter'), 'jente'); Inflector::rules('singular', array('rules' => array('/^(bil)er$/i' => '\\1', '/^(inflec|contribu)tors$/i' => '\\1ta'), 'uninflected' => array('singulars'), 'irregular' => array('spins' => 'spinor'))); $this->assertEqual(Inflector::singularize('inflectors'), 'inflecta'); $this->assertEqual(Inflector::singularize('contributors'), 'contributa'); $this->assertEqual(Inflector::singularize('spins'), 'spinor'); $this->assertEqual(Inflector::singularize('singulars'), 'singulars'); }
* Uncomment one of the lines below, as you need. make sure you read the documentation on CakePlugin to use more * advanced ways of loading plugins * * CakePlugin::loadAll(); // Loads all plugins at once * CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit * */ //CakePlugin::load('DebugKit'); // Enable the Dispatcher filters for plugin assets, and // CacheHelper. Configure::write('Dispatcher.filters', array('AssetDispatcher', 'CacheDispatcher')); // Add logging configuration. CakeLog::config('debug', array('engine' => 'FileLog', 'types' => array('notice', 'info', 'debug'), 'file' => 'debug')); CakeLog::config('error', array('engine' => 'FileLog', 'types' => array('warning', 'error', 'critical', 'alert', 'emergency'), 'file' => 'error')); Inflector::rules('plural', array('irregular' => array('billing' => 'billing'))); Inflector::rules('plural', array('irregular' => array('admin' => 'admin'))); if (!defined('FULL_BASE_URL')) { define('FULL_BASE_URL', 'http://rentsquaredev.com'); } define('USER_TYPE_MANAGER', 0); define('USER_TYPE_TENANT', 1); define('USER_TYPE_ADMIN', 2); define('MSG_STATUS_UNREAD', 0); define('MSG_STATUS_READ', 1); define('CC_FEE', 0.0275); define('ACH_FEE', 3.95); define('RENTSQUARE_MERCH_USER', 'yolodesign1'); define('RENTSQUARE_MERCH_PASS', 'whLswPbvLfkrHCZHvGHp'); define('RENTSQUARE_MERCH_KEY', 'E03E49619870FD8C9885513210F4F7F7BC1AB65BFE79456E'); define('BC_SANDBOXVALUE', true); //define('RENTSQUARE_MERCH_USER','RentSquare');
* 'Vendor' => array('/full/path/to/vendors/', '/next/full/path/to/vendors/'), * 'Console/Command' => array('/full/path/to/shells/', '/next/full/path/to/shells/'), * 'locales' => array('/full/path/to/locale/', '/next/full/path/to/locale/') * )); * */ /** * Custom Inflector rules, can be set to correctly pluralize or singularize table, model, controller names or whatever other * string is passed to the inflection functions * * Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * */ Inflector::rules('plural', array('rules' => array('/^([^A]+)$/i' => '\\1ar', '/^([^A]+)$/i' => '\\1er'), 'irregular' => array('purring' => 'purringer', 'selger' => 'selgere', 'kaffitype' => 'kaffityper', 'postsending' => 'postsendingar', 'transportbetaling' => 'transportbetalingar', 'restbetaling' => 'restbetalingar', 'forskuddsbetaling' => 'forskuddsbetalingar', 'kaffiimport' => 'kaffiimportar', 'kaffibrenning' => 'kaffibrenningar', 'lagerverditype' => 'lagerverdityper', 'lagerverdikonto' => 'lagerverdikontoer', 'lagerverdiflytting' => 'lagerverdiflyttinger', 'kontobalanse' => 'kontobalanser', 'kunde' => 'kunder', 'faktura' => 'fakturaer', 'kaffelager' => 'kaffelagre', 'kaffepris' => 'kaffepriser', 'kaffeflytting' => 'kaffeflyttinger', 'pengeflytting' => 'pengeflyttinger', 'konto' => 'kontoer', 'selger' => 'selgere', 'rolle' => 'roller', 'lagertype' => 'lagertyper', 'fralagertype' => 'fralagertyper', 'tillagertype' => 'tillagertyper', 'fralager' => 'fralagre', 'tillager' => 'tillagre', 'kontotype' => 'kontotyper', 'adresse' => 'adresser', 'kaffetype' => 'kaffetyper', 'frakonto' => 'frakontoer', 'tilkonto' => 'tilkontoer', 'fakturaadresse' => 'fakturaadresser', 'leveringsadresse' => 'leveringsadresser', 'startsaldo' => 'startsaldoer', 'rabatt' => 'rabatter', 'varetelling' => 'varetellinger', 'beholdning' => 'beholdninger', 'kaffelagerbeholdning' => 'kaffelagerbeholdninger', 'pengetelling' => 'pengetellingar', 'InternFil' => 'InternFiler', 'intern_fil' => 'intern_filer', 'internFil' => 'internFiler', 'internfil' => 'internfiler', 'kontoutskrift' => 'kontoutskrifter', 'purrefaktura' => 'purrefakturaer', 'mvaklasse' => 'mvaklasser', 'rekning' => 'rekningar', 'leverandor' => 'leverandorar', 'tinging' => 'tingingar', 'innstilling' => 'innstillingar'), 'uninflected' => array('kaffesalgvekt', 'kaffesalg', 'kaffeflyttingvekt', 'Faktura_Ubetalt', 'bilag', 'regnskap', 'kaffiinnkjop'))); Inflector::rules('singular', array('rules' => array('/^(.+)er$/i' => '\\1', '/^(.+)ar$/i' => '\\1'), 'irregular' => array(), 'uninflected' => array('regnskap'))); /** * Plugins need to be loaded manually, you can either load them one by one or all of them in a single call * Uncomment one of the lines below, as you need. make sure you read the documentation on CakePlugin to use more * advanced ways of loading plugins * * CakePlugin::loadAll(); // Loads all plugins at once * CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit * */ /** Copied from guide to upgrade to cake 2.2 **/ // Enable the Dispatcher filters for plugin assets, and // CacheHelper. Configure::write('Dispatcher.filters', array('AssetDispatcher', 'CacheDispatcher'));
* 'Locale' => array('/path/to/locales', '/next/path/to/locales'), * 'Vendor' => array('/path/to/vendors', '/next/path/to/vendors'), * 'Plugin' => array('/path/to/plugins', '/next/path/to/plugins'), * )); * */ /** * Custom Inflector rules, can be set to correctly pluralize or singularize table, model, controller names or whatever other * string is passed to the inflection functions * * Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * */ Inflector::rules('singular', array('rules' => array('/([rlnd])es$/i' => '\\1', '/([taeiouj])s$/i' => '\\1'), 'irregular' => array('users' => 'user', 'roles' => 'role', 'models' => 'model', 'controllers' => 'controller'))); Inflector::rules('plural', array('rules' => array('/([taeiouj])$/i' => '\\1s', '/([rlnd])$/i' => '\\1es'), 'irregular' => array('user' => 'users', 'role' => 'roles', 'model' => 'models', 'controller' => 'controllers'))); /** * Plugins need to be loaded manually, you can either load them one by one or all of them in a single call * Uncomment one of the lines below, as you need. make sure you read the documentation on CakePlugin to use more * advanced ways of loading plugins * * CakePlugin::loadAll(); // Loads all plugins at once * CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit * */ CakePlugin::loadAll(); #Definiendo la lengua español(spa) por defecto Configure::write('Config.language', 'spa'); //Autologin debugin Configure::write('AutoLogin', array('email' => '*****@*****.**')); Configure::write('EmailTokenRequest', array('email_debug' => '*****@*****.**'));
* 'Locale' => array('/path/to/locales', '/next/path/to/locales'), * 'Vendor' => array('/path/to/vendors', '/next/path/to/vendors'), * 'Plugin' => array('/path/to/plugins', '/next/path/to/plugins'), * )); * */ /** * Custom Inflector rules, can be set to correctly pluralize or singularize table, model, controller names or whatever other * string is passed to the inflection functions * * Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * */ Inflector::rules('plural', array('rules' => array('/(.*[^aeiou])$/i' => '\\1es', '/(.*[aeiou])$/i' => '\\1s'), 'irregular' => array('rol' => 'roles', 'perfil' => 'perfiles', 'user' => 'users', 'encuestasuser' => 'encuestasUsers'), 'uninflected' => array())); Inflector::rules('singular', array('rules' => array('/(.*[^aeiou])es$/i' => '\\1', '/(.*[aeiou])s$/i' => '\\1'), 'irregular' => array('roles' => 'rol', 'perfiles' => 'perfil', 'users' => 'user', 'encuestasusers' => 'encuestasUser'), 'uninflected' => array())); /** * Plugins need to be loaded manually, you can either load them one by one or all of them in a single call * Uncomment one of the lines below, as you need. make sure you read the documentation on CakePlugin to use more * advanced ways of loading plugins * * CakePlugin::loadAll(); // Loads all plugins at once * CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit * */ /** * You can attach event listeners to the request lifecyle as Dispatcher Filter . By Default CakePHP bundles two filters: * * - AssetDispatcher filter will serve your asset files (css, images, js, etc) from your themes and plugins * - CacheDispatcher filter will read the Cache.check configure variable and try to serve cached content generated from controllers *
* 'View' => array('/full/path/to/views/', '/next/full/path/to/views/'), * 'Controller' => array('/full/path/to/controllers/', '/next/full/path/to/controllers/'), * 'Model/Datasource' => array('/full/path/to/datasources/', '/next/full/path/to/datasources/'), * 'Model/Behavior' => array('/full/path/to/behaviors/', '/next/full/path/to/behaviors/'), * 'Controller/Component' => array('/full/path/to/components/', '/next/full/path/to/components/'), * 'View/Helper' => array('/full/path/to/helpers/', '/next/full/path/to/helpers/'), * 'Vendor' => array('/full/path/to/vendors/', '/next/full/path/to/vendors/'), * 'Console/Command' => array('/full/path/to/shells/', '/next/full/path/to/shells/'), * 'locales' => array('/full/path/to/locale/', '/next/full/path/to/locale/') * )); * */ /** * Custom Inflector rules, can be set to correctly pluralize or singularize table, model, controller names or whatever other * string is passed to the inflection functions * * Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * */ Inflector::rules('singular', array('rules' => array(), 'irregular' => array('profesor' => 'profesores'), 'uninflected' => array())); Inflector::rules('plural', array('rules' => array(), 'irregular' => array('profesores' => 'profesor'), 'uninflected' => array())); /** * Plugins need to be loaded manually, you can either load them one by one or all of them in a single call * Uncomment one of the lines below, as you need. make sure you read the documentation on CakePlugin to use more * advanced ways of loading plugins * * CakePlugin::loadAll(); // Loads all plugins at once * CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit * */
<?php Configure::write('Kinspir', array('Site' => array('url' => 'https://www.kinspir.com'), 'Email' => array('Address' => array('noreply' => '*****@*****.**', 'support' => '*****@*****.**'), 'Subject' => array('invited' => '%s has invited you to Kinspir with them', 'reset' => 'Kinspir account reset', 'notification' => 'You have received a notification in Kinspir'), 'Template' => array('invited' => 'invited', 'reset' => 'reset', 'notification' => 'notification')), 'Default' => array('User' => array('invites' => 10, 'role_id' => 2, 'locale' => 'en_US', 'is_active' => 1, 'group_id' => 4, 'level_id' => 4)))); // custom inflection // don't inflect the word css Inflector::rules('plural', array('uninflected' => array('css'))); // set CakePHP timezone to GMT ini_set('date.timezone', 'GMT'); // turn down error reporting error_reporting(E_ERROR | E_WARNING | E_PARSE);
* 'Locale' => array('/path/to/locales', '/next/path/to/locales'), * 'Vendor' => array('/path/to/vendors', '/next/path/to/vendors'), * 'Plugin' => array('/path/to/plugins', '/next/path/to/plugins'), * )); * */ /** * Custom Inflector rules, can be set to correctly pluralize or singularize table, model, controller names or whatever other * string is passed to the inflection functions * * Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * */ Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array('contactUs', 'serverRoomAccess', 'ephiRecieved', 'ephiRemoved', 'educationCenter'))); Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array('dashboard', 'contactUs', 'serverRoomAccess', 'ephiRecieved', 'ephiRemoved', 'educationCenter'))); /** * Plugins need to be loaded manually, you can either load them one by one or all of them in a single call * Uncomment one of the lines below, as you need. make sure you read the documentation on CakePlugin to use more * advanced ways of loading plugins * * CakePlugin::loadAll(); // Loads all plugins at once * CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit * */ CakePlugin::load('AclExtras'); CakePlugin::load('Upload'); CakePlugin::load('DebugKit'); //CakePlugin::loadAll(); //CakePlugin::load('Tools'); /**
* To prefer app translation over plugin translation, you can set * * Configure::write('I18n.preferApp', true); */ /** * You can attach event listeners to the request lifecycle as Dispatcher Filter. By default CakePHP bundles two filters: * * - AssetDispatcher filter will serve your asset files (css, images, js, etc) from your themes and plugins * - CacheDispatcher filter will read the Cache.check configure variable and try to serve cached content generated from controllers * * Feel free to remove or add filters as you see fit for your application. A few examples: * * Configure::write('Dispatcher.filters', array( * 'MyCacheFilter', // will use MyCacheFilter class from the Routing/Filter package in your app. * 'MyCacheFilter' => array('prefix' => 'my_cache_'), // will use MyCacheFilter class from the Routing/Filter package in your app with settings array. * 'MyPlugin.MyFilter', // will use MyFilter class from the Routing/Filter package in MyPlugin plugin. * array('callable' => $aFunction, 'on' => 'before', 'priority' => 9), // A valid PHP callback type to be called on beforeDispatch * array('callable' => $anotherMethod, 'on' => 'after'), // A valid PHP callback type to be called on afterDispatch * * )); */ Configure::write('Dispatcher.filters', array('AssetDispatcher', 'CacheDispatcher')); /** * Configures default file logging options */ App::uses('CakeLog', 'Log'); CakeLog::config('debug', array('engine' => 'File', 'types' => array('notice', 'info', 'debug'), 'file' => 'debug')); CakeLog::config('error', array('engine' => 'File', 'types' => array('warning', 'error', 'critical', 'alert', 'emergency'), 'file' => 'error')); Inflector::rules('singular', ['/(.*)res$/i' => '\\1r', '/(.*)nes$/i' => '\\1n', '/(.*)en$/i' => '\\1e', '/(.*)es$/i' => '\\1e', '/(.*)des$/i' => '\\1d', '/(.*)ses$/i' => '\\1s', '/(.*)les$/i' => '\\1l']); Inflector::rules('plural', ['/(.*)r$/i' => '\\1res', '/(.*)e$/i' => '\\1en', '/(.*)e$/i' => '\\1es', '/(.*)n$/i' => '\\1nes', '/(.*)d$/i' => '\\1des', '/(.*)s$/i' => '\\1ses', '/(.*)l$/i' => '\\1les']);
//defines all the needed constants include_once '301rewriting.php'; //do some 301 redirects /** * The settings below can be used to set additional paths to models, views and controllers. * This is related to Ticket #470 (https://trac.cakephp.org/ticket/470) * * App::build(array( * 'plugins' => array('/full/path/to/plugins/', '/next/full/path/to/plugins/'), * 'models' => array('/full/path/to/models/', '/next/full/path/to/models/'), * 'views' => array('/full/path/to/views/', '/next/full/path/to/views/'), * 'controllers' => array('/full/path/to/controllers/', '/next/full/path/to/controllers/'), * 'datasources' => array('/full/path/to/datasources/', '/next/full/path/to/datasources/'), * 'behaviors' => array('/full/path/to/behaviors/', '/next/full/path/to/behaviors/'), * 'components' => array('/full/path/to/components/', '/next/full/path/to/components/'), * 'helpers' => array('/full/path/to/helpers/', '/next/full/path/to/helpers/'), * 'vendors' => array('/full/path/to/vendors/', '/next/full/path/to/vendors/'), * 'shells' => array('/full/path/to/shells/', '/next/full/path/to/shells/'), * 'locales' => array('/full/path/to/locale/', '/next/full/path/to/locale/') * )); * */ /** * As of 1.3, additional rules for the inflector are added below * * Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * */ Inflector::rules('plural', array('irregular' => array('surveys_taken' => 'surveys_taken')));
* 'Lib' => array('/path/to/libs/', '/next/path/to/libs/'), * 'Locale' => array('/path/to/locales/', '/next/path/to/locales/'), * 'Vendor' => array('/path/to/vendors/', '/next/path/to/vendors/'), * 'Plugin' => array('/path/to/plugins/', '/next/path/to/plugins/'), * )); * */ /** * Custom Inflector rules, can be set to correctly pluralize or singularize table, model, controller names or whatever other * string is passed to the inflection functions * * Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * */ Inflector::rules('plural', array('uninflected' => array('import', 'dashboard'))); /** * Plugins need to be loaded manually, you can either load them one by one or all of them in a single call * Uncomment one of the lines below, as you need. make sure you read the documentation on CakePlugin to use more * advanced ways of loading plugins * * CakePlugin::loadAll(); // Loads all plugins at once * CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit * */ //CakePlugin::load('DebugKit'); CakePlugin::load('Wizard'); /** * You can attach event listeners to the request lifecycle as Dispatcher Filter . By Default CakePHP bundles two filters: * * - AssetDispatcher filter will serve your asset files (css, images, js, etc) from your themes and plugins
<?php /** * Arquivo para adaptação da aplicação para Português-Brasil * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource * @author Juan Basso <*****@*****.**> * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ // Definindo idioma da aplicação Configure::write('Config.language', 'pt-br'); // Adicionando o caminho do locale App::build(array('locales' => dirname(dirname(__FILE__)) . DS . 'locale' . DS)); // Alteração do inflector $_uninflected = array('atlas', 'lapis', 'onibus', 'pires', 'virus', '.*x'); $_pluralIrregular = array('abdomens' => 'abdomen', 'alemao' => 'alemaes', 'artesa' => 'artesaos', 'as' => 'ases', 'bencao' => 'bencaos', 'cao' => 'caes', 'capelao' => 'capelaes', 'capitao' => 'capitaes', 'chao' => 'chaos', 'charlatao' => 'charlataes', 'cidadao' => 'cidadaos', 'consul' => 'consules', 'cristao' => 'cristaos', 'dificil' => 'dificeis', 'escrivao' => 'escrivaes', 'fossel' => 'fosseis', 'germens' => 'germen', 'grao' => 'graos', 'hifens' => 'hifen', 'irmao' => 'irmaos', 'liquens' => 'liquen', 'mal' => 'males', 'mao' => 'maos', 'orfao' => 'orfaos', 'pais' => 'paises', 'pao' => 'paes', 'perfil' => 'perfis', 'projetil' => 'projeteis', 'reptil' => 'repteis', 'sacristao' => 'sacristaes', 'sotao' => 'sotaos', 'tabeliao' => 'tabeliaes'); Inflector::rules('singular', array('rules' => array('/^(.*)(oes|aes|aos)$/i' => '\\1ao', '/^(.*)(a|e|o|u)is$/i' => '\\1\\2l', '/^(.*)e?is$/i' => '\\1il', '/^(.*)(r|s|z)es$/i' => '\\1\\2', '/^(.*)ns$/i' => '\\1m', '/^(.*)s$/i' => '\\1'), 'uninflected' => $_uninflected, 'irregular' => array_flip($_pluralIrregular))); Inflector::rules('plural', array('rules' => array('/^(.*)ao$/i' => '\\1oes', '/^(.*)(r|s|z)$/i' => '\\1\\2es', '/^(.*)(a|e|o|u)l$/i' => '\\1\\2is', '/^(.*)il$/i' => '\\1is', '/^(.*)(m|n)$/i' => '\\1ns', '/^(.*)$/i' => '\\1s'), 'uninflected' => $_uninflected, 'irregular' => $_pluralIrregular)); unset($_uninflected, $_pluralIrregular);
* * CakePlugin::loadAll(); // Loads all plugins at once * CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit * */ /** * You can attach event listeners to the request lifecycle as Dispatcher Filter. By default CakePHP bundles two filters: * * - AssetDispatcher filter will serve your asset files (css, images, js, etc) from your themes and plugins * - CacheDispatcher filter will read the Cache.check configure variable and try to serve cached content generated from controllers * * Feel free to remove or add filters as you see fit for your application. A few examples: * * Configure::write('Dispatcher.filters', array( * 'MyCacheFilter', // will use MyCacheFilter class from the Routing/Filter package in your app. * 'MyCacheFilter' => array('prefix' => 'my_cache_'), // will use MyCacheFilter class from the Routing/Filter package in your app with settings array. * 'MyPlugin.MyFilter', // will use MyFilter class from the Routing/Filter package in MyPlugin plugin. * array('callable' => $aFunction, 'on' => 'before', 'priority' => 9), // A valid PHP callback type to be called on beforeDispatch * array('callable' => $anotherMethod, 'on' => 'after'), // A valid PHP callback type to be called on afterDispatch * * )); */ Configure::write('Dispatcher.filters', array('AssetDispatcher', 'CacheDispatcher')); /** * Configures default file logging options */ App::uses('CakeLog', 'Log'); CakeLog::config('debug', array('engine' => 'File', 'types' => array('notice', 'info', 'debug'), 'file' => 'debug')); CakeLog::config('error', array('engine' => 'File', 'types' => array('warning', 'error', 'critical', 'alert', 'emergency'), 'file' => 'error')); Inflector::rules('plural', array('irregular' => array('tipo_maquinaria' => 'tipos_maquinarias', 'camion' => 'camiones', 'tabulador' => 'tabuladores', 'maquinarias_trabajo' => 'maquinarias_trabajos', 'camiones_tabulador' => 'camiones_tabuladores')));
* 'Controller/Component/Auth' => array('/path/to/auths/', '/next/path/to/auths/'), * 'Controller/Component/Acl' => array('/path/to/acls/', '/next/path/to/acls/'), * 'View' => array('/path/to/views/', '/next/path/to/views/'), * 'View/Helper' => array('/path/to/helpers/', '/next/path/to/helpers/'), * 'Console' => array('/path/to/consoles/', '/next/path/to/consoles/'), * 'Console/Command' => array('/path/to/commands/', '/next/path/to/commands/'), * 'Console/Command/Task' => array('/path/to/tasks/', '/next/path/to/tasks/'), * 'Lib' => array('/path/to/libs/', '/next/path/to/libs/'), * 'Locale' => array('/path/to/locales/', '/next/path/to/locales/'), * 'Vendor' => array('/path/to/vendors/', '/next/path/to/vendors/'), * 'Plugin' => array('/path/to/plugins/', '/next/path/to/plugins/'), * )); * */ Inflector::rules('singular', array('irregular' => array('webpage_jses' => 'webpage_js', 'webpagejs' => 'WebpageJs', 'canvas' => 'canvas'))); Inflector::rules('plural', array('irregular' => array('webpage_js' => 'webpage_jses'))); /** * reads settings.ini (or defaults.ini if non-existent) * and sets configurable constants that are set in the settings db table */ function __setConstants($path = null, $return = false) { $path = !empty($path) ? $path : CONFIGS; if (file_exists($path . 'defaults.ini')) { if (file_exists($path . 'settings.ini')) { $path .= 'settings.ini'; } else { $path .= 'defaults.ini'; } $settings = parse_ini_file($path, true); if ($return == true) {
* 'Lib' => array('/path/to/libs/', '/next/path/to/libs/'), * 'Locale' => array('/path/to/locales/', '/next/path/to/locales/'), * 'Vendor' => array('/path/to/vendors/', '/next/path/to/vendors/'), * 'Plugin' => array('/path/to/plugins/', '/next/path/to/plugins/'), * )); * */ /** * Custom Inflector rules can be set to correctly pluralize or singularize table, model, controller names or whatever other * string is passed to the inflection functions * * Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * */ Inflector::rules('plural', ['irregular' => ['identifier' => 'identifiers', 'dataseries' => 'dataseries', 'methodology' => 'methodology', 'jcamp' => 'jcamp', 'metadata' => 'metadata', 'search' => 'search', 'jmol' => 'jmol']]); /** * Plugins need to be loaded manually, you can either load them one by one or all of them in a single call * Uncomment one of the lines below, as you need. Make sure you read the documentation on CakePlugin to use more * advanced ways of loading plugins * * CakePlugin::loadAll(); // Loads all plugins at once * CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit * */ CakePlugin::load('Pubchem'); CakePlugin::load('Animl'); CakePlugin::load('Jcamp'); /** * To prefer app translation over plugin translation, you can set *
* 'Vendor' => array('/path/to/vendors/', '/next/path/to/vendors/'), * 'Plugin' => array('/path/to/plugins/', '/next/path/to/plugins/'), * )); * */ /** * Custom Inflector rules can be set to correctly pluralize or singularize table, model, controller names or whatever other * string is passed to the inflection functions * * Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * */ //Inflectores españoles Inflector::rules('singular', array('rules' => array('/(.*)res$/i' => '\\1r', '/(.*)nes$/i' => '\\1n', '/(.*)des$/i' => '\\1d', '/(.*)ses$/i' => '\\1s'), 'irregular' => array('commissions' => 'commission', 'cosplayers' => 'cosplayer', 'gottalenters' => 'gottalenter', 'gottalents' => 'gottalent'), 'uninflected' => array())); Inflector::rules('plural', array('rules' => array('/(.*)r$/i' => '\\1res', '/(.*)n$/i' => '\\1nes', '/(.*)d$/i' => '\\1des', '/(.*)s$/i' => '\\1ses'), 'irregular' => array('commission' => 'commissions', 'cosplayer' => 'cosplayers', 'gottalenter' => 'gottalenters', 'gottalent' => 'gottalents'), 'uninflected' => array('commissions'))); /** * Plugins need to be loaded manually, you can either load them one by one or all of them in a single call * Uncomment one of the lines below, as you need. Make sure you read the documentation on CakePlugin to use more * advanced ways of loading plugins * * CakePlugin::loadAll(); // Loads all plugins at once * CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit * */ /** * You can attach event listeners to the request lifecycle as Dispatcher Filter. By default CakePHP bundles two filters: * * - AssetDispatcher filter will serve your asset files (css, images, js, etc) from your themes and plugins * - CacheDispatcher filter will read the Cache.check configure variable and try to serve cached content generated from controllers *
/** * Tests that you can easily pass more (like Arabic) transliterations to Inflector and * thus enhance the slugging. * * @return void */ public function testCustomCharsAdditional() { $rules = []; foreach (static::$customMaps as $language => $map) { foreach ($map as $from => $to) { $rules['/' . $from . '/'] = $to; } } Inflector::rules('transliteration', $rules); $this->Model->Behaviors->unload('Slugged'); $this->Model->Behaviors->load('Tools.Slugged', ['mode' => 'ascii']); foreach (static::$customMaps as $language => $map) { foreach ($map as $from => $to) { $result = $this->Model->slug($from, false); $this->assertEquals($to, $result, $from . ' (' . $language . ') should become ' . $to . ' - but became ' . $result); } } }
*/ /** * The settings below can be used to set additional paths to models, views and controllers. * This is related to Ticket #470 (https://trac.cakephp.org/ticket/470) * * App::build(array( * 'plugins' => array('/full/path/to/plugins/', '/next/full/path/to/plugins/'), * 'models' => array('/full/path/to/models/', '/next/full/path/to/models/'), * 'views' => array('/full/path/to/views/', '/next/full/path/to/views/'), * 'controllers' => array('/full/path/to/controllers/', '/next/full/path/to/controllers/'), * 'datasources' => array('/full/path/to/datasources/', '/next/full/path/to/datasources/'), * 'behaviors' => array('/full/path/to/behaviors/', '/next/full/path/to/behaviors/'), * 'components' => array('/full/path/to/components/', '/next/full/path/to/components/'), * 'helpers' => array('/full/path/to/helpers/', '/next/full/path/to/helpers/'), * 'vendors' => array('/full/path/to/vendors/', '/next/full/path/to/vendors/'), * 'shells' => array('/full/path/to/shells/', '/next/full/path/to/shells/'), * 'locales' => array('/full/path/to/locale/', '/next/full/path/to/locale/') * )); * */ /** * As of 1.3, additional rules for the inflector are added below * * Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * */ Inflector::rules("singular", array("rules" => array('/^(sina)is_(vita)is$/i' => '\\1l_\\2l', '/^(sina)is(vita)is$/i' => '\\1l\\2l', '/^(internacao_internac)oes$/i' => '\\1ao', '/^(internacaointernac)oes$/i' => '\\1ao', '/^(acesso_permiss)oes$/i' => '\\1ao', '/^(acessopermiss)oes$/i' => '\\1ao', '/(laudo_padr)oes$/i' => '\\1ao', '/(laudopadr)oes$/i' => '\\1ao', '/^(hospitalar_profissiona)is$/' => '\\1l', '/^(hospitalarprofissiona)is$/' => '\\1l'))); Inflector::rules("plural", array("rules" => array('/(sina)l_(vita)l$/i' => '\\1is_\\2is', '/(sina)l(vita)l$/i' => '\\1is\\2is', '/(internacao_internac)ao$/i' => '\\1oes', '/(internacaointernac)ao$/i' => '\\1oes', '/(acesso_permiss)ao$/i' => '\\1oes', '/(acessopermiss)ao$/i' => '\\1oes', '/(laudo_padr)ao$/i' => '\\1oes', '/(laudopadr)ao$/i' => '\\1oes', '/(hospitalar_profissiona)l$/i' => '\\1is', '/(hospitalarprofissiona)l$/i' => '\\1is'))); /** Some constants */ define("ADSGithub", "ADSGithub");
* 'Locale' => array('/path/to/locales/', '/next/path/to/locales/'), * 'Vendor' => array('/path/to/vendors/', '/next/path/to/vendors/'), * 'Plugin' => array('/path/to/plugins/', '/next/path/to/plugins/'), * )); * */ /** * Custom Inflector rules can be set to correctly pluralize or singularize table, model, controller names or whatever other * string is passed to the inflection functions * * Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * */ Inflector::rules('singular', array('rules' => array('/^(cuota)$/i' => '\\1', '/^(categoria)$/i' => '\\1', '/^(provincia)$/i' => '\\1'), 'irregular' => array('cobradores' => 'cobrador', 'localidades' => 'localidad'), 'uninflected' => array())); Inflector::rules('plural', array('rules' => array('/^(categoria)$/i' => '\\1s'), 'irregular' => array('cobrador' => 'cobradores', 'localidad' => 'localidades'), 'uninflected' => array())); /** * Plugins need to be loaded manually, you can either load them one by one or all of them in a single call * Uncomment one of the lines below, as you need. Make sure you read the documentation on CakePlugin to use more * advanced ways of loading plugins * * CakePlugin::loadAll(); // Loads all plugins at once * CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit * */ /** * You can attach event listeners to the request lifecycle as Dispatcher Filter. By default CakePHP bundles two filters: * * - AssetDispatcher filter will serve your asset files (css, images, js, etc) from your themes and plugins * - CacheDispatcher filter will read the Cache.check configure variable and try to serve cached content generated from controllers *
* Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * */ Inflector::rules('singular', array('irregular' => array('avisos_etapas' => 'aviso_etapa'))); Inflector::rules('singular', array('irregular' => array('avisosetapas' => 'avisoEtapa'))); Inflector::rules('plural', array('irregular' => array('avisoetapa' => 'avisosEtapas'))); Inflector::rules('plural', array('irregular' => array('aviso_etapa' => 'avisos_etapas'))); Inflector::rules('singular', array('irregular' => array('arquivos_atividades' => 'arquivo_atividade'))); Inflector::rules('singular', array('irregular' => array('arquivosatividades' => 'arquivoEtapa'))); Inflector::rules('plural', array('irregular' => array('arquivoatividade' => 'arquivosEtapas'))); Inflector::rules('plural', array('irregular' => array('arquivo_atividade' => 'arquivos_atividades'))); Inflector::rules('singular', array('irregular' => array('arquivos_demandas' => 'arquivo_demanda'))); Inflector::rules('singular', array('irregular' => array('arquivosdemandas' => 'arquivoEtapa'))); Inflector::rules('plural', array('irregular' => array('arquivodemanda' => 'arquivosEtapas'))); Inflector::rules('plural', array('irregular' => array('arquivo_demanda' => 'arquivos_demandas'))); /* // include the Session Component to our application App::uses('SessionComponent', 'Controller/Component'); // now create new SessionComponent instance $Session = new SessionComponent(new ComponentCollection()); // check if the user logged in if ($Session->read('UserAuth.User')) { Configure::write('Route.default', array('controller' => 'pages', 'action' => 'display','home')); } // nope, user not logged in else { Configure::write('Route.default', array('controller' => 'usuarios', 'action' => 'login')); }
* 'Locale' => array('/path/to/locales/', '/next/path/to/locales/'), * 'Vendor' => array('/path/to/vendors/', '/next/path/to/vendors/'), * 'Plugin' => array('/path/to/plugins/', '/next/path/to/plugins/'), * )); * */ /** * Custom Inflector rules can be set to correctly pluralize or singularize table, model, controller names or whatever other * string is passed to the inflection functions * * Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * */ Inflector::rules('singular', array('rules' => array('/^([a-zA-Z_-]*)res$/i' => '\\1r'), 'irregular' => array('banners' => 'banner'), 'uninflected' => array())); Inflector::rules('plural', array('rules' => array('/^([a-zA-Z_-]*)r$/i' => '\\1res'), 'irregular' => array('banner' => 'banners'), 'uninflected' => array())); /** * Plugins need to be loaded manually, you can either load them one by one or all of them in a single call * Uncomment one of the lines below, as you need. Make sure you read the documentation on CakePlugin to use more * advanced ways of loading plugins * * CakePlugin::loadAll(); // Loads all plugins at once * CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit * */ /** * To prefer app translation over plugin translation, you can set * * Configure::write('I18n.preferApp', true); */ /**
<?php /** * Arquivo para adaptação da aplicação para Português-Brasil * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource * @author Juan Basso <*****@*****.**> * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ // Definindo idioma da aplicação Configure::write('Config.language', 'pt-br'); // Adicionando o caminho do locale App::build(array('locales' => dirname(dirname(__FILE__)) . DS . 'locale' . DS)); // Alteração do inflector $_uninflected = array('atlas', 'lapis', 'onibus', 'pires', 'virus', '.*x'); $_pluralIrregular = array('abdomens' => 'abdomen', 'alemao' => 'alemaes', 'artesa' => 'artesaos', 'as' => 'ases', 'bencao' => 'bencaos', 'cao' => 'caes', 'capelao' => 'capelaes', 'capitao' => 'capitaes', 'chao' => 'chaos', 'charlatao' => 'charlataes', 'cidadao' => 'cidadaos', 'consul' => 'consules', 'cristao' => 'cristaos', 'dificil' => 'dificeis', 'email' => 'emails', 'escrivao' => 'escrivaes', 'fossel' => 'fosseis', 'germens' => 'germen', 'grao' => 'graos', 'hifens' => 'hifen', 'irmao' => 'irmaos', 'liquens' => 'liquen', 'mal' => 'males', 'mao' => 'maos', 'orfao' => 'orfaos', 'pais' => 'paises', 'pai' => 'pais', 'pao' => 'paes', 'perfil' => 'perfis', 'projetil' => 'projeteis', 'reptil' => 'repteis', 'sacristao' => 'sacristaes', 'sotao' => 'sotaos', 'tabeliao' => 'tabeliaes', 'user' => 'users'); Inflector::rules('singular', array('rules' => array('/^(.*)(oes|aes|aos)$/i' => '\\1ao', '/^(.*)(a|e|o|u)is$/i' => '\\1\\2l', '/^(.*)e?is$/i' => '\\1il', '/^(.*)(r|s|z)es$/i' => '\\1\\2', '/^(.*)ns$/i' => '\\1m', '/^(.*)s$/i' => '\\1'), 'uninflected' => $_uninflected, 'irregular' => array_flip($_pluralIrregular)), true); Inflector::rules('plural', array('rules' => array('/^(.*)ao$/i' => '\\1oes', '/^(.*)(r|s|z)$/i' => '\\1\\2es', '/^(.*)(a|e|o|u)l$/i' => '\\1\\2is', '/^(.*)il$/i' => '\\1is', '/^(.*)(m|n)$/i' => '\\1ns', '/^(.*)$/i' => '\\1s'), 'uninflected' => $_uninflected, 'irregular' => $_pluralIrregular), true); Inflector::rules('transliteration', array('/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ/' => 'A', '/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě/' => 'E', '/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ/' => 'I', '/Ò|Ó|Ô|Õ|Ö|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ/' => 'O', '/Ù|Ú|Û|Ü|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ/' => 'U', '/Ç|Ć|Ĉ|Ċ|Č/' => 'C', '/Ð|Ď|Đ/' => 'D', '/Ĝ|Ğ|Ġ|Ģ/' => 'G', '/Ĥ|Ħ/' => 'H', '/Ĵ/' => 'J', '/Ķ/' => 'K', '/Ĺ|Ļ|Ľ|Ŀ|Ł/' => 'L', '/Ñ|Ń|Ņ|Ň/' => 'N', '/Ŕ|Ŗ|Ř/' => 'R', '/Ś|Ŝ|Ş|Š/' => 'S', '/Ţ|Ť|Ŧ/' => 'T', '/Ý|Ÿ|Ŷ/' => 'Y', '/Ź|Ż|Ž/' => 'Z', '/Ŵ/' => 'W', '/Æ|Ǽ/' => 'AE', '/ß/' => 'ss', '/IJ/' => 'IJ', '/Œ/' => 'OE', '/à|á|â|ã|ä|å|ǻ|ā|ă|ą|ǎ|ª/' => 'a', '/è|é|ê|ë|ē|ĕ|ė|ę|ě|&/' => 'e', '/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı/' => 'i', '/ò|ó|ô|õ|ö|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º/' => 'o', '/ù|ú|û|ü|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ/' => 'u', '/ç|ć|ĉ|ċ|č/' => 'c', '/ð|ď|đ/' => 'd', '/ĝ|ğ|ġ|ģ/' => 'g', '/ĥ|ħ/' => 'h', '/ĵ/' => 'j', '/ķ/' => 'k', '/ĺ|ļ|ľ|ŀ|ł/' => 'l', '/ñ|ń|ņ|ň|ʼn/' => 'n', '/ŕ|ŗ|ř/' => 'r', '/ś|ŝ|ş|š|ſ/' => 's', '/ţ|ť|ŧ/' => 't', '/ý|ÿ|ŷ/' => 'y', '/ŵ/' => 'w', '/ź|ż|ž/' => 'z', '/æ|ǽ/' => 'ae', '/ij/' => 'ij', '/œ/' => 'oe', '/ƒ/' => 'f')); unset($_uninflected, $_pluralIrregular);
* To prefer app translation over plugin translation, you can set * * Configure::write('I18n.preferApp', true); */ CakePlugin::load('DebugKit'); /** * You can attach event listeners to the request lifecycle as Dispatcher Filter. By default CakePHP bundles two filters: * * - AssetDispatcher filter will serve your asset files (css, images, js, etc) from your themes and plugins * - CacheDispatcher filter will read the Cache.check configure variable and try to serve cached content generated from controllers * * Feel free to remove or add filters as you see fit for your application. A few examples: * * Configure::write('Dispatcher.filters', array( * 'MyCacheFilter', // will use MyCacheFilter class from the Routing/Filter package in your app. * 'MyCacheFilter' => array('prefix' => 'my_cache_'), // will use MyCacheFilter class from the Routing/Filter package in your app with settings array. * 'MyPlugin.MyFilter', // will use MyFilter class from the Routing/Filter package in MyPlugin plugin. * array('callable' => $aFunction, 'on' => 'before', 'priority' => 9), // A valid PHP callback type to be called on beforeDispatch * array('callable' => $anotherMethod, 'on' => 'after'), // A valid PHP callback type to be called on afterDispatch * * )); */ Configure::write('Dispatcher.filters', array('AssetDispatcher', 'CacheDispatcher')); /** * Configures default file logging options */ App::uses('CakeLog', 'Log'); CakeLog::config('debug', array('engine' => 'File', 'types' => array('notice', 'info', 'debug'), 'file' => 'debug')); CakeLog::config('error', array('engine' => 'File', 'types' => array('warning', 'error', 'critical', 'alert', 'emergency'), 'file' => 'error')); Inflector::rules('transliteration', array('/а/' => 'a', '/б/' => 'b', '/в/' => 'v', '/г/' => 'g', '/д/' => 'd', '/е/' => 'e', '/ё/' => 'yo', '/ж/' => 'zh', '/з/' => 'z', '/и/' => 'i', '/й/' => 'yi', '/к/' => 'k', '/л/' => 'l', '/м/' => 'm', '/н/' => 'n', '/о/' => 'o', '/п/' => 'p', '/р/' => 'r', '/с/' => 's', '/т/' => 't', '/у/' => 'u', '/ф/' => 'f', '/х/' => 'kh', '/ц/' => 'ts', '/ч/' => 'ch', '/ш/' => 'sh', '/щ/' => 'sch', '/ь/' => '', '/ы/' => 'y', '/ъ/' => '', '/э/' => 'e', '/ю/' => 'yu', '/я/' => 'ya', '/А/' => 'A', '/Б/' => 'B', '/В/' => 'V', '/Г/' => 'G', '/Д/' => 'D', '/Е/' => 'E', '/Ё/' => 'Yo', '/Ж/' => 'Zh', '/З/' => 'Z', '/И/' => 'I', '/Й/' => 'Yi', '/К/' => 'K', '/Л/' => 'L', '/М/' => 'M', '/Н/' => 'N', '/О/' => 'O', '/П/' => 'P', '/Р/' => 'R', '/С/' => 'S', '/Т/' => 'T', '/У/' => 'U', '/Ф/' => 'F', '/Х/' => 'Kh', '/Ц/' => 'Ts', '/Ч/' => 'Ch', '/Ш/' => 'Sh', '/Щ/' => 'Sch', '/Ь/' => '', '/Ы/' => 'Y', '/Ъ/' => '', '/Э/' => 'E', '/Ю/' => 'Yu', '/Я/' => 'Ya', '/ /' => '_'));
/** * Test resetting inflection rules. * * @return void */ function testCustomRuleWithReset() { $uninflected = array('atlas', 'lapis', 'onibus', 'pires', 'virus', '.*x'); $pluralIrregular = array('as' => 'ases'); Inflector::rules('singular', array('rules' => array('/^(.*)(a|e|o|u)is$/i' => '\\1\\2l'), 'uninflected' => $uninflected), true); Inflector::rules('plural', array('rules' => array('/^(.*)(a|e|o|u)l$/i' => '\\1\\2is'), 'uninflected' => $uninflected, 'irregular' => $pluralIrregular), true); $this->assertEqual(Inflector::pluralize('Alcool'), 'Alcoois'); $this->assertEqual(Inflector::pluralize('Atlas'), 'Atlas'); $this->assertEqual(Inflector::singularize('Alcoois'), 'Alcool'); $this->assertEqual(Inflector::singularize('Atlas'), 'Atlas'); }
* 'Console/Command/Task' => array('/path/to/tasks/', '/next/path/to/tasks/'), * 'Lib' => array('/path/to/libs/', '/next/path/to/libs/'), * 'Locale' => array('/path/to/locales/', '/next/path/to/locales/'), * 'Vendor' => array('/path/to/vendors/', '/next/path/to/vendors/'), * 'Plugin' => array('/path/to/plugins/', '/next/path/to/plugins/'), * )); * */ /** * Custom Inflector rules can be set to correctly pluralize or singularize table, model, controller names or whatever other * string is passed to the inflection functions * * Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); */ Inflector::rules('plural', array('irregular' => array('proveedor' => 'proveedores'))); /** * Plugins need to be loaded manually, you can either load them one by one or all of them in a single call * Uncomment one of the lines below, as you need. Make sure you read the documentation on CakePlugin to use more * advanced ways of loading plugins * * CakePlugin::loadAll(); // Loads all plugins at once * CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit * */ /** * You can attach event listeners to the request lifecycle as Dispatcher Filter. By default CakePHP bundles two filters: * * - AssetDispatcher filter will serve your asset files (css, images, js, etc) from your themes and plugins * - CacheDispatcher filter will read the Cache.check configure variable and try to serve cached content generated from controllers *