Go to the source code of this file.
Namespaces | |
| namespace | MythWeb |
Functions | |
| setting ($field, $hostname=null, $new_value="old\0old") | |
| Get or set a database setting. | |
| find_in_path ($file) | |
| Find a particular file in the current include_path. | |
| smart_args ($args) | |
| I like how in perl, you can pass variables into functions in lists or arrays, and they all show up to the function as one giant list. | |
| & | fix_crlfxy (&$array) |
| Recursively fixes silly stuff that some browsers send. | |
| & | fix_magic_quotes (&$array) |
| Recursively strip slashes from an array (eg. | |
| redirect_browser ($url) | |
| Strips slashes ONLY before quotes, to get around php adding slashes in preg_replace //e but not in such a way that stripslashes works properly. | |
| nice_filesize ($size) | |
| Pass in a filesize in bytes, and receive a more human-readable version JS: adapted from php.net: sponger 10-Jun-2002 12:28 /*. | |
| nice_length ($length) | |
| Convert a unix timestamp into an day/hour/minute string. | |
| unixtime ($sql_timestamp) | |
| Converts an sql timestamp into unixtime /*. | |
| escape ($string, $allow_null=false) | |
| DEPRECATED (use the Database object instead). | |
| html_entities ($str) | |
| Overloaded version of htmlentities() that requests the UTF-8 entities rather than the default ISO-9660. | |
| get_sorted_files ($dir= '.', $regex= '', $negate=false) | |
| Returns a sorted list of files in a directory, minus . | |
| timer ($message=null, $index=0) | |
| Start/display a microtime timer. | |
| _or ($this, $or_this, $gt=false) | |
| returns $this or $or_this if $gt is set to true, $this will only be returned if it's > 0 if $gt is set to a number, $this will only be returned if it's > $gt /* | |
| video_url ($show, $ext=false) | |
| Someday, we may even be able to pass in a recording and get back a specific hostname. | |
| utf8tolocal ($str) | |
| debug ($data, $file=false) | |
| Prints out a piece of data to the firebug console. | |
| fequals ($lhs, $rhs) | |
| setting | ( | $ | field, | |
| $ | hostname = null, |
|||
| $ | new_value = "old\0old" | |||
| ) |
Get or set a database setting.
| string | $field The field (settings.value) to retrieve/set. | |
| string | $hostname Hostname (or null) associated with $field. | |
| string | $new_value New value (settings.data) to set. |
Definition at line 33 of file utils.php.
Referenced by Video::__construct(), DTVDeviceConfigGroup::AddNodes(), TriggeredConfigurationGroup::byName(), DoVideoDatabaseSchemaUpgrade(), get_str_option(), MainServer::HandleSetSetting(), MainServer::HandleSettingQuery(), if(), MythThemedMenuState::parseButtonDefinition(), RecorderBase::SetIntOption(), NuppelVideoRecorder::SetOptionsFromProfile(), RecorderBase::SetStrOption(), TVRec::SetupDTVSignalMonitor(), UpgradeMusicDatabaseSchema(), GlobalSetup::wireUI(), and ZMServer::ZMServer().
| find_in_path | ( | $ | file | ) |
| smart_args | ( | $ | args | ) |
| & fix_crlfxy | ( | &$ | array | ) |
| & fix_magic_quotes | ( | &$ | array | ) |
| redirect_browser | ( | $ | url | ) |
Strips slashes ONLY before quotes, to get around php adding slashes in preg_replace //e but not in such a way that stripslashes works properly.
/*/ function strip_quote_slashes($str) { return preg_replace("/\\\\([\"'])/", '$1', $str); }
/** Print a redirect header and exit /*
| nice_filesize | ( | $ | size | ) |
| nice_length | ( | $ | length | ) |
Convert a unix timestamp into an day/hour/minute string.
| int | $length time to convert. |
Definition at line 194 of file utils.php.
Referenced by Video::metadata().
| unixtime | ( | $ | sql_timestamp | ) |
| escape | ( | $ | string, | |
| $ | allow_null = false | |||
| ) |
DEPRECATED (use the Database object instead).
For lack of a function that escapes strings AND adds quotes, I wrote one myself to make the rest of my code read a bit easier. /*
Definition at line 237 of file utils.php.
Referenced by MythControls::keyPressEvent(), sajax_get_common_js(), and vc1_decode_ac_coeff().
| html_entities | ( | $ | str | ) |
| get_sorted_files | ( | $ | dir = '.', |
|
| $ | regex = '', |
|||
| $ | negate = false | |||
| ) |
| timer | ( | $ | message = null, |
|
| $ | index = 0 | |||
| ) |
Start/display a microtime timer.
| mixed | $message The message to echo, or another value (see return) | |
| int | $index The index value of the cache to store the timer. Useful for handling multiple simultaneous timers. |
Definition at line 285 of file utils.php.
Referenced by MadDecoder::calcLength(), UIAnimatedImageType::IsPaused(), AudioOutputOSS::OpenDevice(), AudioOutputJACK::OpenDevice(), NetworkControl::processJump(), NetworkControl::processPlay(), NetworkControl::processQuery(), ZMClient::readData(), BufferedSocketDevice::ReadLine(), MythSocket::readStringList(), WorkerThread::run(), AutoExpire::RunExpirer(), NetworkControl::saveScreenshot(), and MythContextPrivate::UPnPautoconf().
| _or | ( | $ | this, | |
| $ | or_this, | |||
| $ | gt = false | |||
| ) |
returns $this or $or_this if $gt is set to true, $this will only be returned if it's > 0 if $gt is set to a number, $this will only be returned if it's > $gt /*
Definition at line 313 of file utils.php.
Referenced by Channel::__construct().
| video_url | ( | $ | show, | |
| $ | ext = false | |||
| ) |
| utf8tolocal | ( | $ | str | ) |
| debug | ( | $ | data, | |
| $ | file = false | |||
| ) |
1.5.5