Example #1
0
 public function get_serial()
 {
     require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'string.php';
     # This would be cooler: $this->records->find etc etc and leave the domain condition away
     return dindex(preg_split('/\\s+/', Record::find('first', array('conditions' => 'type = ' . Domain::quote('SOA') . ' AND ' . 'domain_id = ' . Domain::quote($this->id)))->content), 2, null);
 }
Example #2
0
/**
 * Like func_get_args() without restrictions
 *
 * @return array
 */
function args()
{
    return dindex(dindex(debug_backtrace(), 1), 'args');
}
Example #3
0
/**
 * Returns english word for a number if between one and ten otherwise returns the
 * number as a string.
 *
 * @param int $number
 * @return string
 */
function flu_english_num($number)
{
    return dindex(array(1 => 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten'), (int) $number, (string) $number);
}