本文整理汇总了PHP中debug_print_r函数的典型用法代码示例。如果您正苦于以下问题:PHP debug_print_r函数的具体用法?PHP debug_print_r怎么用?PHP debug_print_r使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了debug_print_r函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _on_execute
/**
* Loads all entries that need to be processed and processes them.
*/
public function _on_execute()
{
$qb = midcom_services_at_entry_dba::new_query_builder();
// (to be) start(ed) AND last touched over two days ago
$qb->add_constraint('start', '<=', time() - 3600 * 24 * 2);
$qb->begin_group('OR');
$qb->add_constraint('host', '=', midcom_connection::get('host'));
$qb->add_constraint('host', '=', 0);
$qb->end_group();
$qb->add_constraint('metadata.revised', '<=', date('Y-m-d H:i:s', time() - 3600 * 24 * 2));
$qb->add_constraint('status', '>=', midcom_services_at_entry_dba::RUNNING);
midcom::get('auth')->request_sudo('midcom.services.at');
$qbret = $qb->execute();
if (empty($qbret)) {
debug_add('Got empty resultset, exiting');
midcom::get('auth')->drop_sudo();
return;
}
foreach ($qbret as $entry) {
debug_add("Deleting dangling entry #{$entry->id}\n", MIDCOM_LOG_INFO);
debug_print_r("Entry #{$entry->id} dump: ", $entry);
$entry->delete();
}
midcom::get('auth')->drop_sudo();
}
示例2: find_links_object_component
/**
* Query all specific component for objects related to given object
*
* See org_openpsa_relatedto_suspect::find_links_object() for details
*/
public static function find_links_object_component($object, $component, $defaults = false)
{
$ret = array();
//Make sure we can load and access the component
if (midcom::get('componentloader')->load_graceful($component)) {
//We could not load the component/interface
debug_add("could not load component {$component}", MIDCOM_LOG_ERROR);
return $ret;
}
$interface = midcom::get('componentloader')->get_interface_class($component);
if (!method_exists($interface, 'org_openpsa_relatedto_find_suspects')) {
//Component does not wish to tell us anything
debug_add("component {$component} does not support querying for suspects", MIDCOM_LOG_INFO);
return $ret;
}
//Get components suspected links
$interface->org_openpsa_relatedto_find_suspects($object, $defaults, $ret);
//Filter out existing links
foreach ($ret as $k => $linkdata) {
if ($guid = $linkdata['link']->check_db(false)) {
//Essentially same link already exists in db, remove from returned values
debug_print_r("found matching link with {$guid} (skipping), our data:", $linkdata['link']);
unset($ret[$k]);
}
}
reset($ret);
return $ret;
}
示例3: _create_product
/**
* DM2 creation callback, binds to the current content topic.
*/
private function _create_product($title, $productgroup)
{
$product = new org_openpsa_products_product_dba();
$product->productGroup = $productgroup;
$product->title = $title;
if (!$product->create()) {
debug_print_r('We operated on this object:', $product);
return null;
}
// Generate URL name
if ($product->code == '') {
$product->code = midcom_helper_misc::generate_urlname_from_string($product->title);
$tries = 0;
$maxtries = 999;
while (!$product->update() && $tries < $maxtries) {
$product->code = midcom_helper_misc::generate_urlname_from_string($product->title);
if ($tries > 0) {
// Append an integer if products with same name exist
$product->code .= sprintf("-%03d", $tries);
}
$tries++;
}
}
$product->parameter('midcom.helper.datamanager2', 'schema_name', $this->_config->get('api_products_schema'));
return $product;
}
示例4: _create_article
/**
* DM2 creation callback, binds to the current content topic.
*/
private function _create_article($title)
{
$author = midcom::get('auth')->user->get_storage();
$article = new midcom_db_article();
$article->topic = $this->_content_topic->id;
$article->title = $title;
//Figure out author
$article->author = $author->id;
if (!$article->create()) {
debug_print_r('We operated on this object:', $article);
return null;
}
// Generate URL name
if ($article->name == '') {
$article->name = midcom_helper_misc::generate_urlname_from_string($article->title);
$tries = 0;
$maxtries = 999;
while (!$article->update() && $tries < $maxtries) {
$article->name = midcom_helper_misc::generate_urlname_from_string($article->title);
if ($tries > 0) {
// Append an integer if articles with same name exist
$article->name .= sprintf("-%03d", $tries);
}
$tries++;
}
}
$article->parameter('midcom.helper.datamanager2', 'schema_name', $this->_config->get('api_metaweblog_schema'));
return $article;
}
示例5: _handler_move
/**
* Handle the moving of a group phase
*
* @param mixed $handler_id The ID of the handler.
* @param Array $args The argument list.
* @param Array &$data The local request data.
*/
public function _handler_move($handler_id, array $args, array &$data)
{
$data['group'] = new midcom_db_group($args[0]);
// Get the prefix
$data['prefix'] = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX);
if (isset($_POST['f_cancel'])) {
return new midcom_response_relocate("__mfa/asgard_midcom.admin.user/group/edit/{$data['group']->guid}/");
}
if (isset($_POST['f_submit'])) {
echo "<pre>\n";
print_r($_POST);
echo "</pre>\n";
$data['group']->owner = (int) $_POST['midcom_admin_user_move_group'];
if ($data['group']->update()) {
midcom::get('uimessages')->add($this->_l10n->get('midcom.admin.user'), midcom::get('i18n')->get_string('updated', 'midcom'));
return new midcom_response_relocate("__mfa/asgard_midcom.admin.user/group/edit/{$data['group']->guid}/");
} else {
debug_add('Failed to update the group, last midcom_connection::get_error_string was ' . midgard_connection::get_error_string(), MIDCOM_LOG_ERROR);
debug_print_r('We operated on this object', $data['group'], MIDCOM_LOG_ERROR);
throw new midcom_error('Failed to update the group, see error level log for details');
}
}
$data['view_title'] = sprintf($this->_l10n->get('move %s'), $data['group']->official);
midcom::get('head')->set_pagetitle($data['view_title']);
$this->_update_breadcrumb($handler_id);
}
示例6: __construct
/**
* Start up the storage manager and bind it to a given MidgardObject.
* The passed object must be a MidCOM DBA object, otherwise the system bails with
* midcom_error. In this case, no automatic conversion is done, as this would
* destroy the reference.
*
* @param midcom_helper_datamanager2_schema $schema The data schema to use for processing.
* @param MidCOMDBAObject $object A reference to the DBA object to user for Data I/O.
*/
public function __construct($schema, $object)
{
parent::__construct($schema);
if (!midcom::get('dbclassloader')->is_mgdschema_object($object)) {
debug_print_r('Object passed:', $object);
throw new midcom_error('The midgard storage backend requires a MidCOM DBA object.');
}
$this->object = $object;
}
示例7: net_nehmer_static_link_dba
/**
* DM2 creation callback, binds to the current content topic.
*/
public function &dm2_create_callback(&$controller)
{
$this->_link = new net_nehmer_static_link_dba();
$this->_link->topic = $this->_topic->id;
if (!$this->_link->create()) {
debug_print_r('We operated on this object:', $this->_link);
throw new midcom_error('Failed to create a new article. Last Midgard error was: ' . midcom_connection::get_error_string());
}
return $this->_link;
}
示例8: midcom_db_group
/**
* DM2 creation callback.
*/
function &dm2_create_callback(&$controller)
{
// Create a new group
$this->_group = new midcom_db_group();
if (!$this->_group->create()) {
debug_print_r('We operated on this object:', $this->_group);
throw new midcom_error('Failed to create a new group. Last Midgard error was: ' . midcom_connection::get_error_string());
}
return $this->_group;
}
示例9: org_openpsa_contacts_person_dba
/**
* This is what Datamanager calls to actually create a person
*/
public function &dm2_create_callback(&$datamanager)
{
$person = new org_openpsa_contacts_person_dba();
if (!$person->create()) {
debug_print_r('We operated on this object:', $person);
throw new midcom_error("Failed to create a new person, cannot continue. Error: " . midcom_connection::get_error_string());
}
$this->_person =& $person;
return $person;
}
示例10: org_openpsa_products_product_group_dba
/**
* DM2 creation callback, binds to the current content topic.
*/
public function &dm2_create_callback(&$controller)
{
$this->_group = new org_openpsa_products_product_group_dba();
$this->_group->up = $this->_request_data['up'];
if (!$this->_group->create()) {
debug_print_r('We operated on this object:', $this->_group);
throw new midcom_error('Failed to create a new product group. Last Midgard error was: ' . midcom_connection::get_error_string());
}
return $this->_group;
}
示例11: org_openpsa_directmarketing_campaign_dba
/**
* DM2 creation callback, binds to the current content topic.
*/
public function &dm2_create_callback(&$controller)
{
$this->_campaign = new org_openpsa_directmarketing_campaign_dba();
$this->_campaign->node = $this->_topic->id;
if (!$this->_campaign->create()) {
debug_print_r('We operated on this object:', $this->_campaign);
throw new midcom_error('Failed to create a new campaign. Last Midgard error was: ' . midcom_connection::get_error_string());
}
return $this->_campaign;
}
示例12: midcom_db_person
/**
* DM2 creation callback, creates a new person and binds it to the selected group.
*
* Assumes Admin Privileges.
*/
public function &dm2_create_callback(&$controller)
{
// Create a new person
$this->_person = new midcom_db_person();
if (!$this->_person->create()) {
debug_print_r('We operated on this object:', $this->_person);
throw new midcom_error('Failed to create a new person. Last Midgard error was: ' . midcom_connection::get_error_string());
}
return $this->_person;
}
示例13: org_openpsa_calendar_event_dba
/**
* DM2 creation callback, binds to the current content topic.
*/
public function &dm2_create_callback(&$controller)
{
$this->_event = new org_openpsa_calendar_event_dba();
$this->_event->up = $this->_root_event->id;
if (!$this->_event->create()) {
debug_print_r('We operated on this object:', $this->_event);
throw new midcom_error('Failed to create a new event. Last Midgard error was: ' . midcom_connection::get_error_string());
}
return $this->_event;
}
示例14: org_openpsa_reports_query_dba
/**
* This is what Datamanager calls to actually create a query
*/
function &dm2_create_callback(&$controller)
{
$query = new org_openpsa_reports_query_dba();
$query->component = $this->_component;
if (!$query->create()) {
debug_print_r('We operated on this object:', $query);
throw new midcom_error("Failed to create a new project. Error: " . midcom_connection::get_error_string());
}
$this->_request_data['query'] = $query;
return $query;
}
示例15: org_openpsa_products_product_dba
/**
* DM2 creation callback, binds to the current content topic.
*/
public function &dm2_create_callback(&$controller)
{
$this->_product = new org_openpsa_products_product_dba();
$this->_request_data['up'] = $controller->formmanager->get_value('productGroup');
$this->_product->productGroup = $this->_request_data['up'];
if (!$this->_product->create()) {
debug_print_r('We operated on this object:', $this->_product);
throw new midcom_error("Failed to create a new product under product group #{$this->_request_data['up']}. Error: " . midcom_connection::get_error_string());
}
return $this->_product;
}