mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
issue 2119. supporting php 5.4. editor, extravar and file classes.
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12688 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
1de3e9cd17
commit
b69abcca68
5 changed files with 700 additions and 356 deletions
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Superclass of the edit component.
|
||||
* Set up the component variables
|
||||
|
|
@ -8,16 +9,20 @@
|
|||
*/
|
||||
class EditorHandler extends Object
|
||||
{
|
||||
|
||||
/**
|
||||
* set the xml and other information of the component
|
||||
* @param object $info editor information
|
||||
* @return void
|
||||
**/
|
||||
* */
|
||||
function setInfo($info)
|
||||
{
|
||||
Context::set('component_info', $info);
|
||||
|
||||
if(!$info->extra_vars) return;
|
||||
if(!$info->extra_vars)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach($info->extra_vars as $key => $val)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* A class to handle extra variables used in posts, member and others
|
||||
*
|
||||
|
|
@ -6,6 +7,7 @@
|
|||
*/
|
||||
class ExtraVar
|
||||
{
|
||||
|
||||
/**
|
||||
* sequence of module
|
||||
* @var int
|
||||
|
|
@ -48,11 +50,15 @@ class ExtraVar
|
|||
*/
|
||||
function setExtraVarKeys($extra_keys)
|
||||
{
|
||||
if(!is_array($extra_keys) || !count($extra_keys)) return;
|
||||
if(!is_array($extra_keys) || !count($extra_keys))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach($extra_keys as $key => $val)
|
||||
{
|
||||
$obj = null;
|
||||
$obj = new ExtraItem($val->module_srl, $val->idx, $val->name, $val->type, $val->default, $val->desc, $val->is_required, $val->search, $val->value, $val->eid);
|
||||
$obj = new ExtraItem($val->module_srl, $val->idx, $val->name, $val->type, $val->default, $val->desc, $val->is_required, $val->search, $val->value, $val->eid);
|
||||
$this->keys[$val->idx] = $obj;
|
||||
}
|
||||
}
|
||||
|
|
@ -66,6 +72,7 @@ class ExtraVar
|
|||
{
|
||||
return $this->keys;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -75,6 +82,7 @@ class ExtraVar
|
|||
*/
|
||||
class ExtraItem
|
||||
{
|
||||
|
||||
/**
|
||||
* Sequence of module
|
||||
* @var int
|
||||
|
|
@ -151,7 +159,11 @@ class ExtraItem
|
|||
*/
|
||||
function ExtraItem($module_srl, $idx, $name, $type = 'text', $default = null, $desc = '', $is_required = 'N', $search = 'N', $value = null, $eid = '')
|
||||
{
|
||||
if(!$idx) return;
|
||||
if(!$idx)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$this->module_srl = $module_srl;
|
||||
$this->idx = $idx;
|
||||
$this->name = $name;
|
||||
|
|
@ -185,47 +197,92 @@ class ExtraItem
|
|||
function _getTypeValue($type, $value)
|
||||
{
|
||||
$value = trim($value);
|
||||
if(!isset($value)) return;
|
||||
if(!isset($value))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch($type)
|
||||
{
|
||||
case 'homepage' :
|
||||
if($value && !preg_match('/^([a-z]+):\/\//i',$value)) $value = 'http://'.$value;
|
||||
if($value && !preg_match('/^([a-z]+):\/\//i', $value))
|
||||
{
|
||||
$value = 'http://' . $value;
|
||||
}
|
||||
return htmlspecialchars($value);
|
||||
break;
|
||||
|
||||
case 'tel' :
|
||||
if(is_array($value)) $values = $value;
|
||||
elseif(strpos($value,'|@|')!==false) $values = explode('|@|', $value);
|
||||
elseif(strpos($value,',')!==false) $values = explode(',', $value);
|
||||
if(is_array($value))
|
||||
{
|
||||
$values = $value;
|
||||
}
|
||||
elseif(strpos($value, '|@|') !== FALSE)
|
||||
{
|
||||
$values = explode('|@|', $value);
|
||||
}
|
||||
elseif(strpos($value, ',') !== FALSE)
|
||||
{
|
||||
$values = explode(',', $value);
|
||||
}
|
||||
|
||||
$values[0] = $values[0];
|
||||
$values[1] = $values[1];
|
||||
$values[2] = $values[2];
|
||||
return $values;
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'checkbox' :
|
||||
case 'radio' :
|
||||
case 'select' :
|
||||
if(is_array($value)) $values = $value;
|
||||
elseif(strpos($value,'|@|')!==false) $values = explode('|@|', $value);
|
||||
elseif(strpos($value,',')!==false) $values = explode(',', $value);
|
||||
else $values = array($value);
|
||||
for($i=0;$i<count($values);$i++) $values[$i] = htmlspecialchars($values[$i]);
|
||||
if(is_array($value))
|
||||
{
|
||||
$values = $value;
|
||||
}
|
||||
elseif(strpos($value, '|@|') !== FALSE)
|
||||
{
|
||||
$values = explode('|@|', $value);
|
||||
}
|
||||
elseif(strpos($value, ',') !== FALSE)
|
||||
{
|
||||
$values = explode(',', $value);
|
||||
}
|
||||
else
|
||||
{
|
||||
$values = array($value);
|
||||
}
|
||||
|
||||
for($i = 0; $i < count($values); $i++)
|
||||
{
|
||||
$values[$i] = htmlspecialchars($values[$i]);
|
||||
}
|
||||
|
||||
return $values;
|
||||
break;
|
||||
|
||||
case 'kr_zip' :
|
||||
if(is_array($value)) $values = $value;
|
||||
elseif(strpos($value,'|@|')!==false) $values = explode('|@|', $value);
|
||||
elseif(strpos($value,',')!==false) $values = explode(',', $value);
|
||||
else $values = array($value);
|
||||
if(is_array($value))
|
||||
{
|
||||
$values = $value;
|
||||
}
|
||||
elseif(strpos($value, '|@|') !== false)
|
||||
{
|
||||
$values = explode('|@|', $value);
|
||||
}
|
||||
elseif(strpos($value, ',') !== false)
|
||||
{
|
||||
$values = explode(',', $value);
|
||||
}
|
||||
else
|
||||
{
|
||||
$values = array($value);
|
||||
}
|
||||
|
||||
return $values;
|
||||
break;
|
||||
|
||||
//case 'date' :
|
||||
//case 'email_address' :
|
||||
//case 'text' :
|
||||
//case 'textarea' :
|
||||
default :
|
||||
return htmlspecialchars($value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -237,35 +294,55 @@ class ExtraItem
|
|||
function getValueHTML()
|
||||
{
|
||||
$value = $this->_getTypeValue($this->type, $this->value);
|
||||
|
||||
switch($this->type)
|
||||
{
|
||||
case 'homepage' :
|
||||
return ($value)?(sprintf('<a href="%s" target="_blank">%s</a>', $value, strlen($value)>60?substr($value,0,40).'...'.substr($value,-10):$value)):"";
|
||||
return ($value) ? (sprintf('<a href="%s" target="_blank">%s</a>', $value, strlen($value) > 60 ? substr($value, 0, 40) . '...' . substr($value, -10) : $value)) : "";
|
||||
|
||||
case 'email_address' :
|
||||
return ($value)?sprintf('<a href="mailto:%s">%s</a>', $value, $value):"";
|
||||
break;
|
||||
return ($value) ? sprintf('<a href="mailto:%s">%s</a>', $value, $value) : "";
|
||||
|
||||
case 'tel' :
|
||||
return sprintf('%s - %s - %s', $value[0],$value[1],$value[2]);
|
||||
break;
|
||||
return sprintf('%s - %s - %s', $value[0], $value[1], $value[2]);
|
||||
|
||||
case 'textarea' :
|
||||
return nl2br($value);
|
||||
break;
|
||||
|
||||
case 'checkbox' :
|
||||
if(is_array($value)) return implode(', ',$value);
|
||||
else return $value;
|
||||
break;
|
||||
if(is_array($value))
|
||||
{
|
||||
return implode(', ', $value);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
|
||||
case 'date' :
|
||||
return zdate($value,"Y-m-d");
|
||||
break;
|
||||
return zdate($value, "Y-m-d");
|
||||
|
||||
case 'select' :
|
||||
case 'radio' :
|
||||
if(is_array($value)) return implode(', ',$value);
|
||||
else return $value;
|
||||
break;
|
||||
if(is_array($value))
|
||||
{
|
||||
return implode(', ', $value);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
|
||||
case 'kr_zip' :
|
||||
if(is_array($value)) return implode(' ',$value);
|
||||
else return $value;
|
||||
break;
|
||||
if(is_array($value))
|
||||
{
|
||||
return implode(' ', $value);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
|
||||
// case 'text' :
|
||||
default :
|
||||
return $value;
|
||||
|
|
@ -285,54 +362,66 @@ class ExtraItem
|
|||
$name = $this->name;
|
||||
$value = $this->_getTypeValue($this->type, $this->value);
|
||||
$default = $this->_getTypeValue($this->type, $this->default);
|
||||
$column_name = 'extra_vars'.$this->idx;
|
||||
$tmp_id = $column_name.'-'.$id_num++;
|
||||
$column_name = 'extra_vars' . $this->idx;
|
||||
$tmp_id = $column_name . '-' . $id_num++;
|
||||
|
||||
$buff = '';
|
||||
switch($type)
|
||||
{
|
||||
// Homepage
|
||||
case 'homepage' :
|
||||
$buff .= '<input type="text" name="'.$column_name.'" value="'.$value.'" class="homepage" />';
|
||||
$buff .= '<input type="text" name="' . $column_name . '" value="' . $value . '" class="homepage" />';
|
||||
break;
|
||||
// Email Address
|
||||
case 'email_address' :
|
||||
$buff .= '<input type="text" name="'.$column_name.'" value="'.$value.'" class="email_address" />';
|
||||
$buff .= '<input type="text" name="' . $column_name . '" value="' . $value . '" class="email_address" />';
|
||||
break;
|
||||
// Phone Number
|
||||
case 'tel' :
|
||||
$buff .=
|
||||
'<input type="text" name="'.$column_name.'[]" value="'.$value[0].'" size="4" maxlength="4" class="tel" />'.
|
||||
'<input type="text" name="'.$column_name.'[]" value="'.$value[1].'" size="4" maxlength="4" class="tel" />'.
|
||||
'<input type="text" name="'.$column_name.'[]" value="'.$value[2].'" size="4" maxlength="4" class="tel" />';
|
||||
'<input type="text" name="' . $column_name . '[]" value="' . $value[0] . '" size="4" maxlength="4" class="tel" />' .
|
||||
'<input type="text" name="' . $column_name . '[]" value="' . $value[1] . '" size="4" maxlength="4" class="tel" />' .
|
||||
'<input type="text" name="' . $column_name . '[]" value="' . $value[2] . '" size="4" maxlength="4" class="tel" />';
|
||||
break;
|
||||
// textarea
|
||||
case 'textarea' :
|
||||
$buff .= '<textarea name="'.$column_name.'" rows="8" cols="42">'.$value.'</textarea>';
|
||||
$buff .= '<textarea name="' . $column_name . '" rows="8" cols="42">' . $value . '</textarea>';
|
||||
break;
|
||||
// multiple choice
|
||||
case 'checkbox' :
|
||||
$buff .= '<ul>';
|
||||
foreach($default as $v)
|
||||
{
|
||||
if($value && in_array(trim($v), $value)) $checked = ' checked="checked"';
|
||||
else $checked = '';
|
||||
if($value && in_array(trim($v), $value))
|
||||
{
|
||||
$checked = ' checked="checked"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$checked = '';
|
||||
}
|
||||
|
||||
// Temporary ID for labeling
|
||||
$tmp_id = $column_name.'-'.$id_num++;
|
||||
$tmp_id = $column_name . '-' . $id_num++;
|
||||
|
||||
$buff .='<li><input type="checkbox" name="'.$column_name.'[]" id="'.$tmp_id.'" value="'.htmlspecialchars($v).'" '.$checked.' /><label for="'.$tmp_id.'">'.$v.'</label></li>';
|
||||
$buff .='<li><input type="checkbox" name="' . $column_name . '[]" id="' . $tmp_id . '" value="' . htmlspecialchars($v) . '" ' . $checked . ' /><label for="' . $tmp_id . '">' . $v . '</label></li>';
|
||||
}
|
||||
$buff .= '</ul>';
|
||||
break;
|
||||
// single choice
|
||||
case 'select' :
|
||||
$buff .= '<select name="'.$column_name.'" class="select">';
|
||||
$buff .= '<select name="' . $column_name . '" class="select">';
|
||||
foreach($default as $v)
|
||||
{
|
||||
if($value && in_array(trim($v),$value)) $selected = ' selected="selected"';
|
||||
else $selected = '';
|
||||
$buff .= '<option value="'.$v.'" '.$selected.'>'.$v.'</option>';
|
||||
if($value && in_array(trim($v), $value))
|
||||
{
|
||||
$selected = ' selected="selected"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$selected = '';
|
||||
}
|
||||
$buff .= '<option value="' . $v . '" ' . $selected . '>' . $v . '</option>';
|
||||
}
|
||||
$buff .= '</select>';
|
||||
break;
|
||||
|
|
@ -341,13 +430,19 @@ class ExtraItem
|
|||
$buff .= '<ul>';
|
||||
foreach($default as $v)
|
||||
{
|
||||
if($value && in_array(trim($v),$value)) $checked = ' checked="checked"';
|
||||
else $checked = '';
|
||||
if($value && in_array(trim($v), $value))
|
||||
{
|
||||
$checked = ' checked="checked"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$checked = '';
|
||||
}
|
||||
|
||||
// Temporary ID for labeling
|
||||
$tmp_id = $column_name.'-'.$id_num++;
|
||||
$tmp_id = $column_name . '-' . $id_num++;
|
||||
|
||||
$buff .= '<li><input type="radio" name="'.$column_name.'" id="'.$tmp_id.'" '.$checked.' value="'.$v.'" class="radio" /><label for="'.$tmp_id.'">'.$v.'</label></li>';
|
||||
$buff .= '<li><input type="radio" name="' . $column_name . '" id="' . $tmp_id . '" ' . $checked . ' value="' . $v . '" class="radio" /><label for="' . $tmp_id . '">' . $v . '</label></li>';
|
||||
}
|
||||
$buff .= '</ul>';
|
||||
break;
|
||||
|
|
@ -357,23 +452,23 @@ class ExtraItem
|
|||
Context::loadJavascriptPlugin('ui.datepicker');
|
||||
|
||||
$buff .=
|
||||
'<input type="hidden" name="'.$column_name.'" value="'.$value.'" />'.
|
||||
'<input type="text" id="date_'.$column_name.'" value="'.zdate($value,'Y-m-d').'" class="date" /> <input type="button" value="' . Context::getLang('cmd_delete') . '" id="dateRemover_' . $column_name . '" />'."\n".
|
||||
'<script>'."\n".
|
||||
'(function($){'."\n".
|
||||
' $(function(){'."\n".
|
||||
' var option = { dateFormat: "yy-mm-dd", changeMonth:true, changeYear:true, gotoCurrent: false,yearRange:\'-100:+10\', onSelect:function(){'."\n".
|
||||
' $(this).prev(\'input[type="hidden"]\').val(this.value.replace(/-/g,""))}'."\n".
|
||||
' };'."\n".
|
||||
' $.extend(option,$.datepicker.regional[\''.Context::getLangType().'\']);'."\n".
|
||||
' $("#date_'.$column_name.'").datepicker(option);'."\n".
|
||||
' $("#dateRemover_' . $column_name . '").click(function(){' . "\n" .
|
||||
' $(this).siblings("input").val("");' . "\n" .
|
||||
' return false;' . "\n" .
|
||||
' })' . "\n" .
|
||||
' });'."\n".
|
||||
'})(jQuery);'."\n".
|
||||
'</script>';
|
||||
'<input type="hidden" name="' . $column_name . '" value="' . $value . '" />' .
|
||||
'<input type="text" id="date_' . $column_name . '" value="' . zdate($value, 'Y-m-d') . '" class="date" /> <input type="button" value="' . Context::getLang('cmd_delete') . '" id="dateRemover_' . $column_name . '" />' . "\n" .
|
||||
'<script>' . "\n" .
|
||||
'(function($){' . "\n" .
|
||||
' $(function(){' . "\n" .
|
||||
' var option = { dateFormat: "yy-mm-dd", changeMonth:true, changeYear:true, gotoCurrent: false,yearRange:\'-100:+10\', onSelect:function(){' . "\n" .
|
||||
' $(this).prev(\'input[type="hidden"]\').val(this.value.replace(/-/g,""))}' . "\n" .
|
||||
' };' . "\n" .
|
||||
' $.extend(option,$.datepicker.regional[\'' . Context::getLangType() . '\']);' . "\n" .
|
||||
' $("#date_' . $column_name . '").datepicker(option);' . "\n" .
|
||||
' $("#dateRemover_' . $column_name . '").click(function(){' . "\n" .
|
||||
' $(this).siblings("input").val("");' . "\n" .
|
||||
' return false;' . "\n" .
|
||||
' })' . "\n" .
|
||||
' });' . "\n" .
|
||||
'})(jQuery);' . "\n" .
|
||||
'</script>';
|
||||
break;
|
||||
// address
|
||||
case "kr_zip" :
|
||||
|
|
@ -381,33 +476,35 @@ class ExtraItem
|
|||
Context::loadJavascriptPlugin('ui.krzip');
|
||||
|
||||
$buff .=
|
||||
'<div id="addr_searched_'.$column_name.'" style="display:'.($value[0]?'block':'none').';">'.
|
||||
'<input type="text" readonly="readonly" name="'.$column_name.'[]" value="'.$value[0].'" class="address" />'.
|
||||
'<a href="#" onclick="doShowKrZipSearch(this, \''.$column_name.'\'); return false;" class="button red"><span>'.Context::getLang('cmd_cancel').'</span></a>'.
|
||||
'</div>'.
|
||||
|
||||
'<div id="addr_list_'.$column_name.'" style="display:none;">'.
|
||||
'<select name="addr_list_'.$column_name.'"></select>'.
|
||||
'<a href="#" onclick="doSelectKrZip(this, \''.$column_name.'\'); return false;" class="button blue"><span>'.Context::getLang('cmd_select').'</span></a>'.
|
||||
'<a href="#" onclick="doHideKrZipList(this, \''.$column_name.'\'); return false;" class="button red"><span>'.Context::getLang('cmd_cancel').'</span></a>'.
|
||||
'</div>'.
|
||||
|
||||
'<div id="addr_search_'.$column_name.'" style="display:'.($value[0]?'none':'block').'">'.
|
||||
'<input type="text" name="addr_search_'.$column_name.'" class="address" value="" />'.
|
||||
'<a href="#" onclick="doSearchKrZip(this, \''.$column_name.'\'); return false;" class="button green"><span>'.Context::getLang('cmd_search').'</span></a>'.
|
||||
'</div>'.
|
||||
|
||||
'<input type="text" name="'.$column_name.'[]" value="'.htmlspecialchars($value[1]).'" class="address" />'.
|
||||
'';
|
||||
'<div id="addr_searched_' . $column_name . '" style="display:' . ($value[0] ? 'block' : 'none') . ';">' .
|
||||
'<input type="text" readonly="readonly" name="' . $column_name . '[]" value="' . $value[0] . '" class="address" />' .
|
||||
'<a href="#" onclick="doShowKrZipSearch(this, \'' . $column_name . '\'); return false;" class="button red"><span>' . Context::getLang('cmd_cancel') . '</span></a>' .
|
||||
'</div>' .
|
||||
'<div id="addr_list_' . $column_name . '" style="display:none;">' .
|
||||
'<select name="addr_list_' . $column_name . '"></select>' .
|
||||
'<a href="#" onclick="doSelectKrZip(this, \'' . $column_name . '\'); return false;" class="button blue"><span>' . Context::getLang('cmd_select') . '</span></a>' .
|
||||
'<a href="#" onclick="doHideKrZipList(this, \'' . $column_name . '\'); return false;" class="button red"><span>' . Context::getLang('cmd_cancel') . '</span></a>' .
|
||||
'</div>' .
|
||||
'<div id="addr_search_' . $column_name . '" style="display:' . ($value[0] ? 'none' : 'block') . '">' .
|
||||
'<input type="text" name="addr_search_' . $column_name . '" class="address" value="" />' .
|
||||
'<a href="#" onclick="doSearchKrZip(this, \'' . $column_name . '\'); return false;" class="button green"><span>' . Context::getLang('cmd_search') . '</span></a>' .
|
||||
'</div>' .
|
||||
'<input type="text" name="' . $column_name . '[]" value="' . htmlspecialchars($value[1]) . '" class="address" />' .
|
||||
'';
|
||||
break;
|
||||
// General text
|
||||
default :
|
||||
$buff .=' <input type="text" name="'.$column_name.'" value="'.($value ? $value : $default).'" class="text" />';
|
||||
$buff .=' <input type="text" name="' . $column_name . '" value="' . ($value ? $value : $default) . '" class="text" />';
|
||||
break;
|
||||
}
|
||||
if($this->desc) $buff .= '<p>'.$this->desc.'</p>';
|
||||
if($this->desc)
|
||||
{
|
||||
$buff .= '<p>' . $this->desc . '</p>';
|
||||
}
|
||||
|
||||
return $buff;
|
||||
}
|
||||
|
||||
}
|
||||
/* End of file ExtraVar.class.php */
|
||||
/* Location: ./classes/extravar/ExtraVar.class.php */
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* File abstraction class
|
||||
*
|
||||
|
|
@ -6,17 +7,18 @@
|
|||
*/
|
||||
class FileObject extends Object
|
||||
{
|
||||
|
||||
/**
|
||||
* File descriptor
|
||||
* @var resource
|
||||
*/
|
||||
var $fp = null;
|
||||
var $fp = NULL;
|
||||
|
||||
/**
|
||||
* File path
|
||||
* @var string
|
||||
*/
|
||||
var $path = null;
|
||||
var $path = NULL;
|
||||
|
||||
/**
|
||||
* File open mode
|
||||
|
|
@ -33,7 +35,10 @@ class FileObject extends Object
|
|||
*/
|
||||
function FileObject($path, $mode)
|
||||
{
|
||||
if($path != null) $this->Open($path, $mode);
|
||||
if($path != NULL)
|
||||
{
|
||||
$this->Open($path, $mode);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -74,7 +79,6 @@ class FileObject extends Object
|
|||
return fread($this->fp, $size);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Write string to current file
|
||||
*
|
||||
|
|
@ -84,8 +88,14 @@ class FileObject extends Object
|
|||
function write($str)
|
||||
{
|
||||
$len = strlen($str);
|
||||
if(!$str || $len <= 0) return false;
|
||||
if(!$this->fp) return false;
|
||||
if(!$str || $len <= 0)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if(!$this->fp)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
$written = fwrite($this->fp, $str);
|
||||
return $written;
|
||||
}
|
||||
|
|
@ -101,18 +111,18 @@ class FileObject extends Object
|
|||
*/
|
||||
function open($path, $mode)
|
||||
{
|
||||
if($this->fp != null)
|
||||
{
|
||||
if($this->fp != NULL)
|
||||
{
|
||||
$this->close();
|
||||
}
|
||||
$this->fp = fopen($path, $mode);
|
||||
if(! is_resource($this->fp) )
|
||||
if(!is_resource($this->fp))
|
||||
{
|
||||
$this->fp = null;
|
||||
return false;
|
||||
$this->fp = NULL;
|
||||
return FALSE;
|
||||
}
|
||||
$this->path = $path;
|
||||
return true;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -122,13 +132,13 @@ class FileObject extends Object
|
|||
*/
|
||||
function getPath()
|
||||
{
|
||||
if($this->fp != null)
|
||||
if($this->fp != NULL)
|
||||
{
|
||||
return $this->path;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -139,13 +149,13 @@ class FileObject extends Object
|
|||
*/
|
||||
function close()
|
||||
{
|
||||
if($this->fp != null)
|
||||
if($this->fp != NULL)
|
||||
{
|
||||
fclose($this->fp);
|
||||
$this->fp = null;
|
||||
$this->fp = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/* End of file FileObject.class.php */
|
||||
/* Location: ./classes/file/FileObject.class.php */
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
<?php
|
||||
try
|
||||
{
|
||||
return self::_getRemoteResource($url, $body, $timeout, $method, $content_type, $headers, $cookies, $post_data);
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
/* End of file getRemoteResourcePHP5.php */
|
||||
/* Location: ./classes/file/getRemoteResourcePHP5.php */
|
||||
Loading…
Add table
Add a link
Reference in a new issue