本文整理汇总了PHP中F0FInflector::addWord方法的典型用法代码示例。如果您正苦于以下问题:PHP F0FInflector::addWord方法的具体用法?PHP F0FInflector::addWord怎么用?PHP F0FInflector::addWord使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类F0FInflector
的用法示例。
在下文中一共展示了F0FInflector::addWord方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dispatch
public function dispatch()
{
if (!class_exists('AkeebaControllerDefault')) {
require_once JPATH_ADMINISTRATOR . '/components/com_akeeba/controllers/default.php';
}
// Merge the language overrides
$paths = array(JPATH_ROOT, JPATH_ADMINISTRATOR);
$jlang = JFactory::getLanguage();
$jlang->load($this->component, $paths[0], 'en-GB', true);
$jlang->load($this->component, $paths[0], null, true);
$jlang->load($this->component, $paths[1], 'en-GB', true);
$jlang->load($this->component, $paths[1], null, true);
$jlang->load($this->component . '.override', $paths[0], 'en-GB', true);
$jlang->load($this->component . '.override', $paths[0], null, true);
$jlang->load($this->component . '.override', $paths[1], 'en-GB', true);
$jlang->load($this->component . '.override', $paths[1], null, true);
F0FInflector::addWord('alice', 'alices');
// Timezone fix; avoids errors printed out by PHP 5.3.3+ (thanks Yannick!)
if (function_exists('date_default_timezone_get') && function_exists('date_default_timezone_set')) {
if (function_exists('error_reporting')) {
$oldLevel = error_reporting(0);
}
$serverTimezone = @date_default_timezone_get();
if (empty($serverTimezone) || !is_string($serverTimezone)) {
$serverTimezone = 'UTC';
}
if (function_exists('error_reporting')) {
error_reporting($oldLevel);
}
@date_default_timezone_set($serverTimezone);
}
// Necessary defines for Akeeba Engine
if (!defined('AKEEBAENGINE')) {
define('AKEEBAENGINE', 1);
// Required for accessing Akeeba Engine's factory class
define('AKEEBAROOT', dirname(__FILE__) . '/akeeba');
define('ALICEROOT', dirname(__FILE__) . '/alice');
}
// Setup Akeeba's ACLs, honoring laxed permissions in component's parameters, if set
// Access check, Joomla! 1.6 style.
$user = JFactory::getUser();
if (!$user->authorise('core.manage', 'com_akeeba')) {
return JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR'));
}
// Make sure we have a profile set throughout the component's lifetime
$session = JFactory::getSession();
$profile_id = $session->get('profile', null, 'akeeba');
if (is_null($profile_id)) {
// No profile is set in the session; use default profile
$session->set('profile', 1, 'akeeba');
}
// Load the factory
require_once JPATH_COMPONENT_ADMINISTRATOR . '/akeeba/factory.php';
@(include_once JPATH_COMPONENT_ADMINISTRATOR . '/alice/factory.php');
// Load the Akeeba Backup configuration and check user access permission
$aeconfig = AEFactory::getConfiguration();
AEPlatform::getInstance()->load_configuration();
$jDbo = JFactory::getDbo();
if ($jDbo->name == 'pdomysql') {
// Prevents the "SQLSTATE[HY000]: General error: 2014" due to resource sharing with Akeeba Engine
@JFactory::getDbo()->disconnect();
}
unset($aeconfig);
// Preload helpers
require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/includes.php';
require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/escape.php';
// Load the utils helper library
AEPlatform::getInstance()->load_version_defines();
// Create a versioning tag for our static files
$staticFilesVersioningTag = md5(AKEEBA_VERSION . AKEEBA_DATE);
define('AKEEBAMEDIATAG', $staticFilesVersioningTag);
// If JSON functions don't exist, load our compatibility layer
if (!function_exists('json_encode') || !function_exists('json_decode')) {
require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/jsonlib.php';
}
// Look for controllers in the plugins folder
$option = $this->input->get('option', 'com_foobar', 'cmd');
$view = $this->input->get('view', $this->defaultView, 'cmd');
$c = F0FInflector::singularize($view);
$alt_path = JPATH_ADMINISTRATOR . '/components/' . $option . '/plugins/controllers/' . $c . '.php';
JLoader::import('joomla.filesystem.file');
if (JFile::exists($alt_path)) {
// The requested controller exists and there you load it...
require_once $alt_path;
}
$this->input->set('view', $this->view);
parent::dispatch();
}
示例2: dispatch
public function dispatch()
{
if (!class_exists('AkeebaControllerDefault')) {
require_once JPATH_ADMINISTRATOR . '/components/com_akeeba/controllers/default.php';
}
// Merge the language overrides
$paths = array(JPATH_ROOT, JPATH_ADMINISTRATOR);
$jlang = JFactory::getLanguage();
$jlang->load($this->component, $paths[0], 'en-GB', true);
$jlang->load($this->component, $paths[0], null, true);
$jlang->load($this->component, $paths[1], 'en-GB', true);
$jlang->load($this->component, $paths[1], null, true);
$jlang->load($this->component . '.override', $paths[0], 'en-GB', true);
$jlang->load($this->component . '.override', $paths[0], null, true);
$jlang->load($this->component . '.override', $paths[1], 'en-GB', true);
$jlang->load($this->component . '.override', $paths[1], null, true);
F0FInflector::addWord('alice', 'alices');
// Timezone fix; avoids errors printed out by PHP 5.3.3+ (thanks Yannick!)
if (function_exists('date_default_timezone_get') && function_exists('date_default_timezone_set')) {
if (function_exists('error_reporting')) {
$oldLevel = error_reporting(0);
}
$serverTimezone = @date_default_timezone_get();
if (empty($serverTimezone) || !is_string($serverTimezone)) {
$serverTimezone = 'UTC';
}
if (function_exists('error_reporting')) {
error_reporting($oldLevel);
}
@date_default_timezone_set($serverTimezone);
}
// Necessary defines for Akeeba Engine
if (!defined('AKEEBAENGINE')) {
define('AKEEBAENGINE', 1);
// Required for accessing Akeeba Engine's factory class
define('AKEEBAROOT', dirname(__FILE__) . '/akeeba');
define('ALICEROOT', dirname(__FILE__) . '/alice');
}
// Setup Akeeba's ACLs, honoring laxed permissions in component's parameters, if set
// Access check, Joomla! 1.6 style.
$user = JFactory::getUser();
if (!$user->authorise('core.manage', 'com_akeeba')) {
return JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR'));
}
// Make sure we have a profile set throughout the component's lifetime
$session = JFactory::getSession();
$profile_id = $session->get('profile', null, 'akeeba');
if (is_null($profile_id)) {
// No profile is set in the session; use default profile
$session->set('profile', 1, 'akeeba');
}
// Load Akeeba Engine and ALICE
require_once JPATH_COMPONENT_ADMINISTRATOR . '/engine/Factory.php';
if (@file_exists(JPATH_COMPONENT_ADMINISTRATOR . '/alice/factory.php')) {
require_once JPATH_COMPONENT_ADMINISTRATOR . '/alice/factory.php';
}
// Load the Akeeba Engine configuration
Platform::addPlatform('joomla25', JPATH_COMPONENT_ADMINISTRATOR . '/platform/joomla25');
$akeebaEngineConfig = Factory::getConfiguration();
Platform::getInstance()->load_configuration();
$jDbo = JFactory::getDbo();
if ($jDbo->name == 'pdomysql') {
// Prevents the "SQLSTATE[HY000]: General error: 2014" due to resource sharing with Akeeba Engine
@JFactory::getDbo()->disconnect();
}
unset($akeebaEngineConfig);
// Preload helpers
require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/escape.php';
// Load the utils helper library
Platform::getInstance()->load_version_defines();
// Create a versioning tag for our static files
$staticFilesVersioningTag = md5(AKEEBA_VERSION . AKEEBA_DATE);
define('AKEEBAMEDIATAG', $staticFilesVersioningTag);
$this->input->set('view', $this->view);
// Load JHtml behaviours as needed
$this->loadJHtmlBehaviors();
parent::dispatch();
}