コード例 #1
0
ファイル: Domain.php プロジェクト: petski/SnapElements
 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);
 }
コード例 #2
0
ファイル: fluidics.php プロジェクト: petski/SnapElements
/**
 * Like func_get_args() without restrictions
 *
 * @return array
 */
function args()
{
    return dindex(dindex(debug_backtrace(), 1), 'args');
}
コード例 #3
0
ファイル: string.php プロジェクト: petski/SnapElements
/**
 * 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);
}