예제 #1
0
파일: Server.php 프로젝트: aoyel/pinst
 public function onMasterStart($server)
 {
     file_put_contents($this->pid_file, $server->master_pid);
     if (APP_DEBUG) {
         Console::println("Service[{$server->master_pid}] startup success !");
     }
     \Pinst::warning("server was start on {$this->port} !");
 }
예제 #2
0
파일: Db.php 프로젝트: aoyel/pinst
 protected function log($msg, $level = Logger::LEVEL_DEBUG)
 {
     if ($level < Logger::LEVEL_WARNING) {
         \Pinst::debug($msg);
     } else {
         \Pinst::error($msg);
     }
 }
예제 #3
0
파일: ErrorHandel.php 프로젝트: aoyel/pinst
 public function handleFatalError()
 {
     $error = error_get_last();
     if (empty($error)) {
         return;
     }
     if (in_array($error['type'], array(E_ERROR, E_WARNING))) {
         \Pinst::error("{$error['message']}\n\tin{$error['file']}({$error['line']})");
     }
 }
예제 #4
0
파일: Application.php 프로젝트: aoyel/pinst
 /**
  * get component
  * @param $name component name
  * @return mixed return component object
  * @throws UnknownPropertyException
  */
 protected function getComponent($name)
 {
     $component = $this->components[$name];
     $this->{$name} = \Pinst::createObject($component);
     return $this->getProperty($name);
 }
예제 #5
0
파일: Pinst.php 프로젝트: aoyel/pinst
<?php

define("PINST_PATH", __DIR__);
require PINST_PATH . '/BasePinst.php';
class Pinst extends \pinst\BasePinst
{
}
if (!defined("APP_DEBUG")) {
    define("APP_DEBUG", true);
}
Pinst::addNamespaceMap("pinst", PINST_PATH);
spl_autoload_register(['Pinst', 'autoload'], true, true);