本文整理汇总了PHP中debug::output方法的典型用法代码示例。如果您正苦于以下问题:PHP debug::output方法的具体用法?PHP debug::output怎么用?PHP debug::output使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类debug
的用法示例。
在下文中一共展示了debug::output方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: HarmoniRepositoryManager
/**
* Constructor
* @param array $configuration An array of the configuration options
* nessisary to load this manager. To use the a specific manager store, a
* store data source must be configured as noted in the class of said
* manager store.
* manager.
* @access public
*/
function HarmoniRepositoryManager($configuration = NULL)
{
// Define the type to use as a key for Identifying repositories
$this->repositoryKeyType = new HarmoniType("Repository", "edu.middlebury.harmoni", "Repository", "Nodes with this type are by definition Repositories.");
// Cache any created repositories so that we can pass out references to them.
$this->_createdRepositories = array();
$schemaMgr = Services::getService("SchemaManager");
$ids = Services::getService("Id");
$recordStructureId = $ids->getId("edu.middlebury.harmoni.repository.asset_content");
$recordDesc = "A RecordStructure for the generic content of an asset.";
if (!$schemaMgr->schemaExists($recordStructureId->getIdString())) {
// Create the Schema
$schema = new Schema($recordStructureId->getIdString(), "Repository Asset Content", 1, $recordDesc);
$schema->addField(new SchemaField("Content", "Content", "blob", "The binary content of the Asset"));
$schemaMgr->synchronize($schema);
// The SchemaManager only allows you to use Schemas created by it for use with Records.
$schema = $schemaMgr->getSchemaByID($recordStructureId->getIdString());
debug::output("RecordStructure is being created from Schema with Id: '" . $schema->getID() . "'");
$nullRepositoryId = $ids->getId('null');
$this->_createdRecordStructures[$schema->getID()] = new HarmoniRecordStructure($this, $schema, $nullRepositoryId);
// Add the parts to the schema
// $partStructureType = new Type("Repository", "edu.middlebury.harmoni", "Blob", "");
// $this->_createdRecordStructures[$schema->getID()]->createPartStructure(
// "Content",
// "The binary content of the Asset",
// $partStructureType,
// FALSE,
// FALSE,
// FALSE,
// $ids->getId("edu.middlebury.harmoni.repository.asset_content.Content")
// );
}
}
示例2: __destruct
public function __destruct()
{
$this->values['end'] = date('H:i:s');
$logdb = new log_database();
try {
$logdb->logSMSStatus($this->values);
//throw new dbException('PACKET OVERFLOW',1153);
} catch (dbException $e) {
if ($e->getCode() == 1153) {
//max_allowed_packet
$logf = new log_file('/packet_overflow/');
if ($logf->packet_overflow($this->values)) {
$this->values['log_message'] = "LOG TEXT OVER MySQL max_packet_size, WRITTEN TO " . $logf->path;
$logdb->logSMSStatus($this->values);
} else {
$this->values['log_message'] = "TRIED TO CREATE LOG FILE AND FAILED " . $logf->path;
}
$this->status(CRITICAL);
$logdb->logSMSStatus($this->values);
} else {
debug::output($e->getMessage());
$this->status(WARNING);
}
}
}
示例3: fopen
public static function fopen($path, $mode)
{
self::$path = $path;
if (!(self::$handle = fopen(self::$path, $mode))) {
debug::output('Cannot write to filename: ' . self::$path);
return false;
} else {
return true;
}
}
示例4: getStatus
/**
* Checks the environment and returns a status value. Return value is one of STARTUP_STATUS_* defines.
* @access public
* @return integer
*/
function getStatus()
{
debug::output("ExtensionRequirement - checking to make sure PHP loaded {$this->_extension}.", 7, "StartupCheck");
if (!extension_loaded($this->_extension)) {
$prefix = PHP_SHLIB_SUFFIX == 'dll' ? 'php_' : '';
if (!@dl($prefix . $this->_extension . "." . PHP_SHLIB_SUFFIX)) {
StartupCheck::error(dgettext("polyphony", sprintf("ExtensionRequirement - PHP extension <b>%s</b> is neither loaded nor could we load it dynamically.", $this->_extension)));
return STARTUP_STATUS_ERROR;
}
}
return STARTUP_STATUS_OK;
}
示例5: current
public function current()
{
$this->row_counter++;
$row = fgetcsv($this->fh, $this->row_size, $this->delimiter);
if (!empty($this->header) && !empty($row)) {
if (count($row) == $this->column_count) {
$row = array_combine($this->header, $row);
} else {
debug::output("CSV parser - row count mismatch (line: {$this->row_counter})");
}
}
return $row;
}
示例6: getStatus
/**
* Checks the environment and returns a status value. Return value is one of STARTUP_STATUS_* defines.
* @access public
* @return integer
*/
function getStatus()
{
$harmoniVer = $this->_harmoni->getVersionNumber();
$harmoniVerStr = $this->_harmoni->getVersionStr();
debug::output("HarmoniVersionRequirement - checking to make sure Harmoni (currently {$harmoniVer}) is greater than " . $this->_version, 7, "StartupCheck");
if ($this->_version <= $harmoniVer) {
// everything's OK!
return STARTUP_STATUS_OK;
} else {
// we got trouble
StartupCheck::error(sprintf(dgettext("polyphony", "HarmoniVersionRequirement - program execution could not proceed. I must be running under the Harmoni framework version <i>%s</i> or newer. However, we detected you only have version <i>%s</i> installed."), $this->_versionStr, $harmoniVerStr));
return STARTUP_STATUS_ERROR;
}
}
示例7: execute
/**
* Execute this action.
*
* @return mixed
* @access public
* @since 4/25/05
*/
function execute()
{
$harmoni = Harmoni::instance();
// Set the new language
$langLoc = Services::getService('Lang');
$harmoni->request->startNamespace("polyphony");
$langLoc->setLanguage($harmoni->request->get("language"));
$harmoni->request->endNamespace();
debug::output("Setting the language to " . $harmoni->request->get("polyphony/language"));
debug::output("SESSION: " . printpre($_SESSION, TRUE));
$harmoni->history->goBack("polyphony/language/change");
$null = null;
return $null;
}
示例8: search
function search($strQuery, $context = "none")
{
if ($context != "none") {
$result = $this->xpath->query($strQuery, $context);
} else {
//echo $strQuery."\n";
$result = $this->xpath->query($strQuery);
}
if ($result->length == 0) {
debug::output('Missing XML data for query: \'' . $strQuery . '\'');
return false;
}
return $result;
}
示例9: inputValidation
private function inputValidation($tag)
{
$okay = true;
/*
* Make sure tag is not empty
*/
$okay = parent::checkHasContents($tag);
if ($okay == false) {
return false;
}
debug::output("Validated: Tag ({$tag}) is not empty.");
/*
* Make sure tag is in the correct format
*/
$okay = parent::checkTagFormat($tag);
if ($okay == false) {
return false;
}
debug::output("Validated: Tag ({$tag}) is correctly formatted.");
return true;
}
示例10: database
public function database()
{
$sql = "SELECT clientMessageReference FROM log_outbound_sms WHERE received=false AND status='LIVE' and clientMessageReference = {$this->clientMessageReference} \n";
//
$q = mysql::i()->query($sql);
$r = mysql::i()->fetch_array($q);
$sql = "SELECT * FROM log_http_delivery_status WHERE clientmessagereference = {$this->clientMessageReference} order by http_delivery_status_id asc \n";
$q = mysql::i()->query($sql);
while ($r = mysql::i()->fetch_array($q)) {
$deliveryStatus = $r['received'];
debug::output("{$r['messagestatusgroup']} - {$this->clientMessageReference}");
}
//$deliveryStatus=false; //test
if ($deliveryStatus == true) {
$sql = "UPDATE log_outbound_sms SET received=true WHERE clientMessageReference = {$this->clientMessageReference} \n";
mysql::i()->query($sql);
$fault = false;
} else {
$fault = true;
}
//$fault = true; //test
return $fault;
}
示例11: inputValidation
private function inputValidation($tag)
{
$okay = true;
/*
* Order of validation. Order done to reduce database calls. Check formatting is correct. Then check if activated next.
* This cuts out 2 other DB checks as it must be in the group table if activated.
* Same reason to check group table next, then if logged.
*/
/*
* Make sure tag is in the correct format
*/
$okay = parent::checkTagFormat($tag);
if ($okay == false) {
debug::output("Invalid: " . $this->errors[$tag]);
return false;
}
debug::output("Validated: Tag ({$tag}) is correctly formatted.");
/*
* Make sure tag exists in database (do we need to do this check?)
*/
$okay = $this->checkTagValidityDatabase($tag);
if ($okay == false) {
debug::output("Invalid: " . $this->errors[$tag]);
return false;
}
debug::output("Validated: Tag ({$tag}) exists in database.");
/*
* Make sure tag exists in database
*/
$okay = $this->checkDueForRenew($tag);
if ($okay == false) {
debug::output("Invalid: " . $this->errors[$tag]);
return false;
}
debug::output("Validated: Tag ({$tag}) is due for renewal.");
return true;
}
示例12: deleteField
/**
* Removes the definition for field $id from the Schema.
* @param string $id
* @return void
*/
function deleteField($id)
{
debug::output("Deleting Field: " . $id . "\n " . (isset($this->_fields[$id]) ? 'exists' : "doesn't exist"), DEBUG_SYS5, "DataManager");
$this->_fields[$id]->delete();
}
示例13: _execute
/**
* Executes the given action
* @param string $module
* @param string $action
* @access private
* @return mixed
**/
function _execute($module, $action)
{
debug::output("executing action '{$module}.{$action}'...", DEBUG_SYS5, "ActionHandler");
$_pair = "{$module}.{$action}";
// if we've already executed this action, we're probably stuck
// in an infinite loop. no good!
if (in_array($_pair, $this->_actionsExecuted)) {
throw new HarmoniException("ActionHandler::execute({$_pair}) - could not proceed: \n\t\t\t\t\t\t\t\tit seems we have already executed this action before. \n\t\t\t\t\t\t\t\tAre we in an infinite loop?");
return false;
}
if ($this->requiresRequestToken($module, $action) && !$this->isRequestTokenValid()) {
throw new PermissionDeniedException("Required request token does not match. Cannot Execute this action.");
}
// go through each of the ActionSources and see if they have an action to execute. if so, execute it and stop
// cycling through them (only the first action will be executed).
$executedAction = false;
$result = null;
foreach (array_keys($this->_actionSources) as $sourceID) {
$source = $this->_actionSources[$sourceID];
if ($source->actionExists($module, $action)) {
$result = $source->executeAction($module, $action);
$executedAction = true;
break;
}
}
if (!$executedAction) {
throw new UnknownActionException("ActionHandler::execute({$module}, {$action}) - could not proceed: no action source could find an\n\t\t\t\taction to associate with this module/action pair.");
}
// we've now executed this action -- add it to the array
$this->_actionsExecuted[] = $_pair;
$this->triggerEvent("edu.middlebury.harmoni.actionhandler.action_executed", $this, array("action" => $_pair));
// now that we have our $result, let's check if we should do anything
// else or just return back to our caller.
// if the action that was executing called forward(), execute that action.
// otherwise, check if we have a thread to follow.
if ($this->_forwardToAction) {
$forward = $this->_forwardToAction;
$this->_forwardToAction = false;
return $this->_executePair($forward);
}
if (isset($this->_threads[$_pair])) {
// we have a subsequent action defined...
// if we failed and there's a fail defined
if (!$result && ($failAction = $this->_threads[$_pair][0])) {
return $this->_executePair($failAction);
}
// if we succeeded and there's a success action defined
if ($result && ($successAction = $this->_threads[$_pair][1])) {
return $this->_executePair($successAction);
}
}
// otherwise, just return the darned result
return $result;
// phew!
}
示例14: createId
/**
* Create a new unique identifier.
*
* @return object Id
*
* @throws object IdException An exception with one of the following
* messages defined in org.osid.id.IdException: {@link
* org.osid.id.IdException#OPERATION_FAILED OPERATION_FAILED},
* {@link org.osid.id.IdException#PERMISSION_DENIED
* PERMISSION_DENIED}, {@link
* org.osid.id.IdException#CONFIGURATION_ERROR
* CONFIGURATION_ERROR}, {@link
* org.osid.id.IdException#UNIMPLEMENTED UNIMPLEMENTED}
*
* @access public
*/
function createId()
{
if (isset($this->createId_stmt)) {
$this->createId_stmt->execute();
$newID = $this->harmoni_db->lastInsertId('id', 'id_value');
$this->deleteId_stmt->bindValue(1, $newID);
$this->deleteId_stmt->execute();
} else {
debug::output("Attempting to generate new id.", 20, "IdManager");
$dbHandler = Services::getService("DatabaseManager");
$query = new InsertQuery();
$query->setAutoIncrementColumn("id_value", "id_id_value_seq");
$query->setTable("id");
$query->addRowOfValues(array());
$result = $dbHandler->query($query, $this->_dbIndex);
if ($result->getNumberOfRows() != 1) {
throwError(new Error(IdException::CONFIGURATION_ERROR(), "IdManager", true));
}
$newID = $result->getLastAutoIncrementValue();
// Clear out any values smaller than our last one to keep the table from
// exploding size.
$query = new DeleteQuery();
$query->setTable("id");
$query->setWhere("id_value < '" . $newID . "'");
$result = $dbHandler->query($query, $this->_dbIndex);
}
$newID = $this->_prefix . strval($newID);
debug::output("Successfully created new id '{$newID}'.", DEBUG_SYS5, "IdManager");
$id = new HarmoniId($newID);
// cache the id
// $this->_ids[$newID] = $id;
return $id;
}
示例15: OsidContext
$context = new OsidContext();
$configuration = new ConfigurationProperties();
Services::startManagerAsService("DatabaseManager");
require_once HARMONI . "errorHandler/ErrorHandler.class.php";
$errorHandler = Services::getService("ErrorHandler", true);
$dbHandler = Services::getService("DBHandler", true);
$dbIndex = $dbHandler->addDatabase(new MySQLDatabase("devo", "doboHarmoniTest", "test", "test"));
$dbHandler->pConnect($dbIndex);
$configuration->addProperty('database_index', $dbIndex);
$configuration->addProperty('database_name', $arg0 = "doboHarmoniTest");
unset($arg0);
Services::startManagerAsService("IdManager", $context, $configuration);
$errorHandler->setDebugMode(TRUE);
$test = new GroupTest('Hierarchy Tests');
$test->addTestFile(HARMONI . '/oki2/hierarchy/tests/NodeTestCase.class.php');
$test->addTestFile(HARMONI . '/oki2/hierarchy/tests/HierarchyTestCase.class.php');
$test->addTestFile(HARMONI . '/oki2/hierarchy/tests/HierarchyManagerTestCase.class.php');
$test->attachObserver(new DoboTestHtmlDisplay());
$test->run();
$timer->end();
print "\n<br />Harmoni Load Time: " . $harmonyLoadupTimer->printTime();
print "\n<br />Overall Time: " . $timer->printTime();
print "\n</p>";
$num = $dbHandler->getTotalNumberOfQueries();
debug::output("Total # of queries: " . $num, 1, "DBHandler");
debug::printAll();
unset($dbHandler, $errorHandler, $userError);
unset($num);
// $errorHandler->printErrors(HIGH_DETAIL);
// print "<pre>";
// print_r($errorHandler);