function wpdt_init()
 {
     if (!is_admin() && current_user_can("level_10") && get_option('wpdt_quick_profiler')) {
         $this->db = new MySqlDatabase(DB_HOST, DB_USER, DB_PASSWORD);
         $this->db->connect(true);
         $this->db->changeDatabase(DB_NAME);
         $this->profiler = new PhpQuickProfiler(PhpQuickProfiler::getMicroTime());
         Console::logSpeed('Initializing...');
         if (get_option('wpdt_log_predefined_php') == 'checked') {
             //PHP Predefined Variables
             Console::log($_COOKIE, '_COOKIE');
             Console::log($_ENV, '_ENV');
             Console::log($_FILES, '_FILES');
             Console::log($_GET, '_GET');
             Console::log($PHP_SELF, '_PHP_SELF');
             Console::log($_POST, '_POST');
             Console::log($_REQUEST, '_REQUEST');
             Console::log($_SERVER, '_SERVER');
             Console::log($_SESSION, '_SESSION');
         }
         foreach ($this->filter_list as $filter) {
             if (get_option('wpdt_' . $filter) == 'checked') {
                 add_filter($filter, 'wpdt_' . $filter);
             } else {
                 remove_filter($filter, 'wpdt_' . $filter);
             }
         }
     } else {
         remove_action('init', array(&$this, 'wpdt_init'));
         remove_action('wp_footer', array(&$this, 'wpdt_end'));
     }
 }
Пример #2
0
 public static function pqp()
 {
     if ((int) DEBUG && PROFILER) {
         define("DIR_PQP", "./library/components/pqp/");
         require_once DIR_PQP . 'classes/PhpQuickProfiler.php';
         return new PhpQuickProfiler(PhpQuickProfiler::getMicroTime());
     } else {
         return null;
     }
 }
Пример #3
0
 public static function pqp()
 {
     if ((int) DEBUG && PROFILER) {
         define('DIR_PQP', './library/plugins/pqp/');
         require_once DIR_PQP . 'classes/PhpQuickProfiler.php';
         return new PhpQuickProfiler(PhpQuickProfiler::getMicroTime());
     } else {
         return null;
     }
 }
Пример #4
0
 function __construct()
 {
     global $db;
     $this->db = $db;
     $this->profiler = new PhpQuickProfiler(PhpQuickProfiler::getMicroTime());
 }
 public function __construct()
 {
     $this->profiler = new PhpQuickProfiler(PhpQuickProfiler::getMicroTime());
     Console::logMemory();
 }
 public static function profile($that = '', $function = '', $line = '', $msg = '')
 {
     if (defined('OWA_PROFILER')) {
         if (OWA_PROFILER === true) {
             static $profiler;
             if (!class_exists('PhpQuickProfiler')) {
                 require_once OWA_INCLUDE_DIR . 'pqp/classes/PhpQuickProfiler.php';
             }
             if (empty($profiler)) {
                 $profiler = new PhpQuickProfiler(PhpQuickProfiler::getMicroTime(), OWA_INCLUDE_DIR . 'pqp/');
             }
             $class = get_class($that);
             Console::logSpeed($class . "::{$function} - Line: {$line} - Msg: {$msg}");
             Console::logMemory($that, $class . "::{$function} - Line: {$line}");
             return $profiler;
         }
     }
 }
Пример #7
0
 public static function logSpeed($name = 'Point in Time')
 {
     $logItem = array("data" => PhpQuickProfiler::getMicroTime(), "type" => 'speed', "name" => $name);
     self::addToConsoleAndIncrement('speedCount', $logItem);
 }
 static function load_pqp()
 {
     $dir = dirname(__FILE__);
     require_once $dir . '/pqp/classes/PhpQuickProfiler.php';
     pqp_pi::$pqp_instance = new PhpQuickProfiler(PhpQuickProfiler::getMicroTime());
 }
Пример #9
0
 public function logSpeed($name = 'Point in Time')
 {
     $logItem = array("data" => PhpQuickProfiler::getMicroTime(), "type" => 'speed', "name" => $name);
     $GLOBALS['debugger_logs']['console'][] = $logItem;
     $GLOBALS['debugger_logs']['speedCount'] += 1;
 }
Пример #10
0
 public function __construct()
 {
     $this->profiler = new PhpQuickProfiler(PhpQuickProfiler::getMicroTime(), '/PHP-Quick-Profiler/pqp/');
 }
Пример #11
0
require_once __DIR__ . '/../../vendor/autoload.php';
/* prevent XSS */
$_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING);
$_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);
// filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_URL) = $_SERVER['PHP_SELF'];
// $PHPSELF = filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_URL);
define("WRITELOG_QUERY", false);
define("FSROOT", substr(dirname(__FILE__), 0, -3));
define("LIBDIR", FSROOT . "lib/");
// INCLUDE MISC
include FSROOT . "lib/Misc.php";
sanitize_post_get();
define("PHP_QUICK_PROFILER", false);
// Include PHP-Quick-Profiler
require_once 'PhpQuickProfiler.php';
$objProf = new PhpQuickProfiler(0);
$profiler = new PhpQuickProfiler($objProf->getMicroTime());
include_once FSROOT . "lib/interface/constants.php";
include_once dirname(__FILE__) . "/Class.A2Billing.php";
include_once dirname(__FILE__) . "/Class.Table.php";
include_once dirname(__FILE__) . "/Class.Connection.php";
include_once dirname(__FILE__) . "/Class.Realtime.php";
// USE PHPMAILER
include_once FSROOT . "lib/mail/class.phpmailer.php";
include dirname(__FILE__) . "/Class.NotificationsDAO.php";
include dirname(__FILE__) . "/Class.Notification.php";
include dirname(__FILE__) . "/Class.Mail.php";
session_name("UIADMINSESSION");
session_start();
// Control Session Time
if (isset($_SESSION['startTime'])) {
Пример #12
0
$response = new \Litpi\Response();
$session = new \Litpi\Session();
$registry->set('request', $request);
$registry->set('response', $response);
$registry->set('session', $session);
require 'includes/conf.php';
require 'includes/config.php';
require 'includes/setting.php';
$registry->set('conf', $conf);
$registry->set('setting', $setting);
$registry->set('https', PROTOCOL == 'https' ? true : false);
require 'includes/permission.php';
$registry->set('groupPermisson', $groupPermisson);
require 'includes/rewriterule.php';
require 'includes/startup.php';
include 'libs/pqp/classes/PhpQuickProfiler.php';
$myDosDetector = new DosDetector();
$myDosDetector->run($conf['rooturl'] . 'accessdeny.html');
if ($request->query->has('xprofiler')) {
    $pqpProfiler = new \PhpQuickProfiler(\PhpQuickProfiler::getMicroTime(), SITE_PATH . 'libs/pqp/');
}
# Load router
$registry->set('me', new \Model\User());
$router = new Router($registry);
$registry->set('router', $router);
$router->delegate();
//Send response
$registry->get('response')->send();
if ($request->query->has('xprofiler')) {
    $pqpProfiler->display();
}
Пример #13
0
    public function __construct($debug)
	{
        $this->profiler = new PhpQuickProfiler(PhpQuickProfiler::getMicroTime(), '/library/pqp/');
		$this->debug = $debug;
		$this->db = new MyDB();
    }
Пример #14
0
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * 
**/
define("PHP_QUICK_PROFILER", false);
// Include PHP-Quick-Profiler
require_once 'PhpQuickProfiler.php';
$profiler = new PhpQuickProfiler(PhpQuickProfiler::getMicroTime());
define("WRITELOG_QUERY", false);
define("FSROOT", substr(dirname(__FILE__), 0, -3));
define("LIBDIR", FSROOT . "lib/");
include_once FSROOT . "lib/interface/constants.php";
include_once dirname(__FILE__) . "/Class.A2Billing.php";
require_once 'adodb/adodb.inc.php';
// AdoDB
include_once dirname(__FILE__) . "/Class.Table.php";
include_once dirname(__FILE__) . "/Class.Connection.php";
include_once dirname(__FILE__) . "/Class.Realtime.php";
// USE PHPMAILER
include_once FSROOT . "lib/mail/class.phpmailer.php";
// INCLUDE MISC
include FSROOT . "lib/Misc.php";
include dirname(__FILE__) . "/Class.NotificationsDAO.php";
 /**
  * Constructor.
  */
 function PKPProfiler()
 {
     $this->profiler = new PhpQuickProfiler(PhpQuickProfiler::getMicroTime());
 }
Пример #16
0
	public function __construct() {
		$this->profiler = new PhpQuickProfiler(PhpQuickProfiler::getMicroTime());
	}
 public static function time($name)
 {
     if (isset(self::$profiler)) {
         if (isset(self::$time[$name])) {
             $logItem = array("data" => PhpQuickProfiler::getMicroTime(), "type" => 'speed', "name" => $name, "time" => self::$time[$name]);
             Console::addToConsoleAndIncrement('speedCount', $logItem);
         } else {
             self::$time[$name] = PhpQuickProfiler::getMicroTime();
         }
     }
 }