当前位置: 首页>>代码示例>>PHP>>正文


PHP JFolder::makesafe方法代码示例

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


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

示例1: addSportsType

 /**
  * Method to add a new sportstype if not already exists
  *
  * @access	private
  * @return	boolean	True on success
  **/
 function addSportsType($newSportsTypeName)
 {
     $path = JPATH::clean(JPATH_ROOT . '/images/com_joomleague/database/events/' . JFolder::makesafe($newSportsTypeName));
     if (!JFolder::exists($path)) {
         JFolder::create($path);
     }
     // SportsType does NOT exist and has to be created
     $tblSportsType = $this->getTable();
     $tblSportsType->load(array('name' => $newSportsTypeName));
     $tblSportsType->name = $newSportsTypeName;
     $tblSportsType->store();
     return $tblSportsType->id;
 }
开发者ID:hfmprs,项目名称:JoomLeague,代码行数:19,代码来源:sportstype.php

示例2: addSportsType

 /**
  * Method to add a new sportstype if not already exists
  *
  * @access	private
  * @return	boolean	True on success
  * @since	1.5
  **/
 function addSportsType($newsportstype)
 {
     //check if sportstype exists. If not add a new sportstype to table
     $query = "SELECT * FROM #__joomleague_sport_type WHERE name=" . $this->_db->Quote($newsportstype);
     $this->_db->setQuery($query);
     $sportstypeObject = $this->_db->loadObject();
     if ($sportstypeObject->id) {
         //sportstype already exists
         return $sportstypeObject->id;
     }
     JFolder::create(JPATH::clean(JPATH_ROOT . '/images/com_joomleague/database/events/' . JFolder::makesafe($name)));
     //sportstype does NOT exist and has to be created
     $p_sportstype =& $this->getTable();
     $p_sportstype->set('name', $newsportstype);
     if (!$p_sportstype->store()) {
         $sportstypeObject->id = 0;
     } else {
         $sportstypeObject->id = $this->_db->insertid();
         //mysql_insert_id();
     }
     return $sportstypeObject->id;
 }
开发者ID:santas156,项目名称:joomleague-2-komplettpaket,代码行数:29,代码来源:sportstype.php


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