Example #1
0
 /**
  * Init in Debug mode
  *
  * @return void
  */
 private static function _initOnDebug()
 {
     require_once 'Panda/Debug.php';
     require_once 'Panda/Debug/util.php';
     require_once 'Panda/Exception.php';
     include_once 'Net/Growl.php';
     ini_set('display_errors', 1);
     // アサーションを有効
     assert_options(ASSERT_ACTIVE, 1);
     assert_options(ASSERT_WARNING, 0);
     assert_options(ASSERT_QUIET_EVAL, 1);
     assert_options(ASSERT_CALLBACK, array('Panda', 'onAssert'));
     restore_error_handler();
     restore_exception_handler();
     set_exception_handler(array('Panda', 'onException'));
     if (class_exists('PEAR', false)) {
         PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array('Panda', 'onPearError'));
     }
     if (class_exists('PEAR_ErrorStack', false)) {
         PEAR_ErrorStack::setDefaultCallback(array('Panda', 'onStackError'));
     }
     set_error_handler(array('Panda', 'onDebugPhpError'));
 }
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 * @package    Piece_Unity
 * @subpackage Piece_Unity_Component_KernelConfigurator
 * @copyright  2006-2008 KUBO Atsuhiro <*****@*****.**>
 * @license    http://www.opensource.org/licenses/bsd-license.php  BSD License (revised)
 * @version    SVN: $Id$
 * @since      File available since Release 1.0.0
 */
error_reporting(E_ALL);
if (file_exists(dirname(__FILE__) . '/../../../Piece/Unity.php')) {
    set_include_path(realpath(dirname(__FILE__) . '/../../..') . PATH_SEPARATOR . get_include_path());
}
if (file_exists(dirname(__FILE__) . '/../Piece/Unity/Plugin/KernelConfigurator.php')) {
    set_include_path(realpath(dirname(__FILE__) . '/..') . PATH_SEPARATOR . get_include_path());
}
require_once 'PEAR/ErrorStack.php';
PEAR_ErrorStack::setDefaultCallback(create_function('$error', 'var_dump($error); return ' . PEAR_ERRORSTACK_DIE . ';'));
/*
 * Local Variables:
 * mode: php
 * coding: iso-8859-1
 * tab-width: 4
 * c-basic-offset: 4
 * c-hanging-comment-ender-p: nil
 * indent-tabs-mode: nil
 * End:
 */
Example #3
0
 /**
  * Constructor.
  */
 public function __construct()
 {
     parent::__construct('CiviCRM');
     $log = CRM_Core_Config::getLog();
     $this->setLogger($log);
     // PEAR<=1.9.0 does not declare "static" properly.
     if (!is_callable(array('PEAR', '__callStatic'))) {
         $this->setDefaultCallback(array($this, 'handlePES'));
     } else {
         PEAR_ErrorStack::setDefaultCallback(array($this, 'handlePES'));
     }
 }