当前位置: 首页>>代码示例>>PHP>>正文


PHP PerchUtil::output_debug方法代码示例

本文整理汇总了PHP中PerchUtil::output_debug方法的典型用法代码示例。如果您正苦于以下问题:PHP PerchUtil::output_debug方法的具体用法?PHP PerchUtil::output_debug怎么用?PHP PerchUtil::output_debug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PerchUtil的用法示例。


在下文中一共展示了PerchUtil::output_debug方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

        if (PerchUtil::file_extension($file) == 'php') {
            include PerchUtil::file_path(PERCH_CORE . '/update/scripts/' . $file);
        }
    }
}
if (!$errors) {
    echo '<li class="icon success">Successfully updated to version ' . $Perch->version . '.</li>';
    $Settings->set($setting_key, 'done');
}
?>
				</ul>
				<?php 
if (!$errors) {
    echo '<a href="' . PERCH_LOGINPATH . '" class="button">Continue</a>';
} else {
    echo '<p><a href="http://support.grabaperch.com/">Contact us</a> if you are unsure how to resolve these problems, or <a href="' . PERCH_LOGINPATH . '/core/update/?force=accept">accept these errors and continue</a>.</p>';
}
?>

			</div>
		</div>

	</div>
<?php 
if (PERCH_DEBUG) {
    PerchUtil::debug('Queries: ' . PerchDB_MySQL::$queries);
    PerchUtil::output_debug();
}
?>
</body>
</html>
开发者ID:jaredmedley,项目名称:Perch-Core-Files,代码行数:31,代码来源:index.php

示例2: create_with_file


//.........这里部分代码省略.........
         if (is_writable($dir)) {
             // Are we creating a new folder?
             if (!$create_folder) {
                 // Get a new file name
                 $new_file = $this->get_unique_file_name($dir, $file_name, $file_extension);
             }
             $template_dir = PerchUtil::file_path(PERCH_TEMPLATE_PATH . '/pages');
             if (file_exists($template_dir)) {
                 $template_file = PerchUtil::file_path($template_dir . '/' . $Template->templatePath());
                 // Is this referenced or copied?
                 if ($Template->templateReference()) {
                     // Referenced, so write a PHP include
                     $include_path = str_replace(DIRECTORY_SEPARATOR, '/', $this->get_relative_path($template_file, $dir));
                     // If changing, update pattern in PerchPages_Page::move_file(), and account for old-patterned pages.
                     $contents = '<' . '?php include(str_replace(\'/\', DIRECTORY_SEPARATOR, \'' . $include_path . '\')); ?' . '>';
                 } else {
                     // Copied, so grab the template's contents
                     $contents = file_get_contents($template_file);
                 }
                 if ($contents) {
                     // Write the file
                     if (!file_exists($new_file) && file_put_contents($new_file, $contents)) {
                         // Get the new file path
                         if ($create_folder) {
                             $new_url = $pageSection . '/' . $new_dir_name . str_replace($dir, '', $new_file);
                             $data['pageSubpagePath'] = $pageSection . '/' . $new_dir_name;
                         } else {
                             $new_url = $pageSection . str_replace($dir, '', $new_file);
                             $data['pageSubpagePath'] = $pageSection;
                         }
                         $data['pageSubpagePath'] = str_replace('//', '/', $data['pageSubpagePath']);
                         $r = str_replace(DIRECTORY_SEPARATOR, '/', $new_url);
                         $r = str_replace('//', '/', $r);
                         $data['pagePath'] = $r;
                         // Insert into the DB
                         $Page = $this->create($data);
                         if (!is_object($Page)) {
                             PerchUtil::output_debug();
                         }
                         // Set its position in the tree
                         $Page->update_tree_position($parentPageID);
                         // Add to nav groups
                         if ($Template->templateNavGroups() != '') {
                             $Page->update_navgroups(explode(',', $Template->templateNavGroups()));
                         }
                         // Copy page options?
                         if ($Template->optionsPageID() != '0') {
                             $CopyPage = $this->find($Template->optionsPageID());
                             if (is_object($CopyPage)) {
                                 $sql = 'INSERT INTO ' . PERCH_DB_PREFIX . 'content_regions (
                                         pageID,
                                         regionKey,
                                         regionPage,
                                         regionHTML,
                                         regionNew,
                                         regionOrder,
                                         regionTemplate,
                                         regionMultiple,
                                         regionOptions,
                                         regionSearchable,
                                         regionEditRoles
                                     )
                                     SELECT
                                         ' . $this->db->pdb($Page->id()) . ' AS pageID,
                                         regionKey,
                                         ' . $this->db->pdb($r) . ' AS regionPage,
                                         "<!-- Undefined content -->" AS regionHTML,
                                         regionNew,
                                         regionOrder,
                                         regionTemplate,
                                         regionMultiple,
                                         regionOptions,
                                         regionSearchable,
                                         regionEditRoles
                                     FROM ' . PERCH_DB_PREFIX . 'content_regions
                                     WHERE regionPage!=' . $this->db->pdb('*') . ' AND pageID=' . $this->db->pdb((int) $CopyPage->id());
                                 $this->db->execute($sql);
                             }
                         }
                         return $Page;
                     } else {
                         PerchUtil::debug('Could not put file contents.');
                         $this->error_messages[] = 'Could not write contents to file: ' . $new_file;
                     }
                 }
             } else {
                 PerchUtil::debug('Template folder not found: ' . $template_dir);
                 $this->error_messages[] = 'Template folder not found: ' . $template_dir;
             }
         } else {
             PerchUtil::debug('Folder is not writable: ' . $dir);
             $this->error_messages[] = 'Folder is not writable: ' . $dir;
         }
     } else {
         PerchUtil::debug('Template not found.');
         PerchUtil::debug($data);
         $this->error_messages[] = 'Template could not be found.';
     }
     return false;
 }
开发者ID:Bloom-web,项目名称:bloom-web,代码行数:101,代码来源:PerchContent_Pages.class.php


注:本文中的PerchUtil::output_debug方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。