Ejemplo n.º 1
0
 public function index()
 {
     $tasks = $this->getTasks();
     // Web mode
     if (!Director::is_cli()) {
         $renderer = new DebugView();
         $renderer->writeHeader();
         $renderer->writeInfo("SilverStripe Development Tools: Tasks", Director::absoluteBaseURL());
         $base = Director::absoluteBaseURL();
         echo "<div class=\"options\">";
         echo "<ul>";
         foreach ($tasks as $task) {
             echo "<li><p>";
             echo "<a href=\"{$base}dev/tasks/" . $task['segment'] . "\">" . $task['title'] . "</a><br />";
             echo "<span class=\"description\">" . $task['description'] . "</span>";
             echo "</p></li>\n";
         }
         echo "</ul></div>";
         $renderer->writeFooter();
         // CLI mode
     } else {
         echo "SILVERSTRIPE DEVELOPMENT TOOLS: Tasks\n--------------------------\n\n";
         foreach ($tasks as $task) {
             echo " * {$task['title']}: sake dev/tasks/" . $task['segment'] . "\n";
         }
     }
 }
 public function init()
 {
     parent::init();
     $renderer = new DebugView();
     $renderer->writeHeader();
     $renderer->writeInfo("SilverStripe Development Tools: Logs", Director::absoluteBaseURL());
 }
Ejemplo n.º 3
0
	function index() {
		$tasks = $this->getTasks();

		// Web mode
		if(!Director::is_cli()) {
			$renderer = new DebugView();
			$renderer->writeHeader();
			$renderer->writeInfo("Sapphire Development Tools: Tasks", Director::absoluteBaseURL());
			$base = Director::baseURL();
			if(strpos($base,-1) != '/') $base .= '/';
			
			echo "<ul>";
			foreach($tasks as $task) {
				echo "<li>";
				echo "<a href=\"{$base}dev/tasks/" . $task['class'] . "\">" . $task['title'] . "</a><br />";
				echo "<span class=\"description\">" . $task['description'] . "</span>";
				echo "</li>\n";
			}
			echo "</ul>";

			$renderer->writeFooter();
		// CLI mode
		} else {
			echo "SAPPHIRE DEVELOPMENT TOOLS: Tasks\n--------------------------\n\n";
			foreach($tasks as $task) {
				echo " * $task: sake dev/tasks/" . $task['class'] . "\n";
			}
		}
	}
Ejemplo n.º 4
0
 function _render($___viewFn, $___dataForView, $loadHelpers = true, $cached = false)
 {
     $out = parent::_render($___viewFn, $___dataForView, $loadHelpers, $cached);
     if (strpos($___viewFn, '/debug_kit/views/elements/') === false) {
         $this->viewpathCtp[] = array($___viewFn);
     }
     return $out;
 }
 public function build($request)
 {
     if (Director::is_cli()) {
         $da = DatabaseAdmin::create();
         return $da->handleRequest($request, $this->model);
     } else {
         $renderer = DebugView::create();
         $renderer->writeHeader();
         $renderer->writeInfo("Environment Builder", Director::absoluteBaseURL());
         echo "<div class=\"build\">";
         $da = DatabaseAdmin::create();
         return $da->handleRequest($request, $this->model);
         echo "</div>";
         $renderer->writeFooter();
     }
 }
 public function index()
 {
     $renderer = DebugView::create();
     $renderer->writeHeader();
     $renderer->writeInfo("Installed Omnipay Payment Gateways", Director::absoluteBaseURL());
     $types = $this->PaymentTypes();
     echo "<table style=\"font-size:12px;\" border=1 cellspacing=0>\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Short Name</td>\n\t\t\t\t\t\t<td>Full name</td>\n\t\t\t\t\t\t<td>Purchase</td>\n\t\t\t\t\t\t<td>Authorize</td>\n\t\t\t\t\t\t<td>CompleteAuthorize</td>\n\t\t\t\t\t\t<td>Capture</td>\n\t\t\t\t\t\t<td>Complete Purchase</td>\n\t\t\t\t\t\t<td>Refund</td>\n\t\t\t\t\t\t<td>Void</td>\n\t\t\t\t\t\t<td>Create Card</td>\n\t\t\t\t\t\t<td>Delete Card</td>\n\t\t\t\t\t\t<td>Update Card</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t<tbody>";
     foreach ($types as $gateway) {
         echo "<tr>" . "<td>" . $gateway->getShortName() . "</td>" . "<td>" . $gateway->getName() . "</td>" . "<td>yes</td>" . "<td>" . ($gateway->supportsAuthorize() ? "yes" : "") . "</td>" . "<td>" . ($gateway->supportsCompleteAuthorize() ? "yes" : "") . "</td>" . "<td>" . ($gateway->supportsCapture() ? "yes" : "") . "</td>" . "<td>" . ($gateway->supportsCompletePurchase() ? "yes" : "") . "</td>" . "<td>" . ($gateway->supportsRefund() ? "yes" : "") . "</td>" . "<td>" . ($gateway->supportsVoid() ? "yes" : "") . "</td>" . "<td>" . ($gateway->supportsCreateCard() ? "yes" : "") . "</td>" . "<td>" . ($gateway->supportsDeleteCard() ? "yes" : "") . "</td>" . "<td>" . ($gateway->supportsUpdateCard() ? "yes" : "") . "</td>" . "</tr>";
         if ($this->request->getVar('defaults')) {
             echo "<tr><td colspan=\"11\">";
             var_dump($gateway->getDefaultParameters());
             echo "</td></tr>";
         }
     }
     echo "</tbody></table>";
     $renderer->writeFooter();
 }
Ejemplo n.º 7
0
 /**
  * Render a user-facing error page, using the default HTML error template
  * rendered by {@link ErrorPage} if it exists. Doesn't use the standard {@link SS_HTTPResponse} class
  * the keep dependencies minimal. 
  * 
  * @uses ErrorPage
  *
  * @param int $statusCode HTTP Status Code (Default: 500)
  * @param string $friendlyErrorMessage User-focused error message. Should not contain code pointers or "tech-speak".
  *    Used in the HTTP Header and ajax responses.
  * @param string $friendlyErrorDetail Detailed user-focused message. Is just used if no {@link ErrorPage} is found
  *    for this specific status code.
  * @return string HTML error message for non-ajax requests, plaintext for ajax-request.
  */
 static function friendlyError($statusCode = 500, $friendlyErrorMessage = null, $friendlyErrorDetail = null)
 {
     if (!$friendlyErrorMessage) {
         $friendlyErrorMessage = self::$friendly_error_header;
     }
     if (!$friendlyErrorDetail) {
         $friendlyErrorDetail = self::$friendly_error_detail;
     }
     if (!headers_sent()) {
         header(sprintf('%s %d %s', $_SERVER['SERVER_PROTOCOL'], $statusCode, strip_tags(str_replace(array("\n", "\r"), '', $friendlyErrorMessage))));
     }
     if (Director::is_ajax()) {
         echo $friendlyErrorMessage;
     } else {
         $errorFilePath = ErrorPage::get_filepath_for_errorcode($statusCode, Translatable::get_current_locale());
         if (file_exists($errorFilePath)) {
             $content = file_get_contents(ASSETS_PATH . "/error-{$statusCode}.html");
             // $BaseURL is left dynamic in error-###.html, so that multi-domain sites don't get broken
             echo str_replace('$BaseURL', Director::absoluteBaseURL(), $content);
         } else {
             $renderer = new DebugView();
             $renderer->writeHeader();
             $renderer->writeInfo("Website Error", $friendlyErrorMessage, $friendlyErrorDetail);
             if (Email::getAdminEmail()) {
                 $mailto = Email::obfuscate(Email::getAdminEmail());
                 $renderer->writeParagraph('Contact an administrator: ' . $mailto . '');
             }
             $renderer->writeFooter();
         }
     }
 }
 public function populate()
 {
     $_REQUEST['showqueries'] = 0;
     set_time_limit(3600);
     $renderer = DebugView::create();
     $renderer->writeHeader();
     $renderer->writeInfo("Orient Environment Builder: Do not run while logged in as a member", Director::absoluteBaseURL());
     echo "<div class=\"build\">";
     $numTestObjects = 100;
     $content .= "<br /><br />Creating {$numTestObjects} test objects.. <br />";
     for ($i = 0; $i < $numTestObjects; $i++) {
         $rand = rand(1, 10);
         $testObj = new TestObject();
         $testObj->Code = 'orient-test-' . $rand;
         $testObj->Title = 'OrientDB Test ' . $rand;
         $testObj->Sort = 1;
         $testObj->write(false, true, true);
         // $content .= "{$testObj->Title} <br />";
     }
     $content .= "Creating inherited object <br />";
     $child = Family_Child::create();
     $child->update(array('Name' => "Name First", 'Title' => 'Child'));
     $result = $child->write();
     $numPosts = 100;
     $content .= "Creating {$numPosts} posts and authors <br />";
     for ($i = 0; $i < $numPosts; $i++) {
         $rand = rand(1, 9);
         $author = new Person();
         $author->Name = "Person {$rand}";
         $id = $author->write();
         $post = new Post();
         $post->Title = "Post Title {$rand}";
         $post->AuthorID = $id;
         $post->write();
     }
     $numArticles = 100;
     $content .= "Creating {$numArticles} articles and at least as many tags <br />";
     for ($i = 0; $i < $numArticles; $i++) {
         $rand = rand(1, 999);
         $article = new Article();
         $article->Title = "Article {$rand}";
         $id = $article->write();
         $range = array(1, 2);
         foreach ($range as $val) {
             $tag = new Tag();
             $tag->Name = "Tag {$val}";
             $tag->write();
             $article->Tags()->add($tag);
         }
     }
     echo $content;
     echo "</div>";
     $renderer->writeFooter();
 }
Ejemplo n.º 9
0
 /**
  * Render a user-facing error page, using the default HTML error template
  * rendered by {@link ErrorPage} if it exists. Doesn't use the standard {@link SS_HTTPResponse} class
  * the keep dependencies minimal.
  *
  * @uses ErrorPage
  *
  * @param int $statusCode HTTP Status Code (Default: 500)
  * @param string $friendlyErrorMessage User-focused error message. Should not contain code pointers
  *                                     or "tech-speak". Used in the HTTP Header and ajax responses.
  * @param string $friendlyErrorDetail Detailed user-focused message. Is just used if no {@link ErrorPage} is found
  *                                    for this specific status code.
  * @return string HTML error message for non-ajax requests, plaintext for ajax-request.
  */
 public static function friendlyError($statusCode = 500, $friendlyErrorMessage = null, $friendlyErrorDetail = null)
 {
     // Ensure the error message complies with the HTTP 1.1 spec
     if (!$friendlyErrorMessage) {
         $friendlyErrorMessage = Config::inst()->get('Debug', 'friendly_error_header');
     }
     $friendlyErrorMessage = strip_tags(str_replace(array("\n", "\r"), '', $friendlyErrorMessage));
     if (!$friendlyErrorDetail) {
         $friendlyErrorDetail = Config::inst()->get('Debug', 'friendly_error_detail');
     }
     if (!headers_sent()) {
         // Allow toggle between legacy behaviour and correctly setting HTTP response code
         // In 4.0 this should be fixed to always set this response code.
         if (Config::inst()->get('Debug', 'friendly_error_httpcode') || !Controller::has_curr()) {
             header($_SERVER['SERVER_PROTOCOL'] . " {$statusCode} {$friendlyErrorMessage}");
         }
     }
     if (Director::is_ajax()) {
         echo $friendlyErrorMessage;
     } else {
         if (!headers_sent()) {
             header('Content-Type: text/html');
         }
         if (class_exists('ErrorPage')) {
             $errorFilePath = ErrorPage::get_filepath_for_errorcode($statusCode, class_exists('Translatable') ? Translatable::get_current_locale() : null);
             if (file_exists($errorFilePath)) {
                 $content = file_get_contents($errorFilePath);
                 // $BaseURL is left dynamic in error-###.html, so that multi-domain sites don't get broken
                 echo str_replace('$BaseURL', Director::absoluteBaseURL(), $content);
             }
         } else {
             $renderer = new DebugView();
             $renderer->writeHeader();
             $renderer->writeInfo("Website Error", $friendlyErrorMessage, $friendlyErrorDetail);
             if (Email::config()->admin_email) {
                 $mailto = Email::obfuscate(Email::config()->admin_email);
                 $renderer->writeParagraph('Contact an administrator: ' . $mailto . '');
             }
             $renderer->writeFooter();
         }
     }
     return false;
 }
Ejemplo n.º 10
0
	function build() {
		$renderer = new DebugView();
		$renderer->writeHeader();
		$renderer->writeInfo("Environment Builder (formerly db/build)", Director::absoluteBaseURL());
		echo "<div style=\"margin: 0 2em\">";

		$da = new DatabaseAdmin();
		$da->build();
		
		echo "</div>";
		$renderer->writeFooter();
	}
<?php

/**
 * @package silverstripe-multisites
 */
if (!ClassInfo::exists('MultiValueField')) {
    $view = new DebugView();
    $link = 'https://github.com/nyeholt/silverstripe-multivaluefield';
    if (!headers_sent()) {
        header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error');
    }
    $view->writeHeader();
    $view->writeInfo('Dependency Error', 'The Multisites module requires the MultiValueField module.');
    $view->writeParagraph("Please install the <a href=\"{$link}\">MultiValueField</a> module.");
    $view->writeFooter();
    exit;
}
if (!defined('MULTISITES_PATH')) {
    define('MULTISITES_PATH', rtrim(basename(dirname(__FILE__))));
}
CMSMenu::remove_menu_item('MultisitesCMSSiteAddController');
CMSMenu::remove_menu_item('MultisitesCMSPageAddController');
LeftAndMain::require_css(MULTISITES_PATH . '/css/MultisitesAdmin.css');
LeftAndMain::require_javascript(MULTISITES_PATH . '/javascript/MultisitesAdmin.js');
SiteTree::set_create_default_pages(false);
// Remove LeftAndMain.AddForm.js - at least until this ticket is resolved
// http://open.silverstripe.org/ticket/7987
Requirements::block(FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.AddForm.js');
SS_Report::add_excluded_reports(array('SideReport_EmptyPages', 'BrokenLinksReport', 'SideReport_RecentlyEdited', 'SideReport_BrokenLinks', 'SideReport_BrokenFiles', 'SideReport_BrokenVirtualPages', 'SideReport_BrokenRedirectorPages'));
Ejemplo n.º 12
0
 /**
  * Render a user-facing error page, using the default HTML error template
  * rendered by {@link ErrorPage} if it exists. Doesn't use the standard {@link HTTPResponse} class
  * the keep dependencies minimal. 
  * 
  * @uses ErrorPage
  *
  * @param int $statusCode HTTP Status Code (Default: 500)
  * @param string $friendlyErrorMessage User-focused error message. Should not contain code pointers or "tech-speak".
  *    Used in the HTTP Header and ajax responses.
  * @param string $friendlyErrorDetail Detailed user-focused message. Is just used if no {@link ErrorPage} is found
  *    for this specific status code.
  * @return string HTML error message for non-ajax requests, plaintext for ajax-request.
  */
 static function friendlyError($statusCode = 500, $friendlyErrorMessage = null, $friendlyErrorDetail = null)
 {
     if (!$friendlyErrorMessage) {
         $friendlyErrorMessage = 'There has been an error';
     }
     if (!$friendlyErrorDetail) {
         $friendlyErrorDetail = 'The website server has not been able to respond to your request.';
     }
     if (!headers_sent()) {
         header($_SERVER['SERVER_PROTOCOL'] . " {$statusCode} {$friendlyErrorMessage}");
     }
     if (Director::is_ajax()) {
         echo $friendlyErrorMessage;
     } else {
         $errorFilePath = ErrorPage::get_filepath_for_errorcode($statusCode, Translatable::get_current_locale());
         if (file_exists($errorFilePath)) {
             echo file_get_contents($errorFilePath);
         } else {
             $renderer = new DebugView();
             $renderer->writeHeader();
             $renderer->writeInfo("Website Error", $friendlyErrorMessage, $friendlyErrorDetail);
             if (Email::getAdminEmail()) {
                 $mailto = Email::obfuscate(Email::getAdminEmail());
                 $renderer->writeParagraph('Contact an administrator: ' . $mailto . '');
             }
             $renderer->writeFooter();
         }
     }
 }
Ejemplo n.º 13
0
 function reset()
 {
     global $databaseConfig;
     $databaseName = $databaseConfig['database'];
     if (Director::is_cli()) {
         echo "\nPlease run dev/reset from your web browser.\n";
     } else {
         $renderer = new DebugView();
         $renderer->writeHeader();
         $renderer->writeInfo('Database reset', 'Completely truncate and rebuild the current database');
         echo '<div style="margin: 0 2em">';
         if (isset($_GET['done'])) {
             echo "<p style=\"color: green\"><b>{$databaseName}</b> has been completely truncated and rebuilt.</p>";
             echo "<p>Note: If you had <i>SS_DEFAULT_ADMIN_USERNAME</i> and <i>SS_DEFAULT_ADMIN_PASSWORD</i>\n\t\t\t\t\t\tdefined in your <b>_ss_environment.php</b> file, a default admin Member record has been created\n\t\t\t\t\t\twith those credentials.</p>";
         } else {
             echo $this->ResetForm()->renderWith('Form');
         }
         echo '</div>';
         $renderer->writeFooter();
     }
 }
 protected function header()
 {
     $renderer = new DebugView();
     $renderer->writeHeader();
     $renderer->writeInfo("SilverStripe Development Tools: Info", Director::absoluteBaseURL());
 }
Ejemplo n.º 15
0
	/**
	 * Render a user-facing error page, using the default HTML error template
	 * rendered by {@link ErrorPage} if it exists. Doesn't use the standard {@link HTTPResponse} class
	 * the keep dependencies minimal. 
	 * 
	 * @uses ErrorPage
	 *
	 * @param int $statusCode HTTP Status Code (Default: 500)
	 * @param string $friendlyErrorMessage User-focused error message. Should not contain code pointers or "tech-speak".
	 *    Used in the HTTP Header and ajax responses.
	 * @param string $friendlyErrorDetail Detailed user-focused message. Is just used if no {@link ErrorPage} is found
	 *    for this specific status code.
	 * @return string HTML error message for non-ajax requests, plaintext for ajax-request.
	 */
	static function friendlyError($statusCode = 500, $friendlyErrorMessage = null, $friendlyErrorDetail = null) {
		if(!$friendlyErrorMessage) $friendlyErrorMessage = 'There has been an error';
		if(!$friendlyErrorDetail) $friendlyErrorDetail = 'The website server has not been able to respond to your request.';

		if(!headers_sent()) header($_SERVER['SERVER_PROTOCOL'] . " $statusCode $friendlyErrorMessage");

		if(Director::is_ajax()) {
			echo $friendlyErrorMessage;
		} else {
			if(file_exists(ASSETS_PATH . "/error-$statusCode.html")) {
				echo file_get_contents(ASSETS_PATH . "/error-$statusCode.html");
			} else {
				$renderer = new DebugView();
				$renderer->writeHeader();
				$renderer->writeInfo("Website Error", $friendlyErrorMessage, $friendlyErrorDetail);
				
				if(Email::getAdminEmail()) {
					$mailto = Email::obfuscate(Email::getAdminEmail());
					$renderer->writeParagraph('Contact an administrator: ' . $mailto . '');
				}

				$renderer->writeFooter();
			}
		}
	}
 public function ActionDeleteCruft($data, $form)
 {
     if (!Director::is_cli()) {
         $renderer = DebugView::create();
         $renderer->writeHeader();
         $renderer->writeInfo("Environment Builder", Director::absoluteBaseURL());
         echo "<div class=\"scrub\">";
     }
     if (!empty($data["DeleteSpec"])) {
         foreach ($data["DeleteSpec"] as $table => $spec) {
             if (!empty($spec["WholeTable"]) && $spec["WholeTable"] === "1") {
                 $this->deleteTable($table);
                 continue;
             }
             if (!empty($spec["Fields"])) {
                 foreach ($spec["Fields"] as $fieldName => $delete) {
                     if ($delete !== "1") {
                         continue;
                     }
                     $this->deleteField($table, $fieldName);
                 }
             }
             if (!empty($spec["Indexes"])) {
                 foreach ($spec["Indexes"] as $indexName => $delete) {
                     if ($delete !== "1") {
                         continue;
                     }
                     $this->deleteIndex($table, $indexName);
                 }
             }
             if (!empty($spec["ManyMany"])) {
                 foreach ($spec["ManyMany"] as $relationship => $manyManySpec) {
                     if (!empty($manyManySpec["Fields"])) {
                         foreach ($manyManySpec["Fields"] as $fieldName => $delete) {
                             if ($delete !== "1") {
                                 continue;
                             }
                             $this->deleteField("{$table}_{$relationship}", $fieldName);
                         }
                     }
                     if (!empty($manyManySpec["Indexes"])) {
                         foreach ($manyManySpec["Indexes"] as $indexName => $delete) {
                             if ($delete !== "1") {
                                 continue;
                             }
                             $this->deleteIndex("{$table}_{$relationship}", $indexName);
                         }
                     }
                 }
             }
         }
     }
     if (!Director::is_cli()) {
         echo "</div>";
         $renderer->writeFooter();
     }
 }
Ejemplo n.º 17
0
 /**
  * Render a user-facing error page, using the default HTML error template
  * rendered by {@link ErrorPage} if it exists. Doesn't use the standard {@link SS_HTTPResponse} class
  * the keep dependencies minimal. 
  * 
  * @uses ErrorPage
  *
  * @param int $statusCode HTTP Status Code (Default: 500)
  * @param string $friendlyErrorMessage User-focused error message. Should not contain code pointers
  *                                     or "tech-speak". Used in the HTTP Header and ajax responses.
  * @param string $friendlyErrorDetail Detailed user-focused message. Is just used if no {@link ErrorPage} is found
  *                                    for this specific status code.
  * @return string HTML error message for non-ajax requests, plaintext for ajax-request.
  */
 public static function friendlyError($statusCode = 500, $friendlyErrorMessage = null, $friendlyErrorDetail = null)
 {
     if (!$friendlyErrorMessage) {
         $friendlyErrorMessage = Config::inst()->get('Debug', 'friendly_error_header');
     }
     if (!$friendlyErrorDetail) {
         $friendlyErrorDetail = Config::inst()->get('Debug', 'friendly_error_detail');
     }
     if (!headers_sent()) {
         $currController = Controller::has_curr() ? Controller::curr() : null;
         // Ensure the error message complies with the HTTP 1.1 spec
         $msg = strip_tags(str_replace(array("\n", "\r"), '', $friendlyErrorMessage));
         if ($currController) {
             $response = $currController->getResponse();
             $response->setStatusCode($statusCode, $msg);
         } else {
             header($_SERVER['SERVER_PROTOCOL'] . " {$statusCode} {$msg}");
         }
     }
     if (Director::is_ajax()) {
         echo $friendlyErrorMessage;
     } else {
         if (class_exists('ErrorPage')) {
             $errorFilePath = ErrorPage::get_filepath_for_errorcode($statusCode, class_exists('Translatable') ? Translatable::get_current_locale() : null);
             if (file_exists($errorFilePath)) {
                 $content = file_get_contents(ASSETS_PATH . "/error-{$statusCode}.html");
                 // $BaseURL is left dynamic in error-###.html, so that multi-domain sites don't get broken
                 echo str_replace('$BaseURL', Director::absoluteBaseURL(), $content);
             }
         } else {
             $renderer = new DebugView();
             $renderer->writeHeader();
             $renderer->writeInfo("Website Error", $friendlyErrorMessage, $friendlyErrorDetail);
             if (Email::config()->admin_email) {
                 $mailto = Email::obfuscate(Email::config()->admin_email);
                 $renderer->writeParagraph('Contact an administrator: ' . $mailto . '');
             }
             $renderer->writeFooter();
         }
     }
     return false;
 }
<?php

/**
 * @package silverstripe-memberprofiles
 */
if (!ClassInfo::exists('Orderable')) {
    $view = new DebugView();
    $link = 'https://github.com/ajshort/silverstripe-orderable';
    if (!headers_sent()) {
        header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error');
    }
    $view->writeHeader();
    $view->writeInfo('Dependency Error', 'The Member Profiles module requires the Orderable module.');
    $view->writeParagraph("Please install the <a href=\"{$link}\">Orderable</a> module.");
    $view->writeFooter();
    exit;
}
Director::addRules(20, array('member-approval' => 'MemberApprovalController'));
Object::add_extension('Member', 'MemberProfileExtension');
Ejemplo n.º 19
0
 /**
  * Build the default data, calling requireDefaultRecords on all
  * DataObject classes
  * Should match the $url_handlers rule:
  *		'build/defaults' => 'buildDefaults',
  */
 function buildDefaults()
 {
     $da = DatabaseAdmin::create();
     if (!Director::is_cli()) {
         $renderer = DebugView::create();
         $renderer->writeHeader();
         $renderer->writeInfo("Defaults Builder", Director::absoluteBaseURL());
         echo "<div style=\"margin: 0 2em\">";
     }
     $da->buildDefaults();
     if (!Director::is_cli()) {
         echo "</div>";
         $renderer->writeFooter();
     }
 }
Ejemplo n.º 20
0
 /**
  * test rendering and ensure that timers are being set.
  *
  * @return void
  */
 public function testRenderTimers()
 {
     $request = new CakeRequest('/posts/index');
     $request->addParams(Router::parse($request->url));
     $request->addPaths(array('webroot' => '/', 'base' => '/', 'here' => '/posts/index'));
     $this->Controller->setRequest($request);
     $this->Controller->viewPath = 'posts';
     $this->Controller->layout = 'default';
     $View = new DebugView($this->Controller, false);
     $View->render('index');
     $result = DebugKitDebugger::getTimers();
     $this->assertEqual(count($result), 4);
     $this->assertTrue(isset($result['viewRender']));
     $this->assertTrue(isset($result['render_default.ctp']));
     $this->assertTrue(isset($result['render_index.ctp']));
     $result = DebugKitDebugger::getMemoryPoints();
     $this->assertTrue(isset($result['View render complete']));
 }
Ejemplo n.º 21
0
    echo DebugView::getExecutionTabPane($i, $request);
    ?>
              <?php 
    echo DebugView::getSessionTabPane($i, $request);
    ?>
              <?php 
    echo DebugView::getQueriesTabPane($i, $request);
    ?>
              <?php 
    echo DebugView::getApiCallsTabPane($i, $request);
    ?>
              <?php 
    echo DebugView::getCacheTabPane($i, $request);
    ?>
              <?php 
    echo DebugView::getLoggingTabPane($i, $request);
    ?>
            </div>
          </div>
          <?php 
}
?>
        </div>
        <script>
        $(function () {
          var classes=[];
          $('#debug-request-<?php 
echo $last;
?>
 a[data-toggle="tab"]').each(function (e) {
            classes.push($(this).attr('class'));
 public function populate()
 {
     $renderer = DebugView::create();
     $renderer->writeHeader();
     $renderer->writeInfo("Orient Environment Builder: Do not run while logged in as a member", Director::absoluteBaseURL());
     echo "<div class=\"build\">";
     $content = 'Creating some test objects.. <br /><br />';
     for ($i = 0; $i < 50; $i++) {
         $rand = rand(1, 10);
         $testObj = new TestObject();
         $testObj->Code = 'orient-test-' . $rand;
         $testObj->Title = 'OrientDB Test ' . $rand;
         $testObj->Sort = 1;
         $testObj->write(false, true, true);
         $content .= "{$testObj->Title} <br />";
     }
     echo $content;
     echo "</div>";
     $renderer->writeFooter();
 }