Skip to content
This repository
tree: 6c085ad86f
Fetching contributors…

Cannot retrieve contributors at this time

executable file 60 lines (47 sloc) 1.409 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
<?php if (!defined('CLYDEPHP')) die('Direct access not allowed') ;?>
<?php

abstract class BaseClass {

protected $_params = array();

public function __construct($params = array()) {
if (!is_array($params)) {
throw new ClydePhpException('Passing non array params to '.get_class($this).' constructor is not allowed');
}

$this->_params = $params;
}

public function getProperty($name) {
if (!isset($this->_params[$name])) {
return null;
}
return $this->_params[$name];
}

public function setProperty($name,$value) {
$this->_params[$name] = $value;
}
}


abstract class UniqueIdObject extends DynaBean {

public $id;

public function __construct($id=null) {
$this->id = $id;
}
}

class ClydePhpException extends Exception {

}

function clydePhpExceptionHandler($exception){
echo '<div style=\'font-family:courier;\'>';
echo '<u>'.get_class($exception).': '.$exception->getMessage().'</u>';
echo '<ul style=\'list-style-type:none\'>';
echo '<li> at ('.$exception->getFile().':'.$exception->getLine().')';
foreach ($exception->getTrace() as $trace) {
echo '<li> at ';
if (isset($trace['class'])){
echo $trace['class'].$trace['type'];
}
echo $trace['function'];
if (isset($trace['file'])) {
echo '('.$trace['file'].':'.$trace['line'].')';
}
echo '</li>';
}
echo '</ul>';
echo '</div>';
}
Something went wrong with that request. Please try again.