本文整理汇总了PHP中Sintattica\Atk\Core\Tools::atkdebug方法的典型用法代码示例。如果您正苦于以下问题:PHP Tools::atkdebug方法的具体用法?PHP Tools::atkdebug怎么用?PHP Tools::atkdebug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sintattica\Atk\Core\Tools
的用法示例。
在下文中一共展示了Tools::atkdebug方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getConfig
/**
* Get an instance of the columnconfig class.
*
* @param Node $node
* @param string $id
* @param bool $forceNew force new instance?
*
* @return ColumnConfig An instance of the columnconfig class
*/
public static function getConfig($node, $id = null, $forceNew = false)
{
static $s_instances = [];
$sm = SessionManager::getInstance();
if ($id == null) {
$id = $node->atkNodeUri();
}
if (!isset($s_instances[$id]) || $forceNew) {
$cc = new self();
$s_instances[$id] = $cc;
$cc->setNode($node);
$colcfg = $sm != null ? $sm->pageVar('atkcolcfg_' . $id) : null;
if (!is_array($colcfg) || $forceNew) {
// create new
Tools::atkdebug('New colconfig initialising');
$cc->init();
} else {
// inherit old config from session.
Tools::atkdebug('Resuming colconfig from session');
$cc->m_colcfg =& $colcfg;
}
// See if there are any url params which influence this colcfg.
$cc->doUrlCommands();
}
if ($sm != null) {
$sm->pageVar('atkcolcfg_' . $id, $s_instances[$id]->m_colcfg);
}
return $s_instances[$id];
}
示例2: nodeCopy
/**
* Copies a record, based on parameters passed in the url.
*/
public function nodeCopy()
{
Tools::atkdebug('CopyHandler::nodeCopy()');
$recordset = $this->m_node->select($this->m_postvars['atkselector'])->mode('copy')->getAllRows();
$db = $this->m_node->getDb();
if (count($recordset) > 0) {
// allowed to copy record?
if (!$this->allowed($recordset[0])) {
$this->renderAccessDeniedPage();
return;
}
if (!$this->m_node->copyDb($recordset[0])) {
Tools::atkdebug('node::action_copy() -> Error');
$db->rollback();
$location = $this->m_node->feedbackUrl('save', self::ACTION_FAILED, $recordset[0], $db->getErrorMsg());
Tools::atkdebug('node::action_copy() -> Redirect');
$this->m_node->redirect($location);
} else {
$db->commit();
$this->notify('copy', $recordset[0]);
$this->clearCache();
}
}
$this->m_node->redirect();
}
示例3: getInstance
/**
* Get new menu object.
*
* @return Menu class object
*/
public static function getInstance()
{
static $s_instance = null;
if ($s_instance == null) {
Tools::atkdebug('Creating a new menu instance');
$s_instance = new static();
}
return $s_instance;
}
示例4: notify
/**
* Notify the listener of any action on a record.
*
* This method is called by the framework for each action called on a
* node. Depending on the actionfilter passed in the constructor, the
* call is forwarded to the actionPerformed($action, $record) method.
*
* @param string $trigger The trigger being performed
* @param array $record The record on which the trigger is performed
* @param string $mode The mode (add/update)
*
* @return bool Result of operation.
*/
public function notify($trigger, &$record, $mode = null)
{
if (method_exists($this, $trigger)) {
Tools::atkdebug('Call listener ' . get_class($this) . " for trigger {$trigger} on " . $this->m_node->atkNodeUri() . ' (' . $this->m_node->primaryKey($record) . ')');
return $this->{$trigger}($record, $mode);
} else {
return true;
}
}
示例5: tableExist
/**
* check if database table exists.
*
* @return bool
*/
protected function tableExist()
{
if ($this->m_table_exists !== null) {
return $this->m_table_exists;
}
$db = $this->m_node->getDb();
$this->m_table_exists = $db->tableExists($this->m_table);
Tools::atkdebug('tableExists checking table: ' . $this->m_table . ' exists : ' . print_r($this->m_table_exists, true));
return $this->m_table_exists;
}
示例6: select
/**
* Select records using the given criteria.
*
* @param string $selector selector string
* @param string $order order string
* @param array $limit limit array
*
* @return array selected records
*/
public function select($selector = null, $order = null, $limit = null)
{
Tools::atkdebug(get_class($this) . '::select(' . $selector . ')');
if ($order == null) {
$order = $this->getOrder();
}
$params = array('selector' => $selector, 'order' => $order, 'offset' => isset($limit['offset']) ? $limit['offset'] : 0, 'limit' => isset($limit['limit']) ? $limit['limit'] : -1, 'search' => isset($this->m_postvars['atksearch']) ? $this->m_postvars['atksearch'] : null);
$result = $this->findData($params);
Tools::atkdebug('Result ' . get_class($this) . '::select(' . $selector . ') => ' . count($result) . ' row(s)');
return $result;
}
示例7: _bindParams
/**
* Replace the bind parameters in the parsed query with their escaped values.
*
* @param array $params parameters
*
* @return string query
*/
protected function _bindParams($params)
{
$query = $this->_getParsedQuery();
Tools::atkdebug('Binding parameters for query: ' . $this->_getParsedQuery());
foreach (array_values($this->_getBindPositions()) as $i => $param) {
Tools::atkdebug("Bind param {$i}: " . ($params[$param] === null ? 'NULL' : $params[$param]));
}
foreach (array_reverse($this->_getBindPositions(), true) as $position => $param) {
$query = substr($query, 0, $position) . ($params[$param] === null ? 'NULL' : "'" . $this->getDb()->escapeSQL($params[$param]) . "'") . substr($query, $position + 1);
}
return $query;
}
示例8: ipLongFormat
/**
* Converts an ip (in number or string format) to a long number.
*
* The supplied ip must be a valid ip. If the given ip is not
* valid, then atkerror will be called.
*
* @static This function may be used statically
*
* @param mixed $ip String or long numeric IP address.
*
* @return bool True if the ip is valid, False if not.
*/
public static function ipLongFormat($ip)
{
if (!self::ipValidate($ip)) {
Tools::atkdebug('IpUtils::ipLongFormat() Invalid ip given');
return;
}
if (is_numeric($ip)) {
return $ip;
}
$array = explode('.', $ip);
return $array[3] + 256 * $array[2] + 256 * 256 * $array[1] + 256 * 256 * 256 * $array[0];
}
示例9: getCopyRecord
/**
* Get the selected record from.
*
* @return array the record to be copied
*/
protected function getCopyRecord()
{
$selector = $this->m_postvars['atkselector'];
$recordset = $this->m_node->select($selector)->mode('copy')->getAllRows();
if (count($recordset) > 0) {
return $recordset[0];
} else {
Tools::atkdebug("Geen records gevonden met selector: {$selector}");
$this->m_node->redirect();
}
return;
}
示例10: smarty_function_atkmessages
/**
* Implements the {atkmessages} plugin for use in templates.
*
* The {atkmessages} tag does not output anything. Instead, it loads
* the messages into the template variable {$atkmessages}, which is
* an array of elements, each with a single message.
*
* <b>Example:</b>
* <code>
* {atkmessages}
*
* {foreach from=$atkmessages item=message}
* {$message.message}<br>
* {/foreach}
* </code>
*
* @author Patrick van der Velden <patrick@ibuildings.nl>
*/
function smarty_function_atkmessages($params, $smarty)
{
$sessionManager = SessionManager::getInstance();
if (is_object($sessionManager)) {
$msgs = MessageQueue::getMessages();
$smarty->assign('atkmessages', $msgs);
if (empty($msgs)) {
Tools::atkdebug('No messages in MessageQueue');
}
return '';
}
return '';
}
示例11: _bindParams
/**
* Bind statement parameters.
*
* @param array $params parameters
*/
private function _bindParams($params)
{
if (count($params) == 0) {
return;
}
$i = 0;
$args = [];
$args[] = str_repeat('s', count($this->_getBindPositions()));
foreach ($this->_getBindPositions() as $param) {
Tools::atkdebug("Bind param {$i}: " . ($params[$param] === null ? 'NULL' : $params[$param]));
$args[] =& $params[$param];
++$i;
}
call_user_func_array(array($this->m_stmt, 'bind_param'), $args);
}
示例12: zendPlatformAvailable
/**
* Check if Zend Platform is available and good to go.
*
* @return bool
*/
protected function zendPlatformAvailable()
{
if (!function_exists('accelerator_license_info')) {
Tools::atkdebug('Zend Platform was not detected');
return false;
}
if (!function_exists('accelerator_get_configuration')) {
$licenseInfo = accelerator_license_info();
Tools::atkdebug('The Zend Platform extension is not loaded correctly: ' . $licenseInfo['failure_reason']);
return false;
}
if (!function_exists('monitor_custom_event')) {
Tools::atkdebug('Zend Platform seems to be there, but the function \'monitor_custom_event\' could not be found');
return false;
}
return true;
}
示例13: getInstance
/**
* Get the Smarty instance.
*
* @return \Smarty The one and only instance.
*/
public static function getInstance()
{
static $s_smarty = null;
if ($s_smarty == null) {
Tools::atkdebug('Creating Smarty instance');
$tplcompiledir = Config::getGlobal('tplcompiledir');
if (!is_dir($tplcompiledir) && !mkdir($tplcompiledir, 0755, true)) {
Tools::atkerror("Unable to create template compile directory: {$tplcompiledir}");
}
$tplcompiledir = realpath($tplcompiledir);
$s_smarty = new Smarty();
$s_smarty->setTemplateDir(Config::getGlobal('template_dir'));
// name of directory for templates
$s_smarty->autoload_filters = [];
// indicates which filters will be auto-loaded
$s_smarty->setCompileDir($tplcompiledir);
// name of directory for compiled templates
$s_smarty->setForceCompile(Config::getGlobal('tplforcecompile'));
// force templates to compile every time,
$s_smarty->addPluginsDir(__DIR__ . '/plugins');
Tools::atkdebug('Instantiated new Smarty');
}
return $s_smarty;
}
示例14: getCountryOption
/**
* Get Country option, when current language doesn't exists
* it will return the english language.
*
* @param string $iso_code 2 Letter iso code of the country
*
* @return string Country name
*/
public function getCountryOption($iso_code)
{
$lng = Language::getLanguage();
if (!array_key_exists($iso_code, $this->m_country)) {
Tools::atkdebug('UNKNOWN ISO CODE: ' . $iso_code);
}
if (array_key_exists($lng, $this->m_country[$iso_code])) {
return $this->m_country[$iso_code][$lng];
} else {
return $this->m_country[$iso_code]['en'];
}
}
示例15: populate
/**
* Populate the record with the destination record data.
*
* @param array $record record
* @param mixed $fullOrFields load all data, only the given fields or only the descriptor fields?
*/
public function populate(&$record, $fullOrFields = false)
{
if (!is_array($record) || $record[$this->fieldName()] == '') {
return;
}
Tools::atkdebug('Delayed loading of ' . ($fullOrFields || is_array($fullOrFields) ? '' : 'descriptor ') . 'fields for ' . $this->m_name);
$this->createDestination();
$includes = '';
if (is_array($fullOrFields)) {
$includes = array_merge($this->m_destInstance->m_primaryKey, $fullOrFields);
} else {
if (!$fullOrFields) {
$includes = $this->m_destInstance->descriptorFields();
}
}
$result = $this->m_destInstance->select($this->m_destInstance->primaryKey($record[$this->fieldName()]))->orderBy($this->m_destInstance->getColumnConfig()->getOrderByStatement())->includes($includes)->getFirstRow();
if ($result != null) {
$record[$this->fieldName()] = $result;
}
}