public function testLogTags() { $tfile = $this->createFile(); $this->assertEntriesInFile($tfile, 0); common_log_Dispatcher::singleton()->init(array(array('class' => 'SingleFileAppender', 'threshold' => common_Logger::TRACE_LEVEL, 'file' => $tfile, 'tags' => 'CORRECTTAG'))); common_Logger::singleton()->enable(); common_Logger::t('message'); $this->assertEntriesInFile($tfile, 0); common_Logger::t('message', 'WRONGTAG'); $this->assertEntriesInFile($tfile, 0); common_Logger::t('message', 'CORRECTTAG'); $this->assertEntriesInFile($tfile, 1); common_Logger::t('message', array('WRONGTAG', 'CORRECTTAG')); $this->assertEntriesInFile($tfile, 2); common_Logger::t('message', array('WRONGTAG', 'WRONGTAG2')); $this->assertEntriesInFile($tfile, 2); common_Logger::singleton()->restore(); }
public function run() { common_log_Dispatcher::singleton()->init(array(array('class' => 'UDPAppender', 'host' => '127.0.0.1', 'port' => 5775, 'threshold' => 1))); // load the constants common_ext_ExtensionsManager::singleton()->getExtensionById('taoDelivery'); common_ext_ExtensionsManager::singleton()->getExtensionById('wfEngine'); $deliveryClass = new core_kernel_classes_Class(TAO_DELIVERY_CLASS); foreach ($deliveryClass->getInstances(true) as $delivery) { $this->out('looking for compiled ' . $delivery->getLabel()); $workflow = $delivery->getOnePropertyValue(new core_kernel_classes_Property(self::OLD_DELIVERY_COMPILED)); if (!is_null($workflow) && $workflow instanceof core_kernel_classes_Resource) { $this->out('Compilation found for ' . $delivery->getLabel()); $compiled = $this->buildCompiledDelivery($delivery, $workflow); $delivery->editPropertyValues(new core_kernel_classes_Property(PROPERTY_DELIVERY_ACTIVE_COMPILATION), $compiled); } else { $this->out('No compilation found for ' . $delivery->getLabel()); } $delivery->removePropertyValues(new core_kernel_classes_Property(self::OLD_DELIVERY_COMPILED)); $delivery->removePropertyValues(new core_kernel_classes_Property(self::OLD_DELIVERY_ISCOMPILED)); } }
public function __construct() { parent::__construct(); $this->service = taoUpdate_models_classes_DataMigrationService::singleton(); common_log_Dispatcher::singleton()->init(array(array('class' => 'SingleFileAppender', 'format' => '[%s] %m', 'threshold' => common_Logger::TRACE_LEVEL, 'file' => self::getTemplatePath('update.log')))); }
*/ // -- Install bootstrap $rootDir = dir(dirname(__FILE__) . '/../../'); $root = realpath($rootDir->path) . DIRECTORY_SEPARATOR; define('TAO_INSTALL_PATH', $root); define('GENERIS_PATH', $root . 'generis/'); set_include_path(get_include_path() . PATH_SEPARATOR . $root . PATH_SEPARATOR . GENERIS_PATH); function install_loader($class_name) { foreach (array(TAO_INSTALL_PATH, GENERIS_PATH) as $dir) { $path = str_replace('_', '/', $class_name); $file = 'class.' . basename($path) . '.php'; $filePath = $dir . dirname($path) . '/' . $file; if (file_exists($filePath)) { require_once $filePath; break; } else { $file = 'interface.' . basename($path) . '.php'; $filePath = $dir . dirname($path) . '/' . $file; if (file_exists($filePath)) { require_once $filePath; break; } } } } spl_autoload_register('install_loader'); common_log_Dispatcher::singleton()->init(array(array('class' => 'SingleFileAppender', 'threshold' => common_Logger::TRACE_LEVEL, 'file' => TAO_INSTALL_PATH . 'tao/install/log/install.log'))); require_once $root . 'vendor/autoload.php'; require_once 'tao/helpers/class.Display.php'; require_once 'tao/helpers/class.Uri.php';
/** * Returns the dispatcher * * @return Appender */ private function getDispatcher() { if (is_null($this->dispatcher)) { $this->disable(); $this->dispatcher = common_log_Dispatcher::singleton(); $this->restore(); } return $this->dispatcher; }