Пример #1
0
	/**
	 * Tracy\Debugger::dump() shortcut.
	 * @tracySkipLocation
	 */
	function dump($var)
	{
		foreach (func_get_args() as $arg) {
			Tracy\Debugger::dump($arg);
		}
		return $var;
	}
Пример #2
0
function sendPayload($params = array())
{
    global $Payload;
    $payloadArray = (array) $Payload;
    Tracy\Debugger::$productionMode = TRUE;
    header('Content-Type:application/json;charset=utf-8');
    print json_encode($params + $payloadArray) and die;
}
Пример #3
0
 /**
  * Tracy\Debugger::log() shortcut.
  */
 function dlog($var = NULL)
 {
     if (func_num_args() === 0) {
         Tracy\Debugger::log(new Exception(), 'dlog');
     }
     foreach (func_get_args() as $arg) {
         Tracy\Debugger::log($arg, 'dlog');
     }
     return $var;
 }
Пример #4
0
 /**
  * Tracy\Debugger::log() shortcut.
  * @deprecated
  */
 function dlog($var = NULL)
 {
     trigger_error(__FUNCTION__ . '() is deprecated.', E_USER_DEPRECATED);
     if (func_num_args() === 0) {
         Tracy\Debugger::log(new Exception(), 'dlog');
     }
     foreach (func_get_args() as $arg) {
         Tracy\Debugger::log($arg, 'dlog');
     }
     return $var;
 }
Пример #5
0
 public static function setup($tempDir, $callback = NULL)
 {
     if (!class_exists('Tester\\Assert')) {
         echo "Install Nette Tester using `composer update --dev`\n";
         exit(1);
     }
     self::$tempDir = $tempDir;
     self::$onBeforeContainerCreate = $callback;
     umask(0);
     \Tester\Environment::setup();
     date_default_timezone_set('Europe/Prague');
     if (class_exists('Tracy\\Debugger')) {
         \Tracy\Debugger::$logDirectory = self::$tempDir;
     }
     $_ENV = $_GET = $_POST = $_FILES = [];
 }
Пример #6
0
 /**
  * Sends response to output.
  * @param  Nette\Http\IRequest  $httpRequest
  * @param  Nette\Http\IResponse $httpResponse
  * @return void
  */
 public function send(Nette\Http\IRequest $httpRequest, Nette\Http\IResponse $httpResponse)
 {
     /**
      * Disable tracy bar
      */
     if (class_exists('\\Tracy\\Debugger') && property_exists('\\Tracy\\Debugger', 'productionMode')) {
         \Tracy\Debugger::$productionMode = TRUE;
     }
     /**
      * Set Content-Type header
      */
     $httpResponse->setContentType($this->contentType, $this->output_encoding);
     /**
      * Set Content-Disposition header
      */
     $httpResponse->setHeader('Content-Disposition', 'attachment' . '; filename="' . $this->name . '"');
     /*. '; filename*=' . $this->output_encoding . '\'\'' . rawurlencode($this->name));*/
     /**
      * Set other headers
      */
     foreach ($this->headers as $key => $value) {
         $httpResponse->setHeader($key, $value);
     }
     if (function_exists('ob_start')) {
         ob_start();
     }
     /**
      * Output data
      */
     if ($this->include_bom && strtolower($this->output_encoding) == 'utf-8') {
         echo "";
     }
     $delimiter = '"' . $this->delimiter . '"';
     foreach ($this->data as $row) {
         if (strtolower($this->output_encoding) == 'utf-8') {
             echo '"' . implode($delimiter, (array) $row) . '"';
         } else {
             echo iconv('UTF-8', $this->output_encoding, '"' . implode($delimiter, (array) $row) . '"');
         }
         echo "\r\n";
     }
     if (function_exists('ob_end_flush')) {
         ob_end_flush();
     }
 }
Пример #7
0
function wp_tracy_init_action()
{
    if (defined("DOING_AJAX") && DOING_AJAX) {
        return;
        // for IE compatibility WordPress media upload
    }
    if (defined("WP_TRACY_CHECK_USER_LOGGED_IN") && WP_TRACY_CHECK_USER_LOGGED_IN && is_user_logged_in()) {
        return;
        // cancel for anonymous users
    }
    Tracy\Debugger::enable(defined("WP_TRACY_ENABLE_MODE") ? WP_TRACY_ENABLE_MODE : null);
    // hooray, enabling debugging using Tracy
    // panels in the correct order
    $defaultPanels = array("WpTracy\\WpPanel", "WpTracy\\WpUserPanel", "WpTracy\\WpPostPanel", "WpTracy\\WpQueryPanel", "WpTracy\\WpQueriedObjectPanel", "WpTracy\\WpDbPanel", "WpTracy\\WpRewritePanel");
    $panels = apply_filters("wp_tracy_panels_filter", $defaultPanels);
    // panels registration
    foreach ($panels as $className) {
        Tracy\Debugger::getBar()->addPanel(new $className());
    }
}
Пример #8
0
 public static function setup($tempDir, $callback = NULL)
 {
     if (!class_exists('Tester\\Assert')) {
         echo "Install Nette Tester using `composer update --dev`\n";
         exit(1);
     }
     self::$tempDir = $tempDir;
     self::$onBeforeContainerCreate = $callback;
     umask(0);
     if (!ob_get_level() > 0) {
         //\Tester\Environment::setup already called
         \Tester\Environment::setup();
     }
     date_default_timezone_set('Europe/Prague');
     if (class_exists('Tracy\\Debugger')) {
         \Tracy\Debugger::$logDirectory = self::$tempDir;
     }
     $_ENV = $_GET = $_POST = $_FILES = [];
     $_SERVER['HTTP_USER_AGENT'] = 'Awesome Browser';
     $_SERVER['REMOTE_ADDR'] = '11.22.33.44';
     $_SERVER['HTTP_HOST'] = $_SERVER['SERVER_NAME'] = 'test.bench';
 }
Пример #9
0
<?php

require __DIR__ . '/../vendor/autoload.php';
require_once '../vendor/ezyang/htmlpurifier/library/HTMLPurifier.php';
$configurator = new Nette\Configurator();
$configurator->setDebugMode(array("0.0.0.0"));
// enable for your remote IP
$configurator->enableDebugger(__DIR__ . '/../log');
error_reporting(E_ALL ^ E_NOTICE);
\Tracy\Debugger::$strictMode = FALSE;
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->register();
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config.local.neon');
$container = $configurator->createContainer();
return $container;
Пример #10
0
 public function actionPocasi($id, $mesto, $rec = false)
 {
     // api.plbot.lury.cz/pocasi/dnes?kraj=kraj
     if ($mesto === NULL) {
         $mesto = "praha";
     } else {
         $mesto = \Nette\Utils\Strings::webalize($mesto);
     }
     $return = array('data' => array());
     $cached = $this->cache->load($this->name . $this->action . $mesto . date('d.m.Y') . $id);
     if ($cached !== NULL) {
         if ($rec === FALSE) {
             $this->sendResponse(new \Nette\Application\Responses\JsonResponse($cached, "application/json;charset=utf-8"));
             return;
         } else {
             return $cached;
         }
     }
     $response = $this->tools->callCurlRequest(sprintf(static::URL_POCASI, $mesto));
     switch ($id) {
         case 'dnes':
             preg_match('#<span id="title-loc">(.*?)</span>#i', $response, $title);
             preg_match('#<div id="predpoved-dnes".+<div class="info">\\s*<p>\\s*([^<]+)</p>(.+)id="predpoved-zitra"#i', $response, $r);
             preg_match('#<span class="date">(.*?)</span>#i', $r[0], $date);
             preg_match('#temp.*?value">([^<]*).*?sup">([^<]*)</span>.*?<span class=#i', $r[2], $r2);
             preg_match_all('#temp">([\\d-]+).*?sup">([^<]*)</span>.*?dayTime">\\s*([^<]*)\\s*</span>\\s*</div>#im', $r[2], $r3);
             \Tracy\Debugger::$maxLen = 10000;
             $return['data']['datum'] = "{$date[1]}";
             $return['data']['predpoved'] = html_entity_decode($r[1]);
             $return['data']['nyni'] = html_entity_decode("{$r2[1]}{$r2[2]}");
             $return['data']['rano'] = '?? °C';
             $return['data']['odpoledne'] = '?? °C';
             $return['data']['vecer'] = '?? °C';
             $return['data']['noc'] = '?? °C';
             foreach ($r3[3] as $key => $doba) {
                 switch ($doba) {
                     case 'Ráno':
                         $return['data']['rano'] = html_entity_decode("{$r3[1][$key]}{$r3[2][$key]}");
                         break;
                     case 'Odpoledne':
                         $return['data']['odpoledne'] = html_entity_decode("{$r3[1][$key]}{$r3[2][$key]}");
                         break;
                     case 'Večer':
                         $return['data']['vecer'] = html_entity_decode("{$r3[1][$key]}{$r3[2][$key]}");
                         break;
                     case 'V Noci':
                         $return['data']['noc'] = html_entity_decode("{$r3[1][$key]}{$r3[2][$key]}");
                         break;
                 }
             }
             $return['data']['pro'] = "Pro {$title[1]}";
             $this->cache->save($this->name . $this->action . $mesto . date('d.m.Y') . $id, $return, array(\Nette\Caching\Cache::EXPIRE => "+1 day"));
             break;
         case 'zitra':
             preg_match('#<span id="title-loc">(.*?)</span>#i', $response, $title);
             preg_match('#<div id="predpoved-zitra".+<div class="info">\\s*<p>\\s*([^<]+)</p>(.+)id="predpoved-pozitri"#i', $response, $r);
             preg_match('#<span class="date">(.*?)</span>#i', $r[0], $date);
             preg_match('#atDay.*?temp.*?value">([-\\d]+).*?sup">([^<]+)</span>.*?atNight.*?temp.*?value">([-\\d]+).*?sup">([^<]+)</span>#i', $r[0], $r2);
             \Tracy\Debugger::$maxLen = 10000;
             $return['data']['datum'] = "{$date[1]}";
             $return['data']['predpoved'] = html_entity_decode($r[1]);
             $return['data']['den'] = html_entity_decode("{$r2[1]}{$r2[2]}");
             $return['data']['noc'] = html_entity_decode("{$r2[3]}{$r2[4]}");
             $return['data']['pro'] = "Pro {$title[1]}";
             $this->cache->save($this->name . $this->action . $mesto . date('d.m.Y') . $id, $return, array(\Nette\Caching\Cache::EXPIRE => "+1 day"));
             break;
         case 'pozitri':
             preg_match('#<span id="title-loc">(.*?)</span>#i', $response, $title);
             preg_match('#<div id="predpoved-pozitri".*?<div class="info">\\s*<p>\\s*([^<]+)</p>(.*?)id="predpoved-(.*?)"#i', $response, $r);
             preg_match('#<span class="date">(.*?)</span>#i', $r[0], $date);
             //preg_match( '#atDay.*?temp.*?value">(\d+).*?sup">([^<]+)</span>.*?atNight.*?temp.*?value">(\d+).*?sup">([^<]+)</span>#i', $r[0], $r2 );
             preg_match('#atDay.*?temp.*?value">([-\\d]+).*?sup">([^<]+)</span>.*?atNight.*?temp.*?value">([-\\d]+).*?sup">([^<]+)</span>#i', $r[0], $r2);
             \Tracy\Debugger::$maxLen = 10000;
             $return['data']['datum'] = "{$date[1]}";
             $return['data']['predpoved'] = html_entity_decode($r[1]);
             $return['data']['den'] = html_entity_decode("{$r2[1]}{$r2[2]}");
             $return['data']['noc'] = html_entity_decode("{$r2[3]}{$r2[4]}");
             $return['data']['pro'] = "Pro {$title[1]}";
             $this->cache->save($this->name . $this->action . $mesto . date('d.m.Y') . $id, $return, array(\Nette\Caching\Cache::EXPIRE => "+1 day"));
             break;
         default:
             $id = NULL;
             $dnes = $this->actionPocasi("dnes", $mesto, true);
             $zitra = $this->actionPocasi("zitra", $mesto, true);
             $pozitri = $this->actionPocasi("pozitri", $mesto, true);
             $return['data'] = array('dnes' => $dnes, 'zitra' => $zitra, 'pozitri' => $pozitri);
             $this->cache->save($this->name . $this->action . $mesto . date('d.m.Y') . $id, $return, array(\Nette\Caching\Cache::EXPIRE => "+1 day"));
             break;
     }
     if ($rec === false) {
         $this->sendResponse(new \Nette\Application\Responses\JsonResponse($return, "application/json;charset=utf-8"));
     } else {
         return $return['data'];
     }
 }
Пример #11
0
<?php

if (@(!(include __DIR__ . '/../vendor/autoload.php'))) {
    echo 'Install Nette Tester using `composer update --dev`';
    exit(1);
}
// configure environment
Tester\Environment::setup();
class_alias('Tester\\Assert', 'Assert');
date_default_timezone_set('Europe/Prague');
// create temporary directory
define('TEMP_DIR', __DIR__ . '/../tmp/' . (isset($_SERVER['argv']) ? md5(serialize($_SERVER['argv'])) : getmypid()));
Tester\Helpers::purge(TEMP_DIR);
Tracy\Debugger::$logDirectory = TEMP_DIR;
$_SERVER = array_intersect_key($_SERVER, array_flip(array('PHP_SELF', 'SCRIPT_NAME', 'SERVER_ADDR', 'SERVER_SOFTWARE', 'HTTP_HOST', 'DOCUMENT_ROOT', 'OS', 'argc', 'argv')));
$_SERVER['REQUEST_TIME'] = 1234567890;
$_ENV = $_GET = $_POST = array();
function test(\Closure $function)
{
    $function();
}
Пример #12
0
<?php

return call_user_func(function () : Nette\Configurator {
    return call_user_func(function () : Nette\Configurator {
        Tracy\Debugger::$errorTemplate = __DIR__ . '/maintenance.php';
        if (!($configurator = is_file($local = __DIR__ . '/local.php') ? require $local : NULL) instanceof Nette\Configurator) {
            $configurator = new Nette\Configurator();
        }
        $configurator->addParameters(['appDir' => __DIR__, 'wwwDir' => __DIR__ . '/public', 'composer' => $composer = json_decode(file_get_contents(__DIR__ . '/../composer.json'), TRUE)]);
        $directory = isset($composer['name']) ? implode(DIRECTORY_SEPARATOR, [sys_get_temp_dir(), $composer['name']]) : NULL;
        if ($directory) {
            if (!is_dir($directory)) {
                @mkdir($directory, 0777, TRUE);
            }
            $configurator->enableDebugger($directory);
            $configurator->setTempDirectory($directory);
        }
        $configurator->addConfig(__DIR__ . '/../vendor/config.neon');
        $configurator->addConfig(__DIR__ . '/config.neon');
        if (is_file($local = __DIR__ . '/local.neon')) {
            $configurator->addConfig($local);
        }
        return $configurator;
    }, require __DIR__ . '/../vendor/autoload.php');
});
Пример #13
0
<?php

if (!($loader = (include __DIR__ . '/../../vendor/autoload.php'))) {
    echo 'Install Nette Tester using `composer update --dev`';
    exit(1);
}
$loader->add('LibretteTests', __DIR__ . '/../');
Tracy\Debugger::enable(Tracy\Debugger::DEVELOPMENT, __DIR__ . '/../tmp/');
Tester\Environment::setup();
date_default_timezone_set('Europe/Prague');
define('TEMP_DIR', __DIR__ . '/../tmp/' . (isset($_SERVER['argv']) ? md5(serialize($_SERVER['argv'])) : getmypid()));
Tester\Helpers::purge(TEMP_DIR);
$_SERVER = array_intersect_key($_SERVER, array_flip(array('PHP_SELF', 'SCRIPT_NAME', 'SERVER_ADDR', 'SERVER_SOFTWARE', 'HTTP_HOST', 'DOCUMENT_ROOT', 'OS', 'argc', 'argv')));
$_SERVER['REQUEST_TIME'] = 1234567890;
$_ENV = $_GET = $_POST = array();
function run(Tester\TestCase $testCase)
{
    $testCase->run(isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : NULL);
}
Пример #14
0
#!/usr/bin/env php
<?php 
include __DIR__ . '/../vendor/autoload.php';
\Tracy\Debugger::$maxDepth = 10;
$tester = new \Php2js\Tester\Tester();
$tester->run();
Пример #15
0
<?php

header('Content-Type:text/html;charset=utf-8');
require_once __DIR__ . '/vendor/autoload.php';
Tracy\Debugger::enable(Tracy\Debugger::DETECT, __DIR__ . '/log');
function utf8Url($url)
{
    if (strpos($url, '%') !== FALSE) {
        return $url;
    }
    list($protocol, $rest) = explode('://', $url);
    $parts = explode('/', $rest);
    $parts = array_map('rawurlencode', $parts);
    return $protocol . '://' . implode('/', $parts);
}
function fromZomato($url, $force = FALSE)
{
    $url = utf8Url($url);
    $cachePath = __DIR__ . '/cache/temp-' . date('Y-m-d') . '-' . md5($url) . '.html';
    if (!$force && file_exists($cachePath)) {
        return file_get_contents($cachePath);
    }
    $document = new DOMDocument();
    @$document->loadHTMLFile($url);
    $xpath = new DOMXPath($document);
    $nodes = $xpath->query('//div[contains(concat(" ", normalize-space(@class), " "), " tmi-group ")]');
    $node = $nodes->item(0);
    $content = "";
    if ($nodes->length && $node->ownerDocument) {
        $content = $node->ownerDocument->saveHTML($node);
    }
 public function initialize()
 {
     Doctrine\Common\Annotations\AnnotationRegistry::registerLoader("class_exists");
     date_default_timezone_set('Europe/Prague');
     Nette\Reflection\AnnotationsParser::setCacheStorage($this->getByType("Nette\\Caching\\IStorage"));
     Nette\Reflection\AnnotationsParser::$autoRefresh = FALSE;
     $this->getService('events.manager')->createEvent(array('Nette\\DI\\Container', 'onInitialize'))->dispatch($this);
     Kdyby\Doctrine\Diagnostics\Panel::registerBluescreen($this);
     Tracy\Debugger::getBlueScreen()->collapsePaths[] = '/home/richmond/vhosts/nette-test/sandbox/vendor/kdyby/doctrine/src/Kdyby/Doctrine';
     Tracy\Debugger::getBlueScreen()->collapsePaths[] = '/home/richmond/vhosts/nette-test/sandbox/vendor/doctrine';
     Tracy\Debugger::getBlueScreen()->collapsePaths[] = '/home/richmond/vhosts/nette-test/sandbox/app/../temp/proxies';
 }
Пример #17
0
/**
 * Test initialization and helpers.
 *
 * @author     Petr Bugyík
 * @package    Grido\Tests
 */
if (@(!(include __DIR__ . '/../vendor/autoload.php'))) {
    echo 'Install Nette Tester using `composer update --dev`';
    exit(1);
}
// configure environment
Tester\Environment::setup();
date_default_timezone_set('Europe/Prague');
Tracy\Debugger::$maxDepth = 5;
Tracy\Debugger::$maxLen = 500;
// create temporary directory
define('TEMP_DIR', __DIR__ . '/tmp/' . getmypid());
@mkdir(dirname(TEMP_DIR));
// @ - directory may already exist
Tester\Helpers::purge(TEMP_DIR);
ini_set('session.save_path', TEMP_DIR);
function id($val)
{
    return $val;
}
function before(\Closure $function = NULL)
{
    static $val;
    if (!func_num_args()) {
        return $val ? $val() : NULL;
 /**
  * @return Nette\Security\User
  */
 public function createServiceUser()
 {
     $service = new Nette\Security\User($this->getService('nette.userStorage'), $this->getService('authenticator'));
     Tracy\Debugger::getBar()->addPanel(new Nette\Bridges\SecurityTracy\UserPanel($service));
     return $service;
 }
Пример #19
0
<!DOCTYPE html><link rel="stylesheet" href="data/style.css">

<style> html { background: url(data/arrow.png) no-repeat bottom right; height: 100%; } </style>

<h1>Tracy | dibi</h1>

<p>Dibi can log queries and dump variables to the <a href="http://tracy.nette.org">Tracy</a>.</p>

<?php 
if (@(!(include __DIR__ . '/../vendor/autoload.php'))) {
    die('Install dependencies using `composer install --dev`');
}
// enable Tracy
Tracy\Debugger::enable();
$connection = dibi::connect(array('driver' => 'sqlite3', 'database' => 'data/sample.s3db', 'profiler' => array('run' => TRUE)));
// add panel to debug bar
$panel = new Dibi\Bridges\Tracy\Panel();
$panel->register($connection);
// query will be logged
dibi::query('SELECT 123');
// result set will be dumped
Tracy\Debugger::barDump(dibi::fetchAll('SELECT * FROM customers WHERE customer_id < ?', 38), '[customers]');
Пример #20
0
} elseif (is_dir($view_folder)) {
    if (($_temp = realpath($view_folder)) !== FALSE) {
        $view_folder = $_temp;
    } else {
        $view_folder = strtr(rtrim($view_folder, '/\\'), '/\\', DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR);
    }
} elseif (is_dir(APPPATH . $view_folder . DIRECTORY_SEPARATOR)) {
    $view_folder = APPPATH . strtr(trim($view_folder, '/\\'), '/\\', DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR);
} else {
    header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
    echo 'Your view folder path does not appear to be set correctly. Please open the following file and correct this: ' . SELF;
    exit(3);
    // EXIT_CONFIG
}
define('VIEWPATH', $view_folder . DIRECTORY_SEPARATOR);
/*
 * --------------------------------------------------------------------
 * LOAD THE VENDOR AUTOLOAD FILE
 * --------------------------------------------------------------------
 */
require_once FCPATH . 'vendor/autoload.php';
Tracy\Debugger::enable(Tracy\Debugger::DEVELOPMENT);
Tracy\Debugger::$showBar = False;
/*
 * --------------------------------------------------------------------
 * LOAD THE BOOTSTRAP FILE
 * --------------------------------------------------------------------
 *
 * And away we go...
 */
require_once BASEPATH . 'core/CodeIgniter.php';
 public function initialize()
 {
     date_default_timezone_set('Europe/Prague');
     Nette\Bridges\Framework\TracyBridge::initialize();
     $this->getService('events.manager')->createEvent(array('Nette\\DI\\Container', 'onInitialize'))->dispatch($this);
     Tracy\Debugger::$email = '*****@*****.**';
     Tracy\Debugger::$editor = 'sublime';
     Tracy\Debugger::$browser = 'chromium-browser';
     Tracy\Debugger::$strictMode = TRUE;
     Nette\Caching\Storages\FileStorage::$useDirectories = TRUE;
     $this->getByType("Nette\\Http\\Session")->exists() && $this->getByType("Nette\\Http\\Session")->start();
     header('X-Frame-Options: SAMEORIGIN');
     $this->getService('systemModule.initializer');
     $this->getService('usersModule.initializer');
     $this->getService('securityModule.initializer');
     header('X-Powered-By: Nette Framework');
     header('Content-Type: text/html; charset=utf-8');
     Nette\Utils\SafeStream::register();
     Nette\Reflection\AnnotationsParser::setCacheStorage($this->getByType("Nette\\Caching\\IStorage"));
     Nette\Reflection\AnnotationsParser::$autoRefresh = FALSE;
     Doctrine\Common\Annotations\AnnotationRegistry::registerLoader("class_exists");
     Kdyby\Doctrine\Diagnostics\Panel::registerBluescreen($this);
     Kdyby\Doctrine\Proxy\ProxyAutoloader::create('/home/fuca/Projects/www/sportsclub/tests/tmp/proxies', 'Kdyby\\GeneratedProxy')->register();
     Nette\Diagnostics\Debugger::getBlueScreen()->collapsePaths[] = '/home/fuca/Projects/www/sportsclub/vendor/kdyby/doctrine/src/Kdyby/Doctrine';
     Nette\Diagnostics\Debugger::getBlueScreen()->collapsePaths[] = '/home/fuca/Projects/www/sportsclub/vendor/doctrine';
     Nette\Diagnostics\Debugger::getBlueScreen()->collapsePaths[] = '/home/fuca/Projects/www/sportsclub/tests/tmp/proxies';
     Kdyby\Translation\Diagnostics\Panel::registerBluescreen();
     \Tracy\Debugger::setLogger($this->getService('monolog.adapter'));
 }
Пример #22
0
<?php

require __DIR__ . '/../vendor/autoload.php';
\Tracy\Debugger::$showLocation = TRUE;
function barDump($var, $title = NULL, $options = NULL)
{
    \Tracy\Debugger::barDump($var, $title, $options);
}
$configurator = new Nette\Configurator();
$configurator->setDebugMode('194.228.13.179');
// enable for your remote IP
$configurator->enableDebugger(__DIR__ . '/../log', '*****@*****.**');
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->register();
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config.local.neon');
$container = $configurator->createContainer();
return $container;
Пример #23
0
 /**
  * @return Tracy\ILogger
  */
 public function createServiceTracy__logger()
 {
     $service = Tracy\Debugger::getLogger();
     if (!$service instanceof Tracy\ILogger) {
         throw new Nette\UnexpectedValueException('Unable to create service \'tracy.logger\', value returned by factory is not Tracy\\ILogger type.');
     }
     return $service;
 }
Пример #24
0
function pdump($val)
{
    Tracy\Debugger::$productionMode = false;
    call_user_func_array('dump', func_get_args());
}
    function _lb252a8ca011_content($_b, $_args)
    {
        foreach ($_args as $__k => $__v) {
            ${$__k} = $__v;
        }
        if ($user->isAllowed('adminMenu')) {
            ?>
<div class="box-admin-menu">
    <div class="adminmenu">
        <ul>
            <li>
                <a href="#">Akce s fotogalerií</a>
                <ul>
                    <li><a href="<?php 
            echo Latte\Runtime\Filters::escapeHtml($_control->link("Foto:upload", array($nemovitost->id)), ENT_COMPAT);
            ?>
">Nahrát fotografie</a></li>
                    <li><a href="<?php 
            echo Latte\Runtime\Filters::escapeHtml($_control->link("Foto:nastavHlavniFoto", array($nemovitost->id)), ENT_COMPAT);
            ?>
">Nastavit hlavní foto</a></li>
                    <li><a href="<?php 
            echo Latte\Runtime\Filters::escapeHtml($_control->link("Foto:smazat", array($nemovitost->id)), ENT_COMPAT);
            ?>
">Mazat fotografie</a></li>
                </ul>
            </li>
             <li>
                <a href="#">Akce s PDF soubory</a>
                <ul>
                    <li><a href="<?php 
            echo Latte\Runtime\Filters::escapeHtml($_control->link("File:upload", array($nemovitost->id)), ENT_COMPAT);
            ?>
">Nahrát nové</a></li>
                    <li><a href="<?php 
            echo Latte\Runtime\Filters::escapeHtml($_control->link("File:vypis", array($nemovitost->id)), ENT_COMPAT);
            ?>
">Výpis a správa nahraných souborů</a></li>
                </ul>
            </li>
<?php 
            if ($nemovitost->mod == 1) {
                ?>
            <li>
                <a href="<?php 
                echo Latte\Runtime\Filters::escapeHtml($_control->link("Aukce:vypisHistorieAukce", array($nemovitost->id)), ENT_COMPAT);
                ?>
">Výpis historie aukce</a>
            </li>
<?php 
            }
            ?>
            <li>
                <a href="#">Akce s nemovitostmi</a>
                <ul>
                    <li><a href="<?php 
            echo Latte\Runtime\Filters::escapeHtml($_control->link("upravitNemovitost", array($nemovitost->id)), ENT_COMPAT);
            ?>
">Upravit nemovitost</a></li>
                    <li><a href="<?php 
            echo Latte\Runtime\Filters::escapeHtml($_control->link("smazatNemovitost", array($nemovitost->id)), ENT_COMPAT);
            ?>
">Smazat nemovitost</a></li>
                </ul>
            </li>
        </ul>
    </div>
</div>
<?php 
        }
        if ($user->isAllowed('adminMenu') && $nemovitost->admin_description != '') {
            ?>
<div class="info">
<b>Poznámka administrátora.</b> <?php 
            echo Latte\Runtime\Filters::escapeHtml($nemovitost->admin_description, ENT_NOQUOTES);
            ?>

</div>
<?php 
        }
        Tracy\Debugger::barDump(array('$nemovitost->typ->typ' => $nemovitost->typ->typ), "Template " . str_replace(dirname(dirname($template->getName())), "…", $template->getName()));
        ?>
<div class="box-left">
    <h2>
        <?php 
        echo Latte\Runtime\Filters::escapeHtml($nemovitost->nazev, ENT_NOQUOTES);
        ?>

    </h2>
    <div>
        <h3>ID nemovitosti:</h3>
        <p><?php 
        echo Latte\Runtime\Filters::escapeHtml($nemovitost->idn, ENT_NOQUOTES);
        ?>
</p>
    </div>
    <div>
        <h3>Stav:</h3>
        <p><?php 
        echo Latte\Runtime\Filters::escapeHtml($nemovitost->status, ENT_NOQUOTES);
        ?>
</p>
    </div>
    <div>
        <h3>Adresa nemovitosti:</h3>
        <p><?php 
        echo Latte\Runtime\Filters::escapeHtml($nemovitost->adresa, ENT_NOQUOTES);
        ?>
</p>
    </div>
    <div>
        <h3>Popis nemovitosti:</h3>
        <p><?php 
        echo Latte\Runtime\Filters::escapeHtml($nemovitost->popis, ENT_NOQUOTES);
        ?>
</p>
    </div>
<?php 
        if ($nemovitost->mod < 2) {
            ?>
    <div class="inline">
        <div>
            <h3>Aktuální cena nemovitosti:</h3> 
            <p><?php 
            echo Latte\Runtime\Filters::escapeHtml($template->number($drazba['cena']), ENT_NOQUOTES);
            ?>
 Kč 
<?php 
            if ($status == 3) {
                ?>
                    <?php 
                if ($user->isAllowed('drazba', 'prihodit') && $nemovitost->id == $user->identity->id_nemovitost) {
                    ?>
                    <a class="btn btn-default button" href="<?php 
                    echo Latte\Runtime\Filters::escapeHtml($_control->link("Aukce:prihodit", array($nemovitost->id)), ENT_COMPAT);
                    ?>
">
                        Přihodit
                    </a>
<?php 
                }
            }
            ?>
            </p>               
        </div>
        <div>
            <h3>Poznámka k ceně:</h3> 
            <p><?php 
            echo Latte\Runtime\Filters::escapeHtml($nemovitost->price_description, ENT_NOQUOTES);
            ?>
</p>               
        </div>
        <div>
            <h3>Nejvyšší nabídka od:</h3> 
            <p>
<?php 
            if ($user->isAllowed('zajemce', 'zobrazit') && $drazba['nick'] != null) {
                ?>
                    <a class="ref-profil" href="<?php 
                echo Latte\Runtime\Filters::escapeHtml($_control->link("Uzivatele:vizitka", array($drazba['id'])), ENT_COMPAT);
                ?>
"><?php 
                echo Latte\Runtime\Filters::escapeHtml($drazba['nick'], ENT_NOQUOTES);
                ?>
</a>
<?php 
            } else {
                ?>
                    <?php 
                echo Latte\Runtime\Filters::escapeHtml($drazba['nick'], ENT_NOQUOTES);
                ?>

<?php 
            }
            ?>
            </p>
        </div>
    </div>
    <div class="inline">
        <div>
            <h3>Datum zahájení aukce:</h3> 
            <p><?php 
            echo Latte\Runtime\Filters::escapeHtml($template->date($nemovitost->datum_zacatek, 'j.n.Y'), ENT_NOQUOTES);
            ?>
</p>
        </div>
        <div>
            <h3>Čas zahájení aukce:</h3> 
            <p><?php 
            echo Latte\Runtime\Filters::escapeHtml($template->date($nemovitost->datum_zacatek, 'H:i'), ENT_NOQUOTES);
            ?>
</p>
        </div>
    </div>
    <div class="inline">
        <div>
            <h3>Datum ukončení aukce:</h3> 
            <p><?php 
            echo Latte\Runtime\Filters::escapeHtml($template->date($nemovitost->datum_konec, 'j.n.Y'), ENT_NOQUOTES);
            ?>
</p>
        </div>
        <div>
            <h3>Čas ukončení aukce:</h3> 
            <p><?php 
            echo Latte\Runtime\Filters::escapeHtml($template->date($nemovitost->datum_konec, 'H:i'), ENT_NOQUOTES);
            ?>
</p>
        </div>
    </div>
<?php 
        } else {
            ?>
    <div class="inline">
        <div>
            <h3>Cena nemovitosti:</h3> 
            <p><?php 
            echo Latte\Runtime\Filters::escapeHtml($template->number($nemovitost->pocatecni_cena), ENT_NOQUOTES);
            ?>
 Kč</p>               
        </div>
        <div>
            <h3>Poznámka k ceně:</h3> 
            <p><?php 
            echo Latte\Runtime\Filters::escapeHtml($nemovitost->price_description, ENT_NOQUOTES);
            ?>
</p>               
        </div>
    </div>
<?php 
        }
        ?>
</div>
<div class="box-right">

<?php 
        if (isset($hlavni_fotka->name)) {
            ?>
    <div id="main-photo" class="main-photo" photo-id="0">
                <div>
            <img src="../../images/icons/mix/zoom.png">
            <span>Zobrazit plnou velikost</span>
        </div>
                <img src="../../images/auction/<?php 
            echo Latte\Runtime\Filters::escapeHtml(Latte\Runtime\Filters::safeUrl($hlavni_fotka->id_property), ENT_COMPAT);
            ?>
/<?php 
            echo Latte\Runtime\Filters::escapeHtml(Latte\Runtime\Filters::safeUrl($hlavni_fotka->name), ENT_COMPAT);
            ?>
">
<?php 
        } else {
            ?>
    <div class="main-photo" photo-id="0">
        <img src="../../images/auction/default.jpg">
<?php 
        }
        ?>
    </div>
    <div class="miniatures">
<?php 
        $index = 0;
        $iterations = 0;
        foreach ($fotky as $fotka) {
            ?>
            <span href="../../images/auction/<?php 
            echo Latte\Runtime\Filters::escapeHtml(Latte\Runtime\Filters::safeUrl($fotka->id_property), ENT_COMPAT);
            ?>
/<?php 
            echo Latte\Runtime\Filters::escapeHtml(Latte\Runtime\Filters::safeUrl($fotka->name), ENT_COMPAT);
            ?>
" data-lightbox="photogallery" photo-id="<?php 
            echo Latte\Runtime\Filters::escapeHtml($index++, ENT_COMPAT);
            ?>
">
            	<img src="../../images/auction/<?php 
            echo Latte\Runtime\Filters::escapeHtml(Latte\Runtime\Filters::safeUrl($fotka->id_property), ENT_COMPAT);
            ?>
/<?php 
            echo Latte\Runtime\Filters::escapeHtml(Latte\Runtime\Filters::safeUrl($fotka->name), ENT_COMPAT);
            ?>
">  
            </span>  
<?php 
            $iterations++;
        }
        ?>
    </div>

    <div class="pdfs">
    	<h3>Přiložené PDF soubory:</h3>
<?php 
        ob_start();
        ?>
    	 <ul>
<?php 
        $iterations = 0;
        foreach ($files as $file) {
            ?>
            	<li>
            		<a href="../../files/auction/<?php 
            echo Latte\Runtime\Filters::escapeHtml(Latte\Runtime\Filters::safeUrl($file->id_property), ENT_COMPAT);
            ?>
/<?php 
            echo Latte\Runtime\Filters::escapeHtml(Latte\Runtime\Filters::safeUrl($file->hid_name), ENT_COMPAT);
            ?>
-<?php 
            echo Latte\Runtime\Filters::escapeHtml(Latte\Runtime\Filters::safeUrl($file->timestamp), ENT_COMPAT);
            ?>
.<?php 
            echo Latte\Runtime\Filters::escapeHtml(Latte\Runtime\Filters::safeUrl($file->type), ENT_COMPAT);
            ?>
" target="_blank">
            			<img src="../../images/icons/pdf.jpg" height="18">    
            			<?php 
            echo Latte\Runtime\Filters::escapeHtml($file->name, ENT_NOQUOTES);
            ?>
 (.<?php 
            echo Latte\Runtime\Filters::escapeHtml($file->type, ENT_NOQUOTES);
            ?>
, <?php 
            echo Latte\Runtime\Filters::escapeHtml($file->size, ENT_NOQUOTES);
            ?>
 MB)
            		</a>  
            	</li>
<?php 
            $iterations++;
        }
        ?>
         </ul>
<?php 
        ob_start();
        ?>
        	<span>Nejsou k dispozici, žádné PDF soubory.</span>
<?php 
        if (isset($file)) {
            ob_end_clean();
            ob_end_flush();
        } else {
            $_l->else = ob_get_contents();
            ob_end_clean();
            ob_end_clean();
            echo $_l->else;
        }
        ?>
    </div>

    <div class="contact">
        <h3>Kontaktní osoba:</h3>
        <div>
            <p>
                <?php 
        echo Latte\Runtime\Filters::escapeHtml($nemovitost->uzivatel->jmeno, ENT_NOQUOTES);
        ?>
<br>
            </p>
            <p>
                <a href="mailto:<?php 
        echo Latte\Runtime\Filters::escapeHtml(Latte\Runtime\Filters::safeUrl($nemovitost->uzivatel->email), ENT_COMPAT);
        ?>
">
                    <?php 
        echo Latte\Runtime\Filters::escapeHtml($nemovitost->uzivatel->email, ENT_NOQUOTES);
        ?>

                </a>
            </p>
            <p>
                <a href="tel:<?php 
        echo Latte\Runtime\Filters::escapeHtml(Latte\Runtime\Filters::safeUrl($template->replace($template->strip($nemovitost->uzivatel->telefon), ' ', '')), ENT_COMPAT);
        ?>
">
                    <?php 
        echo Latte\Runtime\Filters::escapeHtml($nemovitost->uzivatel->telefon, ENT_NOQUOTES);
        ?>

                </a>
            </p>
        </div>
    </div>
</div>
<div class="box-bottom">
    <iframe width="100%" height="400" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/place?key=AIzaSyAFNdFUtRnkm7hvikG-jOHUQZGWorUtxOA&q=<?php 
        echo Latte\Runtime\Filters::escapeHtml(Latte\Runtime\Filters::safeUrl($template->replace($template->strip($nemovitost->adresa), ' ', '+')), ENT_COMPAT);
        ?>
">
    </iframe>
</div>
<?php 
    }
Пример #26
0
function dd($var, $depth = 3)
{
    \Tracy\Debugger::$maxDepth = $depth;
    dump($var);
    die;
}
Пример #27
0
<?php

require_once __DIR__ . '/../vendor/autoload.php';
define('LOG_DIR', __DIR__ . '/../log');
define('TEMP_DIR', __DIR__ . '/../temp/cache');
@mkdir(LOG_DIR);
@mkdir(TEMP_DIR);
\Tracy\Debugger::enable(\Tracy\Debugger::DEVELOPMENT, LOG_DIR);
\Tracy\Debugger::$strictMode = true;
?>
<!DOCTYPE html>
<html lang="en" class=" is-copy-enabled is-u2f-enabled">
<head>

	<title>Mesour DataGrid sandbox</title>

	<!-- Latest compiled and minified CSS -->
	<link rel="stylesheet" href="css/bootstrap.min.css">

	<link rel="stylesheet" href="css/bootstrap-datetimepicker.min.css">

	<link rel="stylesheet" href="css/font-awesome.min.css">

	<link rel="stylesheet" href="css/mesour.grid.min.css">

</head>

<body>

<?php 
$time_start = microtime(true);
Пример #28
0
<?php

require __DIR__ . '/../vendor/autoload.php';
$configurator = new Nette\Configurator();
$configurator->setDebugMode(strncmp($_SERVER['REMOTE_ADDR'], '172.20.10.', 10) === 0 || in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']));
$configurator->enableDebugger(__DIR__ . '/../log');
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()->addDirectory(__DIR__)->register();
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config.local.neon');
Tracy\Debugger::setLogger(new Beetle\Tracy\Logger(__DIR__ . '/../log', ['consolePath' => '/srv/http/me/monokl/bugs/bin/console', 'userId' => 2, 'projectId' => 4]));
$container = $configurator->createContainer();
return $container;
Пример #29
0
<!DOCTYPE html><link rel="stylesheet" href="data/style.css">

<h1>Using Extension Methods | dibi</h1>

<?php 
if (@(!(include __DIR__ . '/../vendor/autoload.php'))) {
    die('Install dependencies using `composer install --dev`');
}
Tracy\Debugger::enable();
dibi::connect(array('driver' => 'sqlite3', 'database' => 'data/sample.s3db'));
// using the "prototype" to add custom method to class DibiResult
DibiResult::extensionMethod('fetchShuffle', function (DibiResult $obj) {
    $all = $obj->fetchAll();
    shuffle($all);
    return $all;
});
// fetch complete result set shuffled
$res = dibi::query('SELECT * FROM [customers]');
$all = $res->fetchShuffle();
Tracy\Dumper::dump($all);
Пример #30
0
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">

<?php 
define('SRC_DIR', __DIR__ . '/../src/');
require_once __DIR__ . '/../vendor/autoload.php';
\Tracy\Debugger::enable(\Tracy\Debugger::DEVELOPMENT, __DIR__ . '/log');
\Tracy\Debugger::$strictMode = TRUE;
require_once SRC_DIR . 'Mesour/Icon/IIcon.php';
require_once SRC_DIR . 'Mesour/UI/Icon.php';
?>

<div class="container">
    <hr>

    <h2>Demo - default</h2>

    <div class="jumbotron">
        <?php 
$icon = new \Mesour\UI\Icon();
echo $icon->render();
?>
    </div>

    <hr>

    <h2>Demo - pencil</h2>

    <div class="jumbotron">
        <?php 
$icon = new \Mesour\UI\Icon();