• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP JError类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中JError的典型用法代码示例。如果您正苦于以下问题:PHP JError类的具体用法?PHP JError怎么用?PHP JError使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了JError类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: featured

 /**
  * Method to toggle the featured setting of a list of articles.
  *
  * @return	void
  * @since	1.6
  */
 function featured()
 {
     // Check for request forgeries
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     // Initialise variables.
     $user = JFactory::getUser();
     $ids = JRequest::getVar('cid', array(), '', 'array');
     $values = array('featured' => 1, 'unfeatured' => 0);
     $task = $this->getTask();
     $value = JArrayHelper::getValue($values, $task, 0, 'int');
     // Access checks.
     foreach ($ids as $i => $id) {
         if (!$user->authorise('core.edit.state', 'com_content.article.' . (int) $id)) {
             // Prune items that you can't change.
             unset($ids[$i]);
             JError::raiseNotice(403, JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'));
         }
     }
     if (empty($ids)) {
         JError::raiseWarning(500, JText::_('JERROR_NO_ITEMS_SELECTED'));
     } else {
         // Get the model.
         $model = $this->getModel();
         // Publish the items.
         if (!$model->featured($ids, $value)) {
             JError::raiseWarning(500, $model->getError());
         }
     }
     $this->setRedirect('index.php?option=com_content&view=articles');
 }
开发者ID:joomline,项目名称:Joomla2.5.999,代码行数:36,代码来源:articles.php


示例2: display

 /**
  * Method to display a view.
  *
  * @param	boolean			If true, the view output will be cached
  * @param	array			An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  *
  * @return	JController		This object to support chaining.
  * @since	1.5
  */
 public function display($cachable = false, $urlparams = false)
 {
     require_once JPATH_COMPONENT . '/helpers/users.php';
     // Load the submenu.
     UsersHelper::addSubmenu(JRequest::getCmd('view', 'users'));
     $view = JRequest::getCmd('view', 'users');
     $layout = JRequest::getCmd('layout', 'default');
     $id = JRequest::getInt('id');
     if (!$this->canView($view)) {
         JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
         return;
     }
     // Check for edit form.
     if ($view == 'user' && $layout == 'edit' && !$this->checkEditId('com_users.edit.user', $id)) {
         // Somehow the person just went to the form - we don't allow that.
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_users&view=users', false));
         return false;
     } elseif ($view == 'group' && $layout == 'edit' && !$this->checkEditId('com_users.edit.group', $id)) {
         // Somehow the person just went to the form - we don't allow that.
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_users&view=groups', false));
         return false;
     } elseif ($view == 'level' && $layout == 'edit' && !$this->checkEditId('com_users.edit.level', $id)) {
         // Somehow the person just went to the form - we don't allow that.
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_users&view=levels', false));
         return false;
     }
     return parent::display();
 }
开发者ID:Simarpreet05,项目名称:joomla,代码行数:43,代码来源:controller.php


示例3: display

 /**
  * Generates a list of JSON items.
  *
  * @return    void
  */
 public function display($tpl = null)
 {
     $model = $this->getModel();
     $this->item = $this->get('Item');
     $this->component = $model->getState($model->getName() . '.component');
     $this->section = $model->getState($model->getName() . '.section');
     $this->asset_id = $model->getState($model->getName() . '.asset_id');
     $this->project_id = $model->getState($model->getName() . '.project_id');
     $this->inherit = $model->getState($model->getName() . '.inherit');
     if (!$this->asset_id && $this->inherit) {
         $this->asset_id = $this->getComponentProjectAssetId($this->component, $this->project_id);
     }
     $this->rules = $this->getAssetRules();
     $this->public_groups = array('1', JComponentHelper::getParams('com_users')->get('guest_usergroup', 1));
     $user = JFactory::getUser();
     if (!$user->authorise('core.admin', $this->component) && !$user->authorise('core.manage', $this->component)) {
         JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR'));
         return false;
     }
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseWarning(500, implode("\n", $errors));
         return false;
     }
     parent::display($tpl);
 }
开发者ID:gagnonjeanfrancois,项目名称:Projectfork,代码行数:31,代码来源:view.raw.php


示例4: save

 function save()
 {
     $data = JRequest::getVar('jform', array(), 'post', 'NONE', 4);
     $id = (int) $data['id'];
     if (empty($id)) {
         if (!igGeneralHelper::authorise('core.igalleryfront.create')) {
             return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
         }
     } else {
         if (!igGeneralHelper::authorise('core.igalleryfront.edit', $id)) {
             return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
         }
     }
     $model = $this->getModel();
     $msg = '';
     if (!$model->save($data)) {
         JError::raise(2, 500, $model->getError());
     } else {
         $msg = JText::_('SUCCESSFULLY_SAVED');
     }
     switch ($this->task) {
         case 'apply':
             $url = 'index.php?option=com_igallery&view=icategory&id=' . $id;
             break;
         case 'save':
             $url = 'index.php?option=com_igallery&view=categories';
     }
     $this->setRedirect(JRoute::_($url, false), $msg);
 }
开发者ID:iFactoryDigital,项目名称:gympieradiology,代码行数:29,代码来源:icategory.php


示例5: display

 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed   A string if successful, otherwise a Error object.
  */
 public function display($tpl = null)
 {
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->filterForm = $this->get('FilterForm');
     $this->activeFilters = $this->get('ActiveFilters');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     // Preprocess the list of items to find ordering divisions.
     foreach ($this->items as &$item) {
         $this->ordering[$item->parent_id][] = $item->id;
     }
     // Levels filter.
     $options = array();
     $options[] = JHtml::_('select.option', '1', JText::_('J1'));
     $options[] = JHtml::_('select.option', '2', JText::_('J2'));
     $options[] = JHtml::_('select.option', '3', JText::_('J3'));
     $options[] = JHtml::_('select.option', '4', JText::_('J4'));
     $options[] = JHtml::_('select.option', '5', JText::_('J5'));
     $options[] = JHtml::_('select.option', '6', JText::_('J6'));
     $options[] = JHtml::_('select.option', '7', JText::_('J7'));
     $options[] = JHtml::_('select.option', '8', JText::_('J8'));
     $options[] = JHtml::_('select.option', '9', JText::_('J9'));
     $options[] = JHtml::_('select.option', '10', JText::_('J10'));
     $this->f_levels = $options;
     // We don't need toolbar in the modal window.
     if ($this->getLayout() !== 'modal') {
         $this->addToolbar();
     }
     parent::display($tpl);
 }
开发者ID:SysBind,项目名称:joomla-cms,代码行数:42,代码来源:view.html.php


示例6: move

 /**
  * swap the ordering of a record in the Xref tables
  * @param  $direction , 1/-1 The increment to reorder by
  */
 function move($direction, $where = '', $orderingkey = 0)
 {
     if (empty($this->_skey)) {
         vmError('No secondary keys defined in VmTableXarray ' . $this->_tbl);
         return false;
     }
     $skeyId = vRequest::getInt($this->_skey, 0);
     // Initialize variables
     $db = JFactory::getDBO();
     $cid = vRequest::getInt($this->_pkey);
     $order = vRequest::getInt('order');
     //I found now two times "order" instead of ordering.
     //This sql is broken
     $query = 'SELECT `id` FROM `' . $this->_tbl . '` WHERE ' . $this->_pkey . ' = ' . (int) $cid[0] . ' AND `tsmart_category_id` = ' . (int) $skeyId;
     $db->setQuery($query);
     $id = $db->loadResult();
     $keys = array_keys($order);
     // TODO next 2 lines not used ????
     if ($direction > 0) {
         $idToSwap = $order[$keys[array_search($id, $keys)] + 1];
     } else {
         $idToSwap = $order[$keys[array_search($id, $keys)] - 1];
     }
     if (isset($cid[0])) {
         $query = 'UPDATE `' . $this->_tbl . '` ' . ' SET `' . $this->_orderingKey . '` = `' . $this->_orderingKey . '` + ' . $direction . ' WHERE `' . $this->_pkey . '` = ' . (int) $cid[0] . ' AND `' . $this->_skey . '`  = ' . (int) $skeyId;
         $db->setQuery($query);
         if (!$db->execute()) {
             $err = $db->getErrorMsg();
             JError::raiseError(500, get_class($this) . ':: move ' . $err);
         }
     }
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:36,代码来源:tsmtablexarray.php


示例7: akeebaACLCheck

 /**
  * Do our custom ACL checks for the back-end views
  *
  * @return boolean
  */
 private function akeebaACLCheck()
 {
     // Get the view
     $view = $this->input->getCmd('view', '');
     // Fetch the privilege to check, or use the default (akeeba.configure)
     // privilege.
     if (array_key_exists($view, self::$viewACLMap)) {
         $privilege = self::$viewACLMap[$view];
     } else {
         $privilege = 'akeeba.configure';
     }
     // If an empty privileve is defined do not do any ACL check
     if (empty($privilege)) {
         return true;
     }
     // Throw an error if we are not allowed access to the view
     if (!JFactory::getUser()->authorise($privilege, 'com_akeeba')) {
         $this->setRedirect('index.php?option=com_akeeba&view=cpanel');
         JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR'));
         $this->redirect();
         return false;
     } else {
         return true;
     }
 }
开发者ID:jvhost,项目名称:A-Website,代码行数:30,代码来源:default.php


示例8: save

 function save()
 {
     $productfieldgroup = JTable::getInstance('productFieldGroup', 'jshop');
     $post = JRequest::get("post");
     JPluginHelper::importPlugin('jshoppingadmin');
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeSaveProductFieldGroup', array(&$post));
     if (!$productfieldgroup->bind($post)) {
         JError::raiseWarning("", _JSHOP_ERROR_BIND);
         $this->setRedirect("index.php?option=com_jshopping&controller=productfieldgroups");
         return 0;
     }
     if (!$id) {
         $productfieldgroup->ordering = null;
         $productfieldgroup->ordering = $productfieldgroup->getNextOrder();
     }
     if (!$productfieldgroup->store()) {
         JError::raiseWarning("", _JSHOP_ERROR_SAVE_DATABASE);
         $this->setRedirect("index.php?option=com_jshopping&controller=productfieldgroups");
         return 0;
     }
     $dispatcher->trigger('onAfterSaveProductFieldGroup', array(&$productfieldgroup));
     if ($this->getTask() == 'apply') {
         $this->setRedirect("index.php?option=com_jshopping&controller=productfieldgroups&task=edit&id=" . $productfieldgroup->id);
     } else {
         $this->setRedirect("index.php?option=com_jshopping&controller=productfieldgroups");
     }
 }
开发者ID:Tommar,项目名称:vino2,代码行数:28,代码来源:productfieldgroups.php


示例9: render

 public function render($layout, $args = array())
 {
     // prevent render to recurse indefinitely
     static $count = 0;
     $count++;
     if ($count < self::MAX_RENDER_RECURSIONS) {
         // init vars
         $parts = explode($this->_separator, $layout);
         $this->_layout = preg_replace('/[^A-Z0-9_\\.-]/i', '', array_pop($parts));
         // render layout
         if ($__layout = JPath::find($this->_getPath(implode(DIRECTORY_SEPARATOR, $parts)), $this->_layout . $this->_extension)) {
             // import vars and layout output
             extract($args);
             ob_start();
             include $__layout;
             $output = ob_get_contents();
             ob_end_clean();
             $count--;
             return $output;
         }
         $count--;
         // raise warning, if layout was not found
         JError::raiseWarning(0, 'Renderer Layout "' . $layout . '" not found. (' . YUtility::debugInfo(debug_backtrace()) . ')');
         return null;
     }
     // raise warning, if render recurses indefinitly
     JError::raiseWarning(0, 'Warning! Render recursed indefinitly. (' . YUtility::debugInfo(debug_backtrace()) . ')');
     return null;
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:29,代码来源:renderer.php


示例10: display

 /**
  * Display the view
  *
  * @return	mixed	False on error, null otherwise.
  */
 function display($tpl = null)
 {
     // Initialise variables
     $state = $this->get('State');
     $items = $this->get('Items');
     $parent = $this->get('Parent');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseWarning(500, implode("\n", $errors));
         return false;
     }
     if ($items === false) {
         JError::raiseError(404, JText::_('COM_CONTENT_ERROR_CATEGORY_NOT_FOUND'));
         return false;
     }
     if ($parent == false) {
         JError::raiseError(404, JText::_('COM_CONTENT_ERROR_PARENT_CATEGORY_NOT_FOUND'));
         return false;
     }
     $params =& $state->params;
     $items = array($parent->id => $items);
     //Escape strings for HTML output
     $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));
     $this->maxLevelcat = $params->get('maxLevelcat', -1);
     $this->assignRef('params', $params);
     $this->assignRef('parent', $parent);
     $this->assignRef('items', $items);
     $this->_prepareDocument();
     parent::display($tpl);
 }
开发者ID:networksoft,项目名称:networksoft.com.co,代码行数:35,代码来源:view.html.php


示例11: display

 /**
  * Method to display the view.
  *
  * @param   string  The template file to include
  * @since   1.5
  */
 public function display($tpl = null)
 {
     // This name will be used to get the model
     $name = $this->getLayout();
     // Check that the name is valid - has an associated model.
     if (!in_array($name, array('confirm', 'complete'))) {
         $name = 'default';
     }
     if ('default' == $name) {
         $formname = 'Form';
     } else {
         $formname = ucfirst($this->_name) . ucfirst($name) . 'Form';
     }
     // Get the view data.
     $this->form = $this->get($formname);
     $this->state = $this->get('State');
     $this->params = $this->state->params;
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode('<br />', $errors));
         return false;
     }
     //Escape strings for HTML output
     $this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx'));
     $this->prepareDocument();
     parent::display($tpl);
 }
开发者ID:01J,项目名称:topm,代码行数:33,代码来源:view.html.php


示例12: load

 /**
  * Loads the entire menu table into memory.
  *
  * @return  boolean  True on success, false on failure
  *
  * @since   1.5
  */
 public function load()
 {
     $db = JFactory::getDbo();
     $query = $db->getQuery(true)->select('m.id, m.menutype, m.title, m.alias, m.note, m.path AS route, m.link, m.type, m.level, m.language')->select($db->quoteName('m.browserNav') . ', m.access, m.params, m.home, m.img, m.template_style_id, m.component_id, m.parent_id')->select('e.element as component')->from('#__menu AS m')->join('LEFT', '#__extensions AS e ON m.component_id = e.extension_id')->where('m.published = 1')->where('m.parent_id > 0')->where('m.client_id = 0')->order('m.lft');
     // Set the query
     $db->setQuery($query);
     try {
         $this->_items = $db->loadObjectList('id');
     } catch (RuntimeException $e) {
         JError::raiseWarning(500, JText::sprintf('JERROR_LOADING_MENUS', $e->getMessage()));
         return false;
     }
     foreach ($this->_items as &$item) {
         // Get parent information.
         $parent_tree = array();
         if (isset($this->_items[$item->parent_id])) {
             $parent_tree = $this->_items[$item->parent_id]->tree;
         }
         // Create tree.
         $parent_tree[] = $item->id;
         $item->tree = $parent_tree;
         // Create the query array.
         $url = str_replace('index.php?', '', $item->link);
         $url = str_replace('&amp;', '&', $url);
         parse_str($url, $item->query);
     }
     return true;
 }
开发者ID:naumangla,项目名称:joomla-cms,代码行数:35,代码来源:site.php


示例13: store

 /**
  * Method to store a file to the FTP server
  *
  * @param   string  $local   Path to local file to store on the FTP server
  * @param   string  $remote  FTP path to file to create
  *
  * @throws Exception
  *
  * @return  boolean  True if successful
  */
 public function store($local, $remote = null)
 {
     //-- Avoid all this mess by throwing appropriate exceptions !!
     if (false === parent::store($local, $remote)) {
         throw new Exception(JError::getError());
     }
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:17,代码来源:ftp.php


示例14: display

 /**
  * Method to display the view.
  *
  * @param   string  $tpl  A template file to load. [optional]
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  *
  * @since   2.5
  */
 public function display($tpl = null)
 {
     // Load plug-in language files.
     FinderHelperLanguage::loadPluginLanguage();
     $this->items = $this->get('Items');
     $this->total = $this->get('Total');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->pluginState = $this->get('pluginState');
     $this->filterForm = $this->get('FilterForm');
     $this->activeFilters = $this->get('ActiveFilters');
     FinderHelper::addSubmenu('index');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     if (!$this->pluginState['plg_content_finder']->enabled) {
         JFactory::getApplication()->enqueueMessage(JText::_('COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED'), 'warning');
     } elseif ($this->get('TotalIndexed') === 0) {
         JFactory::getApplication()->enqueueMessage(JText::_('COM_FINDER_INDEX_NO_DATA') . '  ' . JText::_('COM_FINDER_INDEX_TIP'), 'notice');
     }
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     // Configure the toolbar.
     $this->addToolbar();
     $this->sidebar = JHtmlSidebar::render();
     parent::display($tpl);
 }
开发者ID:N6REJ,项目名称:joomla-cms,代码行数:37,代码来源:view.html.php


示例15: display

 /**
  * Display the view
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     ContentHelper::addSubmenu('featured');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->authors = $this->get('Authors');
     $this->filterForm = $this->get('FilterForm');
     $this->activeFilters = $this->get('ActiveFilters');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     // Levels filter.
     $options = array();
     $options[] = JHtml::_('select.option', '1', JText::_('J1'));
     $options[] = JHtml::_('select.option', '2', JText::_('J2'));
     $options[] = JHtml::_('select.option', '3', JText::_('J3'));
     $options[] = JHtml::_('select.option', '4', JText::_('J4'));
     $options[] = JHtml::_('select.option', '5', JText::_('J5'));
     $options[] = JHtml::_('select.option', '6', JText::_('J6'));
     $options[] = JHtml::_('select.option', '7', JText::_('J7'));
     $options[] = JHtml::_('select.option', '8', JText::_('J8'));
     $options[] = JHtml::_('select.option', '9', JText::_('J9'));
     $options[] = JHtml::_('select.option', '10', JText::_('J10'));
     $this->f_levels = $options;
     $this->addToolbar();
     $this->sidebar = JHtmlSidebar::render();
     parent::display($tpl);
 }
开发者ID:deenison,项目名称:joomla-cms,代码行数:38,代码来源:view.html.php


示例16: save

	public function save() {
		$app = JFactory::getApplication ();
		if (! JRequest::checkToken ()) {
			$app->enqueueMessage ( JText::_ ( 'COM_KUNENA_ERROR_TOKEN' ), 'error' );
			$this->redirectBack ();
		}

		// perform security checks
		$this->user = JFactory::getUser();
		if ($this->user->id == 0) {
			JError::raiseError( 403, JText::_('Access Forbidden') );
			return;
		}

		$this->config = KunenaFactory::getConfig();

		$this->saveUser();

		$this->me = KunenaFactory::getUser();
		$this->saveProfile();
		$this->saveAvatar();
		$this->saveSettings();
		if (!$this->me->save()) {
			$app = JFactory::getApplication();
			$app->enqueueMessage($this->me->getError(), 'notice');
		}

		$msg = JText::_( 'COM_KUNENA_PROFILE_SAVED' );
		$this->setRedirect ( CKunenaLink::GetMyProfileURL($this->user->get('id'), '', false), $msg );
	}
开发者ID:rich20,项目名称:Kunena,代码行数:30,代码来源:user.php


示例17: featured

 /**
  * Method to toggle the featured setting of a list of teamids.
  *
  * @return	void
  * 
  */
 public function featured()
 {
     // Check for request forgeries
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     $user = JFactory::getUser();
     $ids = $this->input->getVar('cid', array(), 'array');
     $values = array('featured' => 1, 'unfeatured' => 0);
     $task = $this->getTask();
     $value = JArrayHelper::getValue($values, $task, 0, 'int');
     // Get the model.
     $model = $this->getModel();
     // Access checks.
     foreach ($ids as $i => $id) {
         $item = $model->getItem($id);
         if (!$user->authorise('core.edit.state', 'com_knvbapi2.teamid.' . $id)) {
             // Prune items that you can't change.
             unset($ids[$i]);
             JError::raiseNotice(403, JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'));
         }
     }
     if (empty($ids)) {
         JError::raiseWarning(500, JText::_('COM_KNVBAPI2_TEAMIDS_NO_ITEM_SELECTED'));
     } else {
         // Publish the items.
         if (!$model->featured($ids, $value)) {
             JError::raiseWarning(500, $model->getError());
         }
         if ($value == 1) {
             $message = JText::plural('COM_KNVBAPI2_TEAMIDS_N_ITEMS_FEATURED', count($ids));
         } else {
             $message = JText::plural('COM_KNVBAPI2_TEAMIDS_N_ITEMS_UNFEATURED', count($ids));
         }
     }
     $this->setRedirect(JRoute::_('index.php?option=com_knvbapi2&view=teamids', false), $message);
 }
开发者ID:esorone,项目名称:efcpw,代码行数:41,代码来源:teamids.php


示例18: __construct

 /**
  * Constructor
  *
  * @access protected
  * @param array $options optional parameters
  */
 function __construct($options = array())
 {
     if (!$this->test()) {
         return JError::raiseError(404, "The apc extension is not available");
     }
     parent::__construct($options);
 }
开发者ID:Fellah,项目名称:govnobaki,代码行数:13,代码来源:apc.php


示例19: admin_postinstall_eaccelerator_action

/**
 * Disables the unsupported eAccelerator caching method, replacing it with the
 * "file" caching method.
 *
 * @return  void
 *
 * @since   3.2
 */
function admin_postinstall_eaccelerator_action()
{
    $prev = new JConfig();
    $prev = JArrayHelper::fromObject($prev);
    $data = array('cacheHandler' => 'file');
    $data = array_merge($prev, $data);
    $config = new Registry('config');
    $config->loadArray($data);
    jimport('joomla.filesystem.path');
    jimport('joomla.filesystem.file');
    // Set the configuration file path.
    $file = JPATH_CONFIGURATION . '/configuration.php';
    // Get the new FTP credentials.
    $ftp = JClientHelper::getCredentials('ftp', true);
    // Attempt to make the file writeable if using FTP.
    if (!$ftp['enabled'] && JPath::isOwner($file) && !JPath::setPermissions($file, '0644')) {
        JError::raiseNotice('SOME_ERROR_CODE', JText::_('COM_CONFIG_ERROR_CONFIGURATION_PHP_NOTWRITABLE'));
    }
    // Attempt to write the configuration file as a PHP class named JConfig.
    $configuration = $config->toString('PHP', array('class' => 'JConfig', 'closingtag' => false));
    if (!JFile::write($file, $configuration)) {
        JFactory::getApplication()->enqueueMessage(JText::_('COM_CONFIG_ERROR_WRITE_FAILED'), 'error');
        return;
    }
    // Attempt to make the file unwriteable if using FTP.
    if (!$ftp['enabled'] && JPath::isOwner($file) && !JPath::setPermissions($file, '0444')) {
        JError::raiseNotice('SOME_ERROR_CODE', JText::_('COM_CONFIG_ERROR_CONFIGURATION_PHP_NOTUNWRITABLE'));
    }
}
开发者ID:grlf,项目名称:eyedock,代码行数:37,代码来源:eaccelerator.php


示例20: test_

 /**
  * Test the _ method.
  *
  * @return  void
  *
  * @since   11.1
  */
 public function test_()
 {
     // Add the include path to html test files.
     JHtml::addIncludePath(array(__DIR__ . '/html/testfiles'));
     // Test the class method was called and the arguments passed correctly.
     $this->assertThat(JHtml::_('inspector.method1', 'argument1', 'argument2'), $this->equalTo('JHtmlInspector::method1'), 'JHtmlInspector::method1 could not be called.');
     $this->assertThat(JHtmlInspector::$arguments[0], $this->equalTo(array('argument1', 'argument2')), 'The arguments where not correctly passed to JHtmlInspector::method1.');
     // Test error cases.
     // Prepare the error handlers.
     $this->saveErrorHandlers();
     $errorCallback = $this->getMock('errorCallback', array('error1', 'error2', 'error3'));
     $errorCallback->expects($this->once())->method('error1');
     $errorCallback->expects($this->once())->method('error2');
     $errorCallback->expects($this->once())->method('error3');
     // Ensure that we get an error if we can find the file but the file does not contain the class.
     JError::setErrorHandling(E_ERROR, 'callback', array($errorCallback, 'error1'));
     $this->assertThat(JHtml::_('empty.anything'), $this->isFalse());
     // Ensure that we get an error if we can't find the file.
     JError::setErrorHandling(E_ERROR, 'callback', array($errorCallback, 'error2'));
     $this->assertThat(JHtml::_('nofile.anything'), $this->isFalse());
     // Ensure that we get an error if we have the class but not the method.
     JError::setErrorHandling(E_ERROR, 'callback', array($errorCallback, 'error3'));
     $this->assertThat(JHtml::_('inspector.nomethod'), $this->isFalse());
     // Restore the error handlers.
     $this->setErrorHandlers($this->savedErrorState);
 }
开发者ID:raquelsa,项目名称:Joomla,代码行数:33,代码来源:JHtmlTest.php



注:本文中的JError类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP JEventDispatcher类代码示例发布时间:2022-05-23
下一篇:
PHP JEditor类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap