pgfouine-1.2/0000755000175000017500000000000011516212335011563 5ustar acmeacmepgfouine-1.2/tests/0000755000175000017500000000000011516212335012725 5ustar acmeacmepgfouine-1.2/tests/logs/0000755000175000017500000000000011516212335013671 5ustar acmeacmepgfouine-1.2/tests/logs/TestGenericLogReader/0000755000175000017500000000000011516212335017672 5ustar acmeacmepgfouine-1.2/tests/logs/TestGenericLogReader/testReadLogFile.log0000644000175000017500000000002710334504440023407 0ustar acmeacmeline1 line2 line3 line4pgfouine-1.2/tests/logs/TestLogFiles/0000755000175000017500000000000011516212335016235 5ustar acmeacmepgfouine-1.2/tests/logs/TestLogFiles/test_double_duration.log0000644000175000017500000000713211172430455023164 0ustar acmeacme2008 Jan 9 16:16:34 hostname postgres[30059]: [12-1] LOG: duration: 3617.465 ms 2008 Jan 9 16:16:34 hostname postgres[30059]: [13-1] LOG: duration: 3617.465 ms statement: select 2008 Jan 9 16:16:34 hostname postgres[30059]: [13-2] t.tid,t.title,m.name,gn.name,to_char( t.retail_reldate, 'mm-dd-yy' ) as retail_reldate,coalesce(s0c100r0.units,0) as 2008 Jan 9 16:16:34 hostname postgres[30059]: [13-3] w0c100r0units,'NA' as w0c100r0dollars,'NA' as w0c100r0arp,coalesce(s0c1r0.units,0) as w0c1r0units,'NA' as w0c1r0dollars,'NA' as 2008 Jan 9 16:16:34 hostname postgres[30059]: [13-4] w0c1r0arp,coalesce(s0c2r0.units,0) as w0c2r0units,coalesce(s0c2r0.dollars,0) as w0c2r0dollars,arp(s0c2r0.dollars, s0c2r0.units) 2008 Jan 9 16:16:34 hostname postgres[30059]: [13-5] as w0c2r0arp from title t left outer join sublabel sl on t.sublabel_rel = sl.key left outer join label s on sl.lid = s.id left 2008 Jan 9 16:16:34 hostname postgres[30059]: [13-6] outer join label d on s.did = d.id left outer join sale_200601 s0c100r0 on t.tid = s0c100r0.tid and s0c100r0.week = 200601 and 2008 Jan 9 16:16:34 hostname postgres[30059]: [13-7] s0c100r0.channel = 100 and s0c100r0.region = 0 left outer join sale_200601 s0c1r0 on t.tid = s0c1r0.tid and s0c1r0.week = 2008 Jan 9 16:16:34 hostname postgres[30059]: [13-8] 200601 and s0c1r0.channel = 1 and s0c1r0.region = 0 left outer join sale_200601 s0c2r0 on t.tid = s0c2r0.tid and s0c2r0.week = 2008 Jan 9 16:16:34 hostname postgres[30059]: [13-9] 200601 and s0c2r0.channel = 2 and s0c2r0.region = 0 left outer join media m on t.media = m.key left outer join genre_n gn on 2008 Jan 9 16:16:34 hostname postgres[30059]: [13-10] t.genre_n = gn.key where ((((upper(t.title) like '%MATRIX%' or upper(t.artist) like '%MATRIX%') ))) and t.blob in ('L', 'M', 2008 Jan 9 16:16:34 hostname postgres[30059]: [13-11] 'R') and t.source_dvd != 'IN' order by t.title asc limit 100 2008 Jan 9 16:16:34 hostname postgres[30059]: [14-1] LOG: duration: 3.358 ms 2008 Jan 9 16:16:36 hostname postgres[30059]: [15-1] LOG: duration: 1982.460 ms 2008 Jan 9 16:16:36 hostname postgres[30059]: [16-1] LOG: duration: 1982.460 ms statement: select sum(coalesce(s0c100r0.units,0)) as 2008 Jan 9 16:16:36 hostname postgres[30059]: [16-2] w0c100r0units,'' as w0c100r0dollars,'' as w0c100r0arp,sum(coalesce(s0c1r0.units,0)) as w0c1r0units,'' as w0c1r0dollars,'' as 2008 Jan 9 16:16:36 hostname postgres[30059]: [16-3] w0c1r0arp,sum(coalesce(s0c2r0.units,0)) as w0c2r0units,sum(coalesce(s0c2r0.dollars,0)) as w0c2r0dollars,NULL as w0c2r0arp from 2008 Jan 9 16:16:36 hostname postgres[30059]: [16-4] title t left outer join sublabel sl on t.sublabel_rel = sl.key left outer join label s on sl.lid = s.id left outer join label d 2008 Jan 9 16:16:36 hostname postgres[30059]: [16-5] on s.did = d.id left outer join sale_200601 s0c100r0 on t.tid = s0c100r0.tid and s0c100r0.week = 200601 and s0c100r0.channel = 2008 Jan 9 16:16:36 hostname postgres[30059]: [16-6] 100 and s0c100r0.region = 0 left outer join sale_200601 s0c1r0 on t.tid = s0c1r0.tid and s0c1r0.week = 200601 and 2008 Jan 9 16:16:36 hostname postgres[30059]: [16-7] s0c1r0.channel = 1 and s0c1r0.region = 0 left outer join sale_200601 s0c2r0 on t.tid = s0c2r0.tid and s0c2r0.week = 200601 and 2008 Jan 9 16:16:36 hostname postgres[30059]: [16-8] s0c2r0.channel = 2 and s0c2r0.region = 0 where ((((upper(t.title) like '%MATRIX%' or upper(t.artist) like '%MATRIX%') ))) and 2008 Jan 9 16:16:36 hostname postgres[30059]: [16-9] t.blob in ('L', 'M', 'R') and t.source_dvd != 'IN' pgfouine-1.2/tests/logs/TestLogFiles/test_carriage_return.log0000644000175000017500000000366511172431647023174 0ustar acmeacme2008 Jan 9 16:16:34 hostname postgres[30059]: [13-1] LOG: duration: 3617.465 ms statement: 2008 Jan 9 16:16:34 hostname postgres[30059]: [13-2] select 2008 Jan 9 16:16:34 hostname postgres[30059]: [13-3] t.tid,t.title,m.name,gn.name,to_char( t.retail_reldate, 'mm-dd-yy' ) as retail_reldate,coalesce(s0c100r0.units,0) as 2008 Jan 9 16:16:34 hostname postgres[30059]: [13-4] w0c100r0units,'NA' as w0c100r0dollars,'NA' as w0c100r0arp,coalesce(s0c1r0.units,0) as w0c1r0units,'NA' as w0c1r0dollars,'NA' as 2008 Jan 9 16:16:34 hostname postgres[30059]: [13-5] w0c1r0arp,coalesce(s0c2r0.units,0) as w0c2r0units,coalesce(s0c2r0.dollars,0) as w0c2r0dollars,arp(s0c2r0.dollars, s0c2r0.units) 2008 Jan 9 16:16:34 hostname postgres[30059]: [13-6] as w0c2r0arp from title t left outer join sublabel sl on t.sublabel_rel = sl.key left outer join label s on sl.lid = s.id left 2008 Jan 9 16:16:34 hostname postgres[30059]: [13-7] outer join label d on s.did = d.id left outer join sale_200601 s0c100r0 on t.tid = s0c100r0.tid and s0c100r0.week = 200601 and 2008 Jan 9 16:16:34 hostname postgres[30059]: [13-8] s0c100r0.channel = 100 and s0c100r0.region = 0 left outer join sale_200601 s0c1r0 on t.tid = s0c1r0.tid and s0c1r0.week = 2008 Jan 9 16:16:34 hostname postgres[30059]: [13-9] 200601 and s0c1r0.channel = 1 and s0c1r0.region = 0 left outer join sale_200601 s0c2r0 on t.tid = s0c2r0.tid and s0c2r0.week = 2008 Jan 9 16:16:34 hostname postgres[30059]: [13-10] 200601 and s0c2r0.channel = 2 and s0c2r0.region = 0 left outer join media m on t.media = m.key left outer join genre_n gn on 2008 Jan 9 16:16:34 hostname postgres[30059]: [13-11] t.genre_n = gn.key where ((((upper(t.title) like '%MATRIX%' or upper(t.artist) like '%MATRIX%') ))) and t.blob in ('L', 'M', 2008 Jan 9 16:16:34 hostname postgres[30059]: [13-12] 'R') and t.source_dvd != 'IN' order by t.title asc limit 100 2008 Jan 9 16:16:34 hostname postgres[30059]: [14-1] LOG: duration: 3.358 mspgfouine-1.2/tests/TestSlowestQueryList.class.php0000644000175000017500000000271510411317325020727 0ustar acmeacmesetDuration(1.2); $query2 = new QueryLogObject(TEST_USER, TEST_DB, ''); $query2->setDuration(1.5); $query3 = new QueryLogObject(TEST_USER, TEST_DB, ''); $query3->setDuration(1.7); $query4 = new QueryLogObject(TEST_USER, TEST_DB, ''); $query4->setDuration(1.3); $list = new SlowestQueryList(2); $list->addQuery($query1); $queries =& $list->getQueries(); $this->assertEqual(1, count($queries)); $this->assertReference($queries['1.2'][0], $query1); $list->addQuery($query2); $queries =& $list->getQueries(); $this->assertEqual(2, count($queries)); $this->assertReference($queries['1.2'][0], $query1); $this->assertReference($queries['1.5'][0], $query2); $list->addQuery($query3); $queries =& $list->getQueries(); $this->assertEqual(2, count($queries)); $this->assertReference($queries['1.5'][0], $query2); $this->assertReference($queries['1.7'][0], $query3); $list->addQuery($query4); $queries =& $list->getQueries(); $this->assertEqual(2, count($queries)); $this->assertReference($queries['1.5'][0], $query2); $this->assertReference($queries['1.7'][0], $query3); } } ?>pgfouine-1.2/tests/TestSyslogPostgreSQLParser.class.php0000644000175000017500000001017610334504437021774 0ustar acmeacmeparser = new SyslogPostgreSQLParser(); } function testPostgreSQLLineDetection() { $this->assertTrue($this->parser->parse(QUERY_LINE)); $this->assertTrue($this->parser->parse(QUERY_LINE_WITH_DASH_IN_CONNECTION_ID)); $this->assertTrue($this->parser->parse(DURATION_LINE)); $this->assertFalse($this->parser->parse(RANDOM_SYSLOG_LINE)); } function testConnectionId() { $line =& $this->parser->parse(QUERY_LINE_WITH_DASH_IN_CONNECTION_ID); $this->assertEqual('4545', $line->getConnectionId()); } function testCommandNumber() { $line =& $this->parser->parse(QUERY_LINE); $this->assertEqual('2755', $line->getCommandNumber()); } function testCommandNumberWithDash() { $line =& $this->parser->parse(QUERY_LINE_WITH_DASH_IN_CONNECTION_ID); $this->assertEqual('2755', $line->getCommandNumber()); } function testLineNumber() { $line =& $this->parser->parse(QUERY_LINE); $this->assertEqual('1', $line->getLineNumber()); } function testLineNumberWithDash() { $line =& $this->parser->parse(QUERY_LINE_WITH_DASH_IN_CONNECTION_ID); $this->assertEqual('4', $line->getLineNumber()); } function testQueryLineDetection() { $line =& $this->parser->parse(DETECTION_QUERY_LINE_1); $this->assertTrue(is_a($line, 'PostgreSQLQueryStartWithDurationLine')); $line =& $this->parser->parse(DETECTION_QUERY_LINE_2); $this->assertTrue(is_a($line, 'PostgreSQLQueryStartWithDurationLine')); } function testContinuationLineDetection() { $line =& $this->parser->parse(DETECTION_CONTINUATION_LINE); $this->assertTrue(is_a($line, 'PostgreSQLContinuationLine')); } function testStatementLineDetection() { $line =& $this->parser->parse(DETECTION_STATEMENT_LINE); $this->assertTrue(is_a($line, 'PostgreSQLStatementLine')); } function testStatusLineDetection() { $line =& $this->parser->parse(DETECTION_CONNECTION_RECEIVED_LINE); $this->assertTrue(is_a($line, 'PostgreSQLStatusLine')); $line =& $this->parser->parse(DETECTION_CONNECTION_AUTHORIZED_LINE); $this->assertTrue(is_a($line, 'PostgreSQLStatusLine')); } function testErrorLineDetection() { $line =& $this->parser->parse(DETECTION_ERROR_LINE); $this->assertTrue(is_a($line, 'PostgreSQLErrorLine')); } function testDetailLineDetection() { $line =& $this->parser->parse(DETECTION_DETAIL_LINE); $this->assertTrue(is_a($line, 'PostgreSQLDetailLine')); } } ?>pgfouine-1.2/tests/TestCase.class.php0000644000175000017500000000270311174670072016265 0ustar acmeacmeaddTestFile('TestRegExp.class.php'); //$commonTests->addTestFile('TestProfiler.class.php'); $commonTests->addTestFile('TestGenericLogReader.class.php'); $commonTests->addTestFile('TestLogObject.class.php'); $commonTests->addTestFile('TestQueryLogObject.class.php'); $commonTests->addTestFile('TestErrorLogObject.class.php'); $commonTests->addTestFile('TestLogStream.class.php'); $commonTests->addTestFile('TestSlowestQueryList.class.php'); $commonTests->run(new TextReporter()); $postgresqlTests = &new GroupTest('PostgreSQL tests'); $postgresqlTests->addTestFile('TestSyslogPostgreSQLParser.class.php'); $postgresqlTests->addTestFile('TestLogFiles.class.php'); $postgresqlTests->run(new TextReporter()); fclose($stderr); ?>pgfouine-1.2/tests/TestQueryLogObject.class.php0000644000175000017500000001034510466203202020277 0ustar acmeacmeassertEqual(EVENT_QUERY, $query->getEventType()); $this->assertFalse($query->isIgnored()); $query = new QueryLogObject(TEST_CONNECTION_ID, TEST_USER, TEST_DB, TEST_TEXT, true); $this->assertTrue($query->isIgnored()); $this->assertEqual(TEST_TEXT, $query->getText()); $query = new QueryLogObject(TEST_CONNECTION_ID, TEST_USER, TEST_DB, TEST_TEXT, false); $this->assertFalse($query->isIgnored()); } function testSettersAndGetters() { define('TEST_TEXT', 'test text'); define('TEST_DB', 'test_db'); define('TEST_USER', 'test_user'); define('TEST_DURATION', 100); $query = new QueryLogObject(TEST_CONNECTION_ID, TEST_USER, TEST_DB, TEST_TEXT); $query->setDuration(TEST_DURATION); $this->assertEqual(TEST_DURATION, $query->getDuration()); } function testTypeDetection() { $query = new QueryLogObject(TEST_CONNECTION_ID, TEST_USER, TEST_DB, 'select * from mytable'); $this->assertTrue($query->isSelect()); $this->assertFalse($query->isDelete()); $this->assertFalse($query->isInsert()); $this->assertFalse($query->isUpdate()); $query = new QueryLogObject(TEST_CONNECTION_ID, TEST_USER, TEST_DB, 'SELECT * FROM mytable'); $this->assertTrue($query->isSelect()); $this->assertFalse($query->isDelete()); $this->assertFalse($query->isInsert()); $this->assertFalse($query->isUpdate()); $query = new QueryLogObject(TEST_CONNECTION_ID, TEST_USER, TEST_DB, 'delete from mytable'); $this->assertFalse($query->isSelect()); $this->assertTrue($query->isDelete()); $this->assertFalse($query->isInsert()); $this->assertFalse($query->isUpdate()); $query = new QueryLogObject(TEST_CONNECTION_ID, TEST_USER, TEST_DB, 'DELETE FROM mytable'); $this->assertFalse($query->isSelect()); $this->assertTrue($query->isDelete()); $this->assertFalse($query->isInsert()); $this->assertFalse($query->isUpdate()); $query = new QueryLogObject(TEST_CONNECTION_ID, TEST_USER, TEST_DB, 'insert into mytable values(4)'); $this->assertFalse($query->isSelect()); $this->assertFalse($query->isDelete()); $this->assertTrue($query->isInsert()); $this->assertFalse($query->isUpdate()); $query = new QueryLogObject(TEST_CONNECTION_ID, TEST_USER, TEST_DB, 'INSERT INTO mytable VALUES(4)'); $this->assertFalse($query->isSelect()); $this->assertFalse($query->isDelete()); $this->assertTrue($query->isInsert()); $this->assertFalse($query->isUpdate()); $query = new QueryLogObject(TEST_CONNECTION_ID, TEST_USER, TEST_DB, 'update mytable set field=4'); $this->assertFalse($query->isSelect()); $this->assertFalse($query->isDelete()); $this->assertFalse($query->isInsert()); $this->assertTrue($query->isUpdate()); $query = new QueryLogObject(TEST_CONNECTION_ID, TEST_USER, TEST_DB, 'UPDATE mytable SET field=4'); $this->assertFalse($query->isSelect()); $this->assertFalse($query->isDelete()); $this->assertFalse($query->isInsert()); $this->assertTrue($query->isUpdate()); } function testSubQuery() { define('TEST_TEXT1', 'test text 1'); define('TEST_TEXT2', 'test text 2'); define('TEST_TEXT3', 'test text 3'); define('TEST_TEXT4', 'test text 4'); $query = new QueryLogObject(TEST_CONNECTION_ID, TEST_USER, TEST_DB, TEST_TEXT1); $query2 = new QueryLogObject(TEST_CONNECTION_ID, TEST_USER, TEST_DB, TEST_TEXT2); $query3 = new QueryLogObject(TEST_CONNECTION_ID, TEST_USER, TEST_DB, TEST_TEXT3); $query->addSubQuery($query2); $subQueries = $query->getSubQueries(); $this->assertEqual(1, count($subQueries)); $this->assertReference($query2, $subQueries[0]); $query->addSubQuery($query3); $subQueries = $query->getSubQueries(); $this->assertEqual(2, count($subQueries)); $this->assertReference($query2, $subQueries[0]); $this->assertReference($query3, $subQueries[1]); } } ?>pgfouine-1.2/tests/TestLogFiles.class.php0000644000175000017500000002603511172431647017123 0ustar acmeacmesyslogParser = new SyslogPostgreSQLParser(); $this->logStream = new LogStream(); } function getLinesFromFile($fileName) { $filePath = 'logs/TestLogFiles/'.$fileName; if(is_readable($filePath)) { $lines = file($filePath); } else { $lines = array(); } return $lines; } function testDoubleDuration() { $textLines = $this->getLinesFromFile('test_double_duration.log'); $step = 0; foreach($textLines AS $textLine) { $line =& $this->syslogParser->parse($textLine); $logObject =& $this->logStream->append($line); switch($step) { case 0: $this->checkLine($line, 'PostgreSQLDurationLine', '1199891794', '30059', '12', '1', '', '3.617465'); $this->assertFalse($logObject); break; case 1: $this->checkLine($line, 'PostgreSQLQueryStartWithDurationLine', '1199891794', '30059', '13', '1', 'select', '3.617465'); $this->assertFalse($logObject); break; case 2: $this->checkLine($line, 'PostgreSQLContinuationLine', '1199891794', '30059', '13', '2', " t.tid,t.title,m.name,gn.name,to_char( t.retail_reldate, 'mm-dd-yy' ) as retail_reldate,coalesce(s0c100r0.units,0) as", false); $this->assertFalse($logObject); break; case 3: $this->checkLine($line, 'PostgreSQLContinuationLine', '1199891794', '30059', '13', '3', " w0c100r0units,'NA' as w0c100r0dollars,'NA' as w0c100r0arp,coalesce(s0c1r0.units,0) as w0c1r0units,'NA' as w0c1r0dollars,'NA' as", false); $this->assertFalse($logObject); break; case 4: $this->checkLine($line, 'PostgreSQLContinuationLine', '1199891794', '30059', '13', '4', " w0c1r0arp,coalesce(s0c2r0.units,0) as w0c2r0units,coalesce(s0c2r0.dollars,0) as w0c2r0dollars,arp(s0c2r0.dollars, s0c2r0.units)", false); $this->assertFalse($logObject); break; case 5: $this->checkLine($line, 'PostgreSQLContinuationLine', '1199891794', '30059', '13', '5', " as w0c2r0arp from title t left outer join sublabel sl on t.sublabel_rel = sl.key left outer join label s on sl.lid = s.id left", false); $this->assertFalse($logObject); break; case 6: $this->checkLine($line, 'PostgreSQLContinuationLine', '1199891794', '30059', '13', '6', " outer join label d on s.did = d.id left outer join sale_200601 s0c100r0 on t.tid = s0c100r0.tid and s0c100r0.week = 200601 and", false); $this->assertFalse($logObject); break; case 7: $this->checkLine($line, 'PostgreSQLContinuationLine', '1199891794', '30059', '13', '7', " s0c100r0.channel = 100 and s0c100r0.region = 0 left outer join sale_200601 s0c1r0 on t.tid = s0c1r0.tid and s0c1r0.week =", false); $this->assertFalse($logObject); break; case 8: $this->checkLine($line, 'PostgreSQLContinuationLine', '1199891794', '30059', '13', '8', " 200601 and s0c1r0.channel = 1 and s0c1r0.region = 0 left outer join sale_200601 s0c2r0 on t.tid = s0c2r0.tid and s0c2r0.week =", false); $this->assertFalse($logObject); break; case 9: $this->checkLine($line, 'PostgreSQLContinuationLine', '1199891794', '30059', '13', '9', " 200601 and s0c2r0.channel = 2 and s0c2r0.region = 0 left outer join media m on t.media = m.key left outer join genre_n gn on", false); $this->assertFalse($logObject); break; case 10: $this->checkLine($line, 'PostgreSQLContinuationLine', '1199891794', '30059', '13', '10', " t.genre_n = gn.key where ((((upper(t.title) like '%MATRIX%' or upper(t.artist) like '%MATRIX%') ))) and t.blob in ('L', 'M',", false); $this->assertFalse($logObject); break; case 11: $this->checkLine($line, 'PostgreSQLContinuationLine', '1199891794', '30059', '13', '11', " 'R') and t.source_dvd != 'IN' order by t.title asc limit 100", false); $this->assertFalse($logObject); break; case 12: $this->checkLine($line, 'PostgreSQLDurationLine', '1199891794', '30059', '14', '1', '', '0.003358'); $this->checkQueryLogObject($logObject, 'QueryLogObject', 1199891794, 13, "select t.tid,t.title,m.name,gn.name,to_char( t.retail_reldate, 'mm-dd-yy' ) as retail_reldate,coalesce(s0c100r0.units,0) as w0c100r0units,'NA' as w0c100r0dollars,'NA' as w0c100r0arp,coalesce(s0c1r0.units,0) as w0c1r0units,'NA' as w0c1r0dollars,'NA' as w0c1r0arp,coalesce(s0c2r0.units,0) as w0c2r0units,coalesce(s0c2r0.dollars,0) as w0c2r0dollars,arp(s0c2r0.dollars, s0c2r0.units) as w0c2r0arp from title t left outer join sublabel sl on t.sublabel_rel = sl.key left outer join label s on sl.lid = s.id left outer join label d on s.did = d.id left outer join sale_200601 s0c100r0 on t.tid = s0c100r0.tid and s0c100r0.week = 200601 and s0c100r0.channel = 100 and s0c100r0.region = 0 left outer join sale_200601 s0c1r0 on t.tid = s0c1r0.tid and s0c1r0.week = 200601 and s0c1r0.channel = 1 and s0c1r0.region = 0 left outer join sale_200601 s0c2r0 on t.tid = s0c2r0.tid and s0c2r0.week = 200601 and s0c2r0.channel = 2 and s0c2r0.region = 0 left outer join media m on t.media = m.key left outer join genre_n gn on t.genre_n = gn.key where ((((upper(t.title) like '%MATRIX%' or upper(t.artist) like '%MATRIX%') ))) and t.blob in ('L', 'M', 'R') and t.source_dvd != 'IN' order by t.title asc limit 100", '3.617465'); break; case 13: $this->checkLine($line, 'PostgreSQLDurationLine', '1199891796', '30059', '15', '1', '', '1.98246'); $this->checkQueryLogObject($logObject, 'DurationLogObject', 1199891794, 14, false, '0.003358'); break; case 14: $this->checkLine($line, 'PostgreSQLQueryStartWithDurationLine', '1199891796', '30059', '16', '1', 'select sum(coalesce(s0c100r0.units,0)) as', '1.98246'); $this->assertFalse($logObject); break; case 15: $this->checkLine($line, 'PostgreSQLContinuationLine', '1199891796', '30059', '16', '2', " w0c100r0units,'' as w0c100r0dollars,'' as w0c100r0arp,sum(coalesce(s0c1r0.units,0)) as w0c1r0units,'' as w0c1r0dollars,'' as", false); $this->assertFalse($logObject); break; case 16: $this->checkLine($line, 'PostgreSQLContinuationLine', '1199891796', '30059', '16', '3', " w0c1r0arp,sum(coalesce(s0c2r0.units,0)) as w0c2r0units,sum(coalesce(s0c2r0.dollars,0)) as w0c2r0dollars,NULL as w0c2r0arp from", false); $this->assertFalse($logObject); break; case 17: $this->checkLine($line, 'PostgreSQLContinuationLine', '1199891796', '30059', '16', '4', " title t left outer join sublabel sl on t.sublabel_rel = sl.key left outer join label s on sl.lid = s.id left outer join label d", false); $this->assertFalse($logObject); break; case 18: $this->checkLine($line, 'PostgreSQLContinuationLine', '1199891796', '30059', '16', '5', " on s.did = d.id left outer join sale_200601 s0c100r0 on t.tid = s0c100r0.tid and s0c100r0.week = 200601 and s0c100r0.channel =", false); $this->assertFalse($logObject); break; case 19: $this->checkLine($line, 'PostgreSQLContinuationLine', '1199891796', '30059', '16', '6', " 100 and s0c100r0.region = 0 left outer join sale_200601 s0c1r0 on t.tid = s0c1r0.tid and s0c1r0.week = 200601 and", false); $this->assertFalse($logObject); break; case 20: $this->checkLine($line, 'PostgreSQLContinuationLine', '1199891796', '30059', '16', '7', " s0c1r0.channel = 1 and s0c1r0.region = 0 left outer join sale_200601 s0c2r0 on t.tid = s0c2r0.tid and s0c2r0.week = 200601 and", false); $this->assertFalse($logObject); break; case 21: $this->checkLine($line, 'PostgreSQLContinuationLine', '1199891796', '30059', '16', '8', " s0c2r0.channel = 2 and s0c2r0.region = 0 where ((((upper(t.title) like '%MATRIX%' or upper(t.artist) like '%MATRIX%') ))) and", false); $this->assertFalse($logObject); break; case 22: $this->checkLine($line, 'PostgreSQLContinuationLine', '1199891796', '30059', '16', '9', " t.blob in ('L', 'M', 'R') and t.source_dvd != 'IN'", false); $this->assertFalse($logObject); break; default: stderrArray($line); break; } unset($line); unset($logObject); $step ++; } } function testCarriageReturn() { $textLines = $this->getLinesFromFile('test_carriage_return.log'); foreach($textLines AS $textLine) { $line =& $this->syslogParser->parse($textLine); $logObject =& $this->logStream->append($line); } $this->checkQueryLogObject($logObject, 'QueryLogObject', 1199891794, 13, "select t.tid,t.title,m.name,gn.name,to_char( t.retail_reldate, 'mm-dd-yy' ) as retail_reldate,coalesce(s0c100r0.units,0) as w0c100r0units,'NA' as w0c100r0dollars,'NA' as w0c100r0arp,coalesce(s0c1r0.units,0) as w0c1r0units,'NA' as w0c1r0dollars,'NA' as w0c1r0arp,coalesce(s0c2r0.units,0) as w0c2r0units,coalesce(s0c2r0.dollars,0) as w0c2r0dollars,arp(s0c2r0.dollars, s0c2r0.units) as w0c2r0arp from title t left outer join sublabel sl on t.sublabel_rel = sl.key left outer join label s on sl.lid = s.id left outer join label d on s.did = d.id left outer join sale_200601 s0c100r0 on t.tid = s0c100r0.tid and s0c100r0.week = 200601 and s0c100r0.channel = 100 and s0c100r0.region = 0 left outer join sale_200601 s0c1r0 on t.tid = s0c1r0.tid and s0c1r0.week = 200601 and s0c1r0.channel = 1 and s0c1r0.region = 0 left outer join sale_200601 s0c2r0 on t.tid = s0c2r0.tid and s0c2r0.week = 200601 and s0c2r0.channel = 2 and s0c2r0.region = 0 left outer join media m on t.media = m.key left outer join genre_n gn on t.genre_n = gn.key where ((((upper(t.title) like '%MATRIX%' or upper(t.artist) like '%MATRIX%') ))) and t.blob in ('L', 'M', 'R') and t.source_dvd != 'IN' order by t.title asc limit 100", '3.617465'); } function checkLine(& $line, $type, $timestamp, $connectionId, $commandNumber, $lineNumber, $text, $duration, $ignore = false, $database = false, $user = false) { $this->assertIsA($line, $type); $this->assertEqual($timestamp, $line->getTimestamp()); $this->assertEqual($connectionId, $line->getConnectionId()); $this->assertEqual($commandNumber, $line->getCommandNumber()); $this->assertEqual($lineNumber, $line->getLineNumber()); $this->assertEqual($text, $line->getText()); $this->assertEqual(0, bccomp($duration, $line->getDuration())); $this->assertEqual($ignore, $line->isIgnored()); $this->assertEqual($database, $line->getDatabase()); $this->assertEqual($user, $line->getUser()); } function checkQueryLogObject(& $logObject, $type, $timestamp, $commandNumber, $text, $duration, $ignored = false, $database = false, $user = false, $context = false, $subQueries = array()) { $this->assertIsA($logObject, $type); $this->assertEqual($timestamp, $logObject->getTimestamp()); $this->assertEqual($commandNumber, $logObject->getCommandNumber()); $this->assertEqual($text, $logObject->getText()); $this->assertEqual(0, bccomp($duration, $logObject->getDuration())); $this->assertEqual($ignored, $logObject->isIgnored()); $this->assertEqual($database, $logObject->getDatabase()); $this->assertEqual($user, $logObject->getUser()); $this->assertEqual($context, $logObject->getContext()); if($type == 'QueryLogObject') { $this->assertEqual($subQueries, $logObject->getSubQueries()); } } } ?>pgfouine-1.2/tests/TestProfiler.class.php0000644000175000017500000001471010341157520017166 0ustar acmeacmeassertTrue(is_float(getTime(microtime()))); } function testStage() { define('TEST_PROFILER_STAGE', 'stage1'); $profiler = new Profiler(); $profiler->start(); $profiler->startStage(TEST_PROFILER_STAGE); sleep(1); $profiler->endStage(TEST_PROFILER_STAGE); $profiler->end(); $stages = $profiler->getStages(); $this->assertTrue(isset($stages[TEST_PROFILER_STAGE])); $this->assertEqual(1, $stages[TEST_PROFILER_STAGE]['count']); $this->assertTrue($stages[TEST_PROFILER_STAGE]['duration'] > 1); $this->assertTrue($stages[TEST_PROFILER_STAGE]['duration'] < 2); } function testTwoStages() { define('TEST_PROFILER_STAGE_1', 'stage1'); define('TEST_PROFILER_STAGE_2', 'stage2'); $profiler = new Profiler(); $profiler->start(); $profiler->startStage(TEST_PROFILER_STAGE_1); sleep(1); $profiler->endStage(TEST_PROFILER_STAGE_1); $profiler->startStage(TEST_PROFILER_STAGE_2); sleep(1); $profiler->endStage(TEST_PROFILER_STAGE_2); $profiler->end(); $stages = $profiler->getStages(); $this->assertTrue(isset($stages[TEST_PROFILER_STAGE_1])); $this->assertEqual(1, $stages[TEST_PROFILER_STAGE_1]['count']); $this->assertTrue($stages[TEST_PROFILER_STAGE_1]['duration'] > 1); $this->assertTrue($stages[TEST_PROFILER_STAGE_1]['duration'] < 2); $this->assertTrue(isset($stages[TEST_PROFILER_STAGE_2])); $this->assertEqual(1, $stages[TEST_PROFILER_STAGE_2]['count']); $this->assertTrue($stages[TEST_PROFILER_STAGE_2]['duration'] > 1); $this->assertTrue($stages[TEST_PROFILER_STAGE_2]['duration'] < 2); } function testTwoIdenticalStages() { define('TEST_PROFILER_STAGE_1', 'stage1'); $profiler = new Profiler(); $profiler->start(); $profiler->startStage(TEST_PROFILER_STAGE_1); sleep(1); $profiler->endStage(TEST_PROFILER_STAGE_1); $profiler->startStage(TEST_PROFILER_STAGE_1); sleep(1); $profiler->endStage(TEST_PROFILER_STAGE_1); $profiler->end(); $stages = $profiler->getStages(); $this->assertTrue(isset($stages[TEST_PROFILER_STAGE_1])); $this->assertEqual(2, $stages[TEST_PROFILER_STAGE_1]['count']); $this->assertTrue($stages[TEST_PROFILER_STAGE_1]['duration'] > 2); $this->assertTrue($stages[TEST_PROFILER_STAGE_1]['duration'] < 3); } function testInnerStages() { define('TEST_PROFILER_STAGE_1', 'stage1'); define('TEST_PROFILER_STAGE_2', 'stage2'); define('TEST_PROFILER_STAGE_3', 'stage3'); define('TEST_PROFILER_STAGE_4', 'stage4'); $profiler = new Profiler(); $profiler->start(); $profiler->startStage(TEST_PROFILER_STAGE_1); sleep(1); $profiler->startStage(TEST_PROFILER_STAGE_2); sleep(1); $profiler->endStage(TEST_PROFILER_STAGE_2); $profiler->startStage(TEST_PROFILER_STAGE_3); sleep(1); $profiler->startStage(TEST_PROFILER_STAGE_4); sleep(1); $profiler->endStage(TEST_PROFILER_STAGE_4); $profiler->endStage(TEST_PROFILER_STAGE_3); $profiler->startStage(TEST_PROFILER_STAGE_2); sleep(1); $profiler->endStage(TEST_PROFILER_STAGE_2); $profiler->endStage(TEST_PROFILER_STAGE_1); $profiler->startStage(TEST_PROFILER_STAGE_1); sleep(1); $profiler->endStage(TEST_PROFILER_STAGE_1); $profiler->end(); $stages = $profiler->getStages(); $this->assertTrue(isset($stages[TEST_PROFILER_STAGE_1])); $this->assertEqual(2, $stages[TEST_PROFILER_STAGE_1]['count']); $this->assertTrue($stages[TEST_PROFILER_STAGE_1]['duration'] > 6); $this->assertTrue($stages[TEST_PROFILER_STAGE_1]['duration'] < 7); $this->assertTrue(isset($stages[TEST_PROFILER_STAGE_1.'>'.TEST_PROFILER_STAGE_2])); $this->assertEqual(2, $stages[TEST_PROFILER_STAGE_1.'>'.TEST_PROFILER_STAGE_2]['count']); $this->assertTrue($stages[TEST_PROFILER_STAGE_1.'>'.TEST_PROFILER_STAGE_2]['duration'] > 2); $this->assertTrue($stages[TEST_PROFILER_STAGE_1.'>'.TEST_PROFILER_STAGE_2]['duration'] < 3); $this->assertTrue(isset($stages[TEST_PROFILER_STAGE_1.'>'.TEST_PROFILER_STAGE_3])); $this->assertEqual(1, $stages[TEST_PROFILER_STAGE_1.'>'.TEST_PROFILER_STAGE_3]['count']); $this->assertTrue($stages[TEST_PROFILER_STAGE_1.'>'.TEST_PROFILER_STAGE_3]['duration'] > 2); $this->assertTrue($stages[TEST_PROFILER_STAGE_1.'>'.TEST_PROFILER_STAGE_3]['duration'] < 3); $this->assertTrue(isset($stages[TEST_PROFILER_STAGE_1.'>'.TEST_PROFILER_STAGE_3.'>'.TEST_PROFILER_STAGE_4])); $this->assertEqual(1, $stages[TEST_PROFILER_STAGE_1.'>'.TEST_PROFILER_STAGE_3.'>'.TEST_PROFILER_STAGE_4]['count']); $this->assertTrue($stages[TEST_PROFILER_STAGE_1.'>'.TEST_PROFILER_STAGE_3.'>'.TEST_PROFILER_STAGE_4]['duration'] > 1); $this->assertTrue($stages[TEST_PROFILER_STAGE_1.'>'.TEST_PROFILER_STAGE_3.'>'.TEST_PROFILER_STAGE_4]['duration'] < 2); } function testTags() { define('TEST_PROFILER_STAGE_1', 'stage1'); define('TEST_PROFILER_STAGE_2', 'stage2'); define('TEST_PROFILER_STAGE_3', 'stage3'); define('TEST_PROFILER_STAGE_4', 'stage4'); define('TEST_PROFILER_TAG_1', 'tag1'); define('TEST_PROFILER_TAG_2', 'tag2'); $profiler = new Profiler(); $profiler->start(); $profiler->startStage(TEST_PROFILER_STAGE_1); sleep(1); $profiler->startStage(TEST_PROFILER_STAGE_2); sleep(1); $profiler->endStage(TEST_PROFILER_STAGE_2, TEST_PROFILER_TAG_1); $profiler->startStage(TEST_PROFILER_STAGE_3); sleep(1); $profiler->startStage(TEST_PROFILER_STAGE_4); sleep(1); $profiler->endStage(TEST_PROFILER_STAGE_4); $profiler->endStage(TEST_PROFILER_STAGE_3, TEST_PROFILER_TAG_1); $profiler->startStage(TEST_PROFILER_STAGE_2); sleep(1); $profiler->endStage(TEST_PROFILER_STAGE_2, TEST_PROFILER_TAG_2); $profiler->endStage(TEST_PROFILER_STAGE_1); $profiler->startStage(TEST_PROFILER_STAGE_1); sleep(1); $profiler->endStage(TEST_PROFILER_STAGE_1); $profiler->end(); $tags = $profiler->getTags(); $this->assertTrue(isset($tags[TEST_PROFILER_TAG_1])); $this->assertEqual(2, $tags[TEST_PROFILER_TAG_1]['count']); $this->assertTrue($tags[TEST_PROFILER_TAG_1]['duration'] > 3); $this->assertTrue($tags[TEST_PROFILER_TAG_1]['duration'] < 4); $this->assertTrue(isset($tags[TEST_PROFILER_TAG_2])); $this->assertEqual(1, $tags[TEST_PROFILER_TAG_2]['count']); $this->assertTrue($tags[TEST_PROFILER_TAG_2]['duration'] > 1); $this->assertTrue($tags[TEST_PROFILER_TAG_2]['duration'] < 2); } } ?>pgfouine-1.2/tests/simpletest/0000755000175000017500000000000011516212335015116 5ustar acmeacmepgfouine-1.2/tests/simpletest/frames.php0000644000175000017500000005761410334504436017124 0ustar acmeacme_frameset = &$page; $this->_frames = array(); $this->_focus = false; $this->_names = array(); } /** * Adds a parsed page to the frameset. * @param SimplePage $page Frame page. * @param string $name Name of frame in frameset. * @access public */ function addFrame(&$page, $name = false) { $this->_frames[] = &$page; if ($name) { $this->_names[$name] = count($this->_frames) - 1; } } /** * Replaces existing frame with another. If the * frame is nested, then the call is passed down * one level. * @param array $path Path of frame in frameset. * @param SimplePage $page Frame source. * @access public */ function setFrame($path, &$page) { $name = array_shift($path); if (isset($this->_names[$name])) { $index = $this->_names[$name]; } else { $index = $name - 1; } if (count($path) == 0) { $this->_frames[$index] = &$page; return; } $this->_frames[$index]->setFrame($path, $page); } /** * Accessor for current frame focus. Will be * false if no frame has focus. Will have the nested * frame focus if any. * @return array Labels or indexes of nested frames. * @access public */ function getFrameFocus() { if ($this->_focus === false) { return array(); } return array_merge( array($this->_getPublicNameFromIndex($this->_focus)), $this->_frames[$this->_focus]->getFrameFocus()); } /** * Turns an internal array index into the frames list * into a public name, or if none, then a one offset * index. * @param integer $subject Internal index. * @return integer/string Public name. * @access private */ function _getPublicNameFromIndex($subject) { foreach ($this->_names as $name => $index) { if ($subject == $index) { return $name; } } return $subject + 1; } /** * Sets the focus by index. The integer index starts from 1. * If already focused and the target frame also has frames, * then the nested frame will be focused. * @param integer $choice Chosen frame. * @return boolean True if frame exists. * @access public */ function setFrameFocusByIndex($choice) { if (is_integer($this->_focus)) { if ($this->_frames[$this->_focus]->hasFrames()) { return $this->_frames[$this->_focus]->setFrameFocusByIndex($choice); } } if (($choice < 1) || ($choice > count($this->_frames))) { return false; } $this->_focus = $choice - 1; return true; } /** * Sets the focus by name. If already focused and the * target frame also has frames, then the nested frame * will be focused. * @param string $name Chosen frame. * @return boolean True if frame exists. * @access public */ function setFrameFocus($name) { if (is_integer($this->_focus)) { if ($this->_frames[$this->_focus]->hasFrames()) { return $this->_frames[$this->_focus]->setFrameFocus($name); } } if (in_array($name, array_keys($this->_names))) { $this->_focus = $this->_names[$name]; return true; } return false; } /** * Clears the frame focus. * @access public */ function clearFrameFocus() { $this->_focus = false; $this->_clearNestedFramesFocus(); } /** * Clears the frame focus for any nested frames. * @access private */ function _clearNestedFramesFocus() { for ($i = 0; $i < count($this->_frames); $i++) { $this->_frames[$i]->clearFrameFocus(); } } /** * Test for the presence of a frameset. * @return boolean Always true. * @access public */ function hasFrames() { return true; } /** * Accessor for frames information. * @return array/string Recursive hash of frame URL strings. * The key is either a numerical * index or the name attribute. * @access public */ function getFrames() { $report = array(); for ($i = 0; $i < count($this->_frames); $i++) { $report[$this->_getPublicNameFromIndex($i)] = $this->_frames[$i]->getFrames(); } return $report; } /** * Accessor for raw text of either all the pages or * the frame in focus. * @return string Raw unparsed content. * @access public */ function getRaw() { if (is_integer($this->_focus)) { return $this->_frames[$this->_focus]->getRaw(); } $raw = ''; for ($i = 0; $i < count($this->_frames); $i++) { $raw .= $this->_frames[$i]->getRaw(); } return $raw; } /** * Accessor for plain text of either all the pages or * the frame in focus. * @return string Plain text content. * @access public */ function getText() { if (is_integer($this->_focus)) { return $this->_frames[$this->_focus]->getText(); } $raw = ''; for ($i = 0; $i < count($this->_frames); $i++) { $raw .= ' ' . $this->_frames[$i]->getText(); } return trim($raw); } /** * Accessor for last error. * @return string Error from last response. * @access public */ function getTransportError() { if (is_integer($this->_focus)) { return $this->_frames[$this->_focus]->getTransportError(); } return $this->_frameset->getTransportError(); } /** * Request method used to fetch this frame. * @return string GET, POST or HEAD. * @access public */ function getMethod() { if (is_integer($this->_focus)) { return $this->_frames[$this->_focus]->getMethod(); } return $this->_frameset->getMethod(); } /** * Original resource name. * @return SimpleUrl Current url. * @access public */ function getUrl() { if (is_integer($this->_focus)) { $url = $this->_frames[$this->_focus]->getUrl(); $url->setTarget($this->_getPublicNameFromIndex($this->_focus)); } else { $url = $this->_frameset->getUrl(); } return $url; } /** * Original request data. * @return mixed Sent content. * @access public */ function getRequestData() { if (is_integer($this->_focus)) { return $this->_frames[$this->_focus]->getRequestData(); } return $this->_frameset->getRequestData(); } /** * Accessor for current MIME type. * @return string MIME type as string; e.g. 'text/html' * @access public */ function getMimeType() { if (is_integer($this->_focus)) { return $this->_frames[$this->_focus]->getMimeType(); } return $this->_frameset->getMimeType(); } /** * Accessor for last response code. * @return integer Last HTTP response code received. * @access public */ function getResponseCode() { if (is_integer($this->_focus)) { return $this->_frames[$this->_focus]->getResponseCode(); } return $this->_frameset->getResponseCode(); } /** * Accessor for last Authentication type. Only valid * straight after a challenge (401). * @return string Description of challenge type. * @access public */ function getAuthentication() { if (is_integer($this->_focus)) { return $this->_frames[$this->_focus]->getAuthentication(); } return $this->_frameset->getAuthentication(); } /** * Accessor for last Authentication realm. Only valid * straight after a challenge (401). * @return string Name of security realm. * @access public */ function getRealm() { if (is_integer($this->_focus)) { return $this->_frames[$this->_focus]->getRealm(); } return $this->_frameset->getRealm(); } /** * Accessor for outgoing header information. * @return string Header block. * @access public */ function getRequest() { if (is_integer($this->_focus)) { return $this->_frames[$this->_focus]->getRequest(); } return $this->_frameset->getRequest(); } /** * Accessor for raw header information. * @return string Header block. * @access public */ function getHeaders() { if (is_integer($this->_focus)) { return $this->_frames[$this->_focus]->getHeaders(); } return $this->_frameset->getHeaders(); } /** * Accessor for parsed title. * @return string Title or false if no title is present. * @access public */ function getTitle() { return $this->_frameset->getTitle(); } /** * Accessor for a list of all fixed links. * @return array List of urls with scheme of * http or https and hostname. * @access public */ function getAbsoluteUrls() { if (is_integer($this->_focus)) { return $this->_frames[$this->_focus]->getAbsoluteUrls(); } $urls = array(); foreach ($this->_frames as $frame) { $urls = array_merge($urls, $frame->getAbsoluteUrls()); } return array_values(array_unique($urls)); } /** * Accessor for a list of all relative links. * @return array List of urls without hostname. * @access public */ function getRelativeUrls() { if (is_integer($this->_focus)) { return $this->_frames[$this->_focus]->getRelativeUrls(); } $urls = array(); foreach ($this->_frames as $frame) { $urls = array_merge($urls, $frame->getRelativeUrls()); } return array_values(array_unique($urls)); } /** * Accessor for URLs by the link label. Label will match * regardess of whitespace issues and case. * @param string $label Text of link. * @return array List of links with that label. * @access public */ function getUrlsByLabel($label) { if (is_integer($this->_focus)) { return $this->_tagUrlsWithFrame( $this->_frames[$this->_focus]->getUrlsByLabel($label), $this->_focus); } $urls = array(); foreach ($this->_frames as $index => $frame) { $urls = array_merge( $urls, $this->_tagUrlsWithFrame( $frame->getUrlsByLabel($label), $index)); } return $urls; } /** * Accessor for a URL by the id attribute. If in a frameset * then the first link found with that ID attribute is * returned only. Focus on a frame if you want one from * a specific part of the frameset. * @param string $id Id attribute of link. * @return string URL with that id. * @access public */ function getUrlById($id) { foreach ($this->_frames as $index => $frame) { if ($url = $frame->getUrlById($id)) { if (! $url->gettarget()) { $url->setTarget($this->_getPublicNameFromIndex($index)); } return $url; } } return false; } /** * Attaches the intended frame index to a list of URLs. * @param array $urls List of SimpleUrls. * @param string $frame Name of frame or index. * @return array List of tagged URLs. * @access private */ function _tagUrlsWithFrame($urls, $frame) { $tagged = array(); foreach ($urls as $url) { if (! $url->getTarget()) { $url->setTarget($this->_getPublicNameFromIndex($frame)); } $tagged[] = $url; } return $tagged; } /** * Finds a held form by button label. Will only * search correctly built forms. The first form found * either within the focused frame, or across frames, * will be the one returned. * @param string $label Button label, default 'Submit'. * @return SimpleForm Form object containing the button. * @access public */ function &getFormBySubmitLabel($label) { return $this->_findForm('getFormBySubmitLabel', $label); } /** * Finds a held form by button label. Will only * search correctly built forms. The first form found * either within the focused frame, or across frames, * will be the one returned. * @param string $name Button name attribute. * @return SimpleForm Form object containing the button. * @access public */ function &getFormBySubmitName($name) { return $this->_findForm('getFormBySubmitName', $name); } /** * Finds a held form by button id. Will only * search correctly built forms. The first form found * either within the focused frame, or across frames, * will be the one returned. * @param string $id Button ID attribute. * @return SimpleForm Form object containing the button. * @access public */ function &getFormBySubmitId($id) { return $this->_findForm('getFormBySubmitId', $id); } /** * Finds a held form by image label. Will only * search correctly built forms. The first form found * either within the focused frame, or across frames, * will be the one returned. * @param string $label Usually the alt attribute. * @return SimpleForm Form object containing the image. * @access public */ function &getFormByImageLabel($label) { return $this->_findForm('getFormByImageLabel', $label); } /** * Finds a held form by image button id. Will only * search correctly built forms. The first form found * either within the focused frame, or across frames, * will be the one returned. * @param string $name Image name. * @return SimpleForm Form object containing the image. * @access public */ function &getFormByImageName($name) { return $this->_findForm('getFormByImageName', $name); } /** * Finds a held form by image button id. Will only * search correctly built forms. The first form found * either within the focused frame, or across frames, * will be the one returned. * @param string $id Image ID attribute. * @return SimpleForm Form object containing the image. * @access public */ function &getFormByImageId($id) { return $this->_findForm('getFormByImageId', $id); } /** * Finds a held form by the form ID. A way of * identifying a specific form when we have control * of the HTML code. The first form found * either within the focused frame, or across frames, * will be the one returned. * @param string $id Form label. * @return SimpleForm Form object containing the matching ID. * @access public */ function &getFormById($id) { return $this->_findForm('getFormById', $id); } /** * General form finder. Will search all the frames or * just the one in focus. * @param string $method Method to use to find in a page. * @param string $attribute Label, name or ID. * @return SimpleForm Form object containing the matching ID. * @access private */ function &_findForm($method, $attribute) { if (is_integer($this->_focus)) { return $this->_findFormInFrame( $this->_frames[$this->_focus], $this->_focus, $method, $attribute); } for ($i = 0; $i < count($this->_frames); $i++) { $form = &$this->_findFormInFrame( $this->_frames[$i], $i, $method, $attribute); if ($form) { return $form; } } return null; } /** * Finds a form in a page using a form finding method. Will * also tag the form with the frame name it belongs in. * @param SimplePage $page Page content of frame. * @param integer $index Internal frame representation. * @param string $method Method to use to find in a page. * @param string $attribute Label, name or ID. * @return SimpleForm Form object containing the matching ID. * @access private */ function &_findFormInFrame(&$page, $index, $method, $attribute) { $form = &$this->_frames[$index]->$method($attribute); if (isset($form)) { $form->setDefaultTarget($this->_getPublicNameFromIndex($index)); } return $form; } /** * Sets a field on each form in which the field is * available. * @param string $name Field name. * @param string $value Value to set field to. * @return boolean True if value is valid. * @access public */ function setField($name, $value) { if (is_integer($this->_focus)) { $this->_frames[$this->_focus]->setField($name, $value); } else { for ($i = 0; $i < count($this->_frames); $i++) { $this->_frames[$i]->setField($name, $value); } } } /** * Sets a field on the form in which the unique field is * available. * @param string/integer $id Field ID attribute. * @param string $value Value to set field to. * @return boolean True if value is valid. * @access public */ function setFieldById($id, $value) { if (is_integer($this->_focus)) { $this->_frames[$this->_focus]->setFieldById($id, $value); } else { for ($i = 0; $i < count($this->_frames); $i++) { $this->_frames[$i]->setFieldById($id, $value); } } } /** * Accessor for a form element value within a frameset. * Finds the first match amongst the frames. * @param string $name Field name. * @return string/boolean A string if the field is * present, false if unchecked * and null if missing. * @access public */ function getField($name) { for ($i = 0; $i < count($this->_frames); $i++) { $value = $this->_frames[$i]->getField($name); if (isset($value)) { return $value; } } return null; } /** * Accessor for a form element value within a page. * Finds the first match. * @param string/integer $id Field ID attribute. * @return string/boolean A string if the field is * present, false if unchecked * and null if missing. * @access public */ function getFieldById($id) { for ($i = 0; $i < count($this->_frames); $i++) { $value = $this->_frames[$i]->getFieldById($id); if (isset($value)) { return $value; } } return null; } } ?>pgfouine-1.2/tests/simpletest/mock_objects.php0000644000175000017500000015214710334504436020306 0ustar acmeacmeSimpleExpectation(); } /** * Tests the expectation. Always true. * @param mixed $compare Ignored. * @return boolean True. * @access public */ function test($compare) { return true; } /** * Returns a human readable test message. * @param mixed $compare Comparison value. * @return string Description of success * or failure. * @access public */ function testMessage($compare) { $dumper = &$this->_getDumper(); return 'Wildcard always matches [' . $dumper->describeValue($compare) . ']'; } } /** * Parameter comparison assertion. * @package SimpleTest * @subpackage MockObjects */ class ParametersExpectation extends SimpleExpectation { var $_expected; /** * Sets the expected parameter list. * @param array $parameters Array of parameters including * those that are wildcarded. * If the value is not an array * then it is considered to match any. * @param mixed $wildcard Any parameter matching this * will always match. * @param string $message Customised message on failure. * @access public */ function ParametersExpectation($expected = false, $message = '%s') { $this->SimpleExpectation($message); $this->_expected = $expected; } /** * Tests the assertion. True if correct. * @param array $parameters Comparison values. * @return boolean True if correct. * @access public */ function test($parameters) { if (! is_array($this->_expected)) { return true; } if (count($this->_expected) != count($parameters)) { return false; } for ($i = 0; $i < count($this->_expected); $i++) { if (! $this->_testParameter($parameters[$i], $this->_expected[$i])) { return false; } } return true; } /** * Tests an individual parameter. * @param mixed $parameter Value to test. * @param mixed $expected Comparison value. * @return boolean True if expectation * fulfilled. * @access private */ function _testParameter($parameter, $expected) { $comparison = $this->_coerceToExpectation($expected); return $comparison->test($parameter); } /** * Returns a human readable test message. * @param array $comparison Incoming parameter list. * @return string Description of success * or failure. * @access public */ function testMessage($parameters) { if ($this->test($parameters)) { return "Expectation of " . count($this->_expected) . " arguments of [" . $this->_renderArguments($this->_expected) . "] is correct"; } else { return $this->_describeDifference($this->_expected, $parameters); } } /** * Message to display if expectation differs from * the parameters actually received. * @param array $expected Expected parameters as list. * @param array $parameters Actual parameters received. * @return string Description of difference. * @access private */ function _describeDifference($expected, $parameters) { if (count($expected) != count($parameters)) { return "Expected " . count($expected) . " arguments of [" . $this->_renderArguments($expected) . "] but got " . count($parameters) . " arguments of [" . $this->_renderArguments($parameters) . "]"; } $messages = array(); for ($i = 0; $i < count($expected); $i++) { $comparison = $this->_coerceToExpectation($expected[$i]); if (! $comparison->test($parameters[$i])) { $messages[] = "parameter " . ($i + 1) . " with [" . $comparison->overlayMessage($parameters[$i]) . "]"; } } return "Parameter expectation differs at " . implode(" and ", $messages); } /** * Creates an identical expectation if the * object/value is not already some type * of expectation. * @param mixed $expected Expected value. * @return SimpleExpectation Expectation object. * @access private */ function _coerceToExpectation($expected) { if (SimpleTestCompatibility::isA($expected, 'SimpleExpectation')) { return $expected; } return new IdenticalExpectation($expected); } /** * Renders the argument list as a string for * messages. * @param array $args Incoming arguments. * @return string Simple description of type and value. * @access private */ function _renderArguments($args) { $descriptions = array(); if (is_array($args)) { foreach ($args as $arg) { $dumper = &new SimpleDumper(); $descriptions[] = $dumper->describeValue($arg); } } return implode(', ', $descriptions); } } /** * Confirms that the number of calls on a method is as expected. */ class CallCountExpectation extends SimpleExpectation { var $_method; var $_count; /** * Stashes the method and expected count for later * reporting. * @param string $method Name of method to confirm against. * @param integer $count Expected number of calls. * @param string $message Custom error message. */ function CallCountExpectation($method, $count, $message = '%s') { $this->_method = $method; $this->_count = $count; $this->SimpleExpectation($message); } /** * Tests the assertion. True if correct. * @param integer $compare Measured call count. * @return boolean True if expected. * @access public */ function test($compare) { return ($this->_count == $compare); } /** * Reports the comparison. * @param integer $compare Measured call count. * @return string Message to show. * @access public */ function testMessage($compare) { return 'Expected call count for [' . $this->_method . '] was [' . $this->_count . '] got [' . $compare . ']'; } } /** * Confirms that the number of calls on a method is as expected. */ class MinimumCallCountExpectation extends SimpleExpectation { var $_method; var $_count; /** * Stashes the method and expected count for later * reporting. * @param string $method Name of method to confirm against. * @param integer $count Minimum number of calls. * @param string $message Custom error message. */ function MinimumCallCountExpectation($method, $count, $message = '%s') { $this->_method = $method; $this->_count = $count; $this->SimpleExpectation($message); } /** * Tests the assertion. True if correct. * @param integer $compare Measured call count. * @return boolean True if enough. * @access public */ function test($compare) { return ($this->_count <= $compare); } /** * Reports the comparison. * @param integer $compare Measured call count. * @return string Message to show. * @access public */ function testMessage($compare) { return 'Minimum call count for [' . $this->_method . '] was [' . $this->_count . '] got [' . $compare . ']'; } } /** * Confirms that the number of calls on a method is as expected. */ class MaximumCallCountExpectation extends SimpleExpectation { var $_method; var $_count; /** * Stashes the method and expected count for later * reporting. * @param string $method Name of method to confirm against. * @param integer $count Minimum number of calls. * @param string $message Custom error message. */ function MaximumCallCountExpectation($method, $count, $message = '%s') { $this->_method = $method; $this->_count = $count; $this->SimpleExpectation($message); } /** * Tests the assertion. True if correct. * @param integer $compare Measured call count. * @return boolean True if not over. * @access public */ function test($compare) { return ($this->_count >= $compare); } /** * Reports the comparison. * @param integer $compare Measured call count. * @return string Message to show. * @access public */ function testMessage($compare) { return 'Maximum call count for [' . $this->_method . '] was [' . $this->_count . '] got [' . $compare . ']'; } } /** * Retrieves values and references by searching the * parameter lists until a match is found. * @package SimpleTest * @subpackage MockObjects */ class CallMap { var $_map; /** * Creates an empty call map. * @access public */ function CallMap() { $this->_map = array(); } /** * Stashes a value against a method call. * @param array $parameters Arguments including wildcards. * @param mixed $value Value copied into the map. * @access public */ function addValue($parameters, $value) { $this->addReference($parameters, $value); } /** * Stashes a reference against a method call. * @param array $parameters Array of arguments (including wildcards). * @param mixed $reference Array reference placed in the map. * @access public */ function addReference($parameters, &$reference) { $place = count($this->_map); $this->_map[$place] = array(); $this->_map[$place]["params"] = new ParametersExpectation($parameters); $this->_map[$place]["content"] = &$reference; } /** * Searches the call list for a matching parameter * set. Returned by reference. * @param array $parameters Parameters to search by * without wildcards. * @return object Object held in the first matching * slot, otherwise null. * @access public */ function &findFirstMatch($parameters) { $slot = $this->_findFirstSlot($parameters); if (!isset($slot)) { return null; } return $slot["content"]; } /** * Searches the call list for a matching parameter * set. True if successful. * @param array $parameters Parameters to search by * without wildcards. * @return boolean True if a match is present. * @access public */ function isMatch($parameters) { return ($this->_findFirstSlot($parameters) != null); } /** * Searches the map for a matching item. * @param array $parameters Parameters to search by * without wildcards. * @return array Reference to slot or null. * @access private */ function &_findFirstSlot($parameters) { $count = count($this->_map); for ($i = 0; $i < $count; $i++) { if ($this->_map[$i]["params"]->test($parameters)) { return $this->_map[$i]; } } return null; } } /** * An empty collection of methods that can have their * return values set. Used for prototyping. * @package SimpleTest * @subpackage MockObjects */ class SimpleStub { var $_wildcard; var $_is_strict; var $_returns; var $_return_sequence; var $_call_counts; /** * Sets up the wildcard and everything else empty. * @param mixed $wildcard Parameter matching wildcard. * @param boolean $is_strict Enables method name checks. * @access public */ function SimpleStub($wildcard, $is_strict = true) { $this->_wildcard = $wildcard; $this->_is_strict = $is_strict; $this->_returns = array(); $this->_return_sequence = array(); $this->_call_counts = array(); } /** * Replaces wildcard matches with wildcard * expectations in the argument list. * @param array $args Raw argument list. * @return array Argument list with * expectations. * @access private */ function _replaceWildcards($args) { if ($args === false) { return false; } for ($i = 0; $i < count($args); $i++) { if ($args[$i] === $this->_wildcard) { $args[$i] = new WildcardExpectation(); } } return $args; } /** * Returns the expected value for the method name. * @param string $method Name of method to simulate. * @param array $args Arguments as an array. * @return mixed Stored return. * @access private */ function &_invoke($method, $args) { $method = strtolower($method); $step = $this->getCallCount($method); $this->_addCall($method, $args); return $this->_getReturn($method, $args, $step); } /** * Triggers a PHP error if the method is not part * of this object. * @param string $method Name of method. * @param string $task Description of task attempt. * @access protected */ function _dieOnNoMethod($method, $task) { if ($this->_is_strict && !method_exists($this, $method)) { trigger_error( "Cannot $task as no ${method}() in class " . get_class($this), E_USER_ERROR); } } /** * Adds one to the call count of a method. * @param string $method Method called. * @param array $args Arguments as an array. * @access protected */ function _addCall($method, $args) { if (!isset($this->_call_counts[$method])) { $this->_call_counts[$method] = 0; } $this->_call_counts[$method]++; } /** * Fetches the call count of a method so far. * @param string $method Method name called. * @return Number of calls so far. * @access public */ function getCallCount($method) { $this->_dieOnNoMethod($method, "get call count"); $method = strtolower($method); if (! isset($this->_call_counts[$method])) { return 0; } return $this->_call_counts[$method]; } /** * Sets a return for a parameter list that will * be passed by value for all calls to this method. * @param string $method Method name. * @param mixed $value Result of call passed by value. * @param array $args List of parameters to match * including wildcards. * @access public */ function setReturnValue($method, $value, $args = false) { $this->_dieOnNoMethod($method, "set return value"); $args = $this->_replaceWildcards($args); $method = strtolower($method); if (! isset($this->_returns[$method])) { $this->_returns[$method] = new CallMap(); } $this->_returns[$method]->addValue($args, $value); } /** * Sets a return for a parameter list that will * be passed by value only when the required call count * is reached. * @param integer $timing Number of calls in the future * to which the result applies. If * not set then all calls will return * the value. * @param string $method Method name. * @param mixed $value Result of call passed by value. * @param array $args List of parameters to match * including wildcards. * @access public */ function setReturnValueAt($timing, $method, $value, $args = false) { $this->_dieOnNoMethod($method, "set return value sequence"); $args = $this->_replaceWildcards($args); $method = strtolower($method); if (! isset($this->_return_sequence[$method])) { $this->_return_sequence[$method] = array(); } if (! isset($this->_return_sequence[$method][$timing])) { $this->_return_sequence[$method][$timing] = new CallMap(); } $this->_return_sequence[$method][$timing]->addValue($args, $value); } /** * Sets a return for a parameter list that will * be passed by reference for all calls. * @param string $method Method name. * @param mixed $reference Result of the call will be this object. * @param array $args List of parameters to match * including wildcards. * @access public */ function setReturnReference($method, &$reference, $args = false) { $this->_dieOnNoMethod($method, "set return reference"); $args = $this->_replaceWildcards($args); $method = strtolower($method); if (! isset($this->_returns[$method])) { $this->_returns[$method] = new CallMap(); } $this->_returns[$method]->addReference($args, $reference); } /** * Sets a return for a parameter list that will * be passed by value only when the required call count * is reached. * @param integer $timing Number of calls in the future * to which the result applies. If * not set then all calls will return * the value. * @param string $method Method name. * @param mixed $reference Result of the call will be this object. * @param array $args List of parameters to match * including wildcards. * @access public */ function setReturnReferenceAt($timing, $method, &$reference, $args = false) { $this->_dieOnNoMethod($method, "set return reference sequence"); $args = $this->_replaceWildcards($args); $method = strtolower($method); if (! isset($this->_return_sequence[$method])) { $this->_return_sequence[$method] = array(); } if (! isset($this->_return_sequence[$method][$timing])) { $this->_return_sequence[$method][$timing] = new CallMap(); } $this->_return_sequence[$method][$timing]->addReference($args, $reference); } /** * Finds the return value matching the incoming * arguments. If there is no matching value found * then an error is triggered. * @param string $method Method name. * @param array $args Calling arguments. * @param integer $step Current position in the * call history. * @return mixed Stored return. * @access protected */ function &_getReturn($method, $args, $step) { if (isset($this->_return_sequence[$method][$step])) { if ($this->_return_sequence[$method][$step]->isMatch($args)) { return $this->_return_sequence[$method][$step]->findFirstMatch($args); } } if (isset($this->_returns[$method])) { return $this->_returns[$method]->findFirstMatch($args); } return null; } } /** * An empty collection of methods that can have their * return values set and expectations made of the * calls upon them. The mock will assert the * expectations against it's attached test case in * addition to the server stub behaviour. * @package SimpleTest * @subpackage MockObjects */ class SimpleMock extends SimpleStub { var $_test; var $_expected_counts; var $_max_counts; var $_expected_args; var $_expected_args_at; /** * Creates an empty return list and expectation list. * All call counts are set to zero. * @param SimpleTestCase $test Test case to test expectations in. * @param mixed $wildcard Parameter matching wildcard. * @param boolean $is_strict Enables method name checks on * expectations. * @access public */ function SimpleMock(&$test, $wildcard, $is_strict = true) { $this->SimpleStub($wildcard, $is_strict); if (! $test) { trigger_error('No unit tester for mock object', E_USER_ERROR); return; } $this->_test = SimpleMock::registerTest($test); $this->_expected_counts = array(); $this->_max_counts = array(); $this->_expected_args = array(); $this->_expected_args_at = array(); } /** * Accessor for attached unit test so that when * subclassed, new expectations can be added easily. * @return SimpleTestCase Unit test passed in constructor. * @access public */ function &getTest() { return $this->_test; } /** * Die if bad arguments array is passed * @param mixed $args The arguments value to be checked. * @param string $task Description of task attempt. * @return boolean Valid arguments * @access private */ function _checkArgumentsIsArray($args, $task) { if (! is_array($args)) { trigger_error( "Cannot $task as \$args parameter is not an array", E_USER_ERROR); } } /** * Sets up an expected call with a set of * expected parameters in that call. All * calls will be compared to these expectations * regardless of when the call is made. * @param string $method Method call to test. * @param array $args Expected parameters for the call * including wildcards. * @param string $message Overridden message. * @access public */ function expectArguments($method, $args, $message = '%s') { $this->_dieOnNoMethod($method, 'set expected arguments'); $this->_checkArgumentsIsArray($args, 'set expected arguments'); $args = $this->_replaceWildcards($args); $message .= Mock::getExpectationLine(' at line [%d]'); $this->_expected_args[strtolower($method)] = new ParametersExpectation($args, $message); } /** * Sets up an expected call with a set of * expected parameters in that call. The * expected call count will be adjusted if it * is set too low to reach this call. * @param integer $timing Number of calls in the future at * which to test. Next call is 0. * @param string $method Method call to test. * @param array $args Expected parameters for the call * including wildcards. * @param string $message Overridden message. * @access public */ function expectArgumentsAt($timing, $method, $args, $message = '%s') { $this->_dieOnNoMethod($method, 'set expected arguments at time'); $this->_checkArgumentsIsArray($args, 'set expected arguments at time'); $args = $this->_replaceWildcards($args); if (! isset($this->_expected_args_at[$timing])) { $this->_expected_args_at[$timing] = array(); } $method = strtolower($method); $message .= Mock::getExpectationLine(' at line [%d]'); $this->_expected_args_at[$timing][$method] = new ParametersExpectation($args, $message); } /** * Sets an expectation for the number of times * a method will be called. The tally method * is used to check this. * @param string $method Method call to test. * @param integer $count Number of times it should * have been called at tally. * @param string $message Overridden message. * @access public */ function expectCallCount($method, $count, $message = '%s') { $this->_dieOnNoMethod($method, 'set expected call count'); $message .= Mock::getExpectationLine(' at line [%d]'); $this->_expected_counts[strtolower($method)] = new CallCountExpectation($method, $count, $message); } /** * Sets the number of times a method may be called * before a test failure is triggered. * @param string $method Method call to test. * @param integer $count Most number of times it should * have been called. * @param string $message Overridden message. * @access public */ function expectMaximumCallCount($method, $count, $message = '%s') { $this->_dieOnNoMethod($method, 'set maximum call count'); $message .= Mock::getExpectationLine(' at line [%d]'); $this->_max_counts[strtolower($method)] = new MaximumCallCountExpectation($method, $count, $message); } /** * Sets the number of times to call a method to prevent * a failure on the tally. * @param string $method Method call to test. * @param integer $count Least number of times it should * have been called. * @param string $message Overridden message. * @access public */ function expectMinimumCallCount($method, $count, $message = '%s') { $this->_dieOnNoMethod($method, 'set minimum call count'); $message .= Mock::getExpectationLine(' at line [%d]'); $this->_expected_counts[strtolower($method)] = new MinimumCallCountExpectation($method, $count, $message); } /** * Convenience method for barring a method * call. * @param string $method Method call to ban. * @param string $message Overridden message. * @access public */ function expectNever($method, $message = '%s') { $this->expectMaximumCallCount($method, 0, $message); } /** * Convenience method for a single method * call. * @param string $method Method call to track. * @param array $args Expected argument list or * false for any arguments. * @param string $message Overridden message. * @access public */ function expectOnce($method, $args = false, $message = '%s') { $this->expectCallCount($method, 1, $message); if ($args !== false) { $this->expectArguments($method, $args, $message); } } /** * Convenience method for requiring a method * call. * @param string $method Method call to track. * @param array $args Expected argument list or * false for any arguments. * @param string $message Overridden message. * @access public */ function expectAtLeastOnce($method, $args = false, $message = '%s') { $this->expectMinimumCallCount($method, 1, $message); if ($args !== false) { $this->expectArguments($method, $args, $message); } } /** * Totals up the call counts and triggers a test * assertion if a test is present for expected * call counts. * This method must be called explicitly for the call * count assertions to be triggered. * @access public */ function tally() { foreach ($this->_expected_counts as $method => $expectation) { $this->_assertTrue( $expectation->test($this->getCallCount($method)), $expectation->overlayMessage($this->getCallCount($method))); } foreach ($this->_max_counts as $method => $expectation) { if ($expectation->test($this->getCallCount($method))) { $this->_assertTrue( true, $expectation->overlayMessage($this->getCallCount($method))); } } } /** * Returns the expected value for the method name * and checks expectations. Will generate any * test assertions as a result of expectations * if there is a test present. * @param string $method Name of method to simulate. * @param array $args Arguments as an array. * @return mixed Stored return. * @access private */ function &_invoke($method, $args) { $method = strtolower($method); $step = $this->getCallCount($method); $this->_addCall($method, $args); $this->_checkExpectations($method, $args, $step); return $this->_getReturn($method, $args, $step); } /** * Tests the arguments against expectations. * @param string $method Method to check. * @param array $args Argument list to match. * @param integer $timing The position of this call * in the call history. * @access private */ function _checkExpectations($method, $args, $timing) { if (isset($this->_max_counts[$method])) { if (! $this->_max_counts[$method]->test($timing + 1)) { $this->_assertTrue( false, $this->_max_counts[$method]->overlayMessage($timing + 1)); } } if (isset($this->_expected_args_at[$timing][$method])) { $this->_assertTrue( $this->_expected_args_at[$timing][$method]->test($args), "Mock method [$method] at [$timing] -> " . $this->_expected_args_at[$timing][$method]->overlayMessage($args)); } elseif (isset($this->_expected_args[$method])) { $this->_assertTrue( $this->_expected_args[$method]->test($args), "Mock method [$method] -> " . $this->_expected_args[$method]->overlayMessage($args)); } } /** * Triggers an assertion on the held test case. * Should be overridden when using another test * framework other than the SimpleTest one if the * assertion method has a different name. * @param boolean $assertion True will pass. * @param string $message Message that will go with * the test event. * @access protected */ function _assertTrue($assertion, $message) { $test = &SimpleMock::injectTest($this->_test); $test->assertTrue($assertion, $message); } /** * Stashes the test case for later recovery. * @param SimpleTestCase $test Test case. * @return string Key to find it again. * @access public * @static */ function registerTest(&$test) { $registry = &SimpleMock::_getRegistry(); $registry[$class = get_class($test)] = &$test; return $class; } /** * Resolves the dependency on the test case. * @param string $class Key to look up test case in. * @return SimpleTestCase Test case to send results to. * @access public * @static */ function &injectTest($key) { $registry = &SimpleMock::_getRegistry(); return $registry[$key]; } /** * Registry for test cases. The reason for this is * to break the reference between the test cases and * the mocks. It was leading to a fatal error due to * recursive dependencies during comparisons. See * http://bugs.php.net/bug.php?id=31449 for the PHP * bug. * @return array List of references. * @access private * @static */ function &_getRegistry() { static $registry; if (! isset($registry)) { $registry = array(); } return $registry; } } /** * Static methods only service class for code generation of * server stubs. * @package SimpleTest * @subpackage MockObjects */ class Stub { /** * Factory for server stub classes. */ function Stub() { trigger_error('Stub factory methods are class only.'); } /** * Clones a class' interface and creates a stub version * that can have return values set. * @param string $class Class to clone. * @param string $stub_class New class name. Default is * the old name with "Stub" * prepended. * @param array $methods Additional methods to add beyond * those in the cloned class. Use this * to emulate the dynamic addition of * methods in the cloned class or when * the class hasn't been written yet. * @static * @access public */ function generate($class, $stub_class = false, $methods = false) { if (! SimpleTestCompatibility::classExists($class)) { return false; } if (! $stub_class) { $stub_class = "Stub" . $class; } if (SimpleTestCompatibility::classExists($stub_class)) { return false; } return eval(Stub::_createClassCode( $class, $stub_class, $methods ? $methods : array()) . " return true;"); } /** * The new server stub class code in string form. * @param string $class Class to clone. * @param string $mock_class New class name. * @param array $methods Additional methods. * @static * @access private */ function _createClassCode($class, $stub_class, $methods) { $stub_base = SimpleTestOptions::getStubBaseClass(); $code = "class $stub_class extends $stub_base {\n"; $code .= " function $stub_class(\$wildcard = MOCK_WILDCARD) {\n"; $code .= " \$this->$stub_base(\$wildcard);\n"; $code .= " }\n"; $code .= Stub::_createHandlerCode($class, $stub_base, $methods); $code .= "}\n"; return $code; } /** * Creates code within a class to generate replaced * methods. All methods call the _invoke() handler * with the method name and the arguments in an * array. * @param string $class Class to clone. * @param string $base Base mock/stub class with methods that * cannot be cloned. Otherwise you * would be stubbing the accessors used * to set the stubs. * @param array $methods Additional methods. * @static * @access private */ function _createHandlerCode($class, $base, $methods) { $code = ""; $methods = array_merge($methods, get_class_methods($class)); foreach ($methods as $method) { if (Stub::_isSpecialMethod($method)) { continue; } if (in_array($method, get_class_methods($base))) { continue; } $code .= " function &$method() {\n"; $code .= " \$args = func_get_args();\n"; $code .= " return \$this->_invoke(\"$method\", \$args);\n"; $code .= " }\n"; } return $code; } /** * Tests to see if a special PHP method is about to * be stubbed by mistake. * @param string $method Method name. * @return boolean True if special. * @access private * @static */ function _isSpecialMethod($method) { return in_array( strtolower($method), array('__construct', '__clone', '__get', '__set', '__call')); } } /** * Static methods only service class for code generation of * mock objects. * @package SimpleTest * @subpackage MockObjects */ class Mock { /** * Factory for mock object classes. * @access public */ function Mock() { trigger_error("Mock factory methods are class only."); } /** * Clones a class' interface and creates a mock version * that can have return values and expectations set. * @param string $class Class to clone. * @param string $mock_class New class name. Default is * the old name with "Mock" * prepended. * @param array $methods Additional methods to add beyond * those in th cloned class. Use this * to emulate the dynamic addition of * methods in the cloned class or when * the class hasn't been written yet. * @static * @access public */ function generate($class, $mock_class = false, $methods = false) { if (! SimpleTestCompatibility::classExists($class)) { return false; } if (! $mock_class) { $mock_class = "Mock" . $class; } if (SimpleTestCompatibility::classExists($mock_class)) { return false; } return eval(Mock::_createClassCode( $class, $mock_class, $methods ? $methods : array()) . " return true;"); } /** * Generates a version of a class with selected * methods mocked only. Inherits the old class * and chains the mock methods of an aggregated * mock object. * @param string $class Class to clone. * @param string $mock_class New class name. * @param array $methods Methods to be overridden * with mock versions. * @static * @access public */ function generatePartial($class, $mock_class, $methods) { if (! SimpleTestCompatibility::classExists($class)) { return false; } if (SimpleTestCompatibility::classExists($mock_class)) { trigger_error("Partial mock class [$mock_class] already exists"); return false; } return eval(Mock::_extendClassCode($class, $mock_class, $methods)); } /** * The new mock class code as a string. * @param string $class Class to clone. * @param string $mock_class New class name. * @param array $methods Additional methods. * @return string Code for new mock class. * @static * @access private */ function _createClassCode($class, $mock_class, $methods) { $mock_base = SimpleTestOptions::getMockBaseClass(); $code = "class $mock_class extends $mock_base {\n"; $code .= " function $mock_class(&\$test, \$wildcard = MOCK_WILDCARD) {\n"; $code .= " \$this->$mock_base(\$test, \$wildcard);\n"; $code .= " }\n"; $code .= Stub::_createHandlerCode($class, $mock_base, $methods); $code .= "}\n"; return $code; } /** * The extension class code as a string. The class * composites a mock object and chains mocked methods * to it. * @param string $class Class to extend. * @param string $mock_class New class name. * @param array $methods Mocked methods. * @return string Code for a new class. * @static * @access private */ function _extendClassCode($class, $mock_class, $methods) { $mock_base = SimpleTestOptions::getMockBaseClass(); $code = "class $mock_class extends $class {\n"; $code .= " var \$_mock;\n"; $code .= Mock::_addMethodList($methods); $code .= "\n"; $code .= " function $mock_class(&\$test, \$wildcard = MOCK_WILDCARD) {\n"; $code .= " \$this->_mock = &new $mock_base(\$test, \$wildcard, false);\n"; $code .= " }\n"; $code .= Mock::_chainMockReturns(); $code .= Mock::_chainMockExpectations(); $code .= Mock::_overrideMethods($methods); $code .= SimpleTestOptions::getPartialMockCode(); $code .= "}\n"; return $code; } /** * Creates a list of mocked methods for error checking. * @param array $methods Mocked methods. * @return string Code for a method list. * @access private */ function _addMethodList($methods) { return " var \$_mocked_methods = array('" . implode("', '", $methods) . "');\n"; } /** * Creates code to abandon the expectation if not mocked. * @param string $alias Parameter name of method name. * @return string Code for bail out. * @access private */ function _bailOutIfNotMocked($alias) { $code = " if (! in_array($alias, \$this->_mocked_methods)) {\n"; $code .= " trigger_error(\"Method [$alias] is not mocked\");\n"; $code .= " return;\n"; $code .= " }\n"; return $code; } /** * Creates source code for chaining to the composited * mock object. * @return string Code for mock set up. * @access private */ function _chainMockReturns() { $code = " function setReturnValue(\$method, \$value, \$args = false) {\n"; $code .= Mock::_bailOutIfNotMocked("\$method"); $code .= " \$this->_mock->setReturnValue(\$method, \$value, \$args);\n"; $code .= " }\n"; $code .= " function setReturnValueAt(\$timing, \$method, \$value, \$args = false) {\n"; $code .= Mock::_bailOutIfNotMocked("\$method"); $code .= " \$this->_mock->setReturnValueAt(\$timing, \$method, \$value, \$args);\n"; $code .= " }\n"; $code .= " function setReturnReference(\$method, &\$ref, \$args = false) {\n"; $code .= Mock::_bailOutIfNotMocked("\$method"); $code .= " \$this->_mock->setReturnReference(\$method, \$ref, \$args);\n"; $code .= " }\n"; $code .= " function setReturnReferenceAt(\$timing, \$method, &\$ref, \$args = false) {\n"; $code .= Mock::_bailOutIfNotMocked("\$method"); $code .= " \$this->_mock->setReturnReferenceAt(\$timing, \$method, \$ref, \$args);\n"; $code .= " }\n"; return $code; } /** * Creates source code for chaining to an aggregated * mock object. * @return string Code for expectations. * @access private */ function _chainMockExpectations() { $code = " function expectArguments(\$method, \$args = false) {\n"; $code .= Mock::_bailOutIfNotMocked("\$method"); $code .= " \$this->_mock->expectArguments(\$method, \$args);\n"; $code .= " }\n"; $code .= " function expectArgumentsAt(\$timing, \$method, \$args = false) {\n"; $code .= Mock::_bailOutIfNotMocked("\$method"); $code .= " \$this->_mock->expectArgumentsAt(\$timing, \$method, \$args);\n"; $code .= " }\n"; $code .= " function expectCallCount(\$method, \$count) {\n"; $code .= Mock::_bailOutIfNotMocked("\$method"); $code .= " \$this->_mock->expectCallCount(\$method, \$count);\n"; $code .= " }\n"; $code .= " function expectMaximumCallCount(\$method, \$count) {\n"; $code .= Mock::_bailOutIfNotMocked("\$method"); $code .= " \$this->_mock->expectMaximumCallCount(\$method, \$count);\n"; $code .= " }\n"; $code .= " function expectMinimumCallCount(\$method, \$count) {\n"; $code .= Mock::_bailOutIfNotMocked("\$method"); $code .= " \$this->_mock->expectMinimumCallCount(\$method, \$count);\n"; $code .= " }\n"; $code .= " function expectNever(\$method) {\n"; $code .= Mock::_bailOutIfNotMocked("\$method"); $code .= " \$this->_mock->expectNever(\$method);\n"; $code .= " }\n"; $code .= " function expectOnce(\$method, \$args = false) {\n"; $code .= Mock::_bailOutIfNotMocked("\$method"); $code .= " \$this->_mock->expectOnce(\$method, \$args);\n"; $code .= " }\n"; $code .= " function expectAtLeastOnce(\$method, \$args = false) {\n"; $code .= Mock::_bailOutIfNotMocked("\$method"); $code .= " \$this->_mock->expectAtLeastOnce(\$method, \$args);\n"; $code .= " }\n"; $code .= " function tally() {\n"; $code .= " \$this->_mock->tally();\n"; $code .= " }\n"; return $code; } /** * Creates source code to override a list of methods * with mock versions. * @param array $methods Methods to be overridden * with mock versions. * @return string Code for overridden chains. * @access private */ function _overrideMethods($methods) { $code = ""; foreach ($methods as $method) { $code .= " function &$method() {\n"; $code .= " \$args = func_get_args();\n"; $code .= " return \$this->_mock->_invoke(\"$method\", \$args);\n"; $code .= " }\n"; } return $code; } /** * Uses a stack trace to find the line of an assertion. * @param string $format String formatting. * @param array $stack Stack frames top most first. Only * needed if not using the PHP * backtrace function. * @return string Line number of first expect* * method embedded in format string. * @access public * @static */ function getExpectationLine($format = '%d', $stack = false) { if ($stack === false) { $stack = SimpleTestCompatibility::getStackTrace(); } return SimpleDumper::getFormattedAssertionLine($stack, $format, 'expect'); } } ?>pgfouine-1.2/tests/simpletest/user_agent.php0000644000175000017500000004503410334504436017774 0ustar acmeacme_cookies = array(); } /** * Removes expired and temporary cookies as if * the browser was closed and re-opened. * @param string/integer $now Time to test expiry against. * @access public */ function restartSession($date = false) { $surviving_cookies = array(); for ($i = 0; $i < count($this->_cookies); $i++) { if (! $this->_cookies[$i]->getValue()) { continue; } if (! $this->_cookies[$i]->getExpiry()) { continue; } if ($date && $this->_cookies[$i]->isExpired($date)) { continue; } $surviving_cookies[] = $this->_cookies[$i]; } $this->_cookies = $surviving_cookies; } /** * Ages all cookies in the cookie jar. * @param integer $interval The old session is moved * into the past by this number * of seconds. Cookies now over * age will be removed. * @access public */ function agePrematurely($interval) { for ($i = 0; $i < count($this->_cookies); $i++) { $this->_cookies[$i]->agePrematurely($interval); } } /** * Adds a cookie to the jar. This will overwrite * cookies with matching host, paths and keys. * @param SimpleCookie $cookie New cookie. * @access public */ function setCookie($cookie) { for ($i = 0; $i < count($this->_cookies); $i++) { $is_match = $this->_isMatch( $cookie, $this->_cookies[$i]->getHost(), $this->_cookies[$i]->getPath(), $this->_cookies[$i]->getName()); if ($is_match) { $this->_cookies[$i] = $cookie; return; } } $this->_cookies[] = $cookie; } /** * Fetches a hash of all valid cookies filtered * by host, path and keyed by name * Any cookies with missing categories will not * be filtered out by that category. Expired * cookies must be cleared by restarting the session. * @param string $host Host name requirement. * @param string $path Path encompassing cookies. * @return hash Valid cookie objects keyed * on the cookie name. * @access public */ function getValidCookies($host = false, $path = "/") { $valid_cookies = array(); foreach ($this->_cookies as $cookie) { if ($this->_isMatch($cookie, $host, $path, $cookie->getName())) { $valid_cookies[] = $cookie; } } return $valid_cookies; } /** * Tests cookie for matching against search * criteria. * @param SimpleTest $cookie Cookie to test. * @param string $host Host must match. * @param string $path Cookie path must be shorter than * this path. * @param string $name Name must match. * @return boolean True if matched. * @access private */ function _isMatch($cookie, $host, $path, $name) { if ($cookie->getName() != $name) { return false; } if ($host && $cookie->getHost() && !$cookie->isValidHost($host)) { return false; } if (! $cookie->isValidPath($path)) { return false; } return true; } /** * Adds the current cookies to a request. * @param SimpleHttpRequest $request Request to modify. * @param SimpleUrl $url Cookie selector. * @access private */ function addHeaders(&$request, $url) { $cookies = $this->getValidCookies($url->getHost(), $url->getPath()); foreach ($cookies as $cookie) { $request->setCookie($cookie); } } } /** * Fetches web pages whilst keeping track of * cookies and authentication. * @package SimpleTest * @subpackage WebTester */ class SimpleUserAgent { var $_cookie_jar; var $_authenticator; var $_max_redirects; var $_proxy; var $_proxy_username; var $_proxy_password; var $_connection_timeout; var $_additional_headers; /** * Starts with no cookies, realms or proxies. * @access public */ function SimpleUserAgent() { $this->_cookie_jar = &new SimpleCookieJar(); $this->_authenticator = &new SimpleAuthenticator(); $this->setMaximumRedirects(DEFAULT_MAX_REDIRECTS); $this->_proxy = false; $this->_proxy_username = false; $this->_proxy_password = false; $this->setConnectionTimeout(DEFAULT_CONNECTION_TIMEOUT); $this->_additional_headers = array(); } /** * Removes expired and temporary cookies as if * the browser was closed and re-opened. Authorisation * has to be obtained again as well. * @param string/integer $date Time when session restarted. * If omitted then all persistent * cookies are kept. * @access public */ function restart($date = false) { $this->_cookie_jar->restartSession($date); $this->_authenticator->restartSession(); } /** * Adds a header to every fetch. * @param string $header Header line to add to every * request until cleared. * @access public */ function addHeader($header) { $this->_additional_headers[] = $header; } /** * Ages the cookies by the specified time. * @param integer $interval Amount in seconds. * @access public */ function ageCookies($interval) { $this->_cookie_jar->agePrematurely($interval); } /** * Sets an additional cookie. If a cookie has * the same name and path it is replaced. * @param string $name Cookie key. * @param string $value Value of cookie. * @param string $host Host upon which the cookie is valid. * @param string $path Cookie path if not host wide. * @param string $expiry Expiry date. * @access public */ function setCookie($name, $value, $host = false, $path = '/', $expiry = false) { $cookie = new SimpleCookie($name, $value, $path, $expiry); if ($host) { $cookie->setHost($host); } $this->_cookie_jar->setCookie($cookie); } /** * Reads the most specific cookie value from the * browser cookies. * @param string $host Host to search. * @param string $path Applicable path. * @param string $name Name of cookie to read. * @return string False if not present, else the * value as a string. * @access public */ function getCookieValue($host, $path, $name) { $longest_path = ''; foreach ($this->_cookie_jar->getValidCookies($host, $path) as $cookie) { if ($name == $cookie->getName()) { if (strlen($cookie->getPath()) > strlen($longest_path)) { $value = $cookie->getValue(); $longest_path = $cookie->getPath(); } } } return (isset($value) ? $value : false); } /** * Reads the current cookies within the base URL. * @param string $name Key of cookie to find. * @param SimpleUrl $base Base URL to search from. * @return string Null if there is no base URL, false * if the cookie is not set. * @access public */ function getBaseCookieValue($name, $base) { if (! $base) { return null; } return $this->getCookieValue($base->getHost(), $base->getPath(), $name); } /** * Sets the socket timeout for opening a connection. * @param integer $timeout Maximum time in seconds. * @access public */ function setConnectionTimeout($timeout) { $this->_connection_timeout = $timeout; } /** * Sets the maximum number of redirects before * a page will be loaded anyway. * @param integer $max Most hops allowed. * @access public */ function setMaximumRedirects($max) { $this->_max_redirects = $max; } /** * Sets proxy to use on all requests for when * testing from behind a firewall. Set URL * to false to disable. * @param string $proxy Proxy URL. * @param string $username Proxy username for authentication. * @param string $password Proxy password for authentication. * @access public */ function useProxy($proxy, $username, $password) { if (! $proxy) { $this->_proxy = false; return; } if (strncmp($proxy, 'http://', 7) != 0) { $proxy = 'http://'. $proxy; } $this->_proxy = &new SimpleUrl($proxy); $this->_proxy_username = $username; $this->_proxy_password = $password; } /** * Test to see if the redirect limit is passed. * @param integer $redirects Count so far. * @return boolean True if over. * @access private */ function _isTooManyRedirects($redirects) { return ($redirects > $this->_max_redirects); } /** * Sets the identity for the current realm. * @param string $host Host to which realm applies. * @param string $realm Full name of realm. * @param string $username Username for realm. * @param string $password Password for realm. * @access public */ function setIdentity($host, $realm, $username, $password) { $this->_authenticator->setIdentityForRealm($host, $realm, $username, $password); } /** * Fetches a URL as a response object. Will keep trying if redirected. * It will also collect authentication realm information. * @param string $method GET, POST, etc. * @param string/SimpleUrl $url Target to fetch. * @param SimpleFormEncoding $parameters Additional parameters for request. * @return SimpleHttpResponse Hopefully the target page. * @access public */ function &fetchResponse($method, $url, $parameters = false) { if ($method != 'POST') { $url->addRequestParameters($parameters); $parameters = false; } $response = &$this->_fetchWhileRedirected($method, $url, $parameters); if ($headers = $response->getHeaders()) { if ($headers->isChallenge()) { $this->_authenticator->addRealm( $url, $headers->getAuthentication(), $headers->getRealm()); } } return $response; } /** * Fetches the page until no longer redirected or * until the redirect limit runs out. * @param string $method GET, POST, etc. * @param SimpleUrl $url Target to fetch. * @param SimpelFormEncoding $parameters Additional parameters for request. * @return SimpleHttpResponse Hopefully the target page. * @access private */ function &_fetchWhileRedirected($method, $url, $parameters) { $redirects = 0; do { $response = &$this->_fetch($method, $url, $parameters); if ($response->isError()) { return $response; } $headers = $response->getHeaders(); $location = new SimpleUrl($headers->getLocation()); $url = $location->makeAbsolute($url); $this->_addCookiesToJar($url, $headers->getNewCookies()); if (! $headers->isRedirect()) { break; } $method = 'GET'; $parameters = false; } while (! $this->_isTooManyRedirects(++$redirects)); return $response; } /** * Actually make the web request. * @param string $method GET, POST, etc. * @param SimpleUrl $url Target to fetch. * @param SimpleFormEncoding $parameters Additional parameters for request. * @return SimpleHttpResponse Headers and hopefully content. * @access protected */ function &_fetch($method, $url, $parameters) { if (! $parameters) { $parameters = new SimpleFormEncoding(); } $request = &$this->_createRequest($method, $url, $parameters); return $request->fetch($this->_connection_timeout); } /** * Creates a full page request. * @param string $method Fetching method. * @param SimpleUrl $url Target to fetch as url object. * @param SimpleFormEncoding $parameters POST/GET parameters. * @return SimpleHttpRequest New request. * @access private */ function &_createRequest($method, $url, $parameters) { $request = &$this->_createHttpRequest($method, $url, $parameters); $this->_addAdditionalHeaders($request); $this->_cookie_jar->addHeaders($request, $url); $this->_authenticator->addHeaders($request, $url); return $request; } /** * Builds the appropriate HTTP request object. * @param string $method Fetching method. * @param SimpleUrl $url Target to fetch as url object. * @param SimpleFormEncoding $parameters POST/GET parameters. * @return SimpleHttpRequest New request object. * @access protected */ function &_createHttpRequest($method, $url, $parameters) { if ($method == 'POST') { $request = &new SimpleHttpRequest( $this->_createRoute($url), 'POST', $parameters); return $request; } if ($parameters) { $url->addRequestParameters($parameters); } return new SimpleHttpRequest($this->_createRoute($url), $method); } /** * Sets up either a direct route or via a proxy. * @param SimpleUrl $url Target to fetch as url object. * @return SimpleRoute Route to take to fetch URL. * @access protected */ function &_createRoute($url) { if ($this->_proxy) { return new SimpleProxyRoute( $url, $this->_proxy, $this->_proxy_username, $this->_proxy_password); } return new SimpleRoute($url); } /** * Adds additional manual headers. * @param SimpleHttpRequest $request Outgoing request. * @access private */ function _addAdditionalHeaders(&$request) { foreach ($this->_additional_headers as $header) { $request->addHeaderLine($header); } } /** * Extracts new cookies into the cookie jar. * @param SimpleUrl $url Target to fetch as url object. * @param array $cookies New cookies. * @access private */ function _addCookiesToJar($url, $cookies) { foreach ($cookies as $cookie) { if ($url->getHost()) { $cookie->setHost($url->getHost()); } $this->_cookie_jar->setCookie($cookie); } } } ?>pgfouine-1.2/tests/simpletest/options.php0000644000175000017500000003117610334504436017335 0ustar acmeacme 'SimpleStub', 'MockBaseClass' => 'SimpleMock', 'IgnoreList' => array(), 'AdditionalPartialMockCode' => '', 'DefaultProxy' => false, 'DefaultProxyUsername' => false, 'DefaultProxyPassword' => false); } } /** * Static methods for compatibility between different * PHP versions. * @package SimpleTest */ class SimpleTestCompatibility { /** * Identity test. Drops back to equality + types for PHP5 * objects as the === operator counts as the * stronger reference constraint. * @param mixed $first Test subject. * @param mixed $second Comparison object. * @access public * @static */ function isIdentical($first, $second) { if ($first != $second) { return false; } if (version_compare(phpversion(), '5') >= 0) { return SimpleTestCompatibility::_isIdenticalType($first, $second); } return ($first === $second); } /** * Recursive type test. * @param mixed $first Test subject. * @param mixed $second Comparison object. * @access private * @static */ function _isIdenticalType($first, $second) { if (gettype($first) != gettype($second)) { return false; } if (is_object($first) && is_object($second)) { if (get_class($first) != get_class($second)) { return false; } return SimpleTestCompatibility::_isArrayOfIdenticalTypes( get_object_vars($first), get_object_vars($second)); } if (is_array($first) && is_array($second)) { return SimpleTestCompatibility::_isArrayOfIdenticalTypes($first, $second); } return true; } /** * Recursive type test for each element of an array. * @param mixed $first Test subject. * @param mixed $second Comparison object. * @access private * @static */ function _isArrayOfIdenticalTypes($first, $second) { if (array_keys($first) != array_keys($second)) { return false; } foreach (array_keys($first) as $key) { $is_identical = SimpleTestCompatibility::_isIdenticalType( $first[$key], $second[$key]); if (! $is_identical) { return false; } } return true; } /** * Test for two variables being aliases. * @param mixed $first Test subject. * @param mixed $second Comparison object. * @access public * @static */ function isReference(&$first, &$second) { if (version_compare(phpversion(), '5', '>=') && is_object($first)) { return ($first === $second); } $temp = $first; $first = uniqid("test"); $is_ref = ($first === $second); $first = $temp; return $is_ref; } /** * Test to see if an object is a member of a * class hiearchy. * @param object $object Object to test. * @param string $class Root name of hiearchy. * @access public * @static */ function isA($object, $class) { if (version_compare(phpversion(), '5') >= 0) { if (! class_exists($class, false)) { return false; } eval("\$is_a = \$object instanceof $class;"); return $is_a; } if (function_exists('is_a')) { return is_a($object, $class); } return ((strtolower($class) == get_class($object)) or (is_subclass_of($object, $class))); } /** * Autoload safe version of class_exists(). * @param string $class Name of class to look for. * @return boolean True if class is defined. * @access public * @static */ function classExists($class) { if (version_compare(phpversion(), '5') >= 0) { return class_exists($class, false); } else { return class_exists($class); } } /** * Sets a socket timeout for each chunk. * @param resource $handle Socket handle. * @param integer $timeout Limit in seconds. * @access public * @static */ function setTimeout($handle, $timeout) { if (function_exists('stream_set_timeout')) { stream_set_timeout($handle, $timeout, 0); } elseif (function_exists('socket_set_timeout')) { socket_set_timeout($handle, $timeout, 0); } elseif (function_exists('set_socket_timeout')) { set_socket_timeout($handle, $timeout, 0); } } /** * Gets the current stack trace topmost first. * @return array List of stack frames. * @access public * @static */ function getStackTrace() { if (function_exists('debug_backtrace')) { return array_reverse(debug_backtrace()); } return array(); } } ?> pgfouine-1.2/tests/simpletest/tag.php0000644000175000017500000011234210334504436016410 0ustar acmeacme_name = $name; $this->_attributes = $attributes; $this->_content = ''; } /** * Check to see if the tag can have both start and * end tags with content in between. * @return boolean True if content allowed. * @access public */ function expectEndTag() { return true; } /** * Appends string content to the current content. * @param string $content Additional text. * @access public */ function addContent($content) { $this->_content .= (string)$content; } /** * Adds an enclosed tag to the content. * @param SimpleTag $tag New tag. * @access public */ function addTag(&$tag) { } /** * Accessor for tag name. * @return string Name of tag. * @access public */ function getTagName() { return $this->_name; } /** * List oflegal child elements. * @return array List of element names. * @access public */ function getChildElements() { return array(); } /** * Accessor for an attribute. * @param string $label Attribute name. * @return string Attribute value. * @access public */ function getAttribute($label) { $label = strtolower($label); if (! isset($this->_attributes[$label])) { return false; } if ($this->_attributes[$label] === '') { return true; } return (string)$this->_attributes[$label]; } /** * Sets an attribute. * @param string $label Attribute name. * @return string $value New attribute value. * @access protected */ function _setAttribute($label, $value) { $this->_attributes[strtolower($label)] = $value; } /** * Accessor for the whole content so far. * @return string Content as big raw string. * @access public */ function getContent() { return $this->_content; } /** * Accessor for content reduced to visible text. Acts * like a text mode browser, normalising space and * reducing images to their alt text. * @return string Content as plain text. * @access public */ function getText() { return SimpleSaxParser::normalise($this->_content); } /** * Test to see if id attribute matches. * @param string $id ID to test against. * @return boolean True on match. * @access public */ function isId($id) { return ($this->getAttribute('id') == $id); } } /** * Page title. * @package SimpleTest * @subpackage WebTester */ class SimpleTitleTag extends SimpleTag { /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and * string values. */ function SimpleTitleTag($attributes) { $this->SimpleTag('title', $attributes); } } /** * Link. * @package SimpleTest * @subpackage WebTester */ class SimpleAnchorTag extends SimpleTag { /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and * string values. */ function SimpleAnchorTag($attributes) { $this->SimpleTag('a', $attributes); } /** * Accessor for URL as string. * @return string Coerced as string. * @access public */ function getHref() { $url = $this->getAttribute('href'); if (is_bool($url)) { $url = ''; } return $url; } } /** * Form element. * @package SimpleTest * @subpackage WebTester */ class SimpleWidget extends SimpleTag { var $_value; var $_is_set; /** * Starts with a named tag with attributes only. * @param string $name Tag name. * @param hash $attributes Attribute names and * string values. */ function SimpleWidget($name, $attributes) { $this->SimpleTag($name, $attributes); $this->_value = false; $this->_is_set = false; } /** * Accessor for name submitted as the key in * GET/POST variables hash. * @return string Parsed value. * @access public */ function getName() { return $this->getAttribute('name'); } /** * Accessor for default value parsed with the tag. * @return string Parsed value. * @access public */ function getDefault() { $default = $this->getAttribute('value'); if ($default === true) { $default = ''; } if ($default === false) { $default = ''; } return $default; } /** * Accessor for currently set value or default if * none. * @return string Value set by form or default * if none. * @access public */ function getValue() { if (! $this->_is_set) { return $this->getDefault(); } return $this->_value; } /** * Sets the current form element value. * @param string $value New value. * @return boolean True if allowed. * @access public */ function setValue($value) { $this->_value = $value; $this->_is_set = true; return true; } /** * Resets the form element value back to the * default. * @access public */ function resetValue() { $this->_is_set = false; } } /** * Text, password and hidden field. * @package SimpleTest * @subpackage WebTester */ class SimpleTextTag extends SimpleWidget { /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and * string values. */ function SimpleTextTag($attributes) { $this->SimpleWidget('input', $attributes); if ($this->getAttribute('value') === false) { $this->_setAttribute('value', ''); } } /** * Tag contains no content. * @return boolean False. * @access public */ function expectEndTag() { return false; } /** * Sets the current form element value. Cannot * change the value of a hidden field. * @param string $value New value. * @return boolean True if allowed. * @access public */ function setValue($value) { if ($this->getAttribute('type') == 'hidden') { return false; } return parent::setValue($value); } } /** * Submit button as input tag. * @package SimpleTest * @subpackage WebTester */ class SimpleSubmitTag extends SimpleWidget { /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and * string values. */ function SimpleSubmitTag($attributes) { $this->SimpleWidget('input', $attributes); if ($this->getAttribute('name') === false) { $this->_setAttribute('name', 'submit'); } if ($this->getAttribute('value') === false) { $this->_setAttribute('value', 'Submit'); } } /** * Tag contains no end element. * @return boolean False. * @access public */ function expectEndTag() { return false; } /** * Disables the setting of the button value. * @param string $value Ignored. * @return boolean True if allowed. * @access public */ function setValue($value) { return false; } /** * Value of browser visible text. * @return string Visible label. * @access public */ function getLabel() { return $this->getValue(); } /** * Gets the values submitted as a form. * @return array Hash of name and values. * @access public */ function getSubmitValues() { return array($this->getName() => $this->getValue()); } } /** * Image button as input tag. * @package SimpleTest * @subpackage WebTester */ class SimpleImageSubmitTag extends SimpleWidget { /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and * string values. */ function SimpleImageSubmitTag($attributes) { $this->SimpleWidget('input', $attributes); } /** * Tag contains no end element. * @return boolean False. * @access public */ function expectEndTag() { return false; } /** * Disables the setting of the button value. * @param string $value Ignored. * @return boolean True if allowed. * @access public */ function setValue($value) { return false; } /** * Value of browser visible text. * @return string Visible label. * @access public */ function getLabel() { if ($this->getAttribute('title')) { return $this->getAttribute('title'); } return $this->getAttribute('alt'); } /** * Gets the values submitted as a form. * @return array Hash of name and values. * @access public */ function getSubmitValues($x, $y) { return array( $this->getName() . '.x' => $x, $this->getName() . '.y' => $y); } } /** * Submit button as button tag. * @package SimpleTest * @subpackage WebTester */ class SimpleButtonTag extends SimpleWidget { /** * Starts with a named tag with attributes only. * Defaults are very browser dependent. * @param hash $attributes Attribute names and * string values. */ function SimpleButtonTag($attributes) { $this->SimpleWidget('button', $attributes); } /** * Check to see if the tag can have both start and * end tags with content in between. * @return boolean True if content allowed. * @access public */ function expectEndTag() { return true; } /** * Disables the setting of the button value. * @param string $value Ignored. * @return boolean True if allowed. * @access public */ function setValue($value) { return false; } /** * Value of browser visible text. * @return string Visible label. * @access public */ function getLabel() { return $this->getContent(); } /** * Gets the values submitted as a form. Gone * for the Mozilla defaults values. * @return array Hash of name and values. * @access public */ function getSubmitValues() { if ($this->getAttribute('name') === false) { return array(); } if ($this->getAttribute('value') === false) { return array($this->getName() => ''); } return array($this->getName() => $this->getValue()); } } /** * Content tag for text area. * @package SimpleTest * @subpackage WebTester */ class SimpleTextAreaTag extends SimpleWidget { /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and * string values. */ function SimpleTextAreaTag($attributes) { $this->SimpleWidget('textarea', $attributes); } /** * Accessor for starting value. * @return string Parsed value. * @access public */ function getDefault() { if ($this->_wrapIsEnabled()) { return wordwrap( $this->getContent(), (integer)$this->getAttribute('cols'), "\n"); } return $this->getContent(); } /** * Applies word wrapping if needed. * @param string $value New value. * @return boolean True if allowed. * @access public */ function setValue($value) { if ($this->_wrapIsEnabled()) { $value = wordwrap( $value, (integer)$this->getAttribute('cols'), "\n"); } return parent::setValue($value); } /** * Test to see if text should be wrapped. * @return boolean True if wrapping on. * @access private */ function _wrapIsEnabled() { if ($this->getAttribute('cols')) { $wrap = $this->getAttribute('wrap'); if (($wrap == 'physical') || ($wrap == 'hard')) { return true; } } return false; } } /** * Checkbox widget. * @package SimpleTest * @subpackage WebTester */ class SimpleCheckboxTag extends SimpleWidget { /** * Starts with attributes only. * @param hash $attributes Attribute names and * string values. */ function SimpleCheckboxTag($attributes) { $this->SimpleWidget('input', $attributes); if ($this->getAttribute('value') === false) { $this->_setAttribute('value', 'on'); } } /** * Tag contains no content. * @return boolean False. * @access public */ function expectEndTag() { return false; } /** * The only allowed value in the one in the * "value" attribute. The default for this * attribute is "on". * @param string $value New value. * @return boolean True if allowed. * @access public */ function setValue($value) { if ($value === false) { return parent::setValue($value); } if ($value != $this->getAttribute('value')) { return false; } return parent::setValue($value); } /** * Accessor for starting value. The default * value is "on". * @return string Parsed value. * @access public */ function getDefault() { if ($this->getAttribute('checked')) { return $this->getAttribute('value'); } return false; } } /** * Drop down widget. * @package SimpleTest * @subpackage WebTester */ class SimpleSelectionTag extends SimpleWidget { var $_options; var $_choice; /** * Starts with attributes only. * @param hash $attributes Attribute names and * string values. */ function SimpleSelectionTag($attributes) { $this->SimpleWidget('select', $attributes); $this->_options = array(); $this->_choice = false; } /** * Adds an option tag to a selection field. * @param SimpleOptionTag $tag New option. * @access public */ function addTag(&$tag) { if ($tag->getTagName() == 'option') { $this->_options[] = &$tag; } } /** * Text within the selection element is ignored. * @param string $content Ignored. * @access public */ function addContent($content) { } /** * Scans options for defaults. If none, then * the first option is selected. * @return string Selected field. * @access public */ function getDefault() { for ($i = 0, $count = count($this->_options); $i < $count; $i++) { if ($this->_options[$i]->getAttribute('selected')) { return $this->_options[$i]->getDefault(); } } if ($count > 0) { return $this->_options[0]->getDefault(); } return ''; } /** * Can only set allowed values. * @param string $value New choice. * @return boolean True if allowed. * @access public */ function setValue($value) { for ($i = 0, $count = count($this->_options); $i < $count; $i++) { if (trim($this->_options[$i]->getContent()) == trim($value)) { $this->_choice = $i; return true; } } return false; } /** * Accessor for current selection value. * @return string Value attribute or * content of opton. * @access public */ function getValue() { if ($this->_choice === false) { return $this->getDefault(); } return $this->_options[$this->_choice]->getValue(); } } /** * Drop down widget. * @package SimpleTest * @subpackage WebTester */ class MultipleSelectionTag extends SimpleWidget { var $_options; var $_values; /** * Starts with attributes only. * @param hash $attributes Attribute names and * string values. */ function MultipleSelectionTag($attributes) { $this->SimpleWidget('select', $attributes); $this->_options = array(); $this->_values = false; } /** * Adds an option tag to a selection field. * @param SimpleOptionTag $tag New option. * @access public */ function addTag(&$tag) { if ($tag->getTagName() == 'option') { $this->_options[] = &$tag; } } /** * Text within the selection element is ignored. * @param string $content Ignored. * @access public */ function addContent($content) { } /** * Scans options for defaults to populate the * value array(). * @return array Selected fields. * @access public */ function getDefault() { $default = array(); for ($i = 0, $count = count($this->_options); $i < $count; $i++) { if ($this->_options[$i]->getAttribute('selected')) { $default[] = $this->_options[$i]->getDefault(); } } return $default; } /** * Can only set allowed values. * @param array $values New choices. * @return boolean True if allowed. * @access public */ function setValue($values) { foreach ($values as $value) { $is_option = false; for ($i = 0, $count = count($this->_options); $i < $count; $i++) { if (trim($this->_options[$i]->getContent()) == trim($value)) { $is_option = true; break; } } if (! $is_option) { return false; } } $this->_values = $values; return true; } /** * Accessor for current selection value. * @return array List of currently set options. * @access public */ function getValue() { if ($this->_values === false) { return $this->getDefault(); } return $this->_values; } } /** * Option for selection field. * @package SimpleTest * @subpackage WebTester */ class SimpleOptionTag extends SimpleWidget { /** * Stashes the attributes. */ function SimpleOptionTag($attributes) { $this->SimpleWidget('option', $attributes); } /** * Does nothing. * @param string $value Ignored. * @return boolean Not allowed. * @access public */ function setValue($value) { return false; } /** * Accessor for starting value. Will be set to * the option label if no value exists. * @return string Parsed value. * @access public */ function getDefault() { if ($this->getAttribute('value') === false) { return $this->getContent(); } return $this->getAttribute('value'); } } /** * Radio button. * @package SimpleTest * @subpackage WebTester */ class SimpleRadioButtonTag extends SimpleWidget { /** * Stashes the attributes. * @param array $attributes Hash of attributes. */ function SimpleRadioButtonTag($attributes) { $this->SimpleWidget('input', $attributes); if ($this->getAttribute('value') === false) { $this->_setAttribute('value', 'on'); } } /** * Tag contains no content. * @return boolean False. * @access public */ function expectEndTag() { return false; } /** * The only allowed value in the one in the * "value" attribute. * @param string $value New value. * @return boolean True if allowed. * @access public */ function setValue($value) { if ($value === false) { return parent::setValue($value); } if ($value != $this->getAttribute('value')) { return false; } return parent::setValue($value); } /** * Accessor for starting value. * @return string Parsed value. * @access public */ function getDefault() { if ($this->getAttribute('checked')) { return $this->getAttribute('value'); } return false; } } /** * A group of tags with the same name within a form. * @package SimpleTest * @subpackage WebTester */ class SimpleCheckboxGroup { var $_widgets; /** * Starts empty. * @access public */ function SimpleCheckboxGroup() { $this->_widgets = array(); } /** * Accessor for an attribute. * @param string $label Attribute name. * @return boolean Always false. * @access public */ function getAttribute($label) { return false; } /** * Scans the checkboxes for one with the appropriate * ID field. * @param string $id ID value to try. * @return boolean True if matched. * @access public */ function isId($id) { for ($i = 0, $count = count($this->_widgets); $i < $count; $i++) { if ($this->_widgets[$i]->isId($id)) { return true; } } return false; } /** * Adds a tag to the group. * @param SimpleWidget $widget * @access public */ function addWidget(&$widget) { $this->_widgets[] = &$widget; } /** * Fetches the name for the widget from the first * member. * @return string Name of widget. * @access public */ function getName() { if (count($this->_widgets) > 0) { return $this->_widgets[0]->getName(); } } /** * Accessor for current selected widget or false * if none. * @return string/array Widget values or false if none. * @access public */ function getValue() { $values = array(); for ($i = 0, $count = count($this->_widgets); $i < $count; $i++) { if ($this->_widgets[$i]->getValue()) { $values[] = $this->_widgets[$i]->getValue(); } } return $this->_coerceValues($values); } /** * Accessor for starting value that is active. * @return string/array Widget values or false if none. * @access public */ function getDefault() { $values = array(); for ($i = 0, $count = count($this->_widgets); $i < $count; $i++) { if ($this->_widgets[$i]->getDefault()) { $values[] = $this->_widgets[$i]->getDefault(); } } return $this->_coerceValues($values); } /** * Accessor for current set values. * @param string/array/boolean $values Either a single string, a * hash or false for nothing set. * @return boolean True if all values can be set. * @access public */ function setValue($values) { $values = $this->_makeArray($values); if (! $this->_valuesArePossible($values)) { return false; } for ($i = 0, $count = count($this->_widgets); $i < $count; $i++) { $possible = $this->_widgets[$i]->getAttribute('value'); if (in_array($this->_widgets[$i]->getAttribute('value'), $values)) { $this->_widgets[$i]->setValue($possible); } else { $this->_widgets[$i]->setValue(false); } } return true; } /** * Tests to see if a possible value set is legal. * @param string/array/boolean $values Either a single string, a * hash or false for nothing set. * @return boolean False if trying to set a * missing value. * @access private */ function _valuesArePossible($values) { $matches = array(); for ($i = 0, $count = count($this->_widgets); $i < $count; $i++) { $possible = $this->_widgets[$i]->getAttribute('value'); if (in_array($possible, $values)) { $matches[] = $possible; } } return ($values == $matches); } /** * Converts the output to an appropriate format. This means * that no values is false, a single value is just that * value and only two or more are contained in an array. * @param array $values List of values of widgets. * @return string/array/boolean Expected format for a tag. * @access private */ function _coerceValues($values) { if (count($values) == 0) { return false; } elseif (count($values) == 1) { return $values[0]; } else { return $values; } } /** * Converts false or string into array. The opposite of * the coercian method. * @param string/array/boolean $value A single item is converted * to a one item list. False * gives an empty list. * @return array List of values, possibly empty. * @access private */ function _makeArray($value) { if ($value === false) { return array(); } if (is_string($value)) { return array($value); } return $value; } } /** * A group of tags with the same name within a form. * Used for radio buttons. * @package SimpleTest * @subpackage WebTester */ class SimpleRadioGroup { var $_widgets; /** * Starts empty. * @access public */ function SimpleRadioGroup() { $this->_widgets = array(); } /** * Accessor for an attribute. * @param string $label Attribute name. * @return boolean Always false. * @access public */ function getAttribute($label) { return false; } /** * Scans the checkboxes for one with the appropriate * ID field. * @param string $id ID value to try. * @return boolean True if matched. * @access public */ function isId($id) { for ($i = 0, $count = count($this->_widgets); $i < $count; $i++) { if ($this->_widgets[$i]->isId($id)) { return true; } } return false; } /** * Adds a tag to the group. * @param SimpleWidget $widget * @access public */ function addWidget(&$widget) { $this->_widgets[] = &$widget; } /** * Fetches the name for the widget from the first * member. * @return string Name of widget. * @access public */ function getName() { if (count($this->_widgets) > 0) { return $this->_widgets[0]->getName(); } } /** * Each tag is tried in turn until one is * successfully set. The others will be * unchecked if successful. * @param string $value New value. * @return boolean True if any allowed. * @access public */ function setValue($value) { if (! $this->_valueIsPossible($value)) { return false; } $index = false; for ($i = 0, $count = count($this->_widgets); $i < $count; $i++) { if (! $this->_widgets[$i]->setValue($value)) { $this->_widgets[$i]->setValue(false); } } return true; } /** * Tests to see if a value is allowed. * @param string Attempted value. * @return boolean True if a valid value. * @access private */ function _valueIsPossible($value) { for ($i = 0, $count = count($this->_widgets); $i < $count; $i++) { if ($this->_widgets[$i]->getAttribute('value') == $value) { return true; } } return false; } /** * Accessor for current selected widget or false * if none. * @return string/boolean Value attribute or * content of opton. * @access public */ function getValue() { for ($i = 0, $count = count($this->_widgets); $i < $count; $i++) { if ($this->_widgets[$i]->getValue()) { return $this->_widgets[$i]->getValue(); } } return false; } /** * Accessor for starting value that is active. * @return string/boolean Value of first checked * widget or false if none. * @access public */ function getDefault() { for ($i = 0, $count = count($this->_widgets); $i < $count; $i++) { if ($this->_widgets[$i]->getDefault()) { return $this->_widgets[$i]->getDefault(); } } return false; } } /** * Tag to aid parsing the form. * @package SimpleTest * @subpackage WebTester */ class SimpleFormTag extends SimpleTag { /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and * string values. */ function SimpleFormTag($attributes) { $this->SimpleTag('form', $attributes); } } /** * Tag to aid parsing the frames in a page. * @package SimpleTest * @subpackage WebTester */ class SimpleFrameTag extends SimpleTag { /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and * string values. */ function SimpleFrameTag($attributes) { $this->SimpleTag('frame', $attributes); } /** * Tag contains no content. * @return boolean False. * @access public */ function expectEndTag() { return false; } } ?>pgfouine-1.2/tests/simpletest/remote.php0000644000175000017500000000741410334504436017133 0ustar acmeacme_url = $url; $this->_dry_url = $dry_url ? $dry_url : $url; $this->_size = false; } /** * Accessor for the test name for subclasses. * @return string Name of the test. * @access public */ function getLabel() { return $this->_url; } /** * Runs the top level test for this class. Currently * reads the data as a single chunk. I'll fix this * once I have added iteration to the browser. * @param SimpleReporter $reporter Target of test results. * @returns boolean True if no failures. * @access public */ function run(&$reporter) { $browser = &$this->_createBrowser(); $xml = $browser->get($this->_url); if (! $xml) { trigger_error('Cannot read remote test URL [' . $this->_url . ']'); return false; } $parser = &$this->_createParser($reporter); if (! $parser->parse($xml)) { trigger_error('Cannot parse incoming XML from [' . $this->_url . ']'); return false; } return true; } /** * Creates a new web browser object for fetching * the XML report. * @return SimpleBrowser New browser. * @access protected */ function &_createBrowser() { return new SimpleBrowser(); } /** * Creates the XML parser. * @param SimpleReporter $reporter Target of test results. * @return SimpleTestXmlListener XML reader. * @access protected */ function &_createParser(&$reporter) { return new SimpleTestXmlParser($reporter); } /** * Accessor for the number of subtests. * @return integer Number of test cases. * @access public */ function getSize() { if ($this->_size === false) { $browser = &$this->_createBrowser(); $xml = $browser->get($this->_dry_url); if (! $xml) { trigger_error('Cannot read remote test URL [' . $this->_dry_url . ']'); return false; } $reporter = &new SimpleReporter(); $parser = &$this->_createParser($reporter); if (! $parser->parse($xml)) { trigger_error('Cannot parse incoming XML from [' . $this->_dry_url . ']'); return false; } $this->_size = $reporter->getTestCaseCount(); } return $this->_size; } } ?>pgfouine-1.2/tests/simpletest/test/0000755000175000017500000000000011516212335016075 5ustar acmeacmepgfouine-1.2/tests/simpletest/test/real_sites_test.php0000644000175000017500000000226610334504436022010 0ustar acmeacmeassertTrue($this->get('http://www.lastcraft.com')); $this->assertResponse(array(200)); $this->assertMime(array('text/html')); $this->clickLink('About'); $this->assertTitle('About Last Craft'); } function testSourceforge() { $this->assertTrue($this->get('http://sourceforge.net/')); $this->setField('words', 'simpletest'); $this->assertTrue($this->clickImageByName('imageField')); $this->assertTitle('SourceForge.net: Search'); $this->assertTrue($this->clickLink('SimpleTest')); $this->clickLink('statistics'); $this->assertWantedPattern('/Statistics for the past 7 days/'); $this->assertTrue($this->setField('report', 'Monthly')); $this->clickSubmit('Change Stats View'); $this->assertWantedPattern('/Statistics for the past \d+ months/'); } } ?>pgfouine-1.2/tests/simpletest/test/browser_test.php0000644000175000017500000012001010334504436021325 0ustar acmeacmeassertIdentical($history->getMethod(), false); $this->assertIdentical($history->getUrl(), false); $this->assertIdentical($history->getParameters(), false); } function testCannotMoveInEmptyHistory() { $history = &new SimpleBrowserHistory(); $this->assertFalse($history->back()); $this->assertFalse($history->forward()); } function testCurrentTargetAccessors() { $history = &new SimpleBrowserHistory(); $history->recordEntry( 'GET', new SimpleUrl('http://www.here.com/'), new SimpleFormEncoding()); $this->assertIdentical($history->getMethod(), 'GET'); $this->assertIdentical($history->getUrl(), new SimpleUrl('http://www.here.com/')); $this->assertIdentical($history->getParameters(), new SimpleFormEncoding()); } function testSecondEntryAccessors() { $history = &new SimpleBrowserHistory(); $history->recordEntry( 'GET', new SimpleUrl('http://www.first.com/'), new SimpleFormEncoding()); $history->recordEntry( 'POST', new SimpleUrl('http://www.second.com/'), new SimpleFormEncoding(array('a' => 1))); $this->assertIdentical($history->getMethod(), 'POST'); $this->assertIdentical($history->getUrl(), new SimpleUrl('http://www.second.com/')); $this->assertIdentical( $history->getParameters(), new SimpleFormEncoding(array('a' => 1))); } function testGoingBackwards() { $history = &new SimpleBrowserHistory(); $history->recordEntry( 'GET', new SimpleUrl('http://www.first.com/'), new SimpleFormEncoding()); $history->recordEntry( 'POST', new SimpleUrl('http://www.second.com/'), new SimpleFormEncoding(array('a' => 1))); $this->assertTrue($history->back()); $this->assertIdentical($history->getMethod(), 'GET'); $this->assertIdentical($history->getUrl(), new SimpleUrl('http://www.first.com/')); $this->assertIdentical($history->getParameters(), new SimpleFormEncoding()); } function testGoingBackwardsOffBeginning() { $history = &new SimpleBrowserHistory(); $history->recordEntry( 'GET', new SimpleUrl('http://www.first.com/'), new SimpleFormEncoding()); $this->assertFalse($history->back()); $this->assertIdentical($history->getMethod(), 'GET'); $this->assertIdentical($history->getUrl(), new SimpleUrl('http://www.first.com/')); $this->assertIdentical($history->getParameters(), new SimpleFormEncoding()); } function testGoingForwardsOffEnd() { $history = &new SimpleBrowserHistory(); $history->recordEntry( 'GET', new SimpleUrl('http://www.first.com/'), new SimpleFormEncoding()); $this->assertFalse($history->forward()); $this->assertIdentical($history->getMethod(), 'GET'); $this->assertIdentical($history->getUrl(), new SimpleUrl('http://www.first.com/')); $this->assertIdentical($history->getParameters(), new SimpleFormEncoding()); } function testGoingBackwardsAndForwards() { $history = &new SimpleBrowserHistory(); $history->recordEntry( 'GET', new SimpleUrl('http://www.first.com/'), new SimpleFormEncoding()); $history->recordEntry( 'POST', new SimpleUrl('http://www.second.com/'), new SimpleFormEncoding(array('a' => 1))); $this->assertTrue($history->back()); $this->assertTrue($history->forward()); $this->assertIdentical($history->getMethod(), 'POST'); $this->assertIdentical($history->getUrl(), new SimpleUrl('http://www.second.com/')); $this->assertIdentical( $history->getParameters(), new SimpleFormEncoding(array('a' => 1))); } function testNewEntryReplacesNextOne() { $history = &new SimpleBrowserHistory(); $history->recordEntry( 'GET', new SimpleUrl('http://www.first.com/'), new SimpleFormEncoding()); $history->recordEntry( 'POST', new SimpleUrl('http://www.second.com/'), new SimpleFormEncoding(array('a' => 1))); $history->back(); $history->recordEntry( 'GET', new SimpleUrl('http://www.third.com/'), new SimpleFormEncoding()); $this->assertIdentical($history->getMethod(), 'GET'); $this->assertIdentical($history->getUrl(), new SimpleUrl('http://www.third.com/')); $this->assertIdentical($history->getParameters(), new SimpleFormEncoding()); } function testNewEntryDropsFutureEntries() { $history = &new SimpleBrowserHistory(); $history->recordEntry( 'GET', new SimpleUrl('http://www.first.com/'), new SimpleFormEncoding()); $history->recordEntry( 'GET', new SimpleUrl('http://www.second.com/'), new SimpleFormEncoding()); $history->recordEntry( 'GET', new SimpleUrl('http://www.third.com/'), new SimpleFormEncoding()); $history->back(); $history->back(); $history->recordEntry( 'GET', new SimpleUrl('http://www.fourth.com/'), new SimpleFormEncoding()); $this->assertIdentical($history->getUrl(), new SimpleUrl('http://www.fourth.com/')); $this->assertFalse($history->forward()); $history->back(); $this->assertIdentical($history->getUrl(), new SimpleUrl('http://www.first.com/')); $this->assertFalse($history->back()); } } class TestOfParsedPageAccess extends UnitTestCase { function &loadPage(&$page) { $response = &new MockSimpleHttpResponse($this); $agent = &new MockSimpleUserAgent($this); $agent->setReturnReference('fetchResponse', $response); $browser = &new MockParseSimpleBrowser($this); $browser->setReturnReference('_createUserAgent', $agent); $browser->setReturnReference('_parse', $page); $browser->SimpleBrowser(); $browser->get('http://this.com/page.html'); return $browser; } function testAccessorsWhenNoPage() { $agent = &new MockSimpleUserAgent($this); $browser = &new MockParseSimpleBrowser($this); $browser->setReturnReference('_createUserAgent', $agent); $browser->SimpleBrowser(); $this->assertEqual($browser->getContent(), ''); } function testParse() { $page = &new MockSimplePage($this); $page->setReturnValue('getRequest', "GET here.html\r\n\r\n"); $page->setReturnValue('getRaw', 'Raw HTML'); $page->setReturnValue('getTitle', 'Here'); $page->setReturnValue('getFrameFocus', 'Frame'); $page->setReturnValue('getMimeType', 'text/html'); $page->setReturnValue('getResponseCode', 200); $page->setReturnValue('getAuthentication', 'Basic'); $page->setReturnValue('getRealm', 'Somewhere'); $page->setReturnValue('getTransportError', 'Ouch!'); $browser = &$this->loadPage($page); $this->assertEqual($browser->getRequest(), "GET here.html\r\n\r\n"); $this->assertEqual($browser->getContent(), 'Raw HTML'); $this->assertEqual($browser->getTitle(), 'Here'); $this->assertEqual($browser->getFrameFocus(), 'Frame'); $this->assertIdentical($browser->getResponseCode(), 200); $this->assertEqual($browser->getMimeType(), 'text/html'); $this->assertEqual($browser->getAuthentication(), 'Basic'); $this->assertEqual($browser->getRealm(), 'Somewhere'); $this->assertEqual($browser->getTransportError(), 'Ouch!'); } function testLinkAffirmationWhenPresent() { $page = &new MockSimplePage($this); $page->setReturnValue('getUrlsByLabel', array('http://www.nowhere.com')); $page->expectOnce('getUrlsByLabel', array('a link label')); $browser = &$this->loadPage($page); $this->assertTrue($browser->isLink('a link label')); $page->tally(); } function testLinkAffirmationByIdWhenPresent() { $page = &new MockSimplePage($this); $page->setReturnValue('getUrlById', true, array(99)); $page->setReturnValue('getUrlById', false, array('*')); $browser = &$this->loadPage($page); $this->assertTrue($browser->isLinkById(99)); $this->assertFalse($browser->isLinkById(98)); $page->tally(); } function testFormHandling() { $page = &new MockSimplePage($this); $page->setReturnValue('getField', 'Value'); $page->expectOnce('getField', array('key')); $page->expectOnce('setField', array('key', 'Value')); $page->setReturnValue('getFieldById', 'Id value'); $page->expectOnce('getFieldById', array(99)); $page->expectOnce('setFieldById', array(99, 'Id value')); $browser = &$this->loadPage($page); $this->assertEqual($browser->getField('key'), 'Value'); $this->assertEqual($browser->getFieldById(99), 'Id value'); $browser->setField('key', 'Value'); $browser->setFieldById(99, 'Id value'); $page->tally(); } } class TestOfBrowserNavigation extends UnitTestCase { function &createBrowser(&$agent, &$page) { $browser = &new MockParseSimpleBrowser($this); $browser->setReturnReference('_createUserAgent', $agent); $browser->setReturnReference('_parse', $page); $browser->SimpleBrowser(); return $browser; } function testClickLinkRequestsPage() { $agent = &new MockSimpleUserAgent($this); $agent->setReturnReference('fetchResponse', new MockSimpleHttpResponse($this)); $agent->expectArgumentsAt( 0, 'fetchResponse', array('GET', new SimpleUrl('http://this.com/page.html'), false)); $agent->expectArgumentsAt( 1, 'fetchResponse', array('GET', new SimpleUrl('http://this.com/new.html'), false)); $agent->expectCallCount('fetchResponse', 2); $page = &new MockSimplePage($this); $page->setReturnValue('getUrlsByLabel', array(new SimpleUrl('http://this.com/new.html'))); $page->expectOnce('getUrlsByLabel', array('New')); $page->setReturnValue('getRaw', 'A page'); $browser = &$this->createBrowser($agent, $page); $browser->get('http://this.com/page.html'); $this->assertTrue($browser->clickLink('New')); $agent->tally(); $page->tally(); } function testClickLinkWithUnknownFrameStillRequestsWholePage() { $agent = &new MockSimpleUserAgent($this); $agent->setReturnReference('fetchResponse', new MockSimpleHttpResponse($this)); $agent->expectArgumentsAt( 0, 'fetchResponse', array('GET', new SimpleUrl('http://this.com/page.html'), false)); $target = new SimpleUrl('http://this.com/new.html'); $target->setTarget('missing'); $agent->expectArgumentsAt( 1, 'fetchResponse', array('GET', $target, false)); $agent->expectCallCount('fetchResponse', 2); $parsed_url = new SimpleUrl('http://this.com/new.html'); $parsed_url->setTarget('missing'); $page = &new MockSimplePage($this); $page->setReturnValue('getUrlsByLabel', array($parsed_url)); $page->setReturnValue('hasFrames', false); $page->expectOnce('getUrlsByLabel', array('New')); $page->setReturnValue('getRaw', 'A page'); $browser = &$this->createBrowser($agent, $page); $browser->get('http://this.com/page.html'); $this->assertTrue($browser->clickLink('New')); $agent->tally(); $page->tally(); } function testClickingMissingLinkFails() { $agent = &new MockSimpleUserAgent($this); $agent->setReturnReference('fetchResponse', new MockSimpleHttpResponse($this)); $page = &new MockSimplePage($this); $page->setReturnValue('getUrlsByLabel', array()); $page->setReturnValue('getRaw', 'stuff'); $browser = &$this->createBrowser($agent, $page); $this->assertTrue($browser->get('http://this.com/page.html')); $this->assertFalse($browser->clickLink('New')); } function testClickIndexedLink() { $agent = &new MockSimpleUserAgent($this); $agent->setReturnReference('fetchResponse', new MockSimpleHttpResponse($this)); $agent->expectArgumentsAt( 1, 'fetchResponse', array('GET', new SimpleUrl('1.html'), false)); $agent->expectCallCount('fetchResponse', 2); $page = &new MockSimplePage($this); $page->setReturnValue( 'getUrlsByLabel', array(new SimpleUrl('0.html'), new SimpleUrl('1.html'))); $page->setReturnValue('getRaw', 'A page'); $browser = &$this->createBrowser($agent, $page); $browser->get('http://this.com/page.html'); $this->assertTrue($browser->clickLink('New', 1)); $agent->tally(); } function testClinkLinkById() { $agent = &new MockSimpleUserAgent($this); $agent->setReturnReference('fetchResponse', new MockSimpleHttpResponse($this)); $agent->expectArgumentsAt(1, 'fetchResponse', array( 'GET', new SimpleUrl('http://this.com/link.html'), false)); $agent->expectCallCount('fetchResponse', 2); $page = &new MockSimplePage($this); $page->setReturnValue('getUrlById', new SimpleUrl('http://this.com/link.html')); $page->expectOnce('getUrlById', array(2)); $page->setReturnValue('getRaw', 'A page'); $browser = &$this->createBrowser($agent, $page); $browser->get('http://this.com/page.html'); $this->assertTrue($browser->clickLinkById(2)); $agent->tally(); $page->tally(); } function testClickingMissingLinkIdFails() { $agent = &new MockSimpleUserAgent($this); $agent->setReturnReference('fetchResponse', new MockSimpleHttpResponse($this)); $page = &new MockSimplePage($this); $page->setReturnValue('getUrlById', false); $browser = &$this->createBrowser($agent, $page); $browser->get('http://this.com/page.html'); $this->assertFalse($browser->clickLink(0)); } function testSubmitFormByLabel() { $agent = &new MockSimpleUserAgent($this); $agent->setReturnReference('fetchResponse', new MockSimpleHttpResponse($this)); $agent->expectArgumentsAt(1, 'fetchResponse', array( 'POST', new SimpleUrl('http://this.com/handler.html'), new SimpleFormEncoding(array('a' => 'A')))); $agent->expectCallCount('fetchResponse', 2); $form = &new MockSimpleForm($this); $form->setReturnValue('getAction', new SimpleUrl('http://this.com/handler.html')); $form->setReturnValue('getMethod', 'post'); $form->setReturnValue('submitButtonByLabel', new SimpleFormEncoding(array('a' => 'A'))); $form->expectOnce('submitButtonByLabel', array('Go', false)); $page = &new MockSimplePage($this); $page->setReturnReference('getFormBySubmitLabel', $form); $page->expectOnce('getFormBySubmitLabel', array('Go')); $page->setReturnValue('getRaw', 'stuff'); $browser = &$this->createBrowser($agent, $page); $browser->get('http://this.com/page.html'); $this->assertTrue($browser->clickSubmit('Go')); $agent->tally(); $page->tally(); $form->tally(); } function testDefaultSubmitFormByLabel() { $agent = &new MockSimpleUserAgent($this); $agent->setReturnReference('fetchResponse', new MockSimpleHttpResponse($this)); $agent->expectArgumentsAt(1, 'fetchResponse', array( 'GET', new SimpleUrl('http://this.com/page.html'), new SimpleFormEncoding(array('a' => 'A')))); $agent->expectCallCount('fetchResponse', 2); $form = &new MockSimpleForm($this); $form->setReturnValue('getAction', new SimpleUrl('http://this.com/page.html')); $form->setReturnValue('getMethod', 'get'); $form->setReturnValue('submitButtonByLabel', new SimpleFormEncoding(array('a' => 'A'))); $page = &new MockSimplePage($this); $page->setReturnReference('getFormBySubmitLabel', $form); $page->expectOnce('getFormBySubmitLabel', array('Submit')); $page->setReturnValue('getRaw', 'stuff'); $page->setReturnValue('getUrl', new SimpleUrl('http://this.com/page.html')); $browser = &$this->createBrowser($agent, $page); $browser->get('http://this.com/page.html'); $this->assertTrue($browser->clickSubmit()); $agent->tally(); $page->tally(); $form->tally(); } function testSubmitFormByName() { $agent = &new MockSimpleUserAgent($this); $agent->setReturnReference('fetchResponse', new MockSimpleHttpResponse($this)); $form = &new MockSimpleForm($this); $form->setReturnValue('getAction', new SimpleUrl('http://this.com/handler.html')); $form->setReturnValue('getMethod', 'post'); $form->setReturnValue('submitButtonByName', new SimpleFormEncoding(array('a' => 'A'))); $page = &new MockSimplePage($this); $page->setReturnReference('getFormBySubmitName', $form); $page->expectOnce('getFormBySubmitName', array('me')); $page->setReturnValue('getRaw', 'stuff'); $browser = &$this->createBrowser($agent, $page); $browser->get('http://this.com/page.html'); $this->assertTrue($browser->clickSubmitByName('me')); $page->tally(); } function testSubmitFormById() { $agent = &new MockSimpleUserAgent($this); $agent->setReturnReference('fetchResponse', new MockSimpleHttpResponse($this)); $form = &new MockSimpleForm($this); $form->setReturnValue('getAction', new SimpleUrl('http://this.com/handler.html')); $form->setReturnValue('getMethod', 'post'); $form->setReturnValue('submitButtonById', new SimpleFormEncoding(array('a' => 'A'))); $form->expectOnce('submitButtonById', array(99, false)); $page = &new MockSimplePage($this); $page->setReturnReference('getFormBySubmitId', $form); $page->expectOnce('getFormBySubmitId', array(99)); $page->setReturnValue('getRaw', 'stuff'); $browser = &$this->createBrowser($agent, $page); $browser->get('http://this.com/page.html'); $this->assertTrue($browser->clickSubmitById(99)); $page->tally(); $form->tally(); } function testSubmitFormByImageLabel() { $agent = &new MockSimpleUserAgent($this); $agent->setReturnReference('fetchResponse', new MockSimpleHttpResponse($this)); $form = &new MockSimpleForm($this); $form->setReturnValue('getAction', new SimpleUrl('http://this.com/handler.html')); $form->setReturnValue('getMethod', 'post'); $form->setReturnValue('submitImageByLabel', new SimpleFormEncoding(array('a' => 'A'))); $form->expectOnce('submitImageByLabel', array('Go!', 10, 11, false)); $page = &new MockSimplePage($this); $page->setReturnReference('getFormByImageLabel', $form); $page->expectOnce('getFormByImageLabel', array('Go!')); $page->setReturnValue('getRaw', 'stuff'); $browser = &$this->createBrowser($agent, $page); $browser->get('http://this.com/page.html'); $this->assertTrue($browser->clickImage('Go!', 10, 11)); $page->tally(); $form->tally(); } function testSubmitFormByImageName() { $agent = &new MockSimpleUserAgent($this); $agent->setReturnReference('fetchResponse', new MockSimpleHttpResponse($this)); $form = &new MockSimpleForm($this); $form->setReturnValue('getAction', new SimpleUrl('http://this.com/handler.html')); $form->setReturnValue('getMethod', 'post'); $form->setReturnValue('submitImageByName', new SimpleFormEncoding(array('a' => 'A'))); $form->expectOnce('submitImageByName', array('a', 10, 11, false)); $page = &new MockSimplePage($this); $page->setReturnReference('getFormByImageName', $form); $page->expectOnce('getFormByImageName', array('a')); $page->setReturnValue('getRaw', 'stuff'); $browser = &$this->createBrowser($agent, $page); $browser->get('http://this.com/page.html'); $this->assertTrue($browser->clickImageByName('a', 10, 11)); $page->tally(); $form->tally(); } function testSubmitFormByImageId() { $agent = &new MockSimpleUserAgent($this); $agent->setReturnReference('fetchResponse', new MockSimpleHttpResponse($this)); $form = &new MockSimpleForm($this); $form->setReturnValue('getAction', new SimpleUrl('http://this.com/handler.html')); $form->setReturnValue('getMethod', 'post'); $form->setReturnValue('submitImageById', new SimpleFormEncoding(array('a' => 'A'))); $form->expectOnce('submitImageById', array(99, 10, 11, false)); $page = &new MockSimplePage($this); $page->setReturnReference('getFormByImageId', $form); $page->expectOnce('getFormByImageId', array(99)); $page->setReturnValue('getRaw', 'stuff'); $browser = &$this->createBrowser($agent, $page); $browser->get('http://this.com/page.html'); $this->assertTrue($browser->clickImageById(99, 10, 11)); $page->tally(); $form->tally(); } function testSubmitFormByFormId() { $agent = &new MockSimpleUserAgent($this); $agent->setReturnReference('fetchResponse', new MockSimpleHttpResponse($this)); $agent->expectArgumentsAt(1, 'fetchResponse', array( 'POST', new SimpleUrl('http://this.com/handler.html'), new SimpleFormEncoding(array('a' => 'A')))); $agent->expectCallCount('fetchResponse', 2); $form = &new MockSimpleForm($this); $form->setReturnValue('getAction', new SimpleUrl('http://this.com/handler.html')); $form->setReturnValue('getMethod', 'post'); $form->setReturnValue('submit', new SimpleFormEncoding(array('a' => 'A'))); $page = &new MockSimplePage($this); $page->setReturnReference('getFormById', $form); $page->expectOnce('getFormById', array(33)); $page->setReturnValue('getRaw', 'stuff'); $browser = &$this->createBrowser($agent, $page); $browser->get('http://this.com/page.html'); $this->assertTrue($browser->submitFormById(33)); $agent->tally(); $page->tally(); } } class TestOfBrowserFrames extends UnitTestCase { function &createBrowser(&$agent) { $browser = &new MockUserAgentSimpleBrowser($this); $browser->setReturnReference('_createUserAgent', $agent); $browser->SimpleBrowser(); return $browser; } function &createUserAgent($pages) { $agent = &new MockSimpleUserAgent($this); foreach ($pages as $url => $raw) { $url = new SimpleUrl($url); $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getUrl', $url); $response->setReturnValue('getContent', $raw); $agent->setReturnReference('fetchResponse', $response, array('*', $url, '*')); } return $agent; } function testSimplePageHasNoFrames() { $browser = &$this->createBrowser($this->createUserAgent( array('http://site.with.no.frames/' => 'A non-framed page'))); $this->assertEqual( $browser->get('http://site.with.no.frames/'), 'A non-framed page'); $this->assertIdentical($browser->getFrames(), 'http://site.with.no.frames/'); } function testFramesetWithNoFrames() { $browser = &$this->createBrowser($this->createUserAgent( array('http://site.with.no.frames/' => ''))); $this->assertEqual( $browser->get('http://site.with.no.frames/'), ''); $this->assertIdentical($browser->getFrames(), array()); } function testFramesetWithSingleFrame() { $frameset = ''; $browser = &$this->createBrowser($this->createUserAgent(array( 'http://site.with.one.frame/' => $frameset, 'http://site.with.one.frame/frame.html' => 'A frame'))); $this->assertEqual( $browser->get('http://site.with.one.frame/'), 'A frame'); $this->assertIdentical( $browser->getFrames(), array('a' => 'http://site.with.one.frame/frame.html')); } function testTitleTakenFromFramesetPage() { $frameset = 'Frameset title' . ''; $browser = &$this->createBrowser($this->createUserAgent(array( 'http://site.with.one.frame/' => $frameset, 'http://site.with.one.frame/frame.html' => 'Page title'))); $browser->get('http://site.with.one.frame/'); $this->assertEqual($browser->getTitle(), 'Frameset title'); } function testFramesetWithSingleUnnamedFrame() { $frameset = ''; $browser = &$this->createBrowser($this->createUserAgent(array( 'http://site.with.one.frame/' => $frameset, 'http://site.with.one.frame/frame.html' => 'One frame'))); $this->assertEqual( $browser->get('http://site.with.one.frame/'), 'One frame'); $this->assertIdentical( $browser->getFrames(), array(1 => 'http://site.with.one.frame/frame.html')); } function testFramesetWithMultipleFrames() { $frameset = '' . '' . '' . '' . ''; $browser = &$this->createBrowser($this->createUserAgent(array( 'http://site.with.frames/' => $frameset, 'http://site.with.frames/frame_a.html' => 'A frame', 'http://site.with.frames/frame_b.html' => 'B frame', 'http://site.with.frames/frame_c.html' => 'C frame'))); $this->assertEqual( $browser->get('http://site.with.frames/'), 'A frameB frameC frame'); $this->assertIdentical($browser->getFrames(), array( 'a' => 'http://site.with.frames/frame_a.html', 'b' => 'http://site.with.frames/frame_b.html', 'c' => 'http://site.with.frames/frame_c.html')); } function testFrameFocusByName() { $frameset = '' . '' . '' . '' . ''; $browser = &$this->createBrowser($this->createUserAgent(array( 'http://site.with.frames/' => $frameset, 'http://site.with.frames/frame_a.html' => 'A frame', 'http://site.with.frames/frame_b.html' => 'B frame', 'http://site.with.frames/frame_c.html' => 'C frame'))); $browser->get('http://site.with.frames/'); $browser->setFrameFocus('a'); $this->assertEqual($browser->getContent(), 'A frame'); $browser->setFrameFocus('b'); $this->assertEqual($browser->getContent(), 'B frame'); $browser->setFrameFocus('c'); $this->assertEqual($browser->getContent(), 'C frame'); } function testFramesetWithSomeNamedFrames() { $frameset = '' . '' . '' . '' . '' . ''; $browser = &$this->createBrowser($this->createUserAgent(array( 'http://site.with.frames/' => $frameset, 'http://site.with.frames/frame_a.html' => 'A frame', 'http://site.with.frames/frame_b.html' => 'B frame', 'http://site.with.frames/frame_c.html' => 'C frame', 'http://site.with.frames/frame_d.html' => 'D frame'))); $this->assertEqual( $browser->get('http://site.with.frames/'), 'A frameB frameC frameD frame'); $this->assertIdentical($browser->getFrames(), array( 'a' => 'http://site.with.frames/frame_a.html', 2 => 'http://site.with.frames/frame_b.html', 'c' => 'http://site.with.frames/frame_c.html', 4 => 'http://site.with.frames/frame_d.html')); } function testFrameFocusWithMixedNamesAndIndexes() { $frameset = '' . '' . '' . '' . '' . ''; $browser = &$this->createBrowser($this->createUserAgent(array( 'http://site.with.frames/' => $frameset, 'http://site.with.frames/frame_a.html' => 'A frame', 'http://site.with.frames/frame_b.html' => 'B frame', 'http://site.with.frames/frame_c.html' => 'C frame', 'http://site.with.frames/frame_d.html' => 'D frame'))); $browser->get('http://site.with.frames/'); $browser->setFrameFocus('a'); $this->assertEqual($browser->getContent(), 'A frame'); $browser->setFrameFocus(2); $this->assertEqual($browser->getContent(), 'B frame'); $browser->setFrameFocus('c'); $this->assertEqual($browser->getContent(), 'C frame'); $browser->setFrameFocus(4); $this->assertEqual($browser->getContent(), 'D frame'); $browser->clearFrameFocus(); $this->assertEqual($browser->getContent(), 'A frameB frameC frameD frame'); } function testNestedFrameset() { $inner = '' . '' . ''; $outer = '' . '' . ''; $browser = &$this->createBrowser($this->createUserAgent(array( 'http://site.with.nested.frame/' => $outer, 'http://site.with.nested.frame/inner.html' => $inner, 'http://site.with.nested.frame/page.html' => 'The page'))); $this->assertEqual( $browser->get('http://site.with.nested.frame/'), 'The page'); $this->assertIdentical($browser->getFrames(), array( 'inner' => array( 'page' => 'http://site.with.nested.frame/page.html'))); } function testCanNavigateToNestedFrame() { $inner = '' . '' . '' . ''; $outer = '' . '' . '' . ''; $browser = &$this->createBrowser($this->createUserAgent(array( 'http://site.with.nested.frames/' => $outer, 'http://site.with.nested.frames/inner.html' => $inner, 'http://site.with.nested.frames/one.html' => 'Page one', 'http://site.with.nested.frames/two.html' => 'Page two', 'http://site.with.nested.frames/three.html' => 'Page three'))); $browser->get('http://site.with.nested.frames/'); $this->assertEqual($browser->getContent(), 'Page onePage twoPage three'); $this->assertTrue($browser->setFrameFocus('inner')); $this->assertEqual($browser->getFrameFocus(), array('inner')); $this->assertTrue($browser->setFrameFocus('one')); $this->assertEqual($browser->getFrameFocus(), array('inner', 'one')); $this->assertEqual($browser->getContent(), 'Page one'); $this->assertTrue($browser->setFrameFocus('two')); $this->assertEqual($browser->getFrameFocus(), array('inner', 'two')); $this->assertEqual($browser->getContent(), 'Page two'); $browser->clearFrameFocus(); $this->assertTrue($browser->setFrameFocus('three')); $this->assertEqual($browser->getFrameFocus(), array('three')); $this->assertEqual($browser->getContent(), 'Page three'); $this->assertTrue($browser->setFrameFocus('inner')); $this->assertEqual($browser->getContent(), 'Page onePage two'); } function testCanNavigateToNestedFrameByIndex() { $inner = '' . '' . '' . ''; $outer = '' . '' . '' . ''; $browser = &$this->createBrowser($this->createUserAgent(array( 'http://site.with.nested.frames/' => $outer, 'http://site.with.nested.frames/inner.html' => $inner, 'http://site.with.nested.frames/one.html' => 'Page one', 'http://site.with.nested.frames/two.html' => 'Page two', 'http://site.with.nested.frames/three.html' => 'Page three'))); $browser->get('http://site.with.nested.frames/'); $this->assertEqual($browser->getContent(), 'Page onePage twoPage three'); $this->assertTrue($browser->setFrameFocusByIndex(1)); $this->assertEqual($browser->getFrameFocus(), array(1)); $this->assertTrue($browser->setFrameFocusByIndex(1)); $this->assertEqual($browser->getFrameFocus(), array(1, 1)); $this->assertEqual($browser->getContent(), 'Page one'); $this->assertTrue($browser->setFrameFocusByIndex(2)); $this->assertEqual($browser->getFrameFocus(), array(1, 2)); $this->assertEqual($browser->getContent(), 'Page two'); $browser->clearFrameFocus(); $this->assertTrue($browser->setFrameFocusByIndex(2)); $this->assertEqual($browser->getFrameFocus(), array(2)); $this->assertEqual($browser->getContent(), 'Page three'); $this->assertTrue($browser->setFrameFocusByIndex(1)); $this->assertEqual($browser->getContent(), 'Page onePage two'); } } ?>pgfouine-1.2/tests/simpletest/test/expectation_test.php0000644000175000017500000002522510334504436022201 0ustar acmeacmeassertTrue($is_true->test(true)); $this->assertFalse($is_true->test(false)); $this->assertWantedPattern( '/equal expectation.*?boolean: true/i', $is_true->testMessage(true)); $this->assertWantedPattern( '/fails.*?boolean.*?boolean/i', $is_true->testMessage(false)); } function testStringMatch() { $hello = &new EqualExpectation("Hello"); $this->assertTrue($hello->test("Hello")); $this->assertFalse($hello->test("Goodbye")); $this->assertWantedPattern('/Equal expectation.*?Hello/', $hello->testMessage("Hello")); $this->assertWantedPattern('/fails/', $hello->testMessage("Goodbye")); $this->assertWantedPattern('/fails.*?goodbye/i', $hello->testMessage("Goodbye")); } function testStringPosition() { $comparisons = array( "ab" => 2, "a" => 1, "abcz" => 3, "abz" => 2, "az" => 1, "z" => 0); $str = &new EqualExpectation("abc"); foreach ($comparisons as $compare => $position) { $this->assertWantedPattern( "/at character $position/", $str->testMessage($compare)); } $str = &new EqualExpectation("abcd"); foreach ($comparisons as $compare => $position) { $this->assertWantedPattern( "/at character $position/", $str->testMessage($compare)); } } function testInteger() { $fifteen = &new EqualExpectation(15); $this->assertTrue($fifteen->test(15)); $this->assertFalse($fifteen->test(14)); $this->assertWantedPattern( '/equal expectation.*?15/i', $fifteen->testMessage(15)); $this->assertWantedPattern( '/fails.*?15.*?14/i', $fifteen->testMessage(14)); } function testFloat() { $pi = &new EqualExpectation(3.14); $this->assertTrue($pi->test(3.14)); $this->assertFalse($pi->test(3.15)); $this->assertWantedPattern( '/float.*?3\.14/i', $pi->testMessage(3.14)); $this->assertWantedPattern( '/fails.*?3\.14.*?3\.15/i', $pi->testMessage(3.15)); } function testArray() { $colours = &new EqualExpectation(array("r", "g", "b")); $this->assertTrue($colours->test(array("r", "g", "b"))); $this->assertFalse($colours->test(array("g", "b", "r"))); $this->assertEqual( $colours->testMessage(array("r", "g", "b")), "Equal expectation [Array: 3 items]"); $this->assertWantedPattern('/fails/', $colours->testMessage(array("r", "g", "z"))); $this->assertWantedPattern( '/\[2\] at character 0/', $colours->testMessage(array("r", "g", "z"))); $this->assertWantedPattern( '/key.*? does not match/', $colours->testMessage(array("r", "g"))); $this->assertWantedPattern( '/key.*? does not match/', $colours->testMessage(array("r", "g", "b", "z"))); } function testHash() { $is_blue = &new EqualExpectation(array("r" => 0, "g" => 0, "b" => 255)); $this->assertTrue($is_blue->test(array("r" => 0, "g" => 0, "b" => 255))); $this->assertFalse($is_blue->test(array("r" => 0, "g" => 255, "b" => 0))); $this->assertWantedPattern( '/array.*?3 items/i', $is_blue->testMessage(array("r" => 0, "g" => 0, "b" => 255))); $this->assertWantedPattern( '/fails.*?\[b\]/', $is_blue->testMessage(array("r" => 0, "g" => 0, "b" => 254))); } function testNestedHash() { $tree = &new EqualExpectation(array( "a" => 1, "b" => array( "c" => 2, "d" => "Three"))); $this->assertWantedPattern( '/member.*?\[b\].*?\[d\].*?at character 5/', $tree->testMessage(array( "a" => 1, "b" => array( "c" => 2, "d" => "Threeish")))); } function testHashWithOutOfOrderKeysShouldStillMatch() { $any_order = &new EqualExpectation(array('a' => 1, 'b' => 2)); $this->assertTrue($any_order->test(array('b' => 2, 'a' => 1))); } } class TestOfInequality extends UnitTestCase { function testStringMismatch() { $not_hello = &new NotEqualExpectation("Hello"); $this->assertTrue($not_hello->test("Goodbye")); $this->assertFalse($not_hello->test("Hello")); $this->assertWantedPattern( '/at character 0/', $not_hello->testMessage("Goodbye")); $this->assertWantedPattern( '/matches/', $not_hello->testMessage("Hello")); } } class RecursiveNasty { var $_me; function RecursiveNasty() { $this->_me = $this; } } class TestOfIdentity extends UnitTestCase { function testType() { $string = &new IdenticalExpectation("37"); $this->assertTrue($string->test("37")); $this->assertFalse($string->test(37)); $this->assertFalse($string->test("38")); $this->assertWantedPattern( '/identical.*?string.*?37/i', $string->testMessage("37")); $this->assertWantedPattern( '/fails.*?37/', $string->testMessage(37)); $this->assertWantedPattern( '/at character 1/', $string->testMessage("38")); } function _testNastyPhp5Bug() { $this->assertFalse(new RecursiveNasty() != new RecursiveNasty()); } function _testReallyHorribleRecursiveStructure() { $hopeful = &new IdenticalExpectation(new RecursiveNasty()); $this->assertTrue($hopeful->test(new RecursiveNasty())); } } class TestOfNonIdentity extends UnitTestCase { function testType() { $string = &new NotIdenticalExpectation("37"); $this->assertTrue($string->test("38")); $this->assertTrue($string->test(37)); $this->assertFalse($string->test("37")); $this->assertWantedPattern( '/at character 1/', $string->testMessage("38")); $this->assertWantedPattern( '/passes.*?type/', $string->testMessage(37)); } } class TestOfPatterns extends UnitTestCase { function testWanted() { $pattern = &new WantedPatternExpectation('/hello/i'); $this->assertTrue($pattern->test("Hello world")); $this->assertFalse($pattern->test("Goodbye world")); } function testUnwanted() { $pattern = &new UnwantedPatternExpectation('/hello/i'); $this->assertFalse($pattern->test("Hello world")); $this->assertTrue($pattern->test("Goodbye world")); } } class ExpectedMethodTarget { function hasThisMethod() {} } class TestOfMethodExistence extends UnitTestCase { function testHasMethod() { $instance = &new ExpectedMethodTarget(); $expectation = &new MethodExistsExpectation('hasThisMethod'); $this->assertTrue($expectation->test($instance)); $expectation = &new MethodExistsExpectation('doesNotHaveThisMethod'); $this->assertFalse($expectation->test($instance)); } } class TestOfIsA extends UnitTestCase { function testString() { $expectation = &new IsAExpectation('string'); $this->assertTrue($expectation->test('Hello')); $this->assertFalse($expectation->test(5)); } function testBoolean() { $expectation = &new IsAExpectation('boolean'); $this->assertTrue($expectation->test(true)); $this->assertFalse($expectation->test(1)); } function testBool() { $expectation = &new IsAExpectation('bool'); $this->assertTrue($expectation->test(true)); $this->assertFalse($expectation->test(1)); } function testDouble() { $expectation = &new IsAExpectation('double'); $this->assertTrue($expectation->test(5.0)); $this->assertFalse($expectation->test(5)); } function testFloat() { $expectation = &new IsAExpectation('float'); $this->assertTrue($expectation->test(5.0)); $this->assertFalse($expectation->test(5)); } function testReal() { $expectation = &new IsAExpectation('real'); $this->assertTrue($expectation->test(5.0)); $this->assertFalse($expectation->test(5)); } function testInteger() { $expectation = &new IsAExpectation('integer'); $this->assertTrue($expectation->test(5)); $this->assertFalse($expectation->test(5.0)); } function testInt() { $expectation = &new IsAExpectation('int'); $this->assertTrue($expectation->test(5)); $this->assertFalse($expectation->test(5.0)); } } class TestOfNotA extends UnitTestCase { function testString() { $expectation = &new NotAExpectation('string'); $this->assertFalse($expectation->test('Hello')); $this->assertTrue($expectation->test(5)); } } ?>pgfouine-1.2/tests/simpletest/test/form_test.php0000644000175000017500000003714110334504436020621 0ustar acmeacme 'GET', 'action' => 'here.php', 'id' => '33')); $form = &new SimpleForm($tag, new SimpleUrl('http://host/a/index.html')); $this->assertEqual($form->getMethod(), 'get'); $this->assertEqual( $form->getAction(), new SimpleUrl('http://host/a/here.php')); $this->assertIdentical($form->getId(), '33'); $this->assertNull($form->getValue('a')); } function testEmptyAction() { $tag = &new SimpleFormTag(array('method' => 'GET', 'action' => '', 'id' => '33')); $form = &new SimpleForm($tag, new SimpleUrl('http://host/a/index.html')); $this->assertEqual( $form->getAction(), new SimpleUrl('http://host/a/index.html')); } function testMissingAction() { $tag = &new SimpleFormTag(array('method' => 'GET', 'id' => '33')); $form = &new SimpleForm($tag, new SimpleUrl('http://host/a/index.html')); $this->assertEqual( $form->getAction(), new SimpleUrl('http://host/a/index.html')); } function testRootAction() { $tag = &new SimpleFormTag(array('method' => 'GET', 'action' => '/', 'id' => '33')); $form = &new SimpleForm($tag, new SimpleUrl('http://host/a/index.html')); $this->assertEqual( $form->getAction(), new SimpleUrl('http://host/')); } function testDefaultFrameTargetOnForm() { $tag = &new SimpleFormTag(array('method' => 'GET', 'action' => 'here.php', 'id' => '33')); $form = &new SimpleForm($tag, new SimpleUrl('http://host/a/index.html')); $form->setDefaultTarget('frame'); $expected = new SimpleUrl('http://host/a/here.php'); $expected->setTarget('frame'); $this->assertEqual($form->getAction(), $expected); } function testTextWidget() { $form = &new SimpleForm( new SimpleFormTag(array()), new SimpleUrl('htp://host')); $form->addWidget(new SimpleTextTag( array('name' => 'me', 'type' => 'text', 'value' => 'Myself'))); $this->assertIdentical($form->getValue('me'), 'Myself'); $this->assertTrue($form->setField('me', 'Not me')); $this->assertFalse($form->setField('not_present', 'Not me')); $this->assertIdentical($form->getValue('me'), 'Not me'); $this->assertNull($form->getValue('not_present')); } function testTextWidgetById() { $form = &new SimpleForm( new SimpleFormTag(array()), new SimpleUrl('htp://host')); $form->addWidget(new SimpleTextTag( array('name' => 'me', 'type' => 'text', 'value' => 'Myself', 'id' => 50))); $this->assertIdentical($form->getValueById(50), 'Myself'); $this->assertTrue($form->setFieldById(50, 'Not me')); $this->assertIdentical($form->getValueById(50), 'Not me'); } function testSubmitEmpty() { $form = &new SimpleForm( new SimpleFormTag(array()), new SimpleUrl('htp://host')); $this->assertIdentical($form->submit(), new SimpleFormEncoding()); } function testSubmitButton() { $form = &new SimpleForm( new SimpleFormTag(array()), new SimpleUrl('http://host')); $form->addWidget(new SimpleSubmitTag( array('type' => 'submit', 'name' => 'go', 'value' => 'Go!', 'id' => '9'))); $this->assertTrue($form->hasSubmitName('go')); $this->assertEqual($form->getValue('go'), 'Go!'); $this->assertEqual($form->getValueById(9), 'Go!'); $this->assertEqual( $form->submitButtonByName('go'), new SimpleFormEncoding(array('go' => 'Go!'))); $this->assertEqual( $form->submitButtonByLabel('Go!'), new SimpleFormEncoding(array('go' => 'Go!'))); $this->assertEqual( $form->submitButtonById(9), new SimpleFormEncoding(array('go' => 'Go!'))); } function testSubmitWithAdditionalParameters() { $form = &new SimpleForm( new SimpleFormTag(array()), new SimpleUrl('http://host')); $form->addWidget(new SimpleSubmitTag( array('type' => 'submit', 'name' => 'go', 'value' => 'Go!', 'id' => '9'))); $this->assertEqual( $form->submitButtonByName('go', array('a' => 'A')), new SimpleFormEncoding(array('go' => 'Go!', 'a' => 'A'))); $this->assertEqual( $form->submitButtonByLabel('Go!', array('a' => 'A')), new SimpleFormEncoding(array('go' => 'Go!', 'a' => 'A'))); $this->assertEqual( $form->submitButtonById(9, array('a' => 'A')), new SimpleFormEncoding(array('go' => 'Go!', 'a' => 'A'))); } function testSubmitButtonWithLabelOfSubmit() { $form = &new SimpleForm( new SimpleFormTag(array()), new SimpleUrl('http://host')); $form->addWidget(new SimpleSubmitTag( array('type' => 'submit', 'name' => 'test', 'value' => 'Submit', 'id' => '9'))); $this->assertTrue($form->hasSubmitName('test')); $this->assertEqual($form->getValue('test'), 'Submit'); $this->assertEqual($form->getValueById(9), 'Submit'); $this->assertEqual( $form->submitButtonByName('test'), new SimpleFormEncoding(array('test' => 'Submit'))); $this->assertEqual( $form->submitButtonByLabel('Submit'), new SimpleFormEncoding(array('test' => 'Submit'))); $this->assertEqual( $form->submitButtonById(9), new SimpleFormEncoding(array('test' => 'Submit'))); } function testSubmitButtonWithWhitespacePaddedLabelOfSubmit() { $form = &new SimpleForm( new SimpleFormTag(array()), new SimpleUrl('http://host')); $form->addWidget(new SimpleSubmitTag( array('type' => 'submit', 'name' => 'test', 'value' => ' Submit ', 'id' => '9'))); $this->assertEqual($form->getValue('test'), ' Submit '); $this->assertEqual($form->getValueById(9), ' Submit '); $this->assertEqual( $form->submitButtonByLabel('Submit'), new SimpleFormEncoding(array('test' => ' Submit '))); } function testImageSubmitButton() { $form = &new SimpleForm( new SimpleFormTag(array()), new SimpleUrl('htp://host')); $form->addWidget(new SimpleImageSubmitTag(array( 'type' => 'image', 'src' => 'source.jpg', 'name' => 'go', 'alt' => 'Go!', 'id' => '9'))); $this->assertTrue($form->hasImageLabel('Go!')); $this->assertEqual( $form->submitImageByLabel('Go!', 100, 101), new SimpleFormEncoding(array('go.x' => 100, 'go.y' => 101))); $this->assertTrue($form->hasImageName('go')); $this->assertEqual( $form->submitImageByName('go', 100, 101), new SimpleFormEncoding(array('go.x' => 100, 'go.y' => 101))); $this->assertTrue($form->hasImageId(9)); $this->assertEqual( $form->submitImageById(9, 100, 101), new SimpleFormEncoding(array('go.x' => 100, 'go.y' => 101))); } function testImageSubmitButtonWithAdditionalData() { $form = &new SimpleForm( new SimpleFormTag(array()), new SimpleUrl('htp://host')); $form->addWidget(new SimpleImageSubmitTag(array( 'type' => 'image', 'src' => 'source.jpg', 'name' => 'go', 'alt' => 'Go!', 'id' => '9'))); $this->assertEqual( $form->submitImageByLabel('Go!', 100, 101, array('a' => 'A')), new SimpleFormEncoding(array('go.x' => 100, 'go.y' => 101, 'a' => 'A'))); $this->assertTrue($form->hasImageName('go')); $this->assertEqual( $form->submitImageByName('go', 100, 101, array('a' => 'A')), new SimpleFormEncoding(array('go.x' => 100, 'go.y' => 101, 'a' => 'A'))); $this->assertTrue($form->hasImageId(9)); $this->assertEqual( $form->submitImageById(9, 100, 101, array('a' => 'A')), new SimpleFormEncoding(array('go.x' => 100, 'go.y' => 101, 'a' => 'A'))); } function testButtonTag() { $form = &new SimpleForm( new SimpleFormTag(array()), new SimpleUrl('http://host')); $widget = &new SimpleButtonTag( array('type' => 'submit', 'name' => 'go', 'value' => 'Go', 'id' => '9')); $widget->addContent('Go!'); $form->addWidget($widget); $this->assertTrue($form->hasSubmitName('go')); $this->assertTrue($form->hasSubmitLabel('Go!')); $this->assertEqual( $form->submitButtonByName('go'), new SimpleFormEncoding(array('go' => 'Go'))); $this->assertEqual( $form->submitButtonByLabel('Go!'), new SimpleFormEncoding(array('go' => 'Go'))); $this->assertEqual( $form->submitButtonById(9), new SimpleFormEncoding(array('go' => 'Go'))); } function testSingleSelectFieldSubmitted() { $form = &new SimpleForm( new SimpleFormTag(array()), new SimpleUrl('htp://host')); $select = &new SimpleSelectionTag(array('name' => 'a')); $select->addTag(new SimpleOptionTag( array('value' => 'aaa', 'selected' => ''))); $form->addWidget($select); $this->assertIdentical( $form->submit(), new SimpleFormEncoding(array('a' => 'aaa'))); } function testUnchecked() { $form = &new SimpleForm( new SimpleFormTag(array()), new SimpleUrl('htp://host')); $form->addWidget(new SimpleCheckboxTag( array('name' => 'me', 'type' => 'checkbox'))); $this->assertIdentical($form->getValue('me'), false); $this->assertTrue($form->setField('me', 'on')); $this->assertEqual($form->getValue('me'), 'on'); $this->assertFalse($form->setField('me', 'other')); $this->assertEqual($form->getValue('me'), 'on'); } function testChecked() { $form = &new SimpleForm( new SimpleFormTag(array()), new SimpleUrl('htp://host')); $form->addWidget(new SimpleCheckboxTag( array('name' => 'me', 'value' => 'a', 'type' => 'checkbox', 'checked' => ''))); $this->assertIdentical($form->getValue('me'), 'a'); $this->assertFalse($form->setField('me', 'on')); $this->assertEqual($form->getValue('me'), 'a'); $this->assertTrue($form->setField('me', false)); $this->assertEqual($form->getValue('me'), false); } function testSingleUncheckedRadioButton() { $form = &new SimpleForm( new SimpleFormTag(array()), new SimpleUrl('htp://host')); $form->addWidget(new SimpleRadioButtonTag( array('name' => 'me', 'value' => 'a', 'type' => 'radio'))); $this->assertIdentical($form->getValue('me'), false); $this->assertTrue($form->setField('me', 'a')); $this->assertIdentical($form->getValue('me'), 'a'); } function testSingleCheckedRadioButton() { $form = &new SimpleForm( new SimpleFormTag(array()), new SimpleUrl('htp://host')); $form->addWidget(new SimpleRadioButtonTag( array('name' => 'me', 'value' => 'a', 'type' => 'radio', 'checked' => ''))); $this->assertIdentical($form->getValue('me'), 'a'); $this->assertFalse($form->setField('me', 'other')); } function testUncheckedRadioButtons() { $form = &new SimpleForm( new SimpleFormTag(array()), new SimpleUrl('htp://host')); $form->addWidget(new SimpleRadioButtonTag( array('name' => 'me', 'value' => 'a', 'type' => 'radio'))); $form->addWidget(new SimpleRadioButtonTag( array('name' => 'me', 'value' => 'b', 'type' => 'radio'))); $this->assertIdentical($form->getValue('me'), false); $this->assertTrue($form->setField('me', 'a')); $this->assertIdentical($form->getValue('me'), 'a'); $this->assertTrue($form->setField('me', 'b')); $this->assertIdentical($form->getValue('me'), 'b'); $this->assertFalse($form->setField('me', 'c')); $this->assertIdentical($form->getValue('me'), 'b'); } function testCheckedRadioButtons() { $form = &new SimpleForm( new SimpleFormTag(array()), new SimpleUrl('htp://host')); $form->addWidget(new SimpleRadioButtonTag( array('name' => 'me', 'value' => 'a', 'type' => 'radio'))); $form->addWidget(new SimpleRadioButtonTag( array('name' => 'me', 'value' => 'b', 'type' => 'radio', 'checked' => ''))); $this->assertIdentical($form->getValue('me'), 'b'); $this->assertTrue($form->setField('me', 'a')); $this->assertIdentical($form->getValue('me'), 'a'); } function testMultipleFieldsWithSameKey() { $form = &new SimpleForm( new SimpleFormTag(array()), new SimpleUrl('htp://host')); $form->addWidget(new SimpleCheckboxTag( array('name' => 'a', 'type' => 'checkbox', 'value' => 'me'))); $form->addWidget(new SimpleCheckboxTag( array('name' => 'a', 'type' => 'checkbox', 'value' => 'you'))); $this->assertIdentical($form->getValue('a'), false); $this->assertTrue($form->setField('a', 'me')); $this->assertIdentical($form->getValue('a'), 'me'); } } ?>pgfouine-1.2/tests/simpletest/test/web_tester_test.php0000644000175000017500000001440310334504436022015 0ustar acmeacmeassertTrue($expectation->test('a')); $this->assertTrue($expectation->test(array('a'))); $this->assertFalse($expectation->test('A')); } function testMatchesInteger() { $expectation = new FieldExpectation('1'); $this->assertTrue($expectation->test('1')); $this->assertTrue($expectation->test(1)); $this->assertTrue($expectation->test(array('1'))); $this->assertTrue($expectation->test(array(1))); } function testNonStringFailsExpectation() { $expectation = new FieldExpectation('a'); $this->assertFalse($expectation->test(null)); } function testUnsetFieldCanBeTestedFor() { $expectation = new FieldExpectation(false); $this->assertTrue($expectation->test(false)); } function testMultipleValuesCanBeInAnyOrder() { $expectation = new FieldExpectation(array('a', 'b')); $this->assertTrue($expectation->test(array('a', 'b'))); $this->assertTrue($expectation->test(array('b', 'a'))); $this->assertFalse($expectation->test(array('a', 'a'))); $this->assertFalse($expectation->test('a')); } function testSingleItemCanBeArrayOrString() { $expectation = new FieldExpectation(array('a')); $this->assertTrue($expectation->test(array('a'))); $this->assertTrue($expectation->test('a')); } } class TestOfHeaderExpectations extends UnitTestCase { function testExpectingOnlyTheHeaderName() { $expectation = new HttpHeaderExpectation('a'); $this->assertIdentical($expectation->test(false), false); $this->assertIdentical($expectation->test('a: A'), true); $this->assertIdentical($expectation->test('A: A'), true); $this->assertIdentical($expectation->test('a: B'), true); $this->assertIdentical($expectation->test(' a : A '), true); } function testHeaderValueAsWell() { $expectation = new HttpHeaderExpectation('a', 'A'); $this->assertIdentical($expectation->test(false), false); $this->assertIdentical($expectation->test('a: A'), true); $this->assertIdentical($expectation->test('A: A'), true); $this->assertIdentical($expectation->test('A: a'), false); $this->assertIdentical($expectation->test('a: B'), false); $this->assertIdentical($expectation->test(' a : A '), true); $this->assertIdentical($expectation->test(' a : AB '), false); } function testMultilineSearch() { $expectation = new HttpHeaderExpectation('a', 'A'); $this->assertIdentical($expectation->test("aa: A\r\nb: B\r\nc: C"), false); $this->assertIdentical($expectation->test("aa: A\r\na: A\r\nb: B"), true); } function testMultilineSearchWithPadding() { $expectation = new HttpHeaderExpectation('a', ' A '); $this->assertIdentical($expectation->test("aa:A\r\nb:B\r\nc:C"), false); $this->assertIdentical($expectation->test("aa:A\r\na:A\r\nb:B"), true); } function testPatternMatching() { $expectation = new HttpHeaderPatternExpectation('a', '/A/'); $this->assertIdentical($expectation->test('a: A'), true); $this->assertIdentical($expectation->test('A: A'), true); $this->assertIdentical($expectation->test('A: a'), false); $this->assertIdentical($expectation->test('a: B'), false); $this->assertIdentical($expectation->test(' a : A '), true); $this->assertIdentical($expectation->test(' a : AB '), true); } function testCaseInsensitivePatternMatching() { $expectation = new HttpHeaderPatternExpectation('a', '/A/i'); $this->assertIdentical($expectation->test('a: a'), true); $this->assertIdentical($expectation->test('a: B'), false); $this->assertIdentical($expectation->test(' a : A '), true); $this->assertIdentical($expectation->test(' a : BAB '), true); $this->assertIdentical($expectation->test(' a : bab '), true); } function testUnwantedHeader() { $expectation = new HttpUnwantedHeaderExpectation('a'); $this->assertIdentical($expectation->test(''), true); $this->assertIdentical($expectation->test('stuff'), true); $this->assertIdentical($expectation->test('b: B'), true); $this->assertIdentical($expectation->test('a: A'), false); $this->assertIdentical($expectation->test('A: A'), false); } function testMultilineUnwantedSearch() { $expectation = new HttpUnwantedHeaderExpectation('a'); $this->assertIdentical($expectation->test("aa:A\r\nb:B\r\nc:C"), true); $this->assertIdentical($expectation->test("aa:A\r\na:A\r\nb:B"), false); } } class TestOfTextExpectations extends UnitTestCase { function testMatchingSubString() { $expectation = new WantedTextExpectation('wanted'); $this->assertIdentical($expectation->test(''), false); $this->assertIdentical($expectation->test('Wanted'), false); $this->assertIdentical($expectation->test('wanted'), true); $this->assertIdentical($expectation->test('the wanted text is here'), true); } function testNotMatchingSubString() { $expectation = new UnwantedTextExpectation('wanted'); $this->assertIdentical($expectation->test(''), true); $this->assertIdentical($expectation->test('Wanted'), true); $this->assertIdentical($expectation->test('wanted'), false); $this->assertIdentical($expectation->test('the wanted text is here'), false); } } ?>pgfouine-1.2/tests/simpletest/test/parser_test.php0000644000175000017500000007741710334504436021164 0ustar acmeacmeassertFalse($regex->match("Hello", $match)); $this->assertEqual($match, ""); } function testNoSubject() { $regex = &new ParallelRegex(false); $regex->addPattern(".*"); $this->assertTrue($regex->match("", $match)); $this->assertEqual($match, ""); } function testMatchAll() { $regex = &new ParallelRegex(false); $regex->addPattern(".*"); $this->assertTrue($regex->match("Hello", $match)); $this->assertEqual($match, "Hello"); } function testCaseSensitive() { $regex = &new ParallelRegex(true); $regex->addPattern("abc"); $this->assertTrue($regex->match("abcdef", $match)); $this->assertEqual($match, "abc"); $this->assertTrue($regex->match("AAABCabcdef", $match)); $this->assertEqual($match, "abc"); } function testCaseInsensitive() { $regex = &new ParallelRegex(false); $regex->addPattern("abc"); $this->assertTrue($regex->match("abcdef", $match)); $this->assertEqual($match, "abc"); $this->assertTrue($regex->match("AAABCabcdef", $match)); $this->assertEqual($match, "ABC"); } function testMatchMultiple() { $regex = &new ParallelRegex(true); $regex->addPattern("abc"); $regex->addPattern("ABC"); $this->assertTrue($regex->match("abcdef", $match)); $this->assertEqual($match, "abc"); $this->assertTrue($regex->match("AAABCabcdef", $match)); $this->assertEqual($match, "ABC"); $this->assertFalse($regex->match("Hello", $match)); } function testPatternLabels() { $regex = &new ParallelRegex(false); $regex->addPattern("abc", "letter"); $regex->addPattern("123", "number"); $this->assertIdentical($regex->match("abcdef", $match), "letter"); $this->assertEqual($match, "abc"); $this->assertIdentical($regex->match("0123456789", $match), "number"); $this->assertEqual($match, "123"); } } class TestOfStateStack extends UnitTestCase { function testStartState() { $stack = &new SimpleStateStack("one"); $this->assertEqual($stack->getCurrent(), "one"); } function testExhaustion() { $stack = &new SimpleStateStack("one"); $this->assertFalse($stack->leave()); } function testStateMoves() { $stack = &new SimpleStateStack("one"); $stack->enter("two"); $this->assertEqual($stack->getCurrent(), "two"); $stack->enter("three"); $this->assertEqual($stack->getCurrent(), "three"); $this->assertTrue($stack->leave()); $this->assertEqual($stack->getCurrent(), "two"); $stack->enter("third"); $this->assertEqual($stack->getCurrent(), "third"); $this->assertTrue($stack->leave()); $this->assertTrue($stack->leave()); $this->assertEqual($stack->getCurrent(), "one"); } } class TestParser { function accept() { } function a() { } function b() { } } Mock::generate('TestParser'); class TestOfLexer extends UnitTestCase { function testEmptyPage() { $handler = &new MockTestParser($this); $handler->expectNever("accept"); $handler->setReturnValue("accept", true); $handler->expectNever("accept"); $handler->setReturnValue("accept", true); $lexer = &new SimpleLexer($handler); $lexer->addPattern("a+"); $this->assertTrue($lexer->parse("")); } function testSinglePattern() { $handler = &new MockTestParser($this); $handler->expectArgumentsAt(0, "accept", array("aaa", LEXER_MATCHED)); $handler->expectArgumentsAt(1, "accept", array("x", LEXER_UNMATCHED)); $handler->expectArgumentsAt(2, "accept", array("a", LEXER_MATCHED)); $handler->expectArgumentsAt(3, "accept", array("yyy", LEXER_UNMATCHED)); $handler->expectArgumentsAt(4, "accept", array("a", LEXER_MATCHED)); $handler->expectArgumentsAt(5, "accept", array("x", LEXER_UNMATCHED)); $handler->expectArgumentsAt(6, "accept", array("aaa", LEXER_MATCHED)); $handler->expectArgumentsAt(7, "accept", array("z", LEXER_UNMATCHED)); $handler->expectCallCount("accept", 8); $handler->setReturnValue("accept", true); $lexer = &new SimpleLexer($handler); $lexer->addPattern("a+"); $this->assertTrue($lexer->parse("aaaxayyyaxaaaz")); $handler->tally(); } function testMultiplePattern() { $handler = &new MockTestParser($this); $target = array("a", "b", "a", "bb", "x", "b", "a", "xxxxxx", "a", "x"); for ($i = 0; $i < count($target); $i++) { $handler->expectArgumentsAt($i, "accept", array($target[$i], '*')); } $handler->expectCallCount("accept", count($target)); $handler->setReturnValue("accept", true); $lexer = &new SimpleLexer($handler); $lexer->addPattern("a+"); $lexer->addPattern("b+"); $this->assertTrue($lexer->parse("ababbxbaxxxxxxax")); $handler->tally(); } } class TestOfLexerModes extends UnitTestCase { function testIsolatedPattern() { $handler = &new MockTestParser($this); $handler->expectArgumentsAt(0, "a", array("a", LEXER_MATCHED)); $handler->expectArgumentsAt(1, "a", array("b", LEXER_UNMATCHED)); $handler->expectArgumentsAt(2, "a", array("aa", LEXER_MATCHED)); $handler->expectArgumentsAt(3, "a", array("bxb", LEXER_UNMATCHED)); $handler->expectArgumentsAt(4, "a", array("aaa", LEXER_MATCHED)); $handler->expectArgumentsAt(5, "a", array("x", LEXER_UNMATCHED)); $handler->expectArgumentsAt(6, "a", array("aaaa", LEXER_MATCHED)); $handler->expectArgumentsAt(7, "a", array("x", LEXER_UNMATCHED)); $handler->expectCallCount("a", 8); $handler->setReturnValue("a", true); $lexer = &new SimpleLexer($handler, "a"); $lexer->addPattern("a+", "a"); $lexer->addPattern("b+", "b"); $this->assertTrue($lexer->parse("abaabxbaaaxaaaax")); $handler->tally(); } function testModeChange() { $handler = &new MockTestParser($this); $handler->expectArgumentsAt(0, "a", array("a", LEXER_MATCHED)); $handler->expectArgumentsAt(1, "a", array("b", LEXER_UNMATCHED)); $handler->expectArgumentsAt(2, "a", array("aa", LEXER_MATCHED)); $handler->expectArgumentsAt(3, "a", array("b", LEXER_UNMATCHED)); $handler->expectArgumentsAt(4, "a", array("aaa", LEXER_MATCHED)); $handler->expectArgumentsAt(0, "b", array(":", LEXER_ENTER)); $handler->expectArgumentsAt(1, "b", array("a", LEXER_UNMATCHED)); $handler->expectArgumentsAt(2, "b", array("b", LEXER_MATCHED)); $handler->expectArgumentsAt(3, "b", array("a", LEXER_UNMATCHED)); $handler->expectArgumentsAt(4, "b", array("bb", LEXER_MATCHED)); $handler->expectArgumentsAt(5, "b", array("a", LEXER_UNMATCHED)); $handler->expectArgumentsAt(6, "b", array("bbb", LEXER_MATCHED)); $handler->expectArgumentsAt(7, "b", array("a", LEXER_UNMATCHED)); $handler->expectCallCount("a", 5); $handler->expectCallCount("b", 8); $handler->setReturnValue("a", true); $handler->setReturnValue("b", true); $lexer = &new SimpleLexer($handler, "a"); $lexer->addPattern("a+", "a"); $lexer->addEntryPattern(":", "a", "b"); $lexer->addPattern("b+", "b"); $this->assertTrue($lexer->parse("abaabaaa:ababbabbba")); $handler->tally(); } function testNesting() { $handler = &new MockTestParser($this); $handler->setReturnValue("a", true); $handler->setReturnValue("b", true); $handler->expectArgumentsAt(0, "a", array("aa", LEXER_MATCHED)); $handler->expectArgumentsAt(1, "a", array("b", LEXER_UNMATCHED)); $handler->expectArgumentsAt(2, "a", array("aa", LEXER_MATCHED)); $handler->expectArgumentsAt(3, "a", array("b", LEXER_UNMATCHED)); $handler->expectArgumentsAt(0, "b", array("(", LEXER_ENTER)); $handler->expectArgumentsAt(1, "b", array("bb", LEXER_MATCHED)); $handler->expectArgumentsAt(2, "b", array("a", LEXER_UNMATCHED)); $handler->expectArgumentsAt(3, "b", array("bb", LEXER_MATCHED)); $handler->expectArgumentsAt(4, "b", array(")", LEXER_EXIT)); $handler->expectArgumentsAt(4, "a", array("aa", LEXER_MATCHED)); $handler->expectArgumentsAt(5, "a", array("b", LEXER_UNMATCHED)); $handler->expectCallCount("a", 6); $handler->expectCallCount("b", 5); $lexer = &new SimpleLexer($handler, "a"); $lexer->addPattern("a+", "a"); $lexer->addEntryPattern("(", "a", "b"); $lexer->addPattern("b+", "b"); $lexer->addExitPattern(")", "b"); $this->assertTrue($lexer->parse("aabaab(bbabb)aab")); $handler->tally(); } function testSingular() { $handler = &new MockTestParser($this); $handler->setReturnValue("a", true); $handler->setReturnValue("b", true); $handler->expectArgumentsAt(0, "a", array("aa", LEXER_MATCHED)); $handler->expectArgumentsAt(1, "a", array("aa", LEXER_MATCHED)); $handler->expectArgumentsAt(2, "a", array("xx", LEXER_UNMATCHED)); $handler->expectArgumentsAt(3, "a", array("xx", LEXER_UNMATCHED)); $handler->expectArgumentsAt(0, "b", array("b", LEXER_SPECIAL)); $handler->expectArgumentsAt(1, "b", array("bbb", LEXER_SPECIAL)); $handler->expectCallCount("a", 4); $handler->expectCallCount("b", 2); $lexer = &new SimpleLexer($handler, "a"); $lexer->addPattern("a+", "a"); $lexer->addSpecialPattern("b+", "a", "b"); $this->assertTrue($lexer->parse("aabaaxxbbbxx")); $handler->tally(); } function testUnwindTooFar() { $handler = &new MockTestParser($this); $handler->setReturnValue("a", true); $handler->expectArgumentsAt(0, "a", array("aa", LEXER_MATCHED)); $handler->expectArgumentsAt(1, "a", array(")", LEXER_EXIT)); $handler->expectCallCount("a", 2); $lexer = &new SimpleLexer($handler, "a"); $lexer->addPattern("a+", "a"); $lexer->addExitPattern(")", "a"); $this->assertFalse($lexer->parse("aa)aa")); $handler->tally(); } } class TestOfLexerHandlers extends UnitTestCase { function testModeMapping() { $handler = &new MockTestParser($this); $handler->setReturnValue("a", true); $handler->expectArgumentsAt(0, "a", array("aa", LEXER_MATCHED)); $handler->expectArgumentsAt(1, "a", array("(", LEXER_ENTER)); $handler->expectArgumentsAt(2, "a", array("bb", LEXER_MATCHED)); $handler->expectArgumentsAt(3, "a", array("a", LEXER_UNMATCHED)); $handler->expectArgumentsAt(4, "a", array("bb", LEXER_MATCHED)); $handler->expectArgumentsAt(5, "a", array(")", LEXER_EXIT)); $handler->expectArgumentsAt(6, "a", array("b", LEXER_UNMATCHED)); $handler->expectCallCount("a", 7); $lexer = &new SimpleLexer($handler, "mode_a"); $lexer->addPattern("a+", "mode_a"); $lexer->addEntryPattern("(", "mode_a", "mode_b"); $lexer->addPattern("b+", "mode_b"); $lexer->addExitPattern(")", "mode_b"); $lexer->mapHandler("mode_a", "a"); $lexer->mapHandler("mode_b", "a"); $this->assertTrue($lexer->parse("aa(bbabb)b")); $handler->tally(); } } Mock::generate("HtmlSaxParser"); class TestOfHtmlLexer extends UnitTestCase { var $_handler; var $_lexer; function setUp() { $this->_handler = &new MockSimpleSaxParser($this); $this->_handler->setReturnValue("acceptStartToken", true); $this->_handler->setReturnValue("acceptEndToken", true); $this->_handler->setReturnValue("acceptAttributeToken", true); $this->_handler->setReturnValue("acceptEntityToken", true); $this->_handler->setReturnValue("acceptTextToken", true); $this->_handler->setReturnValue("ignore", true); $this->_lexer = &SimpleSaxParser::createLexer($this->_handler); } function tearDown() { $this->_handler->tally(); } function testUninteresting() { $this->_handler->expectOnce("acceptTextToken", array("", "*")); $this->assertTrue($this->_lexer->parse("")); } function testSkipCss() { $this->_handler->expectMaximumCallCount("acceptTextToken", 0); $this->_handler->expectAtLeastOnce("ignore"); $this->assertTrue($this->_lexer->parse("")); } function testSkipJavaScript() { $this->_handler->expectMaximumCallCount("acceptTextToken", 0); $this->_handler->expectAtLeastOnce("ignore"); $this->assertTrue($this->_lexer->parse("")); } function testSkipComments() { $this->_handler->expectMaximumCallCount("acceptTextToken", 0); $this->_handler->expectAtLeastOnce("ignore"); $this->assertTrue($this->_lexer->parse("")); } function testTitleTag() { $this->_handler->expectArgumentsAt(0, "acceptStartToken", array("_handler->expectArgumentsAt(1, "acceptStartToken", array(">", "*")); $this->_handler->expectCallCount("acceptStartToken", 2); $this->_handler->expectOnce("acceptTextToken", array("Hello", "*")); $this->_handler->expectOnce("acceptEndToken", array("", "*")); $this->assertTrue($this->_lexer->parse("Hello")); } function testFramesetTag() { $this->_handler->expectArgumentsAt(0, "acceptStartToken", array("_handler->expectArgumentsAt(1, "acceptStartToken", array(">", "*")); $this->_handler->expectCallCount("acceptStartToken", 2); $this->_handler->expectOnce("acceptTextToken", array("Frames", "*")); $this->_handler->expectOnce("acceptEndToken", array("", "*")); $this->assertTrue($this->_lexer->parse("Frames")); } function testInputTag() { $this->_handler->expectArgumentsAt(0, "acceptStartToken", array("_handler->expectArgumentsAt(1, "acceptStartToken", array("name", "*")); $this->_handler->expectArgumentsAt(2, "acceptStartToken", array("value", "*")); $this->_handler->expectArgumentsAt(3, "acceptStartToken", array(">", "*")); $this->_handler->expectArgumentsAt(0, "acceptAttributeToken", array("=a.b.c", "*")); $this->_handler->expectArgumentsAt(1, "acceptAttributeToken", array("= d", "*")); $this->assertTrue($this->_lexer->parse("")); } function testEmptyLink() { $this->_handler->expectArgumentsAt(0, "acceptStartToken", array("_handler->expectArgumentsAt(1, "acceptStartToken", array(">", "*")); $this->_handler->expectCallCount("acceptStartToken", 2); $this->_handler->expectOnce("acceptEndToken", array("", "*")); $this->assertTrue($this->_lexer->parse("")); } function testLabelledLink() { $this->_handler->expectArgumentsAt(0, "acceptStartToken", array("_handler->expectArgumentsAt(1, "acceptStartToken", array(">", "*")); $this->_handler->expectCallCount("acceptStartToken", 2); $this->_handler->expectOnce("acceptEndToken", array("", "*")); $this->_handler->expectArgumentsAt(0, "acceptTextToken", array("", "*")); $this->_handler->expectArgumentsAt(1, "acceptTextToken", array("label", "*")); $this->_handler->expectArgumentsAt(2, "acceptTextToken", array("", "*")); $this->_handler->expectCallCount("acceptTextToken", 3); $this->assertTrue($this->_lexer->parse("label")); } function testLinkAddress() { $this->_handler->expectArgumentsAt(0, "acceptTextToken", array("", "*")); $this->_handler->expectArgumentsAt(1, "acceptTextToken", array("label", "*")); $this->_handler->expectArgumentsAt(2, "acceptTextToken", array("", "*")); $this->_handler->expectCallCount("acceptTextToken", 3); $this->_handler->expectArgumentsAt(0, "acceptStartToken", array("_handler->expectArgumentsAt(1, "acceptStartToken", array("href", "*")); $this->_handler->expectArgumentsAt(2, "acceptStartToken", array(">", "*")); $this->_handler->expectCallCount("acceptStartToken", 3); $this->_handler->expectArgumentsAt(0, "acceptAttributeToken", array("= '", "*")); $this->_handler->expectArgumentsAt(1, "acceptAttributeToken", array("here.html", "*")); $this->_handler->expectArgumentsAt(2, "acceptAttributeToken", array("'", "*")); $this->_handler->expectCallCount("acceptAttributeToken", 3); $this->assertTrue($this->_lexer->parse("label")); } function testEncodedLinkAddress() { $this->_handler->expectArgumentsAt(0, "acceptTextToken", array("", "*")); $this->_handler->expectArgumentsAt(1, "acceptTextToken", array("label", "*")); $this->_handler->expectArgumentsAt(2, "acceptTextToken", array("", "*")); $this->_handler->expectCallCount("acceptTextToken", 3); $this->_handler->expectArgumentsAt(0, "acceptStartToken", array("_handler->expectArgumentsAt(1, "acceptStartToken", array("href", "*")); $this->_handler->expectArgumentsAt(2, "acceptStartToken", array(">", "*")); $this->_handler->expectCallCount("acceptStartToken", 3); $this->_handler->expectArgumentsAt(0, "acceptAttributeToken", array("= '", "*")); $this->_handler->expectArgumentsAt(1, "acceptAttributeToken", array("here&there.html", "*")); $this->_handler->expectArgumentsAt(2, "acceptAttributeToken", array("'", "*")); $this->_handler->expectCallCount("acceptAttributeToken", 3); $this->assertTrue($this->_lexer->parse("label")); } function testEmptyLinkWithId() { $this->_handler->expectArgumentsAt(0, "acceptTextToken", array("", "*")); $this->_handler->expectArgumentsAt(1, "acceptTextToken", array("label", "*")); $this->_handler->expectArgumentsAt(2, "acceptTextToken", array("", "*")); $this->_handler->expectCallCount("acceptTextToken", 3); $this->_handler->expectArgumentsAt(0, "acceptStartToken", array("_handler->expectArgumentsAt(1, "acceptStartToken", array("id", "*")); $this->_handler->expectArgumentsAt(2, "acceptStartToken", array(">", "*")); $this->_handler->expectCallCount("acceptStartToken", 3); $this->_handler->expectArgumentsAt(0, "acceptAttributeToken", array("=\"", "*")); $this->_handler->expectArgumentsAt(1, "acceptAttributeToken", array("0", "*")); $this->_handler->expectArgumentsAt(2, "acceptAttributeToken", array("\"", "*")); $this->_handler->expectCallCount("acceptAttributeToken", 3); $this->assertTrue($this->_lexer->parse("label")); } function testComplexLink() { $this->_handler->expectArgumentsAt(0, "acceptStartToken", array("_handler->expectArgumentsAt(1, "acceptStartToken", array("HREF", "*")); $this->_handler->expectArgumentsAt(2, "acceptStartToken", array("bool", "*")); $this->_handler->expectArgumentsAt(3, "acceptStartToken", array("Style", "*")); $this->_handler->expectArgumentsAt(4, "acceptStartToken", array(">", LEXER_EXIT)); $this->_handler->expectCallCount("acceptStartToken", 5); $this->_handler->expectArgumentsAt(0, "acceptAttributeToken", array("= '", "*")); $this->_handler->expectArgumentsAt(1, "acceptAttributeToken", array("here.html", LEXER_UNMATCHED)); $this->_handler->expectArgumentsAt(2, "acceptAttributeToken", array("'", "*")); $this->_handler->expectArgumentsAt(3, "acceptAttributeToken", array("=\"", "*")); $this->_handler->expectArgumentsAt(4, "acceptAttributeToken", array("'coo", "*")); $this->_handler->expectArgumentsAt(5, "acceptAttributeToken", array('\"', "*")); $this->_handler->expectArgumentsAt(6, "acceptAttributeToken", array("l'", "*")); $this->_handler->expectArgumentsAt(7, "acceptAttributeToken", array("\"", "*")); $this->_handler->expectCallCount("acceptAttributeToken", 8); $this->assertTrue($this->_lexer->parse("label")); } function testSubmit() { $this->_handler->expectArgumentsAt(0, "acceptStartToken", array("_handler->expectArgumentsAt(1, "acceptStartToken", array("type", "*")); $this->_handler->expectArgumentsAt(2, "acceptStartToken", array("name", "*")); $this->_handler->expectArgumentsAt(3, "acceptStartToken", array("value", "*")); $this->_handler->expectArgumentsAt(4, "acceptStartToken", array("/", "*")); $this->_handler->expectArgumentsAt(5, "acceptStartToken", array(">", LEXER_EXIT)); $this->_handler->expectCallCount("acceptStartToken", 6); $this->assertTrue($this->_lexer->parse('')); } function testFramesParsedWithoutError() { $this->assertTrue($this->_lexer->parse( '')); $this->assertTrue($this->_lexer->parse( 'Hello')); } } class TestOfTextExtraction extends UnitTestCase { function testSpaceNormalisation() { $this->assertEqual( SimpleSaxParser::normalise("\nOne\tTwo \nThree\t"), 'One Two Three'); } function testTagSuppression() { $this->assertEqual( SimpleSaxParser::normalise('Hello'), 'Hello'); } function testAdjoiningTagSuppression() { $this->assertEqual( SimpleSaxParser::normalise('HelloGoodbye'), 'HelloGoodbye'); } function testExtractImageAltTextWithDifferentQuotes() { $this->assertEqual( SimpleSaxParser::normalise('One\'Two\'Three'), 'One Two Three'); } function testExtractImageAltTextMultipleTimes() { $this->assertEqual( SimpleSaxParser::normalise('OneTwoThree'), 'One Two Three'); } function testHtmlEntityTranslation() { $this->assertEqual( SimpleSaxParser::normalise('<>"&'), '<>"&'); } } class TestSimpleSaxParser extends SimpleSaxParser { var $_lexer; function TestSimpleSaxParser(&$listener, &$lexer) { $this->_lexer = &$lexer; $this->SimpleSaxParser($listener); } function &createLexer() { return $this->_lexer; } } Mock::generate("SimpleSaxListener"); Mock::generate("SimpleLexer"); class TestOfSaxGeneration extends UnitTestCase { var $_listener; var $_lexer; function setUp() { $this->_listener = &new MockSimpleSaxListener($this); $this->_lexer = &new MockSimpleLexer($this); $this->_parser = &new TestSimpleSaxParser($this->_listener, $this->_lexer); } function tearDown() { $this->_listener->tally(); $this->_lexer->tally(); } function testLexerFailure() { $this->_lexer->setReturnValue("parse", false); $this->assertFalse($this->_parser->parse("")); } function testLexerSuccess() { $this->_lexer->setReturnValue("parse", true); $this->assertTrue($this->_parser->parse("")); } function testSimpleLinkStart() { $this->_parser->parse(""); $this->_listener->expectOnce("startElement", array("a", array())); $this->_listener->setReturnValue("startElement", true); $this->assertTrue($this->_parser->acceptStartToken("assertTrue($this->_parser->acceptStartToken(">", LEXER_EXIT)); } function testSimpleTitleStart() { $this->_parser->parse(""); $this->_listener->expectOnce("startElement", array("title", array())); $this->_listener->setReturnValue("startElement", true); $this->assertTrue($this->_parser->acceptStartToken("assertTrue($this->_parser->acceptStartToken(">", LEXER_EXIT)); } function testLinkStart() { $this->_parser->parse(""); $this->_listener->expectOnce("startElement", array("a", array("href" => "here.html"))); $this->_listener->setReturnValue("startElement", true); $this->assertTrue($this->_parser->acceptStartToken("assertTrue($this->_parser->acceptStartToken("href", LEXER_MATCHED)); $this->assertTrue($this->_parser->acceptAttributeToken("=\"", LEXER_ENTER)); $this->assertTrue($this->_parser->acceptAttributeToken("here.html", LEXER_UNMATCHED)); $this->assertTrue($this->_parser->acceptAttributeToken("\"", LEXER_EXIT)); $this->assertTrue($this->_parser->acceptStartToken(">", LEXER_EXIT)); } function testLinkStartWithEncodedUrl() { $this->_parser->parse(""); $this->_listener->expectOnce( "startElement", array("a", array("href" => "here&there.html"))); $this->_listener->setReturnValue("startElement", true); $this->assertTrue($this->_parser->acceptStartToken("assertTrue($this->_parser->acceptStartToken("href", LEXER_MATCHED)); $this->assertTrue($this->_parser->acceptAttributeToken("=\"", LEXER_ENTER)); $this->assertTrue($this->_parser->acceptAttributeToken("here&there.html", LEXER_UNMATCHED)); $this->assertTrue($this->_parser->acceptAttributeToken("\"", LEXER_EXIT)); $this->assertTrue($this->_parser->acceptStartToken(">", LEXER_EXIT)); } function testLinkStartWithId() { $this->_parser->parse(""); $this->_listener->expectOnce( "startElement", array("a", array("id" => "0"))); $this->_listener->setReturnValue("startElement", true); $this->assertTrue($this->_parser->acceptStartToken("assertTrue($this->_parser->acceptStartToken("id", LEXER_MATCHED)); $this->assertTrue($this->_parser->acceptAttributeToken("= \"", LEXER_ENTER)); $this->assertTrue($this->_parser->acceptAttributeToken("0", LEXER_UNMATCHED)); $this->assertTrue($this->_parser->acceptAttributeToken("\"", LEXER_EXIT)); $this->assertTrue($this->_parser->acceptStartToken(">", LEXER_EXIT)); } function testLinkEnd() { $this->_parser->parse(""); $this->_listener->expectOnce("endElement", array("a")); $this->_listener->setReturnValue("endElement", true); $this->assertTrue($this->_parser->acceptEndToken("", LEXER_SPECIAL)); } function testInput() { $this->_parser->parse(""); $this->_listener->expectOnce( "startElement", array("input", array("name" => "a"))); $this->_listener->setReturnValue("startElement", true); $this->assertTrue($this->_parser->acceptStartToken("assertTrue($this->_parser->acceptStartToken("name", LEXER_MATCHED)); $this->assertTrue($this->_parser->acceptAttributeToken("= a", LEXER_SPECIAL)); $this->assertTrue($this->_parser->acceptStartToken(">", LEXER_EXIT)); } function testButton() { $this->_parser->parse(""); $this->_listener->expectOnce( "startElement", array("button", array("name" => "a"))); $this->_listener->setReturnValue("startElement", true); $this->assertTrue($this->_parser->acceptStartToken("assertTrue($this->_parser->acceptStartToken("name", LEXER_MATCHED)); $this->assertTrue($this->_parser->acceptAttributeToken("= a", LEXER_SPECIAL)); $this->assertTrue($this->_parser->acceptStartToken(">", LEXER_EXIT)); } function testContent() { $this->_parser->parse(""); $this->_listener->expectOnce("addContent", array("stuff")); $this->_listener->setReturnValue("addContent", true); $this->assertTrue($this->_parser->acceptTextToken("stuff", LEXER_UNMATCHED)); } function testIgnore() { $this->_parser->parse(""); $this->_listener->expectNever("addContent"); $this->assertTrue($this->_parser->ignore("stuff", LEXER_UNMATCHED)); } } ?>pgfouine-1.2/tests/simpletest/test/shell_test.php0000644000175000017500000000240710334504436020762 0ustar acmeacmeassertIdentical($shell->execute('echo Hello'), 0); $this->assertWantedPattern('/Hello/', $shell->getOutput()); } function testBadCommand() { $shell = &new SimpleShell(); $this->assertNotEqual($ret = $shell->execute('blurgh! 2>&1'), 0); } } class TestOfShellTesterAndShell extends ShellTestCase { function testEcho() { $this->assertTrue($this->execute('echo Hello')); $this->assertExitCode(0); $this->assertoutput('Hello'); } function testFileExistence() { $this->assertFileExists(dirname(__FILE__) . '/all_tests.php'); $this->assertFileNotExists('wibble'); } function testFilePatterns() { $this->assertFilePattern('/all_tests/i', dirname(__FILE__) . '/all_tests.php'); $this->assertNoFilePattern('/sputnik/i', dirname(__FILE__) . '/all_tests.php'); } } ?>pgfouine-1.2/tests/simpletest/test/options_test.php0000644000175000017500000000674310334504436021355 0ustar acmeacmeassertEqual(SimpleTestOptions::getMockBaseClass(), 'Fred'); SimpleTestOptions::setMockBaseClass($old_class); } function testStubBase() { $old_class = SimpleTestOptions::getStubBaseClass(); SimpleTestOptions::setStubBaseClass('Fred'); $this->assertEqual(SimpleTestOptions::getStubBaseClass(), 'Fred'); SimpleTestOptions::setStubBaseClass($old_class); } function testIgnoreList() { $this->assertFalse(SimpleTestOptions::isIgnored('ImaginaryTestCase')); SimpleTestOptions::ignore('ImaginaryTestCase'); $this->assertTrue(SimpleTestOptions::isIgnored('ImaginaryTestCase')); } } class ComparisonClass { } class ComparisonSubclass extends ComparisonClass { } class TestOfCompatibility extends UnitTestCase { function testIsA() { $this->assertTrue(SimpleTestCompatibility::isA( new ComparisonClass(), 'ComparisonClass')); $this->assertFalse(SimpleTestCompatibility::isA( new ComparisonClass(), 'ComparisonSubclass')); $this->assertTrue(SimpleTestCompatibility::isA( new ComparisonSubclass(), 'ComparisonClass')); } function testIdentityOfObjects() { $object1 = new ComparisonClass(); $object2 = new ComparisonClass(); $this->assertIdentical($object1, $object2); } function testReferences () { $thing = "Hello"; $thing_reference = &$thing; $thing_copy = $thing; $this->assertTrue(SimpleTestCompatibility::isReference( $thing, $thing)); $this->assertTrue(SimpleTestCompatibility::isReference( $thing, $thing_reference)); $this->assertFalse(SimpleTestCompatibility::isReference( $thing, $thing_copy)); } function testObjectReferences () { $object = &new ComparisonClass(); $object_reference = &$object; $object_copy = new ComparisonClass(); $object_assignment = $object; $this->assertTrue(SimpleTestCompatibility::isReference( $object, $object)); $this->assertTrue(SimpleTestCompatibility::isReference( $object, $object_reference)); $this->assertFalse(SimpleTestCompatibility::isReference( $object, $object_copy)); if (version_compare(phpversion(), '5', '>=')) { $this->assertTrue(SimpleTestCompatibility::isReference( $object, $object_assignment)); } else { $this->assertFalse(SimpleTestCompatibility::isReference( $object, $object_assignment)); } } } ?>pgfouine-1.2/tests/simpletest/test/unit_tests.php0000644000175000017500000000364510334504436021022 0ustar acmeacmeGroupTest('Unit tests'); $this->addTestFile('errors_test.php'); $this->addTestFile('options_test.php'); $this->addTestFile('dumper_test.php'); $this->addTestFile('expectation_test.php'); $this->addTestFile('unit_tester_test.php'); $this->addTestFile('simple_mock_test.php'); $this->addTestFile('adapter_test.php'); $this->addTestFile('socket_test.php'); $this->addTestFile('encoding_test.php'); $this->addTestFile('url_test.php'); $this->addTestFile('http_test.php'); $this->addTestFile('authentication_test.php'); $this->addTestFile('user_agent_test.php'); $this->addTestFile('parser_test.php'); $this->addTestFile('tag_test.php'); $this->addTestFile('form_test.php'); $this->addTestFile('page_test.php'); $this->addTestFile('frames_test.php'); $this->addTestFile('browser_test.php'); $this->addTestFile('web_tester_test.php'); $this->addTestFile('shell_tester_test.php'); $this->addTestFile('xml_test.php'); } } if (TEST == __FILE__) { $test = &new UnitTests(); if (SimpleReporter::inCli()) { exit ($test->run(new TextReporter()) ? 0 : 1); } $test->run(new HtmlReporter()); } ?>pgfouine-1.2/tests/simpletest/test/live_test.php0000644000175000017500000000400310334504436020604 0ustar acmeacmeassertTrue($socket->isError()); $this->assertWantedPattern( '/Cannot open \\[bad_url:111\\] with \\[.*?\\] within \\[5\\] seconds/', $socket->getError()); $this->assertFalse($socket->isOpen()); $this->assertFalse($socket->write('A message')); } function testSocketClosure() { $socket = &new SimpleSocket('www.lastcraft.com', 80, 15); $this->assertTrue($socket->isOpen()); $this->assertTrue($socket->write("GET /test/network_confirm.php HTTP/1.0\r\n")); $socket->write("Host: www.lastcraft.com\r\n"); $socket->write("Connection: close\r\n\r\n"); $this->assertEqual($socket->read(8), "HTTP/1.1"); $socket->close(); $this->assertIdentical($socket->read(8), false); } function testRecordOfSentCharacters() { $socket = &new SimpleSocket('www.lastcraft.com', 80, 15); $this->assertTrue($socket->write("GET /test/network_confirm.php HTTP/1.0\r\n")); $socket->write("Host: www.lastcraft.com\r\n"); $socket->write("Connection: close\r\n\r\n"); $socket->close(); $this->assertEqual($socket->getSent(), "GET /test/network_confirm.php HTTP/1.0\r\n" . "Host: www.lastcraft.com\r\n" . "Connection: close\r\n\r\n"); } } ?>pgfouine-1.2/tests/simpletest/test/visual_test.php0000644000175000017500000003355610334504436021167 0ustar acmeacme_a = $a; } } class TestOfUnitTestCaseOutput extends UnitTestCase { function testOfResults() { $this->pass('Pass'); $this->fail('Fail'); // Fail. } function testTrue() { $this->assertTrue(true); $this->assertTrue(false); // Fail. } function testFalse() { $this->assertFalse(true); // Fail. $this->assertFalse(false); } function testExpectation() { $expectation = &new EqualExpectation(25, 'My expectation message: %s'); $this->assertExpectation($expectation, 25, 'My assert message : %s'); $this->assertExpectation($expectation, 24, 'My assert message : %s'); // Fail. } function testNull() { $this->assertNull(null, "%s -> Pass"); $this->assertNull(false, "%s -> Fail"); // Fail. $this->assertNotNull(null, "%s -> Fail"); // Fail. $this->assertNotNull(false, "%s -> Pass"); } function testType() { $this->assertIsA("hello", "string", "%s -> Pass"); $this->assertIsA(14, "string", "%s -> Fail"); // Fail. $this->assertIsA($this, "TestOfUnitTestCaseOutput", "%s -> Pass"); $this->assertIsA($this, "UnitTestCase", "%s -> Pass"); $this->assertIsA(14, "TestOfUnitTestCaseOutput", "%s -> Fail"); // Fail. $this->assertIsA($this, "TestReporter", "%s -> Fail"); // Fail. } function testTypeEquality() { $this->assertEqual("0", 0, "%s -> Pass"); $this->assertNotEqual("0", 0, "%s -> Fail"); // Fail. } function testNullEquality() { $this->assertEqual(null, 1, "%s -> Fail"); // Fail. $this->assertNotEqual(null, 1, "%s -> Pass"); $this->assertEqual(1, null, "%s -> Fail"); // Fail. $this->assertNotEqual(1, null, "%s -> Pass"); } function testIntegerEquality() { $this->assertEqual(1, 2, "%s -> Fail"); // Fail. $this->assertNotEqual(1, 2, "%s -> Pass"); } function testStringEquality() { $this->assertEqual("a", "a", "%s -> Pass"); $this->assertNotEqual("a", "a", "%s -> Fail"); // Fail. $this->assertEqual("aa", "ab", "%s -> Fail"); // Fail. $this->assertNotEqual("aa", "ab", "%s -> Pass"); } function testHashEquality() { $this->assertEqual(array("a" => "A", "b" => "B"), array("b" => "B", "a" => "A"), "%s -> Pass"); $this->assertEqual(array("a" => "A", "b" => "B"), array("b" => "B", "a" => "Z"), "%s -> Pass"); } function testStringIdentity() { $a = "fred"; $b = $a; $this->assertIdentical($a, $b, "%s -> Pass"); $this->assertNotIdentical($a, $b, "%s -> Fail"); // Fail. } function testTypeIdentity() { $a = "0"; $b = 0; $this->assertIdentical($a, $b, "%s -> Fail"); // Fail. $this->assertNotIdentical($a, $b, "%s -> Pass"); } function testNullIdentity() { $this->assertIdentical(null, 1, "%s -> Fail"); // Fail. $this->assertNotIdentical(null, 1, "%s -> Pass"); $this->assertIdentical(1, null, "%s -> Fail"); // Fail. $this->assertNotIdentical(1, null, "%s -> Pass"); } function testHashIdentity() { $this->assertIdentical(array("a" => "A", "b" => "B"), array("b" => "B", "a" => "A"), "%s -> fail"); // Fail. } function testObjectEquality() { $this->assertEqual(new TestDisplayClass(4), new TestDisplayClass(4), "%s -> Pass"); $this->assertNotEqual(new TestDisplayClass(4), new TestDisplayClass(4), "%s -> Fail"); // Fail. $this->assertEqual(new TestDisplayClass(4), new TestDisplayClass(5), "%s -> Fail"); // Fail. $this->assertNotEqual(new TestDisplayClass(4), new TestDisplayClass(5), "%s -> Pass"); } function testObjectIndentity() { $this->assertIdentical(new TestDisplayClass(false), new TestDisplayClass(false), "%s -> Pass"); $this->assertNotIdentical(new TestDisplayClass(false), new TestDisplayClass(false), "%s -> Fail"); // Fail. $this->assertIdentical(new TestDisplayClass(false), new TestDisplayClass(0), "%s -> Fail"); // Fail. $this->assertNotIdentical(new TestDisplayClass(false), new TestDisplayClass(0), "%s -> Pass"); } function testReference() { $a = "fred"; $b = &$a; $this->assertReference($a, $b, "%s -> Pass"); $this->assertCopy($a, $b, "%s -> Fail"); // Fail. $c = "Hello"; $this->assertReference($a, $c, "%s -> Fail"); // Fail. $this->assertCopy($a, $c, "%s -> Pass"); } function testPatterns() { $this->assertWantedPattern('/hello/i', "Hello there", "%s -> Pass"); $this->assertNoUnwantedPattern('/hello/', "Hello there", "%s -> Pass"); $this->assertWantedPattern('/hello/', "Hello there", "%s -> Fail"); // Fail. $this->assertNoUnwantedPattern('/hello/i', "Hello there", "%s -> Fail"); // Fail. } function testLongStrings() { $text = ""; for ($i = 0; $i < 10; $i++) { $text .= "0123456789"; } $this->assertEqual($text, $text); $this->assertEqual($text . $text, $text . "a" . $text); // Fail. } function testErrorDisplay() { trigger_error('Default'); // Exception. trigger_error('Error', E_USER_ERROR); // Exception. trigger_error('Warning', E_USER_WARNING); // Exception. trigger_error('Notice', E_USER_NOTICE); // Exception. } function testErrorTrap() { $this->assertNoErrors("%s -> Pass"); $this->assertError(); // Fail. trigger_error('Error 1'); $this->assertNoErrors("%s -> Fail"); // Fail. $this->assertError(); $this->assertNoErrors("%s -> Pass at end"); } function testErrorText() { trigger_error('Error 2'); $this->assertError('Error 2', "%s -> Pass"); trigger_error('Error 3'); $this->assertError('Error 2', "%s -> Fail"); // Fail. } function testErrorPatterns() { trigger_error('Error 2'); $this->assertErrorPattern('/Error 2/', "%s -> Pass"); trigger_error('Error 3'); $this->assertErrorPattern('/Error 2/', "%s -> Fail"); // Fail. } function testDumping() { $this->dump(array("Hello"), "Displaying a variable"); } function testSignal() { $fred = "signal as a string"; $this->signal("Signal", $fred); // Signal. } } class Dummy { function Dummy() { } function a() { } } Mock::generate('Dummy'); class TestOfMockObjectsOutput extends UnitTestCase { function testCallCounts() { $dummy = &new MockDummy($this); $dummy->expectCallCount('a', 1, 'My message: %s'); $dummy->a(); $dummy->tally(); $dummy->a(); $dummy->tally(); } function testMinimumCallCounts() { $dummy = &new MockDummy($this); $dummy->expectMinimumCallCount('a', 2, 'My message: %s'); $dummy->a(); $dummy->tally(); $dummy->a(); $dummy->tally(); } function testEmptyMatching() { $dummy = &new MockDummy($this); $dummy->expectArguments('a', array()); $dummy->a(); $dummy->a(null); // Fail. } function testEmptyMatchingWithCustomMessage() { $dummy = &new MockDummy($this); $dummy->expectArguments('a', array(), 'My expectation message: %s'); $dummy->a(); $dummy->a(null); // Fail. } function testNullMatching() { $dummy = &new MockDummy($this); $dummy->expectArguments('a', array(null)); $dummy->a(null); $dummy->a(); // Fail. } function testBooleanMatching() { $dummy = &new MockDummy($this); $dummy->expectArguments('a', array(true, false)); $dummy->a(true, false); $dummy->a(true, true); // Fail. } function testIntegerMatching() { $dummy = &new MockDummy($this); $dummy->expectArguments('a', array(32, 33)); $dummy->a(32, 33); $dummy->a(32, 34); // Fail. } function testFloatMatching() { $dummy = &new MockDummy($this); $dummy->expectArguments('a', array(3.2, 3.3)); $dummy->a(3.2, 3.3); $dummy->a(3.2, 3.4); // Fail. } function testStringMatching() { $dummy = &new MockDummy($this); $dummy->expectArguments('a', array('32', '33')); $dummy->a('32', '33'); $dummy->a('32', '34'); // Fail. } function testEmptyMatchingWithCustomExpectationMessage() { $dummy = &new MockDummy($this); $dummy->expectArguments( 'a', array(new EqualExpectation('A', 'My part expectation message: %s')), 'My expectation message: %s'); $dummy->a('A'); $dummy->a('B'); // Fail. } function testArrayMatching() { $dummy = &new MockDummy($this); $dummy->expectArguments('a', array(array(32), array(33))); $dummy->a(array(32), array(33)); $dummy->a(array(32), array('33')); // Fail. } function testObjectMatching() { $a = new Dummy(); $a->a = 'a'; $b = new Dummy(); $b->b = 'b'; $dummy = &new MockDummy($this); $dummy->expectArguments('a', array($a, $b)); $dummy->a($a, $b); $dummy->a($a, $a); // Fail. } function testBigList() { $dummy = &new MockDummy($this); $dummy->expectArguments('a', array(false, 0, 1, 1.0)); $dummy->a(false, 0, 1, 1.0); $dummy->a(true, false, 2, 2.0); // Fail. } } class TestOfPastBugs extends UnitTestCase { function testMixedTypes() { $this->assertEqual(array(), null, "%s -> Pass"); $this->assertIdentical(array(), null, "%s -> Fail"); // Fail. } function testMockWildcards() { $dummy = &new MockDummy($this); $dummy->expectArguments('a', array('*', array(33))); $dummy->a(array(32), array(33)); $dummy->a(array(32), array('33')); // Fail. } } class TestOfVisualShell extends ShellTestCase { function testDump() { $this->execute('ls'); $this->dumpOutput(); $this->execute('dir'); $this->dumpOutput(); } function testDumpOfList() { $this->execute('ls'); $this->dump($this->getOutputAsList()); } } class AllOutputReporter extends HtmlReporter { function _getCss() { return parent::_getCss() . ' .pass { color: darkgreen; }'; } function paintPass($message) { parent::paintPass($message); print "Pass: "; $breadcrumb = $this->getTestList(); array_shift($breadcrumb); print implode(" -> ", $breadcrumb); print " -> " . htmlentities($message) . "
\n"; } function paintSignal($type, &$payload) { print "$type: "; $breadcrumb = $this->getTestList(); array_shift($breadcrumb); print implode(" -> ", $breadcrumb); print " -> " . htmlentities(serialize($payload)) . "
\n"; } } $test = &new GroupTest("Visual test with 49 passes, 49 fails and 4 exceptions"); $test->addTestCase(new TestOfUnitTestCaseOutput()); $test->addTestCase(new TestOfMockObjectsOutput()); $test->addTestCase(new TestOfPastBugs()); $test->addTestCase(new TestOfVisualShell()); if (isset($_GET['xml']) || in_array('xml', (isset($argv) ? $argv : array()))) { $reporter = &new XmlReporter(); } elseif(SimpleReporter::inCli()) { $reporter = &new TextReporter(); } else { $reporter = &new AllOutputReporter(); } if (isset($_GET['dry']) || in_array('dry', (isset($argv) ? $argv : array()))) { $reporter->makeDry(); } exit ($test->run($reporter) ? 0 : 1); ?>pgfouine-1.2/tests/simpletest/test/adapter_test.php0000644000175000017500000000411210334504436021266 0ustar acmeacmeassertTrue(true, "PEAR true"); $this->assertFalse(false, "PEAR false"); } function testName() { $this->assertTrue($this->getName() == get_class($this)); } function testPass() { $this->pass("PEAR pass"); } function testNulls() { $value = null; $this->assertNull($value, "PEAR null"); $value = 0; $this->assertNotNull($value, "PEAR not null"); } function testType() { $this->assertType("Hello", "string", "PEAR type"); } function testEquals() { $this->assertEquals(12, 12, "PEAR identity"); $this->setLooselyTyped(true); $this->assertEquals("12", 12, "PEAR equality"); } function testSame() { $same = &new SameTestClass(); $this->assertSame($same, $same, "PEAR same"); } function testRegExp() { $this->assertRegExp('/hello/', "A big hello from me", "PEAR regex"); } } class TestOfPhpUnitAdapter extends TestCase { function TestOfPhpUnitAdapter() { $this->TestCase("TestOfPhpUnitAdapter"); } function testBoolean() { $this->assert(true, "PHP Unit true"); } function testName() { $this->assertTrue($this->name() == "TestOfPhpUnitAdapter"); } function testEquals() { $this->assertEquals(12, 12, "PHP Unit equality"); } function testMultilineEquals() { $this->assertEquals("a\nb\n", "a\nb\n", "PHP Unit equality"); } function testRegExp() { $this->assertRegexp('/hello/', "A big hello from me", "PEAR regex"); } } ?>pgfouine-1.2/tests/simpletest/test/url_test.php0000644000175000017500000004220310334504436020453 0ustar acmeacmeassertEqual($url->getScheme(), ''); $this->assertEqual($url->getHost(), ''); $this->assertEqual($url->getScheme('http'), 'http'); $this->assertEqual($url->getHost('localhost'), 'localhost'); $this->assertEqual($url->getPath(), ''); } function testBasicParsing() { $url = new SimpleUrl('https://www.lastcraft.com/test/'); $this->assertEqual($url->getScheme(), 'https'); $this->assertEqual($url->getHost(), 'www.lastcraft.com'); $this->assertEqual($url->getPath(), '/test/'); } function testRelativeUrls() { $url = new SimpleUrl('../somewhere.php'); $this->assertEqual($url->getScheme(), false); $this->assertEqual($url->getHost(), false); $this->assertEqual($url->getPath(), '../somewhere.php'); } function testParseBareParameter() { $url = new SimpleUrl('?a'); $this->assertEqual($url->getPath(), ''); $this->assertEqual($url->getEncodedRequest(), '?a='); } function testParseEmptyParameter() { $url = new SimpleUrl('?a='); $this->assertEqual($url->getPath(), ''); $this->assertEqual($url->getEncodedRequest(), '?a='); } function testParseParameterPair() { $url = new SimpleUrl('?a=A'); $this->assertEqual($url->getPath(), ''); $this->assertEqual($url->getEncodedRequest(), '?a=A'); } function testParseMultipleParameters() { $url = new SimpleUrl('?a=A&b=B'); $this->assertEqual($url->getEncodedRequest(), '?a=A&b=B'); } function testParsingParameterMixture() { $url = new SimpleUrl('?a=A&b=&c'); $this->assertEqual($url->getEncodedRequest(), '?a=A&b=&c='); } function testAddParameters() { $url = new SimpleUrl(''); $url->addRequestParameter('a', 'A'); $this->assertEqual($url->getEncodedRequest(), '?a=A'); $url->addRequestParameter('b', 'B'); $this->assertEqual($url->getEncodedRequest(), '?a=A&b=B'); $url->addRequestParameter('a', 'aaa'); $this->assertEqual($url->getEncodedRequest(), '?a=A&a=aaa&b=B'); } function testClearingParameters() { $url = new SimpleUrl(''); $url->addRequestParameter('a', 'A'); $url->clearRequest(); $this->assertIdentical($url->getEncodedRequest(), ''); } function testEncodingParameters() { $url = new SimpleUrl(''); $url->addRequestParameter('a', '?!"\'#~@[]{}:;<>,./|£$%^&*()_+-='); $this->assertIdentical( $request = $url->getEncodedRequest(), '?a=%3F%21%22%27%23%7E%40%5B%5D%7B%7D%3A%3B%3C%3E%2C.%2F%7C%A3%24%25%5E%26%2A%28%29_%2B-%3D'); } function testDecodingParameters() { $url = new SimpleUrl('?a=%3F%21%22%27%23%7E%40%5B%5D%7B%7D%3A%3B%3C%3E%2C.%2F%7C%A3%24%25%5E%26%2A%28%29_%2B-%3D'); $this->assertEqual( $url->getEncodedRequest(), '?a=' . urlencode('?!"\'#~@[]{}:;<>,./|£$%^&*()_+-=')); } function testSettingCordinates() { $url = new SimpleUrl(''); $url->setCoordinates('32', '45'); $this->assertIdentical($url->getX(), 32); $this->assertIdentical($url->getY(), 45); $this->assertEqual($url->getEncodedRequest(), '?32,45'); } function testParseCordinates() { $url = new SimpleUrl('?32,45'); $this->assertIdentical($url->getX(), 32); $this->assertIdentical($url->getY(), 45); $this->assertEqual($url->getEncodedRequest(), '?32,45'); } function testClearingCordinates() { $url = new SimpleUrl('?32,45'); $url->setCoordinates(); $this->assertIdentical($url->getX(), false); $this->assertIdentical($url->getY(), false); } function testParsingParameterCordinateMixture() { $url = new SimpleUrl('?a=A&b=&c?32,45'); $this->assertIdentical($url->getX(), 32); $this->assertIdentical($url->getY(), 45); $this->assertEqual($url->getEncodedRequest(), '?a=A&b=&c=?32,45'); } function testParsingParameterWithBadCordinates() { $url = new SimpleUrl('?a=A&b=&c?32'); $this->assertIdentical($url->getX(), false); $this->assertIdentical($url->getY(), false); $this->assertEqual($url->getEncodedRequest(), '?a=A&b=&c?32='); } function testPageSplitting() { $url = new SimpleUrl('./here/../there/somewhere.php'); $this->assertEqual($url->getPath(), './here/../there/somewhere.php'); $this->assertEqual($url->getPage(), 'somewhere.php'); $this->assertEqual($url->getBasePath(), './here/../there/'); } function testAbsolutePathPageSplitting() { $url = new SimpleUrl("http://host.com/here/there/somewhere.php"); $this->assertEqual($url->getPath(), "/here/there/somewhere.php"); $this->assertEqual($url->getPage(), "somewhere.php"); $this->assertEqual($url->getBasePath(), "/here/there/"); } function testSplittingUrlWithNoPageGivesEmptyPage() { $url = new SimpleUrl('/here/there/'); $this->assertEqual($url->getPath(), '/here/there/'); $this->assertEqual($url->getPage(), ''); $this->assertEqual($url->getBasePath(), '/here/there/'); } function testPathNormalisation() { $this->assertEqual( SimpleUrl::normalisePath('https://host.com/I/am/here/../there/somewhere.php'), 'https://host.com/I/am/there/somewhere.php'); } function testUsernameAndPasswordAreUrlDecoded() { $url = new SimpleUrl('http://' . urlencode('test@test') . ':' . urlencode('$!£@*&%') . '@www.lastcraft.com'); $this->assertEqual($url->getUsername(), 'test@test'); $this->assertEqual($url->getPassword(), '$!£@*&%'); } function testBlitz() { $this->assertUrl( "https://username:password@www.somewhere.com:243/this/that/here.php?a=1&b=2#anchor", array("https", "username", "password", "www.somewhere.com", 243, "/this/that/here.php", "com", "?a=1&b=2", "anchor"), array("a" => "1", "b" => "2")); $this->assertUrl( "username:password@www.somewhere.com/this/that/here.php?a=1", array(false, "username", "password", "www.somewhere.com", false, "/this/that/here.php", "com", "?a=1", false), array("a" => "1")); $this->assertUrl( "username:password@somewhere.com:243?1,2", array(false, "username", "password", "somewhere.com", 243, "/", "com", "?1,2", false), array(), array(1, 2)); $this->assertUrl( "https://www.somewhere.com", array("https", false, false, "www.somewhere.com", false, "/", "com", "", false)); $this->assertUrl( "username@www.somewhere.com:243#anchor", array(false, "username", false, "www.somewhere.com", 243, "/", "com", "", "anchor")); $this->assertUrl( "/this/that/here.php?a=1&b=2?3,4", array(false, false, false, false, false, "/this/that/here.php", false, "?a=1&b=2?3,4", false), array("a" => "1", "b" => "2"), array(3, 4)); $this->assertUrl( "username@/here.php?a=1&b=2", array(false, "username", false, false, false, "/here.php", false, "?a=1&b=2", false), array("a" => "1", "b" => "2")); } function testAmbiguousHosts() { $this->assertUrl( "tigger", array(false, false, false, false, false, "tigger", false, "", false)); $this->assertUrl( "/tigger", array(false, false, false, false, false, "/tigger", false, "", false)); $this->assertUrl( "//tigger", array(false, false, false, "tigger", false, "/", false, "", false)); $this->assertUrl( "//tigger/", array(false, false, false, "tigger", false, "/", false, "", false)); $this->assertUrl( "tigger.com", array(false, false, false, "tigger.com", false, "/", "com", "", false)); $this->assertUrl( "me.net/tigger", array(false, false, false, "me.net", false, "/tigger", "net", "", false)); } function testAsString() { $this->assertPreserved('https://www.here.com'); $this->assertPreserved('http://me:secret@www.here.com'); $this->assertPreserved('http://here/there'); $this->assertPreserved('http://here/there?a=A&b=B'); $this->assertPreserved('http://here/there?a=1&a=2'); $this->assertPreserved('http://here/there?a=1&a=2?9,8'); $this->assertPreserved('http://host?a=1&a=2'); $this->assertPreserved('http://host#stuff'); $this->assertPreserved('http://me:secret@www.here.com/a/b/c/here.html?a=A?7,6'); } function assertUrl($raw, $parts, $params = false, $coords = false) { if (! is_array($params)) { $params = array(); } $url = new SimpleUrl($raw); $this->assertIdentical($url->getScheme(), $parts[0], "[$raw] scheme -> %s"); $this->assertIdentical($url->getUsername(), $parts[1], "[$raw] username -> %s"); $this->assertIdentical($url->getPassword(), $parts[2], "[$raw] password -> %s"); $this->assertIdentical($url->getHost(), $parts[3], "[$raw] host -> %s"); $this->assertIdentical($url->getPort(), $parts[4], "[$raw] port -> %s"); $this->assertIdentical($url->getPath(), $parts[5], "[$raw] path -> %s"); $this->assertIdentical($url->getTld(), $parts[6], "[$raw] tld -> %s"); $this->assertIdentical($url->getEncodedRequest(), $parts[7], "[$raw] encoded -> %s"); $this->assertIdentical($url->getFragment(), $parts[8], "[$raw] fragment -> %s"); if ($coords) { $this->assertIdentical($url->getX(), $coords[0], "[$raw] x -> %s"); $this->assertIdentical($url->getY(), $coords[1], "[$raw] y -> %s"); } } function assertPreserved($string) { $url = new SimpleUrl($string); $this->assertEqual($url->asString(), $string); } } class TestOfAbsoluteUrls extends UnitTestCase { function testMakingAbsolute() { $url = new SimpleUrl('../there/somewhere.php'); $this->assertEqual($url->getPath(), '../there/somewhere.php'); $absolute = $url->makeAbsolute('https://host.com:1234/I/am/here/'); $this->assertEqual($absolute->getScheme(), 'https'); $this->assertEqual($absolute->getHost(), 'host.com'); $this->assertEqual($absolute->getPort(), 1234); $this->assertEqual($absolute->getPath(), '/I/am/there/somewhere.php'); } function testMakingAnEmptyUrlAbsolute() { $url = new SimpleUrl(''); $this->assertEqual($url->getPath(), ''); $absolute = $url->makeAbsolute('http://host.com/I/am/here/page.html'); $this->assertEqual($absolute->getScheme(), 'http'); $this->assertEqual($absolute->getHost(), 'host.com'); $this->assertEqual($absolute->getPath(), '/I/am/here/page.html'); } function testMakingAnEmptyUrlAbsoluteWithMissingPageName() { $url = new SimpleUrl(''); $this->assertEqual($url->getPath(), ''); $absolute = $url->makeAbsolute('http://host.com/I/am/here/'); $this->assertEqual($absolute->getScheme(), 'http'); $this->assertEqual($absolute->getHost(), 'host.com'); $this->assertEqual($absolute->getPath(), '/I/am/here/'); } function testMakingAShortQueryUrlAbsolute() { $url = new SimpleUrl('?a#b'); $this->assertEqual($url->getPath(), ''); $absolute = $url->makeAbsolute('http://host.com/I/am/here/'); $this->assertEqual($absolute->getScheme(), 'http'); $this->assertEqual($absolute->getHost(), 'host.com'); $this->assertEqual($absolute->getPath(), '/I/am/here/'); $this->assertEqual($absolute->getEncodedRequest(), '?a='); $this->assertEqual($absolute->getFragment(), 'b'); } function testMakingADirectoryUrlAbsolute() { $url = new SimpleUrl('hello/'); $this->assertEqual($url->getPath(), 'hello/'); $this->assertEqual($url->getBasePath(), 'hello/'); $this->assertEqual($url->getPage(), ''); $absolute = $url->makeAbsolute('http://host.com/I/am/here/page.html'); $this->assertEqual($absolute->getPath(), '/I/am/here/hello/'); } function testMakingARootUrlAbsolute() { $url = new SimpleUrl('/'); $this->assertEqual($url->getPath(), '/'); $absolute = $url->makeAbsolute('http://host.com/I/am/here/page.html'); $this->assertEqual($absolute->getPath(), '/'); } function testMakingARootPageUrlAbsolute() { $url = new SimpleUrl('/here.html'); $absolute = $url->makeAbsolute('http://host.com/I/am/here/page.html'); $this->assertEqual($absolute->getPath(), '/here.html'); } function testMakingCoordinateUrlAbsolute() { $url = new SimpleUrl('?1,2'); $this->assertEqual($url->getPath(), ''); $absolute = $url->makeAbsolute('http://host.com/I/am/here/'); $this->assertEqual($absolute->getScheme(), 'http'); $this->assertEqual($absolute->getHost(), 'host.com'); $this->assertEqual($absolute->getPath(), '/I/am/here/'); $this->assertEqual($absolute->getX(), 1); $this->assertEqual($absolute->getY(), 2); } function testMakingAbsoluteAppendedPath() { $url = new SimpleUrl('./there/somewhere.php'); $absolute = $url->makeAbsolute('https://host.com/here/'); $this->assertEqual($absolute->getPath(), '/here/there/somewhere.php'); } function testMakingAbsoluteBadlyFormedAppendedPath() { $url = new SimpleUrl('there/somewhere.php'); $absolute = $url->makeAbsolute('https://host.com/here/'); $this->assertEqual($absolute->getPath(), '/here/there/somewhere.php'); } function testMakingAbsoluteHasNoEffectWhenAlreadyAbsolute() { $url = new SimpleUrl('https://test:secret@www.lastcraft.com:321/stuff/?a=1#f'); $absolute = $url->makeAbsolute('http://host.com/here/'); $this->assertEqual($absolute->getScheme(), 'https'); $this->assertEqual($absolute->getUsername(), 'test'); $this->assertEqual($absolute->getPassword(), 'secret'); $this->assertEqual($absolute->getHost(), 'www.lastcraft.com'); $this->assertEqual($absolute->getPort(), 321); $this->assertEqual($absolute->getPath(), '/stuff/'); $this->assertEqual($absolute->getEncodedRequest(), '?a=1'); $this->assertEqual($absolute->getFragment(), 'f'); } function testMakingHostOnlyAbsoluteDoesNotCarryAnyOtherInformation() { $url = new SimpleUrl('http://www.lastcraft.com'); $absolute = $url->makeAbsolute('https://host.com:81/here/'); $this->assertEqual($absolute->getScheme(), 'http'); $this->assertEqual($absolute->getHost(), 'www.lastcraft.com'); $this->assertIdentical($absolute->getPort(), false); $this->assertEqual($absolute->getPath(), '/'); } } class TestOfFrameUrl extends UnitTestCase { function testTargetAttachment() { $url = new SimpleUrl('http://www.site.com/home.html'); $this->assertIdentical($url->getTarget(), false); $url->setTarget('A frame'); $this->assertIdentical($url->getTarget(), 'A frame'); } } ?>pgfouine-1.2/tests/simpletest/test/xml_test.php0000644000175000017500000002001410334504436020445 0ustar acmeacme 2)); $this->assertEqual($nesting->getSize(), 2); } } class TestOfXmlStructureParsing extends UnitTestCase { function testValidXml() { $listener = &new MockSimpleScorer($this); $listener->expectNever('paintGroupStart'); $listener->expectNever('paintGroupEnd'); $listener->expectNever('paintCaseStart'); $listener->expectNever('paintCaseEnd'); $parser = &new SimpleTestXmlParser($listener); $this->assertTrue($parser->parse("\n")); $this->assertTrue($parser->parse("\n")); $this->assertTrue($parser->parse("\n")); } function testEmptyGroup() { $listener = &new MockSimpleScorer($this); $listener->expectOnce('paintGroupStart', array('a_group', 7)); $listener->expectOnce('paintGroupEnd', array('a_group')); $parser = &new SimpleTestXmlParser($listener); $parser->parse("\n"); $parser->parse("\n"); $this->assertTrue($parser->parse("\n")); $this->assertTrue($parser->parse("a_group\n")); $this->assertTrue($parser->parse("\n")); $parser->parse("\n"); $listener->tally(); } function testEmptyCase() { $listener = &new MockSimpleScorer($this); $listener->expectOnce('paintCaseStart', array('a_case')); $listener->expectOnce('paintCaseEnd', array('a_case')); $parser = &new SimpleTestXmlParser($listener); $parser->parse("\n"); $parser->parse("\n"); $this->assertTrue($parser->parse("\n")); $this->assertTrue($parser->parse("a_case\n")); $this->assertTrue($parser->parse("\n")); $parser->parse("\n"); $listener->tally(); } function testEmptyMethod() { $listener = &new MockSimpleScorer($this); $listener->expectOnce('paintCaseStart', array('a_case')); $listener->expectOnce('paintCaseEnd', array('a_case')); $listener->expectOnce('paintMethodStart', array('a_method')); $listener->expectOnce('paintMethodEnd', array('a_method')); $parser = &new SimpleTestXmlParser($listener); $parser->parse("\n"); $parser->parse("\n"); $parser->parse("\n"); $parser->parse("a_case\n"); $this->assertTrue($parser->parse("\n")); $this->assertTrue($parser->parse("a_method\n")); $this->assertTrue($parser->parse("\n")); $parser->parse("\n"); $parser->parse("\n"); $listener->tally(); } function testNestedGroup() { $listener = &new MockSimpleScorer($this); $listener->expectArgumentsAt(0, 'paintGroupStart', array('a_group', 7)); $listener->expectArgumentsAt(1, 'paintGroupStart', array('b_group', 3)); $listener->expectCallCount('paintGroupStart', 2); $listener->expectArgumentsAt(0, 'paintGroupEnd', array('b_group')); $listener->expectArgumentsAt(1, 'paintGroupEnd', array('a_group')); $listener->expectCallCount('paintGroupEnd', 2); $parser = &new SimpleTestXmlParser($listener); $parser->parse("\n"); $parser->parse("\n"); $this->assertTrue($parser->parse("\n")); $this->assertTrue($parser->parse("a_group\n")); $this->assertTrue($parser->parse("\n")); $this->assertTrue($parser->parse("b_group\n")); $this->assertTrue($parser->parse("\n")); $this->assertTrue($parser->parse("\n")); $parser->parse("\n"); $listener->tally(); } } class AnyOldSignal { var $stuff = true; } class TestOfXmlResultsParsing extends UnitTestCase { function sendValidStart(&$parser) { $parser->parse("\n"); $parser->parse("\n"); $parser->parse("\n"); $parser->parse("a_case\n"); $parser->parse("\n"); $parser->parse("a_method\n"); } function sendValidEnd(&$parser) { $parser->parse("\n"); $parser->parse("\n"); $parser->parse("\n"); } function testPass() { $listener = &new MockSimpleScorer($this); $listener->expectOnce('paintPass', array('a_message')); $parser = &new SimpleTestXmlParser($listener); $this->sendValidStart($parser); $this->assertTrue($parser->parse("a_message\n")); $this->sendValidEnd($parser); $listener->tally(); } function testFail() { $listener = &new MockSimpleScorer($this); $listener->expectOnce('paintFail', array('a_message')); $parser = &new SimpleTestXmlParser($listener); $this->sendValidStart($parser); $this->assertTrue($parser->parse("a_message\n")); $this->sendValidEnd($parser); $listener->tally(); } function testException() { $listener = &new MockSimpleScorer($this); $listener->expectOnce('paintException', array('a_message')); $parser = &new SimpleTestXmlParser($listener); $this->sendValidStart($parser); $this->assertTrue($parser->parse("a_message\n")); $this->sendValidEnd($parser); $listener->tally(); } function testSignal() { $signal = new AnyOldSignal(); $signal->stuff = "Hello"; $listener = &new MockSimpleScorer($this); $listener->expectOnce('paintSignal', array('a_signal', $signal)); $parser = &new SimpleTestXmlParser($listener); $this->sendValidStart($parser); $this->assertTrue($parser->parse( "\n")); $this->sendValidEnd($parser); $listener->tally(); } function testMessage() { $listener = &new MockSimpleScorer($this); $listener->expectOnce('paintMessage', array('a_message')); $parser = &new SimpleTestXmlParser($listener); $this->sendValidStart($parser); $this->assertTrue($parser->parse("a_message\n")); $this->sendValidEnd($parser); $listener->tally(); } function testFormattedMessage() { $listener = &new MockSimpleScorer($this); $listener->expectOnce('paintFormattedMessage', array("\na\tmessage\n")); $parser = &new SimpleTestXmlParser($listener); $this->sendValidStart($parser); $this->assertTrue($parser->parse("\n")); $this->sendValidEnd($parser); $listener->tally(); } } ?>pgfouine-1.2/tests/simpletest/test/shell_tester_test.php0000644000175000017500000000252010334504436022344 0ustar acmeacme_mock_shell; } function testExitCode() { $this->_mock_shell = &new MockSimpleShell($this); $this->_mock_shell->setReturnValue('execute', 0); $this->_mock_shell->expectOnce('execute', array('ls')); $this->assertTrue($this->execute('ls')); $this->assertExitCode(0); $this->_mock_shell->tally(); } function testOutput() { $this->_mock_shell = &new MockSimpleShell($this); $this->_mock_shell->setReturnValue('execute', 0); $this->_mock_shell->setReturnValue('getOutput', "Line 1\nLine 2\n"); $this->assertOutput("Line 1\nLine 2\n"); } function testOutputPatterns() { $this->_mock_shell = &new MockSimpleShell($this); $this->_mock_shell->setReturnValue('execute', 0); $this->_mock_shell->setReturnValue('getOutput', "Line 1\nLine 2\n"); $this->assertOutputPattern('/line/i'); $this->assertNoOutputPattern('/line 2/'); } } ?>pgfouine-1.2/tests/simpletest/test/page_test.php0000644000175000017500000010373510334504436020575 0ustar acmeacme 'http://somewhere')); $tag->addContent('Label'); $page = &new MockSimplePage($this); $page->expectArguments('acceptTag', array($tag)); $page->expectCallCount('acceptTag', 1); $builder = &new PartialSimplePageBuilder($this); $builder->setReturnReference('_createPage', $page); $builder->setReturnReference('_createParser', new MockSimpleSaxParser($this)); $builder->SimplePageBuilder(); $builder->parse(new MockSimpleHttpResponse($this)); $this->assertTrue($builder->startElement( 'a', array('href' => 'http://somewhere'))); $this->assertTrue($builder->addContent('Label')); $this->assertTrue($builder->endElement('a')); $page->tally(); } function testLinkWithId() { $tag = &new SimpleAnchorTag(array("href" => "http://somewhere", "id" => "44")); $tag->addContent("Label"); $page = &new MockSimplePage($this); $page->expectArguments("acceptTag", array($tag)); $page->expectCallCount("acceptTag", 1); $builder = &new PartialSimplePageBuilder($this); $builder->setReturnReference('_createPage', $page); $builder->setReturnReference('_createParser', new MockSimpleSaxParser($this)); $builder->SimplePageBuilder(); $builder->parse(new MockSimpleHttpResponse($this)); $this->assertTrue($builder->startElement( "a", array("href" => "http://somewhere", "id" => "44"))); $this->assertTrue($builder->addContent("Label")); $this->assertTrue($builder->endElement("a")); $page->tally(); } function testLinkExtraction() { $tag = &new SimpleAnchorTag(array("href" => "http://somewhere")); $tag->addContent("Label"); $page = &new MockSimplePage($this); $page->expectArguments("acceptTag", array($tag)); $page->expectCallCount("acceptTag", 1); $builder = &new PartialSimplePageBuilder($this); $builder->setReturnReference('_createPage', $page); $builder->setReturnReference('_createParser', new MockSimpleSaxParser($this)); $builder->SimplePageBuilder(); $builder->parse(new MockSimpleHttpResponse($this)); $this->assertTrue($builder->addContent("Starting stuff")); $this->assertTrue($builder->startElement( "a", array("href" => "http://somewhere"))); $this->assertTrue($builder->addContent("Label")); $this->assertTrue($builder->endElement("a")); $this->assertTrue($builder->addContent("Trailing stuff")); $page->tally(); } function testMultipleLinks() { $a1 = new SimpleAnchorTag(array("href" => "http://somewhere")); $a1->addContent("1"); $a2 = new SimpleAnchorTag(array("href" => "http://elsewhere")); $a2->addContent("2"); $page = &new MockSimplePage($this); $page->expectArgumentsAt(0, "acceptTag", array($a1)); $page->expectArgumentsAt(1, "acceptTag", array($a2)); $page->expectCallCount("acceptTag", 2); $builder = &new PartialSimplePageBuilder($this); $builder->setReturnReference('_createPage', $page); $builder->setReturnReference('_createParser', new MockSimpleSaxParser($this)); $builder->SimplePageBuilder(); $builder->parse(new MockSimpleHttpResponse($this)); $builder->startElement("a", array("href" => "http://somewhere")); $builder->addContent("1"); $builder->endElement("a"); $builder->addContent("Padding"); $builder->startElement("a", array("href" => "http://elsewhere")); $builder->addContent("2"); $builder->endElement("a"); $page->tally(); } function testTitle() { $tag = &new SimpleTitleTag(array()); $tag->addContent("HereThere"); $page = &new MockSimplePage($this); $page->expectArguments("acceptTag", array($tag)); $page->expectCallCount("acceptTag", 1); $builder = &new PartialSimplePageBuilder($this); $builder->setReturnReference('_createPage', $page); $builder->setReturnReference('_createParser', new MockSimpleSaxParser($this)); $builder->SimplePageBuilder(); $builder->parse(new MockSimpleHttpResponse($this)); $builder->startElement("title", array()); $builder->addContent("Here"); $builder->addContent("There"); $builder->endElement("title"); $page->tally(); } function testForm() { $page = &new MockSimplePage($this); $page->expectOnce("acceptFormStart", array(new SimpleFormTag(array()))); $page->expectOnce("acceptFormEnd", array()); $builder = &new PartialSimplePageBuilder($this); $builder->setReturnReference('_createPage', $page); $builder->setReturnReference('_createParser', new MockSimpleSaxParser($this)); $builder->SimplePageBuilder(); $builder->parse(new MockSimpleHttpResponse($this)); $builder->startElement("form", array()); $builder->addContent("Stuff"); $builder->endElement("form"); $page->tally(); } } class TestOfPageParsing extends UnitTestCase { function testParseMechanics() { $parser = &new MockSimpleSaxParser($this); $parser->expectOnce('parse', array('stuff')); $page = &new MockSimplePage($this); $page->expectOnce('acceptPageEnd'); $builder = &new PartialSimplePageBuilder($this); $builder->setReturnReference('_createPage', $page); $builder->setReturnReference('_createParser', $parser); $builder->SimplePageBuilder(); $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getContent', 'stuff'); $builder->parse($response); $parser->tally(); $page->tally(); } } class TestOfErrorPage extends UnitTestCase { function testInterface() { $page = &new SimplePage(); $this->assertEqual($page->getTransportError(), 'No page fetched yet'); $this->assertIdentical($page->getRaw(), false); $this->assertIdentical($page->getHeaders(), false); $this->assertIdentical($page->getMimeType(), false); $this->assertIdentical($page->getResponseCode(), false); $this->assertIdentical($page->getAuthentication(), false); $this->assertIdentical($page->getRealm(), false); $this->assertFalse($page->hasFrames()); $this->assertIdentical($page->getAbsoluteUrls(), array()); $this->assertIdentical($page->getRelativeUrls(), array()); $this->assertIdentical($page->getTitle(), false); } } class TestOfPageHeaders extends UnitTestCase { function testUrlAccessor() { $headers = &new MockSimpleHttpHeaders($this); $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getHeaders', $headers); $response->setReturnValue('getMethod', 'POST'); $response->setReturnValue('getUrl', new SimpleUrl('here')); $response->setReturnValue('getRequestData', array('a' => 'A')); $page = &new SimplePage($response); $this->assertEqual($page->getMethod(), 'POST'); $this->assertEqual($page->getUrl(), new SimpleUrl('here')); $this->assertEqual($page->getRequestData(), array('a' => 'A')); } function testTransportError() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getError', 'Ouch'); $page = &new SimplePage($response); $this->assertEqual($page->getTransportError(), 'Ouch'); } function testHeadersAccessor() { $headers = &new MockSimpleHttpHeaders($this); $headers->setReturnValue('getRaw', 'My: Headers'); $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getHeaders', $headers); $page = &new SimplePage($response); $this->assertEqual($page->getHeaders(), 'My: Headers'); } function testMimeAccessor() { $headers = &new MockSimpleHttpHeaders($this); $headers->setReturnValue('getMimeType', 'text/html'); $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getHeaders', $headers); $page = &new SimplePage($response); $this->assertEqual($page->getMimeType(), 'text/html'); } function testResponseAccessor() { $headers = &new MockSimpleHttpHeaders($this); $headers->setReturnValue('getResponseCode', 301); $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getHeaders', $headers); $page = &new SimplePage($response); $this->assertIdentical($page->getResponseCode(), 301); } function testAuthenticationAccessors() { $headers = &new MockSimpleHttpHeaders($this); $headers->setReturnValue('getAuthentication', 'Basic'); $headers->setReturnValue('getRealm', 'Secret stuff'); $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getHeaders', $headers); $page = &new SimplePage($response); $this->assertEqual($page->getAuthentication(), 'Basic'); $this->assertEqual($page->getRealm(), 'Secret stuff'); } } class TestOfHtmlPage extends UnitTestCase { function testRawAccessor() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getContent', 'Raw HTML'); $page = &new SimplePage($response); $this->assertEqual($page->getRaw(), 'Raw HTML'); } function testTextAccessor() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getContent', 'Some "messy" HTML'); $page = &new SimplePage($response); $this->assertEqual($page->getText(), 'Some "messy" HTML'); } function testNoLinks() { $page = &new SimplePage(new MockSimpleHttpResponse($this)); $this->assertIdentical($page->getAbsoluteUrls(), array(), 'abs->%s'); $this->assertIdentical($page->getRelativeUrls(), array(), 'rel->%s'); $this->assertIdentical($page->getUrlsByLabel('Label'), array()); } function testAddAbsoluteLink() { $link = &new SimpleAnchorTag(array('href' => 'http://somewhere.com')); $link->addContent('Label'); $page = &new SimplePage(new MockSimpleHttpResponse($this)); $page->AcceptTag($link); $this->assertEqual($page->getAbsoluteUrls(), array('http://somewhere.com'), 'abs->%s'); $this->assertIdentical($page->getRelativeUrls(), array(), 'rel->%s'); $this->assertEqual( $page->getUrlsByLabel('Label'), array(new SimpleUrl('http://somewhere.com'))); } function testAddStrictRelativeLink() { $link = &new SimpleAnchorTag(array('href' => './somewhere.php')); $link->addContent('Label'); $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getUrl', new SimpleUrl('http://host/')); $page = &new SimplePage($response); $page->AcceptTag($link); $this->assertEqual($page->getAbsoluteUrls(), array(), 'abs->%s'); $this->assertIdentical($page->getRelativeUrls(), array('./somewhere.php'), 'rel->%s'); $this->assertEqual( $page->getUrlsByLabel('Label'), array(new SimpleUrl('http://host/somewhere.php'))); } function testAddRelativeLink() { $link = &new SimpleAnchorTag(array('href' => 'somewhere.php')); $link->addContent('Label'); $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getUrl', new SimpleUrl('http://host/')); $page = &new SimplePage($response); $page->AcceptTag($link); $this->assertEqual($page->getAbsoluteUrls(), array(), 'abs->%s'); $this->assertIdentical($page->getRelativeUrls(), array('somewhere.php'), 'rel->%s'); $this->assertEqual( $page->getUrlsByLabel('Label'), array(new SimpleUrl('http://host/somewhere.php'))); } function testLinkIds() { $link = &new SimpleAnchorTag(array('href' => './somewhere.php', 'id' => 33)); $link->addContent('Label'); $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getUrl', new SimpleUrl('http://host/')); $page = &new SimplePage($response); $page->AcceptTag($link); $this->assertEqual( $page->getUrlsByLabel('Label'), array(new SimpleUrl('http://host/somewhere.php'))); $this->assertFalse($page->getUrlById(0)); $this->assertEqual( $page->getUrlById(33), new SimpleUrl('http://host/somewhere.php')); } function testFindLinkWithNormalisation() { $link = &new SimpleAnchorTag(array('href' => './somewhere.php', 'id' => 33)); $link->addContent(' Long & thin '); $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getUrl', new SimpleUrl('http://host/')); $page = &new SimplePage($response); $page->AcceptTag($link); $this->assertEqual( $page->getUrlsByLabel('Long & thin'), array(new SimpleUrl('http://host/somewhere.php'))); } function testFindLinkWithImage() { $link = &new SimpleAnchorTag(array('href' => './somewhere.php', 'id' => 33)); $link->addContent('<A picture>'); $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getUrl', new SimpleUrl('http://host/')); $page = &new SimplePage($response); $page->AcceptTag($link); $this->assertEqual( $page->getUrlsByLabel(''), array(new SimpleUrl('http://host/somewhere.php'))); } function testTitleSetting() { $title = &new SimpleTitleTag(array()); $title->addContent('Title'); $page = &new SimplePage(new MockSimpleHttpResponse($this)); $page->AcceptTag($title); $this->assertEqual($page->getTitle(), 'Title'); } function testFramesetAbsence() { $url = new SimpleUrl('here'); $response = new MockSimpleHttpResponse($this); $response->setReturnValue('getUrl', $url); $page = &new SimplePage($response); $this->assertFalse($page->hasFrames()); $this->assertIdentical($page->getFrameset(), false); } function testHasEmptyFrameset() { $page = &new SimplePage(new MockSimpleHttpResponse($this)); $page->acceptFramesetStart(new SimpleTag('frameset', array())); $page->acceptFramesetEnd(); $this->assertTrue($page->hasFrames()); $this->assertIdentical($page->getFrameset(), array()); } function testFramesInPage() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getUrl', new SimpleUrl('http://here')); $page = &new SimplePage($response); $page->acceptFrame(new SimpleFrameTag(array('src' => '1.html'))); $page->acceptFramesetStart(new SimpleTag('frameset', array())); $page->acceptFrame(new SimpleFrameTag(array('src' => '2.html'))); $page->acceptFrame(new SimpleFrameTag(array('src' => '3.html'))); $page->acceptFramesetEnd(); $page->acceptFrame(new SimpleFrameTag(array('src' => '4.html'))); $this->assertTrue($page->hasFrames()); $this->assertIdentical($page->getFrameset(), array( 1 => new SimpleUrl('http://here/2.html'), 2 => new SimpleUrl('http://here/3.html'))); } function testNamedFramesInPage() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getUrl', new SimpleUrl('http://here')); $page = &new SimplePage($response); $page->acceptFramesetStart(new SimpleTag('frameset', array())); $page->acceptFrame(new SimpleFrameTag(array('src' => '1.html'))); $page->acceptFrame(new SimpleFrameTag(array('src' => '2.html', 'name' => 'A'))); $page->acceptFrame(new SimpleFrameTag(array('src' => '3.html', 'name' => 'B'))); $page->acceptFrame(new SimpleFrameTag(array('src' => '4.html'))); $page->acceptFramesetEnd(); $this->assertTrue($page->hasFrames()); $this->assertIdentical($page->getFrameset(), array( 1 => new SimpleUrl('http://here/1.html'), 'A' => new SimpleUrl('http://here/2.html'), 'B' => new SimpleUrl('http://here/3.html'), 4 => new SimpleUrl('http://here/4.html'))); } } class TestOfForms extends UnitTestCase { function testButtons() { $page = &new SimplePage(new MockSimpleHttpResponse($this)); $page->acceptFormStart( new SimpleFormTag(array("method" => "GET", "action" => "here.php"))); $page->AcceptTag( new SimpleSubmitTag(array("type" => "submit", "name" => "s"))); $page->acceptFormEnd(); $form = &$page->getFormBySubmitLabel("Submit"); $this->assertEqual( $form->submitButtonByLabel("Submit"), new SimpleFormEncoding(array("s" => "Submit"))); } } class TestOfPageScraping extends UnitTestCase { function &parse($response) { $builder = &new SimplePageBuilder(); return $builder->parse($response); } function testEmptyPage() { $page = &new SimplePage(new MockSimpleHttpResponse($this)); $this->assertIdentical($page->getAbsoluteUrls(), array()); $this->assertIdentical($page->getRelativeUrls(), array()); $this->assertIdentical($page->getTitle(), false); } function testUninterestingPage() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getContent', '

Stuff

'); $page = &$this->parse($response); $this->assertIdentical($page->getAbsoluteUrls(), array()); $this->assertIdentical($page->getRelativeUrls(), array()); } function testLinksPage() { $raw = ''; $raw .= '
There'; $raw .= 'That page'; $raw .= ''; $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getContent', $raw); $response->setReturnValue('getUrl', new SimpleUrl('http://www.here.com/a/index.html')); $page = &$this->parse($response); $this->assertIdentical( $page->getAbsoluteUrls(), array('http://there.com/that.html')); $this->assertIdentical( $page->getRelativeUrls(), array('there.html')); $this->assertIdentical( $page->getUrlsByLabel('There'), array(new SimpleUrl('http://www.here.com/a/there.html'))); $this->assertEqual( $page->getUrlById('0'), new SimpleUrl('http://there.com/that.html')); } function testTitle() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getContent', 'Me'); $page = &$this->parse($response); $this->assertEqual($page->getTitle(), 'Me'); } function testNastyTitle() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue( 'getContent', ' <b>Me&Me '); $page = &$this->parse($response); $this->assertEqual($page->getTitle(), "Me&Me"); } function testCompleteForm() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getContent', '
' . '' . '
'); $page = &$this->parse($response); $this->assertEqual($page->getField('here'), "Hello"); } function testUnclosedForm() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getContent', '
' . '' . ''); $page = &$this->parse($response); $this->assertEqual($page->getField('here'), "Hello"); } function testEmptyFrameset() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue( 'getContent', ''); $page = &$this->parse($response); $this->assertTrue($page->hasFrames()); $this->assertIdentical($page->getFrameset(), array()); } function testSingleFrame() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue( 'getContent', ''); $response->setReturnValue('getUrl', new SimpleUrl('http://host/')); $page = &$this->parse($response); $this->assertTrue($page->hasFrames()); $this->assertIdentical( $page->getFrameset(), array(1 => new SimpleUrl('http://host/a.html'))); } function testSingleFrameInNestedFrameset() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getContent', '' . '' . ''); $response->setReturnValue('getUrl', new SimpleUrl('http://host/')); $page = &$this->parse($response); $this->assertTrue($page->hasFrames()); $this->assertIdentical( $page->getFrameset(), array(1 => new SimpleUrl('http://host/a.html'))); } function testFrameWithNoSource() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue( 'getContent', ''); $page = &$this->parse($response); $this->assertTrue($page->hasFrames()); $this->assertIdentical($page->getFrameset(), array()); } function testFramesCollectedWithNestedFramesetTags() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getContent', '' . '' . '' . '' . ''); $response->setReturnValue('getUrl', new SimpleUrl('http://host/')); $page = &$this->parse($response); $this->assertTrue($page->hasFrames()); $this->assertIdentical($page->getFrameset(), array( 1 => new SimpleUrl('http://host/a.html'), 2 => new SimpleUrl('http://host/b.html'), 3 => new SimpleUrl('http://host/c.html'))); } function testNamedFrames() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getContent', '' . '' . '' . '' . '' . ''); $response->setReturnValue('getUrl', new SimpleUrl('http://host/')); $page = &$this->parse($response); $this->assertTrue($page->hasFrames()); $this->assertIdentical($page->getFrameset(), array( 1 => new SimpleUrl('http://host/a.html'), '_one' => new SimpleUrl('http://host/b.html'), 3 => new SimpleUrl('http://host/c.html'), '_two' => new SimpleUrl('http://host/d.html'))); } function testFindFormByLabel() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue( 'getContent', '
'); $page = &$this->parse($response); $this->assertNull($page->getFormBySubmitLabel('submit')); $this->assertIsA($page->getFormBySubmitName('submit'), 'SimpleForm'); $this->assertIsA($page->getFormBySubmitLabel('Submit'), 'SimpleForm'); } function testConfirmSubmitAttributesAreCaseInsensitive() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue( 'getContent', '
'); $page = &$this->parse($response); $this->assertIsA($page->getFormBySubmitName('submit'), 'SimpleForm'); $this->assertIsA($page->getFormBySubmitLabel('Submit'), 'SimpleForm'); } function testFindFormByImage() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getContent', '
' . '' . '
'); $page = &$this->parse($response); $this->assertIsA($page->getFormByImageLabel('Label'), 'SimpleForm'); $this->assertIsA($page->getFormByImageName('me'), 'SimpleForm'); $this->assertIsA($page->getFormByImageId(100), 'SimpleForm'); } function testFindFormByButtonTag() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getContent', '
' . '' . '
'); $page = &$this->parse($response); $this->assertNull($page->getFormBySubmitLabel('b')); $this->assertNull($page->getFormBySubmitLabel('B')); $this->assertIsA($page->getFormBySubmitName('b'), 'SimpleForm'); $this->assertIsA($page->getFormBySubmitLabel('BBB'), 'SimpleForm'); } function testFindFormById() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue( 'getContent', '
'); $page = &$this->parse($response); $this->assertNull($page->getFormById(54)); $this->assertIsA($page->getFormById(55), 'SimpleForm'); } function testReadingTextField() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getContent', '
' . '' . '' . '
'); $page = &$this->parse($response); $this->assertNull($page->getField('missing')); $this->assertIdentical($page->getField('a'), ''); $this->assertIdentical($page->getField('b'), 'bbb'); } function testReadingTextFieldIsCaseInsensitive() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getContent', '
' . '' . '' . '
'); $page = &$this->parse($response); $this->assertNull($page->getField('missing')); $this->assertIdentical($page->getField('a'), ''); $this->assertIdentical($page->getField('b'), 'bbb'); } function testSettingTextField() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getContent', '
' . '' . '' . '' . '
'); $page = &$this->parse($response); $this->assertTrue($page->setField('a', 'aaa')); $this->assertEqual($page->getField('a'), 'aaa'); $this->assertTrue($page->setFieldById(3, 'bbb')); $this->assertEqual($page->getFieldById(3), 'bbb'); $this->assertFalse($page->setField('z', 'zzz')); $this->assertNull($page->getField('z')); } function testReadingTextArea() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getContent', '
' . '' . '' . '
'); $page = &$this->parse($response); $this->assertEqual($page->getField('a'), 'aaa'); } function testSettingTextArea() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getContent', '
' . '' . '' . '
'); $page = &$this->parse($response); $this->assertTrue($page->setField('a', 'AAA')); $this->assertEqual($page->getField('a'), 'AAA'); } function testSettingSelectionField() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getContent', '
' . '' . '' . '
'); $page = &$this->parse($response); $this->assertEqual($page->getField('a'), 'bbb'); $this->assertFalse($page->setField('a', 'ccc')); $this->assertTrue($page->setField('a', 'aaa')); $this->assertEqual($page->getField('a'), 'aaa'); } } ?>pgfouine-1.2/tests/simpletest/test/remote_test.php0000644000175000017500000000112510334504436021142 0ustar acmeacmeaddTestCase(new RemoteTestCase( $base_url . 'test/visual_test.php?xml=yes', $base_url . 'test/visual_test.php?xml=yes&dry=yes')); if (SimpleReporter::inCli()) { exit ($test->run(new XmlReporter()) ? 0 : 1); } $test->run(new HtmlReporter()); ?>pgfouine-1.2/tests/simpletest/test/frames_test.php0000644000175000017500000005656610334504436021147 0ustar acmeacmesetReturnValue('getTitle', 'This page'); $frameset = &new SimpleFrameset($page); $this->assertEqual($frameset->getTitle(), 'This page'); } function TestHeadersReadFromFramesetByDefault() { $page = &new MockSimplePage($this); $page->setReturnValue('getHeaders', 'Header: content'); $page->setReturnValue('getMimeType', 'text/xml'); $page->setReturnValue('getResponseCode', 401); $page->setReturnValue('getTransportError', 'Could not parse headers'); $page->setReturnValue('getAuthentication', 'Basic'); $page->setReturnValue('getRealm', 'Safe place'); $frameset = &new SimpleFrameset($page); $this->assertIdentical($frameset->getHeaders(), 'Header: content'); $this->assertIdentical($frameset->getMimeType(), 'text/xml'); $this->assertIdentical($frameset->getResponseCode(), 401); $this->assertIdentical($frameset->getTransportError(), 'Could not parse headers'); $this->assertIdentical($frameset->getAuthentication(), 'Basic'); $this->assertIdentical($frameset->getRealm(), 'Safe place'); } function testEmptyFramesetHasNoContent() { $page = &new MockSimplePage($this); $page->setReturnValue('getRaw', 'This content'); $frameset = &new SimpleFrameset($page); $this->assertEqual($frameset->getRaw(), ''); } function testRawContentIsFromOnlyFrame() { $page = &new MockSimplePage($this); $page->expectNever('getRaw'); $frame = &new MockSimplePage($this); $frame->setReturnValue('getRaw', 'Stuff'); $frameset = &new SimpleFrameset($page); $frameset->addFrame($frame); $this->assertEqual($frameset->getRaw(), 'Stuff'); } function testRawContentIsFromAllFrames() { $page = &new MockSimplePage($this); $page->expectNever('getRaw'); $frame1 = &new MockSimplePage($this); $frame1->setReturnValue('getRaw', 'Stuff1'); $frame2 = &new MockSimplePage($this); $frame2->setReturnValue('getRaw', 'Stuff2'); $frameset = &new SimpleFrameset($page); $frameset->addFrame($frame1); $frameset->addFrame($frame2); $this->assertEqual($frameset->getRaw(), 'Stuff1Stuff2'); } function testTextContentIsFromOnlyFrame() { $page = &new MockSimplePage($this); $page->expectNever('getText'); $frame = &new MockSimplePage($this); $frame->setReturnValue('getText', 'Stuff'); $frameset = &new SimpleFrameset($page); $frameset->addFrame($frame); $this->assertEqual($frameset->getText(), 'Stuff'); } function testTextContentIsFromAllFrames() { $page = &new MockSimplePage($this); $page->expectNever('getText'); $frame1 = &new MockSimplePage($this); $frame1->setReturnValue('getText', 'Stuff1'); $frame2 = &new MockSimplePage($this); $frame2->setReturnValue('getText', 'Stuff2'); $frameset = &new SimpleFrameset($page); $frameset->addFrame($frame1); $frameset->addFrame($frame2); $this->assertEqual($frameset->getText(), 'Stuff1 Stuff2'); } function testFieldIsFirstInFramelist() { $frame1 = &new MockSimplePage($this); $frame1->setReturnValue('getField', null); $frame1->expectOnce('getField', array('a')); $frame2 = &new MockSimplePage($this); $frame2->setReturnValue('getField', 'A'); $frame2->expectOnce('getField', array('a')); $frame3 = &new MockSimplePage($this); $frame3->expectNever('getField'); $page = &new MockSimplePage($this); $frameset = &new SimpleFrameset($page); $frameset->addFrame($frame1); $frameset->addFrame($frame2); $frameset->addFrame($frame3); $this->assertIdentical($frameset->getField('a'), 'A'); $frame1->tally(); $frame2->tally(); } function testFrameReplacementByIndex() { $page = &new MockSimplePage($this); $page->expectNever('getRaw'); $frame1 = &new MockSimplePage($this); $frame1->setReturnValue('getRaw', 'Stuff1'); $frame2 = &new MockSimplePage($this); $frame2->setReturnValue('getRaw', 'Stuff2'); $frameset = &new SimpleFrameset($page); $frameset->addFrame($frame1); $frameset->setFrame(array(1), $frame2); $this->assertEqual($frameset->getRaw(), 'Stuff2'); } function testFrameReplacementByName() { $page = &new MockSimplePage($this); $page->expectNever('getRaw'); $frame1 = &new MockSimplePage($this); $frame1->setReturnValue('getRaw', 'Stuff1'); $frame2 = &new MockSimplePage($this); $frame2->setReturnValue('getRaw', 'Stuff2'); $frameset = &new SimpleFrameset($page); $frameset->addFrame($frame1, 'a'); $frameset->setFrame(array('a'), $frame2); $this->assertEqual($frameset->getRaw(), 'Stuff2'); } } class TestOfFrameNavigation extends UnitTestCase { function testStartsWithoutFrameFocus() { $page = &new MockSimplePage($this); $frameset = &new SimpleFrameset($page); $frameset->addFrame($frame); $this->assertFalse($frameset->getFrameFocus()); } function testCanFocusOnSingleFrame() { $page = &new MockSimplePage($this); $page->expectNever('getRaw'); $frame = &new MockSimplePage($this); $frame->setReturnValue('getFrameFocus', array()); $frame->setReturnValue('getRaw', 'Stuff'); $frameset = &new SimpleFrameset($page); $frameset->addFrame($frame); $this->assertFalse($frameset->setFrameFocusByIndex(0)); $this->assertTrue($frameset->setFrameFocusByIndex(1)); $this->assertEqual($frameset->getRaw(), 'Stuff'); $this->assertFalse($frameset->setFrameFocusByIndex(2)); $this->assertIdentical($frameset->getFrameFocus(), array(1)); } function testContentComesFromFrameInFocus() { $page = &new MockSimplePage($this); $frame1 = &new MockSimplePage($this); $frame1->setReturnValue('getRaw', 'Stuff1'); $frame1->setReturnValue('getFrameFocus', array()); $frame2 = &new MockSimplePage($this); $frame2->setReturnValue('getRaw', 'Stuff2'); $frame2->setReturnValue('getFrameFocus', array()); $frameset = &new SimpleFrameset($page); $frameset->addFrame($frame1); $frameset->addFrame($frame2); $this->assertTrue($frameset->setFrameFocusByIndex(1)); $this->assertEqual($frameset->getFrameFocus(), array(1)); $this->assertEqual($frameset->getRaw(), 'Stuff1'); $this->assertTrue($frameset->setFrameFocusByIndex(2)); $this->assertEqual($frameset->getFrameFocus(), array(2)); $this->assertEqual($frameset->getRaw(), 'Stuff2'); $this->assertFalse($frameset->setFrameFocusByIndex(3)); $this->assertEqual($frameset->getFrameFocus(), array(2)); $frameset->clearFrameFocus(); $this->assertEqual($frameset->getRaw(), 'Stuff1Stuff2'); } function testCanFocusByName() { $page = &new MockSimplePage($this); $frame1 = &new MockSimplePage($this); $frame1->setReturnValue('getRaw', 'Stuff1'); $frame1->setReturnValue('getFrameFocus', array()); $frame2 = &new MockSimplePage($this); $frame2->setReturnValue('getRaw', 'Stuff2'); $frame2->setReturnValue('getFrameFocus', array()); $frameset = &new SimpleFrameset($page); $frameset->addFrame($frame1, 'A'); $frameset->addFrame($frame2, 'B'); $this->assertTrue($frameset->setFrameFocus('A')); $this->assertEqual($frameset->getFrameFocus(), array('A')); $this->assertEqual($frameset->getRaw(), 'Stuff1'); $this->assertTrue($frameset->setFrameFocusByIndex(2)); $this->assertEqual($frameset->getFrameFocus(), array('B')); $this->assertEqual($frameset->getRaw(), 'Stuff2'); $this->assertFalse($frameset->setFrameFocus('z')); $frameset->clearFrameFocus(); $this->assertEqual($frameset->getRaw(), 'Stuff1Stuff2'); } } class TestOfFramesetPageInterface extends UnitTestCase { var $_page_interface; var $_frameset_interface; function TestOfFramesetPageInterface() { $this->UnitTestCase(); $this->_page_interface = $this->_getPageMethods(); $this->_frameset_interface = $this->_getFramesetMethods(); } function assertListInAnyOrder($list, $expected) { sort($list); sort($expected); $this->assertEqual($list, $expected); } function _getPageMethods() { $methods = array(); foreach (get_class_methods('SimplePage') as $method) { if (strtolower($method) == strtolower('SimplePage')) { continue; } if (strtolower($method) == strtolower('getFrameset')) { continue; } if (strncmp($method, '_', 1) == 0) { continue; } if (strncmp($method, 'accept', 6) == 0) { continue; } $methods[] = $method; } return $methods; } function _getFramesetMethods() { $methods = array(); foreach (get_class_methods('SimpleFrameset') as $method) { if (strtolower($method) == strtolower('SimpleFrameset')) { continue; } if (strncmp($method, '_', 1) == 0) { continue; } if (strncmp($method, 'add', 3) == 0) { continue; } $methods[] = $method; } return $methods; } function testFramsetHasPageInterface() { $difference = array(); foreach ($this->_page_interface as $method) { if (! in_array($method, $this->_frameset_interface)) { $this->fail("No [$method] in Frameset class"); return; } } $this->pass('Frameset covers Page interface'); } function testHeadersReadFromFrameIfInFocus() { $frame = &new MockSimplePage($this); $frame->setReturnValue('getUrl', new SimpleUrl('http://localhost/stuff')); $frame->setReturnValue('getRequest', 'POST stuff'); $frame->setReturnValue('getMethod', 'POST'); $frame->setReturnValue('getRequestData', array('a' => 'A')); $frame->setReturnValue('getHeaders', 'Header: content'); $frame->setReturnValue('getMimeType', 'text/xml'); $frame->setReturnValue('getResponseCode', 401); $frame->setReturnValue('getTransportError', 'Could not parse headers'); $frame->setReturnValue('getAuthentication', 'Basic'); $frame->setReturnValue('getRealm', 'Safe place'); $frameset = &new SimpleFrameset(new MockSimplePage($this)); $frameset->addFrame($frame); $frameset->setFrameFocusByIndex(1); $url = new SimpleUrl('http://localhost/stuff'); $url->setTarget(1); $this->assertIdentical($frameset->getUrl(), $url); $this->assertIdentical($frameset->getRequest(), 'POST stuff'); $this->assertIdentical($frameset->getMethod(), 'POST'); $this->assertIdentical($frameset->getRequestData(), array('a' => 'A')); $this->assertIdentical($frameset->getHeaders(), 'Header: content'); $this->assertIdentical($frameset->getMimeType(), 'text/xml'); $this->assertIdentical($frameset->getResponseCode(), 401); $this->assertIdentical($frameset->getTransportError(), 'Could not parse headers'); $this->assertIdentical($frameset->getAuthentication(), 'Basic'); $this->assertIdentical($frameset->getRealm(), 'Safe place'); } function testAbsoluteUrlsComeFromBothFrames() { $page = &new MockSimplePage($this); $page->expectNever('getAbsoluteUrls'); $frame1 = &new MockSimplePage($this); $frame1->setReturnValue( 'getAbsoluteUrls', array('http://www.lastcraft.com/', 'http://myserver/')); $frame2 = &new MockSimplePage($this); $frame2->setReturnValue( 'getAbsoluteUrls', array('http://www.lastcraft.com/', 'http://test/')); $frameset = &new SimpleFrameset($page); $frameset->addFrame($frame1); $frameset->addFrame($frame2); $this->assertListInAnyOrder( $frameset->getAbsoluteUrls(), array('http://www.lastcraft.com/', 'http://myserver/', 'http://test/')); } function testRelativeUrlsComeFromBothFrames() { $frame1 = &new MockSimplePage($this); $frame1->setReturnValue( 'getRelativeUrls', array('/', '.', '/test/', 'goodbye.php')); $frame2 = &new MockSimplePage($this); $frame2->setReturnValue( 'getRelativeUrls', array('/', '..', '/test/', 'hello.php')); $page = &new MockSimplePage($this); $page->expectNever('getRelativeUrls'); $frameset = &new SimpleFrameset($page); $frameset->addFrame($frame1); $frameset->addFrame($frame2); $this->assertListInAnyOrder( $frameset->getRelativeUrls(), array('/', '.', '/test/', 'goodbye.php', '..', 'hello.php')); } function testLabelledUrlsComeFromBothFrames() { $frame1 = &new MockSimplePage($this); $frame1->setReturnValue( 'getUrlsByLabel', array(new SimpleUrl('goodbye.php')), array('a')); $frame2 = &new MockSimplePage($this); $frame2->setReturnValue( 'getUrlsByLabel', array(new SimpleUrl('hello.php')), array('a')); $frameset = &new SimpleFrameset(new MockSimplePage($this)); $frameset->addFrame($frame1); $frameset->addFrame($frame2, 'Two'); $expected1 = new SimpleUrl('goodbye.php'); $expected1->setTarget(1); $expected2 = new SimpleUrl('hello.php'); $expected2->setTarget('Two'); $this->assertEqual( $frameset->getUrlsByLabel('a'), array($expected1, $expected2)); } function testUrlByIdComesFromFirstFrameToRespond() { $frame1 = &new MockSimplePage($this); $frame1->setReturnValue('getUrlById', new SimpleUrl('four.php'), array(4)); $frame1->setReturnValue('getUrlById', false, array(5)); $frame2 = &new MockSimplePage($this); $frame2->setReturnValue('getUrlById', false, array(4)); $frame2->setReturnValue('getUrlById', new SimpleUrl('five.php'), array(5)); $frameset = &new SimpleFrameset(new MockSimplePage($this)); $frameset->addFrame($frame1); $frameset->addFrame($frame2); $four = new SimpleUrl('four.php'); $four->setTarget(1); $this->assertEqual($frameset->getUrlById(4), $four); $five = new SimpleUrl('five.php'); $five->setTarget(2); $this->assertEqual($frameset->getUrlById(5), $five); } function testReadUrlsFromFrameInFocus() { $frame1 = &new MockSimplePage($this); $frame1->setReturnValue('getAbsoluteUrls', array('a')); $frame1->setReturnValue('getRelativeUrls', array('r')); $frame1->setReturnValue('getUrlsByLabel', array(new SimpleUrl('l'))); $frame1->setReturnValue('getUrlById', new SimpleUrl('i')); $frame2 = &new MockSimplePage($this); $frame2->expectNever('getAbsoluteUrls'); $frame2->expectNever('getRelativeUrls'); $frame2->expectNever('getUrlsByLabel'); $frame2->expectNever('getUrlById'); $frameset = &new SimpleFrameset(new MockSimplePage($this)); $frameset->addFrame($frame1, 'A'); $frameset->addFrame($frame2, 'B'); $frameset->setFrameFocus('A'); $this->assertIdentical($frameset->getAbsoluteUrls(), array('a')); $this->assertIdentical($frameset->getRelativeUrls(), array('r')); $expected = new SimpleUrl('l'); $expected->setTarget('A'); $this->assertIdentical($frameset->getUrlsByLabel('label'), array($expected)); $expected = new SimpleUrl('i'); $expected->setTarget('A'); $this->assertIdentical($frameset->getUrlById(99), $expected); } function testReadFrameTaggedUrlsFromFrameInFocus() { $frame = &new MockSimplePage($this); $by_label = new SimpleUrl('l'); $by_label->setTarget('L'); $frame->setReturnValue('getUrlsByLabel', array($by_label)); $by_id = new SimpleUrl('i'); $by_id->setTarget('I'); $frame->setReturnValue('getUrlById', $by_id); $frameset = &new SimpleFrameset(new MockSimplePage($this)); $frameset->addFrame($frame, 'A'); $frameset->setFrameFocus('A'); $this->assertIdentical($frameset->getUrlsByLabel('label'), array($by_label)); $this->assertIdentical($frameset->getUrlById(99), $by_id); } function testFindingFormsByAllFinders() { $finders = array( 'getFormBySubmitLabel', 'getFormBySubmitName', 'getFormBySubmitId', 'getFormByImageLabel', 'getFormByImageName', 'getFormByImageId', 'getFormById'); $forms = array(); $frame = &new MockSimplePage($this); for ($i = 0; $i < count($finders); $i++) { $forms[$i] = &new MockSimpleForm($this); $frame->setReturnReference($finders[$i], $forms[$i], array('a')); } $frameset = &new SimpleFrameset(new MockSimplePage($this)); $frameset->addFrame(new MockSimplePage($this), 'A'); $frameset->addFrame($frame, 'B'); for ($i = 0; $i < count($finders); $i++) { $method = $finders[$i]; $this->assertReference($frameset->$method('a'), $forms[$i]); } $frameset->setFrameFocus('A'); for ($i = 0; $i < count($finders); $i++) { $method = $finders[$i]; $this->assertNull($frameset->$method('a')); } $frameset->setFrameFocus('B'); for ($i = 0; $i < count($finders); $i++) { $method = $finders[$i]; $this->assertReference($frameset->$method('a'), $forms[$i]); } } function testSettingAllFrameFieldsWhenNoFrameFocus() { $frame1 = &new MockSimplePage($this); $frame1->expectOnce('setField', array('a', 'A')); $frame1->expectOnce('setFieldById', array(22, 'A')); $frame2 = &new MockSimplePage($this); $frame2->expectOnce('setField', array('a', 'A')); $frame2->expectOnce('setFieldById', array(22, 'A')); $frameset = &new SimpleFrameset(new MockSimplePage($this)); $frameset->addFrame($frame1, 'A'); $frameset->addFrame($frame2, 'B'); $frameset->setField('a', 'A'); $frameset->setFieldById(22, 'A'); $frame1->tally(); $frame2->tally(); } function testOnlySettingFieldFromFocusedFrame() { $frame1 = &new MockSimplePage($this); $frame1->expectOnce('setField', array('a', 'A')); $frame1->expectOnce('setFieldById', array(22, 'A')); $frame2 = &new MockSimplePage($this); $frame2->expectNever('setField'); $frame2->expectNever('setFieldById'); $frameset = &new SimpleFrameset(new MockSimplePage($this)); $frameset->addFrame($frame1, 'A'); $frameset->addFrame($frame2, 'B'); $frameset->setFrameFocus('A'); $frameset->setField('a', 'A'); $frameset->setFieldById(22, 'A'); $frame1->tally(); } function testOnlyGettingFieldFromFocusedFrame() { $frame1 = &new MockSimplePage($this); $frame1->setReturnValue('getField', 'f', array('a')); $frame1->setReturnValue('getFieldById', 'i', array(7)); $frame2 = &new MockSimplePage($this); $frame2->expectNever('getField'); $frame2->expectNever('getFieldById'); $frameset = &new SimpleFrameset(new MockSimplePage($this)); $frameset->addFrame($frame1, 'A'); $frameset->addFrame($frame2, 'B'); $frameset->setFrameFocus('A'); $this->assertIdentical($frameset->getField('a'), 'f'); $this->assertIdentical($frameset->getFieldById(7), 'i'); } } ?>pgfouine-1.2/tests/simpletest/test/errors_test.php0000644000175000017500000001053310334504436021166 0ustar acmeacmeclear(); } function tearDown() { $queue = &SimpleErrorQueue::instance(); $queue->clear(); } function testSingleton() { $this->assertReference( SimpleErrorQueue::instance(), SimpleErrorQueue::instance()); $this->assertIsA(SimpleErrorQueue::instance(), 'SimpleErrorQueue'); } function testEmpty() { $queue = &SimpleErrorQueue::instance(); $this->assertTrue($queue->isEmpty()); $this->assertFalse($queue->extract()); } function testOrder() { $queue = &SimpleErrorQueue::instance(); $queue->add(1024, 'Ouch', 'here.php', 100, array()); $this->assertFalse($queue->isEmpty()); $queue->add(512, 'Yuk', 'there.php', 101, array()); $this->assertEqual( $queue->extract(), array(1024, 'Ouch', 'here.php', 100, array())); $this->assertEqual( $queue->extract(), array(512, 'Yuk', 'there.php', 101, array())); $this->assertFalse($queue->extract()); } } class TestOfErrorTrap extends UnitTestCase { var $_old; function setUp() { $this->_old = error_reporting(E_ALL); set_error_handler('simpleTestErrorHandler'); } function tearDown() { restore_error_handler(); error_reporting($this->_old); } function testTrappedErrorPlacedInQueue() { $queue = &SimpleErrorQueue::instance(); $this->assertFalse($queue->extract()); trigger_error('Ouch!'); list($severity, $message, $file, $line, $globals) = $queue->extract(); $this->assertEqual($message, 'Ouch!'); $this->assertEqual($file, __FILE__); $this->assertFalse($queue->extract()); } } class TestOfErrors extends UnitTestCase { var $_old; function setUp() { $this->_old = error_reporting(E_ALL); } function tearDown() { error_reporting($this->_old); } function testDefaultWhenAllReported() { error_reporting(E_ALL); trigger_error('Ouch!'); $this->assertError('Ouch!'); } function testNoticeWhenReported() { error_reporting(E_ALL); trigger_error('Ouch!', E_USER_NOTICE); $this->assertError('Ouch!'); } function testWarningWhenReported() { error_reporting(E_ALL); trigger_error('Ouch!', E_USER_WARNING); $this->assertError('Ouch!'); } function testErrorWhenReported() { error_reporting(E_ALL); trigger_error('Ouch!', E_USER_ERROR); $this->assertError('Ouch!'); } function testNoNoticeWhenNotReported() { error_reporting(0); trigger_error('Ouch!', E_USER_NOTICE); $this->assertNoErrors(); } function testNoWarningWhenNotReported() { error_reporting(0); trigger_error('Ouch!', E_USER_WARNING); $this->assertNoErrors(); } function testNoErrorWhenNotReported() { error_reporting(0); trigger_error('Ouch!', E_USER_ERROR); $this->assertNoErrors(); } function testNoticeSuppressedWhenReported() { error_reporting(E_ALL); @trigger_error('Ouch!', E_USER_NOTICE); $this->assertNoErrors(); } function testWarningSuppressedWhenReported() { error_reporting(E_ALL); @trigger_error('Ouch!', E_USER_WARNING); $this->assertNoErrors(); } function testErrorSuppressedWhenReported() { error_reporting(E_ALL); @trigger_error('Ouch!', E_USER_ERROR); $this->assertNoErrors(); } } ?>pgfouine-1.2/tests/simpletest/test/encoding_test.php0000644000175000017500000001325010334504436021437 0ustar acmeacmeassertIdentical($encoding->getValue('a'), false); $this->assertIdentical($encoding->getKeys(), array()); $this->assertIdentical($encoding->asString(), ''); } function testPrefilled() { $encoding = &new SimpleFormEncoding(array('a' => 'aaa')); $this->assertIdentical($encoding->getValue('a'), 'aaa'); $this->assertIdentical($encoding->getKeys(), array('a')); $this->assertIdentical($encoding->asString(), 'a=aaa'); } function testPrefilledWithObject() { $encoding = &new SimpleFormEncoding(new SimpleFormEncoding(array('a' => 'aaa'))); $this->assertIdentical($encoding->getValue('a'), 'aaa'); $this->assertIdentical($encoding->getKeys(), array('a')); $this->assertIdentical($encoding->asString(), 'a=aaa'); } function testMultiplePrefilled() { $encoding = &new SimpleFormEncoding(array('a' => array('a1', 'a2'))); $this->assertIdentical($encoding->getValue('a'), array('a1', 'a2')); $this->assertIdentical($encoding->asString(), 'a=a1&a=a2'); } function testSingleParameter() { $encoding = &new SimpleFormEncoding(); $encoding->add('a', 'Hello'); $this->assertEqual($encoding->getValue('a'), 'Hello'); $this->assertIdentical($encoding->asString(), 'a=Hello'); } function testFalseParameter() { $encoding = &new SimpleFormEncoding(); $encoding->add('a', false); $this->assertEqual($encoding->getValue('a'), false); $this->assertIdentical($encoding->asString(), ''); } function testUrlEncoding() { $encoding = &new SimpleFormEncoding(); $encoding->add('a', 'Hello there!'); $this->assertIdentical($encoding->asString(), 'a=Hello+there%21'); } function testMultipleParameter() { $encoding = &new SimpleFormEncoding(); $encoding->add('a', 'Hello'); $encoding->add('b', 'Goodbye'); $this->assertIdentical($encoding->asString(), 'a=Hello&b=Goodbye'); } function testEmptyParameters() { $encoding = &new SimpleFormEncoding(); $encoding->add('a', ''); $encoding->add('b', ''); $this->assertIdentical($encoding->asString(), 'a=&b='); } function testRepeatedParameter() { $encoding = &new SimpleFormEncoding(); $encoding->add('a', 'Hello'); $encoding->add('a', 'Goodbye'); $this->assertIdentical($encoding->getValue('a'), array('Hello', 'Goodbye')); $this->assertIdentical($encoding->asString(), 'a=Hello&a=Goodbye'); } function testDefaultCoordinatesAreUnset() { $encoding = &new SimpleFormEncoding(); $this->assertIdentical($encoding->getX(), false); $this->assertIdentical($encoding->getY(), false); } function testSettingCoordinates() { $encoding = &new SimpleFormEncoding(); $encoding->setCoordinates('32', '45'); $this->assertIdentical($encoding->getX(), 32); $this->assertIdentical($encoding->getY(), 45); $this->assertIdentical($encoding->asString(), '?32,45'); } function testClearingCordinates() { $encoding = &new SimpleFormEncoding(); $encoding->setCoordinates('32', '45'); $encoding->setCoordinates(); $this->assertIdentical($encoding->getX(), false); $this->assertIdentical($encoding->getY(), false); } function testAddingLists() { $encoding = &new SimpleFormEncoding(); $encoding->add('a', array('Hello', 'Goodbye')); $this->assertIdentical($encoding->getValue('a'), array('Hello', 'Goodbye')); $this->assertIdentical($encoding->asString(), 'a=Hello&a=Goodbye'); } function testMergeInHash() { $encoding = &new SimpleFormEncoding(array('a' => 'A1', 'b' => 'B')); $encoding->merge(array('a' => 'A2')); $this->assertIdentical($encoding->getValue('a'), array('A1', 'A2')); $this->assertIdentical($encoding->getValue('b'), 'B'); } function testMergeInObject() { $encoding = &new SimpleFormEncoding(array('a' => 'A1', 'b' => 'B')); $encoding->merge(new SimpleFormEncoding(array('a' => 'A2'))); $this->assertIdentical($encoding->getValue('a'), array('A1', 'A2')); $this->assertIdentical($encoding->getValue('b'), 'B'); } function testMergeInObjectWithCordinates() { $incoming = new SimpleFormEncoding(array('a' => 'A2')); $incoming->setCoordinates(25, 24); $encoding = &new SimpleFormEncoding(array('a' => 'A1')); $encoding->setCoordinates(1, 2); $encoding->merge($incoming); $this->assertIdentical($encoding->getValue('a'), array('A1', 'A2')); $this->assertIdentical($encoding->getX(), 25); $this->assertIdentical($encoding->getY(), 24); $this->assertIdentical($encoding->asString(), 'a=A1&a=A2?25,24'); } } ?>pgfouine-1.2/tests/simpletest/test/test_with_parse_error.php0000644000175000017500000000025310334504436023226 0ustar acmeacmepgfouine-1.2/tests/simpletest/test/dumper_test.php0000644000175000017500000000650510334504436021152 0ustar acmeacmeassertEqual( $dumper->clipString("Hello", 6), "Hello", "Hello, 6->%s"); $this->assertEqual( $dumper->clipString("Hello", 5), "Hello", "Hello, 5->%s"); $this->assertEqual( $dumper->clipString("Hello world", 3), "Hel...", "Hello world, 3->%s"); $this->assertEqual( $dumper->clipString("Hello world", 6, 3), "Hello ...", "Hello world, 6, 3->%s"); $this->assertEqual( $dumper->clipString("Hello world", 3, 6), "...o w...", "Hello world, 3, 6->%s"); $this->assertEqual( $dumper->clipString("Hello world", 4, 11), "...orld", "Hello world, 4, 11->%s"); $this->assertEqual( $dumper->clipString("Hello world", 4, 12), "...orld", "Hello world, 4, 12->%s"); } function testDescribeNull() { $dumper = new SimpleDumper(); $this->assertWantedPattern('/null/i', $dumper->describeValue(null)); } function testDescribeBoolean() { $dumper = new SimpleDumper(); $this->assertWantedPattern('/boolean/i', $dumper->describeValue(true)); $this->assertWantedPattern('/true/i', $dumper->describeValue(true)); $this->assertWantedPattern('/false/i', $dumper->describeValue(false)); } function testDescribeString() { $dumper = new SimpleDumper(); $this->assertWantedPattern('/string/i', $dumper->describeValue('Hello')); $this->assertWantedPattern('/Hello/', $dumper->describeValue('Hello')); } function testDescribeInteger() { $dumper = new SimpleDumper(); $this->assertWantedPattern('/integer/i', $dumper->describeValue(35)); $this->assertWantedPattern('/35/', $dumper->describeValue(35)); } function testDescribeFloat() { $dumper = new SimpleDumper(); $this->assertWantedPattern('/float/i', $dumper->describeValue(0.99)); $this->assertWantedPattern('/0\.99/', $dumper->describeValue(0.99)); } function testDescribeArray() { $dumper = new SimpleDumper(); $this->assertWantedPattern('/array/i', $dumper->describeValue(array(1, 4))); $this->assertWantedPattern('/2/i', $dumper->describeValue(array(1, 4))); } function testDescribeObject() { $dumper = new SimpleDumper(); $this->assertWantedPattern( '/object/i', $dumper->describeValue(new DumperDummy())); $this->assertWantedPattern( '/DumperDummy/i', $dumper->describeValue(new DumperDummy())); } } ?>pgfouine-1.2/tests/simpletest/test/authentication_test.php0000644000175000017500000001363610334504436022700 0ustar acmeacmeassertTrue($realm->isWithin( new SimpleUrl('http://www.here.com/path/hello.html'))); } function testInsideWithLongerUrl() { $realm = &new SimpleRealm( 'Basic', new SimpleUrl('http://www.here.com/path/')); $this->assertTrue($realm->isWithin( new SimpleUrl('http://www.here.com/path/hello.html'))); } function testBelowRootIsOutside() { $realm = &new SimpleRealm( 'Basic', new SimpleUrl('http://www.here.com/path/')); $this->assertTrue($realm->isWithin( new SimpleUrl('http://www.here.com/path/more/hello.html'))); } function testOldNetscapeDefinitionIsOutside() { $realm = &new SimpleRealm( 'Basic', new SimpleUrl('http://www.here.com/path/')); $this->assertFalse($realm->isWithin( new SimpleUrl('http://www.here.com/pathmore/hello.html'))); } function testDifferentPageNameStillInside() { $realm = &new SimpleRealm( 'Basic', new SimpleUrl('http://www.here.com/path/hello.html')); $this->assertTrue($realm->isWithin( new SimpleUrl('http://www.here.com/path/goodbye.html'))); } function testNewUrlInSameDirectoryDoesNotChangeRealm() { $realm = &new SimpleRealm( 'Basic', new SimpleUrl('http://www.here.com/path/hello.html')); $realm->stretch(new SimpleUrl('http://www.here.com/path/goodbye.html')); $this->assertTrue($realm->isWithin( new SimpleUrl('http://www.here.com/path/index.html'))); $this->assertFalse($realm->isWithin( new SimpleUrl('http://www.here.com/index.html'))); } function testNewUrlMakesRealmTheCommonPath() { $realm = &new SimpleRealm( 'Basic', new SimpleUrl('http://www.here.com/path/here/hello.html')); $realm->stretch(new SimpleUrl('http://www.here.com/path/there/goodbye.html')); $this->assertTrue($realm->isWithin( new SimpleUrl('http://www.here.com/path/here/index.html'))); $this->assertTrue($realm->isWithin( new SimpleUrl('http://www.here.com/path/there/index.html'))); $this->assertTrue($realm->isWithin( new SimpleUrl('http://www.here.com/path/index.html'))); $this->assertFalse($realm->isWithin( new SimpleUrl('http://www.here.com/index.html'))); $this->assertFalse($realm->isWithin( new SimpleUrl('http://www.here.com/paths/index.html'))); $this->assertFalse($realm->isWithin( new SimpleUrl('http://www.here.com/pathindex.html'))); } } class TestOfAuthenticator extends UnitTestCase { function testNoRealms() { $request = &new MockSimpleHttpRequest($this); $request->expectNever('addHeaderLine'); $authenticator = &new SimpleAuthenticator(); $authenticator->addHeaders($request, new SimpleUrl('http://here.com/')); $request->tally(); } function &createSingleRealm() { $authenticator = &new SimpleAuthenticator(); $authenticator->addRealm( new SimpleUrl('http://www.here.com/path/hello.html'), 'Basic', 'Sanctuary'); $authenticator->setIdentityForRealm('www.here.com', 'Sanctuary', 'test', 'secret'); return $authenticator; } function testOutsideRealm() { $request = &new MockSimpleHttpRequest($this); $request->expectNever('addHeaderLine'); $authenticator = &$this->createSingleRealm(); $authenticator->addHeaders( $request, new SimpleUrl('http://www.here.com/hello.html')); $request->tally(); } function testWithinRealm() { $request = &new MockSimpleHttpRequest($this); $request->expectOnce('addHeaderLine'); $authenticator = &$this->createSingleRealm(); $authenticator->addHeaders( $request, new SimpleUrl('http://www.here.com/path/more/hello.html')); $request->tally(); } function testRestartingClearsRealm() { $request = &new MockSimpleHttpRequest($this); $request->expectNever('addHeaderLine'); $authenticator = &$this->createSingleRealm(); $authenticator->restartSession(); $authenticator->addHeaders( $request, new SimpleUrl('http://www.here.com/hello.html')); $request->tally(); } function testDifferentHostIsOutsideRealm() { $request = &new MockSimpleHttpRequest($this); $request->expectNever('addHeaderLine'); $authenticator = &$this->createSingleRealm(); $authenticator->addHeaders( $request, new SimpleUrl('http://here.com/path/hello.html')); $request->tally(); } } ?>pgfouine-1.2/tests/simpletest/test/simple_mock_test.php0000644000175000017500000006144110334504436022160 0ustar acmeacmeassertTrue($expectation->test(33)); $this->assertWantedPattern( '/matches.*33/i', $expectation->testMessage(33)); } } class TestOfParametersExpectation extends UnitTestCase { function testEmptyMatch() { $expectation = new ParametersExpectation(array()); $this->assertTrue($expectation->test(array())); $this->assertFalse($expectation->test(array(33))); } function testSingleMatch() { $expectation = new ParametersExpectation(array(0)); $this->assertFalse($expectation->test(array(1))); $this->assertTrue($expectation->test(array(0))); } function testAnyMatch() { $expectation = new ParametersExpectation(false); $this->assertTrue($expectation->test(array())); $this->assertTrue($expectation->test(array(1, 2))); } function testMissingParameter() { $expectation = new ParametersExpectation(array(0)); $this->assertFalse($expectation->test(array())); } function testNullParameter() { $expectation = new ParametersExpectation(array(null)); $this->assertTrue($expectation->test(array(null))); $this->assertFalse($expectation->test(array())); } function testWildcardExpectations() { $expectation = new ParametersExpectation(array(new WildcardExpectation())); $this->assertFalse($expectation->test(array())); $this->assertIdentical($expectation->test(array(null)), true); $this->assertIdentical($expectation->test(array(13)), true); } function testOtherExpectations() { $expectation = new ParametersExpectation( array(new WantedPatternExpectation('/hello/i'))); $this->assertFalse($expectation->test(array('Goodbye'))); $this->assertTrue($expectation->test(array('hello'))); $this->assertTrue($expectation->test(array('Hello'))); } function testIdentityOnly() { $expectation = new ParametersExpectation(array("0")); $this->assertFalse($expectation->test(array(0))); $this->assertTrue($expectation->test(array("0"))); } function testLongList() { $expectation = new ParametersExpectation( array("0", 0, new WildcardExpectation(), false)); $this->assertTrue($expectation->test(array("0", 0, 37, false))); $this->assertFalse($expectation->test(array("0", 0, 37, true))); $this->assertFalse($expectation->test(array("0", 0, 37))); } } class TestOfCallMap extends UnitTestCase { function testEmpty() { $map = new CallMap(); $this->assertFalse($map->isMatch("any", array())); $this->assertNull($map->findFirstMatch("any", array())); } function testExactValue() { $map = new CallMap(); $map->addValue(array(0), "Fred"); $map->addValue(array(1), "Jim"); $map->addValue(array("1"), "Tom"); $this->assertTrue($map->isMatch(array(0))); $this->assertEqual($map->findFirstMatch(array(0)), "Fred"); $this->assertTrue($map->isMatch(array(1))); $this->assertEqual($map->findFirstMatch(array(1)), "Jim"); $this->assertEqual($map->findFirstMatch(array("1")), "Tom"); } function testExactReference() { $map = new CallMap(); $ref = "Fred"; $map->addReference(array(0), $ref); $this->assertEqual($map->findFirstMatch(array(0)), "Fred"); $ref2 = &$map->findFirstMatch(array(0)); $this->assertReference($ref2, $ref); } function testWildcard() { $map = new CallMap(); $map->addValue(array(new WildcardExpectation(), 1, 3), "Fred"); $this->assertTrue($map->isMatch(array(2, 1, 3))); $this->assertEqual($map->findFirstMatch(array(2, 1, 3)), "Fred"); } function testAllWildcard() { $map = new CallMap(); $this->assertFalse($map->isMatch(array(2, 1, 3))); $map->addValue("", "Fred"); $this->assertTrue($map->isMatch(array(2, 1, 3))); $this->assertEqual($map->findFirstMatch(array(2, 1, 3)), "Fred"); } function testOrdering() { $map = new CallMap(); $map->addValue(array(1, 2), "1, 2"); $map->addValue(array(1, 3), "1, 3"); $map->addValue(array(1), "1"); $map->addValue(array(1, 4), "1, 4"); $map->addValue(array(new WildcardExpectation()), "Any"); $map->addValue(array(2), "2"); $map->addValue("", "Default"); $map->addValue(array(), "None"); $this->assertEqual($map->findFirstMatch(array(1, 2)), "1, 2"); $this->assertEqual($map->findFirstMatch(array(1, 3)), "1, 3"); $this->assertEqual($map->findFirstMatch(array(1, 4)), "1, 4"); $this->assertEqual($map->findFirstMatch(array(1)), "1"); $this->assertEqual($map->findFirstMatch(array(2)), "Any"); $this->assertEqual($map->findFirstMatch(array(3)), "Any"); $this->assertEqual($map->findFirstMatch(array()), "Default"); } } class Dummy { function Dummy() { } function aMethod($parameter) { return $parameter; } function anotherMethod() { return true; } } Stub::generate("Dummy"); Stub::generate("Dummy", "AnotherStubDummy"); Stub::generate("Dummy", "StubDummyWithExtraMethods", array("extraMethod")); class SpecialSimpleStub extends SimpleStub { function SpecialSimpleStub($wildcard) { $this->SimpleStub($wildcard); } } SimpleTestOptions::setStubBaseClass("SpecialSimpleStub"); Stub::generate("Dummy", "SpecialStubDummy"); SimpleTestOptions::setStubBaseClass("SimpleStub"); class TestOfStubGeneration extends UnitTestCase { function testCloning() { $stub = &new StubDummy(); $this->assertTrue(method_exists($stub, "aMethod")); $this->assertNull($stub->aMethod()); } function testCloningWithExtraMethod() { $stub = &new StubDummyWithExtraMethods(); $this->assertTrue(method_exists($stub, "extraMethod")); } function testCloningWithChosenClassName() { $stub = &new AnotherStubDummy(); $this->assertTrue(method_exists($stub, "aMethod")); } function testCloningWithDifferentBaseClass() { $stub = &new SpecialStubDummy(); $this->assertIsA($stub, "SpecialSimpleStub"); $this->assertTrue(method_exists($stub, "aMethod")); } } class TestOfServerStubReturns extends UnitTestCase { function testDefaultReturn() { $stub = &new StubDummy(); $stub->setReturnValue("aMethod", "aaa"); $this->assertIdentical($stub->aMethod(), "aaa"); $this->assertIdentical($stub->aMethod(), "aaa"); } function testParameteredReturn() { $stub = &new StubDummy(); $stub->setReturnValue("aMethod", "aaa", array(1, 2, 3)); $this->assertNull($stub->aMethod()); $this->assertIdentical($stub->aMethod(1, 2, 3), "aaa"); } function testReferenceReturned() { $stub = &new StubDummy(); $object = new Dummy(); $stub->setReturnReference("aMethod", $object, array(1, 2, 3)); $this->assertReference($stub->aMethod(1, 2, 3), $object); } function testWildcardReturn() { $stub = &new StubDummy("wild"); $stub->setReturnValue("aMethod", "aaa", array(1, "wild", 3)); $this->assertIdentical($stub->aMethod(1, "something", 3), "aaa"); $this->assertIdentical($stub->aMethod(1, "anything", 3), "aaa"); } function testAllWildcardReturn() { $stub = &new StubDummy("wild"); $stub->setReturnValue("aMethod", "aaa"); $this->assertIdentical($stub->aMethod(1, 2, 3), "aaa"); $this->assertIdentical($stub->aMethod(), "aaa"); } function testCallCount() { $stub = &new StubDummy(); $this->assertEqual($stub->getCallCount("aMethod"), 0); $stub->aMethod(); $this->assertEqual($stub->getCallCount("aMethod"), 1); $stub->aMethod(); $this->assertEqual($stub->getCallCount("aMethod"), 2); } function testMultipleMethods() { $stub = &new StubDummy(); $stub->setReturnValue("aMethod", 100, array(1)); $stub->setReturnValue("aMethod", 200, array(2)); $stub->setReturnValue("anotherMethod", 10, array(1)); $stub->setReturnValue("anotherMethod", 20, array(2)); $this->assertIdentical($stub->aMethod(1), 100); $this->assertIdentical($stub->anotherMethod(1), 10); $this->assertIdentical($stub->aMethod(2), 200); $this->assertIdentical($stub->anotherMethod(2), 20); } function testReturnSequence() { $stub = &new StubDummy(); $stub->setReturnValueAt(0, "aMethod", "aaa"); $stub->setReturnValueAt(1, "aMethod", "bbb"); $stub->setReturnValueAt(3, "aMethod", "ddd"); $this->assertIdentical($stub->aMethod(), "aaa"); $this->assertIdentical($stub->aMethod(), "bbb"); $this->assertNull($stub->aMethod()); $this->assertIdentical($stub->aMethod(), "ddd"); } function testReturnReferenceSequence() { $stub = &new StubDummy(); $object = new Dummy(); $stub->setReturnReferenceAt(1, "aMethod", $object); $this->assertNull($stub->aMethod()); $this->assertReference($stub->aMethod(), $object); $this->assertNull($stub->aMethod()); } function testComplicatedReturnSequence() { $stub = &new StubDummy("wild"); $object = new Dummy(); $stub->setReturnValueAt(1, "aMethod", "aaa", array("a")); $stub->setReturnValueAt(1, "aMethod", "bbb"); $stub->setReturnReferenceAt(2, "aMethod", $object, array("wild", 2)); $stub->setReturnValueAt(2, "aMethod", "value", array("wild", 3)); $stub->setReturnValue("aMethod", 3, array(3)); $this->assertNull($stub->aMethod()); $this->assertEqual($stub->aMethod("a"), "aaa"); $this->assertReference($stub->aMethod(1, 2), $object); $this->assertEqual($stub->aMethod(3), 3); $this->assertNull($stub->aMethod()); } function testMultipleMethodSequences() { $stub = &new StubDummy(); $stub->setReturnValueAt(0, "aMethod", "aaa"); $stub->setReturnValueAt(1, "aMethod", "bbb"); $stub->setReturnValueAt(0, "anotherMethod", "ccc"); $stub->setReturnValueAt(1, "anotherMethod", "ddd"); $this->assertIdentical($stub->aMethod(), "aaa"); $this->assertIdentical($stub->anotherMethod(), "ccc"); $this->assertIdentical($stub->aMethod(), "bbb"); $this->assertIdentical($stub->anotherMethod(), "ddd"); } function testSequenceFallback() { $stub = &new StubDummy(); $stub->setReturnValueAt(0, "aMethod", "aaa", array('a')); $stub->setReturnValueAt(1, "aMethod", "bbb", array('a')); $stub->setReturnValue("aMethod", "AAA"); $this->assertIdentical($stub->aMethod('a'), "aaa"); $this->assertIdentical($stub->aMethod('b'), "AAA"); } function testMethodInterference() { $stub = &new StubDummy(); $stub->setReturnValueAt(0, "anotherMethod", "aaa"); $stub->setReturnValue("aMethod", "AAA"); $this->assertIdentical($stub->aMethod(), "AAA"); $this->assertIdentical($stub->anotherMethod(), "aaa"); } } Mock::generate("Dummy"); Mock::generate("Dummy", "AnotherMockDummy"); Mock::generate("Dummy", "MockDummyWithExtraMethods", array("extraMethod")); class SpecialSimpleMock extends SimpleMock { function SpecialSimpleMock(&$test, $wildcard) { $this->SimpleMock($test, $wildcard); } } SimpleTestOptions::setMockBaseClass("SpecialSimpleMock"); Mock::generate("Dummy", "SpecialMockDummy"); SimpleTestOptions::setMockBaseClass("SimpleMock"); class TestOfMockGeneration extends UnitTestCase { function testCloning() { $mock = &new MockDummy($this); $this->assertTrue(method_exists($mock, "aMethod")); $this->assertNull($mock->aMethod()); } function testCloningWithExtraMethod() { $mock = &new MockDummyWithExtraMethods($this); $this->assertTrue(method_exists($mock, "extraMethod")); } function testCloningWithChosenClassName() { $mock = &new AnotherMockDummy($this); $this->assertTrue(method_exists($mock, "aMethod")); } function testCloningWithDifferentBaseClass() { $mock = &new SpecialMockDummy($this); $this->assertIsA($mock, "SpecialSimpleMock"); $this->assertTrue(method_exists($mock, "aMethod")); } } class TestOfMockReturns extends UnitTestCase { function testNoUnitTesterSetThrowsError() { $mock = &new MockDummy(); $this->assertErrorPattern('/missing argument/i'); $this->assertErrorPattern('/no unit tester/i'); } function testParameteredReturn() { $mock = &new MockDummy($this); $mock->setReturnValue("aMethod", "aaa", array(1, 2, 3)); $this->assertNull($mock->aMethod()); $this->assertIdentical($mock->aMethod(1, 2, 3), "aaa"); } function testReferenceReturned() { $mock = &new MockDummy($this); $object = new Dummy(); $mock->setReturnReference("aMethod", $object, array(1, 2, 3)); $this->assertReference($mock->aMethod(1, 2, 3), $object); } function testWildcardReturn() { $mock = &new MockDummy($this, "wild"); $mock->setReturnValue("aMethod", "aaa", array(1, "wild", 3)); $this->assertIdentical($mock->aMethod(1, "something", 3), "aaa"); $this->assertIdentical($mock->aMethod(1, "anything", 3), "aaa"); } function testPatternMatchReturn() { $mock = &new MockDummy($this); $mock->setReturnValue( "aMethod", "aaa", array(new wantedPatternExpectation('/hello/i'))); $this->assertIdentical($mock->aMethod('Hello'), "aaa"); $this->assertNull($mock->aMethod('Goodbye')); } function testCallCount() { $mock = &new MockDummy($this); $this->assertEqual($mock->getCallCount("aMethod"), 0); $mock->aMethod(); $this->assertEqual($mock->getCallCount("aMethod"), 1); $mock->aMethod(); $this->assertEqual($mock->getCallCount("aMethod"), 2); } function testReturnReferenceSequence() { $mock = &new MockDummy($this); $object = new Dummy(); $mock->setReturnReferenceAt(1, "aMethod", $object); $this->assertNull($mock->aMethod()); $this->assertReference($mock->aMethod(), $object); $this->assertNull($mock->aMethod()); $this->swallowErrors(); } } Mock::generate("SimpleTestCase"); class TestOfMockTally extends UnitTestCase { function testZeroCallCount() { $mock = &new MockDummy($this); $mock->expectCallCount("aMethod", 0); $mock->tally(); } function testExpectedCallCount() { $mock = &new MockDummy($this); $mock->expectCallCount("aMethod", 2); $mock->aMethod(); $mock->aMethod(); $mock->tally(); } } class TestOfMockExpectations extends UnitTestCase { var $_test; function TestOfMockExpectations() { $this->UnitTestCase(); } function setUp() { $this->_test = &new MockSimpleTestCase($this); } function tearDown() { $this->_test->tally(); } function testSettingExpectationOnNonMethodThrowsError() { $mock = &new MockDummy($this); $mock->expectMaximumCallCount("aMissingMethod", 2); $this->assertError(); } function testMaxCallsDetectsOverrun() { $this->_test->expectOnce("assertTrue", array(false, '*')); $mock = &new MockDummy($this->_test); $mock->expectMaximumCallCount("aMethod", 2); $mock->aMethod(); $mock->aMethod(); $mock->aMethod(); } function testTallyOnMaxCallsSendsPassOnUnderrun() { $this->_test->expectOnce("assertTrue", array(true, '*')); $mock = &new MockDummy($this->_test); $mock->expectMaximumCallCount("aMethod", 2); $mock->aMethod(); $mock->aMethod(); $mock->tally(); } function testExpectNeverDetectsOverrun() { $this->_test->expectOnce("assertTrue", array(false, '*')); $mock = &new MockDummy($this->_test); $mock->expectNever("aMethod"); $mock->aMethod(); } function testTallyOnExpectNeverSendsPassOnUnderrun() { $this->_test->expectOnce("assertTrue", array(true, '*')); $mock = &new MockDummy($this->_test); $mock->expectNever("aMethod"); $mock->tally(); } function testMinCalls() { $this->_test->expectOnce("assertTrue", array(true, '*')); $mock = &new MockDummy($this->_test); $mock->expectMinimumCallCount("aMethod", 2); $mock->aMethod(); $mock->aMethod(); $mock->tally(); } function testFailedNever() { $this->_test->expectOnce("assertTrue", array(false, '*')); $mock = &new MockDummy($this->_test); $mock->expectNever("aMethod"); $mock->aMethod(); } function testUnderOnce() { $this->_test->expectOnce("assertTrue", array(false, '*')); $mock = &new MockDummy($this->_test); $mock->expectOnce("aMethod"); $mock->tally(); } function testOverOnce() { $this->_test->expectOnce("assertTrue", array(false, '*')); $mock = &new MockDummy($this->_test); $mock->expectOnce("aMethod"); $mock->aMethod(); $mock->aMethod(); $mock->tally(); $this->swallowErrors(); } function testUnderAtLeastOnce() { $this->_test->expectOnce("assertTrue", array(false, '*')); $mock = &new MockDummy($this->_test); $mock->expectAtLeastOnce("aMethod"); $mock->tally(); } function testZeroArguments() { $mock = &new MockDummy($this); $mock->expectArguments("aMethod", array()); $mock->aMethod(); } function testExpectedArguments() { $mock = &new MockDummy($this); $mock->expectArguments("aMethod", array(1, 2, 3)); $mock->aMethod(1, 2, 3); } function testFailedArguments() { $this->_test->expectOnce("assertTrue", array(false, "*")); $mock = &new MockDummy($this->_test); $mock->expectArguments("aMethod", array("this")); $mock->aMethod("that"); } function testWildcardArguments() { $mock = &new MockDummy($this, "wild"); $mock->expectArguments("aMethod", array("wild", 123, "wild")); $mock->aMethod(100, 123, 101); } function testSpecificSequence() { $mock = &new MockDummy($this); $mock->expectArgumentsAt(1, "aMethod", array(1, 2, 3)); $mock->expectArgumentsAt(2, "aMethod", array("Hello")); $mock->aMethod(); $mock->aMethod(1, 2, 3); $mock->aMethod("Hello"); $mock->aMethod(); } function testFailedSequence() { $this->_test->expectArguments("assertTrue", array(false, "*")); $this->_test->expectCallCount("assertTrue", 2); $mock = &new MockDummy($this->_test); $mock->expectArgumentsAt(0, "aMethod", array(1, 2, 3)); $mock->expectArgumentsAt(1, "aMethod", array("Hello")); $mock->aMethod(1, 2); $mock->aMethod("Goodbye"); } function testBadArgParameter() { $mock = &new MockDummy($this); $mock->expectArguments("aMethod", "foo"); $this->assertErrorPattern('/\$args.*not an array/i'); $mock->aMethod(); $mock->tally(); } } class TestOfMockComparisons extends UnitTestCase { function testTestCaseRegistry() { $test = &new MockSimpleTestCase($this); $class = SimpleMock::registerTest($test); $this->assertReference($test, SimpleMock::injectTest($class)); } function testEqualComparisonOfMocksDoesNotCrash() { $expectation = &new EqualExpectation(new MockDummy($this)); $this->assertTrue($expectation->test(new MockDummy($this), true)); } function testIdenticalComparisonOfMocksDoesNotCrash() { $expectation = &new IdenticalExpectation(new MockDummy($this)); $this->assertTrue($expectation->test(new MockDummy($this))); } } SimpleTestOptions::addPartialMockCode('function sayHello() { return "Hello"; }'); Mock::generatePartial("Dummy", "TestDummy", array("anotherMethod")); SimpleTestOptions::addPartialMockCode(); class TestOfPartialMocks extends UnitTestCase { function testMethodReplacement() { $mock = &new TestDummy($this); $this->assertEqual($mock->aMethod(99), 99); $this->assertNull($mock->anotherMethod()); } function testSettingReturns() { $mock = &new TestDummy($this); $mock->setReturnValue("anotherMethod", 33, array(3)); $mock->setReturnValue("anotherMethod", 22); $mock->setReturnValueAt(2, "anotherMethod", 44, array(3)); $this->assertEqual($mock->anotherMethod(), 22); $this->assertEqual($mock->anotherMethod(3), 33); $this->assertEqual($mock->anotherMethod(3), 44); } function testReferences() { $mock = &new TestDummy($this); $object = new Dummy(); $mock->setReturnReferenceAt(0, "anotherMethod", $object, array(3)); $this->assertReference($mock->anotherMethod(3), $object); } function testExpectations() { $mock = &new TestDummy($this); $mock->expectCallCount("anotherMethod", 2); $mock->expectArguments("anotherMethod", array(77)); $mock->expectArgumentsAt(1, "anotherMethod", array(66)); $mock->anotherMethod(77); $mock->anotherMethod(66); $mock->tally(); } function testAdditionalPartialMockCode() { $dummy = &new TestDummy($this); $this->assertEqual($dummy->sayHello(), 'Hello'); } function testSettingExpectationOnMissingMethodThrowsError() { $mock = &new TestDummy($this); $mock->expectCallCount("aMissingMethod", 2); $this->assertError(); } } ?>pgfouine-1.2/tests/simpletest/test/parse_error_test.php0000644000175000017500000000045310334504436022175 0ustar acmeacmeaddTestFile('test_with_parse_error.php'); $test->run(new HtmlReporter()); ?>pgfouine-1.2/tests/simpletest/test/unit_tester_test.php0000644000175000017500000000305710334504436022222 0ustar acmeacmeassertTrue($this->assertTrue(true)); } function testAssertFalseReturnsAssertionAsBoolean() { $this->assertTrue($this->assertFalse(false)); } function testAssertEqualReturnsAssertionAsBoolean() { $this->assertTrue($this->assertEqual(5, 5)); } function testAssertIdenticalReturnsAssertionAsBoolean() { $this->assertTrue($this->assertIdentical(5, 5)); } function testCoreAssertionsDoNotThrowErrors() { $this->assertIsA($this, 'UnitTestCase'); $this->assertNotA($this, 'WebTestCase'); } } class JBehaveStyleRunner extends SimpleRunner { function JBehaveStyleRunner(&$test_case, &$scorer) { $this->SimpleRunner($test_case, $scorer); } function _isTest($method) { return strtolower(substr($method, 0, 6)) == 'should'; } } class TestOfJBehaveStyleRunner extends UnitTestCase { function &_createRunner(&$reporter) { return new JBehaveStyleRunner($this, $reporter); } function testFail() { $this->fail('This should not be run'); } function shouldBeRun() { $this->pass('This should be run'); } } ?>pgfouine-1.2/tests/simpletest/test/http_test.php0000644000175000017500000006404610334504436020641 0ustar acmeacmeassertFalse($cookie->getValue()); $this->assertEqual($cookie->getPath(), "/"); $this->assertIdentical($cookie->getHost(), false); $this->assertFalse($cookie->getExpiry()); $this->assertFalse($cookie->isSecure()); } function testCookieAccessors() { $cookie = new SimpleCookie( "name", "value", "/path", "Mon, 18 Nov 2002 15:50:29 GMT", true); $this->assertEqual($cookie->getName(), "name"); $this->assertEqual($cookie->getValue(), "value"); $this->assertEqual($cookie->getPath(), "/path/"); $this->assertEqual($cookie->getExpiry(), "Mon, 18 Nov 2002 15:50:29 GMT"); $this->assertTrue($cookie->isSecure()); } function testFullHostname() { $cookie = new SimpleCookie("name"); $this->assertTrue($cookie->setHost("host.name.here")); $this->assertEqual($cookie->getHost(), "host.name.here"); $this->assertTrue($cookie->setHost("host.com")); $this->assertEqual($cookie->getHost(), "host.com"); } function testHostTruncation() { $cookie = new SimpleCookie("name"); $cookie->setHost("this.host.name.here"); $this->assertEqual($cookie->getHost(), "host.name.here"); $cookie->setHost("this.host.com"); $this->assertEqual($cookie->getHost(), "host.com"); $this->assertTrue($cookie->setHost("dashes.in-host.com")); $this->assertEqual($cookie->getHost(), "in-host.com"); } function testBadHosts() { $cookie = new SimpleCookie("name"); $this->assertFalse($cookie->setHost("gibberish")); $this->assertFalse($cookie->setHost("host.here")); $this->assertFalse($cookie->setHost("host..com")); $this->assertFalse($cookie->setHost("...")); $this->assertFalse($cookie->setHost("host.com.")); } function testHostValidity() { $cookie = new SimpleCookie("name"); $cookie->setHost("this.host.name.here"); $this->assertTrue($cookie->isValidHost("host.name.here")); $this->assertTrue($cookie->isValidHost("that.host.name.here")); $this->assertFalse($cookie->isValidHost("bad.host")); $this->assertFalse($cookie->isValidHost("nearly.name.here")); } function testPathValidity() { $cookie = new SimpleCookie("name", "value", "/path"); $this->assertFalse($cookie->isValidPath("/")); $this->assertTrue($cookie->isValidPath("/path/")); $this->assertTrue($cookie->isValidPath("/path/more")); } function testSessionExpiring() { $cookie = new SimpleCookie("name", "value", "/path"); $this->assertTrue($cookie->isExpired(0)); } function testTimestampExpiry() { $cookie = new SimpleCookie("name", "value", "/path", 456); $this->assertFalse($cookie->isExpired(0)); $this->assertTrue($cookie->isExpired(457)); $this->assertFalse($cookie->isExpired(455)); } function testDateExpiry() { $cookie = new SimpleCookie( "name", "value", "/path", "Mon, 18 Nov 2002 15:50:29 GMT"); $this->assertTrue($cookie->isExpired("Mon, 18 Nov 2002 15:50:30 GMT")); $this->assertFalse($cookie->isExpired("Mon, 18 Nov 2002 15:50:28 GMT")); } function testAging() { $cookie = new SimpleCookie("name", "value", "/path", 200); $cookie->agePrematurely(199); $this->assertFalse($cookie->isExpired(0)); $cookie->agePrematurely(2); $this->assertTrue($cookie->isExpired(0)); } } class TestOfDirectRoute extends UnitTestCase { function testDefaultGetRequest() { $socket = &new MockSimpleSocket($this); $socket->expectArgumentsAt(0, 'write', array("GET /here.html HTTP/1.0\r\n")); $socket->expectArgumentsAt(1, 'write', array("Host: a.valid.host\r\n")); $socket->expectArgumentsAt(2, 'write', array("Connection: close\r\n")); $socket->expectCallCount('write', 3); $route = &new PartialSimpleRoute($this); $route->setReturnReference('_createSocket', $socket); $route->SimpleRoute(new SimpleUrl('http://a.valid.host/here.html')); $this->assertReference($route->createConnection('GET', 15), $socket); $socket->tally(); } function testDefaultPostRequest() { $socket = &new MockSimpleSocket($this); $socket->expectArgumentsAt(0, 'write', array("POST /here.html HTTP/1.0\r\n")); $socket->expectArgumentsAt(1, 'write', array("Host: a.valid.host\r\n")); $socket->expectArgumentsAt(2, 'write', array("Connection: close\r\n")); $socket->expectCallCount('write', 3); $route = &new PartialSimpleRoute($this); $route->setReturnReference('_createSocket', $socket); $route->SimpleRoute(new SimpleUrl('http://a.valid.host/here.html')); $route->createConnection('POST', 15); $socket->tally(); } function testGetWithPort() { $socket = &new MockSimpleSocket($this); $socket->expectArgumentsAt(0, 'write', array("GET /here.html HTTP/1.0\r\n")); $socket->expectArgumentsAt(1, 'write', array("Host: a.valid.host:81\r\n")); $socket->expectArgumentsAt(2, 'write', array("Connection: close\r\n")); $socket->expectCallCount('write', 3); $route = &new PartialSimpleRoute($this); $route->setReturnReference('_createSocket', $socket); $route->SimpleRoute(new SimpleUrl('http://a.valid.host:81/here.html')); $route->createConnection('GET', 15); $socket->tally(); } function testGetWithParameters() { $socket = &new MockSimpleSocket($this); $socket->expectArgumentsAt(0, 'write', array("GET /here.html?a=1&b=2 HTTP/1.0\r\n")); $socket->expectArgumentsAt(1, 'write', array("Host: a.valid.host\r\n")); $socket->expectArgumentsAt(2, 'write', array("Connection: close\r\n")); $socket->expectCallCount('write', 3); $route = &new PartialSimpleRoute($this); $route->setReturnReference('_createSocket', $socket); $route->SimpleRoute(new SimpleUrl('http://a.valid.host/here.html?a=1&b=2')); $route->createConnection('GET', 15); $socket->tally(); } } class TestOfProxyRoute extends UnitTestCase { function testDefaultGet() { $socket = &new MockSimpleSocket($this); $socket->expectArgumentsAt(0, 'write', array("GET http://a.valid.host/here.html HTTP/1.0\r\n")); $socket->expectArgumentsAt(1, 'write', array("Host: my-proxy:8080\r\n")); $socket->expectArgumentsAt(2, 'write', array("Connection: close\r\n")); $socket->expectCallCount('write', 3); $route = &new PartialSimpleProxyRoute($this); $route->setReturnReference('_createSocket', $socket); $route->SimpleProxyRoute( new SimpleUrl('http://a.valid.host/here.html'), new SimpleUrl('http://my-proxy')); $route->createConnection('GET', 15); $socket->tally(); } function testDefaultPost() { $socket = &new MockSimpleSocket($this); $socket->expectArgumentsAt(0, 'write', array("POST http://a.valid.host/here.html HTTP/1.0\r\n")); $socket->expectArgumentsAt(1, 'write', array("Host: my-proxy:8080\r\n")); $socket->expectArgumentsAt(2, 'write', array("Connection: close\r\n")); $socket->expectCallCount('write', 3); $route = &new PartialSimpleProxyRoute($this); $route->setReturnReference('_createSocket', $socket); $route->SimpleProxyRoute( new SimpleUrl('http://a.valid.host/here.html'), new SimpleUrl('http://my-proxy')); $route->createConnection('POST', 15); $socket->tally(); } function testGetWithPort() { $socket = &new MockSimpleSocket($this); $socket->expectArgumentsAt(0, 'write', array("GET http://a.valid.host:81/here.html HTTP/1.0\r\n")); $socket->expectArgumentsAt(1, 'write', array("Host: my-proxy:8081\r\n")); $socket->expectArgumentsAt(2, 'write', array("Connection: close\r\n")); $socket->expectCallCount('write', 3); $route = &new PartialSimpleProxyRoute($this); $route->setReturnReference('_createSocket', $socket); $route->SimpleProxyRoute( new SimpleUrl('http://a.valid.host:81/here.html'), new SimpleUrl('http://my-proxy:8081')); $route->createConnection('GET', 15); $socket->tally(); } function testGetWithParameters() { $socket = &new MockSimpleSocket($this); $socket->expectArgumentsAt(0, 'write', array("GET http://a.valid.host/here.html?a=1&b=2 HTTP/1.0\r\n")); $socket->expectArgumentsAt(1, 'write', array("Host: my-proxy:8080\r\n")); $socket->expectArgumentsAt(2, 'write', array("Connection: close\r\n")); $socket->expectCallCount('write', 3); $route = &new PartialSimpleProxyRoute($this); $route->setReturnReference('_createSocket', $socket); $route->SimpleProxyRoute( new SimpleUrl('http://a.valid.host/here.html?a=1&b=2'), new SimpleUrl('http://my-proxy')); $route->createConnection('GET', 15); $socket->tally(); } function testGetWithAuthentication() { $encoded = base64_encode('Me:Secret'); $socket = &new MockSimpleSocket($this); $socket->expectArgumentsAt(0, 'write', array("GET http://a.valid.host/here.html HTTP/1.0\r\n")); $socket->expectArgumentsAt(1, 'write', array("Host: my-proxy:8080\r\n")); $socket->expectArgumentsAt(2, 'write', array("Proxy-Authorization: Basic $encoded\r\n")); $socket->expectArgumentsAt(3, 'write', array("Connection: close\r\n")); $socket->expectCallCount('write', 4); $route = &new PartialSimpleProxyRoute($this); $route->setReturnReference('_createSocket', $socket); $route->SimpleProxyRoute( new SimpleUrl('http://a.valid.host/here.html'), new SimpleUrl('http://my-proxy'), 'Me', 'Secret'); $route->createConnection('GET', 15); $socket->tally(); } } class TestOfHttpRequest extends UnitTestCase { function testReadingBadConnection() { $socket = &new MockSimpleSocket($this); $route = &new MockSimpleRoute($this); $route->setReturnReference('createConnection', $socket); $request = &new SimpleHttpRequest($route, 'GET'); $reponse = &$request->fetch(15); $this->assertTrue($reponse->isError()); } function testReadingGoodConnection() { $socket = &new MockSimpleSocket($this); $socket->expectOnce('write', array("\r\n")); $route = &new MockSimpleRoute($this); $route->setReturnReference('createConnection', $socket); $route->expectArguments('createConnection', array('GET', 15)); $request = &new SimpleHttpRequest($route, 'GET'); $this->assertIsA($request->fetch(15), 'SimpleHttpResponse'); $socket->tally(); $route->tally(); } function testWritingAdditionalHeaders() { $socket = &new MockSimpleSocket($this); $socket->expectArgumentsAt(0, 'write', array("My: stuff\r\n")); $socket->expectArgumentsAt(1, 'write', array("\r\n")); $socket->expectCallCount('write', 2); $route = &new MockSimpleRoute($this); $route->setReturnReference('createConnection', $socket); $request = &new SimpleHttpRequest($route, 'GET'); $request->addHeaderLine('My: stuff'); $request->fetch(15); $socket->tally(); } function testCookieWriting() { $socket = &new MockSimpleSocket($this); $socket->expectArgumentsAt(0, 'write', array("Cookie: a=A\r\n")); $socket->expectArgumentsAt(1, 'write', array("\r\n")); $socket->expectCallCount('write', 2); $route = &new MockSimpleRoute($this); $route->setReturnReference('createConnection', $socket); $request = &new SimpleHttpRequest($route, 'GET'); $request->setCookie(new SimpleCookie('a', 'A')); $this->assertIsA($request->fetch(15), 'SimpleHttpResponse'); $socket->tally(); } function testMultipleCookieWriting() { $socket = &new MockSimpleSocket($this); $socket->expectArgumentsAt(0, 'write', array("Cookie: a=A;b=B\r\n")); $route = &new MockSimpleRoute($this); $route->setReturnReference('createConnection', $socket); $request = &new SimpleHttpRequest($route, 'GET'); $request->setCookie(new SimpleCookie('a', 'A')); $request->setCookie(new SimpleCookie('b', 'B')); $request->fetch(15); $socket->tally(); } } class TestOfHttpPostRequest extends UnitTestCase { function testReadingBadConnection() { $socket = &new MockSimpleSocket($this); $route = &new MockSimpleRoute($this); $route->setReturnReference('createConnection', $socket); $request = &new SimpleHttpRequest($route, 'POST', ''); $reponse = &$request->fetch(15); $this->assertTrue($reponse->isError()); } function testReadingGoodConnection() { $socket = &new MockSimpleSocket($this); $socket->expectArgumentsAt(0, 'write', array("Content-Length: 0\r\n")); $socket->expectArgumentsAt(1, 'write', array("Content-Type: application/x-www-form-urlencoded\r\n")); $socket->expectArgumentsAt(2, 'write', array("\r\n")); $socket->expectArgumentsAt(3, 'write', array("")); $route = &new MockSimpleRoute($this); $route->setReturnReference('createConnection', $socket); $route->expectArguments('createConnection', array('POST', 15)); $request = &new SimpleHttpRequest($route, 'POST', new SimpleFormEncoding()); $this->assertIsA($request->fetch(15), 'SimpleHttpResponse'); $socket->tally(); $route->tally(); } function testContentHeadersCalculated() { $socket = &new MockSimpleSocket($this); $socket->expectArgumentsAt(0, 'write', array("Content-Length: 3\r\n")); $socket->expectArgumentsAt(1, 'write', array("Content-Type: application/x-www-form-urlencoded\r\n")); $socket->expectArgumentsAt(2, 'write', array("\r\n")); $socket->expectArgumentsAt(3, 'write', array("a=A")); $route = &new MockSimpleRoute($this); $route->setReturnReference('createConnection', $socket); $route->expectArguments('createConnection', array('POST', 15)); $request = &new SimpleHttpRequest( $route, 'POST', new SimpleFormEncoding(array('a' => 'A'))); $this->assertIsA($request->fetch(15), 'SimpleHttpResponse'); $socket->tally(); $route->tally(); } } class TestOfHttpHeaders extends UnitTestCase { function testParseBasicHeaders() { $headers = new SimpleHttpHeaders("HTTP/1.1 200 OK\r\n" . "Date: Mon, 18 Nov 2002 15:50:29 GMT\r\n" . "Content-Type: text/plain\r\n" . "Server: Apache/1.3.24 (Win32) PHP/4.2.3\r\n" . "Connection: close"); $this->assertIdentical($headers->getHttpVersion(), "1.1"); $this->assertIdentical($headers->getResponseCode(), 200); $this->assertEqual($headers->getMimeType(), "text/plain"); } function testParseOfCookies() { $headers = new SimpleHttpHeaders("HTTP/1.1 200 OK\r\n" . "Date: Mon, 18 Nov 2002 15:50:29 GMT\r\n" . "Content-Type: text/plain\r\n" . "Server: Apache/1.3.24 (Win32) PHP/4.2.3\r\n" . "Set-Cookie: a=aaa; expires=Wed, 25-Dec-02 04:24:20 GMT; path=/here/\r\n" . "Set-Cookie: b=bbb\r\n" . "Connection: close"); $cookies = $headers->getNewCookies(); $this->assertEqual(count($cookies), 2); $this->assertEqual($cookies[0]->getName(), "a"); $this->assertEqual($cookies[0]->getValue(), "aaa"); $this->assertEqual($cookies[0]->getPath(), "/here/"); $this->assertEqual($cookies[0]->getExpiry(), "Wed, 25 Dec 2002 04:24:20 GMT"); $this->assertEqual($cookies[1]->getName(), "b"); $this->assertEqual($cookies[1]->getValue(), "bbb"); $this->assertEqual($cookies[1]->getPath(), "/"); $this->assertEqual($cookies[1]->getExpiry(), ""); } function testRedirect() { $headers = new SimpleHttpHeaders("HTTP/1.1 301 OK\r\n" . "Content-Type: text/plain\r\n" . "Content-Length: 0\r\n" . "Location: http://www.somewhere-else.com/\r\n" . "Connection: close"); $this->assertIdentical($headers->getResponseCode(), 301); $this->assertEqual($headers->getLocation(), "http://www.somewhere-else.com/"); $this->assertTrue($headers->isRedirect()); } function testParseChallenge() { $headers = new SimpleHttpHeaders("HTTP/1.1 401 Authorization required\r\n" . "Content-Type: text/plain\r\n" . "Connection: close\r\n" . "WWW-Authenticate: Basic realm=\"Somewhere\""); $this->assertEqual($headers->getAuthentication(), 'Basic'); $this->assertEqual($headers->getRealm(), 'Somewhere'); $this->assertTrue($headers->isChallenge()); } } class TestOfHttpResponse extends UnitTestCase { function testBadRequest() { $socket = &new MockSimpleSocket($this); $socket->setReturnValue('getSent', ''); $response = &new SimpleHttpResponse($socket, 'GET', new SimpleUrl('here')); $this->assertTrue($response->isError()); $this->assertWantedPattern('/Nothing fetched/', $response->getError()); $this->assertIdentical($response->getContent(), false); $this->assertIdentical($response->getSent(), ''); } function testBadSocketDuringResponse() { $socket = &new MockSimpleSocket($this); $socket->setReturnValueAt(0, "read", "HTTP/1.1 200 OK\r\n"); $socket->setReturnValueAt(1, "read", "Date: Mon, 18 Nov 2002 15:50:29 GMT\r\n"); $socket->setReturnValue("read", ""); $socket->setReturnValue('getSent', 'HTTP/1.1 ...'); $response = &new SimpleHttpResponse($socket, 'GET', new SimpleUrl('here')); $this->assertTrue($response->isError()); $this->assertEqual($response->getContent(), ''); $this->assertEqual($response->getSent(), 'HTTP/1.1 ...'); } function testIncompleteHeader() { $socket = &new MockSimpleSocket($this); $socket->setReturnValueAt(0, "read", "HTTP/1.1 200 OK\r\n"); $socket->setReturnValueAt(1, "read", "Date: Mon, 18 Nov 2002 15:50:29 GMT\r\n"); $socket->setReturnValueAt(2, "read", "Content-Type: text/plain\r\n"); $socket->setReturnValue("read", ""); $response = &new SimpleHttpResponse($socket, 'GET', new SimpleUrl('here')); $this->assertTrue($response->isError()); $this->assertEqual($response->getContent(), ""); } function testParseOfResponseHeaders() { $socket = &new MockSimpleSocket($this); $socket->setReturnValueAt(0, "read", "HTTP/1.1 200 OK\r\nDate: Mon, 18 Nov 2002 15:50:29 GMT\r\n"); $socket->setReturnValueAt(1, "read", "Content-Type: text/plain\r\n"); $socket->setReturnValueAt(2, "read", "Server: Apache/1.3.24 (Win32) PHP/4.2.3\r\nConne"); $socket->setReturnValueAt(3, "read", "ction: close\r\n\r\nthis is a test file\n"); $socket->setReturnValueAt(4, "read", "with two lines in it\n"); $socket->setReturnValue("read", ""); $response = &new SimpleHttpResponse($socket, 'GET', new SimpleUrl('here')); $this->assertFalse($response->isError()); $this->assertEqual( $response->getContent(), "this is a test file\nwith two lines in it\n"); $headers = $response->getHeaders(); $this->assertIdentical($headers->getHttpVersion(), "1.1"); $this->assertIdentical($headers->getResponseCode(), 200); $this->assertEqual($headers->getMimeType(), "text/plain"); $this->assertFalse($headers->isRedirect()); $this->assertFalse($headers->getLocation()); } function testParseOfCookies() { $socket = &new MockSimpleSocket($this); $socket->setReturnValueAt(0, "read", "HTTP/1.1 200 OK\r\n"); $socket->setReturnValueAt(1, "read", "Date: Mon, 18 Nov 2002 15:50:29 GMT\r\n"); $socket->setReturnValueAt(2, "read", "Content-Type: text/plain\r\n"); $socket->setReturnValueAt(3, "read", "Server: Apache/1.3.24 (Win32) PHP/4.2.3\r\n"); $socket->setReturnValueAt(4, "read", "Set-Cookie: a=aaa; expires=Wed, 25-Dec-02 04:24:20 GMT; path=/here/\r\n"); $socket->setReturnValueAt(5, "read", "Connection: close\r\n"); $socket->setReturnValueAt(6, "read", "\r\n"); $socket->setReturnValue("read", ""); $response = &new SimpleHttpResponse($socket, 'GET', new SimpleUrl('here')); $this->assertFalse($response->isError()); $headers = $response->getHeaders(); $cookies = $headers->getNewCookies(); $this->assertEqual($cookies[0]->getName(), "a"); $this->assertEqual($cookies[0]->getValue(), "aaa"); $this->assertEqual($cookies[0]->getPath(), "/here/"); $this->assertEqual($cookies[0]->getExpiry(), "Wed, 25 Dec 2002 04:24:20 GMT"); } function testRedirect() { $socket = &new MockSimpleSocket($this); $socket->setReturnValueAt(0, "read", "HTTP/1.1 301 OK\r\n"); $socket->setReturnValueAt(1, "read", "Content-Type: text/plain\r\n"); $socket->setReturnValueAt(2, "read", "Location: http://www.somewhere-else.com/\r\n"); $socket->setReturnValueAt(3, "read", "Connection: close\r\n"); $socket->setReturnValueAt(4, "read", "\r\n"); $socket->setReturnValue("read", ""); $response = &new SimpleHttpResponse($socket, 'GET', new SimpleUrl('here')); $headers = $response->getHeaders(); $this->assertTrue($headers->isRedirect()); $this->assertEqual($headers->getLocation(), "http://www.somewhere-else.com/"); } function testRedirectWithPort() { $socket = &new MockSimpleSocket($this); $socket->setReturnValueAt(0, "read", "HTTP/1.1 301 OK\r\n"); $socket->setReturnValueAt(1, "read", "Content-Type: text/plain\r\n"); $socket->setReturnValueAt(2, "read", "Location: http://www.somewhere-else.com:80/\r\n"); $socket->setReturnValueAt(3, "read", "Connection: close\r\n"); $socket->setReturnValueAt(4, "read", "\r\n"); $socket->setReturnValue("read", ""); $response = &new SimpleHttpResponse($socket, 'GET', new SimpleUrl('here')); $headers = $response->getHeaders(); $this->assertTrue($headers->isRedirect()); $this->assertEqual($headers->getLocation(), "http://www.somewhere-else.com:80/"); } } ?>pgfouine-1.2/tests/simpletest/test/all_tests.php0000644000175000017500000000213410334504436020603 0ustar acmeacmeGroupTest('All tests for SimpleTest ' . SimpleTestOptions::getVersion()); $this->addTestCase(new UnitTests()); $this->addTestFile('shell_test.php'); $this->addTestFile('live_test.php'); $this->addTestFile('acceptance_test.php'); $this->addTestFile('real_sites_test.php'); } } $test = &new AllTests(); if (SimpleReporter::inCli()) { exit ($test->run(new TextReporter()) ? 0 : 1); } $test->run(new HtmlReporter()); ?>pgfouine-1.2/tests/simpletest/test/acceptance_test.php0000644000175000017500000013716510334504436021753 0ustar acmeacmeaddHeader('User-Agent: SimpleTest ' . SimpleTestOptions::getVersion()); $this->assertTrue($browser->get('http://www.lastcraft.com/test/network_confirm.php')); $this->assertWantedPattern('/target for the SimpleTest/', $browser->getContent()); $this->assertWantedPattern('/Request method.*?
GET<\/dd>/', $browser->getContent()); $this->assertEqual($browser->getTitle(), 'Simple test target file'); $this->assertEqual($browser->getResponseCode(), 200); $this->assertEqual($browser->getMimeType(), 'text/html'); } function testPost() { $browser = &new SimpleBrowser(); $browser->addHeader('User-Agent: SimpleTest ' . SimpleTestOptions::getVersion()); $this->assertTrue($browser->post('http://www.lastcraft.com/test/network_confirm.php')); $this->assertWantedPattern('/target for the SimpleTest/', $browser->getContent()); $this->assertWantedPattern('/Request method.*?
POST<\/dd>/', $browser->getContent()); } function testAbsoluteLinkFollowing() { $browser = &new SimpleBrowser(); $browser->addHeader('User-Agent: SimpleTest ' . SimpleTestOptions::getVersion()); $browser->get('http://www.lastcraft.com/test/link_confirm.php'); $this->assertTrue($browser->clickLink('Absolute')); $this->assertWantedPattern('/target for the SimpleTest/', $browser->getContent()); } function testRelativeLinkFollowing() { $browser = &new SimpleBrowser(); $browser->addHeader('User-Agent: SimpleTest ' . SimpleTestOptions::getVersion()); $browser->get('http://www.lastcraft.com/test/link_confirm.php'); $this->assertTrue($browser->clickLink('Relative')); $this->assertWantedPattern('/target for the SimpleTest/', $browser->getContent()); } function testIdLinkFollowing() { $browser = &new SimpleBrowser(); $browser->addHeader('User-Agent: SimpleTest ' . SimpleTestOptions::getVersion()); $browser->get('http://www.lastcraft.com/test/link_confirm.php'); $this->assertTrue($browser->clickLinkById(1)); $this->assertWantedPattern('/target for the SimpleTest/', $browser->getContent()); } function testCookieReading() { $browser = &new SimpleBrowser(); $browser->addHeader('User-Agent: SimpleTest ' . SimpleTestOptions::getVersion()); $browser->get('http://www.lastcraft.com/test/set_cookies.php'); $this->assertEqual($browser->getCurrentCookieValue('session_cookie'), 'A'); $this->assertEqual($browser->getCurrentCookieValue('short_cookie'), 'B'); $this->assertEqual($browser->getCurrentCookieValue('day_cookie'), 'C'); } function testSimpleSubmit() { $browser = &new SimpleBrowser(); $browser->addHeader('User-Agent: SimpleTest ' . SimpleTestOptions::getVersion()); $browser->get('http://www.lastcraft.com/test/form.html'); $this->assertTrue($browser->clickSubmit('Go!')); $this->assertWantedPattern('/Request method.*?
POST<\/dd>/', $browser->getContent()); $this->assertWantedPattern('/go=\[Go!\]/', $browser->getContent()); } } class TestOfLiveFetching extends WebTestCase { function setUp() { $this->addHeader('User-Agent: SimpleTest ' . SimpleTestOptions::getVersion()); } function testGet() { $this->assertTrue($this->get('http://www.lastcraft.com/test/network_confirm.php')); $this->assertTrue($this->getUrl() == 'http://www.lastcraft.com/test/network_confirm.php'); $this->assertWantedPattern('/target for the SimpleTest/'); $this->assertWantedPattern('/Request method.*?
GET<\/dd>/'); $this->assertTitle('Simple test target file'); $this->assertResponse(200); $this->assertMime('text/html'); } function testSlowGet() { $this->assertTrue($this->get('http://www.lastcraft.com/test/slow_page.php')); } function testTimedOutGet() { $this->setConnectionTimeout(1); $this->assertFalse($this->get('http://www.lastcraft.com/test/slow_page.php')); } function testPost() { $this->assertTrue($this->post('http://www.lastcraft.com/test/network_confirm.php')); $this->assertWantedText('target for the SimpleTest'); $this->assertWantedPattern('/Request method.*?
POST<\/dd>/'); } function testGetWithData() { $this->get('http://www.lastcraft.com/test/network_confirm.php', array("a" => "aaa")); $this->assertWantedPattern('/Request method.*?
GET<\/dd>/'); $this->assertWantedText('a=[aaa]'); } function testPostWithData() { $this->post('http://www.lastcraft.com/test/network_confirm.php', array("a" => "aaa")); $this->assertWantedPattern('/Request method.*?
POST<\/dd>/'); $this->assertWantedText('a=[aaa]'); } function testRelativeGet() { $this->get('http://www.lastcraft.com/test/link_confirm.php'); $this->assertTrue($this->get('network_confirm.php')); $this->assertWantedText('target for the SimpleTest'); } function testRelativePost() { $this->post('http://www.lastcraft.com/test/link_confirm.php'); $this->assertTrue($this->post('network_confirm.php')); $this->assertWantedText('target for the SimpleTest'); } function testAbsoluteLinkFollowing() { $this->get('http://www.lastcraft.com/test/link_confirm.php'); $this->assertLink('Absolute'); $this->assertTrue($this->clickLink('Absolute')); $this->assertWantedText('target for the SimpleTest'); } function testRelativeLinkFollowing() { $this->get('http://www.lastcraft.com/test/link_confirm.php'); $this->assertTrue($this->clickLink('Relative')); $this->assertWantedText('target for the SimpleTest'); } function testLinkIdFollowing() { $this->get('http://www.lastcraft.com/test/link_confirm.php'); $this->assertLinkById(1); $this->assertTrue($this->clickLinkById(1)); $this->assertWantedText('target for the SimpleTest'); } function testAbsoluteUrlBehavesAbsolutely() { $this->get('http://www.lastcraft.com/test/link_confirm.php'); $this->get('http://www.lastcraft.com'); $this->assertWantedText('No guarantee of quality is given or even intended'); } } class TestOfLivePageLinkingWithMinimalLinks extends WebTestCase { function setUp() { $this->addHeader('User-Agent: SimpleTest ' . SimpleTestOptions::getVersion()); } function testClickToExplicitelyNamedSelfReturns() { $this->get('http://www.lastcraft.com/test/front_controller_style/a_page.php'); $this->assertTrue($this->getUrl() == 'http://www.lastcraft.com/test/front_controller_style/a_page.php'); $this->assertTitle('Simple test page with links'); $this->clickLink('Self'); $this->assertTitle('Simple test page with links'); } function testClickToMissingPageReturnsToSamePage() { $this->get('http://www.lastcraft.com/test/front_controller_style/a_page.php'); $this->clickLink('No page'); $this->assertTitle('Simple test page with links'); $this->assertWantedText('[action=no_page]'); } function testClickToBareActionReturnsToSamePage() { $this->get('http://www.lastcraft.com/test/front_controller_style/a_page.php'); $this->clickLink('Bare action'); $this->assertTitle('Simple test page with links'); $this->assertWantedText('[action=]'); } function testClickToSingleQuestionMarkReturnsToSamePage() { $this->get('http://www.lastcraft.com/test/front_controller_style/a_page.php'); $this->clickLink('Empty query'); $this->assertTitle('Simple test page with links'); } function testClickToEmptyStringReturnsToSamePage() { $this->get('http://www.lastcraft.com/test/front_controller_style/a_page.php'); $this->clickLink('Empty link'); $this->assertTitle('Simple test page with links'); } function testClickToSingleDotGoesToCurrentDirectory() { $this->get('http://www.lastcraft.com/test/front_controller_style/a_page.php'); $this->clickLink('Current directory'); $this->assertTitle('Simple test front controller'); } function testClickBackADirectoryLevel() { $this->get('http://www.lastcraft.com/test/front_controller_style/'); $this->clickLink('Down one'); $this->assertWantedText('Index of /test'); } } class TestOfLiveFrontControllerEmulation extends WebTestCase { function setUp() { $this->addHeader('User-Agent: SimpleTest ' . SimpleTestOptions::getVersion()); } function testJumpToNamedPage() { $this->get('http://www.lastcraft.com/test/front_controller_style/'); $this->assertWantedText('Simple test front controller'); $this->clickLink('Index'); $this->assertResponse(200); $this->assertWantedText('[action=index]'); } function testJumpToUnnamedPage() { $this->get('http://www.lastcraft.com/test/front_controller_style/'); $this->clickLink('No page'); $this->assertResponse(200); $this->assertWantedText('Simple test front controller'); $this->assertWantedText('[action=no_page]'); } function testJumpToUnnamedPageWithBareParameter() { $this->get('http://www.lastcraft.com/test/front_controller_style/'); $this->clickLink('Bare action'); $this->assertResponse(200); $this->assertWantedText('Simple test front controller'); $this->assertWantedText('[action=]'); } function testJumpToUnnamedPageWithEmptyQuery() { $this->get('http://www.lastcraft.com/test/front_controller_style/'); $this->clickLink('Empty query'); $this->assertResponse(200); $this->assertWantedPattern('/Simple test front controller/'); $this->assertWantedPattern('/raw get data.*?\[\].*?get data/si'); } function testJumpToUnnamedPageWithEmptyLink() { $this->get('http://www.lastcraft.com/test/front_controller_style/'); $this->clickLink('Empty link'); $this->assertResponse(200); $this->assertWantedPattern('/Simple test front controller/'); $this->assertWantedPattern('/raw get data.*?\[\].*?get data/si'); } function testJumpBackADirectoryLevel() { $this->get('http://www.lastcraft.com/test/front_controller_style/'); $this->clickLink('Down one'); $this->assertWantedText('Index of /test'); } function testSubmitToNamedPage() { $this->get('http://www.lastcraft.com/test/front_controller_style/'); $this->assertWantedText('Simple test front controller'); $this->clickSubmit('Index'); $this->assertResponse(200); $this->assertWantedText('[action=Index]'); } function testSubmitToSameDirectory() { $this->get('http://www.lastcraft.com/test/front_controller_style/index.php'); $this->clickSubmit('Same directory'); $this->assertResponse(200); $this->assertWantedText('[action=Same+directory]'); } function testSubmitToEmptyAction() { $this->get('http://www.lastcraft.com/test/front_controller_style/index.php'); $this->clickSubmit('Empty action'); $this->assertResponse(200); $this->assertWantedText('[action=Empty+action]'); } function testSubmitToNoAction() { $this->get('http://www.lastcraft.com/test/front_controller_style/index.php'); $this->clickSubmit('No action'); $this->assertResponse(200); $this->assertWantedText('[action=No+action]'); } function testSubmitBackADirectoryLevel() { $this->get('http://www.lastcraft.com/test/front_controller_style/'); $this->clickSubmit('Down one'); $this->assertWantedText('Index of /test'); } } class TestOfLiveHeaders extends WebTestCase { function setUp() { $this->addHeader('User-Agent: SimpleTest ' . SimpleTestOptions::getVersion()); } function testConfirmingHeaderExistence() { $this->get('http://www.lastcraft.com/'); $this->assertHeader('content-type'); $this->assertHeader('content-type', 'text/html'); $this->assertHeaderPattern('content-type', '/HTML/i'); $this->assertNoUnwantedHeader('WWW-Authenticate'); } } class TestOfLiveRedirects extends WebTestCase { function setUp() { $this->addHeader('User-Agent: SimpleTest ' . SimpleTestOptions::getVersion()); } function testNoRedirects() { $this->setMaximumRedirects(0); $this->get('http://www.lastcraft.com/test/redirect.php'); $this->assertTitle('Redirection test'); } function testRedirects() { $this->setMaximumRedirects(1); $this->get('http://www.lastcraft.com/test/redirect.php'); $this->assertTitle('Simple test target file'); } function testRedirectLosesGetData() { $this->get('http://www.lastcraft.com/test/redirect.php', array('a' => 'aaa')); $this->assertNoUnwantedText('a=[aaa]'); } function testRedirectKeepsExtraRequestDataOfItsOwn() { $this->get('http://www.lastcraft.com/test/redirect.php'); $this->assertWantedText('r=[rrr]'); } function testRedirectLosesPostData() { $this->post('http://www.lastcraft.com/test/redirect.php', array('a' => 'aaa')); $this->assertTitle('Simple test target file'); $this->assertNoUnwantedText('a=[aaa]'); } function testRedirectWithBaseUrlChange() { $this->get('http://www.lastcraft.com/test/base_change_redirect.php'); $this->assertTitle('Simple test target file in folder'); $this->get('http://www.lastcraft.com/test/path/base_change_redirect.php'); $this->assertTitle('Simple test target file'); } function testRedirectWithDoubleBaseUrlChange() { $this->get('http://www.lastcraft.com/test/double_base_change_redirect.php'); $this->assertTitle('Simple test target file'); } } class TestOfLiveCookies extends WebTestCase { function setUp() { $this->addHeader('User-Agent: SimpleTest ' . SimpleTestOptions::getVersion()); } function testCookieSetting() { $this->setCookie('a', 'Test cookie a', 'www.lastcraft.com'); $this->setCookie('b', 'Test cookie b', 'www.lastcraft.com', 'test'); $this->get('http://www.lastcraft.com/test/network_confirm.php'); $this->assertWantedPattern('/Test cookie a/'); $this->assertWantedPattern('/Test cookie b/'); $this->assertCookie('a'); $this->assertCookie('b', 'Test cookie b'); $this->assertTrue($this->getCookie('a') == 'Test cookie a'); $this->assertTrue($this->getCookie('b') == 'Test cookie b'); } function testCookieReading() { $this->get('http://www.lastcraft.com/test/set_cookies.php'); $this->assertCookie('session_cookie', 'A'); $this->assertCookie('short_cookie', 'B'); $this->assertCookie('day_cookie', 'C'); } function testTemporaryCookieExpiry() { $this->get('http://www.lastcraft.com/test/set_cookies.php'); $this->restart(); $this->assertNoCookie('session_cookie'); $this->assertCookie('day_cookie', 'C'); } function testTimedCookieExpiry() { $this->get('http://www.lastcraft.com/test/set_cookies.php'); $this->ageCookies(3600); $this->restart(time() + 60); // Includes a 60 sec. clock drift margin. $this->assertNoCookie('session_cookie'); $this->assertNoCookie('hour_cookie'); $this->assertCookie('day_cookie', 'C'); } function testOfClockOverDrift() { $this->get('http://www.lastcraft.com/test/set_cookies.php'); $this->restart(time() + 160); // Allows sixty second drift. $this->assertNoCookie( 'short_cookie', '%s->Please check your computer clock setting if you are not using NTP'); } function testOfClockUnderDrift() { $this->get('http://www.lastcraft.com/test/set_cookies.php'); $this->restart(time() + 40); // Allows sixty second drift. $this->assertCookie( 'short_cookie', 'B', '%s->Please check your computer clock setting if you are not using NTP'); } function testCookiePath() { $this->get('http://www.lastcraft.com/test/set_cookies.php'); $this->assertNoCookie("path_cookie", "D"); $this->get('./path/show_cookies.php'); $this->assertWantedPattern('/path_cookie/'); $this->assertCookie("path_cookie", "D"); } } class TestOfLiveForms extends WebTestCase { function setUp() { $this->addHeader('User-Agent: SimpleTest ' . SimpleTestOptions::getVersion()); } function testSimpleSubmit() { $this->get('http://www.lastcraft.com/test/form.html'); $this->assertTrue($this->clickSubmit('Go!')); $this->assertWantedPattern('/Request method.*?
POST<\/dd>/'); $this->assertWantedText('go=[Go!]'); } function testDefaultFormValues() { $this->get('http://www.lastcraft.com/test/form.html'); $this->assertField('a', ''); $this->assertField('b', 'Default text'); $this->assertField('c', ''); $this->assertField('d', 'd1'); $this->assertField('e', false); $this->assertField('f', 'on'); $this->assertField('g', 'g3'); $this->assertField('h', 2); $this->assertField('go', 'Go!'); $this->assertTrue($this->clickSubmit('Go!')); $this->assertWantedText('go=[Go!]'); $this->assertWantedText('a=[]'); $this->assertWantedText('b=[Default text]'); $this->assertWantedText('c=[]'); $this->assertWantedText('d=[d1]'); $this->assertNoUnwantedText('e=['); $this->assertWantedText('f=[on]'); $this->assertWantedText('g=[g3]'); } function testFormSubmissionByLabel() { $this->get('http://www.lastcraft.com/test/form.html'); $this->setField('a', 'aaa'); $this->setField('b', 'bbb'); $this->setField('c', 'ccc'); $this->setField('d', 'D2'); $this->setField('e', 'on'); $this->setField('f', false); $this->setField('g', 'g2'); $this->setField('h', 1); $this->assertTrue($this->clickSubmit('Go!')); $this->assertWantedText('a=[aaa]'); $this->assertWantedText('b=[bbb]'); $this->assertWantedText('c=[ccc]'); $this->assertWantedText('d=[d2]'); $this->assertWantedText('e=[on]'); $this->assertNoUnwantedText('f=['); $this->assertWantedText('g=[g2]'); } function testAdditionalFormValues() { $this->get('http://www.lastcraft.com/test/form.html'); $this->assertTrue($this->clickSubmit('Go!', array('add' => 'A'))); $this->assertWantedText('go=[Go!]'); $this->assertWantedText('add=[A]'); } function testFormSubmissionByName() { $this->get('http://www.lastcraft.com/test/form.html'); $this->assertTrue($this->clickSubmitByName('go')); $this->assertWantedText('go=[Go!]'); } function testFormSubmissionByNameAndadditionalParameters() { $this->get('http://www.lastcraft.com/test/form.html'); $this->assertTrue($this->clickSubmitByName('go', array('add' => 'A'))); $this->assertWantedText('go=[Go!]'); $this->assertWantedText('add=[A]'); } function testFormSubmissionBySubmitButtonLabeledSubmit() { $this->get('http://www.lastcraft.com/test/form.html'); $this->assertTrue($this->clickSubmitByName('test')); $this->assertWantedText('test=[Submit]'); } function testFormSubmissionWithIds() { $this->get('http://www.lastcraft.com/test/form.html'); $this->assertFieldById(1, ''); $this->assertFieldById(2, 'Default text'); $this->assertFieldById(3, ''); $this->assertFieldById(4, 'd1'); $this->assertFieldById(5, false); $this->setFieldById(1, 'aaa'); $this->setFieldById(2, 'bbb'); $this->setFieldById(3, 'ccc'); $this->setFieldById(4, 'D2'); $this->setFieldById(5, 'on'); $this->assertTrue($this->clickSubmitById(99)); $this->assertWantedText('a=[aaa]'); $this->assertWantedText('b=[bbb]'); $this->assertWantedText('c=[ccc]'); $this->assertWantedText('d=[d2]'); $this->assertWantedText('e=[on]'); $this->assertWantedText('go=[Go!]'); } function testImageSubmissionByLabel() { $this->get('http://www.lastcraft.com/test/form.html'); $this->assertTrue($this->clickImage('Image go!', 10, 12)); $this->assertWantedText('go_x=[10]'); $this->assertWantedText('go_y=[12]'); } function testImageSubmissionByLabelWithAdditionalParameters() { $this->get('http://www.lastcraft.com/test/form.html'); $this->assertTrue($this->clickImage('Image go!', 10, 12, array('add' => 'A'))); $this->assertWantedText('add=[A]'); } function testImageSubmissionByName() { $this->get('http://www.lastcraft.com/test/form.html'); $this->assertTrue($this->clickImageByName('go', 10, 12)); $this->assertWantedText('go_x=[10]'); $this->assertWantedText('go_y=[12]'); } function testImageSubmissionById() { $this->get('http://www.lastcraft.com/test/form.html'); $this->assertTrue($this->clickImageById(97, 10, 12)); $this->assertWantedText('go_x=[10]'); $this->assertWantedText('go_y=[12]'); } function testButtonSubmissionByLabel() { $this->get('http://www.lastcraft.com/test/form.html'); $this->assertTrue($this->clickSubmit('Button go!', 10, 12)); $this->assertWantedPattern('/go=\[ButtonGo\]/s'); } function testSelfSubmit() { $this->get('http://www.lastcraft.com/test/self_form.php'); $this->assertNoUnwantedPattern('/

submitted<\/p>/i'); $this->assertNoUnwantedPattern('/

wrong form<\/p>/i'); $this->assertTitle('Test of form self submission'); $this->assertTrue($this->clickSubmit()); $this->assertWantedPattern('/

submitted<\/p>/i'); $this->assertNoUnwantedPattern('/

wrong form<\/p>/i'); $this->assertTitle('Test of form self submission'); } function testSettingOfBlankOption() { $this->get('http://www.lastcraft.com/test/form.html'); $this->assertTrue($this->setField('d', '')); $this->clickSubmit('Go!'); $this->assertWantedText('d=[]'); } } class TestOfLiveMultiValueWidgets extends WebTestCase { function setUp() { $this->addHeader('User-Agent: SimpleTest ' . SimpleTestOptions::getVersion()); } function testDefaultFormValueSubmission() { $this->get('http://www.lastcraft.com/test/multiple_widget_form.html'); $this->assertField('a', array('a2', 'a3')); $this->assertField('b', array('b2', 'b3')); $this->assertField('c[]', array('c2', 'c3')); $this->assertTrue($this->clickSubmit('Go!')); $this->assertWantedText('a=[a2, a3]'); $this->assertWantedText('b=[b2, b3]'); $this->assertWantedText('c=[c2, c3]'); } function testSubmittingMultipleValues() { $this->get('http://www.lastcraft.com/test/multiple_widget_form.html'); $this->setField('a', array('a1', 'a4')); $this->assertField('a', array('a1', 'a4')); $this->assertField('a', array('a4', 'a1')); $this->setField('b', array('b1', 'b4')); $this->assertField('b', array('b1', 'b4')); $this->setField('c[]', array('c1', 'c4')); $this->assertField('c[]', array('c1', 'c4')); $this->assertTrue($this->clickSubmit('Go!')); $this->assertWantedText('a=[a1, a4]'); $this->assertWantedText('b=[b1, b4]'); $this->assertWantedText('c=[c1, c4]'); } function testSavantStyleHiddenFieldDefaults() { $this->get('http://www.lastcraft.com/test/savant_style_form.html'); $this->assertField('a', array('a0')); $this->assertField('b', array('b0')); $this->assertTrue($this->clickSubmit('Go!')); $this->assertWantedText('a=[a0]'); $this->assertWantedText('b=[b0]'); } function testSavantStyleHiddenDefaultsAreOverridden() { $this->get('http://www.lastcraft.com/test/savant_style_form.html'); $this->assertTrue($this->setField('a', array('a1'))); $this->assertTrue($this->setField('b', 'b1')); $this->assertTrue($this->clickSubmit('Go!')); $this->assertWantedText('a=[a1]'); $this->assertWantedText('b=[b1]'); } function testSavantStyleFormSettingById() { $this->get('http://www.lastcraft.com/test/savant_style_form.html'); $this->assertFieldById(1, array('a0')); $this->assertFieldById(4, array('b0')); $this->assertTrue($this->setFieldById(2, 'a1')); $this->assertTrue($this->setFieldById(5, 'b1')); $this->assertTrue($this->clickSubmitById(99)); $this->assertWantedText('a=[a1]'); $this->assertWantedText('b=[b1]'); } } class TestOfLiveHistoryNavigation extends WebTestCase { function setUp() { $this->addHeader('User-Agent: SimpleTest ' . SimpleTestOptions::getVersion()); } function testRetry() { $this->get('http://www.lastcraft.com/test/cookie_based_counter.php'); $this->assertWantedPattern('/count: 1/i'); $this->retry(); $this->assertWantedPattern('/count: 2/i'); $this->retry(); $this->assertWantedPattern('/count: 3/i'); } function testOfBackButton() { $this->get('http://www.lastcraft.com/test/1.html'); $this->clickLink('2'); $this->assertTitle('2'); $this->assertTrue($this->back()); $this->assertTitle('1'); $this->assertTrue($this->forward()); $this->assertTitle('2'); $this->assertFalse($this->forward()); } function testGetRetryResubmitsData() { $this->assertTrue($this->get( 'http://www.lastcraft.com/test/network_confirm.php?a=aaa')); $this->assertWantedPattern('/Request method.*?

GET<\/dd>/'); $this->assertWantedText('a=[aaa]'); $this->retry(); $this->assertWantedPattern('/Request method.*?
GET<\/dd>/'); $this->assertWantedText('a=[aaa]'); } function testGetRetryResubmitsExtraData() { $this->assertTrue($this->get( 'http://www.lastcraft.com/test/network_confirm.php', array('a' => 'aaa'))); $this->assertWantedPattern('/Request method.*?
GET<\/dd>/'); $this->assertWantedText('a=[aaa]'); $this->retry(); $this->assertWantedPattern('/Request method.*?
GET<\/dd>/'); $this->assertWantedText('a=[aaa]'); } function testPostRetryResubmitsData() { $this->assertTrue($this->post( 'http://www.lastcraft.com/test/network_confirm.php', array('a' => 'aaa'))); $this->assertWantedPattern('/Request method.*?
POST<\/dd>/'); $this->assertWantedText('a=[aaa]'); $this->retry(); $this->assertWantedPattern('/Request method.*?
POST<\/dd>/'); $this->assertWantedText('a=[aaa]'); } function testGetRetryResubmitsRepeatedData() { $this->assertTrue($this->get( 'http://www.lastcraft.com/test/network_confirm.php?a=1&a=2')); $this->assertWantedPattern('/Request method.*?
GET<\/dd>/'); $this->assertWantedText('a=[1, 2]'); $this->retry(); $this->assertWantedPattern('/Request method.*?
GET<\/dd>/'); $this->assertWantedText('a=[1, 2]'); } } class TestOfLiveAuthentication extends WebTestCase { function setUp() { $this->addHeader('User-Agent: SimpleTest ' . SimpleTestOptions::getVersion()); } function testChallengeFromProtectedPage() { $this->get('http://www.lastcraft.com/test/protected/'); $this->assertResponse(401); $this->assertAuthentication('Basic'); $this->assertRealm('SimpleTest basic authentication'); $this->authenticate('test', 'secret'); $this->assertResponse(200); $this->retry(); $this->assertResponse(200); } function testEncodedAuthenticationFetchesPage() { $this->get('http://test:secret@www.lastcraft.com/test/protected/'); $this->assertResponse(200); } function testRealmExtendsToWholeDirectory() { $this->get('http://www.lastcraft.com/test/protected/1.html'); $this->authenticate('test', 'secret'); $this->clickLink('2'); $this->assertResponse(200); $this->clickLink('3'); $this->assertResponse(200); } function testRedirectKeepsAuthentication() { $this->get('http://www.lastcraft.com/test/protected/local_redirect.php'); $this->authenticate('test', 'secret'); $this->assertTitle('Simple test target file'); } function testSessionRestartLosesAuthentication() { $this->get('http://www.lastcraft.com/test/protected/'); $this->authenticate('test', 'secret'); $this->assertResponse(200); $this->restart(); $this->get('http://www.lastcraft.com/test/protected/'); $this->assertResponse(401); } } class TestOfLoadingFrames extends WebTestCase { function setUp() { $this->addHeader('User-Agent: SimpleTest ' . SimpleTestOptions::getVersion()); } function testNoFramesContentWhenFramesDisabled() { $this->ignoreFrames(); $this->get('http://www.lastcraft.com/test/one_page_frameset.html'); $this->assertTitle('Frameset for testing of SimpleTest'); $this->assertWantedText('This content is for no frames only'); } function testPatternMatchCanReadTheOnlyFrame() { $this->get('http://www.lastcraft.com/test/one_page_frameset.html'); $this->assertWantedText('A target for the SimpleTest test suite'); $this->assertNoUnwantedText('This content is for no frames only'); } function testMessyFramesetResponsesByName() { $this->assertTrue($this->get( 'http://www.lastcraft.com/test/messy_frameset.html')); $this->assertTitle('Frameset for testing of SimpleTest'); $this->assertTrue($this->setFrameFocus('Front controller')); $this->assertResponse(200); $this->assertWantedText('Simple test front controller'); $this->assertTrue($this->setFrameFocus('One')); $this->assertResponse(200); $this->assertLink('2'); $this->assertTrue($this->setFrameFocus('Frame links')); $this->assertResponse(200); $this->assertLink('Set one to 2'); $this->assertTrue($this->setFrameFocus('Counter')); $this->assertResponse(200); $this->assertWantedText('Count: 1'); $this->assertTrue($this->setFrameFocus('Redirected')); $this->assertResponse(200); $this->assertWantedText('r=rrr'); $this->assertTrue($this->setFrameFocus('Protected')); $this->assertResponse(401); $this->assertTrue($this->setFrameFocus('Protected redirect')); $this->assertResponse(401); $this->assertTrue($this->setFrameFocusByIndex(1)); $this->assertResponse(200); $this->assertWantedText('Simple test front controller'); $this->assertTrue($this->setFrameFocusByIndex(2)); $this->assertResponse(200); $this->assertLink('2'); $this->assertTrue($this->setFrameFocusByIndex(3)); $this->assertResponse(200); $this->assertLink('Set one to 2'); $this->assertTrue($this->setFrameFocusByIndex(4)); $this->assertResponse(200); $this->assertWantedTExt('Count: 1'); $this->assertTrue($this->setFrameFocusByIndex(5)); $this->assertResponse(200); $this->assertWantedText('r=rrr'); $this->assertTrue($this->setFrameFocusByIndex(6)); $this->assertResponse(401); $this->assertTrue($this->setFrameFocusByIndex(7)); } function testReloadingFramesetPage() { $this->get('http://www.lastcraft.com/test/messy_frameset.html'); $this->assertWantedText('Count: 1'); $this->retry(); $this->assertWantedText('Count: 2'); $this->retry(); $this->assertWantedText('Count: 3'); } function testReloadingSingleFrameWithCookieCounter() { $this->get('http://www.lastcraft.com/test/counting_frameset.html'); $this->setFrameFocus('a'); $this->assertWantedText('Count: 1'); $this->setFrameFocus('b'); $this->assertWantedText('Count: 2'); $this->setFrameFocus('a'); $this->retry(); $this->assertWantedText('Count: 3'); $this->retry(); $this->assertWantedText('Count: 4'); $this->setFrameFocus('b'); $this->assertWantedText('Count: 2'); } function testReloadingFrameWhenUnfocusedReloadsWholeFrameset() { $this->get('http://www.lastcraft.com/test/counting_frameset.html'); $this->setFrameFocus('a'); $this->assertWantedText('Count: 1'); $this->setFrameFocus('b'); $this->assertWantedText('Count: 2'); $this->clearFrameFocus('a'); $this->retry(); $this->assertTitle('Frameset for testing of SimpleTest'); $this->setFrameFocus('a'); $this->assertWantedText('Count: 3'); $this->setFrameFocus('b'); $this->assertWantedText('Count: 4'); } function testClickingNormalLinkReplacesJustThatFrame() { $this->get('http://www.lastcraft.com/test/messy_frameset.html'); $this->clickLink('2'); $this->assertLink('3'); $this->assertWantedText('Simple test front controller'); } function testJumpToNamedPageReplacesJustThatFrame() { $this->get('http://www.lastcraft.com/test/messy_frameset.html'); $this->assertWantedPattern('/Simple test front controller/'); $this->clickLink('Index'); $this->assertResponse(200); $this->assertWantedText('[action=index]'); $this->assertWantedText('Count: 1'); } function testJumpToUnnamedPageReplacesJustThatFrame() { $this->get('http://www.lastcraft.com/test/messy_frameset.html'); $this->clickLink('No page'); $this->assertResponse(200); $this->assertWantedText('Simple test front controller'); $this->assertWantedText('[action=no_page]'); $this->assertWantedText('Count: 1'); } function testJumpToUnnamedPageWithBareParameterReplacesJustThatFrame() { $this->get('http://www.lastcraft.com/test/messy_frameset.html'); $this->clickLink('Bare action'); $this->assertResponse(200); $this->assertWantedText('Simple test front controller'); $this->assertWantedText('[action=]'); $this->assertWantedText('Count: 1'); } function testJumpToUnnamedPageWithEmptyQueryReplacesJustThatFrame() { $this->get('http://www.lastcraft.com/test/messy_frameset.html'); $this->clickLink('Empty query'); $this->assertResponse(200); $this->assertWantedPattern('/Simple test front controller/'); $this->assertWantedPattern('/raw get data.*?\[\].*?get data/si'); $this->assertWantedPattern('/Count: 1/'); } function testJumpToUnnamedPageWithEmptyLinkReplacesJustThatFrame() { $this->get('http://www.lastcraft.com/test/messy_frameset.html'); $this->clickLink('Empty link'); $this->assertResponse(200); $this->assertWantedPattern('/Simple test front controller/'); $this->assertWantedPattern('/raw get data.*?\[\].*?get data/si'); $this->assertWantedPattern('/Count: 1/'); } function testJumpBackADirectoryLevelReplacesJustThatFrame() { $this->get('http://www.lastcraft.com/test/messy_frameset.html'); $this->clickLink('Down one'); $this->assertWantedPattern('/index of \/test/i'); $this->assertWantedPattern('/Count: 1/'); } function testSubmitToNamedPageReplacesJustThatFrame() { $this->get('http://www.lastcraft.com/test/messy_frameset.html'); $this->assertWantedPattern('/Simple test front controller/'); $this->clickSubmit('Index'); $this->assertResponse(200); $this->assertWantedText('[action=Index]'); $this->assertWantedText('Count: 1'); } function testSubmitToSameDirectoryReplacesJustThatFrame() { $this->get('http://www.lastcraft.com/test/messy_frameset.html'); $this->clickSubmit('Same directory'); $this->assertResponse(200); $this->assertWantedText('[action=Same+directory]'); $this->assertWantedText('Count: 1'); } function testSubmitToEmptyActionReplacesJustThatFrame() { $this->get('http://www.lastcraft.com/test/messy_frameset.html'); $this->clickSubmit('Empty action'); $this->assertResponse(200); $this->assertWantedText('[action=Empty+action]'); $this->assertWantedText('Count: 1'); } function testSubmitToNoActionReplacesJustThatFrame() { $this->get('http://www.lastcraft.com/test/messy_frameset.html'); $this->clickSubmit('No action'); $this->assertResponse(200); $this->assertWantedText('[action=No+action]'); $this->assertWantedText('Count: 1'); } function testSubmitBackADirectoryLevelReplacesJustThatFrame() { $this->get('http://www.lastcraft.com/test/messy_frameset.html'); $this->clickSubmit('Down one'); $this->assertWantedPattern('/index of \/test/i'); $this->assertWantedPattern('/Count: 1/'); } function testTopLinkExitsFrameset() { $this->get('http://www.lastcraft.com/test/messy_frameset.html'); $this->clickLink('Exit the frameset'); $this->assertTitle('Simple test target file'); } function testLinkInOnePageCanLoadAnother() { $this->get('http://www.lastcraft.com/test/messy_frameset.html'); $this->assertNoLink('3'); $this->clickLink('Set one to 2'); $this->assertLink('3'); $this->assertNoLink('2'); $this->assertTitle('Frameset for testing of SimpleTest'); } } class TestOfFrameAuthentication extends WebTestCase { function testUnauthenticatedFrameSendsChallenge() { $this->get('http://www.lastcraft.com/test/protected/'); $this->setFrameFocus('Protected'); $this->assertAuthentication('Basic'); $this->assertRealm('SimpleTest basic authentication'); $this->assertResponse(401); } function testCanReadFrameFromAlreadyAuthenticatedRealm() { $this->get('http://www.lastcraft.com/test/protected/'); $this->authenticate('test', 'secret'); $this->get('http://www.lastcraft.com/test/messy_frameset.html'); $this->setFrameFocus('Protected'); $this->assertResponse(200); $this->assertWantedText('A target for the SimpleTest test suite'); } function testCanAuthenticateFrame() { $this->get('http://www.lastcraft.com/test/messy_frameset.html'); $this->setFrameFocus('Protected'); $this->authenticate('test', 'secret'); $this->assertResponse(200); $this->assertWantedText('A target for the SimpleTest test suite'); $this->clearFrameFocus(); $this->assertWantedText('Count: 1'); } function testCanAuthenticateRedirectedFrame() { $this->get('http://www.lastcraft.com/test/messy_frameset.html'); $this->setFrameFocus('Protected redirect'); $this->assertResponse(401); $this->authenticate('test', 'secret'); $this->assertResponse(200); $this->assertWantedText('A target for the SimpleTest test suite'); $this->clearFrameFocus(); $this->assertWantedText('Count: 1'); } } class TestOfNestedFrames extends WebTestCase { function testCanNavigateToSpecificContent() { $this->get('http://www.lastcraft.com/test/nested_frameset.html'); $this->assertTitle('Nested frameset for testing of SimpleTest'); $this->assertWantedPattern('/This is frame A/'); $this->assertWantedPattern('/This is frame B/'); $this->assertWantedPattern('/Simple test front controller/'); $this->assertLink('2'); $this->assertLink('Set one to 2'); $this->assertWantedPattern('/Count: 1/'); $this->assertWantedPattern('/r=rrr/'); $this->setFrameFocus('pair'); $this->assertWantedPattern('/This is frame A/'); $this->assertWantedPattern('/This is frame B/'); $this->assertNoUnwantedPattern('/Simple test front controller/'); $this->assertNoLink('2'); $this->setFrameFocus('aaa'); $this->assertWantedPattern('/This is frame A/'); $this->assertNoUnwantedPattern('/This is frame B/'); $this->clearFrameFocus(); $this->assertResponse(200); $this->setFrameFocus('messy'); $this->assertResponse(200); $this->setFrameFocus('Front controller'); $this->assertResponse(200); $this->assertWantedPattern('/Simple test front controller/'); $this->assertNoLink('2'); } function testReloadingFramesetPage() { $this->get('http://www.lastcraft.com/test/nested_frameset.html'); $this->assertWantedPattern('/Count: 1/'); $this->retry(); $this->assertWantedPattern('/Count: 2/'); $this->retry(); $this->assertWantedPattern('/Count: 3/'); } function testRetryingNestedPageOnlyRetriesThatSet() { $this->get('http://www.lastcraft.com/test/nested_frameset.html'); $this->assertWantedPattern('/Count: 1/'); $this->setFrameFocus('messy'); $this->retry(); $this->assertWantedPattern('/Count: 2/'); $this->setFrameFocus('Counter'); $this->retry(); $this->assertWantedPattern('/Count: 3/'); $this->clearFrameFocus(); $this->setFrameFocus('messy'); $this->setFrameFocus('Front controller'); $this->retry(); $this->clearFrameFocus(); $this->assertWantedPattern('/Count: 3/'); } function testAuthenticatingNestedPage() { $this->get('http://www.lastcraft.com/test/nested_frameset.html'); $this->setFrameFocus('messy'); $this->setFrameFocus('Protected'); $this->assertAuthentication('Basic'); $this->assertRealm('SimpleTest basic authentication'); $this->assertResponse(401); $this->authenticate('test', 'secret'); $this->assertResponse(200); $this->assertWantedPattern('/A target for the SimpleTest test suite/'); } } ?>pgfouine-1.2/tests/simpletest/test/tag_test.php0000644000175000017500000004652610334504436020440 0ustar acmeacme '1', 'b' => '')); $this->assertEqual($tag->getTagName(), 'title'); $this->assertIdentical($tag->getAttribute('a'), '1'); $this->assertIdentical($tag->getAttribute('b'), true); $this->assertIdentical($tag->getAttribute('c'), false); $this->assertIdentical($tag->getContent(), ''); } function testTitleContent() { $tag = &new SimpleTitleTag(array()); $this->assertTrue($tag->expectEndTag()); $tag->addContent('Hello'); $tag->addContent('World'); $this->assertEqual($tag->getText(), 'HelloWorld'); } function testMessyTitleContent() { $tag = &new SimpleTitleTag(array()); $this->assertTrue($tag->expectEndTag()); $tag->addContent('Hello'); $tag->addContent('World'); $this->assertEqual($tag->getText(), 'HelloWorld'); } function testTagWithNoEnd() { $tag = &new SimpleTextTag(array()); $this->assertFalse($tag->expectEndTag()); } function testAnchorHref() { $tag = &new SimpleAnchorTag(array('href' => 'http://here/')); $this->assertEqual($tag->getHref(), 'http://here/'); $tag = &new SimpleAnchorTag(array('href' => '')); $this->assertIdentical($tag->getAttribute('href'), true); $this->assertIdentical($tag->getHref(), ''); $tag = &new SimpleAnchorTag(array()); $this->assertIdentical($tag->getAttribute('href'), false); $this->assertIdentical($tag->getHref(), ''); } function testIsIdMatchesIdAttribute() { $tag = &new SimpleAnchorTag(array('href' => 'http://here/', 'id' => 7)); $this->assertIdentical($tag->getAttribute('id'), '7'); $this->assertTrue($tag->isId(7)); } } class TestOfWidget extends UnitTestCase { function testTextEmptyDefault() { $tag = &new SimpleTextTag(array('' => 'text')); $this->assertIdentical($tag->getDefault(), ''); $this->assertIdentical($tag->getValue(), ''); } function testTextDefault() { $tag = &new SimpleTextTag(array('value' => 'aaa')); $this->assertEqual($tag->getDefault(), 'aaa'); $this->assertEqual($tag->getValue(), 'aaa'); } function testSettingTextValue() { $tag = &new SimpleTextTag(array('value' => 'aaa')); $tag->setValue('bbb'); $this->assertEqual($tag->getValue(), 'bbb'); $tag->resetValue(); $this->assertEqual($tag->getValue(), 'aaa'); } function testFailToSetHiddenValue() { $tag = &new SimpleTextTag(array('value' => 'aaa', 'type' => 'hidden')); $this->assertFalse($tag->setValue('bbb')); $this->assertEqual($tag->getValue(), 'aaa'); } function testSubmitDefaults() { $tag = &new SimpleSubmitTag(array('type' => 'submit')); $this->assertEqual($tag->getName(), 'submit'); $this->assertEqual($tag->getValue(), 'Submit'); $this->assertFalse($tag->setValue('Cannot set this')); $this->assertEqual($tag->getValue(), 'Submit'); $this->assertEqual($tag->getLabel(), 'Submit'); $this->assertEqual($tag->getSubmitValues(), array('submit' => 'Submit')); } function testPopulatedSubmit() { $tag = &new SimpleSubmitTag( array('type' => 'submit', 'name' => 's', 'value' => 'Ok!')); $this->assertEqual($tag->getName(), 's'); $this->assertEqual($tag->getValue(), 'Ok!'); $this->assertEqual($tag->getLabel(), 'Ok!'); $this->assertEqual($tag->getSubmitValues(), array('s' => 'Ok!')); } function testImageSubmit() { $tag = &new SimpleImageSubmitTag( array('type' => 'image', 'name' => 's', 'alt' => 'Label')); $this->assertEqual($tag->getName(), 's'); $this->assertEqual($tag->getLabel(), 'Label'); $this->assertEqual( $tag->getSubmitValues(20, 30), array('s.x' => 20, 's.y' => 30)); } function testImageSubmitTitlePreferredOverAltForLabel() { $tag = &new SimpleImageSubmitTag( array('type' => 'image', 'name' => 's', 'alt' => 'Label', 'title' => 'Title')); $this->assertEqual($tag->getLabel(), 'Title'); } function testButton() { $tag = &new SimpleButtonTag( array('type' => 'submit', 'name' => 's', 'value' => 'do')); $tag->addContent('I am a button'); $this->assertEqual($tag->getName(), 's'); $this->assertEqual($tag->getValue(), 'do'); $this->assertEqual($tag->getLabel(), 'I am a button'); $this->assertEqual($tag->getSubmitValues(), array('s' => 'do')); } } class TestOfTextArea extends UnitTestCase { function testDefault() { $tag = &new SimpleTextAreaTag(array('name' => 'a')); $tag->addContent('Some text'); $this->assertEqual($tag->getName(), 'a'); $this->assertEqual($tag->getDefault(), 'Some text'); } function testWrapping() { $tag = &new SimpleTextAreaTag(array('cols' => '10', 'wrap' => 'physical')); $tag->addContent("Lot's of text that should be wrapped"); $this->assertEqual( $tag->getDefault(), "Lot's of\ntext that\nshould be\nwrapped"); $tag->setValue("New long text\nwith two lines"); $this->assertEqual( $tag->getValue(), "New long\ntext\nwith two\nlines"); } } class TestOfSelection extends UnitTestCase { function testEmpty() { $tag = &new SimpleSelectionTag(array('name' => 'a')); $this->assertIdentical($tag->getValue(), ''); } function testSingle() { $tag = &new SimpleSelectionTag(array('name' => 'a')); $option = &new SimpleOptionTag(array()); $option->addContent('AAA'); $tag->addTag($option); $this->assertEqual($tag->getValue(), 'AAA'); } function testSingleDefault() { $tag = &new SimpleSelectionTag(array('name' => 'a')); $option = &new SimpleOptionTag(array('selected' => '')); $option->addContent('AAA'); $tag->addTag($option); $this->assertEqual($tag->getValue(), 'AAA'); } function testSingleMappedDefault() { $tag = &new SimpleSelectionTag(array('name' => 'a')); $option = &new SimpleOptionTag(array('selected' => '', 'value' => 'aaa')); $option->addContent('AAA'); $tag->addTag($option); $this->assertEqual($tag->getValue(), 'aaa'); } function testStartsWithDefault() { $tag = &new SimpleSelectionTag(array('name' => 'a')); $a = &new SimpleOptionTag(array()); $a->addContent('AAA'); $tag->addTag($a); $b = &new SimpleOptionTag(array('selected' => '')); $b->addContent('BBB'); $tag->addTag($b); $c = &new SimpleOptionTag(array()); $c->addContent('CCC'); $tag->addTag($c); $this->assertEqual($tag->getValue(), 'BBB'); } function testSettingOption() { $tag = &new SimpleSelectionTag(array('name' => 'a')); $a = &new SimpleOptionTag(array()); $a->addContent('AAA'); $tag->addTag($a); $b = &new SimpleOptionTag(array('selected' => '')); $b->addContent('BBB'); $tag->addTag($b); $c = &new SimpleOptionTag(array()); $c->addContent('CCC'); $tag->setValue('AAA'); $this->assertEqual($tag->getValue(), 'AAA'); } function testSettingMappedOption() { $tag = &new SimpleSelectionTag(array('name' => 'a')); $a = &new SimpleOptionTag(array('value' => 'aaa')); $a->addContent('AAA'); $tag->addTag($a); $b = &new SimpleOptionTag(array('value' => 'bbb', 'selected' => '')); $b->addContent('BBB'); $tag->addTag($b); $c = &new SimpleOptionTag(array('value' => 'ccc')); $c->addContent('CCC'); $tag->addTag($c); $tag->setValue('AAA'); $this->assertEqual($tag->getValue(), 'aaa'); } function testSelectionDespiteSpuriousWhitespace() { $tag = &new SimpleSelectionTag(array('name' => 'a')); $a = &new SimpleOptionTag(array()); $a->addContent(' AAA '); $tag->addTag($a); $b = &new SimpleOptionTag(array('selected' => '')); $b->addContent(' BBB '); $tag->addTag($b); $c = &new SimpleOptionTag(array()); $c->addContent(' CCC '); $tag->addTag($c); $this->assertEqual($tag->getValue(), ' BBB '); $tag->setValue('AAA'); $this->assertEqual($tag->getValue(), ' AAA '); } function testFailToSetIllegalOption() { $tag = &new SimpleSelectionTag(array('name' => 'a')); $a = &new SimpleOptionTag(array()); $a->addContent('AAA'); $tag->addTag($a); $b = &new SimpleOptionTag(array('selected' => '')); $b->addContent('BBB'); $tag->addTag($b); $c = &new SimpleOptionTag(array()); $c->addContent('CCC'); $tag->addTag($c); $this->assertFalse($tag->setValue('Not present')); $this->assertEqual($tag->getValue(), 'BBB'); } function testNastyOptionValuesThatLookLikeFalse() { $tag = &new SimpleSelectionTag(array('name' => 'a')); $a = &new SimpleOptionTag(array('value' => '1')); $a->addContent('One'); $tag->addTag($a); $b = &new SimpleOptionTag(array('value' => '0')); $b->addContent('Zero'); $tag->addTag($b); $this->assertIdentical($tag->getValue(), '1'); $tag->setValue('Zero'); $this->assertIdentical($tag->getValue(), '0'); } function testBlankOption() { $tag = &new SimpleSelectionTag(array('name' => 'A')); $a = &new SimpleOptionTag(array()); $tag->addTag($a); $b = &new SimpleOptionTag(array()); $b->addContent('b'); $tag->addTag($b); $this->assertIdentical($tag->getValue(), ''); $tag->setValue('b'); $this->assertIdentical($tag->getValue(), 'b'); $tag->setValue(''); $this->assertIdentical($tag->getValue(), ''); } function testMultipleDefaultWithNoSelections() { $tag = &new MultipleSelectionTag(array('name' => 'a', 'multiple' => '')); $a = &new SimpleOptionTag(array()); $a->addContent('AAA'); $tag->addTag($a); $b = &new SimpleOptionTag(array()); $b->addContent('BBB'); $tag->addTag($b); $this->assertIdentical($tag->getDefault(), array()); $this->assertIdentical($tag->getValue(), array()); } function testMultipleDefaultWithSelections() { $tag = &new MultipleSelectionTag(array('name' => 'a', 'multiple' => '')); $a = &new SimpleOptionTag(array('selected' => '')); $a->addContent('AAA'); $tag->addTag($a); $b = &new SimpleOptionTag(array('selected' => '')); $b->addContent('BBB'); $tag->addTag($b); $this->assertIdentical($tag->getDefault(), array('AAA', 'BBB')); $this->assertIdentical($tag->getValue(), array('AAA', 'BBB')); } function testSettingMultiple() { $tag = &new MultipleSelectionTag(array('name' => 'a', 'multiple' => '')); $a = &new SimpleOptionTag(array('selected' => '')); $a->addContent('AAA'); $tag->addTag($a); $b = &new SimpleOptionTag(array()); $b->addContent('BBB'); $tag->addTag($b); $c = &new SimpleOptionTag(array('selected' => '')); $c->addContent('CCC'); $tag->addTag($c); $this->assertIdentical($tag->getDefault(), array('AAA', 'CCC')); $this->assertTrue($tag->setValue(array('BBB', 'CCC'))); $this->assertIdentical($tag->getValue(), array('BBB', 'CCC')); $this->assertTrue($tag->setValue(array())); $this->assertIdentical($tag->getValue(), array()); } function testFailToSetIllegalOptionsInMultiple() { $tag = &new MultipleSelectionTag(array('name' => 'a', 'multiple' => '')); $a = &new SimpleOptionTag(array('selected' => '')); $a->addContent('AAA'); $tag->addTag($a); $b = &new SimpleOptionTag(array()); $b->addContent('BBB'); $tag->addTag($b); $this->assertFalse($tag->setValue(array('CCC'))); $this->assertTrue($tag->setValue(array('AAA', 'BBB'))); $this->assertFalse($tag->setValue(array('AAA', 'CCC'))); } } class TestOfRadioGroup extends UnitTestCase { function testEmptyGroup() { $group = &new SimpleRadioGroup(); $this->assertIdentical($group->getDefault(), false); $this->assertIdentical($group->getValue(), false); $this->assertFalse($group->setValue('a')); } function testReadingSingleButtonGroup() { $group = &new SimpleRadioGroup(); $group->addWidget(new SimpleRadioButtonTag( array('value' => 'A', 'checked' => ''))); $this->assertIdentical($group->getDefault(), 'A'); $this->assertIdentical($group->getValue(), 'A'); } function testReadingMultipleButtonGroup() { $group = &new SimpleRadioGroup(); $group->addWidget(new SimpleRadioButtonTag( array('value' => 'A'))); $group->addWidget(new SimpleRadioButtonTag( array('value' => 'B', 'checked' => ''))); $this->assertIdentical($group->getDefault(), 'B'); $this->assertIdentical($group->getValue(), 'B'); } function testFailToSetUnlistedValue() { $group = &new SimpleRadioGroup(); $group->addWidget(new SimpleRadioButtonTag(array('value' => 'z'))); $this->assertFalse($group->setValue('a')); $this->assertIdentical($group->getValue(), false); } function testSettingNewValueClearsTheOldOne() { $group = &new SimpleRadioGroup(); $group->addWidget(new SimpleRadioButtonTag( array('value' => 'A'))); $group->addWidget(new SimpleRadioButtonTag( array('value' => 'B', 'checked' => ''))); $this->assertTrue($group->setValue('A')); $this->assertIdentical($group->getValue(), 'A'); } function testIsIdMatchesAnyWidgetInSet() { $group = &new SimpleRadioGroup(); $group->addWidget(new SimpleRadioButtonTag( array('value' => 'A', 'id' => 'i1'))); $group->addWidget(new SimpleRadioButtonTag( array('value' => 'B', 'id' => 'i2'))); $this->assertFalse($group->isId('i0')); $this->assertTrue($group->isId('i1')); $this->assertTrue($group->isId('i2')); } } class TestOfTagGroup extends UnitTestCase { function testReadingMultipleCheckboxGroup() { $group = &new SimpleCheckboxGroup(); $group->addWidget(new SimpleCheckboxTag(array('value' => 'A'))); $group->addWidget(new SimpleCheckboxTag( array('value' => 'B', 'checked' => ''))); $this->assertIdentical($group->getDefault(), 'B'); $this->assertIdentical($group->getValue(), 'B'); } function testReadingMultipleUncheckedItems() { $group = &new SimpleCheckboxGroup(); $group->addWidget(new SimpleCheckboxTag(array('value' => 'A'))); $group->addWidget(new SimpleCheckboxTag(array('value' => 'B'))); $this->assertIdentical($group->getDefault(), false); $this->assertIdentical($group->getValue(), false); } function testReadingMultipleCheckedItems() { $group = &new SimpleCheckboxGroup(); $group->addWidget(new SimpleCheckboxTag( array('value' => 'A', 'checked' => ''))); $group->addWidget(new SimpleCheckboxTag( array('value' => 'B', 'checked' => ''))); $this->assertIdentical($group->getDefault(), array('A', 'B')); $this->assertIdentical($group->getValue(), array('A', 'B')); } function testSettingSingleValue() { $group = &new SimpleCheckboxGroup(); $group->addWidget(new SimpleCheckboxTag(array('value' => 'A'))); $group->addWidget(new SimpleCheckboxTag(array('value' => 'B'))); $this->assertTrue($group->setValue('A')); $this->assertIdentical($group->getValue(), 'A'); $this->assertTrue($group->setValue('B')); $this->assertIdentical($group->getValue(), 'B'); } function testSettingMultipleValues() { $group = &new SimpleCheckboxGroup(); $group->addWidget(new SimpleCheckboxTag(array('value' => 'A'))); $group->addWidget(new SimpleCheckboxTag(array('value' => 'B'))); $this->assertTrue($group->setValue(array('A', 'B'))); $this->assertIdentical($group->getValue(), array('A', 'B')); } function testSettingNoValue() { $group = &new SimpleCheckboxGroup(); $group->addWidget(new SimpleCheckboxTag(array('value' => 'A'))); $group->addWidget(new SimpleCheckboxTag(array('value' => 'B'))); $this->assertTrue($group->setValue(false)); $this->assertIdentical($group->getValue(), false); } function testIsIdMatchesAnyIdInSet() { $group = &new SimpleCheckboxGroup(); $group->addWidget(new SimpleCheckboxTag(array('id' => 1, 'value' => 'A'))); $group->addWidget(new SimpleCheckboxTag(array('id' => 2, 'value' => 'B'))); $this->assertFalse($group->isId(0)); $this->assertTrue($group->isId(1)); $this->assertTrue($group->isId(2)); } } ?>pgfouine-1.2/tests/simpletest/test/user_agent_test.php0000644000175000017500000006002410334504436022006 0ustar acmeacmesetCookie(new SimpleCookie("a", "A")); $cookies = $jar->getValidCookies(); $this->assertEqual(count($cookies), 1); $this->assertEqual($cookies[0]->getValue(), "A"); } function testHostFilter() { $jar = new SimpleCookieJar(); $cookie = new SimpleCookie('a', 'A'); $cookie->setHost('my-host.com'); $jar->setCookie($cookie); $cookie = new SimpleCookie('b', 'B'); $cookie->setHost('another-host.com'); $jar->setCookie($cookie); $cookie = new SimpleCookie('c', 'C'); $jar->setCookie($cookie); $cookies = $jar->getValidCookies('my-host.com'); $this->assertEqual(count($cookies), 2); $this->assertEqual($cookies[0]->getValue(), 'A'); $this->assertEqual($cookies[1]->getValue(), 'C'); $this->assertEqual(count($jar->getValidCookies('another-host.com')), 2); $this->assertEqual(count($jar->getValidCookies('www.another-host.com')), 2); $this->assertEqual(count($jar->getValidCookies('new-host.org')), 1); $this->assertEqual(count($jar->getValidCookies()), 3); } function testPathFilter() { $jar = new SimpleCookieJar(); $jar->setCookie(new SimpleCookie("a", "A", "/path/")); $this->assertEqual(count($jar->getValidCookies(false, "/")), 0); $this->assertEqual(count($jar->getValidCookies(false, "/elsewhere")), 0); $this->assertEqual(count($jar->getValidCookies(false, "/path/")), 1); $this->assertEqual(count($jar->getValidCookies(false, "/path")), 1); $this->assertEqual(count($jar->getValidCookies(false, "/pa")), 0); $this->assertEqual(count($jar->getValidCookies(false, "/path/here/")), 1); } function testPathFilterDeeply() { $jar = new SimpleCookieJar(); $jar->setCookie(new SimpleCookie("a", "A", "/path/more_path/")); $this->assertEqual(count($jar->getValidCookies(false, "/path/")), 0); $this->assertEqual(count($jar->getValidCookies(false, "/path")), 0); $this->assertEqual(count($jar->getValidCookies(false, "/pa")), 0); $this->assertEqual(count($jar->getValidCookies(false, "/path/more_path/")), 1); $this->assertEqual(count($jar->getValidCookies(false, "/path/more_path/and_more")), 1); $this->assertEqual(count($jar->getValidCookies(false, "/path/not_here/")), 0); } function testMultipleCookieWithDifferentPaths() { $jar = new SimpleCookieJar(); $jar->setCookie(new SimpleCookie("a", "abc", "/")); $jar->setCookie(new SimpleCookie("a", "123", "/path/here/")); $cookies = $jar->getValidCookies("my-host.com", "/"); $this->assertEqual($cookies[0]->getPath(), "/"); $cookies = $jar->getValidCookies("my-host.com", "/path/"); $this->assertEqual($cookies[0]->getPath(), "/"); $cookies = $jar->getValidCookies("my-host.com", "/path/here"); $this->assertEqual($cookies[0]->getPath(), "/"); $this->assertEqual($cookies[1]->getPath(), "/path/here/"); $cookies = $jar->getValidCookies("my-host.com", "/path/here/there"); $this->assertEqual($cookies[0]->getPath(), "/"); $this->assertEqual($cookies[1]->getPath(), "/path/here/"); } function testOverwrite() { $jar = new SimpleCookieJar(); $jar->setCookie(new SimpleCookie("a", "abc", "/")); $jar->setCookie(new SimpleCookie("a", "cde", "/")); $cookies = $jar->getValidCookies(); $this->assertIdentical($cookies[0]->getValue(), "cde"); } function testClearSessionCookies() { $jar = new SimpleCookieJar(); $jar->setCookie(new SimpleCookie("a", "A", "/")); $jar->restartSession(); $this->assertEqual(count($jar->getValidCookies(false, "/")), 0); } function testExpiryFilterByDate() { $cookie = new SimpleCookie("a", "A", "/", "Wed, 25-Dec-02 04:24:20 GMT"); $jar = new SimpleCookieJar(); $jar->setCookie($cookie); $jar->restartSession("Wed, 25-Dec-02 04:24:19 GMT"); $this->assertIdentical($list = $jar->getValidCookies(false, "/"), array($cookie)); $jar->restartSession("Wed, 25-Dec-02 04:24:21 GMT"); $this->assertIdentical($list = $jar->getValidCookies(false, "/"), array()); } function testExpiryFilterByAgeing() { $cookie = new SimpleCookie("a", "A", "/", "Wed, 25-Dec-02 04:24:20 GMT"); $jar = new SimpleCookieJar(); $jar->setCookie($cookie); $jar->restartSession("Wed, 25-Dec-02 04:24:19 GMT"); $this->assertIdentical($list = $jar->getValidCookies(false, "/"), array($cookie)); $jar->agePrematurely(2); $jar->restartSession("Wed, 25-Dec-02 04:24:19 GMT"); $this->assertIdentical($list = $jar->getValidCookies(false, "/"), array()); } function testCookieClearing() { $jar = new SimpleCookieJar(); $jar->setCookie(new SimpleCookie("a", "abc", "/")); $jar->setCookie(new SimpleCookie("a", "", "/")); $this->assertEqual(count($cookies = $jar->getValidCookies(false, "/")), 1); $this->assertIdentical($cookies[0]->getValue(), ""); } function testCookieClearByDate() { $jar = new SimpleCookieJar(); $jar->setCookie(new SimpleCookie("a", "abc", "/", "Wed, 25-Dec-02 04:24:21 GMT")); $jar->setCookie(new SimpleCookie("a", "def", "/", "Wed, 25-Dec-02 04:24:19 GMT")); $cookies = $jar->getValidCookies(false, "/"); $this->assertIdentical($cookies[0]->getValue(), "def"); $jar->restartSession("Wed, 25-Dec-02 04:24:20 GMT"); $this->assertEqual(count($jar->getValidCookies(false, "/")), 0); } } class TestOfFetchingUrlParameters extends UnitTestCase { function testGet() { $headers = &new MockSimpleHttpHeaders($this); $headers->setReturnValue('getMimeType', 'text/html'); $headers->setReturnValue('getResponseCode', 200); $headers->setReturnValue('getNewCookies', array()); $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getContent', 'stuff'); $response->setReturnReference('getHeaders', $headers); $request = &new MockSimpleHttpRequest($this); $request->setReturnReference('fetch', $response); $agent = &new MockRequestUserAgent($this); $agent->setReturnReference('_createHttpRequest', $request); $agent->expectOnce('_createHttpRequest', array( 'GET', new SimpleUrl('http://test:secret@this.com/page.html?a=A&b=B'), new SimpleFormEncoding())); $agent->SimpleUserAgent(); $agent->fetchResponse( 'GET', new SimpleUrl('http://test:secret@this.com/page.html'), new SimpleFormEncoding(array('a' => 'A', 'b' => 'B'))); $agent->tally(); } function testHead() { $headers = &new MockSimpleHttpHeaders($this); $headers->setReturnValue('getMimeType', 'text/html'); $headers->setReturnValue('getResponseCode', 200); $headers->setReturnValue('getNewCookies', array()); $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getContent', 'stuff'); $response->setReturnReference('getHeaders', $headers); $request = &new MockSimpleHttpRequest($this); $request->setReturnReference('fetch', $response); $url = new SimpleUrl('http://this.com/page.html'); $url->addRequestParameters(array('a' => 'A', 'b' => 'B')); $agent = &new MockRequestUserAgent($this); $agent->setReturnReference('_createHttpRequest', $request); $agent->expectOnce('_createHttpRequest', array( 'HEAD', new SimpleUrl('http://test:secret@this.com/page.html?a=A&b=B'), new SimpleFormEncoding())); $agent->SimpleUserAgent(); $agent->fetchResponse( 'HEAD', new SimpleUrl('http://test:secret@this.com/page.html'), new SimpleFormEncoding(array('a' => 'A', 'b' => 'B'))); $agent->tally(); } function testPost() { $headers = &new MockSimpleHttpHeaders($this); $headers->setReturnValue('getMimeType', 'text/html'); $headers->setReturnValue('getResponseCode', 200); $headers->setReturnValue('getNewCookies', array()); $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getContent', 'stuff'); $response->setReturnReference('getHeaders', $headers); $request = &new MockSimpleHttpRequest($this); $request->setReturnReference('fetch', $response); $agent = &new MockRequestUserAgent($this); $agent->setReturnReference('_createHttpRequest', $request); $agent->expectOnce('_createHttpRequest', array( 'POST', new SimpleUrl('http://test:secret@this.com/page.html'), new SimpleFormEncoding(array('a' => 'A', 'b' => 'B')))); $agent->SimpleUserAgent(); $agent->fetchResponse( 'POST', new SimpleUrl('http://test:secret@this.com/page.html'), new SimpleFormEncoding(array('a' => 'A', 'b' => 'B'))); $agent->tally(); } } class TestOfAdditionalHeaders extends UnitTestCase { function testAdditionalHeaderAddedToRequest() { $headers = &new MockSimpleHttpHeaders($this); $headers->setReturnValue('getNewCookies', array()); $response = &new MockSimpleHttpResponse($this); $response->setReturnReference('getHeaders', $headers); $request = &new MockSimpleHttpRequest($this); $request->setReturnReference('fetch', $response); $request->expectOnce( 'addHeaderLine', array('User-Agent: SimpleTest')); $agent = &new MockRequestUserAgent($this); $agent->setReturnReference('_createHttpRequest', $request); $agent->SimpleUserAgent(); $agent->addHeader('User-Agent: SimpleTest'); $response = &$agent->fetchResponse('GET', new SimpleUrl('http://this.host/')); $request->tally(); } } class TestOfBrowserCookies extends UnitTestCase { function &_createStandardResponse() { $headers = &new MockSimpleHttpHeaders($this); $headers->setReturnValue("getNewCookies", array()); $response = &new MockSimpleHttpResponse($this); $response->setReturnValue("isError", false); $response->setReturnValue("getContent", "stuff"); $response->setReturnReference("getHeaders", $headers); return $response; } function &_createCookieSite($cookies) { $headers = &new MockSimpleHttpHeaders($this); $headers->setReturnValue("getNewCookies", $cookies); $response = &new MockSimpleHttpResponse($this); $response->setReturnValue("isError", false); $response->setReturnReference("getHeaders", $headers); $response->setReturnValue("getContent", "stuff"); $request = &new MockSimpleHttpRequest($this); $request->setReturnReference("fetch", $response); return $request; } function &_createPartialFetcher(&$request) { $agent = &new MockRequestUserAgent($this); $agent->setReturnReference('_createHttpRequest', $request); $agent->SimpleUserAgent(); return $agent; } function testSendingExistingCookie() { $request = &new MockSimpleHttpRequest($this); $request->setReturnReference('fetch', $this->_createStandardResponse()); $request->expectOnce('setCookie', array(new SimpleCookie('a', 'A'))); $agent = &$this->_createPartialFetcher($request); $agent->setCookie('a', 'A'); $response = $agent->fetchResponse( 'GET', new SimpleUrl('http://this.com/this/path/page.html'), array()); $this->assertEqual($response->getContent(), "stuff"); $request->tally(); } function testOverwriteCookieThatAlreadyExists() { $request = &$this->_createCookieSite(array(new SimpleCookie("a", "AAAA", "this/path/"))); $agent = &$this->_createPartialFetcher($request); $agent->setCookie("a", "A"); $agent->fetchResponse( "GET", new SimpleUrl('http://this.com/this/path/page.html'), array()); $this->assertEqual($agent->getCookieValue("this.com", "this/path/", "a"), "AAAA"); } function testClearCookieBySettingExpiry() { $request = &$this->_createCookieSite(array( new SimpleCookie("a", "b", "this/path/", "Wed, 25-Dec-02 04:24:19 GMT"))); $agent = &$this->_createPartialFetcher($request); $agent->setCookie("a", "A", "this/path/", "Wed, 25-Dec-02 04:24:21 GMT"); $agent->fetchResponse( 'GET', new SimpleUrl('http://this.com/this/path/page.html'), array()); $this->assertIdentical( $agent->getCookieValue("this.com", "this/path/", "a"), "b"); $agent->restart("Wed, 25-Dec-02 04:24:20 GMT"); $this->assertIdentical( $agent->getCookieValue("this.com", "this/path/", "a"), false); } function testAgeingAndClearing() { $request = &$this->_createCookieSite(array( new SimpleCookie("a", "A", "this/path/", "Wed, 25-Dec-02 04:24:21 GMT"))); $agent = &$this->_createPartialFetcher($request); $agent->fetchResponse( 'GET', new SimpleUrl('http://this.com/this/path/page.html'), array()); $agent->restart("Wed, 25-Dec-02 04:24:20 GMT"); $this->assertIdentical( $agent->getCookieValue("this.com", "this/path/", "a"), "A"); $agent->ageCookies(2); $agent->restart("Wed, 25-Dec-02 04:24:20 GMT"); $this->assertIdentical( $agent->getCookieValue("this.com", "this/path/", "a"), false); } function testReadingIncomingAndSetCookies() { $request = &$this->_createCookieSite(array( new SimpleCookie("a", "AAA", "this/path/"))); $agent = &$this->_createPartialFetcher($request); $this->assertNull($agent->getBaseCookieValue("a", false)); $agent->fetchResponse( 'GET', new SimpleUrl('http://this.com/this/path/page.html'), array()); $agent->setCookie("b", "BBB", "this.com", "this/path/"); $this->assertEqual( $agent->getBaseCookieValue("a", new SimpleUrl('http://this.com/this/path/page.html')), "AAA"); $this->assertEqual( $agent->getBaseCookieValue("b", new SimpleUrl('http://this.com/this/path/page.html')), "BBB"); } } class TestOfHttpRedirects extends UnitTestCase { function &createRedirect($content, $redirect) { $headers = &new MockSimpleHttpHeaders($this); $headers->setReturnValue('getNewCookies', array()); $headers->setReturnValue('isRedirect', (boolean)$redirect); $headers->setReturnValue('getLocation', $redirect); $headers->setReturnValue('getNewCookies', array()); $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('getContent', $content); $response->setReturnReference('getHeaders', $headers); $request = &new MockSimpleHttpRequest($this); $request->setReturnReference('fetch', $response); return $request; } function testDisabledRedirects() { $agent = &new MockRequestUserAgent($this); $agent->setReturnReference( '_createHttpRequest', $this->createRedirect('stuff', 'there.html')); $agent->expectOnce('_createHttpRequest'); $agent->SimpleUserAgent(); $agent->setMaximumRedirects(0); $response = &$agent->fetchResponse('GET', new SimpleUrl('here.html')); $this->assertEqual($response->getContent(), 'stuff'); $agent->tally(); } function testSingleRedirect() { $agent = &new MockRequestUserAgent($this); $agent->setReturnReferenceAt( 0, '_createHttpRequest', $this->createRedirect('first', 'two.html')); $agent->setReturnReferenceAt( 1, '_createHttpRequest', $this->createRedirect('second', 'three.html')); $agent->expectCallCount('_createHttpRequest', 2); $agent->SimpleUserAgent(); $agent->setMaximumRedirects(1); $response = &$agent->fetchResponse('GET', new SimpleUrl('one.html')); $this->assertEqual($response->getContent(), 'second'); $agent->tally(); } function testDoubleRedirect() { $agent = &new MockRequestUserAgent($this); $agent->setReturnReferenceAt( 0, '_createHttpRequest', $this->createRedirect('first', 'two.html')); $agent->setReturnReferenceAt( 1, '_createHttpRequest', $this->createRedirect('second', 'three.html')); $agent->setReturnReferenceAt( 2, '_createHttpRequest', $this->createRedirect('third', 'four.html')); $agent->expectCallCount('_createHttpRequest', 3); $agent->SimpleUserAgent(); $agent->setMaximumRedirects(2); $response = &$agent->fetchResponse('GET', new SimpleUrl('one.html')); $this->assertEqual($response->getContent(), 'third'); $agent->tally(); } function testSuccessAfterRedirect() { $agent = &new MockRequestUserAgent($this); $agent->setReturnReferenceAt( 0, '_createHttpRequest', $this->createRedirect('first', 'two.html')); $agent->setReturnReferenceAt( 1, '_createHttpRequest', $this->createRedirect('second', false)); $agent->setReturnReferenceAt( 2, '_createHttpRequest', $this->createRedirect('third', 'four.html')); $agent->expectCallCount('_createHttpRequest', 2); $agent->SimpleUserAgent(); $agent->setMaximumRedirects(2); $response = &$agent->fetchResponse('GET', new SimpleUrl('one.html')); $this->assertEqual($response->getContent(), 'second'); $agent->tally(); } function testRedirectChangesPostToGet() { $agent = &new MockRequestUserAgent($this); $agent->setReturnReferenceAt( 0, '_createHttpRequest', $this->createRedirect('first', 'two.html')); $agent->expectArgumentsAt(0, '_createHttpRequest', array('POST', '*', '*')); $agent->setReturnReferenceAt( 1, '_createHttpRequest', $this->createRedirect('second', 'three.html')); $agent->expectArgumentsAt(1, '_createHttpRequest', array('GET', '*', '*')); $agent->expectCallCount('_createHttpRequest', 2); $agent->SimpleUserAgent(); $agent->setMaximumRedirects(1); $response = &$agent->fetchResponse('POST', new SimpleUrl('one.html')); $agent->tally(); } } class TestOfBadHosts extends UnitTestCase { function &_createSimulatedBadHost() { $response = &new MockSimpleHttpResponse($this); $response->setReturnValue('isError', true); $response->setReturnValue('getError', 'Bad socket'); $response->setReturnValue('getContent', false); $request = &new MockSimpleHttpRequest($this); $request->setReturnReference('fetch', $response); return $request; } function testUntestedHost() { $request = &$this->_createSimulatedBadHost(); $agent = &new MockRequestUserAgent($this); $agent->setReturnReference('_createHttpRequest', $request); $agent->SimpleUserAgent(); $response = &$agent->fetchResponse( 'GET', new SimpleUrl('http://this.host/this/path/page.html')); $this->assertTrue($response->isError()); } } class TestOfAuthorisation extends UnitTestCase { function testAuthenticateHeaderAdded() { $headers = &new MockSimpleHttpHeaders($this); $headers->setReturnValue('getNewCookies', array()); $response = &new MockSimpleHttpResponse($this); $response->setReturnReference('getHeaders', $headers); $request = &new MockSimpleHttpRequest($this); $request->setReturnReference('fetch', $response); $request->expectOnce( 'addHeaderLine', array('Authorization: Basic ' . base64_encode('test:secret'))); $agent = &new MockRequestUserAgent($this); $agent->setReturnReference('_createHttpRequest', $request); $agent->SimpleUserAgent(); $response = &$agent->fetchResponse( 'GET', new SimpleUrl('http://test:secret@this.host')); $request->tally(); } } ?>pgfouine-1.2/tests/simpletest/test/socket_test.php0000644000175000017500000000146610334504436021147 0ustar acmeacmeassertFalse($error->isError()); $error->_setError('Ouch'); $this->assertTrue($error->isError()); $this->assertEqual($error->getError(), 'Ouch'); } function testClearingError() { $error = new SimpleStickyError(); $error->_setError('Ouch'); $this->assertTrue($error->isError()); $error->_clearError(); $this->assertFalse($error->isError()); } } ?>pgfouine-1.2/tests/simpletest/extensions/0000755000175000017500000000000011516212335017315 5ustar acmeacmepgfouine-1.2/tests/simpletest/extensions/pear_test_case.php0000644000175000017500000001554010334504440023012 0ustar acmeacmeSimpleTestCase($label); $this->_loosely_typed = false; } /** * Will test straight equality if set to loose * typing, or identity if not. * @param $first First value. * @param $second Comparison value. * @param $message Message to display. * @public */ function assertEquals($first, $second, $message = "%s", $delta = 0) { if ($this->_loosely_typed) { $expectation = &new EqualExpectation($first); } else { $expectation = &new IdenticalExpectation($first); } $this->assertExpectation($expectation, $second, $message); } /** * Passes if the value tested is not null. * @param $value Value to test against. * @param $message Message to display. * @public */ function assertNotNull($value, $message = "%s") { parent::assertTrue(isset($value), $message); } /** * Passes if the value tested is null. * @param $value Value to test against. * @param $message Message to display. * @public */ function assertNull($value, $message = "%s") { parent::assertTrue(!isset($value), $message); } /** * In PHP5 the identity test tests for the same * object. This is a reference test in PHP4. * @param $first First object handle. * @param $second Hopefully the same handle. * @param $message Message to display. * @public */ function assertSame(&$first, &$second, $message = "%s") { $dumper = &new SimpleDumper(); $message = sprintf( $message, "[" . $dumper->describeValue($first) . "] and [" . $dumper->describeValue($second) . "] should reference the same object"); return $this->assertTrue( SimpleTestCompatibility::isReference($first, $second), $message); } /** * In PHP5 the identity test tests for the same * object. This is a reference test in PHP4. * @param $first First object handle. * @param $second Hopefully a different handle. * @param $message Message to display. * @public */ function assertNotSame(&$first, &$second, $message = "%s") { $dumper = &new SimpleDumper(); $message = sprintf( $message, "[" . $dumper->describeValue($first) . "] and [" . $dumper->describeValue($second) . "] should not be the same object"); return $this->assertFalse( SimpleTestCompatibility::isReference($first, $second), $message); } /** * Sends pass if the test condition resolves true, * a fail otherwise. * @param $condition Condition to test true. * @param $message Message to display. * @public */ function assertTrue($condition, $message = "%s") { parent::assertTrue($condition, $message); } /** * Sends pass if the test condition resolves false, * a fail otherwise. * @param $condition Condition to test false. * @param $message Message to display. * @public */ function assertFalse($condition, $message = "%s") { parent::assertTrue(!$condition, $message); } /** * Tests a regex match. Needs refactoring. * @param $pattern Regex to match. * @param $subject String to search in. * @param $message Message to display. * @public */ function assertRegExp($pattern, $subject, $message = "%s") { $this->assertExpectation( new WantedPatternExpectation($pattern), $subject, $message); } /** * Tests the type of a value. * @param $value Value to take type of. * @param $type Hoped for type. * @param $message Message to display. * @public */ function assertType($value, $type, $message = "%s") { parent::assertTrue(gettype($value) == strtolower($type), $message); } /** * Sets equality operation to act as a simple equal * comparison only, allowing a broader range of * matches. * @param $loosely_typed True for broader comparison. * @public */ function setLooselyTyped($loosely_typed) { $this->_loosely_typed = $loosely_typed; } /** * For progress indication during * a test amongst other things. * @return Usually one. * @public */ function countTestCases() { return $this->getSize(); } /** * Accessor for name, normally just the class * name. * @public */ function getName() { return $this->getLabel(); } /** * Does nothing. For compatibility only. * @param $name Dummy * @public */ function setName($name) { } } ?> pgfouine-1.2/tests/simpletest/extensions/phpunit_test_case.php0000644000175000017500000000671610334504440023557 0ustar acmeacmeSimpleTestCase($label); } /** * Sends pass if the test condition resolves true, * a fail otherwise. * @param $condition Condition to test true. * @param $message Message to display. * @public */ function assert($condition, $message = false) { parent::assertTrue($condition, $message); } /** * Will test straight equality if set to loose * typing, or identity if not. * @param $first First value. * @param $second Comparison value. * @param $message Message to display. * @public */ function assertEquals($first, $second, $message = false) { $this->assertExpectation( new EqualExpectation($first), $second, $message); } /** * Will test straight equality if set to loose * typing, or identity if not. * @param $first First value. * @param $second Comparison value. * @param $message Message to display. * @public */ function assertEqualsMultilineStrings($first, $second, $message = false) { $this->assertExpectation( new EqualExpectation($first), $second, $message); } /** * Tests a regex match. * @param $pattern Regex to match. * @param $subject String to search in. * @param $message Message to display. * @public */ function assertRegexp($pattern, $subject, $message = false) { $this->assertExpectation( new WantedPatternExpectation($pattern), $subject, $message); } /** * Sends an error which we interpret as a fail * with a different message for compatibility. * @param $message Message to display. * @public */ function error($message) { parent::assertTrue(false, "Error triggered [$message]"); } /** * Accessor for name. * @public */ function name() { return $this->getLabel(); } } ?> pgfouine-1.2/tests/simpletest/expectation.php0000644000175000017500000004634110334504436020165 0ustar acmeacme_dumper = &new SimpleDumper(); $this->_message = $message; } /** * Tests the expectation. True if correct. * @param mixed $compare Comparison value. * @return boolean True if correct. * @access public * @abstract */ function test($compare) { } /** * Returns a human readable test message. * @param mixed $compare Comparison value. * @return string Description of success * or failure. * @access public * @abstract */ function testMessage($compare) { } /** * Overlays the generated message onto the stored user * message. * @param mixed $compare Comparison value. * @return string Description of success * or failure. * @access public */ function overlayMessage($compare) { return sprintf($this->_message, $this->testMessage($compare)); } /** * Accessor for the dumper. * @return SimpleDumper Current value dumper. * @access protected */ function &_getDumper() { return $this->_dumper; } } /** * Test for equality. * @package SimpleTest * @subpackage UnitTester */ class EqualExpectation extends SimpleExpectation { var $_value; /** * Sets the value to compare against. * @param mixed $value Test value to match. * @param string $message Customised message on failure. * @access public */ function EqualExpectation($value, $message = '%s') { $this->SimpleExpectation($message); $this->_value = $value; } /** * Tests the expectation. True if it matches the * held value. * @param mixed $compare Comparison value. * @return boolean True if correct. * @access public */ function test($compare, $nasty = false) { return (($this->_value == $compare) && ($compare == $this->_value)); } /** * Returns a human readable test message. * @param mixed $compare Comparison value. * @return string Description of success * or failure. * @access public */ function testMessage($compare) { if ($this->test($compare)) { return "Equal expectation [" . $this->_dumper->describeValue($this->_value) . "]"; } else { return "Equal expectation fails " . $this->_dumper->describeDifference($this->_value, $compare); } } /** * Accessor for comparison value. * @return mixed Held value to compare with. * @access protected */ function _getValue() { return $this->_value; } } /** * Test for inequality. * @package SimpleTest * @subpackage UnitTester */ class NotEqualExpectation extends EqualExpectation { /** * Sets the value to compare against. * @param mixed $value Test value to match. * @param string $message Customised message on failure. * @access public */ function NotEqualExpectation($value, $message = '%s') { $this->EqualExpectation($value, $message); } /** * Tests the expectation. True if it differs from the * held value. * @param mixed $compare Comparison value. * @return boolean True if correct. * @access public */ function test($compare) { return ! parent::test($compare); } /** * Returns a human readable test message. * @param mixed $compare Comparison value. * @return string Description of success * or failure. * @access public */ function testMessage($compare) { $dumper = &$this->_getDumper(); if ($this->test($compare)) { return "Not equal expectation passes " . $dumper->describeDifference($this->_getValue(), $compare); } else { return "Not equal expectation fails [" . $dumper->describeValue($this->_getValue()) . "] matches"; } } } /** * Test for identity. * @package SimpleTest * @subpackage UnitTester */ class IdenticalExpectation extends EqualExpectation { /** * Sets the value to compare against. * @param mixed $value Test value to match. * @param string $message Customised message on failure. * @access public */ function IdenticalExpectation($value, $message = '%s') { $this->EqualExpectation($value, $message); } /** * Tests the expectation. True if it exactly * matches the held value. * @param mixed $compare Comparison value. * @return boolean True if correct. * @access public */ function test($compare) { return SimpleTestCompatibility::isIdentical($this->_getValue(), $compare); } /** * Returns a human readable test message. * @param mixed $compare Comparison value. * @return string Description of success * or failure. * @access public */ function testMessage($compare) { $dumper = &$this->_getDumper(); if ($this->test($compare)) { return "Identical expectation [" . $dumper->describeValue($this->_getValue()) . "]"; } else { return "Identical expectation [" . $dumper->describeValue($this->_getValue()) . "] fails with [" . $dumper->describeValue($compare) . "] " . $dumper->describeDifference($this->_getValue(), $compare, TYPE_MATTERS); } } } /** * Test for non-identity. * @package SimpleTest * @subpackage UnitTester */ class NotIdenticalExpectation extends IdenticalExpectation { /** * Sets the value to compare against. * @param mixed $value Test value to match. * @param string $message Customised message on failure. * @access public */ function NotIdenticalExpectation($value, $message = '%s') { $this->IdenticalExpectation($value, $message); } /** * Tests the expectation. True if it differs from the * held value. * @param mixed $compare Comparison value. * @return boolean True if correct. * @access public */ function test($compare) { return ! parent::test($compare); } /** * Returns a human readable test message. * @param mixed $compare Comparison value. * @return string Description of success * or failure. * @access public */ function testMessage($compare) { $dumper = &$this->_getDumper(); if ($this->test($compare)) { return "Not identical expectation passes " . $dumper->describeDifference($this->_getValue(), $compare, TYPE_MATTERS); } else { return "Not identical expectation [" . $dumper->describeValue($this->_getValue()) . "] matches"; } } } /** * Test for a pattern using Perl regex rules. * @package SimpleTest * @subpackage UnitTester */ class WantedPatternExpectation extends SimpleExpectation { var $_pattern; /** * Sets the value to compare against. * @param string $pattern Pattern to search for. * @param string $message Customised message on failure. * @access public */ function WantedPatternExpectation($pattern, $message = '%s') { $this->SimpleExpectation($message); $this->_pattern = $pattern; } /** * Accessor for the pattern. * @return string Perl regex as string. * @access protected */ function _getPattern() { return $this->_pattern; } /** * Tests the expectation. True if the Perl regex * matches the comparison value. * @param string $compare Comparison value. * @return boolean True if correct. * @access public */ function test($compare) { return (boolean)preg_match($this->_getPattern(), $compare); } /** * Returns a human readable test message. * @param mixed $compare Comparison value. * @return string Description of success * or failure. * @access public */ function testMessage($compare) { if ($this->test($compare)) { return $this->_describePatternMatch($this->_getPattern(), $compare); } else { $dumper = &$this->_getDumper(); return "Pattern [" . $this->_getPattern() . "] not detected in [" . $dumper->describeValue($compare) . "]"; } } /** * Describes a pattern match including the string * found and it's position. * @param string $pattern Regex to match against. * @param string $subject Subject to search. * @access protected */ function _describePatternMatch($pattern, $subject) { preg_match($pattern, $subject, $matches); $position = strpos($subject, $matches[0]); $dumper = &$this->_getDumper(); return "Pattern [$pattern] detected at character [$position] in [" . $dumper->describeValue($subject) . "] as [" . $matches[0] . "] in region [" . $dumper->clipString($subject, 100, $position) . "]"; } } /** * Fail if a pattern is detected within the * comparison. * @package SimpleTest * @subpackage UnitTester */ class UnwantedPatternExpectation extends WantedPatternExpectation { /** * Sets the reject pattern * @param string $pattern Pattern to search for. * @param string $message Customised message on failure. * @access public */ function UnwantedPatternExpectation($pattern, $message = '%s') { $this->WantedPatternExpectation($pattern, $message); } /** * Tests the expectation. False if the Perl regex * matches the comparison value. * @param string $compare Comparison value. * @return boolean True if correct. * @access public */ function test($compare) { return ! parent::test($compare); } /** * Returns a human readable test message. * @param string $compare Comparison value. * @return string Description of success * or failure. * @access public */ function testMessage($compare) { if ($this->test($compare)) { $dumper = &$this->_getDumper(); return "Pattern [" . $this->_getPattern() . "] not detected in [" . $dumper->describeValue($compare) . "]"; } else { return $this->_describePatternMatch($this->_getPattern(), $compare); } } } /** * Tests either type or class name if it's an object. * @package SimpleTest * @subpackage UnitTester */ class IsAExpectation extends SimpleExpectation { var $_type; /** * Sets the type to compare with. * @param string $type Type or class name. * @param string $message Customised message on failure. * @access public */ function IsAExpectation($type, $message = '%s') { $this->SimpleExpectation($message); $this->_type = $type; } /** * Accessor for type to check against. * @return string Type or class name. * @access protected */ function _getType() { return $this->_type; } /** * Tests the expectation. True if the type or * class matches the string value. * @param string $compare Comparison value. * @return boolean True if correct. * @access public */ function test($compare) { if (is_object($compare)) { return SimpleTestCompatibility::isA($compare, $this->_type); } else { return (strtolower(gettype($compare)) == $this->_canonicalType($this->_type)); } } /** * Coerces type name into a gettype() match. * @param string $type User type. * @return string Simpler type. * @access private */ function _canonicalType($type) { $type = strtolower($type); $map = array( 'bool' => 'boolean', 'float' => 'double', 'real' => 'double', 'int' => 'integer'); if (isset($map[$type])) { $type = $map[$type]; } return $type; } /** * Returns a human readable test message. * @param mixed $compare Comparison value. * @return string Description of success * or failure. * @access public */ function testMessage($compare) { $dumper = &$this->_getDumper(); return "Value [" . $dumper->describeValue($compare) . "] should be type [" . $this->_type . "]"; } } /** * Tests either type or class name if it's an object. * Will succeed if the type does not match. * @package SimpleTest * @subpackage UnitTester */ class NotAExpectation extends IsAExpectation { var $_type; /** * Sets the type to compare with. * @param string $type Type or class name. * @param string $message Customised message on failure. * @access public */ function NotAExpectation($type, $message = '%s') { $this->IsAExpectation($type, $message); } /** * Tests the expectation. False if the type or * class matches the string value. * @param string $compare Comparison value. * @return boolean True if different. * @access public */ function test($compare) { return ! parent::test($compare); } /** * Returns a human readable test message. * @param mixed $compare Comparison value. * @return string Description of success * or failure. * @access public */ function testMessage($compare) { $dumper = &$this->_getDumper(); return "Value [" . $dumper->describeValue($compare) . "] should not be type [" . $this->_getType() . "]"; } } /** * Tests for existance of a method in an object * @package SimpleTest * @subpackage UnitTester */ class MethodExistsExpectation extends SimpleExpectation { var $_method; /** * Sets the value to compare against. * @param string $method Method to check. * @param string $message Customised message on failure. * @access public * @return void */ function MethodExistsExpectation($method, $message = '%s') { $this->SimpleExpectation($message); $this->_method = &$method; } /** * Tests the expectation. True if the method exists in the test object. * @param string $compare Comparison method name. * @return boolean True if correct. * @access public */ function test($compare) { return (boolean)(is_object($compare) && method_exists($compare, $this->_method)); } /** * Returns a human readable test message. * @param mixed $compare Comparison value. * @return string Description of success * or failure. * @access public */ function testMessage($compare) { $dumper = &$this->_getDumper(); if (! is_object($compare)) { return 'No method on non-object [' . $dumper->describeValue($compare) . ']'; } $method = $this->_method; return "Object [" . $dumper->describeValue($compare) . "] should contain method [$method]"; } } ?>pgfouine-1.2/tests/simpletest/README0000644000175000017500000001136610334504436016010 0ustar acmeacmeSimpleTest ========== You probably got this package from... http://sourceforge.net/projects/simpletest/ If there is no licence agreement with this package please download a version from the location above. You must read and accept that licence to use this software. The file is titled simply LICENSE. What is it? It's a framework for unit testing, web site testing and mock objects for PHP 4.2.0+. If you have used JUnit you will find this PHP unit testing version very similar. Also included is a mock objects and server stubs generator. The stubs can have return values set for different arguments, can have sequences set also by arguments and can return items by reference. The mocks inherit all of this functionality and can also have expectations set, again in sequences and for different arguments. A web tester similar in concept to JWebUnit is also included. There is no JavaScript or tables support, but forms, authentication, cookies and frames are handled. You are not tied to just using SimpleTest, though. The mocks and stubs will work with other test frameworks and SimpleTest can use other framework's (PHPUnit, PEAR::PhpUnit) test cases as it's own. The web browser part of the web tester can also be used independently either in other testers or as part of a scripting solution. You can see a release schedule at http://www.lastcraft.com/overview.php which is also copied to the documentation folder with this release. A full PHPDocumenter API documentation exists at http://simpletest.sourceforge.net/. The user interface is minimal in the extreme, but a lot of information flows from the test suite. After version 1.0 we will release a better web UI, but we are leaving XUL and GTk versions to volunteers as everybody has their own opinion on a good GUI, and we don't want to discourage development by shipping one with the toolkit. You are looking at a first full release. The unit tests for SimpleTest itself can be run here... simpletest/test/unit_tests.php And tests involving live network connections as well are here... simpletest/test/all_tests.php The full tests will typically overrun the 8Mb limit usually allowed to a PHP process. A workaround is to run the tests on the command with a custom php.ini file if you do not have access to your server version. You will have to edit the all_tests.php file if you are accesssing the internet through a proxy server. See the comments in all_tests.php for instructions. The full tests read some test data from the LastCraft site. If the site is down or has been modified for a later version then you will get spurious errors. A unit_tests.php failure on the other hand would be very serious. As far as we know we haven't yet managed to check in any test failures so please correct us if you find one. Even if all of the tests run please verify that your existing test suites also function as expected. If they don't see the file... HELP_MY_TESTS_DONT_WORK_ANYMORE This contains information on interface changes. It also points out deprecated interfaces so you should read this even if all of your current tests appear to run. There is a documentation folder which contains the core reference information in English and French, although this information is fairly basic. You can find a tutorial on http://www.lastcraft.com/first_test_tutorial.php to get you started and this material will eventually become included with the project documentation. A French translation exists at http://www.onpk.net/index.php/2005/01/12/254-tutoriel-simpletest-decouvrir-les-tests-unitaires. If you download and use and possibly even extend this tool, please let us know. Any feedback, even bad, is always welcome and we will work to get your suggestions into the version one release. Ideally please send your comments to... simpletest-support@lists.sourceforge.net ...so that others can read them too. We usually try to respond within 48 hours. There is no change log as yet except at Sourceforge. You can visit the release notes to see the completed TODO list after each cycle and also the status of any bugs, but if the bug is recent then it will be fixed in CVS only. The CVS check-ins always have all the tests passing and so CVS snapshots should be pretty usable, although the code may not look so good internally. Oh, yes. It is called "Simple" because it should be simple to use. We intend to add a complete set of tools for a test first and "test as you code" type of development. "Simple" does not mean "Lite" in this context. Thanks to everyone who has sent comments and offered suggestions. They really are invaluable, but sadly you are too many to mention in full. Thanks to all on the advanced PHP forum on SitePoint, especially Harry Feucks. Early adopters are always an inspiration. yours Marcus Baker, Jason Sweat and Perrick Penet. -- marcus@lastcraft.com pgfouine-1.2/tests/simpletest/http.php0000644000175000017500000007122510334504436016620 0ustar acmeacme_host = false; $this->_name = $name; $this->_value = $value; $this->_path = ($path ? $this->_fixPath($path) : "/"); $this->_expiry = false; if (is_string($expiry)) { $this->_expiry = strtotime($expiry); } elseif (is_integer($expiry)) { $this->_expiry = $expiry; } $this->_is_secure = $is_secure; } /** * Sets the host. The cookie rules determine * that the first two parts are taken for * certain TLDs and three for others. If the * new host does not match these rules then the * call will fail. * @param string $host New hostname. * @return boolean True if hostname is valid. * @access public */ function setHost($host) { if ($host = $this->_truncateHost($host)) { $this->_host = $host; return true; } return false; } /** * Accessor for the truncated host to which this * cookie applies. * @return string Truncated hostname. * @access public */ function getHost() { return $this->_host; } /** * Test for a cookie being valid for a host name. * @param string $host Host to test against. * @return boolean True if the cookie would be valid * here. */ function isValidHost($host) { return ($this->_truncateHost($host) === $this->getHost()); } /** * Extracts just the domain part that determines a * cookie's host validity. * @param string $host Host name to truncate. * @return string Domain or false on a bad host. * @access private */ function _truncateHost($host) { $tlds = SimpleUrl::getAllTopLevelDomains(); if (preg_match('/[a-z\-]+\.(' . $tlds . ')$/i', $host, $matches)) { return $matches[0]; } elseif (preg_match('/[a-z\-]+\.[a-z\-]+\.[a-z\-]+$/i', $host, $matches)) { return $matches[0]; } return false; } /** * Accessor for name. * @return string Cookie key. * @access public */ function getName() { return $this->_name; } /** * Accessor for value. A deleted cookie will * have an empty string for this. * @return string Cookie value. * @access public */ function getValue() { return $this->_value; } /** * Accessor for path. * @return string Valid cookie path. * @access public */ function getPath() { return $this->_path; } /** * Tests a path to see if the cookie applies * there. The test path must be longer or * equal to the cookie path. * @param string $path Path to test against. * @return boolean True if cookie valid here. * @access public */ function isValidPath($path) { return (strncmp( $this->_fixPath($path), $this->getPath(), strlen($this->getPath())) == 0); } /** * Accessor for expiry. * @return string Expiry string. * @access public */ function getExpiry() { if (! $this->_expiry) { return false; } return gmdate("D, d M Y H:i:s", $this->_expiry) . " GMT"; } /** * Test to see if cookie is expired against * the cookie format time or timestamp. * Will give true for a session cookie. * @param integer/string $now Time to test against. Result * will be false if this time * is later than the cookie expiry. * Can be either a timestamp integer * or a cookie format date. * @access public */ function isExpired($now) { if (! $this->_expiry) { return true; } if (is_string($now)) { $now = strtotime($now); } return ($this->_expiry < $now); } /** * Ages the cookie by the specified number of * seconds. * @param integer $interval In seconds. * @public */ function agePrematurely($interval) { if ($this->_expiry) { $this->_expiry -= $interval; } } /** * Accessor for the secure flag. * @return boolean True if cookie needs SSL. * @access public */ function isSecure() { return $this->_is_secure; } /** * Adds a trailing and leading slash to the path * if missing. * @param string $path Path to fix. * @access private */ function _fixPath($path) { if (substr($path, 0, 1) != '/') { $path = '/' . $path; } if (substr($path, -1, 1) != '/') { $path .= '/'; } return $path; } } /** * Creates HTTP headers for the end point of * a HTTP request. * @package SimpleTest * @subpackage WebTester */ class SimpleRoute { var $_url; /** * Sets the target URL. * @param SimpleUrl $url URL as object. * @access public */ function SimpleRoute($url) { $this->_url = $url; } /** * Resource name. * @return SimpleUrl Current url. * @access protected */ function getUrl() { return $this->_url; } /** * Creates the first line which is the actual request. * @param string $method HTTP request method, usually GET. * @return string Request line content. * @access protected */ function _getRequestLine($method) { return $method . ' ' . $this->_url->getPath() . $this->_url->getEncodedRequest() . ' HTTP/1.0'; } /** * Creates the host part of the request. * @return string Host line content. * @access protected */ function _getHostLine() { $line = 'Host: ' . $this->_url->getHost(); if ($this->_url->getPort()) { $line .= ':' . $this->_url->getPort(); } return $line; } /** * Opens a socket to the route. * @param string $method HTTP request method, usually GET. * @param integer $timeout Connection timeout. * @return SimpleSocket New socket. * @access public */ function &createConnection($method, $timeout) { $default_port = ('https' == $this->_url->getScheme()) ? 443 : 80; $socket = &$this->_createSocket( $this->_url->getScheme() ? $this->_url->getScheme() : 'http', $this->_url->getHost(), $this->_url->getPort() ? $this->_url->getPort() : $default_port, $timeout); if (! $socket->isError()) { $socket->write($this->_getRequestLine($method) . "\r\n"); $socket->write($this->_getHostLine() . "\r\n"); $socket->write("Connection: close\r\n"); } return $socket; } /** * Factory for socket. * @param string $scheme Protocol to use. * @param string $host Hostname to connect to. * @param integer $port Remote port. * @param integer $timeout Connection timeout. * @return SimpleSocket/SimpleSecureSocket New socket. * @access protected */ function &_createSocket($scheme, $host, $port, $timeout) { if (in_array($scheme, array('https'))) { return new SimpleSecureSocket($host, $port, $timeout); } return new SimpleSocket($host, $port, $timeout); } } /** * Creates HTTP headers for the end point of * a HTTP request via a proxy server. * @package SimpleTest * @subpackage WebTester */ class SimpleProxyRoute extends SimpleRoute { var $_proxy; var $_username; var $_password; /** * Stashes the proxy address. * @param SimpleUrl $url URL as object. * @param string $proxy Proxy URL. * @param string $username Username for autentication. * @param string $password Password for autentication. * @access public */ function SimpleProxyRoute($url, $proxy, $username = false, $password = false) { $this->SimpleRoute($url); $this->_proxy = $proxy; $this->_username = $username; $this->_password = $password; } /** * Creates the first line which is the actual request. * @param string $method HTTP request method, usually GET. * @param SimpleUrl $url URL as object. * @return string Request line content. * @access protected */ function _getRequestLine($method) { $url = $this->getUrl(); $scheme = $url->getScheme() ? $url->getScheme() : 'http'; $port = $url->getPort() ? ':' . $url->getPort() : ''; return $method . ' ' . $scheme . '://' . $url->getHost() . $port . $url->getPath() . $url->getEncodedRequest() . ' HTTP/1.0'; } /** * Creates the host part of the request. * @param SimpleUrl $url URL as object. * @return string Host line content. * @access protected */ function _getHostLine() { $host = 'Host: ' . $this->_proxy->getHost(); $port = $this->_proxy->getPort() ? $this->_proxy->getPort() : 8080; return "$host:$port"; } /** * Opens a socket to the route. * @param string $method HTTP request method, usually GET. * @param integer $timeout Connection timeout. * @return SimpleSocket New socket. * @access public */ function &createConnection($method, $timeout) { $socket = &$this->_createSocket( $this->_proxy->getScheme() ? $this->_proxy->getScheme() : 'http', $this->_proxy->getHost(), $this->_proxy->getPort() ? $this->_proxy->getPort() : 8080, $timeout); if (! $socket->isError()) { $socket->write($this->_getRequestLine($method) . "\r\n"); $socket->write($this->_getHostLine() . "\r\n"); if ($this->_username && $this->_password) { $socket->write('Proxy-Authorization: Basic ' . base64_encode($this->_username . ':' . $this->_password) . "\r\n"); } $socket->write("Connection: close\r\n"); } return $socket; } } /** * HTTP request for a web page. Factory for * HttpResponse object. * @package SimpleTest * @subpackage WebTester */ class SimpleHttpRequest { var $_route; var $_method; var $_encoding; var $_headers; var $_cookies; /** * Saves the URL ready for fetching. * @param SimpleRoute $route Request route. * @param string $method HTTP request method, * usually GET. * @param SimpleFormEncoding $encoding Content to send with * request or false. * @access public */ function SimpleHttpRequest(&$route, $method, $encoding = false) { $this->_route = &$route; $this->_method = $method; $this->_encoding = $encoding; $this->_headers = array(); $this->_cookies = array(); } /** * Fetches the content and parses the headers. * @param integer $timeout Connection timeout. * @return SimpleHttpResponse A response which may only have * an error. * @access public */ function &fetch($timeout) { $socket = &$this->_route->createConnection($this->_method, $timeout); if ($socket->isError()) { return $this->_createResponse($socket); } $this->_dispatchRequest($socket, $this->_method, $this->_encoding); return $this->_createResponse($socket); } /** * Sends the headers. * @param SimpleSocket $socket Open socket. * @param string $method HTTP request method, * usually GET. * @param SimpleFormEncoding $encoding Content to send with request. * @access private */ function _dispatchRequest(&$socket, $method, $encoding) { if ($encoding || ($method == 'POST')) { $socket->write("Content-Length: " . $this->_getContentLength($encoding) . "\r\n"); $socket->write("Content-Type: application/x-www-form-urlencoded\r\n"); } foreach ($this->_headers as $header_line) { $socket->write($header_line . "\r\n"); } if (count($this->_cookies) > 0) { $socket->write("Cookie: " . $this->_marshallCookies($this->_cookies) . "\r\n"); } $socket->write("\r\n"); if ($encoding) { $socket->write($encoding->asString()); } } /** * Calculates the length of the encoded content. * @param SimpleFormEncoding $encoding Content to send with * request or false. */ function _getContentLength($encoding) { if (! $encoding) { return 0; } return (integer)strlen($encoding->asString()); } /** * Adds a header line to the request. * @param string $header_line Text of header line. * @access public */ function addHeaderLine($header_line) { $this->_headers[] = $header_line; } /** * Adds a cookie to the request. * @param SimpleCookie $cookie Additional cookie. * @access public */ function setCookie($cookie) { $this->_cookies[] = $cookie; } /** * Serialises the cookie hash ready for * transmission. * @param hash $cookies Parsed cookies. * @return array Cookies in header form. * @access private */ function _marshallCookies($cookies) { $cookie_pairs = array(); foreach ($cookies as $cookie) { $cookie_pairs[] = $cookie->getName() . "=" . $cookie->getValue(); } return implode(";", $cookie_pairs); } /** * Wraps the socket in a response parser. * @param SimpleSocket $socket Responding socket. * @return SimpleHttpResponse Parsed response object. * @access protected */ function &_createResponse(&$socket) { return new SimpleHttpResponse( $socket, $this->_method, $this->_route->getUrl(), $this->_encoding); } } /** * Collection of header lines in the response. * @package SimpleTest * @subpackage WebTester */ class SimpleHttpHeaders { var $_raw_headers; var $_response_code; var $_http_version; var $_mime_type; var $_location; var $_cookies; var $_authentication; var $_realm; /** * Parses the incoming header block. * @param string $headers Header block. * @access public */ function SimpleHttpHeaders($headers) { $this->_raw_headers = $headers; $this->_response_code = false; $this->_http_version = false; $this->_mime_type = ''; $this->_location = false; $this->_cookies = array(); $this->_authentication = false; $this->_realm = false; foreach (split("\r\n", $headers) as $header_line) { $this->_parseHeaderLine($header_line); } } /** * Accessor for parsed HTTP protocol version. * @return integer HTTP error code. * @access public */ function getHttpVersion() { return $this->_http_version; } /** * Accessor for raw header block. * @return string All headers as raw string. * @access public */ function getRaw() { return $this->_raw_headers; } /** * Accessor for parsed HTTP error code. * @return integer HTTP error code. * @access public */ function getResponseCode() { return (integer)$this->_response_code; } /** * Returns the redirected URL or false if * no redirection. * @return string URL or false for none. * @access public */ function getLocation() { return $this->_location; } /** * Test to see if the response is a valid redirect. * @return boolean True if valid redirect. * @access public */ function isRedirect() { return in_array($this->_response_code, array(301, 302, 303, 307)) && (boolean)$this->getLocation(); } /** * Test to see if the response is an authentication * challenge. * @return boolean True if challenge. * @access public */ function isChallenge() { return ($this->_response_code == 401) && (boolean)$this->_authentication && (boolean)$this->_realm; } /** * Accessor for MIME type header information. * @return string MIME type. * @access public */ function getMimeType() { return $this->_mime_type; } /** * Accessor for authentication type. * @return string Type. * @access public */ function getAuthentication() { return $this->_authentication; } /** * Accessor for security realm. * @return string Realm. * @access public */ function getRealm() { return $this->_realm; } /** * Accessor for any new cookies. * @return array List of new cookies. * @access public */ function getNewCookies() { return $this->_cookies; } /** * Called on each header line to accumulate the held * data within the class. * @param string $header_line One line of header. * @access protected */ function _parseHeaderLine($header_line) { if (preg_match('/HTTP\/(\d+\.\d+)\s+(.*?)\s/i', $header_line, $matches)) { $this->_http_version = $matches[1]; $this->_response_code = $matches[2]; } if (preg_match('/Content-type:\s*(.*)/i', $header_line, $matches)) { $this->_mime_type = trim($matches[1]); } if (preg_match('/Location:\s*(.*)/i', $header_line, $matches)) { $this->_location = trim($matches[1]); } if (preg_match('/Set-cookie:(.*)/i', $header_line, $matches)) { $this->_cookies[] = $this->_parseCookie($matches[1]); } if (preg_match('/WWW-Authenticate:\s+(\S+)\s+realm=\"(.*?)\"/i', $header_line, $matches)) { $this->_authentication = $matches[1]; $this->_realm = trim($matches[2]); } } /** * Parse the Set-cookie content. * @param string $cookie_line Text after "Set-cookie:" * @return SimpleCookie New cookie object. * @access private */ function _parseCookie($cookie_line) { $parts = split(";", $cookie_line); $cookie = array(); preg_match('/\s*(.*?)\s*=(.*)/', array_shift($parts), $cookie); foreach ($parts as $part) { if (preg_match('/\s*(.*?)\s*=(.*)/', $part, $matches)) { $cookie[$matches[1]] = trim($matches[2]); } } return new SimpleCookie( $cookie[1], trim($cookie[2]), isset($cookie["path"]) ? $cookie["path"] : "", isset($cookie["expires"]) ? $cookie["expires"] : false); } } /** * Basic HTTP response. * @package SimpleTest * @subpackage WebTester */ class SimpleHttpResponse extends SimpleStickyError { var $_method; var $_url; var $_request_data; var $_sent; var $_content; var $_headers; /** * Constructor. Reads and parses the incoming * content and headers. * @param SimpleSocket $socket Network connection to fetch * response text from. * @param string $method HTTP request method. * @param SimpleUrl $url Resource name. * @param mixed $request_data Record of content sent. * @access public */ function SimpleHttpResponse(&$socket, $method, $url, $request_data = '') { $this->SimpleStickyError(); $this->_method = $method; $this->_url = $url; $this->_request_data = $request_data; $this->_sent = $socket->getSent(); $this->_content = false; $raw = $this->_readAll($socket); if ($socket->isError()) { $this->_setError('Error reading socket [' . $socket->getError() . ']'); return; } $this->_parse($raw); } /** * Splits up the headers and the rest of the content. * @param string $raw Content to parse. * @access private */ function _parse($raw) { if (! $raw) { $this->_setError('Nothing fetched'); $this->_headers = &new SimpleHttpHeaders(''); } elseif (! strstr($raw, "\r\n\r\n")) { $this->_setError('Could not parse headers'); $this->_headers = &new SimpleHttpHeaders($raw); } else { list($headers, $this->_content) = split("\r\n\r\n", $raw, 2); $this->_headers = &new SimpleHttpHeaders($headers); } } /** * Original request method. * @return string GET, POST or HEAD. * @access public */ function getMethod() { return $this->_method; } /** * Resource name. * @return SimpleUrl Current url. * @access public */ function getUrl() { return $this->_url; } /** * Original request data. * @return mixed Sent content. * @access public */ function getRequestData() { return $this->_request_data; } /** * Raw request that was sent down the wire. * @return string Bytes actually sent. * @access public */ function getSent() { return $this->_sent; } /** * Accessor for the content after the last * header line. * @return string All content. * @access public */ function getContent() { return $this->_content; } /** * Accessor for header block. The response is the * combination of this and the content. * @return SimpleHeaders Wrapped header block. * @access public */ function getHeaders() { return $this->_headers; } /** * Accessor for any new cookies. * @return array List of new cookies. * @access public */ function getNewCookies() { return $this->_headers->getNewCookies(); } /** * Reads the whole of the socket output into a * single string. * @param SimpleSocket $socket Unread socket. * @return string Raw output if successful * else false. * @access private */ function _readAll(&$socket) { $all = ''; while (! $this->_isLastPacket($next = $socket->read())) { $all .= $next; } return $all; } /** * Test to see if the packet from the socket is the * last one. * @param string $packet Chunk to interpret. * @return boolean True if empty or EOF. * @access private */ function _isLastPacket($packet) { if (is_string($packet)) { return $packet === ''; } return ! $packet; } } ?>pgfouine-1.2/tests/simpletest/page.php0000644000175000017500000007762210334504436016564 0ustar acmeacmeSimpleSaxListener(); } /** * Reads the raw content and send events * into the page to be built. * @param $response SimpleHttpResponse Fetched response. * @return SimplePage Newly parsed page. * @access public */ function parse($response) { $this->_tags = array(); $this->_page = &$this->_createPage($response); $parser = &$this->_createParser($this); $parser->parse($response->getContent()); $this->_page->acceptPageEnd(); return $this->_page; } /** * Creates an empty page. * @return SimplePage New unparsed page. * @access protected */ function &_createPage($response) { return new SimplePage($response); } /** * Creates the parser used with the builder. * @param $listener SimpleSaxListener Target of parser. * @return SimpleSaxParser Parser to generate * events for the builder. * @access protected */ function &_createParser(&$listener) { return new SimpleSaxParser($listener); } /** * Make the keys lower case for case insensitive look-ups. * @param hash $map Hash to convert. * @return hash Unchanged values, but keys lower case. * @access private */ function _keysToLowerCase($map) { $lower = array(); foreach ($map as $key => $value) { $lower[strtolower($key)] = $value; } return $lower; } /** * Start of element event. Opens a new tag. * @param string $name Element name. * @param hash $attributes Attributes without content * are marked as true. * @return boolean False on parse error. * @access public */ function startElement($name, $attributes) { $tag = &$this->_createTag($name, $this->_keysToLowerCase($attributes)); if ($name == 'form') { $this->_page->acceptFormStart($tag); return true; } if ($name == 'frameset') { $this->_page->acceptFramesetStart($tag); return true; } if ($name == 'frame') { $this->_page->acceptFrame($tag); return true; } if ($tag->expectEndTag()) { $this->_openTag($tag); return true; } $this->_page->acceptTag($tag); return true; } /** * End of element event. * @param string $name Element name. * @return boolean False on parse error. * @access public */ function endElement($name) { if ($name == 'form') { $this->_page->acceptFormEnd(); return true; } if ($name == 'frameset') { $this->_page->acceptFramesetEnd(); return true; } if (isset($this->_tags[$name]) && (count($this->_tags[$name]) > 0)) { $tag = array_pop($this->_tags[$name]); $this->_addContentTagToOpenTags($tag); $this->_page->acceptTag($tag); return true; } return true; } /** * Unparsed, but relevant data. The data is added * to every open tag. * @param string $text May include unparsed tags. * @return boolean False on parse error. * @access public */ function addContent($text) { foreach (array_keys($this->_tags) as $name) { for ($i = 0, $count = count($this->_tags[$name]); $i < $count; $i++) { $this->_tags[$name][$i]->addContent($text); } } return true; } /** * Parsed relevant data. The parsed tag is added * to every open tag. * @param SimpleTag $tag May include unparsed tags. * @access private */ function _addContentTagToOpenTags(&$tag) { if ($tag->getTagName() != 'option') { return; } foreach (array_keys($this->_tags) as $name) { for ($i = 0, $count = count($this->_tags[$name]); $i < $count; $i++) { $this->_tags[$name][$i]->addTag($tag); } } } /** * Opens a tag for receiving content. Multiple tags * will be receiving input at the same time. * @param SimpleTag $tag New content tag. * @access private */ function _openTag(&$tag) { $name = $tag->getTagName(); if (! in_array($name, array_keys($this->_tags))) { $this->_tags[$name] = array(); } array_push($this->_tags[$name], $tag); } /** * Factory for the tag objects. Creates the * appropriate tag object for the incoming tag name. * @param string $name HTML tag name. * @param hash $attributes Element attributes. * @return SimpleTag Tag object. * @access protected */ function &_createTag($name, $attributes) { if ($name == 'a') { return new SimpleAnchorTag($attributes); } elseif ($name == 'title') { return new SimpleTitleTag($attributes); } elseif ($name == 'input') { return $this->_createInputTag($attributes); } elseif ($name == 'button') { return new SimpleButtonTag($attributes); } elseif ($name == 'textarea') { return new SimpleTextAreaTag($attributes); } elseif ($name == 'select') { return $this->_createSelectionTag($attributes); } elseif ($name == 'option') { return new SimpleOptionTag($attributes); } elseif ($name == 'form') { return new SimpleFormTag($attributes); } elseif ($name == 'frame') { return new SimpleFrameTag($attributes); } return new SimpleTag($name, $attributes); } /** * Factory for selection fields. * @param hash $attributes Element attributes. * @return SimpleTag Tag object. * @access protected */ function &_createSelectionTag($attributes) { if (isset($attributes['multiple'])) { return new MultipleSelectionTag($attributes); } return new SimpleSelectionTag($attributes); } /** * Factory for input tags. * @param hash $attributes Element attributes. * @return SimpleTag Tag object. * @access protected */ function &_createInputTag($attributes) { if (! isset($attributes['type'])) { return new SimpleTextTag($attributes); } $type = strtolower($attributes['type']); if ($type == 'submit') { return new SimpleSubmitTag($attributes); } elseif ($type == 'image') { return new SimpleImageSubmitTag($attributes); } elseif ($type == 'checkbox') { return new SimpleCheckboxTag($attributes); } elseif ($type == 'radio') { return new SimpleRadioButtonTag($attributes); } else { return new SimpleTextTag($attributes); } } } /** * A wrapper for a web page. * @package SimpleTest * @subpackage WebTester */ class SimplePage { var $_links; var $_title; var $_open_forms; var $_complete_forms; var $_frameset; var $_frames; var $_frameset_nesting_level; var $_transport_error; var $_raw; var $_text; var $_sent; var $_headers; var $_method; var $_url; var $_request_data; /** * Parses a page ready to access it's contents. * @param SimpleHttpResponse $response Result of HTTP fetch. * @access public */ function SimplePage($response = false) { $this->_links = array(); $this->_title = false; $this->_open_forms = array(); $this->_complete_forms = array(); $this->_frameset = false; $this->_frames = array(); $this->_frameset_nesting_level = 0; $this->_text = false; if ($response) { $this->_extractResponse($response); } else { $this->_noResponse(); } } /** * Extracts all of the response information. * @param SimpleHttpResponse $response Response being parsed. * @access private */ function _extractResponse($response) { $this->_transport_error = $response->getError(); $this->_raw = $response->getContent(); $this->_sent = $response->getSent(); $this->_headers = $response->getHeaders(); $this->_method = $response->getMethod(); $this->_url = $response->getUrl(); $this->_request_data = $response->getRequestData(); } /** * Sets up a missing response. * @access private */ function _noResponse() { $this->_transport_error = 'No page fetched yet'; $this->_raw = false; $this->_sent = false; $this->_headers = false; $this->_method = 'GET'; $this->_url = false; $this->_request_data = false; } /** * Original request as bytes sent down the wire. * @return mixed Sent content. * @access public */ function getRequest() { return $this->_sent; } /** * Accessor for raw text of page. * @return string Raw unparsed content. * @access public */ function getRaw() { return $this->_raw; } /** * Accessor for plain text of page as a text browser * would see it. * @return string Plain text of page. * @access public */ function getText() { if (! $this->_text) { $this->_text = SimpleSaxParser::normalise($this->_raw); } return $this->_text; } /** * Accessor for raw headers of page. * @return string Header block as text. * @access public */ function getHeaders() { if ($this->_headers) { return $this->_headers->getRaw(); } return false; } /** * Original request method. * @return string GET, POST or HEAD. * @access public */ function getMethod() { return $this->_method; } /** * Original resource name. * @return SimpleUrl Current url. * @access public */ function getUrl() { return $this->_url; } /** * Original request data. * @return mixed Sent content. * @access public */ function getRequestData() { return $this->_request_data; } /** * Accessor for last error. * @return string Error from last response. * @access public */ function getTransportError() { return $this->_transport_error; } /** * Accessor for current MIME type. * @return string MIME type as string; e.g. 'text/html' * @access public */ function getMimeType() { if ($this->_headers) { return $this->_headers->getMimeType(); } return false; } /** * Accessor for HTTP response code. * @return integer HTTP response code received. * @access public */ function getResponseCode() { if ($this->_headers) { return $this->_headers->getResponseCode(); } return false; } /** * Accessor for last Authentication type. Only valid * straight after a challenge (401). * @return string Description of challenge type. * @access public */ function getAuthentication() { if ($this->_headers) { return $this->_headers->getAuthentication(); } return false; } /** * Accessor for last Authentication realm. Only valid * straight after a challenge (401). * @return string Name of security realm. * @access public */ function getRealm() { if ($this->_headers) { return $this->_headers->getRealm(); } return false; } /** * Accessor for current frame focus. Will be * false as no frames. * @return array Always empty. * @access public */ function getFrameFocus() { return array(); } /** * Sets the focus by index. The integer index starts from 1. * @param integer $choice Chosen frame. * @return boolean Always false. * @access public */ function setFrameFocusByIndex($choice) { return false; } /** * Sets the focus by name. Always fails for a leaf page. * @param string $name Chosen frame. * @return boolean False as no frames. * @access public */ function setFrameFocus($name) { return false; } /** * Clears the frame focus. Does nothing for a leaf page. * @access public */ function clearFrameFocus() { } /** * Adds a tag to the page. * @param SimpleTag $tag Tag to accept. * @access public */ function acceptTag(&$tag) { if ($tag->getTagName() == "a") { $this->_addLink($tag); } elseif ($tag->getTagName() == "title") { $this->_setTitle($tag); } elseif ($this->_isFormElement($tag->getTagName())) { for ($i = 0; $i < count($this->_open_forms); $i++) { $this->_open_forms[$i]->addWidget($tag); } } } /** * Tests to see if a tag is a possible form * element. * @param string $name HTML element name. * @return boolean True if form element. * @access private */ function _isFormElement($name) { return in_array($name, array('input', 'button', 'textarea', 'select')); } /** * Opens a form. New widgets go here. * @param SimpleFormTag $tag Tag to accept. * @access public */ function acceptFormStart(&$tag) { $this->_open_forms[] = &new SimpleForm($tag, $this->getUrl()); } /** * Closes the most recently opened form. * @access public */ function acceptFormEnd() { if (count($this->_open_forms)) { $this->_complete_forms[] = array_pop($this->_open_forms); } } /** * Opens a frameset. A frameset may contain nested * frameset tags. * @param SimpleFramesetTag $tag Tag to accept. * @access public */ function acceptFramesetStart(&$tag) { if (! $this->_isLoadingFrames()) { $this->_frameset = &$tag; } $this->_frameset_nesting_level++; } /** * Closes the most recently opened frameset. * @access public */ function acceptFramesetEnd() { if ($this->_isLoadingFrames()) { $this->_frameset_nesting_level--; } } /** * Takes a single frame tag and stashes it in * the current frame set. * @param SimpleFrameTag $tag Tag to accept. * @access public */ function acceptFrame(&$tag) { if ($this->_isLoadingFrames()) { if ($tag->getAttribute('src')) { $this->_frames[] = &$tag; } } } /** * Test to see if in the middle of reading * a frameset. * @return boolean True if inframeset. * @access private */ function _isLoadingFrames() { if (! $this->_frameset) { return false; } return ($this->_frameset_nesting_level > 0); } /** * Test to see if link is an absolute one. * @param string $url Url to test. * @return boolean True if absolute. * @access protected */ function _linkIsAbsolute($url) { $parsed = new SimpleUrl($url); return (boolean)($parsed->getScheme() && $parsed->getHost()); } /** * Adds a link to the page. * @param SimpleAnchorTag $tag Link to accept. * @access protected */ function _addLink($tag) { $this->_links[] = $tag; } /** * Marker for end of complete page. Any work in * progress can now be closed. * @access public */ function acceptPageEnd() { while (count($this->_open_forms)) { $this->_complete_forms[] = array_pop($this->_open_forms); } } /** * Test for the presence of a frameset. * @return boolean True if frameset. * @access public */ function hasFrames() { return (boolean)$this->_frameset; } /** * Accessor for frame name and source URL for every frame that * will need to be loaded. Immediate children only. * @return boolean/array False if no frameset or * otherwise a hash of frame URLs. * The key is either a numerical * base one index or the name attribute. * @access public */ function getFrameset() { if (! $this->_frameset) { return false; } $urls = array(); for ($i = 0; $i < count($this->_frames); $i++) { $name = $this->_frames[$i]->getAttribute('name'); $url = new SimpleUrl($this->_frames[$i]->getAttribute('src')); $urls[$name ? $name : $i + 1] = $url->makeAbsolute($this->getUrl()); } return $urls; } /** * Fetches a list of loaded frames. * @return array/string Just the URL for a single page. * @access public */ function getFrames() { $url = $this->getUrl(); return $url->asString(); } /** * Accessor for a list of all fixed links. * @return array List of urls with scheme of * http or https and hostname. * @access public */ function getAbsoluteUrls() { $all = array(); foreach ($this->_links as $link) { if ($this->_linkIsAbsolute($link->getHref())) { $all[] = $link->getHref(); } } return $all; } /** * Accessor for a list of all relative links. * @return array List of urls without hostname. * @access public */ function getRelativeUrls() { $all = array(); foreach ($this->_links as $link) { if (! $this->_linkIsAbsolute($link->getHref())) { $all[] = $link->getHref(); } } return $all; } /** * Accessor for URLs by the link label. Label will match * regardess of whitespace issues and case. * @param string $label Text of link. * @return array List of links with that label. * @access public */ function getUrlsByLabel($label) { $matches = array(); foreach ($this->_links as $link) { if ($link->getText() == $label) { $matches[] = $this->_getUrlFromLink($link); } } return $matches; } /** * Accessor for a URL by the id attribute. * @param string $id Id attribute of link. * @return SimpleUrl URL with that id of false if none. * @access public */ function getUrlById($id) { foreach ($this->_links as $link) { if ($link->getAttribute('id') === (string)$id) { return $this->_getUrlFromLink($link); } } return false; } /** * Converts a link into a target URL. * @param SimpleAnchor $link Parsed link. * @return SimpleUrl URL with frame target if any. * @access private */ function _getUrlFromLink($link) { $url = $this->_makeAbsolute($link->getHref()); if ($link->getAttribute('target')) { $url->setTarget($link->getAttribute('target')); } return $url; } /** * Expands expandomatic URLs into fully qualified * URLs. * @param SimpleUrl $url Relative URL. * @return SimpleUrl Absolute URL. * @access protected */ function _makeAbsolute($url) { if (! is_object($url)) { $url = new SimpleUrl($url); } return $url->makeAbsolute($this->getUrl()); } /** * Sets the title tag contents. * @param SimpleTitleTag $tag Title of page. * @access protected */ function _setTitle(&$tag) { $this->_title = &$tag; } /** * Accessor for parsed title. * @return string Title or false if no title is present. * @access public */ function getTitle() { if ($this->_title) { return $this->_title->getText(); } return false; } /** * Finds a held form by button label. Will only * search correctly built forms. * @param string $label Button label, default 'Submit'. * @return SimpleForm Form object containing the button. * @access public */ function &getFormBySubmitLabel($label) { for ($i = 0; $i < count($this->_complete_forms); $i++) { if ($this->_complete_forms[$i]->hasSubmitLabel($label)) { return $this->_complete_forms[$i]; } } return null; } /** * Finds a held form by button label. Will only * search correctly built forms. * @param string $name Button name attribute. * @return SimpleForm Form object containing the button. * @access public */ function &getFormBySubmitName($name) { for ($i = 0; $i < count($this->_complete_forms); $i++) { if ($this->_complete_forms[$i]->hasSubmitName($name)) { return $this->_complete_forms[$i]; } } return null; } /** * Finds a held form by button id. Will only * search correctly built forms. * @param string $id Button ID attribute. * @return SimpleForm Form object containing the button. * @access public */ function &getFormBySubmitId($id) { for ($i = 0; $i < count($this->_complete_forms); $i++) { if ($this->_complete_forms[$i]->hasSubmitId($id)) { return $this->_complete_forms[$i]; } } return null; } /** * Finds a held form by image label. Will only * search correctly built forms. * @param string $label Usually the alt attribute. * @return SimpleForm Form object containing the image. * @access public */ function &getFormByImageLabel($label) { for ($i = 0; $i < count($this->_complete_forms); $i++) { if ($this->_complete_forms[$i]->hasImageLabel($label)) { return $this->_complete_forms[$i]; } } return null; } /** * Finds a held form by image button id. Will only * search correctly built forms. * @param string $name Image name. * @return SimpleForm Form object containing the image. * @access public */ function &getFormByImageName($name) { for ($i = 0; $i < count($this->_complete_forms); $i++) { if ($this->_complete_forms[$i]->hasImageName($name)) { return $this->_complete_forms[$i]; } } return null; } /** * Finds a held form by image button id. Will only * search correctly built forms. * @param string $id Image ID attribute. * @return SimpleForm Form object containing the image. * @access public */ function &getFormByImageId($id) { for ($i = 0; $i < count($this->_complete_forms); $i++) { if ($this->_complete_forms[$i]->hasImageId($id)) { return $this->_complete_forms[$i]; } } return null; } /** * Finds a held form by the form ID. A way of * identifying a specific form when we have control * of the HTML code. * @param string $id Form label. * @return SimpleForm Form object containing the matching ID. * @access public */ function &getFormById($id) { for ($i = 0; $i < count($this->_complete_forms); $i++) { if ($this->_complete_forms[$i]->getId() == $id) { return $this->_complete_forms[$i]; } } return null; } /** * Sets a field on each form in which the field is * available. * @param string $name Field name. * @param string $value Value to set field to. * @return boolean True if value is valid. * @access public */ function setField($name, $value) { $is_set = false; for ($i = 0; $i < count($this->_complete_forms); $i++) { if ($this->_complete_forms[$i]->setField($name, $value)) { $is_set = true; } } return $is_set; } /** * Sets a field on the form in which the unique field is * available. * @param string/integer $id Field ID attribute. * @param string $value Value to set field to. * @return boolean True if value is valid. * @access public */ function setFieldById($id, $value) { for ($i = 0; $i < count($this->_complete_forms); $i++) { if ($this->_complete_forms[$i]->setFieldById($id, $value)) { return true; } } return false; } /** * Accessor for a form element value within a page. * Finds the first match. * @param string $name Field name. * @return string/boolean A string if the field is * present, false if unchecked * and null if missing. * @access public */ function getField($name) { for ($i = 0; $i < count($this->_complete_forms); $i++) { $value = $this->_complete_forms[$i]->getValue($name); if (isset($value)) { return $value; } } return null; } /** * Accessor for a form element value within a page. * Finds the first match. * @param string/integer $id Field ID attribute. * @return string/boolean A string if the field is * present, false if unchecked * and null if missing. * @access public */ function getFieldById($id) { for ($i = 0; $i < count($this->_complete_forms); $i++) { $value = $this->_complete_forms[$i]->getValueById($id); if (isset($value)) { return $value; } } return null; } } ?> pgfouine-1.2/tests/simpletest/scorer.php0000644000175000017500000002702110334504436017131 0ustar acmeacme_passes = 0; $this->_fails = 0; $this->_exceptions = 0; $this->_is_dry_run = false; } /** * Signals that the next evaluation will be a dry * run. That is, the structure events will be * recorded, but no tests will be run. */ function makeDry($is_dry = true) { $this->_is_dry_run = $is_dry; } /** * The reporter has a veto on what should be run. * @param string $test_case_name name of test case. * @param string $method Name of test method. * @access public */ function shouldInvoke($test_case_name, $method) { return ! $this->_is_dry_run; } /** * Accessor for current status. Will be false * if there have been any failures or exceptions. * Used for command line tools. * @return boolean True if no failures. * @access public */ function getStatus() { if ($this->_exceptions + $this->_fails > 0) { return false; } return true; } /** * Paints the start of a test method. * @param string $test_name Name of test or other label. * @access public */ function paintMethodStart($test_name) { } /** * Paints the end of a test method. * @param string $test_name Name of test or other label. * @access public */ function paintMethodEnd($test_name) { } /** * Paints the start of a test case. * @param string $test_name Name of test or other label. * @access public */ function paintCaseStart($test_name) { } /** * Paints the end of a test case. * @param string $test_name Name of test or other label. * @access public */ function paintCaseEnd($test_name) { } /** * Paints the start of a group test. * @param string $test_name Name of test or other label. * @param integer $size Number of test cases starting. * @access public */ function paintGroupStart($test_name, $size) { } /** * Paints the end of a group test. * @param string $test_name Name of test or other label. * @access public */ function paintGroupEnd($test_name) { } /** * Increments the pass count. * @param string $message Message is ignored. * @access public */ function paintPass($message) { $this->_passes++; } /** * Increments the fail count. * @param string $message Message is ignored. * @access public */ function paintFail($message) { $this->_fails++; } /** * Deals with PHP 4 throwing an error. * @param string $message Text of error formatted by * the test case. * @access public */ function paintError($message) { $this->paintException($message); } /** * Deals with PHP 5 throwing an exception * This isn't really implemented yet. * @param Exception $exception Object thrown. * @access public */ function paintException($exception) { $this->_exceptions++; } /** * Accessor for the number of passes so far. * @return integer Number of passes. * @access public */ function getPassCount() { return $this->_passes; } /** * Accessor for the number of fails so far. * @return integer Number of fails. * @access public */ function getFailCount() { return $this->_fails; } /** * Accessor for the number of untrapped errors * so far. * @return integer Number of exceptions. * @access public */ function getExceptionCount() { return $this->_exceptions; } /** * Paints a simple supplementary message. * @param string $message Text to display. * @access public */ function paintMessage($message) { } /** * Paints a formatted ASCII message such as a * variable dump. * @param string $message Text to display. * @access public */ function paintFormattedMessage($message) { } /** * By default just ignores user generated events. * @param string $type Event type as text. * @param mixed $payload Message or object. * @access public */ function paintSignal($type, &$payload) { } } /** * Recipient of generated test messages that can display * page footers and headers. Also keeps track of the * test nesting. This is the main base class on which * to build the finished test (page based) displays. * @package SimpleTest * @subpackage UnitTester */ class SimpleReporter extends SimpleScorer { var $_test_stack; var $_size; var $_progress; /** * Starts the display with no results in. * @access public */ function SimpleReporter() { $this->SimpleScorer(); $this->_test_stack = array(); $this->_size = null; $this->_progress = 0; } /** * Paints the start of a group test. Will also paint * the page header and footer if this is the * first test. Will stash the size if the first * start. * @param string $test_name Name of test that is starting. * @param integer $size Number of test cases starting. * @access public */ function paintGroupStart($test_name, $size) { if (! isset($this->_size)) { $this->_size = $size; } if (count($this->_test_stack) == 0) { $this->paintHeader($test_name); } $this->_test_stack[] = $test_name; } /** * Paints the end of a group test. Will paint the page * footer if the stack of tests has unwound. * @param string $test_name Name of test that is ending. * @param integer $progress Number of test cases ending. * @access public */ function paintGroupEnd($test_name) { array_pop($this->_test_stack); if (count($this->_test_stack) == 0) { $this->paintFooter($test_name); } } /** * Paints the start of a test case. Will also paint * the page header and footer if this is the * first test. Will stash the size if the first * start. * @param string $test_name Name of test that is starting. * @access public */ function paintCaseStart($test_name) { if (! isset($this->_size)) { $this->_size = 1; } if (count($this->_test_stack) == 0) { $this->paintHeader($test_name); } $this->_test_stack[] = $test_name; } /** * Paints the end of a test case. Will paint the page * footer if the stack of tests has unwound. * @param string $test_name Name of test that is ending. * @access public */ function paintCaseEnd($test_name) { $this->_progress++; array_pop($this->_test_stack); if (count($this->_test_stack) == 0) { $this->paintFooter($test_name); } } /** * Paints the start of a test method. * @param string $test_name Name of test that is starting. * @access public */ function paintMethodStart($test_name) { $this->_test_stack[] = $test_name; } /** * Paints the end of a test method. Will paint the page * footer if the stack of tests has unwound. * @param string $test_name Name of test that is ending. * @access public */ function paintMethodEnd($test_name) { array_pop($this->_test_stack); } /** * Paints the test document header. * @param string $test_name First test top level * to start. * @access public * @abstract */ function paintHeader($test_name) { } /** * Paints the test document footer. * @param string $test_name The top level test. * @access public * @abstract */ function paintFooter($test_name) { } /** * Accessor for internal test stack. For * subclasses that need to see the whole test * history for display purposes. * @return array List of methods in nesting order. * @access public */ function getTestList() { return $this->_test_stack; } /** * Accessor for total test size in number * of test cases. Null until the first * test is started. * @return integer Total number of cases at start. * @access public */ function getTestCaseCount() { return $this->_size; } /** * Accessor for the number of test cases * completed so far. * @return integer Number of ended cases. * @access public */ function getTestCaseProgress() { return $this->_progress; } /** * Static check for running in the comand line. * @return boolean True if CLI. * @access public * @static */ function inCli() { return php_sapi_name() == 'cli'; } } ?>pgfouine-1.2/tests/simpletest/form.php0000644000175000017500000005500710334504436016604 0ustar acmeacme_name = $name; } /** * Comparison. Compares with name attribute of * widget. * @param SimpleWidget $widget Control to compare. * @access public */ function isMatch($widget) { return ($widget->getName() == $this->_name); } } /** * Used to extract form elements for testing against. * Searches by visible label or alt text. * @package SimpleTest * @subpackage WebTester */ class SimpleLabelSelector { var $_label; /** * Stashes the name for later comparison. * @param string $label Visible text to match. */ function SimpleLabelSelector($label) { $this->_label = $label; } /** * Comparison. Compares visible text of widget. * @param SimpleWidget $widget Control to compare. * @access public */ function isMatch($widget) { return (trim($widget->getLabel()) == trim($this->_label)); } } /** * Used to extract form elements for testing against. * Searches dy id attribute. * @package SimpleTest * @subpackage WebTester */ class SimpleIdSelector { var $_id; /** * Stashes the name for later comparison. * @param string $id ID atribute to match. */ function SimpleIdSelector($id) { $this->_id = $id; } /** * Comparison. Compares id attribute of widget. * @param SimpleWidget $widget Control to compare. * @access public */ function isMatch($widget) { return $widget->isId($this->_id); } } /** * Form tag class to hold widget values. * @package SimpleTest * @subpackage WebTester */ class SimpleForm { var $_method; var $_action; var $_default_target; var $_id; var $_buttons; var $_images; var $_widgets; var $_radios; var $_checkboxes; /** * Starts with no held controls/widgets. * @param SimpleTag $tag Form tag to read. * @param SimpleUrl $url Location of holding page. */ function SimpleForm($tag, $url) { $this->_method = $tag->getAttribute('method'); $this->_action = $this->_createAction($tag->getAttribute('action'), $url); $this->_default_target = false; $this->_id = $tag->getAttribute('id'); $this->_buttons = array(); $this->_images = array(); $this->_widgets = array(); $this->_radios = array(); $this->_checkboxes = array(); } /** * Sets the frame target within a frameset. * @param string $frame Name of frame. * @access public */ function setDefaultTarget($frame) { $this->_default_target = $frame; } /** * Accessor for form action. * @return string Either get or post. * @access public */ function getMethod() { return ($this->_method ? strtolower($this->_method) : 'get'); } /** * Combined action attribute with current location * to get an absolute form target. * @param string $action Action attribute from form tag. * @param SimpleUrl $base Page location. * @return SimpleUrl Absolute form target. */ function _createAction($action, $base) { if ($action === false) { return $base; } if ($action === true) { $url = new SimpleUrl(''); } else { $url = new SimpleUrl($action); } return $url->makeAbsolute($base); } /** * Absolute URL of the target. * @return SimpleUrl URL target. * @access public */ function getAction() { $url = $this->_action; if ($this->_default_target && ! $url->getTarget()) { $url->setTarget($this->_default_target); } return $url; } /** * ID field of form for unique identification. * @return string Unique tag ID. * @access public */ function getId() { return $this->_id; } /** * Adds a tag contents to the form. * @param SimpleWidget $tag Input tag to add. * @access public */ function addWidget($tag) { if (strtolower($tag->getAttribute('type')) == 'submit') { $this->_buttons[] = &$tag; } elseif (strtolower($tag->getAttribute('type')) == 'image') { $this->_images[] = &$tag; } elseif ($tag->getName()) { $this->_setWidget($tag); } } /** * Sets the widget into the form, grouping radio * buttons if any. * @param SimpleWidget $tag Incoming form control. * @access private */ function _setWidget($tag) { if (strtolower($tag->getAttribute('type')) == 'radio') { $this->_addRadioButton($tag); } elseif (strtolower($tag->getAttribute('type')) == 'checkbox') { $this->_addCheckbox($tag); } else { $this->_widgets[] = &$tag; } } /** * Adds a radio button, building a group if necessary. * @param SimpleRadioButtonTag $tag Incoming form control. * @access private */ function _addRadioButton($tag) { if (! isset($this->_radios[$tag->getName()])) { $this->_widgets[] = &new SimpleRadioGroup(); $this->_radios[$tag->getName()] = count($this->_widgets) - 1; } $this->_widgets[$this->_radios[$tag->getName()]]->addWidget($tag); } /** * Adds a checkbox, making it a group on a repeated name. * @param SimpleCheckboxTag $tag Incoming form control. * @access private */ function _addCheckbox($tag) { if (! isset($this->_checkboxes[$tag->getName()])) { $this->_widgets[] = &$tag; $this->_checkboxes[$tag->getName()] = count($this->_widgets) - 1; } else { $index = $this->_checkboxes[$tag->getName()]; if (! SimpleTestCompatibility::isA($this->_widgets[$index], 'SimpleCheckboxGroup')) { $previous = &$this->_widgets[$index]; $this->_widgets[$index] = &new SimpleCheckboxGroup(); $this->_widgets[$index]->addWidget($previous); } $this->_widgets[$index]->addWidget($tag); } } /** * Extracts current value from form. * @param SimpleSelector $selector Criteria to apply. * @return string/array Value(s) as string or null * if not set. * @access public */ function _getValueBySelector($selector) { for ($i = 0, $count = count($this->_widgets); $i < $count; $i++) { if ($selector->isMatch($this->_widgets[$i])) { return $this->_widgets[$i]->getValue(); } } foreach ($this->_buttons as $button) { if ($selector->isMatch($button)) { return $button->getValue(); } } return null; } /** * Extracts current value from form. * @param string $name Keyed by widget name. * @return string/array Value(s) or null * if not set. * @access public */ function getValue($name) { return $this->_getValueBySelector(new SimpleNameSelector($name)); } /** * Extracts current value from form by the ID. * @param string/integer $id Keyed by widget ID attribute. * @return string/array Value(s) or null * if not set. * @access public */ function getValueById($id) { return $this->_getValueBySelector(new SimpleIdSelector($id)); } /** * Sets a widget value within the form. * @param SimpleSelector $selector Criteria to apply. * @param string $value Value to input into the widget. * @return boolean True if value is legal, false * otherwise. If the field is not * present, nothing will be set. * @access public */ function _setFieldBySelector($selector, $value) { $success = false; for ($i = 0, $count = count($this->_widgets); $i < $count; $i++) { if ($selector->isMatch($this->_widgets[$i])) { if ($this->_widgets[$i]->setValue($value)) { $success = true; } } } return $success; } /** * Sets a widget value within the form. * @param string $name Name of widget tag. * @param string $value Value to input into the widget. * @return boolean True if value is legal, false * otherwise. If the field is not * present, nothing will be set. * @access public */ function setField($name, $value) { return $this->_setFieldBySelector(new SimpleNameSelector($name), $value); } /** * Sets a widget value within the form by using the ID. * @param string/integer $id Name of widget tag. * @param string $value Value to input into the widget. * @return boolean True if value is legal, false * otherwise. If the field is not * present, nothing will be set. * @access public */ function setFieldById($id, $value) { return $this->_setFieldBySelector(new SimpleIdSelector($id), $value); } /** * Creates the encoding for the current values in the * form. * @return SimpleFormEncoding Request to submit. * @access private */ function _getEncoding() { $encoding = new SimpleFormEncoding(); for ($i = 0, $count = count($this->_widgets); $i < $count; $i++) { $encoding->add( $this->_widgets[$i]->getName(), $this->_widgets[$i]->getValue()); } return $encoding; } /** * Test to see if a form has a submit button. * @param SimpleSelector $selector Criteria to apply. * @return boolean True if present. * @access private */ function _hasSubmitBySelector($selector) { foreach ($this->_buttons as $button) { if ($selector->isMatch($button)) { return true; } } return false; } /** * Test to see if a form has a submit button with this * name attribute. * @param string $name Name to look for. * @return boolean True if present. * @access public */ function hasSubmitName($name) { return $this->_hasSubmitBySelector(new SimpleNameSelector($name)); } /** * Test to see if a form has a submit button with this * value attribute. * @param string $label Button label to search for. * @return boolean True if present. * @access public */ function hasSubmitLabel($label) { return $this->_hasSubmitBySelector(new SimpleLabelSelector($label)); } /** * Test to see if a form has a submit button with this * ID attribute. * @param string $id Button ID attribute to search for. * @return boolean True if present. * @access public */ function hasSubmitId($id) { return $this->_hasSubmitBySelector(new SimpleIdSelector($id)); } /** * Test to see if a form has an image control. * @param SimpleSelector $selector Criteria to apply. * @return boolean True if present. * @access public */ function _hasImageBySelector($selector) { foreach ($this->_images as $image) { if ($selector->isMatch($image)) { return true; } } return false; } /** * Test to see if a form has a submit button with this * name attribute. * @param string $label Button alt attribute to search for * or nearest equivalent. * @return boolean True if present. * @access public */ function hasImageLabel($label) { return $this->_hasImageBySelector(new SimpleLabelSelector($label)); } /** * Test to see if a form has a submittable image with this * field name. * @param string $name Image name to search for. * @return boolean True if present. * @access public */ function hasImageName($name) { return $this->_hasImageBySelector(new SimpleNameSelector($name)); } /** * Test to see if a form has a submittable image with this * ID attribute. * @param string $id Button ID attribute to search for. * @return boolean True if present. * @access public */ function hasImageId($id) { return $this->_hasImageBySelector(new SimpleIdSelector($id)); } /** * Gets the submit values for a selected button. * @param SimpleSelector $selector Criteria to apply. * @param hash $additional Additional data for the form. * @return SimpleEncoding Submitted values or false * if there is no such button * in the form. * @access public */ function _submitButtonBySelector($selector, $additional) { foreach ($this->_buttons as $button) { if ($selector->isMatch($button)) { $encoding = $this->_getEncoding(); $encoding->merge($button->getSubmitValues()); if ($additional) { $encoding->merge($additional); } return $encoding; } } return false; } /** * Gets the submit values for a named button. * @param string $name Button label to search for. * @param hash $additional Additional data for the form. * @return SimpleEncoding Submitted values or false * if there is no such button in the * form. * @access public */ function submitButtonByName($name, $additional = false) { return $this->_submitButtonBySelector( new SimpleNameSelector($name), $additional); } /** * Gets the submit values for a named button. * @param string $label Button label to search for. * @param hash $additional Additional data for the form. * @return SimpleEncoding Submitted values or false * if there is no such button in the * form. * @access public */ function submitButtonByLabel($label, $additional = false) { return $this->_submitButtonBySelector( new SimpleLabelSelector($label), $additional); } /** * Gets the submit values for a button identified by the ID. * @param string $id Button ID attribute to search for. * @param hash $additional Additional data for the form. * @return SimpleEncoding Submitted values or false * if there is no such button in the * form. * @access public */ function submitButtonById($id, $additional = false) { return $this->_submitButtonBySelector( new SimpleIdSelector($id), $additional); } /** * Gets the submit values for an image. * @param SimpleSelector $selector Criteria to apply. * @param integer $x X-coordinate of click. * @param integer $y Y-coordinate of click. * @param hash $additional Additional data for the form. * @return SimpleEncoding Submitted values or false * if there is no such button in the * form. * @access public */ function _submitImageBySelector($selector, $x, $y, $additional) { foreach ($this->_images as $image) { if ($selector->isMatch($image)) { $encoding = $this->_getEncoding(); $encoding->merge($image->getSubmitValues($x, $y)); if ($additional) { $encoding->merge($additional); } return $encoding; } } return false; } /** * Gets the submit values for an image identified by the alt * tag or nearest equivalent. * @param string $label Button label to search for. * @param integer $x X-coordinate of click. * @param integer $y Y-coordinate of click. * @param hash $additional Additional data for the form. * @return SimpleEncoding Submitted values or false * if there is no such button in the * form. * @access public */ function submitImageByLabel($label, $x, $y, $additional = false) { return $this->_submitImageBySelector( new SimpleLabelSelector($label), $x, $y, $additional); } /** * Gets the submit values for an image identified by the ID. * @param string $name Image name to search for. * @param integer $x X-coordinate of click. * @param integer $y Y-coordinate of click. * @param hash $additional Additional data for the form. * @return SimpleEncoding Submitted values or false * if there is no such button in the * form. * @access public */ function submitImageByName($name, $x, $y, $additional = false) { return $this->_submitImageBySelector( new SimpleNameSelector($name), $x, $y, $additional); } /** * Gets the submit values for an image identified by the ID. * @param string/integer $id Button ID attribute to search for. * @param integer $x X-coordinate of click. * @param integer $y Y-coordinate of click. * @param hash $additional Additional data for the form. * @return SimpleEncoding Submitted values or false * if there is no such button in the * form. * @access public */ function submitImageById($id, $x, $y, $additional = false) { return $this->_submitImageBySelector( new SimpleIdSelector($id), $x, $y, $additional); } /** * Simply submits the form without the submit button * value. Used when there is only one button or it * is unimportant. * @return hash Submitted values. * @access public */ function submit() { return $this->_getEncoding(); } } ?>pgfouine-1.2/tests/simpletest/socket.php0000644000175000017500000001557010334504436017132 0ustar acmeacme_clearError(); } /** * Test for an outstanding error. * @return boolean True if there is an error. * @access public */ function isError() { return ($this->_error != ''); } /** * Accessor for an outstanding error. * @return string Empty string if no error otherwise * the error message. * @access public */ function getError() { return $this->_error; } /** * Sets the internal error. * @param string Error message to stash. * @access protected */ function _setError($error) { $this->_error = $error; } /** * Resets the error state to no error. * @access protected */ function _clearError() { $this->_setError(''); } } /** * Wrapper for TCP/IP socket. * @package SimpleTest * @subpackage WebTester */ class SimpleSocket extends SimpleStickyError { var $_handle; var $_is_open; var $_sent; /** * Opens a socket for reading and writing. * @param string $host Hostname to send request to. * @param integer $port Port on remote machine to open. * @param integer $timeout Connection timeout in seconds. * @access public */ function SimpleSocket($host, $port, $timeout) { $this->SimpleStickyError(); $this->_is_open = false; $this->_sent = ''; if (! ($this->_handle = $this->_openSocket($host, $port, $error_number, $error, $timeout))) { $this->_setError("Cannot open [$host:$port] with [$error] within [$timeout] seconds"); return; } $this->_is_open = true; SimpleTestCompatibility::setTimeout($this->_handle, $timeout); } /** * Writes some data to the socket and saves alocal copy. * @param string $message String to send to socket. * @return boolean True if successful. * @access public */ function write($message) { if ($this->isError() || ! $this->isOpen()) { return false; } $count = fwrite($this->_handle, $message); if (! $count) { if ($count === false) { $this->_setError('Cannot write to socket'); $this->close(); } return false; } fflush($this->_handle); $this->_sent .= $message; return true; } /** * Reads data from the socket. The error suppresion * is a workaround for PHP4 always throwing a warning * with a secure socket. * @param integer $block_size Size of chunk to read. * @return integer Incoming bytes. False * on error. * @access public */ function read($block_size = 255) { if ($this->isError() || ! $this->isOpen()) { return false; } $raw = @fread($this->_handle, $block_size); if ($raw === false) { $this->_setError('Cannot read from socket'); $this->close(); } return $raw; } /** * Accessor for socket open state. * @return boolean True if open. * @access public */ function isOpen() { return $this->_is_open; } /** * Closes the socket preventing further reads. * Cannot be reopened once closed. * @return boolean True if successful. * @access public */ function close() { $this->_is_open = false; return fclose($this->_handle); } /** * Accessor for content so far. * @return string Bytes sent only. * @access public */ function getSent() { return $this->_sent; } /** * Actually opens the low level socket. * @param string $host Host to connect to. * @param integer $port Port on host. * @param integer $error_number Recipient of error code. * @param string $error Recipoent of error message. * @param integer $timeout Maximum time to wait for connection. * @access protected */ function _openSocket($host, $port, &$error_number, &$error, $timeout) { return @fsockopen($host, $port, $error_number, $error, $timeout); } } /** * Wrapper for TCP/IP socket over TLS. * @package SimpleTest * @subpackage WebTester */ class SimpleSecureSocket extends SimpleSocket { /** * Opens a secure socket for reading and writing. * @param string $host Hostname to send request to. * @param integer $port Port on remote machine to open. * @param integer $timeout Connection timeout in seconds. * @access public */ function SimpleSecureSocket($host, $port, $timeout) { $this->SimpleSocket($host, $port, $timeout); } /** * Actually opens the low level socket. * @param string $host Host to connect to. * @param integer $port Port on host. * @param integer $error_number Recipient of error code. * @param string $error Recipient of error message. * @param integer $timeout Maximum time to wait for connection. * @access protected */ function _openSocket($host, $port, &$error_number, &$error, $timeout) { return parent::_openSocket("tls://$host", $port, $error_number, $error, $timeout); } } ?>pgfouine-1.2/tests/simpletest/HELP_MY_TESTS_DONT_WORK_ANYMORE0000644000175000017500000001673310334504436022055 0ustar acmeacmeSimple Test interface changes ============================= Because the SimpleTest tool set is still evolving it is likely that tests written with earlier versions will fail with the newest ones. The most dramatic changes are in the alpha releases. Here is a list of possible problems... No HTML when matching page elements ----------------------------------- This behaviour has been switched to using plain text as if it were seen by the user of the browser. This means that HTML tags are suppressed, entities are converted and whitespace is normalised. This should make it easier to match items in forms. Also images are replaced with their "alt" text so that they can be matched as well. No method SimpleRunner::_getTestCase() -------------------------------------- This was made public as getTestCase() in 1.0RC2. No method restartSession() -------------------------- This was renamed to restart() in the WebTestCase, SimpleBrowser and the underlying SimpleUserAgent in 1.0RC2. Because it was undocumented anyway, no attempt was made at backward compatibility. My custom test case ignored by tally() -------------------------------------- The _assertTrue method has had it's signature changed due to a bug in the PHP 5.0.1 release. You must now use getTest() from within that method to get the test case. Broken code extending SimpleRunner ---------------------------------- This was replaced with SimpleScorer so that I could use the runner name in another class. This happened in RC1 development and there is no easy backward compatibility fix. The solution is simply to extend SimpleScorer instead. Missing method getBaseCookieValue() ----------------------------------- This was renamed getCurrentCookieValue() in RC1. Missing files from the SimpleTest suite --------------------------------------- Versions of SimpleTest prior to Beta6 required a SIMPLE_TEST constant to point at the SimpleTest folder location before any of the toolset was loaded. This is no longer documented as it is now unnecessary for later versions. If you are using an earlier version you may need this constant. Consult the documentation that was bundled with the release that you are using or upgrade to Beta6 or later. No method SimpleBrowser::getCurrentUrl() -------------------------------------- This is replaced with the more versatile showRequest() for debugging. It only existed in this context for version Beta5. Later versions will have SimpleBrowser::getHistory() for tracking paths through pages. It is renamed as getUrl() since 1.0RC1. No method Stub::setStubBaseClass() ---------------------------------- This method has finally been removed in 1.0RC1. Use SimpleTestOptions::setStubBaseClass() instead. No class CommandLineReporter ---------------------------- This was renamed to TextReporter in Beta3 and the deprecated version was removed in 1.0RC1. No method requireReturn() ------------------------- This was deprecated in Beta3 and is now removed. No method expectCookie() ------------------------ This method was abruptly removed in Beta4 so as to simplify the internals until another mechanism can replace it. As a workaround it is necessary to assert that the cookie has changed by setting it before the page fetch and then assert the desired value. No method clickSubmitByFormId() ------------------------------- This method had an incorrect name as no button was involved. It was renamed to submitByFormId() in Beta4 and the old version deprecated. Now removed. No method paintStart() or paintEnd() ------------------------------------ You should only get this error if you have subclassed the lower level reporting and test runner machinery. These methods have been broken down into events for test methods, events for test cases and events for group tests. The new methods are... paintStart() --> paintMethodStart(), paintCaseStart(), paintGroupStart() paintEnd() --> paintMethodEnd(), paintCaseEnd(), paintGroupEnd() This change was made in Beta3, ironically to make it easier to subclass the inner machinery. Simply duplicating the code you had in the previous methods should provide a temporary fix. No class TestDisplay -------------------- This has been folded into SimpleReporter in Beta3 and is now deprecated. It was removed in RC1. No method WebTestCase::fetch() ------------------------------ This was renamed get() in Alpha8. It is removed in Beta3. No method submit() ------------------ This has been renamed clickSubmit() in Beta1. The old method was removed in Beta2. No method clearHistory() ------------------------ This method is deprecated in Beta2 and removed in RC1. No method getCallCount() ------------------------ This method has been deprecated since Beta1 and has now been removed. There are now more ways to set expectations on counts and so this method should be unecessery. Removed in RC1. Cannot find file * ------------------ The following public name changes have occoured... simple_html_test.php --> reporter.php simple_mock.php --> mock_objects.php simple_unit.php --> unit_tester.php simple_web.php --> web_tester.php The old names were deprecated in Alpha8 and removed in Beta1. No method attachObserver() -------------------------- Prior to the Alpha8 release the old internal observer pattern was gutted and replaced with a visitor. This is to trade flexibility of test case expansion against the ease of writing user interfaces. Code such as... $test = &new MyTestCase(); $test->attachObserver(new TestHtmlDisplay()); $test->run(); ...should be rewritten as... $test = &new MyTestCase(); $test->run(new HtmlReporter()); If you previously attached multiple observers then the workaround is to run the tests twice, once with each, until they can be combined. For one observer the old method is simulated in Alpha 8, but is removed in Beta1. No class TestHtmlDisplay ------------------------ This class has been renamed to HtmlReporter in Alpha8. It is supported, but deprecated in Beta1 and removed in Beta2. If you have subclassed the display for your own design, then you will have to extend this class (HtmlReporter) instead. If you have accessed the event queue by overriding the notify() method then I am afraid you are in big trouble :(. The reporter is now carried around the test suite by the runner classes and the methods called directly. In the unlikely event that this is a problem and you don't want to upgrade the test tool then simplest is to write your own runner class and invoke the tests with... $test->accept(new MyRunner(new MyReporter())); ...rather than the run method. This should be easier to extend anyway and gives much more control. Even this method is overhauled in Beta3 where the runner class can be set within the test case. Really the best thing to do is to upgrade to this version as whatever you were trying to achieve before should now be very much easier. Missing set options method -------------------------- All test suite options are now in one class called SimpleTestOptions. This means that options are set differently... GroupTest::ignore() --> SimpleTestOptions::ignore() Mock::setMockBaseClass() --> SimpleTestOptions::setMockBaseClass() These changed in Alpha8 and the old versions are now removed in RC1. No method setExpected*() ------------------------ The mock expectations changed their names in Alpha4 and the old names ceased to be supported in Alpha8. The changes are... setExpectedArguments() --> expectArguments() setExpectedArgumentsSequence() --> expectArgumentsAt() setExpectedCallCount() --> expectCallCount() setMaximumCallCount() --> expectMaximumCallCount() The parameters remained the same. pgfouine-1.2/tests/simpletest/docs/0000755000175000017500000000000011516212335016046 5ustar acmeacmepgfouine-1.2/tests/simpletest/docs/en/0000755000175000017500000000000011516212335016450 5ustar acmeacmepgfouine-1.2/tests/simpletest/docs/en/expectation_documentation.html0000644000175000017500000003223510334504440024615 0ustar acmeacme Extending the SimpleTest unit tester with additional expectation classes

Expectation documentation

More control over mock objects

The default behaviour of the mock objects in SimpleTest is either an identical match on the argument or to allow any argument at all. For almost all tests this is sufficient. Sometimes, though, you want to weaken a test case.

One place where a test can be too tightly coupled is with text matching. Suppose we have a component that outputs a helpful error message when something goes wrong. You want to test that the correct error was sent, but the actual text may be rather long. If you test for the text exactly, then every time the exact wording of the message changes, you will have to go back and edit the test suite.

For example, suppose we have a news service that has failed to connect to its remote source.

class NewsService {
    ...
    function publish(&$writer) {
        if (! $this->isConnected()) {
            $writer->write('Cannot connect to news service "' .
                    $this->_name . '" at this time. ' .
                    'Please try again later.');
        }
        ...
    }
}
Here it is sending its content to a Writer class. We could test this behaviour with a MockWriter like so...
class TestOfNewsService extends UnitTestCase {
    ...
    function testConnectionFailure() {
        $writer = &new MockWriter($this);
        $writer->expectOnce('write', array(
                'Cannot connect to news service ' .
                '"BBC News" at this time. ' .
                'Please try again later.'));
        
        $service = &new NewsService('BBC News');
        $service->publish($writer);
        
        $writer->tally();
    }
}
This is a good example of a brittle test. If we decide to add additional instructions, such as suggesting an alternative news source, we will break our tests even though no underlying functionality has been altered.

To get around this, we would like to do a regular expression test rather than an exact match. We can actually do this with...

class TestOfNewsService extends UnitTestCase {
    ...
    function testConnectionFailure() {
        $writer = &new MockWriter($this);
        $writer->expectOnce(
                'write',
                array(new WantedPatternExpectation('/cannot connect/i')));
        
        $service = &new NewsService('BBC News');
        $service->publish($writer);
        
        $writer->tally();
    }
}
Instead of passing in the expected parameter to the MockWriter we pass an expectation class called WantedPatternExpectation. The mock object is smart enough to recognise this as special and to treat it differently. Rather than simply comparing the incoming argument to this object, it uses the expectation object itself to perform the test.

The WantedPatternExpectation takes the regular expression to match in its constructor. Whenever a comparison is made by the MockWriter against this expectation class, it will do a preg_match() with this pattern. With our test case above, as long as "cannot connect" appears in the text of the string, the mock will issue a pass to the unit tester. The rest of the text does not matter.

The possible expectation classes are...
EqualExpectationAn equality, rather than the stronger identity comparison
NotEqualExpectationAn inequality comparison
IndenticalExpectationThe default mock object check which must match exactly
NotIndenticalExpectationInverts the mock object logic
WantedPatternExpectationUses a Perl Regex to match a string
NoUnwantedPatternExpectationPasses only if failing a Perl Regex
IsAExpectationChecks the type or class name only
NotAExpectationOpposite of the IsAExpectation
MethodExistsExpectationChecks a method is available on an object
Most take the expected value in the constructor. The exceptions are the pattern matchers, which take a regular expression, and the IsAExpectation and NotAExpectation which takes a type or class name as a string.

Using expectations to control stubs

The expectation classes can be used not just for sending assertions from mock objects, but also for selecting behaviour for either the mock objects or the server stubs. Anywhere a list of arguments is given, a list of expectation objects can be inserted instead.

Suppose we want an authorisation server stub to simulate a successful login only if it receives a valid session object. We can do this as follows...

Stub::generate('Authorisation');

$authorisation = new StubAuthorisation();
$authorisation->setReturnValue(
        'isAllowed',
        true,
        array(new IsAExpectation('Session', 'Must be a session')));
$authorisation->setReturnValue('isAllowed', false);
We have set the default stub behaviour to return false when isAllowed is called. When we call the method with a single parameter that is a Session object, it will return true. We have also added a second parameter as a message. This will be displayed as part of the mock object failure message if this expectation is the cause of a failure.

This kind of sophistication is rarely useful, but is included for completeness.

Creating your own expectations

The expectation classes have a very simple structure. So simple that it is easy to create your own versions for commonly used test logic.

As an example here is the creation of a class to test for valid IP addresses. In order to work correctly with the stubs and mocks the new expectation class should extend SimpleExpectation...

class ValidIp extends SimpleExpectation {
    
    function test($ip) {
        return (ip2long($ip) != -1);
    }
    
    function testMessage($ip) {
        return "Address [$ip] should be a valid IP address";
    }
}
There are only two methods to implement. The test() method should evaluate to true if the expectation is to pass, and false otherwise. The testMessage() method should simply return some helpful text explaining the test that was carried out.

This class can now be used in place of the earlier expectation classes.

Under the bonnet of the unit tester

The SimpleTest unit testing framework also uses the expectation classes internally for the UnitTestCase class. We can also take advantage of these mechanisms to reuse our homebrew expectation classes within the test suites directly.

The most crude way of doing this is to use the SimpleTest::assertExpectation() method to test against it directly...

class TestOfNetworking extends UnitTestCase {
    ...
    function testGetValidIp() {
        $server = &new Server();
        $this->assertExpectation(
                new ValidIp(),
                $server->getIp(),
                'Server IP address->%s');
    }
}
This is a little untidy compared with our usual assert...() syntax.

For such a simple case we would normally create a separate assertion method on our test case rather than bother using the expectation class. If we pretend that our expectation is a little more complicated for a moment, so that we want to reuse it, we get...

class TestOfNetworking extends UnitTestCase {
    ...
    function assertValidIp($ip, $message = '%s') {
        $this->assertExpectation(new ValidIp(), $ip, $message);
    }
    
    function testGetValidIp() {
        $server = &new Server();
        $this->assertValidIp(
                $server->getIp(),
                'Server IP address->%s');
    }
}
It is unlikely we would ever need this degree of control over the testing machinery. It is rare to need the expectations for more than pattern matching. Also, complex expectation classes could make the tests harder to read and debug. These mechanisms are really of most use to authors of systems that will extend the test framework to create their own tool set.

pgfouine-1.2/tests/simpletest/docs/en/docs.css0000644000175000017500000000260610334504440020114 0ustar acmeacmebody { padding-left: 3%; padding-right: 3%; } pre { font-family: courier; font-size: 80%; border: 1px solid; background-color: #cccccc; padding: 5px; margin-left: 5%; margin-right: 8%; } .code, .new_code, pre.new_code { font-weight: bold; } div.copyright { font-size: 80%; color: gray; } div.copyright a { color: gray; } ul.api { padding-left: 0em; padding-right: 25%; } ul.api li { margin-top: 0.2em; margin-bottom: 0.2em; list-style: none; text-indent: -3em; padding-left: 3em; } div.demo { border: 4px ridge; border-color: gray; padding: 10px; margin: 5px; margin-left: 20px; margin-right: 40px; background-color: white; } div.demo span.fail { color: red; } div.demo span.pass { color: green; } div.demo h1 { font-size: 12pt; text-align: left; font-weight: bold; } table { border: 2px outset; border-color: gray; background-color: white; margin: 5px; margin-left: 5%; margin-right: 5%; } td { font-size: 80%; } .shell { color: white; } pre.shell { border: 4px ridge; border-color: gray; padding: 10px; margin: 5px; margin-left: 20px; margin-right: 40px; background-color: black; } form.demo { background-color: lightgray; border: 4px outset; border-color: lightgray; padding: 10px; margin-right: 40%; } pgfouine-1.2/tests/simpletest/docs/en/web_tester_documentation.html0000644000175000017500000004742710334504440024446 0ustar acmeacme Simple Test for PHP web script testing documentation

Web tester documentation

Fetching a page

Testing classes is all very well, but PHP is predominately a language for creating functionality within web pages. How do we test the front end presentation role of our PHP applications? Well the web pages are just text, so we should be able to examine them just like any other test data.

This leads to a tricky issue. If we test at too low a level, testing for matching tags in the page with pattern matching for example, our tests will be brittle. The slightest change in layout could break a large number of tests. If we test at too high a level, say using mock versions of a template engine, then we lose the ability to automate some classes of test. For example, the interaction of forms and navigation will have to be tested manually. These types of test are extremely repetitive and error prone.

SimpleTest includes a special form of test case for the testing of web page actions. The WebTestCase includes facilities for navigation, content and cookie checks and form handling. Usage of these test cases is similar to the UnitTestCase...

class TestOfLastcraft extends WebTestCase {
}
Here we are about to test the Last Craft site itself. If this test case is in a file called lastcraft_test.php then it can be loaded in a runner script just like unit tests...
<?php
    require_once('simpletest/web_tester.php');
    require_once('simpletest/reporter.php');
    
    $test = &new GroupTest('Web site tests');
    $test->addTestFile('lastcraft_test.php');
    exit ($test->run(new TextReporter()) ? 0 : 1);
?>
I am using the text reporter here to more clearly distinguish the web content from the test output.

Nothing is being tested yet. We can fetch the home page by using the get() method...

class TestOfLastcraft extends WebTestCase {
    
    function testHomepage() {
        $this->assertTrue($this->get('http://www.lastcraft.com/'));
    }
}
The get() method will return true only if page content was successfully loaded. It is a simple, but crude way to check that a web page was actually delivered by the web server. However that content may be a 404 response and yet our get() method will still return true.

Assuming that the web server for the Last Craft site is up (sadly not always the case), we should see...

Web site tests
OK
Test cases run: 1/1, Failures: 0, Exceptions: 0
All we have really checked is that any kind of page was returned. We don't yet know if it was the right one.

Testing page content

To confirm that the page we think we are on is actually the page we are on, we need to verify the page content.

class TestOfLastcraft extends WebTestCase {
    
    function testHomepage() {
        $this->get('http://www.lastcraft.com/');
        $this->assertWantedPattern('/why the last craft/i');
    }
}
The page from the last fetch is held in a buffer in the test case, so there is no need to refer to it directly. The pattern match is always made against the buffer.

Here is the list of possible content assertions...
assertTitle($title)Pass if title is an exact match
assertWantedPattern($pattern)A Perl pattern match against the page content
assertNoUnwantedPattern($pattern)A Perl pattern match to not find content
assertWantedText($text)Pass if matches visible and "alt" text
assertNoUnwantedText($text)Pass if doesn't match visible and "alt" text
assertLink($label)Pass if a link with this text is present
assertNoLink($label)Pass if no link with this text is present
assertLinkById($id)Pass if a link with this id attribute is present
assertNoLinkById($id)Pass if no link with this id attribute is present
assertField($name, $value)Pass if an input tag with this name has this value
assertFieldById($id, $value)Pass if an input tag with this id has this value
assertResponse($codes)Pass if HTTP response matches this list
assertMime($types)Pass if MIME type is in this list
assertAuthentication($protocol)Pass if the current challenge is this protocol
assertNoAuthentication()Pass if there is no current challenge
assertRealm($name)Pass if the current challenge realm matches
assertHeader($header, $content)Pass if a header was fetched matching this value
assertNoUnwantedHeader($header)Pass if a header was not fetched
assertHeaderPattern($header, $pattern)Pass if a header was fetched matching this Perl regex
assertCookie($name, $value)Pass if there is currently a matching cookie
assertNoCookie($name)Pass if there is currently no cookie of this name
As usual with the SimpleTest assertions, they all return false on failure and true on pass. They also allow an optional test message and you can embed the original test message inside using "%s" inside your custom message.

So now we could instead test against the title tag with...

$this->assertTitle('The Last Craft? Web developer tutorials on PHP, Extreme programming and Object Oriented development');
As well as the simple HTML content checks we can check that the MIME type is in a list of allowed types with...
$this->assertMime(array('text/plain', 'text/html'));
More interesting is checking the HTTP response code. Like the MIME type, we can assert that the response code is in a list of allowed values...
class TestOfLastcraft extends WebTestCase {
    
    function testRedirects() {
        $this->get('http://www.lastcraft.com/test/redirect.php');
        $this->assertResponse(200);</strong>
    }
}
Here we are checking that the fetch is successful by allowing only a 200 HTTP response. This test will pass, but it is not actually correct to do so. There is no page, instead the server issues a redirect. The WebTestCase will automatically follow up to three such redirects. The tests are more robust this way and we are usually interested in the interaction with the pages rather than their delivery. If the redirects are of interest then this ability must be disabled...
class TestOfLastcraft extends WebTestCase {
    
    function testHomepage() {
        $this->setMaximumRedirects(0);
        $this->get('http://www.lastcraft.com/test/redirect.php');
        $this->assertResponse(200);
    }
}
The assertion now fails as expected...
Web site tests
1) Expecting response in [200] got [302]
	in testhomepage
	in testoflastcraft
	in lastcraft_test.php
FAILURES!!!
Test cases run: 1/1, Failures: 1, Exceptions: 0
We can modify the test to correctly assert redirects with...
class TestOfLastcraft extends WebTestCase {
    
    function testHomepage() {
        $this->setMaximumRedirects(0);
        $this->get('http://www.lastcraft.com/test/redirect.php');
        $this->assertResponse(array(301, 302, 303, 307));
    }
}
This now passes.

Navigating a web site

Users don't often navigate sites by typing in URLs, but by clicking links and buttons. Here we confirm that the contact details can be reached from the home page...

class TestOfLastcraft extends WebTestCase {
    ...
    function testContact() {
        $this->get('http://www.lastcraft.com/');
        $this->clickLink('About');
        $this->assertTitle('About Last Craft');
    }
}
The parameter is the text of the link.

If the target is a button rather than an anchor tag, then clickSubmit() should be used with the button title...

$this->clickSubmit('Go!');

The list of navigation methods is...
getUrl()The current location
get($url, $parameters)Send a GET request with these parameters
post($url, $parameters)Send a POST request with these parameters
head($url, $parameters)Send a HEAD request without replacing the page content
retry()Reload the last request
back()Like the browser back button
forward()Like the browser forward button
authenticate($name, $password)Retry after a challenge
restart()Restarts the browser as if a new session
getCookie($name)Gets the cookie value for the current context
ageCookies($interval)Ages current cookies prior to a restart
clearFrameFocus()Go back to treating all frames as one page
clickSubmit($label)Click the first button with this label
clickSubmitByName($name)Click the button with this name attribute
clickSubmitById($id)Click the button with this ID attribute
clickImage($label, $x, $y)Click an input tag of type image by title or alt text
clickImageByName($name, $x, $y)Click an input tag of type image by name
clickImageById($id, $x, $y)Click an input tag of type image by ID attribute
submitFormById($id)Submit a form without the submit value
clickLink($label, $index)Click an anchor by the visible label text
clickLinkById($id)Click an anchor by the ID attribute
getFrameFocus()The name of the currently selected frame
setFrameFocusByIndex($choice)Focus on a frame counting from 1
setFrameFocus($name)Focus on a frame by name

The parameters in the get(), post() or head() methods are optional. The HTTP HEAD fetch does not change the browser context, only loads cookies. This can be useful for when an image or stylesheet sets a cookie for crafty robot blocking.

The retry(), back() and forward() commands work as they would on your web browser. They use the history to retry pages. This can be handy for checking the effect of hitting the back button on your forms.

The frame methods need a little explanation. By default a framed page is treated just like any other. Content will be searced for throughout the entire frameset, so clicking a link will work no matter which frame the anchor tag is in. You can override this behaviour by focusing on a single frame. If you do that, all searches and actions will apply to that frame alone, such as authentication and retries. If a link or button is not in a focused frame then it cannot be clicked.

Testing navigation on fixed pages only tells you when you have broken an entire script. For highly dynamic pages, such as for bulletin boards, this can be crucial for verifying the correctness of the application. For most applications though, the really tricky logic is usually in the handling of forms and sessions. Fortunately SimpleTest includes tools for testing web forms as well.

Modifying the request

Although SimpleTest does not have the goal of testing networking problems, it does include some methods to modify and debug the requests it makes. Here is another method list...
getTransportError()The last socket error
showRequest()Dump the outgoing request
showHeaders()Dump the incoming headers
showSource()Dump the raw HTML page content
ignoreFrames()Do not load framesets
setCookie($name, $value)Set a cookie from now on
addHeader($header)Always add this header to the request
setMaximumRedirects($max)Stop after this many redirects
setConnectionTimeout($timeout)Kill the connection after this time between bytes
useProxy($proxy, $name, $password)Make requests via this proxy URL
These methods are principally for debugging.

pgfouine-1.2/tests/simpletest/docs/en/index.html0000644000175000017500000004264010334504440020451 0ustar acmeacme Download the Simple Test testing framework - Unit tests and mock objects for PHP

Simple Test for PHP

The following assumes that you are familiar with the concept of unit testing as well as the PHP web development language. It is a guide for the impatient new user of SimpleTest. For fuller documentation, especially if you are new to unit testing see the ongoing documentation, and for example test cases see the unit testing tutorial.

Using the tester quickly

Amongst software testing tools, a unit tester is the one closest to the developer. In the context of agile development the test code sits right next to the source code as both are written simultaneously. In this context SimpleTest aims to be a complete PHP developer test solution and is called "Simple" because it should be easy to use and extend. It wasn't a good choice of name really. It includes all of the typical functions you would expect from JUnit and the PHPUnit ports, but also adds mock objects. It has some JWebUnit functionality as well. This includes web page navigation, cookie testing and form submission.

The quickest way to demonstrate is with an example.

Let us suppose we are testing a simple file logging class called Log in classes/log.php. We start by creating a test script which we will call tests/log_test.php and populate it as follows...

<?php
require_once('simpletest/unit_tester.php');
require_once('simpletest/reporter.php');
require_once('../classes/log.php');
?>
Here the simpletest folder is either local or in the path. You would have to edit these locations depending on where you placed the toolset. Next we create a test case...
<?php
require_once('simpletest/unit_tester.php');
require_once('simpletest/reporter.php');
require_once('../classes/log.php');

class TestOfLogging extends UnitTestCase {
}
?>
Now we have five lines of scaffolding code and still no tests. However from this part on we get return on our investment very quickly. We'll assume that the Log class takes the file name to write to in the constructor and we have a temporary folder in which to place this file...
<?php
require_once('simpletest/unit_tester.php');
require_once('simpletest/reporter.php');
require_once('../classes/log.php');

class TestOfLogging extends UnitTestCase {
    
    function testCreatingNewFile() {
        @unlink('/temp/test.log');
        $log = new Log('/temp/test.log');
        $this->assertFalse(file_exists('/temp/test.log'));
        $log->message('Should write this to a file');
        $this->assertTrue(file_exists('/temp/test.log'));
    }
}
?>
When a test case runs it will search for any method that starts with the string test and execute that method. We would normally have more than one test method of course. Assertions within the test methods trigger messages to the test framework which displays the result immediately. This immediate response is important, not just in the event of the code causing a crash, but also so that print statements can display their content right next to the test case concerned.

To see these results we have to actually run the tests. If this is the only test case we wish to run we can achieve it with...

<?php
require_once('simpletest/unit_tester.php');
require_once('simpletest/reporter.php');
require_once('../classes/log.php');

class TestOfLogging extends UnitTestCase {
    
    function testCreatingNewFile() {
        @unlink('/temp/test.log');
        $log = new Log('/temp/test.log');
        $this->assertFalse(file_exists('/temp/test.log'));
        $log->message('Should write this to a file');
        $this->assertTrue(file_exists('/temp/test.log'));
    }
}

$test = &new TestOfLogging();
$test->run(new HtmlReporter());
?>

On failure the display looks like this...

testoflogging

Fail: testcreatingnewfile->True assertion failed.
1/1 test cases complete. 1 passes and 1 fails.
...and if it passes like this...

testoflogging

1/1 test cases complete. 2 passes and 0 fails.
And if you get this...
Fatal error: Failed opening required '../classes/log.php' (include_path='') in /home/marcus/projects/lastcraft/tutorial_tests/Log/tests/log_test.php on line 7
it means you're missing the classes/Log.php file that could look like...
<?php
class Log {
    
        function Log($file_path) {
        }

		function message() {
		}
}
?>;

Building group tests

It is unlikely in a real application that we will only ever run one test case. This means that we need a way of grouping cases into a test script that can, if need be, run every test in the application.

Our first step is to strip the includes and to undo our previous hack...

<?php
require_once('../classes/log.php');

class TestOfLogging extends UnitTestCase {
    
    function testCreatingNewFile() {
        @unlink('/temp/test.log');
        $log = new Log('/temp/test.log');
        $this->assertFalse(file_exists('/temp/test.log'));
        $log->message('Should write this to a file');
        $this->assertTrue(file_exists('/temp/test.log'));
    }
}
?>
Next we create a new file called tests/all_tests.php and insert the following code...
<?php
require_once('simpletest/unit_tester.php');
require_once('simpletest/reporter.php');

$test = &new GroupTest('All tests');
$test->addTestFile('log_test.php');
$test->run(new HtmlReporter());
?>
The method GroupTest::addTestFile() will include the test case file and read any new classes created that are descended from SimpleTestCase, of which UnitTestCase is one example. Just the class names are stored for now, so that the test runner can instantiate the class when it works its way through your test suite.

For this to work properly the test case file should not blindly include any other test case extensions that do not actually run tests. This could result in extra test cases being counted during the test run. Hardly a major problem, but to avoid this inconvenience simply add a SimpleTestOptions::ignore() directive somewhere in the test case file. Also the test case file should not have been included elsewhere or no cases will be added to this group test. This would be a more serious error as if the test case classes are already loaded by PHP the GroupTest::addTestFile() method will not detect them.

To display the results it is necessary only to invoke tests/all_tests.php from the web server.

Using mock objects

Let's move further into the future.

Assume that our logging class is tested and completed. Assume also that we are testing another class that is required to write log messages, say a SessionPool. We want to test a method that will probably end up looking like this...


class SessionPool {
    ...
    function logIn($username) {
        ...
        $this->_log->message("User $username logged in.");
        ...
    }
    ...
}

In the spirit of reuse we are using our Log class. A conventional test case might look like this...

<?php
require_once('../classes/log.php');
require_once('../classes/session_pool.php');

class TestOfSessionLogging extends UnitTestCase {
    
    function setUp() {
        @unlink('/temp/test.log');
    }
    
    function tearDown() {
        @unlink('/temp/test.log');
    }
    
    function testLogInIsLogged() {
        $log = new Log('/temp/test.log');
        $session_pool = &new SessionPool($log);
        $session_pool->logIn('fred');
        $messages = file('/temp/test.log');
        $this->assertEqual($messages[0], "User fred logged in.\n");
    }
}
?>
This test case design is not all bad, but it could be improved. We are spending time fiddling with log files which are not part of our test. Worse, we have created close ties with the Log class and this test. What if we don't use files any more, but use ths syslog library instead? Did you notice the extra carriage return in the message? Was that added by the logger? What if it also added a time stamp or other data?

The only part that we really want to test is that a particular message was sent to the logger. We reduce coupling if we can pass in a fake logging class that simply records the message calls for testing, but takes no action. It would have to look exactly like our original though.

If the fake object doesn't write to a file then we save on deleting the file before and after each test. We could save even more test code if the fake object would kindly run the assertion for us.

Too good to be true? Luckily we can create such an object easily...
<?php
require_once('../classes/log.php');
require_once('../classes/session_pool.php');
Mock::generate('Log');

class TestOfSessionLogging extends UnitTestCase {
    
    function testLogInIsLogged() {
        $log = &new MockLog($this);
        $log->expectOnce('message', array('User fred logged in.'));
        $session_pool = &new SessionPool($log);
        $session_pool->logIn('fred');
        $log->tally();
    }
}
?>
The tally() call is needed to tell the mock object that time is up for the expected call count. Without it the mock would wait forever for the method call to come in without ever actually notifying the test case. The other test will be triggered when the call to message() is invoked on the MockLog object. The mock call will trigger a parameter comparison and then send the resulting pass or fail event to the test display. Wildcards can be included here too so as to prevent tests becoming too specific.

The mock objects in the SimpleTest suite can have arbitrary return values set, sequences of returns, return values selected according to the incoming arguments, sequences of parameter expectations and limits on the number of times a method is to be invoked.

For this test to run the mock objects library must have been included in the test suite, say in all_tests.php.

Web page testing

One of the requirements of web sites is that they produce web pages. If you are building a project top-down and you want to fully integrate testing along the way then you will want a way of automatically navigating a site and examining output for correctness. This is the job of a web tester.

The web testing in SimpleTest is fairly primitive, there is no JavaScript for example. To give an idea here is a trivial example where a home page is fetched, from which we navigate to an "about" page and then test some client determined content.

<?php
require_once('simpletest/web_tester.php');
require_once('simpletest/reporter.php');

class TestOfAbout extends WebTestCase {
    
    function setUp() {
        $this->get('http://test-server/index.php');
        $this->clickLink('About');
    }
    
    function testSearchEngineOptimisations() {
        $this->assertTitle('A long title about us for search engines');
        $this->assertWantedPattern('/a popular keyphrase/i');
    }
}
$test = &new TestOfAbout();
$test->run(new HtmlReporter());
?>
With this code as an acceptance test you can ensure that the content always meets the specifications of both the developers and the other project stakeholders.

SourceForge.net Logo

pgfouine-1.2/tests/simpletest/docs/en/partial_mocks_documentation.html0000644000175000017500000003446010334504440025124 0ustar acmeacme SimpleTest for PHP partial mocks documentation

Partial mock objects documentation

A partial mock is simply a pattern to alleviate a specific problem in testing with mock objects, that of getting mock objects into tight corners. It's quite a limited tool and possibly not even a good idea. It is included with SimpleTest because I have found it useful on more than one occasion and has saved a lot of work at that point.

The mock injection problem

When one object uses another it is very simple to just pass a mock version in already set up with its expectations. Things are rather tricker if one object creates another and the creator is the one you want to test. This means that the created object should be mocked, but we can hardly tell our class under test to create a mock instead. The tested class doesn't even know it is running inside a test after all.

For example, suppose we are building a telnet client and it needs to create a network socket to pass its messages. The connection method might look something like...

<?php
    require_once('socket.php');
    
    class Telnet {
        ...
        function &connect($ip, $port, $username, $password) {
            $socket = &new Socket($ip, $port);
            $socket->read( ... );
            ...
        }
    }
?>
We would really like to have a mock object version of the socket here, what can we do?

The first solution is to pass the socket in as a parameter, forcing the creation up a level. Having the client handle this is actually a very good approach if you can manage it and should lead to factoring the creation from the doing. In fact, this is one way in which testing with mock objects actually forces you to code more tightly focused solutions. They improve your programming.

Here this would be...

<?php
    require_once('socket.php');
    
    class Telnet {
        ...
        function &connect(&$socket, $username, $password) {
            $socket->read( ... );
            ...
        }
    }
?>
This means that the test code is typical for a test involving mock objects.
class TelnetTest extends UnitTestCase {
    ...
    function testConnection() {
        $socket = &new MockSocket($this);
        ...
        $telnet = &new Telnet();
        $telnet->connect($socket, 'Me', 'Secret');
        ...
    }
}
It is pretty obvious though that one level is all you can go. You would hardly want your top level application creating every low level file, socket and database connection ever needed. It wouldn't know the constructor parameters anyway.

The next simplest compromise is to have the created object passed in as an optional parameter...

<?php
    require_once('socket.php');
    
    class Telnet {
        ...
        function &connect($ip, $port, $username, $password, $socket = false) {
            if (!$socket) {
                $socket = &new Socket($ip, $port);
            }
            $socket->read( ... );
            ...
            return $socket;
        }
    }
?>
For a quick solution this is usually good enough. The test now looks almost the same as if the parameter was formally passed...
class TelnetTest extends UnitTestCase {
    ...
    function testConnection() {
        $socket = &new MockSocket($this);
        ...
        $telnet = &new Telnet();
        $telnet->connect('127.0.0.1', 21, 'Me', 'Secret', &$socket);
        ...
    }
}
The problem with this approach is its untidiness. There is test code in the main class and parameters passed in the test case that are never used. This is a quick and dirty approach, but nevertheless effective in most situations.

The next method is to pass in a factory object to do the creation...

<?php
    require_once('socket.php');
    
    class Telnet {
        function Telnet(&$network) {
            $this->_network = &$network;
        }
        ...
        function &connect($ip, $port, $username, $password) {
            $socket = &$this->_network->createSocket($ip, $port);
            $socket->read( ... );
            ...
            return $socket;
        }
    }
?>
This is probably the most highly factored answer as creation is now moved into a small specialist class. The networking factory can now be tested separately, but mocked easily when we are testing the telnet class...
class TelnetTest extends UnitTestCase {
    ...
    function testConnection() {
        $socket = &new MockSocket($this);
        ...
        $network = &new MockNetwork($this);
        $network->setReturnReference('createSocket', $socket);
        $telnet = &new Telnet($network);
        $telnet->connect('127.0.0.1', 21, 'Me', 'Secret');
        ...
    }
}
The downside is that we are adding a lot more classes to the library. Also we are passing a lot of factories around which will make the code a little less intuitive. The most flexible solution, but the most complex.

Is there a middle ground?

Protected factory method

There is a way we can circumvent the problem without creating any new application classes, but it involves creating a subclass when we do the actual testing. Firstly we move the socket creation into its own method...

<?php
    require_once('socket.php');
    
    class Telnet {
        ...
        function &connect($ip, $port, $username, $password) {
            $socket = &$this->_createSocket($ip, $port);
            $socket->read( ... );
            ...
        }
        
        function &_createSocket($ip, $port) {
            return new Socket($ip, $port);
        }
    }
?>
This is the only change we make to the application code.

For the test case we have to create a subclass so that we can intercept the socket creation...

class TelnetTestVersion extends Telnet {
    var $_mock;
    
    function TelnetTestVersion(&$mock) {
        $this->_mock = &$mock;
        $this->Telnet();
    }
    
    function &_createSocket() {
        return $this->_mock;
    }
}
Here I have passed the mock in the constructor, but a setter would have done just as well. Note that the mock was set into the object variable before the constructor was chained. This is necessary in case the constructor calls connect(). Otherwise it could get a null value from _createSocket().

After the completion of all of this extra work the actual test case is fairly easy. We just test our new class instead...

class TelnetTest extends UnitTestCase {
    ...
    function testConnection() {
        $socket = &new MockSocket($this);
        ...
        $telnet = &new TelnetTestVersion($socket);
        $telnet->connect('127.0.0.1', 21, 'Me', 'Secret');
        ...
    }
}
The new class is very simple of course. It just sets up a return value, rather like a mock. It would be nice if it also checked the incoming parameters as well. Just like a mock. It seems we are likely to do this often, can we automate the subclass creation?

A partial mock

Of course the answer is "yes" or I would have stopped writing this by now! The previous test case was a lot of work, but we can generate the subclass using a similar approach to the mock objects.

Here is the partial mock version of the test...

Mock::generatePartial(
        'Telnet',
        'TelnetTestVersion',
        array('_createSocket'));

class TelnetTest extends UnitTestCase {
    ...
    function testConnection() {
        $socket = &new MockSocket($this);
        ...
        $telnet = &new TelnetTestVersion($this);
        $telnet->setReturnReference('_createSocket', $socket);
        $telnet->Telnet();
        $telnet->connect('127.0.0.1', 21, 'Me', 'Secret');
        ...
    }
}
The partial mock is a subclass of the original with selected methods "knocked out" with test versions. The generatePartial() call takes three parameters: the class to be subclassed, the new test class name and a list of methods to mock.

Instantiating the resulting objects is slightly tricky. The only constructor parameter of a partial mock is the unit tester reference. As with the normal mock objects this is needed for sending test results in response to checked expectations.

The original constructor is not run yet. This is necessary in case the constructor is going to make use of the as yet unset mocked methods. We set any return values at this point and then run the constructor with its normal parameters. This three step construction of "new", followed by setting up the methods, followed by running the constructor proper is what distinguishes the partial mock code.

Apart from construction, all of the mocked methods have the same features as mock objects and all of the unmocked methods behave as before. We can set expectations very easily...

class TelnetTest extends UnitTestCase {
    ...
    function testConnection() {
        $socket = &new MockSocket($this);
        ...
        $telnet = &new TelnetTestVersion($this);
        $telnet->setReturnReference('_createSocket', $socket);
        $telnet->expectOnce('_createSocket', array('127.0.0.1', 21));
        $telnet->Telnet();
        $telnet->connect('127.0.0.1', 21, 'Me', 'Secret');
        ...
        $telnet->tally();
    }
}

Testing less than a class

The mocked out methods don't have to be factory methods, they could be any sort of method. In this way partial mocks allow us to take control of any part of a class except the constructor. We could even go as far as to mock every method except one we actually want to test.

This last situation is all rather hypothetical, as I haven't tried it. I am open to the possibility, but a little worried that forcing object granularity may be better for the code quality. I personally use partial mocks as a way of overriding creation or for occasional testing of the TemplateMethod pattern.

It's all going to come down to the coding standards of your project to decide which mechanism you use.

pgfouine-1.2/tests/simpletest/docs/en/reporter_documentation.html0000644000175000017500000005050210334504440024131 0ustar acmeacme SimpleTest for PHP test runner and display documentation

Test reporter documentation

SimpleTest pretty much follows the MVC pattern (Model-View-Controller). The reporter classes are the view and the model is your test cases and their hiearchy. The controller is mostly hidden from the user of SimpleTest unless you want to change how the test cases are actually run, in which case it is possible to override the runner objects from within the test case. As usual with MVC, the controller is mostly undefined and there are other places to control the test run.

Reporting results in HTML

The default test display is minimal in the extreme. It reports success and failure with the conventional red and green bars and shows a breadcrumb trail of test groups for every failed assertion. Here's a fail...

File test

Fail: createnewfile->True assertion failed.
1/1 test cases complete. 0 passes, 1 fails and 0 exceptions.
And here all tests passed...

File test

1/1 test cases complete. 1 passes, 0 fails and 0 exceptions.
The good news is that there are several points in the display hiearchy for subclassing.

For web page based displays there is the HtmlReporter class with the following signature...

class HtmlReporter extends SimpleReporter {
    public HtmlReporter($encoding) { ... }
    public makeDry(boolean $is_dry) { ... }
    public void paintHeader(string $test_name) { ... }
    public void sendNoCacheHeaders() { ... }
    public void paintFooter(string $test_name) { ... }
    public void paintGroupStart(string $test_name, integer $size) { ... }
    public void paintGroupEnd(string $test_name) { ... }
    public void paintCaseStart(string $test_name) { ... }
    public void paintCaseEnd(string $test_name) { ... }
    public void paintMethodStart(string $test_name) { ... }
    public void paintMethodEnd(string $test_name) { ... }
    public void paintFail(string $message) { ... }
    public void paintPass(string $message) { ... }
    public void paintError(string $message) { ... }
    public void paintException(string $message) { ... }
    public void paintMessage(string $message) { ... }
    public void paintFormattedMessage(string $message) { ... }
    protected string _getCss() { ... }
    public array getTestList() { ... }
    public integer getPassCount() { ... }
    public integer getFailCount() { ... }
    public integer getExceptionCount() { ... }
    public integer getTestCaseCount() { ... }
    public integer getTestCaseProgress() { ... }
}
Here is what some of these methods mean. First the display methods that you will probably want to override...
  • HtmlReporter(string $encoding)
    is the constructor. Note that the unit test sets up the link to the display rather than the other way around. The display is a mostly passive receiver of test events. This allows easy adaption of the display for other test systems beside unit tests, such as monitoring servers. The encoding is the character encoding you wish to display the test output in. In order to correctly render debug output when using the web tester, this should match the encoding of the site you are trying to test. The available character set strings are described in the PHP html_entities() function.
  • void paintHeader(string $test_name)
    is called once at the very start of the test when the first start event arrives. The first start event is usually delivered by the top level group test and so this is where $test_name comes from. It paints the page titles, CSS, body tag, etc. It returns nothing (void).
  • void paintFooter(string $test_name)
    Called at the very end of the test to close any tags opened by the page header. By default it also displays the red/green bar and the final count of results. Actually the end of the test happens when a test end event comes in with the same name as the one that started it all at the same level. The tests nest you see. Closing the last test finishes the display.
  • void paintMethodStart(string $test_name)
    is called at the start of each test method. The name normally comes from method name. The other test start events behave the same way except that the group test one tells the reporter how large it is in number of held test cases. This is so that the reporter can display a progress bar as the runner churns through the test cases.
  • void paintMethodEnd(string $test_name)
    backs out of the test started with the same name.
  • void paintFail(string $message)
    paints a failure. By default it just displays the word fail, a breadcrumbs trail showing the current test nesting and the message issued by the assertion.
  • void paintPass(string $message)
    by default does nothing.
  • string _getCss()
    Returns the CSS styles as a string for the page header method. Additional styles have to be appended here if you are not overriding the page header. You will want to use this method in an overriden page header if you want to include the original CSS.
There are also some accessors to get information on the current state of the test suite. Use these to enrich the display...
  • array getTestList()
    is the first convenience method for subclasses. Lists the current nesting of the tests as a list of test names. The first, most deeply nested test, is first in the list and the current test method will be last.
  • integer getPassCount()
    returns the number of passes chalked up so far. Needed for the display at the end.
  • integer getFailCount()
    is likewise the number of fails so far.
  • integer getExceptionCount()
    is likewise the number of errors so far.
  • integer getTestCaseCount()
    is the total number of test cases in the test run. This includes the grouping tests themselves.
  • integer getTestCaseProgress()
    is the number of test cases completed so far.
One simple modification is to get the HtmlReporter to display the passes as well as the failures and errors...
class ShowPasses extends HtmlReporter {
    
    function paintPass($message) {
        parent::paintPass($message);
        print "&<span class=\"pass\">Pass</span>: ";
        $breadcrumb = $this->getTestList();
        array_shift($breadcrumb);
        print implode("-&gt;", $breadcrumb);
        print "-&gt;$message<br />\n";
    }
    
    function _getCss() {
        return parent::_getCss() . ' .pass { color: green; }';
    }
}

One method that was glossed over was the makeDry() method. If you run this method, with no parameters, on the reporter before the test suite is run no actual test methods will be called. You will still get the events of entering and leaving the test methods and test cases, but no passes or failures etc, because the test code will not actually be executed.

The reason for this is to allow for more sophistcated GUI displays that allow the selection of individual test cases. In order to build a list of possible tests they need a report on the test structure for drawing, say a tree view of the test suite. With a reporter set to dry run that just sends drawing events this is easily accomplished.

Extending the reporter

Rather than simply modifying the existing display, you might want to produce a whole new HTML look, or even generate text or XML. Rather than override every method in HtmlReporter we can take one step up the class hiearchy to SimpleReporter in the simple_test.php source file.

A do nothing display, a blank canvas for your own creation, would be...

require_once('simpletest/simple_test.php');

class MyDisplay extends SimpleReporter {
    
    function paintHeader($test_name) {
    }
    
    function paintFooter($test_name) {
    }
    
    function paintStart($test_name, $size) {
        parent::paintStart($test_name, $size);
    }
    
    function paintEnd($test_name, $size) {
        parent::paintEnd($test_name, $size);
    }
    
    function paintPass($message) {
        parent::paintPass($message);
    }
    
    function paintFail($message) {
        parent::paintFail($message);
    }
}
No output would come from this class until you add it.

The command line reporter

SimpleTest also ships with a minimal command line reporter. The interface mimics JUnit to some extent, but paints the failure messages as they arrive. To use the command line reporter simply substitute it for the HTML version...

<?php
    require_once('simpletest/unit_tester.php');
    require_once('simpletest/reporter.php');

    $test = &new GroupTest('File test');
    $test->addTestFile('tests/file_test.php');
    $test->run(new TextReporter());
?>
Then invoke the test suite from the command line...
php file_test.php
You will need the command line version of PHP installed of course. A passing test suite looks like this...
File test
OK
Test cases run: 1/1, Failures: 0, Exceptions: 0
A failure triggers a display like this...
File test
1) True assertion failed.
	in createnewfile
FAILURES!!!
Test cases run: 1/1, Failures: 1, Exceptions: 0

One of the main reasons for using a command line driven test suite is of using the tester as part of some automated process. To function properly in shell scripts the test script should return a non-zero exit code on failure. If a test suite fails the value false is returned from the SimpleTest::run() method. We can use that result to exit the script with the desired return code...

<?php
    require_once('simpletest/unit_tester.php');
    require_once('simpletest/reporter.php');

    $test = &new GroupTest('File test');
    $test->addTestFile('tests/file_test.php');
    exit ($test->run(new TextReporter()) ? 0 : 1);
?>
Of course we don't really want to create two test scripts, a command line one and a web browser one, for each test suite. The command line reporter includes a method to sniff out the run time environment...
<?php
    require_once('simpletest/unit_tester.php');
    require_once('simpletest/reporter.php');

    $test = &new GroupTest('File test');
    $test->addTestFile('tests/file_test.php');
    if (TextReporter::inCli()) {
        exit ($test->run(new TextReporter()) ? 0 : 1);
    }
    $test->run(new HtmlReporter());
?>
This is the form used within SimpleTest itself.

Remote testing

SimpleTest ships with an XmlReporter class used for internal communication. When run the output looks like...

<?xml version="1.0"?>
<run>
  <group size="4">
    <name>Remote tests</name>
    <group size="4">
      <name>Visual test with 48 passes, 48 fails and 4 exceptions</name>
      <case>
        <name>testofunittestcaseoutput</name>
        <test>
          <name>testofresults</name>
          <pass>This assertion passed</pass>
          <fail>This assertion failed</fail>
        </test>
        <test>
          ...
        </test>
      </case>
    </group>
  </group>
</run>
You can make use of this format with the parser supplied as part of SimpleTest itself. This is called SimpleTestXmlParser and resides in xml.php within the SimpleTest package...
<?php
    require_once('simpletest/xml.php');
    
    ...
    $parser = &new SimpleTestXmlParser(new HtmlReporter());
    $parser->parse($test_output);
?>
The $test_output should be the XML format from the XML reporter, and could come from say a command line run of a test case. The parser sends events to the reporter just like any other test run. There are some odd occasions where this is actually useful.

A problem with large test suites is thet they can exhaust the default 8Mb memory limit on a PHP process. By having the test groups output in XML and run in separate processes, the output can be reparsed to aggregate the results into a much smaller footprint top level test.

Because the XML output can come from anywhere, this opens up the possibility of aggregating test runs from remote servers. A test case already exists to do this within the SimpleTest framework, but it is currently experimental...

<?php
    require_once('../remote.php');
    require_once('../reporter.php');
    
    $test_url = ...;
    $dry_url = ...;
    
    $test = &new GroupTest('Remote tests');
    $test->addTestCase(new RemoteTestCase($test_url, $dry_url));
    $test->run(new HtmlReporter());
?>
The RemoteTestCase takes the actual location of the test runner, basically a web page in XML format. It also takes the URL of a reporter set to do a dry run. This is so that progress can be reported upward correctly. The RemoteTestCase can be added to test suites just like any other group test.

pgfouine-1.2/tests/simpletest/docs/en/authentication_documentation.html0000644000175000017500000002630610334504440025313 0ustar acmeacme SimpleTest documentation for testing log-in and authentication

Authentication documentation

One of the trickiest, and yet most important, areas of testing web sites is the security. Testing these schemes is one of the core goals of the SimpleTest web tester.

Basic HTTP authentication

If you fetch a page protected by basic authentication then rather than receiving content, you will instead get a 401 header. We can illustrate this with this test...

class AuthenticationTest extends WebTestCase {
    function test401Header() {
        $this->get('http://www.lastcraft.com/protected/');
        $this->showHeaders();
    }
}
This allows us to see the challenge header...

File test

HTTP/1.1 401 Authorization Required
Date: Sat, 18 Sep 2004 19:25:18 GMT
Server: Apache/1.3.29 (Unix) PHP/4.3.4
WWW-Authenticate: Basic realm="SimpleTest basic authentication"
Connection: close
Content-Type: text/html; charset=iso-8859-1
1/1 test cases complete. 0 passes, 0 fails and 0 exceptions.
We are trying to get away from visual inspection though, and so SimpleTest allows to make automated assertions against the challenge. Here is a thorough test of our header...
class AuthenticationTest extends WebTestCase {
    function test401Header() {
        $this->get('http://www.lastcraft.com/protected/');
        $this->assertAuthentication('Basic');
        $this->assertResponse(401);
        $this->assertRealm('SimpleTest basic authentication');
    }
}
Any one of these tests would normally do on it's own depending on the amount of detail you want to see.

Most of the time we are not interested in testing the authentication itself, but want to get past it to test the pages underneath. As soon as the challenge has been issued we can reply with an authentication response...

class AuthenticationTest extends WebTestCase {
    function testAuthentication() {
        $this->get('http://www.lastcraft.com/protected/');
        $this->authenticate('Me', 'Secret');
        $this->assertTitle(...);
    }
}
The username and password will now be sent with every subsequent request to that directory and subdirectories. You will have to authenticate again if you step outside the authenticated directory, but SimpleTest is smart enough to merge subdirectories into a common realm.

You can shortcut this step further by encoding the log in details straight into the URL...

class AuthenticationTest extends WebTestCase {
    function testCanReadAuthenticatedPages() {
        $this->get('http://Me:Secret@www.lastcraft.com/protected/');
        $this->assertTitle(...);
    }
}
If your username or password has special characters, then you will have to URL encode them or the request will not be parsed correctly. Also this header will not be sent on subsequent requests if you request a page with a fully qualified URL. If you navigate with relative URLs though, the authentication information will be preserved.

Only basic authentication is currently supported and this is only really secure in tandem with HTTPS connections. This is usually enough to protect test server from prying eyes, however. Digest authentication and NTLM authentication may be added in the future.

Cookies

Basic authentication doesn't give enough control over the user interface for web developers. More likely this functionality will be coded directly into the web architecture using cookies and complicated timeouts.

Starting with a simple log-in form...

<form>
    Username:
    <input type="text" name="u" value="" /><br />
    Password:
    <input type="password" name="p" value="" /><br />
    <input type="submit" value="Log in" />
</form>
Which looks like...

Username:
Password:

Let's suppose that in fetching this page a cookie has been set with a session ID. We are not going to fill the form in yet, just test that we are tracking the user. Here is the test...

class LogInTest extends WebTestCase {
    function testSessionCookieSetBeforeForm() {
        $this->get('http://www.my-site.com/login.php');
        $this->assertCookie('SID');
    }
}
All we are doing is confirming that the cookie is set. As the value is likely to be rather cryptic it's not really worth testing this.

The rest of the test would be the same as any other form, but we might want to confirm that we still have the same cookie after log-in as before we entered. We wouldn't want to lose track of this after all. Here is a possible test for this...

class LogInTest extends WebTestCase {
    ...
    function testSessionCookieSameAfterLogIn() {
        $this->get('http://www.my-site.com/login.php');
        $session = $this->getCookie('SID');
        $this->setField('u', 'Me');
        $this->setField('p', 'Secret');
        $this->clickSubmit('Log in');
        $this->assertWantedPattern('/Welcome Me/');
        $this->assertCookie('SID', $session);
    }
}
This confirms that the session identifier is maintained afer log-in.

We could even attempt to spoof our own system by setting arbitrary cookies to gain access...

class LogInTest extends WebTestCase {
    ...
    function testSessionCookieSameAfterLogIn() {
        $this->get('http://www.my-site.com/login.php');
        $this->setCookie('SID', 'Some other session');
        $this->get('http://www.my-site.com/restricted.php');
        $this->assertWantedPattern('/Access denied/');
    }
}
Is your site protected from this attack?

Browser sessions

If you are testing an authentication system a critical piece of behaviour is what happens when a user logs back in. We would like to simulate closing and reopening a browser...

class LogInTest extends WebTestCase {
    ...
    function testLoseAuthenticationAfterBrowserClose() {
        $this->get('http://www.my-site.com/login.php');
        $this->setField('u', 'Me');
        $this->setField('p', 'Secret');
        $this->clickSubmit('Log in');
        $this->assertWantedPattern('/Welcome Me/');
        
        $this->restart();
        $this->get('http://www.my-site.com/restricted.php');
        $this->assertWantedPattern('/Access denied/');
    }
}
The WebTestCase::restart() method will preserve cookies that have unexpired timeouts, but throw away those that are temporary or expired. You can optionally specify the time and date that the restart happened.

Expiring cookies can be a problem. After all, if you have a cookie that expires after an hour, you don't want to stall the test for an hour while the cookie passes it's timeout.

To push the cookies over the hour limit you can age them before you restart the session...

class LogInTest extends WebTestCase {
    ...
    function testLoseAuthenticationAfterOneHour() {
        $this->get('http://www.my-site.com/login.php');
        $this->setField('u', 'Me');
        $this->setField('p', 'Secret');
        $this->clickSubmit('Log in');
        $this->assertWantedPattern('/Welcome Me/');
        
        $this->ageCookies(3600);
        $this->restart();
        $this->get('http://www.my-site.com/restricted.php');
        $this->assertWantedPattern('/Access denied/');
    }
}
After the restart it will appear that cookies are an hour older and any that pass their expiry will have disappeared.

pgfouine-1.2/tests/simpletest/docs/en/group_test_documentation.html0000644000175000017500000003003510334504440024461 0ustar acmeacme SimpleTest for PHP group test documentation

Group Test documentation

Grouping tests

To run test cases as part of a group the test cases should really be placed in files without the runner code...

<?php
    require_once('../classes/io.php');

    class FileTester extends UnitTestCase {
        ...
    }

    class SocketTester extends UnitTestCase {
        ...
    }
?>
As many cases as needed can appear in a single file. They should include any code they need, such as the library being tested, but none of the simple test libraries.

If you have extended any test cases, you can include them as well.

<?php
    require_once('../classes/io.php');

    class MyFileTestCase extends UnitTestCase {
        ...
    }
    SimpleTestOptions::ignore('MyFileTestCase');

    class FileTester extends MyFileTestCase {
        ...
    }

    class SocketTester extends UnitTestCase {
        ...
    }
?>
The FileTester class does not contain any actual tests, but is a base class for other test cases. For this reason we use the SimpleTestOptions::ignore() directive to tell the upcoming group test to ignore it. This directive can appear anywhere in the file and works when a whole file of test cases is loaded (see below). We will call this sample file_test.php.

Next we create a group test file, called say group_test.php. You will think of a better name I am sure. We will add the test file using a safe method...

<?php
    require_once('simpletest/unit_tester.php');
    require_once('simpletest/reporter.php');
    require_once('file_test.php');

    $test = &new GroupTest('All file tests');
    $test->addTestCase(new FileTestCase());
    $test->run(new HtmlReporter());
?>
This instantiates the test case before the test suite is run. This could get a little expensive with a large number of test cases, so another method is provided that will only instantiate the class when it is needed...
<?php
    require_once('simpletest/unit_tester.php');
    require_once('simpletest/reporter.php');
    require_once('file_test.php');

    $test = &new GroupTest('All file tests');
    $test->addTestClass('FileTestCase');
    $test->run(new HtmlReporter());
?>
The problem with this method is that for every test case that we add we will have to require_once() the test code file and manually instantiate each and every test case. We can save a lot of typing with...
<?php
    require_once('simpletest/unit_tester.php');
    require_once('simpletest/reporter.php');

    $test = &new GroupTest('All file tests');
    $test->addTestFile('file_test.php');
    $test->run(new HtmlReporter());
?&gt;
What happens here is that the GroupTest class has done the require_once() for us. It then checks to see if any new test case classes have been created by the new file and automatically adds them to the group test. Now all we have to do is add each new file.

There are two things that could go wrong and which require care...

  1. The file could already have been parsed by PHP and so no new classes will have been added. You should make sure that the test cases are only included in this file and no others.
  2. New test case extension classes that get included will be placed in the group test and run also. You will need to add a SimpleTestOptions::ignore() directive for these classes or make sure that they are included before the GroupTest::addTestFile() line.

Higher groupings

The above method places all of the test cases into one large group. For larger projects though this may not be flexible enough; you may want to group the tests in all sorts of ways.

To get a more flexible group test we can subclass GroupTest and then instantiate it as needed...

<?php
    require_once('simpletest/unit_tester.php');
    require_once('simpletest/reporter.php');
    
    class FileGroupTest extends GroupTest {
        function FileGroupTest() {
            $this->GroupTest('All file tests');
            $this->addTestFile('file_test.php');
        }
    }
?>
This effectively names the test in the constructor and then adds our test cases and a single group below. Of course we can add more than one group at this point. We can now invoke the tests from a separate runner file...
<?php
    require_once('file_group_test.php');
    
    $test = &new FileGroupTest();
    $test->run(new HtmlReporter());
?>
...or we can group them into even larger group tests...
<?php
    require_once('file_group_test.php');
    
    $test = &new BigGroupTest('Big group');
    $test->addTestCase(new FileGroupTest());
    $test->addTestCase(...);
    $test->run(new HtmlReporter());
?>
If we still wish to run the original group test and we don't want all of these little runner files, we can put the test runner code around guard bars when we create each group.
<?php
    class FileGroupTest extends GroupTest {
        function FileGroupTest() {
            $this->GroupTest('All file tests');
            $test->addTestFile('file_test.php');
        }
    }
    
    if (! defined('RUNNER')) {
        define('RUNNER', true);
        $test = &new FileGroupTest();
        $test->run(new HtmlReporter());
    }
?>
This approach requires the guard to be set when including the group test file, but this is still less hassle than lots of separate runner files. You include the same guard on the top level tests to make sure that run() will run once only from the top level script that has been invoked.
<?php
    define('RUNNER', true);
    require_once('file_group_test.php');

    $test = &new BigGroupTest('Big group');
    $test->addTestCase(new FileGroupTest());
    $test->addTestCase(...);
    $test->run(new HtmlReporter());
?>
As with the normal test cases, a GroupTest can be loaded with the GroupTest::addTestFile() method.
<?php
    define('RUNNER', true);

    $test = &new BigGroupTest('Big group');
    $test->addTestFile('file_group_test.php');
    $test->addTestFile(...);
    $test->run(new HtmlReporter());
?>

Integrating legacy test cases

If you already have unit tests for your code or are extending external classes that have tests, it is unlikely that all of the test cases are in SimpleTest format. Fortunately it is possible to incorporate test cases from other unit testers directly into SimpleTest group tests.

Say we have the following PhpUnit test case in the file config_test.php...

class ConfigFileTest extends TestCase {
    function ConfigFileTest() {
        $this->TestCase('Config file test');
    }
    
    function testContents() {
        $config = new ConfigFile('test.conf');
        $this->assertRegexp('/me/', $config->getValue('username'));
    }
}
The group test can recognise this as long as we include the appropriate adapter class before we add the test file...
<?php
    require_once('simpletest/unit_tester.php');
    require_once('simpletest/reporter.php');
    require_once('simpletest/adapters/phpunit_test_case.php');

    $test = &new GroupTest('All file tests');
    $test->addTestFile('config_test.php');
    $test->run(new HtmlReporter());
?>
There are only two adapters, the other is for the PEAR 1.0 unit tester...
<?php
    require_once('simpletest/unit_tester.php');
    require_once('simpletest/reporter.php');
    require_once('simpletest/adapters/pear_test_case.php');

    $test = &new GroupTest('All file tests');
    $test->addTestFile('some_pear_test_cases.php');
    $test->run(new HtmlReporter());
?>
The PEAR test cases can be freely mixed with SimpleTest ones even in the same test file, but you cannot use SimpleTest assertions in the legacy test case versions. This is done as a check that you are not accidently making your test cases completely dependent on SimpleTest. You may want to do a PEAR release of your library for example which would mean shipping it with valid PEAR::PhpUnit test cases.

pgfouine-1.2/tests/simpletest/docs/en/browser_documentation.html0000644000175000017500000003653010334504440023757 0ustar acmeacme SimpleTest documentation for the scriptable web browser component

PHP Scriptable Web Browser

SimpleTest's web browser component can be used not just outside of the WebTestCase class, but also independently of the SimpleTest framework itself.

The Scriptable Browser

You can use the web browser in PHP scripts to confirm services are up and running, or to extract information from them at a regular basis. For example, here is a small script to extract the current number of open PHP 5 bugs from the PHP web site...

<?php
    require_once('simpletest/browser.php');
    
    $browser = &new SimpleBrowser();
    $browser->get('http://php.net/');
    $browser->clickLink('reporting bugs');
    $browser->clickLink('statistics');
    $page = $browser->clickLink('PHP 5 bugs only');
    preg_match('/status=Open.*?by=Any.*?(\d+)<\/a>/', $page, $matches);
    print $matches[1];
?>
There are simpler methods to do this particular example in PHP of course. For example you can just use the PHP file() command against what here is a pretty fixed page. However, using the web browser for scripts allows authentication, correct handling of cookies, automatic loading of frames, redirects, form submission and the ability to examine the page headers. Such methods are fragile against a site that is constantly evolving and you would want a more direct way of accessing data in a permanent set up, but for simple tasks this can provide a very rapid solution.

All of the navigation methods used in the WebTestCase are present in the SimpleBrowser class, but the assertions are replaced with simpler accessors. Here is a full list of the page navigation methods...
addHeader($header)Adds a header to every fetch
useProxy($proxy, $username, $password)Use this proxy from now on
head($url, $parameters)Perform a HEAD request
get($url, $parameters)Fetch a page with GET
post($url, $parameters)Fetch a page with POST
clickLink($label)Follows a link by label
isLink($label)See if a link is present by label
clickLinkById($id)Follows a link by attribute
isLinkById($id)See if a link is present by attribut
getUrl()Current URL of page or frame
getTitle()Page title
getContent()Raw page or frame
getContentAsText()HTML removed except for alt text
retry()Repeat the last request
back()Use the browser back button
forward()Use the browser forward button
authenticate($username, $password)Retry page or frame after a 401 response
restart($date)Restarts the browser for a new session
ageCookies($interval)Ages the cookies by the specified time
setCookie($name, $value)Sets an additional cookie
getCookieValue($host, $path, $name)Reads the most specific cookie
getCurrentCookieValue($name)Reads cookie for the current context
The methods SimpleBrowser::useProxy() and SimpleBrowser::addHeader() are special. Once called they continue to apply to all subsequent fetches.

Navigating forms is similar to the WebTestCase form navigation...
setField($name, $value)Sets all form fields with that name
setFieldById($id, $value)Sets all form fields with that id
getField($name)Accessor for a form element value
getFieldById($id)Accessor for a form element value
clickSubmit($label)Submits form by button label
clickSubmitByName($name)Submits form by button attribute
clickSubmitById($id)Submits form by button attribute
clickImage($label, $x, $y)Clicks the image by alt text
clickImageByName($name, $x, $y)Clicks the image by attribute
clickImageById($id, $x, $y)Clicks the image by attribute
submitFormById($id)Submits by the form tag attribute
At the moment there aren't any methods to list available forms and fields. This will probably be added to later versions of SimpleTest.

Within a page, individual frames can be selected. If no selection is made then all the frames are merged together in one large conceptual page. The content of the current page will be a concatenation of all of the frames in the order that they were specified in the "frameset" tags.
getFrames()A dump of the current frame structure
getFrameFocus()Current frame label or index
setFrameFocusByIndex($choice)Select a frame numbered from 1
setFrameFocus($name)Select frame by label
clearFrameFocus()Treat all the frames as a single page
When focused on a single frame, the content will come from that frame only. This includes links to click and forms to submit.

What went wrong?

All of this functionality is great when we actually manage to fetch pages, but that doesn't always happen. To help figure out what went wrong, the browser has some methods to aid in debugging...
setConnectionTimeout($timeout)Close the socket on overrun
getRequest()Raw request header of page or frame
getHeaders()Raw response header of page or frame
getTransportError()Any socket level errors in the last fetch
getResponseCode()HTTP response of page or frame
getMimeType()Mime type of page or frame
getAuthentication()Authentication type in 401 challenge header
getRealm()Authentication realm in 401 challenge header
setMaximumRedirects($max)Number of redirects before page is loaded anyway
setMaximumNestedFrames($max)Protection against recursive framesets
ignoreFrames()Disables frames support
useFrames()Enables frames support
The methods SimpleBrowser::setConnectionTimeout() SimpleBrowser::setMaximumRedirects(), SimpleBrowser::setMaximumNestedFrames(), SimpleBrowser::ignoreFrames() and SimpleBrowser::useFrames() continue to apply to every subsequent request. The other methods are frames aware. This means that if you have an individual frame that is not loading, navigate to it using SimpleBrowser::setFrameFocus() and you can then use SimpleBrowser::getRequest(), etc to see what happened.

Complex unit tests with multiple browsers

Anything that could be done in a WebTestCase can now be done in a UnitTestCase. This means that we can freely mix domain object testing with the web interface...


class TestOfRegistration extends UnitTestCase {
    function testNewUserAddedToAuthenticator() {
        $browser = &new SimpleBrowser();
        $browser->get('http://my-site.com/register.php');
        $browser->setField('email', 'me@here');
        $browser->setField('password', 'Secret');
        $browser->clickSubmit('Register');
        
        $authenticator = &new Authenticator();
        $member = &$authenticator->findByEmail('me@here');
        $this->assertEqual($member->getPassword(), 'Secret');
    }
}
While this may be a useful temporary expediency, I am not a fan of this type of testing. The testing has cut across application layers, make it twice as likely it will need refactoring when the code changes.

A more useful case of where using the browser directly can be helpful is where the WebTestCase cannot cope. An example is where two browsers are needed at the same time.

For example, say we want to disallow multiple simultaneous usage of a site with the same username. This test case will do the job...

class TestOfSecurity extends UnitTestCase {
    function testNoMultipleLoginsFromSameUser() {
        $first = &new SimpleBrowser();
        $first->get('http://my-site.com/login.php');
        $first->setField('name', 'Me');
        $first->setField('password', 'Secret');
        $first->clickSubmit('Enter');
        $this->assertEqual($first->getTitle(), 'Welcome');
        
        $second = &new SimpleBrowser();
        $second->get('http://my-site.com/login.php');
        $second->setField('name', 'Me');
        $second->setField('password', 'Secret');
        $second->clickSubmit('Enter');
        $this->assertEqual($second->getTitle(), 'Access Denied');
    }
}
You can also use the SimpleBrowser class directly when you want to write test cases using a different test tool than SimpleTest.

pgfouine-1.2/tests/simpletest/docs/en/mock_objects_documentation.html0000644000175000017500000007100410334504440024731 0ustar acmeacme SimpleTest for PHP mock objects documentation

Mock objects documentation

What are mock objects?

Mock objects have two roles during a test case: actor and critic.

The actor behaviour is to simulate objects that are difficult to set up or time consuming to set up for a test. The classic example is a database connection. Setting up a test database at the start of each test would slow testing to a crawl and would require the installation of the database engine and test data on the test machine. If we can simulate the connection and return data of our choosing we not only win on the pragmatics of testing, but can also feed our code spurious data to see how it responds. We can simulate databases being down or other extremes without having to create a broken database for real. In other words, we get greater control of the test environment.

If mock objects only behaved as actors they would simply be known as server stubs.

However, the mock objects not only play a part (by supplying chosen return values on demand) they are also sensitive to the messages sent to them (via expectations). By setting expected parameters for a method call they act as a guard that the calls upon them are made correctly. If expectations are not met they save us the effort of writing a failed test assertion by performing that duty on our behalf. In the case of an imaginary database connection they can test that the query, say SQL, was correctly formed by the object that is using the connection. Set them up with fairly tight expectations and you will hardly need manual assertions at all.

Creating mock objects

In the same way that we create server stubs, all we need is an existing class, say a database connection that looks like this...

class DatabaseConnection {
    function DatabaseConnection() {
    }
    
    function query() {
    }
    
    function selectQuery() {
    }
}
The class does not need to have been implemented yet. To create a mock version of the class we need to include the mock object library and run the generator...
require_once('simpletest/unit_tester.php');
require_once('simpletest/mock_objects.php');
require_once('database_connection.php');

Mock::generate('DatabaseConnection');
This generates a clone class called MockDatabaseConnection. We can now create instances of the new class within our test case...
require_once('simpletest/unit_tester.php');
require_once('simpletest/mock_objects.php');
require_once('database_connection.php');

Mock::generate('DatabaseConnection');

class MyTestCase extends UnitTestCase {
    
    function testSomething() {
        $connection = &new MockDatabaseConnection($this);
    }
}
Unlike the generated stubs the mock constructor needs a reference to the test case so that it can dispatch passes and failures while checking its expectations. This means that mock objects can only be used within test cases. Despite this their extra power means that stubs are hardly ever used if mocks are available.

Mocks as actors

The mock version of a class has all the methods of the original so that operations like $connection->query() are still legal. As with stubs we can replace the default null return values...

$connection->setReturnValue('query', 37);
Now every time we call $connection->query() we get the result of 37. As with the stubs we can set wildcards and we can overload the wildcard parameter. We can also add extra methods to the mock when generating it and choose our own class name...
Mock::generate('DatabaseConnection', 'MyMockDatabaseConnection', array('setOptions'));
Here the mock will behave as if the setOptions() existed in the original class. This is handy if a class has used the PHP overload() mechanism to add dynamic methods. You can create a special mock to simulate this situation.

All of the patterns available with server stubs are available to mock objects...

class Iterator {
    function Iterator() {
    }
    
    function next() {
    }
}
Again, assuming that this iterator only returns text until it reaches the end, when it returns false, we can simulate it with...
Mock::generate('Iterator');

class IteratorTest extends UnitTestCase() {
    
    function testASequence() {
        $iterator = &new MockIterator($this);
        $iterator->setReturnValue('next', false);
        $iterator->setReturnValueAt(0, 'next', 'First string');
        $iterator->setReturnValueAt(1, 'next', 'Second string');
        ...
    }
}
When next() is called on the mock iterator it will first return "First string", on the second call "Second string" will be returned and on any other call false will be returned. The sequenced return values take precedence over the constant return value. The constant one is a kind of default if you like.

A repeat of the stubbed information holder with name/value pairs...

class Configuration {
    function Configuration() {
    }
    
    function getValue($key) {
    }
}
This is a classic situation for using mock objects as actual configuration will vary from machine to machine, hardly helping the reliability of our tests if we use it directly. The problem though is that all the data comes through the getValue() method and yet we want different results for different keys. Luckily the mocks have a filter system...
$config = &new MockConfiguration($this);
$config->setReturnValue('getValue', 'primary', array('db_host'));
$config->setReturnValue('getValue', 'admin', array('db_user'));
$config->setReturnValue('getValue', 'secret', array('db_password'));
The extra parameter is a list of arguments to attempt to match. In this case we are trying to match only one argument which is the look up key. Now when the mock object has the getValue() method invoked like this...
$config->getValue('db_user')
...it will return "admin". It finds this by attempting to match the calling arguments to its list of returns one after another until a complete match is found.

There are times when you want a specific object to be dished out by the mock rather than a copy. Again this is identical to the server stubs mechanism...

class Thing {
}

class Vector {
    function Vector() {
    }
    
    function get($index) {
    }
}
In this case you can set a reference into the mock's return list...
$thing = new Thing();
$vector = &new MockVector($this);
$vector->setReturnReference('get', $thing, array(12));
With this arrangement you know that every time $vector->get(12) is called it will return the same $thing each time.

Mocks as critics

Although the server stubs approach insulates your tests from real world disruption, it is only half the benefit. You can have the class under test receiving the required messages, but is your new class sending correct ones? Testing this can get messy without a mock objects library.

By way of example, suppose we have a SessionPool class that we want to add logging to. Rather than grow the original class into something more complicated, we want to add this behaviour with a decorator (GOF). The SessionPool code currently looks like this...

class SessionPool {
    function SessionPool() {
        ...
    }
    
    function &findSession($cookie) {
        ...
    }
    ...
}

class Session {
    ...
}
</php>
                While our logging code looks like this...
<php>
class Log {
    function Log() {
        ...
    }
    
    function message() {
        ...
    }
}

class LoggingSessionPool {
    function LoggingSessionPool(&$session_pool, &$log) {
        ...
    }
    
    function &findSession(\$cookie) {
        ...
    }
    ...
}
Out of all of this, the only class we want to test here is the LoggingSessionPool. In particular we would like to check that the findSession() method is called with the correct session ID in the cookie and that it sent the message "Starting session $cookie" to the logger.

Despite the fact that we are testing only a few lines of production code, here is what we would have to do in a conventional test case:

  1. Create a log object.
  2. Set a directory to place the log file.
  3. Set the directory permissions so we can write the log.
  4. Create a SessionPool object.
  5. Hand start a session, which probably does lot's of things.
  6. Invoke findSession().
  7. Read the new Session ID (hope there is an accessor!).
  8. Raise a test assertion to confirm that the ID matches the cookie.
  9. Read the last line of the log file.
  10. Pattern match out the extra logging timestamps, etc.
  11. Assert that the session message is contained in the text.
It is hardly surprising that developers hate writing tests when they are this much drudgery. To make things worse, every time the logging format changes or the method of creating new sessions changes, we have to rewrite parts of this test even though this test does not officially test those parts of the system. We are creating headaches for the writers of these other classes.

Instead, here is the complete test method using mock object magic...

Mock::generate('Session');
Mock::generate('SessionPool');
Mock::generate('Log');

class LoggingSessionPoolTest extends UnitTestCase {
    ...
    function testFindSessionLogging() {
        $session = &new MockSession($this);
        $pool = &new MockSessionPool($this);
        $pool->setReturnReference('findSession', $session);
        $pool->expectOnce('findSession', array('abc'));
        
        $log = &new MockLog($this);
        $log->expectOnce('message', array('Starting session abc'));
        
        $logging_pool = &new LoggingSessionPool($pool, $log);
        $this->assertReference($logging_pool->findSession('abc'), $session);
        $pool->tally();
        $log->tally();
    }
}
We start by creating a dummy session. We don't have to be too fussy about this as the check for which session we want is done elsewhere. We only need to check that it was the same one that came from the session pool.

findSession() is a factory method the simulation of which is described above. The point of departure comes with the first expectOnce() call. This line states that whenever findSession() is invoked on the mock, it will test the incoming arguments. If it receives the single argument of a string "abc" then a test pass is sent to the unit tester, otherwise a fail is generated. This was the part where we checked that the right session was asked for. The argument list follows the same format as the one for setting return values. You can have wildcards and sequences and the order of evaluation is the same.

If the call is never made then neither a pass nor a failure will generated. To get around this we must tell the mock when the test is over so that the object can decide if the expectation has been met. The unit tester assertion for this is triggered by the tally() call at the end of the test.

We use the same pattern to set up the mock logger. We tell it that it should have message() invoked once only with the argument "Starting session abc". By testing the calling arguments, rather than the logger output, we insulate the test from any display changes in the logger.

We start to run our tests when we create the new LoggingSessionPool and feed it our preset mock objects. Everything is now under our control. Finally we confirm that the $session we gave our decorator is the one that we get back and tell the mocks to run their internal call count tests with the tally() calls.

This is still quite a bit of test code, but the code is very strict. If it still seems rather daunting there is a lot less of it than if we tried this without mocks and this particular test, interactions rather than output, is always more work to set up. More often you will be testing more complex situations without needing this level or precision. Also some of this can be refactored into a test case setUp() method.

Here is the full list of expectations you can set on a mock object in SimpleTest...
ExpectationNeeds tally()
expectArguments($method, $args) No
expectArgumentsAt($timing, $method, $args) No
expectCallCount($method, $count) Yes
expectMaximumCallCount($method, $count) No
expectMinimumCallCount($method, $count) Yes
expectNever($method) No
expectOnce($method, $args) Yes
expectAtLeastOnce($method, $args) Yes
Where the parameters are...

$method
The method name, as a string, to apply the condition to.
$args
The arguments as a list. Wildcards can be included in the same manner as for setReturn(). This argument is optional for expectOnce() and expectAtLeastOnce().
$timing
The only point in time to test the condition. The first call starts at zero.
$count
The number of calls expected.
The method expectMaximumCallCount() is slightly different in that it will only ever generate a failure. It is silent if the limit is never reached.

Like the assertions within test cases, all of the expectations can take a message override as an extra parameter. Also the original failure message can be embedded in the output as "%s".

Other approaches

There are three approaches to creating mocks including the one that SimpleTest employs. Coding them by hand using a base class, generating them to a file and dynamically generating them on the fly.

Mock objects generated with SimpleTest are dynamic. They are created at run time in memory, using eval(), rather than written out to a file. This makes the mocks easy to create, a one liner, especially compared with hand crafting them in a parallel class hierarchy. The problem is that the behaviour is usually set up in the tests themselves. If the original objects change the mock versions that the tests rely on can get out of sync. This can happen with the parallel hierarchy approach as well, but is far more quickly detected.

The solution, of course, is to add some real integration tests. You don't need very many and the convenience gained from the mocks more than outweighs the small amount of extra testing. You cannot trust code that was only tested with mocks.

If you are still determined to build static libraries of mocks because you want to simulate very specific behaviour, you can achieve the same effect using the SimpleTest class generator. In your library file, say mocks/connection.php for a database connection, create a mock and inherit to override special methods or add presets...

<?php
    require_once('simpletest/mock_objects.php');
    require_once('../classes/connection.php');

    Mock::generate('Connection', 'BasicMockConnection');
    class MockConnection extends BasicMockConnection {
        function MockConnection(&$test, $wildcard = '*') {
            $this->BasicMockConnection($test, $wildcard);
            $this->setReturn('query', false);
        }
    }
?>
The generate call tells the class generator to create a class called BasicMockConnection rather than the usual MockConnection. We then inherit from this to get our version of MockConnection. By intercepting in this way we can add behaviour, here setting the default value of query() to be false. By using the default name we make sure that the mock class generator will not recreate a different one when invoked elsewhere in the tests. It never creates a class if it already exists. As long as the above file is included first then all tests that generated MockConnection should now be using our one instead. If we don't get the order right and the mock library creates one first then the class creation will simply fail.

Use this trick if you find you have a lot of common mock behaviour or you are getting frequent integration problems at later stages of testing.

I think SimpleTest stinks!

But at the time of writing it is the only one with mock objects, so are you stuck with it?

No, not at all. SimpleTest is a toolkit and one of those tools is the mock objects which can be employed independently. Suppose you have your own favourite unit tester and all your current test cases are written using it. Pretend that you have called your unit tester PHPUnit (everyone else has) and the core test class looks like this...

class PHPUnit {
    function PHPUnit() {
    }
    
    function assertion($message, $assertion) {
    }
    ...
}
All the assertion() method does is print some fancy output and the boolean assertion parameter determines whether to print a pass or a failure. Let's say that it is used like this...
$unit_test = new PHPUnit();
$unit_test>assertion('I hope this file exists', file_exists('my_file'));
How do you use mocks with this?

There is a protected method on the base mock class SimpleMock called _assertTrue() and by overriding this method we can use our own assertion format. We start with a subclass, in say my_mock.php...

<?php
    require_once('simpletest/mock_objects.php');
    
    class MyMock extends SimpleMock() {
        function MyMock(&$test, $wildcard) {
            $this->SimpleMock($test, $wildcard);
        }
        
        function _assertTrue($assertion, $message) {
            $test = &$this->getTest();
            $test->assertion($message, $assertion);
        }
    }
?>
Now instantiating MyMock will create an object that speaks the same language as your tester. The catch is of course that we never create such an object, the code generator does. We need just one more line of code to tell the generator to use your mock instead...
<?php
    require_once('simpletst/mock_objects.php');
    
    class MyMock extends SimpleMock() {
        function MyMock($test, $wildcard) {
            $this->SimpleMock(&$test, $wildcard);
        }
        
        function _assertTrue($assertion, $message , &$test) {
            $test->assertion($message, $assertion);
        }
    }
    SimpleTestOptions::setMockBaseClass('MyMock');
?>
From now on you just include my_mock.php instead of the default mock_objects.php version and you can introduce mock objects into your existing test suite.

pgfouine-1.2/tests/simpletest/docs/en/overview.html0000644000175000017500000004533410334504440021213 0ustar acmeacme Overview and feature list for the SimpleTest PHP unit tester and web tester

Overview of SimpleTest

What is SimpleTest?

The heart of SimpleTest is a testing framework built around test case classes. These are written as extensions of base test case classes, each extended with methods that actually contain test code. Top level test scripts then invoke the run() methods on every one of these test cases in order. Each test method is written to invoke various assertions that the developer expects to be true such as assertEqual(). If the expectation is correct, then a successful result is dispatched to the observing test reporter, but any failure triggers an alert and a description of the mismatch.

A test case looks like this...

<?php
class MyTestCase extends UnitTestCase {
    
    function testLog() {
        $log = &new Log('my.log');
        $log->message('Hello');
        $this->assertTrue(file_exists('my.log'));
    }
}
?>

These tools are designed for the developer. Tests are written in the PHP language itself more or less as the application itself is built. The advantage of using PHP itself as the testing language is that there are no new languages to learn, testing can start straight away, and the developer can test any part of the code. Basically, all parts that can be accessed by the application code can also be accessed by the test code if they are in the same language.

The simplest type of test case is the UnitTestCase. This class of test case includes standard tests for equality, references and pattern matching. All these test the typical expectations of what you would expect the result of a function or method to be. This is by far the most common type of test in the daily routine of development, making up about 95% of test cases.

The top level task of a web application though is not to produce correct output from its methods and objects, but to generate web pages. The WebTestCase class tests web pages. It simulates a web browser requesting a page, complete with cookies, proxies, secure connections, authentication, forms, frames and most navigation elements. With this type of test case, the developer can assert that information is present in the page and that forms and sessions are handled correctly.

A WebTestCase looks like this...

<?php
class MySiteTest extends WebTestCase {
    
    function testHomePage() {
        $this->get('http://www.my-site.com/index.php');
        $this->assertTitle('My Home Page');
        $this->clickLink('Contact');
        $this->assertTitle('Contact me');
        $this->assertWantedPattern('/Email me at/');
    }
}
?>

Feature list

The following is a very rough outline of past and future features and their expected point of release. I am afraid it is liable to change without warning as meeting the milestones rather depends on time available. Green stuff has been coded, but not necessarily released yet. If you have a pressing need for a green but unreleased feature then you should check-out the code from sourceforge CVS directly. A released feature is marked as "Done".
FeatureDescriptionRelease
Unit test case Core test case class and assertions Done
Html display Simplest possible display Done
Autoloading of test cases Reading a file with test cases and loading them into a group test automatically Done
Mock objects code generator Objects capable of simulating other objects removing test dependencies Done
Server stubs Mocks without expectations to be used outside of test cases, e.g. for prototyping Done
Integration of other unit testers The ability to read and simulate test cases from PHPUnit and PEAR::PhpUnit Done
Web test case Basic pattern matching of fetched pages Done
HTML parsing of pages Allows link following and title tag matching Done
Partial mocks Mocking parts of a class for testing less than a class or for complex simulations Done
Web cookie handling Correct handling of cookies when fetching pages Done
Following redirects Page fetching automatically follows 300 redirects Done
Form parsing Ability to submit simple forms and read default form values Done
Command line interface Test display without the need of a web browser Done
Exposure of expectation classes Can create precise tests with mocks as well as test cases Done
XML output and parsing Allows multi host testing and the integration of acceptance testing extensions Done
Command line test case Allows testing of utilities and file handling Done
PHP Documentor compatibility Fully generated class level documentation Done
Browser interface Exposure of lower level web browser interface for more detailed test cases Done
HTTP authentication Fetching protected web pages with basic authentication only Done
Browser navigation buttons Back, forward and retry Done
SSL support Can connect to https: pages Done
Proxy support Can connect via. common proxies Done
Frames support Handling of frames in web test cases Done
Improved display Better web GUI with tree display of test cases 1.1
Localisation Messages abstracted and code generated from XML 1.1
File upload testing Can simulate the input type file tag 1.1
Mocking interfaces Can generate mock objects to interfaces as well as classes 2.0
Testing exceptions Similar to testing PHP errors 2.0
XPath searching of elements Can make use of HTML tidy for faster and more flexible content matching 2.0
PHP5 migraton will start straight after the version 1.1 series, whereupon PHP4 will no longer be supported. SimpleTest is currently compatible with PHP5, but will not make use of all of the new features until version 2.

Web resources for testing

Process is at least as important as tools. The type of process that makes the heaviest use of a developer's testing tool is of course Extreme Programming. This is one of the Agile Methodologies which combine various practices to "flatten the cost curve" of software development. More extreme still is Test Driven Development, where you very strictly adhere to the rule of no coding until you have a test. If you're more of a planner or believe that experience trumps evolution, you may prefer the RUP approach. I haven't tried it, but even I can see that you will need test tools (see figure 9).

Most unit testers clone JUnit to some degree, as far as the interface at least. There is a wealth of information on the JUnit site including the FAQ which contains plenty of general advice on testing. Once you get bitten by the bug you will certainly appreciate the phrase test infected coined by Eric Gamma. If you are still reviewing which unit tester to use the main choices are PHPUnit and Pear PHP::PHPUnit. They currently lack a lot of features found in SimpleTest, but the PEAR version at least has been upgraded for PHP5 and is recommended if you are porting existing JUnit test cases.

Library writers don't seem to ship tests with their code very often which is a shame. Library code that includes tests can be more safely refactored and the test code can act as additional documentation in a fairly standard form. This can save trawling the source code for clues when problems occour, especially when upgrading such a library. Libraries using SimpleTest for their unit testing include WACT and PEAR::XML_HTMLSax.

There is currently a sad lack of material on mock objects, which is a shame as unit testing without them is a lot more work. The original mock objects paper is very Java focused, but still worth a read. As a new technology there are plenty of discussions and debate on how to use mocks, often on Wikis such as Extreme Tuesday or www.mockobjects.com or the original C2 Wiki. Injecting mocks into a class is the main area of debate for which this paper on IBM makes a good starting point.

There are plenty of web testing tools, but most are written in Java and tutorials and advice are rather thin on the ground. The only hope is to look at the documentation for HTTPUnit, HTMLUnit or JWebUnit and hope for clues. There are some XML driven test frameworks, but again most require Java to run. As SimpleTest does not support JavaScript you would probably have to look at these tools anyway if you have highly dynamic pages.

pgfouine-1.2/tests/simpletest/docs/en/server_stubs_documentation.html0000644000175000017500000003354710334504440025027 0ustar acmeacme SimpleTest for PHP server stubs documentation

Server stubs documentation

What are server stubs?

This was originally a pattern named by Robert Binder (Testing object-oriented systems: models, patterns, and tools, Addison-Wesley) in 1999. A server stub is a simulation of an object or component. It should exactly replace a component in a system for test or prototyping purposes, but remain lightweight. This allows tests to run more quickly, or if the simulated class has not been written, to run at all.

Creating server stubs

All we need is an existing class, say a database connection that looks like this...

class DatabaseConnection {
    function DatabaseConnection() {
    }
    
    function query() {
    }
    
    function selectQuery() {
    }
}
The class does not need to have been implemented yet. To create a stub version of the class we need to include the server stub library and run the generator...
require_once('simpletest/mock_objects.php');
require_once('database_connection.php');
Stub::generate('DatabaseConnection');
This generates a clone class called StubDatabaseConnection. We can now create instances of the new class within our prototype script...
require_once('simpletest/mock_objects.php');
require_once('database_connection.php');
Stub::generate('DatabaseConnection');

$connection = new StubDatabaseConnection();

The stub version of a class has all the methods of the original so that operations like $connection->query() are still legal. The return value will be null, but we can change that with...
$connection->setReturnValue('query', 37)
Now every time we call $connection->query() we get the result of 37. We can set the return value to anything, say a hash of imaginary database results or a list of persistent objects. Parameters are irrelevant here, we always get the same values back each time once they have been set up this way. That may not sound like a convincing replica of a database connection, but for the half a dozen lines of a test method it is usually all you need.

Simulation patterns

Things aren't always that simple though. One common problem is iterators, where constantly returning the same value could cause an endless loop in the object being tested. For these we need to set up sequences of values. Let's say we have a simple iterator that looks like this...

class Iterator {
    function Iterator() {
    }
    
    function next() {
    }
}
This is about the simplest iterator you could have. Assuming that this iterator only returns text until it reaches the end, when it returns false, we can simulate it with...
Stub::generate('Iterator');

$iterator = new StubIterator();
$iterator->setReturnValue('next', false);
$iterator->setReturnValueAt(0, 'next', 'First string');
$iterator->setReturnValueAt(1, 'next', 'Second string');
When next() is called on the stub iterator it will first return "First string", on the second call "Second string" will be returned and on any other call false will be returned. The sequenced return values take precedence over the constant return value. The constant one is a kind of default if you like.

Another tricky situation is an overloaded get() operation. An example of this is an information holder with name/value pairs. Say we have a configuration class like...

class Configuration {
    function Configuration() {
    }
    
    function getValue($key) {
    }
}
This is a classic situation for using stub objects as actual configuration will vary from machine to machine, hardly helping the reliability of our tests if we use it directly. The problem though is that all the data comes through the getValue() method and yet we want different results for different keys. Luckily the stubs have a filter system...
Stub::generate('Configuration');

$config = &new StubConfiguration();
$config->setReturnValue('getValue', 'primary', array('db_host'));
$config->setReturnValue('getValue', 'admin', array('db_user'));
$config->setReturnValue('getValue', 'secret', array('db_password'));
The extra parameter is a list of arguments to attempt to match. In this case we are trying to match only one argument which is the look up key. Now when the server stub has the getValue() method invoked like this...
$config->getValue('db_user');
...it will return "admin". It finds this by attempting to match the calling arguments to its list of returns one after another until a complete match is found.

You can set a default argument argument like so...


$config->setReturnValue('getValue', false, array('*'));
This is not the same as setting the return value without any argument requirements like this...

$config->setReturnValue('getValue', false);
In the first case it will accept any single argument, but exactly one is required. In the second case any number of arguments will do and it acts as a catchall after all other matches. Note that if we add further single parameter options after the wildcard in the first case, they will be ignored as the wildcard will match first. With complex parameter lists the ordering could be important or else desired matches could be masked by earlier wildcard ones. Declare the most specific matches first if you are not sure.

There are times when you want a specific object to be dished out by the stub rather than just a copy. The PHP copy semantics force us to use a different method for this. You might be simulating a container for example...

class Thing {
}

class Vector {
    function Vector() {
    }
    
    function get($index) {
    }
}
In this case you can set a reference into the stub's return list...
Stub::generate('Vector');

$thing = new Thing();
$vector = &new StubVector();
$vector->setReturnReference('get', $thing, array(12));
With this arrangement you know that every time $vector->get(12) is called it will return the same $thing each time.

These three factors, timing, parameters and whether to copy, can be combined orthogonally. For example...

$complex = &new StubComplexThing();
$stuff = new Stuff();
$complex->setReturnReferenceAt(3, 'get', $stuff, array('*', 1));
This will return the $stuff only on the third call and only if two parameters were set the second of which must be the integer 1. That should cover most simple prototyping situations.

A final tricky case is one object creating another, known as a factory pattern. Suppose that on a successful query to our imaginary database, a result set is returned as an iterator with each call to next() giving one row until false. This sounds like a simulation nightmare, but in fact it can all be stubbed using the mechanics above.

Here's how...

Stub::generate('DatabaseConnection');
Stub::generate('ResultIterator');

class DatabaseTest extends UnitTestCase {
    
    function testUserFinder() {
        $result = &new StubResultIterator();
        $result->setReturnValue('next', false);
        $result->setReturnValueAt(0, 'next', array(1, 'tom'));
        $result->setReturnValueAt(1, 'next', array(3, 'dick'));
        $result->setReturnValueAt(2, 'next', array(6, 'harry'));
        
        $connection = &new StubDatabaseConnection();
        $connection->setReturnValue('query', false);
        $connection->setReturnReference(
                'query',
                $result,
                array('select id, name from users'));
                
        $finder = &new UserFinder($connection);
        $this->assertIdentical(
                $finder->findNames(),
                array('tom', 'dick', 'harry'));
    }
}
Now only if our $connection is called with the correct query() will the $result be returned that is itself exhausted after the third call to next(). This should be enough information for our UserFinder class, the class actually being tested here, to come up with goods. A very precise test and not a real database in sight.

Stub creation options

There are some additional options when creating stubs. At the generation stage we can change the class name...

Stub::generate('Iterator', 'MyStubIterator');
$iterator = &new MyStubIterator();

This is not very useful in itself as there would be no difference in this class and the default except for the name. However we can also add additional methods not found in the original interface...
class Iterator {
}
Stub::generate('Iterator', 'PrototypeIterator', array('next', 'isError'));
$iterator = &new PrototypeIterator();
$iterator->setReturnValue('next', 0);

The next() and isError() methods can now have return values set just as if they existed in the original class.

One other esoteric way of customising the stubs is to change the default wildcard used for parameter matching.

Stub::generate('Connection');
$iterator = &new StubConnection('wild');
$iterator->setReturnValue('query', array('id' => 33), array('wild'));

The only reason to do this is if you genuinely wanted to test against the literal string "*" and didn't want it interpreted as "any".

pgfouine-1.2/tests/simpletest/docs/en/form_testing_documentation.html0000644000175000017500000002434510334504440024775 0ustar acmeacme Simple Test documentation for testing HTML forms

Form testing documentation

Submitting a simple form

When a page is fetched by the WebTestCase using get() or post() the page content is automatically parsed. This results in any form controls that are inside <form> tags being available from within the test case. For example, if we have this snippet of HTML...

<form>
    <input type="text" name="a" value="A default" />
    <input type="submit" value="Go" />
</form>
Which looks like this...

We can navigate to this code, via the LastCraft site, with the following test...

class SimpleFormTests extends WebTestCase {
    
    function testDefaultValue() {
        $this->get('http://www.lastcraft.com/form_testing_documentation.php');
        $this->assertField('a', 'A default');
    }
}
Immediately after loading the page all of the HTML controls are set at their default values just as they would appear in the web browser. The assertion tests that a HTML widget exists in the page with the name "a" and that it is currently set to the value "A default"

We could submit the form straight away, but first we'll change the value of the text field and only then submit it...

class SimpleFormTests extends WebTestCase {

    function testDefaultValue() {
        $this->get('http://www.my-site.com/');
        $this->assertField('a', 'A default');
        $this->setField('a', 'New value');
        $this->clickSubmit('Go');
    }
}
Because we didn't specify a method attribute on the form tag, and didn't specify an action either, the test case will follow the usual browser behaviour of submitting the form data as a GET request back to the same location. SimpleTest tries to emulate typical browser behaviour as much as possible, rather than attempting to catch missing attributes on tags. This is because the target of the testing framework is the PHP application logic, not syntax or other errors in the HTML code. For HTML errors, other tools such as HTMLTidy should be used.

If a field is not present in any form, or if an option is unavailable, then WebTestCase::setField() will return false. For example, suppose we wish to verify that a "Superuser" option is not present in this form...

<strong>Select type of user to add:</strong>
<select name="type">
    <option>Subscriber</option>
    <option>Author</option>
    <option>Administrator</option>
</select>
Which looks like...

Select type of user to add:

The following test will confirm it...

class SimpleFormTests extends WebTestCase {
    ...
    function testNoSuperuserChoiceAvailable() {
        $this->get('http://www.lastcraft.com/form_testing_documentation.php');
        $this->assertFalse($this->setField('type', 'Superuser'));
    }
}
The selection will not be changed on a failure to set a widget value.

Here is the full list of widgets currently supported...

  • Text fields, including hidden and password fields.
  • Submit buttons including the button tag, although not yet reset buttons
  • Text area. This includes text wrapping behaviour.
  • Checkboxes, including multiple checkboxes in the same form.
  • Drop down selections, including multiple selects.
  • Radio buttons.
  • Images.

Although most standard HTML widgets are catered for by SimpleTest's built in parser, it is unlikely that JavaScript will be implemented anytime soon.

Fields with multiple values

SimpleTest can cope with two types of multivalue controls: Multiple selection drop downs, and multiple checkboxes with the same name within a form. The multivalue nature of these means that setting and testing are slightly different. Using checkboxes as an example...

<form class="demo">
    <strong>Create privileges allowed:</strong>
    <input type="checkbox" name="crud" value="c" checked><br>
    <strong>Retrieve privileges allowed:</strong>
    <input type="checkbox" name="crud" value="r" checked><br>
    <strong>Update privileges allowed:</strong>
    <input type="checkbox" name="crud" value="u" checked><br>
    <strong>Destroy privileges allowed:</strong>
    <input type="checkbox" name="crud" value="d" checked><br>
    <input type="submit" value="Enable Privileges">
</form>
Which renders as...

Create privileges allowed:
Retrieve privileges allowed:
Update privileges allowed:
Destroy privileges allowed:

If we wish to disable all but the retrieval privileges and submit this information we can do it like this...

class SimpleFormTests extends WebTestCase {
    ...
    function testDisableNastyPrivileges() {
        $this->get('http://www.lastcraft.com/form_testing_documentation.php');
        $this->assertField('crud', array('c', 'r', 'u', 'd'));
        $this->setField('crud', array('r'));
        $this->clickSubmit('Enable Privileges');
    }
}
Instead of setting the field to a single value, we give it a list of values. We do the same when testing expected values. We can then write other test code to confirm the effect of this, perhaps by logging in as that user and attempting an update.

Raw posting

If you want to test a form handler, but have not yet written or do not have access to the form itself, you can create a form submission by hand.

class SimpleFormTests extends WebTestCase {
    ...    
    function testAttemptedHack() {
        $this->post(
                'http://www.my-site.com/add_user.php',
                array('type' => 'superuser'));
        $this->assertNoUnwantedPattern('/user created/i');
    }
}
By adding data to the WebTestCase::post() method, we are attempting to fetch the page as a form submission.

pgfouine-1.2/tests/simpletest/docs/en/unit_test_documentation.html0000644000175000017500000003426010334504440024310 0ustar acmeacme SimpleTest for PHP regression test documentation

PHP Unit Test documentation

Unit test cases

The core system is a regression testing framework built around test cases. A sample test case looks like this...

class FileTestCase extends UnitTestCase {
}
If no test name is supplied when chaining the constructor then the class name will be taken instead. This will be the name displayed in the test results.

Actual tests are added as methods in the test case whose names by default start with the string "test" and when the test case is invoked all such methods are run in the order that PHP introspection finds them. As many test methods can be added as needed. For example...

require_once('../classes/writer.php');

class FileTestCase extends UnitTestCase {
    function FileTestCase() {
        $this->UnitTestCase('File test');
    }
    
    function setUp() {
        @unlink('../temp/test.txt');
    }
    
    function tearDown() {
        @unlink('../temp/test.txt');
    }
    
    function testCreation() {
        $writer = &new FileWriter('../temp/test.txt');
        $writer->write('Hello');
        $this->assertTrue(file_exists('../temp/test.txt'), 'File created');
    }
}
The constructor is optional and usually omitted. Without a name, the class name is taken as the name of the test case.

Our only test method at the moment is testCreation() where we check that a file has been created by our Writer object. We could have put the unlink() code into this method as well, but by placing it in setUp() and tearDown() we can use it with other test methods that we add.

The setUp() method is run just before each and every test method. tearDown() is run just after each and every test method.

You can place some test case set up into the constructor to be run once for all the methods in the test case, but you risk test inteference that way. This way is slightly slower, but it is safer. Note that if you come from a JUnit background this will not be the behaviour you are used to. JUnit surprisingly reinstantiates the test case for each test method to prevent such interference. SimpleTest requires the end user to use setUp(), but supplies additional hooks for library writers.

The means of reporting test results (see below) are by a visiting display class that is notified by various assert...() methods. Here is the full list for the UnitTestCase class, the default for SimpleTest...
assertTrue($x)Fail if $x is false
assertFalse($x)Fail if $x is true
assertNull($x)Fail if $x is set
assertNotNull($x)Fail if $x not set
assertIsA($x, $t)Fail if $x is not the class or type $t
assertNotA($x, $t)Fail if $x is of the class or type $t
assertEqual($x, $y)Fail if $x == $y is false
assertNotEqual($x, $y)Fail if $x == $y is true
assertIdentical($x, $y)Fail if $x == $y is false or a type mismatch
assertNotIdentical($x, $y)Fail if $x == $y is true and types match
assertReference($x, $y)Fail unless $x and $y are the same variable
assertCopy($x, $y)Fail if $x and $y are the same variable
assertWantedPattern($p, $x)Fail unless the regex $p matches $x
assertNoUnwantedPattern($p, $x)Fail if the regex $p matches $x
assertNoErrors()Fail if any PHP error occoured
assertError($x)Fail if no PHP error or incorrect message
assertErrorPattern($p)Fail unless the error matches the regex $p
All assertion methods can take an optional description to label the displayed result with. If omitted a default message is sent instead which is usually sufficient. This default message can still be embedded in your own message if you include "%s" within the string. All the assertions return true on a pass or false on failure.

Some examples...

$variable = null;
$this->assertNull($variable, 'Should be cleared');
...will pass and normally show no message. If you have set up the tester to display passes as well then the message will be displayed as is.
$this->assertIdentical(0, false, 'Zero is not false [%s]');
This will fail as it performs a type check as well as a comparison between the two values. The "%s" part is replaced by the default error message that would have been shown if we had not supplied our own. This also allows us to nest test messages.
$a = 1;
$b = $a;
$this->assertReference($a, $b);
Will fail as the variable $a is a copy of $b.
$this->assertWantedPattern('/hello/i', 'Hello world');
This will pass as using a case insensitive match the string hello is contained in Hello world.
trigger_error('Disaster');
trigger_error('Catastrophe');
$this->assertError();
$this->assertError('Catastrophe');
$this->assertNoErrors();
This one takes some explanation as in fact they all pass!

PHP errors in SimpleTest are trapped and placed in a queue. Here the first error check catches the "Disaster" message without checking the text and passes. This removes the error from the queue. The next error check tests not only the existence of the error, but also the text which here matches so another pass. With the queue now empty the last test will pass as well. If any unchecked errors are left at the end of a test method then an exception will be reported in the test. Note that SimpleTest cannot catch compile time PHP errors.

The test cases also have some convenience methods for debugging code or extending the suite...
setUp()Runs this before each test method
tearDown()Runs this after each test method
pass()Sends a test pass
fail()Sends a test failure
error()Sends an exception event
sendMessage()Sends a status message to those displays that support it
signal($type, $payload)Sends a user defined message to the test reporter
dump($var)Does a formatted print_r() for quick and dirty debugging
swallowErrors()Clears the error queue

Extending test cases

Of course additional test methods can be added to create specific types of test case too so as to extend framework...

require_once('simpletest/unit_tester.php');

class FileTester extends UnitTestCase {
    function FileTester($name = false) {
        $this->UnitTestCase($name);
    }
    
    function assertFileExists($filename, $message = '%s') {
        $this->assertTrue(
                file_exists($filename),
                sprintf($message, 'File [$filename] existence check'));
    }
}
Here the SimpleTest library is held in a folder called simpletest that is local. Substitute your own path for this.

This new case can be now be inherited just like a normal test case...

class FileTestCase extends FileTester {
    
    function setUp() {
        @unlink('../temp/test.txt');
    }
    
    function tearDown() {
        @unlink('../temp/test.txt');
    }
    
    function testCreation() {
        $writer = &new FileWriter('../temp/test.txt');
        $writer->write('Hello');
        $this->assertFileExists('../temp/test.txt');
    }
}

If you want a test case that does not have all of the UnitTestCase assertions, only your own and assertTrue(), you need to extend the SimpleTestCase class instead. It is found in simple_test.php rather than unit_tester.php. See later if you want to incorporate other unit tester's test cases in your test suites.

Running a single test case

You won't often run single test cases except when bashing away at a module that is having difficulty and you don't want to upset the main test suite. Here is the scaffolding needed to run the a lone test case...

<?php
    require_once('simpletest/unit_tester.php');
    require_once('simpletest/reporter.php');
    require_once('../classes/writer.php');

    class FileTestCase extends UnitTestCase {
        function FileTestCase() {
            $this->UnitTestCase('File test');
        }
    }
    
    $test = &new FileTestCase();
    $test->run(new HtmlReporter());
?>
This script will run as is, but will output zero passes and zero failures until test methods are added.

pgfouine-1.2/tests/simpletest/docs/fr/0000755000175000017500000000000011516212335016455 5ustar acmeacmepgfouine-1.2/tests/simpletest/docs/fr/expectation_documentation.html0000644000175000017500000003310310334504440024615 0ustar acmeacme Documentation SimpleTest : étendre le testeur unitaire avec des classes d'attentes supplémentaires

Documentation sur les attentes

Plus de contrôle sur les objets fantaisie

Le comportement par défaut des objets fantaisie dans SimpleTest est soit une correspondance identique sur l'argument, soit l'acceptation de n'importe quel argument. Pour la plupart des tests, c'est suffisant. Cependant il est parfois nécessaire de ramollir un scénario de test.

Un des endroits où un test peut être trop serré est la reconnaissance textuelle. Prenons l'exemple d'un composant qui produirait un message d'erreur utile lorsque quelque chose plante. Il serait utile de tester que l'erreur correcte est renvoyée, mais le texte proprement dit risque d'être plutôt long. Si vous testez le texte dans son ensemble alors à chaque modification de ce même message -- même un point ou une virgule -- vous aurez à revenir sur la suite de test pour la modifier.

Voici un cas concret, nous avons un service d'actualités qui a échoué dans sa tentative de connexion à sa source distante.

class NewsService {
    ...
    function publish(&$writer) {
        if (! $this->isConnected()) {
            $writer->write('Cannot connect to news service "' .
                    $this->_name . '" at this time. ' .
                    'Please try again later.');
        }
        ...
    }
}
Là il envoie son contenu vers un classe Writer. Nous pourrions tester ce comportement avec un MockWriter...
class TestOfNewsService extends UnitTestCase {
    ...
    function testConnectionFailure() {
        $writer = &new MockWriter($this);
        $writer->expectOnce('write', array(
                'Cannot connect to news service ' .
                '"BBC News" at this time. ' .
                'Please try again later.'));
        
        $service = &new NewsService('BBC News');
        $service->publish($writer);
        
        $writer->tally();
    }
}
C'est un bon exemple d'un test fragile. Si nous décidons d'ajouter des instructions complémentaires, par exemple proposer une source d'actualités alternative, nous casserons nos tests par la même occasion sans pourtant avoir modifié une seule fonctionnalité.

Pour contourner ce problème, nous voudrions utiliser un test avec une expression rationnelle plutôt qu'une correspondance exacte. Nous pouvons y parvenir avec...

class TestOfNewsService extends UnitTestCase {
    ...
    function testConnectionFailure() {
        $writer = &new MockWriter($this);
        $writer->expectOnce(
                'write',
                array(new WantedPatternExpectation('/cannot connect/i')));
        
        $service = &new NewsService('BBC News');
        $service->publish($writer);
        
        $writer->tally();
    }
}
Plutôt que de transmettre le paramètre attendu au MockWriter, nous envoyons une classe d'attente appelée WantedPatternExpectation. L'objet fantaisie est suffisamment élégant pour reconnaître qu'il s'agit d'un truc spécial et pour le traiter différemment. Plutôt que de comparer l'argument entrant à cet objet, il utilise l'objet attente lui-même pour exécuter le test.

WantedPatternExpectation utilise l'expression rationnelle pour la comparaison avec son constructeur. A chaque fois q'une comparaison est fait à travers MockWriter par rapport à cette classe attente, elle fera un preg_match() avec ce motif. Dans notre scénario de test ci-dessus, aussi longtemps que la chaîne "cannot connect" apparaît dans le texte, la fantaisie transmettra un succès au testeur unitaire. Peu importe le reste du texte.

Les classes attente possibles sont...
EqualExpectationUne égalité, plutôt que la plus forte comparaison à l'identique
NotEqualExpectationUne comparaison sur la non-égalité
IndenticalExpectationLa vérification par défaut de l'objet fantaisie qui doit correspondre exactement
NotIndenticalExpectationInverse la logique de l'objet fantaisie
WantedPatternExpectationUtilise une expression rationnelle Perl pour comparer une chaîne
NoUnwantedPatternExpectationPasse seulement si l'expression rationnelle Perl échoue
IsAExpectationVérifie le type ou le nom de la classe uniquement
NotAExpectationL'opposé de IsAExpectation
MethodExistsExpectationVérifie si la méthode est disponible sur un objet
La plupart utilisent la valeur attendue dans le constructeur. Les exceptions sont les vérifications sur motif, qui utilisent une expression rationnelle, ainsi que IsAExpectation et NotAExpectation, qui prennent un type ou un nom de classe comme chaîne.

Utiliser les attentes pour contrôler les bouchons serveur

Les classes attente peuvent servir à autre chose que l'envoi d'assertions depuis les objets fantaisie, afin de choisir le comportement d'un objet fantaisie our celui d'un bouchon serveur. A chaque fois qu'une liste d'arguments est donnée, une liste d'objets attente peut être insérée à la place.

Mettons que nous voulons qu'un bouchon serveur d'autorisation simule une connexion réussie seulement si il reçoit un objet de session valide. Nous pouvons y arriver avec ce qui suit...

Stub::generate('Authorisation');

$authorisation = new StubAuthorisation();
$authorisation->setReturnValue(
        'isAllowed',
        true,
        array(new IsAExpectation('Session', 'Must be a session')));
$authorisation->setReturnValue('isAllowed', false);
Le comportement par défaut du bouchon serveur est défini pour renvoyer false quand isAllowed est appelé. Lorsque nous appelons cette méthode avec un unique paramètre qui est un objet Session, il renverra true. Nous avons aussi ajouté un deuxième paramètre comme message. Il sera affiché dans le message d'erreur de l'objet fantaisie si l'attente est la cause de l'échec.

Ce niveau de sophistication est rarement utile : il n'est inclut que pour être complet.

Créer vos propres attentes

Les classes d'attentes ont une structure très simple. Tellement simple qu'il devient très simple de créer vos propres version de logique pour des tests utilisés couramment.

Par exemple voici la création d'une classe pour tester la validité d'adresses IP. Pour fonctionner correctement avec les bouchons serveurs et les objets fantaisie, cette nouvelle classe d'attente devrait étendre SimpleExpectation...

class ValidIp extends SimpleExpectation {
    
    function test($ip) {
        return (ip2long($ip) != -1);
    }
    
    function testMessage($ip) {
        return "Address [$ip] should be a valid IP address";
    }
}
Il n'y a véritablement que deux méthodes à mettre en place. La méthode test() devrait renvoyer un true si l'attente doit passer, et une erreur false dans le cas contraire. La méthode testMessage() ne devrait renvoyer que du texte utile à la compréhension du test en lui-même.

Cette classe peut désormais être employée à la place des classes d'attente précédentes.

Sous le capot du testeur unitaire

Le frameworkd de test unitaire SimpleTest utilise aussi dans son coeur des classes d'attente pour la classe UnitTestCase. Nous pouvons aussi tirer parti de ces mécanismes pour réutiliser nos propres classes attente à l'intérieur même des suites de test.

La méthode la plus directe est d'utiliser la méthode SimpleTest::assertExpectation() pour effectuer le test...

class TestOfNetworking extends UnitTestCase {
    ...
    function testGetValidIp() {
        $server = &new Server();
        $this->assertExpectation(
                new ValidIp(),
                $server->getIp(),
                'Server IP address->%s');
    }
}
C'est plutôt sale par rapport à notre syntaxe habituelle du type assert...().

Pour un cas aussi simple, nous créons d'ordinaire une méthode d'assertion distincte en utilisant la classe d'attente. Supposons un instant que notre attente soit un peu plus compliquée et que par conséquent nous souhaitions la réutiliser, nous obtenons...

class TestOfNetworking extends UnitTestCase {
    ...
    function assertValidIp($ip, $message = '%s') {
        $this->assertExpectation(new ValidIp(), $ip, $message);
    }
    
    function testGetValidIp() {
        $server = &new Server();
        $this->assertValidIp(
                $server->getIp(),
                'Server IP address->%s');
    }
}
Il est peu probable que nous ayons besoin de ce niveau de contrôle sur la machinerie de test. Il est assez rare que le besoin d'une attente dépasse le stade de la reconnaissance d'un motif. De plus, les classes d'attente complexes peuvent rendre les tests difficiles à lire et à déboguer. Ces mécanismes sont véritablement là pour les auteurs de système qui étendront le framework de test pour leurs propres outils de test.

pgfouine-1.2/tests/simpletest/docs/fr/docs.css0000644000175000017500000000260610334504440020121 0ustar acmeacmebody { padding-left: 3%; padding-right: 3%; } pre { font-family: courier; font-size: 80%; border: 1px solid; background-color: #cccccc; padding: 5px; margin-left: 5%; margin-right: 8%; } .code, .new_code, pre.new_code { font-weight: bold; } div.copyright { font-size: 80%; color: gray; } div.copyright a { color: gray; } ul.api { padding-left: 0em; padding-right: 25%; } ul.api li { margin-top: 0.2em; margin-bottom: 0.2em; list-style: none; text-indent: -3em; padding-left: 3em; } div.demo { border: 4px ridge; border-color: gray; padding: 10px; margin: 5px; margin-left: 20px; margin-right: 40px; background-color: white; } div.demo span.fail { color: red; } div.demo span.pass { color: green; } div.demo h1 { font-size: 12pt; text-align: left; font-weight: bold; } table { border: 2px outset; border-color: gray; background-color: white; margin: 5px; margin-left: 5%; margin-right: 5%; } td { font-size: 80%; } .shell { color: white; } pre.shell { border: 4px ridge; border-color: gray; padding: 10px; margin: 5px; margin-left: 20px; margin-right: 40px; background-color: black; } form.demo { background-color: lightgray; border: 4px outset; border-color: lightgray; padding: 10px; margin-right: 40%; } pgfouine-1.2/tests/simpletest/docs/fr/web_tester_documentation.html0000644000175000017500000005112210334504440024436 0ustar acmeacme Documentation SimpleTest : tester des scripts web

Documentation sur le testeur web

Télécharger une page

Tester des classes c'es très bien. Reste que PHP est avant tout un langage pour créer des fonctionnalités à l'intérieur de pages web. Comment pouvons tester la partie de devant -- celle de l'interface -- dans nos applications en PHP ? Etant donné qu'une page web n'est constituée que de texte, nous devrions pouvoir les examiner exactement comme n'importe quelle autre donnée de test.

Cela nous amène à une situation délicate. Si nous testons dans un niveau trop bas, vérifier des balises avec un motif ad hoc par exemple, nos tests seront trop fragiles. Le moindre changement dans la présentation pourrait casser un grand nombre de test. Si nos tests sont situés trop haut, en utilisant une version fantaisie du moteur de template pour donner un cas précis, alors nous perdons complètement la capacité à automatiser certaines classes de test. Par exemple, l'interaction entre des formulaires et la navigation devra être testé manuellement. Ces types de test sont extrêmement fastidieux et plutôt sensibles aux erreurs.

SimpleTest comprend une forme spéciale de scénario de test pour tester les actions d'une page web. WebTestCase inclut des facilités pour la navigation, des vérifications sur le contenu et les cookies ainsi que la gestion des formulaires. Utiliser ces scénarios de test ressemble fortement à UnitTestCase...

class TestOfLastcraft extends WebTestCase {
}
Ici nous sommes sur le point de tester le site de Last Craft. Si ce scénario de test est situé dans un fichier appelé lastcraft_test.php alors il peut être chargé dans un script de lancement tout comme des tests unitaires...
<?php
    require_once('simpletest/web_tester.php');
    require_once('simpletest/reporter.php');
    
    $test = &new GroupTest('Web site tests');
    $test->addTestFile('lastcraft_test.php');
    exit ($test->run(new TextReporter()) ? 0 : 1);
?>
J'utilise ici le rapporteur en mode texte pour mieux distinguer le contenu au format HTML du résultat du test proprement dit.

Rien n'est encore testé. Nous pouvons télécharger la page d'accueil en utilisant la méthode get()...

class TestOfLastcraft extends WebTestCase {
    
    function testHomepage() {
        $this->assertTrue($this->get('http://www.lastcraft.com/'));
    }
}
La méthode get() renverra "true" uniquement si le contenu de la page a bien été téléchargé. C'est un moyen simple, mais efficace pour vérifier qu'une page web a bien été délivré par le serveur web. Cependant le contenu peut révéler être une erreur 404 et dans ce cas notre méthode get() renverrait encore un succès.

En supposant que le serveur web pour le site Last Craft soit opérationnel (malheureusement ce n'est pas toujours le cas), nous devrions voir...

Web site tests
OK
Test cases run: 1/1, Failures: 0, Exceptions: 0
Nous avons vérifié qu'une page, de n'importe quel type, a bien été renvoyée. Nous ne savons pas encore s'il s'agit de celle que nous souhaitions.

Tester le contenu d'une page

Pour obtenir la confirmation que la page téléchargée est bien celle que nous attendions, nous devons vérifier son contenu.

class TestOfLastcraft extends WebTestCase {
    
    function testHomepage() {
        $this->get('http://www.lastcraft.com/');
        $this->assertWantedPattern('/why the last craft/i');
    }
}
La page obtenue par le dernier téléchargement est placée dans un buffer au sein même du scénario de test. Il n'est donc pas nécessaire de s'y référer directement. La correspondance du motif est toujours effectuée par rapport à ce buffer.

Voici une liste possible d'assertions sur le contenu...
assertWantedPattern($pattern)Vérifier une correspondance sur le contenu via une expression rationnelle Perl
assertNoUnwantedPattern($pattern)Une expression rationnelle Perl pour vérifier une absence
assertTitle($title)Passe si le titre de la page correspond exactement
assertLink($label)Passe si un lien avec ce texte est présent
assertNoLink($label)Passe si aucun lien avec ce texte est présent
assertLinkById($id)Passe si un lien avec cet attribut d'identification est présent
assertField($name, $value)Passe si une balise input avec ce nom contient cette valeur
assertFieldById($id, $value)Passe si une balise input avec cet identifiant contient cette valeur
assertResponse($codes)Passe si la réponse HTTP trouve une correspondance dans la liste
assertMime($types)Passe si le type MIME se retrouve dans cette liste
assertAuthentication($protocol)Passe si l'authentification provoquée est de ce type de protocole
assertNoAuthentication()Passe s'il n'y pas d'authentification provoquée en cours
assertRealm($name)Passe si le domaine provoqué correspond
assertHeader($header, $content)Passe si une entête téléchargée correspond à cette valeur
assertNoUnwantedHeader($header)Passe si une entête n'a pas été téléchargé
assertHeaderPattern($header, $pattern)Passe si une entête téléchargée correspond à cette expression rationnelle Perl
assertCookie($name, $value)Passe s'il existe un cookie correspondant
assertNoCookie($name)Passe s'il n'y a pas de cookie avec un tel nom
Comme d'habitude avec les assertions de SimpleTest, elles renvoient toutes "false" en cas d'échec et "true" si c'est un succès. Elles renvoient aussi un message de test optionnel : vous pouvez l'ajouter dans votre propre message en utilisant "%s".

A présent nous pourrions effectué le test sur le titre uniquement...

$this->assertTitle('The Last Craft?');
En plus d'une simple vérification sur le contenu HTML, nous pouvons aussi vérifier que le type MIME est bien d'un type acceptable...
$this->assertMime(array('text/plain', 'text/html'));
Plus intéressant encore est la vérification sur le code de la réponse HTTP. Pareillement au type MIME, nous pouvons nous assurer que le code renvoyé se trouve bien dans un liste de valeurs possibles...
class TestOfLastcraft extends WebTestCase {
    
    function testHomepage() {
        $this->get('http://simpletest.sourceforge.net/');
        $this->assertResponse(200);
    }
}
Ici nous vérifions que le téléchargement s'est bien terminé en ne permettant qu'une réponse HTTP 200. Ce test passera, mais ce n'est pas la meilleure façon de procéder. Il n'existe aucune page sur http://simpletest.sourceforge.net/, à la place le serveur renverra une redirection vers http://www.lastcraft.com/simple_test.php. WebTestCase suit automatiquement trois de ces redirections. Les tests sont quelque peu plus robustes de la sorte. Surtout qu'on est souvent plus intéressé par l'interaction entre les pages que de leur simple livraison. Si les redirections se révèlent être digne d'intérêt, il reste possible de les supprimer...
class TestOfLastcraft extends WebTestCase {
    
    function testHomepage() {
        $this->setMaximumRedirects(0);
        $this->get('http://simpletest.sourceforge.net/');
        $this->assertResponse(200);
    }
}
Alors l'assertion échoue comme prévue...
Web site tests
1) Expecting response in [200] got [302]
	in testhomepage
	in testoflastcraft
	in lastcraft_test.php
FAILURES!!!
Test cases run: 1/1, Failures: 1, Exceptions: 0
Nous pouvons modifier le test pour accepter les redirections...
class TestOfLastcraft extends WebTestCase {
    
    function testHomepage() {
        $this->setMaximumRedirects(0);
        $this->get('http://simpletest.sourceforge.net/');
        $this->assertResponse(array(301, 302, 303, 307));
    }
}
Maitenant ça passe.

Navigeur dans un site web

Les utilisateurs ne naviguent pas souvent en tapant les URLs, mais surtout en cliquant sur des liens et des boutons. Ici nous confirmons que les informations sur le contact peuvent être atteintes depuis la page d'accueil...

class TestOfLastcraft extends WebTestCase {
    ...
    function testContact() {
        $this->get('http://www.lastcraft.com/');
        $this->clickLink('About');
        $this->assertTitle('About Last Craft');
    }
}
Le paramètre est le texte du lien.

Il l'objectif est un bouton plutôt qu'une balise ancre, alors clickSubmit() doit être utilisé avec le titre du bouton...

$this->clickSubmit('Go!');

La liste des méthodes de navigation est...
get($url, $parameters)Envoie une requête GET avec ces paramètres
post($url, $parameters)Envoie une requête POST avec ces paramètres
head($url, $parameters)Envoie une requête HEAD sans remplacer le contenu de la page
retry()Relance la dernière requête
back()Identique au bouton "Précédent" du navigateur
forward()Identique au bouton "Suivant" du navigateur
authenticate($name, $password)Re-essaye avec une tentative d'authentification
getFrameFocus()Le nom de la fenêtre en cours d'utilisation
setFrameFocusByIndex($choice)Change le focus d'une fenêtre en commençant par 1
setFrameFocus($name)Change le focus d'une fenêtre en utilisant son nom
clearFrameFocus()Revient à un traitement de toutes les fenêtres comme une seule
clickSubmit($label)Clique sur le premier bouton avec cette étiquette
clickSubmitByName($name)Clique sur le bouton avec cet attribut de nom
clickSubmitById($id)Clique sur le bouton avec cet attribut d'identification
clickImage($label, $x, $y)Clique sur une balise input de type image avec ce titre ou ce texte dans l'attribut alt
clickImageByName($name, $x, $y)Clique sur une balise input de type image avec ce nom
clickImageById($id, $x, $y)Clique sur une balise input de type image avec cet attribut d'identification
submitFormById($id)Soumet un formulaire sans valeur de soumission
clickLink($label, $index)Clique sur un ancre avec ce texte d'étiquette visible
clickLinkById($id)Clique sur une ancre avec cet attribut d'identification

Les paramètres dans les méthodes get(), post() et head() sont optionnels. Le téléchargement via HTTP HEAD ne modifie pas le contexte du navigateur, il se limite au chargement des cookies. Cela peut être utilise lorsqu'une image ou une feuille de style initie un cookie pour bloquer un robot trop entreprenant.

Les commandes retry(), back() et forward() fonctionnent exactement comme dans un navigateur. Elles utilisent l'historique pour relancer les pages. Une technique bien pratique pour vérifier les effets d'un bouton retour sur vos formulaires.

Les méthodes sur les fenêtres méritent une petite explication. Par défaut, une page avec des fenêtres est traitée comme toutes les autres. Le contenu sera vérifié à travers l'ensemble de la "frameset", par conséquent un lien fonctionnera, peu importe la fenêtre qui contient la balise ancre. Vous pouvez outrepassé ce comportement en exigeant le focus sur une unique fenêtre. Si vous réalisez cela, toutes les recherches et toutes les actions se limiteront à cette unique fenêtre, y compris les demandes d'authentification. Si un lien ou un bouton n'est pas dans la fenêtre en focus alors il ne peut pas être cliqué.

Tester la navigation sur des pages fixes ne vous alerte que quand vous avez cassé un script entier. Pour des pages fortement dynamiques, un forum de discussion par exemple, ça peut être crucial pour vérifier l'état de l'application. Pour la plupart des applications cependant, la logique vraiment délicate se situe dans la gestion des formulaires et des sessions. Heureusement SimpleTest aussi inclut des outils pour tester des formulaires web.

Modifier la requête

Bien que SimpleTest n'ait pas comme objectif de contrôler des erreurs réseau, il contient quand même des méthodes pour modifier et déboguer les requêtes qu'il lance. Voici une autre liste de méthode...
getTransportError()La dernière erreur de socket
getUrl()La localisation courante
showRequest()Déverse la requête sortante
showHeaders()Déverse les entêtes d'entrée
showSource()Déverse le contenu brut de la page HTML
ignoreFrames()Ne recharge pas les framesets
setCookie($name, $value)Initie un cookie à partir de maintenant
addHeader($header)Ajoute toujours cette entête à la requête
setMaximumRedirects($max)S'arrête après autant de redirections
setConnectionTimeout($timeout)Termine la connexion après autant de temps entre les bytes
useProxy($proxy, $name, $password)Effectue les requêtes à travers ce proxy d'URL

pgfouine-1.2/tests/simpletest/docs/fr/index.html0000644000175000017500000004430510334504440020456 0ustar acmeacme Télécharger le framework de tests Simple Test - Tests unitaire et objets fantaisie pour PHP

Simple Test pour PHP

Le présent article présuppose que vous soyez familier avec le concept de tests unitaires ainsi que celui de développement web avec le langage PHP. Il s'agit d'un guide pour le nouvel et impatient utilisateur de SimpleTest. Pour une documentation plus complète, particulièrement si vous découvrez les tests unitaires, consultez la documentation en cours, et pour des exemples de scénarios de test, consultez le tutorial sur les tests unitaires.

Utiliser le testeur rapidement

Parmi les outils de test pour logiciel, le testeur unitaire est le plus proche du développeur. Dans un contexte de développement agile, le code de test se place juste à côté du code source étant donné que tous les deux sont écrits simultanément. Dans ce contexte, SimpleTest aspire à être une solution complète de test pour un développeur PHP et s'appelle "Simple" parce qu'elle devrait être simple à utiliser et à étendre. Ce nom n'était pas vraiment un bon choix. Non seulement cette solution inclut toutes les fonctions classiques qu'on est en droit d'attendre de la part des portages de JUnit et des PHPUnit, mais elle inclut aussi les objets fantaisie ou "mock objects". Sans compter quelques fonctionnalités de JWebUnit : parmi celles-ci la navigation sur des pages web, les tests sur les cookies et l'envoi de formulaire.

La démonstration la plus rapide : l'exemple

Supposons que nous sommes en train de tester une simple classe de log dans un fichier : elle s'appelle Log dans classes/Log.php. Commençons par créer un script de test, appelé tests/log_test.php. Son contenu est le suivant...

<?php
require_once('simpletest/unit_tester.php');
require_once('simpletest/reporter.php');
require_once('../classes/log.php');
?>
Ici le répertoire simpletest est soit dans le dossier courant, soit dans les dossiers pour fichiers inclus. Vous auriez à éditer ces arborescences suivant l'endroit où vous avez installé SimpleTest. Ensuite créons un scénario de test...
<?php
require_once('simpletest/unit_tester.php');
require_once('simpletest/reporter.php');
require_once('../classes/log.php');

class TestOfLogging extends UnitTestCase {
}
?>
A présent il y a 5 lignes de code d'échafaudage et toujours pas de test. Cependant à partir de cet instant le retour sur investissement arrive très rapidement. Supposons que la classe Log prenne le nom du fichier à écrire dans le constructeur et que nous ayons un répertoire temporaire dans lequel placer ce fichier...
<?php
require_once('simpletest/unit_tester.php');
require_once('simpletest/reporter.php');
require_once('../classes/log.php');

class TestOfLogging extends UnitTestCase {
    
    function testCreatingNewFile() {
        @unlink('/temp/test.log');
        $log = new Log('/temp/test.log');
        $this->assertFalse(file_exists('/temp/test.log'));
        $log->message('Should write this to a file');
        $this->assertTrue(file_exists('/temp/test.log'));
    }
}
?>
Au lancement du scénario de test, toutes les méthodes qui commencent avec la chaîne test sont identifiées puis exécutées. D'ordinaire nous avons bien plusieurs méthodes de tests. Les assertions dans les méthodes de test envoient des messages vers le framework de test qui affiche immédiatement le résultat. Cette réponse immédiate est importante, non seulement lors d'un crash causé par le code, mais aussi de manière à rapprocher l'affichage de l'erreur au plus près du scénario de test concerné.

Pour voir ces résultats lançons effectivement les tests. S'il s'agit de l'unique scénario de test à lancer, on peut y arriver avec...

<?php
require_once('simpletest/unit_tester.php');
require_once('simpletest/reporter.php');
require_once('../classes/log.php');

class TestOfLogging extends UnitTestCase {
    
    function testCreatingNewFile() {
        @unlink('/temp/test.log');
        $log = new Log('/temp/test.log');
        $this->assertFalse(file_exists('/temp/test.log'));
        $log->message('Should write this to a file');
        $this->assertTrue(file_exists('/temp/test.log'));
    }
}

$test = &new TestOfLogging();
$test->run(new HtmlReporter());
?>

En cas échec, l'affichage ressemble à...

testoflogging

Fail: testcreatingnewfile->True assertion failed.
1/1 test cases complete. 1 passes and 1 fails.
...et si ça passe, on obtient...

testoflogging

1/1 test cases complete. 2 passes and 0 fails.
Et si vous obtenez ça...
Fatal error: Failed opening required '../classes/log.php' (include_path='') in /home/marcus/projects/lastcraft/tutorial_tests/Log/tests/log_test.php on line 7
c'est qu'il vous manque le fichier classes/Log.php qui pourrait ressembler à :
<?php
class Log {
    
        function Log($file_path) {
        }
}
?>;

Construire des groupes de tests

Il est peu probable que dans une véritable application on ait uniquement besoin de passer un seul scénario de test. Cela veut dire que nous avons besoin de grouper les scénarios dans un script de test qui peut, si nécessaire, lancer tous les tests de l'application.

Notre première étape est de supprimer les includes et de défaire notre hack précédent...

<?php
require_once('../classes/log.php');

class TestOfLogging extends UnitTestCase {
    
    function testCreatingNewFile() {
        @unlink('/temp/test.log');
        $log = new Log('/temp/test.log');
        $this->assertFalse(file_exists('/temp/test.log'));
        $log->message('Should write this to a file');
        $this->assertTrue(file_exists('/temp/test.log'));
    }
}
?>
Ensuite nous créons un nouveau fichier appelé tests/all_tests.php. On y insert le code suivant...
<?php
require_once('simpletest/unit_tester.php');
require_once('simpletest/reporter.php');

$test = &new GroupTest('All tests');
$test->addTestFile('log_test.php');
$test->run(new HtmlReporter());
?>
Cette méthode GroupTest::addTestFile() va inclure le fichier de scénarios de test et lire parmi toutes les nouvelles classes créées celles qui sont issues de TestCase. Dans un premier temps, seuls les noms sont stockés, de la sorte le lanceur de test peut instancier la classe au fur et à mesure qu'il exécute votre suite de tests.

Pour que ça puisse marcher proprement le fichier de suite de tests ne devrait pas inclure aveuglement d'autres extensions de scénarios de test qui n'exécuteraient pas effectivement de test. Le résultat pourrait être que des tests supplémentaires soient alors être comptabilisés pendant l'exécution des tests. Ce n'est pas un problème grave mais pour éviter ce désagrément, il suffit d'ajouter la commande SimpleTestOptions::ignore() quelque part dans le fichier de scénario de test. Par ailleurs le scénario de test ne devrait pas avoir été inclus ailleurs ou alors aucun scénario ne sera ajouté aux groupes de test. Il s'agirait là d'une erreur autrement sérieuse : si tous les classes de scénario de test sont chargées par PHP, alors la méthode GroupTest::addTestFile() ne pourra pas les détecter.

Pour afficher les résultats, il est seulement nécessaire d'invoquer tests/all_tests.php à partir du serveur web.

Utiliser les objets fantaisie

Avançons un peu plus dans le futur.

Supposons que notre class logging soit testée et terminée. Supposons aussi que nous testons une autre classe qui ait besoin d'écrire des messages de log, disons SessionPool. Nous voulons tester une méthode qui ressemblera probablement à quelque chose comme...


class SessionPool {
    ...
    function logIn($username) {
        ...
        $this->_log->message('User $username logged in.');
        ...
    }
    ...
}

Avec le concept de "réutilisation de code" comme fil conducteur, nous utilisons notre class Log. Un scénario de test classique ressemblera peut-être à...

<?php
require_once('../classes/log.php');
require_once('../classes/session_pool.php');

class TestOfSessionLogging extends UnitTestCase {
    
    function setUp() {
        @unlink('/temp/test.log');
    }
    
    function tearDown() {
        @unlink('/temp/test.log');
    }
    
    function testLogInIsLogged() {
        $log = new Log('/temp/test.log');
        $session_pool = &new SessionPool($log);
        $session_pool->logIn('fred');
        $messages = file('/temp/test.log');
        $this->assertEqual($messages[0], "User fred logged in.\n");
    }
}
?>
Le design de ce scénario de test n'est pas complètement mauvais, mais on peut l'améliorer. Nous passons du temps à tripoter les fichiers de log qui ne font pas partie de notre test. Pire, nous avons créé des liens de proximité entre la classe Log et ce test. Que se passerait-il si nous n'utilisions plus de fichiers, mais la bibliothèque syslog à la place ? Avez-vous remarqué le retour chariot supplémentaire à la fin du message ? A-t-il été ajouté par le loggueur ? Et si il ajoutait aussi un timestamp ou d'autres données ?

L'unique partie à tester réellement est l'envoi d'un message précis au loggueur. Nous réduisons le couplage en créant une fausse classe de logging : elle ne fait qu'enregistrer le message pour le test, mais ne produit aucun résultat. Sauf qu'elle doit ressembler exactement à l'original.

Si l'objet fantaisie n'écrit pas dans un fichier alors nous nous épargnons la suppression du fichier avant et après le test. Nous pourrions même nous épargner quelques lignes de code supplémentaires si l'objet fantaisie pouvait exécuter l'assertion.

Trop beau pour être vrai ? Par chance on peut créer un tel objet très facilement...
<?php
require_once('../classes/log.php');
require_once('../classes/session_pool.php');
Mock::generate('Log');

class TestOfSessionLogging extends UnitTestCase {
    
    function testLogInIsLogged() {
        $log = &new MockLog($this);
        $log->expectOnce('message', array('User fred logged in.'));
        $session_pool = &new SessionPool($log);
        $session_pool->logIn('fred');
        $log->tally();
    }
}
?>
L'appel tally() est nécessaire pour annoncer à l'objet fantaisie qu'il n'y aura plus d'appels ultérieurs. Sans ça l'objet fantaisie pourrait attendre pendant une éternité l'appel de la méthode sans jamais prévenir le scénario de test. Les autres tests sont déclenchés automatiquement quand l'appel à message() est invoqué sur l'objet MockLog. L'appel mock va déclencher une comparaison des paramètres et ensuite envoyer le message "pass" ou "fail" au test pour l'affichage. Des jokers peuvent être inclus ici aussi afin d'empêcher que les tests ne deviennent trop spécifiques.

Les objets fantaisie dans la suite SimpleTest peuvent avoir un ensemble de valeurs de sortie arbitraires, des séquences de sorties, des valeurs de sortie sélectionnées à partir des arguments d'entrée, des séquences de paramètres attendus et des limites sur le nombre de fois qu'une méthode peut être invoquée.

Pour que ce test fonctionne la librairie avec les objets fantaisie doit être incluse dans la suite de tests, par exemple dans all_tests.php.

Tester une page web

Une des exigences des sites web, c'est qu'ils produisent des pages web. Si vous construisez un projet de A à Z et que vous voulez intégrer des tests au fur et à mesure alors vous voulez un outil qui puisse effectuer une navigation automatique et en examiner le résultat. C'est le boulot d'un testeur web.

Effectuer un test web via SimpleTest reste assez primitif : il n'y a pas de javascript par exemple. Pour vous donner une idée, voici un exemple assez trivial : aller chercher une page web, à partir de là naviguer vers la page "about" et finalement tester un contenu déterminé par le client.

<?php
require_once('simpletest/web_tester.php');
require_once('simpletest/reporter.php');

class TestOfAbout extends WebTestCase {
    
    function setUp() {
        $this->get('http://test-server/index.php');
        $this->clickLink('About');
    }
    
    function testSearchEngineOptimisations() {
        $this->assertTitle('A long title about us for search engines');
        $this->assertWantedPattern('/a popular keyphrase/i');
    }
}
$test = &new TestOfAbout();
$test->run(new HtmlReporter());
?>
Avec ce code comme test de recette, vous pouvez vous assurer que le contenu corresponde toujours aux spécifications à la fois des développeurs et des autres parties prenantes au projet.

SourceForge.net Logo

pgfouine-1.2/tests/simpletest/docs/fr/partial_mocks_documentation.html0000644000175000017500000003750210334504440025131 0ustar acmeacme Documentation SimpleTest : les objets fantaisie partiels

Documentation sur les objets fantaisie partiels

Un objet fantaisie partiel n'est ni plus ni moins qu'un modèle de conception pour soulager un problème spécifique du test avec des objets fantaisie, celui de placer des objets fantaisie dans des coins serrés. Il s'agit d'un outil assez limité et peut-être même une idée pas si bonne que ça. Elle est incluse dans SimpleTest pour la simple raison que je l'ai trouvée utile à plus d'une occasion et qu'elle m'a épargnée pas mal de travail dans ces moments-là.

Le problème de l'injection dans un objet fantaisie

Quand un objet en utilise un autre il est très simple d'y faire circuler une version fantaisie déjà prête avec ses attentes. Les choses deviennent un peu plus délicates si un objet en crée un autre et que le créateur est celui que l'on souhaite tester. Cela revient à dire que l'objet créé devrait être une fantaisie, mais nous pouvons difficilement dire à notre classe sous test de créer un objet fantaisie plutôt qu'un "vrai" objet. La classe testée ne sait même pas qu'elle travaille dans un environnement de test.

Par exemple, supposons que nous sommes en train de construire un client telnet et qu'il a besoin de créer une socket réseau pour envoyer ses messages. La méthode de connexion pourrait ressemble à quelque chose comme...

<?php
    require_once('socket.php');
    
    class Telnet {
        ...
        function &connect($ip, $port, $username, $password) {
            $socket = &new Socket($ip, $port);
            $socket->read( ... );
            ...
        }
    }
?>
Nous voudrions vraiment avoir une version fantaisie de l'objet socket, que pouvons nous faire ?

La première solution est de passer la socket en tant que paramètre, ce qui force la création au niveau inférieur. Charger le client de cette tâche est effectivement une bonne approche si c'est possible et devrait conduire à un remaniement -- de la création à partir de l'action. En fait, c'est là une des manières avec lesquels tester en s'appuyant sur des objets fantaisie vous force à coder des solutions plus resserrées sur leur objectif. Ils améliorent votre programmation.

Voici ce que ça devrait être...

<?php
    require_once('socket.php');
    
    class Telnet {
        ...
        function &connect(&$socket, $username, $password) {
            $socket->read( ... );
            ...
        }
    }
?>
Sous-entendu, votre code de test est typique d'un cas de test avec un objet fantaisie.
class TelnetTest extends UnitTestCase {
    ...
    function testConnection() {
        $socket = &new MockSocket($this);
        ...
        $telnet = &new Telnet();
        $telnet->connect($socket, 'Me', 'Secret');
        ...
    }
}
C'est assez évident que vous ne pouvez descendre que d'un niveau. Vous ne voudriez pas que votre application de haut niveau crée tous les fichiers de bas niveau, sockets et autres connexions à la base de données dont elle aurait besoin. Elle ne connaîtrait pas les paramètres du constructeur de toute façon.

La solution suivante est de passer l'objet créé sous la forme d'un paramètre optionnel...

<?php
    require_once('socket.php');
    
    class Telnet {
        ...
        function &connect($ip, $port, $username, $password, $socket = false) {
            if (!$socket) {
                $socket = &new Socket($ip, $port);
            }
            $socket->read( ... );
            ...
            return $socket;
        }
    }
?>
Pour une solution rapide, c'est généralement suffisant. Ensuite le test est très similaire : comme si le paramètre était transmis formellement...
class TelnetTest extends UnitTestCase {
    ...
    function testConnection() {
        $socket = &new MockSocket($this);
        ...
        $telnet = &new Telnet();
        $telnet->connect('127.0.0.1', 21, 'Me', 'Secret', &$socket);
        ...
    }
}
Le problème de cette approche tient dans son manque de netteté. Il y a du code de test dans la classe principale et aussi des paramètres transmis dans le scénario de test qui ne sont jamais utilisés. Il s'agit là d'une approche rapide et sale, mais qui ne reste pas moins efficace dans la plupart des situations.

Une autre solution encore est de laisser un objet fabrique s'occuper de la création...

<?php
    require_once('socket.php');
    
    class Telnet {
        function Telnet(&$network) {
            $this->_network = &$network;
        }
        ...
        function &connect($ip, $port, $username, $password) {
            $socket = &$this->_network->createSocket($ip, $port);
            $socket->read( ... );
            ...
            return $socket;
        }
    }
?>
Il s'agit là probablement de la réponse la plus travaillée étant donné que la création est maintenant située dans une petite classe spécialisée. La fabrique réseau peut être testée séparément et utilisée en tant que fantaisie quand nous testons la classe telnet...
class TelnetTest extends UnitTestCase {
    ...
    function testConnection() {
        $socket = &new MockSocket($this);
        ...
        $network = &new MockNetwork($this);
        $network->setReturnReference('createSocket', $socket);
        $telnet = &new Telnet($network);
        $telnet->connect('127.0.0.1', 21, 'Me', 'Secret');
        ...
    }
}
Le problème reste que nous ajoutons beaucoup de classes à la bibliothèque. Et aussi que nous utilisons beaucoup de fabriques ce qui rend notre code un peu moins intuitif. La solution la plus flexible, mais aussi la plus complexe.

Peut-on trouver un juste milieu ?

Méthode fabrique protégée

Il existe une technique pour palier à ce problème sans créer de nouvelle classe dans l'application; par contre elle induit la création d'une sous-classe au moment du test. Premièrement nous déplaçons la création de la socket dans sa propre méthode...

<?php
    require_once('socket.php');
    
    class Telnet {
        ...
        function &connect($ip, $port, $username, $password) {
            $socket = &$this->_createSocket($ip, $port);
            $socket->read( ... );
            ...
        }
        
        function &_createSocket($ip, $port) {
            return new Socket($ip, $port);
        }
    }
?>
Il s'agit là de la seule modification dans le code de l'application.

Pour le scénario de test, nous devons créer une sous-classe de manière à intercepter la création de la socket...

class TelnetTestVersion extends Telnet {
    var $_mock;
    
    function TelnetTestVersion(&$mock) {
        $this->_mock = &$mock;
        $this->Telnet();
    }
    
    function &_createSocket() {
        return $this->_mock;
    }
}
Ici j'ai déplacé la fantaisie dans le constructeur, mais un setter aurait fonctionné tout aussi bien. Notez bien que la fantaisie est placée dans une variable d'objet avant que le constructeur ne soit attaché. C'est nécessaire dans le cas où le constructeur appelle connect(). Autrement il pourrait donner un valeur nulle à partir de _createSocket().

Après la réalisation de tout ce travail supplémentaire le scénario de test est assez simple. Nous avons juste besoin de tester notre nouvelle classe à la place...

class TelnetTest extends UnitTestCase {
    ...
    function testConnection() {
        $socket = &new MockSocket($this);
        ...
        $telnet = &new TelnetTestVersion($socket);
        $telnet->connect('127.0.0.1', 21, 'Me', 'Secret');
        ...
    }
}
Cette nouvelle classe est très simple bien sûr. Elle ne fait qu'initier une valeur renvoyée, à la manière d'une fantaisie. Ce serait pas mal non plus si elle pouvait vérifier les paramètres entrants. Exactement comme un objet fantaisie. Il se pourrait bien que nous ayons à réaliser cette astuce régulièrement : serait-il possible d'automatiser la création de cette sous-classe ?

Un objet fantaisie partiel

Bien sûr la réponse est "oui" ou alors j'aurais arrêté d'écrire depuis quelques temps déjà ! Le test précédent a représenté beaucoup de travail, mais nous pouvons générer la sous-classe en utilisant une approche à celle des objets fantaisie.

Voici donc une version avec objet fantaisie partiel du test...

Mock::generatePartial(
        'Telnet',
        'TelnetTestVersion',
        array('_createSocket'));

class TelnetTest extends UnitTestCase {
    ...
    function testConnection() {
        $socket = &new MockSocket($this);
        ...
        $telnet = &new TelnetTestVersion($this);
        $telnet->setReturnReference('_createSocket', $socket);
        $telnet->Telnet();
        $telnet->connect('127.0.0.1', 21, 'Me', 'Secret');
        ...
    }
}
La fantaisie partielle est une sous-classe de l'original dont on aurait "remplacé" les méthodes sélectionnées avec des versions de test. L'appel à generatePartial() nécessite trois paramètres : la classe à sous classer, le nom de la nouvelle classe et une liste des méthodes à simuler.

Instancier les objets qui en résultent est plutôt délicat. L'unique paramètre du constructeur d'un objet fantaisie partiel est la référence du testeur unitaire. Comme avec les objets fantaisie classiques c'est nécessaire pour l'envoi des résultats de test en réponse à la vérification des attentes.

Une nouvelle fois le constructeur original n'est pas lancé. Indispensable dans le cas où le constructeur aurait besoin des méthodes fantaisie : elles n'ont pas encore été initiées ! Nous initions les valeurs retournées à cet instant et ensuite lançons le constructeur avec ses paramètres normaux. Cette construction en trois étapes de "new", suivie par la mise en place des méthodes et ensuite par la lancement du constructeur proprement dit est ce qui distingue le code d'un objet fantaisie partiel.

A part pour leur construction, toutes ces méthodes fantaisie ont les mêmes fonctionnalités que dans le cas des objets fantaisie et toutes les méthodes non fantaisie se comportent comme avant. Nous pouvons mettre en place des attentes très facilement...

class TelnetTest extends UnitTestCase {
    ...
    function testConnection() {
        $socket = &new MockSocket($this);
        ...
        $telnet = &new TelnetTestVersion($this);
        $telnet->setReturnReference('_createSocket', $socket);
        $telnet->expectOnce('_createSocket', array('127.0.0.1', 21));
        $telnet->Telnet();
        $telnet->connect('127.0.0.1', 21, 'Me', 'Secret');
        ...
        $telnet->tally();
    }
}

Tester moins qu'une classe

Les méthodes issues d'un objet fantaisie n'ont pas besoin d'être des méthodes fabrique, Il peut s'agir de n'importe quelle sorte de méthode. Ainsi les objets fantaisie partiels nous permettent de prendre le contrôle de n'importe quelle partie d'une classe, le constructeur excepté. Nous pourrions même aller jusqu'à créer des fantaisies sur toutes les méthode à part celle que nous voulons effectivement tester.

Cette situation est assez hypothétique, étant donné que je ne l'ai jamais essayée. Je suis ouvert à cette possibilité, mais je crains qu'en forçant la granularité d'un objet on n'obtienne pas forcément un code de meilleur qualité. Personnellement j'utilise les objets fantaisie partiels comme moyen de passer outre la création ou alors de temps en temps pour tester le modèle de conception TemplateMethod.

Pour choisir le mécanisme à utiliser, on en revient toujours aux standards de code de votre projet.

pgfouine-1.2/tests/simpletest/docs/fr/reporter_documentation.html0000644000175000017500000005173710334504440024151 0ustar acmeacme Documentation SimpleTest : le rapporteur de test

Documentation sur le rapporteur de test

SimpleTest suit plutôt plus que moins le modèle MVC (Modèle-Vue-Contrôleur). Les classes "reporter" sont les vues et les modèles sont vos scénarios de test et leur hiérarchie. Le contrôleur est le plus souvent masqué à l'utilisateur de SimpleTest à moins de vouloir changer la façon dont les tests sont effectivement exécutés, auquel cas il est possible de surcharger les objets "runner" (ceux de l'exécuteur) depuis l'intérieur d'un scénario de test. Comme d'habitude avec MVC, le contrôleur est plutôt indéfini et il existe d'autres endroits pour contrôler l'exécution des tests.

Les résultats rapportés au format HTML

L'affichage par défaut est minimal à l'extrême. Il renvoie le succès ou l'échec avec les barres conventionnelles - rouge et verte - et affichent une trace d'arborescence des groupes de test pour chaque assertion erronée. Voici un tel échec...

File test

Fail: createnewfile->True assertion failed.
1/1 test cases complete. 0 passes, 1 fails and 0 exceptions.
Alors qu'ici tous les tests passent...

File test

1/1 test cases complete. 1 passes, 0 fails and 0 exceptions.
La bonne nouvelle, c'est qu'il existe pas mal de points dans la hiérarchie de l'affichage pour créer des sous-classes.

Pour l'affichage basé sur des pages web, il y a la classe HtmlReporter avec la signature suivante...

class HtmlReporter extends SimpleReporter {
    public HtmlReporter($encoding) { ... }
    public makeDry(boolean $is_dry) { ... }
    public void paintHeader(string $test_name) { ... }
    public void sendNoCacheHeaders() { ... }
    public void paintFooter(string $test_name) { ... }
    public void paintGroupStart(string $test_name, integer $size) { ... }
    public void paintGroupEnd(string $test_name) { ... }
    public void paintCaseStart(string $test_name) { ... }
    public void paintCaseEnd(string $test_name) { ... }
    public void paintMethodStart(string $test_name) { ... }
    public void paintMethodEnd(string $test_name) { ... }
    public void paintFail(string $message) { ... }
    public void paintPass(string $message) { ... }
    public void paintError(string $message) { ... }
    public void paintException(string $message) { ... }
    public void paintMessage(string $message) { ... }
    public void paintFormattedMessage(string $message) { ... }
    protected string _getCss() { ... }
    public array getTestList() { ... }
    public integer getPassCount() { ... }
    public integer getFailCount() { ... }
    public integer getExceptionCount() { ... }
    public integer getTestCaseCount() { ... }
    public integer getTestCaseProgress() { ... }
}
Voici ce que certaines de ces méthodes veulent dire. Premièrement les méthodes d'affichage que vous voudrez probablement surcharger...
  • HtmlReporter(string $encoding)
    est le constructeur. Notez que le test unitaire initie le lien à l'affichage plutôt que l'opposé. L'affichage est principalement un receveur passif des évènements de tests. Cela permet d'adapter facilement l'affichage pour d'autres systèmes en dehors des tests unitaires, tel le suivi de la charge de serveurs. L'"encoding" est le type d'encodage que vous souhaitez utiliser pour l'affichage du test. Pour pouvoir effectuer un rendu correct de la sortie de débogage quand on utilise le testeur web, il doit correspondre à l'encodage du site testé. Les chaînes de caractères disponibles sont indiquées dans la fonction PHP html_entities().
  • void paintHeader(string $test_name)
    est appelé une fois, au début du test quand l'évènement de démarrage survient. Le premier évènement de démarrage est souvent délivré par le groupe de test du niveau le plus haut et donc c'est de là que le $test_name arrive. Il peint les titres de la page, CSS, la balise "body", etc. Il ne renvoie rien du tout (void).
  • void paintFooter(string $test_name)
    est appelé à la toute fin du test pour fermer les balises ouvertes par l'entête de la page. Par défaut il affiche aussi la barre rouge ou verte et le décompte final des résultats. En fait la fin des tests arrive quand l'évènement de fin de test arrive avec le même nom que celui qui l'a initié au même niveau. Le nid des tests en quelque sorte. Fermer le dernier test finit l'affichage.
  • void paintMethodStart(string $test_name)
    est appelé au début de chaque méthode de test. Normalement le nom vient de celui de la méthode. Les autres évènements de départ de test se comportent de la même manière sauf que celui du groupe de test indique au rapporteur le nombre de scénarios de test qu'il contient. De la sorte le rapporteur peut afficher une barre de progrès au fur et à mesure que l'exécuteur passe en revue les scénarios de test.
  • void paintMethodEnd(string $test_name)
    clôt le test lancé avec le même nom.
  • void paintFail(string $message)
    peint un échec. Par défait il ne fait qu'afficher le mot "fail", une trace d'arborescence affichant la position du test en cours et le message transmis par l'assertion.
  • void paintPass(string $message)
    ne fait rien, par défaut.
  • string _getCss()
    renvoie les styles CSS sous la forme d'une chaîne à l'attention de la méthode d'entêtes d'une page. Des styles additionnels peuvent être ajoutés ici si vous ne surchargez pas les entêtes de la page. Vous ne voudrez pas utiliser cette méthode dans des entêtes d'une page surchargée si vous souhaitez inclure le feuille de style CSS d'origine.
Il y a aussi des accesseurs pour aller chercher l'information sur l'état courant de la suite de test. Vous les utiliserez pour enrichir l'affichage...
  • array getTestList()
    est la première méthode très commode pour les sous-classes. Elle liste l'arborescence courante des tests sous la forme d'une liste de noms de tests. Le premier test -- celui le plus proche du coeur -- sera le premier dans la liste et la méthode de test en cours sera la dernière.
  • integer getPassCount()
    renvoie le nombre de succès atteint. Il est nécessaire pour l'affichage à la fin.
  • integer getFailCount()
    renvoie de la même manière le nombre d'échecs.
  • integer getExceptionCount()
    renvoie quant à lui le nombre d'erreurs.
  • integer getTestCaseCount()
    est le nombre total de scénarios lors de l'exécution des tests. Il comprend aussi les tests groupés.
  • integer getTestCaseProgress()
    est le nombre de scénarios réalisés jusqu'à présent.
Une modification simple : demander à l'HtmlReporter d'afficher aussi bien les succès que les échecs et les erreurs...
class ShowPasses extends HtmlReporter {
    
    function paintPass($message) {
        parent::paintPass($message);
        print "&<span class=\"pass\">Pass</span>: ";
        $breadcrumb = $this->getTestList();
        array_shift($breadcrumb);
        print implode("-&gt;", $breadcrumb);
        print "-&gt;$message<br />\n";
    }
    
    function _getCss() {
        return parent::_getCss() . ' .pass { color: green; }';
    }
}

Une méthode qui a beaucoup fait jaser reste la méthode makeDry(). Si vous lancez cette méthode, sans paramètre, sur le rapporteur avant que la suite de test ne soit exécutée alors aucune méthode de test ne sera appelée. Vous continuerez à avoir les évènements entrants et sortants des méthodes et scénarios de test, mais aucun succès ni échec ou erreur, parce que le code de test ne sera pas exécuté.

La raison ? Pour permettre un affichage complexe d'une IHM (ou GUI) qui permettrait la sélection de scénarios de test individuels. Afin de construire une liste de tests possibles, ils ont besoin d'un rapport sur la structure du test pour, par exemple, l'affichage un vue en arbre de la suite de test. Avec un rapporteur lancé sur une exécution sèche qui ne renverrait que les évènements d'affichage, cela devient facilement réalisable.

Etendre le rapporteur

Plutôt que de modifier l'affichage existant, vous voudrez peut-être produire une présentation HTML complètement différente, ou même générer une version texte ou XML. Plutôt que de surcharger chaque méthode dans HtmlReporter nous pouvons nous rendre une étape plus haut dans la hiérarchie de classe vers SimpleReporter dans le fichier source simple_test.php.

Un affichage sans rien, un canvas vierge pour votre propre création, serait...

require_once('simpletest/simple_test.php');

class MyDisplay extends SimpleReporter {
    
    function paintHeader($test_name) {
    }
    
    function paintFooter($test_name) {
    }
    
    function paintStart($test_name, $size) {
        parent::paintStart($test_name, $size);
    }
    
    function paintEnd($test_name, $size) {
        parent::paintEnd($test_name, $size);
    }
    
    function paintPass($message) {
        parent::paintPass($message);
    }
    
    function paintFail($message) {
        parent::paintFail($message);
    }
}
Aucune sortie ne viendrait de cette classe jusqu'à un ajout de votre part.

Le rapporteur en ligne de commande

SimpleTest est aussi livré avec un rapporteur en ligne de commande, minime lui aussi. L'interface imite celle de JUnit, sauf qu'elle envoie les messages d'erreur au fur et à mesure de leur arrivée. Pour utiliser le rapporteur en ligne de commande, il suffit de l'intervertir avec celui de la version HTML...

<?php
    require_once('simpletest/unit_tester.php');
    require_once('simpletest/reporter.php');

    $test = &new GroupTest('File test');
    $test->addTestFile('tests/file_test.php');
    $test->run(new TextReporter());
?>
Et ensuite d'invoquer la suite de test à partir d'une ligne de commande...
php file_test.php
Bien sûr vous aurez besoin d'installer PHP en ligne de commande. Une suite de test qui passerait toutes ses assertions ressemble à...
File test
OK
Test cases run: 1/1, Failures: 0, Exceptions: 0
Un échec déclenche un affichage comme...
File test
1) True assertion failed.
	in createnewfile
FAILURES!!!
Test cases run: 1/1, Failures: 1, Exceptions: 0

Une des principales raisons pour utiliser une suite de test en ligne de commande tient dans l'utilisation possible du testeur avec un processus automatisé. Pour fonctionner comme il faut dans des scripts shell le script de test devrait renvoyer un code de sortie non-nul suite à un échec. Si une suite de test échoue la valeur false est renvoyée par la méthode SimpleTest::run(). Nous pouvons utiliser ce résultat pour terminer le script avec la bonne valeur renvoyée...

<?php
    require_once('simpletest/unit_tester.php');
    require_once('simpletest/reporter.php');

    $test = &new GroupTest('File test');
    $test->addTestFile('tests/file_test.php');
    exit ($test->run(new TextReporter()) ? 0 : 1);
?>
Bien sûr l'objectif n'est pas de créer deux scripts de test, l'un en ligne de commande et l'autre pour un navigateur web, pour chaque suite de test. Le rapporteur en ligne de commande inclut une méthode pour déterminer l'environnement d'exécution...
<?php
    require_once('simpletest/unit_tester.php');
    require_once('simpletest/reporter.php');

    $test = &new GroupTest('File test');
    $test->addTestFile('tests/file_test.php');
    if (TextReporter::inCli()) {
        exit ($test->run(new TextReporter()) ? 0 : 1);
    }
    $test->run(new HtmlReporter());
?>
Il s'agit là de la forme utilisée par SimpleTest lui-même.

Test distant

SimpleTest est livré avec une classe XmlReporter utilisée pour de la communication interne. Lors de son exécution, le résultat ressemble à...

<?xml version="1.0"?>
<run>
  <group size="4">
    <name>Remote tests</name>
    <group size="4">
      <name>Visual test with 48 passes, 48 fails and 4 exceptions</name>
      <case>
        <name>testofunittestcaseoutput</name>
        <test>
          <name>testofresults</name>
          <pass>This assertion passed</pass>
          <fail>This assertion failed</fail>
        </test>
        <test>
          ...
        </test>
      </case>
    </group>
  </group>
</run>
Vous pouvez utiliser ce format avec le parseur fourni dans SimpleTest lui-même. Il s'agit de SimpleTestXmlParser et se trouve xml.php à l'intérieur du paquet SimpleTest...
<?php
    require_once('simpletest/xml.php');
    
    ...
    $parser = &new SimpleTestXmlParser(new HtmlReporter());
    $parser->parse($test_output);
?>
$test_output devrait être au format XML, à partir du rapporteur XML, et pourrait venir d'une exécution en ligne de commande d'un scénario de test. Le parseur envoie des évènements au rapporteur exactement comme tout autre exécution de test. Il y a des occasions bizarres dans lesquelles c'est en fait très utile.

Un problème des suites de test très grandes, c'est qu'elles peuvent venir à bout de la limite de mémoire par défaut d'un process PHP - 8Mb. En plaçant la sortie des groupes de test dans du XML et leur exécution dans des process différents, le résultat peut être parser à nouveau pour agrégrer les résultats avec moins d'impact sur le test au premier niveau.

Parce que la sortie XML peut venir de n'importe où, ça ouvre des possibilités d'agrégation d'exécutions de test depuis des serveur distants. Un scénario de test pour le réaliser existe déjà à l'intérieur du framework SimpleTest, mais il est encore expérimental...

<?php
    require_once('../remote.php');
    require_once('../reporter.php');
    
    $test_url = ...;
    $dry_url = ...;
    
    $test = &new GroupTest('Remote tests');
    $test->addTestCase(new RemoteTestCase($test_url, $dry_url));
    $test->run(new HtmlReporter());
?>
RemoteTestCase prend la localisation réelle du lanceur de test, tout simplement un page web au format XML. Il prend aussi l'URL d'un rapporteur initié pour effectuer une exécution sèche. Cette technique est employée pour que les progrès soient correctement rapportés vers le haut. RemoteTestCase peut être ajouté à une suite de test comme n'importe quel autre groupe de test.

pgfouine-1.2/tests/simpletest/docs/fr/authentication_documentation.html0000644000175000017500000002635310334504440025322 0ustar acmeacme Documentation Simple Test : tester l'authentification

Documentation sur l'authentification

Un des secteurs à la fois délicat et important lors d'un test de site web reste la sécurité. Tester ces schémas est au coeur des objectifs du testeur web de SimpleTest.

Authentification HTTP basique

Si vous allez chercher une page web protégée par une authentification basique, vous hériterez d'une entête 401. Nous pouvons représenter ceci par ce test...

class AuthenticationTest extends WebTestCase {
    function test401Header() {
        $this->get('http://www.lastcraft.com/protected/');
        $this->showHeaders();
    }
}
Ce qui nous permet de voir les entêtes reçues...

File test

HTTP/1.1 401 Authorization Required
Date: Sat, 18 Sep 2004 19:25:18 GMT
Server: Apache/1.3.29 (Unix) PHP/4.3.4
WWW-Authenticate: Basic realm="SimpleTest basic authentication"
Connection: close
Content-Type: text/html; charset=iso-8859-1
1/1 test cases complete. 0 passes, 0 fails and 0 exceptions.
Sauf que nous voulons éviter l'inspection visuelle, on souhaite que SimpleTest puisse nous dire si oui ou non la page est protégée. Voici un test en profondeur sur nos entêtes...
class AuthenticationTest extends WebTestCase {
    function test401Header() {
        $this->get('http://www.lastcraft.com/protected/');
        $this->assertAuthentication('Basic');
        $this->assertResponse(401);
        $this->assertRealm('SimpleTest basic authentication');
    }
}
N'importe laquelle de ces assertions suffirait, tout dépend de la masse de détails que vous souhaitez voir.

La plupart du temps, nous ne souhaitons pas tester l'authentification en elle-même, mais plutôt les pages protégées par cette authentification. Dès que la tentative d'authentification est reçue, nous pouvons y répondre à l'aide d'une réponse d'authentification :

class AuthenticationTest extends WebTestCase {
    function testAuthentication() {
        $this->get('http://www.lastcraft.com/protected/');
        $this->authenticate('Me', 'Secret');
        $this->assertTitle(...);
    }
}
Le nom d'utilisateur et le mot de passe seront désormais envoyés à chaque requête vers ce répertoire et ses sous répertoires. En revanche vous devrez vous authentifier à nouveau si vous sortez de ce répertoire.

Vous pouvez gagner une ligne en définissant l'authentification au niveau de l'URL...

class AuthenticationTest extends WebTestCase {
    function testCanReadAuthenticatedPages() {
        $this->get('http://Me:Secret@www.lastcraft.com/protected/');
        $this->assertTitle(...);
    }
}
Si votre nom d'utilisateur ou mot de passe comporte des caractères spéciaux, alors n'oubliez pas de les encoder, sinon la requête ne sera pas analysée correctement. De plus cette entête ne sera pas envoyée aux sous requêtes si vous la définissez avec une URL absolue. Par contre si vous naviguez avec des URL relatives, l'information d'authentification sera préservée.

Pour l'instant, seule l'authentification de base est implémentée et elle n'est réellement fiable qu'en tandem avec une connexion HTTPS. C'est généralement suffisant pour protéger le serveur testé des regards malveillants. Les authentifications Digest et NTLM pourraient être ajoutées prochainement.

Cookies

L'authentification de base ne donne pas assez de contrôle au développeur Web sur l'interface utilisateur. Il y a de forte chance pour que cette fonctionnalité soit codée directement dans l'architecture web à grand renfort de cookies et de timeouts compliqués.

Commençons par un simple formulaire de connexion...

<form>
    Username:
    <input type="text" name="u" value="" /><br />
    Password:
    <input type="password" name="p" value="" /><br />
    <input type="submit" value="Log in" />
</form>
Lequel doit ressembler à...

Username:
Password:

Supposons que, durant le chargement de la page, un cookie ait été inscrit avec un numéro d'identifiant de session. Nous n'allons pas encore remplir le formulaire, juste tester que nous pistons bien l'utilisateur. Voici le test...

class LogInTest extends WebTestCase {
    function testSessionCookieSetBeforeForm() {
        $this->get('http://www.my-site.com/login.php');
        $this->assertCookie('SID');
    }
}
Nous nous contentons ici de vérifier que le cookie a bien été défini. Etant donné que sa valeur est plutôt énigmatique, elle ne vaut pas la peine d'être testée.

Le reste du test est le même que dans n'importe quel autre formulaire, mais nous pourrions souhaiter nous assurer que le cookie n'a pas été modifié depuis la phase de connexion. Voici comment cela pourrait être testé :

class LogInTest extends WebTestCase {
    ...
    function testSessionCookieSameAfterLogIn() {
        $this->get('http://www.my-site.com/login.php');
        $session = $this->getCookie('SID');
        $this->setField('u', 'Me');
        $this->setField('p', 'Secret');
        $this->clickSubmit('Log in');
        $this->assertWantedPattern('/Welcome Me/');
        $this->assertCookie('SID', $session);
    }
}
Ceci confirme que l'identifiant de session est identique avant et après la connexion.

Nous pouvons même essayer de duper notre propre système en créant un cookie arbitraire pour se connecter...

class LogInTest extends WebTestCase {
    ...
    function testSessionCookieSameAfterLogIn() {
        $this->get('http://www.my-site.com/login.php');
        $this->setCookie('SID', 'Some other session');
        $this->get('http://www.my-site.com/restricted.php');
        $this->assertWantedPattern('/Access denied/');
    }
}
Votre site est-il protégé contre ce type d'attaque ?

Sessions de navigateur

Si vous testez un système d'authentification, la reconnexion par un utilisateur est un point sensible. Essayons de simuler ce qui se passe dans ce cas :

class LogInTest extends WebTestCase {
    ...
    function testLoseAuthenticationAfterBrowserClose() {
        $this->get('http://www.my-site.com/login.php');
        $this->setField('u', 'Me');
        $this->setField('p', 'Secret');
        $this->clickSubmit('Log in');
        $this->assertWantedPattern('/Welcome Me/');
        
        $this->restart();
        $this->get('http://www.my-site.com/restricted.php');
        $this->assertWantedPattern('/Access denied/');
    }
}
La méthode WebTestCase::restart() préserve les cookies dont le timeout a expiré, mais conserve les cookies temporaires ou expirés. Vous pouvez spécifier l'heure et la date de leur réactivation.

L'expiration des cookies peut être un problème. Si vous avez un cookie qui doit expirer au bout d'une heure, nous n'allons pas mettre le test en veille en attendant que le cookie expire...

Afin de provoquer leur expiration, vous pouvez dater manuellement les cookies, avant le début de la session.

class LogInTest extends WebTestCase {
    ...
    function testLoseAuthenticationAfterOneHour() {
        $this->get('http://www.my-site.com/login.php');
        $this->setField('u', 'Me');
        $this->setField('p', 'Secret');
        $this->clickSubmit('Log in');
        $this->assertWantedPattern('/Welcome Me/');
        
        $this->ageCookies(3600);
        $this->restart();
        $this->get('http://www.my-site.com/restricted.php');
        $this->assertWantedPattern('/Access denied/');
    }
}
Après le redémarrage, les cookies seront plus vieux d'une heure et que tous ceux dont la date d'expiration sera passée auront disparus.

pgfouine-1.2/tests/simpletest/docs/fr/group_test_documentation.html0000644000175000017500000003130710334504440024471 0ustar acmeacme Documentation SimpleTest : Grouper des tests

Documentation sur le groupement des tests

Grouper des tests

Pour lancer les scénarios de tests en tant que groupe, ils devraient être placés dans des fichiers sans le code du lanceur...

<?php
    require_once('../classes/io.php');

    class FileTester extends UnitTestCase {
        ...
    }

    class SocketTester extends UnitTestCase {
        ...
    }
?>
Autant de scénarios que nécessaires peuvent être mis dans un fichier unique. Ils doivent contenir tout le code nécessaire, entre autres la bibliothèque testée, mais aucune des bibliothèques de SimpleTest.

Si vous avez étendu l'un ou l'autre des scénarios de test, vous pouvez aussi les inclure.

<?php
    require_once('../classes/io.php');

    class MyFileTestCase extends UnitTestCase {
        ...
    }
    SimpleTestOptions::ignore('MyFileTestCase');

    class FileTester extends MyFileTestCase {
        ...
    }

    class SocketTester extends UnitTestCase {
        ...
    }
?>
La classe FileTester ne contient aucun test véritable, il s'agit d'une classe de base pour d'autres scénarios de test. Pour cette raison nous utilisons la directive SimpleTestOptions::ignore() pour indiquer au prochain groupe de test de l'ignorer. Cette directive peut se placer n'importe où dans le fichier et fonctionne quand un fichier complet des scénarios de test est chargé (cf. ci-dessous). Nous l'appelons file_test.php.

Ensuite nous créons un fichier de groupe de test, disons group_test.php. Vous penserez à un nom plus convaincant, j'en suis sûr. Nous lui ajoutons le fichier de test avec une méthode sans risque...

<?php
    require_once('simpletest/unit_tester.php');
    require_once('simpletest/reporter.php');
    require_once('file_test.php');

    $test = &new GroupTest('All file tests');
    $test->addTestCase(new FileTestCase());
    $test->run(new HtmlReporter());
?>
Ceci instancie le scénario de test avant que la suite de test ne soit lancée. Ça pourrait devenir assez onéreux avec un grand nombre de scénarios de test : il existe donc une autre méthode qui instancie la classe uniquement quand elle devient nécessaire...
<?php
    require_once('simpletest/unit_tester.php');
    require_once('simpletest/reporter.php');
    require_once('file_test.php');

    $test = &new GroupTest('All file tests');
    $test->addTestClass('FileTestCase');
    $test->run(new HtmlReporter());
?>
Le problème de cette technique est que pour chaque scénario de test supplémentaire nous aurons à require_once() le fichier de code de test et à manuellement instancier chaque scénario de test. Nous pouvons nous épargner beaucoup de dactylographie avec...
<?php
    require_once('simpletest/unit_tester.php');
    require_once('simpletest/reporter.php');

    $test = &new GroupTest('All file tests');
    $test->addTestFile('file_test.php');
    $test->run(new HtmlReporter());
?&gt;
Voici ce qui vient de se passer : la classe GroupTest a réalisé le require_once() pour nous. Ensuite elle vérifie si de nouvelles classes de scénario de test ont été créées par ce nouveau fichier et les ajoute automatiquement au groupe de test. Désormais tout ce qu'il nous reste à faire, c'est d'ajouter chaque nouveau fichier.

Il y a deux choses qui peuvent planter et qui demandent un minimum d'attention...

  1. Le fichier peut déjà avoir été analysé par PHP et dans ce cas aucune classe ne sera ajoutée. Pensez à bien vérifier que les scénarios de test ne sont inclus que dans ce fichier et dans aucun autre.
  2. Les nouvelles classes d'extension de scénario de test qui sont incluses seront placées dans le groupe de test et exécutées par la même occasion. Vous aurez à ajouter une directive SimpleTestOptions::ignore() pour ces classes ou alors pensez à les ajouter avant la ligne GroupTest::addTestFile().

Groupements de plus haut niveau

La technique ci-dessus place tous les scénarios de test dans un unique et grand groupe. Sauf que pour des projets plus conséquents, ce n'est probablement pas assez souple ; vous voudriez peut-être grouper les tests tout à fait différemment.

Pour obtenir un groupe de test plus souple nous pouvons sous classer GroupTest et ensuite l'instancier au cas par cas...

<?php
    require_once('simpletest/unit_tester.php');
    require_once('simpletest/reporter.php');
    
    class FileGroupTest extends GroupTest {
        function FileGroupTest() {
            $this->GroupTest('All file tests');
            $this->addTestFile('file_test.php');
        }
    }
?>
Ceci nomme le test dans le constructeur et ensuite ajoute à la fois nos scénarios de test et un unique groupe en dessous. Bien sûr nous pouvons ajouter plus d'un groupe à cet instant. Nous pouvons maintenant invoquer les tests à partir d'un autre fichier d'exécution...
<?php
    require_once('file_group_test.php');
    
    $test = &new FileGroupTest();
    $test->run(new HtmlReporter());
?>
...ou alors nous pouvons les grouper dans un groupe de tests encore plus grand...
<?php
    require_once('file_group_test.php');
    
    $test = &new BigGroupTest('Big group');
    $test->addTestCase(new FileGroupTest());
    $test->addTestCase(...);
    $test->run(new HtmlReporter());
?>
Si nous souhaitons lancer le groupe de test original sans utiliser ses petits fichiers d'exécution, nous pouvons mettre le code du lanceur de test derrière des barreaux quand nous créons chaque groupe.
<?php
    class FileGroupTest extends GroupTest {
        function FileGroupTest() {
            $this->GroupTest('All file tests');
            $test->addTestFile('file_test.php');
        }
    }
    
    if (! defined('RUNNER')) {
        define('RUNNER', true);
        $test = &new FileGroupTest();
        $test->run(new HtmlReporter());
    }
?>
Cette approche exige aux barrières d'être activées à l'inclusion du fichier de groupe de test, mais c'est quand même moins de tracas que beaucoup de fichiers de lancement éparpillés. Reste à inclure des barreaux identiques au niveau supérieur afin de s'assurer que le run() ne sera lancé qu'une seule fois à partir du script de haut niveau qui l'a invoqué.
<?php
    define('RUNNER', true);

    require_once('file_group_test.php');
    $test = &new BigGroupTest('Big group');
    $test->addTestCase(new FileGroupTest());
    $test->addTestCase(...);
    $test->run(new HtmlReporter());
?>
Comme les scénarios de test normaux, un GroupTest peut être chargé avec la méthode GroupTest::addTestFile().
	
<?php	
    define('RUNNER', true);	
 	 	
    $test = &new BigGroupTest('Big group');	
    $test->addTestFile('file_group_test.php');	
    $test->addTestFile(...);	
    $test->run(new HtmlReporter());	
?>	

Intégrer des scénarios de test hérités

Si vous avez déjà des tests unitaires pour votre code ou alors si vous étendez des classes externes qui ont déjà leurs propres tests, il y a peu de chances pour que ceux-ci soient déjà au format SimpleTest. Heureusement il est possible d'incorporer ces scénarios de test en provenance d'autres testeurs unitaires directement dans des groupes de test SimpleTest.

Par exemple, supposons que nous ayons ce scénario de test prévu pour PhpUnitdans le fichier config_test.php...

class ConfigFileTest extends TestCase {
    function ConfigFileTest() {
        $this->TestCase('Config file test');
    }
    
    function testContents() {
        $config = new ConfigFile('test.conf');
        $this->assertRegexp('/me/', $config->getValue('username'));
    }
}
Le groupe de test peut le reconnaître à partir du moment où nous mettons l'adaptateur approprié avant d'ajouter le fichier de test...
<?php
    require_once('simpletest/unit_tester.php');
    require_once('simpletest/reporter.php');
    require_once('simpletest/adapters/phpunit_test_case.php');

    $test = &new GroupTest('All file tests');
    $test->addTestFile('config_test.php');
    $test->run(new HtmlReporter());
?>
Il n'y a que deux adaptateurs, l'autre est pour le paquet testeur unitaire de PEAR...
<?php
    require_once('simpletest/unit_tester.php');
    require_once('simpletest/reporter.php');
    require_once('simpletest/adapters/pear_test_case.php');

    $test = &new GroupTest('All file tests');
    $test->addTestFile('some_pear_test_cases.php');
    $test->run(new HtmlReporter());
?>
Les scénarios de test de PEAR peuvent être librement mélangés avec ceux de SimpleTest mais vous ne pouvez pas utiliser les assertions de SimpleTest au sein des versions héritées des scénarios de test. La raison ? Une simple vérification que vous ne rendez pas par accident vos scénarios de test complètement dépendants de SimpleTest. Peut-être que vous souhaitez publier votre bibliothèque sur PEAR par exemple : ça voudrait dire la livrer avec des scénarios de test compatibles avec PEAR::PhpUnit.

pgfouine-1.2/tests/simpletest/docs/fr/browser_documentation.html0000644000175000017500000004132510334504440023762 0ustar acmeacme Documentation SimpleTest : le composant de navigation web scriptable

Documentation sur le navigateur scriptable

Le composant de navigation web de SimpleTest peut être utilisé non seulement à l'extérieur de la classe WebTestCase, mais aussi indépendamment du frameword SimpleTest lui-même.

Le navigateur scriptable

Vous pouvez utiliser le navigateur web dans des scripts PHP pour confirmer que des services marchent bien comme il faut ou pour extraire des informations à partir de ceux-ci de façon régulière. Par exemple, voici un petit script pour extraire le nombre de bogues ouverts dans PHP 5 à partir du site web PHP...

<?php
    require_once('simpletest/browser.php');
    
    $browser = &new SimpleBrowser();
    $browser->get('http://php.net/');
    $browser->clickLink('reporting bugs');
    $browser->clickLink('statistics');
    $browser->clickLink('PHP 5 bugs only');
    $page = $browser->getContent();
    preg_match('/status=Open.*?by=Any.*?(\d+)<\/a>/', $page, $matches);
    print $matches[1];
?>
Bien sûr Il y a des méthodes plus simple pour réaliser cet exemple en PHP. Par exemple, vous pourriez juste utiliser la commande PHP file() sur ce qui est ici une page fixe. Cependant, en utilisant des scripts avec le navigateur web vous vous autorisez l'authentification, la gestion des cookies, le chargement automatique des fenêtres, les redirections, la transmission de formulaire et la capacité d'examiner les entêtes. De telles méthodes sont fragiles dans un site en constante évolution et vous voudrez employer une méthode plus directe pour accéder aux données de façon permanente, mais pour des tâches simples cette technique peut s'avérer une solution très rapide.

Toutes les méthode de navigation utilisées dans WebTestCase sont présente dans la classe SimpleBrowser, mais les assertions sont remplacées par de simples accesseurs. Voici une liste complète des méthodes de navigation de page à page...
addHeader($header)Ajouter une entête à chaque téléchargement
useProxy($proxy, $username, $password)Utilise ce proxy à partir de maintenant
head($url, $parameters)Effectue une requête HEAD
get($url, $parameters)Télécharge une page avec un GET
post($url, $parameters)Télécharge une page avec un POST
clickLink($label)Suit un lien par son étiquette
isLink($label)Vérifie si un lien avec cette étiquette existe
clickLinkById($id)Suit un lien par son attribut d'identification
isLinkById($id)Vérifie si un lien avec cet attribut d'identification existe
getUrl()La page ou la fenêtre URL en cours
getTitle()Le titre de la page
getContent()Le page ou la fenêtre brute
getContentAsText()Sans code HTML à l'exception du text "alt"
retry()Répète la dernière requête
back()Utilise le bouton "précédent" du navigateur
forward()Utilise le bouton "suivant" du navigateur
authenticate($username, $password)Retente la page ou la fenêtre après une réponse 401
restart($date)Relance le navigateur pour une nouvelle session
ageCookies($interval)Change la date des cookies
setCookie($name, $value)Lance un nouveau cookie
getCookieValue($host, $path, $name)Lit le cookie le plus spécifique
getCurrentCookieValue($name)Lit le contenue du cookie en cours
Les méthode SimpleBrowser::useProxy() et SimpleBrowser::addHeader() sont spéciales. Une fois appellées, elles continuent à s'appliquer sur les téléchargements suivants.

Naviguer dans les formulaires est similaire à la navigation des formulaires via WebTestCase...
setField($name, $value)Modifie tous les champs avec ce nom
setFieldById($id, $value)Modifie tous les champs avec cet identifiant
getField($name)Accesseur de la valeur d'un élément de formulaire
getFieldById($id)Accesseur de la valeur de l'élément de formulaire avec cet identifiant
clickSubmit($label)Transmet le formulaire avec l'étiquette de son bouton
clickSubmitByName($name)Transmet le formulaire avec l'attribut de son bouton
clickSubmitById($id)Transmet le formulaire avec l'identifiant de son bouton
clickImage($label, $x, $y)Clique sur l'image par son texte alternatif
clickImageByName($name, $x, $y)Clique sur l'image par son attribut
clickImageById($id, $x, $y)Clique sur l'image par son identifiant
submitFormById($id)Transmet le formulaire par son identifiant propre
A aujourd'hui il n'existe aucune méthode pour lister les formulaires et les champs disponibles : ce sera probablement ajouté dans des versions successives de SimpleTest.

A l'intérieur d'une page, les fenêtres individuelles peuvent être sélectionnées. Si aucune sélection n'est réalisée alors toutes les fenêtres sont fusionnées ensemble dans un unique et grande page. Le contenu de la page en cours sera une concaténation des toutes les fenêtres dans l'ordre spécifié par les balises "frameset".
getFrames()Un déchargement de la structure de la fenêtre courante
getFrameFocus()L'index ou l'étiquette de la fenêtre en courante
setFrameFocusByIndex($choice)Sélectionne la fenêtre numérotée à partir de 1
setFrameFocus($name)Sélectionne une fenêtre par son étiquette
clearFrameFocus()Traite toutes les fenêtres comme une seule page
Lorsqu'on est focalisé sur une fenêtre unique, le contenu viendra de celle-ci uniquement. Cela comprend les liens à cliquer et les formulaires à transmettre.

Où sont les erreurs ?

Toute cette masse de fonctionnalités est géniale lorsqu'on arrive à bien télécharger les pages, mais ce n'est pas toujours évident. Pour aider à découvrir les erreurs, le navigateur a aussi des méthodes pour aider au débogage.
setConnectionTimeout($timeout)Ferme la socket avec un délai trop long
getRequest()L'entête de la requête brute de la page ou de la fenêtre
getHeaders()L'entête de réponse de la page ou de la fenêtre
getTransportError()N'importe quel erreur au niveau de la socket dans le dernier téléchargement
getResponseCode()La réponse HTTP de la page ou de la fenêtre
getMimeType()Le type Mime de la page our de la fenêtre
getAuthentication()Le type d'authenficiation dans l'entête d'une provocation 401
getRealm()Le realm d'authentification dans l'entête d'une provocation 401
setMaximumRedirects($max)Nombre de redirection avant que la page ne soit chargée automatiquement
setMaximumNestedFrames($max)Protection contre des framesets récursifs
ignoreFrames()Neutralise le support des fenêtres
useFrames()Autorise le support des fenêtres
Les méthodes SimpleBrowser::setConnectionTimeout(), SimpleBrowser::setMaximumRedirects(),SimpleBrowser::setMaximumNestedFrames(), SimpleBrowser::ignoreFrames() et SimpleBrowser::useFrames() continuent à s'appliquer sur toutes les requêtes suivantes. Les autres méthodes tiennent compte des fenêtres. Cela veut dire que si une fenêtre individuel ne se charge pas, il suffit de se diriger vers elle avec SimpleBrowser::setFrameFocus() : ensuite on utilisera SimpleBrowser::getRequest(), etc. pour voir ce qui se passe.

Tests unitaires complexes avec des navigateurs multiples

Tout ce qui peut être fait dans WebTestCase peut maintenant être fait dans un UnitTestCase. Ce qui revient à dire que nous pouvons librement mélanger des tests sur des objets de domaine avec l'interface web...

class TestOfRegistration extends UnitTestCase {
    function testNewUserAddedToAuthenticator() {
        $browser = &new SimpleBrowser();
        $browser->get('http://my-site.com/register.php');
        $browser->setField('email', 'me@here');
        $browser->setField('password', 'Secret');
        $browser->clickSubmit('Register');
        
        $authenticator = &new Authenticator();
        $member = &$authenticator->findByEmail('me@here');
        $this->assertEqual($member->getPassword(), 'Secret');
    }
}
Bien que ça puisse être utile par convenance temporaire, je ne suis pas fan de ce genre de test. Ce test s'applique à sur plusieurs couches de l'application, ça implique qu'il est plus que probable qu'il faudra le remanier lorsque le code change.

Un cas plus utile d'utilisation directe du navigateur est le moment où le WebTestCase ne peut plus suivre. Un exemple ? Quand deux navigateurs doivent être utilisés en même temps.

Par exemple, supposons que nous voulions interdire des usages simultanés d'un site avec le même login d'identification. Ce scénario de test le vérifie...

class TestOfSecurity extends UnitTestCase {
    function testNoMultipleLoginsFromSameUser() {
        $first = &new SimpleBrowser();
        $first->get('http://my-site.com/login.php');
        $first->setField('name', 'Me');
        $first->setField('password', 'Secret');
        $first->clickSubmit('Enter');
        $this->assertEqual($first->getTitle(), 'Welcome');
        
        $second = &new SimpleBrowser();
        $second->get('http://my-site.com/login.php');
        $second->setField('name', 'Me');
        $second->setField('password', 'Secret');
        $second->clickSubmit('Enter');
        $this->assertEqual($second->getTitle(), 'Access Denied');
    }
}
Vous pouvez aussi utiliser la classe SimpleBrowser quand vous souhaitez écrire des scénarios de test en utilisant un autre outil que SimpleTest.

pgfouine-1.2/tests/simpletest/docs/fr/mock_objects_documentation.html0000644000175000017500000007511510334504440024745 0ustar acmeacme Documentation SimpleTest : les objets fantaise

Documentation sur les objets fantaisie

Que sont les objets fantaisie ?

Les objets fantaisie - ou "mock objects" en anglais - ont deux rôles pendant un scénario de test : acteur et critique.

Le comportement d'acteur est celui de simuler des objets difficiles à initialiser ou trop consommateurs en temps pendant un test. Le cas classique est celui de la connexion à une base de données. Mettre sur pied une base de données de test au lancement de chaque test ralentirait considérablement les tests et en plus exigerait l'installation d'un moteur de base de données ainsi que des données sur la machine de test. Si nous pouvons simuler la connexion et renvoyer des données à notre guise alors non seulement nous gagnons en pragmatisme sur les tests mais en sus nous pouvons nourrir notre base avec des données falsifiées et voir comment il répond. Nous pouvons simuler une base de données en suspens ou d'autres cas extrêmes sans avoir à créer une véritable panne de base de données. En d'autres termes nous pouvons gagner en contrôle sur l'environnement de test.

Si les objets fantaisie ne se comportaient que comme des acteurs alors on les connaîtrait sous le nom de bouchons serveur.

Cependant non seulement les objets fantaisie jouent un rôle (en fournissant à la demande les valeurs requises) mais en plus ils sont aussi sensibles aux messages qui leur sont envoyés (par le biais d'attentes). En posant les paramètres attendus d'une méthode ils agissent comme des gardiens : un appel sur eux doit être réalisé correctement. Si les attentes ne sont pas atteintes ils nous épargnent l'effort de l'écriture d'une assertion de test avec échec en réalisant cette tâche à notre place. Dans le cas d'une connexion à une base de données imaginaire ils peuvent tester si la requête, disons SQL, a bien été formé par l'objet qui utilise cette connexion. Mettez-les sur pied avec des attentes assez précises et vous verrez que vous n'aurez presque plus d'assertion à écrire manuellement.

Créer des objets fantaisie

Comme pour la création des bouchons serveur, tout ce dont nous avons besoin c'est d'un classe existante. La fameuse connexion à une base de données qui ressemblerait à...

class DatabaseConnection {
    function DatabaseConnection() {
    }
    
    function query() {
    }
    
    function selectQuery() {
    }
}
Cette classe n'a pas encore besoin d'être implémentée. Pour en créer sa version fantaisie nous devons juste inclure la librairie d'objet fantaisie puis lancer le générateur...
require_once('simpletest/unit_tester.php');
require_once('simpletest/mock_objects.php');
require_once('database_connection.php');

Mock::generate('DatabaseConnection');
Ceci génère une classe clone appelée MockDatabaseConnection. Nous pouvons désormais créer des instances de cette nouvelle classe à l'intérieur même de notre scénario de test...
require_once('simpletest/unit_tester.php');
require_once('simpletest/mock_objects.php');
require_once('database_connection.php');

Mock::generate('DatabaseConnection');

class MyTestCase extends UnitTestCase {
    
    function testSomething() {
        $connection = &new MockDatabaseConnection($this);
    }
}
Contrairement aux bouchons, le constructeur d'une classe fantaisie a besoin d'une référence au scénario de test pour pouvoir transmettre les succès et les échecs pendant qu'il vérifie les attentes. Concrètement ça veut dire que les objets fantaisie ne peuvent être utilisés qu'au sein d'un scénario de test. Malgré tout, cette puissance supplémentaire implique que les bouchons ne sont que rarement utilisés si des objets fantaisie sont disponibles.

Objets fantaisie en action

La version fantaisie d'une classe contient toutes les méthodes de l'originale. De la sorte une opération comme $connection->query() est encore possible. Tout comme avec les bouchons, nous pouvons remplacer la valeur nulle renvoyée par défaut...

$connection->setReturnValue('query', 37);
Désormais à chaque appel de $connection->query() nous recevons comme résultat 37. Tout comme avec les bouchons nous pouvons utiliser des jokers et surcharger le paramètre joker. Nous pouvons aussi ajouter des méthodes supplémentaires à l'objet fantaisie lors de sa génération et lui choisir un nom de classe qui lui soit propre...
Mock::generate('DatabaseConnection', 'MyMockDatabaseConnection', array('setOptions'));
Ici l'objet fantaisie se comportera comme si setOptions() existait dans la classe originale. C'est pratique si une classe a utilisé le mécanisme overload() de PHP pour ajouter des méthodes dynamiques. Vous pouvez créer des fantaisies spéciales pour simuler cette situation.

Tous les modèles disponibles avec les bouchons serveur le sont également avec les objets fantaisie...

class Iterator {
    function Iterator() {
    }
    
    function next() {
    }
}
Une nouvelle fois, supposons que cet itérateur ne retourne que du texte jusqu'au moment où il atteint son terme, quand il renvoie false. Nous pouvons le simuler avec...
Mock::generate('Iterator');

class IteratorTest extends UnitTestCase() {
    
    function testASequence() {
        $iterator = &new MockIterator($this);
        $iterator->setReturnValue('next', false);
        $iterator->setReturnValueAt(0, 'next', 'First string');
        $iterator->setReturnValueAt(1, 'next', 'Second string');
        ...
    }
}
Au moment du premier appel à next() sur l'itérateur fantaisie il renverra tout d'abord "First string", puis ce sera au tour de "Second string" au deuxième appel et ensuite pour tout appel suivant false sera renvoyé. Ces valeurs renvoyées successivement sont prioritaires sur la valeur constante retournée. Cette dernière est un genre de valeur par défaut si vous voulez.

Reprenons aussi le conteneur d'information bouchonné avec des pairs clef / valeur...

class Configuration {
    function Configuration() {
    }
    
    function getValue($key) {
    }
}
Il s'agit là d'une situation classique d'utilisation d'objets fantaisie étant donné que la configuration peut varier grandement de machine à machine : ça contraint fortement la fiabilité de nos tests si nous l'utilisons directement. Le problème est que toutes les données nous parviennent à travers la méthode getValue() et que nous voulons des résultats différents pour des clefs différentes. Heureusement les objets fantaisie ont un système de filtrage...
$config = &new MockConfiguration($this);
$config->setReturnValue('getValue', 'primary', array('db_host'));
$config->setReturnValue('getValue', 'admin', array('db_user'));
$config->setReturnValue('getValue', 'secret', array('db_password'));
Le paramètre en plus est une liste d'arguments à faire correspondre. Dans ce cas nous essayons de faire correspondre un unique argument : en l'occurrence la clef recherchée. Maintenant que la méthode getValue() est invoquée sur l'objet fantaisie...
$config->getValue('db_user')
...elle renverra "admin". Elle le trouve en essayant de faire correspondre les arguments entrants dans sa liste d'arguments sortants les uns après les autres jusqu'au moment où une correspondance exacte est atteinte.

Il y a des fois où vous souhaitez qu'un objet spécifique soit servi par la fantaisie plutôt qu'une copie. De nouveau c'est identique au mécanisme des bouchons serveur...

class Thing {
}

class Vector {
    function Vector() {
    }
    
    function get($index) {
    }
}
Dans ce cas vous pouvez placer une référence dans la liste renvoyée par l'objet fantaisie...
$thing = new Thing();
$vector = &new MockVector($this);
$vector->setReturnReference('get', $thing, array(12));
Avec cet arrangement vous savez qu'à chaque appel de $vector->get(12) le même $thing sera renvoyé.

Objets fantaisie en critique

Même si les bouchons serveur vous isolent du désordre du monde réel, il ne s'agit là que de la moitié du bénéfice potentiel. Vous pouvez avoir une classe de test recevant les messages ad hoc, mais est-ce que votre nouvelle classe renvoie bien les bons ? Le tester peut devenir cafouillis sans une librairie d'objets fantaisie.

Pour l'exemple, prenons une classe SessionPool à laquelle nous allons ajouter une fonction de log. Plutôt que de complexifier la classe originale, nous souhaitons ajouter ce comportement avec un décorateur (GOF). Pour l'instant le code de SessionPool ressemble à...

class SessionPool {
    function SessionPool() {
        ...
    }
    
    function &findSession($cookie) {
        ...
    }
    ...
}

class Session {
    ...
}

Alors que pour notre code de log, nous avons...

class Log {
    function Log() {
        ...
    }
    
    function message() {
        ...
    }
}

class LoggingSessionPool {
    function LoggingSessionPool(&$session_pool, &$log) {
        ...
    }
    
    function &findSession(\$cookie) {
        ...
    }
    ...
}
Dans tout ceci, la seule classe à tester est LoggingSessionPool. En particulier, nous voulons vérifier que la méthode findSession() est appelée avec le bon identifiant de session au sein du cookie et qu'elle renvoie bien le message "Starting session $cookie" au loggueur.

Bien que nous ne testions que quelques lignes de code de production, voici la liste des choses à faire dans un scénario de test conventionnel :

  1. Créer un objet de log.
  2. Indiquer le répertoire d'écriture du fichier de log.
  3. Modifier les droits sur le répertoire pour pouvoir y écrire le fichier.
  4. Créer un objet SessionPool.
  5. Lancer une session, ce qui demande probablement pas mal de choses.
  6. Invoquer findSession().
  7. Lire le nouvel identifiant de sessions (en espérant qu'il existe un accesseur !).
  8. Lever une assertion de test pour vérifier que cet identifiant correspond bien au cookie.
  9. Lire la dernière ligne du fichier de log.
  10. Supprimer avec une (ou plusieurs) expression rationnelle les timestamps de log en trop, etc.
  11. Vérifier que le message de session est bien dans le texte.
Pas étonnant que les développeurs détestent écrire des tests quand ils sont aussi ingrats. Pour rendre les choses encore pire, à chaque fois que le format de log change ou bien que la méthode de création des sessions change, nous devons réécrire une partie des tests alors même qu'ils ne testent pas ces parties du système. Nous sommes en train de préparer le cauchemar pour les développeurs de ces autres classes.

A la place, voici la méthode complète pour le test avec un peu de magie via les objets fantaisie...

Mock::generate('Session');
Mock::generate('SessionPool');
Mock::generate('Log');

class LoggingSessionPoolTest extends UnitTestCase {
    ...
    function testFindSessionLogging() {
        $session = &new MockSession($this);
        $pool = &new MockSessionPool($this);
        $pool->setReturnReference('findSession', $session);
        $pool->expectOnce('findSession', array('abc'));
        
        $log = &new MockLog($this);
        $log->expectOnce('message', array('Starting session abc'));
        
        $logging_pool = &new LoggingSessionPool($pool, $log);
        $this->assertReference($logging_pool->findSession('abc'), $session);
        $pool->tally();
        $log->tally();
    }
}
Commençons par écrire une session simulacre. Pas la peine d'être trop pointilleux avec celle-ci puisque la vérification de la session désirée est effectuée ailleurs. Nous avons juste besoin de vérifier qu'il s'agit de la même que celle qui vient du groupe commun des sessions.

findSession() est un méthode fabrique dont la simulation est décrite plus haut. Le point de départ vient avec le premier appel expectOnce(). Cette ligne indique qu'à chaque fois que findSession() est invoqué sur l'objet fantaisie, il vérifiera les arguments entrant. S'il ne reçoit que la chaîne "abc" en tant qu'argument alors un succès est envoyé au testeur unitaire, sinon c'est un échec qui est généré. Il s'agit là de la partie qui teste si nous avons bien la bonne session. La liste des arguments suit une format identique à celui qui précise les valeurs renvoyées. Vous pouvez avoir des jokers et des séquences et l'ordre de l'évaluation restera le même.

Si l'appel n'est jamais effectué alors n'est généré ni le succès, ni l'échec. Pour contourner cette limitation, nous devons dire à l'objet fantaisie que le test est terminé : il pourra alors décider si les attentes ont été répondues. L'assertion du testeur unitaire de ceci est déclenchée par l'appel tally() à la fin du test.

Nous utilisons le même modèle pour mettre sur pied le loggueur fantaisie. Nous lui indiquons que message() devrait être invoqué une fois et une fois seulement avec l'argument "Starting session abc". En testant les arguments d'appel, plutôt que ceux de sorite du loggueur, nous isolons le test de tout modification dans le loggueur.

Nous commençons le lancement nos tests à la création du nouveau LoggingSessionPool et nous l'alimentons avec nos objets fantaisie juste créés. Désormais tout est sous contrôle. Au final nous confirmons que le $session donné au décorateur est bien celui reçu et prions les objets fantaisie de lancer leurs tests de comptage d'appel interne avec les appels tally().

Il y a encore pas mal de code de test, mais ce code est très strict. S'il vous semble encore terrifiant il l'est bien moins que si nous avions essayé sans les objets fantaisie et ce test en particulier, interactions plutôt que résultat, est toujours plus difficile à mettre en place. Le plus souvent vous aurez besoin de tester des situations plus complexes sans ce niveau ni cette précision. En outre une partie peut être remaniée avec la méthode de scénario de test setUp().

Voici la liste complète des attentes que vous pouvez placer sur un objet fantaisie avec SimpleTest...
AttenteNécessite tally()
expectArguments($method, $args) Non
expectArgumentsAt($timing, $method, $args) Non
expectCallCount($method, $count) Oui
expectMaximumCallCount($method, $count) Non
expectMinimumCallCount($method, $count) Oui
expectNever($method) Non
expectOnce($method, $args) Oui
expectAtLeastOnce($method, $args) Oui
Où les paramètres sont...

$method
Le nom de la méthode, sous la forme d'une chaîne, à laquelle la condition doit être appliquée.
$args
Les arguments sous la forme d'une liste. Les jokers peuvent être inclus de la même manière qu'avec setReturn(). Cet argument est optionel pour expectOnce() et expectAtLeastOnce().
$timing
Le seul point dans le temps pour tester la condition. Le premier appel commence à zéro.
$count
Le nombre d'appels attendu.
La méthode expectMaximumCallCount() est légèrement différente dans le sens où elle ne pourra générer qu'un échec. Elle reste silencieuse si la limite n'est jamais atteinte.

Comme avec les assertions dans les scénarios de test, toutes ces attentes peuvent accepter une surcharge de message sous la forme d'un paramètre supplémentaire. Par ailleurs le message d'échec original peut être inclus dans le résultat avec "%s".

D'autres approches

Il existe trois approches pour créer des objets fantaisie en comprenant celle utiliser par SimpleTest. Les coder à la main en utilisant une classe de base, les générer dans un fichier ou les générer dynamiquement à la volée.

Les objets fantaisie générés avec SimpleTest sont dynamiques. Ils sont créés à l'exécution dans la mémoire, grâce à eval(), plutôt qu'écrit dans un fichier. Cette opération les rend facile à créer, en une seule ligne, surtout par rapport à leur création à la main dans une hiérarchie de classe parallèle. Le problème avec ce comportement tient généralement dans la mise en place des tests proprement dits. Si les objets originaux changent les versions fantaisie sur lesquels reposent les tests, une désynchronisation peut subvenir. Cela peut aussi arriver avec l'approche en hiérarchie parallèle, mais c'est détecté beaucoup plus vite.

Bien sûr, la solution est d'ajouter de véritables tests d'intégration. Vous n'en avez pas besoin de beaucoup et le côté pratique des objets fantaisie fait plus que compenser la petite dose de test supplémentaire. Vous ne pouvez pas avoir confiance dans du code qui ne serait testé que par des objets fantaisie.

Si vous restez déterminé de construire des librairies statiques d'objets fantaisie parce que vous souhaitez émuler un comportement très spécifique, vous pouvez y parvenir grâce au générateur de classe de SimpleTest. Dans votre fichier librairie, par exemple mocks/connection.php pour une connexion à une base de données, créer un objet fantaisie et provoquer m'héritage pour hériter pour surcharger des méthodes spéciales ou ajouter des préréglages...

<?php
    require_once('simpletest/mock_objects.php');
    require_once('../classes/connection.php');

    Mock::generate('Connection', 'BasicMockConnection');
    class MockConnection extends BasicMockConnection {
        function MockConnection(&$test, $wildcard = '*') {
            $this->BasicMockConnection($test, $wildcard);
            $this->setReturn('query', false);
        }
    }
?>
L'appel generate dit au générateur de classe d'en créer une appelée BasicMockConnection plutôt que la plus courante MockConnection. Ensuite nous héritons à partir de celle-ci pour obtenir notre version de MockConnection. En interceptant de cette manière nous pouvons ajouter un comportement, ici transformer la valeur par défaut de query() en "false". En utilisant le nom par défaut nous garantissons que le générateur de classe fantaisie n'en recréera pas une autre différente si il est invoqué ailleurs dans les tests. Il ne créera jamais de classe si elle existe déjà. Aussi longtemps que le fichier ci-dessus est inclus avant alors tous les tests qui généraient MockConnection devraient utiliser notre version à présent. Par contre si nous avons une erreur dans l'ordre et que la librairie de fantaisie en crée une d'abord alors la création de la classe échouera tout simplement.

Utiliser cette astuce si vous vous trouvez avec beaucoup de comportement en commun sur les objets fantaisie ou si vous avez de fréquents problèmes d'intégration plus tard dans les étapes de test.

Je pense que SimpleTest pue !

Mais au moment d'écrire ces lignes c'est le seul à gérer les objets fantaisie, donc vous êtes bloqué avec lui ?

Non, pas du tout. SimpleTest est une boîte à outils et parmi ceux-ci on trouve les objets fantaisie qui peuvent être utilisés indépendamment. Supposons que vous avez votre propre testeur unitaire favori et que tous vos tests actuels l'utilisent. Prétendez que vous avez appelé votre tester unitaire PHPUnit (c'est ce que tout le monde a fait) et que la classe principale de test ressemble à...

class PHPUnit {
    function PHPUnit() {
    }
    
    function assertion($message, $assertion) {
    }
    ...
}
La seule chose que la méthode assertion() réalise, c'est de préparer une sortie embellie alors le paramètre boolien de l'assertion sert à déterminer s'il s'agit d'une erreur ou d'un succès. Supposons qu'elle est utilisée de la manière suivante...
$unit_test = new PHPUnit();
$unit_test>assertion('I hope this file exists', file_exists('my_file'));
Comment utiliser les objets fantaisie avec ceci ?

Il y a une méthode protégée sur la classe de base des objets fantaisie : elle s'appelle _assertTrue(). En surchargeant cette méthode nous pouvons utiliser notre propre format d'assertion. Nous commençons avec une sous-classe, dans my_mock.php...

<?php
    require_once('simpletest/mock_objects.php');
    
    class MyMock extends SimpleMock() {
        function MyMock(&$test, $wildcard) {
            $this->SimpleMock($test, $wildcard);
        }
        
        function _assertTrue($assertion, $message) {
            $test = &$this->getTest();
            $test->assertion($message, $assertion);
        }
    }
?>
Maintenant une instance de MyMock créera un objet qui parle le même langage que votre testeur. Bien sûr le truc c'est que nous créons jamais un tel objet : le générateur s'en chargera. Nous avons juste besoin d'une ligne de code supplémentaire pour dire au générateur d'utiliser vos nouveaux objets fantaisie...
<?php
    require_once('simpletst/mock_objects.php');
    
    class MyMock extends SimpleMock() {
        function MyMock($test, $wildcard) {
            $this->SimpleMock(&$test, $wildcard);
        }
        
        function _assertTrue($assertion, $message , &$test) {
            $test->assertion($message, $assertion);
        }
    }
    SimpleTestOptions::setMockBaseClass('MyMock');
?>
A partir de maintenant vous avez juste à inclure my_mock.php à la place de la version par défaut simple_mock.php et vous pouvez introduire des objets fantaisie dans votre suite de tests existants.

pgfouine-1.2/tests/simpletest/docs/fr/overview.html0000644000175000017500000004701310334504440021214 0ustar acmeacme Aperçu et liste des fonctionnalités des testeurs unitaires PHP et web de SimpleTest PHP

Apercu de SimpleTest

Qu'est-ce que SimpleTest ?

Le coeur de SimpleTest est un framework de test construit autour de classes de scénarios de test. Celles-ci sont écrites comme des extensions des classes premières de scénarios de test, chacune élargie avec des méthodes qui contiennent le code de test effectif. Les scripts de test de haut niveau invoque la méthode run() à chaque scénario de test successivement. Chaque méthode de test est écrite pour appeler des assertions diverses que le développeur suppose être vraies, assertEqual() par exemple. Si l'assertion est correcte, alors un succès est expédié au rapporteur observant le test, mais toute erreur déclenche une alerte et une description de la dissension.

Un scénario de test ressemble à...

class MyTestCase extends UnitTestCase {
    
    function testLog() {
        $log = &new Log('my.log');
        $log->message('Hello');
        $this->assertTrue(file_exists('my.log'));
    }
}

Ces outils sont conçus pour le développeur. Les tests sont écrits en PHP directement, plus ou moins simultanément avec la construction de l'application elle-même. L'avantage d'utiliser PHP lui-même comme langage de test est qu'il n'y a pas de nouveau langage à apprendre, les tests peuvent commencer directement et le développeur peut tester n'importe quelle partie du code. Plus simplement, toutes les parties qui peuvent être accédées par le code de l'application peuvent aussi être accédées par le code de test si ils sont tous les deux dans le même langage.

Le type de scénario de test le plus simple est le UnitTestCase. Cette classe de scénario de test inclut les tests standards pour l'égalité, les références et l'appariement de motifs (via les expressions rationnelles). Ceux-ci testent ce que vous seriez en droit d'attendre du résultat d'une fonction ou d'une méthode. Il s'agit du type de test le plus commun pendant le quotidien du développeur, peut-être 95% des scénarios de test.

La tâche ultime d'une application web n'est cependant pas de produire une sortie correcte à partir de méthodes ou d'objets, mais plutôt de produire des pages web. La classe WebTestCase teste des pages web. Elle simule un navigateur web demandant une page, de façon exhaustive : cookies, proxies, connexions sécurisées, authentification, formulaires, cadres et la plupart des éléments de navigation. Avec ce type de scénario de test, le développeur peut garantir que telle ou telle information est présente dans la page et que les formulaires ainsi que les sessions sont gérés comme il faut.

Un scénario de test web ressemble à...

class MySiteTest extends WebTestCase {
    
    function testHomePage() {
        $this->get('http://www.my-site.com/index.php');
        $this->assertTitle('My Home Page');
        $this->clickLink('Contact');
        $this->assertTitle('Contact me');
        $this->assertWantedPattern('/Email me at/');
    }
}

Liste des fonctionnalites

Ci-dessous vous trouverez un canevas assez brut des fonctionnalités à aujourd'hui et pour demain, sans oublier leur date approximative de publication. J'ai bien peur qu'il soit modifiable sans pré-avis étant donné que les jalons dépendent beaucoup sur le temps disponible. Les trucs en vert ont été codés, mais pas forcément déjà rendus public. Si vous avez une besoin pressant pour une fonctionnalité verte mais pas encore publique alors vous devriez retirer le code directement sur le CVS chez SourceFourge. Une fonctionnalitée publiée est indiqué par "Fini".
FonctionnalitéDescriptionPublication
Scénariot de test unitaire Les classes de test et assertions de base Fini
Affichage HTML L'affichage le plus simple possible Fini
Autochargement des scénarios de test Lire un fichier avec des scénarios de test et les charger dans un groupe de test automatiquement Fini
Générateur de code d'objets fantaisie Des objets capable de simuler d'autres objets, supprimant les dépendances dans les tests Fini
Bouchons serveur Des objets fantaisie sans résultat attendu à utiliser à l'extérieur des scénarios de test, pour le prototypage par exemple. Fini
Intégration d'autres testeurs unitaires La capacité de lire et simuler d'autres scénarios de test en provenance de PHPUnit et de PEAR::Phpunit. Fini
Scénario de test web Appariement basique de motifs dans une page téléchargée. Fini
Analyse de page HTML Permet de suivre les liens et de trouver la balise de titre Fini
Simulacre partiel Simuler des parties d'une classe pour tester moins qu'une classe ou dans des cas complexes. Fini
Gestion des cookies Web Gestion correcte des cookies au téléchargement d'une page. Fini
Suivi des redirections Le téléchargement d'une page suit automatiquement une redirection 300. Fini
Analyse d'un formulaire La capacité de valider un formulaire simple et d'en lire les valeurs par défaut. Fini
Interface en ligne de commande Affiche le résultat des tests sans navigateur web. Fini
Mise à nu des attentes d'une classe Peut créer des tests précis avec des simulacres ainsi que des scénarios de test. Fini
Sortie et analyse XML Permet de tester sur plusieurs hôtes et d'intégrer des extensions d'acceptation de test. Fini
Scénario de test en ligne de commande Permet de tester des outils ou scripts en ligne de commande et de manier des fichiers. Fini
Compatibilité avec PHP Documentor Génération automatique et complète de la documentation au niveau des classes. Fini
Interface navigateur Mise à nu des niveaux bas de l'interface du navigateur web pour des scénarios de test plus précis. Fini
Authentification HTTP Téléchargement des pages web protégées avec une authentification basique seulement. Fini
Boutons de navigation d'un navigateur Arrière, avant et recommencer Fini
Support de SSL Peut se connecter à des pages de type https. Fini
Support de proxy Peut se connecter via des proxys communs Fini
Support des cadres Gère les cadres dans les scénarios de test web. Fini
Amélioration de l'affichage des tests Une meilleure interface graphique web, avec un arbre des scénarios de test. 1.1
Localisation Abstraction des messages et génration du code à partir de fichiers XML. 1.1
Simulation d'interface Peut générer des objets fantaisie tant vers des interfaces que vers des classes. 2.0
Test sur es exceptions Dans le même esprit que sur les tests des erreurs PHP. 2.0
Rercherche d'éléments avec XPath Peut utiliser Tidy HTML pour un appariement plus rapide et plus souple. 2.0
Test de l'upload de fichier Peut simuler la balise input de type file 2.0
La migration vers PHP5 commencera juste après la série des 1.0, à partir de là PHP4 ne sera plus supporté. SimpleTest est actuellement compatible avec PHP5 mais n'utilisera aucune des nouvelles fonctionnalités avant la version 2.

Ressources sur le web pour les tests

Le processus est au moins aussi important que les outils. Le type de procédure que fait un usage le plus intensif des outils de test pour développeur est bien sûr l'Extreme Programming. Il s'agit là d'une des méthodes agiles qui combinent plusieurs pratiques pour "lisser la courbe de coût" du développement logiciel. La plus extrème reste le développement piloté par les tests, où vous devez adhérer à la règle du pas de code avant d'avoir un test. Si vous êtes plutôt du genre planninficateur ou que vous estimez que l'expérience compte plus que l'évolution, vous préférerez peut-être l'approche RUP. Je ne l'ai pas testé mais je peux voir où vous aurez besoin d'outils de test (cf. illustration 9).

La plupart des testeurs unitaires sont dans une certaine mesure un clone de JUnit, au moins dans l'interface. Il y a énormément d'information sur le site de JUnit, à commencer par la FAQ quie contient pas mal de conseils généraux sur les tests. Une fois mordu par le bogue vous apprécierez sûrement la phrase infecté par les tests trouvée par Eric Gamma. Si vous êtes encore en train de tergiverser sur un testeur unitaire, sachez que les choix principaux sont PHPUnit et Pear PHP::PHPUnit. De nombreuses fonctionnalités de SimpleTest leurs font défaut, mais la version PEAR a d'ores et déjà été mise à jour pour PHP5. Elle est aussi recommandée si vous portez des scénarios de test existant depuis JUnit.

Les développeurs de bibliothèque n'ont pas l'air de livrer très souvent des tests avec leur code : c'est bien dommage. Le code d'une bibliothèque qui inclut des tests peut être remanié avec plus de sécurité et le code de test sert de documentation additionnelle dans un format assez standard. Ceci peut épargner la pêche aux indices dans le code source lorsque qu'un problème survient, en particulier lors de la mise à jour d'une telle bibliothèque. Parmi les bibliothèques utilisant SimpleTest comme testeur unitaire on retrouve WACT et PEAR::XML_HTMLSax.

Au jour d'aujourd'hui il manque tristement beaucoup de matière sur les objets fantaisie : dommage, surtout que tester unitairement sans eux représente pas mal de travail en plus. L'article original sur les objets fantaisie est très orienté Java, mais reste intéressant à lire. Etant donné qu'il s'agit d'une nouvelle technologie il y a beaucoup de discussions et de débats sur comment les utiliser, souvent sur des wikis comme Extreme Tuesday ou www.mockobjects.comou the original C2 Wiki. Injecter des objets fantaisie dans une classe est un des champs principaux du débat : cet article chez IBM en est un bon point de départ.

Il y a énormement d'outils de test web mais la plupart sont écrits en Java. De plus les tutoriels et autres conseils sont plutôt rares. Votre seul espoir est de regarder directement la documentation pour HTTPUnit, HTMLUnit ou JWebUnit et d'espérer y trouver pour des indices. Il y a aussi des frameworks basés sur XML, mais de nouveau la plupart ont besoin de Java pour tourner.

pgfouine-1.2/tests/simpletest/docs/fr/server_stubs_documentation.html0000644000175000017500000003535210334504440025030 0ustar acmeacme Documentation SimpleTest : les bouchons serveur

Documentation sur les bouchons serveur

Que sont les bouchons serveur ?

Au départ il s'agit d'un modèle de conception initié par Robert Binder (Testing object-oriented systems: models, patterns, and tools, Addison-Wesley) in 1999. Un bouchon serveur est une simulation d'un objet ou d'un composant. Il doit remplacer exactement un composant dans un système pour des raisons de testabilité ou de prototypage, tout en restant léger. Il permet aux tests de tourner plus rapidement ou alors, si la classe simulée n'a pas été écrite, juste de fonctionner.

Créer des bouchons serveur

Nous avons juste besoin d'une classe préexistante, par exemple une connexion vers une base de données qui ressemblerait à...

class DatabaseConnection {
    function DatabaseConnection() {
    }
    
    function query() {
    }
    
    function selectQuery() {
    }
}
La classe n'a même pas encore besoin d'avoir été implémentée. Pour créer la version bouchonnée de cette classe, nous incluons la librairie de bouchon serveur et exécutons le générateur...
require_once('simpletest/mock_objects.php');
require_once('database_connection.php');
Stub::generate('DatabaseConnection');
Est généré un clone de la classe appelé StubDatabaseConnection. Nous pouvons alors créer des instances de cette nouvelle classe à l'intérieur de notre prototype de script...
require_once('simpletest/mock_objects.php');
require_once('database_connection.php');
Stub::generate('DatabaseConnection');

$connection = new StubDatabaseConnection();

La version bouchonnée de la classe contient toutes les méthodes de l'original de telle sorte qu'une opération comme $connection->query() soit encore légale. La valeur retournée sera null, Mais nous pouvons y remédier avec...
$connection->setReturnValue('query', 37)
Désormais à chaque appel de $connection->query() nous obtenons un résultat de 37. Nous pouvons choisir n'importe quelle valeur pour le résultat, par exemple un hash de résultats provenant d'un base de données imaginaire ou alors une liste d'objets persistants. Peu importe les paramètres, nous obtenons systématiquement les même valeurs chaque fois qu'ils ont été initialisés de la sorte : ça ne ressemble peut-être pas à une réponse convaincante venant d'une connexion vers une base de données. Mais pour la demi-douzaine de lignes d'une méthode de test c'est souvent largement suffisant.

Modèles de simulation

Sauf que les choses ne sont que rarement aussi simples. Parmi les problèmes les plus courants on trouve les itérateurs : le renvoi d'une valeur constante peut causer une boucle infini dans l'objet testé. Pour ceux-ci nous avons besoin de mettre sur pied une suite de valeurs. Prenons par exemple un itérateur simple qui ressemble à...

class Iterator {
    function Iterator() {
    }
    
    function next() {
    }
}
C'est probablement le plus simple des itérateurs possibles. Supposons que cet itérateur ne retourne que du texte, jusqu'à la fin - quand il retourne false. Une simulation est possible avec...
Stub::generate('Iterator');

$iterator = new StubIterator();
$iterator->setReturnValue('next', false);
$iterator->setReturnValueAt(0, 'next', 'First string');
$iterator->setReturnValueAt(1, 'next', 'Second string');
A l'appel de next() sur l'itérateur bouchonné il va d'abord renvoyer "First string", puis au second appel c'est "Second string" qui sera renvoyé. Finalement pour tous les autres appels, il s'agira d'un false. Les valeurs renvoyées successivement ont priorité sur la valeur constante renvoyé. Cette dernière est un genre de valeur par défaut.

Une autre situation délicate est une opération get() surchargée. Un exemple ? Un porteur d'information avec des pairs de clef / valeur. Prenons une classe de configuration...

class Configuration {
    function Configuration() {
    }
    
    function getValue($key) {
    }
}
Il s'agit d'une situation propice à l'utilisation d'objets bouchon, surtout que la configuration en production dépend invariablement de la machine : l'utiliser directement ne va pas nous aider à maintenir notre confiance dans nos tests. Sauf que le problème tient de ce que toutes les données proviennent de la méthode getValue() et que nous voulons des résultats différents suivant la clef. Par chance les bouchons ont un système de filtre...
Stub::generate('Configuration');

$config = &new StubConfiguration();
$config->setReturnValue('getValue', 'primary', array('db_host'));
$config->setReturnValue('getValue', 'admin', array('db_user'));
$config->setReturnValue('getValue', 'secret', array('db_password'));
Ce paramètre supplémentaire est une liste d'arguments que l'on peut utiliser. Dans ce cas nous essayons d'utiliser un unique argument, à savoir la clef recherchée. Maintenant quand on invoque le bouchon serveur via la méthode getValue() avec...
$config->getValue('db_user');
...il renvoie "admin". Il le trouve en essayant d'assortir successivement les arguments d'entrée avec sa liste de ceux de sortie jusqu'au moment où une correspondance exacte est trouvée.

Vous pouvez définir un argument par défaut avec...


$config->setReturnValue('getValue', false, array('*'));
Attention ce n'est pas équivalent à initialiser la valeur retournée sans aucun argument.

$config->setReturnValue('getValue', false);
Dans le premier cas il acceptera n'importe quel argument, mais exactement un -- pas plus -- est nécessaire. Dans le second cas n'importe quel nombre d'arguments fera l'affaire : il agit comme un catchall après tous les correspondances. Prenez garde à l'ordre : si nous ajoutons un autre paramètre après le joker ('*') il sera ignoré puisque le joker aura été trouvé auparavant. Avec des listes de paramètres complexes l'ordre peut devenir crucial, au risque de perdre des correspondances souhaitées, masquées par un joker antérieur. Pensez à mettre d'abord les cas les plus spécifiques si vous n'êtes pas sûr.

Il y a des fois où l'on souhaite qu'un objet spécifique soit servi par le bouchon plutôt qu'une simple copie. La sémantique de la copie en PHP nous force à utiliser une autre méthode pour cela. Vous êtes peut-être en train de simuler un conteneur par exemple...

class Thing {
}

class Vector {
    function Vector() {
    }
    
    function get($index) {
    }
}
Dans ce cas vous pouvez mettre une référence dans la liste renvoyée par le bouchon...
Stub::generate('Vector');

$thing = new Thing();
$vector = &new StubVector();
$vector->setReturnReference('get', $thing, array(12));
Avec ce petit arrangement vous vous assurez qu'à chaque fois que $vector->get(12) est appelé il renverra le même $thing.

Ces trois facteurs, ordre, paramètres et copie (ou référence), peuvent être combinés orthogonalement. Par exemple...

$complex = &new StubComplexThing();
$stuff = new Stuff();
$complex->setReturnReferenceAt(3, 'get', $stuff, array('*', 1));
Le $stuff ne sera renvoyé qu'au troisième appel et seulement si deux paramètres étaient indiqués, avec la contrainte que le second de ceux-ci soit l'entier 1. N'est-ce pas suffisant pour des situations de prototypage simple ?

Un dernier cas critique reste celle d'un objet en créant un autre, connu sous le nom du modèle factory - fabrique. Supposons qu'après une requête réussie à notre base de données imaginaire, un ensemble de résultats est retourné sous la forme d'un itérateur, chaque appel à next() donnant un ligne et à la fin un false. Au premier abord, ça donne l'impression d'être cauchemardesque à simuler. Alors qu'en fait tout peut être bouchonné en utilisant les mécanismes ci-dessus.

Voici comment...

Stub::generate('DatabaseConnection');
Stub::generate('ResultIterator');

class DatabaseTest extends UnitTestCase {
    
    function testUserFinder() {
        $result = &new StubResultIterator();
        $result->setReturnValue('next', false);
        $result->setReturnValueAt(0, 'next', array(1, 'tom'));
        $result->setReturnValueAt(1, 'next', array(3, 'dick'));
        $result->setReturnValueAt(2, 'next', array(6, 'harry'));
        
        $connection = &new StubDatabaseConnection();
        $connection->setReturnValue('query', false);
        $connection->setReturnReference(
                'query',
                $result,
                array('select id, name from users'));
                
        $finder = &new UserFinder($connection);
        $this->assertIdentical(
                $finder->findNames(),
                array('tom', 'dick', 'harry'));
    }
}
Désormais ce n'est que si notre $connection est appelé avec la bonne query() que le $result sera renvoyé après le troisième appel à next(). Cela devrait être suffisant pour que notre classe UserFinder, la classe effectivement testée à ce niveau, puisse s'exécuter comme il faut. Un test très précis et pas une seule base de données à l'horizon.

Options de création pour les bouchons

Il y a d'autres options additionnelles à la création d'un bouchon. Au moment de la génération nous pouvons changer le nom de la classe...

Stub::generate('Iterator', 'MyStubIterator');
$iterator = &new MyStubIterator();

Pris tout seul ce n'est pas très utile étant donné qu'il n'y aurait pas de différence entre cette classe et celle par défaut -- à part le nom bien entendu. Par contre nous pouvons aussi lui ajouter d'autres méthodes qui ne se trouveraient pas dans l'interface originale...
class Iterator {
}
Stub::generate('Iterator', 'PrototypeIterator', array('next', 'isError'));
$iterator = &new PrototypeIterator();
$iterator->setReturnValue('next', 0);

Les méthodes next() et isError() peuvent maintenant renvoyer des ensembles de valeurs exactement comme si elles existaient dans la classe originale.

Un moyen encore plus ésotérique de modifier les bouchons est de changer le joker utiliser par défaut pour la correspondance des paramètres.

Stub::generate('Connection');
$iterator = &new StubConnection('wild');
$iterator->setReturnValue('query', array('id' => 33), array('wild'));

L'unique raison valable pour effectuer cette opération, c'est quand vous souhaitez tester la chaîne "*" sans pour autant l'interpréter comme un "n'importe lequel".

pgfouine-1.2/tests/simpletest/docs/fr/form_testing_documentation.html0000644000175000017500000002532210334504440024776 0ustar acmeacme Documentation SimpleTest : tester des formulaires HTML

Documentation sur les tests de formulaire

Valider un formulaire simple

Lorsqu'une page est téléchargée par WebTestCase en utilisant get() ou post() le contenu de la page est automatiquement analysé. De cette analyse découle le fait que toutes les commandes à l'intérieur de la balise <form> sont disponibles depuis l'intérieur du scénario de test. Prenons pas exemple cet extrait de code HTML...

<form>
    <input type="text" name="a" value="A default" />
    <input type="submit" value="Go" />
</form>
Il ressemble à...

Nous pouvons naviguer vers ce code, via le site LastCraft, avec le test suivant...

class SimpleFormTests extends WebTestCase {
    
    function testDefaultValue() {
        $this->get('http://www.lastcraft.com/form_testing_documentation.php');
        $this->assertField('a', 'A default');
    }
}
Directement après le chargement de la page toutes les commandes HTML sont initiées avec leur valeur par défaut, comme elles apparaîtraient dans un navigateur web. L'assertion teste qu'un objet HTML avec le nom "a" existe dans la page et qu'il contient la valeur "A default".

Nous pourrions retourner le formulaire tout de suite, mais d'abord nous allons changer la valeur du champ texte. Ce n'est qu'après que nous le transmettre...

class SimpleFormTests extends WebTestCase {

    function testDefaultValue() {
        $this->get('http://www.my-site.com/');
        $this->assertField('a', 'A default');
        $this->setField('a', 'New value');
        $this->clickSubmit('Go');
    }
}
Parce que nous n'avons spécifié ni attribut "method" sur la balise form, ni attribut "action", le scénario de test suivra le comportement classique d'un navigateur : transmission des données avec une requête GET vers la même page. SimpleTest essaie d'émuler le comportement typique d'un navigateur autant que possible, plutôt que d'essayer d'attraper des attributs manquants sur les balises. La raison est simple : la cible d'un framework de test est la logique d'une application PHP, pas les erreurs -- de syntaxe ou autres -- du code HTML. Pour les erreurs HTML, d'autres outils tel HTMLTidy devraient être employés.

Si un champ manque dans n'importe que formulaire ou si une option est indisponible alors WebTestCase::setField() renverra false. Par exemple, supposons que nous souhaitons vérifier qu'une option "Superuser" n'est pas présente dans ce formulaire...

<strong>Select type of user to add:</strong>
<select name="type">
    <option>Subscriber</option>
    <option>Author</option>
    <option>Administrator</option>
</select>
Qui ressemble à...

Select type of user to add:

Le test suivant le confirmera...

class SimpleFormTests extends WebTestCase {
    ...
    function testNoSuperuserChoiceAvailable() {
        $this->get('http://www.lastcraft.com/form_testing_documentation.php');
        $this->assertFalse($this->setField('type', 'Superuser'));
    }
}
La sélection ne sera pas changée suite à un échec d'initialisation d'une valeur sur un objet.

Voici la liste complète des objets supportés à aujourd'hui...

  • Champs texte, y compris les champs masqués (hidden) ou cryptés (password).
  • Boutons submit, en incluant aussi la balise button, mais pas encore les boutons reset
  • Aires texte (textarea) avec leur gestion des retours à la ligne (wrap).
  • Cases à cocher, y compris les cases à cocher multiples dans un même formulaire.
  • Listes à menu déroulant, y compris celles à sélections multiples.
  • Boutons radio.
  • Images.

Bien que la plupart des objets HTML standards soient couvert par le parseur de SimpleTest, il est peu probable que JavaScript soit implémenté dans un futur proche.

Champs à valeurs multiples

SimpleTest peut gérer deux types de commandes à valeur multiple : les menus déroulants à sélection multiple et les cases à cocher avec le même nom à l'intérieur même d'un formulaire. La nature de ceux-ci implique que leur initialisation et leur test sont légèrement différents. Voici un exemple avec des cases à cocher...

<form class="demo">
    <strong>Create privileges allowed:</strong>
    <input type="checkbox" name="crud" value="c" checked><br>
    <strong>Retrieve privileges allowed:</strong>
    <input type="checkbox" name="crud" value="r" checked><br>
    <strong>Update privileges allowed:</strong>
    <input type="checkbox" name="crud" value="u" checked><br>
    <strong>Destroy privileges allowed:</strong>
    <input type="checkbox" name="crud" value="d" checked><br>
    <input type="submit" value="Enable Privileges">
</form>
Qui se traduit par...

Create privileges allowed:
Retrieve privileges allowed:
Update privileges allowed:
Destroy privileges allowed:

Si nous souhaitons désactiver tous les privilèges sauf ceux de téléchargement (Retrieve) et transmettre cette information, nous pouvons y arriver par...

class SimpleFormTests extends WebTestCase {
    ...
    function testDisableNastyPrivileges() {
        $this->get('http://www.lastcraft.com/form_testing_documentation.php');
        $this->assertField('crud', array('c', 'r', 'u', 'd'));
        $this->setField('crud', array('r'));
        $this->clickSubmit('Enable Privileges');
    }
}
Plutôt que d'initier le champ à une valeur unique, nous lui donnons une liste de valeurs. Nous faisons la même chose pour tester les valeurs attendues. Nous pouvons écrire d'autre code de test pour confirmer cet effet, peut-être en nous connectant comme utilisateur et en essayant d'effectuer une mise à jour.

Envoi brut

Si vous souhaitez tester un gestionnaire de formulaire mais que vous ne l'avez pas écrit ou que vous n'y avez pas encore accès, vous pouvez créer un envoi de formulaire à la main.

class SimpleFormTests extends WebTestCase {
    ...    
    function testAttemptedHack() {
        $this->post(
                'http://www.my-site.com/add_user.php',
                array('type' => 'superuser'));
        $this->assertNoUnwantedPattern('/user created/i');
    }
}
En ajoutant des données à la méthode WebTestCase::post(), nous essayons de télécharger la page via la transmission d'un formulaire.

pgfouine-1.2/tests/simpletest/docs/fr/unit_test_documentation.html0000644000175000017500000003571710334504440024325 0ustar acmeacme Documenation SimpleTest pour les tests de régression en PHP

Documentation sur les tests unitaires en PHP

Scénarios de tests unitaires

Le coeur du système est un framework de test de régression construit autour des scénarios de test. Un exemple de scénario de test ressemble à...

class FileTestCase extends UnitTestCase {
}
Si aucun nom de test n'est fourni au moment de la liaison avec le constructeur alors le nom de la classe sera utilisé. Il s'agit du nom qui sera affiché dans les résultats du test.

Les véritables tests sont ajoutés en tant que méthode dans le scénario de test dont le nom par défaut commence par la chaîne "test" et quand le scénario de test est appelé toutes les méthodes de ce type sont exécutées dans l'ordre utilisé par l'introspection de PHP pour les trouver. Peuvent être ajoutées autant de méthodes de test que nécessaires. Par exemple...

require_once('../classes/writer.php');

class FileTestCase extends UnitTestCase {
    function FileTestCase() {
        $this->UnitTestCase('File test');
    }
    
    function setUp() {
        @unlink('../temp/test.txt');
    }
    
    function tearDown() {
        @unlink('../temp/test.txt');
    }
    
    function testCreation() {
        $writer = &new FileWriter('../temp/test.txt');
        $writer->write('Hello');
        $this->assertTrue(file_exists('../temp/test.txt'), 'File created');
    }
}
Le constructeur est optionnel et souvent omis. Sans nom, le nom de la classe est utilisé comme nom pour le scénario de test.

Notre unique méthode de test pour le moment est testCreation() où nous vérifions qu'un fichier a bien été créé par notre objet Writer. Nous pourrions avoir mis le code unlink() dans cette méthode, mais en la plaçant dans setUp() et tearDown() nous pouvons l'utiliser pour nos autres méthodes de test que nous ajouterons.

La méthode setUp() est lancé juste avant chaque méthode de test. tearDown() est lancé après chaque méthode de test.

Vous pouvez placer une initialisation de scénario de test dans le constructeur afin qu'elle soit lancée pour toutes les méthodes dans le scénario de test mais dans un tel cas vous vous exposeriez à des interférences. Cette façon de faire est légèrement moins rapide, mais elle est plus sûre. Notez que si vous arrivez avec des notions de JUnit, il ne s'agit pas du comportement auquel vous êtes habitués. Bizarrement JUnit re-instancie le scénario de test pour chaque méthode de test pour se prévenir d'une telle interférence. SimpleTest demande à l'utilisateur final d'utiliser setUp(), mais fournit aux codeurs de bibliothèque d'autres crochets.

Pour rapporter les résultats de test, le passage par une classe d'affichage - notifiée par les différentes méthodes de type assert...() - est utilisée. En voici la liste complète pour la classe UnitTestCase, celle par défaut dans SimpleTest...
assertTrue($x)Echoue si $x est faux
assertFalse($x)Echoue si $x est vrai
assertNull($x)Echoue si $x est initialisé
assertNotNull($x)Echoue si $x n'est pas initialisé
assertIsA($x, $t)Echoue si $x n'est pas de la classe ou du type $t
assertEqual($x, $y)Echoue si $x == $y est faux
assertNotEqual($x, $y)Echoue si $x == $y est vrai
assertIdentical($x, $y)Echoue si $x === $y est faux
assertNotIdentical($x, $y)Echoue si $x === $y est vrai
assertReference($x, $y)Echoue sauf si $x et $y sont la même variable
assertCopy($x, $y)Echoue si $x et $y sont la même variable
assertWantedPattern($p, $x)Echoue sauf si l'expression rationnelle $p capture $x
assertNoUnwantedPattern($p, $x)Echoue si l'expression rationnelle $p capture $x
assertNoErrors()Echoue si une erreur PHP arrive
assertError($x)Echoue si aucune erreur ou message incorrect de PHP n'arrive
Toutes les méthodes d'assertion peuvent recevoir une description optionnelle : cette description sert pour étiqueter le résultat. Sans elle, une message par défaut est envoyée à la place : il est généralement suffisant. Ce message par défaut peut encore être encadré dans votre propre message si vous incluez "%s" dans la chaîne. Toutes les assertions renvoient vrai / true en cas de succès et faux / false en cas d'échec.

D'autres exemples...

$variable = null;
$this->assertNull($variable, 'Should be cleared');
...passera et normalement n'affichera aucun message. Si vous avez configuré le testeur pour afficher aussi les succès alors le message sera affiché comme tel.
$this->assertIdentical(0, false, 'Zero is not false [%s]');
Ceci échouera étant donné qu'il effectue une vérification sur le type en plus d'une comparaison sur les deux valeurs. La partie "%s" est remplacée par le message d'erreur par défaut qui aurait été affiché si nous n'avions pas fourni le nôtre. Cela nous permet d'emboîter les messages de test.
$a = 1;
$b = $a;
$this->assertReference($a, $b);
Échouera étant donné que la variable $b est une copie de $a.
$this->assertWantedPattern('/hello/i', 'Hello world');
Là, ça passe puisque la recherche est insensible à la casse et que donc hello est bien repérable dans Hello world.
trigger_error('Disaster');
trigger_error('Catastrophe');
$this->assertError();
$this->assertError('Catastrophe');
$this->assertNoErrors();
Ici, il y a besoin d'une petite explication : toutes passent !

Les erreurs PHP dans SimpleTest sont piégées et placées dans une queue. Ici la première vérification d'erreur attrape le message "Disaster" sans vérifier le texte et passe. Résultat : l'erreur est supprimée de la queue. La vérification suivante teste non seulement l'existence de l'erreur mais aussi le texte qui correspond : un autre succès. Désormais la queue est vide et le dernier test passe aussi. Si une autre erreur non vérifiée est encore dans la queue à la fin de notre méthode de test alors une exception sera rapportée dans le test. Notez que SimpleTest ne peut pas attraper les erreurs PHP à la compilation.

Les scénarios de test peuvent utiliser des méthodes bien pratiques pour déboguer le code ou pour étendre la suite...
setUp()Est lancée avant chaque méthode de test
tearDown()Est lancée après chaque méthode de test
pass()Envoie un succès
fail()Envoie un échec
error()Envoi un évènement exception
sendMessage()Envoie un message d'état aux systèmes d'affichage qui le supporte
signal($type, $payload)Envoie un message défini par l'utilisateur au rapporteur du test
dump($var)Effectue un print_r() formaté pour du déboguage rapide et grossier
swallowErrors()Vide les erreurs de la queue

Etendre les scénarios de test

Bien sûr des méthodes supplémentaires de test peuvent être ajoutées pour créer d'autres types de scénario de test afin d'étendre le framework...

require_once('simpletest/unit_tester.php');

class FileTester extends UnitTestCase {
    function FileTester($name = false) {
        $this->UnitTestCase($name);
    }
    
    function assertFileExists($filename, $message = '%s') {
        $this->assertTrue(
                file_exists($filename),
                sprintf($message, 'File [$filename] existence check'));
    }
}
Ici la bibliothèque SimpleTest est localisée dans un répertoire local appelé simpletest. Pensez à le modifier pour votre propre environnement.

Ce nouveau scénario peut être hérité exactement comme un scénario de test classique...

class FileTestCase extends FileTester {
    
    function setUp() {
        @unlink('../temp/test.txt');
    }
    
    function tearDown() {
        @unlink('../temp/test.txt');
    }
    
    function testCreation() {
        $writer = &new FileWriter('../temp/test.txt');
        $writer->write('Hello');
        $this->assertFileExists('../temp/test.txt');
    }
}

Si vous souhaitez un scénario de test sans toutes les assertions de UnitTestCase mais uniquement avec les vôtres propres, vous aurez besoin d'étendre la classe SimpleTestCase à la place. Elle se trouve dans simple_test.php en lieu et place de unit_tester.php. A consulter plus tard si vous souhaitez incorporer les scénarios d'autres testeurs unitaires dans votre suite de test.

Lancer un unique scénario de test

Ce n'est pas souvent qu'il faille lancer des scénarios avec un unique test. Sauf lorsqu'il s'agit de s'arracher les cheveux sur un module à problème sans pour autant désorganiser la suite de test principale. Voici l'échafaudage nécessaire pour lancer un scénario de test solitaire...

<?php
    require_once('simpletest/unit_tester.php');
    require_once('simpletest/reporter.php');
    require_once('../classes/writer.php');

    class FileTestCase extends UnitTestCase {
        function FileTestCase() {
            $this->UnitTestCase('File test');
        }
    }
    
    $test = &new FileTestCase();
    $test->run(new HtmlReporter());
?>
Ce script sera lancé tel que mais il n'y aura aucun succès ou échec avant que des méthodes de test soient ajoutées.

pgfouine-1.2/tests/simpletest/parser.php0000644000175000017500000006724310334504436017142 0ustar acmeacme_case = $case; $this->_patterns = array(); $this->_labels = array(); $this->_regex = null; } /** * Adds a pattern with an optional label. * @param string $pattern Perl style regex, but ( and ) * lose the usual meaning. * @param string $label Label of regex to be returned * on a match. * @access public */ function addPattern($pattern, $label = true) { $count = count($this->_patterns); $this->_patterns[$count] = $pattern; $this->_labels[$count] = $label; $this->_regex = null; } /** * Attempts to match all patterns at once against * a string. * @param string $subject String to match against. * @param string $match First matched portion of * subject. * @return boolean True on success. * @access public */ function match($subject, &$match) { if (count($this->_patterns) == 0) { return false; } if (! preg_match($this->_getCompoundedRegex(), $subject, $matches)) { $match = ''; return false; } $match = $matches[0]; for ($i = 1; $i < count($matches); $i++) { if ($matches[$i]) { return $this->_labels[$i - 1]; } } return true; } /** * Compounds the patterns into a single * regular expression separated with the * "or" operator. Caches the regex. * Will automatically escape (, ) and / tokens. * @param array $patterns List of patterns in order. * @access private */ function _getCompoundedRegex() { if ($this->_regex == null) { for ($i = 0, $count = count($this->_patterns); $i < $count; $i++) { $this->_patterns[$i] = '(' . str_replace( array('/', '(', ')'), array('\/', '\(', '\)'), $this->_patterns[$i]) . ')'; } $this->_regex = "/" . implode("|", $this->_patterns) . "/" . $this->_getPerlMatchingFlags(); } return $this->_regex; } /** * Accessor for perl regex mode flags to use. * @return string Perl regex flags. * @access private */ function _getPerlMatchingFlags() { return ($this->_case ? "msS" : "msSi"); } } /** * States for a stack machine. * @package SimpleTest * @subpackage WebTester */ class SimpleStateStack { var $_stack; /** * Constructor. Starts in named state. * @param string $start Starting state name. * @access public */ function SimpleStateStack($start) { $this->_stack = array($start); } /** * Accessor for current state. * @return string State. * @access public */ function getCurrent() { return $this->_stack[count($this->_stack) - 1]; } /** * Adds a state to the stack and sets it * to be the current state. * @param string $state New state. * @access public */ function enter($state) { array_push($this->_stack, $state); } /** * Leaves the current state and reverts * to the previous one. * @return boolean False if we drop off * the bottom of the list. * @access public */ function leave() { if (count($this->_stack) == 1) { return false; } array_pop($this->_stack); return true; } } /** * Accepts text and breaks it into tokens. * Some optimisation to make the sure the * content is only scanned by the PHP regex * parser once. Lexer modes must not start * with leading underscores. * @package SimpleTest * @subpackage WebTester */ class SimpleLexer { var $_regexes; var $_parser; var $_mode; var $_mode_handlers; var $_case; /** * Sets up the lexer in case insensitive matching * by default. * @param SimpleSaxParser $parser Handling strategy by * reference. * @param string $start Starting handler. * @param boolean $case True for case sensitive. * @access public */ function SimpleLexer(&$parser, $start = "accept", $case = false) { $this->_case = $case; $this->_regexes = array(); $this->_parser = &$parser; $this->_mode = &new SimpleStateStack($start); $this->_mode_handlers = array($start => $start); } /** * Adds a token search pattern for a particular * parsing mode. The pattern does not change the * current mode. * @param string $pattern Perl style regex, but ( and ) * lose the usual meaning. * @param string $mode Should only apply this * pattern when dealing with * this type of input. * @access public */ function addPattern($pattern, $mode = "accept") { if (! isset($this->_regexes[$mode])) { $this->_regexes[$mode] = new ParallelRegex($this->_case); } $this->_regexes[$mode]->addPattern($pattern); if (! isset($this->_mode_handlers[$mode])) { $this->_mode_handlers[$mode] = $mode; } } /** * Adds a pattern that will enter a new parsing * mode. Useful for entering parenthesis, strings, * tags, etc. * @param string $pattern Perl style regex, but ( and ) * lose the usual meaning. * @param string $mode Should only apply this * pattern when dealing with * this type of input. * @param string $new_mode Change parsing to this new * nested mode. * @access public */ function addEntryPattern($pattern, $mode, $new_mode) { if (! isset($this->_regexes[$mode])) { $this->_regexes[$mode] = new ParallelRegex($this->_case); } $this->_regexes[$mode]->addPattern($pattern, $new_mode); if (! isset($this->_mode_handlers[$new_mode])) { $this->_mode_handlers[$new_mode] = $new_mode; } } /** * Adds a pattern that will exit the current mode * and re-enter the previous one. * @param string $pattern Perl style regex, but ( and ) * lose the usual meaning. * @param string $mode Mode to leave. * @access public */ function addExitPattern($pattern, $mode) { if (! isset($this->_regexes[$mode])) { $this->_regexes[$mode] = new ParallelRegex($this->_case); } $this->_regexes[$mode]->addPattern($pattern, "__exit"); if (! isset($this->_mode_handlers[$mode])) { $this->_mode_handlers[$mode] = $mode; } } /** * Adds a pattern that has a special mode. Acts as an entry * and exit pattern in one go, effectively calling a special * parser handler for this token only. * @param string $pattern Perl style regex, but ( and ) * lose the usual meaning. * @param string $mode Should only apply this * pattern when dealing with * this type of input. * @param string $special Use this mode for this one token. * @access public */ function addSpecialPattern($pattern, $mode, $special) { if (! isset($this->_regexes[$mode])) { $this->_regexes[$mode] = new ParallelRegex($this->_case); } $this->_regexes[$mode]->addPattern($pattern, "_$special"); if (! isset($this->_mode_handlers[$special])) { $this->_mode_handlers[$special] = $special; } } /** * Adds a mapping from a mode to another handler. * @param string $mode Mode to be remapped. * @param string $handler New target handler. * @access public */ function mapHandler($mode, $handler) { $this->_mode_handlers[$mode] = $handler; } /** * Splits the page text into tokens. Will fail * if the handlers report an error or if no * content is consumed. If successful then each * unparsed and parsed token invokes a call to the * held listener. * @param string $raw Raw HTML text. * @return boolean True on success, else false. * @access public */ function parse($raw) { if (! isset($this->_parser)) { return false; } $length = strlen($raw); while (is_array($parsed = $this->_reduce($raw))) { list($raw, $unmatched, $matched, $mode) = $parsed; if (! $this->_dispatchTokens($unmatched, $matched, $mode)) { return false; } if ($raw === '') { return true; } if (strlen($raw) == $length) { return false; } $length = strlen($raw); } if (! $parsed) { return false; } return $this->_invokeParser($raw, LEXER_UNMATCHED); } /** * Sends the matched token and any leading unmatched * text to the parser changing the lexer to a new * mode if one is listed. * @param string $unmatched Unmatched leading portion. * @param string $matched Actual token match. * @param string $mode Mode after match. A boolean * false mode causes no change. * @return boolean False if there was any error * from the parser. * @access private */ function _dispatchTokens($unmatched, $matched, $mode = false) { if (! $this->_invokeParser($unmatched, LEXER_UNMATCHED)) { return false; } if (is_bool($mode)) { return $this->_invokeParser($matched, LEXER_MATCHED); } if ($this->_isModeEnd($mode)) { if (! $this->_invokeParser($matched, LEXER_EXIT)) { return false; } return $this->_mode->leave(); } if ($this->_isSpecialMode($mode)) { $this->_mode->enter($this->_decodeSpecial($mode)); if (! $this->_invokeParser($matched, LEXER_SPECIAL)) { return false; } return $this->_mode->leave(); } $this->_mode->enter($mode); return $this->_invokeParser($matched, LEXER_ENTER); } /** * Tests to see if the new mode is actually to leave * the current mode and pop an item from the matching * mode stack. * @param string $mode Mode to test. * @return boolean True if this is the exit mode. * @access private */ function _isModeEnd($mode) { return ($mode === "__exit"); } /** * Test to see if the mode is one where this mode * is entered for this token only and automatically * leaves immediately afterwoods. * @param string $mode Mode to test. * @return boolean True if this is the exit mode. * @access private */ function _isSpecialMode($mode) { return (strncmp($mode, "_", 1) == 0); } /** * Strips the magic underscore marking single token * modes. * @param string $mode Mode to decode. * @return string Underlying mode name. * @access private */ function _decodeSpecial($mode) { return substr($mode, 1); } /** * Calls the parser method named after the current * mode. Empty content will be ignored. The lexer * has a parser handler for each mode in the lexer. * @param string $content Text parsed. * @param boolean $is_match Token is recognised rather * than unparsed data. * @access private */ function _invokeParser($content, $is_match) { if (($content === '') || ($content === false)) { return true; } $handler = $this->_mode_handlers[$this->_mode->getCurrent()]; return $this->_parser->$handler($content, $is_match); } /** * Tries to match a chunk of text and if successful * removes the recognised chunk and any leading * unparsed data. Empty strings will not be matched. * @param string $raw The subject to parse. This is the * content that will be eaten. * @return array/boolean Three item list of unparsed * content followed by the * recognised token and finally the * action the parser is to take. * True if no match, false if there * is a parsing error. * @access private */ function _reduce($raw) { if ($action = $this->_regexes[$this->_mode->getCurrent()]->match($raw, $match)) { $unparsed_character_count = strpos($raw, $match); $unparsed = substr($raw, 0, $unparsed_character_count); $raw = substr($raw, $unparsed_character_count + strlen($match)); return array($raw, $unparsed, $match, $action); } return true; } } /** * Converts HTML tokens into selected SAX events. * @package SimpleTest * @subpackage WebTester */ class SimpleSaxParser { var $_lexer; var $_listener; var $_tag; var $_attributes; var $_current_attribute; /** * Sets the listener. * @param SimpleSaxListener $listener SAX event handler. * @access public */ function SimpleSaxParser(&$listener) { $this->_listener = &$listener; $this->_lexer = &$this->createLexer($this); $this->_tag = ''; $this->_attributes = array(); $this->_current_attribute = ''; } /** * Runs the content through the lexer which * should call back to the acceptors. * @param string $raw Page text to parse. * @return boolean False if parse error. * @access public */ function parse($raw) { return $this->_lexer->parse($raw); } /** * Sets up the matching lexer. Starts in 'text' mode. * @param SimpleSaxParser $parser Event generator, usually $self. * @return SimpleLexer Lexer suitable for this parser. * @access public * @static */ function &createLexer(&$parser) { $lexer = &new SimpleLexer($parser, 'text'); $lexer->mapHandler('text', 'acceptTextToken'); SimpleSaxParser::_addSkipping($lexer); foreach (SimpleSaxParser::_getParsedTags() as $tag) { SimpleSaxParser::_addTag($lexer, $tag); } SimpleSaxParser::_addInTagTokens($lexer); return $lexer; } /** * List of parsed tags. Others are ignored. * @return array List of searched for tags. * @access private */ function _getParsedTags() { return array('a', 'title', 'form', 'input', 'button', 'textarea', 'select', 'option', 'frameset', 'frame'); } /** * The lexer has to skip certain sections such * as server code, client code and styles. * @param SimpleLexer $lexer Lexer to add patterns to. * @access private * @static */ function _addSkipping(&$lexer) { $lexer->mapHandler('css', 'ignore'); $lexer->addEntryPattern('addExitPattern('', 'css'); $lexer->mapHandler('js', 'ignore'); $lexer->addEntryPattern('addExitPattern('', 'js'); $lexer->mapHandler('comment', 'ignore'); $lexer->addEntryPattern('', 'comment'); } /** * Pattern matches to start and end a tag. * @param SimpleLexer $lexer Lexer to add patterns to. * @param string $tag Name of tag to scan for. * @access private * @static */ function _addTag(&$lexer, $tag) { $lexer->addSpecialPattern("", 'text', 'acceptEndToken'); $lexer->addEntryPattern("<$tag", 'text', 'tag'); } /** * Pattern matches to parse the inside of a tag * including the attributes and their quoting. * @param SimpleLexer $lexer Lexer to add patterns to. * @access private * @static */ function _addInTagTokens(&$lexer) { $lexer->mapHandler('tag', 'acceptStartToken'); $lexer->addSpecialPattern('\s+', 'tag', 'ignore'); SimpleSaxParser::_addAttributeTokens($lexer); $lexer->addExitPattern('>', 'tag'); } /** * Matches attributes that are either single quoted, * double quoted or unquoted. * @param SimpleLexer $lexer Lexer to add patterns to. * @access private * @static */ function _addAttributeTokens(&$lexer) { $lexer->mapHandler('dq_attribute', 'acceptAttributeToken'); $lexer->addEntryPattern('=\s*"', 'tag', 'dq_attribute'); $lexer->addPattern("\\\\\"", 'dq_attribute'); $lexer->addExitPattern('"', 'dq_attribute'); $lexer->mapHandler('sq_attribute', 'acceptAttributeToken'); $lexer->addEntryPattern("=\s*'", 'tag', 'sq_attribute'); $lexer->addPattern("\\\\'", 'sq_attribute'); $lexer->addExitPattern("'", 'sq_attribute'); $lexer->mapHandler('uq_attribute', 'acceptAttributeToken'); $lexer->addSpecialPattern('=\s*[^>\s]*', 'tag', 'uq_attribute'); } /** * Accepts a token from the tag mode. If the * starting element completes then the element * is dispatched and the current attributes * set back to empty. The element or attribute * name is converted to lower case. * @param string $token Incoming characters. * @param integer $event Lexer event type. * @return boolean False if parse error. * @access public */ function acceptStartToken($token, $event) { if ($event == LEXER_ENTER) { $this->_tag = strtolower(substr($token, 1)); return true; } if ($event == LEXER_EXIT) { $success = $this->_listener->startElement( $this->_tag, $this->_attributes); $this->_tag = ""; $this->_attributes = array(); return $success; } if ($token != "=") { $this->_current_attribute = strtolower(SimpleSaxParser::decodeHtml($token)); $this->_attributes[$this->_current_attribute] = ""; } return true; } /** * Accepts a token from the end tag mode. * The element name is converted to lower case. * @param string $token Incoming characters. * @param integer $event Lexer event type. * @return boolean False if parse error. * @access public */ function acceptEndToken($token, $event) { if (! preg_match('/<\/(.*)>/', $token, $matches)) { return false; } return $this->_listener->endElement(strtolower($matches[1])); } /** * Part of the tag data. * @param string $token Incoming characters. * @param integer $event Lexer event type. * @return boolean False if parse error. * @access public */ function acceptAttributeToken($token, $event) { if ($event == LEXER_UNMATCHED) { $this->_attributes[$this->_current_attribute] .= SimpleSaxParser::decodeHtml($token); } if ($event == LEXER_SPECIAL) { $this->_attributes[$this->_current_attribute] .= preg_replace('/^=\s*/' , '', SimpleSaxParser::decodeHtml($token)); } return true; } /** * A character entity. * @param string $token Incoming characters. * @param integer $event Lexer event type. * @return boolean False if parse error. * @access public */ function acceptEntityToken($token, $event) { } /** * Character data between tags regarded as * important. * @param string $token Incoming characters. * @param integer $event Lexer event type. * @return boolean False if parse error. * @access public */ function acceptTextToken($token, $event) { return $this->_listener->addContent($token); } /** * Incoming data to be ignored. * @param string $token Incoming characters. * @param integer $event Lexer event type. * @return boolean False if parse error. * @access public */ function ignore($token, $event) { return true; } /** * Decodes any HTML entities. * @param string $html Incoming HTML. * @return string Outgoing plain text. * @access public * @static */ function decodeHtml($html) { static $translations; if (! isset($translations)) { $translations = array_flip(get_html_translation_table(HTML_ENTITIES)); } return strtr($html, $translations); } /** * Turns HTML into text browser visible text. Images * are converted to their alt text and tags are supressed. * Entities are converted to their visible representation. * @param string $html HTML to convert. * @return string Plain text. * @access public * @static */ function normalise($html) { $text = preg_replace('||', ' \1 ', $html); $text = preg_replace('||', ' \1 ', $text); $text = preg_replace('||', ' \1 ', $text); $text = preg_replace('|<.*?>|', '', $text); $text = SimpleSaxParser::decodeHtml($text); $text = preg_replace('|\s+|', ' ', $text); return trim($text); } } /** * SAX event handler. * @package SimpleTest * @subpackage WebTester * @abstract */ class SimpleSaxListener { /** * Sets the document to write to. * @access public */ function SimpleSaxListener() { } /** * Start of element event. * @param string $name Element name. * @param hash $attributes Name value pairs. * Attributes without content * are marked as true. * @return boolean False on parse error. * @access public */ function startElement($name, $attributes) { } /** * End of element event. * @param string $name Element name. * @return boolean False on parse error. * @access public */ function endElement($name) { } /** * Unparsed, but relevant data. * @param string $text May include unparsed tags. * @return boolean False on parse error. * @access public */ function addContent($text) { } } ?>pgfouine-1.2/tests/simpletest/VERSION0000644000175000017500000000000410334504436016163 0ustar acmeacme1.0 pgfouine-1.2/tests/simpletest/errors.php0000644000175000017500000001146710334504436017157 0ustar acmeacmeclear(); } /** * Adds an error to the front of the queue. * @param $severity PHP error code. * @param $message Text of error. * @param $filename File error occoured in. * @param $line Line number of error. * @param $super_globals Hash of PHP super global arrays. * @access public */ function add($severity, $message, $filename, $line, $super_globals) { array_push( $this->_queue, array($severity, $message, $filename, $line, $super_globals)); } /** * Pulls the earliest error from the queue. * @return False if none, or a list of error * information. Elements are: severity * as the PHP error code, the error message, * the file with the error, the line number * and a list of PHP super global arrays. * @access public */ function extract() { if (count($this->_queue)) { return array_shift($this->_queue); } return false; } /** * Discards the contents of the error queue. * @access public */ function clear() { $this->_queue = array(); } /** * Tests to see if the queue is empty. * @return True if empty. */ function isEmpty() { return (count($this->_queue) == 0); } /** * Global access to a single error queue. * @return Global error queue object. * @access public * @static */ function &instance() { static $queue = false; if (! $queue) { $queue = new SimpleErrorQueue(); } return $queue; } /** * Converst an error code into it's string * representation. * @param $severity PHP integer error code. * @return String version of error code. * @access public * @static */ function getSeverityAsString($severity) { static $map = array( E_STRICT => 'E_STRICT', E_ERROR => 'E_ERROR', E_WARNING => 'E_WARNING', E_PARSE => 'E_PARSE', E_NOTICE => 'E_NOTICE', E_CORE_ERROR => 'E_CORE_ERROR', E_CORE_WARNING => 'E_CORE_WARNING', E_COMPILE_ERROR => 'E_COMPILE_ERROR', E_COMPILE_WARNING => 'E_COMPILE_WARNING', E_USER_ERROR => 'E_USER_ERROR', E_USER_WARNING => 'E_USER_WARNING', E_USER_NOTICE => 'E_USER_NOTICE'); return $map[$severity]; } } /** * Error handler that simply stashes any errors into the global * error queue. Simulates the existing behaviour with respect to * logging errors, but this feature may be removed in future. * @param $severity PHP error code. * @param $message Text of error. * @param $filename File error occoured in. * @param $line Line number of error. * @param $super_globals Hash of PHP super global arrays. * @static * @access public */ function simpleTestErrorHandler($severity, $message, $filename, $line, $super_globals) { if ($severity = $severity & error_reporting()) { restore_error_handler(); if (ini_get('log_errors')) { $label = SimpleErrorQueue::getSeverityAsString($severity); error_log("$label: $message in $filename on line $line"); } $queue = &SimpleErrorQueue::instance(); $queue->add($severity, $message, $filename, $line, $super_globals); set_error_handler('simpleTestErrorHandler'); } } ?>pgfouine-1.2/tests/simpletest/web_tester.php0000644000175000017500000014457610334504436020016 0ustar acmeacmeSimpleExpectation(); if (is_array($value)) { sort($value); } $this->_value = $value; } /** * Tests the expectation. True if it matches * a string value or an array value in any order. * @param mixed $compare Comparison value. False for * an unset field. * @return boolean True if correct. * @access public */ function test($compare) { if ($this->_value === false) { return ($compare === false); } if ($this->_isSingle($this->_value)) { return $this->_testSingle($compare); } if (is_array($this->_value)) { return $this->_testMultiple($compare); } return false; } /** * Tests for valid field comparisons with a single option. * @param mixed $value Value to type check. * @return boolean True if integer, string or float. * @access private */ function _isSingle($value) { return is_string($value) || is_integer($value) || is_float($value); } /** * String comparison for simple field with a single option. * @param mixed $compare String to test against. * @returns boolean True if matching. * @access private */ function _testSingle($compare) { if (is_array($compare) && count($compare) == 1) { $compare = $compare[0]; } if (! $this->_isSingle($compare)) { return false; } return ($this->_value == $compare); } /** * List comparison for multivalue field. * @param mixed $compare List in any order to test against. * @returns boolean True if matching. * @access private */ function _testMultiple($compare) { if (is_string($compare)) { $compare = array($compare); } if (! is_array($compare)) { return false; } sort($compare); return ($this->_value === $compare); } /** * Returns a human readable test message. * @param mixed $compare Comparison value. * @return string Description of success * or failure. * @access public */ function testMessage($compare) { $dumper = &$this->_getDumper(); if (is_array($compare)) { sort($compare); } if ($this->test($compare)) { return "Field expectation [" . $dumper->describeValue($this->_value) . "]"; } else { return "Field expectation [" . $dumper->describeValue($this->_value) . "] fails with [" . $this->_dumper->describeValue($compare) . "] " . $this->_dumper->describeDifference($this->_value, $compare); } } } /** * Test for a specific HTTP header within a header block. * @package SimpleTest * @subpackage WebTester */ class HttpHeaderExpectation extends SimpleExpectation { var $_expected_header; var $_expected_value; /** * Sets the field and value to compare against. * @param string $header Case insenstive trimmed header name. * @param string $value Optional value to compare. If not * given then any value will match. */ function HttpHeaderExpectation($header, $value = false) { $this->_expected_header = $this->_normaliseHeader($header); $this->_expected_value = $value; } /** * Accessor for subclases. * @return mixed Expectation set in constructor. * @access protected */ function _getExpectation() { return $this->_expected_value; } /** * Removes whitespace at ends and case variations. * @param string $header Name of header. * @param string Trimmed and lowecased header * name. * @access private */ function _normaliseHeader($header) { return strtolower(trim($header)); } /** * Tests the expectation. True if it matches * a string value or an array value in any order. * @param mixed $compare Raw header block to search. * @return boolean True if header present. * @access public */ function test($compare) { return is_string($this->_findHeader($compare)); } /** * Searches the incoming result. Will extract the matching * line as text. * @param mixed $compare Raw header block to search. * @return string Matching header line. * @access protected */ function _findHeader($compare) { $lines = split("\r\n", $compare); foreach ($lines as $line) { if ($this->_testHeaderLine($line)) { return $line; } } return false; } /** * Compares a single header line against the expectation. * @param string $line A single line to compare. * @return boolean True if matched. * @access private */ function _testHeaderLine($line) { if (count($parsed = split(':', $line)) < 2) { return false; } list($header, $value) = $parsed; if ($this->_normaliseHeader($header) != $this->_expected_header) { return false; } return $this->_testHeaderValue($value, $this->_expected_value); } /** * Tests the value part of the header. * @param string $value Value to test. * @param mixed $expected Value to test against. * @return boolean True if matched. * @access protected */ function _testHeaderValue($value, $expected) { if ($expected === false) { return true; } return (trim($value) == trim($expected)); } /** * Returns a human readable test message. * @param mixed $compare Raw header block to search. * @return string Description of success * or failure. * @access public */ function testMessage($compare) { $expectation = $this->_expected_header; if ($this->_expected_value) { $expectation .= ': ' . $this->_expected_header; } if (is_string($line = $this->_findHeader($compare))) { return "Searching for header [$expectation] found [$line]"; } else { return "Failed to find header [$expectation]"; } } } /** * Test for a specific HTTP header within a header block that * should not be found. * @package SimpleTest * @subpackage WebTester */ class HttpUnwantedHeaderExpectation extends HttpHeaderExpectation { var $_expected_header; var $_expected_value; /** * Sets the field and value to compare against. * @param string $unwanted Case insenstive trimmed header name. */ function HttpUnwantedHeaderExpectation($unwanted) { $this->HttpHeaderExpectation($unwanted); } /** * Tests that the unwanted header is not found. * @param mixed $compare Raw header block to search. * @return boolean True if header present. * @access public */ function test($compare) { return ($this->_findHeader($compare) === false); } /** * Returns a human readable test message. * @param mixed $compare Raw header block to search. * @return string Description of success * or failure. * @access public */ function testMessage($compare) { $expectation = $this->_getExpectation(); if (is_string($line = $this->_findHeader($compare))) { return "Found unwanted header [$expectation] with [$line]"; } else { return "Did not find unwanted header [$expectation]"; } } } /** * Test for a specific HTTP header within a header block. * @package SimpleTest * @subpackage WebTester */ class HttpHeaderPatternExpectation extends HttpHeaderExpectation { /** * Sets the field and value to compare against. * @param string $header Case insenstive header name. * @param string $pattern Pattern to compare value against. * @access public */ function HttpHeaderPatternExpectation($header, $pattern) { $this->HttpHeaderExpectation($header, $pattern); } /** * Tests the value part of the header. * @param string $value Value to test. * @param mixed $pattern Pattern to test against. * @return boolean True if matched. * @access protected */ function _testHeaderValue($value, $expected) { return (boolean)preg_match($expected, trim($value)); } } /** * Test for a text substring. * @package SimpleTest * @subpackage UnitTester */ class WantedTextExpectation extends SimpleExpectation { var $_substring; /** * Sets the value to compare against. * @param string $substring Text to search for. * @param string $message Customised message on failure. * @access public */ function WantedTextExpectation($substring, $message = '%s') { $this->SimpleExpectation($message); $this->_substring = $substring; } /** * Accessor for the substring. * @return string Text to match. * @access protected */ function _getSubstring() { return $this->_substring; } /** * Tests the expectation. True if the text contains the * substring. * @param string $compare Comparison value. * @return boolean True if correct. * @access public */ function test($compare) { return (strpos($compare, $this->_substring) !== false); } /** * Returns a human readable test message. * @param mixed $compare Comparison value. * @return string Description of success * or failure. * @access public */ function testMessage($compare) { if ($this->test($compare)) { return $this->_describeTextMatch($this->_getSubstring(), $compare); } else { $dumper = &$this->_getDumper(); return "Text [" . $this->_getSubstring() . "] not detected in [" . $dumper->describeValue($compare) . "]"; } } /** * Describes a pattern match including the string * found and it's position. * @param string $substring Text to search for. * @param string $subject Subject to search. * @access protected */ function _describeTextMatch($substring, $subject) { $position = strpos($subject, $substring); $dumper = &$this->_getDumper(); return "Text [$substring] detected at character [$position] in [" . $dumper->describeValue($subject) . "] in region [" . $dumper->clipString($subject, 100, $position) . "]"; } } /** * Fail if a substring is detected within the * comparison text. * @package SimpleTest * @subpackage UnitTester */ class UnwantedTextExpectation extends WantedTextExpectation { /** * Sets the reject pattern * @param string $substring Text to search for. * @param string $message Customised message on failure. * @access public */ function UnwantedTextExpectation($substring, $message = '%s') { $this->WantedTextExpectation($substring, $message); } /** * Tests the expectation. False if the substring appears * in the text. * @param string $compare Comparison value. * @return boolean True if correct. * @access public */ function test($compare) { return ! parent::test($compare); } /** * Returns a human readable test message. * @param string $compare Comparison value. * @return string Description of success * or failure. * @access public */ function testMessage($compare) { if ($this->test($compare)) { $dumper = &$this->_getDumper(); return "Text [" . $this->_getSubstring() . "] not detected in [" . $dumper->describeValue($compare) . "]"; } else { return $this->_describeTextMatch($this->_getSubstring(), $compare); } } } /** * Extension that builds a web browser at the start of each * test. * @package SimpleTest * @subpackage WebTester */ class WebTestCaseInvoker extends SimpleInvokerDecorator { /** * Takes in the test case and reporter to mediate between. * @param SimpleTestCase $test_case Test case to run. * @param SimpleScorer $scorer Reporter to receive events. */ function WebTestCaseInvoker(&$invoker) { $this->SimpleInvokerDecorator($invoker); } /** * Builds the browser and runs the test. * @param string $method Test method to call. * @access public */ function invoke($method) { $test = &$this->getTestCase(); $test->setBrowser($test->createBrowser()); parent::invoke($method); $test->unsetBrowser(); } } /** * Test case for testing of web pages. Allows * fetching of pages, parsing of HTML and * submitting forms. * @package SimpleTest * @subpackage WebTester */ class WebTestCase extends SimpleTestCase { var $_browser; /** * Creates an empty test case. Should be subclassed * with test methods for a functional test case. * @param string $label Name of test case. Will use * the class name if none specified. * @access public */ function WebTestCase($label = false) { $this->SimpleTestCase($label); } /** * Sets the invoker to one that restarts the browser on * each request. * @return SimpleInvoker Invoker for each method. * @access public */ function &createInvoker() { return new WebTestCaseInvoker(parent::createInvoker()); } /** * Gets a current browser reference for setting * special expectations or for detailed * examination of page fetches. * @return SimpleBrowser Current test browser object. * @access public */ function &getBrowser() { return $this->_browser; } /** * Gets a current browser reference for setting * special expectations or for detailed * examination of page fetches. * @param SimpleBrowser $browser New test browser object. * @access public */ function setBrowser(&$browser) { return $this->_browser = &$browser; } /** * Clears the current browser reference to help the * PHP garbage collector. * @access public */ function unsetBrowser() { unset($this->_browser); } /** * Creates a new default web browser object. * Will be cleared at the end of the test method. * @return TestBrowser New browser. * @access public */ function &createBrowser() { return new SimpleBrowser(); } /** * Gets the last response error. * @return string Last low level HTTP error. * @access public */ function getTransportError() { return $this->_browser->getTransportError(); } /** * Accessor for the currently selected URL. * @return string Current location or false if * no page yet fetched. * @access public */ function getUrl() { return $this->_browser->getUrl(); } /** * Dumps the current request for debugging. * @access public */ function showRequest() { $this->dump($this->_browser->getRequest()); } /** * Dumps the current HTTP headers for debugging. * @access public */ function showHeaders() { $this->dump($this->_browser->getHeaders()); } /** * Dumps the current HTML source for debugging. * @access public */ function showSource() { $this->dump($this->_browser->getContent()); } /** * Simulates the closing and reopening of the browser. * Temporary cookies will be discarded and timed * cookies will be expired if later than the * specified time. * @param string/integer $date Time when session restarted. * If ommitted then all persistent * cookies are kept. Time is either * Cookie format string or timestamp. * @access public */ function restart($date = false) { if ($date === false) { $date = time(); } $this->_browser->restart($date); } /** * Moves cookie expiry times back into the past. * Useful for testing timeouts and expiries. * @param integer $interval Amount to age in seconds. * @access public */ function ageCookies($interval) { $this->_browser->ageCookies($interval); } /** * Disables frames support. Frames will not be fetched * and the frameset page will be used instead. * @access public */ function ignoreFrames() { $this->_browser->ignoreFrames(); } /** * Adds a header to every fetch. * @param string $header Header line to add to every * request until cleared. * @access public */ function addHeader($header) { $this->_browser->addHeader($header); } /** * Sets the maximum number of redirects before * the web page is loaded regardless. * @param integer $max Maximum hops. * @access public */ function setMaximumRedirects($max) { if (! $this->_browser) { trigger_error( 'Can only set maximum redirects in a test method, setUp() or tearDown()'); } $this->_browser->setMaximumRedirects($max); } /** * Sets the socket timeout for opening a connection and * receiving at least one byte of information. * @param integer $timeout Maximum time in seconds. * @access public */ function setConnectionTimeout($timeout) { $this->_browser->setConnectionTimeout($timeout); } /** * Sets proxy to use on all requests for when * testing from behind a firewall. Set URL * to false to disable. * @param string $proxy Proxy URL. * @param string $username Proxy username for authentication. * @param string $password Proxy password for authentication. * @access public */ function useProxy($proxy, $username = false, $password = false) { $this->_browser->useProxy($proxy, $username, $password); } /** * Fetches a page into the page buffer. If * there is no base for the URL then the * current base URL is used. After the fetch * the base URL reflects the new location. * @param string $url URL to fetch. * @param hash $parameters Optional additional GET data. * @return boolean True on success. * @access public */ function get($url, $parameters = false) { $content = $this->_browser->get($url, $parameters); if ($content === false) { return false; } return true; } /** * Fetches a page by POST into the page buffer. * If there is no base for the URL then the * current base URL is used. After the fetch * the base URL reflects the new location. * @param string $url URL to fetch. * @param hash $parameters Optional additional GET data. * @return boolean True on success. * @access public */ function post($url, $parameters = false) { $content = $this->_browser->post($url, $parameters); if ($content === false) { return false; } return true; } /** * Does a HTTP HEAD fetch, fetching only the page * headers. The current base URL is unchanged by this. * @param string $url URL to fetch. * @param hash $parameters Optional additional GET data. * @return boolean True on success. * @access public */ function head($url, $parameters = false) { return $this->_browser->head($url, $parameters); } /** * Equivalent to hitting the retry button on the * browser. Will attempt to repeat the page fetch. * @return boolean True if fetch succeeded. * @access public */ function retry() { return $this->_browser->retry(); } /** * Equivalent to hitting the back button on the * browser. * @return boolean True if history entry and * fetch succeeded. * @access public */ function back() { return $this->_browser->back(); } /** * Equivalent to hitting the forward button on the * browser. * @return boolean True if history entry and * fetch succeeded. * @access public */ function forward() { return $this->_browser->forward(); } /** * Retries a request after setting the authentication * for the current realm. * @param string $username Username for realm. * @param string $password Password for realm. * @return boolean True if successful fetch. Note * that authentication may still have * failed. * @access public */ function authenticate($username, $password) { return $this->_browser->authenticate($username, $password); } /** * Gets the cookie value for the current browser context. * @param string $name Name of cookie. * @return string Value of cookie or false if unset. * @access public */ function getCookie($name) { return $this->_browser->getCurrentCookieValue($name); } /** * Sets a cookie in the current browser. * @param string $name Name of cookie. * @param string $value Cookie value. * @param string $host Host upon which the cookie is valid. * @param string $path Cookie path if not host wide. * @param string $expiry Expiry date. * @access public */ function setCookie($name, $value, $host = false, $path = "/", $expiry = false) { $this->_browser->setCookie($name, $value, $host, $path, $expiry); } /** * Accessor for current frame focus. Will be * false if no frame has focus. * @return integer/string/boolean Label if any, otherwise * the position in the frameset * or false if none. * @access public */ function getFrameFocus() { return $this->_browser->getFrameFocus(); } /** * Sets the focus by index. The integer index starts from 1. * @param integer $choice Chosen frame. * @return boolean True if frame exists. * @access public */ function setFrameFocusByIndex($choice) { return $this->_browser->setFrameFocusByIndex($choice); } /** * Sets the focus by name. * @param string $name Chosen frame. * @return boolean True if frame exists. * @access public */ function setFrameFocus($name) { return $this->_browser->setFrameFocus($name); } /** * Clears the frame focus. All frames will be searched * for content. * @access public */ function clearFrameFocus() { return $this->_browser->clearFrameFocus(); } /** * Clicks the submit button by label. The owning * form will be submitted by this. * @param string $label Button label. An unlabeled * button can be triggered by 'Submit'. * @param hash $additional Additional form values. * @return boolean/string Page on success. * @access public */ function clickSubmit($label = 'Submit', $additional = false) { return $this->_browser->clickSubmit($label, $additional); } /** * Clicks the submit button by name attribute. The owning * form will be submitted by this. * @param string $name Name attribute of button. * @param hash $additional Additional form values. * @return boolean/string Page on success. * @access public */ function clickSubmitByName($name, $additional = false) { return $this->_browser->clickSubmitByName($name, $additional); } /** * Clicks the submit button by ID attribute. The owning * form will be submitted by this. * @param string $id ID attribute of button. * @param hash $additional Additional form values. * @return boolean/string Page on success. * @access public */ function clickSubmitById($id, $additional = false) { return $this->_browser->clickSubmitById($id, $additional); } /** * Clicks the submit image by some kind of label. Usually * the alt tag or the nearest equivalent. The owning * form will be submitted by this. Clicking outside of * the boundary of the coordinates will result in * a failure. * @param string $label Alt attribute of button. * @param integer $x X-coordinate of imaginary click. * @param integer $y Y-coordinate of imaginary click. * @param hash $additional Additional form values. * @return boolean/string Page on success. * @access public */ function clickImage($label, $x = 1, $y = 1, $additional = false) { return $this->_browser->clickImage($label, $x, $y, $additional); } /** * Clicks the submit image by the name. Usually * the alt tag or the nearest equivalent. The owning * form will be submitted by this. Clicking outside of * the boundary of the coordinates will result in * a failure. * @param string $name Name attribute of button. * @param integer $x X-coordinate of imaginary click. * @param integer $y Y-coordinate of imaginary click. * @param hash $additional Additional form values. * @return boolean/string Page on success. * @access public */ function clickImageByName($name, $x = 1, $y = 1, $additional = false) { return $this->_browser->clickImageByName($name, $x, $y, $additional); } /** * Clicks the submit image by ID attribute. The owning * form will be submitted by this. Clicking outside of * the boundary of the coordinates will result in * a failure. * @param integer/string $id ID attribute of button. * @param integer $x X-coordinate of imaginary click. * @param integer $y Y-coordinate of imaginary click. * @param hash $additional Additional form values. * @return boolean/string Page on success. * @access public */ function clickImageById($id, $x = 1, $y = 1, $additional = false) { return $this->_browser->clickImageById($id, $x, $y, $additional); } /** * Submits a form by the ID. * @param string $id Form ID. No button information * is submitted this way. * @return boolean/string Page on success. * @access public */ function submitFormById($id) { return $this->_browser->submitFormById($id); } /** * Follows a link by name. Will click the first link * found with this link text by default, or a later * one if an index is given. Match is case insensitive * with normalised space. * @param string $label Text between the anchor tags. * @param integer $index Link position counting from zero. * @return boolean/string Page on success. * @access public */ function clickLink($label, $index = 0) { return $this->_browser->clickLink($label, $index); } /** * Follows a link by id attribute. * @param string $id ID attribute value. * @return boolean/string Page on success. * @access public */ function clickLinkById($id) { return $this->_browser->clickLinkById($id); } /** * Tests for the presence of a link label. Match is * case insensitive with normalised space. * @param string $label Text between the anchor tags. * @param string $message Message to display. Default * can be embedded with %s. * @return boolean True if link present. * @access public */ function assertLink($label, $message = "%s") { return $this->assertTrue( $this->_browser->isLink($label), sprintf($message, "Link [$label] should exist")); } /** * Tests for the non-presence of a link label. Match is * case insensitive with normalised space. * @param string/integer $label Text between the anchor tags * or ID attribute. * @param string $message Message to display. Default * can be embedded with %s. * @return boolean True if link missing. * @access public */ function assertNoLink($label, $message = "%s") { return $this->assertFalse( $this->_browser->isLink($label), sprintf($message, "Link [$label] should not exist")); } /** * Tests for the presence of a link id attribute. * @param string $id Id attribute value. * @param string $message Message to display. Default * can be embedded with %s. * @return boolean True if link present. * @access public */ function assertLinkById($id, $message = "%s") { return $this->assertTrue( $this->_browser->isLinkById($id), sprintf($message, "Link ID [$id] should exist")); } /** * Tests for the non-presence of a link label. Match is * case insensitive with normalised space. * @param string $id Id attribute value. * @param string $message Message to display. Default * can be embedded with %s. * @return boolean True if link missing. * @access public */ function assertNoLinkById($id, $message = "%s") { return $this->assertFalse( $this->_browser->isLinkById($id), sprintf($message, "Link ID [$id] should not exist")); } /** * Sets all form fields with that name. * @param string $name Name of field in forms. * @param string $value New value of field. * @return boolean True if field exists, otherwise false. * @access public */ function setField($name, $value) { return $this->_browser->setField($name, $value); } /** * Sets all form fields with that name. * @param string/integer $id Id of field in forms. * @param string $value New value of field. * @return boolean True if field exists, otherwise false. * @access public */ function setFieldById($id, $value) { return $this->_browser->setFieldById($id, $value); } /** * Confirms that the form element is currently set * to the expected value. A missing form will always * fail. If no value is given then only the existence * of the field is checked. * @param string $name Name of field in forms. * @param mixed $expected Expected string/array value or * false for unset fields. * @param string $message Message to display. Default * can be embedded with %s. * @return boolean True if pass. * @access public */ function assertField($name, $expected = true, $message = "%s") { $value = $this->_browser->getField($name); if ($expected === true) { return $this->assertTrue( isset($value), sprintf($message, "Field [$name] should exist")); } else { return $this->assertExpectation( new FieldExpectation($expected), $value, sprintf($message, "Field [$name] should match with [%s]")); } } /** * Confirms that the form element is currently set * to the expected value. A missing form will always * fail. If no ID is given then only the existence * of the field is checked. * @param string/integer $id Name of field in forms. * @param mixed $expected Expected string/array value or * false for unset fields. * @param string $message Message to display. Default * can be embedded with %s. * @return boolean True if pass. * @access public */ function assertFieldById($id, $expected = true, $message = "%s") { $value = $this->_browser->getFieldById($id); if ($expected === true) { return $this->assertTrue( isset($value), sprintf($message, "Field of ID [$id] should exist")); } else { return $this->assertExpectation( new FieldExpectation($expected), $value, sprintf($message, "Field of ID [$id] should match with [%s]")); } } /** * Checks the response code against a list * of possible values. * @param array $responses Possible responses for a pass. * @param string $message Message to display. Default * can be embedded with %s. * @return boolean True if pass. * @access public */ function assertResponse($responses, $message = '%s') { $responses = (is_array($responses) ? $responses : array($responses)); $code = $this->_browser->getResponseCode(); $message = sprintf($message, "Expecting response in [" . implode(", ", $responses) . "] got [$code]"); return $this->assertTrue(in_array($code, $responses), $message); } /** * Checks the mime type against a list * of possible values. * @param array $types Possible mime types for a pass. * @param string $message Message to display. * @return boolean True if pass. * @access public */ function assertMime($types, $message = '%s') { $types = (is_array($types) ? $types : array($types)); $type = $this->_browser->getMimeType(); $message = sprintf($message, "Expecting mime type in [" . implode(", ", $types) . "] got [$type]"); return $this->assertTrue(in_array($type, $types), $message); } /** * Attempt to match the authentication type within * the security realm we are currently matching. * @param string $authentication Usually basic. * @param string $message Message to display. * @return boolean True if pass. * @access public */ function assertAuthentication($authentication = false, $message = '%s') { if (! $authentication) { $message = sprintf($message, "Expected any authentication type, got [" . $this->_browser->getAuthentication() . "]"); return $this->assertTrue( $this->_browser->getAuthentication(), $message); } else { $message = sprintf($message, "Expected authentication [$authentication] got [" . $this->_browser->getAuthentication() . "]"); return $this->assertTrue( strtolower($this->_browser->getAuthentication()) == strtolower($authentication), $message); } } /** * Checks that no authentication is necessary to view * the desired page. * @param string $message Message to display. * @return boolean True if pass. * @access public */ function assertNoAuthentication($message = '%s') { $message = sprintf($message, "Expected no authentication type, got [" . $this->_browser->getAuthentication() . "]"); return $this->assertFalse($this->_browser->getAuthentication(), $message); } /** * Attempts to match the current security realm. * @param string $realm Name of security realm. * @param string $message Message to display. * @return boolean True if pass. * @access public */ function assertRealm($realm, $message = '%s') { $message = sprintf($message, "Expected realm [$realm] got [" . $this->_browser->getRealm() . "]"); return $this->assertTrue( strtolower($this->_browser->getRealm()) == strtolower($realm), $message); } /** * Checks each header line for the required value. If no * value is given then only an existence check is made. * @param string $header Case insensitive header name. * @param string $value Case sensitive trimmed string to * match against. * @return boolean True if pass. * @access public */ function assertHeader($header, $value = false, $message = '%s') { return $this->assertExpectation( new HttpHeaderExpectation($header, $value), $this->_browser->getHeaders(), $message); } /** * Checks each header line for the required pattern. * @param string $header Case insensitive header name. * @param string $pattern Pattern to match value against. * @return boolean True if pass. * @access public */ function assertHeaderPattern($header, $pattern, $message = '%s') { return $this->assertExpectation( new HttpHeaderPatternExpectation($header, $pattern), $this->_browser->getHeaders(), $message); } /** * Confirms that the header type has not been received. * Only the landing page is checked. If you want to check * redirect pages, then you should limit redirects so * as to capture the page you want. * @param string $header Case insensitive header name. * @return boolean True if pass. * @access public */ function assertNoUnwantedHeader($header, $message = '%s') { return $this->assertExpectation( new HttpUnwantedHeaderExpectation($header), $this->_browser->getHeaders(), $message); } /** * Tests the text between the title tags. * @param string $title Expected title or empty * if expecting no title. * @param string $message Message to display. * @return boolean True if pass. * @access public */ function assertTitle($title = false, $message = '%s') { return $this->assertTrue( $title === $this->_browser->getTitle(), sprintf($message, "Expecting title [$title] got [" . $this->_browser->getTitle() . "]")); } /** * Will trigger a pass if the text is found in the plain * text form of the page. * @param string $text Text to look for. * @param string $message Message to display. * @return boolean True if pass. * @access public */ function assertWantedText($text, $message = '%s') { return $this->assertExpectation( new WantedTextExpectation($text), $this->_browser->getContentAsText(), $message); } /** * Will trigger a pass if the text is not found in the plain * text form of the page. * @param string $text Text to look for. * @param string $message Message to display. * @return boolean True if pass. * @access public */ function assertNoUnwantedText($text, $message = '%s') { return $this->assertExpectation( new UnwantedTextExpectation($text), $this->_browser->getContentAsText(), $message); } /** * Will trigger a pass if the Perl regex pattern * is found in the raw content. * @param string $pattern Perl regex to look for including * the regex delimiters. * @param string $message Message to display. * @return boolean True if pass. * @access public */ function assertWantedPattern($pattern, $message = '%s') { return $this->assertExpectation( new WantedPatternExpectation($pattern), $this->_browser->getContent(), $message); } /** * Will trigger a pass if the perl regex pattern * is not present in raw content. * @param string $pattern Perl regex to look for including * the regex delimiters. * @param string $message Message to display. * @return boolean True if pass. * @access public */ function assertNoUnwantedPattern($pattern, $message = '%s') { return $this->assertExpectation( new UnwantedPatternExpectation($pattern), $this->_browser->getContent(), $message); } /** * Checks that a cookie is set for the current page * and optionally checks the value. * @param string $name Name of cookie to test. * @param string $expected Expected value as a string or * false if any value will do. * @param string $message Message to display. * @return boolean True if pass. * @access public */ function assertCookie($name, $expected = false, $message = '%s') { $value = $this->getCookie($name); if ($expected) { return $this->assertTrue($value === $expected, sprintf( $message, "Expecting cookie [$name] value [$expected], got [$value]")); } else { return $this->assertTrue( $value, sprintf($message, "Expecting cookie [$name]")); } } /** * Checks that no cookie is present or that it has * been successfully cleared. * @param string $name Name of cookie to test. * @param string $message Message to display. * @return boolean True if pass. * @access public */ function assertNoCookie($name, $message = '%s') { return $this->assertTrue( $this->getCookie($name) === false, sprintf($message, "Not expecting cookie [$name]")); } } ?>pgfouine-1.2/tests/simpletest/simple_test.php0000644000175000017500000004647310334504436020200 0ustar acmeacme_label = $label ? $label : get_class($this); $this->_runner = false; } /** * Accessor for the test name for subclasses. * @return string Name of the test. * @access public */ function getLabel() { return $this->_label; } /** * Used to invoke the single tests. * @return SimpleInvoker Individual test runner. * @access public */ function &createInvoker() { return new SimpleErrorTrappingInvoker(new SimpleInvoker($this)); } /** * Can modify the incoming reporter so as to run * the tests differently. This version simply * passes it straight through. * @param SimpleReporter $reporter Incoming observer. * @return SimpleReporter * @access protected */ function &_createRunner(&$reporter) { return new SimpleRunner($this, $reporter); } /** * Uses reflection to run every method within itself * starting with the string "test" unless a method * is specified. * @param SimpleReporter $reporter Current test reporter. * @access public */ function run(&$reporter) { $reporter->paintCaseStart($this->getLabel()); $this->_runner = &$this->_createRunner($reporter); $this->_runner->run(); $reporter->paintCaseEnd($this->getLabel()); return $reporter->getStatus(); } /** * Sets up unit test wide variables at the start * of each test method. To be overridden in * actual user test cases. * @access public */ function setUp() { } /** * Clears the data set in the setUp() method call. * To be overridden by the user in actual user test cases. * @access public */ function tearDown() { } /** * Sends a pass event with a message. * @param string $message Message to send. * @access public */ function pass($message = "Pass") { $this->_runner->paintPass($message . $this->getAssertionLine(' at line [%d]')); } /** * Sends a fail event with a message. * @param string $message Message to send. * @access public */ function fail($message = "Fail") { $this->_runner->paintFail($message . $this->getAssertionLine(' at line [%d]')); } /** * Formats a PHP error and dispatches it to the * runner. * @param integer $severity PHP error code. * @param string $message Text of error. * @param string $file File error occoured in. * @param integer $line Line number of error. * @param hash $globals PHP super global arrays. * @access public */ function error($severity, $message, $file, $line, $globals) { $severity = SimpleErrorQueue::getSeverityAsString($severity); $this->_runner->paintError( "Unexpected PHP error [$message] severity [$severity] in [$file] line [$line]"); } /** * Sends a user defined event to the test runner. * This is for small scale extension where * both the test case and either the runner or * display are subclassed. * @param string $type Type of event. * @param mixed $payload Object or message to deliver. * @access public */ function signal($type, &$payload) { $this->_runner->paintSignal($type, $payload); } /** * Cancels any outstanding errors. * @access public */ function swallowErrors() { $queue = &SimpleErrorQueue::instance(); $queue->clear(); } /** * Runs an expectation directly, for extending the * tests with new expectation classes. * @param SimpleExpectation $expectation Expectation subclass. * @param mixed $test_value Value to compare. * @param string $message Message to display. * @return boolean True on pass * @access public */ function assertExpectation(&$expectation, $test_value, $message = '%s') { return $this->assertTrue( $expectation->test($test_value), sprintf($message, $expectation->overlayMessage($test_value))); } /** * Called from within the test methods to register * passes and failures. * @param boolean $result Pass on true. * @param string $message Message to display describing * the test state. * @return boolean True on pass * @access public */ function assertTrue($result, $message = false) { if (! $message) { $message = 'True assertion got ' . ($result ? 'True' : 'False'); } if ($result) { $this->pass($message); return true; } else { $this->fail($message); return false; } } /** * Will be true on false and vice versa. False * is the PHP definition of false, so that null, * empty strings, zero and an empty array all count * as false. * @param boolean $result Pass on false. * @param string $message Message to display. * @return boolean True on pass * @access public */ function assertFalse($result, $message = false) { if (! $message) { $message = 'False assertion got ' . ($result ? 'True' : 'False'); } return $this->assertTrue(! $result, $message); } /** * Uses a stack trace to find the line of an assertion. * @param string $format String formatting. * @param array $stack Stack frames top most first. Only * needed if not using the PHP * backtrace function. * @return string Line number of first assert* * method embedded in format string. * @access public */ function getAssertionLine($format = '%d', $stack = false) { if ($stack === false) { $stack = SimpleTestCompatibility::getStackTrace(); } return SimpleDumper::getFormattedAssertionLine($stack, $format); } /** * Sends a formatted dump of a variable to the * test suite for those emergency debugging * situations. * @param mixed $variable Variable to display. * @param string $message Message to display. * @return mixed The original variable. * @access public */ function dump($variable, $message = false) { $formatted = SimpleDumper::dump($variable); if ($message) { $formatted = $message . "\n" . $formatted; } $this->_runner->paintFormattedMessage($formatted); return $variable; } /** * Dispatches a text message straight to the * test suite. Useful for status bar displays. * @param string $message Message to show. * @access public */ function sendMessage($message) { $this->_runner->PaintMessage($message); } /** * Accessor for the number of subtests. * @return integer Number of test cases. * @access public * @static */ function getSize() { return 1; } } /** * This is a composite test class for combining * test cases and other RunnableTest classes into * a group test. * @package SimpleTest * @subpackage UnitTester */ class GroupTest { var $_label; var $_test_cases; var $_old_track_errors; var $_xdebug_is_enabled; /** * Sets the name of the test suite. * @param string $label Name sent at the start and end * of the test. * @access public */ function GroupTest($label) { $this->_label = $label; $this->_test_cases = array(); $this->_old_track_errors = ini_get('track_errors'); $this->_xdebug_is_enabled = function_exists('xdebug_is_enabled') ? xdebug_is_enabled() : false; } /** * Accessor for the test name for subclasses. * @return string Name of the test. * @access public */ function getLabel() { return $this->_label; } /** * Adds a test into the suite. Can be either a group * test or some other unit test. * @param SimpleTestCase $test_case Suite or individual test * case implementing the * runnable test interface. * @access public */ function addTestCase(&$test_case) { $this->_test_cases[] = &$test_case; } /** * Adds a test into the suite by class name. The class will * be instantiated as needed. * @param SimpleTestCase $test_case Suite or individual test * case implementing the * runnable test interface. * @access public */ function addTestClass($class) { $this->_test_cases[] = $class; } /** * Builds a group test from a library of test cases. * The new group is composed into this one. * @param string $test_file File name of library with * test case classes. * @access public */ function addTestFile($test_file) { $existing_classes = get_declared_classes(); if ($error = $this->_requireWithError($test_file)) { $this->addTestCase(new BadGroupTest($test_file, $error)); return; } $classes = $this->_selectRunnableTests($existing_classes, get_declared_classes()); if (count($classes) == 0) { $this->addTestCase(new BadGroupTest($test_file, 'No new test cases')); return; } $this->addTestCase($this->_createGroupFromClasses($test_file, $classes)); } /** * Requires a source file recording any syntax errors. * @param string $file File name to require in. * @return string/boolean An error message on failure or false * if no errors. * @access private */ function _requireWithError($file) { $this->_enableErrorReporting(); include($file); $error = isset($php_errormsg) ? $php_errormsg : false; $this->_disableErrorReporting(); $self_inflicted = array( 'Assigning the return value of new by reference is deprecated', 'var: Deprecated. Please use the public/private/protected modifiers'); if (in_array($error, $self_inflicted)) { return false; } return $error; } /** * Sets up detection of parse errors. Note that XDebug * interferes with this and has to be disabled. This is * to make sure the correct error code is returned * from unattended scripts. * @access private */ function _enableErrorReporting() { if ($this->_xdebug_is_enabled) { xdebug_disable(); } ini_set('track_errors', true); } /** * Resets detection of parse errors to their old values. * This is to make sure the correct error code is returned * from unattended scripts. * @access private */ function _disableErrorReporting() { ini_set('track_errors', $this->_old_track_errors); if ($this->_xdebug_is_enabled) { xdebug_enable(); } } /** * Calculates the incoming test cases from a before * and after list of loaded classes. * @param array $existing_classes Classes before require(). * @param array $new_classes Classes after require(). * @return array New classes which are test * cases that shouldn't be ignored. * @access private */ function _selectRunnableTests($existing_classes, $new_classes) { $classes = array(); foreach ($new_classes as $class) { if (in_array($class, $existing_classes)) { continue; } if (! $this->_isTestCase($class)) { continue; } $classes[] = $class; } return $classes; } /** * Builds a group test from a class list. * @param string $title Title of new group. * @param array $classes Test classes. * @return GroupTest Group loaded with the new * test cases. * @access private */ function _createGroupFromClasses($title, $classes) { $group = new GroupTest($title); foreach ($classes as $class) { if (SimpleTestOptions::isIgnored($class)) { continue; } $group->addTestClass($class); } return $group; } /** * Test to see if a class is derived from the * TestCase class. * @param string $class Class name. * @access private */ function _isTestCase($class) { while ($class = get_parent_class($class)) { $class = strtolower($class); if ($class == "simpletestcase" || $class == "grouptest") { return true; } } return false; } /** * Invokes run() on all of the held test cases, instantiating * them if necessary. * @param SimpleReporter $reporter Current test reporter. * @access public */ function run(&$reporter) { $reporter->paintGroupStart($this->getLabel(), $this->getSize()); for ($i = 0, $count = count($this->_test_cases); $i < $count; $i++) { if (is_string($this->_test_cases[$i])) { $class = $this->_test_cases[$i]; $test = &new $class(); $test->run($reporter); } else { $this->_test_cases[$i]->run($reporter); } } $reporter->paintGroupEnd($this->getLabel()); return $reporter->getStatus(); } /** * Number of contained test cases. * @return integer Total count of cases in the group. * @access public */ function getSize() { $count = 0; foreach ($this->_test_cases as $case) { if (is_string($case)) { $count++; } else { $count += $case->getSize(); } } return $count; } } /** * This is a failing group test for when a test suite hasn't * loaded properly. * @package SimpleTest * @subpackage UnitTester */ class BadGroupTest { var $_label; var $_error; /** * Sets the name of the test suite and error message. * @param string $label Name sent at the start and end * of the test. * @access public */ function BadGroupTest($label, $error) { $this->_label = $label; $this->_error = $error; } /** * Accessor for the test name for subclasses. * @return string Name of the test. * @access public */ function getLabel() { return $this->_label; } /** * Sends a single error to the reporter. * @param SimpleReporter $reporter Current test reporter. * @access public */ function run(&$reporter) { $reporter->paintGroupStart($this->getLabel(), $this->getSize()); $reporter->paintFail('Bad GroupTest [' . $this->getLabel() . '] with error [' . $this->_error . ']'); $reporter->paintGroupEnd($this->getLabel()); return $reporter->getStatus(); } /** * Number of contained test cases. Always zero. * @return integer Total count of cases in the group. * @access public */ function getSize() { return 0; } } ?> pgfouine-1.2/tests/simpletest/runner.php0000644000175000017500000002300510334504436017143 0ustar acmeacme_test_case = &$test_case; } /** * Accessor for test case being run. * @return SimpleTestCase Test case. * @access public */ function &getTestCase() { return $this->_test_case; } /** * Invokes a test method and buffered with setUp() * and tearDown() calls. * @param string $method Test method to call. * @access public */ function invoke($method) { $this->_test_case->setUp(); $this->_test_case->$method(); $this->_test_case->tearDown(); } } /** * Do nothing decorator. Just passes the invocation * straight through. * @package SimpleTest * @subpackage UnitTester */ class SimpleInvokerDecorator { var $_invoker; /** * Stores the invoker to wrap. * @param SimpleInvoker $invoker Test method runner. */ function SimpleInvokerDecorator(&$invoker) { $this->_invoker = &$invoker; } /** * Accessor for test case being run. * @return SimpleTestCase Test case. * @access public */ function &getTestCase() { return $this->_invoker->getTestCase(); } /** * Invokes a test method and buffered with setUp() * and tearDown() calls. * @param string $method Test method to call. * @access public */ function invoke($method) { $this->_invoker->invoke($method); } } /** * Extension that traps errors into an error queue. * @package SimpleTest * @subpackage UnitTester */ class SimpleErrorTrappingInvoker extends SimpleInvokerDecorator { /** /** * Stores the invoker to wrap. * @param SimpleInvoker $invoker Test method runner. */ function SimpleErrorTrappingInvoker(&$invoker) { $this->SimpleInvokerDecorator($invoker); } /** * Invokes a test method and dispatches any * untrapped errors. Called back from * the visiting runner. * @param string $method Test method to call. * @access public */ function invoke($method) { set_error_handler('simpleTestErrorHandler'); parent::invoke($method); $queue = &SimpleErrorQueue::instance(); while (list($severity, $message, $file, $line, $globals) = $queue->extract()) { $test_case = &$this->getTestCase(); $test_case->error($severity, $message, $file, $line, $globals); } restore_error_handler(); } } /** * The standard runner. Will run every method starting * with test Basically the * Mediator pattern. * @package SimpleTest * @subpackage UnitTester */ class SimpleRunner { var $_test_case; var $_scorer; /** * Takes in the test case and reporter to mediate between. * @param SimpleTestCase $test_case Test case to run. * @param SimpleScorer $scorer Reporter to receive events. */ function SimpleRunner(&$test_case, &$scorer) { $this->_test_case = &$test_case; $this->_scorer = &$scorer; } /** * Accessor for test case being run. * @return SimpleTestCase Test case. * @access public */ function &getTestCase() { return $this->_test_case; } /** * Runs the test methods in the test case. * @param SimpleTest $test_case Test case to run test on. * @param string $method Name of test method. * @access public */ function run() { $methods = get_class_methods(get_class($this->_test_case)); $invoker = &$this->_test_case->createInvoker(); foreach ($methods as $method) { if (! $this->_isTest($method)) { continue; } if ($this->_isConstructor($method)) { continue; } $this->_scorer->paintMethodStart($method); if ($this->_scorer->shouldInvoke($this->_test_case->getLabel(), $method)) { $invoker->invoke($method); } $this->_scorer->paintMethodEnd($method); } } /** * Tests to see if the method is the constructor and * so should be ignored. * @param string $method Method name to try. * @return boolean True if constructor. * @access protected */ function _isConstructor($method) { return SimpleTestCompatibility::isA( $this->_test_case, strtolower($method)); } /** * Tests to see if the method is a test that should * be run. Currently any method that starts with 'test' * is a candidate. * @param string $method Method name to try. * @return boolean True if test method. * @access protected */ function _isTest($method) { return strtolower(substr($method, 0, 4)) == 'test'; } /** * Paints the start of a test method. * @param string $test_name Name of test or other label. * @access public */ function paintMethodStart($test_name) { $this->_scorer->paintMethodStart($test_name); } /** * Paints the end of a test method. * @param string $test_name Name of test or other label. * @access public */ function paintMethodEnd($test_name) { $this->_scorer->paintMethodEnd($test_name); } /** * Chains to the wrapped reporter. * @param string $message Message is ignored. * @access public */ function paintPass($message) { $this->_scorer->paintPass($message); } /** * Chains to the wrapped reporter. * @param string $message Message is ignored. * @access public */ function paintFail($message) { $this->_scorer->paintFail($message); } /** * Chains to the wrapped reporter. * @param string $message Text of error formatted by * the test case. * @access public */ function paintError($message) { $this->_scorer->paintError($message); } /** * Chains to the wrapped reporter. * @param Exception $exception Object thrown. * @access public */ function paintException($exception) { $this->_scorer->paintException($exception); } /** * Chains to the wrapped reporter. * @param string $message Text to display. * @access public */ function paintMessage($message) { $this->_scorer->paintMessage($message); } /** * Chains to the wrapped reporter. * @param string $message Text to display. * @access public */ function paintFormattedMessage($message) { $this->_scorer->paintFormattedMessage($message); } /** * Chains to the wrapped reporter. * @param string $type Event type as text. * @param mixed $payload Message or object. * @return boolean Should return false if this * type of signal should fail the * test suite. * @access public */ function paintSignal($type, &$payload) { $this->_scorer->paintSignal($type, $payload); } } ?> pgfouine-1.2/tests/simpletest/encoding.php0000644000175000017500000001152010334504436017417 0ustar acmeacme_request = array(); $this->setCoordinates(); $this->merge($query); } /** * Adds a parameter to the query. * @param string $key Key to add value to. * @param string/array $value New data. * @access public */ function add($key, $value) { if ($value === false) { return; } if (! isset($this->_request[$key])) { $this->_request[$key] = array(); } if (is_array($value)) { foreach ($value as $item) { $this->_request[$key][] = $item; } } else { $this->_request[$key][] = $value; } } /** * Adds a set of parameters to this query. * @param array/SimpleQueryString $query Multiple values are * as lists on a single key. * @access public */ function merge($query) { if (is_object($query)) { foreach ($query->getKeys() as $key) { $this->add($key, $query->getValue($key)); } if ($query->getX() !== false) { $this->setCoordinates($query->getX(), $query->getY()); } } elseif (is_array($query)) { foreach ($query as $key => $value) { $this->add($key, $value); } } } /** * Sets image coordinates. Set to false to clear * them. * @param integer $x Horizontal position. * @param integer $y Vertical position. * @access public */ function setCoordinates($x = false, $y = false) { if (($x === false) || ($y === false)) { $this->_x = $this->_y = false; return; } $this->_x = (integer)$x; $this->_y = (integer)$y; } /** * Accessor for horizontal image coordinate. * @return integer X value. * @access public */ function getX() { return $this->_x; } /** * Accessor for vertical image coordinate. * @return integer Y value. * @access public */ function getY() { return $this->_y; } /** * Accessor for single value. * @return string/array False if missing, string * if present and array if * multiple entries. * @access public */ function getValue($key) { if (! isset($this->_request[$key])) { return false; } elseif (count($this->_request[$key]) == 1) { return $this->_request[$key][0]; } else { return $this->_request[$key]; } } /** * Accessor for key list. * @return array List of keys present. * @access public */ function getKeys() { return array_keys($this->_request); } /** * Renders the query string as a URL encoded * request part. * @return string Part of URL. * @access public */ function asString() { $statements = array(); foreach ($this->_request as $key => $values) { foreach ($values as $value) { $statements[] = "$key=" . urlencode($value); } } $coords = ($this->_x !== false) ? '?' . $this->_x . ',' . $this->_y : ''; return implode('&', $statements) . $coords; } } ?>pgfouine-1.2/tests/simpletest/browser.php0000644000175000017500000011135110334504436017317 0ustar acmeacme_sequence = array(); $this->_position = -1; } /** * Test for no entries yet. * @return boolean True if empty. * @access private */ function _isEmpty() { return ($this->_position == -1); } /** * Test for being at the beginning. * @return boolean True if first. * @access private */ function _atBeginning() { return ($this->_position == 0) && ! $this->_isEmpty(); } /** * Test for being at the last entry. * @return boolean True if last. * @access private */ function _atEnd() { return ($this->_position + 1 >= count($this->_sequence)) && ! $this->_isEmpty(); } /** * Adds a successfully fetched page to the history. * @param string $method GET or POST. * @param SimpleUrl $url URL of fetch. * @param SimpleFormEncoding $parameters Any post data with the fetch. * @access public */ function recordEntry($method, $url, $parameters) { $this->_dropFuture(); array_push( $this->_sequence, array('method' => $method, 'url' => $url, 'parameters' => $parameters)); $this->_position++; } /** * Last fetching method for current history * position. * @return string GET or POST for this point in * the history. * @access public */ function getMethod() { if ($this->_isEmpty()) { return false; } return $this->_sequence[$this->_position]['method']; } /** * Last fully qualified URL for current history * position. * @return SimpleUrl URL for this position. * @access public */ function getUrl() { if ($this->_isEmpty()) { return false; } return $this->_sequence[$this->_position]['url']; } /** * Parameters of last fetch from current history * position. * @return SimpleFormEncoding Post parameters. * @access public */ function getParameters() { if ($this->_isEmpty()) { return false; } return $this->_sequence[$this->_position]['parameters']; } /** * Step back one place in the history. Stops at * the first page. * @return boolean True if any previous entries. * @access public */ function back() { if ($this->_isEmpty() || $this->_atBeginning()) { return false; } $this->_position--; return true; } /** * Step forward one place. If already at the * latest entry then nothing will happen. * @return boolean True if any future entries. * @access public */ function forward() { if ($this->_isEmpty() || $this->_atEnd()) { return false; } $this->_position++; return true; } /** * Ditches all future entries beyond the current * point. * @access private */ function _dropFuture() { if ($this->_isEmpty()) { return; } while (! $this->_atEnd()) { array_pop($this->_sequence); } } } /** * Simulated web browser. This is an aggregate of * the user agent, the HTML parsing, request history * and the last header set. * @package SimpleTest * @subpackage WebTester */ class SimpleBrowser { var $_user_agent; var $_page; var $_history; var $_ignore_frames; var $_maximum_nested_frames; /** * Starts with a fresh browser with no * cookie or any other state information. The * exception is that a default proxy will be * set up if specified in the options. * @access public */ function SimpleBrowser() { $this->_user_agent = &$this->_createUserAgent(); $this->_user_agent->useProxy( SimpleTestOptions::getDefaultProxy(), SimpleTestOptions::getDefaultProxyUsername(), SimpleTestOptions::getDefaultProxyPassword()); $this->_page = &new SimplePage(); $this->_history = &$this->_createHistory(); $this->_ignore_frames = false; $this->_maximum_nested_frames = DEFAULT_MAX_NESTED_FRAMES; } /** * Creates the underlying user agent. * @return SimpleFetcher Content fetcher. * @access protected */ function &_createUserAgent() { return new SimpleUserAgent(); } /** * Creates a new empty history list. * @return SimpleBrowserHistory New list. * @access protected */ function &_createHistory() { return new SimpleBrowserHistory(); } /** * Disables frames support. Frames will not be fetched * and the frameset page will be used instead. * @access public */ function ignoreFrames() { $this->_ignore_frames = true; } /** * Enables frames support. Frames will be fetched from * now on. * @access public */ function useFrames() { $this->_ignore_frames = false; } /** * Parses the raw content into a page. Will load further * frame pages unless frames are disabled. * @param SimpleHttpResponse $response Response from fetch. * @param integer $depth Nested frameset depth. * @return SimplePage Parsed HTML. * @access protected */ function &_parse($response, $depth = 0) { $builder = &new SimplePageBuilder(); $page = &$builder->parse($response); if ($this->_ignore_frames || ! $page->hasFrames() || ($depth > $this->_maximum_nested_frames)) { return $page; } $frameset = &new SimpleFrameset($page); foreach ($page->getFrameset() as $key => $url) { $frame = &$this->_fetch('GET', $url, array(), $depth + 1); $frameset->addFrame($frame, $key); } return $frameset; } /** * Fetches a page. * @param string $method GET or POST. * @param string/SimpleUrl $url Target to fetch as string. * @param SimpleFormEncoding $parameters POST parameters. * @param integer $depth Nested frameset depth protection. * @return SimplePage Parsed page. * @access private */ function &_fetch($method, $url, $parameters, $depth = 0) { $response = &$this->_user_agent->fetchResponse($method, $url, $parameters); if ($response->isError()) { return new SimplePage($response); } return $this->_parse($response, $depth); } /** * Fetches a page or a single frame if that is the current * focus. * @param string $method GET or POST. * @param string/SimpleUrl $url Target to fetch as string. * @param SimpleFormEncoding $parameters POST parameters. * @return string Raw content of page. * @access private */ function _load($method, $url, $parameters = false) { $frame = $url->getTarget(); if (! $frame || ! $this->_page->hasFrames() || (strtolower($frame) == '_top')) { return $this->_loadPage($method, $url, $parameters); } return $this->_loadFrame(array($frame), $method, $url, $parameters); } /** * Fetches a page and makes it the current page/frame. * @param string $method GET or POST. * @param string/SimpleUrl $url Target to fetch as string. * @param SimpleFormEncoding $parameters POST parameters. * @return string Raw content of page. * @access private */ function _loadPage($method, $url, $parameters = false) { $this->_page = &$this->_fetch(strtoupper($method), $url, $parameters); $this->_history->recordEntry( $this->_page->getMethod(), $this->_page->getUrl(), $this->_page->getRequestData()); return $this->_page->getRaw(); } /** * Fetches a frame into the existing frameset replacing the * original. * @param array $frames List of names to drill down. * @param string $method GET or POST. * @param string/SimpleUrl $url Target to fetch as string. * @param SimpleFormEncoding $parameters POST parameters. * @return string Raw content of page. * @access private */ function _loadFrame($frames, $method, $url, $parameters = false) { $page = &$this->_fetch(strtoupper($method), $url, $parameters); $this->_page->setFrame($frames, $page); } /** * Removes expired and temporary cookies as if * the browser was closed and re-opened. * @param string/integer $date Time when session restarted. * If omitted then all persistent * cookies are kept. * @access public */ function restart($date = false) { $this->_user_agent->restart($date); } /** * Adds a header to every fetch. * @param string $header Header line to add to every * request until cleared. * @access public */ function addHeader($header) { $this->_user_agent->addHeader($header); } /** * Ages the cookies by the specified time. * @param integer $interval Amount in seconds. * @access public */ function ageCookies($interval) { $this->_user_agent->ageCookies($interval); } /** * Sets an additional cookie. If a cookie has * the same name and path it is replaced. * @param string $name Cookie key. * @param string $value Value of cookie. * @param string $host Host upon which the cookie is valid. * @param string $path Cookie path if not host wide. * @param string $expiry Expiry date. * @access public */ function setCookie($name, $value, $host = false, $path = '/', $expiry = false) { $this->_user_agent->setCookie($name, $value, $host, $path, $expiry); } /** * Reads the most specific cookie value from the * browser cookies. * @param string $host Host to search. * @param string $path Applicable path. * @param string $name Name of cookie to read. * @return string False if not present, else the * value as a string. * @access public */ function getCookieValue($host, $path, $name) { return $this->_user_agent->getCookieValue($host, $path, $name); } /** * Reads the current cookies for the current URL. * @param string $name Key of cookie to find. * @return string Null if there is no current URL, false * if the cookie is not set. * @access public */ function getCurrentCookieValue($name) { return $this->_user_agent->getBaseCookieValue($name, $this->_page->getUrl()); } /** * Sets the maximum number of redirects before * a page will be loaded anyway. * @param integer $max Most hops allowed. * @access public */ function setMaximumRedirects($max) { $this->_user_agent->setMaximumRedirects($max); } /** * Sets the maximum number of nesting of framed pages * within a framed page to prevent loops. * @param integer $max Highest depth allowed. * @access public */ function setMaximumNestedFrames($max) { $this->_maximum_nested_frames = $max; } /** * Sets the socket timeout for opening a connection. * @param integer $timeout Maximum time in seconds. * @access public */ function setConnectionTimeout($timeout) { $this->_user_agent->setConnectionTimeout($timeout); } /** * Sets proxy to use on all requests for when * testing from behind a firewall. Set URL * to false to disable. * @param string $proxy Proxy URL. * @param string $username Proxy username for authentication. * @param string $password Proxy password for authentication. * @access public */ function useProxy($proxy, $username = false, $password = false) { $this->_user_agent->useProxy($proxy, $username, $password); } /** * Fetches the page content with a HEAD request. * Will affect cookies, but will not change the base URL. * @param string/SimpleUrl $url Target to fetch as string. * @param hash/SimpleFormEncoding $parameters Additional parameters for * HEAD request. * @return boolean True if successful. * @access public */ function head($url, $parameters = false) { if (! is_object($url)) { $url = new SimpleUrl($url); } if (is_array($parameters)) { $parameters = new SimpleFormEncoding($parameters); } if ($this->getUrl()) { $url = $url->makeAbsolute($this->getUrl()); } $response = &$this->_user_agent->fetchResponse( 'HEAD', $url, $parameters); return ! $response->isError(); } /** * Fetches the page content with a simple GET request. * @param string/SimpleUrl $url Target to fetch. * @param hash/SimpleFormEncoding $parameters Additional parameters for * GET request. * @return string Content of page or false. * @access public */ function get($url, $parameters = false) { if (! is_object($url)) { $url = new SimpleUrl($url); } if (is_array($parameters)) { $parameters = new SimpleFormEncoding($parameters); } if ($this->getUrl()) { $url = $url->makeAbsolute($this->getUrl()); } return $this->_load('GET', $url, $parameters); } /** * Fetches the page content with a POST request. * @param string/SimpleUrl $url Target to fetch as string. * @param hash/SimpleFormEncoding $parameters POST parameters. * @return string Content of page. * @access public */ function post($url, $parameters = false) { if (! is_object($url)) { $url = new SimpleUrl($url); } if (is_array($parameters)) { $parameters = new SimpleFormEncoding($parameters); } if ($this->getUrl()) { $url = $url->makeAbsolute($this->getUrl()); } return $this->_load('POST', $url, $parameters); } /** * Equivalent to hitting the retry button on the * browser. Will attempt to repeat the page fetch. If * there is no history to repeat it will give false. * @return string/boolean Content if fetch succeeded * else false. * @access public */ function retry() { $frames = $this->_page->getFrameFocus(); if (count($frames) > 0) { $this->_loadFrame( $frames, $this->_page->getMethod(), $this->_page->getUrl(), $this->_page->getRequestData()); return $this->_page->getRaw(); } if ($method = $this->_history->getMethod()) { $this->_page = &$this->_fetch( $method, $this->_history->getUrl(), $this->_history->getParameters()); return $this->_page->getRaw(); } return false; } /** * Equivalent to hitting the back button on the * browser. The browser history is unchanged on * failure. * @return boolean True if history entry and * fetch succeeded * @access public */ function back() { if (! $this->_history->back()) { return false; } $content = $this->retry(); if (! $content) { $this->_history->forward(); } return $content; } /** * Equivalent to hitting the forward button on the * browser. The browser history is unchanged on * failure. * @return boolean True if history entry and * fetch succeeded * @access public */ function forward() { if (! $this->_history->forward()) { return false; } $content = $this->retry(); if (! $content) { $this->_history->back(); } return $content; } /** * Retries a request after setting the authentication * for the current realm. * @param string $username Username for realm. * @param string $password Password for realm. * @return boolean True if successful fetch. Note * that authentication may still have * failed. * @access public */ function authenticate($username, $password) { if (! $this->_page->getRealm()) { return false; } $url = $this->_page->getUrl(); if (! $url) { return false; } $this->_user_agent->setIdentity( $url->getHost(), $this->_page->getRealm(), $username, $password); return $this->retry(); } /** * Accessor for a breakdown of the frameset. * @return array Hash tree of frames by name * or index if no name. * @access public */ function getFrames() { return $this->_page->getFrames(); } /** * Accessor for current frame focus. Will be * false if no frame has focus. * @return integer/string/boolean Label if any, otherwise * the position in the frameset * or false if none. * @access public */ function getFrameFocus() { return $this->_page->getFrameFocus(); } /** * Sets the focus by index. The integer index starts from 1. * @param integer $choice Chosen frame. * @return boolean True if frame exists. * @access public */ function setFrameFocusByIndex($choice) { return $this->_page->setFrameFocusByIndex($choice); } /** * Sets the focus by name. * @param string $name Chosen frame. * @return boolean True if frame exists. * @access public */ function setFrameFocus($name) { return $this->_page->setFrameFocus($name); } /** * Clears the frame focus. All frames will be searched * for content. * @access public */ function clearFrameFocus() { return $this->_page->clearFrameFocus(); } /** * Accessor for last error. * @return string Error from last response. * @access public */ function getTransportError() { return $this->_page->getTransportError(); } /** * Accessor for current MIME type. * @return string MIME type as string; e.g. 'text/html' * @access public */ function getMimeType() { return $this->_page->getMimeType(); } /** * Accessor for last response code. * @return integer Last HTTP response code received. * @access public */ function getResponseCode() { return $this->_page->getResponseCode(); } /** * Accessor for last Authentication type. Only valid * straight after a challenge (401). * @return string Description of challenge type. * @access public */ function getAuthentication() { return $this->_page->getAuthentication(); } /** * Accessor for last Authentication realm. Only valid * straight after a challenge (401). * @return string Name of security realm. * @access public */ function getRealm() { return $this->_page->getRealm(); } /** * Accessor for current URL of page or frame if * focused. * @return string Location of current page or frame as * a string. */ function getUrl() { $url = $this->_page->getUrl(); return $url ? $url->asString() : false; } /** * Accessor for raw bytes sent down the wire. * @return string Original text sent. * @access public */ function getRequest() { return $this->_page->getRequest(); } /** * Accessor for raw header information. * @return string Header block. * @access public */ function getHeaders() { return $this->_page->getHeaders(); } /** * Accessor for raw page information. * @return string Original text content of web page. * @access public */ function getContent() { return $this->_page->getRaw(); } /** * Accessor for plain text version of the page. * @return string Normalised text representation. * @access public */ function getContentAsText() { return $this->_page->getText(); } /** * Accessor for parsed title. * @return string Title or false if no title is present. * @access public */ function getTitle() { return $this->_page->getTitle(); } /** * Accessor for a list of all fixed links in current page. * @return array List of urls with scheme of * http or https and hostname. * @access public */ function getAbsoluteUrls() { return $this->_page->getAbsoluteUrls(); } /** * Accessor for a list of all relative links. * @return array List of urls without hostname. * @access public */ function getRelativeUrls() { return $this->_page->getRelativeUrls(); } /** * Sets all form fields with that name. * @param string $name Name of field in forms. * @param string $value New value of field. * @return boolean True if field exists, otherwise false. * @access public */ function setField($name, $value) { return $this->_page->setField($name, $value); } /** * Sets all form fields with that id attribute. * @param string/integer $id Id of field in forms. * @param string $value New value of field. * @return boolean True if field exists, otherwise false. * @access public */ function setFieldById($id, $value) { return $this->_page->setFieldById($id, $value); } /** * Accessor for a form element value within the page. * Finds the first match. * @param string $name Field name. * @return string/boolean A string if the field is * present, false if unchecked * and null if missing. * @access public */ function getField($name) { return $this->_page->getField($name); } /** * Accessor for a form element value within the page. * @param string/integer $id Id of field in forms. * @return string/boolean A string if the field is * present, false if unchecked * and null if missing. * @access public */ function getFieldById($id) { return $this->_page->getFieldById($id); } /** * Clicks the submit button by label. The owning * form will be submitted by this. * @param string $label Button label. An unlabeled * button can be triggered by 'Submit'. * @param hash $additional Additional form data. * @return string/boolean Page on success. * @access public */ function clickSubmit($label = 'Submit', $additional = false) { if (! ($form = &$this->_page->getFormBySubmitLabel($label))) { return false; } $success = $this->_load( $form->getMethod(), $form->getAction(), $form->submitButtonByLabel($label, $additional)); return ($success ? $this->getContent() : $success); } /** * Clicks the submit button by name attribute. The owning * form will be submitted by this. * @param string $name Button name. * @param hash $additional Additional form data. * @return string/boolean Page on success. * @access public */ function clickSubmitByName($name, $additional = false) { if (! ($form = &$this->_page->getFormBySubmitName($name))) { return false; } $success = $this->_load( $form->getMethod(), $form->getAction(), $form->submitButtonByName($name, $additional)); return ($success ? $this->getContent() : $success); } /** * Clicks the submit button by ID attribute of the button * itself. The owning form will be submitted by this. * @param string $id Button ID. * @param hash $additional Additional form data. * @return string/boolean Page on success. * @access public */ function clickSubmitById($id, $additional = false) { if (! ($form = &$this->_page->getFormBySubmitId($id))) { return false; } $success = $this->_load( $form->getMethod(), $form->getAction(), $form->submitButtonById($id, $additional)); return ($success ? $this->getContent() : $success); } /** * Clicks the submit image by some kind of label. Usually * the alt tag or the nearest equivalent. The owning * form will be submitted by this. Clicking outside of * the boundary of the coordinates will result in * a failure. * @param string $label ID attribute of button. * @param integer $x X-coordinate of imaginary click. * @param integer $y Y-coordinate of imaginary click. * @param hash $additional Additional form data. * @return string/boolean Page on success. * @access public */ function clickImage($label, $x = 1, $y = 1, $additional = false) { if (! ($form = &$this->_page->getFormByImageLabel($label))) { return false; } $success = $this->_load( $form->getMethod(), $form->getAction(), $form->submitImageByLabel($label, $x, $y, $additional)); return ($success ? $this->getContent() : $success); } /** * Clicks the submit image by the name. Usually * the alt tag or the nearest equivalent. The owning * form will be submitted by this. Clicking outside of * the boundary of the coordinates will result in * a failure. * @param string $name Name attribute of button. * @param integer $x X-coordinate of imaginary click. * @param integer $y Y-coordinate of imaginary click. * @param hash $additional Additional form data. * @return string/boolean Page on success. * @access public */ function clickImageByName($name, $x = 1, $y = 1, $additional = false) { if (! ($form = &$this->_page->getFormByImageName($name))) { return false; } $success = $this->_load( $form->getMethod(), $form->getAction(), $form->submitImageByName($name, $x, $y, $additional)); return ($success ? $this->getContent() : $success); } /** * Clicks the submit image by ID attribute. The owning * form will be submitted by this. Clicking outside of * the boundary of the coordinates will result in * a failure. * @param integer/string $id ID attribute of button. * @param integer $x X-coordinate of imaginary click. * @param integer $y Y-coordinate of imaginary click. * @param hash $additional Additional form data. * @return string/boolean Page on success. * @access public */ function clickImageById($id, $x = 1, $y = 1, $additional = false) { if (! ($form = &$this->_page->getFormByImageId($id))) { return false; } $success = $this->_load( $form->getMethod(), $form->getAction(), $form->submitImageById($id, $x, $y, $additional)); return ($success ? $this->getContent() : $success); } /** * Submits a form by the ID. * @param string $id The form ID. No submit button value * will be sent. * @return string/boolean Page on success. * @access public */ function submitFormById($id) { if (! ($form = &$this->_page->getFormById($id))) { return false; } $success = $this->_load( $form->getMethod(), $form->getAction(), $form->submit()); return ($success ? $this->getContent() : $success); } /** * Follows a link by label. Will click the first link * found with this link text by default, or a later * one if an index is given. The match ignores case and * white space issues. * @param string $label Text between the anchor tags. * @param integer $index Link position counting from zero. * @return string/boolean Page on success. * @access public */ function clickLink($label, $index = 0) { $urls = $this->_page->getUrlsByLabel($label); if (count($urls) == 0) { return false; } if (count($urls) < $index + 1) { return false; } $this->_load('GET', $urls[$index]); return $this->getContent(); } /** * Tests to see if a link is present by label. * @param string $label Text of value attribute. * @return boolean True if link present. * @access public */ function isLink($label) { return (count($this->_page->getUrlsByLabel($label)) > 0); } /** * Follows a link by id attribute. * @param string $id ID attribute value. * @return string/boolean Page on success. * @access public */ function clickLinkById($id) { if (! ($url = $this->_page->getUrlById($id))) { return false; } $this->_load('GET', $url); return $this->getContent(); } /** * Tests to see if a link is present by ID attribute. * @param string $id Text of id attribute. * @return boolean True if link present. * @access public */ function isLinkById($id) { return (boolean)$this->_page->getUrlById($id); } } ?>pgfouine-1.2/tests/simpletest/shell_tester.php0000644000175000017500000002211010334504436020323 0ustar acmeacme_output = false; } /** * Actually runs the command. Does not trap the * error stream output as this need PHP 4.3+. * @param string $command The actual command line * to run. * @return integer Exit code. * @access public */ function execute($command) { $this->_output = false; exec($command, $this->_output, $ret); return $ret; } /** * Accessor for the last output. * @return string Output as text. * @access public */ function getOutput() { return implode("\n", $this->_output); } /** * Accessor for the last output. * @return array Output as array of lines. * @access public */ function getOutputAsList() { return $this->_output; } } /** * Test case for testing of command line scripts and * utilities. Usually scripts taht are external to the * PHP code, but support it in some way. * @package SimpleTest * @subpackage UnitTester */ class ShellTestCase extends SimpleTestCase { var $_current_shell; var $_last_status; var $_last_command; /** * Creates an empty test case. Should be subclassed * with test methods for a functional test case. * @param string $label Name of test case. Will use * the class name if none specified. * @access public */ function ShellTestCase($label = false) { $this->SimpleTestCase($label); $this->_current_shell = &$this->_createShell(); $this->_last_status = false; $this->_last_command = ''; } /** * Executes a command and buffers the results. * @param string $command Command to run. * @return boolean True if zero exit code. * @access public */ function execute($command) { $shell = &$this->_getShell(); $this->_last_status = $shell->execute($command); $this->_last_command = $command; return ($this->_last_status === 0); } /** * Dumps the output of the last command. * @access public */ function dumpOutput() { $this->dump($this->getOutput()); } /** * Accessor for the last output. * @return string Output as text. * @access public */ function getOutput() { $shell = &$this->_getShell(); return $shell->getOutput(); } /** * Accessor for the last output. * @return array Output as array of lines. * @access public */ function getOutputAsList() { $shell = &$this->_getShell(); return $shell->getOutputAsList(); } /** * Tests the last status code from the shell. * @param integer $status Expected status of last * command. * @param string $message Message to display. * @return boolean True if pass. * @access public */ function assertExitCode($status, $message = "%s") { $message = sprintf($message, "Expected status code of [$status] from [" . $this->_last_command . "], but got [" . $this->_last_status . "]"); return $this->assertTrue($status === $this->_last_status, $message); } /** * Attempt to exactly match the combined STDERR and * STDOUT output. * @param string $expected Expected output. * @param string $message Message to display. * @return boolean True if pass. * @access public */ function assertOutput($expected, $message = "%s") { $shell = &$this->_getShell(); return $this->assertExpectation( new EqualExpectation($expected), $shell->getOutput(), $message); } /** * Scans the output for a Perl regex. If found * anywhere it passes, else it fails. * @param string $pattern Regex to search for. * @param string $message Message to display. * @return boolean True if pass. * @access public */ function assertOutputPattern($pattern, $message = "%s") { $shell = &$this->_getShell(); return $this->assertExpectation( new WantedPatternExpectation($pattern), $shell->getOutput(), $message); } /** * If a Perl regex is found anywhere in the current * output then a failure is generated, else a pass. * @param string $pattern Regex to search for. * @param $message Message to display. * @return boolean True if pass. * @access public */ function assertNoOutputPattern($pattern, $message = "%s") { $shell = &$this->_getShell(); return $this->assertExpectation( new UnwantedPatternExpectation($pattern), $shell->getOutput(), $message); } /** * File existence check. * @param string $path Full filename and path. * @param string $message Message to display. * @return boolean True if pass. * @access public */ function assertFileExists($path, $message = "%s") { $message = sprintf($message, "File [$path] should exist"); return $this->assertTrue(file_exists($path), $message); } /** * File non-existence check. * @param string $path Full filename and path. * @param string $message Message to display. * @return boolean True if pass. * @access public */ function assertFileNotExists($path, $message = "%s") { $message = sprintf($message, "File [$path] should not exist"); return $this->assertFalse(file_exists($path), $message); } /** * Scans a file for a Perl regex. If found * anywhere it passes, else it fails. * @param string $pattern Regex to search for. * @param string $path Full filename and path. * @param string $message Message to display. * @return boolean True if pass. * @access public */ function assertFilePattern($pattern, $path, $message = "%s") { $shell = &$this->_getShell(); return $this->assertExpectation( new WantedPatternExpectation($pattern), implode('', file($path)), $message); } /** * If a Perl regex is found anywhere in the named * file then a failure is generated, else a pass. * @param string $pattern Regex to search for. * @param string $path Full filename and path. * @param string $message Message to display. * @return boolean True if pass. * @access public */ function assertNoFilePattern($pattern, $path, $message = "%s") { $shell = &$this->_getShell(); return $this->assertExpectation( new UnwantedPatternExpectation($pattern), implode('', file($path)), $message); } /** * Accessor for current shell. Used for testing the * the tester itself. * @return Shell Current shell. * @access protected */ function &_getShell() { return $this->_current_shell; } /** * Factory for the shell to run the command on. * @return Shell New shell object. * @access protected */ function &_createShell() { return new SimpleShell(); } } ?>pgfouine-1.2/tests/simpletest/dumper.php0000644000175000017500000003634610334504436017142 0ustar acmeacmegetType($value); switch($type) { case "Null": return "NULL"; case "Boolean": return "Boolean: " . ($value ? "true" : "false"); case "Array": return "Array: " . count($value) . " items"; case "Object": return "Object: of " . get_class($value); case "String": return "String: " . $this->clipString($value, 100); default: return "$type: $value"; } return "Unknown"; } /** * Gets the string representation of a type. * @param mixed $value Variable to check against. * @return string Type. * @access public */ function getType($value) { if (! isset($value)) { return "Null"; } elseif (is_bool($value)) { return "Boolean"; } elseif (is_string($value)) { return "String"; } elseif (is_integer($value)) { return "Integer"; } elseif (is_float($value)) { return "Float"; } elseif (is_array($value)) { return "Array"; } elseif (is_resource($value)) { return "Resource"; } elseif (is_object($value)) { return "Object"; } return "Unknown"; } /** * Creates a human readable description of the * difference between two variables. Uses a * dynamic call. * @param mixed $first First variable. * @param mixed $second Value to compare with. * @param boolean $identical If true then type anomolies count. * @return string Description of difference. * @access public */ function describeDifference($first, $second, $identical = false) { if ($identical) { if (! $this->_isTypeMatch($first, $second)) { return "with type mismatch as [" . $this->describeValue($first) . "] does not match [" . $this->describeValue($second) . "]"; } } $type = $this->getType($first); if ($type == "Unknown") { return "with unknown type"; } $method = '_describe' . $type . 'Difference'; return $this->$method($first, $second, $identical); } /** * Tests to see if types match. * @param mixed $first First variable. * @param mixed $second Value to compare with. * @return boolean True if matches. * @access private */ function _isTypeMatch($first, $second) { return ($this->getType($first) == $this->getType($second)); } /** * Clips a string to a maximum length. * @param string $value String to truncate. * @param integer $size Minimum string size to show. * @param integer $position Centre of string section. * @return string Shortened version. * @access public */ function clipString($value, $size, $position = 0) { $length = strlen($value); if ($length <= $size) { return $value; } $position = min($position, $length); $start = ($size/2 > $position ? 0 : $position - $size/2); if ($start + $size > $length) { $start = $length - $size; } $value = substr($value, $start, $size); return ($start > 0 ? "..." : "") . $value . ($start + $size < $length ? "..." : ""); } /** * Creates a human readable description of the * difference between two variables. The minimal * version. * @param null $first First value. * @param mixed $second Value to compare with. * @return string Human readable description. * @access private */ function _describeGenericDifference($first, $second) { return "as [" . $this->describeValue($first) . "] does not match [" . $this->describeValue($second) . "]"; } /** * Creates a human readable description of the * difference between a null and another variable. * @param null $first First null. * @param mixed $second Null to compare with. * @param boolean $identical If true then type anomolies count. * @return string Human readable description. * @access private */ function _describeNullDifference($first, $second, $identical) { return $this->_describeGenericDifference($first, $second); } /** * Creates a human readable description of the * difference between a boolean and another variable. * @param boolean $first First boolean. * @param mixed $second Boolean to compare with. * @param boolean $identical If true then type anomolies count. * @return string Human readable description. * @access private */ function _describeBooleanDifference($first, $second, $identical) { return $this->_describeGenericDifference($first, $second); } /** * Creates a human readable description of the * difference between a string and another variable. * @param string $first First string. * @param mixed $second String to compare with. * @param boolean $identical If true then type anomolies count. * @return string Human readable description. * @access private */ function _describeStringDifference($first, $second, $identical) { if (is_object($second) || is_array($second)) { return $this->_describeGenericDifference($first, $second); } $position = $this->_stringDiffersAt($first, $second); $message = "at character $position"; $message .= " with [" . $this->clipString($first, 100, $position) . "] and [" . $this->clipString($second, 100, $position) . "]"; return $message; } /** * Creates a human readable description of the * difference between an integer and another variable. * @param integer $first First number. * @param mixed $second Number to compare with. * @param boolean $identical If true then type anomolies count. * @return string Human readable description. * @access private */ function _describeIntegerDifference($first, $second, $identical) { if (is_object($second) || is_array($second)) { return $this->_describeGenericDifference($first, $second); } return "because [" . $this->describeValue($first) . "] differs from [" . $this->describeValue($second) . "] by " . abs($first - $second); } /** * Creates a human readable description of the * difference between two floating point numbers. * @param float $first First float. * @param mixed $second Float to compare with. * @param boolean $identical If true then type anomolies count. * @return string Human readable description. * @access private */ function _describeFloatDifference($first, $second, $identical) { if (is_object($second) || is_array($second)) { return $this->_describeGenericDifference($first, $second); } return "because " . $this->describeValue($first) . "] differs from [" . $this->describeValue($second) . "]"; } /** * Creates a human readable description of the * difference between two arrays. * @param array $first First array. * @param mixed $second Array to compare with. * @param boolean $identical If true then type anomolies count. * @return string Human readable description. * @access private */ function _describeArrayDifference($first, $second, $identical) { if (! is_array($second)) { return $this->_describeGenericDifference($first, $second); } if (! $this->_isMatchingKeys($first, $second, $identical)) { return "as key list [" . implode(", ", array_keys($first)) . "] does not match key list [" . implode(", ", array_keys($second)) . "]"; } foreach (array_keys($first) as $key) { if ($identical && ($first[$key] === $second[$key])) { continue; } if (! $identical && ($first[$key] == $second[$key])) { continue; } return "with member [$key] " . $this->describeDifference( $first[$key], $second[$key], $identical); } return ""; } /** * Compares two arrays to see if their key lists match. * For an identical match, the ordering and types of the keys * is significant. * @param array $first First array. * @param array $second Array to compare with. * @param boolean $identical If true then type anomolies count. * @return boolean True if matching. * @access private */ function _isMatchingKeys($first, $second, $identical) { $first_keys = array_keys($first); $second_keys = array_keys($second); if ($identical) { return ($first_keys === $second_keys); } sort($first_keys); sort($second_keys); return ($first_keys == $second_keys); } /** * Creates a human readable description of the * difference between a resource and another variable. * @param resource $first First resource. * @param mixed $second Resource to compare with. * @param boolean $identical If true then type anomolies count. * @return string Human readable description. * @access private */ function _describeResourceDifference($first, $second, $identical) { return $this->_describeGenericDifference($first, $second); } /** * Creates a human readable description of the * difference between two objects. * @param object $first First object. * @param mixed $second Object to compare with. * @param boolean $identical If true then type anomolies count. * @return string Human readable description. * @access private */ function _describeObjectDifference($first, $second, $identical) { if (! is_object($second)) { return $this->_describeGenericDifference($first, $second); } return $this->_describeArrayDifference( get_object_vars($first), get_object_vars($second), $identical); } /** * Find the first character position that differs * in two strings by binary chop. * @param string $first First string. * @param string $second String to compare with. * @return integer Position of first differing * character. * @access private */ function _stringDiffersAt($first, $second) { if (! $first || ! $second) { return 0; } if (strlen($first) < strlen($second)) { list($first, $second) = array($second, $first); } $position = 0; $step = strlen($first); while ($step > 1) { $step = (integer)(($step + 1)/2); if (strncmp($first, $second, $position + $step) == 0) { $position += $step; } } return $position; } /** * Sends a formatted dump of a variable to a string. * @param mixed $variable Variable to display. * @return string Output from print_r(). * @access public * @static */ function dump($variable) { ob_start(); print_r($variable); $formatted = ob_get_contents(); ob_end_clean(); return $formatted; } /** * Extracts the last assertion that was not within * Simpletest itself. The name must start with "assert". * @param array $stack List of stack frames. * @param string $format String formatting. * @param string $prefix Prefix of method to search for. * @access public * @static */ function getFormattedAssertionLine($stack, $format = '%d', $prefix = 'assert') { foreach ($stack as $frame) { if (isset($frame['file']) && strpos($frame['file'], 'simpletest') !== false) { // dirname() is a bit slow. if (substr(dirname($frame['file']), -10) == 'simpletest') { continue; } } if (strncmp($frame['function'], $prefix, strlen($prefix)) == 0) { return sprintf($format, $frame['line']); } } return ''; } } ?>pgfouine-1.2/tests/simpletest/unit_tester.php0000644000175000017500000003040110334504436020175 0ustar acmeacmeSimpleTestCase($label); } /** * Will be true if the value is null. * @param null $value Supposedly null value. * @param string $message Message to display. * @return boolean True on pass * @access public */ function assertNull($value, $message = "%s") { $dumper = &new SimpleDumper(); $message = sprintf( $message, "[" . $dumper->describeValue($value) . "] should be null"); return $this->assertTrue(! isset($value), $message); } /** * Will be true if the value is set. * @param mixed $value Supposedly set value. * @param string $message Message to display. * @return boolean True on pass. * @access public */ function assertNotNull($value, $message = "%s") { $dumper = &new SimpleDumper(); $message = sprintf( $message, "[" . $dumper->describeValue($value) . "] should not be null"); return $this->assertTrue(isset($value), $message); } /** * Type and class test. Will pass if class * matches the type name or is a subclass or * if not an object, but the type is correct. * @param mixed $object Object to test. * @param string $type Type name as string. * @param string $message Message to display. * @return boolean True on pass. * @access public */ function assertIsA($object, $type, $message = "%s") { return $this->assertExpectation( new IsAExpectation($type), $object, $message); } /** * Type and class mismatch test. Will pass if class * name or underling type does not match the one * specified. * @param mixed $object Object to test. * @param string $type Type name as string. * @param string $message Message to display. * @return boolean True on pass. * @access public */ function assertNotA($object, $type, $message = "%s") { return $this->assertExpectation( new NotAExpectation($type), $object, $message); } /** * Will trigger a pass if the two parameters have * the same value only. Otherwise a fail. * @param mixed $first Value to compare. * @param mixed $second Value to compare. * @param string $message Message to display. * @return boolean True on pass * @access public */ function assertEqual($first, $second, $message = "%s") { return $this->assertExpectation( new EqualExpectation($first), $second, $message); } /** * Will trigger a pass if the two parameters have * a different value. Otherwise a fail. * @param mixed $first Value to compare. * @param mixed $second Value to compare. * @param string $message Message to display. * @return boolean True on pass * @access public */ function assertNotEqual($first, $second, $message = "%s") { return $this->assertExpectation( new NotEqualExpectation($first), $second, $message); } /** * Will trigger a pass if the two parameters have * the same value and same type. Otherwise a fail. * @param mixed $first Value to compare. * @param mixed $second Value to compare. * @param string $message Message to display. * @return boolean True on pass * @access public */ function assertIdentical($first, $second, $message = "%s") { return $this->assertExpectation( new IdenticalExpectation($first), $second, $message); } /** * Will trigger a pass if the two parameters have * the different value or different type. * @param mixed $first Value to compare. * @param mixed $second Value to compare. * @param string $message Message to display. * @return boolean True on pass * @access public */ function assertNotIdentical($first, $second, $message = "%s") { return $this->assertExpectation( new NotIdenticalExpectation($first), $second, $message); } /** * Will trigger a pass if both parameters refer * to the same object. Fail otherwise. * @param mixed $first Object reference to check. * @param mixed $second Hopefully the same object. * @param string $message Message to display. * @return boolean True on pass * @access public */ function assertReference(&$first, &$second, $message = "%s") { $dumper = &new SimpleDumper(); $message = sprintf( $message, "[" . $dumper->describeValue($first) . "] and [" . $dumper->describeValue($second) . "] should reference the same object"); return $this->assertTrue( SimpleTestCompatibility::isReference($first, $second), $message); } /** * Will trigger a pass if both parameters refer * to different objects. Fail otherwise. * @param mixed $first Object reference to check. * @param mixed $second Hopefully not the same object. * @param string $message Message to display. * @return boolean True on pass * @access public */ function assertCopy(&$first, &$second, $message = "%s") { $dumper = &new SimpleDumper(); $message = sprintf( $message, "[" . $dumper->describeValue($first) . "] and [" . $dumper->describeValue($second) . "] should not be the same object"); return $this->assertFalse( SimpleTestCompatibility::isReference($first, $second), $message); } /** * Will trigger a pass if the Perl regex pattern * is found in the subject. Fail otherwise. * @param string $pattern Perl regex to look for including * the regex delimiters. * @param string $subject String to search in. * @param string $message Message to display. * @return boolean True on pass * @access public */ function assertWantedPattern($pattern, $subject, $message = "%s") { return $this->assertExpectation( new WantedPatternExpectation($pattern), $subject, $message); } /** * Will trigger a pass if the perl regex pattern * is not present in subject. Fail if found. * @param string $pattern Perl regex to look for including * the regex delimiters. * @param string $subject String to search in. * @param string $message Message to display. * @return boolean True on pass * @access public */ function assertNoUnwantedPattern($pattern, $subject, $message = "%s") { return $this->assertExpectation( new UnwantedPatternExpectation($pattern), $subject, $message); } /** * Confirms that no errors have occoured so * far in the test method. * @param string $message Message to display. * @return boolean True on pass * @access public */ function assertNoErrors($message = "%s") { $queue = &SimpleErrorQueue::instance(); return $this->assertTrue( $queue->isEmpty(), sprintf($message, "Should be no errors")); } /** * Confirms that an error has occoured and * optionally that the error text matches exactly. * @param string $expected Expected error text or * false for no check. * @param string $message Message to display. * @return boolean True on pass * @access public */ function assertError($expected = false, $message = "%s") { $queue = &SimpleErrorQueue::instance(); if ($queue->isEmpty()) { $this->fail(sprintf($message, "Expected error not found")); return; } list($severity, $content, $file, $line, $globals) = $queue->extract(); $severity = SimpleErrorQueue::getSeverityAsString($severity); return $this->assertTrue( ! $expected || ($expected == $content), "Expected [$expected] in PHP error [$content] severity [$severity] in [$file] line [$line]"); } /** * Confirms that an error has occoured and * that the error text matches a Perl regular * expression. * @param string $pattern Perl regular expresion to * match against. * @param string $message Message to display. * @return boolean True on pass * @access public */ function assertErrorPattern($pattern, $message = "%s") { $queue = &SimpleErrorQueue::instance(); if ($queue->isEmpty()) { $this->fail(sprintf($message, "Expected error not found")); return; } list($severity, $content, $file, $line, $globals) = $queue->extract(); $severity = SimpleErrorQueue::getSeverityAsString($severity); return $this->assertTrue( (boolean)preg_match($pattern, $content), "Expected pattern match [$pattern] in PHP error [$content] severity [$severity] in [$file] line [$line]"); } } ?> pgfouine-1.2/tests/simpletest/authentication.php0000644000175000017500000001675310334504436020665 0ustar acmeacme_type = $type; $this->_root = $url->getBasePath(); $this->_username = false; $this->_password = false; } /** * Adds another location to the realm. * @param SimpleUrl $url Somewhere in realm. * @access public */ function stretch($url) { $this->_root = $this->_getCommonPath($this->_root, $url->getPath()); } /** * Finds the common starting path. * @param string $first Path to compare. * @param string $second Path to compare. * @return string Common directories. * @access private */ function _getCommonPath($first, $second) { $first = explode('/', $first); $second = explode('/', $second); for ($i = 0; $i < min(count($first), count($second)); $i++) { if ($first[$i] != $second[$i]) { return implode('/', array_slice($first, 0, $i)) . '/'; } } return implode('/', $first) . '/'; } /** * Sets the identity to try within this realm. * @param string $username Username in authentication dialog. * @param string $username Password in authentication dialog. * @access public */ function setIdentity($username, $password) { $this->_username = $username; $this->_password = $password; } /** * Accessor for current identity. * @return string Last succesful username. * @access public */ function getUsername() { return $this->_username; } /** * Accessor for current identity. * @return string Last succesful password. * @access public */ function getPassword() { return $this->_password; } /** * Test to see if the URL is within the directory * tree of the realm. * @param SimpleUrl $url URL to test. * @return boolean True if subpath. * @access public */ function isWithin($url) { return (strpos($url->getBasePath(), $this->_root) === 0); } } /** * Manages security realms. * @package SimpleTest * @subpackage WebTester */ class SimpleAuthenticator { var $_realms; /** * Clears the realms. * @access public */ function SimpleAuthenticator() { $this->restartSession(); } /** * Starts with no realms set up. * @access public */ function restartSession() { $this->_realms = array(); } /** * Adds a new realm centered the current URL. * Browsers vary wildly on their behaviour in this * regard. Mozilla ignores the realm and presents * only when challenged, wasting bandwidth. IE * just carries on presenting until a new challenge * occours. SimpleTest tries to follow the spirit of * the original standards committee and treats the * base URL as the root of a file tree shaped realm. * @param SimpleUrl $url Base of realm. * @param string $type Authentication type for this * realm. Only Basic authentication * is currently supported. * @param string $realm Name of realm. * @access public */ function addRealm($url, $type, $realm) { $this->_realms[$url->getHost()][$realm] = new SimpleRealm($type, $url); } /** * Sets the current identity to be presented * against that realm. * @param string $host Server hosting realm. * @param string $realm Name of realm. * @param string $username Username for realm. * @param string $password Password for realm. * @access public */ function setIdentityForRealm($host, $realm, $username, $password) { if (isset($this->_realms[$host][$realm])) { $this->_realms[$host][$realm]->setIdentity($username, $password); } } /** * Finds the name of the realm by comparing URLs. * @param SimpleUrl $url URL to test. * @return SimpleRealm Name of realm. * @access private */ function _findRealmFromUrl($url) { if (! isset($this->_realms[$url->getHost()])) { return false; } foreach ($this->_realms[$url->getHost()] as $name => $realm) { if ($realm->isWithin($url)) { return $realm; } } return false; } /** * Presents the appropriate headers for this location. * @param SimpleHttpRequest $request Request to modify. * @param SimpleUrl $url Base of realm. * @access public */ function addHeaders(&$request, $url) { if ($url->getUsername() && $url->getPassword()) { $username = $url->getUsername(); $password = $url->getPassword(); } elseif ($realm = $this->_findRealmFromUrl($url)) { $username = $realm->getUsername(); $password = $realm->getPassword(); } else { return; } $this->addBasicHeaders($request, $username, $password); } /** * Presents the appropriate headers for this * location for basic authentication. * @param SimpleHttpRequest $request Request to modify. * @param string $username Username for realm. * @param string $password Password for realm. * @access public * @static */ function addBasicHeaders(&$request, $username, $password) { if ($username && $password) { $request->addHeaderLine( 'Authorization: Basic ' . base64_encode("$username:$password")); } } } ?>pgfouine-1.2/tests/simpletest/xml.php0000644000175000017500000005070210334504436016436 0ustar acmeacmeSimpleReporter(); $this->_namespace = ($namespace ? $namespace . ':' : ''); $this->_indent = $indent; } /** * Calculates the pretty printing indent level * from the current level of nesting. * @param integer $offset Extra indenting level. * @return string Leading space. * @access protected */ function _getIndent($offset = 0) { return str_repeat( $this->_indent, count($this->getTestList()) + $offset); } /** * Converts character string to parsed XML * entities string. * @param string text Unparsed character data. * @return string Parsed character data. * @access public */ function toParsedXml($text) { return str_replace( array('&', '<', '>', '"', '\''), array('&', '<', '>', '"', '''), $text); } /** * Paints the start of a group test. * @param string $test_name Name of test that is starting. * @param integer $size Number of test cases starting. * @access public */ function paintGroupStart($test_name, $size) { parent::paintGroupStart($test_name, $size); print $this->_getIndent(); print "<" . $this->_namespace . "group size=\"$size\">\n"; print $this->_getIndent(1); print "<" . $this->_namespace . "name>" . $this->toParsedXml($test_name) . "_namespace . "name>\n"; } /** * Paints the end of a group test. * @param string $test_name Name of test that is ending. * @access public */ function paintGroupEnd($test_name) { print $this->_getIndent(); print "_namespace . "group>\n"; parent::paintGroupEnd($test_name); } /** * Paints the start of a test case. * @param string $test_name Name of test that is starting. * @access public */ function paintCaseStart($test_name) { parent::paintCaseStart($test_name); print $this->_getIndent(); print "<" . $this->_namespace . "case>\n"; print $this->_getIndent(1); print "<" . $this->_namespace . "name>" . $this->toParsedXml($test_name) . "_namespace . "name>\n"; } /** * Paints the end of a test case. * @param string $test_name Name of test that is ending. * @access public */ function paintCaseEnd($test_name) { print $this->_getIndent(); print "_namespace . "case>\n"; parent::paintCaseEnd($test_name); } /** * Paints the start of a test method. * @param string $test_name Name of test that is starting. * @access public */ function paintMethodStart($test_name) { parent::paintMethodStart($test_name); print $this->_getIndent(); print "<" . $this->_namespace . "test>\n"; print $this->_getIndent(1); print "<" . $this->_namespace . "name>" . $this->toParsedXml($test_name) . "_namespace . "name>\n"; } /** * Paints the end of a test method. * @param string $test_name Name of test that is ending. * @param integer $progress Number of test cases ending. * @access public */ function paintMethodEnd($test_name) { print $this->_getIndent(); print "_namespace . "test>\n"; parent::paintMethodEnd($test_name); } /** * Increments the pass count. * @param string $message Message is ignored. * @access public */ function paintPass($message) { parent::paintPass($message); print $this->_getIndent(1); print "<" . $this->_namespace . "pass>"; print $this->toParsedXml($message); print "_namespace . "pass>\n"; } /** * Increments the fail count. * @param string $message Message is ignored. * @access public */ function paintFail($message) { parent::paintFail($message); print $this->_getIndent(1); print "<" . $this->_namespace . "fail>"; print $this->toParsedXml($message); print "_namespace . "fail>\n"; } /** * Paints a PHP error or exception. * @param string $message Message is ignored. * @access public * @abstract */ function paintException($message) { parent::paintException($message); print $this->_getIndent(1); print "<" . $this->_namespace . "exception>"; print $this->toParsedXml($message); print "_namespace . "exception>\n"; } /** * Paints a simple supplementary message. * @param string $message Text to display. * @access public */ function paintMessage($message) { parent::paintMessage($message); print $this->_getIndent(1); print "<" . $this->_namespace . "message>"; print $this->toParsedXml($message); print "_namespace . "message>\n"; } /** * Paints a formatted ASCII message such as a * variable dump. * @param string $message Text to display. * @access public */ function paintFormattedMessage($message) { parent::paintFormattedMessage($message); print $this->_getIndent(1); print "<" . $this->_namespace . "formatted>"; print ""; print "_namespace . "formatted>\n"; } /** * Serialises the event object. * @param string $type Event type as text. * @param mixed $payload Message or object. * @access public */ function paintSignal($type, &$payload) { parent::paintSignal($type, $payload); print $this->_getIndent(1); print "<" . $this->_namespace . "signal type=\"$type\">"; print ""; print "_namespace . "signal>\n"; } /** * Paints the test document header. * @param string $test_name First test top level * to start. * @access public * @abstract */ function paintHeader($test_name) { if (! SimpleReporter::inCli()) { header('Content-type: text/xml'); } print "_namespace) { print " xmlns:" . $this->_namespace . "=\"www.lastcraft.com/SimpleTest/Beta3/Report\""; } print "?>\n"; print "<" . $this->_namespace . "run>\n"; } /** * Paints the test document footer. * @param string $test_name The top level test. * @access public * @abstract */ function paintFooter($test_name) { print "_namespace . "run>\n"; } } /** * Accumulator for incoming tag. Holds the * incoming test structure information for * later dispatch to the reporter. * @package SimpleTest * @subpackage UnitTester */ class NestingXmlTag { var $_name; var $_attributes; /** * Sets the basic test information except * the name. * @param hash $attributes Name value pairs. * @access public */ function NestingXmlTag($attributes) { $this->_name = false; $this->_attributes = $attributes; } /** * Sets the test case/method name. * @param string $name Name of test. * @access public */ function setName($name) { $this->_name = $name; } /** * Accessor for name. * @return string Name of test. * @access public */ function getName() { return $this->_name; } /** * Accessor for attributes. * @return hash All attributes. * @access protected */ function _getAttributes() { return $this->_attributes; } } /** * Accumulator for incoming method tag. Holds the * incoming test structure information for * later dispatch to the reporter. * @package SimpleTest * @subpackage UnitTester */ class NestingMethodTag extends NestingXmlTag { /** * Sets the basic test information except * the name. * @param hash $attributes Name value pairs. * @access public */ function NestingMethodTag($attributes) { $this->NestingXmlTag($attributes); } /** * Signals the appropriate start event on the * listener. * @param SimpleReporter $listener Target for events. * @access public */ function paintStart(&$listener) { $listener->paintMethodStart($this->getName()); } /** * Signals the appropriate end event on the * listener. * @param SimpleReporter $listener Target for events. * @access public */ function paintEnd(&$listener) { $listener->paintMethodEnd($this->getName()); } } /** * Accumulator for incoming case tag. Holds the * incoming test structure information for * later dispatch to the reporter. * @package SimpleTest * @subpackage UnitTester */ class NestingCaseTag extends NestingXmlTag { /** * Sets the basic test information except * the name. * @param hash $attributes Name value pairs. * @access public */ function NestingCaseTag($attributes) { $this->NestingXmlTag($attributes); } /** * Signals the appropriate start event on the * listener. * @param SimpleReporter $listener Target for events. * @access public */ function paintStart(&$listener) { $listener->paintCaseStart($this->getName()); } /** * Signals the appropriate end event on the * listener. * @param SimpleReporter $listener Target for events. * @access public */ function paintEnd(&$listener) { $listener->paintCaseEnd($this->getName()); } } /** * Accumulator for incoming group tag. Holds the * incoming test structure information for * later dispatch to the reporter. * @package SimpleTest * @subpackage UnitTester */ class NestingGroupTag extends NestingXmlTag { /** * Sets the basic test information except * the name. * @param hash $attributes Name value pairs. * @access public */ function NestingGroupTag($attributes) { $this->NestingXmlTag($attributes); } /** * Signals the appropriate start event on the * listener. * @param SimpleReporter $listener Target for events. * @access public */ function paintStart(&$listener) { $listener->paintGroupStart($this->getName(), $this->getSize()); } /** * Signals the appropriate end event on the * listener. * @param SimpleReporter $listener Target for events. * @access public */ function paintEnd(&$listener) { $listener->paintGroupEnd($this->getName()); } /** * The size in the attributes. * @return integer Value of size attribute or zero. * @access public */ function getSize() { $attributes = $this->_getAttributes(); if (isset($attributes['SIZE'])) { return (integer)$attributes['SIZE']; } return 0; } } /** * Parser for importing the output of the XmlReporter. * Dispatches that output to another reporter. * @package SimpleTest * @subpackage UnitTester */ class SimpleTestXmlParser { var $_listener; var $_expat; var $_tag_stack; var $_in_content_tag; var $_content; var $_attributes; /** * Loads a listener with the SimpleReporter * interface. * @param SimpleReporter $listener Listener of tag events. * @access public */ function SimpleTestXmlParser(&$listener) { $this->_listener = &$listener; $this->_expat = &$this->_createParser(); $this->_tag_stack = array(); $this->_in_content_tag = false; $this->_content = ''; $this->_attributes = array(); } /** * Parses a block of XML sending the results to * the listener. * @param string $chunk Block of text to read. * @return boolean True if valid XML. * @access public */ function parse($chunk) { if (! xml_parse($this->_expat, $chunk)) { trigger_error('XML parse error with ' . xml_error_string(xml_get_error_code($this->_expat))); return false; } return true; } /** * Sets up expat as the XML parser. * @return resource Expat handle. * @access protected */ function &_createParser() { $expat = xml_parser_create(); xml_set_object($expat, $this); xml_set_element_handler($expat, '_startElement', '_endElement'); xml_set_character_data_handler($expat, '_addContent'); xml_set_default_handler($expat, '_default'); return $expat; } /** * Opens a new test nesting level. * @return NestedXmlTag The group, case or method tag * to start. * @access private */ function _pushNestingTag($nested) { array_unshift($this->_tag_stack, $nested); } /** * Accessor for current test structure tag. * @return NestedXmlTag The group, case or method tag * being parsed. * @access private */ function &_getCurrentNestingTag() { return $this->_tag_stack[0]; } /** * Ends a nesting tag. * @return NestedXmlTag The group, case or method tag * just finished. * @access private */ function _popNestingTag() { return array_shift($this->_tag_stack); } /** * Test if tag is a leaf node with only text content. * @param string $tag XML tag name. * @return @boolean True if leaf, false if nesting. * @private */ function _isLeaf($tag) { return in_array( $tag, array('NAME', 'PASS', 'FAIL', 'EXCEPTION', 'MESSAGE', 'FORMATTED', 'SIGNAL')); } /** * Handler for start of event element. * @param resource $expat Parser handle. * @param string $tag Element name. * @param hash $attributes Name value pairs. * Attributes without content * are marked as true. * @access protected */ function _startElement($expat, $tag, $attributes) { $this->_attributes = $attributes; if ($tag == 'GROUP') { $this->_pushNestingTag(new NestingGroupTag($attributes)); } elseif ($tag == 'CASE') { $this->_pushNestingTag(new NestingCaseTag($attributes)); } elseif ($tag == 'TEST') { $this->_pushNestingTag(new NestingMethodTag($attributes)); } elseif ($this->_isLeaf($tag)) { $this->_in_content_tag = true; $this->_content = ''; } } /** * End of element event. * @param resource $expat Parser handle. * @param string $tag Element name. * @access protected */ function _endElement($expat, $tag) { $this->_in_content_tag = false; if (in_array($tag, array('GROUP', 'CASE', 'TEST'))) { $nesting_tag = $this->_popNestingTag(); $nesting_tag->paintEnd($this->_listener); } elseif ($tag == 'NAME') { $nesting_tag = &$this->_getCurrentNestingTag(); $nesting_tag->setName($this->_content); $nesting_tag->paintStart($this->_listener); } elseif ($tag == 'PASS') { $this->_listener->paintPass($this->_content); } elseif ($tag == 'FAIL') { $this->_listener->paintFail($this->_content); } elseif ($tag == 'EXCEPTION') { $this->_listener->paintException($this->_content); } elseif ($tag == 'SIGNAL') { $this->_listener->paintSignal( $this->_attributes['TYPE'], unserialize($this->_content)); } elseif ($tag == 'MESSAGE') { $this->_listener->paintMessage($this->_content); } elseif ($tag == 'FORMATTED') { $this->_listener->paintFormattedMessage($this->_content); } } /** * Content between start and end elements. * @param resource $expat Parser handle. * @param string $text Usually output messages. * @access protected */ function _addContent($expat, $text) { if ($this->_in_content_tag) { $this->_content .= $text; } return true; } /** * XML and Doctype handler. Discards all such content. * @param resource $expat Parser handle. * @param string $default Text of default content. * @access protected */ function _default($expat, $default) { } } ?> pgfouine-1.2/tests/simpletest/reporter.php0000644000175000017500000002112110334504436017471 0ustar acmeacmeSimpleReporter(); $this->_character_set = $character_set; } /** * Paints the top of the web page setting the * title to the name of the starting test. * @param string $test_name Name class of test. * @access public */ function paintHeader($test_name) { $this->sendNoCacheHeaders(); print "\n\n$test_name\n"; print "\n"; print "\n"; print "\n\n"; print "

$test_name

\n"; flush(); } /** * Send the headers necessary to ensure the page is * reloaded on every request. Otherwise you could be * scratching your head over out of date test data. * @access public * @static */ function sendNoCacheHeaders() { if (! headers_sent()) { header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); } } /** * Paints the CSS. Add additional styles here. * @return string CSS code as text. * @access protected */ function _getCss() { return ".fail { color: red; } pre { background-color: lightgray; }"; } /** * Paints the end of the test with a summary of * the passes and failures. * @param string $test_name Name class of test. * @access public */ function paintFooter($test_name) { $colour = ($this->getFailCount() + $this->getExceptionCount() > 0 ? "red" : "green"); print "
"; print $this->getTestCaseProgress() . "/" . $this->getTestCaseCount(); print " test cases complete:\n"; print "" . $this->getPassCount() . " passes, "; print "" . $this->getFailCount() . " fails and "; print "" . $this->getExceptionCount() . " exceptions."; print "
\n"; print "\n\n"; } /** * Paints the test failure with a breadcrumbs * trail of the nesting test suites below the * top level test. * @param string $message Failure message displayed in * the context of the other tests. * @access public */ function paintFail($message) { parent::paintFail($message); print "Fail: "; $breadcrumb = $this->getTestList(); array_shift($breadcrumb); print implode(" -> ", $breadcrumb); print " -> " . $this->_htmlEntities($message) . "
\n"; } /** * Paints a PHP error or exception. * @param string $message Message is ignored. * @access public * @abstract */ function paintException($message) { parent::paintException($message); print "Exception: "; $breadcrumb = $this->getTestList(); array_shift($breadcrumb); print implode(" -> ", $breadcrumb); print " -> " . $this->_htmlEntities($message) . "
\n"; } /** * Paints formatted text such as dumped variables. * @param string $message Text to show. * @access public */ function paintFormattedMessage($message) { print '
' . $this->_htmlEntities($message) . '
'; } /** * Character set adjusted entity conversion. * @param string $message Plain text or Unicode message. * @return string Browser readable message. * @access protected */ function _htmlEntities($message) { return htmlentities($message, ENT_COMPAT, $this->_character_set); } } /** * Sample minimal test displayer. Generates only * failure messages and a pass count. For command * line use. I've tried to make it look like JUnit, * but I wanted to output the errors as they arrived * which meant dropping the dots. * @package SimpleTest * @subpackage UnitTester */ class TextReporter extends SimpleReporter { /** * Does nothing yet. The first output will * be sent on the first test start. * @access public */ function TextReporter() { $this->SimpleReporter(); } /** * Paints the title only. * @param string $test_name Name class of test. * @access public */ function paintHeader($test_name) { if (! SimpleReporter::inCli()) { header('Content-type: text/plain'); } print "$test_name\n"; flush(); } /** * Paints the end of the test with a summary of * the passes and failures. * @param string $test_name Name class of test. * @access public */ function paintFooter($test_name) { if ($this->getFailCount() + $this->getExceptionCount() == 0) { print "OK\n"; } else { print "FAILURES!!!\n"; } print "Test cases run: " . $this->getTestCaseProgress() . "/" . $this->getTestCaseCount() . ", Passes: " . $this->getPassCount() . ", Failures: " . $this->getFailCount() . ", Exceptions: " . $this->getExceptionCount() . "\n"; } /** * Paints the test failure as a stack trace. * @param string $message Failure message displayed in * the context of the other tests. * @access public */ function paintFail($message) { parent::paintFail($message); print $this->getFailCount() . ") $message\n"; $breadcrumb = $this->getTestList(); array_shift($breadcrumb); print "\tin " . implode("\n\tin ", array_reverse($breadcrumb)); print "\n"; } /** * Paints a PHP error or exception. * @param string $message Message is ignored. * @access public * @abstract */ function paintException($message) { parent::paintException($message); print "Exception " . $this->getExceptionCount() . "!\n$message\n"; } /** * Paints formatted text such as dumped variables. * @param string $message Text to show. * @access public */ function paintFormattedMessage($message) { print "$message\n"; flush(); } } ?> pgfouine-1.2/tests/simpletest/url.php0000644000175000017500000004275410334504436016450 0ustar acmeacme_chompCoordinates($url); $this->_scheme = $this->_chompScheme($url); list($this->_username, $this->_password) = $this->_chompLogin($url); $this->_host = $this->_chompHost($url); $this->_port = false; if (preg_match('/(.*?):(.*)/', $this->_host, $host_parts)) { $this->_host = $host_parts[1]; $this->_port = (integer)$host_parts[2]; } $this->_path = $this->_chompPath($url); $this->_request = $this->_parseRequest($this->_chompRequest($url)); $this->_request->setCoordinates($x, $y); $this->_fragment = (strncmp($url, "#", 1) == 0 ? substr($url, 1) : false); $this->_target = false; } /** * Extracts the X, Y coordinate pair from an image map. * @param string $url URL so far. The coordinates will be * removed. * @return array X, Y as a pair of integers. * @access private */ function _chompCoordinates(&$url) { if (preg_match('/(.*)\?(\d+),(\d+)$/', $url, $matches)) { $url = $matches[1]; return array((integer)$matches[2], (integer)$matches[3]); } return array(false, false); } /** * Extracts the scheme part of an incoming URL. * @param string $url URL so far. The scheme will be * removed. * @return string Scheme part or false. * @access private */ function _chompScheme(&$url) { if (preg_match('/(.*?):(\/\/)(.*)/', $url, $matches)) { $url = $matches[2] . $matches[3]; return $matches[1]; } return false; } /** * Extracts the username and password from the * incoming URL. The // prefix will be reattached * to the URL after the doublet is extracted. * @param string $url URL so far. The username and * password are removed. * @return array Two item list of username and * password. Will urldecode() them. * @access private */ function _chompLogin(&$url) { $prefix = ''; if (preg_match('/(\/\/)(.*)/', $url, $matches)) { $prefix = $matches[1]; $url = $matches[2]; } if (preg_match('/(.*?)@(.*)/', $url, $matches)) { $url = $prefix . $matches[2]; $parts = split(":", $matches[1]); return array( urldecode($parts[0]), isset($parts[1]) ? urldecode($parts[1]) : false); } $url = $prefix . $url; return array(false, false); } /** * Extracts the host part of an incoming URL. * Includes the port number part. Will extract * the host if it starts with // or it has * a top level domain or it has at least two * dots. * @param string $url URL so far. The host will be * removed. * @return string Host part guess or false. * @access private */ function _chompHost(&$url) { if (preg_match('/(\/\/)(.*?)(\/.*|\?.*|#.*|$)/', $url, $matches)) { $url = $matches[3]; return $matches[2]; } if (preg_match('/(.*?)(\.\.\/|\.\/|\/|\?|#|$)(.*)/', $url, $matches)) { $tlds = SimpleUrl::getAllTopLevelDomains(); if (preg_match('/[a-z0-9\-]+\.(' . $tlds . ')/i', $matches[1])) { $url = $matches[2] . $matches[3]; return $matches[1]; } elseif (preg_match('/[a-z0-9\-]+\.[a-z0-9\-]+\.[a-z0-9\-]+/i', $matches[1])) { $url = $matches[2] . $matches[3]; return $matches[1]; } } return false; } /** * Extracts the path information from the incoming * URL. Strips this path from the URL. * @param string $url URL so far. The host will be * removed. * @return string Path part or '/'. * @access private */ function _chompPath(&$url) { if (preg_match('/(.*?)(\?|#|$)(.*)/', $url, $matches)) { $url = $matches[2] . $matches[3]; return ($matches[1] ? $matches[1] : ''); } return ''; } /** * Strips off the request data. * @param string $url URL so far. The request will be * removed. * @return string Raw request part. * @access private */ function _chompRequest(&$url) { if (preg_match('/\?(.*?)(#|$)(.*)/', $url, $matches)) { $url = $matches[2] . $matches[3]; return $matches[1]; } return ''; } /** * Breaks the request down into an object. * @param string $raw Raw request. * @return SimpleFormEncoding Parsed data. * @access private */ function _parseRequest($raw) { $request = new SimpleFormEncoding(); foreach (split("&", $raw) as $pair) { if (preg_match('/(.*?)=(.*)/', $pair, $matches)) { $request->add($matches[1], urldecode($matches[2])); } elseif ($pair) { $request->add($pair, ''); } } return $request; } /** * Accessor for protocol part. * @param string $default Value to use if not present. * @return string Scheme name, e.g "http". * @access public */ function getScheme($default = false) { return $this->_scheme ? $this->_scheme : $default; } /** * Accessor for user name. * @return string Username preceding host. * @access public */ function getUsername() { return $this->_username; } /** * Accessor for password. * @return string Password preceding host. * @access public */ function getPassword() { return $this->_password; } /** * Accessor for hostname and port. * @param string $default Value to use if not present. * @return string Hostname only. * @access public */ function getHost($default = false) { return $this->_host ? $this->_host : $default; } /** * Accessor for top level domain. * @return string Last part of host. * @access public */ function getTld() { $path_parts = pathinfo($this->getHost()); return (isset($path_parts['extension']) ? $path_parts['extension'] : false); } /** * Accessor for port number. * @return integer TCP/IP port number. * @access public */ function getPort() { return $this->_port; } /** * Accessor for path. * @return string Full path including leading slash if implied. * @access public */ function getPath() { if (! $this->_path && $this->_host) { return '/'; } return $this->_path; } /** * Accessor for page if any. This may be a * directory name if ambiguious. * @return Page name. * @access public */ function getPage() { if (! preg_match('/([^\/]*?)$/', $this->getPath(), $matches)) { return false; } return $matches[1]; } /** * Gets the path to the page. * @return string Path less the page. * @access public */ function getBasePath() { if (! preg_match('/(.*\/)[^\/]*?$/', $this->getPath(), $matches)) { return false; } return $matches[1]; } /** * Accessor for fragment at end of URL after the "#". * @return string Part after "#". * @access public */ function getFragment() { return $this->_fragment; } /** * Accessor for horizontal image coordinate. * @return integer X value. * @access public */ function getX() { return $this->_request->getX(); } /** * Accessor for vertical image coordinate. * @return integer Y value. * @access public */ function getY() { return $this->_request->getY(); } /** * Accessor for current request parameters * in URL string form * @return string Form is string "?a=1&b=2", etc. * @access public */ function getEncodedRequest() { $encoded = $this->_request->asString(); if ($encoded) { return '?' . preg_replace('/^\?/', '', $encoded); } return ''; } /** * Adds an additional parameter to the request. * @param string $key Name of parameter. * @param string $value Value as string. * @access public */ function addRequestParameter($key, $value) { $this->_request->add($key, $value); } /** * Adds additional parameters to the request. * @param hash/SimpleFormEncoding $parameters Additional * parameters. * @access public */ function addRequestParameters($parameters) { $this->_request->merge($parameters); } /** * Clears down all parameters. * @access public */ function clearRequest() { $this->_request = &new SimpleFormEncoding(); } /** * Sets image coordinates. Set to flase to clear * them. * @param integer $x Horizontal position. * @param integer $y Vertical position. * @access public */ function setCoordinates($x = false, $y = false) { $this->_request->setCoordinates($x, $y); } /** * Gets the frame target if present. Although * not strictly part of the URL specification it * acts as similarily to the browser. * @return boolean/string Frame name or false if none. * @access public */ function getTarget() { return $this->_target; } /** * Attaches a frame target. * @param string $frame Name of frame. * @access public */ function setTarget($frame) { $this->_target = $frame; } /** * Renders the URL back into a string. * @return string URL in canonical form. * @access public */ function asString() { $scheme = $identity = $host = $path = $encoded = $fragment = ''; if ($this->_username && $this->_password) { $identity = $this->_username . ':' . $this->_password . '@'; } if ($this->getHost()) { $scheme = $this->getScheme() ? $this->getScheme() : 'http'; $host = $this->getHost(); } if (substr($this->_path, 0, 1) == '/') { $path = $this->normalisePath($this->_path); } $encoded = $this->getEncodedRequest(); $fragment = $this->getFragment() ? '#'. $this->getFragment() : ''; return "$scheme://$identity$host$path$encoded$fragment"; } /** * Replaces unknown sections to turn a relative * URL into an absolute one. The base URL can * be either a string or a SimpleUrl object. * @param string/SimpleUrl $base Base URL. * @access public */ function makeAbsolute($base) { if (! is_object($base)) { $base = new SimpleUrl($base); } $scheme = $this->getScheme() ? $this->getScheme() : $base->getScheme(); $host = $this->getHost() ? $this->getHost() : $base->getHost(); $port = $this->_extractAbsolutePort($base); $path = $this->normalisePath($this->_extractAbsolutePath($base)); $identity = $this->_getIdentity() ? $this->_getIdentity() . '@' : ''; $encoded = $this->getEncodedRequest(); $fragment = $this->getFragment() ? '#'. $this->getFragment() : ''; return new SimpleUrl("$scheme://$identity$host$port$path$encoded$fragment"); } /** * Extracts the port from the base URL if it's needed, but * not present, in the current URL. * @param string/SimpleUrl $base Base URL. * @param string Absolute port number. * @access private */ function _extractAbsolutePort($base) { if ($this->getHost()) { return ($this->getPort() ? ':' . $this->getPort() : ''); } return ($base->getPort() ? ':' . $base->getPort() : ''); } /** * Replaces unknown sections of the path with base parts * to return a complete absolute one. * @param string/SimpleUrl $base Base URL. * @param string Absolute path. * @access private */ function _extractAbsolutePath($base) { if ($this->getHost()) { return $this->_path; } if (! $this->_isRelativePath($this->_path)) { return $this->_path; } if ($this->_path) { return $base->getBasePath() . $this->_path; } return $base->getPath(); } /** * Simple test to see if a path part is relative. * @param string $path Path to test. * @return boolean True if starts with a "/". * @access private */ function _isRelativePath($path) { return (substr($path, 0, 1) != '/'); } /** * Extracts the username and password for use in rendering * a URL. * @return string/boolean Form of username:password@ or false. * @access private */ function _getIdentity() { if ($this->_username && $this->_password) { return $this->_username . ':' . $this->_password; } return false; } /** * Replaces . and .. sections of the path. * @param string $path Unoptimised path. * @return string Path with dots removed if possible. * @access public */ function normalisePath($path) { $path = preg_replace('|/[^/]+/\.\./|', '/', $path); return preg_replace('|/\./|', '/', $path); } /** * A pipe seperated list of all TLDs that result in two part * domain names. * @return string Pipe separated list. * @access public * @static */ function getAllTopLevelDomains() { return 'com|edu|net|org|gov|mil|int|biz|info|name|pro|aero|coop|museum'; } } ?>pgfouine-1.2/tests/simpletest/LICENSE0000644000175000017500000001221210334504436016124 0ustar acmeacmeThe Open Group Test Suite License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Testing is essential for proper development and maintenance of standards-based products. For buyers: adequate conformance testing leads to reduced integration costs and protection of investments in applications, software and people. For software developers: conformance testing of platforms and middleware greatly reduces the cost of developing and maintaining multi-platform application software. For suppliers: In-depth testing increases customer satisfaction and keeps development and support costs in check. API conformance is highly measurable and suppliers who claim it must be able to substantiate that claim. As such, since these are benchmark measures of conformance, we feel the integrity of test tools is of importance. In order to preserve the integrity of the existing conformance modes of this test package and to permit recipients of modified versions of this package to run the original test modes, this license requires that the original test modes be preserved. If you find a bug in one of the standards mode test cases, please let us know so we can feed this back into the original, and also raise any specification issues with the appropriate bodies (for example the POSIX committees). Definitions: * "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. * "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. * "Copyright Holder" is whoever is named in the copyright or copyrights for the package. "You" is you, if you're thinking about copying or distributing this Package. * "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) * "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least the following: rename any non-standard executables and testcases so the names do not conflict with standard executables and testcases, which must also be provided, and provide a separate manual page for each non-standard executable and testcase that clearly documents how it differs from the Standard Version. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least the following: accompany any non-standard executables and testcases with their corresponding Standard Version executables and testcases, giving the non-standard executables and testcases non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7.Subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End pgfouine-1.2/tests/TestRegExp.class.php0000644000175000017500000000200110334504436016570 0ustar acmeacmeassertEqual(TEST_PATTERN, $regexp->getPattern()); } function testPatternDetection() { define('TEST_DETECTION_PATTERN', '/test/i'); define('TEST_DETECTION_STRING', 'this is a TEST string'); $regexp = new RegExp(TEST_DETECTION_PATTERN); $this->assertTrue($regexp->match(TEST_DETECTION_STRING)); } function testMatch() { define('TEST_MATCH_PATTERN', '/t(es)t/i'); define('TEST_MATCH_STRING', 'this is a TEST string'); $regexp = new RegExp(TEST_MATCH_PATTERN); $regexpMatch =& $regexp->match(TEST_MATCH_STRING); $this->assertEqual('TEST', $regexpMatch->getMatch(0)); $this->assertEqual('ES', $regexpMatch->getMatch(1)); $this->assertEqual(' string', $regexpMatch->getPostMatch()); } } ?>pgfouine-1.2/tests/TestLogStream.class.php0000644000175000017500000000162210414042047017275 0ustar acmeacmesetHostConnection(LOG_STREAM_HOST, LOG_STREAM_PORT); $this->assertEqual(LOG_STREAM_HOST, $logStream->getHost()); $this->assertEqual(LOG_STREAM_PORT, $logStream->getPort()); } function testSetUserDb() { $logStream = new LogStream(); $logStream->setUserDatabase(LOG_STREAM_USER, LOG_STREAM_DB); $this->assertEqual(LOG_STREAM_USER, $logStream->getUser()); $this->assertEqual(LOG_STREAM_DB, $logStream->getDatabase()); } } ?>pgfouine-1.2/tests/TestLogObject.class.php0000644000175000017500000000454311175035433017263 0ustar acmeacmeassertFalse($logObject->isIgnored()); $logObject = new LogObject(TEST_CONNECTION_ID, TEST_USER, TEST_DB, TEST_TEXT, true); $this->assertTrue($logObject->isIgnored()); $this->assertEqual(TEST_TEXT, $logObject->getText()); $logObject = new LogObject(TEST_CONNECTION_ID, TEST_USER, TEST_DB, TEST_TEXT, false); $this->assertFalse($logObject->isIgnored()); } function testSettersAndGetters() { define('TEST_CONNECTION_ID', 4356); define('TEST_TEXT', 'test text'); define('TEST_DB', 'test_db'); define('TEST_USER', 'test_user'); define('TEST_TIMESTAMP', 1234567890); define('TEST_COMMAND_NUMBER', 43); $logObject = new LogObject(TEST_CONNECTION_ID, TEST_USER, TEST_DB, TEST_TEXT); $this->assertEqual(TEST_CONNECTION_ID, $logObject->getConnectionId()); $this->assertEqual(TEST_DB, $logObject->getDatabase()); $this->assertEqual(TEST_USER, $logObject->getUser()); $logObject->setContextInformation(TEST_TIMESTAMP, TEST_COMMAND_NUMBER); $this->assertEqual(TEST_TIMESTAMP, $logObject->getTimestamp()); $this->assertEqual(TEST_COMMAND_NUMBER, $logObject->getCommandNumber()); } function testNormalize() { $testQuery = "SELECT * FROM mytable WHERE field1=4 AND field2='string' AND field3=0x80 AND field4 IN ('test', 5, 0x80 ) AND field5 IN (SELECT 1 FROM test)"; $logObject = new LogObject(TEST_CONNECTION_ID, TEST_USER, TEST_DB, $testQuery, false); $this->assertEqual($testQuery, $logObject->getText()); $this->assertEqual("SELECT * FROM mytable WHERE field1=0 AND field2='' AND field3=0x AND field4 IN (...) AND field5 IN (SELECT 0 FROM test)", $logObject->getNormalizedText()); } function testAppend() { define('TEST_TEXT1', 'test text 1'); define('TEST_TEXT2', 'test text 2'); $logObject = new LogObject(TEST_CONNECTION_ID, TEST_USER, TEST_DB, TEST_TEXT1); $logObject->append(TEST_TEXT2); $this->assertEqual(TEST_TEXT1.' '.TEST_TEXT2, $logObject->getText()); } } ?>pgfouine-1.2/tests/TestErrorLogObject.class.php0000644000175000017500000000273510466203202020267 0ustar acmeacmeassertFalse($errorLogObject->isIgnored()); $this->assertEqual(TEST_TEXT, $errorLogObject->getText()); $this->assertEqual(TEST_TEXT, $errorLogObject->getError()); $this->assertEqual(EVENT_ERROR, $errorLogObject->getEventType()); } function testSettersAndGetters() { define('TEST_CONNECTION_ID', 4356); define('TEST_USER', 'test user'); define('TEST_DB', 'test db'); define('TEST_TEXT', 'test text'); define('TEST_STATEMENT', 'test_statement'); define('TEST_HINT', 'test_hint'); define('TEST_DETAIL', 'test_detail'); $errorLogObject = new ErrorLogObject(TEST_CONNECTION_ID, TEST_USER, TEST_DB, TEST_TEXT); $errorLogObject->appendStatement(TEST_STATEMENT); $this->assertEqual(TEST_STATEMENT, $errorLogObject->getText()); $errorLogObject->appendHint(TEST_HINT); $this->assertEqual(TEST_HINT, $errorLogObject->getHint()); $errorLogObject->appendDetail(TEST_DETAIL); $this->assertEqual(TEST_DETAIL, $errorLogObject->getDetail()); } } ?>pgfouine-1.2/tests/TestGenericLogReader.class.php0000644000175000017500000000071610466203202020543 0ustar acmeacmeparse(); $this->assertEqual(4, $logReader->getLineParsedCounter()); } } ?>pgfouine-1.2/COPYING0000644000175000017500000004313310335341457012630 0ustar acmeacme GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. pgfouine-1.2/INSTALL0000644000175000017500000000030011174643436012617 0ustar acmeacmeTo install pgFouine, you can: * use your distribution's package, * untar the pgFouine tarball anywhere you want, * install the pgFouine RPM package with rpm -Uvh pgfouine-.noarch.rpm.pgfouine-1.2/THANKS0000644000175000017500000000051610466732624012513 0ustar acmeacmepgFouine is based on Practical Query Analyzer (http://pqa.projects.postgresql.org/) written by Tom Copeland and Thomas Favier. pgFouine uses: * SimpleTest (http://www.lastcraft.com/simple_test.php) * GeSHi (http://qbnz.com/highlighter/) * Artichow (http://www.artichow.org/) * sorttable (http://kryogenix.org/code/browser/sorttable/)pgfouine-1.2/pgfouine.php0000755000175000017500000003431211247304154014120 0ustar acmeacme#! /usr/bin/php -qC [-top ] [-format ] [-logtype ] [-report [outputfile=]] -file log file to analyze - read the log from stdin instead of -file -top number of queries in lists. Default is 20. -format output format: html, html-with-graphs or text. Default is html. -logtype log type: syslog, stderr or csvlog. Default is syslog. for stderr, you have to use the following log_line_prefix: \'%t [%p]: [%l-1] \' -report [outputfile=] list of report blocks separated by a comma report blocks can be: overall, hourly, bytype, slowest, n-mosttime, n-mostfrequent, n-slowestaverage, history, n-mostfrequenterrors, tsung, csv-query you can add several -report options if you want to generate several reports at once -examples maximum number of examples for a normalized query -onlyselect ignore all queries but SELECT -from "" ignore lines logged before this date (uses strtotime) -to "" ignore lines logged after this date (uses strtotime) -database consider only queries on this database (supports db1,db2 and /regexp/) -user consider only queries executed by this user (supports user1,user2 and /regexp/) -keepformatting keep the formatting of the query -maxquerylength maximum length of a query: we cut it if it exceeds this length -durationunit unit used to display the durations. Default is s(econds). -title define the title of the reports -syslogident <ident> PostgreSQL syslog identity. Default is postgres. -memorylimit <n> PHP memory limit in MB. Default is 512. -quiet quiet mode -debug debug mode -profile profile mode -help this help '; if($error) { exit(1); } else { exit(0); } } function checkOutputFilePath($filePath) { if(!$filePath) { return false; } $tmpOutputFilePath = $filePath; $tmpOutputDirectory = dirname($tmpOutputFilePath); $tmpOutputFileName = basename($tmpOutputFilePath); if(file_exists($tmpOutputFilePath) && (!is_file($tmpOutputFilePath) || !is_writable($tmpOutputFilePath))) { usage($tmpOutputFilePath.' already exists and is not a file or is not writable'); return false; } elseif(!is_dir($tmpOutputDirectory) || !is_writable($tmpOutputDirectory)) { usage($tmpOutputDirectory.' is not a directory, does not exist or is not writable'); return false; } elseif(!$tmpOutputFileName) { usage('cannot find a valid basename in '.$tmpOutputFilePath); return false; } else { $outputFilePath = realpath($tmpOutputDirectory).'/'.$tmpOutputFileName; return $outputFilePath; } } if(isset($_SERVER['argv']) && (!isset($argv) || empty($argv))) { $argv = $_SERVER['argv']; } if(is_array($argv)) { $executable = array_shift($argv); } else { $argv = array(); $executable = 'unknown'; } $options = array(); $argvCount = count($argv); for($i = 0; $i < $argvCount; $i++) { if(strpos($argv[$i], '-') === 0) { if($argv[$i] == '-') { define('CONFIG_STDIN', true); } else { $optionKey = substr($argv[$i], 1); $value = false; if(($i+1 < $argvCount) && (strpos($argv[$i+1], '-') !== 0)) { $value = $argv[$i+1]; $i++; } if($optionKey == 'report' || $optionKey == 'reports') { if(!isset($options['reports'])) { $options['reports'] = array(); } $options['reports'][] = $value; } else { $options[$optionKey] = $value; } } } else { usage('invalid options format'); } } if(isset($options['memorylimit']) && ((int) $options['memorylimit']) > 0) { $memoryLimit = (int) $options['memorylimit']; } else { $memoryLimit = 512; } ini_set('memory_limit', $memoryLimit.'M'); if(!defined('CONFIG_STDIN')) { define('CONFIG_STDIN', false); } if(isset($options['help']) || isset($options['h']) || isset($options['-help'])) { usage(); } if(isset($options['debug'])) { define('DEBUG', 1); } else { define('DEBUG', 0); } if(isset($options['profile'])) { define('PROFILE', 1); } else { define('PROFILE', 0); } define('CONFIG_FILTER', false); if(!CONFIG_STDIN) { if(!isset($options['file'])) { usage('the -file option is required'); } elseif(!$options['file']) { usage('you have to specify a file path'); } elseif(!is_readable($options['file'])) { usage('file '.$options['file'].' cannot be read'); } else { $filePath = realpath($options['file']); } } else { $filePath = 'php://stdin'; } if(isset($options['title'])) { define('CONFIG_REPORT_TITLE', $options['title']); } else { define('CONFIG_REPORT_TITLE', 'pgFouine: PostgreSQL log analysis report'); } if(isset($options['top'])) { if((int) $options['top'] > 0) { $top = (int) $options['top']; } else { usage('top option should be a valid integer'); } } else { $top = 20; } define('CONFIG_TOP_QUERIES_NUMBER', $top); $outputToFiles = false; $supportedReportBlocks = array( 'overall' => 'OverallStatsReport', 'bytype' => 'QueriesByTypeReport', 'hourly' => 'HourlyStatsReport', 'slowest' => 'SlowestQueriesReport', 'n-mosttime' => 'NormalizedQueriesMostTimeReport', 'n-mostfrequent' => 'NormalizedQueriesMostFrequentReport', 'n-slowestaverage' => 'NormalizedQueriesSlowestAverageReport', 'history' => 'QueriesHistoryReport', 'historyperpid' => 'QueriesHistoryPerPidReport', 'n-mostfrequenterrors' => 'NormalizedErrorsMostFrequentReport', 'tsung' => 'TsungSessionsReport', 'csv-query' => 'CsvQueriesHistoryReport' ); $defaultReportBlocks = array('overall', 'bytype', 'n-mosttime', 'slowest', 'n-mostfrequent', 'n-slowestaverage'); $reports = array(); if(isset($options['reports'])) { foreach($options['reports'] AS $report) { if(strpos($report, '=') !== false) { list($outputFilePath, $blocks) = explode('=', $report); $outputToFiles = true; } elseif(strpos($report, '.') !== false) { $outputFilePath = $report; $blocks = 'default'; $outputToFiles = true; } else { $outputFilePath = false; $blocks = $report; $outputToFiles = false; } if($blocks == 'default') { $selectedBlocks = $defaultReportBlocks; $notSupportedBlocks = array(); } elseif($blocks == 'all') { $selectedBlocks = array_keys($supportedReportBlocks); $notSupportedBlocks = array(); } else { $selectedBlocks = explode(',', $blocks); $notSupportedBlocks = array_diff($selectedBlocks, array_keys($supportedReportBlocks)); } if(empty($notSupportedBlocks)) { $outputFilePath = checkOutputFilePath($outputFilePath); $reports[] = array( 'blocks' => $selectedBlocks, 'file' => $outputFilePath ); } else { usage('report types not supported: '.implode(',', $notSupportedBlocks)); } } } else { $reports[] = array( 'blocks' => $defaultReportBlocks, 'file' => false ); } $supportedFormats = array('text' => 'TextReportAggregator', 'html' => 'HtmlReportAggregator', 'html-with-graphs' => 'HtmlWithGraphsReportAggregator'); if(isset($options['format'])) { if(array_key_exists($options['format'], $supportedFormats)) { if($options['format'] == 'html-with-graphs') { if(!function_exists('imagegd2')) { usage('HTML with graphs format requires GD2 library and extension'); } if(!function_exists('imagettfbbox')) { usage('HTML with graphs format requires Freetype support'); } if(!$outputToFiles) { usage('you need to define an output file to use HTML with graphs format (use -report outputfile=block1,block2,...)'); } } $aggregator = $supportedFormats[$options['format']]; } else { usage('format not supported'); } } else { $aggregator = $supportedFormats['html']; } $supportedLogTypes = array( 'syslog' => 'SyslogPostgreSQLParser', 'stderr' => 'StderrPostgreSQLParser', 'csvlog' => 'CsvlogPostgreSQLParser', ); $logtype = ''; if(isset($options['logtype'])) { if(array_key_exists($options['logtype'], $supportedLogTypes)) { $parser = $supportedLogTypes[$options['logtype']]; $logtype = $options['logtype']; } else { usage('log type not supported'); } } else { $parser = $supportedLogTypes['syslog']; $logtype = 'syslog'; } if(isset($options['examples'])) { $maxExamples = (int) $options['examples']; } else { $maxExamples = 3; } define('CONFIG_MAX_NUMBER_OF_EXAMPLES', $maxExamples); if(isset($options['onlyselect'])) { define('CONFIG_ONLY_SELECT', true); } else { define('CONFIG_ONLY_SELECT', false); } if(isset($options['database']) && !empty($options['database'])) { $options['database'] = trim($options['database']); if(substr($options['database'], 0, 1) == '/' && substr($options['database'], -1, 1) == '/') { // the filter is probably a regexp if(@preg_match($options['database'], $value) === false) { usage('database filter regexp is not valid'); } else { define('CONFIG_DATABASE_REGEXP', $options['database']); } } elseif(strpos($options['database'], ',') !== false) { // the filter is a list $databases = explode(',', $options['database']); $databases = array_map('trim', $databases); define('CONFIG_DATABASE_LIST', implode(',', $databases)); } else { define('CONFIG_DATABASE', $options['database']); } } if(!defined('CONFIG_DATABASE')) define('CONFIG_DATABASE', false); if(!defined('CONFIG_DATABASE_LIST')) define('CONFIG_DATABASE_LIST', false); if(!defined('CONFIG_DATABASE_REGEXP')) define('CONFIG_DATABASE_REGEXP', false); if(isset($options['user']) && !empty($options['user'])) { $options['user'] = trim($options['user']); if(substr($options['user'], 0, 1) == '/' && substr($options['user'], -1, 1) == '/') { // the filter is probably a regexp if(@preg_match($options['user'], $value) === false) { usage('user filter regexp is not valid'); } else { define('CONFIG_USER_REGEXP', $options['user']); } } elseif(strpos($options['user'], ',') !== false) { // the filter is a list $users = explode(',', $options['user']); $users = array_map('trim', $users); define('CONFIG_USER_LIST', implode(',', $users)); } else { define('CONFIG_USER', $options['user']); } } if(!defined('CONFIG_USER')) define('CONFIG_USER', false); if(!defined('CONFIG_USER_LIST')) define('CONFIG_USER_LIST', false); if(!defined('CONFIG_USER_REGEXP')) define('CONFIG_USER_REGEXP', false); if(isset($options['keepformatting'])) { define('CONFIG_KEEP_FORMATTING', true); } else { define('CONFIG_KEEP_FORMATTING', false); } if(isset($options['maxquerylength']) && is_numeric($options['maxquerylength'])) { define('CONFIG_MAX_QUERY_LENGTH', $options['maxquerylength']); } else { define('CONFIG_MAX_QUERY_LENGTH', 0); } if(isset($options['durationunit']) && $options['durationunit'] == 'ms') { define('CONFIG_DURATION_UNIT', 'ms'); } else { define('CONFIG_DURATION_UNIT', 's'); } if(isset($options['from']) && !empty($options['from'])) { $fromTimestamp = strtotime($options['from']); if($fromTimestamp <= 0) { $fromTimestamp = false; } } else { $fromTimestamp = false; } if(isset($options['to']) && !empty($options['to'])) { $toTimestamp = strtotime($options['to']); if($toTimestamp <= 0) { $toTimestamp = false; } } else { $toTimestamp = false; } if($fromTimestamp || $toTimestamp) { define('CONFIG_TIMESTAMP_FILTER', true); if($fromTimestamp) { define('CONFIG_FROM_TIMESTAMP', $fromTimestamp); } else { define('CONFIG_FROM_TIMESTAMP', MIN_TIMESTAMP); } if($toTimestamp) { define('CONFIG_TO_TIMESTAMP', $toTimestamp); } else { define('CONFIG_TO_TIMESTAMP', MAX_TIMESTAMP); } } else { define('CONFIG_TIMESTAMP_FILTER', false); } if(isset($options['syslogident'])) { define('CONFIG_SYSLOG_IDENTITY', $options['syslogident']); } else { define('CONFIG_SYSLOG_IDENTITY', 'postgres'); } if(isset($options['quiet'])) { define('CONFIG_QUIET', true); } else { define('CONFIG_QUIET', false); } if($logtype == 'csvlog') { $logReader = new CsvlogLogReader($filePath, $parser, 'PostgreSQLAccumulator'); } else { $logReader = new GenericLogReader($filePath, $parser, 'PostgreSQLAccumulator'); } foreach($reports AS $report) { $reportAggregator = new $aggregator($logReader, $report['file']); foreach($report['blocks'] AS $block) { $reportAggregator->addReportBlock($supportedReportBlocks[$block]); } $logReader->addReportAggregator($reportAggregator); unset($reportAggregator); } $logReader->parse(); $logReader->output(); fclose($stderr); exit(0); ?>����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������pgfouine-1.2/ChangeLog������������������������������������������������������������������������������0000644�0001750�0001750�00000036544�11341307461�013352� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������2010-02-24 Guillaume Smet <guillaume.smet@gmail.com> * applied [#1010728] support for rsyslog timestamp format by Peter Eisentraut slightly modified by me * fixed [#1010689] undefined method UselessLogObject::appendContext() * fixed [#1010690] Incorrect results in report. Repeating examples, incorrect statistics * released 1.2 2009-09-01 Guillaume Smet <guillaume-pg@smet.org> * applied [#1010669] Add a '-quiet' option so unrecognised lines are not displayed by Chris Smith 2009-08-24 Guillaume Smet <guillaume-pg@smet.org> * added -maxquerylength option per request from Josh Berkus * added a CSV query report per request from David Fetter 2009-04-26 Guillaume Smet <guillaume-pg@smet.org> * added normalization of IN() clauses * changed the default order of reports * raised the default memory limit to 512 MB * released 1.1 2009-04-25 Guillaume Smet <guillaume-pg@smet.org> * fixed an oversight in stderr parser related to [#1010525] stderr Multiline queries are not parsed * backported fixes from BRANCH_1_0 2009-04-18 Guillaume Smet <guillaume-pg@smet.org> * added support for lists and regexps in -user and -database filter options * updated GeSHi to 1.0.8.3 2009-04-12 Guillaume Smet <guillaume-pg@smet.org> * implemented a simple garbage collector mechanism which should reduce dramatically the memory usage when a connection pooler is not used 2009-04-05 Guillaume Smet <guillaume-pg@smet.org> * applied a patch from Max Valjanski to support large pids on 64 bits servers * applied a patch from Steve Woodcock to fix a long standing problem resulting in leading "statement: " in the query text for some queries 2009-04-01 Guillaume Smet <guillaume-pg@smet.org> * applied [#1010529] Error in normalize for bigint (or numeric) numbers (length > 10) by Oleg Serov 2008-05-15 Guillaume Smet <guillaume-pg@smet.org> * fixed the regexp of the stderr parser to exclude the timezone from the timestamp pattern * fixed a problem with NOTICE lines causing other lines to be ignored (not sure about the consequences though...) 2008-05-13 Guillaume Smet <guillaume-pg@smet.org> * moved from Vera to DejaVuSans 2008-05-05 Guillaume Smet <guillaume.smet@openwide.fr> * fixed [#1010324] "Fails to recognize FSM info" reported by Peter Eisentraut * fixed [#1010306] "pgfouine 1.0 not recognizing postgres syslog lines" reported by Neil Murray by adding log_error_verbosity=verbose support 2008-03-19 Guillaume Smet <guillaume-pg@smet.org> * preliminary support for CSV log format introduced in 8.3 2008-03-09 Guillaume Smet <guillaume-pg@smet.org> * global copyright update * made date parsing more clever in syslog parser 2008-02-25 Guillaume Smet <guillaume-pg@smet.org> * applied a patch from Russell Garrett @last.fm to normalize hexadecimal numbers * added invalid startup packet error to ignore list [#1010261] * added a couple of words to colorize per [#1006782] * updated GeSHi to 1.0.7.20 2007-05-11 Guillaume Smet <guillaume-pg@smet.org> * [1.0] applied [#1003645] Avoid PHP Notice for undefined $line error by Russell Smith 2007-03-30 Guillaume Smet <guillaume-pg@smet.org> * updated GeSHi to 1.0.7.18 * fixed test cases * fixed pgfouine_vacuum.php * released 1.0 2007-03-12 Guillaume Smet <guillaume-pg@smet.org> * improved stderr support by adding isContextual() method to lines * fixed normalization of query text for quote escaping * the timezone is not always present in stderr prefix so make it optional * removed the random selection of examples as it is slower than simply adding them all * all four per report from Stephen Denne in http://pgfoundry.org/forum/forum.php?thread_id=1204&forum_id=555 2007-02-05 Guillaume Smet <guillaume-pg@smet.org> * made syslog pattern matching a bit more permissive 2006-12-25 Guillaume Smet <guillaume-pg@smet.org> * renamed history per connection to history per pid 2006-12-23 Guillaume Smet <guillaume-pg@smet.org> * merged 0.7 branch into HEAD * updated GeSHi to 1.0.7.16 * renamed -timeunit option to -durationunit * implemented -durationunit option for graphs and fixed hourly stats table header * PHP errors are now written in stderr instead of the standard output 2006-12-22 Open Wide <guillaume.smet@openwide.fr> * added a history per connection report 2006-12-11 Open Wide <guillaume.smet@openwide.fr> * [0.7] improved error detection and added exit code * [0.7] released 0.7.2 2006-12-08 Open Wide <guillaume.smet@openwide.fr> * [0.7] fixed hourly stats when there are hours with no query at all * [0.7] commited a tutorial for RPM packaging per Devrim Gunduz 2006-11-24 Guillaume Smet <guillaume-pg@smet.org> * [0.7] fixed [#1000792] tooltip dates incorrect 2006-10-27 Guillaume Smet <guillaume-pg@smet.org> * work on adding a unit option (graphs don't support it yet) * [0.7] fixed a typo that prevents -from option from working * [0.7] fixed an error when pgFouine does not find any query * [0.7] allowed -from and -to options to be used separately * [0.7] released 0.7.1 2006-10-14 Guillaume Smet <guillaume-pg@smet.org> * updated GeSHi to 1.0.7.14 to fix [#1000753] 2006-09-17 Guillaume Smet <guillaume-pg@smet.org> * resynced prepared statements support with current CVS tip * added duration in history report * merged 0.7 branch into HEAD 2006-09-12 Guillaume Smet <guillaume-pg@smet.org> * improved -keepformatting option (keep commented lines and allow space indent) 2006-09-07 Guillaume Smet <guillaume-pg@smet.org> * implemented -keepformatting option to close [#1000724] Do not strip \n's from SQL queries * [0.7] fixed [#1000723] Normalization: negative and positive numbers produces separate groups 2006-09-03 Guillaume Smet <guillaume-pg@smet.org> * [0.7] commited Devrim Gunduz's changes to the spec file * [0.7] fixed problems raised by Toshio Kuratomi in Red Hat's bugzilla: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=202901#c2 2006-08-31 Guillaume Smet <guillaume-pg@smet.org> * reworked everything in prepared statements support for current CVS tip * fixed a bug in history listener: queries were not ordered correctly if their timestamps were identical 2006-08-28 Guillaume Smet <guillaume-pg@smet.org> * added support for prepared statements (including CVS tip bind parameters) 2006-08-19 Guillaume Smet <guillaume-pg@smet.org> * [0.7] fixed detection of malformed log files 2006-08-17 Guillaume Smet <guillaume-pg@smet.org> * released 0.7 * [0.7] applied Devrim Gunduz's patch to RPM spec file 2006-08-16 Guillaume Smet <guillaume-pg@smet.org> * [vacuum] fixed elapsed time calculation. The problem was due to inconsistency in PostgreSQL code. 2006-08-11 Guillaume Smet <guillaume.smet@openwide.fr> * fixed [#1000703] reported by Jérôme Benois 2006-08-10 Guillaume Smet <guillaume-pg@smet.org> * updated RPM packaging for 0.7 2006-08-09 Guillaume Smet <guillaume-pg@smet.org> * [vacuum] fixed the FSM report if we don't find any FSM information * [vacuum] minor cosmetic fixes 2006-08-08 Guillaume Smet <guillaume-pg@smet.org> * fixed unit tests 2006-08-07 Guillaume Smet <guillaume-pg@smet.org> * [tsung] completed Tsung support 2006-08-06 Guillaume Smet <guillaume-pg@smet.org> * [tsung] began the work on Tsung sessions generator 2006-08-03 Guillaume Smet <guillaume-pg@smet.org> * [vacuum] improved the layout * [vacuum] fixed the default sort order to work also for simple VACUUM * [vacuum] added the CPU usage 2006-08-02 Guillaume Smet <guillaume-pg@smet.org> * [vacuum] added the duration information * [vacuum] added a detailed report 2006-08-02 Open Wide <guillaume.smet@openwide.fr> * [vacuum] fixed a bug in database/schema filter 2006-07-26 Guillaume Smet <guillaume-pg@smet.org> * added a few hints if pgFouine does not find any valid PostgreSQL log line 2006-07-25 Guillaume Smet <guillaume-pg@smet.org> * changed the default order for vacuumed tables report * added the ability to filter vacuum log analysis on database and schema 2006-07-24 Guillaume Smet <guillaume-pg@smet.org> * added a queries history report 2006-07-23 Guillaume Smet <guillaume-pg@smet.org> * added the collect of index cleanup information * added more information in vacuum overall statistics 2006-07-19 Guillaume Smet <guillaume-pg@smet.org> * more work on vacuum verbose output analysis 2006-07-19 Open Wide <guillaume.smet@openwide.fr> * began the work on vacuum verbose output analysis 2006-07-13 Guillaume Smet <guillaume-pg@smet.org> * fixed a problem with older versions of PHP 2006-06-11 Guillaume Smet <guillaume-pg@smet.org> * fixed a problem with NOTICE/STATEMENT couple on DDL * improved the -report option analysis * NOTICEs for a query are now displayed * improved normalized queries formatting 2006-05-27 Guillaume Smet <guillaume-pg@smet.org> * fixed a bug when there is no query in the log file 2006-05-21 Guillaume Smet <guillaume-pg@smet.org> * released 0.6 2006-05-20 Guillaume Smet <guillaume-pg@smet.org> * normalized error code cleanup 2006-05-19 Guillaume Smet <guillaume-pg@smet.org> * added a test to check the freetype support * reported changes made on PHP4 version of Artichow to the PHP5 version * added -memorylimit option 2006-04-21 Guillaume Smet <guillaume-pg@smet.org> * fixed a stupid notice in tooltips thanks to Larry Rosenman * added an option to set syslog ident (postgres by default) following Larry Rosenman's suggestion 2006-04-18 Guillaume Smet <guillaume-pg@smet.org> * query count peaks don't depend anymore on the order of the log file (useful when you concatenate 2 log files from 2 different servers) 2006-04-17 Guillaume Smet <guillaume-pg@smet.org> * added tooltip with hourly statistics on errors too 2006-04-06 Guillaume Smet <guillaume-pg@smet.org> * only generate graphs if we have enough data to do it * added -title option to define the title of the report 2006-04-05 Guillaume Smet <guillaume-pg@smet.org> * added the framework for unit testing on real log files * first test case 2006-04-04 Guillaume Smet <guillaume-pg@smet.org> * added a tooltip with hourly statistics on normalized queries 2006-04-03 Guillaume Smet <guillaume-pg@smet.org> * added a tooltip with detailed information on queries and errors * only display identified statistics if different from overall 2006-04-02 Guillaume Smet <guillaume-pg@smet.org> * added a stderr parser based on Tatsuo Ishii's suggestion: http://pgfoundry.org/forum/forum.php?thread_id=735&forum_id=555 2006-04-01 Guillaume Smet <guillaume-pg@smet.org> * added filter on database and user 2006-03-31 Open Wide <guillaume.smet@openwide.fr> * added two more lines to ignore * fixed error reporting for php 4.4 * fixed a bug when two consecutive blocks have the same command line number in the same logstream (should not happen but seems to happen sometimes anyway) 2006-03-27 Open Wide <guillaume.smet@openwide.fr> * removed a few notices with PHP 5.1 * added another line to ignore 2006-03-26 Guillaume Smet <guillaume-pg@smet.org> * improved the errors report * released 0.5 2006-03-25 Guillaume Smet <guillaume-pg@smet.org> * fixed a bug reported by Simon Riggs on pgsql-hackers http://archives.postgresql.org/pgsql-hackers/2006-03/msg00694.php * added html output for hourly statistics report * rewrote the configuration stuff to use constants instead of a function * fixed unit tests * added a dynamic CSS based TOC for users who use a real browser * ignore autovacuum log lines * fixed syslog date detection again 2006-03-23 Guillaume Smet <guillaume-pg@smet.org> * added the ability to parse a log from stdin * added the microsecond unit (us) so that we can use pgFouine to parse a special apache log file 2006-03-13 Guillaume Smet <guillaume-pg@smet.org> * fixed syslog date detection (problem with php 4.3.2 on CentOS 3.5) 2006-03-07 Guillaume Smet <guillaume-pg@smet.org> * fixed an infinite loop when duration and count are exactly identical for two different normalized queries reported by David Touitou 2006-02-11 Guillaume Smet <guillaume-pg@smet.org> * fixed references for PHP 5.1 * lowered error reporting level for PHP 4.4 due to a problem with references * released development version 0.4.99 for PHP 5.1 users 2006-01-26 Guillaume Smet <guillaume-pg@smet.org> * fixed a problem with CONTEXT lines introduced with the new parser refactoring * fixed a bug in LogStream when we have a blank continuation line 2006-01-25 Guillaume Smet <guillaume-pg@smet.org> * fixed a missing reference to $logStream in LogBlock * removed useless code from LogStream * fixed html output method of errors report 2006-01-24 Guillaume Smet <guillaume-pg@smet.org> * fixed a bug on duration if log_duration and log_min_duration_statement are set to true in the new parser (duration counted twice) * minor fix in command line help 2006-01-11 Guillaume Smet <guillaume-pg@smet.org> * it is now possible to generate several reports with only one parse * we now check that GD2 extension is available if we use the HTML with graphs format * merged 0.2 branch (0.2.1) into HEAD 2006-01-10 Guillaume Smet <guillaume-pg@smet.org> * [0.2] fixed a bug on duration if log_duration was set to true submitted by David Link * [0.2] improved the sort in normalized queries reports * [0.2] released 0.2.1 2005-12-25 Guillaume Smet <guillaume-pg@smet.org> * rewrote large parts of the parser to fix various problems * added the ability to take into account duration only log lines 2005-12-22 Guillaume Smet <guillaume-pg@smet.org> * more work on graphs * tagged RELEASE_0_3 even if it is not an official release before major parser changes 2005-12-21 Guillaume Smet <guillaume-pg@smet.org> * worked on graphs for hourly reports * added all the command line stuff to manage graphs 2005-12-20 Guillaume Smet <guillaume-pg@smet.org> * added Artichow library to draw graphs 2005-12-19 Guillaume Smet <guillaume-pg@smet.org> * applied patch from Laurent Almeras to add -from and -to options (ability to filter on timestamps) * worked on hourly statistics (no pretty output yet) 2005-12-18 Guillaume Smet <guillaume-pg@smet.org> * enhanced the syslog parser to get log line timestamps * added the ability to get the timestamp of a query 2005-12-16 Guillaume Smet <guillaume-pg@smet.org> * fixed a few bugs * released 0.2 2005-11-28 Guillaume Smet <guillaume-pg@smet.org> * applied [#1000450] from Laurent Almeras 2005-11-24 Guillaume Smet <guillaume-pg@smet.org> * optimized the parsers * improved html error report and fixed text error report 2005-11-23 Guillaume Smet <guillaume-pg@smet.org> * added a Profiler class * updated the Profiler test case * implemented the Profiler in the parsers * optimized the parsers 2005-11-22 Guillaume Smet <guillaume-pg@smet.org> * added the Profiler test case * added the -profile option to command line * added the -examples option to command line 2005-11-21 Guillaume Smet <guillaume-pg@smet.org> * pgFouine should now work with PostgreSQL 8 log prefix feature * added the -onlyselect option to command line * added config functions * preliminary work on error reports * ignored more common LOG: lines which should not raise an error * fixed references to listeners in reports 2005-11-20 Guillaume Smet <guillaume-pg@smet.org> * improved SQL highlighting by adding PostgreSQL specific functions * added the ability to choose reports generated 2005-11-19 Guillaume Smet <guillaume-pg@smet.org> * released 0.1������������������������������������������������������������������������������������������������������������������������������������������������������������pgfouine-1.2/include/�������������������������������������������������������������������������������0000755�0001750�0001750�00000000000�11516212335�013206� 5����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������pgfouine-1.2/include/CsvlogLogReader.class.php������������������������������������������������������0000644�0001750�0001750�00000003540�11013243235�020042� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * This file is part of pgFouine. * * pgFouine - a PostgreSQL log analyzer * Copyright (c) 2008 Guillaume Smet * * pgFouine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * pgFouine is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pgFouine; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ require_once('lib/common.lib.php'); require_once('base.lib.php'); class CsvlogLogReader extends GenericLogReader { function readFile(& $accumulator, & $filePointer, &$lineParser, &$lineParsedCounter, &$lineDetected) { $currentTimestamp = time(); while ($csvLine = fgetcsv($filePointer)) { $lineParsedCounter ++; if(count($csvLine) == 22) { $lines =& $lineParser->parse($csvLine); if($lines) { if(!isset($this->firstLineTimestamp)) { $this->firstLineTimestamp = $lines[0]->getTimestamp(); } $this->lastLineTimestamp = $lines[0]->getTimestamp(); for($i = 0, $max = count($lines); $i < $max; $i++) { $accumulator->append($lines[$i]); } $lineDetected = true; } if($lineParsedCounter % 100000 == 0) { stderr('parsed '.$lineParsedCounter.' lines'); if(DEBUG) { $currentTime = time() - $currentTimestamp; $currentTimestamp = time(); debug(' '.getMemoryUsage()); debug(' Time: '.$currentTime.' s'); } } } } } } ?>����������������������������������������������������������������������������������������������������������������������������������������������������������������pgfouine-1.2/include/SlowestQueryList.class.php�����������������������������������������������������0000644�0001750�0001750�00000005016�10764774404�020365� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * This file is part of pgFouine. * * pgFouine - a PostgreSQL log analyzer * Copyright (c) 2005-2008 Guillaume Smet * * pgFouine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * pgFouine is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pgFouine; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class SlowestQueryList { var $size; var $queries = array(); var $queriesCount = 0; var $shortestDuration = 100000000; function SlowestQueryList($size) { $this->size = $size; } function setSize($size) { $this->size = $size; } function addQuery(&$query) { $duration = (string) $query->getDuration(); $queriesCount = $this->queriesCount; $shortestDuration = (string) $this->shortestDuration; if($queriesCount < $this->size) { if(!array_key_exists($duration, $this->queries)) { $this->queries[$duration] = array(); } $this->queries[$duration][] =& $query; $this->shortestDuration = min($shortestDuration, $duration); $this->queriesCount++; } else { if($shortestDuration < $duration) { $shortestDurationQueriesCount = count($this->queries[$shortestDuration]); if($shortestDurationQueriesCount == 1) { unset($this->queries[$shortestDuration]); } else { unset($this->queries[$shortestDuration][$shortestDurationQueriesCount - 1]); } if(!array_key_exists($duration, $this->queries)) { $this->queries[$duration] = array(); } $this->queries[$duration][] =& $query; $this->shortestDuration = min(array_keys($this->queries)); } } } function & getQueries() { return $this->queries; } function & getSortedQueries() { $queryList = array(); krsort($this->queries, SORT_NUMERIC); $keys = array_keys($this->queries); foreach($keys AS $key) { $queryArrayCount = count($this->queries[$key]); for($i = 0; $i < $queryArrayCount; $i++) { $queryList[] =& $this->queries[$key][$i]; } } return $queryList; } function & getLastQuery() { $queryList =& last($this->queries); return last($queryList); } } ?>������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������pgfouine-1.2/include/NormalizedQuery.class.php������������������������������������������������������0000644�0001750�0001750�00000005257�10764774404�020204� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * This file is part of pgFouine. * * pgFouine - a PostgreSQL log analyzer * Copyright (c) 2005-2008 Guillaume Smet * * pgFouine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * pgFouine is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pgFouine; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class NormalizedQuery { var $normalizedText; var $duration = 0; var $count = 0; var $examples = false; var $hourlyStatistics = array(); function NormalizedQuery(& $query) { $this->normalizedText = $query->getNormalizedText(); $maxExamples = CONFIG_MAX_NUMBER_OF_EXAMPLES; if($maxExamples) { $this->examples = new SlowestQueryList($maxExamples); } $this->addQuery($query); } function addQuery(& $query) { $this->count ++; $this->duration += $query->getDuration(); $formattedTimestamp = date('Y-m-d H:00:00', $query->getTimestamp()); if(!isset($this->hourlyStatistics[$formattedTimestamp])) { $this->hourlyStatistics[$formattedTimestamp]['count'] = 0; $this->hourlyStatistics[$formattedTimestamp]['duration'] = 0; } $this->hourlyStatistics[$formattedTimestamp]['count']++; $this->hourlyStatistics[$formattedTimestamp]['duration']+= $query->getDuration(); if($this->examples) { $this->examples->addQuery($query); } } function & getQuery() { return $this->examples->getLastQuery(); } function getNormalizedText() { return $this->normalizedText; } function getTotalDuration() { return $this->duration; } function getTimesExecuted() { return $this->count; } function getAverageDuration() { $average = 0; if($this->count > 0) { $average = ($this->duration/$this->count); } return $average; } function & getFilteredExamplesArray() { $returnExamples = false; $examples =& $this->examples->getSortedQueries(); $exampleCount = count($examples); for($i = 0; $i < $exampleCount; $i++) { $example =& $examples[$i]; if($example->getText() != $this->getNormalizedText()) { return $examples; } unset($example); } $examples = array(); return $examples; } function & getHourlyStatistics() { ksort($this->hourlyStatistics); return $this->hourlyStatistics; } } ?>�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������pgfouine-1.2/include/listeners/���������������������������������������������������������������������0000755�0001750�0001750�00000000000�11516212335�015216� 5����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������pgfouine-1.2/include/listeners/query/���������������������������������������������������������������0000755�0001750�0001750�00000000000�11516212335�016363� 5����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������pgfouine-1.2/include/listeners/query/QueriesHistoryListener.class.php�������������������������������0000644�0001750�0001750�00000003740�10764775351�024731� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * This file is part of pgFouine. * * pgFouine - a PostgreSQL log analyzer * Copyright (c) 2006-2008 Guillaume Smet * * pgFouine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * pgFouine is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pgFouine; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class QueriesHistoryListener extends QueryListener { var $queries = array(); var $counter = 0; function fireEvent(& $logObject) { $this->counter ++; $logObject->setNumber($this->counter); $this->queries[] =& $logObject; } function & getQueriesHistory() { usort($this->queries, array($this, 'compareTimestamp')); return $this->queries; } function & getQueriesHistoryPerConnection() { usort($this->queries, array($this, 'compareConnectionId')); return $this->queries; } function compareConnectionId(& $a, & $b) { if($a->getConnectionId() == $b->getConnectionId()) { return $this->compareTimestamp($a, $b); } elseif($a->getConnectionId() < $b->getConnectionId()) { return -1; } else { return 1; } } function compareTimestamp(& $a, & $b) { if($a->getTimestamp() == $b->getTimestamp()) { return $this->compareNumber($a, $b); } elseif($a->getTimestamp() < $b->getTimestamp()) { return -1; } else { return 1; } } function compareNumber(& $a, & $b) { if($a->getNumber() == $b->getNumber()) { return 0; } elseif($a->getNumber() < $b->getNumber()) { return -1; } else { return 1; } } } ?>��������������������������������pgfouine-1.2/include/listeners/query/GlobalCountersListener.class.php�������������������������������0000644�0001750�0001750�00000006702�10764774405�024655� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * This file is part of pgFouine. * * pgFouine - a PostgreSQL log analyzer * Copyright (c) 2005-2008 Guillaume Smet * * pgFouine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * pgFouine is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pgFouine; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class GlobalCountersListener extends QueryListener { var $counter; var $firstQueryTimestamp = MAX_TIMESTAMP; var $lastQueryTimestamp = MIN_TIMESTAMP; var $queryPeakByTimestamp = array(); function GlobalCountersListener() { $this->counter = new QueryCounter(); } function fireEvent(& $logObject) { $objectTimestamp = $logObject->getTimestamp(); $this->firstQueryTimestamp = min($objectTimestamp, $this->firstQueryTimestamp); $this->lastQueryTimestamp = max($objectTimestamp, $this->lastQueryTimestamp); $this->counter->incrementQuery($logObject->getDuration()); if($logObject->getEventType() == EVENT_QUERY) { $this->counter->incrementIdentifiedQuery($logObject->getDuration()); if($logObject->isSelect()) { $this->counter->incrementSelect($logObject->getDuration()); } elseif($logObject->isUpdate()) { $this->counter->incrementUpdate($logObject->getDuration()); } elseif($logObject->isInsert()) { $this->counter->incrementInsert($logObject->getDuration()); } elseif($logObject->isDelete()) { $this->counter->incrementDelete($logObject->getDuration()); } } if(!isset($this->queryPeakByTimestamp[$objectTimestamp])) { $this->queryPeakByTimestamp[$objectTimestamp] = 0; } $this->queryPeakByTimestamp[$objectTimestamp] ++; } function getSubscriptions() { return array_merge(parent::getSubscriptions(), array(EVENT_DURATION_ONLY)); } function getQueryCount() { return $this->counter->getQueryCount(); } function getQueryDuration() { return $this->counter->getQueryDuration(); } function getIdentifiedQueryCount() { return $this->counter->getIdentifiedQueryCount(); } function getIdentifiedQueryDuration() { return $this->counter->getIdentifiedQueryDuration(); } function getSelectCount() { return $this->counter->getSelectCount(); } function getUpdateCount() { return $this->counter->getUpdateCount(); } function getInsertCount() { return $this->counter->getInsertCount(); } function getDeleteCount() { return $this->counter->getDeleteCount(); } function getFirstQueryTimestamp() { return $this->firstQueryTimestamp; } function getLastQueryTimestamp() { return $this->lastQueryTimestamp; } function getQueryPeakTimestamps() { $peakTimestamps = false; if(!empty($this->queryPeakByTimestamp)) { $peakTimestamps = array_keys($this->queryPeakByTimestamp, max($this->queryPeakByTimestamp)); } return $peakTimestamps; } function getQueryPeakQueryCount() { $peakQueryCount = false; if(!empty($this->queryPeakByTimestamp)) { $peakQueryCount = max($this->queryPeakByTimestamp); } return $peakQueryCount; } } ?>��������������������������������������������������������������pgfouine-1.2/include/listeners/query/HourlyCountersListener.class.php�������������������������������0000644�0001750�0001750�00000004754�10764774405�024744� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * This file is part of pgFouine. * * pgFouine - a PostgreSQL log analyzer * Copyright (c) 2005-2008 Guillaume Smet * * pgFouine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * pgFouine is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pgFouine; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class HourlyCountersListener extends QueryListener { var $hourlyStatistics = array(); var $queryPeaksStatistics = array(); function fireEvent(& $logObject) { $objectTimestamp = $logObject->getTimestamp(); $formattedTimestamp = date('Y-m-d H:00:00', $objectTimestamp); if(!isset($this->hourlyStatistics[$formattedTimestamp])) { $this->hourlyStatistics[$formattedTimestamp] = new QueryCounter(); } $queryCounter =& $this->hourlyStatistics[$formattedTimestamp]; $queryCounter->incrementQuery($logObject->getDuration()); if($logObject->getEventType() == EVENT_QUERY) { $queryCounter->incrementIdentifiedQuery($logObject->getDuration()); if($logObject->isSelect()) { $queryCounter->incrementSelect($logObject->getDuration()); } elseif($logObject->isUpdate()) { $queryCounter->incrementUpdate($logObject->getDuration()); } elseif($logObject->isInsert()) { $queryCounter->incrementInsert($logObject->getDuration()); } elseif($logObject->isDelete()) { $queryCounter->incrementDelete($logObject->getDuration()); } } $mainKey = $objectTimestamp - ($objectTimestamp % (5*60)); if(!isset($this->queryPeaksStatistics[$mainKey][$objectTimestamp])) { $this->queryPeaksStatistics[$mainKey][$objectTimestamp] = 0; } $this->queryPeaksStatistics[$mainKey][$objectTimestamp] ++; } function getSubscriptions() { return array_merge(parent::getSubscriptions(), array(EVENT_DURATION_ONLY)); } function & getHourlyStatistics() { ksort($this->hourlyStatistics); return $this->hourlyStatistics; } function & getQueryPeaksStatistics() { ksort($this->queryPeaksStatistics); return $this->queryPeaksStatistics; } } ?>��������������������pgfouine-1.2/include/listeners/query/QueryListener.class.php����������������������������������������0000644�0001750�0001750�00000001772�10764774405�023041� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * This file is part of pgFouine. * * pgFouine - a PostgreSQL log analyzer * Copyright (c) 2005-2008 Guillaume Smet * * pgFouine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * pgFouine is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pgFouine; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class QueryListener { function fireEvent(& $query) { } function close() { //print_r($this); } function getSubscriptions() { return array(EVENT_QUERY); } } ?>������pgfouine-1.2/include/listeners/query/PrintQueryListener.class.php�����������������������������������0000644�0001750�0001750�00000001672�10764774405�024055� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * This file is part of pgFouine. * * pgFouine - a PostgreSQL log analyzer * Copyright (c) 2005-2008 Guillaume Smet * * pgFouine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * pgFouine is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pgFouine; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class PrintQueryListener extends QueryListener { function fireEvent(& $query) { print_r($query); } } ?>����������������������������������������������������������������������pgfouine-1.2/include/listeners/query/TsungSessionsListener.class.php��������������������������������0000644�0001750�0001750�00000002357�10764775351�024564� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * This file is part of pgFouine. * * pgFouine - a PostgreSQL log analyzer * Copyright (c) 2006-2008 Guillaume Smet * * pgFouine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * pgFouine is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pgFouine; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class TsungSessionsListener extends QueryListener { var $sessions = array(); function fireEvent(& $logObject) { $connectionId = $logObject->getConnectionId() ? $logObject->getConnectionId() : 0; if(!isset($this->sessions[$connectionId])) { $this->sessions[$connectionId] = array(); } $this->sessions[$connectionId][] =& $logObject; } function & getSessions() { return $this->sessions; } } ?>���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������pgfouine-1.2/include/listeners/query/NormalizedQueriesListener.class.php����������������������������0000644�0001750�0001750�00000005535�10764774405�025377� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * This file is part of pgFouine. * * pgFouine - a PostgreSQL log analyzer * Copyright (c) 2005-2008 Guillaume Smet * * pgFouine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * pgFouine is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pgFouine; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class NormalizedQueriesListener extends QueryListener { var $queryList = array(); var $queriesNumber = 10; function NormalizedQueriesListener() { $this->queriesNumber = CONFIG_TOP_QUERIES_NUMBER; } function fireEvent(& $query) { $normalizedText = $query->getNormalizedText(); if(isset($this->queryList[$normalizedText])) { $this->queryList[$normalizedText]->addQuery($query); } else { $this->queryList[$normalizedText] = new NormalizedQuery($query); } } function & getQueriesMostTime() { $queryList = $this->queryList; usort($queryList, array($this, 'compareMostTime')); $queries =& array_slice($queryList, 0, $this->queriesNumber); return $queries; } function compareMostTime(& $a, & $b) { if($a->getTotalDuration() == $b->getTotalDuration()) { return 0; } elseif($a->getTotalDuration() < $b->getTotalDuration()) { return 1; } else { return -1; } } function & getMostFrequentQueries() { $queryList = $this->queryList; usort($queryList, array($this, 'compareMostFrequent')); $queries =& array_slice($queryList, 0, $this->queriesNumber); return $queries; } function compareMostFrequent(& $a, & $b, $force = false) { if($a->getTimesExecuted() == $b->getTimesExecuted()) { if($force) { return 0; } else { return $this->compareSlowest($a, $b, true); } } elseif($a->getTimesExecuted() < $b->getTimesExecuted()) { return 1; } else { return -1; } } function & getSlowestQueries() { $queryList = $this->queryList; usort($queryList, array($this, 'compareSlowest')); $queries =& array_slice($queryList, 0, $this->queriesNumber); return $queries; } function compareSlowest(& $a, & $b, $force = false) { if($a->getAverageDuration() == $b->getAverageDuration()) { if($force) { return 0; } else { return $this->compareMostFrequent($a, $b, true); } } elseif($a->getAverageDuration() < $b->getAverageDuration()) { return 1; } else { return -1; } } function getUniqueQueryCount() { return count($this->queryList); } } ?>�������������������������������������������������������������������������������������������������������������������������������������������������������������������pgfouine-1.2/include/listeners/query/SlowestQueriesListener.class.php�������������������������������0000644�0001750�0001750�00000002315�10764774405�024724� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * This file is part of pgFouine. * * pgFouine - a PostgreSQL log analyzer * Copyright (c) 2005-2008 Guillaume Smet * * pgFouine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * pgFouine is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pgFouine; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class SlowestQueriesListener extends QueryListener { var $queryList; function SlowestQueriesListener() { $this->queryList = new SlowestQueryList(CONFIG_TOP_QUERIES_NUMBER); } function fireEvent(& $query) { $this->queryList->addQuery($query); } function & getSortedQueries() { $sortedQueries =& $this->queryList->getSortedQueries(); return $sortedQueries; } } ?>�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������pgfouine-1.2/include/listeners/error/���������������������������������������������������������������0000755�0001750�0001750�00000000000�11516212335�016347� 5����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������pgfouine-1.2/include/listeners/error/NormalizedErrorsListener.class.php�����������������������������0000644�0001750�0001750�00000003466�10764774377�025233� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * This file is part of pgFouine. * * pgFouine - a PostgreSQL log analyzer * Copyright (c) 2005-2008 Guillaume Smet * * pgFouine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * pgFouine is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pgFouine; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class NormalizedErrorsListener extends ErrorListener { var $errorsList = array(); var $errorsNumber = 10; function NormalizedErrorsListener() { $this->errorsNumber = CONFIG_TOP_QUERIES_NUMBER; } function fireEvent(& $error) { $normalizedText = $error->getNormalizedText(); if(isset($this->errorsList[$normalizedText])) { $this->errorsList[$normalizedText]->addError($error); } else { $this->errorsList[$normalizedText] = new NormalizedError($error); } } function & getMostFrequentErrors() { $errorsList = $this->errorsList; usort($errorsList, array($this, 'compareMostFrequent')); $errors =& array_slice($errorsList, 0, $this->errorsNumber); return $errors; } function compareMostFrequent(& $a, & $b) { if($a->getTimesExecuted() == $b->getTimesExecuted()) { return 0; } elseif($a->getTimesExecuted() < $b->getTimesExecuted()) { return 1; } else { return -1; } } function getUniqueErrorCount() { return count($this->errorsList); } } ?>����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������pgfouine-1.2/include/listeners/error/PrintErrorListener.class.php�����������������������������������0000644�0001750�0001750�00000001672�10764774377�024035� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * This file is part of pgFouine. * * pgFouine - a PostgreSQL log analyzer * Copyright (c) 2005-2008 Guillaume Smet * * pgFouine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * pgFouine is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pgFouine; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class PrintErrorListener extends ErrorListener { function fireEvent(& $query) { print_r($query); } } ?>����������������������������������������������������������������������pgfouine-1.2/include/listeners/error/ErrorListener.class.php����������������������������������������0000644�0001750�0001750�00000001746�10764774377�023022� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * This file is part of pgFouine. * * pgFouine - a PostgreSQL log analyzer * Copyright (c) 2005-2008 Guillaume Smet * * pgFouine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * pgFouine is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pgFouine; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class ErrorListener { function fireEvent(& $query) { } function close() { } function getSubscriptions() { return array(EVENT_ERROR); } } ?>��������������������������pgfouine-1.2/include/listeners/error/GlobalErrorCountersListener.class.php��������������������������0000644�0001750�0001750�00000002034�10764774377�025655� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * This file is part of pgFouine. * * pgFouine - a PostgreSQL log analyzer * Copyright (c) 2005-2008 Guillaume Smet * * pgFouine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * pgFouine is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pgFouine; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class GlobalErrorCountersListener extends ErrorListener { var $errorCount = 0; function fireEvent(& $error) { $this->errorCount++; } function getErrorCount() { return $this->errorCount; } } ?>����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������pgfouine-1.2/include/listeners/listeners.lib.php����������������������������������������������������0000644�0001750�0001750�00000002741�10764774405�020527� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * This file is part of pgFouine. * * pgFouine - a PostgreSQL log analyzer * Copyright (c) 2005-2008 Guillaume Smet * * pgFouine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * pgFouine is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pgFouine; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ require_once('query/QueryListener.class.php'); require_once('query/PrintQueryListener.class.php'); require_once('query/GlobalCountersListener.class.php'); require_once('query/HourlyCountersListener.class.php'); require_once('query/SlowestQueriesListener.class.php'); require_once('query/NormalizedQueriesListener.class.php'); require_once('query/QueriesHistoryListener.class.php'); require_once('query/TsungSessionsListener.class.php'); require_once('error/ErrorListener.class.php'); require_once('error/PrintErrorListener.class.php'); require_once('error/GlobalErrorCountersListener.class.php'); require_once('error/NormalizedErrorsListener.class.php'); ?>�������������������������������pgfouine-1.2/include/PreparedStatementLogObject.class.php�������������������������������������������0000644�0001750�0001750�00000005260�10764775351�022266� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * This file is part of pgFouine. * * pgFouine - a PostgreSQL log analyzer * Copyright (c) 2006-2008 Guillaume Smet * * pgFouine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * pgFouine is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pgFouine; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class PreparedStatementLogObject extends QueryLogObject { var $name; var $portalName; var $parameters = array(); function PreparedStatementLogObject($connectionId, $user, $db, $name, $portalName, $text = '', $ignored = false) { $this->QueryLogObject($connectionId, $user, $db, $text, $ignored); } function appendDetail($detail) { global $postgreSQLRegexps; // if we use queries, the text of the query is in the DETAIL line $prepareDetailMatch =& $postgreSQLRegexps['PrepareDetail']->match($detail); if($prepareDetailMatch) { $this->text = $prepareDetailMatch->getPostMatch(); } // if we use the v3 protocol, bind information are in the DETAIL line below the execute line $bindDetailMatch =& $postgreSQLRegexps['BindDetail']->match($detail); if($bindDetailMatch) { $bindParametersMatch = $postgreSQLRegexps['BindParameters']->matchAll($bindDetailMatch->getPostMatch()); $replace = array(); for($i = 0; $i < count($bindParametersMatch); $i++) { $key = $bindParametersMatch[$i][1]; $value = $bindParametersMatch[$i][2]; if(substr($value, 0, 1) == "'") { $trimmedValue = substr($bindParametersMatch[$i][2], 1, -1); if(is_numeric($trimmedValue)) { $value = $trimmedValue; } } $this->parameters[$key] = $value; } } $this->buildQueryText(); } function setParameters($parameters) { $this->parameters = array(); for($i = 0; $i < count($parameters); $i++) { $this->parameters['$'.($i+1)] = $parameters[$i]; } $this->buildQueryText(); } function buildQueryText() { if(count($this->parameters) > 0) { foreach($this->parameters as $key => $value) { $trimmedValue = trim($value, "'"); if(is_numeric($trimmedValue)) { $replace[$key] = $trimmedValue; } else { $replace[$key] = $value; } } $this->text = strtr($this->text, $replace); } } } ?>������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������pgfouine-1.2/include/NormalizedError.class.php������������������������������������������������������0000644�0001750�0001750�00000005016�10764774404�020161� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * This file is part of pgFouine. * * pgFouine - a PostgreSQL log analyzer * Copyright (c) 2005-2008 Guillaume Smet * * pgFouine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * pgFouine is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pgFouine; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class NormalizedError { var $normalizedText; var $error = ''; var $hint = ''; var $detail = ''; var $textIsAStatement = false; var $examples = array(); var $count = 0; var $hourlyStatistics = array(); function NormalizedError(& $error) { $this->normalizedText = $error->getNormalizedText(); $this->error = $error->getError(); $this->hint = $error->getHint(); $this->detail = $error->getDetail(); $this->textIsAStatement = $error->isTextAStatement(); $this->addError($error); } function addError(& $error) { $this->count ++; if(count($this->examples) < CONFIG_MAX_NUMBER_OF_EXAMPLES) { $this->examples[] =& $error; } $formattedTimestamp = date('Y-m-d H:00:00', $error->getTimestamp()); if(!isset($this->hourlyStatistics[$formattedTimestamp])) { $this->hourlyStatistics[$formattedTimestamp]['count'] = 0; } $this->hourlyStatistics[$formattedTimestamp]['count']++; } function getNormalizedText() { return $this->normalizedText; } function getError() { return $this->error; } function getTimesExecuted() { return $this->count; } function & getFilteredExamplesArray() { $examples = array(); $exampleCount = count($this->examples); for($i = 0; $i < $exampleCount; $i++) { $example =& $this->examples[$i]; if($example->getText() != $this->getNormalizedText()) { $examples =& $this->examples; break; } unset($example); } return $examples; } function getDetail() { return $this->detail; } function getHint() { return $this->hint; } function isTextAStatement() { return $this->textIsAStatement; } function & getHourlyStatistics() { ksort($this->hourlyStatistics); return $this->hourlyStatistics; } } ?>������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������pgfouine-1.2/include/Accumulator.class.php����������������������������������������������������������0000644�0001750�0001750�00000004330�11170362313�017300� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * This file is part of pgFouine. * * pgFouine - a PostgreSQL log analyzer * Copyright (c) 2005-2008 Guillaume Smet * * pgFouine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * pgFouine is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pgFouine; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /** * the accumulator is the central point of the analyzer * * - we append the lines to the right log streams via the accumulator * - when a log object is identified, the accumulator fires the event * to all the listeners */ class Accumulator { var $listeners = array(); function append(& $line) { } function addListener($eventType, & $listener) { $this->listeners[$eventType][] =& $listener; } function fireEvent(& $logObject) { $listeners =& $this->listeners[$logObject->getEventType()]; $countListeners = count($listeners); for($i = 0; $i < $countListeners; $i++) { $listener =& $listeners[$i]; $listener->fireEvent($logObject); unset($listener); } } /** * close the accumulator by: * - flushing the log streams * - closing all the existing listeners */ function close() { $this->flushLogStreams(); $this->closeListeners(); } /** * flush the log streams */ function flushLogStreams() { } /** * run the garbage collector */ function garbageCollect($lastLineTimestamp) { } /** * closes all the listeners */ function closeListeners() { $eventTypes = array_keys($this->listeners); foreach($eventTypes AS $eventType) { $listenerCount = count($this->listeners[$eventType]); for($i = 0; $i < $listenerCount; $i++) { $listener =& $this->listeners[$eventType][$i]; $listener->close(); unset($listener); } } } } ?>��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������pgfouine-1.2/include/Parser.class.php���������������������������������������������������������������0000644�0001750�0001750�00000001601�10764774404�016273� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * This file is part of pgFouine. * * pgFouine - a PostgreSQL log analyzer * Copyright (c) 2005-2008 Guillaume Smet * * pgFouine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * pgFouine is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pgFouine; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class Parser { function & parse($text) { } } ?>�������������������������������������������������������������������������������������������������������������������������������pgfouine-1.2/include/DurationLogObject.class.php����������������������������������������������������0000644�0001750�0001750�00000002235�10764774404�020421� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * This file is part of pgFouine. * * pgFouine - a PostgreSQL log analyzer * Copyright (c) 2005-2008 Guillaume Smet * * pgFouine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * pgFouine is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pgFouine; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class DurationLogObject extends LogObject { var $duration; function DurationLogObject($connectionId, $user, $db, $duration) { $this->LogObject($connectionId, $user, $db); $this->duration = $duration; } function getEventType() { return EVENT_DURATION_ONLY; } function getDuration() { return $this->duration; } } ?>�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������pgfouine-1.2/include/base.lib.php�������������������������������������������������������������������0000644�0001750�0001750�00000002757�11013243235�015404� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * This file is part of pgFouine. * * pgFouine - a PostgreSQL log analyzer * Copyright (c) 2005-2008 Guillaume Smet * * pgFouine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * pgFouine is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pgFouine; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ require_once('lib/Profiler.class.php'); require_once('Accumulator.class.php'); require_once('Parser.class.php'); require_once('LogBlock.class.php'); require_once('LogStream.class.php'); require_once('LogObject.class.php'); require_once('QueryLogObject.class.php'); require_once('PreparedStatementLogObject.class.php'); require_once('DurationLogObject.class.php'); require_once('ErrorLogObject.class.php'); require_once('UselessLogObject.class.php'); require_once('GenericLogReader.class.php'); require_once('CsvlogLogReader.class.php'); require_once('SlowestQueryList.class.php'); require_once('NormalizedQuery.class.php'); require_once('NormalizedError.class.php'); ?>�����������������pgfouine-1.2/include/LogBlock.class.php�������������������������������������������������������������0000644�0001750�0001750�00000007322�10764774404�016541� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * This file is part of pgFouine. * * pgFouine - a PostgreSQL log analyzer * Copyright (c) 2005-2008 Guillaume Smet * * pgFouine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * pgFouine is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pgFouine; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /** * A log block is a set of lines we identified as belonging to the * same PostgreSQL log object (a statement, an error...). * * When a log block is complete, we can parse it to build a log object. * The completion of a node is decided by the line objects we add in this * block. * * Even if we have a command number in the log block, you can have lines with different * command numbers in the same log block. PostgreSQL does not log all the lines associated * with a log object with the same command number (for example, when you use log_statement * and log_duration, the statement text and the duration are logged with different command * numbers). */ class LogBlock { var $logStream; var $commandNumber; var $lines = array(); var $complete = false; var $lastLineNumber = 0; function LogBlock(& $logStream, $commandNumber, & $line) { $this->logStream =& $logStream; $this->commandNumber = $commandNumber; $this->addLine($line); } /** * returns the command number currently associated with the log block * * @return int command number */ function getCommandNumber() { return $this->commandNumber; } /** * returns the line number associated with the last line added to the block * * @return int line number */ function getLastLineNumber() { return $this->lastLineNumber; } /** * returns an array containing all the log lines added to the block * * @return array lines */ function & getLines() { return $this->lines; } /** * returns the number of lines added * * @return int count */ function getLineCount() { return count($this->lines); } /** * returns the first line added to the block or false if the block is empty * * @return mixed first log line */ function & getFirstLine() { if(isset($this->lines[0])) { $line =& $this->lines[0]; } else { $line = false; } return $line; } /** * adds a log line to our block. If the line is a candidate to complete the log * block, it declares the log block as complete. * * @param object $line the line to add */ function addLine(& $line) { $this->complete = $this->complete || $line->complete(); $this->lastLineNumber = $line->getLineNumber(); $this->lines[] =& $line; } /** * returns true if the log block is declared complete * * @return boolean true if complete */ function isComplete() { return $this->complete; } /** * closes the log block and builds a log object from the lines previously added * to the block * * @return object log object */ function & close() { $count = count($this->lines); $logObject =& $this->lines[0]->getLogObject($this->logStream); if($logObject && !$logObject->isIgnored()) { for($i = 1; $i < $count; $i++) { $this->lines[$i]->appendTo($logObject); } } if(is_a($logObject, 'UselessLogObject')) { unset($logObject); $logObject = false; } return $logObject; } } ?>��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������pgfouine-1.2/include/reporting/���������������������������������������������������������������������0000755�0001750�0001750�00000000000�11516212335�015217� 5����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������pgfouine-1.2/include/reporting/HtmlReportAggregator.class.php���������������������������������������0000644�0001750�0001750�00000014343�11244576733�023161� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * This file is part of pgFouine. * * pgFouine - a PostgreSQL log analyzer * Copyright (c) 2005-2008 Guillaume Smet * * pgFouine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * pgFouine is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pgFouine; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class HtmlReportAggregator extends ReportAggregator { var $geshi; var $stylesheets = array('common.css'); var $scripts = array(); function HtmlReportAggregator(& $logReader, $outputFilePath = false) { $this->ReportAggregator($logReader, $outputFilePath); $this->geshi = new GeSHi('', 'sql'); $this->geshi->enable_classes(); $this->geshi->set_header_type(GESHI_HEADER_NONE); } function addStylesheet($stylesheetPath) { $this->stylesheets[] = $stylesheetPath; } function addScript($scriptPath) { $this->scripts[] = $scriptPath; } function highlightSql($sql, $prepend = '', $append = '') { if(substr($sql, -1, 1) != ';') { $sql .= ';'; } $this->geshi->set_source($sql); return '<div class="sql">'.$prepend.$this->geshi->parse_code().$append.'</div>'; } function getHeader() { $header = ' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>'.htmlspecialchars(CONFIG_REPORT_TITLE).'

'.htmlspecialchars(CONFIG_REPORT_TITLE).'

'; return $header; } function getBody() { $count = count($this->reportBlocks); $reportsOutput = ''; $menu = ''; $output = $menu."\n"; if($hasNormalizedReports) { $output .= '

Normalized reports are marked with a "(N)".

'; } $output .= '
    '. '
  • Generated on '.date('Y-m-d H:i').'
  • '. '
  • Parsed '.$this->getFileName().' ('.$this->formatInteger($this->getLineParsedCount()).' lines) in '.$this->formatLongDuration($this->getTimeToParse(), 0).'
  • '; if($this->getFirstLineTimestamp() || $this->getLastLineTimestamp()) { $output .= '
  • Log from '.$this->formatTimestamp($this->getFirstLineTimestamp()).' to '.$this->formatTimestamp($this->getLastLineTimestamp()).'
  • '; } if($hostname = getenv('HOSTNAME')) { $output .= '
  • Executed on '.$hostname.'
  • '; } if(CONFIG_FILTER) { $output .= '
  • Filtered on '.CONFIG_FILTER.'
  • '; } $output .= '
'; $output .= '
'; $output .= $reportsOutput; $output .= '
'; return $output; } function getHtmlOutput(& $reportBlock) { return $reportBlock->getHtml(); } function getFooter() { $footer = '
Table of contents
'; return $footer; } function getStyles() { $styles = ''; $this->stylesheets = array_unique($this->stylesheets); foreach($this->stylesheets AS $stylesheetPath) { $styles .= "\n/* ".$stylesheetPath." */\n"; $styles .= $this->getWebFileContent('css/'.$stylesheetPath); $styles .= "\n"; } $styles .= $this->geshi->get_stylesheet(); return $styles; } function getScripts() { $scripts = ''; $this->scripts = array_unique($this->scripts); foreach($this->scripts AS $scriptPath) { $scripts .= "\n/* ".$scriptPath." */\n"; $scripts .= $this->getWebFileContent('js/'.$scriptPath); $scripts .= "\n"; } return $scripts; } function getWebFileContent($path) { ob_start(); include('web/'.$path); $content = ob_get_contents(); ob_end_clean(); return $content; } function formatRealQuery(& $query, $prepend = '', $append = '') { $html = $this->highlightSql($this->shortenQueryText($query->getText()), $prepend, $append); $notices = $query->getNotices(); foreach($notices AS $notice) { $html .= '
Notice: '.$notice.'
'; } if($query->getLocation()) { $html .= '
Location: '.$query->getLocation().'
'; } return $html; } function getWebContent() { } } ?>pgfouine-1.2/include/reporting/artichow/0000755000175000017500000000000011516212335017037 5ustar acmeacmepgfouine-1.2/include/reporting/artichow/php4/0000755000175000017500000000000011516212335017712 5ustar acmeacmepgfouine-1.2/include/reporting/artichow/php4/Plot.class.php0000644000175000017500000006514311012376766022470 0ustar acmeacme */ define("PLOT_LEFT", 'left'); define("PLOT_RIGHT", 'right'); define("PLOT_TOP", 'top'); define("PLOT_BOTTOM", 'bottom'); define("PLOT_BOTH", 'both'); /* */ /** * Graph using X and Y axis * * @package Artichow */ class awPlot extends awComponent { /** * Values for Y axis * * @var array */ var $datay; /** * Values for X axis * * @var array */ var $datax; /** * Grid properties * * @var Grid */ var $grid; /** * X axis * * @var Axis */ var $xAxis; /** * Y axis * * @var Axis */ var $yAxis; /** * Position of X axis * * @var int */ var $xAxisPosition = PLOT_BOTTOM; /** * Set X axis on zero ? * * @var bool */ var $xAxisZero = TRUE; /** * Set Y axis on zero ? * * @var bool */ var $yAxisZero = FALSE; /** * Position of Y axis * * @var int */ var $yAxisPosition = PLOT_LEFT; /** * Change min value for Y axis * * @var mixed */ var $yMin = NULL; /** * Change max value for Y axis * * @var mixed */ var $yMax = NULL; /** * Change min value for X axis * * @var mixed */ var $xMin = NULL; /** * Change max value for X axis * * @var mixed */ var $xMax = NULL; /** * Left axis * * @var int */ /** * RIGHT axis * * @var int */ /** * Top axis * * @var int */ /** * Bottom axis * * @var int */ /** * Both left/right or top/bottom axis * * @var int */ /** * Build the plot * */ function awPlot() { parent::awComponent(); $this->grid = new awGrid; $this->grid->setBackgroundColor(new awWhite); $this->padding->add(20, 0, 0, 20); $this->xAxis = new awAxis; $this->xAxis->addTick('major', new awTick(0, 5)); $this->xAxis->addTick('minor', new awTick(0, 3)); $this->xAxis->setTickStyle(TICK_OUT); $this->xAxis->label->setFont(new awDejaVuSans(7)); $this->yAxis = new awAxis; $this->yAxis->auto(TRUE); $this->yAxis->addTick('major', new awTick(0, 5)); $this->yAxis->addTick('minor', new awTick(0, 3)); $this->yAxis->setTickStyle(TICK_OUT); $this->yAxis->setNumberByTick('minor', 'major', 3); $this->yAxis->label->setFont(new awDejaVuSans(7)); $this->yAxis->title->setAngle(90); } /** * Get plot values * * @return array */ function getValues() { return $this->datay; } /** * Reduce number of values in the plot * * @param int $number Reduce number of values to $number */ function reduce($number) { $count = count($this->datay); $ratio = ceil($count / $number); if($ratio > 1) { $tmpy = $this->datay; $datay = array(); $datax = array(); $cbLabel = $this->xAxis->label->getCallbackFunction(); for($i = 0; $i < $count; $i += $ratio) { $slice = array_slice($tmpy, $i, $ratio); $datay[] = array_sum($slice) / count($slice); // Reduce data on X axis if needed if($cbLabel !== NULL) { $datax[] = $cbLabel($i + round($ratio / 2)); } } $this->setValues($datay); if($cbLabel !== NULL) { $this->xAxis->setLabelText($datax); } } } /** * Count values in the plot * * @return int */ function getXAxisNumber() { list($min, $max) = $this->xAxis->getRange(); return ($max - $min + 1); } /** * Change X axis * * @param int $axis */ function setXAxis($axis) { $this->xAxisPosition = $axis; } /** * Get X axis * * @return int */ function getXAxis() { return $this->xAxisPosition; } /** * Set X axis on zero * * @param bool $zero */ function setXAxisZero($zero) { $this->xAxisZero = (bool)$zero; } /** * Set Y axis on zero * * @param bool $zero */ function setYAxisZero($zero) { $this->yAxisZero = (bool)$zero; } /** * Change Y axis * * @param int $axis */ function setYAxis($axis) { $this->yAxisPosition = $axis; } /** * Get Y axis * * @return int */ function getYAxis() { return $this->yAxisPosition; } /** * Change min value for Y axis * Set NULL for auto selection. * * @param float $value */ function setYMin($value) { $this->yMin = $value; $this->yAxis->auto(FALSE); $this->updateAxis(); } /** * Change max value for Y axis * Set NULL for auto selection. * * @param float $value */ function setYMax($value) { $this->yMax = $value; $this->yAxis->auto(FALSE); $this->updateAxis(); } /** * Change min value for X axis * Set NULL for auto selection. * * @param float $value */ function setXMin($value) { $this->xMin = $value; $this->updateAxis(); } /** * Change max value for X axis * Set NULL for auto selection. * * @param float $value */ function setXMax($value) { $this->xMax = $value; $this->updateAxis(); } /** * Get min value for Y axis * * @return float $value */ function getYMin() { if($this->auto) { if(is_null($this->yMin)) { $min = array_min($this->datay); if($min > 0) { return 0; } } } return is_null($this->yMin) ? array_min($this->datay) : (float)$this->yMin; } /** * Get max value for Y axis * * @return float $value */ function getYMax() { if($this->auto) { if(is_null($this->yMax)) { $max = array_max($this->datay); if($max < 0) { return 0; } } } return is_null($this->yMax) ? array_max($this->datay) : (float)$this->yMax; } /** * Get min value for X axis * * @return float $value */ function getXMin() { return floor(is_null($this->xMin) ? array_min($this->datax) : $this->xMin); } /** * Get max value for X axis * * @return float $value */ function getXMax() { return (ceil(is_null($this->xMax) ? array_max($this->datax) : (float)$this->xMax)) + ($this->getXCenter() ? 1 : 0); } /** * Get min value with spaces for Y axis * * @return float $value */ function getRealYMin() { $min = $this->getYMin(); if($this->space->bottom !== NULL) { $interval = ($this->getYMax() - $min) * $this->space->bottom / 100; return $min - $interval; } else { return is_null($this->yMin) ? $min : (float)$this->yMin; } } /** * Get max value with spaces for Y axis * * @return float $value */ function getRealYMax() { $max = $this->getYMax(); if($this->space->top !== NULL) { $interval = ($max - $this->getYMin()) * $this->space->top / 100; return $max + $interval; } else { return is_null($this->yMax) ? $max : (float)$this->yMax; } } function init($drawer) { list($x1, $y1, $x2, $y2) = $this->getPosition(); // Get space informations list($leftSpace, $rightSpace, $topSpace, $bottomSpace) = $this->getSpace($x2 - $x1, $y2 - $y1); $this->xAxis->setPadding($leftSpace, $rightSpace); if($this->space->bottom > 0 or $this->space->top > 0) { list($min, $max) = $this->yAxis->getRange(); $interval = $max - $min; $this->yAxis->setRange( $min - $interval * $this->space->bottom / 100, $max + $interval * $this->space->top / 100 ); } // Auto-scaling mode $this->yAxis->autoScale(); // Number of labels is not specified if($this->yAxis->getLabelNumber() === NULL) { $number = round(($y2 - $y1) / 75) + 2; $this->yAxis->setLabelNumber($number); } $this->xAxis->line->setX($x1, $x2); $this->yAxis->line->setY($y2, $y1); // Set ticks $this->xAxis->ticks['major']->setNumber($this->getXAxisNumber()); $this->yAxis->ticks['major']->setNumber($this->yAxis->getLabelNumber()); // Center X axis on zero if($this->xAxisZero) { $this->xAxis->setYCenter($this->yAxis, 0); } // Center Y axis on zero if($this->yAxisZero) { $this->yAxis->setXCenter($this->xAxis, 0); } // Set axis labels $labels = array(); for($i = 0, $count = $this->getXAxisNumber(); $i < $count; $i++) { $labels[] = $i; } $this->xAxis->label->set($labels); parent::init($drawer); list($x1, $y1, $x2, $y2) = $this->getPosition(); list($leftSpace, $rightSpace) = $this->getSpace($x2 - $x1, $y2 - $y1); // Create the grid $this->createGrid(); // Draw the grid $this->grid->setSpace($leftSpace, $rightSpace, 0, 0); $this->grid->draw($drawer, $x1, $y1, $x2, $y2); } function drawEnvelope($drawer) { list($x1, $y1, $x2, $y2) = $this->getPosition(); if($this->getXCenter()) { $size = $this->xAxis->getDistance(0, 1); $this->xAxis->label->move($size / 2, 0); $this->xAxis->label->hideLast(TRUE); } // Draw top axis if($this->xAxisPosition === PLOT_TOP or $this->xAxisPosition === PLOT_BOTH) { $top = $this->xAxis; if($this->xAxisZero === FALSE) { $top->line->setY($y1, $y1); } $top->label->setAlign(NULL, LABEL_TOP); $top->label->move(0, -3); $top->title->move(0, -25); $top->draw($drawer); } // Draw bottom axis if($this->xAxisPosition === PLOT_BOTTOM or $this->xAxisPosition === PLOT_BOTH) { $bottom = $this->xAxis; if($this->xAxisZero === FALSE) { $bottom->line->setY($y2, $y2); } $bottom->label->setAlign(NULL, LABEL_BOTTOM); $bottom->label->move(0, 3); $bottom->reverseTickStyle(); $bottom->title->move(0, 25); $bottom->draw($drawer); } // Draw left axis if($this->yAxisPosition === PLOT_LEFT or $this->yAxisPosition === PLOT_BOTH) { $left = $this->yAxis; if($this->yAxisZero === FALSE) { $left->line->setX($x1, $x1); } $left->label->setAlign(LABEL_RIGHT); $left->label->move(-6, 0); $left->title->move(-25, 0); $left->draw($drawer); } // Draw right axis if($this->yAxisPosition === PLOT_RIGHT or $this->yAxisPosition === PLOT_BOTH) { $right = $this->yAxis; if($this->yAxisZero === FALSE) { $right->line->setX($x2, $x2); } $right->label->setAlign(LABEL_LEFT); $right->label->move(6, 0); $right->reverseTickStyle(); $right->title->move(25, 0); $right->draw($drawer); } } function createGrid() { $max = $this->getRealYMax(); $min = $this->getRealYMin(); $number = $this->yAxis->getLabelNumber() - 1; if($number < 1) { return; } // Horizontal lines of the grid $h = array(); for($i = 0; $i <= $number; $i++) { $h[] = $i / $number; } // Vertical lines $major = $this->yAxis->tick('major'); $interval = $major->getInterval(); $number = $this->getXAxisNumber() - 1; $w = array(); if($number > 0) { for($i = 0; $i <= $number; $i++) { if($i%$interval === 0) { $w[] = $i / $number; } } } $this->grid->setGrid($w, $h); } /** * Change values of Y axis * This method ignores not numeric values * * @param array $datay * @param array $datax */ function setValues($datay, $datax = NULL) { $this->checkArray($datay); foreach($datay as $key => $value) { unset($datay[$key]); $datay[(int)$key] = $value; } if($datax === NULL) { $datax = array(); for($i = 0; $i < count($datay); $i++) { $datax[] = $i; } } else { foreach($datax as $key => $value) { unset($datax[$key]); $datax[(int)$key] = $value; } } $this->checkArray($datax); if(count($datay) === count($datax)) { // Set values $this->datay = $datay; $this->datax = $datax; // Update axis with the new awvalues $this->updateAxis(); } else { trigger_error("Plots must have the same number of X and Y points", E_USER_ERROR); } } /** * Return begin and end values * * @return array */ function getLimit() { $i = 0; while(array_key_exists($i, $this->datay) and $this->datay[$i] === NULL) { $i++; } $start = $i; $i = count($this->datay) - 1; while(array_key_exists($i, $this->datay) and $this->datay[$i] === NULL) { $i--; } $stop = $i; return array($start, $stop); } /** * Return TRUE if labels must be centered on X axis, FALSE otherwise * * @return bool */ function updateAxis() { $this->xAxis->setRange( $this->getXMin(), $this->getXMax() ); $this->yAxis->setRange( $this->getRealYMin(), $this->getRealYMax() ); } function checkArray(&$array) { if(is_array($array) === FALSE) { trigger_error("You tried to set a value that is not an array", E_USER_ERROR); } foreach($array as $key => $value) { if(is_numeric($value) === FALSE and is_null($value) === FALSE) { trigger_error("Expected numeric values for the plot", E_USER_ERROR); } } if(count($array) < 1) { trigger_error("Your plot must have at least 1 value", E_USER_ERROR); } } } registerClass('Plot', TRUE); class awPlotAxis { /** * Left axis * * @var Axis */ var $left; /** * Right axis * * @var Axis */ var $right; /** * Top axis * * @var Axis */ var $top; /** * Bottom axis * * @var Axis */ var $bottom; /** * Build the group of axis */ function awPlotAxis() { $this->left = new awAxis; $this->left->auto(TRUE); $this->left->label->setAlign(LABEL_RIGHT); $this->left->label->move(-6, 0); $this->yAxis($this->left); $this->left->setTickStyle(TICK_OUT); $this->left->title->move(-25, 0); $this->right = new awAxis; $this->right->auto(TRUE); $this->right->label->setAlign(LABEL_LEFT); $this->right->label->move(6, 0); $this->yAxis($this->right); $this->right->setTickStyle(TICK_IN); $this->right->title->move(25, 0); $this->top = new awAxis; $this->top->label->setAlign(NULL, LABEL_TOP); $this->top->label->move(0, -3); $this->xAxis($this->top); $this->top->setTickStyle(TICK_OUT); $this->top->title->move(0, -25); $this->bottom = new awAxis; $this->bottom->label->setAlign(NULL, LABEL_BOTTOM); $this->bottom->label->move(0, 3); $this->xAxis($this->bottom); $this->bottom->setTickStyle(TICK_IN); $this->bottom->title->move(0, 25); } function xAxis(&$axis) { $axis->addTick('major', new awTick(0, 5)); $axis->addTick('minor', new awTick(0, 3)); $axis->label->setFont(new awDejaVuSans(7)); } function yAxis(&$axis) { $axis->addTick('major', new awTick(0, 5)); $axis->addTick('minor', new awTick(0, 3)); $axis->setNumberByTick('minor', 'major', 3); $axis->label->setFont(new awDejaVuSans(7)); $axis->title->setAngle(90); } } registerClass('PlotAxis'); /** * A graph with axis can contain some groups of components * * @package Artichow */ class awPlotGroup extends awComponentGroup { /** * Grid properties * * @var Grid */ var $grid; /** * Left, right, top and bottom axis * * @var PlotAxis */ var $axis; /** * Set the X axis on zero * * @var bool */ var $xAxisZero = TRUE; /** * Set the Y axis on zero * * @var bool */ var $yAxisZero = FALSE; /** * Real axis used for Y axis * * @var string */ var $yRealAxis = PLOT_LEFT; /** * Real axis used for X axis * * @var string */ var $xRealAxis = PLOT_BOTTOM; /** * Change min value for Y axis * * @var mixed */ var $yMin = NULL; /** * Change max value for Y axis * * @var mixed */ var $yMax = NULL; /** * Change min value for X axis * * @var mixed */ var $xMin = NULL; /** * Change max value for X axis * * @var mixed */ var $xMax = NULL; /** * Build the PlotGroup * */ function awPlotGroup() { parent::awComponentGroup(); $this->grid = new awGrid; $this->grid->setBackgroundColor(new awWhite); $this->axis = new awPlotAxis; } /** * Set the X axis on zero or not * * @param bool $zero */ function setXAxisZero($zero) { $this->xAxisZero = (bool)$zero; } /** * Set the Y axis on zero or not * * @param bool $zero */ function setYAxisZero($zero) { $this->yAxisZero = (bool)$zero; } /** * Change min value for Y axis * Set NULL for auto selection. * * @param float $value */ function setYMin($value) { $this->axis->left->auto(FALSE); $this->axis->right->auto(FALSE); $this->yMin = $value; } /** * Change max value for Y axis * Set NULL for auto selection. * * @param float $value */ function setYMax($value) { $this->axis->left->auto(FALSE); $this->axis->right->auto(FALSE); $this->yMax = $value; } /** * Change min value for X axis * Set NULL for auto selection. * * @param float $value */ function setXMin($value) { $this->xMin = $value; } /** * Change max value for X axis * Set NULL for auto selection. * * @param float $value */ function setXMax($value) { $this->xMax = $value; } /** * Get min value for X axis * * @return float $value */ function getXMin() { return $this->getX('min'); } /** * Get max value for X axis * * @return float $value */ function getXMax() { return $this->getX('max'); } function getX($type) { switch($type) { case 'max' : if($this->xMax !== NULL) { return $this->xMax; } break; case 'min' : if($this->xMin !== NULL) { return $this->xMin; } break; } $value = NULL; $get = 'getX'.ucfirst($type); for($i = 0; $i < count($this->components); $i++) { $component = $this->components[$i]; if($value === NULL) { $value = $component->$get(); } else { $value = $type($value, $component->$get()); } } return $value; } /** * Get min value with spaces for Y axis * * @param string $axis Axis name * @return float $value */ function getRealYMin($axis = NULL) { if($axis === NULL) { return NULL; } $min = $this->getRealY('min', $axis); $max = $this->getRealY('max', $axis); if($this->space->bottom !== NULL) { $interval = ($min - $max) * $this->space->bottom / 100; return $min + $interval; } else { return $min; } } /** * Get max value with spaces for Y axis * * @param string $axis Axis name * @return float $value */ function getRealYMax($axis = NULL) { if($axis === NULL) { return NULL; } $min = $this->getRealY('min', $axis); $max = $this->getRealY('max', $axis); if($this->space->top !== NULL) { $interval = ($max - $min) * $this->space->top / 100; return $max + $interval; } else { return $max; } } function getRealY($type, $axis) { switch($type) { case 'max' : if($this->yMax !== NULL) { return $this->yMax; } break; case 'min' : if($this->yMin !== NULL) { return $this->yMin; } break; } $value = NULL; $get = 'getY'.ucfirst($type); for($i = 0; $i < count($this->components); $i++) { $component = $this->components[$i]; switch($axis) { case PLOT_LEFT : case PLOT_RIGHT : $test = ($component->getYAxis() === $axis); break; default : $test = FALSE; } if($test) { if($value === NULL) { $value = $component->$get(); } else { $value = $type($value, $component->$get()); } } } return $value; } function init($drawer) { list($x1, $y1, $x2, $y2) = $this->getPosition(); // Get PlotGroup space list($leftSpace, $rightSpace, $topSpace, $bottomSpace) = $this->getSpace($x2 - $x1, $y2 - $y1); // Count values in the group $values = $this->getXAxisNumber(); // Init the PlotGroup $this->axis->top->line->setX($x1, $x2); $this->axis->bottom->line->setX($x1, $x2); $this->axis->left->line->setY($y2, $y1); $this->axis->right->line->setY($y2, $y1); $this->axis->top->setPadding($leftSpace, $rightSpace); $this->axis->bottom->setPadding($leftSpace, $rightSpace); $xMin = $this->getXMin(); $xMax = $this->getXMax(); $this->axis->top->setRange($xMin, $xMax); $this->axis->bottom->setRange($xMin, $xMax); for($i = 0; $i < count($this->components); $i++) { $component = &$this->components[$i]; $component->auto($this->auto); // Copy space to the component $component->setSpace($this->space->left, $this->space->right, $this->space->top, $this->space->bottom); $component->xAxis->setPadding($leftSpace, $rightSpace); $component->xAxis->line->setX($x1, $x2); $component->yAxis->line->setY($y2, $y1); } // Set Y axis range foreach(array('left', 'right') as $axis) { if($this->isAxisUsed($axis)) { $min = $this->getRealYMin($axis); $max = $this->getRealYMax($axis); $interval = $max - $min; $this->axis->{$axis}->setRange( $min - $interval * $this->space->bottom / 100, $max + $interval * $this->space->top / 100 ); // Auto-scaling mode $this->axis->{$axis}->autoScale(); } } if($this->axis->left->getLabelNumber() === NULL) { $number = round(($y2 - $y1) / 75) + 2; $this->axis->left->setLabelNumber($number); } if($this->axis->right->getLabelNumber() === NULL) { $number = round(($y2 - $y1) / 75) + 2; $this->axis->right->setLabelNumber($number); } // Center labels on X axis if needed $test = array(PLOT_TOP => FALSE, PLOT_BOTTOM => FALSE); for($i = 0; $i < count($this->components); $i++) { $component = &$this->components[$i]; if($component->getValues() !== NULL) { $axis = $component->getXAxis(); if($test[$axis] === FALSE) { // Center labels for bar plots if($component->getXCenter()) { $size = $this->axis->{$axis}->getDistance(0, 1); $this->axis->{$axis}->label->move($size / 2, 0); $this->axis->{$axis}->label->hideLast(TRUE); $test[$axis] = TRUE; } } } } // Set axis labels $labels = array(); for($i = $xMin; $i <= $xMax; $i++) { $labels[] = $i; } if($this->axis->top->label->count() === 0) { $this->axis->top->label->set($labels); } if($this->axis->bottom->label->count() === 0) { $this->axis->bottom->label->set($labels); } // Set ticks $this->axis->top->ticks['major']->setNumber($values); $this->axis->bottom->ticks['major']->setNumber($values); $this->axis->left->ticks['major']->setNumber($this->axis->left->getLabelNumber()); $this->axis->right->ticks['major']->setNumber($this->axis->right->getLabelNumber()); // Set X axis on zero if($this->xAxisZero) { $axis = $this->selectYAxis(); $this->axis->bottom->setYCenter($axis, 0); $this->axis->top->setYCenter($axis, 0); } // Set Y axis on zero if($this->yAxisZero) { $axis = $this->selectXAxis(); $this->axis->left->setXCenter($axis, 1); $this->axis->right->setXCenter($axis, 1); } parent::init($drawer); list($leftSpace, $rightSpace, $topSpace, $bottomSpace) = $this->getSpace($x2 - $x1, $y2 - $y1); // Create the grid $this->createGrid(); // Draw the grid $this->grid->setSpace($leftSpace, $rightSpace, 0, 0); $this->grid->draw($drawer, $x1, $y1, $x2, $y2); } function drawComponent($drawer, $x1, $y1, $x2, $y2, $aliasing) { $xMin = $this->getXMin(); $xMax = $this->getXMax(); $maxLeft = $this->getRealYMax(PLOT_LEFT); $maxRight = $this->getRealYMax(PLOT_RIGHT); $minLeft = $this->getRealYMin(PLOT_LEFT); $minRight = $this->getRealYMin(PLOT_RIGHT); foreach($this->components as $component) { $min = $component->getYMin(); $max = $component->getYMax(); // Set component minimum and maximum if($component->getYAxis() === PLOT_LEFT) { list($min, $max) = $this->axis->left->getRange(); $component->setYMin($min); $component->setYMax($max); } else { list($min, $max) = $this->axis->right->getRange(); $component->setYMin($min); $component->setYMax($max); } $component->setXAxisZero($this->xAxisZero); $component->setYAxisZero($this->yAxisZero); $component->xAxis->setRange($xMin, $xMax); $component->drawComponent( $drawer, $x1, $y1, $x2, $y2, $aliasing ); $component->setYMin($min); $component->setYMax($max); } } function drawEnvelope($drawer) { list($x1, $y1, $x2, $y2) = $this->getPosition(); // Hide unused axis foreach(array(PLOT_LEFT, PLOT_RIGHT, PLOT_TOP, PLOT_BOTTOM) as $axis) { if($this->isAxisUsed($axis) === FALSE) { $this->axis->{$axis}->hide(TRUE); } } // Draw top axis $top = $this->axis->top; if($this->xAxisZero === FALSE) { $top->line->setY($y1, $y1); } $top->draw($drawer); // Draw bottom axis $bottom = $this->axis->bottom; if($this->xAxisZero === FALSE) { $bottom->line->setY($y2, $y2); } $bottom->draw($drawer); // Draw left axis $left = $this->axis->left; if($this->yAxisZero === FALSE) { $left->line->setX($x1, $x1); } $left->draw($drawer); // Draw right axis $right = $this->axis->right; if($this->yAxisZero === FALSE) { $right->line->setX($x2, $x2); } $right->draw($drawer); } /** * Is the specified axis used ? * * @param string $axis Axis name * @return bool */ function isAxisUsed($axis) { for($i = 0; $i < count($this->components); $i++) { $component = $this->components[$i]; switch($axis) { case PLOT_LEFT : case PLOT_RIGHT : if($component->getYAxis() === $axis) { return TRUE; } break; case PLOT_TOP : case PLOT_BOTTOM : if($component->getXAxis() === $axis) { return TRUE; } break; } } return FALSE; } function createGrid() { $max = $this->getRealYMax(PLOT_LEFT); $min = $this->getRealYMin(PLOT_RIGHT); // Select axis (left if possible, right otherwise) $axis = $this->selectYAxis(); $number = $axis->getLabelNumber() - 1; if($number < 1) { return; } // Horizontal lines of grid $h = array(); for($i = 0; $i <= $number; $i++) { $h[] = $i / $number; } // Vertical lines $major = $axis->tick('major'); $interval = $major->getInterval(); $number = $this->getXAxisNumber() - 1; $w = array(); if($number > 0) { for($i = 0; $i <= $number; $i++) { if($i%$interval === 0) { $w[] = $i / $number; } } } $this->grid->setGrid($w, $h); } function selectYAxis(){ // Select axis (left if possible, right otherwise) if($this->isAxisUsed(PLOT_LEFT)) { $axis = $this->axis->left; } else { $axis = $this->axis->right; } return $axis; } function selectXAxis(){ // Select axis (bottom if possible, top otherwise) if($this->isAxisUsed(PLOT_BOTTOM)) { $axis = $this->axis->bottom; } else { $axis = $this->axis->top; } return $axis; } function getXAxisNumber() { $offset = $this->components[0]; $max = $offset->getXAxisNumber(); for($i = 1; $i < count($this->components); $i++) { $offset = $this->components[$i]; $max = max($max, $offset->getXAxisNumber()); } return $max; } } registerClass('PlotGroup'); ?>pgfouine-1.2/include/reporting/artichow/php4/Pie.class.php0000644000175000017500000002747210352052222022252 0ustar acmeacme */ define("PIE_DARK", 1); define("PIE_COLORED", 2); define("PIE_AQUA", 3); define("PIE_EARTH", 4); /* */ /** * Pie * * @package Artichow */ class awPie extends awComponent { /** * A dark theme for pies * * * @var int */ /** * A colored theme for pies * * @var int */ /** * A water theme for pies * * @var int */ /** * A earth theme for pies * * @var int */ /** * Pie values * * @var array */ var $values; /** * Pie colors * * @var array */ var $colors; /** * Pie legend * * @var array */ var $legendValues = array(); /** * Intensity of the 3D effect * * @var int */ var $size; /** * Border color * * @var Color */ var $border; /** * Pie explode * * @var array */ var $explode = array(); /** * Initial angle * * @var int */ var $angle = 0; /** * Labels precision * * @var int */ var $precision; /** * Labels number * * @var int */ var $number; /** * Labels minimum * * @var int */ var $minimum; /** * Labels position * * @var int */ var $position = 15; /** * Labels of your pie * * @var Label */ var $label; /** * Build the plot * * @param array $values Pie values */ function awPie($values, $colors = PIE_COLORED) { $this->setValues($values); if(is_array($colors)) { $this->colors = $colors; } else { switch($colors) { case PIE_AQUA : $this->colors = array( new awColor(131, 220, 215), new awColor(131, 190, 215), new awColor(131, 160, 215), new awColor(160, 140, 215), new awColor(190, 131, 215), new awColor(220, 131, 215) ); break; case PIE_EARTH : $this->colors = array( new awColor(97, 179, 110), new awColor(130, 179, 97), new awColor(168, 179, 97), new awColor(179, 147, 97), new awColor(179, 108, 97), new awColor(99, 107, 189), new awColor(99, 165, 189) ); break; case PIE_DARK : $this->colors = array( new awColor(140, 100, 170), new awColor(130, 170, 100), new awColor(160, 160, 120), new awColor(150, 110, 140), new awColor(130, 150, 160), new awColor(90, 170, 140) ); break; default : $this->colors = array( new awColor(187, 213, 151), new awColor(223, 177, 151), new awColor(111, 186, 132), new awColor(197, 160, 230), new awColor(165, 169, 63), new awColor(218, 177, 89), new awColor(116, 205, 121), new awColor(200, 201, 78), new awColor(127, 205, 177), new awColor(205, 160, 160), new awColor(190, 190, 190) ); break; } } parent::awComponent(); $this->label = new awLabel; $this->label->setCallbackFunction('callbackPerCent'); } /** * Change legend values * * @param array $legend An array of values for each part of the pie */ function setLegend($legend) { $this->legendValues = (array)$legend; } /** * Set a border all around the pie * * @param $color A color for the border */ function setBorder($color) { $this->border = $color; } /** * Change 3D effect intensity * * @param int $size Effect size */ function set3D($size) { $this->size = (int)$size; } /** * Change initial angle * * @param int $angle New angle in degrees */ function setStartAngle($angle) { $this->angle = (int)$angle; } /** * Change label precision * * @param int $precision New precision */ function setLabelPrecision($precision) { $this->precision = (int)$precision; } /** * Change label position * * @param int $position New position in pixels */ function setLabelPosition($position) { $this->position = (int)$position; } /** * Change label number * * @param int $number New number */ function setLabelNumber($number) { $this->number = is_null($number) ? $number : (int)$number; } /** * Change label minimum * * @param int $minimum New minimum */ function setLabelMinimum($minimum) { $this->minimum = is_null($minimum) ? $minimum : (int)$minimum; } /** * Change Pie explode * * @param array $explode */ function explode($explode) { $this->explode = (array)$explode; } function drawEnvelope($drawer) { } function drawComponent($drawer, $x1, $y1, $x2, $y2, $aliasing) { $count = count($this->values); $sum = array_sum($this->values); $width = $x2 - $x1; $height = $y2 - $y1; if($aliasing) { $x = $width / 2; $y = $height / 2; } else { $x = $width / 2 + $x1; $y = $height / 2 + $y1; } $position = $this->angle; $values = array(); $parts = array(); $angles = 0; if($aliasing) { $side = new awSide(0, 0, 0, 0); } foreach($this->values as $key => $value) { $angle = ($value / $sum * 360); if($key === $count - 1) { $angle = 360 - $angles; } $angles += $angle; if(array_key_exists($key, $this->explode)) { $middle = 360 - ($position + $angle / 2); $posX = $this->explode[$key] * cos($middle * M_PI / 180); $posY = $this->explode[$key] * sin($middle * M_PI / 180) * -1; if($aliasing) { $explode = new awPoint( $posX * 2, $posY * 2 ); $side->set( max($side->left, $posX * -2), max($side->right, $posX * 2), max($side->top, $posY * -2), max($side->bottom, $posY * 2) ); } else { $explode = new awPoint( $posX, $posY ); } } else { $explode = new awPoint(0, 0); } $values[$key] = array( $position, ($position + $angle), $explode ); $color = $this->colors[$key % count($this->colors)]; $parts[$key] = new awPiePart($color); // Add part to the legend $legend = array_key_exists($key, $this->legendValues) ? $this->legendValues[$key] : $key; $this->legend->add($parts[$key], $legend, LEGEND_BACKGROUND); $position += $angle; } if($aliasing) { $mainDrawer = $drawer; $x *= 2; $y *= 2; $width *= 2; $height *= 2; $this->size *= 2; $image = new awImage; $image->border->hide(); $image->setSize( $width + $side->left + $side->right, $height + $side->top + $side->bottom + $this->size + 1 /* bugs.php.net ! */ ); $drawer = $image->getDrawer( $width / $image->width, $height / $image->height, ($width / 2 + $side->left) / $image->width, ($height / 2 + $side->top) / $image->height ); } // Draw 3D effect for($i = $this->size; $i > 0; $i--) { foreach($values as $key => $value) { $color = $this->colors[$key % count($this->colors)]; $color->brightness(-50); list($from, $to, $explode) = $value; $drawer->filledArc($color, $explode->move($x, $y + $i), $width, $height, $from, $to); $color->free(); unset($color); if(is_a($this->border, 'awColor')) { $point = $explode->move($x, $y); if($i === $this->size) { $drawer->arc($this->border, $point->move(0, $this->size), $width, $height, $from, $to); } } } } foreach($values as $key => $value) { $color = $this->colors[$key % count($this->colors)]; list($from, $to, $explode) = $value; $drawer->filledArc($color, $explode->move($x, $y), $width, $height, $from, $to); if(is_a($this->border, 'awColor')) { $point = $explode->move($x, $y); $drawer->arc($this->border, $point, $width, $height, $from, $to); } } if($aliasing) { $x = $x / 2 + $x1; $y = $y / 2 + $y1; $width /= 2; $height /= 2; $this->size /= 2; foreach($values as $key => $value) { $old = $values[$key][2]; $values[$key][2] = new awPoint( $old->x / 2, $old->y / 2 ); } $mainDrawer->copyResizeImage( $image, new awPoint($x1 - $side->left / 2, $y1 - $side->top / 2), new awPoint($x1 - $side->left / 2 + $image->width / 2, $y1 - $side->top / 2 + $image->height/ 2), new awPoint(0, 0), new awPoint($image->width, $image->height), TRUE ); $drawer = $mainDrawer; } // Get labels values $pc = array(); foreach($this->values as $key => $value) { $pc[$key] = round($value / $sum * 100, $this->precision); } if($this->label->count() === 0) { // Check that there is no user defined values $this->label->set($pc); } $position = 0; foreach($pc as $key => $value) { // Limit number of labels to display if($position === $this->number) { break; } if(is_null($this->minimum) === FALSE and $value < $this->minimum) { continue; } $position++; list($from, $to, $explode) = $values[$key]; $angle = $from + ($to - $from) / 2; $angleRad = (360 - $angle) * M_PI / 180; $point = new awPoint( $x + $explode->x + cos($angleRad) * ($width / 2 + $this->position), $y + $explode->y - sin($angleRad) * ($height / 2 + $this->position) ); $angle %= 360; // We don't display labels on the 3D effect if($angle > 0 and $angle < 180) { $point = $point->move(0, -1 * sin($angleRad) * $this->size); } if($angle >= 45 and $angle < 135) { $this->label->setAlign(LABEL_CENTER, LABEL_BOTTOM); } else if($angle >= 135 and $angle < 225) { $this->label->setAlign(LABEL_RIGHT, LABEL_MIDDLE); } else if($angle >= 225 and $angle < 315) { $this->label->setAlign(LABEL_CENTER, LABEL_TOP); } else { $this->label->setAlign(LABEL_LEFT, LABEL_MIDDLE); } $this->label->draw( $drawer, $point, $key ); } } /** * Return margins around the component * * @return array Left, right, top and bottom margins */ function getMargin() { // Get axis informations $leftAxis = $this->padding->left; $rightAxis = $this->padding->right; $topAxis = $this->padding->top; $bottomAxis = $this->padding->bottom; return array($leftAxis, $rightAxis, $topAxis, $bottomAxis); } /** * Change values of Y axis * This method ignores not numeric values * * @param array $values */ function setValues($values) { $this->checkArray($values); $this->values = $values; } /** * Return values of Y axis * * @return array */ function getValues() { return $this->values; } function checkArray(&$array) { if(is_array($array) === FALSE) { trigger_error("You tried to set values that are not an array"); } foreach($array as $key => $value) { if(is_numeric($value) === FALSE) { unset($array[$key]); } } if(count($array) < 1) { trigger_error("Your graph must have at least 1 value"); } } } registerClass('Pie'); /** * Pie * * @package Artichow */ class awPiePart { /** * Pie part color * * @var Color */ var $color; /** * Build a new awPiePart * * @param $color Pie part color */ function awPiePart($color) { $this->color = $color; } /** * Get the background color or gradient of an element of the component * * @return Color, Gradient */ function getLegendBackground() { return $this->color; } /** * Get the line thickness * * @return NULL */ function getLegendLineThickness() { } /** * Get the line type * * @return NULL */ function getLegendLineStyle() { } /** * Get the color of line * * @return NULL */ function getLegendLineColor() { } /** * Get a mark object * * @return NULL */ function getLegendMark() { } } registerClass('PiePart'); function callbackPerCent($value) { return $value.'%'; } ?>pgfouine-1.2/include/reporting/artichow/php4/LinePlot.class.php0000644000175000017500000002312510352052222023252 0ustar acmeacme */ define("LINEPLOT_LINE", 0); define("LINEPLOT_MIDDLE", 1); /* */ /** * LinePlot * * @package Artichow */ class awLinePlot extends awPlot { /** * Add marks to your line plot * * @var Mark */ var $mark; /** * Labels on your line plot * * @var Label */ var $label; /** * Filled areas * * @var bool */ var $areas = array(); /** * Is the line hidden * * @var bool */ var $lineHide = FALSE; /** * Line color * * @var Color */ var $lineColor; /** * Line mode * * @var int */ var $lineMode = LINEPLOT_LINE; /** * Line type * * @var int */ var $lineStyle = LINE_SOLID; /** * Line thickness * * @var int */ var $lineThickness = 1; /** * Line background * * @var Color, Gradient */ var $lineBackground; /** * Line mode * * @var int */ /** * Line in the middle * * @var int */ /** * Construct a new awLinePlot * * @param array $values Some numeric values for Y axis * @param int $mode */ function awLinePlot($values, $mode = LINEPLOT_LINE) { parent::awPlot(); $this->mark = new awMark; $this->label = new awLabel; $this->lineMode = (int)$mode; $this->setValues($values); } /** * Hide line * * @param bool $hide */ function hideLine($hide) { $this->lineHide = (bool)$hide; } /** * Add a filled area * * @param int $start Begining of the area * @param int $end End of the area * @param mixed $background Background color or gradient of the area */ function setFilledArea($start, $stop, $background) { if($stop <= $start) { trigger_error("End position can not be greater than begin position in awLinePlot::setFilledArea()", E_USER_ERROR); } $this->areas[] = array((int)$start, (int)$stop, $background); } /** * Change line color * * @param $color */ function setColor($color) { $this->lineColor = $color; } /** * Change line style * * @param int $style */ function setStyle($style) { $this->lineStyle = (int)$style; } /** * Change line tickness * * @param int $tickness */ function setThickness($tickness) { $this->lineThickness = (int)$tickness; } /** * Change line background color * * @param $color */ function setFillColor($color) { $this->lineBackground = $color; } /** * Change line background gradient * * @param $gradient */ function setFillGradient($gradient) { $this->lineBackground = $gradient; } /** * Get the line thickness * * @return int */ function getLegendLineThickness() { return $this->lineThickness; } /** * Get the line type * * @return int */ function getLegendLineStyle() { return $this->lineStyle; } /** * Get the color of line * * @return Color */ function getLegendLineColor() { return $this->lineColor; } /** * Get the background color or gradient of an element of the component * * @return Color, Gradient */ function getLegendBackground() { return $this->lineBackground; } /** * Get a mark object * * @return Mark */ function getLegendMark() { return $this->mark; } function drawComponent($drawer, $x1, $y1, $x2, $y2, $aliasing) { $max = $this->getRealYMax(); $min = $this->getRealYMin(); // Get start and stop values list($start, $stop) = $this->getLimit(); if($this->lineMode === LINEPLOT_MIDDLE) { $inc = $this->xAxis->getDistance(0, 1) / 2; } else { $inc = 0; } // Build the polygon $polygon = new awPolygon; for($key = $start; $key <= $stop; $key++) { $value = $this->datay[$key]; if($value !== NULL) { $p = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($key, $value)); $p = $p->move($inc, 0); $polygon->set($key, $p); } } // Draw backgrounds if(is_a($this->lineBackground, 'awColor') or is_a($this->lineBackground, 'awGradient')) { $backgroundPolygon = new awPolygon; $p = $this->xAxisPoint($start); $p = $p->move($inc, 0); $backgroundPolygon->append($p); // Add others points foreach($polygon->all() as $point) { $backgroundPolygon->append($point); } $p = $this->xAxisPoint($stop); $p = $p->move($inc, 0); $backgroundPolygon->append($p); // Draw polygon background $drawer->filledPolygon($this->lineBackground, $backgroundPolygon); } $this->drawArea($drawer, $polygon); // Draw line $prev = NULL; // Line color if($this->lineHide === FALSE) { if($this->lineColor === NULL) { $this->lineColor = new awColor(0, 0, 0); } foreach($polygon->all() as $point) { if($prev !== NULL) { $drawer->line( $this->lineColor, new awLine( $prev, $point, $this->lineStyle, $this->lineThickness ) ); } $prev = $point; } $this->lineColor->free(); } // Draw marks and labels foreach($polygon->all() as $key => $point) { $this->mark->draw($drawer, $point); $this->label->draw($drawer, $point, $key); } } function drawArea($drawer, &$polygon) { $starts = array(); foreach($this->areas as $area) { list($start) = $area; $starts[$start] = TRUE; } // Draw filled areas foreach($this->areas as $area) { list($start, $stop, $background) = $area; $polygonArea = new awPolygon; $p = $this->xAxisPoint($start); $polygonArea->append($p); for($i = $start; $i <= $stop; $i++) { $p = $polygon->get($i); if($i === $stop and array_key_exists($stop, $starts)) { $p = $p->move(-1, 0); } $polygonArea->append($p); } $p = $this->xAxisPoint($stop); if(array_key_exists($stop, $starts)) { $p = $p->move(-1, 0); } $polygonArea->append($p); // Draw area $drawer->filledPolygon($background, $polygonArea); } } function getXAxisNumber() { if($this->lineMode === LINEPLOT_MIDDLE) { return count($this->datay) + 1; } else { return count($this->datay); } } function xAxisPoint($position) { $y = $this->xAxisZero ? 0 : $this->getRealYMin(); return awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($position, $y)); } function getXCenter() { return ($this->lineMode === LINEPLOT_MIDDLE); } } registerClass('LinePlot'); /** * Simple LinePlot * Useful to draw simple horizontal lines * * @package Artichow */ class awSimpleLinePlot extends awPlot { /** * Line color * * @var Color */ var $lineColor; /** * Line start * * @var int */ var $lineStart; /** * Line stop * * @var int */ var $lineStop; /** * Line value * * @var flaot */ var $lineValue; /** * Line mode * * @var int */ var $lineMode = LINEPLOT_LINE; /** * Line type * * @var int */ var $lineStyle = LINE_SOLID; /** * Line thickness * * @var int */ var $lineThickness = 1; /** * Line mode * * @var int */ /** * Line in the middle * * @var int */ /** * Construct a new awLinePlot * * @param float $value A Y value * @param int $start Line start index * @param int $stop Line stop index * @param int $mode Line mode */ function awSimpleLinePlot($value, $start, $stop, $mode = LINEPLOT_LINE) { parent::awPlot(); $this->lineMode = (int)$mode; $this->lineStart = (int)$start; $this->lineStop = (int)$stop; $this->lineValue = (float)$value; $this->lineColor = new awColor(0, 0, 0); } /** * Change line color * * @param $color */ function setColor($color) { $this->lineColor = $color; } /** * Change line style * * @param int $style */ function setStyle($style) { $this->lineStyle = (int)$style; } /** * Change line tickness * * @param int $tickness */ function setThickness($tickness) { $this->lineThickness = (int)$tickness; } /** * Get the line thickness * * @return int */ function getLegendLineThickness() { return $this->lineThickness; } /** * Get the line type * * @return int */ function getLegendLineStyle() { return $this->lineStyle; } /** * Get the color of line * * @return Color */ function getLegendLineColor() { return $this->lineColor; } function getLegendBackground() { return NULL; } function getLegendMark() { return NULL; } function drawComponent($drawer, $x1, $y1, $x2, $y2, $aliasing) { if($this->lineMode === LINEPLOT_MIDDLE) { $inc = $this->xAxis->getDistance(0, 1) / 2; } else { $inc = 0; } $p1 = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($this->lineStart, $this->lineValue)); $p2 = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($this->lineStop, $this->lineValue)); $drawer->line( $this->lineColor, new awLine( $p1->move($inc, 0), $p2->move($inc, 0), $this->lineStyle, $this->lineThickness ) ); $this->lineColor->free(); } function getXAxisNumber() { if($this->lineMode === LINEPLOT_MIDDLE) { return count($this->datay) + 1; } else { return count($this->datay); } } function xAxisPoint($position) { $y = $this->xAxisZero ? 0 : $this->getRealYMin(); return awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($position, $y)); } function getXCenter() { return ($this->lineMode === LINEPLOT_MIDDLE); } } registerClass('SimpleLinePlot'); ?> pgfouine-1.2/include/reporting/artichow/php4/Image.class.php0000644000175000017500000001735010352052222022551 0ustar acmeacme */ define("IMAGE_JPEG", 1); define("IMAGE_PNG", 2); define("IMAGE_GIF", 3); /* */ /* * Check for GD2 */ if(function_exists('imagecreatetruecolor') === FALSE) { trigger_error("You must compile PHP with GD2 support to use Artichow", E_USER_ERROR); } require_once ARTICHOW."/inc/Shadow.class.php"; require_once ARTICHOW."/inc/Border.class.php"; /** * An image for a graph * * @package Artichow */ class awImage { /** * Graph width * * @var int */ var $width; /** * Graph height * * @var int */ var $height; /** * Use anti-aliasing ? * * @var bool */ var $antiAliasing = FALSE; /** * Image format * * @var int */ var $format = IMAGE_PNG; /** * Image background color * * @var Color */ var $background; /** * GD resource * * @var resource */ var $resource; /** * Image drawer * * @var Drawer */ var $drawer; /** * Shadow * * @var Shadow */ var $shadow; /** * Image border * * @var Border */ var $border; /** * Use JPEG for image * * @var int */ /** * Use PNG for image * * @var int */ /** * Use GIF for image * * @var int */ /** * Build the image */ function awImage() { $this->background = new awColor(255, 255, 255); $this->shadow = new awShadow(SHADOW_RIGHT_BOTTOM); $this->border = new awBorder; } /** * Get drawer of the image * * @param int $w Drawer width (from 0 to 1) (default to 1) * @param int $h Drawer height (from 0 to 1) (default to 1) * @param float $x Position on X axis of the center of the drawer (default to 0.5) * @param float $y Position on Y axis of the center of the drawer (default to 0.5) * @return Drawer */ function getDrawer($w = 1, $h = 1, $x = 0.5, $y = 0.5) { $this->create(); $this->drawer->setSize($w, $h); $this->drawer->setPosition($x, $y); return $this->drawer; } /** * Change the image size * * @var int $width Image width * @var int $height Image height */ function setSize($width, $height) { if($width !== NULL) { $this->width = (int)$width; } if($height !== NULL) { $this->height = (int)$height; } } /** * Change image background color * * @param $color */ function setBackgroundColor($color) { $this->background = $color; } /** * Change image background gradient * * @param $gradient */ function setBackgroundGradient($gradient) { $this->background = $gradient; } /** * Can we use anti-aliasing ? * * @var bool $bool */ function setAntiAliasing($bool) { $this->antiAliasing = (bool)$bool; } /** * Change image format * * @var int $format New image format */ function setFormat($format) { if($format === IMAGE_JPEG or $format === IMAGE_PNG or $format === IMAGE_GIF) { $this->format = $format; } } /** * Create a new awimage */ function create() { if($this->resource === NULL) { // Create image $this->resource = imagecreatetruecolor($this->width, $this->height); if(!$this->resource) { trigger_error("Unable to create a graph", E_USER_ERROR); } imagealphablending($this->resource, TRUE); if($this->antiAliasing and function_exists('imageantialias')) { imageantialias($this->resource, TRUE); } $this->drawer = new awDrawer($this->resource); $this->drawer->setImageSize($this->width, $this->height); // Original color $this->drawer->filledRectangle( new awWhite, new awLine( new awPoint(0, 0), new awPoint($this->width, $this->height) ) ); $shadow = $this->shadow->getSpace(); $p1 = new awPoint($shadow->left, $shadow->top); $p2 = new awPoint($this->width - $shadow->right - 1, $this->height - $shadow->bottom - 1); // Draw image background $this->drawer->filledRectangle($this->background, new awLine($p1, $p2)); $this->background->free(); // Draw image border $this->border->rectangle($this->drawer, $p1, $p2); } } /** * Draw a component on the image * * @var &$component A component */ function drawComponent(&$component) { $shadow = $this->shadow->getSpace(); // Image shadow $border = $this->border->visible() ? 1 : 0; // Image border size $drawer = $this->drawer; $drawer->setImageSize( $this->width - $shadow->left - $shadow->right - $border * 2, $this->height - $shadow->top - $shadow->bottom - $border * 2 ); // No absolute size specified if($component->w === NULL and $component->h === NULL) { list($width, $height) = $drawer->setSize($component->width, $component->height); // Set component size in pixels $component->setAbsSize($width, $height); } else { $drawer->setAbsSize($component->w, $component->h); } if($component->top !== NULL and $component->left !== NULL) { $drawer->setAbsPosition( $border + $shadow->left + $component->left, $border + $shadow->top + $component->top ); } else { $drawer->setPosition($component->x, $component->y); } $drawer->movePosition($border + $shadow->left, $border + $shadow->top); list($x1, $y1, $x2, $y2) = $component->getPosition(); $component->init($drawer); $component->drawComponent($drawer, $x1, $y1, $x2, $y2, $this->antiAliasing); $component->drawEnvelope($drawer, $x1, $y1, $x2, $y2); $component->finalize($drawer); } function drawShadow() { $drawer = $this->getDrawer(); $this->shadow->draw( $drawer, new awPoint(0, 0), new awPoint($this->width, $this->height), SHADOW_IN ); } /** * Send the image into a file or to the user browser * * @var string $file Save image into a file if you provide a file name */ function send($file = NULL) { // Test if format is available if((imagetypes() & $this->format) === FALSE) { trigger_error("Format '".$this->format."' is not available on your system. Check that your PHP has been compiled with the good libraries."); } // Get some infos about this image switch($this->format) { case IMAGE_JPEG : $function = 'imagejpeg'; break; case IMAGE_PNG : $function = 'imagepng'; break; case IMAGE_GIF : $function = 'imagegif'; break; } // Create image if($file !== NULL) { $function($this->resource, $file); } else { // Test some text has been printed $data = ob_get_contents(); if($data !== '') { exit; } // Send headers to the browser header("Content-type: image/".$this->getFormat()); $function($this->resource); } } function getFormat() { switch($this->format) { case IMAGE_JPEG : return 'jpeg'; case IMAGE_PNG : return 'png'; case IMAGE_GIF : return 'gif'; } } } registerClass('Image'); /** * Load an image from a file * * @package Artichow */ class awFileImage extends awImage { /** * Build a new awimage * * @param string $file Image file name */ function awFileImage($file) { $image = @getimagesize($file); if($image and in_array($image[2], array(2, 3))) { $this->setSize($image[0], $image[1]); switch($image[2]) { case 2 : $this->resource = imagecreatefromjpeg($file); break; case 3 : $this->resource = imagecreatefrompng($file); break; } $this->drawer = new awDrawer($this->resource); $this->drawer->setImageSize($this->width, $this->height); } else { trigger_error("Artichow does not support this image (must be in PNG or JPEG)", E_USER_ERROR); } } } registerClass('FileImage'); ?> pgfouine-1.2/include/reporting/artichow/php4/MathPlot.class.php0000644000175000017500000001771211012376766023301 0ustar acmeacmef = (string)$f; $this->fromX = is_null($fromX) ? NULL : (float)$fromX; $this->toX = is_null($toX) ? NULL : (float)$toX; $this->line = new awLine; $this->mark = new awMark; $this->color = new awBlack; } /** * Change line color * * @param $color A new awcolor */ function setColor($color) { $this->color = $color; } /** * Get line color * * @return Color */ function getColor() { return $this->color; } /** * Get the background color or gradient of an element of the component * * @return Color, Gradient */ function getLegendBackground() { } /** * Get the line thickness * * @return NULL */ function getLegendLineThickness() { return $this->line->getThickness(); } /** * Get the line type * * @return NULL */ function getLegendLineStyle() { return $this->line->getStyle(); } /** * Get the color of line * * @return NULL */ function getLegendLineColor() { return $this->color; } /** * Get a mark object * * @return NULL */ function getLegendMark() { return $this->mark; } } registerClass('MathFunction'); /** * For mathematics functions * * @package Artichow */ class awMathPlot extends awComponent { /** * Functions * * @var array */ var $functions = array(); /** * Grid properties * * @var Grid */ var $grid; /** * X axis * * @var Axis */ var $xAxis; /** * Y axis * * @var Axis */ var $yAxis; /** * Extremum * * @var Side */ var $extremum = NULL; /** * Interval * * @var float */ var $interval = 1; /** * Build the plot * * @param int $xMin Minimum X value * @param int $xMax Maximum X value * @param int $yMax Maximum Y value * @param int $yMin Minimum Y value */ function awMathPlot($xMin, $xMax, $yMax, $yMin) { parent::awComponent(); $this->setPadding(8, 8, 8, 8); $this->grid = new awGrid; // Hide grid by default $this->grid->hide(TRUE); // Set extremum $this->extremum = new awSide($xMin, $xMax, $yMax, $yMin); // Create axis $this->xAxis = new awAxis; $this->xAxis->setTickStyle(TICK_IN); $this->xAxis->label->hideValue(0); $this->initAxis($this->xAxis); $this->yAxis = new awAxis; $this->yAxis->setTickStyle(TICK_IN); $this->yAxis->label->hideValue(0); $this->initAxis($this->yAxis); } function initAxis(&$axis) { $axis->setLabelPrecision(1); $axis->addTick('major', new awTick(0, 5)); $axis->addTick('minor', new awTick(0, 3)); $axis->addTick('micro', new awTick(0, 1)); $axis->setNumberByTick('minor', 'major', 1); $axis->setNumberByTick('micro', 'minor', 4); $axis->label->setFont(new awDejaVuSans(7)); } /** * Interval to calculate values * * @param float $interval */ function setInterval($interval) { $this->interval = (float)$interval; } /** * Add a formula f(x) * * @param &$function * @param string $name Name for the legend (can be NULL if you don't want to set a legend) * @param int $type Type for the legend */ function add(&$function, $name = NULL, $type = LEGEND_LINE) { $this->functions[] = $function; if($name !== NULL) { $this->legend->add($function, $name, $type); } } function init($drawer) { list($x1, $y1, $x2, $y2) = $this->getPosition(); $this->xAxis->line->setX($x1, $x2); $this->xAxis->label->setAlign(NULL, LABEL_BOTTOM); $this->xAxis->label->move(0, 3); $this->xAxis->setRange($this->extremum->left, $this->extremum->right); $this->yAxis->line->setY($y2, $y1); $this->yAxis->label->setAlign(LABEL_RIGHT); $this->yAxis->label->move(-6, 0); $this->yAxis->reverseTickStyle(); $this->yAxis->setRange($this->extremum->bottom, $this->extremum->top); $this->xAxis->setYCenter($this->yAxis, 0); $this->yAxis->setXCenter($this->xAxis, 0); if($this->yAxis->getLabelNumber() === NULL) { $number = $this->extremum->top - $this->extremum->bottom + 1; $this->yAxis->setLabelNumber($number); } if($this->xAxis->getLabelNumber() === NULL) { $number = $this->extremum->right - $this->extremum->left + 1; $this->xAxis->setLabelNumber($number); } // Set ticks $this->xAxis->ticks['major']->setNumber($this->xAxis->getLabelNumber()); $this->yAxis->ticks['major']->setNumber($this->yAxis->getLabelNumber()); // Set axis labels $labels = array(); for($i = 0, $count = $this->xAxis->getLabelNumber(); $i < $count; $i++) { $labels[] = $i; } $this->xAxis->label->set($labels); $labels = array(); for($i = 0, $count = $this->yAxis->getLabelNumber(); $i < $count; $i++) { $labels[] = $i; } $this->yAxis->label->set($labels); parent::init($drawer); // Create the grid $this->createGrid(); // Draw the grid $this->grid->draw($drawer, $x1, $y1, $x2, $y2); } function drawEnvelope($drawer) { // Draw axis $this->xAxis->draw($drawer); $this->yAxis->draw($drawer); } function drawComponent($drawer, $x1, $y1, $x2, $y2, $aliasing) { foreach($this->functions as $function) { $f = $function->f; $fromX = is_null($function->fromX) ? $this->extremum->left : $function->fromX; $toX = is_null($function->toX) ? $this->extremum->right : $function->toX; $old = NULL; for($i = $fromX; $i <= $toX; $i += $this->interval) { $p = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($i, $f($i))); if($p->y >= $y1 and $p->y <= $y2) { $function->mark->draw($drawer, $p); } if($old !== NULL) { $line = $function->line; $line->setLocation($old, $p); if( ($line->p1->y >= $y1 and $line->p1->y <= $y2) or ($line->p2->y >= $y1 and $line->p2->y <= $y2) ) { $drawer->line( $function->getColor(), $line ); } } $old = $p; } // Draw last point if needed if($old !== NULL and $i - $this->interval != $toX) { $p = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($toX, $f($toX))); if($p->y >= $y1 and $p->y <= $y2) { $function->mark->draw($drawer, $p); } $line = $function->line; $line->setLocation($old, $p); if( ($line->p1->y >= $y1 and $line->p1->y <= $y2) or ($line->p2->y >= $y1 and $line->p2->y <= $y2) ) { $drawer->line( $function->getColor(), $line ); } } } } function createGrid() { // Horizontal lines of the grid $major = $this->yAxis->tick('major'); $interval = $major->getInterval(); $number = $this->yAxis->getLabelNumber() - 1; $h = array(); if($number > 0) { for($i = 0; $i <= $number; $i++) { $h[] = $i / $number; } } // Vertical lines $major = $this->xAxis->tick('major'); $interval = $major->getInterval(); $number = $this->xAxis->getLabelNumber() - 1; $w = array(); if($number > 0) { for($i = 0; $i <= $number; $i++) { if($i%$interval === 0) { $w[] = $i / $number; } } } $this->grid->setGrid($w, $h); } } registerClass('MathPlot'); ?>pgfouine-1.2/include/reporting/artichow/php4/Pattern.class.php0000644000175000017500000000345510352052222023145 0ustar acmeacmeargs[$name] = $value; } } /** * Get an argument * * @param string $name * @param mixed $default Default value if the argument does not exist (default to NULL) * @return mixed Argument value */ function getArg($name, $default = NULL) { if(array_key_exists($name, $this->args)) { return $this->args[$name]; } else { return $default; } } /** * Change several arguments * * @param array $args New arguments */ function setArgs($args) { if(is_array($args)) { foreach($args as $name => $value) { $this->setArg($name, $value); } } } } registerClass('Pattern', TRUE); ?>pgfouine-1.2/include/reporting/artichow/php4/BarPlot.class.php0000644000175000017500000001460310352052222023070 0ustar acmeacmelabel = new awLabel; $this->barPadding = new awSide(0.08, 0.08, 0, 0); $this->barShadow = new awShadow(SHADOW_RIGHT_TOP); $this->barBorder = new awBorder; $this->setValues($values); $this->identifier = (int)$identifier; $this->number = (int)$number; $this->depth = (int)$depth; $this->move = new awSide; // Hide vertical grid $this->grid->hideVertical(TRUE); } /** * Change bars padding * This method is not compatible with awBarPlot::setBarPadding() * * @param float $left Left padding (between 0 and 1) * @param float $right Right padding (between 0 and 1) */ function setBarPadding($left = NULL, $right = NULL) { $this->barPadding->set($left, $right); } /** * Change bars size * This method is not compatible with awBarPlot::setBarPadding() * * @param int $width Bars size (between 0 and 1) */ function setBarSize($size) { $padding = (1 - $size) / 2; $this->barPadding->set($padding, $padding); } /** * Move bars * * @param int $x * @param int $y */ function move($x, $y) { $this->move->set($x, NULL, $y, NULL); } /** * Change bars space * * @param int $space Space in pixels */ function setBarSpace($space) { $this->barSpace = (int)$space; } /** * Change line background color * * @param $color */ function setBarColor($color) { $this->barBackground = $color; } /** * Change line background gradient * * @param $gradient */ function setBarGradient($gradient) { $this->barBackground = $gradient; } /** * Get the line thickness * * @return int */ function getLegendLineThickness() { } /** * Get the line type * * @return int */ function getLegendLineStyle() { } /** * Get the color of line * * @return Color */ function getLegendLineColor() { } /** * Get the background color or gradient of an element of the component * * @return Color, Gradient */ function getLegendBackground() { return $this->barBackground; } /** * Get a mark object * * @return Mark */ function getLegendMark() { } function drawComponent($drawer, $x1, $y1, $x2, $y2, $aliasing) { $count = count($this->datay); $max = $this->getRealYMax(NULL); $min = $this->getRealYMin(NULL); // Find zero for bars if($this->xAxisZero and $min <= 0 and $max >= 0) { $zero = 0; } else if($max < 0) { $zero = $max; } else { $zero = $min; } // Get base position $zero = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint(0, $zero)); // Distance between two values on the graph $distance = $this->xAxis->getDistance(0, 1); // Compute paddings $leftPadding = $this->barPadding->left * $distance; $rightPadding = $this->barPadding->right * $distance; $padding = $leftPadding + $rightPadding; $space = $this->barSpace * ($this->number - 1); $barSize = ($distance - $padding - $space) / $this->number; $barPosition = $leftPadding + $barSize * ($this->identifier - 1); for($key = 0; $key < $count; $key++) { $value = $this->datay[$key]; if($value !== NULL) { $position = awAxis::toPosition( $this->xAxis, $this->yAxis, new awPoint($key, $value) ); $barStart = $barPosition + ($this->identifier - 1) * $this->barSpace + $position->x; $barStop = $barStart + $barSize; $t1 = min($zero->y, $position->y); $t2 = max($zero->y, $position->y); if(round($t2 - $t1) == 0) { continue; } $p1 = new awPoint( round($barStart) + $this->depth + $this->move->left, round($t1) - $this->depth + $this->move->top ); $p2 = new awPoint( round($barStop) + $this->depth + $this->move->left, round($t2) - $this->depth + $this->move->top ); $this->drawBar($drawer, $p1, $p2); } } // Draw labels foreach($this->datay as $key => $value) { if($value !== NULL) { $position = awAxis::toPosition( $this->xAxis, $this->yAxis, new awPoint($key, $value) ); $point = new awPoint( $barPosition + ($this->identifier - 1) * $this->barSpace + $position->x + $barSize / 2 + 1 + $this->depth, $position->y - $this->depth ); $this->label->draw($drawer, $point, $key); } } } function getXAxisNumber() { return count($this->datay) + 1; } // ça bidouille à fond ici ! function getXMax() { return array_max($this->datax) + 1; } function getXCenter() { return TRUE; } function drawBar($drawer, $p1, $p2) { // Draw shadow $this->barShadow->draw( $drawer, $p1, $p2, SHADOW_OUT ); if(abs($p2->y - $p1->y) > 1) { $this->barBorder->rectangle( $drawer, $p1, $p2 ); if($this->barBackground !== NULL) { $size = $this->barBorder->visible() ? 1 : 0; $b1 = $p1->move($size, $size); $b2 = $p2->move(-1 * $size, -1 * $size); // Draw background $drawer->filledRectangle( $this->barBackground, new awLine($b1, $b2) ); } } } } registerClass('BarPlot'); ?> pgfouine-1.2/include/reporting/artichow/php4/inc/0000755000175000017500000000000011516212335020463 5ustar acmeacmepgfouine-1.2/include/reporting/artichow/php4/inc/Mark.class.php0000644000175000017500000001176010352052223023172 0ustar acmeacme */ define("MARK_CIRCLE", 1); define("MARK_SQUARE", 2); define("MARK_IMAGE", 3); define("MARK_STAR", 4); define("MARK_PAPERCLIP", 5); define("MARK_BOOK", 6); /* */ /** * Draw marks * * @package Artichow */ class awMark { /** * Circle mark * * @var int */ /** * Quare mark * * @var int */ /** * Image mark * * @var int */ /** * Star mark * * @var int */ /** * Paperclip mark * * @var int */ /** * Book mark * * @var int */ /** * Must marks be hidden ? * * @var bool */ var $hide; /** * Mark type * * @var int */ var $type; /** * Mark size * * @var int */ var $size = 8; /** * Fill mark * * @var Color, Gradient */ var $fill; /** * Mark image * * @var Image */ var $image; /** * To draw marks * * @var Drawer */ var $drawer; /** * Move position from this vector * * @var Point */ var $move; /** * Marks border * * @var Border */ var $border; /** * Build the mark */ function awMark() { $this->fill = new awColor(255, 0, 0, 0); $this->border = new awBorder; $this->border->hide(); $this->move = new awPoint(0, 0); } /** * Change mark position * * @param int $x Add this interval to X coord * @param int $y Add this interval to Y coord */ function move($x, $y) { $this->move = $this->move->move($x, $y); } /** * Hide marks ? * * @param bool $hide TRUE to hide marks, FALSE otherwise */ function hide($hide = TRUE) { $this->hide = (bool)$hide; } /** * Show marks ? * * @param bool $show */ function show($show = TRUE) { $this->hide = (bool)!$show; } /** * Change mark type * * @param int $size Size in pixels */ function setSize($size) { $this->size = (int)$size; } /** * Change mark type * * @param int $type New mark type * @param int $size Mark size (can be NULL) */ function setType($type, $size = NULL) { $this->type = (int)$type; if($size !== NULL) { $this->setSize($size); } } /** * Fill the mark with a color or a gradient * * @param mixed $fill A color or a gradient */ function setFill($fill) { if(is_a($fill, 'awColor') or is_a($fill, 'awGradient')) { $this->fill = $fill; } } /** * Set an image * Only for MARK_IMAGE type. * * @param Image An image */ function setImage(&$image) { $this->image = $image; } /** * Draw the mark * * @param $drawer * @param $point Mark center */ function draw($drawer, $point) { // Hide marks ? if($this->hide) { return; } // Check if we can print marks if($this->type !== NULL) { $this->drawer = $drawer; $realPoint = $this->move->move($point->x, $point->y); switch($this->type) { case MARK_CIRCLE : $this->drawCircle($realPoint); break; case MARK_SQUARE : $this->drawSquare($realPoint); break; case MARK_IMAGE : $this->drawImage($realPoint); break; case MARK_STAR : $this->changeType('star'); $this->draw($drawer, $point); break; case MARK_PAPERCLIP : $this->changeType('paperclip'); $this->draw($drawer, $point); break; case MARK_BOOK : $this->changeType('book'); $this->draw($drawer, $point); break; } } } function changeType($image) { $this->setType(MARK_IMAGE); $this->setImage(new awFileImage(ARTICHOW_IMAGE.DIRECTORY_SEPARATOR.$image.'.png')); } function drawCircle($point) { $this->drawer->filledEllipse( $this->fill, $point, $this->size, $this->size ); $this->border->ellipse( $this->drawer, $point, $this->size, $this->size ); } function drawSquare($point) { list($x, $y) = $point->getLocation(); $x1 = (int)($x - $this->size / 2); $x2 = $x1 + $this->size; $y1 = (int)($y - $this->size / 2); $y2 = $y1 + $this->size; $this->border->rectangle($this->drawer, new awPoint($x1, $y1), new awPoint($x2, $y2)); $size = $this->border->visible() ? 1 : 0; $this->drawer->filledRectangle( $this->fill, new awLine( new awPoint($x1 + $size, $y1 + $size), new awPoint($x2 - $size, $y2 - $size) ) ); } function drawImage($point) { if(is_a($this->image, 'awImage')) { $width = $this->image->width; $height = $this->image->height; list($x, $y) = $point->getLocation(); $x1 = (int)($x - $width / 2); $x2 = $x1 + $width; $y1 = (int)($y - $width / 2); $y2 = $y1 + $height; $this->border->rectangle($this->drawer, new awPoint($x1 - 1, $y1 - 1), new awPoint($x2 + 1, $y2 + 1)); $this->drawer->copyImage($this->image, new awPoint($x1, $y1), new awPoint($x2, $y2)); } } } registerClass('Mark'); ?>pgfouine-1.2/include/reporting/artichow/php4/inc/Label.class.php0000644000175000017500000002323310354313243023321 0ustar acmeacme */ define("LABEL_LEFT", 1); define("LABEL_RIGHT", 2); define("LABEL_CENTER", 3); define("LABEL_TOP", 4); define("LABEL_BOTTOM", 5); define("LABEL_MIDDLE", 6); /* */ /** * Draw labels * * @package Artichow */ class awLabel { /** * Label border * * @var int */ var $border; /** * Label texts * * @var array */ var $texts; /** * Text font * * @var int */ var $font; /** * Text angle * * @var int */ var $angle = 0; /** * Text color * * @var Color */ var $color; /** * Text background * * @var Color, Gradient */ var $background; /** * Callback function * * @var string */ var $function; /** * Callback function to format output * * @var string */ var $formatFunction; /** * Padding * * @var int */ var $padding; /** * Move position from this vector * * @var Point */ var $move; /** * Label interval * * @var int */ var $interval = 1; /** * Horizontal align * * @var int */ var $hAlign = LABEL_CENTER; /** * Vertical align * * @var int */ var $vAlign = LABEL_MIDDLE; /** * Hide all labels ? * * @var bool */ var $hide = FALSE; /** * Keys to hide * * @var array */ var $hideKey = array(); /** * Values to hide * * @var array */ var $hideValue = array(); /** * Hide first label * * @var bool */ var $hideFirst = FALSE; /** * Hide last label * * @var bool */ var $hideLast = FALSE; /** * Build the label * * @param string $label First label */ function awLabel($label = NULL, $font = NULL, $color = NULL, $angle = 0) { if(is_array($label)) { $this->set($label); } else if(is_string($label)) { $this->set(array($label)); } if($font === NULL) { $font = new awFont2; } $this->setFont($font); $this->setAngle($angle); if(is_a($color, 'awColor')) { $this->setColor($color); } else { $this->setColor(new awColor(0, 0, 0)); } $this->move = new awPoint(0, 0); $this->border = new awBorder; $this->border->hide(); } /** * Get an element of the label from its key * * @param int $key Element key * @return string A value */ function get($key) { return array_key_exists($key, $this->texts) ? $this->texts[$key] : NULL; } /** * Get all labels * * @return array */ function all() { return $this->texts; } /** * Set one or several labels * * @param array $labels Array of string or a string */ function set($labels) { if(is_string($labels)) { $this->texts = array($labels); } else if(is_array($labels)) { $this->texts = $labels; } } /** * Count number of texts in the label * * @return int */ function count() { return is_array($this->texts) ? count($this->texts) : 0; } /** * Set a callback function for labels * * @param string $function */ function setCallbackFunction($function) { $this->function = is_null($function) ? $function : (string)$function; } /** * Return the callback function for labels * * @return string */ function getCallbackFunction() { return $this->function; } /** * Set a callback function to format the labels * * @param string $function */ function setCallbackFormatFunction($function) { $this->formatFunction =& $function; } /** * Change labels format * * @param string $format New format (printf style: %.2f for example) */ function setFormat($format) { $function = 'label'.time().'_'.(microtime() * 1000000); eval('function '.$function.'($value) { return sprintf("'.addcslashes($format, '"').'", $value); }'); $this->setCallbackFunction($function); } /** * Change font for label * * @param &$font New font * @param $color Font color (can be NULL) */ function setFont(&$font, $color = NULL) { $this->font = $font; if(is_a($color, 'awColor')) { $this->setColor($color); } } /** * Change font angle * * @param int $angle New angle */ function setAngle($angle) { $this->angle = (int)$angle; } /** * Change font color * * @param $color */ function setColor($color) { $this->color = $color; } /** * Change text background * * @param mixed $background */ function setBackground($background) { $this->background = $background; } /** * Change text background color * * @param Color */ function setBackgroundColor($color) { $this->background = $color; } /** * Change text background gradient * * @param Gradient */ function setBackgroundGradient($gradient) { $this->background = $gradient; } /** * Change padding * * @param int $left Left padding * @param int $right Right padding * @param int $top Top padding * @param int $bottom Bottom padding */ function setPadding($left, $right, $top, $bottom) { $this->padding = array((int)$left, (int)$right, (int)$top, (int)$bottom); } /** * Hide all labels ? * * @param bool $hide */ function hide($hide = TRUE) { $this->hide = (bool)$hide; } /** * Show all labels ? * * @param bool $show */ function show($show = TRUE) { $this->hide = (bool)!$show; } /** * Hide a key * * @param int $key The key to hide */ function hideKey($key) { $this->hideKey[$key] = TRUE; } /** * Hide a value * * @param int $value The value to hide */ function hideValue($value) { $this->hideValue[] = $value; } /** * Hide first label * * @param bool $hide */ function hideFirst($hide) { $this->hideFirst = (bool)$hide; } /** * Hide last label * * @param bool $hide */ function hideLast($hide) { $this->hideLast = (bool)$hide; } /** * Set label interval * * @param int */ function setInterval($interval) { $this->interval = (int)$interval; } /** * Change label position * * @param int $x Add this interval to X coord * @param int $y Add this interval to Y coord */ function move($x, $y) { $this->move = $this->move->move($x, $y); } /** * Change alignment * * @param int $h Horizontal alignment * @param int $v Vertical alignment */ function setAlign($h = NULL, $v = NULL) { if($h !== NULL) { $this->hAlign = (int)$h; } if($v !== NULL) { $this->vAlign = (int)$v; } } /** * Get a text from the labele * * @param mixed $key Key in the array text * @return Text */ function getText($key) { if(is_array($this->texts) and array_key_exists($key, $this->texts)) { $value = $this->texts[$key]; if(is_string($this->function)) { $value = call_user_func($this->function, $value); } if(!is_null($this->formatFunction)) { $value = call_user_func($this->formatFunction, $value); } $text = new awText($value); $text->setFont($this->font); $text->setAngle($this->angle); $text->setColor($this->color); if(is_a($this->background, 'awColor')) { $text->setBackgroundColor($this->background); } else if(is_a($this->background, 'awGradient')) { $text->setBackgroundGradient($this->background); } $text->border = $this->border; if($this->padding !== NULL) { call_user_func_array(array(&$text, 'setPadding'), $this->padding); } return $text; } else { return NULL; } } /** * Get max width of all texts * * @param $drawer A drawer * @return int */ function getMaxWidth($drawer) { return $this->getMax($drawer, 'getTextWidth'); } /** * Get max height of all texts * * @param $drawer A drawer * @return int */ function getMaxHeight($drawer) { return $this->getMax($drawer, 'getTextHeight'); } /** * Draw the label * * @param $drawer * @param $p Label center * @param int $key Text position in the array of texts (default to zero) */ function draw($drawer, $p, $key = 0) { if(($key % $this->interval) !== 0) { return; } // Hide all labels if($this->hide) { return; } // Key is hidden if(array_key_exists($key, $this->hideKey)) { return; } // Hide first label if($key === 0 and $this->hideFirst) { return; } // Hide last label if($key === count($this->texts) - 1 and $this->hideLast) { return; } $text = $this->getText($key); if($text !== NULL) { // Value must be hidden if(in_array($text->getText(), $this->hideValue)) { return; } $x = $p->x; $y = $p->y; // Get padding list($left, $right, $top, $bottom) = $text->getPadding(); $font = $text->getFont(); $width = $font->getTextWidth($text); $height = $font->getTextHeight($text); switch($this->hAlign) { case LABEL_RIGHT : $x -= ($width + $right); break; case LABEL_CENTER : $x -= ($width - $left + $right) / 2; break; case LABEL_LEFT : $x += $left; break; } switch($this->vAlign) { case LABEL_TOP : $y -= ($height + $bottom); break; case LABEL_MIDDLE : $y -= ($height - $top + $bottom) / 2; break; case LABEL_BOTTOM : $y += $top; break; } $drawer->string($text, $this->move->move($x, $y)); } } function getMax($drawer, $function) { $max = NULL; foreach($this->texts as $key => $text) { $text = $this->getText($key); $font = $text->getFont(); if(is_null($max)) { $max = $font->{$function}($text); } else { $max = max($max, $font->{$function}($text)); } } return $max; } } registerClass('Label'); ?> pgfouine-1.2/include/reporting/artichow/php4/inc/Text.class.php0000644000175000017500000000572610352052223023231 0ustar acmeacmesetText($text); $this->setFont($font); // Set default color to black if($color === NULL) { $color = new awColor(0, 0, 0); } $this->setColor($color); $this->setAngle($angle); $this->border = new awBorder; $this->border->hide(); } /** * Get text * * @return string */ function getText() { return $this->text; } /** * Change text * * @param string $text New text */ function setText($text) { $this->text = (string)$text; } /** * Change text font * * @param Font */ function setFont(&$font) { $this->font = $font; } /** * Get text font * * @return int */ function getFont() { return $this->font; } /** * Change text angle * * @param int */ function setAngle($angle) { $this->angle = (int)$angle; } /** * Get text angle * * @return int */ function getAngle() { return $this->angle; } /** * Change text color * * @param Color */ function setColor($color) { $this->color = $color; } /** * Get text color * * @return Color */ function getColor() { return $this->color; } /** * Change text background color * * @param $color */ function setBackgroundColor($color) { $this->background = $color; } /** * Change text background gradient * * @param $gradient */ function setBackgroundGradient($gradient) { $this->background = $gradient; } /** * Get text background * * @return Color, Gradient */ function getBackground() { return $this->background; } /** * Change padding * * @param int $left Left padding * @param int $right Right padding * @param int $top Top padding * @param int $bottom Bottom padding */ function setPadding($left, $right, $top, $bottom) { $this->padding = array((int)$left, (int)$right, (int)$top, (int)$bottom); } /** * Get current padding * * @return array */ function getPadding() { return $this->padding; } } registerClass('Text'); ?> pgfouine-1.2/include/reporting/artichow/php4/inc/Axis.class.php0000644000175000017500000003206310352052223023203 0ustar acmeacme 'toProportionalValue', 'toPosition' => 'toProportionalPosition' ); /** * Build the axis * * @param float $min Begin of the range of the axis * @param float $max End of the range of the axis */ function awAxis($min = NULL, $max = NULL) { $this->line = new awVector( new awPoint(0, 0), new awPoint(0, 0) ); $this->label = new awLabel; $this->padding = new awSide; $this->title = new awLabel( NULL, NULL, NULL, 0 ); $this->setColor(new awBlack); if($min !== NULL and $max !== NULL) { $this->setRange($min, $max); } } /** * Enable/disable auto-scaling mode * * @param bool $auto */ function auto($auto) { $this->auto = (bool)$auto; } /** * Get auto-scaling mode status * * @return bool */ function isAuto() { return $this->auto; } /** * Hide axis * * @param bool $hide */ function hide($hide = TRUE) { $this->hide = (bool)$hide; } /** * Show axis * * @param bool $show */ function show($show = TRUE) { $this->hide = !(bool)$show; } /** * Return a tick object from its name * * @param string $name Tick object name * @return Tick */ function tick($name) { if(array_key_exists($name, $this->ticks)) { return $tick = &$this->ticks[$name]; } else { return NULL; } } /** * Add a tick object * * @param string $name Tick object name * @param &$tick Tick object */ function addTick($name, &$tick) { $this->ticks[$name] = &$tick; } /** * Delete a tick object * * @param string $name Tick object name */ function deleteTick($name) { if(array_key_exists($name, $this->ticks)) { unset($this->ticks[$name]); } } /** * Hide all ticks * * @param bool $hide Hide or not ? */ function hideTicks($hide = TRUE) { foreach($this->ticks as $key => $tick) { $this->ticks[$key]->hide($hide); } } /** * Change ticks style * * @param int $style Ticks style */ function setTickStyle($style) { foreach($this->ticks as $key => $tick) { $this->ticks[$key]->setStyle($style); } } /** * Change ticks interval * * @param int $interval Ticks interval */ function setTickInterval($interval) { foreach($this->ticks as $key => $tick) { $this->ticks[$key]->setInterval($interval); } } /** * Change number of ticks relative to others ticks * * @param &$to Change number of theses ticks * @param &$from Ticks reference * @param float $number Number of ticks by the reference */ function setNumberByTick($to, $from, $number) { $this->ticks[$to]->setNumberByTick($this->ticks[$from], $number); } /** * Reverse ticks style */ function reverseTickStyle() { foreach($this->ticks as $key => $tick) { if($this->ticks[$key]->getStyle() === TICK_IN) { $this->ticks[$key]->setStyle(TICK_OUT); } else if($this->ticks[$key]->getStyle() === TICK_OUT) { $this->ticks[$key]->setStyle(TICK_IN); } } } /** * Change interval of labels * * @param int $interval Interval */ function setLabelInterval($interval) { $this->auto(FALSE); $this->setTickInterval($interval); $this->label->setInterval($interval); } /** * Change number of labels * * @param int $number Number of labels to display (can be NULL) */ function setLabelNumber($number) { $this->auto(FALSE); $this->labelNumber = is_null($number) ? NULL : (int)$number; } /** * Get number of labels * * @return int */ function getLabelNumber() { return $this->labelNumber; } /** * Change precision of labels * * @param int $precision Precision */ function setLabelPrecision($precision) { $this->auto(FALSE); $function = 'axis'.time().'_'.(microtime() * 1000000); eval('function '.$function.'($value) { return sprintf("%.'.(int)$precision.'f", $value); }'); $this->label->setCallbackFunction($function); } /** * Change text of labels * * @param array $texts Some texts */ function setLabelText($texts) { if(is_array($texts)) { $this->auto(FALSE); $function = 'axis'.time().'_'.(microtime() * 1000000); eval('function '.$function.'($value) { $texts = '.var_export($texts, TRUE).'; return $texts[$value]; }'); $this->label->setCallbackFunction($function); } } /** * Get the position of a point * * @param &$xAxis X axis * @param &$yAxis Y axis * @param $p Position of the point * @return Point Position on the axis */ function toPosition(&$xAxis, &$yAxis, $p) { $p1 = $xAxis->getPointFromValue($p->x); $p2 = $yAxis->getPointFromValue($p->y); return new awPoint( round($p1->x), round($p2->y) ); } /** * Change title alignment * * @param int $alignment New Alignment */ function setTitleAlignment($alignment) { switch($alignment) { case LABEL_TOP : $this->setTitlePosition(1); $this->title->setAlign(NULL, LABEL_BOTTOM); break; case LABEL_BOTTOM : $this->setTitlePosition(0); $this->title->setAlign(NULL, LABEL_TOP); break; case LABEL_LEFT : $this->setTitlePosition(0); $this->title->setAlign(LABEL_LEFT); break; case LABEL_RIGHT : $this->setTitlePosition(1); $this->title->setAlign(LABEL_RIGHT); break; } } /** * Change title position on the axis * * @param float $position A new awposition between 0 and 1 */ function setTitlePosition($position) { $this->titlePosition = (float)$position; } /** * Change axis and axis title color * * @param $color */ function setColor($color) { $this->color = $color; $this->title->setColor($color); } /** * Change axis padding * * @param int $left Left padding in pixels * @param int $right Right padding in pixels */ function setPadding($left, $right) { $this->padding->set($left, $right); } /** * Get axis padding * * @return Side */ function getPadding() { return $this->padding; } /** * Change axis range * * @param float $min * @param float $max */ function setRange($min, $max) { if($min !== NULL) { $this->range[0] = (float)$min; } if($max !== NULL) { $this->range[1] = (float)$max; } } /** * Get axis range * * @return array */ function getRange() { return $this->range; } /** * Change axis range callback function * * @param string $toValue Transform a position between 0 and 1 to a value * @param string $toPosition Transform a value to a position between 0 and 1 on the axis */ function setRangeCallback($toValue, $toPosition) { $this->rangeCallback = array( 'toValue' => (string)$toValue, 'toPosition' => (string)$toPosition ); } /** * Center X values of the axis * * @param &$axis An axis * @param float $value The reference value on the axis */ function setXCenter(&$axis, $value) { // Check vector angle if($this->line->isVertical() === FALSE) { trigger_error("setXCenter() can only be used on vertical axes", E_USER_ERROR); } $p = $axis->getPointFromValue($value); $this->line->setX( $p->x, $p->x ); } /** * Center Y values of the axis * * @param &$axis An axis * @param float $value The reference value on the axis */ function setYCenter(&$axis, $value) { // Check vector angle if($this->line->isHorizontal() === FALSE) { trigger_error("setYCenter() can only be used on horizontal axes", E_USER_ERROR); } $p = $axis->getPointFromValue($value); $this->line->setY( $p->y, $p->y ); } /** * Get the distance between to values on the axis * * @param float $from The first value * @param float $to The last value * @return Point */ function getDistance($from, $to) { $p1 = $this->getPointFromValue($from); $p2 = $this->getPointFromValue($to); return $p1->getDistance($p2); } /** * Get a point on the axis from a value * * @param float $value * @return Point */ function getPointFromValue($value) { $callback = $this->rangeCallback['toPosition']; list($min, $max) = $this->range; $position = $callback($value, $min, $max); return $this->getPointFromPosition($position); } /** * Get a point on the axis from a position * * @param float $position A position between 0 and 1 * @return Point */ function getPointFromPosition($position) { $vector = $this->getVector(); $angle = $vector->getAngle(); $size = $vector->getSize(); return $vector->p1->move( cos($angle) * $size * $position, -1 * sin($angle) * $size * $position ); } /** * Draw axis * * @param $drawer A drawer */ function draw($drawer) { if($this->hide) { return; } $vector = $this->getVector(); // Draw axis ticks $this->drawTicks($drawer, $vector); // Draw axis line $this->line($drawer); // Draw labels $this->drawLabels($drawer); // Draw axis title $p = $this->getPointFromPosition($this->titlePosition); $this->title->draw($drawer, $p); } function autoScale() { if($this->isAuto() === FALSE) { return; } list($min, $max) = $this->getRange(); $interval = $max - $min; $partMax = $max / $interval; $partMin = $min / $interval; $difference = log($interval) / log(10); $difference = floor($difference); $pow = pow(10, $difference); $intervalNormalize = $interval / $pow; if($difference <= 0) { $precision = $difference * -1 + 1; if($intervalNormalize > 2) { $precision--; } } else { $precision = 0; } if($min != 0 and $max != 0) { $precision++; } $this->setLabelPrecision($precision); if($intervalNormalize <= 1.5) { $intervalReal = 1.5; $labelNumber = 4; } else if($intervalNormalize <= 2) { $intervalReal = 2; $labelNumber = 5; } else if($intervalNormalize <= 3) { $intervalReal = 3; $labelNumber = 4; } else if($intervalNormalize <= 4) { $intervalReal = 4; $labelNumber = 5; } else if($intervalNormalize <= 5) { $intervalReal = 5; $labelNumber = 6; } else if($intervalNormalize <= 8) { $intervalReal = 8; $labelNumber = 5; } else if($intervalNormalize <= 10) { $intervalReal = 10; $labelNumber = 6; } if($min == 0) { $this->setRange( $min, $intervalReal * $pow ); } else if($max == 0) { $this->setRange( $intervalReal * $pow * -1, 0 ); } $this->setLabelNumber($labelNumber); } function line($drawer) { $drawer->line( $this->color, $this->line ); } function drawTicks($drawer, &$vector) { foreach($this->ticks as $tick) { $tick->setColor($this->color); $tick->draw($drawer, $vector); } } function drawLabels($drawer) { if($this->labelNumber !== NULL) { list($min, $max) = $this->range; $number = $this->labelNumber - 1; if($number < 1) { return; } $function = $this->rangeCallback['toValue']; $labels = array(); for($i = 0; $i <= $number; $i++) { $labels[] = $function($i / $number, $min, $max); } $this->label->set($labels); } $labels = $this->label->count(); for($i = 0; $i < $labels; $i++) { $p = $this->getPointFromValue($this->label->get($i)); $this->label->draw($drawer, $p, $i); } } function getVector() { $angle = $this->line->getAngle(); // Compute paddings $vector = new awVector( $this->line->p1->move( cos($angle) * $this->padding->left, -1 * sin($angle) * $this->padding->left ), $this->line->p2->move( -1 * cos($angle) * $this->padding->right, -1 * -1 * sin($angle) * $this->padding->right ) ); return $vector; } function __clone() { $this->label = $this->label; $this->line = $this->line; $this->title = $this->title; foreach($this->ticks as $name => $tick) { $this->ticks[$name] = $tick; } } } registerClass('Axis'); function toProportionalValue($position, $min, $max) { return $min + ($max - $min) * $position; } function toProportionalPosition($value, $min, $max) { if($max - $min == 0) { return 0; } return ($value - $min) / ($max - $min); } ?>pgfouine-1.2/include/reporting/artichow/php4/inc/Font.class.php0000644000175000017500000001265610352605100023211 0ustar acmeacmefont = $font; } /** * Draw a text * * @param $drawer * @param $p Draw text at this point * @param &$text The text */ function draw($drawer, $p, &$text) { $angle = $text->getAngle(); if($angle !== 90 and $angle !== 0) { trigger_error("You can only use 0° and 90°", E_USER_ERROR); } if($angle === 90) { $function = 'imagestringup'; } else { $function = 'imagestring'; } if($angle === 90) { $add = $this->getTextHeight($text); } else { $add = 0; } $color = $text->getColor(); $rgb = $color->getColor($drawer->resource); $lines = explode("\n", $text->getText()); for($i = 0; $i < count($lines); $i++) { $function( $drawer->resource, $this->font, $drawer->x + $p->x, $drawer->y + $p->y + $add + $i * $this->getLineHeight($text), $lines[$i], $rgb ); } } /** * Get the width of a string * * @param &$text A string */ function getTextWidth(&$text) { if($text->getAngle() === 90) { $text->setAngle(45); return $this->getTextHeight($text); } else if($text->getAngle() === 45) { $text->setAngle(90); } $font = $text->getFont(); $fontWidth = imagefontwidth($font->font); if($fontWidth === FALSE) { trigger_error("Unable to get font size", E_USER_ERROR); } $lines = explode("\n", $text->getText()); /* this is the correct algorithm but I consider only the first line for my needs $textLength = 0; for($i = 0; $i < count($lines); $i++) { $textLength = max($textLength, strlen($lines[$i])); }*/ $textLength = strlen($lines[0]); return (int)$fontWidth * $textLength; } /** * Get the height of a line * * @param &$text A string */ function getLineHeight(&$text) { if($text->getAngle() === 90) { $text->setAngle(45); return $this->getTextWidth($text); } else if($text->getAngle() === 45) { $text->setAngle(90); } $font = $text->getFont(); $fontHeight = imagefontheight($font->font); if($fontHeight === FALSE) { trigger_error("Unable to get font size", E_USER_ERROR); } return (int)$fontHeight; } /** * Get the height of a string * * @param &$text A string */ function getTextHeight(&$text) { $lines = explode("\n", $text->getText()); $lineCount = count($lines); return $this->getLineHeight($text) * $lineCount; } } registerClass('Font'); /** * TTF fonts * * @package Artichow */ class awTTFFont extends awFont { /** * Font size * * @var int */ var $size; /** * Font file * * @param string $font Font file * @param int $size Font size */ function awTTFFont($font, $size) { parent::awFont($font); $this->size = (int)$size; } /** * Draw a text * * @param $drawer * @param $p Draw text at this point * @param &$text The text */ function draw($drawer, $p, &$text) { // Make easier font positionment $text->setText($text->getText()." "); $color = $text->getColor(); $rgb = $color->getColor($drawer->resource); $box = imagettfbbox($this->size, $text->getAngle(), $this->font, $text->getText()); $height = - $box[5]; $box = imagettfbbox($this->size, 90, $this->font, $text->getText()); $width = abs($box[6] - $box[2]); // Restore old text $text->setText(substr($text->getText(), 0, strlen($text->getText()) - 1)); imagettftext( $drawer->resource, $this->size, $text->getAngle(), $drawer->x + $p->x + $width * sin($text->getAngle() / 180 * M_PI), $drawer->y + $p->y + $height, $rgb, $this->font, $text->getText() ); } /** * Get the width of a string * * @param &$text A string */ function getTextWidth(&$text) { $box = imagettfbbox($this->size, $text->getAngle(), $this->font, $text->getText()); if($box === FALSE) { trigger_error("Unable to get font size", E_USER_ERROR); return; } list(, , $x2, $y2, , , $x1, $y1) = $box; return abs($x2 - $x1); } /** * Get the height of a string * * @param &$text A string */ function getTextHeight(&$text) { $box = imagettfbbox($this->size, $text->getAngle(), $this->font, $text->getText()); if($box === FALSE) { trigger_error("Unable to get font size", E_USER_ERROR); return; } list(, , $x2, $y2, , , $x1, $y1) = $box; return abs($y2 - $y1); } } registerClass('TTFFont'); $php = ''; for($i = 1; $i <= 5; $i++) { $php .= ' class awFont'.$i.' extends awFont { function awFont'.$i.'() { parent::awFont('.$i.'); } } '; if(ARTICHOW_PREFIX !== 'aw') { $php .= ' class '.ARTICHOW_PREFIX.'Font'.$i.' extends awFont'.$i.' { } '; } } eval($php); $php = ''; foreach($fonts as $font) { $php .= ' class aw'.$font.' extends awTTFFont { function aw'.$font.'($size) { parent::awTTFFont(\''.(ARTICHOW_FONT.DIRECTORY_SEPARATOR.$font.'.ttf').'\', $size); } } '; if(ARTICHOW_PREFIX !== 'aw') { $php .= ' class '.ARTICHOW_PREFIX.$font.' extends aw'.$font.' { } '; } } eval($php); ?> pgfouine-1.2/include/reporting/artichow/php4/inc/Color.class.php0000644000175000017500000001057110352052223023355 0ustar acmeacmered = (int)$red; $this->green = (int)$green; $this->blue = (int)$blue; $this->alpha = (int)round($alpha * 127 / 100); } /** * Return a GDised color * * @param resource $resource A GD resource * @return int */ function getColor($resource) { $this->resource = $resource; if($this->color === NULL) { if($this->alpha === 0 or function_exists('imagecolorallocatealpha') === FALSE) { $this->color = imagecolorallocate($this->resource, $this->red, $this->green, $this->blue); } else { $this->color = imagecolorallocatealpha($this->resource, $this->red, $this->green, $this->blue, $this->alpha); } } return $this->color; } /** * Change color brightness * * @param int $brightness Add this intensity to the color (betweeen -255 and +255) */ function brightness($brightness) { $brightness = (int)$brightness; $this->red = min(255, max(0, $this->red + $brightness)); $this->green = min(255, max(0, $this->green + $brightness)); $this->blue = min(255, max(0, $this->blue + $brightness)); } /** * Get RGB and alpha values of your color * * @return array */ function rgba() { return array($this->red, $this->green, $this->blue, $this->alpha); } /** * Free resources used for this color */ function free() { if($this->resource !== NULL) { @imagecolordeallocate($this->resource, $this->color); $this->resource = NULL; } } function php5Destructor() { $this->free(); } } registerClass('Color'); $colors = array( 'Black' => array(0, 0, 0), 'AlmostBlack' => array(48, 48, 48), 'VeryDarkGray' => array(88, 88, 88), 'DarkGray' => array(128, 128, 128), 'MidGray' => array(160, 160, 160), 'LightGray' => array(195, 195, 195), 'VeryLightGray' => array(220, 220, 220), 'White' => array(255, 255, 255), 'VeryDarkRed' => array(64, 0, 0), 'DarkRed' => array(128, 0, 0), 'MidRed' => array(192, 0, 0), 'Red' => array(255, 0, 0), 'LightRed' => array(255, 192, 192), 'VeryDarkGreen' => array(0, 64, 0), 'DarkGreen' => array(0, 128, 0), 'MidGreen' => array(0, 192, 0), 'Green' => array(0, 255, 0), 'LightGreen' => array(192, 255, 192), 'VeryDarkBlue' => array(0, 0, 64), 'DarkBlue' => array(0, 0, 128), 'MidBlue' => array(0, 0, 192), 'Blue' => array(0, 0, 255), 'LightBlue' => array(192, 192, 255), 'VeryDarkYellow' => array(64, 64, 0), 'DarkYellow' => array(128, 128, 0), 'MidYellow' => array(192, 192, 0), 'Yellow' => array(255, 255, 2), 'LightYellow' => array(255, 255, 192), 'VeryDarkCyan' => array(0, 64, 64), 'DarkCyan' => array(0, 128, 128), 'MidCyan' => array(0, 192, 192), 'Cyan' => array(0, 255, 255), 'LightCyan' => array(192, 255, 255), 'VeryDarkMagenta' => array(64, 0, 64), 'DarkMagenta' => array(128, 0, 128), 'MidMagenta' => array(192, 0, 192), 'Magenta' => array(255, 0, 255), 'LightMagenta' => array(255, 192, 255), 'DarkOrange' => array(192, 88, 0), 'Orange' => array(255, 128, 0), 'LightOrange' => array(255, 168, 88), 'VeryLightOrange' => array(255, 220, 168), 'DarkPink' => array(192, 0, 88), 'Pink' => array(255, 0, 128), 'LightPink' => array(255, 88, 168), 'VeryLightPink' => array(255, 168, 220), 'DarkPurple' => array(88, 0, 192), 'Purple' => array(128, 0, 255), 'LightPurple' => array(168, 88, 255), 'VeryLightPurple' => array(220, 168, 255), ); $php = ''; foreach($colors as $name => $color) { list($red, $green, $blue) = $color; $php .= ' class aw'.$name.' extends awColor { function aw'.$name.'($alpha = 0) { parent::awColor('.$red.', '.$green.', '.$blue.', $alpha); } } '; if(ARTICHOW_PREFIX !== 'aw') { $php .= ' class '.ARTICHOW_PREFIX.$name.' extends aw'.$name.' { } '; } } eval($php); ?> pgfouine-1.2/include/reporting/artichow/php4/inc/Tick.class.php0000644000175000017500000001241310352052223023166 0ustar acmeacme */ define("TICK_IN", 0); define("TICK_OUT", 1); define("TICK_IN_OUT", 2); /* */ /** * Handle ticks * * @package Artichow */ class awTick { /** * Ticks style * * @var int */ var $style = TICK_IN; /** * Ticks size * * @var int */ var $size; /** * Ticks color * * @var Color */ var $color; /** * Ticks number * * @var int */ var $number; /** * Ticks number by other tick * * @var array */ var $numberByTick; /** * Ticks interval * * @var int */ var $interval = 1; /** * Hide ticks * * @var bool */ var $hide = FALSE; /** * Hide first tick * * @var bool */ var $hideFirst = FALSE; /** * Hide last tick * * @var bool */ var $hideLast = FALSE; /** * In mode * * @param int */ /** * Out mode * * @param int */ /** * In and out mode * * @param int */ /** * Build the ticks * * @param int $number Number of ticks * @param int $size Ticks size */ function awTick($number, $size) { $this->setSize($size); $this->setNumber($number); $this->setColor(new awBlack); $this->style = TICK_IN; } /** * Change ticks style * * @param int $style */ function setStyle($style) { $this->style = (int)$style; } /** * Get ticks style * * @return int */ function getStyle() { return $this->style; } /** * Change ticks color * * @param $color */ function setColor($color) { $this->color = $color; } /** * Change ticks size * * @param int $size */ function setSize($size) { $this->size = (int)$size; } /** * Change interval of ticks * * @param int $interval */ function setInterval($interval) { $this->interval = (int)$interval; } /** * Get interval between each tick * * @return int */ function getInterval() { return $this->interval; } /** * Change number of ticks * * @param int $number */ function setNumber($number) { $this->number = (int)$number; } /** * Get number of ticks * * @return int */ function getNumber() { return $this->number; } /** * Change number of ticks relative to others ticks * * @param &$tick Ticks reference * @param int $number Number of ticks */ function setNumberByTick(&$tick, $number) { $this->numberByTick = array(&$tick, (int)$number); } /** * Hide ticks * * @param bool $hide */ function hide($hide) { $this->hide = (bool)$hide; } /** * Hide first tick * * @param bool $hide */ function hideFirst($hide) { $this->hideFirst = (bool)$hide; } /** * Hide last tick * * @param bool $hide */ function hideLast($hide) { $this->hideLast = (bool)$hide; } /** * Draw ticks on a vector * * @param $drawer A drawer * @param &$vector A vector */ function draw($drawer, &$vector) { if($this->numberByTick !== NULL) { list($tick, $number) = $this->numberByTick; $this->number = 1 + ($tick->getNumber() - 1) * ($number + 1); $this->interval = $tick->getInterval(); } if($this->number < 2 or $this->hide) { return; } $angle = $vector->getAngle(); // echo "INIT:".$angle."
"; switch($this->style) { case TICK_IN : $this->drawTicks($drawer, $vector, NULL, $angle + M_PI / 2); break; case TICK_OUT : $this->drawTicks($drawer, $vector, $angle + 3 * M_PI / 2, NULL); break; default : $this->drawTicks($drawer, $vector, $angle + M_PI / 2, $angle + 3 * M_PI / 2); break; } } function drawTicks($drawer, &$vector, $from, $to) { // Draw last tick if($this->hideLast === FALSE) { //echo ''; if(($this->number - 1) % $this->interval === 0) { $this->drawTick($drawer, $vector->p2, $from, $to); } //echo ''; } $number = $this->number - 1; $size = $vector->getSize(); // Get tick increment in pixels $inc = $size / $number; // Check if we must hide the first tick $start = $this->hideFirst ? $inc : 0; $stop = $inc * $number; $position = 0; for($i = $start; round($i, 6) < $stop; $i += $inc) { if($position % $this->interval === 0) { $p = $vector->p1->move( round($i * cos($vector->getAngle()), 6), round($i * sin($vector->getAngle() * -1), 6) ); $this->drawTick($drawer, $p, $from, $to); } $position++; } //echo '

'; } function drawTick($drawer, $p, $from, $to) { // echo $this->size.':'.$angle.'|'.cos($angle).'/'; // The round avoid some errors in the calcul // For example, 12.00000008575245 becomes 12 $p1 = $p; $p2 = $p; if($from !== NULL) { $p1 = $p1->move( round($this->size * cos($from), 6), round($this->size * sin($from) * -1, 6) ); } if($to !== NULL) { $p2 = $p2->move( round($this->size * cos($to), 6), round($this->size * sin($to) * -1, 6) ); } //echo $p1->x.':'.$p2->x.'('.$p1->y.':'.$p2->y.')'.'/'; $vector = new awVector( $p1, $p2 ); $drawer->line( $this->color, $vector ); } } registerClass('Tick'); ?>pgfouine-1.2/include/reporting/artichow/php4/inc/Shadow.class.php0000644000175000017500000001652410352052223023530 0ustar acmeacme */ define("SHADOW_LEFT_TOP", 1); define("SHADOW_LEFT_BOTTOM", 2); define("SHADOW_RIGHT_TOP", 3); define("SHADOW_RIGHT_BOTTOM", 4); define("SHADOW_IN", 1); define("SHADOW_OUT", 2); /* */ /** * Draw shadows * */ class awShadow { /** * Shadow on left and top sides * * @var int */ /** * Shadow on left and bottom sides * * @var int */ /** * Shadow on right and top sides * * @var int */ /** * Shadow on right and bottom sides * * @var int */ /** * In mode * * @var int */ /** * Out mode * * @var int */ /** * Shadow size * * @var int */ var $size = 0; /** * Hide shadow ? * * @var bool */ var $hide = FALSE; /** * Shadow color * * @var Color */ var $color; /** * Shadow position * * @var int */ var $position; /** * Smooth shadow ? * * @var bool */ var $smooth = FALSE; /** * Shadow constructor * * @param int $position Shadow position */ function awShadow($position) { $this->setPosition($position); } /** * Hide shadow ? * * @param bool $hide */ function hide($hide = TRUE) { $this->hide = (bool)$hide; } /** * Show shadow ? * * @param bool $show */ function show($show = TRUE) { $this->hide = (bool)!$show; } /** * Change shadow size * * @param int $size * @param bool $smooth Smooth the shadow (facultative argument) */ function setSize($size, $smooth = NULL) { $this->size = (int)$size; if($smooth !== NULL) { $this->smooth($smooth); } } /** * Change shadow color * * @param $color */ function setColor($color) { $this->color = (int)$color; } /** * Change shadow position * * @param int $position */ function setPosition($position) { $this->position = (int)$position; } /** * Smooth shadow ? * * @param bool $smooth */ function smooth($smooth) { $this->smooth = (bool)$smooth; } /** * Get the space taken by the shadow * * @return Side */ function getSpace() { return new awSide( ($this->position === SHADOW_LEFT_TOP or $this->position === SHADOW_LEFT_BOTTOM) ? $this->size : 0, ($this->position === SHADOW_RIGHT_TOP or $this->position === SHADOW_RIGHT_BOTTOM) ? $this->size : 0, ($this->position === SHADOW_LEFT_TOP or $this->position === SHADOW_RIGHT_TOP) ? $this->size : 0, ($this->position === SHADOW_LEFT_BOTTOM or $this->position === SHADOW_RIGHT_BOTTOM) ? $this->size : 0 ); } /** * Draw shadow * * @param $drawer * @param $p1 Top-left point * @param $p2 Right-bottom point * @param int Drawing mode */ function draw($drawer, $p1, $p2, $mode) { if($this->hide) { return; } if($this->size <= 0) { return; } $color = (is_a($this->color, 'awColor')) ? $this->color : new awColor(125, 125, 125); switch($this->position) { case SHADOW_RIGHT_BOTTOM : if($mode === SHADOW_OUT) { $t1 = $p1->move(0, 0); $t2 = $p2->move($this->size + 1, $this->size + 1); } else { // PHP 4 compatibility $t1 = $p1->move(0, 0); $t2 = $p2->move(0, 0); } $width = $t2->x - $t1->x; $height = $t2->y - $t1->y; $drawer->setAbsPosition($t1->x + $drawer->x, $t1->y + $drawer->y); $drawer->filledRectangle( $color, new awLine( new awPoint($width - $this->size, $this->size), new awPoint($width - 1, $height - 1) ) ); $drawer->filledRectangle( $color, new awLine( new awPoint($this->size, $height - $this->size), new awPoint($width - $this->size - 1, $height - 1) ) ); $this->smoothPast($drawer, $color, $width, $height); break; case SHADOW_LEFT_TOP : if($mode === SHADOW_OUT) { $t1 = $p1->move(- $this->size, - $this->size); $t2 = $p2->move(0, 0); } else { // PHP 4 compatibility $t1 = $p1->move(0, 0); $t2 = $p2->move(0, 0); } $width = $t2->x - $t1->x; $height = $t2->y - $t1->y; $drawer->setAbsPosition($t1->x + $drawer->x, $t1->y + $drawer->y); $height = max($height + 1, $this->size); $drawer->filledRectangle( $color, new awLine( new awPoint(0, 0), new awPoint($this->size - 1, $height - $this->size - 1) ) ); $drawer->filledRectangle( $color, new awLine( new awPoint($this->size, 0), new awPoint($width - $this->size - 1, $this->size - 1) ) ); $this->smoothPast($drawer, $color, $width, $height); break; case SHADOW_RIGHT_TOP : if($mode === SHADOW_OUT) { $t1 = $p1->move(0, - $this->size); $t2 = $p2->move($this->size + 1, 0); } else { // PHP 4 compatibility $t1 = $p1->move(0, 0); $t2 = $p2->move(0, 0); } $width = $t2->x - $t1->x; $height = $t2->y - $t1->y; $drawer->setAbsPosition($t1->x + $drawer->x, $t1->y + $drawer->y); $height = max($height + 1, $this->size); $drawer->filledRectangle( $color, new awLine( new awPoint($width - $this->size, 0), new awPoint($width - 1, $height - $this->size - 1) ) ); $drawer->filledRectangle( $color, new awLine( new awPoint($this->size, 0), new awPoint($width - $this->size - 1, $this->size - 1) ) ); $this->smoothFuture($drawer, $color, $width, $height); break; case SHADOW_LEFT_BOTTOM : if($mode === SHADOW_OUT) { $t1 = $p1->move(- $this->size, 0); $t2 = $p2->move(0, $this->size + 1); } else { // PHP 4 compatibility $t1 = $p1->move(0, 0); $t2 = $p2->move(0, 0); } $width = $t2->x - $t1->x; $height = $t2->y - $t1->y; $drawer->setAbsPosition($t1->x + $drawer->x, $t1->y + $drawer->y); $drawer->filledRectangle( $color, new awLine( new awPoint(0, $this->size), new awPoint($this->size - 1, $height - 1) ) ); $drawer->filledRectangle( $color, new awLine( new awPoint($this->size, $height - $this->size), new awPoint($width - $this->size - 1, $height - 1) ) ); $this->smoothFuture($drawer, $color, $width, $height); break; } } function smoothPast($drawer, $color, $width, $height) { if($this->smooth) { for($i = 0; $i < $this->size; $i++) { for($j = 0; $j <= $i; $j++) { $drawer->point( $color, new awPoint($i, $j + $height - $this->size) ); } } for($i = 0; $i < $this->size; $i++) { for($j = 0; $j <= $i; $j++) { $drawer->point( $color, new awPoint($width - $this->size + $j, $i) ); } } } } function smoothFuture($drawer, $color, $width, $height) { if($this->smooth) { for($i = 0; $i < $this->size; $i++) { for($j = 0; $j <= $i; $j++) { $drawer->point( $color, new awPoint($i, $this->size - $j - 1) ); } } for($i = 0; $i < $this->size; $i++) { for($j = 0; $j <= $i; $j++) { $drawer->point( $color, new awPoint($width - $this->size + $j, $height - $i - 1) ); } } } } } registerClass('Shadow'); ?>pgfouine-1.2/include/reporting/artichow/php4/inc/Drawer.class.php0000644000175000017500000005450510352052223023530 0ustar acmeacmeresource = $resource; } /** * Change the image size * * @param int $width Image width * @param int $height Image height */ function setImageSize($width, $height) { $this->width = $width; $this->height = $height; } /** * Inform the drawer of the position of your image * * @param float $x Position on X axis of the center of the component * @param float $y Position on Y axis of the center of the component */ function setPosition($x, $y) { // Calcul absolute position $this->x = round($x * $this->width - $this->w / 2); $this->y = round($y * $this->height - $this->h / 2); } /** * Inform the drawer of the position of your image * This method need absolutes values * * @param int $x Left-top corner X position * @param int $y Left-top corner Y position */ function setAbsPosition($x, $y) { $this->x = $x; $this->y = $y; } /** * Move the position of the image * * @param int $x Add this value to X axis * @param int $y Add this value to Y axis */ function movePosition($x, $y) { $this->x += (int)$x; $this->y += (int)$y; } /** * Inform the drawer of the size of your image * Height and width must be between 0 and 1. * * @param int $w Image width * @param int $h Image height * @return array Absolute width and height of the image */ function setSize($w, $h) { // Calcul absolute size $this->w = round($w * $this->width); $this->h = round($h * $this->height); return $this->getSize(); } /** * Inform the drawer of the size of your image * You can set absolute size with this method. * * @param int $w Image width * @param int $h Image height */ function setAbsSize($w, $h) { $this->w = $w; $this->h = $h; return $this->getSize(); } /** * Get the size of the component handled by the drawer * * @return array Absolute width and height of the component */ function getSize() { return array($this->w, $this->h); } /** * Draw an image here * * @param &$image Image * @param int $p1 Image top-left point * @param int $p2 Image bottom-right point */ function copyImage(&$image, $p1, $p2) { list($x1, $y1) = $p1->getLocation(); list($x2, $y2) = $p2->getLocation(); $drawer = $image->getDrawer(); imagecopy($this->resource, $drawer->resource, $this->x + $x1, $this->y + $y1, 0, 0, $x2 - $x1, $y2 - $y1); } /** * Draw an image here * * @param &$image Image * @param int $d1 Destination top-left position * @param int $d2 Destination bottom-right position * @param int $s1 Source top-left position * @param int $s2 Source bottom-right position * @param bool $resample Resample image ? (default to TRUE) */ function copyResizeImage(&$image, $d1, $d2, $s1, $s2, $resample = TRUE) { if($resample) { $function = 'imagecopyresampled'; } else { $function = 'imagecopyresized'; } $drawer = $image->getDrawer(); $function( $this->resource, $drawer->resource, $this->x + $d1->x, $this->y + $d1->y, $s1->x, $s1->y, $d2->x - $d1->x, $d2->y - $d1->y, $s2->x - $s1->x, $s2->y - $s1->y ); } /** * Draw a string * * @var &$text Text to print * @param $point Draw the text at this point */ function string(&$text, $point) { $font = $text->getFont(); if($text->getBackground() !== NULL or $text->border->visible()) { list($left, $right, $top, $bottom) = $text->getPadding(); $width = $font->getTextWidth($text); $height = $font->getTextHeight($text); $x1 = floor($point->x - $left); $y1 = floor($point->y - $top); $x2 = $x1 + $width + $left + $right; $y2 = $y1 + $height + $top + $bottom; $this->filledRectangle( $text->getBackground(), awLine::build($x1, $y1, $x2, $y2) ); $text->border->rectangle( $this, new awPoint($x1 - 1, $y1 - 1), new awPoint($x2 + 1, $y2 + 1) ); } $font->draw($this, $point, $text); } /** * Draw a pixel * * @param $color Pixel color * @param $p */ function point($color, $p) { if($p->isHidden() === FALSE) { $rgb = $color->getColor($this->resource); imagesetpixel($this->resource, $this->x + round($p->x), $this->y + round($p->y), $rgb); } } /** * Draw a colored line * * @param $color Line color * @param $line * @param int $thickness Line tickness */ function line($color, $line) { if($line->thickness > 0 and $line->isHidden() === FALSE) { $rgb = $color->getColor($this->resource); $thickness = $line->thickness; list($p1, $p2) = $line->getLocation(); $this->startThickness($thickness); switch($line->getStyle()) { case LINE_SOLID : imageline($this->resource, $this->x + round($p1->x), $this->y + round($p1->y), $this->x + round($p2->x), $this->y + round($p2->y), $rgb); break; case LINE_DOTTED : $size = sqrt(pow($p2->y - $p1->y, 2) + pow($p2->x - $p1->x, 2)); $cos = ($p2->x - $p1->x) / $size; $sin = ($p2->y - $p1->y) / $size; for($i = 0; $i <= $size; $i += 2) { $p = new awPoint( round($i * $cos + $p1->x), round($i * $sin + $p1->y) ); $this->point($color, $p); } break; case LINE_DASHED : $width = $p2->x - $p1->x; $height = $p2->y - $p1->y; $size = sqrt(pow($height, 2) + pow($width, 2)); if($size == 0) { return; } $cos = $width / $size; $sin = $height / $size; for($i = 0; $i <= $size; $i += 6) { $t1 = new awPoint( round($i * $cos + $p1->x), round($i * $sin + $p1->y) ); $function = ($height > 0) ? 'min' : 'max'; $t2 = new awPoint( round(min(($i + 3) * $cos, $width) + $p1->x), round($function(($i + 3) * $sin, $height) + $p1->y) ); $this->line($color, new awLine($t1, $t2)); } break; } $this->stopThickness($thickness); } } /** * Draw a color arc * @param $color Arc color * @param $center Point center * @param int $width Ellipse width * @param int $height Ellipse height * @param int $from Start angle * @param int $to End angle */ function arc($color, $center, $width, $height, $from, $to) { imagefilledarc( $this->resource, $this->x + $center->x, $this->y + $center->y, $width, $height, $from, $to, $color->getColor($this->resource), IMG_ARC_EDGED | IMG_ARC_NOFILL ); } /** * Draw an arc with a background color * * @param $color Arc background color * @param $center Point center * @param int $width Ellipse width * @param int $height Ellipse height * @param int $from Start angle * @param int $to End angle */ function filledArc($color, $center, $width, $height, $from, $to) { imagefilledarc( $this->resource, $this->x + $center->x, $this->y + $center->y, $width, $height, $from, $to, $color->getColor($this->resource), IMG_ARC_PIE ); } /** * Draw a colored ellipse * * @param $color Ellipse color * @param $center Ellipse center * @param int $width Ellipse width * @param int $height Ellipse height */ function ellipse($color, $center, $width, $height) { list($x, $y) = $center->getLocation(); $rgb = $color->getColor($this->resource); imageellipse( $this->resource, $this->x + $x, $this->y + $y, $width, $height, $rgb ); } /** * Draw an ellipse with a background * * @param mixed $background Background (can be a color or a gradient) * @param $center Ellipse center * @param int $width Ellipse width * @param int $height Ellipse height */ function filledEllipse($background, $center, $width, $height) { if(is_a($background, 'awColor')) { list($x, $y) = $center->getLocation(); $rgb = $background->getColor($this->resource); imagefilledellipse( $this->resource, $this->x + $x, $this->y + $y, $width, $height, $rgb ); } else if(is_a($background, 'awGradient')) { list($x, $y) = $center->getLocation(); $x1 = $x - round($width / 2); $y1 = $y - round($height / 2); $x2 = $x1 + $width; $y2 = $y1 + $height; $gradientDrawer = new awGradientDrawer($this); $gradientDrawer->filledEllipse( $background, $x1, $y1, $x2, $y2 ); } } /** * Draw a colored rectangle * * @param $color Rectangle color * @param $line Rectangle diagonale * @param $p2 */ function rectangle($color, $line) { $p1 = $line->p1; $p2 = $line->p2; switch($line->getStyle()) { case LINE_SOLID : $thickness = $line->getThickness(); $this->startThickness($thickness); $rgb = $color->getColor($this->resource); imagerectangle($this->resource, $this->x + $p1->x, $this->y + $p1->y, $this->x + $p2->x, $this->y + $p2->y, $rgb); $this->stopThickness($thickness); break; default : // Top side $line->setLocation( new awPoint($p1->x, $p1->y), new awPoint($p2->x, $p1->y) ); $this->line($color, $line); // Right side $line->setLocation( new awPoint($p2->x, $p1->y), new awPoint($p2->x, $p2->y) ); $this->line($color, $line); // Bottom side $line->setLocation( new awPoint($p1->x, $p2->y), new awPoint($p2->x, $p2->y) ); $this->line($color, $line); // Left side $line->setLocation( new awPoint($p1->x, $p1->y), new awPoint($p1->x, $p2->y) ); $this->line($color, $line); break; } } /** * Draw a rectangle with a background * * @param mixed $background Background (can be a color or a gradient) * @param $line Rectangle diagonale */ function filledRectangle($background, $line) { $p1 = $line->p1; $p2 = $line->p2; if(is_a($background, 'awColor')) { $rgb = $background->getColor($this->resource); imagefilledrectangle($this->resource, $this->x + $p1->x, $this->y + $p1->y, $this->x + $p2->x, $this->y + $p2->y, $rgb); } else if(is_a($background, 'awGradient')) { $gradientDrawer = new awGradientDrawer($this); $gradientDrawer->filledRectangle($background, $p1, $p2); } } /** * Draw a polygon * * @param $color Polygon color * @param Polygon A polygon */ function polygon($color, &$polygon) { switch($polygon->getStyle()) { case POLYGON_SOLID : $thickness = $line->getThickness(); $this->startThickness($thickness); $points = $this->getPolygonPoints($polygon); $rgb = $color->getColor($this->resource); imagepolygon($this->resource, $points, $polygon->count(), $rgb); $this->stopThickness($thickness); break; default : if($polygon->count() > 1) { $prev = $polygon->get(0); $line = new awLine; $line->setStyle($polygon->getStyle()); $line->setThickness($polygon->getThickness()); for($i = 1; $i < $polygon->count(); $i++) { $current = $polygon->get($i); $line->setLocation($prev, $current); $this->line($color, $line); $prev = $current; } } } } /** * Draw a polygon with a background * * @param mixed $background Background (can be a color or a gradient) * @param Polygon A polygon */ function filledPolygon($background, &$polygon) { if(is_a($background, 'awColor')) { $points = $this->getPolygonPoints($polygon); $rgb = $background->getColor($this->resource); imagefilledpolygon($this->resource, $points, $polygon->count(), $rgb); } else if(is_a($background, 'awGradient')) { $gradientDrawer = new awGradientDrawer($this); $gradientDrawer->filledPolygon($background, $polygon); } } function getPolygonPoints(&$polygon) { $points = array(); foreach($polygon->all() as $point) { $points[] = $point->x + $this->x; $points[] = $point->y + $this->y; } return $points; } function startThickness($thickness) { if($thickness > 1) { // Beurk :'( imageantialias($this->resource, FALSE); imagesetthickness($this->resource, $thickness); } } function stopThickness($thickness) { if($thickness > 1) { imagesetthickness($this->resource, 1); imageantialias($this->resource, TRUE); } } } registerClass('Drawer'); /** * To your gradients * * @package Artichow */ class awGradientDrawer { /** * A drawer * * @var Drawer */ var $drawer; /** * Build your GradientDrawer * * @var $drawer */ function awGradientDrawer($drawer) { $this->drawer = $drawer; } function drawFilledFlatTriangle($gradient, $a, $b, $c) { if($gradient->angle !== 0) { trigger_error("Flat triangles can only be used with 0 degree gradients", E_USER_ERROR); } // Look for right-angled triangle if($a->x !== $b->x and $b->x !== $c->x) { trigger_error("Not right-angled flat triangles are not supported yet", E_USER_ERROR); } if($a->x === $b->x) { $d = $a; $e = $c; } else { $d = $c; $e = $a; } $this->init($gradient, $b->y - $d->y); for($i = $c->y + 1; $i < $b->y; $i++) { $color = $this->color($i - $d->y); $pos = ($i - $d->y) / ($b->y - $d->y); $p1 = new awPoint($e->x, $i); $p2 = new awPoint(1 + floor($e->x - $pos * ($e->x - $d->x)), $i); $this->drawer->filledRectangle($color, new awLine($p1, $p2)); $color->free(); unset($color); } } function filledRectangle($gradient, $p1, $p2) { list($x1, $y1) = $p1->getLocation(); list($x2, $y2) = $p2->getLocation(); if($y1 < $y2) { $y1 ^= $y2 ^= $y1 ^= $y2; } if($x2 < $x1) { $x1 ^= $x2 ^= $x1 ^= $x2; } if(is_a($gradient, 'awLinearGradient')) { $this->rectangleLinearGradient($gradient, new awPoint($x1, $y1), new awPoint($x2, $y2)); } else { trigger_error("This gradient is not supported by rectangles", E_USER_ERROR); } } function filledPolygon($gradient, &$polygon) { if(is_a($gradient, 'awLinearGradient')) { $this->polygonLinearGradient($gradient, $polygon); } else { trigger_error("This gradient is not supported by polygons", E_USER_ERROR); } } function rectangleLinearGradient(&$gradient, $p1, $p2) { list($x1, $y1) = $p1->getLocation(); list($x2, $y2) = $p2->getLocation(); if($y1 - $y2 > 0) { if($gradient->angle === 0) { $this->init($gradient, $y1 - $y2); for($i = $y2; $i <= $y1; $i++) { $color = $this->color($i - $y2); $p1 = new awPoint($x1, $i); $p2 = new awPoint($x2, $i); $this->drawer->filledRectangle($color, new awLine($p1, $p2)); $color->free(); unset($color); } } else if($gradient->angle === 90) { $this->init($gradient, $x2 - $x1); for($i = $x1; $i <= $x2; $i++) { $color = $this->color($i - $x1); $p1 = new awPoint($i, $y2); $p2 = new awPoint($i, $y1); $this->drawer->filledRectangle($color, new awLine($p1, $p2)); $color->free(); unset($color); } } } } function filledEllipse($gradient, $x1, $y1, $x2, $y2) { if($y1 < $y2) { $y1 ^= $y2 ^= $y1 ^= $y2; } if($x2 < $x1) { $x1 ^= $x2 ^= $x1 ^= $x2; } if(is_a($gradient, 'awRadialGradient')) { $this->ellipseRadialGradient($gradient, $x1, $y1, $x2, $y2); } else if(is_a($gradient, 'awLinearGradient')) { $this->ellipseLinearGradient($gradient, $x1, $y1, $x2, $y2); } else { trigger_error("This gradient is not supported by ellipses", E_USER_ERROR); } } function ellipseRadialGradient($gradient, $x1, $y1, $x2, $y2) { if($y1 - $y2 > 0) { if($y1 - $y2 != $x2 - $x1) { trigger_error("Radial gradients are only implemented on circle, not ellipses"); } $c = new awPoint($x1 + ($x2 - $x1) / 2, $y1 + ($y2 - $y1) / 2); $r = ($x2 - $x1) / 2; $ok = array(); // Init gradient $this->init($gradient, $r); for($i = 0; $i <= $r; $i += 0.45) { $p = ceil((2 * M_PI * $i)); if($p > 0) { $interval = 360 / $p; } else { $interval = 360; } $color = $this->color($i); for($j = 0; $j < 360; $j += $interval) { $rad = ($j / 360) * (2 * M_PI); $x = round($i * cos($rad)); $y = round($i * sin($rad)); $l = sqrt($x * $x + $y * $y); if($l <= $r) { if( array_key_exists((int)$x, $ok) === FALSE or array_key_exists((int)$y, $ok[$x]) === FALSE ) { // Print the point $this->drawer->point($color, new awPoint($c->x + $x, $c->y + $y)); $ok[(int)$x][(int)$y] = TRUE; } } } $color->free(); unset($color); } } } function ellipseLinearGradient($gradient, $x1, $y1, $x2, $y2) { // Gauche->droite : 90° if($y1 - $y2 > 0) { if($y1 - $y2 != $x2 - $x1) { trigger_error("Linear gradients are only implemented on circle, not ellipses"); } $r = ($x2 - $x1) / 2; // Init gradient $this->init($gradient, $x2 - $x1); for($i = -$r; $i <= $r; $i++) { $h = sin(acos($i / $r)) * $r; $color = $this->color($i + $r); if($gradient->angle === 90) { // Print the line $p1 = new awPoint( $x1 + $i + $r, round(max($y2 + $r - $h + 1, $y2)) ); $p2 = new awPoint( $x1 + $i + $r, round(min($y1 - $r + $h - 1, $y1)) ); } else { // Print the line $p1 = new awPoint( round(max($x1 + $r - $h + 1, $x1)), $y2 + $i + $r ); $p2 = new awPoint( round(min($x2 - $r + $h - 1, $x2)), $y2 + $i + $r ); } $this->drawer->filledRectangle($color, new awLine($p1, $p2)); $color->free(); unset($color); } } } function polygonLinearGradient(&$gradient, &$polygon) { $count = $polygon->count(); if($count >= 3) { $left = $polygon->get(0); $right = $polygon->get($count - 1); if($gradient->angle === 0) { // Get polygon maximum and minimum $offset = $polygon->get(0); $max = $min = $offset->y; for($i = 1; $i < $count - 1; $i++) { $offset = $polygon->get($i); $max = max($max, $offset->y); $min = min($min, $offset->y); } $this->init($gradient, $max - $min); $prev = $polygon->get(1); $sum = 0; for($i = 2; $i < $count - 1; $i++) { $current = $polygon->get($i); $interval = 1; if($i !== $count - 2) { $current->x -= $interval; } if($current->x - $prev->x > 0) { // Draw rectangle $x1 = $prev->x; $x2 = $current->x; $y1 = max($prev->y, $current->y); $y2 = $left->y; $gradient = new awLinearGradient( $this->color($max - $min - ($y2 - $y1)), $this->color($max - $min), 0 ); if($y1 > $y2) { $y2 = $y1; } $this->drawer->filledRectangle( $gradient, awLine::build($x1, $y1, $x2, $y2) ); $top = ($prev->y < $current->y) ? $current : $prev; $bottom = ($prev->y >= $current->y) ? $current : $prev; $gradient = new awLinearGradient( $this->color($bottom->y - $min), $this->color($max - $min - ($y2 - $y1)), 0 ); $gradientDrawer = new awGradientDrawer($this->drawer); $gradientDrawer->drawFilledFlatTriangle( $gradient, new awPoint($prev->x, min($prev->y, $current->y)), $top, new awPoint($current->x, min($prev->y, $current->y)) ); unset($gradientDrawer); $sum += $current->x - $prev->x; } $prev = $current; $prev->x += $interval; } } else if($gradient->angle === 90) { $width = $right->x - $left->x; $this->init($gradient, $width); $pos = 1; $next = $polygon->get($pos++); $this->next($polygon, $pos, $prev, $next); for($i = 0; $i <= $width; $i++) { $x = $left->x + $i; $y1 = round($prev->y + ($next->y - $prev->y) * (($i + $left->x - $prev->x) / ($next->x - $prev->x))); $y2 = $left->y; // Draw line $color = $this->color($i); // YaPB : PHP does not handle alpha on lines $this->drawer->filledRectangle($color, awLine::build($x, $y1, $x, $y2)); $color->free(); unset($color); // Jump to next point if($next->x == $i + $left->x) { $this->next($polygon, $pos, $prev, $next); } } } } } function next($polygon, &$pos, &$prev, &$next) { do { $prev = $next; $next = $polygon->get($pos++); } while($next->x - $prev->x == 0 and $pos < $polygon->count()); } /** * Start colors * * @var int */ var $r1, $g1, $b1, $a1; /** * Stop colors * * @var int */ var $r2, $g2, $b2, $a2; /** * Gradient size in pixels * * @var int */ var $size; function init($gradient, $size) { list( $this->r1, $this->g1, $this->b1, $this->a1 ) = $gradient->from->rgba(); list( $this->r2, $this->g2, $this->b2, $this->a2 ) = $gradient->to->rgba(); $this->size = $size; } function color($pos) { return new awColor( $this->getRed($pos), $this->getGreen($pos), $this->getBlue($pos), $this->getAlpha($pos) ); } function getRed($pos) { return (int)round($this->r1 + ($pos / $this->size) * ($this->r2 - $this->r1)); } function getGreen($pos) { return (int)round($this->g1 + ($pos / $this->size) * ($this->g2 - $this->g1)); } function getBlue($pos) { return (int)round($this->b1 + ($pos / $this->size) * ($this->b2 - $this->b1)); } function getAlpha($pos) { return (int)round(($this->a1 + ($pos / $this->size) * ($this->a2 - $this->a1)) / 127 * 100); } } registerClass('GradientDrawer'); ?> pgfouine-1.2/include/reporting/artichow/php4/inc/Border.class.php0000644000175000017500000000465210352052223023517 0ustar acmeacmesetStyle($style); if(is_a($color, 'awColor')) { $this->setColor($color); } else { $this->setColor(new awBlack); } } /** * Change border color * This method automatically shows the border if it is hidden * * @param $color */ function setColor($color) { $this->color = $color; $this->show(); } /** * Change border style * * @param int $style */ function setStyle($style) { $this->style = (int)$style; } /** * Hide border ? * * @param bool $hide */ function hide($hide = TRUE) { $this->hide = (bool)$hide; } /** * Show border ? * * @param bool $show */ function show($show = TRUE) { $this->hide = (bool)!$show; } /** * Is the border visible ? * * @return bool */ function visible() { return !$this->hide; } /** * Draw border as a rectangle * * @param $drawer * @param $p1 Top-left corner * @param $p2 Bottom-right corner */ function rectangle($drawer, $p1, $p2) { // Border is hidden if($this->hide) { return; } $line = new awLine; $line->setStyle($this->style); $line->setLocation($p1, $p2); $drawer->rectangle($this->color, $line); } /** * Draw border as an ellipse * * @param $drawer * @param $center Ellipse center * @param int $width Ellipse width * @param int $height Ellipse height */ function ellipse($drawer, $center, $width, $height) { // Border is hidden if($this->hide) { return; } switch($this->style) { case LINE_SOLID : $drawer->ellipse($this->color, $center, $width, $height); break; default : trigger_error("Dashed and dotted borders and not yet implemented on ellipses", E_USER_ERROR); break; } } } registerClass('Border'); ?>pgfouine-1.2/include/reporting/artichow/php4/inc/Math.class.php0000644000175000017500000001607510352052223023175 0ustar acmeacmestyle = (int)$style; } /** * Return shape style * * @return int */ function getStyle() { return $this->style; } /** * Change shape thickness * * @param int $thickness Shape thickness in pixels */ function setThickness($thickness) { $this->thickness = (int)$thickness; } /** * Return shape thickness * * @return int */ function getThickness() { return $this->thickness; } /** * Hide the shape * * @param bool $hide */ function hide($hide) { $this->hide = (bool)$hide; } /** * Show the shape * * @param bool $shape */ function show($shape) { $this->hide = (bool)!$shape; } /** * Is the line hidden ? * * @return bool */ function isHidden() { return $this->hide; } } registerClass('Shape', TRUE); /** * Describe a point * * @package Artichow */ class awPoint extends awShape { /** * X coord * * @var float */ var $x; /** * Y coord * * @var float */ var $y; /** * Build a new awpoint * * @param float $x * @param float $y */ function awPoint($x, $y) { $this->setLocation($x, $y); } /** * Change X value * * @param float $x */ function setX($x) { $this->x = (float)$x; } /** * Change Y value * * @param float $y */ function setY($y) { $this->y = (float)$y; } /** * Change point location * * @param float $x * @param float $y */ function setLocation($x, $y) { $this->setX($x); $this->setY($y); } /** * Get point location * * @param array Point location */ function getLocation() { return array($this->x, $this->y); } /** * Get distance to another point * * @param $p A point * @return float */ function getDistance($p) { return sqrt(pow($p->x - $this->x, 2) + pow($p->y - $this->y, 2)); } /** * Move the point to another location * * @param Point A Point with the new awlocation */ function move($x, $y) { return new awPoint( $this->x + $x, $this->y + $y ); } } registerClass('Point'); /* */ define("LINE_SOLID", 1); define("LINE_DOTTED", 2); define("LINE_DASHED", 3); /* */ /** * Describe a line * * @package Artichow */ class awLine extends awShape { /** * Line first point * * @param Point */ var $p1; /** * Line second point * * @param Point */ var $p2; /** * Build a new awline * * @param $p1 First point * @param $p2 Second point * @param int $type Style of line (default to solid) * @param int $thickness Line thickness (default to 1) */ function awLine($p1 = NULL, $p2 = NULL, $type = LINE_SOLID, $thickness = 1) { $this->setLocation($p1, $p2); $this->setStyle($type); $this->setThickness($thickness); } /** * Build a line from 4 coords * * @param int $x1 Left position * @param int $y1 Top position * @param int $x2 Right position * @param int $y2 Bottom position */ function build($x1, $y1, $x2, $y2) { return new awLine( new awPoint($x1, $y1), new awPoint($x2, $y2) ); } /** * Change X values of the line * * @param int $x1 Begin value * @param int $x2 End value */ function setX($x1, $x2) { $this->p1->setX($x1); $this->p2->setX($x2); } /** * Change Y values of the line * * @param int $y1 Begin value * @param int $y2 End value */ function setY($y1, $y2) { $this->p1->setY($y1); $this->p2->setY($y2); } /** * Change line location * * @param $p1 First point * @param $p2 Second point */ function setLocation($p1, $p2) { if(is_null($p1) or is_a($p1, 'awPoint')) { $this->p1 = $p1; } if(is_null($p2) or is_a($p2, 'awPoint')) { $this->p2 = $p2; } } /** * Get line location * * @param array Line location */ function getLocation() { return array($this->p1, $this->p2); } /** * Get the line size * * @return float */ function getSize() { $square = pow($this->p2->x - $this->p1->x, 2) + pow($this->p2->y - $this->p1->y, 2); return sqrt($square); } /** * Test if the line can be considered as a point * * @return bool */ function isPoint() { return ($this->p1->x === $this->p2->x and $this->p1->y === $this->p2->y); } /** * Test if the line is a vertical line * * @return bool */ function isVertical() { return ($this->p1->x === $this->p2->x); } /** * Test if the line is an horizontal line * * @return bool */ function isHorizontal() { return ($this->p1->y === $this->p2->y); } } registerClass('Line'); /** * A vector is a type of line * The sense of the vector goes from $p1 to $p2. * * @package Artichow */ class awVector extends awLine { /** * Get vector angle in radians * * @return float */ function getAngle() { if($this->isPoint()) { return 0.0; } $size = $this->getSize(); $width = ($this->p2->x - $this->p1->x); $height = ($this->p2->y - $this->p1->y) * -1; if($width >= 0 and $height >= 0) { return acos($width / $size); } else if($width <= 0 and $height >= 0) { return acos($width / $size); } else { $height *= -1; if($width >= 0 and $height >= 0) { return 2 * M_PI - acos($width / $size); } else if($width <= 0 and $height >= 0) { return 2 * M_PI - acos($width / $size); } } } } registerClass('Vector'); /* */ define("POLYGON_SOLID", 1); define("POLYGON_DOTTED", 2); define("POLYGON_DASHED", 3); /* */ /** * Describe a polygon * * @package Artichow */ class awPolygon extends awShape { /** * Polygon points * * @var array */ var $points = array(); /** * Set a point in the polygon * * @param int $pos Point position * @param $point */ function set($pos, $point) { if(is_null($point) or is_a($point, 'awPoint')) { $this->points[$pos] = $point; } } /** * Add a point at the end of the polygon * * @param $point */ function append($point) { if(is_null($point) or is_a($point, 'awPoint')) { $this->points[] = $point; } } /** * Get a point at a position in the polygon * * @param int $pos Point position * @return Point */ function get($pos) { return $this->points[$pos]; } /** * Count number of points in the polygon * * @return int */ function count() { return count($this->points); } /** * Returns all points in the polygon * * @return array */ function all() { return $this->points; } } registerClass('Polygon'); ?>pgfouine-1.2/include/reporting/artichow/php4/inc/Legend.class.php0000644000175000017500000002701310352052223023474 0ustar acmeacme */ define("LEGEND_LINE", 1); define("LEGEND_BACKGROUND", 2); define("LEGEND_MARK", 3); define("LEGEND_MARKONLY", 4); define("LEGEND_MODEL_RIGHT", 1); define("LEGEND_MODEL_BOTTOM", 2); define("LEGEND_LEFT", 1); define("LEGEND_RIGHT", 2); define("LEGEND_CENTER", 3); define("LEGEND_TOP", 4); define("LEGEND_BOTTOM", 5); define("LEGEND_MIDDLE", 6); /* */ /** * Some legends * * @package Artichow */ class awLegend { /** * Legends added * * @var array */ var $legends = array(); /** * The current component * * @var Component */ var $component; /** * Background color or gradient * * @var Color, Gradient */ var $background; /** * Text color * * @var Color */ var $textColor; /** * Text font * * @var Font */ var $textFont; /** * Text margin * * @var Side */ var $textMargin; /** * Number of columns * * @var int */ var $columns = NULL; /** * Number of rows * * @var int */ var $rows = NULL; /** * Legend position * * @var Point */ var $position; /** * Hide legend ? * * @var bool */ var $hide = FALSE; /** * Space between each legend * * @var int */ var $space = 4; /** * Horizontal alignment * * @var int */ var $hAlign; /** * Vertical alignment * * @var int */ var $vAlign; /** * Margin * * @var array Array for left, right, top and bottom margins */ var $margin; /** * Legend shadow * * @var Shadow */ var $shadow; /** * Legend border * * @var Border */ var $border; /** * Line legend * * @var int */ /** * Color/Gradient background legend * * @var int */ /** * Use marks and line as legend * * @var int */ /** * Use marks as legend * * @var int */ /** * Right side model * * @var int */ /** * Bottom side model * * @var int */ /** * Build the legend * * @param int $model Legend model */ function awLegend($model = LEGEND_MODEL_RIGHT) { $this->shadow = new awShadow(SHADOW_LEFT_BOTTOM); $this->border = new awBorder; $this->textMargin = new awSide(4); $this->setModel($model); } /** * Set a predefined model for the legend * * @param int $model */ function setModel($model) { $this->setBackgroundColor(new awColor(255, 255, 255, 15)); $this->setPadding(8, 8, 8, 8); $this->setTextFont(new awFont2); $this->shadow->setSize(3); switch($model) { case LEGEND_MODEL_RIGHT : $this->setColumns(1); $this->setAlign(LEGEND_RIGHT, LEGEND_MIDDLE); $this->setPosition(0.96, 0.50); break; case LEGEND_MODEL_BOTTOM : $this->setRows(1); $this->setAlign(LEGEND_CENTER, LEGEND_TOP); $this->setPosition(0.50, 0.92); break; default : $this->setPosition(0.5, 0.5); break; } } /** * Hide legend ? * * @param bool $hide TRUE to hide legend, FALSE otherwise */ function hide($hide = TRUE) { $this->hide = (bool)$hide; } /** * Show legend ? * * @param bool $show */ function show($show = TRUE) { $this->hide = (bool)!$show; } /** * Add a Legendable object to the legend * * @param &$legendable * @param string $title Legend title * @param int $type Legend type (default to LEGEND_LINE) */ function add(&$legendable, $title, $type = LEGEND_LINE) { $legend = array($legendable, $title, $type); $this->legends[] = $legend; } /** * Change legend padding * * @param int $left * @param int $right * @param int $top * @param int $bottom */ function setPadding($left, $right, $top, $bottom) { $this->padding = array((int)$left, (int)$right, (int)$top, (int)$bottom); } /** * Change space between each legend * * @param int $space */ function setSpace($space) { $this->space = (int)$space; } /** * Change alignment * * @param int $h Horizontal alignment * @param int $v Vertical alignment */ function setAlign($h = NULL, $v = NULL) { if($h !== NULL) { $this->hAlign = (int)$h; } if($v !== NULL) { $this->vAlign = (int)$v; } } /** * Change number of columns * * @param int $columns */ function setColumns($columns) { $this->rows = NULL; $this->columns = (int)$columns; } /** * Change number of rows * * @param int $rows */ function setRows($rows) { $this->columns = NULL; $this->rows = (int)$rows; } /** * Change legend position * X and Y positions must be between 0 and 1. * * @param float $x * @param float $y */ function setPosition($x = NULL, $y = NULL) { $x = (is_null($x) and !is_null($this->position)) ? $this->position->x : $x; $y = (is_null($y) and !is_null($this->position)) ? $this->position->y : $y; $this->position = new awPoint($x, $y); } /** * Get legend position * * @return Point */ function getPosition() { return $this->position; } /** * Change text font * * @param &$font */ function setTextFont(&$font) { $this->textFont = $font; } /** * Change text margin * * @param int $left * @param int $right */ function setTextMargin($left, $right) { $this->textMargin->set($left, $right); } /** * Change text color * * @param $color */ function setTextColor($color) { $this->textColor = $color; } /** * Change background * * @param mixed $background */ function setBackground($background) { $this->background = $background; } /** * Change background color * * @param $color */ function setBackgroundColor($color) { $this->background = $color; } /** * Change background gradient * * @param $gradient */ function setBackgroundGradient($gradient) { $this->background = $gradient; } /** * Count the number of Legendable objects in the legend * * @return int */ function count() { return count($this->legends); } function draw($drawer) { if($this->hide) { return; } $count = $this->count(); // No legend to print if($count === 0) { return; } // Get text widths and heights of each element of the legend $widths = array(); $heights = array(); $texts = array(); for($i = 0; $i < $count; $i++) { list(, $title, ) = $this->legends[$i]; $text = new awText( $title, $this->textFont, $this->textColor, 0 ); $font = $text->getFont(); $widths[$i] = $font->getTextWidth($text) + $this->textMargin->left + $this->textMargin->right; $heights[$i] = $font->getTextHeight($text); $texts[$i] = $text; } // Maximum height of the font used $heightMax = array_max($heights); // Get number of columns if($this->columns !== NULL) { $columns = $this->columns; } else if($this->rows !== NULL) { $columns = ceil($count / $this->rows); } else { $columns = $count; } // Number of rows $rows = (int)ceil($count / $columns); // Get maximum with of each column $widthMax = array(); for($i = 0; $i < $count; $i++) { // Get column width $column = $i % $columns; if(array_key_exists($column, $widthMax) === FALSE) { $widthMax[$column] = $widths[$i]; } else { $widthMax[$column] = max($widthMax[$column], $widths[$i]); } } $width = $this->padding[0] + $this->padding[1] - $this->space; for($i = 0; $i < $columns; $i++) { $width += $this->space + 5 + 10 + $widthMax[$i]; } $height = ($heightMax + $this->space) * $rows - $this->space + $this->padding[2] + $this->padding[3]; // Look for legends position list($x, $y) = $drawer->getSize(); $p = new awPoint( $this->position->x * $x, $this->position->y * $y ); switch($this->hAlign) { case LEGEND_CENTER : $p->x -= $width / 2; break; case LEGEND_RIGHT : $p->x -= $width; break; } switch($this->vAlign) { case LEGEND_MIDDLE : $p->y -= $height / 2; break; case LEGEND_BOTTOM : $p->y -= $height; break; } // Draw legend shadow $this->shadow->draw( $drawer, $p, $p->move($width, $height), SHADOW_OUT ); // Draw legends base $this->drawBase($drawer, $p, $width, $height); // Draw each legend for($i = 0; $i < $count; $i++) { list($component, $title, $type) = $this->legends[$i]; $column = $i % $columns; $row = (int)floor($i / $columns); // Get width of all previous columns $previousColumns = 0; for($j = 0; $j < $column; $j++) { $previousColumns += $this->space + 10 + 5 + $widthMax[$j]; } // Draw legend text $drawer->string( $texts[$i], $p->move( $this->padding[0] + $previousColumns + 10 + 5 + $this->textMargin->left, $this->padding[2] + $row * ($heightMax + $this->space) + $heightMax / 2 - $heights[$i] / 2 ) ); // Draw legend icon switch($type) { case LEGEND_LINE : case LEGEND_MARK : case LEGEND_MARKONLY : // Get vertical position $x = $this->padding[0] + $previousColumns; $y = $this->padding[2] + $row * ($heightMax + $this->space) + $heightMax / 2 - $component->getLegendLineThickness(); // Draw two lines if($component->getLegendLineColor() !== NULL) { $color = $component->getLegendLineColor(); if(is_a($color, 'awColor') and $type !== LEGEND_MARKONLY) { $drawer->line( $color, new awLine( $p->move( $x, // YaPB ?? $y + $component->getLegendLineThickness() / 2 ), $p->move( $x + 10, $y + $component->getLegendLineThickness() / 2 ), $component->getLegendLineStyle(), $component->getLegendLineThickness() ) ); $color->free(); unset($color); } } if($type === LEGEND_MARK or $type === LEGEND_MARKONLY) { $mark = $component->getLegendMark(); if($mark !== NULL) { $mark->draw( $drawer, $p->move( $x + 5.5, $y + $component->getLegendLineThickness() / 2 ) ); } unset($mark); } break; case LEGEND_BACKGROUND : // Get vertical position $x = $this->padding[0] + $previousColumns; $y = $this->padding[2] + $row * ($heightMax + $this->space) + $heightMax / 2 - 5; $from = $p->move( $x, $y ); $to = $p->move( $x + 10, $y + 10 ); $background = $component->getLegendBackground(); if($background !== NULL) { $drawer->filledRectangle( $component->getLegendBackground(), new awLine($from, $to) ); // Draw rectangle border $this->border->rectangle( $drawer, $from->move(0, 0), $to->move(0, 0) ); } unset($background, $from, $to); break; } } } function drawBase($drawer, $p, $width, $height) { $this->border->rectangle( $drawer, $p, $p->move($width, $height) ); $size = $this->border->visible() ? 1 : 0; $drawer->filledRectangle( $this->background, new awLine( $p->move($size, $size), $p->move($width - $size, $height - $size) ) ); } } registerClass('Legend'); /** * You can add a legend to components which implements this interface * * @package Artichow */ registerInterface('Legendable'); ?>pgfouine-1.2/include/reporting/artichow/php4/inc/Grid.class.php0000644000175000017500000001070310352052223023161 0ustar acmeacmecolor = new awColor(210, 210, 210); $this->background = new awColor(255, 255, 255, 100); } /** * Hide grid ? * * @param bool $hide */ function hide($hide = TRUE) { $this->hide = (bool)$hide; } /** * Hide horizontal lines ? * * @param bool $hideHorizontal */ function hideHorizontal($hide = TRUE) { $this->hideHorizontal = (bool)$hide; } /** * Hide vertical lines ? * * @param bool $hideVertical */ function hideVertical($hide = TRUE) { $this->hideVertical = (bool)$hide; } /** * Change grid color * * @param $color */ function setColor($color) { $this->color = $color; } /** * Remove grid background */ function setNoBackground() { $this->background = NULL; } /** * Change grid background color * * @param $color */ function setBackgroundColor($color) { $this->background = $color; } /** * Change line type * * @param int $type */ function setType($type) { $this->type = (int)$type; } /** * Change grid interval * * @param int $hInterval * @param int $vInterval */ function setInterval($hInterval, $vInterval) { $this->interval = array((int)$hInterval, (int)$vInterval); } /** * Set grid space * * @param int $left Left space in pixels * @param int $right Right space in pixels * @param int $top Top space in pixels * @param int $bottom Bottom space in pixels */ function setSpace($left, $right, $top, $bottom) { $this->space = array((int)$left, (int)$right, (int)$top, (int)$bottom); } /** * Change the current grid * * @param array $xgrid Vertical lines * @param array $ygrid Horizontal lines */ function setGrid($xgrid, $ygrid) { $this->xgrid = $xgrid; $this->ygrid = $ygrid; } /** * Draw grids * * @param $drawer A drawer object * @param int $x1 * @param int $y1 * @param int $x2 * @param int $y2 */ function draw($drawer, $x1, $y1, $x2, $y2) { if(is_a($this->background, 'awColor')) { // Draw background color $drawer->filledRectangle( $this->background, awLine::build($x1, $y1, $x2, $y2) ); $this->background->free(); } if($this->hide === FALSE) { $this->drawGrid( $drawer, $this->color, $this->hideVertical ? array() : $this->xgrid, $this->hideHorizontal ? array() : $this->ygrid, $x1, $y1, $x2, $y2, $this->type, $this->space, $this->interval[0], $this->interval[1] ); } $this->color->free(); } function drawGrid( $drawer, $color, $nx, $ny, $x1, $y1, $x2, $y2, $type, $space, $hInterval, $vInterval ) { list($left, $right, $top, $bottom) = $space; $width = $x2 - $x1 - $left - $right; $height = $y2 - $y1 - $top - $bottom; foreach($nx as $key => $n) { if(($key % $vInterval) === 0) { $pos = (int)round($x1 + $left + $n * $width); $drawer->line( $color, new awLine( new awPoint($pos, $y1), new awPoint($pos, $y2), $type ) ); } } foreach($ny as $key => $n) { if(($key % $hInterval) === 0) { $pos = (int)round($y1 + $top + $n * $height); $drawer->line( $color, new awLine( new awPoint($x1, $pos), new awPoint($x2, $pos), $type ) ); } } } } registerClass('Grid'); ?>pgfouine-1.2/include/reporting/artichow/php4/inc/Tools.class.php0000644000175000017500000000360010352052223023372 0ustar acmeacmeset($left, $right, $top, $bottom); } /** * Change side values * * @param mixed $left * @param mixed $right * @param mixed $top * @param mixed $bottom */ function set($left = NULL, $right = NULL, $top = NULL, $bottom = NULL) { if($left !== NULL) { $this->left = (float)$left; } if($right !== NULL) { $this->right = (float)$right; } if($top !== NULL) { $this->top = (float)$top; } if($bottom !== NULL) { $this->bottom = (float)$bottom; } } /** * Add values to each side * * @param mixed $left * @param mixed $right * @param mixed $top * @param mixed $bottom */ function add($left = NULL, $right = NULL, $top = NULL, $bottom = NULL) { if($left !== NULL) { $this->left += (float)$left; } if($right !== NULL) { $this->right += (float)$right; } if($top !== NULL) { $this->top += (float)$top; } if($bottom !== NULL) { $this->bottom += (float)$bottom; } } } registerClass('Side'); ?>pgfouine-1.2/include/reporting/artichow/php4/inc/Gradient.class.php0000644000175000017500000000401210352052223024025 0ustar acmeacmefrom = $from; $this->to = $to; } /** * Free memory used by the colors of the gradient */ function free() { $this->from->free(); $this->to->free(); } function php5Destructor( ){ $this->free(); } } registerClass('Gradient', TRUE); /** * Create a linear gradient * * @package Artichow */ class awLinearGradient extends awGradient { /** * Gradient angle * * @var int */ var $angle; /** * Build the linear gradient * * @param $from From color * @param $to To color * @param int $angle Gradient angle */ function awLinearGradient($from, $to, $angle) { parent::awGradient( $from, $to ); $this->angle = $angle; } } registerClass('LinearGradient'); /** * Create a bilinear gradient * * @package Artichow */ class awBilinearGradient extends awLinearGradient { /** * Gradient center * * @var int Center between 0 and 1 */ var $center; /** * Build the bilinear gradient * * @param $from From color * @param $to To color * @param int $angle Gradient angle * @param int $center Gradient center */ function awBilinearGradient($from, $to, $angle, $center = 0.5) { parent::awLinearGradient( $from, $to, $angle ); $this->center = $center; } } registerClass('BilinearGradient'); /** * Create a radial gradient * * @package Artichow */ class awRadialGradient extends awGradient { } registerClass('RadialGradient'); ?> pgfouine-1.2/include/reporting/artichow/php4/AntiSpam.class.php0000644000175000017500000001012510352052222023234 0ustar acmeacmestring = (string)$string; } /** * Create a random string * * @param int $length String length * @return string String created */ function setRand($length) { $length = (int)$length; $this->string = ''; $letters = 'aAbBCDeEFgGhHJKLmMnNpPqQRsStTuVwWXYZz2345679'; $number = strlen($letters); for($i = 0; $i < $length; $i++) { $this->string .= $letters{mt_rand(0, $number - 1)}; } return $this->string; } /** * Set noise on image * * @param int $nois Noise intensity (from 0 to 10) */ function setNoise($noise) { if($noise < 0) { $noise = 0; } if($noise > 10) { $noise = 10; } $this->noise = (int)$noise; } /** * Save string value in session * You can use check() to verify the value later * * @param string $qName A name that identify the anti-spam image */ function save($qName) { $this->session(); $session = 'artichow_'.(string)$qName; $_SESSION[$session] = $this->string; } /** * Verify user entry * * @param string $qName A name that identify the anti-spam image * @param string $value User-defined value * @param bool $case TRUE for case insensitive check, FALSE for case sensitive check ? (default to TRUE) * @return bool TRUE if the value is correct, FALSE otherwise */ function check($qName, $value, $case = TRUE) { $this->session(); $session = 'artichow_'.(string)$qName; return ( array_key_exists($session, $_SESSION) === TRUE and $case ? (strtolower($_SESSION[$session]) === strtolower((string)$value)) : ($_SESSION[$session] === (string)$value) ); } /** * Draw image */ function draw() { $fonts = array( ARTICHOW_FONT.DIRECTORY_SEPARATOR.'Tuffy.ttf', ARTICHOW_FONT.DIRECTORY_SEPARATOR.'TuffyBold.ttf', ARTICHOW_FONT.DIRECTORY_SEPARATOR.'TuffyItalic.ttf', ARTICHOW_FONT.DIRECTORY_SEPARATOR.'TuffyBoldItalic.ttf' ); $sizes = array(12, 12.5, 13, 13.5, 14, 15, 16, 17, 18, 19); $widths = array(); $heights = array(); $texts = array(); for($i = 0; $i < strlen($this->string); $i++) { $fontKey = array_rand($fonts); $sizeKey = array_rand($sizes); $font = new awTTFFont( $fonts[$fontKey], $sizes[$sizeKey] ); $text = new awText( $this->string{$i}, $font, NULL, mt_rand(-15, 15) ); $widths[] = $font->getTextWidth($text); $heights[] = $font->getTextHeight($text); $texts[] = $text; } $width = array_sum($widths); $height = array_max($heights); $totalWidth = $width + 10 + count($texts) * 10; $totalHeight = $height + 20; $this->setSize($totalWidth, $totalHeight); $this->create(); for($i = 0; $i < strlen($this->string); $i++) { $this->drawer->string( $texts[$i], new awPoint( 5 + array_sum(array_slice($widths, 0, $i)) + $widths[$i] / 2 + $i * 10, 10 + ($height - $heights[$i]) / 2 ) ); } $this->drawNoise($totalWidth, $totalHeight); $this->send(); } function drawNoise($width, $height) { $points = $this->noise * 30; $color = new awColor(0, 0, 0); for($i = 0; $i < $points; $i++) { $this->drawer->point( $color, new awPoint( mt_rand(0, $width), mt_rand(0, $height) ) ); } } function session() { // Start session if needed if(!session_id()) { session_start(); } } } registerClass('AntiSpam'); ?> pgfouine-1.2/include/reporting/artichow/php4/common.php0000644000175000017500000000327210352052222021711 0ustar acmeacme 0) { do { $min = array_pop($array); if(is_numeric($min === FALSE)) { $min = NULL; } } while(count($array) > 0 and $min === NULL); if($min !== NULL) { $min = (float)$min; } foreach($array as $value) { if(is_numeric($value) and (float)$value < $min) { $min = (float)$value; } } return $min; } return NULL; } /* * Get the maximum of an array and ignore non numeric values */ function array_max($array) { if(is_array($array) and count($array) > 0) { do { $max = array_pop($array); if(is_numeric($max === FALSE)) { $max = NULL; } } while(count($array) > 0 and $max === NULL); if($max !== NULL) { $max = (float)$max; } foreach($array as $value) { if(is_numeric($value) and (float)$value > $max) { $max = (float)$value; } } return $max; } return NULL; } /* * Register a class with the prefix in configuration file */ function registerClass($class, $abstract = FALSE) { if(ARTICHOW_PREFIX === 'aw') { return; } $abstract = ''; eval($abstract." class ".ARTICHOW_PREFIX.$class." extends aw".$class." { }"); } /* * Register an interface with the prefix in configuration file */ function registerInterface($interface) { if(ARTICHOW_PREFIX === 'aw') { return; } } ?> pgfouine-1.2/include/reporting/artichow/php4/ScatterPlot.class.php0000644000175000017500000001147210352052222023772 0ustar acmeacmemark = new awMark; $this->mark->setType(MARK_CIRCLE); $this->mark->setSize(7); $this->mark->border->show(); $this->label = new awLabel; $this->setValues($datay, $datax); $this->setColor(new awBlack); } /** * Display plot as impulses * * @param $impulse Impulses color (or NULL to disable impulses) */ function setImpulse($color) { $this->impulse = $color; } /** * Link scatter plot points * * @param bool $link * @param $color Line color (default to black) */ function link($link, $color = NULL) { $this->link = (bool)$link; if(is_a($color, 'awColor')) { $this->setColor($color); } } /** * Ignore null values for Y data and continue linking * * @param bool $link */ function linkNull($link) { $this->linkNull = (bool)$link; } /** * Change line color * * @param $color */ function setColor($color) { $this->lineColor = $color; } /** * Change line style * * @param int $style */ function setStyle($style) { $this->lineStyle = (int)$style; } /** * Change line tickness * * @param int $tickness */ function setThickness($tickness) { $this->lineThickness = (int)$tickness; } /** * Get the line thickness * * @return int */ function getLegendLineThickness() { return $this->lineThickness; } /** * Get the line type * * @return int */ function getLegendLineStyle() { return $this->lineStyle; } /** * Get the color of line * * @return Color */ function getLegendLineColor() { return $this->lineColor; } /** * Get the background color or gradient of an element of the component * * @return Color, Gradient */ function getLegendBackground() { return NULL; } /** * Get a mark object * * @return Mark */ function getLegendMark() { return $this->mark; } function drawComponent($drawer, $x1, $y1, $x2, $y2, $aliasing) { $count = count($this->datay); // Get start and stop values list($start, $stop) = $this->getLimit(); // Build the polygon $polygon = new awPolygon; for($key = 0; $key < $count; $key++) { $x = $this->datax[$key]; $y = $this->datay[$key]; if($y !== NULL) { $p = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($x, $y)); $polygon->set($key, $p); } else if($this->linkNull === FALSE) { $polygon->set($key, NULL); } } // Link points if needed if($this->link) { $prev = NULL; foreach($polygon->all() as $point) { if($prev !== NULL and $point !== NULL) { $drawer->line( $this->lineColor, new awLine( $prev, $point, $this->lineStyle, $this->lineThickness ) ); } $prev = $point; } $this->lineColor->free(); } // Draw impulses if(is_a($this->impulse, 'awColor')) { foreach($polygon->all() as $key => $point) { if($point !== NULL) { $zero = awAxis::toPosition( $this->xAxis, $this->yAxis, new awPoint($key, 0) ); $drawer->line( $this->impulse, new awLine( $zero, $point, LINE_SOLID, 1 ) ); } } } // Draw marks and labels foreach($polygon->all() as $key => $point) { $this->mark->draw($drawer, $point); $this->label->draw($drawer, $point, $key); } } function xAxisPoint($position) { $y = $this->xAxisZero ? 0 : $this->getRealYMin(); return awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($position, $y)); } function getXCenter() { return FALSE; } } registerClass('ScatterPlot'); ?> pgfouine-1.2/include/reporting/artichow/php4/Component.class.php0000644000175000017500000001616411012376766023513 0ustar acmeacmecomponents = array(); } /** * Add a component to the group * * @param &$component A component */ function add(&$component) { $this->components[] = $component; } } registerClass('ComponentGroup', TRUE); class awComponent { /** * Component drawer * * @var Drawer */ var $drawer; /** * Component width * * @var float */ var $width = 1.0; /** * Component height * * @var float */ var $height = 1.0; /** * Position X of the center the graph (from 0 to 1) * * @var float */ var $x = 0.5; /** * Position Y of the center the graph (from 0 to 1) * * @var float */ var $y = 0.5; /** * Component absolute width (in pixels) * * * @var int */ var $w; /** * Component absolute height (in pixels) * * * @var int */ var $h; /** * Left-top corner Y position * * @var float */ var $top; /** * Left-top corner X position * * @var float */ var $left; /** * Component background color * * @var Color */ var $background; /** * Component padding * * @var Side */ var $padding; /** * Component space * * @var Side */ var $space; /** * Component title * * @var Label */ var $title; /** * Adjust automatically the component ? * * @var bool */ var $auto = TRUE; /** * Legend * * @var Legend */ var $legend; /** * Build the component */ function awComponent() { // Component legend $this->legend = new awLegend(); $this->padding = new awSide(25, 25, 25, 25); $this->space = new awSide(0, 0, 0, 0); // Component title $this->title = new awLabel( NULL, new awDejaVuSans(10), NULL, 0 ); $this->title->setAlign(LABEL_CENTER, LABEL_TOP); } /** * Adjust automatically the component ? * * @param bool $auto */ function auto($auto) { $this->auto = (bool)$auto; } /** * Change the size of the component * * @param int $width Component width (from 0 to 1) * @param int $height Component height (from 0 to 1) */ function setSize($width, $height) { $this->width = (float)$width; $this->height = (float)$height; } /** * Change the absolute size of the component * * @param int $w Component width (in pixels) * @param int $h Component height (in pixels) */ function setAbsSize($w, $h) { $this->w = (int)$w; $this->h = (int)$h; } /** * Change component background color * * @param $color (can be null) */ function setBackgroundColor($color) { if($color === NULL or is_a($color, 'awColor')) { $this->background = $color; } } /** * Change component background gradient * * @param $gradient (can be null) */ function setBackgroundGradient($gradient) { if($gradient === NULL or is_a($gradient, 'awGradient')) { $this->background = $gradient; } } /** * Change component background image * * @param &$image (can be null) */ function setBackgroundImage($image) { if($image === NULL or is_a($image, 'awImage')) { $this->background = $image; } } /** * Return the component background * * @return Color, Gradient */ function getBackground() { return $this->background; } /** * Change component padding * * @param int $left Padding in pixels (NULL to keep old value) * @param int $right Padding in pixels (NULL to keep old value) * @param int $top Padding in pixels (NULL to keep old value) * @param int $bottom Padding in pixels (NULL to keep old value) */ function setPadding($left = NULL, $right = NULL, $top = NULL, $bottom = NULL) { $this->padding->set($left, $right, $top, $bottom); } /** * Change component space * * @param float $left Space in % (NULL to keep old value) * @param float $right Space in % (NULL to keep old value) * @param float $bottom Space in % (NULL to keep old value) * @param float $top Space in % (NULL to keep old value) */ function setSpace($left = NULL, $right = NULL, $bottom = NULL, $top = NULL) { $this->space->set($left, $right, $bottom, $top); } /** * Change the absolute position of the component on the graph * * @var int $x Left-top corner X position * @var int $y Left-top corner Y position */ function setAbsPosition($left, $top) { $this->left = (int)$left; $this->top = (int)$top; } /** * Set the center of the component * * @param int $x Position on X axis of the center of the component * @param int $y Position on Y axis of the center of the component */ function setCenter($x, $y) { $this->x = (float)$x; $this->y = (float)$y; } /** * Get component coords with its padding * * @return array Coords of the component */ function getPosition() { // Get component coords $x1 = $this->padding->left; $y1 = $this->padding->top; $x2 = $this->w - $this->padding->right; $y2 = $this->h - $this->padding->bottom; return array($x1, $y1, $x2, $y2); } /** * Init the drawing of the component */ function init($drawer) { // Set component background $background = $this->getBackground(); if($background !== NULL) { $p1 = new awPoint(0, 0); $p2 = new awPoint($this->w - 1, $this->h - 1); if(is_a($background, 'awImage')) { $drawer->copyImage( $background, $p1, $p2 ); } else { $drawer->filledRectangle( $background, new awLine($p1, $p2) ); } } } /** * Finalize the drawing of the component */ function finalize($drawer) { // Draw component title $point = new awPoint( $this->w / 2, $this->padding->top - 8 ); $this->title->draw($drawer, $point); // Draw legend $this->legend->draw($drawer); } /** * Draw the grid around your component * * @param Drawer A drawer * @return array Coords for the component */ /** * Draw the component on the graph * Component should be drawed into specified coords * * @param Drawer A drawer * @param int $x1 * @param int $y1 * @param int $x2 * @param int $y2 * @param bool $aliasing Use anti-aliasing to draw the component ? */ /** * Get space width in pixels * * @param int $width Component width * @param int $height Component height * @return array */ function getSpace($width, $height) { $left = (int)($width * $this->space->left / 100); $right = (int)($width * $this->space->right / 100); $top = (int)($height * $this->space->top / 100); $bottom = (int)($height * $this->space->bottom / 100); return array($left, $right, $top, $bottom); } } registerClass('Component', TRUE); ?> pgfouine-1.2/include/reporting/artichow/php4/Artichow.class.php0000644000175000017500000001317011012376766023323 0ustar acmeacmesetSize($width, $height); if(ARTICHOW_CACHE) { $this->name = $name; $this->timeout = $timeout; // Clean sometimes all the cache if(mt_rand(0, 5000) === 0) { awGraph::cleanCache(); } if($this->name !== NULL) { $file = ARTICHOW."/cache/".$this->name."-time"; if(is_file($file)) { $type = awGraph::cleanGraphCache($file); if($type === NULL) { awGraph::deleteFromCache($this->name); } else { header("Content-Type: image/".$type); readfile(ARTICHOW."/cache/".$this->name.""); exit; } } } } $this->title = new awLabel( NULL, new awDejaVuSans(16), NULL, 0 ); $this->title->setAlign(LABEL_CENTER, LABEL_BOTTOM); } /** * Delete a graph from the cache * * @param string $name Graph name * @return bool TRUE on success, FALSE on failure */ function deleteFromCache($name) { if(ARTICHOW_CACHE) { if(is_file(ARTICHOW."/cache/".$name."-time")) { unlink(ARTICHOW."/cache/".$name.""); unlink(ARTICHOW."/cache/".$name."-time"); } } } /** * Delete all graphs from the cache */ function deleteAllCache() { if(ARTICHOW_CACHE) { $dp = opendir(ARTICHOW."/cache"); while($file = readdir($dp)) { if($file !== '.' and $file != '..') { unlink(ARTICHOW."/cache/".$file); } } } } /** * Clean cache */ function cleanCache() { if(ARTICHOW_CACHE) { $glob = glob(ARTICHOW."/cache/*-time"); foreach($glob as $file) { $type = awGraph::cleanGraphCache($file); if($type === NULL) { $name = ereg_replace(".*/(.*)\-time", "\\1", $file); awGraph::deleteFromCache($name); } } } } /** * Enable/Disable graph timing * * @param bool $timing */ function setTiming($timing) { $this->timing = (bool)$timing; } /** * Add a component to the graph * * @param &$component */ function add(&$component) { $this->components[] = $component; } /** * Build the graph and draw component on it * Image is sent to the user browser */ function draw() { if($this->timing) { $time = microtimeFloat(); } $this->create(); foreach($this->components as $component) { $this->drawComponent($component); } $this->drawTitle(); $this->drawShadow(); if($this->timing) { $this->drawTiming(microtimeFloat() - $time); } $this->send(); if(ARTICHOW_CACHE) { if($this->name !== NULL) { $data = ob_get_contents(); if(is_writable(ARTICHOW."/cache") === FALSE) { trigger_error("Cache directory is not writable"); } $file = ARTICHOW."/cache/".$this->name.""; file_put_contents($file, $data); $file .= "-time"; file_put_contents($file, $this->timeout."\n".$this->getFormat()); } } } function drawTitle() { $drawer = $this->getDrawer(); $point = new awPoint( $this->width / 2, 10 ); $this->title->draw($drawer, $point); } function drawTiming($time) { $drawer = $this->getDrawer(); $label = new awLabel; $label->set("(".sprintf("%.3f", $time)." s)"); $label->setAlign(LABEL_LEFT, LABEL_TOP); $label->border->show(); $label->setPadding(1, 0, 0, 0); $label->setBackgroundColor(new awColor(230, 230, 230, 25)); $label->draw($drawer, new awPoint(5, $drawer->height - 5)); } function cleanGraphCache($file) { list( $time, $type ) = explode("\n", file_get_contents($file)); $time = (int)$time; if($time !== 0 and $time < time()) { return NULL; } else { return $type; } } } registerClass('Graph'); /* * To preserve PHP 4 compatibility */ function microtimeFloat() { list($usec, $sec) = explode(" ", microtime()); return (float)$usec + (float)$sec; } ?> pgfouine-1.2/include/reporting/artichow/php4/Graph.class.php0000644000175000017500000001514611012376766022611 0ustar acmeacmesetSize($width, $height); $this->name = $name; $this->timeout = $timeout; // Clean sometimes all the cache if(mt_rand(0, 5000) === 0) { awGraph::cleanCache(); } if($this->name !== NULL) { $file = ARTICHOW."/cache/".$this->name."-time"; if(is_file($file)) { $type = awGraph::cleanGraphCache($file); if($type === NULL) { awGraph::deleteFromCache($this->name); } else { header("Content-Type: image/".$type); readfile(ARTICHOW."/cache/".$this->name.""); exit; } } } $this->title = new awLabel( NULL, new awDejaVuSans(16), NULL, 0 ); $this->title->setAlign(LABEL_CENTER, LABEL_BOTTOM); } /** * Delete a graph from the cache * * @param string $name Graph name * @return bool TRUE on success, FALSE on failure */ function deleteFromCache($name) { if(is_file(ARTICHOW."/cache/".$name."-time")) { unlink(ARTICHOW."/cache/".$name.""); unlink(ARTICHOW."/cache/".$name."-time"); } } /** * Delete all graphs from the cache */ function deleteAllCache() { $dp = opendir(ARTICHOW."/cache"); while($file = readdir($dp)) { if($file !== '.' and $file != '..') { unlink(ARTICHOW."/cache/".$file); } } } /** * Clean cache */ function cleanCache() { $glob = glob(ARTICHOW."/cache/*-time"); foreach($glob as $file) { $type = awGraph::cleanGraphCache($file); if($type === NULL) { $name = ereg_replace(".*/(.*)\-time", "\\1", $file); awGraph::deleteFromCache($name); } } } /** * Enable/Disable Graph timing * * @param bool $timing */ function setTiming($timing) { $this->timing = (bool)$timing; } /** * Add a component to the graph * * @param &$component */ function add(&$component) { $this->components[] = $component; } /** * Add a label to the component * * @param &$label * @param int $x Position on X axis of the center of the text * @param int $y Position on Y axis of the center of the text */ function addLabel(&$label, $x, $y) { $this->labels[] = array( $label, $x, $y ); } /** * Add a label to the component with aboslute position * * @param &$label * @param $point Text position */ function addAbsLabel(&$label, $point) { $this->labels[] = array( $label, $point ); } /** * Build the graph and draw component on it * Image is sent to the user browser * * @param string $file Save the image in the specified file. Let it null to print image to screen. */ function draw($file = NULL) { if($this->timing) { $time = microtimeFloat(); } $this->create(); foreach($this->components as $component) { $this->drawComponent($component); } $this->drawTitle(); $this->drawShadow(); $this->drawLabels(); if($this->timing) { $this->drawTiming(microtimeFloat() - $time); } $this->send($file); if($file === NULL) { $data = ob_get_contents(); if($this->name !== NULL) { if(is_writable(ARTICHOW."/cache") === FALSE) { trigger_error("Cache directory is not writable"); } $file = ARTICHOW."/cache/".$this->name.""; file_put_contents($file, $data); $file .= "-time"; file_put_contents($file, $this->timeout."\n".$this->getFormat()); } } } function drawLabels() { $drawer = $this->getDrawer(); foreach($this->labels as $array) { if(count($array) === 3) { // Text in relative position list($label, $x, $y) = $array; $point = new awPoint( $x * $this->width, $y * $this->height ); } else { // Text in absolute position list($label, $point) = $array; } $label->draw($drawer, $point); } } function drawTitle() { $drawer = $this->getDrawer(); $point = new awPoint( $this->width / 2, 10 ); $this->title->draw($drawer, $point); } function drawTiming($time) { $drawer = $this->getDrawer(); $label = new awLabel; $label->set("(".sprintf("%.3f", $time)." s)"); $label->setAlign(LABEL_LEFT, LABEL_TOP); $label->border->show(); $label->setPadding(1, 0, 0, 0); $label->setBackgroundColor(new awColor(230, 230, 230, 25)); $label->draw($drawer, new awPoint(5, $drawer->height - 5)); } function cleanGraphCache($file) { list( $time, $type ) = explode("\n", file_get_contents($file)); $time = (int)$time; if($time !== 0 and $time < time()) { return NULL; } else { return $type; } } } registerClass('Graph'); /* * To preserve PHP 4 compatibility */ function microtimeFloat() { list($usec, $sec) = explode(" ", microtime()); return (float)$usec + (float)$sec; } ?> pgfouine-1.2/include/reporting/artichow/Pie.class.php0000644000175000017500000000014410352052224021364 0ustar acmeacmepgfouine-1.2/include/reporting/artichow/LinePlot.class.php0000644000175000017500000000015110352052224022373 0ustar acmeacmepgfouine-1.2/include/reporting/artichow/Image.class.php0000644000175000017500000000014610352052224021673 0ustar acmeacmepgfouine-1.2/include/reporting/artichow/MathPlot.class.php0000644000175000017500000000015110352052224022375 0ustar acmeacmepgfouine-1.2/include/reporting/artichow/ChangeLog0000644000175000017500000001224110352052224020605 0ustar acmeacmeArtichow 1.0.6 - Add method Plot::setYAxisZero() - Add auto-scaling for axis - Add constant ARTICHOW_CACHE to enable/disable the cache - Improve prefix for classes Artichow 1.0.5 - Add constant ARTICHOW_PREFIX to prefix Artichow's classes (bug #000002) - Add methods Shadow::hide() and Shadow::show() - Add method Plot::reduce() - It is now possible to save its charts in a file - Fix a bug in PlotGroup (setYMin() / setYMax() did not work) - Fix an incoherent behaviour if some values in $datay are not numeric (LinePlot, BarPlot, ScatterPlot) - Fix an inclusion bug in Pattern - Fix a bug for PHP 5.1.0 Artichow 1.0.4 - Add support for GIF images - Add patterns (Pattern.class.php) - Add titles on axis - Rename Artichow.class.php to Graph.class.php (break backward compatibility) - Add a README file - Add support for ScatterPlot - Merge setBackgroundColor() and setBackgroundGradient() into setFill() in class Mark (break backward compatibility) - Add an optional argument $size to Mark::setType() - Grid background in now default to white in class Plot - Change class Polygon to accept NULL values - Add a new legend type (Legend::MARKONLY) - Add method Legend::show() - Add methods Mark::move(), Mark::hide() and Mark::show() - Add new marks (star, book, ...) - Add methods Label::setBackground() and Legend::setBackground() - Add methods Plot::setXMax(), Plot::setXMin(), PlotGroup::setXMax() and PlotGroup::setXMin() - Add new colors to default theme in Pie - Remove methods Drawer::setBackground*() - Tests have been removed from the archive - Move methods Component::addLabel() and Component::addAbsLabel() to class Graph - Modes LinePlot::MIDDLE and LinePlot::BAR have been merged into LinePlot::MIDDLE (break backward compatibility) - Fix a bug in Artichow.cfg.php (unable to use some ttf fonts) - Fix a bug in Legend (position of marks was sometimes broken) - Fix a bug in Pie (pies can now take only a single value) - Fix some bugs in Plot / LinePlot - Fix a bug in Font::draw() (call to undefined function trigger__error) Artichow 1.0.3 (beta) - Add EXPERIMENTAL support for PHP 4 - Change class BarPlot so it now uses class Border instead of setBorderThickness() and setBorderColor() - Change class Legend so it now uses class Border instead of setBorderSize() and setBorderColor() - Change class Mark so it now uses class Border instead of setBorderSize() and setBorderColor() - Change class Text so it now uses class Border instead of setBorderColor() - Change class Label so it now uses class Border instead of setBorderColor() - Drawer::drawRectangle() and Drawer::drawFilledRectangle() now take a line as second argument - Add styles to rectangles and polygons - BarPlot::setBarPadding() takes now values in per-cent instead of pixels - Merge drawFilledRectangleColor() and drawFilledRectangleGradient() into drawFilledRectangle() in class Drawer - Merge drawFilledPolygonColor() and drawFilledPolygonGradient() into drawFilledPolygon() in class Drawer - Merge drawFilledEllipseColor() and drawFilledEllipseGradient() into drawFilledEllipse() in class Drawer - Add method BarPlot::setBarWidth() - Add an optional border to the class Image - Add a new class Border - Add support for MathPlot - LinePlot::STEP has been removed - Merge classes Paragraph and Label (no changes in the API) - Method Plot::setLabelCenter() is obsolete and has been removed - Rewrite Axis (add a new class Tick) (break backward compatibility) - Remove draw*Triangle* from class Drawer (use polygons instead) - Remove prefix draw in each method of class Drawer - Rename LinePlot::setLineType() into LinePlot::setStyle() - Rename LinePlot::setLineThickness() into LinePlot::setThickness() - Rename LinePlot::setLineColor() into LinePlot::setColor() - Rename LinePlot::setLineBackgroundColor() to LinePlot::setFillColor() - Rename LinePlot::setLineBackgroundGradient() to LinePlot::setFillGradient() - Rename Line::setType() to Line::setStyle() - Add methods Label::get(), Label::setFormat() and change method Label::setFont() - Add a parameter $smooth in Shadow::setSize(); - Add filled areas in LinePlot - Add lots of new features in Math.class.php - Fix a bug in Math::isVertical() and Math::isHorizontal() - Fix a bug in Legend (shadow is now well-positioned is there is no border on the legend) - Lots of minor changes Artichow 1.0.2 (beta) - Add support for pies (2D & 3D) - Move shadow from class Component to class Image - X Axis are now centered on 0 by default on bar and line plots - Add title to Graphs - Add 4 named fonts - Add 50 named colors - Add shadow to legends - Add method Image::setBackgroundGradient() - Add methods Label::setCallbackFunction() and Label::hide() - Add method Legend::hide() - Add methods Drawer::copyResizeImage(), Drawer::drawArc() and Drawer::drawFilledArcColor() - Rename Positionable::setHorizontalAlign() and Positionable::setVerticalAlign() to Positionable::setAlign() - API for ellipses has changed - Title is now a property instead of a method in Component - Remove old code, that fixes a bug in the grid - Fix a bug that affects position of bars in some cases - Fix wrong size of shadow - Fix a bug in Plot::setYMin() and Plot::setYMax() Artichow 1.0.1 (alpha) - Add anti-spam images Artichow 1.0.0 (alpha) - Initial release pgfouine-1.2/include/reporting/artichow/font/0000755000175000017500000000000011516212335020005 5ustar acmeacmepgfouine-1.2/include/reporting/artichow/font/DejaVuSans.ttf0000644000175000017500000221477011012376766022556 0ustar acmeacme0FFTMKž¥Z<GDEF7Ü=@XnGPOSÈ¡æȃdGSUB}y œ‡, OS/2ù" ˜LVcmapǪ-'˜¤Šcvt i9¬0þfpgmq4vj®0«gasp®Ü glyfP¦®è}headìn¨M,6hhea ¸ç,<$hmtxëZq,`RXkern«t¿~¸<locaDRøøºÀR\maxp j  namekM  <=post°G"aJDÊJprep;ñ hê”·ÃúQÃúQ  S°±ÅÆÆÇÊËÌÍÑÒÓÔäåéêóôôõõöö÷ÿ     ñòòóôõýþÿ    +,,-/045ST_`ÁÂÊËíîîïðñøùÿ¤¥ª« Ã Ä Ä Å Î Ï Ñ Ò     ) * 0 1 1 2 5 6 7 8 O P Q R j k k lÞßëììííî÷øoppqqrrsuvvw‚ö÷þÿÇÈÒÓ&'./ˆ‰‰Š•±ÆÇÊÍרØÙÙÚäêíîõöö÷÷øúûýþÿ  | DFLT>arabHarmnhcyrlrgrekŒhebršlao ¦latn´nko ètfngôÿÿKUR SND URD ÿÿÿÿMKD SRB ÿÿÿÿÿÿÿÿ(ISM (KSM (LSM (NSM (SKS (SSM (ÿÿÿÿÿÿkern2mark8markFmarkNmarkVmkmk\mkmkdmkmkj     (08@JRZbjrz‚Šš‚Ôp¢0ò ¨ Ör /Œ0´2d466p8`FY¶0&: þ þÔýóVY^VY^Æžî &,28>DJPV\bhntz€†Œ:¤:Ü::ܤþrü Äü4 Ä4Ð `,TUWXZ[\]_'()*+,-.,TUWXZ[\]_'()*+,-.JPV\bhntz€†Œ’˜ž¤ª°°°°°°°°°°°°°°°°°°°$ ýlýàøõö ý¨ý¨N>X  &,ý„öýlwýlwýlwýfný„öîñòóô÷ &,28ýl`ýl~ýl~ýl`ýl~ýl`L€ "FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú þýÞþýÞþý'þý'þýÚþýØþýØþý'þþ‰þþ‰þþ‰þýÚþþþþtþþtþý™þþ þþ;þýÞþýÞþþ8þþ8þþ8þþ¿þýÚþþ þý-þþ þþþþþþþþþþþýTÇÊÍÑÔâ êíøúþÿ!ÇÊÍÑÔ× Úâ êíøúþÿ ‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<þþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþBÞŽ :v|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌþhþhþhþ=þþþDþþþÅþþhþhþ¨þ¨þhþÚþDþ“þþhþhþ=þÐþDþDþþþþÚþnnnnþþþþþhþhþþþþþþþþøþøþøþøþøþøþøþøþøþ±Âîîðóõõ÷÷ûý  !¥ª# * 0)ÈÈ0ÊÊ1ÌÒ2‰‰9 ±Âîîðóõõ÷÷ûý¥ª * 0%ÈÒ,‰‰78âèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,þ{þ{þ{þ°þþþþþþ{þ{þ{þ{þ{þ{þ{þþþþþ{þ{þ°þþþþ{þ{þ{þþ{þþþþþ{þ{þþþþþþþþ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{¸®Ú $6HZl~ cÿœÈÿj cÿœÈÿj cÿœÈÿj cÿœÈÿj cÿœÈýÚ cÿœÈýÚ cÿœÈÿj cÿœÈÿj÷þõö÷øùúûüý VY^>DJPV\bhntz€†Œ’®* ôêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú     $ * 0 6 < B H N T Z ` f l r x ~ „ Š – œ ¢ ¨ ® ´ º À Æ Ì Ò Ø Þ ä ê ð ö ü      & , 2 8 > D J P V \ b h n t z € † Œ ’ ˜ ž ¤ ª ° ¶ ¼ Â È Î Ô Ú à æ ì ò ø þ     " ( . 4 : @ F L R X ^ d j p v | ‚ ˆ Ž ” š   ¦ ¬ ² ¸ ¾ Ä Ê Ð Ö Ü â è î ô ú     $ * 0 6 < B H N T Z ` f l r x ~ „ Š – œ ¢ ¨ ® ´ º À Æ Ì Ò Ø Þ ä ê ð ö ü      & , 2 8 > D J P V \ b h n t z € † Œ ’ ˜ ž ¤ ª ° ¶ ¼ Â È Î Ô Ú à æ ì ò ø þ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ{U:tŒ«Á£!N„‹8©'šQ½Änâââÿœÿœôþ ýÚ¼þpÿœ„þpôÿj„ÿj„ÿj,ýv,ý¨,ývÂÿjÂÿjôþ ôþ Xý¨Xý¨Xý¨XýD[ÿj[ÿj×ý¨×ý¨,ÿœ ÿ8¼ýÚ ÿ8¼þ>ðý¨îþ>ôÿjôþ ¼þp¼ýÚ„ÿj¼ýÚ„ÿj„ÿj„ý¨„þ^„ÿj„ý¨„ÿj„ý¨,ý¨,ý¨,ý¨,ý¨,ý¨,ý¨,ý¨ôþ ôþ ôþ ôþ  ÿ8 ÿ8 ÿ8 ÿj ÿj¼þ>îþ>,ý¨ôþ ¼þp¼þpôÿjI«^`’k/©ÕÝ#€eÝ€YYY£cPþø`Þ{U:ti¾Ái£!N‹©šQÄnU!Q{„ý¨„ý¨+ýÚ+ýÚ„ý¨„ý¨+ýÚ+ýÚ„ý¨„ý¨+ýÚ+ýÚ„ÿj„ÿj+ÿœ+ÿœ„ÿj„ÿj+ÿœ+ÿœ„ÿj„ÿj+ÿœ+ÿœ ÿ8 ÿ8ôÿjÿj ÿ8 ÿ8ôÿjÿj,ý¨,ý¨Xþ Xþ ,ý¨,ý¨XÿXÿ,ý¨,ý¨Xþ Xþ ,ý¨,ý¨Xþ Xþ ôþ ôþ ôþ ôþ  ÿj ÿj,ÿj,ÿj ÿj ÿj,ÿj,ÿjîþ>îý¨ôþ ôþ +ÿœ+ÿœ¼þp¼þp+þ¢+þ¢,ÿœ,ÿœ,ÿœÅÿœ,þ ,ÿœ,ÿœ,ÿœ,ÿœ,þÔ,þÔ,ÿœ,ÿœ,ÿœ,ÿœô2ÿœÿœÿœÿœôþ ôþ ý¨ý¨¼þp¼þp+ÿœ+ÿœÿœÿœ„þp„þp+þ¢+þ¢ôÿjôÿj„ÿj„ÿj+ÿœ+ÿœ„ÿj„ÿj+ÿœ+ÿœ,ý¨,ý¨Xþ¢Xþ¢,ý¨,ý¨XÿœXÿœ,ý¨,ý¨XÿœXÿœÂÿjÂÿjÂÿjÂÿjôþ ôþ ôþ ôþ Xý¨Xý¨ŠÿjŠÿjXý¨Xý¨ŠÿjŠÿjXý¨Xý¨&ÿj&ÿjXý¨Xý¨&ÿj&ÿj[ÿj[ÿjSÿjSÿj[ÿj[ÿjSÿjSÿjŠý¨×ý¨XÿœîÿœŠý¨×ý¨Xÿœîÿœ ÿ8 ÿ8ôÿjÿj¼ýÚ¼ý¨ôÿjÿj ÿ8 ÿ8,ÿj,ÿj¼þ>¼þ>SÿœSÿœðý¨ðý¨&ÿj&ÿjîþ>îý¨+ÿœ+ÿœôÿjôÿjÂÿjôý¨ôþ ôþ ¼þp¼þp¼ýÚ¼ýÚ+þ¢+þ¢„ÿj+ÿœ+ÿœ ÿ8ôÿjÿj¼ý™ôÿjÿj+ÿœ+ÿœ„þ^+þÂ+þ„ÿj+ÿœ+ÿœ,ý¨XÿœXÿœ,ý¨XÿœXÿœ,ý¨XÿœXÿœ,ý¨Xþ Xþ ôþ ôþ ¼þ>SÿœSÿœ¼þp+þ¢+þ¢ôþ ôÿjIII«««^^^```’’’kkk///©©©ÕÕÕÝÝÝ###€€€eeeÝÝÝ€€€YYYYYYYYY (0SnoBqD¤ÁcîöøûŠþ^ŽsöïÙãsåö~™/ˆšõö÷øùúûüý VY^ÉBHNTZ`flrx~„Š–œÿÿ’F˜ 'PV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4UŒÑ0+0¬0™08q0µ080É0i0´0E0 0Ø10ýÍ¥0ä0­0Ë0P=Œi0v0¥0v0À0d0½0½0UŒUŒ8Ñ0É00UŒ    !%ëëïóõöøùüý "™0¸®ä $6HZl~ cr– cr– cr–ä cr–ä cr–Ü cr–Ü cr–Ü cr–Ü÷þ,TUWXZ[\]_ì'()*+,-.RX^djpv|‚ˆŽ”𠦬²¸¾Ä`°°°°°°°°°°`°°°°°°°°& ¶b µlrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú     $ * 0 6 < B H N T Z ` f l r x ~ „ Š – œ ¢ ¨ ® ´ º À Æ Ì Ò Ø Þ ä ê ð ö ü      & , 2 8 > D J P V \ b h n t z € † Œ ’ ˜ ž ¤ ª ° ¶ ¼ Â È Î Ô Ú à æ ì ò ø þ     " ( . 4 : @ F L R X ^ d j p v | ‚ ˆ Ž ” š   ¦ ¬ ² ¸ ¾ Ä Ê Ð Ö Ü â è î ô ú     $ * 0 6 < B H N T Z ` f l r x ~ „ Š – œ ¢ ¨ ® ´ º À Æ Ì Ò Ø Þ ä ê ð ö ü      & , 2 8 > D J P V \ b h n t z € † Œ ’ ˜ ž ¤R``S`ž4Âârôr„èÂL„R„LŠèŠèŠâèâ¼î¼èX X X X [r[rÂ~Âx,°¼LôL¼ÜŠŠ¶ŠèÂRôîôîôî„èôL„â„L„è„R„è„è„L„芊܊èŠèŠÜŠèŠè¼x¼°¼î¼â¼L¼L¼Lôxôx¼4ŠîŠâôâôîôâÂRðIð«ð^ððð`ððàððnðð§ð©ðËðÝð#ðò€òðð”ðÝð€òYððððYðYðõ`R``S`„è„è+è+è„è„è+è+è„è„è+è+è„L„L++„L„L++„â„â+ª+ª¼L¼Lô@ª¼L¼Lô@ªŠèŠèXèXèŠèŠèXèXèŠèŠèXèXèŠèŠèXèXè¼â¼â¼x¼xôxôxúúôxôxú¤ú¤ŠîŠŠôâôâ+è+èôîXV+è+è,¤,¤,:Ű,°,Ü,Ü,:,:,°,°,,,:,:ÂLÐИ˜ÂâÂârrôX+F+Frr„è„è+è+èÂL&L„R„R++„L„L++ŠèŠèXèXèŠèŠèXèXèŠâŠâX~X~èèââ¼î¼î¼è¼èX X ЄЄX X RâRâX X & & X X &è&è[r[rSrSr[r[rSrSrÂ~ôèÂ~îèÂxô~Âxî~¼L¼LôF°ôLôRôF°¼Ü¼ÜúúŠŠSrSrжŠR&R&RŠèŠî++ÂR&RôLô ôîôîôîXVôîXî+è+è„è+è+è¼LôL¶ôRôL¶++„R++„è++ŠXªXªŠÜXxXxŠÜXxXxŠâX~X~¼î¼î¼4S4S4¼¶+°+°¼°&RðððIðIðIð«ð«ð«ð^ð^ð^ððððððð`ð`ð`ððððàðàðàððððnðnðnðððð§ð§ð§ð©ð©ð©ðËðËðËðÝðÝðÝð#ð#ð#ðòòò€ò€ò€òðððððð”ð”ð”ðÝðÝðÝð€ò€ò€òYðYðYððððððððððYðYðYðYðYðYð  0Sno'q)¤ÁHòòfÿÿghi^jsö°Ùã4åö?QZ/ˆ[,TUWXZ[\]_ÂÃÄÅÆÇÈÊì'()*+,-.rx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü`°°°°°°°°°°{{{{{{{{`°°°°°°°°ö <BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞä]xÜþxÿ@€[")ÿ@>Eö"~~€x2 x::Ñëõöø"> @FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîô]kxyyÜyšxy€z[f"w)h>yEy`Pö["~[~t`€zxy2{` ”ˆuxJJ:ˆ:ˆÑëÿÿ îñòóô÷ 28>DJPV\bhnttbbbbt`~~`~` T ¦þR©ÇÊÍÑÔ× Úä êíøúþÿ!"Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>DJPþÿÿþÿÿþþþÿþþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿþþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿêÎò 8rx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ðððððððððððððððððððððððððððððððððððððððððððððððððððððððð$=D]\]4_`6pr ððD6L  $J–s}ÃÕí-±² þ{þ{Þ~ä .^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flÿLž/'¢îѦ–s.}////Ñ–////s}/////.$&(,268DFHLRVXŽ‘®¯°±ÃÕêëìíîïòó-‘’ÊËÌÍ*ÙÚ o pùØþ , ~ ` Nž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ     " ( . 4 : @ F L R X ^ d j p v | ‚ ˆ Ž ” š   ¦ ¬ ² ¸ ¾ Ä Ê Ð Ö Ü â è î ô ú     $ * 0 6 < B H N T Z ` f l‹‹‹‹‹‹‹‹‹‹¼¼Lìžž\/.þRž™sõ'ž'}“sî¼õÍr¾J·¤f–;¦þR¦þR¦é¦s¦þRˆþR%ô}^Gb`þR////ã}}J–Ð////¦‰þRs}·f7þR/'þz`þRÛþR///¦ô¼î¼ž”.þRþR'}r`þR‡TÖ¦TþRTcRRJ@@îþRjþRjþR¦bþRb}þR¦¦þR€™þþRîþRééþRéþR‰þR‰þR‰}é¦þR555þRþRaþRƒt;Q'þRþRþRñþRþRþRôþR}}^G^dþRþRþR°:°:þR'aH¦£ÿöþR«þR_ˆþR°:þþþRþ£GþRŽ þR~þRJ}'/'}ž¦'}^T¦TT@¦X‚}±½½½Tg^GþX^//LBRþRfÖÞ,4$þR'„˜_úzþRf4÷ÆŽLÆó}÷`þRüe·™™žTô¦ž¦¾'sþR¼^õG^£/÷î<\’‘þRô&ÕRäx9Ô´\þRŠÇG$= D]$Ž‘>¨¨B®²CººHÃÃIÕÕJéïKòóRúúT  UV--WEEXNNYTTZYY[aa\ll]vv^{{_‘’`ÊÍböøf iJqLm®??ÐBBÑEEÒ€€Ó’’ÔâãÕþÿ×Ù**Ú--ÛstÜÞà!)æ-1ï5:ôÙÚú o pü 3 3þ ; >ÿ @ B E E H M T T X X \ ] _ a c c e i l o S SNNPQ Sc"„„3\n4††GˆˆHùúIKL%%MÇÊÍÑÔ× Úä êíøúþÿ!"Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>DJPþÿÿþÿÿþþþÿþþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿþþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿŒF Íœ¢¨®´ºÀÆÌÒØÞäêðöü &,28>DJPV\bhnt|‚Š˜ž¤ª°¶¼ÂÈÎÖÜâèîôü &,28>DJRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨°¶¼ÂÈÎÔÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÖÜâèîôú     $ * 0 6 < B H N T Z ` f l r x ~ „ Š – œ ¢ ¨ ® ´ º À Æ Ì Ò Ø Þ ä ê ð ö ü      & , 2 8 > D J P V \ b h n t z € † Œ ’ ˜ ž ¤ ª ° ¶ ¼ Â È Î Ô Ú à æ ì ò ø þ     " ( . 4 : @ F L R X ^ d j p v | ‚ ˆ Ž ” š   ¦ ¬ ² ¸ ¾ Ä Ê Ð Ö Ü â è î ô ú     $ * 0 6 < B H N T Z ` f n t z € † Œ ’ ˜ ž ¤ ª ² ¸ ¾ Ä Ê Ð Ö Ü â è î ô ú     $ * 0 6 < B H N T Z ` f l r x ~ „ Š – œ ¢ ¨ ® ´ º À Æ Ì Ò Ø Þ ä ê ð ö ü &,28>DJPV\bhntz‹ð‹ð‹ð‹ð‹ð‹ð‹ð‹ð‹ð‹ð¼ð¼ðLðìðžðžð\ðð/ð.ðžð*ðsðõð'ðžð'ð}ð“ðsðîð¼ðõðÍðrð¾ðJ{#ð¤{þð–{;ðj{ð//ððé{‰{s{ ¦{o{{'{ð}{^{G{b{`{{'ðã{¦{}ð}{ðªðQð{¦{‰{{}{ðð\ðLðþðXðÄðžð;ð\ð¿ð/ð/ððð‚ðõð'ððÀð'{ððsððsð§ðrð`{¾ð{{'ðð‰{ð{¼ðîð¼ðžð{.ð/'ð}ð{rð`{‡{T{Ö{ðÂ{¦{þðþðc{R{R{J|@{@{î{{jðj{¦{b{b{}{ðð/{€{™ðþðððé{é{é{‰{‰{‰{}{{é{¦ð3{3ð3{^{a{p{‚{;{Q{'{ððñ{ð{ð}{}{^{G{^ðd{{{{{°ð:ð°ð:ð'ða{H{¦ð£{/«{{jð°ð:ðþðþðþð£{GðŽ{ ðððJ{~ð^{}ðJ|Eð‰{}ð{£{‚ð‡{{Eð}{p{¦{t{}{j{{ª{b{¤{^{~ð~ð ðî{}{t{^{ï{¦{¦{/'ð¦{ò{ð¦{Hð/ð¼ð™ðžðOðõðîð'ðoðYð‡ðNðsðàðT{a{E{ö{{›{@{‚{t{ø{{‚{}{{¦{¦{T{`{kðb{{K{©{©{{{{²{ö{t{¦{'{///ú{ó{4ð{óðÀð'ð}{ð•{žð¦{Oð›{îðt{îðt{îðððe{ðsðK{£{‰{{'ð}{E{Íðb{ø{^{{{T{¦{TƒT{{@{¦{{{‚{}{±{½{½{½{{{{{T{g{b{^{G{{þ{{^{ø{LðBðRðfðÆðÖðÞð,ð4â${ð'ð „ð˜ð_âúâzðfð4ðÊDÆðŽðLððÆðóçç}1÷{`{üðeðð*ðð*ðžð}ðT{ðððžðð¾ð{'ðsð¼ð^{õðG{^{ð£{ª{ˆðžð/ð÷ðîð<ðð\ð’ð‘ððôðð&ððÕðRðäðx÷9÷Ô÷´{\{õð{{êðð{{{Çðh$= D]$šš>¨©?²²AººBÀÀCèéDóóFúúG  HI55JBBKEELHIMNNOPPPRVQXYV[]X__[aa\ff]ij^lp`txe{{j¬¬köùl pJxLmµ>V×\]ðaaòccóeeôggõooö|‚÷„„þˆˆÿ’’œœŸŸ¡¢¤¤¦¦ªª¯¯ ¶· ¹¼ ¾ÄÆÛàç-ëë5îï6þ8<!">%-@77IDDJOOKUULYYMstN‚‚P‰ŠQžžST!*]-1g4:l>>s 3 3t ; >u @ By E E| H M} T Tƒ X X„ \ ]… _ a‡ c cŠ e i‹ l o S S”Nd•jj¬~~­„„®\n¯††ÂˆˆÃøúÄÇÈÉ"#Ê%%Ì ±Åîóõõ÷÷ûý "¥ª# * 0)ÈÒ0‰‰;<òú "*28>DLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú "(.4:@FLRX^dþ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þŠoþrþrþ{þŠrþ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{ þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{&Ø!0#5PÿÓÿ·Kr9KÿDÿˆÿ­ÿšÿ &ÿÉÿÜ&ÿÓKÿÓÿÜÿÜ9ÿÜÿÜÿÜÿÜÿaÿ}ÿÿaÿÜÿÜÿÜÿ·ÿÜÿÜÿˆÿ­ÿuÿ·ÿÜÿÜÿÜ9ÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿaÿÿ­ÿaÿuÿÜÿÜÿaÿaÿuÿ­ÿþøÿ/ÿÜÿÜÿÜÿÜÿÁÿ·ÿÿÁÿÜÿÜÿÜÿÜÿÜÿÜÿ·ÿÿÜÿ·ÿÿÿ­ÿÜÿÜÿÜÿÜÿÜ&ÿÜÿÜÿÿÜÿÜÿÜÿÿÿÓÿÉÿDþ·ÿaÿDÿÜÿÜÿDÿÿkÿ·ÿkÿÿDÿDÿÿ·ÿÿDÿDÿÿkÿ·ÿÜÿÜÿÿDÿ·ÿÜÿ·ÿDÿÓþˆÿ·ÿšÿÜÿÜÿÓÿÓÿÉÿÜÿ·ÿÁÿ·ÿ·ÿÜÿÜÿÜÿ·ÿÁÿÿ)ÿÜÿÿÿaÿÉÿ·ÿ·ÿÜÿšÿšÿšÿkÿ}ÿÿÜÿšÿšÿšÿÁÿÁÿÜ/ÿ·þæÿšÿÿDþðÿÜÿÜÿÜÿDÿÜÿÜÿÜþaýæ9ÿ­ÿÜÿÜÿÜÿ}ÿÿÜÿÓÿÜÿDÿÓþÁÿ}ÿÓÿ¤ÿ·ÿÓÿÜÿ·ÿÜÿÜÿÜÿÜÿ¤ÿ·ÿ·ÿÜ&&þ·9ÿÓÿÜÿ}ÿ­ÿ·ÿÁÿ­ÿšÿkÿÿ­ÿ}ÿÓÿ¤ÿ¤ÿ¤ÿÿÿÜÿšÿÓÿ¤ÿ¤ÿ¤ÿkÿ}ÿÜ&ÿDÿ ÿÿaÿˆÿÜþ­þ¤þ¤ÿÁþ¤þÓþ­þÉþ­þÁÿDÿÿˆÿþàþôþçþ¤ÿÓþøÿÜÿˆþøÿYÿ}ÿÜÿaÿaÿÓÿaÿuÿÉÿNÿÿaÿaÿaÿuþæÿ­ÿÿˆÿÿ}ÿˆÿÓÿˆÿ¤ÿ·ÿÜÿÿÜÿ}ÿˆÿˆÿ·ÿÜþøÿšÿkÿ}ÿÜÿ¤ÿÿkÿ¤ÿaÿ­ÿÓÿ þaþðÿaÿÿþæþðÿ·þðÿÿÿkÿþæþðþðÿÿÿÜþøÿÜÿÜÿÜÿÜÿÜÿÿkÿ·ÿÜÿÜÿÜÿ·ÿÜAÿÿÜÿ·ÿ·ÿÁÿ·ÿÜÿ·ÿ·ÿÁÿkÿÿ¤&ÿÜÿÁÿkÿ·ÿ}ÿ}ÿDÿÜÿÓÿÜÿÓÿÜÿÜÿÓÿÜÿÉÿ·ÿÓÿÓÿÓHVþÉÿÉÿaÿÿÜÿÜÿÜþðÿDÿÿÜÿÜÿ)ÿÜÿÁÿÁÿÁÿÁÿÜÿÜþÜÿkÿÜÿÜþÓÿÜÿÜÿÜÿÜÿÜÿÿÿÜÿkÿÜÿÜÿÜ—ÿÜÿÜÿ·ÿ·ÿÜÿÜÿÜÿÜÿDÿNÿÿÿÿÜÿÜÿÜÿÜÿÓÿÜÿÜ9ÿÜÿÜÿÜÿÜÿaÿ}ÿÿaÿÜÿÜÿÜÿ·ÿÜÿÜÿˆÿ­ÿuÿ·ÿÜÿÜÿÜ9ÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿaÿÿ­ÿaÿuÿÜþøÿ/ÿÓÿÜÿÜ9ÿÜÿÜÿÜÿÜÿaÿ}ÿÿaÿÜÿÜÿÜÿ·ÿÜÿÜÿˆÿ­ÿuÿ·ÿÜÿÜÿÜ9ÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿaÿÿ­ÿaÿuÿÜÿþøÿ/ÿÓÿÜÿÜ9ÿÜÿÜÿÜÿÜÿaÿ}ÿÿaÿÜÿÜÿÜÿ·ÿÜÿÜÿˆÿ­ÿuÿ·ÿÜÿÜÿÜ9ÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿaÿÿ­ÿaÿuÿþøÿ/ÿ­ÿ¤ÿÿÜÿÜÿÜ&ÿkÿ·ÿÜÿD&ÿÿÿ­ÿ¤ÿÿ·ÿÓÿÜÿÜ9ÿÜÿÜÿÜÿÜÿaÿ}ÿÿaÿÜÿÜÿÜÿ·ÿÜÿÜÿˆÿ­ÿuÿ·ÿÜÿÜ9ÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿaÿÿ­ÿaÿuÿÜÿþøÿ/ÿÓÿÜÿÜ9ÿÜÿÜÿÜÿÜÿaÿ}ÿÿaÿÜÿÜÿÜÿ·ÿÜÿÜÿˆÿ­ÿ·ÿÜÿÜ9ÿÜÿÜÿÜÿÜÿÜÿÜÿaÿÿ­ÿaÿÜÿþøÿ/ÿÜÿÜÿÿÜÿÜÿÓÿÉÿDÿ?ÿ}ÿDÿÜÿÓÿÜÿÓÿÜÿÜÿÓÿÜÿÉÿ·ÿÓÿÓÿÓÿÜVþÉÿDÿ ÿÿaÿˆÿÜþ­þ¤þ¤ÿÁþ¤þÓþ­þÉþ­þÁÿDÿÿˆþ­þ¤þ¤þÉþ¤ÿÓþøÿÓÿ·Kr9KÿDÿˆÿ­ÿšÿ &ÿÉÿÜ&KþøÿÁÿ·ÿÁÿÁÿ·ÿÁÿ·ÿ·ÿˆÿÜÿ·ÿÿkÿÿ·ÿ·ÿ·þ}ÿ·ÿ·ÿkÿ·&ÿ·ÿÿ·ÿ·ÿ·/ÿÿþæþˆÿÿ·þˆÿÜÿ·ÿ·ÿ·ÿÿ<ÿ&ÿÿ·ÿ·ÿ·O$$%%&&''))**++-- .. // 22 33 445566778899::;;<<==HHIINNQQRRUUYYZZ[[ \\!mm"}}#‚‚$ƒ„%……&††%ˆˆ'‰‰(’’”˜ ›žŸŸ  )¡¡*ª­²²+³³´¸¿¿!ÁÁ!ÂÂ,ÄÄ,ÆÆ-ÈÈ(ÎÎ(ÐÐÒÒ.ÝÝààûû ÿÿ /  0  ""&&100::?? š š2 ¦ ¦3 ¨ ¨4¡$$%%&&''))** ++-- ./22 3344 5566 778899::;;<<==DDFFGGHHIIJKLLOOPPQQRRTTUUVV WW!XX"YY#ZZ$[[%\\&mm'}}(‚†ˆˆ)‰‰*”˜ ›žŸŸ ¡¢¢+££¤§+©©ªª,««¬­,²²-³³´´.µµ¶¸.»»/¼¼"½¾/¿¿&ÁÁ&ÂÂ0ÃÃ1ÄÄ0ÅÅ1ÆÆ0ÇÇ1ÈÈÉÉ2ÊÊ3ËË4ÌÌ3ÍÍ5ÎÎÏÏ2ÐÐÑÑ6ÓÓ7ÕÕ8××8ÙÙ8ÛÛ8ÝÝÞÞ3àà9ááââ3ää:ññ;õõ;ûûÿÿ  3<3<=<;    !! "" ## $$>%%5&&''!((?++@--@//@0011"33@55@66A77B88C99D::??ˆˆ4¬¬E­­F®®E¯¯FÚÚ ÜÜGÝÝ4ðð3ññHóó4ôôIõõJ + +A , ,K - -L . .B / /A 0 0B ™ ™C š šD ¦ ¦M § §N ¨ ¨O^$%&')*+-./23456789:;<=HINQRUYZ[\m}‚ƒ„…†ˆ‰’”•–—˜›œžŸ ¡ª«¬­²³´µ¶·¸¿ÁÂÄÆÈÎÐÒÝàûÿ  "&0:? š ¦ ¨ T¦ DFLT>arabJarmn„cyrl’grek´hebrÄlao Ölatnànko .tfng@ÿÿKUR SND (URD (ÿÿ ÿÿ ÿÿMKD SRB ÿÿÿÿÿÿÿÿ ÿÿ(ISM :KSM :LSM :NSM :SKS :SSM :ÿÿ ÿÿ ÿÿ ÿÿaalt¤aaltªaalt°ccmp¸ccmp¾ccmpÄdligÌdligÒdligØfinaÞfinaähligêhligðinitöinitüligaliga ligaloclloclmedi"medi(rlig.rlig8salt@saltFsaltL    !DLT\dlt|„Œ”œ¤¬´¼ÄÌÔÜäìôü $,4<DTÂdh l ° R – : ~ " V  Ü  ú 8 ‚ : J Z    ° D H L j ˆ ’ ¨ Â Æ ø Bõý  ŒŒŒ>9LMñ *_±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅîïðñòóôõ÷ûüýâäØ r * + , - x yi$=EEGGIIKKLMNOWW‚˜š¡ÂÂÄÄÆÆÈÈÊÊÌÌÎÎÐÐÒÒÔÔÖÖØØÚÚÜÜÞÞààââääæêììîîððññòòôôööøøû      ""$$&&((**,,..0022446688:;==??AAHHRRTTVV‘“••¤¤¬¬®®ÚÚÜÜððôô  **__±ÅÇÊÍäêíîõöö÷÷øúûýþÿââä䨨 r r * - x y&   &v6Pblv€’œ¦¸ÂÔÞèòü",6PZdþýýüü ÿ þ ëù       ùøíü ûú   !"#$%(!½ì B/258;>ADGJMPSVY\_behknqtwz}€ƒ†¤ÁŽD„†ˆŠŒ’–˜œ ¤¨¬®°²´¸¼ÀÄÈÌÐÔØÜàäèìðòôÙß.&åè*"ëî>:ñBFLJÜ26NRVôX\0HJSno#q%B0369<?BEHKNQTWZ]`cfilorux{~„‡¤Ál3Ž”šž¢¦ª¶º¾ÂÆÊÎÒÖÚÞâæêîZöÛá0(çê ,$íð@<óDHÞ48PTãö^ 44668<AHJPRSnoq„‹)Ž1B147:=@CFILORUX[^adgjmpsvy|‚…ˆ¤Ál3“™¡¥©µ¹½ÁÅÉÍÑÕÙÝáåéíYõÚà/'æé+#ìï?;òCGÝ37OSâõ] 44668<AHJPRSnoq„‹)Ž12  )Z,Z ,Y)VVYZ~&8Jl'Z(Z -]*Z .]+Z +X*W(U'T .X-WTUWXZ] ýþáâ> $ûŠù†÷„üŠú†ø„áâJ 8 "(ãIOâILáOàLßI ãOâLIß²Rlž¨$*06<€[~Z|YzXxWwVuUsT3^1]0\ &,[Z}Y{XyWtT2]4]5IQSòíÐ 6 , êØèÖçÐæáéáßéåWVäWAˆ(:FPZfr Ñ" Ä Ð Ï" k$; V P0 Q(/ 1F 7X 6R")567DF è è_^`\]ba28?EMS_^`\]ba28?EMS øD %ø,-DO  %,-O Ñ ËÉÌÊÏÐȉÑÍÒÎ ±²³´·¸¹»¼½À óù!ùúùóù"# ! LMñ *_âäØ r x y3™3™×f ç.ÿÒýÿ `)PfEd@ ÿÿþšmãàÿÿÿ,ü€, üа°~éîó÷OSXbu~ŠŒ¡Î†V_‡ŠÃÇêô :UZot‡’•˜¡¤¦©¯µº¿ÆÌÎÕùçõú?‚„ˆŠ—Ÿ£¥§«¹½ÄÆÍÙÝÅü5JR½ê>Pj…–¯ÞáGvœ#.[jx{…¿É›ùEMWY[]}´ÄÓÛïôþ ' c q Ž ” µ Ñ × Ü á! !I!K!N!„"¯"Æ"Í###!#(#,#u#z#}#‡#”#®#Ï#ã#å$#$i&œ&²'' '''K'M'R'V'^'”'¯'¾'à'ë(ÿ)) )A)„)Õ)ë)û***/* *º*ú++#,o,w-e-oMÿðöÅûûû6û<û>ûAûDûOûû•ûŸûÚûéûÿþþ#þtþüþÿÿýÿÿ  ìó÷QW\tz„ŒŽ£Ðˆ1Ya‰°ÆÐð !@Z`ty‘•˜¡¤¦©¯µº¿ÆÌÎÕðÀëø?„‡Š”™¡¥§ª­»ÀÆÈÐÜ Ð 7LTÀì@RtŠ ÞáFn€&0]w{…›Ä  HPY[]_€¶ÆÖÝòö * j t   Ð Ö Û á!! !K!N!S!"²"È"Ö###$#+#s#z#}#‡#”#›#Î#ã#å$"$`%& ''' ')'M'O'V'X'a'˜'±'à'æ'ð)) )@)ƒ)Î)ë)ú** */*}*®*ù++ ,`,q-0-oMÀðöÅûûûû8û>û@ûCûFûRûŠûžûÙûèûüþþ þpþvþÿÿùÿÿÿãÿÂÿÀÿ¼ÿ¹ÿ±ÿ°ÿ­ÿªÿ™ÿ•ÿÿÿŽÿÿŒÿ‹ÿnÿlÿkÿjÿEÿCÿ;ÿ6ÿÿÿÿÿÿ ÿÿþüþøþïþíþëþãþáþàþÞþÙþÔþÐþÌþÆþÁþÀþºþ ýÚý×ýÕ÷‘÷P÷O÷M÷L÷J÷D÷C÷B÷A÷@÷>÷=÷<÷:÷9÷8÷6÷4õrõhòdòcòbòaò`ò_ò]ò\òTòSòRòIòEò<òò ñ¨ñ‚ñyëëëëëëëêúêåêáê«ê§ê¡êŸêê›ê™ê˜ê—ê–ê•ê“ê’ê‘êêŽêŒê‹êŠêˆê‚ê€êêtêZêVêSêOê1ê0ê/ê-ê)êêêêê ê ê êéÁé½é»é²é¦é éénémé1èõè_è\èè è è è èèèèçÿçþçÝçØçÔçÎçÌç˜çWçæùæëæçæÞæÌææræ4æ/æ*äîäíä5ä,ÃÜ!ÜßÓÎÍÌËÊÉÇ¿·~q__O „ß ~ ébìî¬óó¯÷÷°O±QSWX\btu z~„ŠŒŒŽ¡£Î0І\ˆ1VŸY_Åa‡Ì‰Šó°ÃõÆÇ Ðê ðô&  +,-.!:/@UIZZ_`o`ttpy‡q‘’€••‚˜˜ƒ¡¡„¤¤…¦¦†©©‡¯¯ˆµµ‰ººŠ¿¿‹ÆÆŒÌÌÎÎŽÕÕðùÀçšëõÂøúÍ??Ђф„Ó‡ˆÔŠŠÖ×”—Ø™ŸÜ¡£ã¥¥æ§§çª«è­¹ê»½÷ÀÄúÆÆÿÈÍÐÙÜÝ ÅÐü8e l57J˜LR¬T½³ÀêìH>d@P“Rj¤t…½Š–Ï ¯ÜÞÞìááíFGînvð€œù#+&.90[B]jnwx|{{~……›¿€ÄÉ¥›« ù G ¡ · E ½HM ãPW éYY ñ[[ ò]] ó_} ô€´ ¶Ä HÆÓ WÖÛ eÝï kòô ~öþ ' Š * c ² j q ì t Ž ô ”    µ  Ð Ñ * Ö × , Û Ü . á á 0!! 1! !I ;!K!K z!N!N {!S!„ |!"¯ ®"²"Æ Î"È"Í ã"Ö# é## %##! '#$#( -#+#, 2#s#u 4#z#z 7#}#} 8#‡#‡ 9#”#” :#›#® ;#Î#Ï O#ã#ã Q#å#å R$"$# S$`$i U%&œ _& &²ü'''' ' ''')'K3'M'MV'O'RW'V'V['X'^\'a'”c'˜'¯—'±'¾¯'à'à½'æ'ë¾'ð(ÿÄ))Ô) ) Ö)@)AØ)ƒ)„Ú)Î)ÕÜ)ë)ëä)ú)ûå**ç* *ê*/*/û*}* ü*®*º *ù*ú-++/+ +#J,`,oN,q,w^-0-ee-o-o›MÀMÿœððÜöÅöÅÞûûßûûæûû6ëû8û<û>û> û@ûA ûCûD ûFûOûRûûŠû•IûžûŸUûÙûÚWûèûéYûüûÿ[þþ_þ þ#oþpþtsþvþüxþÿþÿÿÿùÿýÓÓVÕ8Õ9\Õ;Õ>^Õ@ÕDbÕFÕFgÕJÕPhÕRÕkoÕ ÕÓ‰×â×ë½   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a†‡‰‹“˜ž£¢¤¦¥§©«ª¬­¯®°±³µ´¶¸·¼»½¾ ªrdei ¬x¡pk Rvj ~ˆš <s ‚ ƒgw / -M Il|6¨ºcn 8T f $m} °b‚…— ž ¦ § ¢ £¹)Á: Ì Á Âàá «y ¤ ¨ ¸„ŒƒŠ‘Ž•–”œ›óˆžqš›œzŸ‰5¸ËËÁªœ¦¸fqË ²…u¸Ãˉ-˦ðÓª‡ËªJ3ËÙôT´œ99N´R¸çÍ7sÍ`s3¢V¦V9Åɸßsºé3¼Dßͪåªˤ{¸o{RÇÍššoËÍžÓðºƒÕ˜HžÕÁËöƒT3fÓǤ͚sÕ þ+¤´œbœ-ÕÕÕð{T¤¸#Ӹ˦Ãì“ Ó\qÛ…#¨H99`Õš#fy```{œw`ªé`b{Å{´RÍf¼fwÍ;…‰{ÍJ/œœ}oo5jo{®²-–{öƒT7öœáföÍD)fîs–·, °%Id°@QX ÈY!-,°%Id°@QX ÈY!-,  °P° y ¸ÿÿPXY°°%°%#á °P° y ¸ÿÿPXY°°%á-,KPX °ýEDY!-,°%E`D-,KSX°%°%EDY!!-,ED-,°%°%I°%°%I`° ch ŠŠ#:Še:-ÿÿfþ–f¤@ ûû/ÄÔì1ÔìÔì0!%!!füsüåþ–øòr)5Õ 5@ƒ üK° TX¹ÿÀ8Y<ì2991/äüÌ0¶ P ]%3#3#5ËËË¢þþÕýqþ›eŪéÕB@„üK°TK°T[X¹ÿÀ8YüÜì1ô<ì20@0 @ P ` p   ¿ ]#!#oª$ªÕýÕ+ýÕ+ž¾`@1 ‡  ‡   üÌ91/<Ô<<ü<<Ô<<Ä2ì220@   ]!! !3!!!!#!#!5!!5!þÝT%Dh$i g8þ¡R>þ›h gþÛg¡hþÅ`Tþ¾if…þ²‡þaŸþašþ²™þbžþbž™NšŸªþÓm!(/½@U" '&( /)/))/B" ) *!††#Љ*Љ- ) " & 0üK° TX¹ÿÀ8YK° TK°T[K°T[X¹@8Y<ìô<ü<ôäì1/äìÄÔäì2Äîî99990KSXíí9í9íY"#.'5.546753.'>54&´diÒjfÑoÝÉÚÌd]®SS¯\ãÖãÖdtzqá{þÓ---´@AÈ$¬–£¼ëè¯*.þU#´œ©Ãš jXV`ÕþOnZXhqÿã)ð #'3‰@6$%&%&'$'B’ ’.’$’ &Œ($‘4'!%   ! + 1 4üK° TK° T[K° T[K°T[K°T[K° T[X¹1ÿÀ8YÄìôìîöî991ä2ô<äìîöîî0KSXííY""32654&'2#"&546"32654&%3#2#"&546ÑWccWUccUžº» º»ü—VcbWWcd1 üZ ž¼»ŸŸ¹º‘”„‚••‚ƒ•Ü»»ÛÛ»¼Ûa•‚„””„–ùó Û»½ÚÛ¼ºÜÿãþð 0Í@–  † †  † †††  !         B  (('•+•'”$‘Œ .  .'.'!!1üìÄÔÔìÆî99999991/ÆäöæîîÆ9990KSXíí9í9í9í9í9íí9í9ííí9Y"²2]@² " ) **&:4D ^YZ UZZY0g{›š™—• “••"™-  ' (   2'') #**(/2; 49?2J LKFO2VZ Y UY\_2j i`2uy z““—•œœŸš › š 2 2°29]]3267 >73#'#"5467.54632.#"ò[UÔ _¦Iþ{ü;Bº h]ühäƒñþΆ†02Þ¸S¥UWžDiƒ;#Q¡X’Â?@ýøYËr„þþ~þã“YW×€ác?}<¢Å$$¶/1oX3gŪoÕ7@ „üK°TK°T[X¹ÿÀ8Yì1ôì0@ @P`p ]#oªÕýÕ+°þò{ 7@˜—  ÜK°TX¹ ÿÀ8YK°TX¹ @8Yä2ì991üì0#&547{†‚ƒ… –•”—æþ>ççþ;åëÆàßÄì¤þòo @˜— Ü<ôì991üì03#654¤ –••– …ƒƒìþ<ßàþ:ëåÅççÂ=JÃðN@,  ™ ™ ‘    Ô<ä2Ü<ä2991ôÔ<ì2Äì2990 %#'-73%Ãþ™g:þ°rþ°:gþ™:PrPßÂÃbËþ‡yËbÃÂcËyþ‡ËÙÛ #@ œ  Üü<ü<ì1/Ô<ü<Ä0!!#!5!®-ýÓ¨ýÓ-ýÓªýÓ-ª-žÿÃþ@ žƒüìÔÌ1üì073#ðÓ¤Rþ¬þÀ@d߃¶œÜÌ1Ôì0!!dý僤ۮþ·ƒüì1/ì073#ÛÓÓþþÿB²Õ-@BŸ/Ä991ôì0KSXííY"3#ªýøªÕùm‡ÿãð #@   ‘Œ üìôì1äôìî0"32'2#"‹œœû þ÷ûûþ÷ PþÍþÌþÍþÍ3343 þsþ†þ‡þsyzáZÕ @@B     ÔK°TX¹@8YìÄüì1/ì2ôìÔì0KSXY"´]7!5%3!!þJþ™eÊJü¤ªsH¸HúÕª–Jðš@'B¡”  ‘   üK°TK°T[K°T[X¹ÿÀ8YÄÔìÀÀ91/ì2ôìôì0KSXíí9Y"@2UVVzzv‡tvust‚†‚‚‚¨¨]]%!!567>54&#"5>32‰ÁüLs3aM§†_ÓxzÔXèE[þôªªªw‘:m—Iw–BCÌ12èÂ\¥pþëœÿãsð(p@. † †     “  “#‘Œ£)&  )üK°TK°T[X¹ ÿÀ8YÄÄÔìôì991ìäôäìæîîîî90@ daa d!]!"&'532654&+532654&#"5>32?‘£þÐþè^ÇjTÈm¾Ç¹¥®¶•ž£˜S¾rsÉYæ Ž%ÄÝò%%Ã12–„•¦wps{$&´ Ѳ|«d¤Õ @   B     ÜK° TK° T[X¹ ÿÀ8YÔ<Äì291/äÔ<ì290KSXÉÉY"@* *HYiwŠ+&+6NO O Vfuz… ]] !33##!5þþ5þÕÕÉý^%üãÍü3¨þ `ÞÿãdÕ^@#†  ‰   Œ¤  üK°TK°T[X¹ÿÀ8YK°TX¹@8YÄÔìÄî1ääôìæîþÄî90!!>32!"&'532654&#"Ýý ,X,ú$þÔþï^ÃhZÀk­ÊÊ­Q¡TÕªþ’þîêñþõ Ë10¶œœ¶$&ÿã–ð $X@$ †   ¥  ‰"‘Œ% " !%üììôìä1äôäüäîîî90@ËËÍÍÍËˤ²]]"32654&.#">32# !2¤ˆŸŸˆˆŸŸ L›LÈÓ;²káþðâþýþîPL›;º¢¡»»¡¢ºy¸$&þòþïW]þïëæþêyb¥¨hÕc@B üÌÄ991/ôì0KSXííY"K°TX½@ÿÀ878Y@X9Hg°°]]!#!¨ÀýâÓþý3ÕVú+‹ÿã‹ð #/C@%  ' - ‘Œ'£0 $*$ !0üÄìôÄìîî991ìäôìîî990"32654&%.54$32#"$54632654&#"‹¥¥¦¥þ¥‚‘ÿÞßþ‘’£þ÷÷÷þ÷¤H‘ƒ‚““‚ƒ‘Åš‡‡š›†‡šV ²€³Ðг€² "ÆÙèèÙÆat‚‚tt‚‚ÿã‡ð$X@#†  ¥ ‰ ‘Œ%!"" %üìäôìì1äôìæþõîî90@ÄÂÀÀÀÂμé]]7532#"543 !"&2654&#"áLœKÈÓ:²làþûâþ±þåLœ>ˆŸŸˆˆŸŸ¸$& V\ëæþsþ†þŸþ[—º¢¡»»¡¢ºðÃ#@ƒ¦ƒü<ì21/ìôì073#3#ðÓÓÓÓþþ#þžÿÃ# %@ƒžƒ¦  ü<ì2ÔÌ1äüìî03#3#ðÓÓÓ¤R#þýÙ¬þÀ@Ù^Û¦M@*œœœœB¨§$#üì291ôì90KSXííííY" 5Ûûøúþðþ‘þ“¶ѦÑÙ`Û¢@ œœ#ü<Ä21ÔìÔì0!!!!Ùúþúþ¢¨ðªÙ^Û¦O@+œœœœB¨§$#ü<ì91ôì90KSXííííY"55Ùúþð¶þ/¦þ/¶m“°ð$e@+$  †ˆ•‘ƒ   &%ÜK° TX¹ÿÀ8YÄüìÔìî99991/îöþôîÍ9990¶y z z ]%3##546?>54&#"5>32‡ËËÅ¿8ZZ93ƒlO³a^Ág¸ßHZX/'þþ‘še‚VY5^1YnFC¼98ŸL‰VV/5<4‡þœq¢ L•@2  ©©L43¬0©7¬$©7CM34( (+(I+*(I,=MÜìüìþýþ<Æî991ÔÄüìþíÔÆÅî2Äî990K° TK° T[K°T[K°T[K°T[X½MÿÀMM@878Y@ NN/N?N]32654&#"#"&5463253>54&'&$#"3267#"$'&5476$32úŽ|{zy!<›g¬×Ø«gœ;’¥?@hþÕ°{â`±smiùhZ}þÙ˜¹þ¸€€†ˆ~R½Ôk{KOþÂþè£¤ŽŒ¥¤þHMIùÈÈúKLƒý ß±k¼Pƒ‹A@fþµÁŸþêjhmWQoagƒ}}I½¶J}‡® bæ{þùþÐhÕ Â@A       B•    ÔÄ91/<äÔì90KSXííííííííY"² ]@BXvpŒ  VXP ghxv|rwx‡ˆ€ ˜™–]] !3#!#¼þî%þ{å9Òˆý_ˆÕý®ú+þÉìÕ C@#• •• ­ . !üì2üìÔì9991/ììôìî90²"]!2654&#!2654&#%!2#!“D££þ¼+”‘‘”þ çú€|•¥þðûýèÉý݇‹Œ…fþ>orqp¦À±‰¢ ˘ÈÚsÿã'ð6@ ¡® •¡®•‘Œ 0üì2ì1äôìôìîöî0´].# !267# !2'fç‚ÿþð‚çfjí„þ­þz†S†íbÕ_^þÇþØþÙþÇ^_ÓHHŸghŸGɰÕ.@• •  2 üìôì99991/ìôì0²`]3 !%! )“ô5þáþËþBŸ²–þhþPþa/ûw.,¦þ—þ€þ~þ–É‹Õ .@•••­   üì2ÔÄÄ1/ììôìî0² ]!!!!!!ɰýÇý9øü>ÕªþFªýãªÉ#Õ )@••­ üì2ÔÄ1/ìôìî0² ]!!!!#ÉZýpPý°ÊÕªþHªý7sÿã‹ð9@ ••¡®•‘Œ43 üìüäüÄ1äôìôìþÔî990%!5!# !2.# !26Ãþ¶uþæ þ¢þu‹^’opü‹þîþík¨Õ‘¦ýSU™mn™HF×_`þÎþÑþÒþÎ%É;Õ ,@•­ 8  üì2üì21/<ä2üì0²P ]3!3#!#ÉÊÞÊÊý"ÊÕýœdú+Çý9É“Õ.·¯üK°TX¹@8Yì1/ì0@ 0@P`Ÿ]3#ÉÊÊÕú+ÿ–þf“Õ B@ •° 9 üK°TX¹@8Yìä991äüì990@ 0 @ P ` Ÿ ]3+53265ÉÊÍãM?†nÕú“þòôª–ÂÉjÕ ï@(B¯  üì2ÔÄ91/<ì290KSXííííY"²]@’ ((764GFCUgvwƒˆ”›ç    (+*66650 A@E@@@ b`hgwp ‹‹Ž š¶µÅÅ×Öèéèê÷øù,]q]q3! !#ÉÊžýþöý3ÊÕý‰wýHüãÏý1ÉjÕ%@ •:üìì1/äì0@ 0P€€]3!!ÉÊ×ü_ÕúÕªÉÕ ¿@4  B ¯   >  üìüì91/<Äì290KSXííííY"²p]@V   && & 45 i|{y €‚‚  #,'( 4<VY ej vy •›]]! !###É-}-ÅþËþÄÕüøú+üúáÉ3Õ y@B¯6 üìüì991/<ì2990KSXííY"² ]@068HGif€ FIWXeiy…Š•šŸ ]]!3!#É–ÄþðýjÄÕûáú+áûsÿãÙð #@•• ‘Œ 3üìüì1äôìî0"32' ! 'ÜþýÜÜþÿÜ:xþˆþÆþÅþ‡yLþ¸þåþæþ¸HH¤þ[þžþŸþ[¤bb¥ÉÕ:@••   ? üì2üì91/ôìÔì0@ ?_¯]32654&#%!2+#“þššþ8ÈûþÿûþÊ/ýÏ’‡†’¦ãÛÝâý¨sþøÙð R@*  B ••‘Œ    3üìüì9991Ääôìî990KSXíí9Y""32#'# ! 'ÜþýÜÜþÿ? ôÝ!#þÅþ‡y;:xÑLþ¸þåþæþ¸HHúÏþÝï¥ab¥þ[þžþüþŽÉTÕ±@5  B• •   ?  üì2üÄì99991/<ôìÔì9990KSXíí9Y"²@]@Bz%%%&'&&& 66FFhuuwˆˆ˜˜]]#.+#! 32654&#A{>ÍÙ¿J‹xÜÊÈüƒý‰þ’••’¼~þh–bý‰ÕÖØºOýƒ…‡ÿã¢ð'~@<    B ¡”••”%‘Œ( "-"(ÜÄìüìä99991äôäìîöîÆ90KSXí9í9Y"²)]¶)/)O)].#"!"&'532654&/.54$32HsÌ_¥³w¦zâ×þÝþçjï€{ìr­¼‡š{âÊõiÚ¤Å76€vce+Ù¶Ùà0/ÐEFˆ~n|-À«Æä&ÿúéÕJ@•@@Ôäüä1/ôì20K° TX½@ÿÀ878Y@  @ p Ÿ ]!!#!ïýîËýîÕªúÕ+²ÿã)Õ@@ •Œ  8AüK°TX¹ÿÀ8Yìüì1ä2ôì99990¶Ÿ]332653! ²Ë®Ã®ËþßþæþåþßÕüuðÓÓð‹ü\þÜþÖ*$hÕ·@'B¯ÔÄ91/ì290KSXííííY"²P]@b*GGZ}ƒ *&&))% 833<<7HEEIIGYVfiizvvyyu€˜—)]]!3 3JýÆÓÙÚÒýÇÕûéú+D¦Õ {@I      B ¯    ÔÌ91/<ì2290KSXííííííííY"²]@ò  ($ >>4 0 LMB @ Yjkg ` {|€ –•     !   # $ %  <:5306 9 ? 0FFJ@E@BBB@@ D M @@XVY Pfgab```d d d wv{xwtyywpx  †‡ˆ‰… Š —Ÿ¯[]]3 3 3# #DÌ:9ã:9Íþ‰þþÅþÂþÕûîûîú+úð=;Õ f@  ÔÄÜÄÄ1´€ ]@¯ /<ì20K°BPX@   ìììì@    Y3 3 # #ÙsuÙþ Ùþ\þYÚÕýÕ+ý3üø{ý…ÿüçÕ”@(B¯@@ Ôäüä91/ì290KSXííííY"² ]@<5000F@@@QQQe„“ &)78@ ghxp Ÿ ]]3 3#Ùž›ÙýðËÕýšfüòý9Ç\Õ @B••B ÜK° TK° T[X¹ÿÀ8YÄÔä991/ìôì0KSXííY"@@ )&8HGH    / 59? GJO UYfio wx Ÿ ]]!!!5!s•üPÇû=°ügÕšûoªš‘°þòX;@©²©±CÜK° TX¹@8YK°TK°T[X¹ÿÀ8YüÌ21üìôì0!#3!°¨ððþXùüÿB²Õ-@BŸ/Ä991ôì0KSXííY"#ªªýøÕùm“Çþòo0@©²©±CüK°TK°T[X¹@8Y<Üì1üìôì0!53#5oþXïïøÞÙ¨ÛÕ@ ÜÌ91ôÌ290 # #¼ÉþHþHÉÕýÓ‹þu-ÿìþþ¬µ©ÄÄ1Ôì0!5ûØþ¬ªð‰f1@ ´³DÜì1ôì0K° TK°T[X½ÿÀ@878Y #o™þºfþŠv{ÿã-{ %¼@'  ©¹ †º¹#¸Œ   E&üìÌÔì22991/ÄäôüôìÆîî9990@n0000 0!0"?'@@@@ @!@"PPPP P!P"P'p'…‡‡‡ ‡!…"' 'ð'000 0!@@@ @!PPP P!``` `!ppp p!€€€ €!]]"326=7#5#"&5463!54&#"5>32¾ß¬o™¹¸¸?¼ˆ¬Ëýû§—`¶Te¾Zóð3f{bsÙ´)LýªfaÁ¢½À‹..ª''üºÿ㤠8@¹  ¹Œ¸—G Füì22ôì1/ìäôÄìÆî0¶`€ ]4&#"326>32#"&'#3å§’’§§’’§ýŽ:±{ÌÿÿÌ{±:¹¹/ËççËËççRdaþ¼þøþøþ¼ad¨qÿãç{?@†ˆ† ˆ ¹¹¸Œ HEüä2ì1äôìþôîõî0@ € ].#"3267#"!2çNP³ÆÆ³PNM¥]ýþÖ-U¢5¬++ãÍÍã++ª$$>:#qÿãZ8@¹¹Œ¸—G Eüìôì221/ìäôÄìÄî0¶`€ ]3#5#"3232654&#"¢¸¸:±|ËÿÿË|±ýǧ’’¨¨’’§¶^ùì¨daDDaþËççËËççqÿã{p@$ †ˆ©¹ »¹¸ ŒKEüìôìÄ91äôìäîîôî90@)?p Ðð?????,// , ooooo ]q]!3267# 32.#"ü² Í·jÇbcÐkþôþÇ)ü⸥ˆš¹^Z¾Ç44®*,8 CþÝÄ—´®ž/øY@ ©‡—¼    LüK° TX¹ @8YK°TX¹ ÿÀ8Y<Äü<ÄÄ991/ä2üìî2990¶@P ]#"!!##535463ø°cM/þѹ°°®½™Phcü/ÑN»«qþVZ{ (J@#  †¹¹&#¸'¼ ¹½& G E)üÄìôì221/ÄäìäôÄìþÕî990¶`*€* *]4&#"326!"&'5326=#"3253¢¥•”¥¥”•¥¸þþúa¬QQžRµ´9²|ÎüüÎ|²9¸=ÈÜÜÈÇÜÜëþâþé³,*½¿[cb::bcªºd4@ ‡¸ — N  Füì2ôì1/<ìôÄì90²`]#4&#"#3>32d¸||•¬¹¹B³uÁƤý\žŸž¾¤ý‡ýžedïÁy+@¾±¼Fü<ì21/äüì0@  @ P ` p ]3#3#Á¸¸¸¸`û éÿÛþVy D@ ¾ ‡½¼ ±O  Fü<ì2ä991ìäôìî990@ @P`p]3+532653#Á¸£µF1iL¸¸`ûŒÖÀœa™(麜 ¼@)B¼— F üì2ÔÄ91/<ìä90KSXííííY"² ]@_ ')+Vfgsw‚‰Ž“–—£    ('(++@ h` ‰…‰š—ª§¶ÅÖ÷ð÷ð]q]33 ##º¹%ëý®kðýǹüiãýôý¬#ýÝÁy"·—Füì1/ì0@ @P`pð]3#Á¸¸ùìº{"Z@&  ‡ ¸¼PPF#üì2üüüì91/<<äô<Äì290@0$P$p$$ $ $¿$ß$ÿ$ ]>32#4&#"#4&#"#3>32)EÀ‚¯¾¹ru¦¹rw¦¹¹?°yz«‰|võâý\ž¡œ¾¤ý‡ž¢›¿£ý‡`®gb|ºd{6@ ‡¸ ¼ N  Füì2ôì1/<äôÄì90´`Ï]#4&#"#3>32d¸||•¬¹¹B³uÁƤý\žŸž¾¤ý‡`®edïqÿãu{ J@¹¹ ¸Œ QEüìôì1äôìî0@#?{{   {  { ð]"32654&'2#"s”¬«•“¬¬“ðþîðñþïßçÉÉçèÈÇéœþÈþìþíþÇ98ºþV¤{>@¹¹¸Œ½¼ GFüì22ôì1äääôÄìÄî0@ `€ à]%#3>32#"&4&#"326s¹¹:±{ÌÿÿÌ{±8§’’§§’’§¨ý® ªdaþ¼þøþøþ¼aëËççËËççqþVZ{ >@¹  ¹¸Œ½¼ GEüìôì221äääôÄìÆî0@ `€ à]32654&#"#"3253#/§’’¨¨’’§s:±|ËÿÿË|±:¸¸/ËççËËççý®daDDadªùöºJ{0@  ‡¸ ¼ FüÄì21/äôìÄÔÌ90´PŸ].#"#3>32JI,œ§¹¹:º….´˾ý²`®fcoÿãÇ{'ç@<  S  SB †‰†‰¹¹%¸Œ( R"E(üÄìÔìä99991äôìþõîõî90KSXí9í9Y"²']@m   . , , , ; ; ; ; $( ( *//*(() )!$'† † † †      '/)?)_))€)) )ð)]]q.#"#"&'532654&/.54632‹N¨Z‰‰b”?Ä¥÷ØZÃlfÆa‚Œe«@«˜àÎf´?®((TT@I!*™‰œ¶##¾55YQKP%$•‚ž¬7òž8@©¼‡  Fü<Äü<Ä2991/ìô<Äì2990²¯]!!;#"&5#53w{þ…Ks½½Õ¢‡‡žþÂý ‰NšŸÒ`>®ÿãX`;@ ‡Œ ¼¸  NFüìô9ì21/ää2ôÄì90´oÀ]332653#5#"&®¸||•­¸¸C±uÁÈϺ¦ýaŸŸ¾¤{û ¬fcð¨=`û@'B¿ÔK° TX¹@8YK°TK°T[X¹ÿÀ8YÄ91/ì290KSXííííY"@ŽHj{†€‘¤  &&)) 55::0FFIIFH@VVYYPffiigh`ut{{uz……‰‰‰†––—š˜˜—¨§°Àßÿ>]]3 3#=Ã^^Ãþ\ú`üT¬û V5` ë@IU U U U   B ¿    ÔK° TK°T[K°T[K°T[K° T[X¹@8YK° TK° T[K°T[X¹ÿÀ8YÌ91/<ì2290KSXííííííííY"@ÿ" 5 IIF @ [[U P nnf yy‡™˜” ¼¼ÎÇÏ         %%#'!%""%' $ ! # 9669 0FHF@B@@@D D D @@VVVPQRRPS T U cdejejjjn a g ouuy}x}zzxy  { v } ‡ˆ——”“œ›˜˜™@/– Ÿ¦¦¤¤««©©«¤ ¯µ±½»¸ ¿ÄÃÌÊy]]333# #V¸æåÙæå¸þÛÙñòÙ`ü–jü–jû –üj;y` C@F      B ¿  ÔK° TK°T[K°T[K°T[X¹@8YK°TX¹ÿÀ8YÄÔÄ91/<ì290KSXííííííííY"@˜   & =1 UWX f vzvt ‚ ™Ÿ—’ ¦©¯¥£       )&% * :9746 9 0 IFE J @ YVYYWVYVV Y P o x ›”«¤° Ï ß ÿ /]] # # 3 dþkªÙþºþºÙ³þrÙ))`ýßýÁ¸þHJþq=þV`‹@C        B  ‡½ ¼  ÔK° TK°T[X¹ @8YK°TX¹ ÿÀ8YÄÄ91ä2ôì9990KSXíííííí2Y"@ð     # 5 I O N Z Z j ‡ € “        '$$  )( % $ $ ' ** 755008 6 6 8 990A@@@@@@@@B E G II@TQQUPPVUVW W U U YYPffh ii`{xx‰Š … … ‰ ‰‰™ • • šš¤ ¤ ««°Ïßÿe]]+5326?3 3“N”|“lLT3!þ;Ã^^ÃhÈzšH†TNü”lXÛ` @B©¼© ÜK° TK° T[X¹ÿÀ8YK°TX¹@8YÄ2Ä991/ìôì0KSXííY"@B&GI  + 690 @@E@@CWY_ ``f``b € ¯ ]]!!!5!qjýL´ü}´ýe`¨üÛ“¨%þ²$w@4 %   ! © ©À ©±% $  C %ÔK° TX¹@8Y<Äü<Ä299999991üìÄôìî99999990²&]#"&=4&+5326=46;#"3>ù©lŽ==k©ù>DV[noZV¾”Ýï—ts•ðÝ“XøŽŽœøXþ®·±Ôì1üÌ0#®ªøþ²$‡@6%   ©©#À©±%#C %ÔK° TX¹ÿÀ8YK°TX¹@8Y<Ä2ü<Ä99999991üìÄôìî99999990²&]326=467.=4&+532;#"+FŒUZooZUŒF?ù§lŽ>>Žl§ù?¾VøœŽŽøŽW“Ýð•st—ïÝ”ÙÓÛ1#@ œœ ÔÄ1ÔüÔìÀ990#"'&'&'&#"5>32326Ûi³an’ ›^X¬bi³an“ ›^V©1²OD;>MS²OE<>L5Õ b@ƒ ü<ì2991/ôüÌ0K° TX½ @ ÿÀ878YK°TK°T[K°T[X½ ÿÀ @878Y¶ P ]#53#3ËËË¢×þú+eþ›¬þÇ#˜!Q@+  †ˆ †ˆ ¹ ¹¸Œ"  "ÜìÔ<Ô<<ì221äô<ÄìÄþôîõî9990%.'>7#&73¦“¤¤JˆDF‰HA‰Mfñþ÷ ñfI‰ƒX⸹⡬)*ü *'ª#þä 32þá!bð`@!† ©  ”‘   Ü<ÌÌü<ÄÔÄ1/ì2ôäìÔ<î2î990K° TX½ÿÀ@878Y´66].#"!!!!53#535632NLˆ=”t‡þy-üìÇÇÖè=—´¶))›Ô×þ/ªªÑîó^R¼²#/ƒ@I -'! - -¹ëì'¹ë!0 *$0* $ $(st*(s0Üäìôäì9999999991ÔäìôäìÀ9999999907'#"&''7.5467'7>324&#"326{ÏrÎ%$&(ÑrÏ;t=:x=ÏqÏ%%&&ÏsÏ7t@?s9ÏqÏ(&%%ÏsÎ>v:@t8ÎsÏ'%$þ|pššprœRÃÕÆ@F  B Ó Ó   fe f eÔ<ì2ìüì2ì99991/ä2Ô<ì2Ô<ì290KSXííííY"K° TX½ÿÀ@878Y@(†¦ µ' ' ')((79‡ ˆ¦ ¥ª©]]!#!5!5'!5!3 3!!!þcÉþ` Tþ´þþ{y¿þÂþµTŸÇþ9Ç{3›{JýD¼ý¶{›3þ¢®˜@ õõÜ<ì21ÔìÔì0##®ªªª˜ý öý ö\ÿ=¢ð >‘@54&.#"#"&'532654/.5467.54632{?>‹ú?>ÌS8alÎÓƒ\]>9Ì­IšXW”:fqÝÖ€][;;ȦI™¨.Z.L…‡-[.Kˆ“¤''PGZswšeZŒ54m@ލ¤''TLf{x™f[1,pE‚Ÿ×F)’@ÎÍddÜüÔì1ü<ì20K° TK° T[X½@ÿÀ878YK° TK° T[K°T[K°T[X½ÿÀ@878YK°TK°T[X½@ÿÀ878Y@````pppp]3#%3#^ËËþyËËÊÊÊåÍ/IC@&=Ë>:ÌAÊ$1Ë04ÌGÊÉÈ$É 7aD=0^* D^ JÜÌüìþí2î1/îöþýîÖîýîÖî02#"$'&5476$"3267>54&'..#"3267#"&54632˜mmllmmþù˜˜þùmmllmm˜ƒâ^^``^^⃄ã^]]^\^ã§B‚B•§«›@zBC‰FØûûØIˆÍnmmþúš˜þûmmnnmm˜šmmng^^^å‚ã^^__^]⃅ã]^^õ! ¯Ÿ®"ôÐÑòsÕ;ð)_@3(%ãÝá%Ý ßÞÝ à‘* "(kl"k *ÜìÌüì22ÀÀ9991ôäüôìÄîíÖîî99990!!#5#"&546;54&#"5>32"326=‹°ýP®•,]€˜¿¼¶uu>ˆDI‘E·³þì¡~bRh‚P{¸þ@p?D‡q‡Š[[""°ðCO@Mrž%# †@Ièèèè è è è  è B  ç¦ o o nüü<Ôì2991ô<ì2990KSXííííííííY" 5 5%þÓ-þ+#þÓ-þ+#¿þôþô¿¢R¢¿þôþô¿¢RÙÛ^@ œÜÔì1ÔÄì0!#!Ù¨û¦^ýÁ•d߃¶œÜÌ1Ôì0!!dý僤åÍ/8L`@6EBC?2ÉH0É9JCÊ 9ÊÉÈ É$HE301B54&'.'2#"$'&5476$#32654&'2#'.+#ƒâ^^``^^⃄ã^]]^\^ㄘmmllmmþù˜˜þùmmllmm}{{nWXf°®i`C.‰¬;I6B›f^^^å‚ã^^__^]⃅ã]^^gnmmþúš˜þûmmnnmm˜šmmnþbþì>KL?gwyVpMIßÑ`3þœDÕb+ö/·ïîÔÌ1üì0K° TK°T[X½ÿÀ@878Y!!ÕVýªö”Ãu=ð  @ÃÄà ‘ Z[ZÜìüì1ôìüì0"32654&'2#"&546PnnPPnoO@v+..¹†‡´¸ooPOmmOOp1.-rB„·´‡†ºÙÛ .@МР œ   Ô<ì2ü<ì21/ìÔ<ìü<ì0!!#!5!!!®-ýÓ¨ýÓ-ýÓúþþ}ªþ}ƒªƒû¦ª^œ´ðJ@$}}BÝÝ÷ Ý‘~ÜÄÔÄì91ôÄìüìî90KSXí2íY"!!56754&#"5>32 ¨ýª"?XhU4zHM…9‘®þµ8rn81^BQ##{„l‹þä0bÍð(H@' Ý Ý Ý Ý ø÷Ý ø#‘)~&~ )ÜÄÄÔìÔì9991ôäìüäìÔìîî90#"&'532654&+532654&#"5>32 \e¾±9}F4wCmxolV^^ad_(fQI€7©Z`mR|†yOFJLl?<:=svcE`sîRf1@ ´³DÔì1ôì0K° TK°T[X½ÿÀ@878Y3#‹Çþº™fþˆ®þVå` M@% ‡Œ ¼½!   NF!üì2ôìÄ91ää2ô<ìÜÄ990¶"`"Ï"]3326533267#"&'#"&'®¸Š‡”•¸#% )I#ER2‘bf*þV ýH‘”¨¨ü¢<9 ”NPOONNýמÿ;9Õ %@Á]] ÔÔüÜì91Ä2ôì90!###.54$yÀ¾Ž×ëÕùfùáNݸ¾èÛH®F·ƒÔì1Ôì03#ÛÓÓFþ#þuÁ@  ó' ÜÔìÔÌ1/ÔüÄ90!#"&'532654&'T76xv.W+"J/;<+->i0Y[ ƒ0.W=‰œÅß ,@Ý ÝÝ ÷‘ |]|| Üôäüä1ôììÔìî2035733!œÌßæ‰Íý× c)t'ý+n`Õdð.@ãáÝ àÝ‘ klk Üìüì991ôìôìüì0!!2#"&546"32654&‹°ýPX³Îγ³Ðгi~hi}|P{Ý¿¿Ûܾ¿Ýs¡ˆ…  …‰ ÁH# †@I è è è è èèèèB  ç¦ o opü<üÔ<ì991ô<ì2990KSXííííííííY"5 %5 ÁÕþ+-þÓ²Õþ+-þÓ#þ^Rþ^¿  ¿þ^Rþ^¿  ÿÿ‰ÿãð&{' ô‹ýd 35ÿÿ‰ÿã?ð&{'t‹ýd 35ÿÿbÿãð&u' ô‹ýd 35ÿã¬Õ $†@/ †ˆ !ƒ# •Œ#%" " "!& %ÜìÔüìÔì99991äôìþÍôî9990K°TK°T[K°T[X½%ÿÀ%%@878Y@ ttttv]33267#"&546?>7>5#53ô¾7ZZ:3ƒmN´`^Àg¸àIYX0&ÄÊÊDœe‚WX5^1YnFC¼98ŸL‰VV/5<6þÿÿhk&$˼uÿÿhk&$ɼuÿÿhm&$̼u´  +@ ]1ÿÿh^&$ʼu´ #+@ @O# /#]1ÿÿhN&$ȼu´  +@ 0?  ]1hm !Ë@T   !!  ! !!!B  Á • Ž  !  VV!"ÔÄÔì2Ôî299999991/<æÖîÔî9990KSXííííííííY"² #]@  s › P#f iu {yyv v!€# ]]4&#"326!.54632#!#TY?@WX??Y˜þð!þX=>Ÿsr¡?<Òˆý_ˆÕZ?YWA?XXþóýN)sIs ¡rFv)ú‹þHÕ‡@9  B• ••••­    ÔÔ<ì2ÔÄÄ91/<ììÄôììîî0KSXííííY"²€]@gww† …– ¿ ]!!!!!!#!5ýÇý9øü=ýð Íq‹þ¶ËÕªþFªýãªþÕžüðÿÿsþu'ð&&z-ÿÿÉ‹k&(ËžuÿÿÉ‹k&(ÉžuÿÿÉ‹m&(Ìžu@@ ]1ÿÿÉ‹N&(Èžu @@ @]1ÿÿ;ºk&,Ë/uÿÿ¢k&,É/uÿÿÿþ`m&,Ì/u´ +1ÿÿXN&,È/u´ +1 ºÕ g@  © ••  2  yô<ì2ÄôìÄ91/Æ2îöîî20@( °Ÿ Ÿ Ÿ Ÿ ŸŸŸŸ¿ ¿ ¿ ¿ ¿¿¿¿]]! )#53!!3 !Ó ±–þiþPþ`ÉÉËPþ°ó5þáþËÕþ—þ€þ~þ–¼ãþýê.,ÿÿÉ3^&1Êþu´"+@ 0?""]1ÿÿsÿãÙk&2Ë'uÿÿsÿãÙk&2É'uÿÿsÿãÙm&2Ì'u´+@]1ÿÿsÿãÙ^&2Ê'u´!0 +@ 0!?0 !/0!0]1ÿÿsÿãÙN&2È'u´ +@ @O]1?œÅ …@M œ  œœœœœ œ œ B   Ô<Ì291Ô<Ì290KSXííííííííY"  ' 7 œþ7Éwþ5þ5vÈþ8vËËLþ5þ7yËþ5yÉËyþ5Ëfÿºå +ž@< +,  )&  *&•& •‘&Œ,+,* # )#3,üìüìÀ999999991äôìîÀÀ99999990@*WZWU!je!{vu! FYVjddj(|svz( ]] 324&'.#"&5!27!"&''¶ý3>¡_Ü'y=¡_Üþý''†NOy;‚ÝW¢fªNPþˆþÆ€Ý[¢gXü²@CHp¸¸@Cþ¸þåp¼Džf b¥MK¿YÆgþöžþŸþ[KK¿Xÿÿ²ÿã)k&8Ëîuÿÿ²ÿã)k&8Éîuÿÿ²ÿã)m&8Ìîu´ +@ / ]1ÿÿ²ÿã)N&8Èîu´ +@P_@O /]1ÿÿÿüçk&<ÉsuÉÕ =@• •ö  ? üì22üì91/ôüìÔì0@ ?_]332+#32654&#ÉÊþûþÿûþÊÊþš™ŽÕþøáÜÜâþ®'ýÑ’††‘ºÿã¬/š@0-'!  *†¹*¹—Œ.  !' $'$-F0üÄüÌÆîÔîî99991/äþîþÕî990@@'(Š Š     ! "&  : :!MM I!I"jj ¥¥¦ ]]4632#"&'532654&/.5467.#"#ºïÚÐÛ—¨:A9¦`áÓ@ˆIPŒAtx;e\`W§—ƒq‚ˆ»qÈÛèàs`/Q*%jŽd¬·¤_[?T>7;‡[¬gp‹ƒû“ÿÿ{ÿã-f&DCR @?&/&&]1ÿÿ{ÿã-f&DvR @?&/&&]1ÿÿ{ÿã-f&DˆR´ (,+1ÿÿ{ÿã-7&DžR´.< +@ ./<.<]1ÿÿ{ÿã-&DjR ´-( +@(o(P-_(@-O(0-?(-( ]1ÿÿ{ÿã-&DœR%@&,,& 2882 +Ä+Ä1@ ?5?/5/]0{ÿão{3>@C'-%= 4©%†ˆ©:¹.†-º*¹»1 ¸Œ%?47&%7& =&-7"E?üìÌÔü<ÔìÄ999991Ää2ô<Ääü<ôìÄî2îôîî9990@0+0,0-0.0/00@+@,@-@.@/@0P+P,P-P.P/P0…+…0€@@ @°@À@Ð@à@à@ð@??? ??0,0-0.0/@,@-@.@/P,P-P.P/ooo oo`,`-`.`/p,p-p.p/€,€-€.€/]q].#">32!3267#"&'#"&5463!54&#"5>32"326=¶¥‰™¹DJÔ„âü² Ì·hÈddÐj§øMIؽÒýû§—`¶Te¾ZŽÕï߬o™¹”—´®ž0Z^þÝúZ¿È55®*,ywxx»¨½À‹..ª''`þf{bsÙ´)ÿÿqþuç{&Fzÿÿqÿãf&HC‹ÿÿqÿãf&Hv‹ÿÿqÿãf&Hˆ‹´"+1ÿÿqÿã&Hj‹@@ ]1ÿÿÿǦf'Cÿóÿÿof'vÿóÿÿÿÞ\f&óˆÿ´ +1ÿÿÿôF&ójÿ´ +1qÿãu('@^%{&%#${##{#({'(#&'('%$%(('"#" ! B('&%"! ##¹ ¹Œ#±)&' ! (%#" QE)üìôì99999991ìÄôìî9990KSXÉÉÉÉííííY"²?*]@v%+("/#/$)%-&-'*(6%F%X X!` `!f"u u!u"%#%$&&&''(6$6%F$E%Z Z!b b!z{     {zzv v!x" *ð*']].#"32654&#"432''%'3%F2X)§¹®’‘®6 ~rþäæçþåÝ4*ŸþÁ!µäM!þÙ“ØÃ¼ÞÞ¼z¼&þà­ÿþÉ7ÿú7´kc\Ì‘oabÿÿºd7&Qž˜ÿÿqÿãuf&RCsÿÿqÿãuf&Rvsÿÿqÿãuf&Rˆs´+1ÿÿqÿãu7&Ržs´ .+@ /. .]1ÿÿqÿãu&Rjs´ +@ @O0?]1Ù–Ûo )@êêœ r ÜÔ<ü<Ä1ÔÄüÄîî03#3#!!ßööööýúúþoöþõAªHÿ¢œ¼ +ä@<+,&  )&  *&¹& ¹¸&Œ,+,* # #Q)E,üì2ôì2À9999991äôìîÀÀ99999990@p(?-YVUV jf!{    { z{ {!"#$%{&›•%¨ -ð-&YVUZ(ifej(ztvz(‰•š$¢­$]] 32654&'.#".5327#"&''‰þ)gA“¬\*g>—©}66ñ]ŸC‹_’56þîð`¡?‹`!ý°*(èÈOuš))ëÓHn.—MÅw834¨O³MÆxþíþÇ43¨Nÿÿ®ÿãXf&XC{ÿÿ®ÿãXf&Xv{ÿÿ®ÿãXf&Xˆ{´ +1ÿÿ®ÿãX&Xj{´ +@ @O0?]1ÿÿ=þVf&\v^ºþV¤>@¹¹Œ¸½— GFüì22ôì1ìääôÄìÆî0@ `€ à]%#3>32#"&4&#"326s¹¹:±{ÌÿÿÌ{±8§’’§§’’§¨ý®¾ý¢daþ¼þøþøþ¼aëËççËËççÿÿ=þV&\j^´+@ 0? /]1ÿÿh1'q¼;$´ +@@O]1ÿÿ{ÿã-ö&qJD´+@o]1ÿÿh’'šÎJ$´+1@oo]0ÿÿ{ÿã-&šO×D´"+1ÿÿþu¥Õ&$äÿÿ{þu€{&D¿ÿÿsÿã'k&&É-uÿÿqÿãçf&Fv‰ÿÿsÿã'm'ÌLu& ²<=/1ÿÿqÿãçf&Fˆ¤ÿÿsÿã'P&&ÐLuÿÿqÿãç&F›¤ÿÿsÿã'm&&Í-u@]1ÿÿqÿãçf&F‰‰ÿÿɰ&'Íì‰ÿÿqÿãÛ&GÇ @_?]1ÿÿ ºÕ’qÿãô$J@$Ó ù"¹¹ Œ¸—   GE%üìô<Äü<Ä1/ìäôÄìÄîý<î20¶`&€& &]!5!533##5#"3232654&#"¢þºF¸šš¸:±|ËÿÿË|±ýǧ’’¨¨’’§¶N}““}úü¨daDDaþËççËËççÿÿÉ‹3&(q¡=ÿÿqÿãö'q–H@p]1ÿÿÉ‹m'Ï¡u(@@]1ÿÿqÿãH'š–H@p]1ÿÿÉ‹P&(Сuÿÿqÿã&H›–ÿÿÉþuÕ&(Ìÿÿqþu{&HxÿÿÉ‹g&(ͦo@@ ]1ÿÿqÿãa&H‰”ÿû´!+@!]1ÿÿsÿã‹m'Ì\u* ²<=/1ÿÿqþVZf&ˆhJ ² <=/1ÿÿsÿã‹m&*ÏuÿÿqþVZH&Jš‹ÿÿsÿã‹P'Ð\u*@?]0ÿÿqþVZ&›hJÿÿsþ‹ð'×^ÿí*ÿÿqþVZ4'Ãà JÿÿÉ;m'Ìu+´ +@ / ]1ÿÿÿådm'ÌuK*´+1K°QX»ÿÀÿÀ88Y@ €€@@]É‹Õ:@•  •­  8 Üì22Ìüì22Ì1/<ä2üìÜ22ì2203!533##!##53!5qÊÞʨ¨Êý"ʨ¨ÊÞÕààà¤û¯Çý9Q¤¤ààxŸ>@! ‡ ‡¸— N  Ü2ì22ÌÌôì1/<ìôÄìÜ2ì290#4&#"##5353!!>32Ÿ¸||•¬¹}}¹`þ B³uÁƤý\žŸž¾¤ý‡ö¤zz¤þ¼edïÿÿÿäx^'Ê.u,´ +1ÿÿÿÓg7'žÿó´+1ÿÿY1'qÿ.;,´+1ÿÿÿòHõ'qÿÿÿó´+1ÿÿÿõgm'Ï.u,´+1ÿÿÿäVH'šÿó´+1ÿÿ°þu%Õ'ÿd,ÿÿ–þu 'ÿJLÿÿÉ•P&,Ð/u³<<1´??]0Áy`,@ ¸¿Füì91/ìä0@4D@P`p]3#Á¸¸\`û {ÿÿÉþfïÕ'-\,@ì1ÿÿÁþV±'M8L@Fì1ÿÿÿ–þf_m'Ì.u-´+1ÿÿÿÛþV\f'ˆÿù´+1ÿÿÉþjÕ'× .ÿÿºþœ'׬ Nºœ` »@(B¼ F üì2ÔÄ91/<ì290KSXííííY"² ]@_ ')+Vfgsw‚‰Ž“–—£    ('(++@ h` ‰…‰š—ª§¶ÅÖ÷ð÷ð]q]33 ##º¹%ëý®kðýǹ`þåýòý®!ýßÿÿÉjl'Énv/ÿÿÁJl'ÉZvO±<1K°QX¹@8Y@ŸO]0ÿÿÉþjÕ'×› /ÿÿˆþ­'× O@@]1ÿÿÉjÕ'ÇŸÿÃ/ÿÿÁ'Ç9O @]1ÿÿÉjÕ'y1w/ÿÿÁ„'yÖsOK° QK°SK°QZ[X¹@8Y1ÿòuÕ ?@ •  : yô<ìÄü<Ä991/äì90´0P]3%!!'7ÓË9Pþw×ü^”MáÕý˜Ûoþîýãª;jnžH ^@ — z z Ô<äü<ä991/ì90K°TX½ @ ÿÀ878Y@ @ P ` sz p à ð ]37#'7Ǹ}Lɸ{JÅý¦ZjüãšXjÿÿÉ3l'ÉÅv1@O]1ÿÿºdm&vBQ @?O]1ÿÿÉþ3Õ'× 1ÿÿºþd{'× QÿÿÉ3_&1Íõg´ +@ /  ]1ÿÿºdf&Q‰´ +@]1ÿÿ͹Õ'QU~ÉþVð;@  AüK°TX¹ÿÀ8Yì2ÔüÌ1@ •°•‘/äôìôì0!"#367632+53265Pþͳ×ÊÊNij™ãéQRµW1fO¬ÿÞü²Õñ†CCþÁþÌüoÕa`œZ ºþVd{;@ ‡‡¸¼ NF üì2ôìÄ1/äôÄìÔì90´`!Ï!]+5327654&#"#367632dRQµþéi&&||•¬¹¹BYZuÁcc¤ýHÖ``œ01™²Ÿž¾¤ý‡`®e22wxÿÿsÿãÙ1'q';2´ +@]1ÿÿqÿãuõ&qsÿR´+1ÿÿsÿãÙm'Ï'u2´+@]1ÿÿqÿãuH&šsR´#+1ÿÿsÿãÙk'Ñ'u2ÿÿqÿãuf'Ÿ Rs Õ;@•••­   üìÔÄÄÔì299991/ìì2ôì2î0!!!!! !# !3úýÇý9øû×þOþA¿±gþ¿þÀ@AÕªþFªýãª|pm|ªþáþàþßþßqÿãÃ{'3„@1†ˆ ©. ¹(¹»"%¸Œ4"1 K1 Q+E4üìôüôìÄ9991ä2ô<Ääì2Äî2îôî90@%?5_5p5Ÿ5Ï5Ð5ð5????? ooooo ]q].#"!3267#"&'#"32>32%"32654& ¤‰™¹Hü² Ì·jÈbdÐj òQGÑŒñþïñŒÓBNèâú°”¬«•“¬¬”˜³®ž5Z¾Ç44®*,nmnm98olkpþ݇çÉÉçèÈÇéÿÿÉTl'É•v5ÿÿº”m&vBUÿÿÉþTÕ'× 5ÿÿ‚þJ{'× UÿÿÉT_&5Í}g@_]0ÿÿºZf&U‰´ +@]1ÿÿ‡ÿã¢l'É•v6ÿÿoÿãÇm&vBVÿÿ‡ÿã¢m'Ì“u6 ´ ))Ic:1ÿÿoÿãÇf&ˆ%V ´ ))Ic:1ÿÿ‡þu¢ð&6z‹ÿÿoþuÇ{&Vzÿÿ‡ÿã¢m&6Í‹u ´+ ""Ic:1ÿÿoÿãÇf&V‰ ´+ ""Ic:1ÿÿÿúþuéÕ&zP7ÿÿ7þuòž&záWÿÿÿúé_&7Ísg´ +1@_]0ÿÿ7þ‚&WÇ7p@]1ÿúéÕF@ • • @ @ Ô<äÌü<äÌ1/ôì2Ô<ì20@@pŸ ]!!!!#!5!!ïýî þ÷Ëþ÷ ýîÕªýÀªý¿Aª@7òžC@©©¼ ‡ Fü<<Ä2ü<<ÄÄ2991/ìô<Äü<Ü<ì20²¯]!!3#;#"'&=#535#53w{þ…¾¾%&s½½ÕQQ‡‡‡‡žþÂéŽé‰''šPOÒéŽé>ÿÿ²ÿã)^'Êîu8´ '+@ ]1ÿÿ®ÿãX7'žƒX´&+1ÿÿ²ÿã)1'qî;8´ +@ / ]1ÿÿ®ÿãXõ'qƒÿÿX´+1ÿÿ²ÿã)m'Ïîu8´+@]1ÿÿ®ÿãXH'šƒX´+1ÿÿ²ÿã)o&8œðiÿÿ®ÿãXÊ&Xœ|Ä @@@!]1ÿÿ²ÿã)k'Ñîu8ÿÿ®ÿã^f'Ÿ°Xÿÿ²þe)Õ&8úÿðÿÿ®þuè`&X'ÿÿD¦t'Ìõ|:´+1ÿÿV5m'ˆEZ´+1ÿÿÿüçt'Ìr|<´ +1ÿÿ=þVm&ˆ^\´+1ÿÿÿüçN&<Èsu´ +1ÿÿ\l'É•v=ÿÿXÛm&vB]ÿÿ\N'Шs=ÿÿXÛ&]›ÿÿ\m&=;uÿÿXÛf&]‰´ +@ ]1/ø#@ ‡ —©¼ Lü<ÌüÌ1/ôìôì0!##53546;#"˜¹°°®½®°c'&ÑN»«™()g ÿã¤,D@%¹ ¹ Œ¸")%©,$'—".EG* ,(%#'F-ü<Ìì222Ìôìì1/ôÜ<ì2äôÄìÆî04'&#"327667632#"'&'##5353!!åST’’TSST’’TSýŽ:YX{Ì€€Ì{XY:¹šš¹Eþ»/ËtsstËËtsstRd01¢¢þøþø¢¢10d¨}““}ÿ—PÕ)C@#• •• ­ . *üì2üìÔì9991/ììôìî90²"]!2654&#!2654&#%!2#!"#546÷D££þ¼+”‘‘”þ çú€|•¥þðûýè„vœÀÉý݇‹Œ…fþ>orqp¦À±‰¢ ˘ÈÚ0_i1Fµ£ÿÿÉìÕºÿã¤&8@¹#¹ Œ¸©—(EGF'üì22ôìÄì1/ôìäôÄìÆî067632#"'&'#!%4'&#"3276s:YX{Ì€€Ì{XY:¹NýkrST’’TSST’’TS¶d01¢¢þøþø¢¢10d¨¦üÀËtsstËËtsstìÕ 3@  . /Üì2üìÄÌ1@ • ­ •/ìäôì³ 9/04'&#!!276!2#!#ON£þ¼D£NOý|NûþðûýèÉ8·‹DCýÝDC¨ýšÚÞÝÚD‘ÿã¤>@  G /Üì22ôìÄÌ1@¹¸ ¹ Œ—/äôìÄôìij9/0>32#"&'##34&#"326s:±{ÌÿÿÌ{±:¹º"Qr§’’§§’’§¶daþ¼þøþøþ¼ad¨DÑüËççËËççsÿã'ð0@†ˆ•‘ † ˆ• Œ0 Ü<ôìì1ôìôìôìôì0>3 !"&'53 !"shí†S†þzþ­„íjfç‚þðÿ‚çfbGGþaþ˜þ™þaHHÓ_^9'(9^_sÿãZd$D@"!• % ¡® •¡®•‘Œ%  0%üü2ììÄ1äôìôìîöîÜì0´&&].# !267# !2676;#"'fç‚ÿþð‚çfjí„þ­þz†S`œ SfãM?†nbÕ_^þÇþØþÙþÇ^_ÓHHŸghŸ$Ãbzª–qÿãÌ"N@$†ˆ† ˆ ¹¹¸Œ#‡—# HE#üô2Ììì1ôìäôìþôîõî0@ $$€$$ $].#"3267#"!2546;#"çNP³ÆÆ³PNM¥]ýþÖ-GF¡µE0iL~õ++ãÍÍã++ª$$>: ÖÀœaÿÿ ºÕ’ÿ—Õ.@• •  2 üìôì99991/ìôì0²`]3 !%! )"#546÷ô5þáþËþBŸ²–þhþPþa„vœÀ/ûw.,¦þ—þ€þ~þ–0_i1Fµ£ÉìÕ.@  .üìôì2ÄÄ1@ • •­• /ìôìôì0)!"!!"$54$3!!ž@Dþ¼£NýèûþðûNý|·þï#‡“ú+ÚÞÝÚÀqÿãZ?@¹¹Œ¸‡—G EüìÄôì221/üìäôÄìÄî0¶` €   ]5!#5#"3232654&#" M¸:±|ËÿÿË|±:ý§’’¨¨’’§n¦ùì¨daDDad¹üÀËççËËççqþVuc'T@ )E Q E(üìÄô²]ìÔìì99@   ¹¹¶(ôìÔüÔÌ99@%S ì910%!"'53254%&'&326&#">kþGÝxfööþøÐuŽïð›'«””¬¼~@3cnBOþðF™Fu\0%p‡9þÇþíœþü ËåèÃÂÇ *܃EÕ +@    ÜÄÄÔì2Ä1@ • •­•/ìôìôì0!5!!5!!5Eü>øý9ÇýÕú+ªªºªuÿãÙðD@&¡®•••­• ‘Œ3üÄìôì91äôìôäîîôî90!!"56$3 ! 7327uþíþî‹üpo’^‹þˆþÆþ·þ—Ü ÿÊÊÿ   2`_×FHþgþ’þŸþ[·ÌÃþääÿã{ð(@@$ † ˆ •‘)•­)† ˆ•#Œ)* &)üìÔìÔÄÄÌ1ôìôìôì9ôìôì0.54$32.#";#"3267# $546؃Ž æYÉsr¾S˜£ž•¶®¥¹Ç¾mÈTjÇ^þèþУ%!«|²Ñ ´&${spw¦•„–21Ã%%òÝÄÿ–þf#ÕA@ • °••­ üì2ÔÄÄ991ìôìîôì990² ]!!!!+53265ÉZýpPý°ÍãM?†nÕªþHªýŸþòôª–ÂÿþVøe@# ‡ ½©‡—¼ LüK° TX¹@8YK°TX¹ÿÀ8Y<Äü<ÄÄ991ä2üìî299ôì990¶@P ]#"!!+53265#535463ø°cM/þÑ®½®°cM°°®½™Phcû뻫™Ph*N»«sÿã—d&I@43! F'üìüôìüÄÄ1@•'$•$•¡®•‘Œ'äôìôìþÔî99Üì0%!5!# !246;#".# !26Ãþ¶uþæ þ¢þu‹^[£DÉãM?†npü‹þîþík¨Õ‘¦ýSU™mn™¼êª–Â×_`þÎþÑþÒþÎ%þRvÕ%•@ 'P $&ÔÔìÔìÔ]ĵ 91@ •½%$&ä222ôì³990@ #%$$ì<ì<¶$ì¶#$ì´%#@$"! #9927654'&'3#"'&547673¿6,3,,3,6ÙÞýºhC.Kd››dK.ChýºÞþý B9Iy\\yI9B z^ûÏÈ®wB‹AWWA‹Bw®È1ºG*O@, *&NF+üì2ôìÄÄÌÔì91@‡ '&‡& ‡ #¸—/<ìô<Äì9ì99ì0%27654'&'5+"&54&#"#3>323L•TWJ>yàmoþàÝF»||•¬¹¹B³uÁÆLiœbe›Þp_!”‘þìõþæÈΟž¾¤ý‡ýžedïèþò“gÉÆÕ .@ • üK°TX¹@8YìÄ991/äì9903;#"&ÉÊn†?MãÍÕü-–ªô RÕ E@ •¯  ü<ÄK°TX»@@88Yì2Ä1/ìÜ<ô20@ 0 @ P ` Ÿ ]33###53ÉÊ¿¿Ê¿¿Õýªý¿AªÉ÷ðf@ üì2ÔÄ9Ôì1@%    B  •‘¯ /<ìôì9990KSXííííY"#54&#" !#3632÷ªI&F%ýÝþöý3ÊÊlUqˆUUHy6P#ýùüãÏý1Õý‰CO\[n¹œË@   Füì2ÔÄ9Ä1@B  •— ¼/<äüä90KSX@     ííííY²]@5 ( ' ( ++@h `‰ … ‰ š —ª § ¶ÅÖ÷ ð ÷ ð ]´ q@%  ' ) +V f gs w ‚ ‰ Ž“ – —£ ]46;#"3 ##¹£µ¿¨iL%ëý®kðýǹ~ÖÀœa™ýÿãýôý¬#ýÝ * 2@F ü<ì21@ ©—/ìÔ<ì20@  @ P ` p ð ]33###53Á¸±±¸··ý8ýD¼=3''%'3%# =ëGþÔ!)KÈ4:!þÉíÃþÆþ~2¼eccÅŠhahú×<üIJÿã'Õ'J@ )PP (üìüüüÌü<91@ !•!$Œ( /ô<<ô<Äì2909%#"'&5332653327653#5#"'&¦EÀ‚¯__Ë'9u¦Ë99w{SSËË?°yzVUÕ|v{zâûïº5N¾¤ìûï¢NM_`£ìú)®gb>>ÿ–þf3ÕŒ@)B • °¯6  9üìä99üì991/ì299üì990KSXííY"² ]@068HGif€ FIWXeiy…Š•šŸ]]!3!+53265É–ÄþðýjÍãG?†nÕûáú+áû‡þòôª–ÂÿÿºþVd{DsÿãÙð 1@ 3üì2ôì21@• •­ •‘ Œäôìôìì0! ! "!&32sy:;xþˆþÅþÆþ‡µÊÿ ¬þýVûÜÜøéb¥þ[þŸþžþ[¤ÅþäÃÃýzþÿþÂ=ÿÿgÿã&2ôÌ¢4ÿÿvÿãÓë'ÌX RsÿãÏð3@•¯• ‘•Œ!  üìÔ<ìÜìÄ1/ôìôìôì0!4&#! !2!2"327&nz¼þÅþÆþ‡y;pa'ãÍüXÜþýܯ€ŠÓ–û‹Ó¤bb¥ôþòü-Lþ¸þæþåþ¸gFqþVY{!:@ ‡¼"¹¸"¹Œ½"# E"üìÔìÜìÄ91äôìôìôì04'&##"3232"327&¡&&i‰ðñþïñdRصRQý”¬«•@TþVt™10ü¼98``ÖûŒ‰çÉÉç:ð6ÿ—ñÕ:@••   ? üì2üì91/ôìÔì0@ ?_¯]32654&#%!2+#"#546÷þššþ8ÈûþÿûþÊ„vœÀ/ýÏ’‡†’¦ãÛÝâý¨0_i1Fµ£¹þV¤$O@$#¹¹¸Œ½% ©—%G  F%üì22Ì99ôì1ôì99ääôÄìÄî0@ `&€& &à&]%#46;#">32#"&4&#"326sº£µþçiL:±{ÌÿÿÌ{±8§’’§§’’§¨ý®(ÖÀœa™Èdaþ¼þøþøþ¼aëËççËËççÉþøTÕV@  ?  üì22üÄì99991@• • /ìÜôìÔì9990@ @u|]#.+#33 326&#A{>ÍÙ¿J‹xÜÊÊþüƒý‰þš™Ž´~þh–bþ‘ÕþøÖغOýÑ’ ‘rÿãð!d@ -" "ÜìäüìÄ99991@B!¡” • •”‘Œ"äôäìîöîÎ90KSX@ ííY6 327# '&546?6764'& ÌäÆÊâ{š‡¼­áøþýÖþç’‘×âz¦<;YZþ¡ä¤LäþÀ-|숋Ð_ppÙ¶Ù+23Ù@@mdÿã¼{'Ï@  !! RE(üäìÔìÄ99991@ †'‰$†‰¹$¹¸Œ(äôìþõîõî90@S !S BKSXí9í9Y"²]@/)?)_))€)) )ð)]@% '$&((*//*( ( ))$††††]@.,,,;;;; q>323267#"&546?>54&#" L´fÎà˜«@«eŒ‚aÆflÃZØ÷¥Ä?”b‰‰Z¨N?¬ž‚•$%PKQY55¾##¶œ‰™*!I@TT((ÿÿÉ‹Õ0þòþV×6@   O ü2ü2ÌÌÔÌ1@‡ ‡— ‡½ üìôìÔ<ì20;#"&5# 54!23%&'&#"3wMc°®½®¾þò/µR5¿þ†!n|wjû=hP™«»®ÒØ`@o›š,0A37þVòž?@ Fü<Äü<Ü29üÌ1@©¼‡‡½/üììô<Ìì2990!!;+53276="&5#53w{þ…Ks½¤´F0j&&Õ§‡‡žþÂý ‰N®ÖÀœ01™ŸÒ`>éÕX@ •@  ÔÔìüä991/ôì2Ä990K° TX½@ÿÀ878Y@@pŸ ]!!##"#546®;ýîË^„vœÀÕªúÕ+Zi1Fµ£7òI@  Fü<Äü<Ä2291@‡— ©¼‡ /ìô<ì299ôì990²¯]!!;#"&5#53546;#"w{þ…Ks½½Õ¢‡‡®½®°cMÃcý ‰NšŸÒ`N»«™QÿúþféÕT@• ½•@@ ÔäüäÄ1ôì2ôì0K° TX½@ÿÀ878Y@@pŸ ]!!;#"&!ïýîn†?NãÍýîÕªû=–ªôÃÿÿ­ÿ÷_&8ûÌä4ÿÿ°ÿãië'Ìî XNÿãÏÊ:@!3   üÄüÄôÄìüÄ1@ • •Œ ôìü<ì2220!! 47!5!3254'5!ÏþÀ¡ŽþþÑþÏþ‘žþÁX²Ç ØØƱXþØÂþËþwŠ>¸*‹²²aþ´ÊïþÝ"ðÊLa²ÉÿávÕ-@   üìÔì/<91@ •ŒôììÄ0%254'&'5!'&'&33ÆØcAn³¡ŽÀ¿þÏMèagÊn†"ðʦmWDþØÂþËÅÄtzðü–ÿüððd@  @ @Ôäüä9Ä9/ì1@ •‘ ¯/ì9ôìÌ990@        BKSXííííY""#3 632#54&×9%þ„ËýðÙžNZ£ˆUUªIGý¿ý9Çýšùˆ\[nƒy6P=þVØ{j@  ÔK° TK°T[X¹ @8YK°TX¹ ÿÀ8YÄÄ9Ôì991@:        B ‡½ ¹¸ ¼ Ääôìôì9990KSXíííííí2Y"@      '$$  )( % $ $ ' 755008 6 6 8 A@@@@@@@@B E G TQQUPPVUVW W U U ffh {‰Š … … ‰ ™ • • ¤ ¤ F]@%     # 5 I O N Z Z j ‡ € “ ]+5326?3 67632#54&#"“N”|“lLT3!þ;Ã^0X‡ƒ¹²Q99) hÈzšH†TNü”À43`¿†rr:T*\ÕÀ@5    B ••• B ÜK° TK° T[X¹ ÿÀ8YÄÔä99ÄÄ91/ìôìÔ<ì20KSXíí<<<323#‰ÁüL:sþ§â_%'ST†_ijxzÔXè"Jhì0ªªª@umHLIwKK!!CÌ12èÂ\RI`1]ÿÁùÕ5@ FüÔììÔÔìÌ1@ •• • ôìÔìÌÔì0 4&#!!!%$ $5& ¹¥ý÷¡ý)s¢Q;-˜ýÄþÐþÛ%†“,ªþ%ÐhþàV)$yòÝhþL?`3@  FüÄìÔÔìÌ1@‡½‡ ‡ ¼ôìÔìüÌ2ì03 4&#!!!32!"'hªÎ–¹¥þŸýŸÝiä¦;-˜þè»Ô§c%†“,ªþ&cÔþàV)$yJXÿ㥞$!"'&'5327674'&+#5333!ªpln‰þíUQQLITNP³c9:VÀ>ååÊçæ}wsªº}#¬(rA…bLr¤þ줺þV¤{@@  Füì22ÔìÌ1@ B‡ Œ¼½ìÄôôÌì0KSX¶‡íÌY#36763254'&#"s¹¹4‡QÒ¸MNüÏr98xÜ­zþÐ ªBR1pq™þWþäù…BAïÉþV“Õ&@ —½Füì1ìì0@ @P`pð]3#ÉÊÊÕøÿÿÉþV'Õ'‚”‚þVœÕ:@ ©© — ½  Ô<<Ì2ü<<Ì21ìì9/<ì2Ü<ì203!!!!#!5!5!5!sÊ_þ¡_þ¡Êþ¡_þ¡_Õý—¨ðªý,Ôªð¨ÿÿɔՔÿÿÉ Ðm'?±'ÿÿÉ °f'@Õ'ÿÿqÿã‘f'@¶GÿÿÉþf$Õ'-‘/ÿÿÉþVÞ'Me/ÿÿÁþVï'MvOÿÿÉþfòÕ'-_1ÿÿÉþV·'M>1ÿÿºþVÞ'MeQÿÿhm&$;u±<1ÿÿ{ÿã-f&D‰Z´ +'+1ÿÿÿþ`m&,Í/u ´ Ic:1ÿÿÿà^f&ó‰ÿ ´ Ic:1ÿÿsÿãÙm&2Í'uÿÿqÿãuf&R‰v± <1ÿÿ²ÿã)m&8Íöu±<1ÿÿ®ÿãXf&X‰v ´ Ic:1ÿÿ²ÿã)3&û08ÿÿ®ÿãX1'q{;¾ÿÿ²ÿã)Z&8þ6ÿÿ®ÿãX"&Xþÿ¾þÈÿÿ²ÿã)Z&80ÿÿ®ÿãX"&XÿÄþÈÿÿ²ÿã)`&8ÿ0ÿÿ®ÿãX"&Xÿÿ¾þÈÿÿqÿã{ÿÿh3&$ûÿÿ{ÿã-1&¦qR;ÿÿh3&$ýÿÿ{ÿã-ô&Dýÿ“þÁÿÿH4'q×>ˆÿÿ{ÿãoò'qèÿü¨sÿãð%T@!$"43 &üìü<ÌäüÄÄ1@"#•%•¡®•‘Œ&äôìôìþÔî99ܰ KTX±"@8Y<Ì203## !2.# !2675#535!5‹yyuþæ þ¢þu‹^’opü‹þîþík¨Cýýþ¶ þÖXÿSU™mn™HF×_`þÎþÑþÒþÎ%'µX„¦qþVú{ 4X@"2% G,E5üÄìôì22ÄÄ1@ #% ) †¹¹2/¸3¼ ¹½&)/ÄäìäôÄìþÕî99Ô<Ì20¶`6€6 6]4&#"3263#!"&'532767!5!6=#"3253¢¥•”¥¥”•¥¸³Æ:þúa¬QQžRµZý„š9²|ÎüüÎ|²9¸=ÈÜÜÈÇÜÜënXF]@Œ³,*_EG^[cb::bcªÿÿsÿã‹m&*ÍJu±!<@”!T!$!]1ÿÿqþVZc&‰JýJÿÿÉjm'Í¢u.ÿÿÿéœm&NÍu*´ +1K°QX»ÿÀÿÀ88Y@ €€@@]ÿÿsþeÙð'4ÿð2ÿÿqþeu{'€ÿðRÿÿsþeÙ1'q';¬ÿÿqþeuõ&qsÿ­ÿÿ ÿÁøm';uyÿÿXþL/f&‰TÿÿÿÛþVdf'‰ÿ%ù ´ Ic:1ÿÿÉ ÐÕ'=±'ÿÿÉ °Õ']Õ'ÿÿqÿã‘']¶Gÿÿsÿã‹l'Év*ÿÿqþVZc&JvýÉÿã-Õ5@8üì2üì2Ôì1@•­ •Œ/äìä2üìÄ03!327653! '&5!#ÉÊÞÊ>=™”B>Êd`þæþígdý"ÊÕýœdûìŸPNOK¤ŸýZ߀xxvé ý9ÉþVð@@  üì22ÔìÌ1@ B• Œ½ìÄôôÌì0KSX¶‡íÌY%#3676324'&#"“ÊÊ8‘WâÆSTü‘¡=<íºœýº¹HW5xz¤þ7þή GFþÿÿÿÉ3k'Ëu1ÿÿºdd&QCÿþÿÿhs&‡É\}ÿÿ{ÿãÜs&§Éì}ÿÿHl'É\vˆÿÿ{ÿãoc&¨veÿýÿÿfÿºål'ÉþvšÿÿHÿ¢œc&ºvýÿÿhp&$Òåzÿÿ{ÿã-d'À˜ÿþDÿÿh6&$μ>ÿÿ{ÿã-H'ÂeDÿÿÉ‹p&(Ò¥zÿÿqÿãc'ÀºÿýHÿÿÉ‹6&(Φ>ÿÿqÿãH'©Hÿÿÿ§sp&,ÒYzÿÿÿÃc'Àfÿýóÿÿw6&,Î>>ÿÿÿãUH'Â$óÿÿsÿãÙp&2ÒAzÿÿqÿãud'ÀŸÿþRÿÿsÿãÙ6&2Î>ÿÿqÿãuH'˜RÿÿÇTp&5Òyzÿÿ‚Jc'À%ÿýUÿÿÉT6&5΀>ÿÿº^H'Â-Uÿÿ²ÿã)p&8Òzÿÿ®ÿãXd'ÀÔÿþXÿÿ²ÿã)6&8Îì>ÿÿ®ÿãXH'«Xÿÿ‡þ¢ð'×v6ÿÿoþÇ{'×,VÿÿÿúþéÕ'×S7ÿÿ7þòž'×WœþRsð16767654&#"5767654'&"567632œÇÂ¥~b’[?FðøŽjOQ_ciqYxw`eÀ„†GRxŠQY–‚þÐÚµþò@XKy^Žq†j«j=vX{5?:.P¾B*8hi²ªcqMmwqÚŽ{\(GþO¼{36767654'&#"5767654'&#"0567632G²°”rXBAR9?Øß|cGIN`\hOm`bs[«yx@Il|IP‡xþñÄ£þÑ3H2#Pš™³×ÊÊQÌãéÉ×ÕÿÞü²Õñ‡†þÁþÌúÙqÿpD(4%3254'"632!"'#67&5#"'&76323 76'& ¶% 44ÊnˆôþªI5"ÄC0:XY|Ë€€Ë|YX:¸üÕST$TTTTþÜT‚¯- ¸Îþ¿H:E“<$d01¢¢¢¢10d^üæþjtsst–tssqÿã%ð ;W@$3=E (B!8;7B/E<üìôì̲ ;]ôìÌôìì91@$3•­< ;‘<,Œ<ôìôÌÔÌôì990" 7654&327654'&'52 '&54767&'&5476!˸jkkjpkkÔô‚ª_;̨_`Lm‚ä–‹ª˜¬_`œ›ýº›œ`a««CU‚tÅMMþòMMMN†‡š'|OEH-AAˆž+Mdhaº€² "ccÙttttÙcc"FYX‚SJqÿãq 4C@6E B42()+&BE5üìôìÌ2ÔìÌ2ôìì1@4)"¹.­5¹Œ5ôìôì99Ì20" 7654'& '&5467&'&5473327654'qSRRS SSSRþ:4H‚’RQ…„þ„…¤’;4?¡+IHƒ‚IJ,ÅMMþòMMMN†‡MMJ@b™@Y "ccÙttttÙÆ"#VKŽYIAèAAAAtw>\þVÕŸ@ B  ÜK° TK° T[X¹ ÿÀ8YÄÄÔìä991@ B• •• /ìôìÜì0KSX@ ííY@@ )&8HGH  /59?GJOUYfiowxŸ]]+53276=!5!5!!žHrþéi&&ûõ°üg•üPÇþßP%œ01™š‘ªšûoXþVÛ`¬@   ÜK° TK° T[X¹ ÿÀ8YK°TX¹ @8YÄÄ´@`]Ä99Ô´@`]ì1@ B© ©¼© /ìôìÜì0KSX@ ííY@2&GI + 690EIWY_fh€¯]]+53276=!5!5!!ÛžHrþéi&&ý5´ýejýL´þßP%œ01™¨%“¨üÛÿÿhP&$›Ä@ÿÿ{ÿã-&D›_ÿÿÉþu‹Õ&(z¢ÿÿqþu{&Hz{ÿÿsÿãÙ3&2ûbÿÿqÿãu1&¸qs;ÿÿsÿãÙ3&2iÿÿqÿãué&Rÿµþ¶ÿÿsÿãÙO'Ð't2ÿÿqÿãu&›sRÿÿsÿãÙ3&2ýjÿÿqÿãu1&ñqs;ÿÿÿüç1'qr;<ÿÿ=þVõ&q^ÿ\Šÿp\%3254'"632!"'#67&73Î% 44ÊnˆôþªI5"ÄC1¸‚¯- ¸Îþ¿H:E“þÂÿÛþVy` 8@ ‡½¼  OF üìä991äôì990@  @ P ` p ]3+53265Á¸£µF1iL`ûŒÖÀœa™qÿ㌠#/A@1E%G +G!E0üìô<<ü<<ôìì1@(¹ .¹Œ ¸ —/ìä2ô2ì2ì20 6& 23632#"'#5#"'&76'&  7/ST$¨¨þÜT¹õr¹rôÌÿÿÌôr¹rõË€€]STþÜTSST$Túþjtsç–çs Å^ý¢Åþ¼ýðþ¼Å¨¨Å¢¢¢¢üé–tsstþjtssqþVŒ{ %/D@1E$G+G'E0üìô<<ü<<ôìì1@ *¹.¹!¸ Œ½¼0äää2ô<ì2ì20'&  7"'##"'&763253632 6& ÍSTþÜTSST$T¹ôr¹rõË€€Ëõr¹rôÌÿÿú¢ST$¨¨þÜTd–tsstþjtssþóÅý®RÅ¢¢¢¢ÅªªÅþ¼ýðþ¼þjtsç–çsÿýÿº|3 #!#'#7'7 3!Jå†afþp|ÒˆýÖÍ2F;R/þîo½]jÕþ¡¡Yþ'üñŽFF8Äý±þO ÿºŠ",'&76!27&'!2767# '#&# rfÜuÃÃS†v=:efc.1üô ˆ‚tsfjwv„þ´Â9Øt‚ÿˆˆFX»hÏÐ$xYv»+!üf //_ÓH$$Ç\/œþØ­ ÿ¢]¼"+'7&576!27&'32767#"'&#"i`½U—–UQ.-Y_výÓc³PNONMRS]ð“7îGG³cc^NæÌ lOU ý^q+ª$VqrÍg jÕ ;@  • •: ü<Ììü<Ì1/äìÔ<ì20@ 0P€€]33#!!#53ÉÊ¿¿×ü_¿¿Õýwýÿ²ÿº1##'!5!7 !é4þ"Ëþ gZýî™8fý¦,þÔi>ýÌý ý³XÇRªBYþ boþ{=4'&/&'&54632.#"3#"'&/&'&'&'53276 23«@«LLàÎf´LN¨Z‰DE11”?ÆPS{W„Ÿ“*L'TrGYí$alfcca‚FF'K((%$JK‚ž¬®((**T@%$!,KL‰œ[@Ÿ~$š=&[ó#¾5-,Xþ3`!;#"'&/&+=!qjýN\1“*Ll“TrGYí=Z^´ýe`¨üÝ1þø~$š=&[ó?œ %PÕ6@ ÔÔìÔì9991@ •• •/ôìÔìÔì0##32654&+"56;2‘'ÊñššþE¯O˜«þôþ÷Zý¦‘‡ˆ*,¶FÜá×çP{7@   ÔÔìÔì991@ ¹ † ˆ¹¸/ôìôîÔì032654'&#"5632##/dšLU†IVVN˜«û}„ÔÂʦ‘‡AH+¶FntÛÕåþü ìÕ (\@ #  . &%)ü<Ìì22ÌüìÔì9991@(•%• ••­#/ììôìî99/<ì20²*]!!!2654&#!2654&#%!2#!#53“[þ¥D££þ¼+”‘‘”þ çú€|•¥þðûýè¿¿ÉÉʇ‹Œ…fþ>orqp¦À±‰¢ ˘ÈÚp ÿãÎÕ_@ 8AüK°TX¹ÿÀ8Y<Ìì2ü<Ìì21@ • • Œä2ôì9/<<ì2299990¶Ÿ]3!33#! 5#53!3265²ËáË¥¥þßþæþåþߦ¦¬ý®Ã®Õý–jý–¤–þÜþÖ*$–¤¤}ðÓÓðÿÿhÕ)ÉÿB‹“33#!!!!#7#!#!¸ªAX’— þ¼¹.ý˜AªA°®þ<¹Ù—þV“¾ªþFªý㪾¾ÕúÕýãǺþFqÿB&-1&'&'!3267#"'#&'&3273&#"#ÇSošþ+”JajÇbcÐk{cPªm!)ü81Gª\9/ƒý¼‡š¹ZoÏ ”—Z þò6Zþ—44®*,! œ C ¬à"2’ÅJ®žþc¬ÿ–þfRÕY@   ••° 9 üK°TX¹@8Y<ì2ä99ÄÄ1äüìÔ<ì2990@ 0@P`Ÿ]#+53265#5333R¿ÍãM?†n¿¿Ê¿wýñþòôª–¦¸ýHÿÛþVS@$¾± ‡ ½©¼  OFü<<ì22ä991äÜ<ä2ôì99ôì0@ @P`p]33#+53265#533#Á¸£££µF1iLµµ¸¸`þ¤þ(ÖÀœa™ؤ¬ésþf°ñ$C@$ • °%"•• Œ‘¯%  %üìÔì22Ì991ìäôÄìÄîäì99053;#"&5# !232#"³Än†EMãÍMì¥þòþ¬T¥ìüßêÌÍëëÍÌêíèú“–ªô„€«\\«€ýxþãþ»EEþ»qþV@{$H@"‡½%"¹¹Œ¸¼%G E%üìôì22Ì991ìäôÄìÄîôì0¶`&€& &]#"&=#"3253;32654&#"@Fµ£:±|ËÿÿË|±:¸Li1ûï§’’¨¨’’§þVÀÖ¼daDDadªûŒ™a=ËççËËçç TÕ »@  ?  !ü<Ìì2üÄì99991@!  B• • /<ôìÔ2ì29990KSXíí9Y"²@"]@Bz%%%&'&&& "66FFhuuwˆˆ˜˜]]#.+##53! 32654&#A{>ÍÙ¿J‹xÜÊ¿¿Èüƒý‰þ’••’¼~þh–bý‰w¦¸ÖغOýƒ…J{=@ Fü<ÄÄü<<1@ ‡¸© ¼/äÔ<ì2ôìÄÔÌ0´PŸ]###533>32.#"«¹¬¬¹:º….I,œ§h¤þ<Ĥø®fc½ΡÿöìÕ3!733!#!53!Ù— –Ù—œþõþöËþöþôwþјÕààà¤þvý9ÇФ¤â þVµ`+5326?!533!33!+“N”|“lLT3!ÍþÖð¾Ã¸L¸Ã¹ïþ×ÁÚmhÈzšH†TòÍþ3Íþ3þð®ÿã`{ ,¸@ .% F-üì22ÔìÌÄ991@©¹¸-&†%º"¹*Œ¼-äôìüìôìÄÔä¶%  9990@1?$?%?&?'O$O%O&O'_$_%_&_'o$o%o&o'$%&'$%&']@+?#?$?%?&?'?(?)O#O$O%O&O'O(O)_#_$_%_&_'_(_)]2654'&#"367632#!3267#"&߬A@o™\]¸¸?^^ˆ¬fe~ûþþST—`¶Te__Zóð+f{b:9ml´)Lªf01a`¢½``FE..ª'üqÿãZ{8@¹¹Œ¸¼G Eüìôì221/ìäôÄìÄî0¶`€ ]53#5#"3232654&#"¢¸¸:±|ËÿÿË|±ýǧ’’¨¨’’§¶ªû ¨daDDaþËççËËççºÿã£{ 8@¹  ¹Œ¸¼G Füì22ôì1/ìäôÄìÆî0¶`€ ]4&#"326>32#"&'#3å§’’¨¨’’§ý:±|ËÿÿË|±:¸¸/ËççËËççRdaþ¼þøþøþ¼adª`ºÿ㤠$C@¹  ¹Œ¸!©—G! F%üì22Ä99ôì1/üìäôÄìÆî0¶`&€& &]4&#"326>32#"&'#46;#"å§’’§§’’§ýŽ:±{ÌÿÿÌ{±:¹³¥þéZ[/ËççËËççRdaþ¼þøþøþ¼ad¨~ÃÓœ}}ÿãõ{ 0@ †ˆ¹¸!†ˆ¹ Œ!"EH!Ü<ôìì1ôìôìôìôì06763 #"'&'5327654'&#"LQQU–—þÖý]SRMNONP³cccc³PNON5#þîþòþÂ$ª+qrÍÍrq+qÿsç{'/O@( ,,H"E0üä2ìì991@†ˆ¹.*¹¹%¸Œ0äÌôìüÜìõî0@ 11€11 1].#"67632#"'#47&'&!23254#"çNP³Æc'>Ij£J?_S›PI™ 9/•-U¢þŠ:M’„e5¬++ãÍÍrQ,3H=Y}/)9DhQ#3¡ :#ü:9KqþV@$K@$©½%"¹¹Œ¸—%OG E%üìôì22ä1ìäôÄìÄîüì990¶`€ ]#"&=#"323;32654&#"@Fµ£:±|ËÿÿË|±:¸Li1ûï§’’¨¨’’§þVÀÖ¼daDDad^ùØ™a=ËççËËççqÿã¹$=@"¹¹ Œ¸%©—%  GE%üìôì221üääôÄìÄî0¶`€ ]546;#"#5#"3232654&#"¢£µ¿ªiL¸:±|ËÿÿË|±ýǧ’’¨¨’’§¶ÈÖÀœa™û‚¨daDDaþËççËËççqÿã{"r@ KE#üÄìôì91@†ˆ©¹ »¹¸ Œ#äôìäììôì90@)?$p$ $Ð$ð$?????,//,ooooo ]q]47632!"&'532767!7&'&#"qƒ„âü”•œþôkÐcbdcj·fg ü²¸]\šˆRS^ú’‘¡¢þíþöœœ,*®4cd¾žWWZZqÿã{A@$ †ˆ©¹»¹ ¸ŒKEüÄìôì91äôìäîîôî905!.#"5>3 #"73267qN Í·jÇbcÐk 9þ×üâþù¸¥ˆš¹Z¾Ç44®*,þÈþöþíþ½#Ä—´®ž|ÿã„{ 4w@6.('4 KE5üÄìüìÜ<üÜĶ&  91@/©.'"¹"¸5 ¹Œ5ôìôìÔÜì´†ˆôì@  &"90@ 4 &'<<ü<<<%6'6'32#"'&'&'&5>3 73;#"'&5Nf ý— Rˆ¨`•”üä‚\þLÑladbcÐk œ$˸&&i+@¯WRÖŠÏ>8þœE#Z`vþí¢¡‘gœ»'#d4®*,œ#)u”™10œ`ZÈÿÿ…ÿãÈ|Bÿÿ…ÿãÈ|Ã…ÿã*|>i@@603273;#"'&5Â|ŠþþîPUTZGUU]—UTNH‰”›tCDFEwGQPabªLÄq_ì¸&&i+@¯WRþà@\’l­¶«%88ZX83˜,-F@.. §NBj†”™10œ`ZȦFqÿãÅ|/;@ 1 &,E0üìÔìÄÄÔì1@¹¸0©0¹)Œ0ôìÔìôì²#90"327654'&+5327654'&'2# 76ñû`cchÒ—UTNH‰”›tCDFEhÄqr<žÿÛþV`K@ ‡ ½©¼  OFü<<ì22ä991äÜ<ä2ôì990@ @P`p]33#+53265#53Á¸£££µF1iLµµ`þ¤þ(ÖÀœa™ؤqþV¸ 0U@)  †¹¹&#¸-©*— ¹½*-+& G E1üÄìôì22Ä991/ÄäìôìôÄìþÕî990¶`2€2 2]4&#"326!"&'5326=#"32546;#"¢¥•”¥¥”•¥¸þþúa¬QQžRµ´9²|ÎüüÎ|²9£µ¾©iL=ÈÜÜÈÇÜÜëþâþé³,*½¿[cb::bcÈÖÀœa™qþVZ` #C@ †¹¹#¼¹½ GE$üÄìôì21/ÄäìôìþÕî990¶`%€% %]!"326!"&'5326=#"43!¢þª‡–¥”•¥¸þþúa¬QQžRµ´9²|ÎüüÎ=ˆÍ»ÇÜÜëþâþé³,*½¿[cb:ù*qÿãO{8@©¹†ˆ¹¸Œ4 EüìÜäüÄ1äôìôìþÔî990%#5!#"!2.#"326©›Ae×{ýþÖ-hÅ]_Àc³ÆÆ³O|žŒýð$$>:77ª>>ãÍÍã`þRd`#y@ %  $ÔÔìÔìÔĵ 91@ ¹ ½¼$ä222ôì³  990´ì³<´ìµ<<³<³< 3#"&54767327654'&'bBÀþ_j&;––––;&jþ_ÀBC(::(èxüܱS€c‚‚c€S±$úŽ-EIdccdIE-`ÿãd`#y@ %  $ÔÔìÔìÔĵ 91@ ¹ Œ¼$ä222ôì³  990´ì³<´ìµ<<³<³< 3#"&54767327654'&'b)ÙþrG,E––––E,GþrÙ)C'88'ÑýêbLx>‚‚>xLbü-!@2FF2@!-®þVX`9@ ‡Œ ¼ ½  NFüìôì21ää2ôÄì90´`Ï]332653##"&®¸||•­¸¸C±uÁȺ¦ýaŸŸ¾¤{ùöVfcðºdC@! ‡¸ ©— N  Füì2Ä99ôì1/<üì99ôÄì90²`]#4&#"#46;#">32d¸||•¬¹£µþçiMB³uÁƤý\žŸž¾¤ý‡~ÖÀœa™ÌedïºþVd!J@%  ‡¸"©—‡ NF"üì2Ä99ôìÄ1/Üìüì99ôÄì90²`#]+53265#"#46;#"632d£µþéiLø•¬¹£µþçiMƒçÁƤýHÖÀœa™²=¾¤ý‡~ÖÀœa™ÌÉï >@¾ ± ©¼  Fü<<<ì2221/äÜ<ì2üì0@ @P`p]33###533#¸¤¤¸´´¸¸`þ¤þ<Ĥ¬éÿÿ¦n`Ft„` '@   Üì2üì21@  ©¼ ©/ì2üì205!#3!53t¨¨ý𰼤¤ü褤Kß#<@ % V V$ÜüÜ<ü<ÜüÔ1@#!à !×/ä/ì2Ô<ì903327673#"'#&'&#"#67632=¸ &}33[¸ &}33[üí %$R‡IJý… %$R‡IJLT5@  ÜÜÔ<2ü<ÜÄ1@¹ ©—/ä9/<ì2ÔìÄ033##4'# 7632&#"3¢¸úú¸=þèõ5*7M\üþ ýŽT½öú„K9ÁþV_ (@  F üüÔÄ1@  — ‡½ ôìä990;#"&5y=x1F¿™ùÎ|tœÌÊ(ÁþL6$²@#&#" F%üü<ÔÄÔÄì̲#91@B©"©"† “¹ ½"¼ —/ääüìôìì9/ìì³ 990@$#ìì@  **8;ILT[q ]@$$%$$5$7E$FT$\ ]@    ]2!"'&'5327654'&+5!#3!CicUQþÐþè^cdjTÈm¾cd\[§®®ýj¸¸eÜ8+lhŠÝò%Ã12KK„KJ¦óü3þL¨ºÿæb&^@PP F'üìüüüü<91@  ‡#Œ'¼'ô<<ô<Äì290@0(P(p(( ( (¿(ß(ÿ( ]%#"&5332765332653#5#"'&®Cb`‚¯¾¹ruSS¹rw¦¹¹=ZXyzVUØy=<öâ¤ýb¢œ`^¤zýb¢œÀ¢zûž°e32>>ºþVb&a@PP F'üìüüüü<91@  ‡#Œ'¼½'ìô<<ô<Äì290@0(P(p(( ( (¿(ß(ÿ( ]%#"&5332765332653##"'&®Cb`‚¯¾¹ruSS¹rw¦¹¹=ZXyzVUØy=<öâ¤ýb¢œ`^¤zýb¢œÀ¢zùôZe32>>ºþV{0c@PP)%'F1üì2üüüì9Ì1@‡ %*!‡*-¸(¼&/<äô<Äì29Ôì0@02P2p22 2 2¿2ß2ÿ2 ]>32+5327654&#"#4'&#"#3>32)EÀ‚¯__RQµþéi&&ru¦¹99wSS¹¹?°yzUV‰|v{zâýHÖ``œ01™²¡œ¾¤ý‡ž¢NM_`£ý‡`®gb>>ÿÛþVk{Q@N O Füì2ä99ôì1@ ‡¸¼/äôÄì9@  ‡ ½ôì990´`Ï]#4&#"+532653>32k¸||•­£µF1iL¹B³uÁƤý\žŸž¾¤ýsÖÀœa™t®edïºþVJ{;@ N  Füì2ôìÜÄ1@ ‡¸ ¼ ©½ /üìäôÄìµ  90&54&#"#3>32;#"þR||•¬¹¹B³uÁÆ&&i1Fµþ¶`Ö²Ÿž¾¤ý‡`®edïèýH™10œ³d` y@B¼NF üìüì991/<ì2990KSXííY"² ]@068HGif€ FIWXeiy…Š•šŸ ]]!3!#³ÝÄþðþ#Ä`üy‡û lü”qÿãu{ ,@© ¹¹¸Œ Q Eüì2ôì21äôìîÜì0"!.265!2#"q“•t•’•¨ý†¨–ðþîðñþïßÁÁü è””èüþÈþìþíþÇ98q$`I@  EüìÔì2ÔÄÄij 991@ ©¼ © /ü<ôü<@© 9Ð/ì0!!!!! '&76!#";ýÔýë:üáþ»§¨¨§E*%ðxxxxð%`šþÝ›þ”œŽŽ‚lkØÙlm”ÿÜ>|$2@ &E E%üìÔüÔìì1@ ‡‡#Œ¸%äô<ì2ìÄ02765 26= "&'"&H`k&IÐþnÊI&k`þB"F:.a×¢ Öהģµ0[1þÐþð[0µ£ÄÈT\þ¤þ€l²6p£uyŸíÿÿpþVÑaÿå`/@   /Üì2991@ ‡Œ ¼ /ìôìÄÔÌ90%!"/32653#×rþù%832JI,œ§¹¹:º….´˾ü ®fcºþVJ{:@ ‡ ½‡¸¼ FüÄì2Ä1äôìÄÔÌôì90´PŸ].#";#"&53>32JI,§Liéþµ£¹:º….´˾ýž™aœÀÖt®fc„~{%@ ÜÌì2Ì1@  ‡ ¼‡/ì2üì9903!5346;#"à¤þ¤£µþéiLåý¿¤¤AÖÀœat~{%@ ÜÌÌüÌ1@  ‡ ¼‡/ì2üì9903!534&+532Ê´ýð¤Liéþµ£åý¿¤¤A™aœÀº—`°@4  B© © ¼     Füì2ÜÄì99991/<ôìÔì9990KSXíí9Y"²@]@Bz%%%&'&&& 66FFhuuwˆˆ˜˜]]#.+#!232654&#0s2®Ã¢J{Q©¹„ÚÖpýõÆwu t]þ΀:þ'`ž¥iŒþ¯VNM`º—`E@  Füì2ÜÄì99991@  ©©¼/ä2ìÔì9990332673#!32654&#º¹©Q{J¢Ã®2s0jpÖÚþ|¹Æuw`þ':€þÎ]t Œi¥žìþ¯`MNVoþVÇ{0€@C  S('  S'('B©½1 '(†‰‰!¹¹.¸Œ1' ($R$+E1üÄìÔìä9999ìÌ1äôìþõõî9üì0KSXí9í9Y"²0].#"#"/;#"&=32654&/.54632‹N¨Z‰‰b”?Ä¥÷ØdXLiéþµ£ÌÁ‚Œe«@«˜àÎf´?®((TT@I!*™‰œ¶ ™aœÀÖûjYQKP%$•‚ž¬ÿÙþV×4@ O Fü<ì22ä991@ ‡½ ‡—üì99ôì046;#"+5326¾®½®°cM£µF1iK»«™Phû)ÖÀœaÿÙþV× O@ !O F!ü<<ì22ä99Ì2Ä1@©¼! ©‡½! ‡—!üì99ôìÔ<ì2ôì0546;#"3#+53265#53#5¾®½®°cM¢££µF1iK´´¯`N»«™Phý¨¤þ(ÖÀœa™ؤi7þV5e"¶O ÔÜüì1@ ‡½‡¼ôìôì04&+532;#"&—Mc°®½®Ki1Fµ£(hP™«»üí™aœÀþòþV×2@   O ü2ü2ÌÌÔÌ1@ ‡‡— /<ôìì2ÔÌ0!3## 54!346;#"#"3276w·¿5RµþѾ®½®°cMów|n!›o@`ØÒ®»«™Phú£3A07þÀò^3@   /<Ô<ì2991@ © ¼©/<ì2ôìÄ990²¯]!5!4&+5323#²þ…{Ks½½Õ¢‡‡þÀ>`‰NšŸÒý þÂ7þVöž=@©¼‡ ½  Fü<Äü<Ä2991üìô<Äì2990²¯]!!;#"&5#53w{þ…LiÊൣ‡‡žþÂü™aœÀÖå>ÿã`C@ ‡©  Œ¼  NFüì2ôì221/ä2ôÄÜ22ì22ü0´` Ï ]3!33##5#"&=#5!326®¸:¸ºº¸C±uÁÈ®ŸýÇ||²høþøþ¤þ<¬fcðç ¤¥ŸŸºqÿâ„`S@ !  üÄüÄÔÄÌüÄ1@ ©¼ ¹Œ ôìü<ì2220@ààïïÐÐßß@@OO ]##"5467#5!32654&'7!„ìaþäááþäaíºfˆ°°ˆf´¼Hë˜ëþÜ$ë˜ëH¤ÜB׋ŸÂŸ‹×BÜÁ\b,@   FüüÄÄÄÔì91@ ¹¹¸ ¼/ìôìì0+"'&53732654'&'5\Ž‘ÞFµRQ¸&(g3°JInhX§3"î’``ÖÊý6™12Äžèec–0[«s=`h@'B¿ÔK° TX¹@8YK°TK°T[X¹ÿÀ8YÄ91/ì290KSXííííY"33# =¤ú¤Ãþ¢þ¢`û ¬üTV5` ï@   ÔK° TK°T[K°T[K°T[K° T[X¹@8YK° TK° T[K°T[X¹ÿÀ8YÌ91@  ¿/<<ì290@0U U U U   BKSXííííííííY"@ÿ - : FFI O TTZ _ aai vpvpˆ–—› ³³ÁÈÀ       %%#'!%""% ' $ ! #966 90FHF@B@@@ D D D @@VVVPQRRP S T U cdejejjjn a gouuy}x}zzx y  { v }‡ˆ——”“œ›˜˜™ @/–Ÿ¦¦¤¤««©©« ¤¯µ±½»¸ ¿ÄÃÌÊy]]!# # #335¸æåÙæå¸%ÙñòÙjü–jü–`üj–=F´ÔÔÄÄ1µ©—/<ôì0· ü<<<¶  9@   ìì3676;#"# =ìPHJ|“lL*./!ÅÃþ¡þ£ÒÇ>=š$#‡^û²lü”fk`8@   ÔÜüÔÄ91³¼/ä20@ ììì3 3#fÙ%.Ùþ]Ë`þ8ÈýþðXþV¿`ª@"B © ½©¼© OÜK° TK° T[X¹ÿÀ8YK°TX¹@8YÄ2Ä99ì1/ìôìüì0KSXííY"@B&GI + 690@@E@@CWY_``f``b€¯]]!!;#"&=!5!qjýL´Li/Fµ£ý7´ýe`¨üÛ§™aœÀÖ¨%Xÿ‘Û`!±@  "ÜKTK° T[X¹ÿÀ8YK°TX¹@8YÄ2Ä99ìÜ<ì21@ ©¼¹ ©/ü<ÜìÌôì0@ BKSXííY"@:&GI #+ #690#@@ECWY_#``fb#€#¯#]]!367632+#47!5!3254qjýL¯"TA`„:&>R~i™þ–´ýeÿ8ŠFX`¨üÛ¢G7W9W`/=3<;4¨%üÆ6]XþL/` ©@ "!ÜÔÄÔÄì̲91@B©!©† “¹ ½¼!äüìôìì9/ìì³ 990@ ìì@  **8;ILT[q ]@  %$ 5 7E FT \ ]@    ]2!"'&'5327654'&+5!5!`¾qÿãÅ|/=@1 %,%E0üìÔìÄÔìÄ1@¹¸0 © 0¹"Œ0ôìÔìôì²( 90";#"327654'&% !"$5467&'&5476EwEFDCt›”‰HNTU—Òhcc`þöa——þÖþÆîþþŠ|p<:!ÖÀœa™þå>>ãÍÍãÿÿº`ÉþòþV.9@ Fü<ü<ÜÄÜì991@  ½¼± /<Ì2ääüÄ03#33## 54!3#"3276Á¸¸¸µ½7K¼þÑÁ¸u_+éËû ‹xG`ÝÍ‹BA0 ºþLœ` ## 33œ¹ýÛëRý•ð9¹þL—þ TýÝ#ºñ`@ ¿©FüüÌÄ1/ìì03!!º¸üÉ`ü3“qþVø $C@¹  ¹¸Œ#½%‡—% "GE%üìôì221üìääôÄìÆî0@ `&€& &à&]32654&#"#"32546;#"#/§’’¨¨’’§s:±|ËÿÿË|±:£µþçiM¹/ËççËËççý®daDDadÆÖÀœa™ùÚX¥$L@ & %ÜÜ<ü<Üìij#ÌÌ1@ † $©! ¹—©/ÔäôìÜ<ì2KPXÜÔYì032765&'&#"56763 3###53T?ÀV:9c³PONNLQQUŠmlpªççÊåärLb…Ar+¬#}ºªswÔ¤þì¤X¥$M@ &"#E%üìÜ<ü<Üij "#ÌÌ1@† ©$!#¹ —#©#/ÔäôìÜ<ì2KPXÜÔYì0535&'&5476!2&'&#";3##÷çªpln‰UQQLNONP³c9:VÀ>ååʤÔwsªº}#¬+rA…bLrþš¤þìqÿãà &) 76'& %3!!!+5#"'&7632/ST$TTTTþÜT ¸iýL´ü—ž:XY|Ë€€Ë|YXòšúþjtsst–tssH^þL¨üÛ“¨d01¢¢¢¢10MüùqþL4@#5#"'&76323!2!"'&'5327654'&+5 76'& Z¸:XY|Ë€€Ë|YX:¸jþej€bVQþÐþè^cdjTÈm¾cd\]¥®®ú:ST$TTTTþÜTÍü3¨d01¢¢¢¢10d^þL¨þ$8*mhŠÝò%Ã12KK„KJ¦óÓþjtsst–tssqÿ‘ 3: 76'& %%!332!##47!#5#"'&763233254#/ST$TTTTþÜTØ™ýghýL¯<Ûãþ²)™þ–:XY|Ë€€Ë|YX:¸ý®FXúþjtsst–tss_üú“¨üÛ ö½3<;4¨d01¢¢¢¢10d^ú6[7ÿã@žF.#"#"'&'#"'&5#533!!;5327654'&/&'&54632N¨Z‰ED11”?ÆQR|{ØZa]g½ÕQQ‡‡¹{þ…%&s³fcca‚FF3,±@«LLàÎf´?®((**T@%$!,KL‰œ[[!&POÒ`>þÂý ‰''M5-,QK($)$JK‚ž¬7þV&/!05476;#"+53276=#"'&5#53!3wxWQî°c&'QRµF1i&&½ÕQQ‡‡3þˆ%&sžþÂNµ[V™((hû)Ö``œ01™POÒ`>úü¢•ý ‰''7ÿpÉž-9D!6!2&'&#"63 #"'47!"'&5#533276'&#"&57!3w{•ÿUQQLNONP³cccOÎ+eKTI™þëÕQQ‡‡;BS_ƒr(þÖ€‹þ™%&sžþÂz•#¬+qrþfr «öv)2LOAPOÒ`>úù 'KV ø›ý ‰''/þVo5+5327654&#"#!##535476;#"!;67632oRQµþéi&&||•¬¹þÓ¹°°WW½®°c'&-·BYZuÁcc¤ýHÖ``œ01™²Ÿž¾¤ý‡Ñü/ÑN»UV™((hc®e22wxÁÿãÉ#5.#"#"'&'#34632327654'&/&'&N¨Z‰DE11”?ÆPS{|ØZb]h¸¸àÎf´ý8b_ca‚FF2-±@«LL?®((**T@%$!,KL‰œ[[!&ý¬þÔý²2-,QK($)$JKÁâ Ž@   Füü<ÔÄ2991@ B ©¼©—/ììôì0KSX@  ííY@B &GI   + 09 @@@@@C EWY `````b f¯¿ß]]3!!!+Á¸iýL´ü—ž¸šþL¨üÛ“Íüù6ÿâé 333# #333# #6t‘‰‘t¹ˆ˜™ˆ¹t‘‰‘t¹ˆ˜™ˆUþéþéýýþ=þéþéýýþ6­é3@    Ü<ì2Ô<ì2Ä1@  ©©ÔüÌ2ÔüÌ20!#!#!#!#6³ýk³ýkUþXþûrþXþûþJ3@ NF Ôüìôì2Ì1@‡Œ ‡ —¼½ììôìôÌì0%#"&54&+53232653#׃çÁÆLi1Fµ£ø•¬¹¹¬ÉïèÄ™aœÀÖýBþþ¤yùìþVv!:@ #NF "Ôüìôì2ÌÌ1@‡Œ" ‡ —"‡½¼"ìüìôìôÌì0%#"&54&+53232653;#"&'׃çÁÆLi1Fµ£ø•¬¹Ph2F¶ž¬ÉïèÄ™aœÀÖýBþþ¤yûŽ”fœ¹ÝuœÄ0@ ÔÜ32ÄtNN^luu)qJy}þ…wYYk\þžgþ«88†uœÄ:K°SX@ ÔÜ<Ì/ÌÌK° QX±@8Y1²]@ Ô<ÔÌÔÌ0Y#4&#"#46;#">32ÄtNN^lugr ’B0)qJy}þ…wYYk\þž„xkW6Vr88†ÿé­î #@Ü<ÌÜ<Ì1@ÔÔÌÜÌ03+5327653#zt43r,Bttý‚x66XVr‚uœ@ ÜÌÌ1@ /ÄÔÌÔÌ0.#"#3>32.biuu$uT ¯ qkþ¶sa97Hä´ ÜÜ<Ì1µ /ÌÔÌÔÌ032653#5#"&'H.bitt$uT ü qkJýa97H­u'¶ ÜÜ<ÜÜ1@  /<ÌÔÌÔÌÜÌ032653;#"&=#"&'H.bit0B,rg$uT ü qkJý V6Xlx a97 œ!+33276?3327654'&+›CFCD‰ôtk=%%(f{n!!"þ×}K'))'K}éN;[--sþ÷?¡«5ÿ/.6œé 333# #6t‘‰‘t¹ˆ˜™ˆþéþéýýþ&­Õ+53276?33Ÿ1/.N]D0 þâ{ÝÜ{bp"#WK/iþêÿÿ tŸf ÿÿ tf&  tÿÿ®éÓÕ ¢ÿÿ²þ×Õ £ÄîéÚ@ žÜüÔÌ1Ôì0#5—R¤Ú¬þÀ@¬uï‡452654DŽu@XX@sPOOPï=>X@?X=>POæPPuï‡"'&4763"3‡sPOOPs@XX@ïPPæOP>=X?@X>uœ‰32765&'&#"567632#'y7$#?q22110335®WDDFk€[@*7K$@ ` XFh_@Cþ“uœ‰#&'&547632&'&#"3êkGDEW­53301212q>$%6y[þAmC@_hFX ` @$K7*@ 2õ°% % êþ™gþ»õ‹´´‹õ 2õ°5-5õþgþ™ê'õ‹´´‹õÁ|?f=´uÜì91µ³ôÌ2´]90K° TK°T[X½ÿÀ@878Y3# #¶”õ‹´´‹fþgþ™Á|?fL´uÜì91µ³ô<Ô²]90K° TK°T[X½ÿÀ@878Y@ 5:5:3]]33¶õ‹´´‹õ|êþ™gþÁî?f7@ ´³uÜì91ôì290K° TK°T[X½ÿÀ@878Y3#'#¶”õ‹´´‹fþˆõõÁî?f7@ ´³uÜì91ô<ì90K° TK°T[X½ÿÀ@878Y373¶õ‹´´‹õîxõõþˆÖç^@ÜÜÌ1@/Ä0#^ˆýÕ+ÿÿÕb+öqsîRf3#‹Çþº™fþˆªð‰f #o™þºfþŠvÖþÑ^ü@ÜÜÌ1@/Ä0%#^ˆüýÕ+ÿÿÕþÀ+ÿTqù^ªþ‰ÿ’#o™þºnþŠvsþRÿ”3#‹Çþº™lþˆoÔ#E@ Ô<ÄK°PX³@@88Y2991/ÄÔÄ0@ `o]@ P```dd]!!!²e³³þ›ÙJý'þ¶oÙÔ#4¶ÔÄK°PX³@@88Y91ÔÄ0@`]@ P``d]!!²eÙJÿÿuþ‡#€þÿÿuþ‡#þÔá–!533áþ>––j––,þÔÔá–5!##––––þÔ,Á‰ß 533##5#5¢”áá”áþáá”áá”já!5!áþ>Âj–Ç)9H W@ ð³VVÜìÔì1ô<Ôì0K° TX½ÿÀ@878YK°TK°T[K°T[X½@ÿÀ878Y332673#"&Çv aWV` v ž‘‘žHKKJLšDfN@ ÎÍdÔì1üì0K° TK° T[X½@ÿÀ878Y° KT°KT[X½@ÿÀ878Y3#šÌÌÌîá  @Áò ÁñV xVÔìôì1ôìôì04&#"3267#"&54632˜X@AWWA@XzŸssŸŸssŸô?XW@AWX@s  ssŸŸLþuÁ @  óô 'ÔìÄÔÌ1/üüÄ90!33267#"&546¸w-+76 >&Dzs5=X..… W]0i¶J7c@$  Ãà íVwVvôìüì99991ü<üÔ<ì99990K° TK° T[X½ÿÀ@878Y'.#"#>3232673#"&ü9! &$}f[&@%9! &$}f[&@Z7IR‡“!7IR‡“ðî®fB@´³ÔÜÔÌ991ô<ì20K° TK°T[X½ÿÀ@878Y3#3#ü²ø‡ªß‰fþˆxþˆÿÿÞ­%3;#"'&5¸&&i+@¯WRþëd¤”™10œ`ZÈ¢ïîf '#7'373\\]´µµ´]\´¶¶îaa»½``½»u«ý # 5473733254²òþõµú‰¿·‰þ¼‰ˆÜù´„„¿ò/ààþŠ®˜MM‰zœî ±/Ì1±/Ä03#zttü™uœ/2&'&#"#"'&'532654'&/&'&547632j1549W++](}24NMˆ9>=D@?>=RX o(l00GF‚@99 a /$*+MW33 k2-*)*IX01 uœ! #'#37ÿ ‰Í͉û‰»»þÏþ¾ööH+ßßuœ‰#&'&547632&'&#"3êkGDEW­53301212q>$%6y[þAmC@_hFX ` @$K7*@ÖX@ ©ÄÔì1/Ôì0!!5!•þAGЈú¨ÖX'@??//©ÄÔì21/ÔÜì]0!!5!3•þA¿ˆœˆ4ú¨ÖX@ ©ÄÔì21/ÔÜì0!!5!3•þA¿ˆhˆhú¨ÖX'@pp00©ÄÔì21/ÔÜì]0!!5!3•þA¿ˆ4ˆœú¨ÖX@ ©ÄÔì1/ìÄ0%3!5•ˆý¹ˆÐú¨ˆÿÿÁýì?ÿÖ‡ùpÿÿÕâ+v'q€q€îëf3#3#––@––fþˆxþˆÿÿîý.ÿSœøM¶þvJÿ!'&'&#"#67632327673#"&ü9 &}33[&@%9 &}33[&@þ³7 %$R‡IJ!7 %$R‡IJü¨ðþ‡f6@ ´³¸DÜì91äôì0K° TK°T[X½ÿÀ@878Y # ým™þºXfþŠvþýqîÿPf6@ ´³¸DÔì91äôì0K° TK°T[X½ÿÀ@878Y3#þ‰Çþº™fþˆsüÁîÿ?f<@´³¸uÜì991äôì290K° TK°T[X½ÿÀ@878Y3#'#ý¶”õ‹´´‹?fþˆõõsÿÿü´ÿH7žûþÿÿüÙbÿ/öqüÿÿûì|  Æüÿÿü¿)ÿ1Hšûøý˜+þd%@ ¾±¸Ôì91äüì0@4D]3#ý˜ÌÌhå°ü×Fÿ)I@Î͸ dd ÜüÔ9ì1äü<ì20@#4D`````````ppppp]3#%3#þ^ËËþyËË)ÊÊÊËý7òþ÷{"@ V@€ V /ÌìÜì1@Á@À /Üì0632#546?654&#"ý7pihX,#w3-.>GZdH3UC=A   (6%""($4ÿÿüìáÿœûþÿÿüôîÿ²fŸüüÅîÿCf<@´³¸uÜì991äô<ì90K° TK°T[X½ÿÀ@878Y373ýºõ‹´´‹õNîxõõþˆsý¼ìþD¨²/ì1±/Ì0#þDˆ¨þD¼ÿÿüðìÿ¨'¾ÿ4¾Ìü]îÿfB@´³ÔÜÔÌ991ô<ì20K° TK°T[X½ÿÀ@878Y#!#ý͇ø¾‰ßfþˆxþˆxÿÿü¿)ÿ1Ö'›üÆšûøü¿)ÿ1H µVV/ìÔì1´ ð/<Üì0#.#"#> Ïv aWV` v ž"ž)KKJLþéÿD( @ÔÌ0#3þòÓ¤é?ýÂþ‚Á#55#53þ‚òppòÃþÿ{‰þýÂþ‚Á53#7"ýñopòÃþþ‰{ÿyš‡3#@Çu™þˆÿÿü¨ýßþ‡ÿUCûþøïÿÿýqýÝÿPÿUvûþøïý ý&þDÿ53#5#5ý¼ˆˆ°þ_±þ±ˆý¼ý&þôÿ3##3þD°°ˆˆþ_ˆ±êþU†?p!5!#Iþžêˆèˆþþðk{à1@V/K° TK° T[K°T[X¹@8YÜ2Üì1@ Á/ÄüÌ0532654&'3#"&þð=X..… W]0i×w-+76 >&Dzs5ý€þþVÿ¾ @  VÔüÌ21@Á Á/üÜì0"&5463"3þVZ||Z(55(þ}ZY|x5'(5ý ý×þõÿ3!5353þD±þ±ˆþ_ˆˆ±ý ý×þõÿ#5!##ý¼±걈þˆˆˆ±ý ý&þõÿ #53533##ý¼±±ˆ±±ˆý׈±±ˆ±ý þˆþõÿ5!ý êþˆˆˆýzþVÿЀ '+53276=0RQµþéi&&€”Ö``œ01™”ýwþVÿÍ€ %3;#"'&5ýw¸&&iéþµQR€”™10œ``Öÿÿýšþ‡þfÿS›üùCÿÿüÕþ‰ÿ'ÿSjûþùCý(þþÔÿ¾ @V xVÔìôì1@Á Á/üÜì04&#"3267#"&54632þ[6'(55('6y|ZZ||ZZ|þê&65'(56&Z}}ZY||ýjþþÿT @ÔÌ03#ý¼Ó¤¬þÀÿÿý#þuþÁzüÿÿýLþuþÁüý¼ý˜þDÿT²/ì1±/Ì0#þDˆ¬þD¼üðþ ÿÿT#5!#é‰þ뉬þ¶ÂÂJücþ9ÿ˜ÿX#"4533273273"ýþ Ïv aWV` v ž"žþ6KKJLÿÿü´þ9ÿHÿSžûþùÿÿüÙþÀÿ/ÿTüÿÿûìþþ¬Büÿÿûìþÿî ¡üûŒìÿ­ #"'&'.#"5>32326SKOZq Mg3OIN’S5dJ t]F‰ ®;73 !;?®<6 7=ýxÄÿˆh!5xýðh¤¤úíÄÿÿh5!úíĤ¤ûhÿ¢ÿ¼¼'ûÈ`õ_^NÌOúÿºÿ‘'úygfFXYý¬þþ‚ÿ¾ @  VÔüÌ21@Á Á/üÜì02#52654&#ý¬Z||Z(55(B}ZY|x5'(5üñþ[ÿÿ¥3!53üñ‰‰þ[JÂÂþ¶üðý.ÿÿT!!éýÙžþë¬ýÚ&þbþêücþ9ÿ˜ÿX632#&#"#&'"#72ýþ;tÚv gfv ifvÜtúRþæ––•–ý+óþå­ '7'77þ}`}}`}}`}}`p}`}}`}}`}}`þÂÿ Ò.54675>54'&'þC!“‡RI 7!“‡RI Ç0PQn +0PQn ÿÿûì: ' Æü Æüþ¾ÿÿü¨ðþ‡fCûþÿÿýqîÿPfvûþÿÿü´ÿH7žûþÿÿýÂþ‚ÁÄÿÿüçFÿbÒüÿÿýÆþVþ¢ÿ¤üüÕÿ+I#5!#!Õ–þÖ–V––,ýþ2þáÿ¸!5!5!5!þáþ>Âþ>Âþ2x–xýþþëÿŒ3#3#ý––@––tþˆxþˆýþþáÿÖ!#!ý–þÔ*þ>,ü¶îÿJf'73327673#"'&'#7&'&#"#67632ýÿBmk  &}33[& !Bnk  &}33[& ÿg©  $%R‡JI g¨ $%R‡JI ü¶‰ÿJÌ!%'.#"#4632326=3#"&3#3#ýü9 $(}gV$=09" (}gT";è––Ò––h! 2-ev 3)dw.–C–ÿÿü¶ÅÿJ"Ê·ʧücþ(ÿÿ 7!#'73!'3þp„þ„¯¯„ç„~¯¯þ(››ÍÍ››ÍÍý3þþÍÿ¤#557'þ2d›ÍÍ›þç„~¯¯~„ýxáþˆ&'&4767þˆ@*,,*@rNPPNr‹*,@A++{OPæPNÿÿü¿ÿ1Ø'¸åÿÿý+ýUþåÿîøbýxáþˆ050567654'&ýxrNPPNr@*,,*‹{NPæPO{++A@,*ÿÿÿ.Dÿú›ý”ÿÿüpþÿ… ÇüÉÿÿüpkÕ ÇüÉPüp×k!!üp øàk”üpþÀÿT!!üp øà¬”ý* Ö'#'&'&#"#67632327673#"'&O,$e5F¢qpÈ[?9ZO,$a9G¢qpÈ[?9J7  $0G‡JI "7  $,K‡JI ÿÿüpn ÈüÉüwþ(“ÿÂ5!'3#7üws„~¯¯~„þÃd›ÍÍ› tŸf@ÔÌ1ÔÌ03 A¾ntòþ þVŸH@ÔÌ1ÔÌ0%#ŸA¾nHþò¶þV’ÿ¤ #"'&=3;’”• #þV!.åå ÿÿÿãõ{ÿÿqÿãç{'yOÿ„Fÿÿÿãõ{'yŽÿ„ÿÿžÿÃ#sîRf1@ ´³DÔì1ôì0K° TK°T[X½ÿÀ@878Y3#‹Çþº™fþˆÿÿ×FRÒ&jl@¯Ÿ_]@_q0ÿÿhf'þÚÿÿÛH®Fyÿÿÿçuf'þt#êÿÿÿóf'þ€%äÿÿÿí}f'þz'êÿÿÿòÿãf'þ-(ÿÿÿá‘f'þn2ªÿÿÿÛf'þh66ÿÿ€Ò'ÿ.FÿÿhÕ$ÿÿÉìÕ%ÉjÕ@ •üüÌÄ1/ôì03!!É¡ý)ÕªúÕhÕ=@ B••ÔÄÄ1/ìôì0KSX@ììììY !3¼þf5û¹:å9ûš¨Õú+ÿÿÉ‹Õ(ÿÿ\Õ=ÿÿÉ;Õ+sÿãÙð!2@•‘"•­" •Œ"#3"üìÄôìÄì1ôìôìôì0!!"3276'&' ! '&76ÅÂý>bÜ‚ÜÜ€€Ü:x¼¼þÆþż½½¼pª†¤¤þåþæþ¸¤¤¤¤¤þ[þžþŸÒÓÒÒbbÓÒÿÿÉ“Õ,ÿÿÉjÕ.hÕ<@ B•ÔÄÄ1/<ôì0KSX@ììììY3#3#åÕ:å9Òþ&Õú+ÿÿÉÕ0ÿÿÉ3Õ1ÉbÕ *@• •­•   ü<ÄÔ<Äì1/ìôìôì0!!!!!!2Çý9i™üg™ügqªªûªÿÿsÿãÙð2ÿÿÉ;Õ«ÿÿÉÕ3É‹Õ F@B ••  ü<Ô<Ì1/ì2ôì20KSX@   ììììY%!!5 5!!±Úü>ßþ!°ý8ߪªªpªªýóÿÿÿúéÕ7ÿÿÿüçÕ<sÙÕ'<@) !%(üìÔ<<ü<<ÔìÄ1@•' •%'/Ô<ü<ôÔ<ü<0367654'&'&'&76753#–b‚‚b–Ê–b€€b–Êôž½½õÊô¼¼ôÊŽWsÆÅsWWsÅÆsWü† ¡‡ŸŸ†¡þñþò¡†ÿÿ=;Õ;sÛÕ.@ •ÜìÔ<ü<ÔìÌ1/ä22Ü<ì20!6'"'&336763#ÂÖ¼¸Õ‚nŠÊŠn‚Õ¸¼Ö†°ÒÌh™þgþ椌ñüŒ¤™þgþ˜ÌÒHîNÏç&3@ •‘&•("3'üÄüÄôÄìüÄ1/<ì222ôì0%!567654'&#"!5!&'&576! Ïý¨±cc„„ØØþ÷cd²ý¨?žIHÀ¿1/ÁÀGG¡²²²a¦¦Êð‘‘þÝïʦ¦a²²‹••¸>ÅÅÅÄþË””ÿÿXN'È/u'´ +1ÿÿÿüçN'Èqu2´ +1ÿÿqÿçäf&>nÿÿ…ÿãÈf&PBÿÿºþVdf'ÆDÿÿ¦˜f&FÿFÿÿ•ÿâ*Ò&Rqÿçäy *È@ ,%E+üìÔÄÄ99@ ?/]q@ ¹)¸ ¹!Œ¼‡/ìäôìôì99@<ììì<ìì10@ „†ˆ‰ €]@IIIJN LNIK ]@:9:88? <>]@ + +*))]@  ]@++]'&#"3273;#"'&'#"'&763 N,-²†=MKLy†H¤c¤Í( #) Xn^T).^,ëruÆ7 çínжÜikÕç%ý¡Û1)0œT*XoW)˜&ŠšÀþVˆ!7@E Füì2ÄÔìäÔì1@¹ ¹¹ Œ½ìôìÔü9Ôì0%#! !"3 5 4# y¹ª²¬þÔYoÅ þ0kêþûEþÈþþîdZþõþ&J­:ª@ÛþÈ þV`@@ ÔÔüÔÄ1@ ¿½/<ìä20@ ìì99ìì3#&+532iõ^Ãþ;¸þÚ,_1FŰýLdû þVªD~žqÿãuð-T@(/E( Q!E.üìÔìô² ]ìÄì99@%¹%¹Œ.ôìÔüÔÌ99@Sì910&#"#"'&4767&5!232654'&'&ìfïýÐuމ‰ð‰5Kœ¹ÝxþD7VUV•“¬[a~@Fu\0%p‡þëþ÷œœÌ¥@$OFþ(IqÌËrsè¾Ç`g …ÿãÈ|2=@" † ˆ¹¸3©3'†(ˆ#¹,Œ34 '0E3üìÔìÔÄÄÄ1ôìôìÔìôìôì0&'&547632&'&#";#"32767#"'&546‹p<@ ÔìÔÔÔÄüÌK°QX¹@8Y1@¹ ¹Œ‡—ôì2ôìÜì0%#457654'&# !5!Ê„OTJP£E* :ý¢;ýìfý,KOxsPWKL,#%5,*3ìY¹¹þ”þ'þiºþVd{1@‡¸ ¼½ FN  Füì2ôìì1/ìäôÄì0@ €]#4&#"#367632d¸||•¬¹¹BYZuÁcc¤û²HŸž¾¤ý‡`®e22wxqÿéu$!O@ ¹—"•"¹Œ"#E QE"üì2ô²]ì2ì1ôìÔ@?]ìôì0@ w #€#]!3276'&#"2#"'&76±ýƒEV•–SI 6V“™Q@=ð‰‰‰‰ðñˆ‰‰ˆÆþÕœŠÉdžœ~þü´ÔÓþŠþ‹ÔÕÕÔuvÓÔ¦n` @ FüüÔÄ1@ ¼‡/ìä0;#"'&5c"$lYo´RR`ý+‘.0œ`bÔÊ¿…` I@   F üì2ÄÔÄ1@¼ /<ä20@   ìì <<ìì33 ##¿¾ãàþGþáþb‰¾`þ/ÑþZýFBþ?= F@ ÔÄÔÄ1@ ‡ —/<ôì0@ì ììììì # #'&+5zÃþÆþ~ÃëJ/k`uâeú›<üÄ2Æ~žÿÿ®þVå`wJ`B@ÔÄÔìÄ1@ ¼/ä20@ì ì9ì9!367676'&'31 þªÆ!xdLjºE.*ˆ±{`üT|¬p5dwƒY|rNįätkþR&@@ (" %'ÔìÔìÔÔÄÔÄüÌ1@¹ ¹Œ'#‡"‡—'ôü<Ôì9ôìÜì0%#457654'&# %$47#5! $Ú„OTJP£E* :ý‘MþèÜÐý‹ýÆKOxsPWKL,#%5,*µ,X$ÅR¹¹þÝ¿ ªþ¼þñÿÿqÿãu{RJÿÙ˜`/@  ÜÄìÔìÄÄÌ1@ ‡Œ‡¼/ôì22ôì0!#3267#"&5!##J117,#J%x\þc¼`¸ýPH?… ƒ°œüX¨ºþV¤{1@¹¸¹ Œ½EQ Füììô²]ìì1ìôìôì067632#"&'#44&#"326=—;¶ÌÿÿÌ{±:¹+§’’§§’’§˜fZ#þ¼þøþøþ¼adý®ÏçÝËççËËççqþRç{$6@ !& HE%üìôÌÔüÄ1@¹¹Œ% † ˆ ¹¸%ôüôìôìÜì0 !2.#"32#457654'&¨þóþÖ-U¢LNP³ÆÆ¯ƒPTJP£E* >:##¬++ãÍÍãLOxsPWKL,#%5,*qÿãÖ` 1@  QEüìô²]ìÔÄ1@ ¹Œ‡¹¼ôììôì0"32654'&'!##"'&76s˜RV«•“¬VOšcÎm‰‰ðñˆ‰‰qÎns¾ÉçèÈ·zn’¸œÝþ휜›dm`#@  ÔÄüÄÄÄ1@ ‡ ¼¹/ìôì20%;#"'&5!5!!æ$lYo´RRþ\ þWÌ0œ`bÔ¸¸ýã‘•ÿâ*`+@ E FüìÔìä@?? ?]1@ ¼¹/ìô<0327676'&'31'"'&5R27k–i;jºF-*€œþ³eb`ý+‡@EÐv»f€wƒZ{sšý»äxvÅÊpþVÑh )=@+E(#E*üìÔ<Ìü<Ôìì1@¹ ¸*'‡Œ½*ìô<ì2ô<ì20"27654'&'2##"'&7673=A__UVF6Œ‰‰Ë·Ç†ˆˆf¦B:VVMpË‘ýRh]ßÐp[„þÙþñ¡˜þn‘™œ’m£Ns¾Êsg¯.;þUda®@    Ô<Ô<9±Ä1@ © ¼©½ü<ìü<ì90°%KSX@ ìììì´ ´´ ´´9´9´  9´ 9Y#&+53;'$Ü•þÍÙ²¶1š1FA”3ÙþN¶1š1FþþúýÐ×~ž§þ0üèþ)~žpþVÑ`6@   ÜìÔ<ü<ÔìÌ1@ ¼ ‡Œ½ìô<ì2ô<<0&'&53367653#EçkƒºUJ|·ƒCUºƒvÜ·%awó‰ý~·LBÕü,BT¯ýxünc#þn‡ÿã'`8@E  EüÜììÔüÔììÜì1@ ¼ ‡/<ì2ô<Ä0 433233243! &þa›ÆÞ˪ËÞÆ›þaþð!)Rë@þÀðþOýæ±ð@þÀëý®+þÕÿÿ}&Fjÿ.ÿÿ•ÿâ*&jRÿÿqÿãuf&}Lÿÿ•ÿâ*f&"Rÿÿ‡ÿã'f&VY¦ÿéM% 'G@)E& F(üì2ÔììÔ²?]ì1@ ¹("¹Œ(¹—(ôìôìÔ¶?]ì990267656#" '&76#327>&iPËDyÌz]6îö;~þ‹ox†Ò¤Ú]ûYß:P®W­p=l“Þºlþǧé‚_ÕÕ¨,¾Õâþå¶–þꀰœ-Ñžqÿéu$ 7@ !EE üìÌÜììü<1@‡— ‡ ‡Œ ÌôìÜìôì04'&#" '&4632  ®1B•SxyJþ̃ÓЯÚõþäþ#þõ¼°/¥pö~ª‰ZªZ7ªAi6 Þþdüüþe¶Ò þóþ½BWQß I@ "!ÜÌü9ÜÄ´?@]Ì1@•• •‘/ô<ÌììÌÔì99@ oÏ]0#4''&"562%62#"F R*Ë*R Mw(oUCHk&_*SK…Hþó¥ývŠ¥ H# ª 0þr{C @[)/Bÿÿÿá¡f'þn^PÿÿWQN'ÈÅu^pþVÑ'A@)   $E(üìÔ<<ü<<ÔìÄ1@ ‡¸(‡ Œ— ½(ìäô<ü<ô<ü<02##"'&76327676'&#"üÇ…‰‰…Ƿdžˆˆ†Ç·qMTVMq·qLWULþc™œþíþ휙þo‘™œœ™úwgsÊÈugü¸HguÈÊsgAÿâm`5!#%$! 47)323764A,“Mþaþñ")þøþaM:ü’GÞϪÏÞ¨¸¸Ï¤ý­*þÕR¤ÏѧþOýã®§pþ[Íg9&'&47#"54654'&#"563277632327"'532ùö! ½`È7"7$>Ž9[@[½`È7"7þÜ>Ž9[&ÍF¢]_I¤ ðI5lþ÷|"Oš Šz:6hlà0'þÃ[Ml |"Ošþ÷Šz:6hlýàf$1 1sþXÙðD@!  üìܶ0]ü9ܶ0]ìì1@ • ‘ •½ ìÔ<ìôì0#&'&76!   76'„¸ü ½½¼;:¼¼¼Ÿ{þH‚‚¸€€þp³ÒÄÓÒÒÓþžþŸÒ³I¤¤þåþ椤¤¤¤qþVu{ <@!E E üìܲ0]ü999Üìì1@ ¹¸ ¹Œ½ ìô<ìôì0"32654'&#&'&7632s”VVUV•“¬VV9ª¾k‰‰ˆñð‰jßstþntsèÈÇtuü þn’}œœœþÈþìþíœ{‹þR«Õ$ 32#457654'&# '&76)Fþó`{[mÈzYTJP£E* :þÀŽ•¹Šxe+w˜þÍþµ˜TOxsPWKL,#%5,*ËÖeNí±ªqþRQa#"32#457654'&#"476!¬Ø>cccnƒPTJP£E* 9ÌþÖ—h4­¨HqÀÍrqLOxsPWKL,#%5,*>󼃸ÿÿÉ#Õ)ÿ@þVF'347632&'&#"!!#"'&'53276îˆ`©1213$)),x:KAþ¿‹b­933.1220W@R‚ Žd ¤>QoþÉý?’¥s ¤K_³ÿüÔÕ7"'&76'&526n ê'BƒæQ_šý¬'BƒæQ_‡þ[~ý,`*l#½FR¶Úþ‘`*l#½FR¿ˆ #!3ˆþç¸âý&¸âpüÆMý]rþV`ð!#56! #'#64?!"QªÍhЂÙíÖöáRR_@Ͷ»Ðþ¤0:ýŒIKiÆÏþÎþìýÂþXþ’LÊÑ}/M4ÐýÆ!÷wþ–x#&'#&' #'nï¹d2þF¹b.¼Ó-òà¬t¨`4þÌÀ#Mýа!„¤ØÈþPþßþ‰^ösþKÕ='6767&'&'#"'&46733276=332764''3=DÛ´þìvŒaŠyͤgDd''de’Óy{d;]ùT‡CHI}rHGÇFFt†AGC‡Tú_8dàþïËæ¦ˆd*…0Q€A^­­^^±´˜ÉŸFþ¿Ÿ·þÍkmihÆññÆhimw'·ŸAF‚œþë‡þU(`%!$! 4337643'676ˆþí#þòþa‡ÚßЪÎÞÚ‡9iÅšÒkp[Q‹Ç þò5ë@þÀðþ—Ôþ+hð@þÀëÑ„ôž{I%l +?sþVHð32763## '&6%ì´`…nbÃÄbcÙÙDhhªÿœ¢º—(J„¹þîù«˜˜™ ìø„@?ÕÝG6ÕqþVŒ{ 7653##"'&54763‹šPr^SLTT¸¸:XYÚ…‰žýýcнtstË1ùöRd01¢¨øìÈ¢ÉþKâÕ% '676767654'&#"#3676L'±¾Pe^Ò8*ˆ7D˜ ! ! 12ÀÔ°œˆ.#A“L.#^YŒq4+& "H4B;;=/?"+ŸVhP’OþV ö!! 7654'&#"#676! 3 7úÿþíþ¯þ¹º³llc¤´^#ð,V£¡¢¢þ÷þœÕ)èì¾£ñÛ„œe]’6?¡f‘ñضþòþ…µ³dþVj{ # 7654'&#"#67632327\ÚêþîþÞB§\\T‹™PÌ%I‹îèНþ/‘©ýÅþï™yYÂk}oSKu,2Rœè¤œÅþàºs¶ï5%! &'&#"567632 67632'&#" ;!53276ÚnþÍþ€þÜ"?E! rK,/ 4'Kr !D<&þÒtEGúÃGH ªÊþh=»" » C(FþK#C » "&þEýà !ªª!6Ë{5%! &'&#"56763267632'&#";!53276šÌäþ[9ï6:ƒ@%(ÅÅ(%@ƒ:6ö-:IûkI:ž8þî¤=35þú53þ¸þgžžsÿã%+$67632! '&76!2767&#"327*þÖW8QU{‚õ2þÎþùþΤ£‹|°s• K^—lŽÈº¼hiie¿¼b-sJ V"1þ¼ýðþ¼œ›PÞÒ» '±$üA‚æstÀ½xssqÿã[/&67632#"'&76!27674'&#"3276›ãI,)e[xÌ€€Ûÿ‰ˆtgO_\SG]EZ¨ST’•VXXT—”RS7xJ©F61¢¢ý𢢜›PÞÒ» '§'üøÍrsstËÇxsst,þV·Õ#5!#!#!3·ËþëËþëËàË`þòdú `duþ‹7þUÏ#5####!3­å¹å­’¹_ÿpú†zppþpÿòÍg3#"54654'&#"563277632327#"'$47(`È7"7$>Ž9[@[½`È7"7þÜ>Ž9[@[þã™þ÷|"Oš Šz:6hlà0%þÁ[Ml |"Ošþ÷Šz:6hlà0%?[MºþV¤{$4767632#"'&')! $'&  7ºZ6ž;¶Ì€€Ìx[Y: ôþþ+STþÜTSST$T%Уb^#¢¢ýð¢¢10dþXªÚ4–tsstþjtssÿÿqÿãç{FÿÿÿÛþVyMÿÿsÿãÙðaqÿãØ{!&'&#"!!32?# '&76!2Ø%%cj·f_¥ý[_f·€MJOhkþôœœ en('® c\©©\c§œœ(œœ Äÿã+{!56763 !"/532767!5!&'&#"Ä'(ne œœþôkhOJM€·f_ý[¥_f·jc%®£ œœýØœœ§c\©©\c ÿÿÉÕ ÿÿºþV¤Àÿÿsÿã'ð&ÉÕ ! !###É-}-ÅþËþÄÕþ!ßú+þçúáþV³` !!###þ¹þì™þë¹`þ{…û ²þ` ú¤UþV¤{'4767632#"'&'!!#5#5'&  7ºZ=—;¶Ì€€Ì{XY:åþ¹eSTþÜTSST$TµçŒfZ#¢¢ýð¢¢10dþȪppªô–tsstþjtssÿÿsÿã'ðHÿÿsÿã'ð&…y3ÿÿsÿã'ð'yä‰ÿÿÉ‹k&¡ËîuÿÿÉ‹N&¡Èu…±’—B°“°˜B±€B±B|°°#I°°#Ia°€bh°Fa°F`°’C°`#B°’C°`C°UX°°’C°`C8°°5Y±€B±B°°°°#Ih;°°5°°#I°@PX°°@8°°5°5Yÿúþf¬Õ4@  ÔÌü<ÌÜüÌ1@•°••/ôì2Ôìôì0%+532654&#!#!5!!!2¬ÌäL>†o||þˆËþR‹ýÞhþòôª–Â"Ÿžý9+ªªþFéîÿÿÉjk&ŸÉ®usÿã'ðN@  Üì2Ô<ÌÌ1@•­ ¡ ®• ‘¡®•Œôìôìôìôìôì±I±IPX³@8Y0! ! &! !!! 'Ôþõþ±þz†OÐÓÿþøîüâîFÓŸhgŸŽÕ½þãïªïþäÿÿ‡ÿã¢ð6ÿÿÉ“Õ,ÿÿXN‘ÿÿÿ–þf“Õ-T/Õ3@   ÔÔìÔ<ìÜì1@• ­• •/<ì2ôìüì0!565!32#!% 4&+pþÈþ‘Ù•xêûþðûþLª@£à+¸ýÊýû8ª/¦XþýšÚÝÞÚ¦‹‡ýÝÉÌÕ5@ üì2Ü<ì2Üì1@ • ­ •/<ìä2ü<ì20!!#3!332#4&+326 ý†ÊÊzÊêûþðû6£à࡟Çý9ÕýœdýšÚÞÝÚ·‹‡ý݇ÿú¬Õ,@   ÔÌü<ÌÜì1@ •  • /<ôì2Ôì02#4&#!#!5!!ºÞÉ||þˆËþR‹ýîqéîþfŠŸžý9+ªªþFÿÿɆk&¦ÉîuÿÿÉ3k&¤Ëåuÿÿ#½m'Ïru¯Éþ¿;Õ )@  •  üìÔüÔìì1· • /<ä2ìÌ0)3!3!#­þÊÞÊþªÕúÕ+ú+þ¿ÿÿhÕ$ÉìÕ.@  . üì2ôìÄÌ1@ •• ­•/ìôìôì04&#!!26!!2)£þ¼D£lýNûþùþüýè·‹‡ý݇¨¦þ@ÚÞÝÚÕÿÿÉìÕ%ÉjÕ@ •üüÌÄ1/ôì03!!É¡ý)ÕªúÕeþ¿ÛÕ4@• •ÜìÔìÔÌü<ì1@ • •/ì22Ì2ôì0%!!67!3#!#Ó”þpþ±†&axªªûÞªªÔþ þµD+?x4&úÕþAþ¿ëÿÿÉ‹Õ((vÕ˜@   Ü<ì2ÔÄ991@B  ¯ /<<ì2290KSX@    <<ííííY@ I:I:I:I:I:I:@  <<<<33 # # # 3êʪõýßDÓþþþÊþþþÓDýßõªÕýâý³üxþéþêüÿˆMý‡ÿãšð(?@ * %)ü2ÔìÌÔüÌ1@• ¡®• %¡&®"•‘ Œ)äôìôììôìÔì02#"$'532654&+532654&#"5>Iö8Žƒ‘£þîzþä,™©|¼Ð¹ÃÌÔ³ž£Æ†\ÍqìðѲ|«!ÄæéBÐY+•„•¦wps{MÅ("É3Õ y@ B ¯ 6 üìüì991/<ì2990KSXííY"² ]@068HGif€  FI WX ei y …Š •š Ÿ ]]#!33ÄýjþðÄ–Õú+áûÕûáÿÿÉ3m&¤Ïõu#´ +° KT° KT[°KT[X»@ ÿÀ88Y1É†Õ Y@   üì2ÔÄ991@ B ¯ /<ì290KSX@    <<ííííY3! # #ÉÊÒý¿_ÜýúþïÊÕýâý²üyþéþT:Õ%@   ÔÔìÔìì1@ •• /<ìôì035675!#!TÙ>WxÊþfbª/¤Xþú++¸ýÊþøýÿÿÉÕ0ÿÿÉ;Õ+ÿÿsÿãÙð2É;Õ@• üìÔìì1/<ôì0#!#;Êý"ÊÕú++úÕÕÿÿÉÕ3ÿÿsÿã'ð&ÿÿÿúéÕ7#½Õ>´ ÔÄÔÄ1¶B •/ìì20KSX@   ììììY%+53276?3 3 OûM?w.-þ!ÙsuÙµ2&]ª*jkü”lyjÕ =@!   üìÔ<<ü<<Ôìì1@ ••/Ü<ì2ôÜ<ì203>54&'$%53# ÙææÙËÙääÙËþÃþ©W=Ë=Uþ«þÃË¢ÌÅÅËËÅÅÌü+  -‹‹þÕþõþ÷þÕ²ÿÿ=;Õ;Éþ¿åÕ )@ • üìÔì<üÌ1@ •/ì2Ìô<0)3!33#;ûŽÊÞʪªÕúÕ+úÕþ¯³Õ$@  ÜìÔì2ì1·• ­ /ä2ôì0!!"&533!3èþ_ºÞÉ||xËdéîšþvŸžÇú+ÉÅÕ *@    üìÔüÔìì1@ •/ì2ô<<0%!3!3!3¬OÊùÊOʪ+ú+ÕúÕ+Éþ¿oÕ2@ •  üìÔüÔì<üÌ1@   •/ì22Ìô<<0)3!3!33#ÅùÊOÊOʪªÕúÕ+úÕ+úÕþ<Õ *@••­•  ÌÜì2ÔìÌ1/ìôìôì0!!5!!2#4'&#!!276õþGƒNûþðû6ON£þ¼D¡PO+ªýšÚÞÝÚ·‹DCýÝDCÿÿÉFÕ&¸,³ÉìÕ $@• ­ •  üì2ÔìÌ1/ìäôì04'&#!!2763!2#!ON£þ¼D£NOü²ÊNûþðûýè·‹DCýÝDC¨ýšÚÞÝÚoÿã#ðN@ Ü<ÌÔì2Ì1@•­ ¡® •‘¡®•Œôìôìôìôìôì± I±IPX³@8Y0! 7!5!&! 56! ! 'oÓîüâîþøÿÓÐO†þzþ±þõÔF½ïªï½ÕŽþaþ™þ˜þaÓÿã0ð&8@•‘'•Œ'!•&­$#(  !%$'üì2Ô<ìÔìÌ1/äôìôìôì0"3276'&76! ! '&!#3~Ü‚‚ÜÜ€€üs´´;:¼¼¼¼þÆþÅ´´þÐÊÊL¤¤þåþ椤¤¤¤¤ýóÍÌÒÓþžþŸÒÓÍÍýkÕýjˆÆÕ@@  ÔÄìÔì2ì1@ B• •­ /<ôìôì0KSX·  ììY3!!" &$54$)#!›•’:þÆ’•þí˜dÿÊþòþv'ƒ‡…ûV©×Îàú+wý‰ÿÿ{ÿã-{Dpÿã7):@+E'Q! E*üì2ôììÔÄ1@©—*$¹¹ ¸Œ*äô99ìîôì02#"'&5476$%676"32654&}ðþîðñþö:[;z631-ú~LǂӔ¬«•“¬¬{þÈþìþíþÇ0åw) v¹ ’ ,u™8wœçÉÉçèÈÇéº>` /@ " F!üì2ÔìÌÔì1@ © ©¼© /ìôìÔì0!2654&#32654&#%!2#!r~„„~þúòh„„hþV¶ÅÔljŒçÖþ9þ_ZZ^ÉþÊSJJO“…gy˜r–¤ºÐ`¶FüüÜÌ1´©¼/ôì03!!ºý£`“ü3kþå`4@ © ©ÜìÔìÔÄü<ì1@ © ¼©/ì22Ì2ôì0%!!6765!3#!#»þ}vþØ[(bõ““üt““:ŒþdÜ6(UÓ©Ôü3þRþå®ÿÿqÿã{HFï`˜@   Ü<ì2ÔÄ991@B  ¼ /<<ì2290KSX@    <<ííííY@ I:I:I:I:I:I:@  <<<<33 ##'# 3?·éÖþnÌÅþ‡»·»þ‡ÅÌþnÖé`ýòþQýO6Éþ“mÉýʱ¯ýò…ÿãÈ|(N@ &* )ÜÄÄÔìÌÔì1@ †ˆ¹#¸)©) † ˆ ¹Œ)ôü° KQXüôYìÔìôü° KQXüôYì0#"&'532654&+532654&#"5>32Â|ŠþþîP©ZGª]—©–‰”›t‡‹wG¡abªLÄãx\’l­¶«%%pZXk˜YF@\§]ºy` ?@B ¼ F F üìÔì99ì1/<ä2990KSX@  ììY##3y·ýäì·`û ƒü}`üÿÿºy&ÄššÿÌ#´ +°KT°KT[°KT[X»@ ÿÀ88Y1º‘` Y@  F üì2ÔÄ991@ B ¼ /<ì290KSX@    <<ííííY33 ##º·âþTãÎþsÅ·`ýòþOýQ5Èþ“Ls`$@ F  ÔÔìÔìì1· ©¼© /<ìôì0356765!#!L¶8Dõ¸þ{X^™~±Å·û ÍoþPÂϺO` M@B ¼  F F üìÜìì1/<Äì290KSX@   ííííY! !###º >? ¹þ˸þʹ`ýîû °ý'ÙüPº` '@ ©¼ F F üì2Üì2ì1/<ä2Üì03!3#!#º¹U¹¹ý«¹`þ7Éû ýüÿÿqÿãu{Rº`@©¼ FFüìÔìì1/<ôì0#!#¹ý«¹`û Íü3`ÿÿºþV¤{Sÿÿqÿãç{F<m`¶ ÜÔüÜÌ1µ©¼/ôì20!!#!<1þBµþB`“ü3Íÿÿ=þV`\pþVgÕ (3B@5E)! '.E4üìÔ<<ü<<Ôìì1@,¹¸—41¹$Œ ½4ìô<ì2äô<ì20327&#"#"323>32#"&'4&#"326/‘{brrb{‘à9ƒS§éé§Sƒ9¹9ƒS§éé§Sƒ9à‘{brrb{‘/ëǨ¨Çû<9^N5=L^ýü^LþÃþíþíþËN^ýÇÙëǨýì¨Çÿÿ;y`[ºþå` (@ ©F üìÔ<ìüÌ1·¼ ©/ì2Ìô<0)3!33#ü9¹U¹““`ü3Íü3þR–`;@© ¼FÜìÔì2ì1/ä2Ôì°°#I° °#IRX± ¸ÿÀ°8Y0!!"'&533!3Hþ©™f\¸45h)¸×_V¸þõu;;öû º˜` )@ F  F üìÔüÔìì1· ¼©/ì2ô<<0%!3!3!3Ú¹ú"¹Ù¹“Íû `ü3ͺþå+`2@ ©  FüìÔüÔ<ìüÌ1@  ¼ ©/ì22Ìô<<0)3!3!33#˜ú"¹Ù¹Ú¹““`ü3Íü3Íü3þR>.` ,@ E  ÄÜì2Ôìì1@ © ¼© ©/ìÔìôì02#!!5!!!2654&qÖççÖþ8þ•$þù~ƒƒ—£¨¨¤Í“þ7“þ_ZZ^ÿÿº›`'ó"غ>`%@ E  Füì2Ôìì1·© ¼©/ìäÔì04&#!!263!2#!zƒ~þú~ƒý@¹ÖççÖþ9LZ^þ_nþ7£¨¨¤qÿãç{M@ HÜ<Ìôì21@† ˆ †ˆ¹©» ¹¸Œäôìôîþôîõî± I±IPX³@8Y073267!5!.#"563 !"'qž“ÒýÈ2 ŸÇš¡¦-þÛþÿ½“ÕV«Ú“ißV¬FþÃþñþòþÂHÁÿãL{ :@ E  Füì2Ô<ìÔìì1@¹¸¹Œ©¼/äÔìôìôì0"32654&632#"'##3J”¬«•“¬¬ýqùððþîðñþù и¸ßçÉÉçèÈÇéþ¾þÈþìþíþÇ.øý÷`þAt"`<@  ÔÄìÔì21@ B©¼ © /<Ôìôì0KSX·  ììY;#" .5463!##z€wøøw€þúVtš×Ù¶¹åþ¶S^a\ü뉢¡û Ùþ'ÿÿqÿãk&ÁCZÿÿqÿã&Áj–…±’—B°“°˜B±€B±B|°°#I°#°#Ia°€bh°#Fa°F`°’C°`#B°’C°`C°UX°°’C°`C8°°5Y±€B±B°°#°°#Ih;°#°5°°##I°@PX°#°@8°#°5°5Y/þV?@N F ü<Ìì22ÌôüÌ1@©©‡ —/ìÔÄìÜ<ì2Ôì0#533!!>325654&#"#ß°°¹ýãB²v¶Øþ©×zõ||š§¹Ñ´þLþmedéþêâþY)Œ.ÒПĞþûÿÿºØm&¿v†qÿãç{N@ HEüä2ü2Ì1@†ˆ†ˆ¹ © »¹¸Œäôìôîþôîõî± I± IPX³ @8Y02&#"!!327# ¤¦¡šÇŸ 2ýÈÒ“ž“½þÿþÛ-{F¬Vßi“Ú«VªH>=ÿÿoÿãÇ{VÿÿÁyLÿÿÿôF±ÿÿÿÛþVyML¿`6@!E  ÔÔìÔ<ìÔìì1@© ©©¼©/<ìôììÔì0356765!32#!!%2654&+L¶8DØ«ÖèçÖþ›þšX^x~„„~£™~±Å·þ7£¨¨¤ÍoþPÂÏv_ZZ^þº·`8@E   Füì2Ü<ì2Ôì1@ ©  ©¼ /<ä2Ü<ì2ì032#!!#3!2654&+N«ÖèçÖþ›ýÞ¹¹"\~„„~£`þ7£¨¨¤ýü`þ7Éü3_ZZ^þ/‰:@N Fü<Ìì22ôìÌ1@©‡ —/<ìÔÄìÜ<ì20#533!!>32#4&#"#ß°°¹ýãB³u½Ê¸||˜©¹Ñ´þLþmedêíþÐ*ŸžÁ¡þûÿÿº‘m&Ævoÿÿºyk&ÄC]ÿÿ=þV&Ïš^̺þå` )@ F © F üìÔüÔìì1· ©¼ /<ä2ìÌ0)3!3!#Tþf¹U¹þf“`ü3Íû þåsÿãÕ48@$%6 )  5üÜììÔüÔììÜì1@ $•-/<ì2ô<Ì0"'&46733276=332764''3#"'&':Óy{d;]ùT‡CHI}rHGÇFFt†AGC‡Tú_8d{{Ñ’ed''de±´˜ÉŸFþ¿Ÿ·þÍkmihÆññÆhimw'·ŸAF‚œþç¾þf²±^^­­^^ÿÿ‡ÿã'`V±Õ!2#!!5!53!4'&#!!276XNûþðûýèþpÊqON£þ¼D£NOQâÚÞÝÚQ¤àà¤ýf‹DCýÝDCçÕ$4&#!!2!5!3!!!2##ƒ~þú~ýÃþ»E¹Eþ»ÖççÖò´^þ“Í“uþ‹“þÊ£þ°¤Óÿãð+#3376!2&'&# !!!2767# '&ÊÊÒÃS†vwhfst‚ÿˆg²ýF‰ÿ‚tsfjwv„þ­Ãº Çý9Õýœ§Ð$#GÕ_//œwƪþó”//_ÓH$$ÏÆOÁÿã{#2&#"!!327# '&'##33676>¦¡šæ\" Ìþ, žUxž“¼þó”{ “¸¸˜z—{F¬V´AWô^3VªH­äýü`þ3Ê€žøÕ !#!#!#3 øáþêþéÊþçþêáå±þÜþÜýåýåÕüó7ýÉ3` !#####3 Ãìã¸åìÎÑóó•þk•þk`ý¹¡þ_É Õ!#!#!#!#3!3  áþêþéÊþçþêáoýøÊÊ_<å±þÜþÜýåýåÇý9Õýœdüó7ýÉÁÐ`!#####!#3!3 ÐÃìã¸åìÃþk¸¸éÑóó•þk•þkçþ`þéý¹¡þ_sÙÕ##767!#'&'!‹Ê“d‚Õ½xªþQþP¤t¼Õ€`ø>ýƒYý§Y~¤þåbÒ†1êý2‚Òþž¡zÊ(k{`! #4'&'##767Eþ]Ñþ»kK‰ÃV:V¸S8V‰Jlþ»¶þ–ýÌ&VœþìÇtOþ\¢KtÉœU'4ÉÄÕ! !#'&'##767!#3!ïþŸþP¤t¼Õ€`™Ê“d‚Õ½UnýµÊÊ„>ýƒqdý2‚Òþž¡z ý§Y~¤þåbÒ_4ý9Õýœn(Á.`! !#4'&'##767!#3!7þçþ»kK‰ÃV:V¸S8V‰þ’¸¸þ]ÑwéýÌ&VœþìÇtOþ\¢KtÉœþ`þ?þ–sþVszS#"&#"3276&#"#"'&54763!27654'4327654!"567376767632'&#"ss˜ÆDº#`ÜA€t bTDt;ü<}J£5?u_hFA»XùV£RuþÅ¥Þ Ÿs j#B#' "2Z¦brþïRU¾Ïgˆ‚r %§',a’zQ^XRj½7¦&6îJ´- ƒþƒÞ@' WoÊWd§þýE\`[þtÈO#"&#"32632&#"#"'&53!2654'&'"#5223 54'&#"5673767632&#"Èvm¢D¨Pb!',²-cX;b1Ò2i?‰Ä,ZnN .ër‚‚rë. >þ.þ¡˜½½˜_- > ^˜¼¼˜þ¢ >‘¤òó¤‘ ‘¤óò¤‘ ¡ªÒtÓª ªÓþÆþÇÒ« qÿã¡{&P%327654'&+"&'&'#";67>2# '&5476!36767623 !#"'&'&r-¡HVV?ª- ,4, -£GVUH£- ,4 É.þÿx‰‰t. 4 .w‰‰tþû. 4 ¤`t·§ƒa  _t¸¼p_   “‰œî颈   ˆœï袉   vÿãút N#&#"56763 #5765#53#"'&'&#"0#"'&547673!27676323 4'&'39v£Z^™‚‡Nzz%éòG!…ñ¾ftê[na`zxz{Ân[êtfCGoù~[UŠ]LKf›dKJ]ŠU[~úoFCP›/L†&+CþYþõg,'Ižûò‹žD@@DD€D‹òÆâì˜kóâ¶þº63366336F¶âók˜ìâ˜ÿã¡ :#&#"56763 '5765#53!"$"# 33276762324žv£Z^™‚†Ozz$èòF"…ñvŠþrTþÕðþÔRþrŠÆ’Ð>IxdüdyI?Ð’ì›/L†&+CþYþôg,'IžþÈþãþëþPââ±þ¹úþû8[ 77 [8øGÿÿsÿã3'’cSìÿÿ‡ÿã'à&’ísþV'ð!# '&76!2&'&# 3!#ú®þ¥»ÃÃÃS†vwhfst‚ÿˆˆˆ˜ðkÉÆÐShÏÐ$#GÕ_//œþØþÓ‚”ý°qþVç{! '&576!2&'&#";#˜þû•—–UQQLNONP³cccc³õÉ–Ÿú#¬+qr͹rqýê;ÿ¥Ê§'''7'77'77ÊdØiØdØ}®}ØdØiØdØi®i®}µ}®}ØdØ}®}µ}®}µdµûÚÞÿBz/!"'&'&'&547676763!47676762þ¹þ3 8 Í 8 g    ý) M #&#"56763 v¢][“ˆ‹Jw}$)›/K†'*Cý³Âþ¥a"53#7þ¥òñ…†Â ”žý³Âþ¥a#55#53þ¥ò†…ñÍþõgž÷ÖþF` &3@MZg#.#"#> #.#"#> #.#"#> #.#"#> #.#"#> #.#"#> #.#"#> #.#"#> þÇv aWV` v ž"ž8v aWV` v ž"žù®v aWV` v ž"žfv aWV` v ž"žù®v aWV` v ž"ž·v aWV` v ž"ž÷ v aWV` v ž"ž‰v aWV` v ž"žAKKJLþQKKJLKKJLúKKJLKKJL)KKJLKKJLû˜KKJLøXýÃÂ- #)/'7'7'7%'%53-#%5#53 3#k–yo\©ûw–yo\©–zV\þãúL•yþ©[`¬@þÀøÂ¬þÀ@_Ó¤RÓÓ¤RZ–yþ©\µ–yW\þãþñ•zn[©ûw–yo\¨Ô¤‚RÔÔ¤‚R߬@þÀøÂ¬þÀ@ÿÿÉþVüm&“ÏõuÿÿÁþV8&”š ÿÌ!ìÕ!2#!#535334'&#!!276“Nûþðûý訨ʨÜON£þ¼D£NOQâÚÞÝÚQ¤àà¤ýf‹DCýÝDC&Ež 4'&#!!276!2#!#5333>C€þùB>ýøÐyttsÖþ9››¸L^*.þ—.+ßþÊURþ°RRÑ>þÂÉáÕ'+#!2'674&+327'7UŒj’~ÖþÊÈû€â šþþrG×j#u~{Sý¨ÕqrÛ’-,9†’ýÏ/´~ºþV¤{)%'7654'& 32'#"'&'#367632*ŒnŠOSTþÜTSST’F“o•Wl{XY:¹¹:YX{Ì€€ ˜§]¥sÅËtstsþjts®]³.01dý® ªd01¢¢ýð¢Éj@ •üüÜÌ1/ôìÌ03!3!É÷ªý)Õ2þ$úպК· FüüÜÌÌ1µ©¼/ôìÌ03!3!ºƒ“ý¢`:þ3ü3GïÕ )@ • • Ü<Ìü<ÌÌÄ1/ôüÜ<ì20!!5!!!!!Nþù¡ý)#ýÝ”ª—ªþªýl8U` +@  Ü<Ìü<ÌÜÌ1@  © ©¼/ôüÜ<ì20!!5!!!!!?þùý¢ þ`ôªÂþÛªþ ÉþfÌÕ3@  üü<ÜÌÄüÌ1@•°••/ôìÔìôì0#!!!2+5327654&#“Ê¡ý)¡ºqmÌäL>†87||Çý9ÕªþFwrîþÎþòôªKKÂ"ŸžºþV `3@  Füü<ÜÌÄüÌ1@©½©©¼/ôìÔìüì0#!!3 +5327654'&#r¸ý¢úFRRQµÁ¬n!&&1†çþ`ªþÁGQåþòÖ``œ07“ª )(þ¿‘Õ33 3## # # 3êʪõýß׈Å)þþþÊþþþÓDýßõªÕýâý³ý"þAþéþêüÿˆMýFþå`33 3###'# 3?·éÖþnfz¸!þ‡»·»þ‡ÅÌþnÖé`ýòþQýèþL6Éþ“mÉýʱ¯ýòÿÿ‡þušð&z9£ÿÿ…þuÈ|&zÎÃÉþ¿´Õ3! 3## #ÉÊÒý¿í ÅEýúþïÊÕýâý²ý#þAþéþºþå³`33 3###º·âþTwޏ8þsÅ·`ýòþOýêþL5Èþ“ɆÕ373! ###ÉÊ­dÁý¿_Üýúd­ÊÕý±TîËý²üyþ%u±þº‘`37533 ##5#º·`eBâþTãÎþse`·`ýòaÝvFþOýQ5þÅÔaþ“!†Õ33#! # ##53Éʨ¨Òý¿_Üýúþïʨ¨ÕàþŽâý²üyþéþe=‘3!!3 ###53º·dþœâþTãÎþsÅ·}}z}ý5þOýQ5Èþ“}2²Õ _@   ÔÜì2ÔÄ991@B   ¯ /<ì29ì0KSX@    <<ííííY!! # #!2Òý¿_ÜýúþïÊþ=Õýâý²üyþéþ+*‚` _@   ÔÜì2ÔÄ991@B   ¼ /<ì29ì0KSX@    <<ííííY!3 ##!*8âþTãÎþsÅ·þ`ýòþOýQ5Èþ“ÆÉþ¿Õ6@ •­•  • 8 üì2üì2<ì1/<Ììä2üì0²P]3!33##!#ÉÊÞÊÉÉÊý"ÊÕýœdúÕþAÇý9Áþå@`1@ ©¼© F ©  Füì2Ü<ìì2ì1/<Ììä2Üì03!33##!#Á¸W¸¸¸¸ý©¸`þ3Íü9þLýüÉÕ -@• •­  8 üì2üì2Ä1/<ä2üìì03!!!#!#ÉÊÞ¡ý)Êý"ÊÕýœdªúÕÇý9Áæ` +@© ©¼   Füì2Üì2Ä1/<ä2Üìì03!!!#!#Á¸Wý¢¸ý©¸`þ3ͪüJýüÉþftÕ8@üìÔ<ìÜÌüÌ1@• ­••/<Üìôìôì0#!#!!2+5327654&#;Êý"Êr¡ºqmÌäL>†87||Çý9+úÕÕýœwrîþÎþòôªKKÂ"ŸžÁþV!`3@!F üìÔ<ìÜÌüÌ1@  ©¼/<ÜÌôìÜÌ0#!#!3 +5327654'&ˆ¸ý©¸ÇúFRRQµÁ¬n!&&1†çþÆü:`þGQåþòÖ``œ07“¤&.sÿ-'ð1?Y@ 26>6A $0,@üìüÔÌÌìÔì91@ 2:¡•0•Œ@:•%¡$®(• ‘@ôìôüÜìôìÜìÔì90%&47632327#'#$'&76!2.# 32767654'&#"Ed`_©¨ÀfJxuŽTGIRþé¾DLþż½ÃÃSu‡^\úyÿˆˆ‚ÜÙI0a++IJ++ˆ¹Ü}}úÜÖs?]¦À ÑÒbhÏÐ$">·7^œþØþ覤.$?ÖxEGEFyþäqÿR{ ?5@$  A2H;*E@üìôÔÄÌìÔì91@7¹.¸&Œ@äôä%67654&#"&54763327#"'# '&76!2&'&#"3W!V0),3MNƒ„NM‰'8HeZ>FRë‰5<þýЉ—–UQQLCZIU³ccUT«­q‡HT*.N³›…›WXXW¥µš,4ž—œ#˜qrÍÉtsÿÿsþu'ð'z-­ÿÿqþuç{'zÍÿúþ¿éÕ ,@ @ @ ÄÜìü<ìüÄ1@ • •/Ììôì20%3##!5!!×ÉÉËýîïýîªþA+ªª<þåm` (@   ÜÜü<ìÜÌ1@ ©¼©/Ììôì20%3##!5!!¯¸¸µþB1þB™þL¶ªªÿÿÿüçÕ<=þV`o@¼  ÔK° TK°T[X¹ @8YK°TX¹ ÿÀ8YÔüI:91Ìä20@BKSXííííY"%#3 3ÅÃþ;Ã^^ÃþD¼Nü”lÿüçÕ!#!5!53 3!ßþøËþùýðÙž›Ùýðsþsªªýšfüòª=þV` !!#5!5!53 þFþúÃþïþ;Ã^^`û²XªººªXNü”l=þ¿;Õ%3## # 3 3ËpÅþ\þYÚþ/ÙsuÙþ ªþA{ý…¸ýÕ+ý3;þåy`%3## # 3 3q¸!þºþºÙ³þrÙ))Ùþk™þL¸þHJþqýßÿúþ¿GÕ%!33#!!5!!ÖÞÊÉÉûŽýîïýîª+úÕþA+ªªþåB`%!33#!!5!!xZ¸¸¸ü9þB1þB™Çü9þL¶ªª¯þ¿|Õ%3##!"'&533!3³ÉÉËþ_ºqmÉ||x˪þAÇwrî7þÙŸžd–þå¸`%3##!"'&=33!3¸¸¸þ©™f\¸45h)¸™þL _V¸êÓu;;¾¯³Õ#"'&53;333###‚;ºqmÉ||ÖËËÖÇwrî7þÙŸž9þÇdú+ÇþÏ–`5333###5#"'&=3ù ¯¸¸¯ ™f\¸4+¤Âľû  ÄÄ_V¸êÓu;0¯³Õ$@  üì2ÔìÌ1·• ­/<ôôì0!2#4&#!#z¡ºÞÉ||þˆËÕýœéîþfŠŸžý9ÕÿÿºdKÿãð"*I@#$ $3 +Ü2ÜììôìÄ91@¡® •$­ •(•‘Œ+äôììô<ì2Ìôì076! !!267# '&'&=3%!&'& ²"–¼:Cµ»ûp‹üpoƒ„’þ¢Å¼ ªvzªKB@­b‚þH€amªÒÒÛþ„þôþÎ`_×F$$ÍÂUgkßL>D9¿|¤¤|ÿâf{%.i@.&&K /Ü2ìÜ@ p0°0Ï0]ìôìÄ91@&†ˆ &©¹"»*¹¸"Œ/äôìä²o]2ìü<Ìô²/]ì90"'&=33676!2!32767'$'&&'&#"XY`œ09Jt’ÿ⃄ü² fg·jdcbchneþóœ”NRSˆš]\RZ¬F1—!&Å‚¡‘’úZ¾dc4®*—…—ZZWWžÿÿþuð'¼Gÿÿþuf{'çHÿÿÉ“Õ,ÿÿ(vm'Ï[u¢ÿÿFïH'š¨ÂÉþf5Õ32+5327654&#!#3!©‹ºqmÌäL>†87||þˆÊÊžqwrîþÎþòôªKKÂ"Ÿžý9Õý‰w¿þVˆ`3 +5327654'&#!#33^HRRQµÁ¬n!&&,‹þü¹¹%ëwGQåþòÖ``œ07“¦$)þ`þã6þVÕ!#!567!3#:Êþ„bþ‘ÔCuxÉþ’†+Ôþþªý8§.¨%5úÕªþV.þV+`%3##!56765!s¸þÞ{å¸þ{v^þ̳;bõ™™þVªdžþ’þüϙϧÔÉþf;Õ1@ 8üì2üìü<Ì1@ •­ /ä2üìÜÌ0%!#3!3+53276qý"ÊÊÞÊÎãL>†87h_ý9Õýœdú“þòôªKKÁþVˆ`/@ F Füì2Üìü<Ì1@ © ¼/ô<ÜìÜÌ0!#3!3+53276Ðý©¸¸W¸RQµÁ¬n!&ýü`þ3ÍûŒÖ``œ07ÉþVÕ!#!#3!33#;Êý"ÊÊÞÊÉþ’†Çý9ÕýœdúÕªþVÁþV@`!#!#3!33#ˆ¸ý©¸¸W¸¸þÞ{ýü`þ3Íü9™þV¯þ¿³Õ%!"'&533!3##èþ_ºqmÉ||xËËɪwrî7þÙŸždú+þ¿ë–þå`%!"'&=33!3##Hþ©™f\¸45h)¸¸¸™p_V¸êÓu;;¾û þå´ÉþVèÕ%3####! !Éþ’†+ÅþËþÄ-}-ªªþVªüúáÕüøÁþV`%3####! !H¸þÞ{å²þ˸þʲ>?™™þVª°ý'ÙüP`ýîÿÿÁyOÿÿh’'šÎJœ´+1@oo]0ÿÿ{ÿã-&šO×¼´"+1ÿÿhN&œÈ¼u´  +@ 0?  ]1ÿÿ{ÿã-&¼jR ´-( +@(o(P-_(@-O(0-?(-( ]1ÿÿHÕˆÿÿ{ÿão{¨ÿÿÉ‹m'Ï¡u¡@@]1ÿÿqÿãH'š–Á@p]1ÿÿuÿãÙðQÿÿqÿã{ÿÿuÿãÙN'È ucÿÿqÿã&jTdÿÿ(vN'ÈQu¢ÿÿFï'jžÂÿÿ‡ÿãšN'ȇu£ÿÿ…ÿãÈ&j:Ãÿÿ ÿÁøÕyÿÿXþL/`TÿÿÉ31'qõ;¤ÿÿºyõ'q’ÿÿÄÿÿÉ3N'Èõu¤ÿÿºy'j’ÄÿÿsÿãÙN&ªÈ'u´ +@ @O]1ÿÿqÿãu&Êjs´ +@ @O0?]1ÿÿsÿãÙðaÿÿqÿãu{7ÿÿsÿãÙN&sÈ'uÿÿqÿãu&tjsÿÿoÿã#N'Ègu¹ÿÿqÿãç&jâÙÿÿ#½1'qr;¯ÿÿ=þVõ&q^ÿÏÿÿ#½N'Èru¯ÿÿ=þV&j^Ïÿÿ#½k'Ñru¯ÿÿ=þVf&Ÿ^Ïÿÿ¯³N'ÈÌu³ÿÿ–&j^ÓÉþ¿jÕ #@ •  üü<ìÌÄ1¶•/ÌÌôì03!!3#É¡ý)ÉÉÕªûþAºþåÐ` #@ © F üü<ìÜÌ1¶©¼/ÌÌôì03!!3#ºý¢¸¸`ªüãþLÿÿÉFN&·È·uÿÿº›&×jGþVïÕ9@  Ü<<Ìü<ÌÌÄÜÌ1@ • •/ôüÜ<ì2ÌÜÌ0!!5!!!!!!+53265Nþù¡ý)#ýÝiGR¿þéiL”ª—ªþªýì”È`nœa­8þVU`;@  Ü<ÄÌü<ÌÜÌÜÌ1@ © ©¼/ôìÜ<ü<ÌÜÌ0!!5!!!!!!+53265?þùý¢ þ`nFRÀþéjKôªÂþÛªþŒ”È`nœa­=þf+Õ%+532767 # 3 3*SfäL>‡7( þ^þYÚþ/ÙsuÙþ ¾bzªK5sxý…¸ýÕ+ý3;þVd` +527>5 # 3 dþkkCQÄÁÄO5þ½þºÙ³þrÙ))`ýßþ&9Íasœ m˜´þHJþq=;Õ3 3!!# #!5!ÙsuÙþNtþÎÙþ\þYÚÔþŒ–ÕýÕ+ýwýD{ý…¼;y` 3 3!!# #!5·þ©Ù))Ùþª þà~ÙþºþºÙþß”Ìþqþ4ýü¸þH‘´Õ &@  ÜìÔì2ì1@ •­ • /ìäôì03!!"!"$54$3!fON£Dþ¼£NONýèûþðûN·ŠCD#CD“ú+ÚÝÞÚfqõ` %@ F EüìÔì2ì1·© ¼© /ìäÔì03!!"!"'&763!5>Bþù€C>Àþ9ÖsttyÐLZ+.i.*¶û RRPRUÅ‘ÿãCÕ 09@2&)  1ÜìÔì29Ôìì1@"••­-Œ(¼1ììä2ôìì20!"32765#"'&54$3!3327653#"'&êþ¼£NOO_´KV! 3j^nîˆûNÉ?4pi;?Ênh×Ùf1ÉCDþêP_m}ŸþÝ`61‰ÊÞÚfûì[JJO›ŸýZàxx9qÿãs` 08@2F&) E1üìÔì29Ôìì1@" ©1©-Œ(¼1ìÌä2Ôìì20!"32765#"'&54763!3327653#"'&=þù€C>A@j”\-1C]^ˆ¬fetyи>¸dhÎÓd.*^\:9m4œþöl01a`¦ªRUÅýaŸPOORAþ¸ìsxx%Éÿãð74'&+5327654'&#"567632327653#"'&'&ª\]¥®¶•OOQR˜S¾rsdeY憆GGƒ‘RQ?4pi;?Ênh×Ùf0!²„JK¦;$&´ hi²|UV!bb€[JJO›ŸýZàxx8Pa«ÿãF|54'&+5327654'&#"5>32327653#"'&NH‰”›tCDFEwGQPabªLÄqr<=ih<>¸dhÎÇpb8f83˜,-F@.. §NO]@AHOHXDEORAþ¸ìsxueÉþV<ð)!#4'&+5327654'&#"5676323#sÉ\]¥®¶•OOQR˜S¾rsdeY憆GGƒ‘RQÉɱ…JK¦;$&´ hi²|UV!ba’þùý¬«þVƒ|)%3##4'&+5327654'&#"5>32È»¸¸NH‰”›tCDFEwGQPabªLÄqr<¸dhÎÇpbþ{v^þ̳;b`ýWŠORAþ¸ìsxue{†þ’þüϙϧÔÿÿÉÿã-Õ¸Áÿã`327653#"'&=!#3!ˆzgh<>¸dhÎÇpbý©¸¸W`ýWŠORAþ¸ìsxue{Ìýü`þ3Ísÿã‰ð0@  üìÜìÄì1@••• ‘ŒäôìÔüÌì0# '&76! &! !2653‰d-‰|—þ›ÄÀ¿Åe'ááþêýÛ%×{ʺà9!ÒÌÐÍҎ׿ýŸý ”¤ðqÿãF{0@ E EüìÔìÄì1@¹¹ ¹¸ŒäôìÔüÌì076!2&#"3253# '&q’– к¾Ä½bZZb½â¸Éåþü•Ž/¡nª||rþ|r|>¾Åì禞ÿúÿãfÕ327653#"'&5!5!×?4oi;?Ênh×Öinýîï+ü–[JJO›ŸýZàxx}âqªªÿãö`327653#"'&5!5!x>=ih<>¸dhÎÇpbþB1¶ý®VFEORAþ¸ìsxue{~ªªÿÿ¤ÿã{ðRÿÿ…ÿãÈ|BTþf:Õ!56765!+532765pþfbþ‘Ý:WxÍãM?†77+¸ýÊþøý8ª0£ödþú“þòôªKLÁLþVs`!56765!+532765»þ{X^þÌ»3Dõ£µF1a.&ÍoþPÂÏ™}¦зûŒÖÀœ0)¡²ÿã Õ F@   8A!ü²p]ìüìÔì³ 991@ ••Œ /ä2ôìÜì¶  9033265332#54&+! '&²Ë®ÃÂ®Ë ,”ÀœgQ]*-þæþå‘ÕüuðÓÓð‹ü\GC¶«F1l[R.•••$²)òK@  8Aü²p]ì2ü<ìì991@ ••‘ /ÄÄ´`]ôìüÌ0¶ Ÿ ]376! #54&#"!2#54&#!²‘$Ë®ÂîX•¿œgQý¨¤$••þÙþÙ9 ðÓÓð¶«F1l[ýÁ²Äò%D@   8!&ü²p]ìô<ì2Ôì991@  • •‘ /ôìÔ<ü<Ì0²O']32#54&+#!"'&54! 4&#"3)G•¿œgQGËþ*ÉŸn(!Ë®Âî5Z¦r¶«F1l[þ=ó|îï#þÖþÜþÎðÓÓ¢¢I|²ÄòH@   8Aü²p]ìüìÔì² 91@ •¼  •‘ /Äôì9ôüÌ0²O ]32#54&+#4&#"#576! Y•¿œgQGË®ÂîˑZ`¶«F1l[üO‹ðÓÔï 9$•••\²ÿã)Õ$30!2#54'&#!3276=3! '&²ËX•_`œ07Qý¨WWÃÂWWË‘“þéþå‘1¤þ‹[[«F1l*1þ™ðjiij¬ 9ã’•••›ÿºð$2%!67#"'&543 2#54'&#!3 7654'& fè<0I|à‚ƒâƒq4ç•_`œ07Qý5˧OPPOþðOPP¯áÐ'.ˆ‡ëæƪäV]þÏþ÷[[«F1l*1LL]]¢¡]^^]¡¢]²ÿ)ÕD@8 :  üì2ô²€]ì99ôì991@ ••¼ /ääìÌüÌ0%!2#54&#!3!2#54&#!}…•¿œgQý°ËX•¿œgQý¨¯¶«F1l[Õþ‹¶«F1l[²ÿ)ò@@  8Aü²p]ìü<ìì991@ •‘ •/ìÌÄôì0¶Ÿ]376! #54&#"!2#54&#²‘(Ë®ÄìX•¿œgQ¤$••þÝþÕ9 ðÓÖíý$¶«F1l[²Žò-:#'&'&763!&'&#"#76! 32#54'&!#"327654:gi˜’m‚INK(*WÂÃWWË‘—\!%•_`œ05þл™9:E5:.± ßrs Tf½“LQR2jjiðüu¤$•••[¢[[«F1j,1‡i--Q@“²Äò+#! '&4763!332#54'&)"32765pG‘þåþí˜nŸÉÖËG•_`œ07þþT¦Z5WWÂÃWW±þþÜ•••Ž.à|³’þn[[«F1l*1}H•àijjið²)Õ:@ 8Aü²p]ì2üì1@ •¸/Ääôì0²9¶Ÿ]363 #54&#"#²Ë Ñ(Ë®ÂÁ°ËÕþ;dþÝþÕK2ðÓÑòýó²ÿVÕ 3@ : üìô²€]ì991@• /äìÌ0@0P]!2#54&#!}…•¿œgQý°ÕúÚ¶«F1l[Õ²ÿãçÕ327653#"'&!#3|%3x*%ËqXÒÆdqþÌËË`ý×þå>WWK‡°ý7Õ}bbpi“üOÕþ‹Aÿã™Í$3! '&7#'&=33!2#54'&#%" 76'&Öɼ¼þÆþż½Ãg”``œ07Q°•_`œ07Qý¨á|‚‚¸€€y&áþ¤þŸÒÓÒÒbcÚ\[«F1l*1[[«F1l*1 ž¤þåþ椤¤¤©ž²)Õ!## '&33276=3)Ë Ñþí˜ËWWÂÁYWËÅd•Ž+&ýóðjiihò˜²ÿ)Õ !2#54'&#!5 uwüÉ •_`œ07QüÝ1þkÕþ®ü,[[«F1l*1¯ÀfÿÒÉð'1?%#"'&543267#"'&543 327%&#"32 7654'& ®oU¬Ie┃r0I|à‚ƒâƒq9ƒI9~d›•þÉX/? 9.YOPPOþðOPP@$2iùšwï'.ˆ‡ëæƪäþÚöd‡kÀWÆM( ]]¢¡]^^]¡¢]²ÿÄò?@  8Aü²p]ìüìÔì1@•   •‘ /Äôì9ôÌ0²O]%32#54&#!4&#"#576! )G•¿œgQþî®Äìˑ!¯¶«F1l[‹ðÓÔï 9$••þÖþÜ\ÿâ…Õ,3276=4'&#!#5354763!!"!2#5# '&ÙWWÂÁYW07Qý ²²`_•#ý Q70X•_`Ë Ñþç’±þ˜ðijjgò¡l*1¯«[[¯1*k[[«ýFd•”%²ÿãÄÕ!! '&332765!2#54'&#)‘þæþå‘ËWWÃÂWW•_`œ07Q&ý þÜ••••$¤üuðjiijð‹[[«F1l*1ŒÿãSò" $53 6&#!5!2654& #4$ 5þ÷ýJþøÊRS覥õý¿Aæ“Äþ–¸ Ê++.’WHþ±õèçö¢NM›IšŸ‚tYa[J¸¸þñ´\ÿãnÕ@@  8ÔìÔìôìÄ1@ • Œ•ôÜìôì¶ 9²À/0326=3! #"&=33®ÄìËþßþåþæþßG’œgQÝýmðÓÔï 9þÜþÖ-!ü¶¬F2lZ²ÿã)“ 3276=3! '&576%7%5zZ[¾ÃWWË‘ŸþôþÏz=s–ý9þ¤þ™W/¯hiikï 9þψ••¯Ö&dà¡AŒ¾¾¾œ¡žU²)ò7@  8Aü²p]ìüì1@  •‘ /<ôì90¶Ÿ]376! #4&#"²‘!Ë®Âî¤$••þÖþÜü\‹ðÓÓðüu²ÿB)ò4'&#"#576! %5%$76aZ[¾Ã®Ë  1y‘=þ–Çûï\gW/ίgjÔï 92‡••²ÓþÚdà¡AŒ¾¾¾œ¡žU²¡ò##576! #4'&ˈKuË®‘9)Ÿ¯ËuBGü”lP|Ý 9´••£þêü\‹ÌP›ÿºð0%&'&43 2#54'&#!3!767654'&'& ¢EðÊâƒq4ç•_`œ07Qý5Ë«e, 7OþðOP—£ÜܪŽæƪäV]þÏþ÷[[«F1l*1LÃÂ,ƒ@B¾@^^]¡ªt~²ÄòH@   8Aü²p]ìüìÔì² 91@ •¼ •‘ /<ôì9ôüÌ0²O ]32#54&+#4&#"#76! Y•¿œgQGË®ÂîˑZ`¶«F1l[üO‹ðÓÓðüu¤$•••\ÿÿ²ÿã)Õ8²ÿÄÕ!!# '&5332765332#54'&#^ Ñþí˜ËWWÂÁYWËG•_`œ07QÅd•)±˜ðjiihò úÚ[[«F1l*1ÿÿ‡ÿã¢ð6²)ò.@  8Aü²p]ìüì1@•‘ /Äôì0¶Ÿ]376! #54&#"²‘(Ë®Âî¤$••þÝþÕ9 ðÓÓðüuŒÿãSò0@ '&53 7654'&#""#6767&'&5476! "327654'&’RQ…„ýJ„„ÊRSèSSSRõâefg#R’HJ›““›IIþP´acIJåæIJcaW"cc¯õttstö¢NMMN¢§MMM *c" Y[€`XX^‘€[YÙ01YtAAAAtY10² Õ=@ 8  Aü²p]ì2üìÌ1@ ••¸ /Ääôìì0² 9²]54&#"#363 3^®ÂÁ°ËË Ñ—uçÛ2ðÓÑòýóÕþ;d•sâ¯ÿÿsÙÕ3\ãò,<47632#"'!2#54'&#!##"'&=337654'&Ð’ëô„‘‘„ôöIô•_`œ07Qþ Ë •_`œ07Q*Š]WW]Šˆ_WW_r•sppz•zpSÚ[[«F1l*1þ=Ã[[«F1l*1ÜA>T]=BD=[V>CÿÿsÿãÙð2‡ÿã¢ð167654'&4'"!"'&'5&'&547632¹qG^CCþ¼95+<&0âkl’‘þçjxw€{vEB¾[eK[¥ç”ýø 4D~n>=„>@%‘c3A +ml¶Ùpp/ÐE# ,,W`«×arÉÿÿuï‡ÿÿ²þ×Õ~^ñ©Â#33ÕvÕñÑxñ†%"#476327653ÿ[RB˜hjµ[RB˜hjÍTDD‚jlTDD‚jlÿÿžð}fCô^å¼7#47! !"33254'&'#"üž q3U7þþû˜a\ "ÍÌ9ñÓS üA5àz\&Œ²NZñ²%03!Zªª}ñ4þb–ºÿæb&^@PP F'üìüüüü<91@  ‡#Œ¼/ô<<ô<Äì290@0(P(p(( ( (¿(ß(ÿ( ]%#"&5332765332653#5#"'&®E``‚¯¾¹ruSS¹rw¦¹¹?XXyzVUØ|:<öâ¤ýb¢œ`^¤zýb¢œÀ¢zû ®h02>>ºþVd{?@ ‡¸¼  ©  N  Füì22ô<ì1/üÌäôÄì90´`Ï]54&#"!!#3>32¬||•¬ñý¹¹B³uÁÆÂÜŸž¾¤þ6¯þV ®edïèâqþV´{ <@" GE!üìô<ì22ÜÔ1@¹ ¹¸Œ© ½¼!ääìäôÄìÆî032654&#"##"3253!!/§’’¨¨’’§+¸:±|ËÿÿË|±:¸Zþ¦/ËççËËççû\RdaDDadªüO¯ºþV¾{=@ N  Füì2ô<ìÜÄ1@ ‡¸ ¼½© /<ììäôÄìµ  90!#4&#"#3>32!d¸||•¬¹¹B³uÁÆZþVHŸž¾¤ý‡`®edïèþ ¯®ÿãX?@ ‡Œ©¼NFüì2ô<ì21/ôüÌôÄì90´`Ï]3!!3276=3#5#"'&®¸òý>>|˜TV¸¸C±uÁddºZþLªþ ŸPO_b¡¥ýv¬fcxxqþV/{<@ G Eüìôì22ÜÔ1@¹¹ ¸Œ©½¼äôìäôÄìÆî03!#"325332654&#"ZÕþs:±|ËÿÿË|±:¸üÕ§’’¨¨’’§þø¢RdaDDadªýÏËççËËçç®ÿà,@ Füü<ÜÔìÄ1@ ©¼ ©—/äìÌôì0)3!!32#54'&Sþ[¸zý†í˜M`œ01þLªüùI[«F1i&&ºþVd{>@‡¸ ¼ © ½ N  Füì2ô<ì1/üìäôÄì90´`Ï]!4&#"!!3>32¬||•¬ñüV¹B³uÁÆžŸž¾¤üŒ¯ ®edïèý\ºþV6{ )u@ +G  F*üì2ôìÜij$Üü³!Ôì²!$ISX³ $<323#'&5476#"3276#§’’§¹¹:±{Ìÿ’¢5`¬ 4xBdB˜Ÿ‹J4/ËççËü' ªdaþ¼þø¯¡Z¡+h|{Nv¯qq<qÿã/ 4@ ! GE üìô<ì2ÜÄ1@¹Œ ©¼— äô<ü<ôì0!"32765#"4763!33¢þƈbO§’šMS¸þìK•öÿ}ù<¸Õ¶za¬ËçksÔ‡þCþ¯š+Dß«§´þLªºþVd5@ ‡¸ — ½N  Füì2ôì1/ììôÄì90²`]#4&#"#3>32d¸||•¬¹¹B³uÁƤý\žŸž¾¤ûݾýžedïÁþV×` @FüüÔÄ1@¼©½ôää0!!3y^ýê¸þø¢ ºþV†I@  NFüì2Ôìôì21@‡ ©¼Œ—½ /äääô<ìÄìµ 90²@]32653#5#"&5!#3”||•­¸¸C±uÁÈþ—¹¹`ýaŸŸ¾¤{û ¬fcðçüú ¾þLqÿâ¼0\@ 2 $G,E1üìôìÜÄ´,ÜÜì1@ ©0¼1©—1¹(Œ1ôìôìô<ü<0´!""<<µ!ìì²<<#"327676''&5476;#&!!'&'&4763Ã[¥AS§’­].þÝSD81“N/VþÉ®!…‡â÷qÚ¶ZsºËç–IR\++˜(VL-%¯)$žªþ¶?‰¦¡¢뮘®þVX:@  ‡Œ— ¼ ½  NFüìôì21ìääôÄì90´`Ï]332653##"&®¸||•­¸¸C±uÁȺZû­ŸŸ¾¤{ùöVfcðÿÿºdKqÿãZ 4e@ GE5üìôü<@ (''*%%*3ÜüÔì9/ì² 91@.© ¹¸¹Œ'—/äôÄìôìÜì² 90@ `6€6 6à6]32654&#"#5#"325&+"'&5473;2/§’’¨¨’’§énD¸:±|ËÿÊWCv>!¸%“7)/ËççËËççkP¨þÛýÕ¨daDE<6pG5P0,!K7ºþV9{;@ N  Füì2ôìÜÄ1@ ‡¸ ¼ ©½ /üìäôÄìµ  90!4&#"#3>329þs||•¬¹¹B³uÁÆþø¢HŸž¾¤ý‡`®edïèüT®ÿãX-b@ (N  F.ü<ìô<ì2¶ -9·  ìì° /1@%‡Œ©¼†—/ôìô<ü<ôÄìµ! (90#5#"'&=47#5367$732%326=4'&#X¸C±uÃbdzzÚp˜­Ý>Bi°‚Oý˜Š>Ay•­cW ýà¬fcx{äIéʪ€`®&¯$„%8ÃvÆåJ¢MO¾¤;Ï)ž®ÿã +?@-% $NF,üìôì2ÜìÜÄ1@ &©—$‡&)Œ¼$/äôÄìôì90332654'&/&7676;#"#5#"&®¸||•­ M.=<‹ìì(`¸C±uÁȺ¦ýaŸŸ¾¤— ¼p0.-¯ *ó/(ü„¬fcðÿÿÿÛþVy`ù2ÿãZ#G@%  N!$ÔüÌÜìôì2Ä1@  !© — © ¼ ‡Œ /ôÄìô<ìôì90;32653#5#"&5#"'&5476;#"òƒó||•­¸¸C±uÁÈ;•^PZl}YYƒêŠýaŸŸ¾¤{û ¬fcðçü^P”zKW¯ þV•{!<@ #E F"ü<ì2Ô<ìä1@ ©½"¹¸"ôìÔüì0¶!  ìì3!!"'&547654'&#"#4632†/îýÃQ@'$ÍC#@l;q¹»¯ÔsDEÀ ¢E+G56­dZY0Y^c£Ô«e’“eÿÿºd{QFþV;`%X@##'  &ÔìÜìÌÜÄ9/ì1@#©¼&©½&üìôì990¶%  ìì¶ ! ìì3!!"'&547676/&5476;#&(3îýÃW:'$F[•L2Öse`6Žg+¶! ¢E/>A/­(32Âýê||•¬¹¹B³uÁƯ¯žŸž¾¤ý‡`®edïèþ ÿÿ®ÿãX`X®þV-=@    NFüìôì2ÜÄ1@ ‡Œ —¼ ©½üìääôÄì903326533!#"&®¸||•­¸ÕþsC±uÁȺ¦ýaŸŸ¾¤/øä¢Vfcð®ÿã{%i@  PPF&üìü<ü<üì1@‡¸ "‡Œ ¼ /<ô<ôÄìôÄìµ9µ  90@0'P'p'' ' '¿'ß'ÿ' ]3>32#4&#"#5#"&533276¸B³YÁƸ||zUV¸C±dÁȸ||‚XWå{®edïèý\žŸž_`£ý‡¬fcðç¦ýaŸŸ_\ºþVd{7@ ‡¸ ¼ ½N  Füì2ôì1/ìäôÄì90´`Ï]#4&#"#3>32d¸||•¬¹¹B³uÁƤý\žŸž¾¤ûÝ ®edïÿÿqþVZ{JÁŸ`@FüüÔÄ1@¼©/ìä0%!!3y&ý"¸¯¯`®þV%k@  PPF&üìü<ü<üì1@‡¸ "‡Œ ¼—½ /ìäôôÄìôÄìµ9µ  90@0'P'p'' ' '¿'ß'ÿ' ]3>32#4&#"##"&533276¸B³YÁƸ||vYV¸C±dÁȸ||‚XWå/ýžedïèý\žŸž_\§ûÝVfcðç¦ýaŸŸ_\þV¿{$U@&E  G/Ü<ì222ôìÄä1@"¹¹¸Œ%©½¼%äìÜ<ü<äôÄìÄî²IPX±32#"&'!!#54&#"326Õ¹:±{ÌÿÿÌ{±:éý¹+§’’§§’’§ú–Īdaþ¼þøþøþ¼adþô–°°)ËççËËççÿÿqÿãu{RzþV–*"-6u@83 .# *E7ü<ìÜ<<ü<<ÜìÄ1@†&¹—7/ ‡ Œ"½7ìô<Äì2ôìì³#99²#9¶3.  90´#,<<µ. #ìì"'&'53&'&547632##4#"27654'&,Dd†„%ßKcçfep_˜{5S#Âal’~¢¸EU@<%I]7_E8B»Q£-a`¥ta2N•þ©-blëþÚiZþn!vFDs:#÷ý+I¿³J>®ÿã¶8@    NFüìôì2ÜÄ1@  ‡Œ— ¼ ©/ìääôÄì90332653!!5#"&®¸||•­¸^ýêC±uÁȺZû­ŸŸ¾¤{üO¯¬fcððÃR@ü<ì21@ƒƒ/ì/ì073#3#ðÓÓÓÓþþRþ`¤ í27#"'&'3U ooÍ,rr€ON§cA¢UUŸWDþCÚÿÓ´ Ü<Ì21¶ÜÜÜI:03#3#D––––-–d–ÿÿ«þC‚ÿÓ'õ¨ûþä°KRX»@8<1YÿþC¢ÿÓ %¶  Ü<Ü<ÜÌ1@  Ü<Ü<ÜI:05!73#3#ÿ}––––Ö–––d–ÿþC¢ÿÓ.@ Ü<Ü<ÜÜÜÌ1@   Ü<Ü<<ÌÜI:03#3#'#5#5! ––––ú–}-–d–úÈÈ––Dþ»ÚÿQµÜÌ1ÜÌ03#D––¯–ÿÿÇþ»WÿQ&ù}ùƒ²ISX¹@8Y1ÇþCWÿÓ O@   ÔÌÜÌÜI:1²ISXA @ÿÀ88Y@    Ü<Ü<ÜI:03#3#73#D––}––ú––þÙ––––cþ»»ÿQµÜÌ1ÜÌ0!!cXý¨¯–cþu»ÿ¡´ ÜÜÜÌ1´ÜÜ<Ì0#5#5!Ú–áXõ––––––µÔÌ1ÜÌ03#––––ÿÿ––þÿÿ/þ¹ÿÝ'ùßÿ`&ùåöùþëŒ=² ISX¹ ÿÀ8Y³ I:1² ISX¹ ÿÀ8Y² ISX¹ÿÀ8Y³ I:0Nåä{µÔÌ1ÜÌ03#N––{–DþCÚÿÓµÜÌ1ÜÌ03#D––-þpdÆj!!dýåj¤c»–µÔÌ1ÜÌ0!!cXý¨––Ñÿ8‹(´ÔìÌ1²ÌÌ0´@P]3#Ѻº(ú¯–µÔÌ1ÜÌ03#––––Å[–µÔÌ1ÜÌ03#Å––––Ñ‹`#¶ Ô2ì2Ì1´¼/ÌôÌ0´@ P ]3#3#Ѻººº`Êý4ÊfÜ` ¶  ÔìÔÌÌ1¶©¼ © /ìôì06;#"!!fÍã’”†n¼ýŠ^ô–ÂþcþC»ÿÓ´ ÜÜÜÌ1´ÜÜ<Ì0#5#5!Ú–áXÃúú––²ƒ`V@ FN  FüÄìôÄìì1@ B¼ /<ô<90KSX@í <<ý <5–¸²G.Ùþi=d¸ªBôÙ]Gg`²þó¹"þ:T„Ôë®)yýú‰ÔX†`!·  ÔÄÜÌÔì1·©¼ © /ì2ôì04&#!5!23!5!&n†þZ¤ãͦûÒÎy–ôþòþ1CZ`G· ÔÄÜüÔÄ1¶B©¼ /<ôì0KSX@     í íííY4&+532##n†Œ’ÜÌ’Ç[þäÙË^Þ•ôþò<ýÞSþ­"Xh`$µÜìÌÄ1µ©¼/ôì20@]1#!5!žºýtÑü/Ѻd`4@ FN Fü<ìôìì1¶ © ¼/<ôüÌ0@ @P`p]!#3#4&#!5!2s¹¹ñ¹n†þúãÍŠývy–ôþòºt`¶FFüüì1²¼/ô0²]!#3tºº`X¦` #¶  ÜÜìÔÌ1µ©¼/ôì20@ ]5!"#7XNrXºGÑ–Âý‡y Kºd` (@ F N Füìôìì1µ© ¼/<ôì0@]!#4&#!#!2dºn†þ½¹úãÍy–ü/`ôþòºÿã¿`*@ E FüüÌÔì1@ ¹ © ¼Œäô<ìî0332654&+532! ºº•³›¯„w„„Äðþÿþþþ÷ù`ýêþýÀÈëÅÒþêþðþÏþÚ/ºÖt`¶FFüüì1³¼ôÌ0²]#3tººÖŠXþV` ,· FN Ôüìä1¶©¼½ äôì0@  ]#4&#!5!2ºn†þúãÍþV#–ôþòX` @ EN Ô<ôìì1¶ © ¼©/ìôì035!26&#!5! #Xtë’¦×þŒÀÛøòŽŸ’þøþØþ¿ïX&@ F NÔìôììÔì1¶© ¼—/ìôì04=!3!#þTý»þþ¬¿“[ÅCþLþ¬zþèlþòºd` )@ F N Füìôìì1¶ ©¼©/ìôì0@]3!2%!4&#!ºúãÍý6n†þ¾`ôþòý¢ê–Xž`^@ F EôÌ99Ôìì1@ ¹¸© ¼/<ä99äôì0°BKSX@   ííí í³ 99Y"#673632!5!4&þáWWHºFdÆÙašàÅÍýÎxŠѧ§“þðÈ €€ôþòý¢ŽÐ˨ºþVt`¶FFüüì1´½¼äì0²]#3tººþV XÎ` %·F  ÔÌÔìì1¶©¼ © /ìôì0@]4&+532!5!n†”’ãÍýмy–ôþòý¢Xÿã(` *@ E ÔÜìÔìì1@ ¹ ©¼ Œäôì2î0#5! !"264&+"ʸ þëþýøöÀéì×Ñþßþñþ´þÿ0þDµü¥þ_þÐNÿOé`U@ F ÄÄÔ99ìì1¶B¼/ä2990KSX@  ííí9í999Y%67676535673ßVGu"º,:Ép¥Îˆ‘LÞƒ4U›}*÷þÖþð¯ëp>1=!±"$ºþVd`1@ FN FüìÌüìì1@ © ©¼½äôìÔì0@]#4&#!;#"&5!2dºn†þ½\pTQ•óúãÍþV#–ðU;zÀdôþòºd`,@ E N Fü<ìÌôìì1@ ©©¼ ©/ìôìÔì0! )5!2676&+;#"&5º€*þ×ÿþ€4ã×Ýâ{\Lwuqó`þßþñþðþàŽ·ëæ»ðU;zÀCþVp`D@ F  ÔÔì9Ôìì1@ B½ ¼ä29ì0KSX@ í íY#3>=3#ºþÚÍØq_¸¥¨þV`ªþ}Õ›²ñÚC!`J@ F  ÔÄÔÄ99ìì1¶B¼© /ìô<0KSX@     õõ <=3!5!CÚcMg¸¶XCü"œ`ýú‰Ô›²þùÄþ:ŽºþVÜ`,@F Fü<ìÔììÜì1· © ¼½/ìôüÌ0!#76654&#!5!2#3äl)þW›zý®BË'â*ý˺ºu,/¬H‚‹èÂVvþâ.ý¸4X` )· FN Ôôìì1´©¼/ôì0@  ]!#4&#!5!2ºn†þúãÍy–ôþòº½`/@F Füì2ÔìÔìì1@ © ¼ ©/ìô<<Ôì033$763 76763)º¹ :¹0nþ‚LœÇaƒ¹„ÝþTþÃ`ýñ±SþÊlûþÍ+7ŸÔüýíÜþˆ`+@ F ÄÔÜìÔìì1@ ©¼ © /<ìôì20!#4&#!+53265#5!2ˆºn†þö£µdDrL¼~ãÍy–ýÅÖÀa¦;ôþòÿÿº `'–ÿÿº `'–ÿÿºÖ `'–ºä™`@ ´¼DÔì1ôì03#ÒÇþº™`þ„ºän`@´¼DDÔìÜì1ô<ì203#3#§Çþº™½Çþº™`þ„|þ„Ûì!#53®Ó¤R¬@þÀüýñ 327654'&+533676Í7N5G4¯pQf$h?FA@6b ! ¨eþ¿I(R[2*Û #53 3#®Ó¤RÓÓÓ%¬@þÀý-þ“°ð$%#5754&'./.54632.#"¼Ë'/XZH߸gÁ^a³Olƒ39ZZ8þþþ“{4<5/VV‰LŸÂ89¼CFnY1^5YV‚eš£UÞ"756767&'&54767632&767£/SD4Ž35gcbnZdF31`È9:H:ZÍçU°!LOTAKv?=¹0ps2#¹Qÿÿlþ Ã'^ÿ5ÿÿ‚þóÀµ']ÿôþ>RÁy3#Á¸¸ùìÿÿ‚þ¢ë&nÓ9þ¢ÿÿ‹ÿÆ &PÔú„ÿÿ‚ÿìë &nÔ¼Šÿÿ‚ÿìë&nÕ¼Šÿÿþ (f&;Óþ (f$3  !27# '&5767"Ã$ÄþÚ×àJKÁÔ–úþ^©ƒÔ`‰eŸ~h'?6š§®þû‡`¤v¸c–àße4-ÿÿþ (°&;Ó?}ÿÚR%67654'&'3#"'532‡¬#þ¢›—¸€Šÿÿÿ«þ b¶&?Óq ‚þ î?%#&'$473327676'&/3327653323#"'&'üT…ÁPx€mþíi¸l“_Qb_y^@@¸$;sR,%¸@nޏ\Kf% I0Š1_2F„,³kª>GHö´Îܳ&%0žlŽ}=êœJ"5Œþ^ó.327654'&'&#"&#4763&547632#bzL,5;(.;Dn2KÈxAZ¢M\MO¶bxX²'*9:X DD(ÁNOþì­f7*(”„?$S§-8’APÿÿ“þµH¶&ŠÓ? ‹ÿÆ Þ"327654'&'2#"'&5476»B!799[]KB{˜Æ¶“¥„`Q§%T*WE{R,,9.UMAx³ |”ÈKU#JïµN¹ÿ«þ @† &"34'&!5 767"'&'&547632î?,3/ÀV%.¬_]Àþ“g†¨>v-–(tYh‰YH‚Ä9!$3/,¸;þôþÌ X*V¸L_” !"b‰Wg3Zf‚þóÀJ6%#"'$47376767654'&'&'&'4762#&'&'&Vfþ©±xHþÛ?¸B¤a=~±T;~BrC:@¾_Ð`¸ B(EN><}ø9M ªI&huqƒc“- !P85J.39s–J%*=­=!'&"7*S@UYDÿÿ‚þ ÀJ&RÔôþ ܺ$š5%5%ÜHý¸Hªn‚nþŽn‚nܺ$ý&567&'&54763233"/#"'&5332767654&#" %!lE?I(7 /4KU^r8Z #08Ÿ " -d$* 9^W4'6O'&n=NVš)qaKî" %Üþ$ÿö5%%5%ÜHý¸Hþn‚nnn‚nܺ$ª5%ÜHºn‚nܹ$ý-&'&5476323"'&'#5276767654&#") lE?I(7$# +EÈ“˜‹V " -º 8_W4'6O -n=*{nmp" %Üþè$ÿØ5%ÜHþèn‚nÈË8ô(#"'&54737676533254'3'&!9EO)"a 2=`YG g -SG„L(E?4mmb}8T"ªRY$6îs9It…6Y !ìá 4&#"32>"&462–X@AWWA@XzŸæŸŸæô?XW@AWX³æ  æŸ˜¹hÁ732767#"'&'˜ gC*6:)kXZZC5"LMD¥6{S )L}@F€ÿÿO¿¦wpÕÿÿÿOþ ¦ÿÄpÕøÚóî 4373¶Ã‹‚‚‹ÃîFÃÃþº¸Â”¼3#¸Üܼú¼ !#'3¼´%1œÄyI ©Ü!nþÝþ”›Rð#'337673#"¦ ´%1œÇBR´{6´)cóoajr›þ©Ü!n›˜•UPymþúL%#'37676537653#"'« ´%1œÄ/(/H´/; ´'G›… 44.5WY¾þ9©Ü!nr|> @2¦Þ%,*ÊþÏ;l>3 ¯ÿì§ *"2767#"'&54767&'&'&76#zfˆ\MOY‡p0;JcX~VI|ee•pdkAXH,7âp ¨4C@#90¤L@rRiUZ‡hÔÀ®ÇsBBsÇ®Àþ¡ë³þËuu5³ëaUò#'#"'532N%bÄU`޲§´¥ÒþÜþŸþëþ†DK*‘2´2<!&'3673ÌbŸ~ÄšZ00ZšÄ¥xUö:þæþÊþŨ ¨;6þÓþIþÊú<3#&'#6Ì´Ux¥ÄšZ00ZšÄ~ŸbúþÊþIþÓ6;¨ ¨þÅþÊæþ:dò#"'&'&547632#54'&#"¿Î=­:i_{•š\ %ZÄ[,,G\O98<SGU37e{a}Uw¦‡–þÍþ¤œnWl42@B^!xþ©–$%-`+-!d! M fMÿÿ‚ÿìë™&n,„ý¨ÿÿ‚ÿìë&n×9„ÿÿ‚þ ë&n×9ÿÿÿ‚þë &n'Ô¼Šä©þÿÿ‚ÿìë¶&nÖ¼ ÿÿ‚þ ë&nÖ¼ÿÿÿ‚ÿìë&nؼ„ÿÿ‚þ ë&nؼÿÿÿþ (¯&;]Šÿ8ÿÿþ (ª&;×?ÿÿþ (f&;ÔŠÿÿþ (f&;ׯÿÿþ (ª&;ÕÂÿÿþ (f&;Ö––ÿÿþ (f&;Ø–¯ÿÿÿ«þ Á/',¼þ>?ÿÿÿ«þ Ér'_¼þ>?ÿÿÿ«þ &'_ù?ÿÿÿ«þ „°&?Õô ÿ¤ŸÙ:654'&32! '$&73! 76767#"'&54767632µ)B,4((7(*H³nþÃþïþáþÙ‚þ·@¸AËZAÑ×d#?z…Kb–NLZB`.+M;3*)3P&þÚ´F=)d Š\^ˆtL"9;l&NKCW4,”E$2Hf6‰âÿÿÿ¤Ÿ&„Õx~ÿÿÿ¤Ÿ&„Øxx‚ÿ§)-%2767654'&54767#"'$473¸Â$6þÊ2 #déý­Gf>5þ÷ã¡À€þ¶?¸AËhXPA7.EB|=Q#!w*6ºú(  %þ¶{{qeVUI&b Š\^ˆ~B"ÿÿ‚ÿ§)+&‡÷ÊÿÿþÈÉÄ&M_¼“þµHî#"'$47332767654'3HdnùaP„mþ¸/¸1É]]LGÁL"f¸h8­²ÅD%jdëQ¬í45Þb`¸Þœÿÿþ (°'Ö––&;Ó?ÿÿÿ«þ @r'_ÿôþ>Qÿÿ‚þóÀJRÿÿ‚þóÀr&R_ÿôþ>ÿÿ‹ÿÆ ÞPÿÿ¸Â”¼`ÿÿ¼aÿÿRðbÿÿLcRÅ%'&547632&767#"'#'3ÈX\lTX\D8/0EÃ=’ ´%1œÇBx:=œ$!"4'´Qjr›þ©Ü!n›8jÿõâ$(327654'&#"327#"'&5732#"€-2!WZWXZV%2-Z(‘ .5_³ªŸ¾_52œ‘Z¡JkVרààÕÚ<…J¡Ð•ž¸y&ÄvþŠ»þÑ‹¦žÐ 3767"'&547632&#"327ÐAoDdN.†bpŒxXWs>0B7,gŒ`áp†5ÿµoU%m—®ao´3/AbM3))´I˜·áÿÿ<gÿÿ<hÿÿdòi‡ÿãð (@  üìôìì1@    ‘Œäôìì0"32$  ‹œœþhö þ÷þ þ÷PþÍþÌþÍþÍ3343 þsþ†þ‡þsyzáZÕ (@  ÔìÌüü1@     /ì2ôìÔì0%!5!3%=ü¤JÊeþ™ªªª+H¸Hûá=Õ · Üì2Ôì1¶  /ä2Ôì03!#3uÈýlÈÈçîýhüÃÕþá=Õ ¶  Ü2Ôì21·   /ìôÔì0)5!!5!3=ü¤”ýl”Ȫ¹ªÈá=Õ ·  ÜìÔ2ì1·  /ìäÔì0%!!!3!©”ü¤”Èýlªª ÈüŽá=ÕµÜì2Ä1¶  /äÔì0!#3!=ýlÈÈ”Öý*Õý«á=Õ¶ÜìÔì1µ /äÔì0!#!3!=ÈýlÈ”crý8ÖAÕ'µÜüÌ91´/ìÜÌ0¶‡‡ìì#3Aý“þÉSuÃüNÕúÛÅÖAÕ (¶  Üü<Ü̵  /ôÜì´Ü<10%!3!#ŸþþÉÉ¢ý“þ°þ ÃüN{î 2@ EEüìܲ@]ü9Üìì1@ • •‘ /ôìÔ<ì02>4."#&'.4>329[œ¸ZZ¸œ_ÈPGr……䆇䄄rEM»p`77`p_88úæ 1§Å§bb§Å§1 ÁyÕ@ ¯üüì1/ì03#Á¸¸Õú+qÿã!“/@ E  EôìÔ¶ 0   ]ìì1@    ŒôìÔì0 6&    ¹¹¹þúþ«†þëþz>þú¹¹¹þ†þëþzþë='Ù+@  ÜÄ2üÄ291@ /ì2903#3²³Âþç¸þçÂ6£ýQüÖ*¯=q33# =¤ú¤Ãþ¢þ¢qü½ýCºq @ üìÔüì1µ£ /ìô<0)3!3ü9¹U¹qý"Þºq @ ü<Ôüì1¶ £ /ìôì0!5!!5ü9üòqü“K“qOâ!%!!5!&'.4> 2>4."¼‡ü:‡RJr……ä 惃sKRþQ[œ¸ZZ¸œ“““{ 1¨Å©bb©Å¨1 Ÿp`88`p`88º¦ %@    ìÜüÔÌÌ21¶   /ìÜÜÜÌ03"3#!5!ò„…ñpü9Çœ fšžüø“qçî2@ EüìÔ<ì2ÔüÌ1@    ‘/ôìÔ<ì2Ì0!#!##"&6 54'&"3qv¹þCœø¼°±f^‹œ]8Æmr^:ÉüÞþÄ<ÖUåf˜þɃ]8˜ÆƒÁDÕ '@   üü<ü<Ì1@    ¯/ôìÜì0#!!!y¸ƒþ5Ëßý!Õ“þ/’=ÀÕ '@   Ü<ü<üì1@    ¯/ôìÜì03!!!¸ý}Ëþ5ßý!Õ“þ/’ºÕ %@ üü<Ôìì1·   /ììÔì0!!27654'&'2#!3œþÐ,R4,,=iXXXlýιÞýµ]Oz}I_“‡_Ò­‡…ÕýœÁ$Õ;@   ôܲ_]9üÔì@    /ôì999@ ìì10#4'&'5!½ˆ4B ¸5M‰ÃcAþïê¸æþÉq™_–ÜÜ9V“= Õ4·ÔÜü9Ì1@ /ô̲]ìì´]0 53#Tþ麸ßþÇö9ú+Áë!-@ #"üìÔìÔüì1@    ! /ì2ÔìÔì03432>324&#"!4&#"!ÁôÆ}x5%–ÓÒ^ˆº¤ZþýH¤Zl”þî¦ÿK--ÒX€hý&|‚€Å•þncƒ§Òò=‹Õ &@   Üü<ü<üÌ1¶  /ôÜ<Ü<0!5!3!!#ˆþµK¸Kþµ¸€”Áþ?”ü€=Õ9@  Üü<ü<Ü<ü<üÌ1@     /<ô<Ü<<ü<<0!!5!3!3!!#!ˆþµK¹øLþ´¸þ=“Áþ?Áþ?“üüºq!@ üìÔüì1¶ £ /ìôì0!!ü9¹Uqüq“ýµK=ÃÕ! #ÆýtFCþ0æþ0Bû~ú+ÕÁnÕ 4@ üìÜ<ü<Ôìì1@       /ìôìÜ<ì20327654'&+!!2/!!m¨]%i¤þ ;°„@ED\ŒÔýTôqQE=4."þµXEr„„rJS¸RJr…CEoJ¥[œ¸ZZ¸œOó“þ{ 2¦Æ¦1 þ{† 1¦ÆSV/þÞp_88_p`88Á}Õ @ üìÔìì1µ /ôüÌ0#!#}¸þµ¹Õú+BþÅÎÁ}æ #@   üü<Üüì1µ /ÔÌüÌ0#!#3}¸þµ¹¹âüOþü›þüÁmÕ +@   ü<ìÜ<üì1@      /ìôìÔì0!%!!5!!z;þ ôþ ¬ýTÞýµK“Ñ“ú+qOÕ $2>4."%#&'.4767673 [œ¸ZZ¸œTXEr„„rJS¸RJr…CEoJR¸"p_88_p`88Î 2¦Æ¦1 þ{† 1¦ÆSV/ †qOÕ(#&'.4767675!5!!2>4."¼XEr„„rJS¸RJr…CEoJRþµNþµþQ[œ¸ZZ¸œP 2¦Æ¦1 þ{† 1¦ÆSV/ ó““ýàp_88_p`88Ùb/ö²ÜÌ1² /ì0!!ÙVýªö”Bà¾f#"&/#332?¾¢E=9Qc´‹õ”t2 %xfþ¼" %/¯õxà $â¤Dp²/ì1²/ì03#¤ÌÌÌ¿î=f3#'#´”õ‹´´‹fþˆõõ[î¥f!5'3¥ü¶{ì¶î”æäBà¾f3326?3#'#"&'B‹x% 2t”õ‹´cQ9=Efâ$ àþˆõ¯/% "[î¥f5%3%[¶ì{î”äæ”šþ‡fÿS²/ì1²/ì03#šÌÌ­ÌÕF'µ/üÜì1´/<ü<03#%3#\ËËþyËËÊÊÊÈuº·  ü<ÜÜì1´ /ìÜÌ0#527#53ºò„…ñ€þõgšžÈuº·  üÜÜ<ì1´ /ìÜÌ03"3#Èò„…ñ  gšždû¶ ÜÜüÜÌ1µ /ìÔì03#!!×ÌÌþ³üMûÌýd“dÞ '@  ÜÜ<ü<ÜÌ1@   /ìÔìÔì03#3#!!×ÌÌÌÌþ³üM„ÌìÌÞ’ÿì÷“³ÄÜÄ1² /ì0'!! üõ““Åþæ¦'(033!!3'#67654'&67654&ƒÍÍÍþu‹dÑruxt‹NM€ñddx>DD>x˜II’‰þvŠýçþ!ßý þóRTšxŽXY…¯`aþæ£þw,0dc1-ýëþ!:;z{t‚ÿëÛ{*L@$% E+ü<ô<Ô<<ìÜü@!#91@‡Œ$+<ôìÔÄ@ ‡(‡¸+üììÔÄ0%"3254"3254#"54!#"543263 #4#"h??AA??A¸ùæ'+ææ¨,L½–¸â‰Wð@@@@@@@@üÁÍÉÐpØ·QQþ¾üÇ9ªŽ‹ÿ݇Œ/@@1(. #E0üì<ÌÜÌÜü<Ì1@‡‡!Œ0‡%*‡ ¸0üìÌÜÌÜôôìÔì0"3254"54$3  !2632&#"# 54-654!"`@@@CÒv»Bþ™þîþĉըŸŠ†iUvË«þ:Ö×þknL?o@@@@þìä‰Äþ«þìN;EjfŽÕa‘ùïe:.šº88U؉ÿìôŒ8327&'"254"%47&5476! #4'&# 63 #"'632# i60IKhhþ¯*)…“7!‹o¸^R¿þýX;*:ú9«ÌÌþu`þ/'"­€6OÔfq³þ÷ý¿A¼…tqLIþ¶ $\9.ȶlþQŒ!6@   E"üÌÜÌÔüÜü1@‡¸" ‡ ½"üìÌüìÄÜÄ0463 #"&'7325#'&&7'6m¢ÝešÍÖt ½"x¯‚ØÐÖCBC¦quýôýþùðÐ Ñóßh!Ï ACBBÿÿ—š )2@  #&E*üìÔÌÔÌÜ<ì1@ ‡ ¸*%/ÔÌÔÄÌôì0"32654& 4''&5432#5476°$ % U%|{¸eÈÙÚô6þ™ãL¸j` %"%:yxþÙý~)ŽR¦·Àh–††KKª>Ü‹þ †Œ 65@$- 3 (E7ü<ìÌÔÌÔ<ü<1@ 5/‡¸7‡&Œ7ôìôìÌÔÌ"32654&4763  !27632! 54-654!"#"`$ % õçºBþ™þ­ûïy#x—”¾Jþiþ:•O×þknLI¿Òo %"%0‰yKþéþpjNdfïD×þüþ”QcwþõùØiC‘|85s½rÿîô– *;@&%   E+ü<ìÜÌÌÔÌÜì1@"‡)Œ+‡¸&¼+ìôÌÔÌÔìôì02654&'&47&7'73%$æ$!% þ­¥¦lÜÝ6ZA“‹|¸ýÌý³• $! $ý˜Vmê-·Æˆ½G4 ¡p¨¾?ýÁý´ºÿã¼{1@ FüìÌÜÌÜì1@ ‡¸<üì@ŒôÄÜÄ0%"32544!  #"54$32¥@@@þ¹þµæëäÖ)ë@@@@ëÆÆþPÄÈÈŽÌvvÌüÇÿ⃡ .<@- " 'E/üìÌÔÌÜ<Üì1@ $Œ/‡-‡)¸/ô<ì2ÜìôÌÔÌ0%"32654&672#4#"#"'&#" #"53232l$ % L ™ò¸7*>(€z*M#6Õûò—&8"$ñ %"%3|þ©ü¶0Û¯qi½áþPÄÚÒ–Wu«ÿÿþ²|+?@-$'+ ,<ÌÜÌüÌÜÌÜüÌ1@ )‡!¸,Œ&½,ìôÄÜÄü<ìÄÜÄ0%"3254"3254 #"5#&767663 #4!" @@@þ™@@@®äï!ÙÓ¢7yÁ-ž¸þæ²^õ@@@@ö@@@@ý˜ÝÃã×ÇedÕmúÛ%£‹WÿîË‘ ,9@. $  )E-ü<ìÌÔÌÔüÜüÜ1@ ‡'Œ-+"‡¸ô<ìÌÔÌôì0"32654&4323254#4#"%$7"@$ % þùæì‹µ¶'(¸ujþ‘þ’ÕÓø %"%@ÙÕ¯ˆ¨Ì°Xþûüsghý©þ¹\—_ÿã¾"9@ $ E#üÌÜÌüÌÜìÌ1@¸¼#‡ ©Œ#ô<ìììüÄÜÄ0254#"53265$54767653!"'#W@@>¸z]Uþèâî]ƒã¸þi¹TrÙs@@@@üpeœgÌÝÛýu©±/üÑþ²ssHÿîs|2@  Eüì<ÌÜÌÜü1@  ¸¼‡ŒôüìüÄÜÄ0"325447&763! 3%$5@@@þÔ¶·åíþìMg¸ýáýõî@@@@ýRÚÄ&¶Â¼—þѨË'´ýLþBHÿîs2@  Eüì<ÌÜÌÜü1@  ¸—‡ŒôüìüÄÜÄ0"325447&76! 3%$5@@@þÔ¶·åíþìMg¸ýáýõ@@@@ý<ïÅ%·Â½­þÒ¨Ë'hû˜þBYÿîÌé E"32654&!"32654&&''"&5623253765$7465&'7$ % ý$ % K”fg´¦œüÔþ饤¸£›þçÓרIJÒ %"% %"%üIK£šbáëÇþv„„4þË‹‚ŒËî˜42@7-]fÅnþ9¥™ºÿãh%A@'$ F&üìÌÜÌÜüÜüÌ1@‡Œ&ô<ü<Ì@" ¸—&ìüÄÜÄ0!"'# 432!32533253"3254hþ©”fg´þ¾ýÓþ襤¸¢›¸ü>@@@ þÃJJ=|ßëÌþ\¤¤@þ¿¦§ôýÌ@@@@hÿï} -?@, (,$ E.ü<ìÌÔÌÔüÔì1@"&¸¼. ‡Œ.ô<ü<ÄäôÌÔÌ0"32654&2533253!"'# 47&5432d$ % A¤¸¢›¸þ©”fg´þ¾™‰æìèBÒ %"%ü³§4þË©ª/üÑþÃJJ=ð¦%žøÜ‰þñM§hÿï -?@, (,$ E.ü<ìÌÔÌÔüÔì1@"&¸—. ‡Œ.ô<ü<ÄäôÌÔÌ0"32654&2533253!"'# 47&5432d$ % A¤¸¢›¸þ©”fg´þ¾™‰æìèBÒ %"%ü³§4þË©ªèûþÃJJ=ð¦%žøÜ‹þóL‘§@ÿã`$@ÜìÜì1@ ¼‡ Œô<üü<03!23! '#"543225“¸ù¸þOþ³)3¶Æœ)`ý,þíÔüÅþ¾88œ–{‹rÿîô *;@&%   E+ü<ìÜÌÌÔÌÜì1@"‡)Œ+‡¸&—+ìôÌÔÌÔìôì02654&'&47&7'73%$æ$!% þ­¥¦lÜÝ6ZA“‹|¸ýÌý³• $! $ý˜Vmê-·Æˆ½G4 ¡p¨¾Úü&ý´‹ÿïŒ ,7@  '#E-ü<ÌìÔÌÔü1@+‡Œ.%‡‡¸.ôüÔüÔÜÌôì0"32654&4! ! &# ! ! '&54323 c$ $ ½þ€ýÔ6bæuøåþŒ’ýÄþ«‡UÓàK·X $ $è8$Ü{»ŒŸþþ›nE{ËÒN%Oÿîª 0@@2, %&E1ü<ÌìÔÌÜìÔìÜ1@‡%‡/Œ1!‡*¸ôìô<ìÌÔÌÔÌì0%"32654&&'&'&5! 765! '676%&4% $  ,«D ãÏù)@ ' 1#-E5ü<ÌìÔÌÔü<1@ ‡)Œ6/‡%‡!‡¸6ôìÜìÔüÔÜÄôì0"32654& 4%$54!232#"'&#"! '&5432h$ % $—þ{ýÝ¡Ëajjh@”Mó§qKÍy)ý«þLJmá×_œ‹ %"%þù½1EæüYl0þ”xP^b8RþÂþsu_|ÞÚ]FÊþ­ð¡'"2''&'$!32'&547"32?6A€€ñS2;9ŠÂ’ þhhÍÔÓÔ¤ÚNU×~œõþ± €û †+;9j–qÎÖÐ!þþæB¦a¦©þÈÿÿnÿå·€'îýuîúÉû_ÿ¨ +@   /ÌÜÌÜü991@ /üÌÌÜÌ0! &7623$'4'74"YýÇþ¶Ãåò#!A[VЍüÞB8?<þÿ¨kÙØP$U.FŠM?>={É{+@  EüÌÜÌÜì1@   ‡¸<üìÜÌÜÌ0 ##"2#"53254#"·¸ÿn=Úåá¦;C>@{þjýËVÁÇÇ®þR777ÿÿüšÉr&ïû@ìÿji·  /ìÔÜÔì1µ  /<Ì2ÔÌ0! ! !5 74! ûþ%þ&þ?þºþ˜%»~?>þÂþÁ~»Åû@ìi$@  /ÌìÔÜÔì1¶ /<Ì22ÔÌ0! ! 3!5 76! ûþ%þ&>Ôý©þ¹þ˜%»~?>þÂwJ~~»Åû@ìÿji*@   /ìÜÄÜÄÜì1@    /<Ì2ÜüÜÌ0! ! !5 74! #5ûþ%þ&þ?þºþ˜ßî%»~?>þÂþÁ~»ÅNÜÜû@ìi.@  /ÌìÔÄÜÄÔì1@   /<Ì22ÜüÜÌ0! ! 3!5 76! #5ûþ%þ&>Ôý©þ¹þ˜ßî%»~?>þÂwJ~~»ÅTÜÜüþý3þ¶ÿ²"36654'#"5432ýî‚AA\(D³ªeN[̼þÏo[$žºN[‹uÖü§ýŽþÈÿ¯%@ /ÌÔÌÜÌÜÌ1@ /ÌÌÜÄÜÄ0"3254"547&54323253ýró>Juum‚ž„²þ@’s> [yu?{EBXFþºÃû_ÿ¨ '656%"'&76! 4"3Y¨ŠVþ¥A!. Ùå{x9üá322674&#"ŽCC›òèÌjFPˆH OQ²µ$!%!¢p'(FnäJv-Oý!3]ï $ $ÿÿzÿãÈ{&úú0ÿÓÿö1, ("32654&&3 #"4/&5432N$ % þ¤s $ËŒeÓû‹qɘzm… %"%þù´ƒµþçÏ82®º´‘y¦œþ,v\ÿãë#"6@ E#üìÜì@! ÜìÜÜÌ1@ ‡˜#Œ#ôÄÜÄüü04$54%&&5! $#"57"3254ÂiþØó xÜ«äþâïï@@@ç¸ÜXº¸4 |ì`Pþ°¤Ù³ý÷ åÜÝ?@@@@¼ÿê‘ ""32654&5&'7!$#"47#®$ % þdt¦„.;àÕûœï %"%ȈÄ_øp•½¬˜þ‰ ñÐ8>™u“þ%˜t/;4#"#"'&#"$#&532327632! '&57"32654&à"3C2z7J,"Óû¶…/IN\=0‚¶BWþ–þ¡TO½3Hý©$ % Xt\DD\t] ñÏ5ö<\UCþþüªþ÷fˆwpv Ê gH %"%ýñýÆV@/ü1/Ì03#ý´´Vþ›û~àÿ£!'@ /ÔÌÜÌÌÜÌ1@  /Ü<ÌÜÄÜÄ0'6"%)56574 65ü+*+µ×þ„þU·‘G±óm++),}åþÝ….pˆƒ·\(úû>Ç.ó4"!27676327673!#5654#"'&'&#";&543ü.ð%2~*&IHHÜ„BO™g(þâÅÐLBC]i%>’e>.`h>3È‚A?×~= h‚\$…kb8:;-F¡_Zkf2)üNàþŒ !@© /<Ìü<Ü1@© /<Ìü<Ü053533##5üNØŽØØŽ¸ŽØØŽØØÿÿû øPüšöþ>r@ /ÌÜÌ1@ /ÌÜÌ0432#"73254#"üšÔÐÔЄLTPP¾´´ÈÈHHH‡ÿã` " 7654&' ! '&476‹^L:NbX1ˆcoŒþ÷þí€qo’À„h³½`™W®£ü Ä’éý޳¥”æ•Äcÿg¨œ&24764'&#"676'&'&5476 ¶€ òÒpH¼’gc/5pØä†I´u ¦þÎö€€ýê‡uËpHECle\gâÔUÔÜš‰su—ÈýϨ‡cÿy\±$24"27#&5432# '&5?$5+€€rÐ%3Ýàí]fÜþͦÏÓ¸þ”Ù|pHF€þP¶ÆØþäðfou—ÈT¢¥àéþÇþå©aþûpHÿ스/%24'$5432327#"'&#"%$'#"5432253â¶þ¶ï¡3]L/|€t¾kZ1„AQ½þfþÜ(3¶Æœ)¸ƒDj¾R—Ææ:jÄTþûh8KOÈpÆþtþ$68œ–{‹‘ýÖþícÿWα%24"$'&5?$532&'&32!€€­þâþñþ¾rŠÏÓ¸þ”Ù|T9ïlcÙÔì ~x¢˜€ý?Lv§T¢¥àéþÇþå©aþûmY<ÅÐäØÉÇKcÿWα-224"7&5&326532&'&32$'&324!€€ýBå‘äûœ¸³}b$|T9ïlcÙÔì ~x¢þâþñþ¾rŠø=C˜€Ëh¡(ªç­­¢½ë¤ ?fXþòmY<ÅÐäØÉÇKLvÈttYÿîô4@'&''"&54323253765'$543227#"$#""32654&²¥”fg´¦œýÔþ饤¸£›Ùþ¬úu ^|€u½IþòSL\ßü>$ % ,¥™IK£šbßëÇþv„„4þË‹‚jEašØÑüÃTþûùW8Ò‹þ¾ %"%‚þÛ{ &%"324"324#"54!#"543263 #4#"h??AA??A¸ùæ'+ææ¨,L½–¸â‰Wð€€€€üÁÍÉÐpØ·QQþ¾úÛ%ªŽ–þRpt MU"32654&254"#&76767%4#"#"'&#"$#&3232763276'767‰$ % ånnþ´vp†+-•"2D2z7J,"Óû¶„0IN\=0‚¶ŽJØ%•.3?­5xvþ„'ªQœ %"%ýž933¹hk//3wá±t\DD\tþß ñÏ5º<\UCþþýÈrT­«”F-2bG;þÐ"‚b,iÿö÷’ $5354#" #"524"Åm~¸þÀþŶ¥Óý¬€€‘þ¹ý©ejüsûþX°¤þ\Ìëß|9ü€~ÿçÉš LX"327$"3273253!"''&76324%$7&76%$5#0#&76262654&'&¨€A?à€A?‘fx¸þÔ…$8ŸÙÄ$+Rb,7þHþ£ÂåîuŠ æÓ¢5r—ýô$!% @@@@@@@mýÓ”žJü¶þ¾ceÆÁã“$3ýÖþ³- Ó/™×Ô‹uŠþꟵ² îÉcdûê $! $~ÿ瓚 I"327$"3273653%"'%5254%$7&76%$5#0#&7626¨€A?à€A?‘ Tc¸þéb*@þÖÛRX6&$þHþ£ÂåîuŠ æÓ¢5r—ý@@@@@@@mýo6 Jü¶þ½,/¸Ìáƒ7'ýÖþ³- Ó/™×Ô‹uŠþꟵ² îÉcdPi.".54>7!5!!"32>54&'7i7eŽ®ÊÚȬŽd7&KlGþÜêýqÇ”VXšÐxyÓšY²lÅ«Œc66c‹«ÆlJ˜Š7ÀÀ^ŸÐszÖŸ\[ŸÖ{6yEr2b\TZ@#!#".54>7332>53!w!KNM#h¶‡N&?Q*Ðnq-Nj=8kT3È“$ Kƒ°fWxc*s÷@nQ/+Lk?øú·¸ZÿÒ 5!4.#".54>2!þ‹/A%'B/+(¥=B=iŽ ‹f:yýý'D33D( R0oC‰EOˆc88cˆOü'þMPÃ.4.#"32>7#".54>7!5!!÷"@YmEg³„LL…³fjµƒJÌk»ÿ“þ¾oXØý´qý´ØXªG†xdI(Y”Ãji¶†MK…·kù¸ii¸ùÛ«uÅÅu­ÛZ8!4.#".54>32i+Kg<>lP-7:p0M6Nˆ·if²„L>@kK*0Rp?>†?¢1ill3e²„MF}­gûÂZ,#!#4.#".54>32!|þÝÏ/@%&@0&%•BE;hRP‹g;Óüé©(C03F(#P/M‘COˆe96`†PÛþFZö(4.#"32>7".5!5!>32&/Oj=kOýO‡·Î´…MþEŠHŽHj·†Mª€oP.)NpF@pR00R°f³…LL…³fa¶ýn0/I²P- %#"3!!"$&546$3!!£J˜×‰@@‰×˜þùþóÇþØÃ`aÃ(Æ ¾º] ÔwxÔŸ\FüéwÏ¢¡ÏwýÍþ2P:G!!3!nýâÉ!.xú1Z+(4.#"32>#".53>32`+Li=?jM*,Ni=>hL+„™i³ƒJÉEŽMf²„LK{W06\xCKxT.4XwýA_bK‰¾rþŸ62N‹¾püÿZö+4.#"32>#".5##!>32*+Lk?AlM+/Pj<@jM*ÌK„µih¶ˆNëЀIžHkµƒæ?pR0,PpEBnO--On©Î²‚KK‚²gcþBvýj12K„Zþ+"32>5!#".54>3!!5!!Q@lO--Ol@>iL+ÎÿM…³gh¸ˆON‰·iý‚LÁ.QoA@nQ//Qn@/ýùþÑe²„MM„²eh²‚J{¸ýÍüP‚S$!4.#"#4>3!!"632ˆ,Mh<>e-PÉK„²hŽþr>iM,‘f²„Lè?nR0*'R}þ g³†M¶1Tr@§aK„±fþPþ»c K4.#"32>2>73#".5#".54>2™*Lj“OwÏ™YV˜Ðz|ÕšXš0/'»:Yr?DsU0 E nǬŒc67d¬ÆØÈ­e7><qU'!R–‚kL)[ŸÖz{Ö[W›×üì.>#K€]59_|D 6cŒ«ÇlkǬd77d¬Çk{ÔZ'kE"1%P#".5!5!2>53K‚°eiµ…Lþ¢*-Nj|fH'Ïèe²„MO‡µfX¸ûðAqT12Vq>P&!#"&'.5467!5!32>534J“Ep®=AB7Dþ¡ƒ4+! )#$+e;:iP/Ì—05IGH¬eLšJ¶« )RpEn),/,Nj=öùÿZ""!#".54672>53!`þÝN†´gi·‡MNL™6--Nk|jN,Íå+ìþÑe²„MK„²gV·[„@n6@nQ//Qn@ýÍý]‚S#".5332>54&'7SL„²fi³ƒJÉ,Mi>=iL+>5{-H3èe²„MK„²gûç@nQ//Qn@6|>œ/dfd‚S 4.#!!2>7##!!!2ˆ/Oj;þæ;jO/ËJGHÜ“’.’ü¥ãg´†M@qR0ý¨,Nl?d¬EHCþˆºM†³PþºbF4.#"32>5>54.#"#".4>32™Y›ÒywКYXšÐx‚Ô—RÉ6a…O"?/$/ .@KZj>mȬŽd78eŽ­ÇkoÉ­‹c5[])D0zÖž[[žÖz{Öž[Wœ×ýwAoV5³'//!6cŒ¬ÇØÇ«Œc66cŒ«Çlƒúv?GOPb 14.+32>#";+##".4>3!2™>m’TEET’mýœFU’l>>l’UFk\¢Ü€EÌF€Þ¥^^¥Þ€W€Ü¢\Yª–qAüÌ@n†@o–WV•n?—~ÙŸ[þ£][ ÙüÚŸ[]¡ÙFä!#!3!3!þßÏþËÏéü靸3ýÍþF‚S!4.#"#4>32ˆ/Oj;53`E“Ig±ƒJÉ,Mg<:iO/Ë”02Kƒ°fëþ>mQ0,Mi=øùÿnB-#".'332>=#".533267653BL…´i`ª‚RÊ0Lc8;jO/FŽIi³ƒJÉ,Ni=:c'YËèg²„KS½kFzZ40Sm>ª1/J°gíþ@mQ.+(P|ú‚S!4.#"#3632ˆ+Kh<7g4QÉÉ‘’e±ƒL|?nR0++N|ýuþaK„±fý„Pk*!5#".54>32.#"32673°YªUlǬŽd77dެÇlpÒs[.\YS$wЛYXšÐy^ªP»r2@6c‹«ÆlkÆ«‹c6JHž,ZÕôÕžZ;;xýXZ)"32>5!#".54>3!3!Q@mO--Om@>iL+ÐþþM…³gi·‰NN‰·iÎÅ.QoA@nQ//Qn@/ýìþÑe²„MM„²eh²‚J3ýÍý5‚S !4.#!!2>7#!!#!#!2ˆ )þ4Ì)Ë2VsAþ4(Àþ˜É•AsV2ª*=&þÆ$;,S~U+ºþ 9þ/XZ.?#".'332>54.'.'.54>32#6.#".Kƒ±fb­…TÊ1Ng:jN-VU^Æ]4R8èe²„MR½lHzY3/Qn@72*63•Ue³…MT¿kH|Z4/Rn@)D BFRZ‚S#"'!!332>53SL„²f•‹’ü¥É,Ni=53 K„µih¶ˆNÿО/Pj732>54.'.54>32#.#"]¡Ú~|Û¤_-H3’K7>k‘TSj==jS8mV4/Rn@8gQ6Í';#wÙ¥aL~מY[Ÿ×{:omn:vQ©NV“l=53 ,T,PŠf:l #D;%?.Ìa=4.#"32>7+!!#".4>;5!5!54>2Ÿ-  -)//?%&@.¯%?/ç:fŠP¯Wþ©2WvCDwX22XwDpþÃ=½áíêå ýô Ó@Šx½Y9¹lþY…þ|þPþWô!%! %674#"&5! % %óþ1þ,ôlÕ·‰._‹z½þðþè+þ,ÔÍS©Ž‹.+RLo þÛ¤Tnþµ8þÇþÀdþ`ã'675$!2363 ! ##&!"#"32CxþšuçM6þŽþsþcÑÈžì¼*þ›¢rËÚööÚþêE)ËÝîÎØþ ýûPþ¢ýçlaØ•y°Zþ§þ“dþX¬!&732#"&5 ¬þ]þ[*³çèÏä8F›Œ‹ þe’]N/I3þü^@Þ[7œr·rþ2dþX«'!&732=6+537#&5! «þnþN ²øÖÅggºÏЈG‰ŠåïVþ¯zkB3L.íÄ·¦ŒúÿÊ@JKW~XþqÛ\,²d­!$75&7! &324'"6­þZþ^  ,CH!¿êããèÀ €’ùþøIJ:éQþ½›U,þX\þ¤þ•$ÔÖÚdÿüý56#"! !2363#"32ýþUóÉÎþTþcŸ÷D>êƒüôìâàî0þR•^<]þ€ýø¼¼ýõ€þþtdÿì«'6#"$! «þê+†æèƒ.þ!þT‰u®eþ›þì¬uŠ«õdþY­! 473254+5365!5 ¬þWþb¤ æí퇇ÚþŒ2þÿþm“NEIJþú(ò˜ÅþbÆC+þødþ`3675$%2363363 565&#'#"#'#&#4%"fDjþP‹ÕQU»ËORÌþ‰¾ÓÛ “ ËÆ ‘ ÞÎ…¡¯ýTÇgˆ@! «®Ï®¸º²þ5þ„‡§yã<þ÷øøþïøøþ¹þO-þ‰ã6ˆd«! !234#"#!#"2«þmþL¤œCóÀ»{£½æçûÒÛþ%  }>±×eþÂý«þ‰þ~‚Ëû! )!363#"7ËþYþ`°þPlB¨¼ìëëî ýóå  rþž€ýøyþ_þ§dÿöß56#"#'#"$!2363 ÞþHúÇæ“ åÆ÷þL†éDVÛƒþz’–a!tþÝüü#þŒþër–˜…ÂÂd¬!! 4732+53274'$53¬þXþ`4§"çêêgz¯ïþÒ¶ï/ºçîþžc7Qiþìb6‡È•!6°G))þûË=HdþY¬2! 3325 '%5%«þUþcÀÚøþ|Óþ Cþ½Gþkoã Š4YîþΧŒ_ndÿöó9$5$#"#'#"$%7367 óþ>ØÞ ÝÛþBÇdž)ýoœÙQTÜ7þ-n–gDPþËîî5þ°þÀk–nÓ1¢ wþÓ5áá‚Ëñ! 3324&547ËþcþT¶øáÉœW\îýýîüþ‰wØ ?”c-'9ÆdþYÛ: %3! ! %#d’ÿýÊýÁ¼†þ·‘þ¸6‰*Qþ«&ýqý)Ýý¯QûGýåF<þY¯!! 4732#"#'4+536363$¯þWþe7¨%áù•„ … ¡nj³1HŽ:þp¨|BZˆþüšÜËËÜŽš™þmdþYà(0! 3! =4+5326#"! !2363 #"32Ìý÷þ¹.Jbhhv¯Ìþ^þ_œëLJßlɵý-ùÝÝùDþ)×o¥—ûþãWþ(ìøÐÆþwþöO*¼Ú|þ˜þ£dþY­ñ! 4732#&3$!33­þWþ`S%ãõöÏ}þÜ{—F´þpj]P0Gþü9dꬪ*,wkGdþVÞ(675$!236356#"#'#"#&%&,E[þš‡×UQÉ—þsÓÖÚ“ ßÍv±þð¯®ÇSÓ•óÂÂþKþg¥ªl+(þíüüþ›þ&Žoö˜G(ŸdþY­! 365## %3253­þWþ`¾âö3¯þ`:^Ûãö³þtþüàbå"®‚Sûþ¯ë d«%! %34#"#54#532363 #"!2«þþ:Ÿ™I‘ƒ~V`z?:¢.·ðâ Æïþ 5È»!#¹¡ÁÁþµý&•þ‰þ‚ÿìÉ'6##! '6#"3636úÎÅ·ÁÜû²_a¤¼¯?óõrþÛþräÛƒ)þÅýµªjþÇ`M¿êþø€hdþY$%#! 7! 6+532'6'&'3«Éþ)þ¥h*&£š’o{·Z‰…ËX?þçþc#¼ìL‚þcþÂþi2øˆêw/.­}.8d¬ñ ! !233#"32«þWþ` ¯2²¼ëâãëýûýsNü‚þvþ‚Ë%!236;'"#54#"363 ! 332#"‚Ë9@zpf~³e:£Ÿþ`þW¹ïãáññ#»»£ Ã#!Å þ …ýãþÇþÇjŽFþYñ%-! 4724'&' !33#3'6#&Žþ\þ^U%æéˆqYþé#M^¸½R„ý……«¢Žþm“ahi Cþü coz49 Èýí;U¢U7HUihIµ¸­‚Êñ ! 3363#72ÊþaþX¶M‡ »èãçä ýó äý¡„ýøyþ‰þZþY¢×! 4772&'&'5%53%¢þVþbZ,àþÃ=’dþœ¯´þw“¥xYUoþøË`y¥ªŒ´”Bþ…“±šszbd«+! 5332'4'#53256+53274'&53«þ_þZ¿âílµµdeµ³[ØéºØéš”žhþ˜ eeþìÔ®–zs˜„U !ÐdÒŒ/6‰~:_dþYù=! 63!2'4'#53654+53254#5325&'&'3ùþTþ76h¹T%.)ûhˆˆhfŠŠfhˆˆh›‘¦Ÿœ²²²²±²|þÕØ+ ã?þùþåáþ©þ³ ÆŽ†¤Šœ„‘ŽR!"²H61˜¥"(Ÿ»&·’0:dþó¬27&% 7&'6#"•2ð¡¤û>à–Þ•æçìáöd$! %35#$ 3#3%#" 5;54 ¬þXþ`œîîþdHrrrþÐîÞÌþ4Þîþ4¶þ±Of¡kQþ¯Ø”¡²ÎÉÓcÖØÃdþX2&!"'#!525#"3$%2363 #"321þZ†Gþ\ææçøþK¤æVOæ¥ÀéÝáåýévŸþŽïBpþþœ”õþÈÈþpþ¬¸ïdþY_!! %$54#"'! ! 4'7_ýõþGD˜µ¥ `Uþ¯þÈ6I@šbþY§srg¼Ÿ8A:þ¨ÔƒMþîþÜ){6\l‚þYÊ(3324'7%#"'#723! ‚Àíßß«îþf–Bðß»þcþVþýÌ¿0ý±?âþõþ7YãþûþpŒdþW $!6=3! 47$$5! eØÎþ¾þڞòþŒþªïþŒ¿þíþèk¹þHþë©užµŒLLþæ8çTWJÿ&)ü*dÿµ•54&#"'675&%'%"©t_‚C‚Ctâ¨ý—‘?þìèh]²|KytJfqIµ8ý¯=žþÛ£Ê&*“d2ïã 3#3#3#dÀÀѺºþ/½½ã°½®è®dõ 2"4;%"4#"32;ÐÕѹëþþFí|pux$þïþãLµRQžÂ´ºÉhØ=@ B••ÔÄÄ1/ìôì0KSX@ììììY %##™œýÇåýÆ.ûœdªú+ÕÿÿhK'œÀEgÿÿhÕ"ÿÿhO'ÐÀtgɰÕ@·üìÔì1µB¯/ì990KSX@ííííY s£û³çÂüNÚýÕý‡äÿÿɰO'Ð)tiÿÿɰN'È)uiÿÿɰÕ'‰eiw^Õ?¶ÜìÔì1µB¯/ì990KSX@ííííY 5´ü]£ªûçÂþ(þ&þðxäyÿÿw^O'Ð1tmÿÿÉØ'e5‰ÿÿ6Ø'‰¡eÿÿÉÕ&‰g5ÿÿ6Õ'‰¡gÿÿÉO'h5‰ÿÿ6O&h‰¡ÿÿÉEÕ'i•‰ÿÿÉEÕ'‰°iÿÿÉEO'j•‰ÿÿÉEO&j‰°ÿÿɰO'ÐÉ0jÿÿÉóÕ'm•‰ÿÿwEÕ&m‰°ÿÿÉóO'n•‰ÿÿwEO&n‰°ÿÿw^O'Ð?0nÉ •Õ3#ÉÌÌÕ̉œçß!38öîýYgg`ýªnCü½^Úå·^nýç7€]ý€^Úå·7ånýçn7]€]‰0­d"&533265453­ŸæŸzWA@XzCs  s!þßAWX@+ö‰!­U#454&#"#462­zX@AWzŸæŸBþßö+@XWAþß!s  ‰0µU!5!2654&#!5!2£þæ@XX@þæsŸŸ0{X@?X{Ÿæ ‰0­U 4&#"32>"&4623X@AWWA@XzŸæŸŸæC?XW@AWX³æ  æŸH>Þ %™‡þãþ'‡þãÎ1üð11üð‰œ¥ß· ]]ÜìÜìÄ1¶÷‘ô<ì203!3ýäœCü½Cü½É~•K3#ÉÌÌK͉­!5!­ýÜ${‰1­V #5#53533ØzÕÕzÕÕÕ{ÕÕ{‰1­‡##5!ØzÕ$ þ%Û{{ÿÿ:Ø'‚UeÿÿÇÕ'‚âgÿÿÉ"Õ'‚=iÿÿwqÕ'‚ŒmÿÿhÕ9ÿÿhK'œÀE“ÿÿhÕ)ÿÿhO'ÐÀt“w^Õ:µÜ<Ôì1³B¯/ì0KSX@ííííY7 5wMû³çû¶40»ý‡äýˆÿÿw^O'Ð)t•ÿÿw^N'È)u•ÿÿw^Õ'‰¶•w^Õ:µÜìÌ21³B¯/ì0KSX@ííííY%5^ûçû³¶¶xäy»ýÐÿÿw^O'Ð1t™ÿÿÉÕ'‘5‰ÿÿ6Õ&9‰¡ÿÿÉÕ'“5‰ÿÿ6Õ&“‰¡ÿÿÉO'”5‰ÿÿ6O&”‰¡ÿÿÉóÕ'••‰ÿÿwEÕ&•‰°ÿÿÉóO'–•‰ÿÿwEO&–‰°ÿÿÉóO'š•‰ÿÿwEÕ&™‰°ÿÿÉóO'š•‰ÿÿwEO&š‰°ÿÿw^N'È1u™‰› ß<´ÜÌ291µB÷‘ôä0KSX@}}}}ííííY5 üéý`sb€bsþщœß³]Üì1´÷‘ôì03‰œCü½ÿÿ²ÿã)Õ8ÿÿ²)K'œðE®²)ò*@ 8AüK°TX¹ÿÀ8Yìüì1µ •‘ /<ôì03! #4&#"²!!Ë®Âî¤$*þÖþÜü\‹ðÓÓðüuÿÿ²)O'Ðçt®w^Õ¶ 2 Ü<ôì1¶• •/ìôì07! )5! )w¾5þáþËþBŸ²–þhþPþa¦.,¦þ—þ€þ~þ–ÿÿw^O'ÐÇt°ÿÿw^N'ÈÇu°ÿÿw^Õ'‰¶°y`Õ· 2üìô<1¶ ••/ìôì0%! )! !`þaþPþh–²ŸþBþËþá5¦¦j‚€i¦þéþÔþÒþèÿÿy`O'Ð"t´ÿÿÉÿã¬Õ&‰¬ƒÿÿ²ÿã¥Õ'‰¬ÿÿɬò'®ƒ‰ÿÿ²¥ò&®‰ÿÿɬO'¯ƒ‰ÿÿ²¥O&¯‰ÿÿÉóÕ'°•‰ÿÿw½Õ'‰(°ÿÿÉóO'±•‰ÿÿw½O&±‰(ÿÿÉÕ'´½‰ÿÿy½Õ'‰(´ÿÿÉO'µ½‰ÿÿy½O&µ‰(ÿÿðÕ'´½$‰œßµ ~ÜìÌ21@ Ý÷ Ý‘ôìôì0# $54$!3#"3nþðþÿnÍ™¾¨ nË××Ên“ ¹{ÿÿ²ÿã•ß'«|¬ÿÿ²•ò'«|®ÿÿw}ß'«d°ÿÿy¯ß'«–´F>ò %@ üìÜì21@ • •‘/ôìÜ9î0"32654&"$54$32#Bz­È_€²ÌÌ€²ëþï#ÙìÊR¤—¨”©“¤—ý3IðìúáðìûêÿÿÉÁK'œÀEÌÉÁò %@  üì2Üì1@ • •‘/ôìÜ9î0"32654&#4$32#&Åf̲€_È­þTÊìÙ#þïë²R—¤“©”¨—¤ý3ý{ìðáúìðÿÿÉÁO'ÐÀtÌFÿã>Õ (@  üìÜì21@ • •Œ‘ìôîÔ9ì0%2654&#"3#"$54$3Bf̲€_È­¬ÊþðìÙþÝ벃—¤“©”¨—¤Í…ûêìðáúìðÿÿFÿã>O'ÐÓtÎÿÿFÿãüN'ÈÓuÎÉÿãÁÕ (@  üì2Üì1@ • •Œ‘ìôîÔ9ì0%2654&#"672#"$53Åz­È_€²ÌÌ€²ëþÝÙìþðʃ¤—¨”©“¤—ÍIðìúáðìÿÿÉÿãÁO'Ð5tÑÿÿÉò'ÊÚ‰ÿÿF³ò'‰ÊÿÿÉ?ò'Ì~‰ÿÿÉò'‰|ÌÿÿÉ?O&‰Í~ÿÿÉO&͉|ÿÿÉÿãÕ'ÎÚ‰ÿÿFÿã³Õ&ΉÿÿÉÿãO'ÏÚ‰ÿÿFÿã³O&ωÿÿÉÿã?Õ'Ñ~‰ÿÿÉÿãÕ&щ|ÿÿÉÿã?O'Ò~‰ÿÿÉÿãO&Ò‰|ÿÿðÿã?Õ&$Ñ~‰‹ ß $·~ ]Üì2Ôì1@ ÝÝ÷‘ôôüÔì02654&#"632#"&53ÉXP^J\TaaQ_”¬·‰•«ùVFTHUGQK})†„Œ~†„J8‹¸ß 2654&#"03#"&54632xOaT\J^P«•‰·¬”_ùKQGUHTFV}iý¶„†~Œ„†ÿÿF‘ò'«xÊÿÿÉÃò'«ªÌÿÿFÿã‘ß'«xÎÿÿÉÿãÃß'«ªÑF>ò¶ ÜìÜì1µ •‘/ôìÌ0#4$32#4&#"Ê#ÙìÊÌf€²úáðìûꤗ©ÿÿÉÁK'œÀEêÉÁò· üìÜì1µ• ‘/ôìÌ04&#"#4$32÷²€fÌÊìÙ#’©—¤ûéìðáúÿÿÉÁO'ÐÀtêFÿã>Õ¶ ÜìÜì1·• Œ‘äôîÌ032653#"$5²€fÌÊþðìÙþݾ’©—¤ûêìðáúÿÿFÿã>O'ÐÓtìÿÿFÿãüN'ÈÓuìÉÿãÁÕ· üìÜì1· •Œ‘äôîÌ03#"$53326÷ÊþÝÙìþðÊÌf€²¾úáðìû餗©ÿÿÉÿãÁO'Ð5tïÿÿÉò'èÚ‰ÿÿF³ò&è‰ÿÿÉ?ò'ê~‰ÿÿÉò&ê‰|ÿÿÉ?O'ë~‰ÿÿÉO&ë‰|ÿÿÉÿãÕ'ìÚ‰ÿÿFÿã³Õ&ì‰ÿÿÉÿãO'íÚ‰ÿÿFÿã³O&í‰ÿÿÉÿã?Õ'ï~‰ÿÿÉÿãÕ&ï‰|ÿÿÉÿã?O'ð~‰ÿÿÉÿãO&ð‰|ÿÿðÿã?Õ&$ï~‰‹ ß¶] ]ÜìÔì1· Ý÷‘ôôüÌ03#"&53326y·‰•«aO\T•Œ~†„Jý¶PML‰‹ ß32653#"&5T\Oa«•‰·•QLMPJý¶„†~ŒwÕµ:Üüì1´•/ôì0!#!5!Êý)¡+ªÿÿÉjK'œ©EÉjÕ@ •:üìì1/ôì03!!É¡ý)ÕªúÕÿÿÉjO'ЩtwÕµ:Üüì1´•/äì0!5!ü_×Õú+ª+ÿÿwO'гtÿÿwÜN'ȳuÿÿÉjÕ/ÿÿÉjO'Ð5t ÿÿÉ5Õ&‰ÿÿw¯Õ'‰ÿÿÉíÕ&‰ƒÿÿÉ¥Õ'‰ÿÿÉíO'ƒ‰ÿÿÉ¥O&‰ÿÿÉ5Õ'‰ÿÿw¯Õ&‰ÿÿÉ6O'‰ÿÿw¯O&‰ÿÿÉíÕ' ƒ‰ÿÿÉ¥Õ& ‰ÿÿÉíO' ƒ‰ÿÿÉ¥O& ‰ÿÿðíÕ&$ ƒ‰œ¥ß´]ÜìÌ1¶Ý÷‘ôôì0!!3Œýä nC‰œ ßµ ~ÜìÌ21@ Ý÷ Ý‘ôìôì0! $54$)!"3 þúþðþÿþçÍ™¾¨ nË××Ên“ ¹{‰œ¥ß3!5ýä Õü½nwÿãŠ} (@  ÜÔìÔ9ì1@ •Œ• Ôì2ôî0"32654&'2#"$547!5œ‹È__ȘúþïìëþïLýšÓ¦n¨””¨ƒ‘ªáÝìððìªjªÿÿFÿãY 'œiÿFÿãY} )@  üÄìÔ9ì1@ •Œ• Ôì2ôî0"32654&'!!#"$54$C™È`^È‹›ý™MþïëìþïÓ‘ƒ¨””¨n¦ªªjªìððìÝáÿÿ ÿã'Ðiÿ<ÅwŠš "@  ÜÔìÔ9ì1¶•• /ì2Ôì0%2654&#"!5!&54$32˜È__È‹œûêfLëìþýª‘ƒ¨””¨n¦ªªjªìððìÝáÿÿwŠ'Ъÿ<!ÿÿwŠ'Ȫÿ<!FYš #@  üÄìÔ9ì1¶•• /ì2Ôì0%2654&#""$54$32!C›‹È^`È™úþýìëMgª¦n¨””¨ƒ‘ªáÝìððìªjªÿÿFY'ÐTÿ<$ÿÿÉÿãH}'¾‰ÿÿwÿãÐ}'‰;ÿÿÉ3š'$Ú‰ÿÿFYš'‰y$ÿÿÉ3'%Ú‰ÿÿFY&%‰yÿÿFY'ÈTÿ<$‰ß\ä 2654&#""&546 !Éj>_IEcI_£¬(¬0ƒMJBSKFXCIn~|„‡‡„Q;n‰‹.ß"&5332653ܨ«abaa«‹†„Jý¶PMMPJý¶„†‰ß\ä 2654&#"0!5!&546 _IcEI_>jýmƒ0¬(¬£MICXFKSBJnn;Q„‡‡„|~wŠšµ ÜÔìÌ1µ• •/ìÔì0%2654&#!5!2#bŘûêúþï쥒¥ƒ‘ªáÝìðÿÿFY 'œ¤ÿ2FYš¶ üÄìÌ1µ ••/ìÔì0%"$54$3!!"Cìþïúûê™Æ¥¥ðìÝ᪑ƒ¥’ÿÿFY'Фÿ<2wŠšµ  ÜÔìÌ1µ• •/ìÔì052#!5!2654&ìþýúûê˜Åõ¥ðìÝ᪑ƒ¥’ÿÿwŠ'Ъÿ<4ÿÿwŠ'Ȫÿ<4FYš¶ üÄìÌ1µ•• /ìÔì0"3!!"$54$3CbÆ™ûêúþýìõ’¥ƒ‘ªáÝìðÿÿFY'Фÿ<7ÿÿÉHš'0¾‰ÿÿwК&0‰;ÿÿÉ3š'2Ú‰ÿÿFÆš&2‰1ÿÿÉ3'3Ú‰ÿÿFÆ&3‰1ÿÿÉHš'4¾‰ÿÿwК&4‰;ÿÿÉH'5¾‰ÿÿwÐ&5‰;ÿÿÉ3š'7Ú‰ÿÿFÆš&7‰1ÿÿÉ3'8Ú‰ÿÿFÆ&8‰1‰ß\ä"3!!"&5463ÜRiPY’ýnž£¬§vDZHCn~ƒ}‡w^Õ %5-5 ^ûjü–çüìü¶¶2äÔÕä2»éì¸éF Õ ·? Üìüì1µ• /ôÔì0!3#$53TCcÊþúþ ʨþ™þ½ýXonÿÿÉ2K'œ EKÉÕ @ ? üìüì1µ •/ôÔì053#3 ÃÊþ þúÊcCT¨-nþcþ‘ý¨þCÿÿÉO'Ð tKF Õ · ? Üìüì1µ •/äÔì0%#5%3# ÊôÊcþ½þ¬--noXýþ½ÿÿF O'УtMÿÿFÌN'È£uMÉÕ @  ? üìüì1µ• /äÔì0%!#3#Ãþ¬þ½cÊôÊ-gCþý¨þ‘þcnÿÿÉO'Ð3tPÿÿÉäÕ'IÚ‰ÿÿF‘Õ'‰üIÿÿÉÕ'Kƒ‰ÿÿÉ´Õ'‰KÿÿÉO'Lƒ‰ÿÿÉ´O&L‰ÿÿÉäÕ'MÚ‰ÿÿF‘Õ&M‰üÿÿÉäO'NÚ‰ÿÿF‘O&N‰üÿÿÉÕ'Pƒ‰ÿÿÉ´Õ&P‰ÿÿÉO'Qƒ‰ÿÿÉ´O&Q‰ÿÿðÕ&$Pƒ‰œèß ¶ ] ] ÜìÔì1·Ý ÷‘ ôôÜì04&+3#X¸ÏHãìÆÇœ¶þ¹å¬V‰‹ìî+.#"#"&'532654'&/&'&54632¸Cw7Bh#-8GC>©¤=‹JG‰BAm'./G?;¢=~ÇH)@@V\`RʺªÒV\`RʺªÒ¾ÓhZáþç·%XÓhZá·þÛFÿãlò632#4&#"#"&3326tҪºÊR`\VҪºÊR`\V¾X%·ÂþçáZhÓý¨þÛ·ÂáZhÿÿFÿãlO'ÐóteFÿãÜ·'32654 !"/.#"3"54!2ú!„rz|K«È£þÙ¬×42 „swU¡ùÒ¤'­Ö4°X˧|`å¥þí•þÈ~pX˧|`å¥J š3þç~ÿÿFÿãÜ'Ћÿ<gFÿãÜ·'763 #52654&#"# '4!"326(24׬'£Òù¡Uv€r„!24Ö­þ٣ȫK|zs„°p~þÈ•¦þ¼¥å`|§ËXp~þç8•­=¥å`|§ËÿÿFÿãÜ'Ћÿ<iÿÿÉÿãò&‰d•ÿÿFÿãƒò&d‰îÿÿÉÿãò'e•‰ÿÿFÿãƒò&e‰îÿÿÉÿãO'f•‰ÿÿFÿãƒO&f‰îÿÿÉÿãÙ·'gý‰ÿÿFÿãU·'‰ÀgÿÿÉÿãÙ'hý‰ÿÿFÿãU&h‰ÀÿÿÉÿãÙ·'iý‰ÿÿFÿãU·&i‰ÀÿÿÉÿãÙ'jý‰ÿÿFÿãU&j‰À‰Ï¯æ'>72#52654&#"#"&'463"326[*'so¾b„I=J>",BˆþRðÓÓð‹ü\þÜþÖ*$²j¥t_UV²ÿã)ò '2654&"#"'&54632! 33265ð,B:d:B–0<~JI§jŠ­þßþåþæþßË®Âî€B,">>",BˆVU_t¥jýNþÜþÖ*$¤üuðÓÓð²ÿã)ò '"2654&'632#"&5! #4&#"ë,B:d:B–0<~JI§jŠ­!!Ë®ÂîUB,">>",BˆVU_t¥j²$*þÖþÜü\‹ðÓÓð²ÿã)ò '"2654&74&#"#! #"&547632ð(B:d:BB®Ã®Ë!!­Šj§IJ~<UB,">>",Bˆ®ðÓÓðüu¤$*þÖþÜýNj¥t_UVÿÿ²ÿã)O'Ðçt²ÿÿ²ÿã)O'Ðçt³S^Õ$264&"&546; )5! '&óVšþhþÞÌf€²Ê#Ùì¾ fýœ¤—©’úáðìw_ò:@ ÜÜ9ìÜì1@ B •‘/Ìô9ìÌ0KSX·ííY%4$32#4&#"!7gìÙ#ʲ€fÌþÞþhš¾Xìðáú’©—¤ûédfFÿã.Õ=@ ÜìÜì1@ B •Œ‘ä9ôîÌÌ0KSX·ííY#"$533265!>þðìÙþÝʲ€fÌ"˜šü¨ìðáú’©—¤ýœfwÿã_Õ?@  ÜÜ9ìÜì1@ B •Œ‘ä9ôîÌÌ0KSX·ííY '!32653#"$5gþªš˜"Ìf€²ÊþÝÙìþðýôfdû餗©’úáðìÿÿ‰ ÍK'é Úÿÿ‰ Íò'ê Úÿÿ‰ ÍO'ë Úÿÿ‰ÿã;ä'ìýÚÿÿ‰ÿã;O'íýÚÿÿ‰ÿã Íä'ï Úÿÿ‰ÿã ÍO'ð Ú‰¨(ä (2654&""&546323326=3#"&=ÉbFntnPX”¬¬”•«/¹Q,CE«ma¬ZT:KMMKFHn…|p‡‡pX;§oBGj§§„‡ˆƒ9‰¨$ä 3>2654&"!&546323326=3#"&=!"&54632!2654&"ÉbFntnP?+¬”•«/¹Q,CE«ma¬ûÊ”¬¬”•«/ëbFntnPZT:KMMKFH;Xp‡‡pX;§oBGj§§„‡ˆƒ9…|p‡‡pX;T:KMMKFHFY‰<@   üÄìÌÌ91·B•• /ìÔìÌ0KSX@ ííY!"3"$54$3!7Yûê™ÆbìþïúXýòhòþþ‘ƒ¥’¥ðìÝáUšÿÿFY‰'Фÿ<ÜwþŠš8·  Ì9ÜÔìÌ1·B• •/ÌìÔì0KSX@ ííY!26544#!w™Æbìþýúü¨ gX‘ƒ¥’¥ðìÝáþ«šÿÿwþŠ'Ð\ÿ<ÞFþYš:@  üÌìÔÌ91·B • •/ÌìÔì0KSX@ ííY'!"$54$3"3!Yýœhü¨úþýìbÆ™XþišUáÝì𥒥ƒ‘ÿÿFþY'Ðiÿ<à‰µ\ä'%!"&5463"3!\þ±=.ýÌž£¬§RiPY’¬÷Bè~ƒ}‡nDZHCwÕ%#535!53!3##qÉÉý=ÊýÃúÉÉÊà¤Ô­Ðý-þ‚¤à!®Õ%#5#53!3!3´ÊÉÉúýÃÊ=ýÉààà¤~Óý0­Ô¤ÿÿ!®O'ÐtäwÕ533#!#5!5#5qÊÉÉý=ÊýÃúÉõàà¤þ‚ý-ЭԤÿÿwO'ÐÚtæ!®Õ5##3!35!535´ÊÉÉúýÃÊ=ýÉõàà¤þ‚ý-ЭԤÿÿ!®O'ÐVtè ›èß33#!#!5#53‰Ïþ¥‘mþ ßunfyþ~ÔnÉÿãÁÕ ,@  üì22Üì1@ • •Œ‘/ìôîÔ99ì0%2654&#"672#"'"#3Åz­È_€²ÌÌ€²ëþÝÙ·{O{ʃ¤—¨”©“¤—ÍIðìúáH+ÕÿÿɰÕ'sZÕ@  2üìôì1¶• • /ìôì0# !3! !ôþËþá5ôÊþaþPþh–²/þéþÔþÒþè/ú+j‚€i‰œNß !!!5!—©ýùý;þßVýnV‰ìN#5!5!5!53!!75$iþÎ2þÜ$iþä*þÖmÖ‚œ°°Vxn°°Vþ¢þßnÕ††ý™  u!s #'#37ÿ ‰Í͉û‰»»sþÏþ¾ööH+ßßÿÿ‰—ò'ÊY£ÿÿ‰ ±ò&Úèsÿÿ‰ Éò&Ûêÿÿ‰ ÉO&Ûëÿÿ‰ÿã 7ä&Ûìùÿÿ‰ÿã 7O&Ûíùÿÿ‰ÿã Éä&Ûïÿÿ‰ÿã ÉO&Ûðÿì÷åŸ!!ùüŸ¨ÿìÿŸ!!#!þYÊþXŸ¨ý öÿìÿÆŸ !!###!ÚþYÊ÷ÊþXŸ¨ý öý öÿìÿ‡Ÿ!!#####!›þYÊ÷Ê÷ÊþXŸ¨ý öý öý öÿìÿ HŸ!!#######! \þYÊ÷Ê÷Ê÷ÊþXŸ¨ý öý öý öý öÿìÿ Ÿ!!#########! þYÊ÷Ê÷Ê÷Ê÷ÊþXŸ¨ý öý öý öý öý öÿì÷”!3!!¨Ê§ûçŸõý ¨ÿì÷Æ” !333!!¨Ê÷ʧú&Ÿõý õý ¨ÿì÷‡”!33333!!¨Ê÷Ê÷ʧøeŸõý õý õý ¨ÿì÷ G”!3333333!!¨Ê÷Ê÷Ê÷ʦö¥Ÿõý õý õý õý ¨ÿì÷ ”!333333333!!¨Ê÷Ê÷Ê÷Ê÷ʧôãŸõý õý õý õý õý ¨ÿìÿ” !3!!#!ÂêÕêþ?êÕêþrŸõý ¨ý öÿìÿÓ”!333!!###!ÂêÕêîêÕêþ?êÕêîêÕêþrŸõý õý ¨ý öý öÿìÿ–”!33333!!#####!ÂêÕêîêÕêîêÕêþ?êÕêîêÕêîêÕêþrŸõý õý õý ¨ý öý öý öÿìÿ Y”#!3333333!!#######!ÂêÕêîêÕêîêÕêîêÕêþ?êÕêîêÕêîêÕêîêÕêþrŸõý õý õý õý ¨ý öý öý öý öÿìÿ ”+!333333333!!#########!ÂêÕêîêÕêîêÕêîêÕêîêÕêþ?êÕêîêÕêîêÕêîêÕêîêÕêþrŸõý õý õý õý õý ¨ý öý öý öý öý öÿìSC !3!!#!¨Ê§þYÊþXŸ¤þ\¨þ\¤ÿìSÆC!333!!###!¨ÊöʨþXÊöÊþXŸ¤þ\¤þ\¨þ\¤þ\¤ÿìS„C!33333!!#####!¨ÊöÊøÊ¤þ\ÊøÊöÊþXŸ¤þ\¤þ\¤þ\¨þ\¤þ\¤þ\¤ÿìS FC#!3333333!!#######!¨ÊöÊøÊöʦþZÊöÊøÊöÊþXŸ¤þ\¤þ\¤þ\¤þ\¨þ\¤þ\¤þ\¤þ\¤ÿìS C+!333333333!!#########!¨ÊöÊøÊöÊøÊ§þYÊøÊöÊøÊöÊþXŸ¤þ\¤þ\¤þ\¤þ\¤þ\¨þ\¤þ\¤þ\¤þ\¤þ\¤ÿìÿ”!33!!# #!êÕššÕêþrêÕ™™ÕêþrŸõþòý ¨ý ïþöÿìÿ”%!3!!#!!2ÐÑü^DéD^þ£þ»éþ»þ£ÏŸ÷þæ¨õý ¨ý öþÿìÿWcŸ !!!5!5!!!wûûùþÑùüsþXŸ¨þ¨¨þ ÿìþ ·Ÿ#5!! !!'!%'! !7%!77'7! Ëþºýô þúþwƒþúƒƒþúƒþwþú ýô‰ƒþúƒƒþúƒƒƒƒƒ‰þú÷¨¨þþu|ù||ù|þ‹ññþ‹|ù||þ|||||u ÿì÷ G7+/37;?CGKO!5#535#535#53533533533533#3#3#!!#3%#3%#3#3%#3%#3#3%#3%#3¨ÊÊÊÊÊÊÊ÷Ê÷Ê÷ÊÊÊÊÊÊʦö¥ë÷÷þ?÷÷þ?÷÷‚÷÷þ?÷÷þ?÷÷‚÷÷þ?÷÷þ?÷÷Ÿ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨𨨨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ÿì§‹Ÿ!!!!¶øüÊŸúaO¨ø¨q:#[!' 7#þ}þCrŸþar¼Ÿ¨þCrŸžrþDÿì:ž[! !„¼rþaŸrþCþ}Ÿ¼rþbþar½=` !#!#3!ÃfþfäúþÀÀþí`ýG [`3!!!!!!!! Ùjýöóþ ý/þ¾tšè`”þÓ”þˆ“þíÍýÚ&{ÿão{4=J%#"'&=!.#"5>32>32#!3267#"'&32767%2654'&#"JÔ„â„„N Ì·hddddÐj§||MIؽii~ûþþST—`¶Te__ZŽjkü÷SR‰™\]i߬A@o™\]›Z^‘’úZ¿È5®*,=>` #% 54)3#4+327#!5#53!2xþþþúÜÜÞìòòì¹ÖŒçÖþ9||¶ÅÔ™µ´f¤_‘þڪИr–¤ø¤Äÿÿqÿãç{Fºg`32654&#%! )sÙËËÙþº7F0þÎþ¼þÉÍüÇÇÖÕÇ“þñþàþßþð$g` ! )#53!#32654&+º7F0þÎþ¼þÉ––zÁÙËËÙ`þñþàþßþðõ¤¤þŸÇÖÕÇþ̺‹` !!!!!!ºÄýöóþ ý/`”þÓ”þˆ“‚ÿãÅ|1#"&'5327654'&+5327654'&#"567632¿p<54& #.54! ì++ãþfã++ª$$>:#tNP³ÆÆ³PNM¥]ý*þÓþúU¢3MY + 3267>54&#"'>3 '# 5467'7²ý°*(èÈOuš))ëÓHn.—MÅw834¨O³MÆxþíþÇ43¨Nç)gA“¬\*g>—©}66þïñ]ŸC‹_’56ð`¡?‹`qÿãÃ{&/=5!&'&#"5>3267632#"'&'#"'&732767276'&#"qN ff·jÈbdÐj òQGhiŒñˆ‰‰ˆñŒijBNèâ„„¹RR‰™\]”VVUV•“¬VVZ¾dc44®*,nmn67œþíþ윜78lkp‘’ĘZYWWžþ´st’tsèÈÇtuq/u{ 4&#"#32²¬“”¬Âñð/ÇéçÉ8þÈþìqÿãu/ 32653#"4¬“”¬Âþïñðþî/ÇéçÉþìþÈ8—Ì`!264&#%!2#!#N[cc[þH¸¼ÁÁ¼þÿ·Åþ˜^¬^›ªþ¶ªþ>2`!.54763!##"#676#";µjpklÙ„¹©a;;?¢Ã®545ØÆw?@@?wÆ Œi¢QPû Ù%$qþá2^66É**TS++2`!&'&'3;3!"'&546#"3µ7545®Ã¢?;;a©¹þ|Ùlkp Æw?@@?wS66^2þáq$%Ùû PQ¢iŒþcQ++ST**ÿÿ<m`κÿà`$ 653 &53æs¹ÙþXÙ¹}Ž¢³ý;ÛààÛÅýM¢®L+ö%!5!2654&#!5!#TýZŸŸŸ¾¤ý…`¬fcðL¸||–¬¸¸B²tÂÈ®NÛø5353!5!2654&#!5!#®ÊÊÊŒýZŸŸŸ¾¤ý…`¬fcðxÌÌþzÊʤ¸||”®¸¸D°vÀÈ/þª{&#!5!2654&#!5!27654'&#!5!#¸|vz{âý\ž¡œ¾¤ý‡ž¢MN`_£ý‡`®gb>> EÀ‚¯__¹ru¦¹99wSS¹¹?°yzVUÿÿ=`YÿÿV5`ZÿÿXÛ`]xÿãº`73264&+5%5!2 'СӀ„{n ýÔþöF—oäþ}ɽBd»d>““þÂJŸm ¶7³ü{3!!³Iý{ªü/ÿÿ=`N—ì`#!#ì¶þ¶`û ·üI`ÿÿ—Ì`-Z^`367653#5&'&3¸U9Vˆm±¸¯mŠÄV9S`ý1MsÉ,þÔþìœ}îî}œ,þÔÇuMÿÿLs`Ç œhà !3#'!#¹­Zõg„VþXV†qþ`ü¼ÖÖœ–à!!!!!5!#!Šþ.¿þAÞý¢þ³eŠWÐ"à_ø_þÑ_ÖÖDXþI·œà &327654'&#327654'&#%!2#!þÌg1221g̼^-..-^þÅE‘OO)(N^h¬žþ¯+þÎ&&MO%%Xü@? ]65dL.- rUpzœ•à 327654'&#%! )þšÂ[ZZ[Âþ瀀þðþûƒývNO©¨NN]eeרfeœÝà !!!!!!Rþ-Àþ@ßý¢à_ø_þÑ_Sœ±à !5!!5!5!5±ý¢Þþ@Àþ-àü¼_/_ø_HŒ~ï$5#5!#"'&547632&'&#"326ÐNJYXeÝ|}}|Ý\SRFFPOW­WVVW­Cjá]þ™/rsÌÍsr'y5UVª©VUœLà 3!3#!#΀€þ2àþ©Wü¼Žþrœþà3#àü¼ÿ½¶þà 3+53265A@1(TFàüö—DE`Tlœià 33 ##¦¤þ-ô§þ<àþŸaþzþB“þmœÈà3!!Êý·àý_œÛà 33###½ðò½|ò€ó{àýÇ9ü¼ÞýÃ=ý"œGà 33##«¡|¬þ_{àýE»ü¼»ýEœGà ##3G|þ_«{¡àü¼»ýEDýE»HŒ¯ï"327654'&$  '&üŠRQQRŠ‹QQQQþ¯Œwvvwþtww“[\Ÿž\[[\žŸ\[\vvÆÅvvuvŒGŒ>ï@"327654'&327654'&'52#"&54767&'&54763ÂsCDDCstDCCBšR65<%€j<=0ER^X65`l<=ca¸·Ä==ll*6RI¢)++LK,++,KL++5##,&)$%LY+8:6iG2278PyAA‚yP87'21I.*œÞà 32764'&#%!2+#þ Y0110YþážQQQQž ƒþÆ))–))]?@ö@?þ°œ[à #'&'&+#!232654&#=)&''ˆy.,,LŠ¡PO)*þs \^^\$ )(GäÖTþŸD<32#"&'#3t45¸5445¸5þª$pMPPPPMp$uucä@AA@ä@AA86Z[þØ[Z68^gGŒ¾3#5#"'&76322764'&"Jtt%78N€PQQP€N87þš45¸5555¸5°Sü™^8Z[([Z¡ä@AA@ä@AAGŒÕ#!32767#"'&547632&'&#"Õýë@AsC?>>>BAD©bc^]ŸŽSSt44Va:: ï2j88a WW•š[ZQRmT3210YGŒÕMK° SX@ ÔÌÄÔÌ2K°SK°QZK°T[X½ÿÀÿÀÿÀ888Y1@   ÔÌ/ÌÔÌÔÌ0Y5!.#"5>32#"&73267G‚sC}>?ƒC©Å»ŸŽ¦thVau»2koa®•šµ£mTebXTŒb2&'&547632.#";#"32767#"&5476ùG&%HG{065>=f,K,,+*Ib]W-155_;65-9553–¢+,î$$4O,, ^$'U13 `fa<))RŒ`1#"'&'532654'&+5327654'&#"5>32»FLHG{065>=23-KX+*Ib]V.156_:65-9j2–RQ,+¼ H4O-+]4$'U 12  `33a<))G­¾ 14'&#"327#"'&'53276=#"'&763253J44^]4444]^4¨PP¥=7633223r99$88N‚OPPO‚N88$tmà=>>=à=>>F NO e 45k37XX"XX7_z¨î3#53ztttýô‚‚uœç 33 ##uuZ”þ‰†—þšuýþþÛþ²2þÎuœ{"4@ $ #ÔÜ32>32#4&#"²tHKYhuu'oMLl+yRowtHJZiþþžw[Wk\þžsa97EBEB‰~þ…wZXku­Ä4@ ÔÜþzx66X6V‚YYk\þžsa8BDGŒÏ 6@ ÔÌÔÌK°SK°QZK°T[X»ÿÀ ÿÀ88Y1@ ÔÌ/Ì0"32654&'2#"&546‹]ml^]ll]—­­—˜¬¬Çqq‚poƒW®›š¯¯š›®GŒu 67632#"'&'532764'&#"G0336¥^_]^ :5311213p?>>?p3121÷ XX™—YY _ ?@æ@? GÕÏ4'&"#46320T66º67z¬˜—WVÕoBAA@q›®WW›GŒÏÕ27653#"'&50Â66º67z¬˜—VWÕoBAA@q›®WW›u­ì#3>32#"&$4'&"27êuu$pMPPPPMpf45¸5445¸5úþ³b_86Z[þØ[Z6¡ä@AA@ä@AA#œÛÁ3#;#"'&5#535ìïï0Hww†33UUÁ²Pþ¬M,V-,vTP²nŒ½3327653#5#"&nt''N^67tt+78Jy~”{þˆY,-65\cý`9†nÇAÔ!5!27654'&#!5!#þU¦e22<KLÇg#"FS10gg%dAl88u{(#"&53327653327653#5#"&Q+<=Rnxu$$IZ54t$$KY45tt(78LMlE!"Šzþ‰[+,64\cþ‰[+,66Zcýb;F&œÕ33#&{ÝÜ{þøžýòýy­Ü #! !&'3254554#"ít n°þÏ…9F}µþÛæ”¥Ãþê^Ø™83•þö¸a°ž _·{¯­Õ3#5&+532ã›Ü{þãt¹<,|­þ|æýïïÔGXGŒÏï+&#" '&54767&54!232654'&'&yA– §‚JZVWþÒVWW!/b‹LþÌ+"766^]l9=P(r(B4?Kœ”WXXWšr]$,O˜'þø(@ä?A‚jp69G­  )"27654'&'2##5"'&5476734 )=;67-!XQVVQs~SVV@h)%661F¼Qþ:5}t?3XJO¥˜ZUâáUXš R=\ ,Ajq@:©%­Ä'#&+53;'&Í^Á‰sa,£(^Á‰þïra,£×þƼGX]×:þDþøFYÿÿzîg óýdÿÿu‚uýdÿÿnÿð½sjýdÿÿ&ÕsmýdÿÿyÿÜonýdÿÿÿÕsoýdyÿï‚67632#"&'#44&#"326²&_%s€  €No%tþi\[jj[\i92µþض78þ³"{q‚‚qrÿÿGÿ xqýdÿÿ%ÿÄtrýdºþV£{(!2.#">32#"&'#32654&#"ºþa¬QQžRµ´9²|ÎüüÎ|²9¸¸¥•”¥¥”•¥F³,*½¿[cbþÆþýþüþÆbcª#ÈÜÜÈÇÜÜÿÿœLàFt„`5!#3#3!53#53t¨¨¨¨ýð°°°¼¤¤þ¬¤þत ¤T‘þV/%+53276'7#3/¤´F0j&*¸¸š®ÖÀœ06”ú†GŒ¾#367632#"'&$4'&"27»tt%87N€PQQP€N78f54¸5555¸4ú_s^8Z[þØ[Z¡äA@@AäA@@GŒu&'&#"32767#"&54632u1122q>??>q22110h;Ÿ¼¾¥533÷` @?æ?@ _²—™° GKv+325&#"47&'&54632&'&#"632#"Z%0\R@5`$^¾¥4412/412q>??5{¼Ò3î *š &;/Z–™° ` ?@æ@bŠiGŒÏ.&'&#"32654'&7#"&54632''7'37 i:;n\[nO$$ZY‘’²®‹ dɱrPѺœ =67TŒb1#"'&'5327654'&+532654'&#"5>32½N+,QR–2658-56:_651.V]aIV-+K-32==l/|GHLî ))¿¿unn77wU:8PýÝ#P,i/0ÿé­\+53276=1#5333î43r,Brrtnœ x66XU P#ýÝPG­¾ ,5#"3276#"'&'53276=#"'&54763JÆ]4444]^44tPP¥=7633223r99$88N‚OPPO‚Ýë>=à=>>=¢ýÛ NO e 45k37XX‘‚XXn­½3327653##"&nt''N^67tt+87Jy~”{þˆY,-65\cüžO9†Iœ– 5333##53#Irtggttt™\þæ\ýýj‚zœ~ ;#"&5îC,rfþpUWlwIœ– 5!#3!53IMjjþ³o³\\þE\\»Iœ–5!#3#3!535#535IMjjjjþ³ooo³\\¾\¡\\¡\¾ÿV­`3#"54;33#'#"3276ztte¿ªztry "3rKNB ‚ü,|ssýW?#5˜$ z­~3;#"&5ztC,rfäüáSVXlx[­`+53276'7#3`34r,Bttòax66XS güïqœƒ3!!q“ýîýÝ_u­{467632+53265&7454&#"#4'&#"#367632Ÿ+=32#4'&#"î43r,B0t*pJz>?t'(N^66‘x66X6V~a88BDþ…wY,-56\u­U 4'&#"#367632;#"'&5P''N^66uu)89Jy?>0B,r34Y,-56\þžsa8BDþzV6X66xqœÄ 33##q«-{«þÓ{þùý~úþGŒÏ 2#"'&5476"!&'!3276‹—WVVW—˜UWWUõº6/‘/1þw &6^]6&WW›šWXXWš›WWW@9\[8ïE-AA.G®Ï&.#5!#3!535&'&5476767654'&O—¢—pFVVFp—þ^—nCWWCnt6%66%ª4#76$§\\ŒFW›šWG…\\†FWš›WE[þ*,ApoA-þ9Ô*Aâ@+F­a:.#"#"/;#"'&=32654'&/.547632;1j8W*,]({44MNˆ9> 0B“ r34@?>=RX l)k`GF‚@rýb/$+*MW33 V6X66x"j2-*TIX00ÿé­Ê476;#"+5326z73zno>43r,B0‘]Me30U:ýJx66X6#­ÛÁ3#;+5326=#"'&5#535ìïï0Hw43r,B0†33UUÁ²Pþ¬M,ax66X6V -,vTP²^Œ!533!33##5#"&=)3276^ntgtuut+87Jy~Úþš''N^61™\þæþæ\ý`9†‚Y,-6/G‹Ø&5!327654'&'5!# '&54767GE()78Z[78*,?”G$"ZYþäYZ!"J³\{':?KY7667YR8>#{\8?>LƒRRQR€R<=:uŠ’2653#"'&53„QHuDE…†EDuHâPZƒþs{>??>{þ}ZPzœ¿31+"&53?27654'&'&gËH#"YZŽ,rftA Z87)2:0Ä8?>LƒRRlwþpU67YQ8C&œÕ# #3Õ{ÜÝ{ žœýòs7œn !!!5!G'þL´ýÉ´þ\^þ=R^Ã7­ý!!#;#"&=!5!G'þL´C,rfþ>´þ\^þ=R VXlx ^Ã7^n#47#5!5!3632#'3254#|`å´þ\'þLn&ŠÒ m,7œ!!^ÃR^þ=¢ŠjR37¨£!2#"'&'5327654'&+5!5!hCQ>63``°;??C5~Ex>?::hnþ\&§ =;M|CD m**PJ*)]R^GÏ !32767&'&"2#"&76Sþo/6^]6/ +6º6,Ç—WVVW—˜¬VV*€MWXMÞmGYXFoƒvwþ^wwî¢wvü[îÿ¥f!5!73þ°ý«¨‹î”äü[îÿ¥f3!ýPõ‹¨îxä”ü[îÿ¥f#'!5þ°õ‹¨ýéfþˆä”ü[îÿ¥f!!#ýPUý騋f”äüBîÿ¾f 3#'#3þ5”õ‹´´”õ‹´fþˆõõxõüBîÿ¾f 73#'#ýË´´‹õ”´´‹õfõõþˆõõxÿÿþhÕ'Ö¼$ÿÿ{þ-{'ÖTDÿÿÉìN'Эs%ÿÿ®ÿã¤N'¸>EÿÿÉþ‡ìÕ&%Ô¥ÿÿºþ‡¤&EÔšÿÿÉþÀìÕ&%—ÿÿºþÀ¤&Eÿÿsþu'l'ÉLv‰ÿÿqþuçf&©vCÿÿɰO'Ðýt'ÿÿqÿãbN'¸þ>GÿÿÉþ‡°Õ'Ô®'ÿÿqþ‡Z'ÔzGÿÿÉþÀ°Õ&'èÿÿqþÀZ&GOÿÿÉþw°Õ&'z[ÿÿqþuZ&GzöÿÿÉþ°Õ'ˆ¦ù&'ÿÿqþZ'ˆ^ù&GÿÿÉ‹Z&(îÿÿqÿã^'ÿÙÿHÿÿÉ‹Z&(ìÿÿqÿã^&Hÿ×ÿÿÿÉþ‹Õ&(Þ±7ÿÿqþ{&HÞ°7ÿÿÉþv‹Õ&(°³ÿÿqþv{&H°›ÿÿÉþu‹m'Ï¡u&(z¾ÿÿqþuH&H'š‡zKÿÿÉ#O'Ðvt)ÿÿ/øP&I› @ÿÿsÿã‹&*‹2"ÿÿqþVZö&J‹IÿÿÉ;N'Ðs+ÿÿ®dN'¸>KÿÿÉþ‡;Õ'Ô+ÿÿºþ‡d'ÔKÿÿÉ;P&+j@ÿÿÿídN'¹>Kÿÿþt;Õ&+zþîÿÿÿÿþtd&KzþßÿÿÿÿÉþ9;Õ&+ß ÿÿºþ9d&Kß•ÿÿþv”Õ&,°ÿJÿÿÿÓþvg'°ÿLÿÿYZ&,þþtÿÿÿôF&óþþaþ¼ÿÿÉjl'Éâv.ÿÿºœl'ÉZvNÿÿÉþ‡jÕ&.ÔÜÿÿºþ‡œ&NÔ‘ÿÿÉþÀjÕ&. ÿÿºþÀœ&NvÿÿÉþ‡jÕ'Ôš/ÿÿÁþ‡'Ô'O ÿÿþˆjk'µ*u'Ô™/ÿÿÿýþ‡S1'qÿ(;âÿÿÉþÀjÕ&/ŽÿÿÿôþÀJ'ÿOÿÿÉþjÕ'ˆ—ù&/ÿÿÿÞþ\'ˆÿù&OÿÿÉl'Ésv0ÿÿºf&Pv”ÿÿÉO'Ðwt0ÿÿº'›FPÿÿÉþ‡Õ'Ôt0ÿÿºþ‡{'ÔæPÿÿÉ3N'Ðþs1ÿÿºd'›QÿÿÉþ‡3Õ'Ôþ1ÿÿºþ‡d{'ÔQÿÿÉþÀ3Õ&1÷ÿÿºþÀd{&QŒÿÿÉþ3Õ'ˆþù&1ÿÿºþd{'ˆ•ù&QÿÿsÿãÙZ&2fÿÿqÿãu &Rÿ²þ²ÿÿsÿãÙV&2lÿÿqÿãu&R'joÿÊrÿÿsÿãÙZ&2jÿÿqÿãu^&RÿµÿÿÿsÿãÙZ&2hÿÿqÿãu^'ÿ¹ÿRÿÿÉl'Éžv3ÿÿºþV¤f&Sv2ÿÿÉO'Єt3ÿÿºþV¤'›ÙSÿÿÉTN'Ѓs5ÿÿºJ&U›ÿÿÉþ‡TÕ'Ô}5ÿÿºþ‡J{'Ô UÿÿÉþ‡T1'q}; ÿÿºþ‡Jõ&qÿ ÿÿÉþÀTÕ&5åÿÿTþÀJ{&Uÿÿÿ‡ÿã¢O'иt6ÿÿoÿãÇ&›%Vÿÿ‡þ‡¢ð'ÔŠ6ÿÿoþ‡Ç{'ÔVÿÿ‡ÿã¢m'Éâv'Ф’6ÿÿoÿãâf&V&›ŒVvÿÿ‡ÿã¢W&ä6ÿÿoÿãǰ&#›" ÿÿ‡þ‡¢O'Лt ÿÿoþ‡Ç& ›*ÿÿÿúéO'Ðrt7ÿÿ7òN&W›ÿ#>ÿÿÿúþ‡éÕ'Ôq7ÿÿ7þ‡òž'ÔèWÿÿÿúþÀéÕ&7bÿÿ7þÀž&ôWÿÿÿúþéÕ'ˆrù&7ÿÿ7þ'ž'ˆÿèù&Wÿÿ²þ‰)Õ'Õð8ÿÿ®þ‰X`'Õ{Xÿÿ²þv)Õ&8°òÿÿ®þvX`&X°ÿÿ²þ)Õ&8Þà7ÿÿ®þX`&XÞu7ÿÿ²ÿã)Z&.8ÿÿ®ÿãXì&+v–†ÿÿ²ÿã)4&ü28ÿÿ®ÿãXô'üÿÈþÀXÿÿh}&9žíFÿÿ=7&Yžmÿÿþ‡hÕ&9Ô¼ÿÿ=þ‡`&YÔ^ÿÿD¦r'Ëõ|:ÿÿV5k'C ZÿÿD¦r'Éõ|:ÿÿV5m'v†ZÿÿD¦N'jõ>:ÿÿV5'jEZÿÿD¦N'Ðõs:ÿÿV5&Z›GÿÿDþ‡¦Õ&:ÔûÿÿVþ‡5`&ZÔJÿÿ=;O'ÐÊs;ÿÿ;y&[›gÿÿ=;N&;jÊ>ÿÿ;y&[jfÿÿÿüçO'Ðps<ÿÿ=þV&\›fÿÿ\m'̾u=ÿÿXÛf&]ˆÿÿ\þ‡Õ&=ÔÙÿÿXþ‡Û`&]Ô1ÿÿ\þÀÕ&=ÇÿÿXþÀÛ`&]ÿÿºþÀd&KfÿÿòN&Wjÿ->ÿÿV5&ZœBÿÿ=þV&\œÿÿ{ÿãa&D€Úÿÿ/øP&A›ÿý@ÿÿþ‡hÕ'Ô·$ÿÿ{þ‡-{'Ô!Dÿÿhð&$º¼uÿÿ{ÿã-{&DºTÿÿh:&$ÿÿ{ÿã¯Å'ÿ—þ‹Dÿÿh:&$ÿÿ{ÿã-Æ&Dÿ”þŒÿÿh[&$ÿÿ{ÿãæ'ÿ–þ‹Dÿÿhu&$ ÿÿ{ÿã-' ÿ–þ‹Dÿÿþ‡hm&„Ô¯ÿÿ{þ‡-f&¤Ô"ÿÿhZ&$ ÿÿ{ÿã-' ÿ‘þªDÿÿhZ&$ ÿÿ{ÿã-' ÿ’þªDÿÿh‹&$ ÿÿ{ÿã-5' ÿ”þªDÿÿhY&$ ÿÿ{ÿã-&D ÿ’þªÿÿþ‡h’&ÄÔÀÿÿ{þ‡-&ÅÔ3ÿÿÉþ‡‹Õ&(Ôžÿÿqþ‡{&HÔ‹ÿÿÉ‹ð&(ºžuÿÿqÿã{&HºÿÿÉ‹^'Êžu(ÿÿqÿã7'ž—HÿÿÉ:&(ÿÿqÿãèÅ'ÿÐþ‹HÿÿÉ‹:&(îÿÿqÿãÆ'ÿÐþŒHÿÿÉõ[&(îÿÿqÿã׿&HÿÐþ‹ÿÿÉ‹u&( êÿÿqÿã' ÿÑþ‹HÿÿÉþ‡‹m&ŒÔžÿÿqþ‡f'Ô‹& `ˆ‹ÿÿZð&,º#uÿÿD|&óº ÿÿÈþ‡”Õ&,Ô.ÿÿ·þ‡ƒ&LÔÿÿsþ‡Ùð&2Ô'ÿÿqþ‡u{&RÔsÿÿsÿãÙð&2º'uÿÿqÿãu{&Rº}ÿÿsÿãÙ:&2lÿÿqÿãÎÅ'ÿ¶þ‹RÿÿsÿãÙ:&2jÿÿqÿãuÆ'ÿµþŒRÿÿsÿãÙ[&2jÿÿqÿã½æ'ÿ¶þ‹RÿÿsÿãÙu&2 eÿÿqÿãu' ÿ¶þ‹Rÿÿsþ‡Ùm&–Ô'ÿÿqþ‡uf'Ôs& tˆsÿÿgÿãk'É'ubÿÿvÿãÓf&vscÿÿgÿãk'Ë'ubÿÿvÿãÓf&Cscÿÿgÿãð&bº'uÿÿvÿãÓ{&cº}ÿÿgÿã^'Ê'ubÿÿvÿãÓ7&žscÿÿgþ‡&bÔ'ÿÿvþ‡Óë&cÔsÿÿ²þ‡)Õ&8Ôõÿÿ®þ‡X`&XÔ{ÿÿ²ÿã)ð&8ºîuÿÿ®ÿãX{&Xº}ÿÿ­ÿ÷_k'Éîuqÿÿ°ÿãif&v{rÿÿ­ÿ÷_k'Ëîuqÿÿ°ÿãif&C{rÿÿ­ÿ÷_ð&qºîuÿÿ°ÿãi{&rº}ÿÿ­ÿ÷_^'Êîuqÿÿ°ÿãi7'ž€rÿÿ­þ‡_&qÔõÿÿ°þ‡ië&rÔ{ÿÿÿüçr&<Ër|ÿÿ=þVk&\C!ÿÿÿüþ‡çÕ'Ôv<ÿÿ=þV`'Ôt\ÿÿÿüç÷&<ºr|ÿÿ=þV‚&\º`ÿÿÿüç^'Êru<ÿÿ=þV7&žw\ÿÿqÿçäa&> Qpÿÿqÿçäa&> ‰Hÿÿqÿçäf&> ^”ÿÿqÿçäf&> k„ÿÿqÿçäf&> _„ÿÿqÿçäf&> l ÿÿqÿçäm&> `vÿÿqÿçäm&> mDÿÿha& Qÿ#ÿÿha& ‰þóÿÿôf'Œ ^ÿ|ÿÿôf'Œ kˆÿÿf'® _ÿSÿÿXf'ð lÿoÿÿ™m&1 `ÿQÿÿàm&x mÿNÿÿ…ÿãÈa&B QDÿÿ…ÿãÈa&B ‰9ÿÿ…ÿãÈf&B ^ ÿÿ…ÿãÈf&B k%ÿÿ…ÿããf&B _Oÿÿ…ÿãf&B lRÿÿ-a'#¢ Qþÿÿ-a'#¢ ‰þÿÿ7f'#¬ ^ÿ|ÿÿIf'#¾ kˆÿÿ­f'#" _ÿSÿÿéf'#^ lÿoÿÿºþVda&D Q¦ÿÿºþVda&D ‰¢ÿÿºþVdf&D ^€ÿÿºþVdf&D kpÿÿºþVdf&D _„ÿÿºþVdf&D l®ÿÿºþVdm&D `œÿÿºþVdm&D m‡ÿÿéa'%® Qþÿÿæa'%« ‰þÿÿçf'%¬ ^ÿ|ÿÿíf'%² kˆÿÿnf'%3 _ÿSÿÿŸf'%d lÿoÿÿ¯m'%t `ÿQÿÿÊm'% mÿNÿÿ›na&F Qÿÿÿ‘na&F ‰ÿ ÿÿÿ°¹f&F ^ÿ'ÿÿÿºÇf&F kÿ<ÿÿåf&F _ÿQÿÿÿÒîf&F lÿ=ÿÿÿËnm&F `ÿÿÿÿÆnm&F mÿÿÿAa''® Qþÿÿ5a''¢ ‰þÿÿKf''¸ ^ÿ|ÿÿKf''¸ kˆÿÿÇf''4 _ÿSÿÿf''p lÿoÿÿ"m'' `ÿQÿÿ)m''– mÿNÿÿqÿãua&L Qxÿÿqÿãua&L ‰nÿÿqÿãuf&L ^eÿÿqÿãuf&L kTÿÿqÿãuf&L _ˆÿÿqÿãuf&L l‘ÿÿÿãüa&-# QþÿÿÿãVa&-} ‰þÿÿÿãOf'-v ^ÿ|ÿÿÿãYf'-€ kˆÿÿÿãf'-6 _ÿSÿÿÿãPf'-w lÿoÿÿ•ÿâ*a&R Q=ÿÿ•ÿâ*a&R ‰ÿÿ•ÿâ*f&R ^'ÿÿ•ÿâ*f&R k!ÿÿ•ÿâ*f&R _`ÿÿ•ÿâ*f&R lWÿÿ•ÿâ*m&R `8ÿÿ•ÿâ*m&R mÿÿIa'2b ‰þÿÿÿf'2 kˆÿÿf'26 lÿoÿÿ3m'2L mÿNÿÿ‡ÿã'a&V Q^ÿÿ‡ÿã'a&V ‰Tÿÿ‡ÿã'f&V ^Yÿÿ‡ÿã'f&V k^ÿÿ‡ÿã'f&V _¤ÿÿ‡ÿã'f&V l‹ÿÿ‡ÿã'm&V `cÿÿ‡ÿã'm&V m^ÿÿa&6N Qþÿÿqa'6¢ ‰þÿÿif'6š ^ÿ|ÿÿuf'6¦ kˆÿÿCf'6t _ÿSÿÿyf'6ª lÿoÿÿm'6B `ÿQÿÿPm'6 mÿNÿÿqÿçäf&> }tÿÿqÿçäf9ÿÿ…ÿãÈf&B }Tÿÿ…ÿãÈf:ÿÿºþVdf&D }ÆÿÿºþVdf;ÿÿÿnf&F }þãÿÿ¦˜f<ÿÿqÿãuf&L }{ÿÿqÿãufYÿÿ•ÿâ*f&R }0ÿÿ•ÿâ*fZÿÿ‡ÿã'f&V }Mÿÿ‡ÿã'f[ÿÿqþVäa& ¡HÿÿqþVäa& ¢HÿÿqþVäf& £HÿÿqþVäf& ¤HÿÿqþVäf& ¥HÿÿqþVäf& ¦HÿÿqþVäm& §HÿÿqþVäm& ¨HÿÿþVha& © PºÿÿþVha& ª PºÿÿþVôf& « PFÿÿþVôf& ¬ PFÿÿþVf& ­ PhÿÿþVXf& ® PªÿÿþV™m& ¯ PëÿÿþVàm& ° P2ÿÿºþVda& ½ÿ8ÿÿºþVda& ¾ÿ8ÿÿºþVdf& ¿ÿ8ÿÿºþVdf& Àÿ8ÿÿºþVdf& Áÿ8ÿÿºþVdf& Âÿ8ÿÿºþVdm& Ãÿ8ÿÿºþVdm& Äÿ8ÿÿþVéa& Å PžÿÿþVæa& Æ P›ÿÿþVçf& Ç PœÿÿþVíf& È P¢ÿÿþVnf& É P#ÿÿþVŸf& Ê PTÿÿþV¯m& Ë PdÿÿþVÊm& Ì Pÿÿ‡þV'a& õYÿÿ‡þV'a& öYÿÿ‡þV'f& ÷Yÿÿ‡þV'f& øYÿÿ‡þV'f& ùYÿÿ‡þV'f& úYÿÿ‡þV'm& ûYÿÿ‡þV'm& üYÿÿþVa& ý P\ÿÿþVqa& þ P°ÿÿþVif& ÿ P¨ÿÿþVuf&  P´ÿÿþVCf&  P‚ÿÿþVyf&  P¸ÿÿþVm&  PPÿÿþVPm&  PÿÿqÿçäH&>šzÿÿqÿçäö&>qyÿÿqþVäf& HÿÿqþVäy&>HÿÿqþVäf&9Hÿÿqÿçä7&> RnÿÿqþVä7& HHÿÿhm&Ϻuÿÿh1&q¼;ÿÿÿüªf&B }ÿRÿÿhfÿÿþVhÕ& Pºÿÿ†Âxa Qÿÿ¶þV’ÿ¤†ÂxaH´ Ô<ܲ?]À1¶ Ô´?_]°KPXÌÀYÌ̲?]90±I±IPX³@@88Y#55#53xò†…ñÍþõgžÿÿ¶J7žÿÿ¶FJm'Ê„jÿÿºþVdf& ÿ8ÿÿºþVd{&Dÿ8ÿÿºþVdf&;ÿ8ÿÿºþVd7&D RÿÿºþVd7& Wÿ8ÿÿÿüíf'#b }ÿRÿÿÿçufÿÿÿü©f'%n }ÿRÿÿÿófÿÿÉþV;Õ&% Pÿÿÿ‰Â’f' Qÿ } ÿÿ´Â”f' Qÿ. ˆBÿÿ¶ÂJm'Ê„ QÿÿÿënH&Fšÿ$ÿÿÿãnö&FqÿÿÿÿØnÒ&F {ÿ.ÿÿ€Òÿÿÿäx7&F Rÿ.ÿÿÿæzm&F Sÿ0ÿÿÿõgm&'Ï.uÿÿY1&'qÿ.;ÿÿÿüf''q }ÿRÿÿÿí}fÿÿ~‹f' ‰þø }ÿÿ•±f' ‰ÿ ˆ_ÿÿ¶ÂJm'Ê„ ‰ÿÿ•ÿâ*H&Rš'ÿÿ•ÿâ*ö&Rq$ÿÿ•ÿâ*Ò&R {ÿÿ•ÿâ*Ò=ÿÿºþV¤a&N Q»ÿÿºþV¤a&N ‰±ÿÿ•ÿâ*7&R R'ÿÿ•ÿâ*m&R Sÿÿÿüçm&2Ïvuÿÿÿüç1&2q€;ÿÿÿüÇf'2à }ÿRÿÿÿá‘fÿÿ5a'/¨ ‰þÿÿªF)Ò&j }lÿÿ×FRÒÿÿªð‰fCÿÿ‡þV'f& Yÿÿ‡þV'`&VYÿÿ‡þV'f&[Yÿÿ‡ÿã'7&V ROÿÿ‡þV'7& Yÿÿÿüÿãf'-; }ÿRÿÿÿòÿãfÿÿÿüf'6D }ÿRÿÿÿÛfÿÿNþVÏç&6 PÿÿsîRfv†ÂxaH´ ÔÀܲ?]<1¶ Ô´?_]°KPXÌÀYÌ̲?]90±I±IPX³@@88Y53#7"†ò††òÍ”žgd߃¶œÜÌ1Ôì0!!dý僤ÿÿd߃ šdé³y¶©é/Æ1üì0!!dOû±ydéœy¶©é/Æ1üì0!!d8üÈydéœyµ©/Ì1Ôì0!!d8øÈyéyµ©/Ì1Ôì0!!øyÿÿþø&__Jÿÿÿìþÿî&BBB®éÓÕ@ žÜüÔÌ1ôì0#53Ó¤Ré­?þÁ²þ×Õ@ žÜìÔÌ1ôì03#Ó¤RÕ˜þÁ?®ÿÓþ@ žƒÔìÔÌ1üì0%3#Ó¤Rþ¬þÀ@²þ×Õ#5…R¤Õ˜þÁ?˜®émÕ '@ž   ÜüÌÔÌþÔÎ1ô<ì20#53#53Ó¤RšÓ¤Ré­?þÁ­­?þÁ®émÕ '@ ž  ÜìÔÌÜîÔÎ1ô<ì203#%3#Ó¤RšÓ¤RÕ¬þÀ@¬¬þÀ@®ÿmþ '@ žƒ   ÜìÔÌÜîÔÎ1ü<ì20%3#%3#šÓ¤RþfÓ¤Rþ¬þÀ@¬¬þÀ@®émÕ #5!#5R¤mR¤Õ­þÁ?­­þÁ?­9ÿ;ÇÕ '@¹  YW Y Ô<ìü<ì1äôÔ<ì203!!#!5!¨°oþ‘°þ‘oÕþ\™û£]™9ÿ;ÇÕ>@ ¹¹  ÂY W Y Ô<<ì2ü<<ì21äôÄ2Ä2î2î20%!#!5!!5!3!!!Çþ‘°þ‘oþ‘o°oþ‘oßþ\¤š™¤þ\™ýá3Ñ…! · Ç \ Ôì1Ôì04632#"&3­~|«¬}}¬ú|««|}¬¬3Õq3¢ðþˆìÁþ73#ìÕÕþþìkþ%3#%3#–ÕÕýVÕÕþþþþìþ #@ƒ   ÔüÔìÔì1/<<ì220%3#%3#%3#–ÔÔ©ÕÕú­ÕÕþþþþþþÜk¯i3#ÜÓÓiþqÿã Lð #'3?K®@D$%&%&'$'B@’ .’(’F’4 :&Œ$‘L%IC'1+C =  1 =I 7+ ! LüäìÔÄìäîîöîî991ä2ô<<ä2ì2îöîî20KSXííY"K°TK° T[K° T[K° T[K° T[K°T[X½L@LLÿÀ878Y"32654&'2#"&5462#"&546!3#"32654&2#"&546"32654&ôWddWUccUžº» º»ùtž¼»ŸŸ¹º% üZ VcbWWcd²žº» º»ŸWccWUcc‘”„‚••‚ƒ•Ü»»ÛÛ»¼ÛàÛ»½ÚÛ¼ºÜùóŽ•‚„””„–ýŸÜ»»ÛÛ»¼Û”„‚••‚ƒ• qÿã rð "-7;EP\"32654&'2#"&546"32654&'2#"&546  &54%3#"26542#"&546"32654& WddWUccUžº» º»ýyWddWUccUžº» º»øÖ<¼»þ¹ß üZ u¬cb®cNžº» º»ŸWccWUcc‘”„‚••‚ƒ•ÜþŠÛÛ»¼Û”„‚••‚ƒ•ÜþŠÛÛ»¼ÛàÛ»½ÚÛ¼ºÜùóŽ•‚„””„þ5ÜþŠÛÛ»¼Û”„‚••‚ƒ•(` Õ3(­Ëþß`uþ‹ÿÿ(`ÌÕ& º º,ÿÿ(`øÕ' º,& º ºX(` Õ#3 WþßË`uÿÿ(`ÌÕ& ½ ½,ÿÿ(`øÕ& ½' ½X ½, þ«ÿÃ#'#«”»¼•Rþùù¦žs#G@%èèèèBç¦onüì291ôì90KSXííííY" 5sþÓ-þ+#¿þôþô¿¢RÁ–#I@&èèèèBç¦opü<ì91ôì90KSXííííY"5 ÁÕþ+-þÓ#þ^Rþ^¿  ÿÿÃëÌ&™K'ÿèN''=NÎÿÿ“OÕ'ÿ^O“°ð$#5>323#7>54'&L¿ Za^Ág¸ßHZX/'ÅËËÅ-93A%‘­ #C¼98ŸL‰VV/5<4þòþBþR-5^1Y7ÿÿÿì| B_ÿ§þÇÿ… %³ ÄÔij991@  ÔÜÜ<Ì202$7#"$'56çÅåëþ:àßþ<ìæÂþµhh~vvuw~igÿ§Çn %³ ÄÔij991@  ÔÜÜ<Ì202&$#"56$6àÆëåþ;ççþ>æìÄnvv~hhgi~wuÿªþIÕ3 # #çbþâbíícÕþ$þ$Šþvÿÿ=ÿÅÃ' ý{' ý{ “Ý3_!!ÝVýª_Þþ‰ÿãÍð+@BŒ‘ÔÌ1ää0KSXííY"3#- ü\ ðùó°þòX 3!!#3hðþX¨ðð^ý#"ý#J°þòX 53#5!!53°ðð¨þXð^JÝøÞÝÿÿJð&"·"gÿÿ“Jð&"Jÿÿ“Jð'ÿ^"šdÿ–] 327#%dšêû³þà˜êþp]€û(®ìÿ;‡Õ 2###¬×ë׎¾Õ辸Ýü²ùášØÂ( 3+"&5463y¯¯v}¬­~ý±¬}|«ØÂ( ';2+‡¯¯v~­¬}ÂO«|}¬ÿÿ=ÿÅÃk ý{ÿB# #5#5ðÓÓR¤#þþüÛ¬þÀ@¬ÿÿÿ§þÇn& Ç Èÿÿ=ÿòÃo' ý¨ ÿÿ‘ÿBCÕ'‘'ŽÿÙHÿÿÙÓÛ1aÿÿÿ§þÇÿ~ Èø8È| #'7!5!'737!!ª ùqùþŸaúqú úqúaþŸúq)þŸ`ùrù úrûbþžúqú ùrú2¶¶ 535353úÈ,ÈÈÈÈÈþ¢ÈȼÈÈÿÿ(`$Õ' º,& º' º„ ºXfNè 53!535353fÈXÈý¨ÈÈÈÈÈÈÈþpÈÈ ÈÈföNÞ 5353535353öÈÈÈÈÈü,ÈÜȆÈÈþpÈÈ ÈÈüôÈÈ ÈÈÛ®Õ3#3#ÛÓÓÓÓÕþü'þdþåýï 3#%3#3#3#dÓÓÆÓÓýÓÓÓÓiþþþ„þùòþpDÕ %53535353#!5!3!†ÈÈÈü,ÈÜÈ| ýfš šöÈÈ ÈÈüôÈÈ ÈÈþ„ýfš ›ýe ÛP®> 3#3#3#ÛÓÓÓÓÓÓ>þýþöþÛ®w 3#3#3#3#ÛÓÓÓÓÓÓÓÓ‰þìþü–þðþWîð "27654/2#"&546Ê2332Ê233—¡ªª¡¢ªª—VV¬­VVVV­¬V¯ÞÓÔÞÞÔÓÞzœî@ Ü<Ü<Ì1@ÔÄÜÌ03#3#zttttýg‚?œôß Ô@ Ý ÷‘ ] ÜÔ<Äì291ôüÔ<ì290K°TK°T[K°T[K°T[K° T[K° T[X½@ÿÀ878YK°TK°T[X½ÿÀ@878Y@T /9IFYi‹«»       "5GK S[ e„¥µ]] !33##5!5ÝþË5¦‡‡þbfþ]ýämººyfÓß !!67632#"&'53264&#"Žþþy¡^^a`°<~B9>>Eo‚‚o4h6ß_Ì MLƒ‡KJq f®f\óð/"327654'&&'&#"67632#"&547632³X3333XW3333«1221€DD &9:D‘TTXW‘§°ll¶122m45[Z4554Z[54bg KL™1LM„ONÞÔÆuv lœÕß!#!liþ¤ˆHþ3ß0üíäYìð *:"32764'%&'&546 #"'&54767327654'&#"º55j]\655þìT./¤RQ./SZ85UVžŸUV56-/.UQ100/SS0/*,+KLV,+–+]12Hdt::dJ01:7PyAAAAyN98Æ?&%%$A?&%%$Séð.532767#"&547632#"'&2654'&#"‘1220DC #<9E¨WX‘§WXkl¶122ÌXf33XU5443®g KKš/˜„MNooÔÆuv rh\Z4554Z\44‰œ°k !!#!5!Q_þ¡iþ¡_kþÈ_þÈ8_8‰Ô°3!!‰'üÙ3_‰a°¥!!!!‰'üÙ'üÙ¥^‡_o #&'&4767TRRTe^///._üþþþ€ƒ€ú~„gˆ3#676'&ge_/../_eT)**)„~ú€ƒ€~~uœÄ0@ ÔÜ32ÄtNN^luu)qJy}þ…wYYk\þžsa88†ÿÿWÿñîT òýdÿÿ‰ÅC{ýdÿÿ^´TtýdÿÿbÿñÍTuýdÿÿ?ôC ôýdÿÿfÿñÓC õýdÿÿ\ÿñóT öýdÿÿlÕC ÷ýdÿÿYÿñìT øýdÿÿSÿñéT ùýdÿÿ‰°Ï úýdÿÿ‰8°— ûýdÿÿ‰Å°  üýdÿÿoÿif ýýdÿÿgÿiˆf þýdÿÿMÿð¡‚UýdÿÿGÿðÕ‚[ýdÿÿGÿðÏ‚dýdÿÿu!s¥ýdÿÿGÿðÕ‚\ýdV®Ö##"32.#"3267!!!!!!ÝO²cþþÛ%þe±NL­bÀÌÌÀb­LÄýÓýê:ý/¸667756ŸGFêþDêFG €þµ€þk€sÿ¦¾9'.473&'3267#"'#7&'#7&'&76%73&'hA>›/(%:@þÁwÓ]aØy›A9&›A²² œã‘X}R4>CþÁ5Aëi¥Õ<)û—^_ÓHH?W‡æÏghйKüpþØî”Ëû•(`ÿä³ð,%6767# !2.#"3>32.#".aXj]aÙyþÊþ›e6{Ù_]Ôwêù|^™˜0šn&<$€‹Š'/_ÓHGžghŸGGÕ_^þÇþØþÙœu]\Yª¶«…ËÕ!!!!3###5qZýpPý°úúÊì~WªþHªþµEþÇ9Ebð#!!53#535#535632.#"!!!5-üì¿¿ÇÇÖè=—OLˆ=”t‡þyìþ¾ªªB_ó¶))›ÔHºÿB+#&'&#"#3676323632#4&#"#̪m49wSS¹¹>YXyzU6%…ªX\x¯¾¹ru¦¹¾xGM_a¢ý‡`®f21>&>EÖ3öáý\ž¡œ¾¤ý‡u‡Õ"&)''#!333#3#!###535#53355KO¶8~ÄÓåÄÃÃÃÃþðÓåÄÃÃÃÃ8~OO¯ÎÎþò““4ýÚ&ýÚ{“{ýÚ&ýÚ&{“{{““þòÎÎÉÿã ÎÕP32654&#+#!233!!;532654&/.54632.#"#"&'5#"&5‡ï…‘‘…Ýqzìï¾­ìzWQ®eþ›Gl«`»[z„_¡<¡ÓÂ`©HJžU]‹;¹›éËU·f«É˜/ýÏ’‡†’þÌÈjqý¨ÕqRˆ>þÂý ‰N#55YQKP%$•‚ž¬®((TT@I!*™‰œ¶##ŸÒ`Éÿã3ÕE326&##.+#! 32654&/.54632.#"#"'&“þ’••’¿Ù¿J‹xÜÊÈüƒ}A{>[b`ca‚Œe«@«˜àÎf´LN¨Z‰‰b”?Ä¥÷ØZa,/ýúØ–bý‰ÕÖØº$~´3YQKP%$•‚ž¬®((TT@I!*™‰œ¶;®Õ"&)-1'#53'3!73!733#3#####5!73'!!7¶]:1Ì00ã00Í19]zžáþÚÃÜþàŸÀ¥¥þu‘û ¥¥å}ýL‘uÂÂÂÂÂÂuü€€ü€€ýg™uuþüýg™uuuu_ÿãñÕ % #4&#!#)"33!3_ÿ¸°þ±¸Žýýÿþú¸°S¸ÒþÖþÜþ‘VðÓú²*$oþªðÓNÿÿþÀ&ÓŠÿãð1@: Ó"+Ó ¡®•¡®•/‘Œ) 2+"!)#&  , & &*!/<ÔÄ2üÄÄ99999999991Ä2äôìôìîöîî2Ý<î20K° TK° T[K° T[K°T[K°T[K°T[X½2ÿÀ22@878Y@z  1Ti lnooooiko o!o"o#n$l%i'i-ŸŸŸ Ÿ Ÿ Ÿ Ÿ ŸŸŸŸŸŸ–Ÿ Ÿ!Ÿ"Ÿ#Ÿ$Ÿ%Ÿ&Ÿ'Ÿ(Ÿ)Ÿ*Ÿ+Ÿ,-2   USjg ]].#"!!!!3267#"#734&5465#7332[©fÊ A7ýæ¾8þŠ Êf©[Y¹`íþË(Ó7‹Â7œ(6ìb¹bÕiZÈ»{.# .{»ÊZiÓHH"{/ #/{"G(Õ33!!###5¿½uóý€ªþX°ùý_½—Tý‰wýsýÏý1ásÕ!5!!77#'%5'&ýîïýîåPþËæPþÊËçM4èMžªªþñ¡o؈¢oÙý¸º¡nÙˆ¢nÐþ9 ¤ð-bwƒ'67>32#"'&'"326767654'&'&67'>7632#"'.'&/#"'&54632326767654'&'&&#"32¹¢">1–aJ{%A01Q[W7>/÷W1   >$< ù¹ ´. #®dCw¯Ë-^URB$`>DL_K>.3b @N\uLM„iIä±(S395lš9,8„ýG(/&  -þ9)ЗiRm:3X’wdg7? 2øj7#=5(6$ 629T/ ·(2M !:5S}$@{mbõqŒ‚~Es/4 -& "TAB`]…’ü›|@8†nR€kcd]aCœû ".ÿãŽð)5'632327&547632#527654'#"'&#"%654'&#"¹‹“o|@X"07ãPYˆtaTkµ~jü†[Iw‰mqJ2530D#24!`ðNkB±þ¬X``S±ã«£¿Â†q¢J<“Xr~hFÙl¯V1??0W¦D¢Õ$+15#53!23#3#+##5!3276!&'&+!!64—RRÈûL\HGZMûþÊSþþMþÿMþ#ýÝ#ìVtqDjt,tkDqý¨xttzIYIíV,]ÿ[±x$-#5&'&76753&'&'6767#5!'ùŒß‰¨¨‰ßŒi`p^_kbkN?H9x"cxhuŒ…OooO¥§Ìmnͦ‰$F×_0,û?'‘¦ýS*%²§ l™þÑþÒ™lÕ5!3!!3##!##5373!/331µåµ0þûG¾“µÒªþªÕµ’½IÁC©DúÒiR{ýø{Ï{ýøýø{ÏÏÏ{Auÿã¼ð66767!5!67654&#"5>323!!!3267# $547#5\J€þ5’ ;³¥_ÌsrÚiõ¯þýgØC…üS1¼­rì{€ïjþçþݨ¡J,{ +kv€67Å&&äÆUB{\* {;^~ˆFEÐ/0àÙK?{ªþÓw!,&'&#2767#&'&576753w[TUeeUT[Y\Y[d¹sÔÔy²e]Y\þŠ[CvlC¤Õi--ûñ--iÓH$"þðuÖ9BËtèâ"#û£ùBuª¡f´lCüÿË3!üÚ~„åÿ›dü=ÿö!5!'3 üGå„~d›ü=zÿË!#'73!5ý„~¯¯~„å›ÍÍ›ü=zÿË5!'3#7ü=å„~¯¯~„d›ÍÍ›üFÿì 3#%3#%3#üËËËËþyËËfÊÊÊÊÊËûPF° 3#%3#%3#%3#ËËûkËËËËþyËË)ÊÊÊÊÊÊÊËü=zÿË #'73!'3#7üæ„~¯¯~„<„~¯¯~„›ÍÍ››ÍÍ›CÿÏØ $(B"326=7#5#"&54634&#"5>32%3#.#"3267#"&54632 pSHf¼¼™m¦ÍÆ©ogDc\”GÂÁ°ØüDØ©^o8y‰‰y8o^I‚IÊìîÑC€öBRCI”‚ Mþ >Ož–›W\ 7²$ÊúùË„²4œ”“4±"úÑÔùCÿÏþ +EI.46'&#"#&'53254&'"326=7#5#"&54634&#"5>32%3#V‡¹Nz$p´;i0™‰Êª¯‘%“‹±={û‰ pSHf¼¼™m¦ÍÆ©ogDc\”GÂÁ°ØüDØ}|ïŽ4¼9d$, !ó•5ÊLf,1„BRCI”‚ Mþ >Ož–›W\ 7²$ÊúùËsÿã'ð!.#"3267# !2'Yè—£yy£—èYjí„þ­þz†S†íý #bvAZ4û-4ZBuHHŸghŸGû[!¬þºþ»¬!ÿÿÃÿãmð&r&FÿÖÕ+™¸,/¸-/¸ܸܸ,¸(и(/¸ÜA&6FVfv†–¦¶ÆÖ ]Aåõ]¸¸ и¸ и¸и¸#и /º!"+¸!0153&'&'6767!!5&'&76wI3cc3IÊ86QLNN7887NNMR48×ü_¡k•—i³:rÍÍq;Ôzn #¬+ü¤+ª$ *ªÞ rŸn<ÿÏå(2.#"3267#"&54632%3#"326&$  &54^o8y‰‰y8o^I‚IÊìîÑC€ÝØüDØkavva`wwþß‚ÚÚþ~Ù—²4œ”“4±"üÑÔùKùËž’‘Ÿ   øÕÔøøÔÕ<ÿÏM-1332653#5#"&.#"3267#"&54632%3#\¼QPcu¼¼`ž¡ýª^o8y‰‰y8o^I‚IÊìîÑC€ÝØüDØLýõriuðüD PÁÿ²4œ”“4±"üÑÔùKùËÿÿ¤ÿã{ðRÿÿoþÖ#ã¹þóÿÿÃ&ð&r)IÿãŒûo!6767632#"'&#"32767#"'&'&547!#"'&54632327676"#"'&'&54767632¿lø(9BKc{=&%%03!((!,739%7`lG;7 þ25]­¹hB4,'5  'B[QF$%ˆ]c'G  %! }Kr~“,§ê1ý¼ÑŒ˜Ig)*!&!(D;wÖþ½¥‚},75;!_']7:y}©[´Ïž£\®@4>#,!, 'QFª§ÿj(JG4$$,*)/9„yK#%þù‹ÙP73276767654'&'&#"&'&"'632654'&'&54767767#"'&'672#"*i(X%# 1F‚S°E/ ËO.55Fu½PU[QF[00rlÓ~œ"‘KI}!;IFs;n¡íò;_þéT^ÍŒQ79}w²–^l.G‰yr\[4þúO9%#i#Þ^MX;€¥yv@c„“}e.ID\7I;>2V秉uÓ°þ¢ÓþþÉÕ3!3%!!!!!!ÕÊûŽÊþÒ’’þnýêþnqúó úó dýˆxú+Ûý%H‡#>54&#"#3>32uƒ¹ƒ j_”Ù y¸/¸wFÚx”£ ¤ý\/HT^Ȧý“ýœ^m ‘$R#a"67632#654'&#"##7373!!”UcduÁL/ƒ¸‚ .|•Ñ {¹ùšš¹@ýÀ²e22wKwGWý\ž?3L0O¾¤ý‡}““};ÿátð9#"'&5476323276765"#"'&54767632thÁ‚n<7# ;KQ>!|Za,4(XM‹•µ!}ã,üþþ†Â‚<7D9#7.M=†„¾.1?@ '(MXI(' jÿãFð!2?632327654'&54?#"'&#"632327#"&#"jŒou9„!ydG>PPÕPP5ʺò6…8^nm{z€}}È‹oÖz€Z¥'PV‰aK~p’md Œ‹yk”b¼^òÞOP681/:ª:b:DÿãnòJ327654'7#"'&'$#5"'47676766767632#"'&'&'&#"32ÛnZS_n0VBšR„äny#H‰B?„ÁX!$9B©„€Mw>7l. ;7%,;(Ó§½uy,D0ÿäÿãÒð&3273#"'#67&5477632654#0)W:K…32#"&'####53&  Á¸¸¹±ýO:±{ÌÿÿÌ{±:¹¸¸¡¡›§þܧ§$“““}þ²daþ¼ýðþ¼ad¨úü}ûã–ççþjçÆ¢Õ %# !3!# ýîêü”¨ÐdþXý0dd úóqûáú+áû6ÁÕ+/±’—B°“°˜B°/³,/°<±•í°°-ݰ.<°-°Þ°#ͱ?± °<± •í°#° °9° FhH°°)°#°#Ii;±€B±B=°°#I°€bi°F`°Fa°’C°`#B°’C°`C°UX°°’C°`C8Y°²& °<±€B±B0°0±þ°<°Ä°±ý°<°± 6ü°<° ±ý°<°9° FhH° ° °°#Ih;° <° °Ö°° ݰ,9°, FhH° °&Ö°&°°° #Ii;°/°,°#Ih:°°1#I°’C°`#B°’C°`C°PXµ& ,/°’C°`C°8K° RX° °#I°’C°`#B°’C°`C°@PX°’C°`C°@a°’C°`#B´ °’C°`C°8YYY±€B±B=°°#I°€bi°F`°Fa°’C°`#B°’C°`C°UX°°’C°`C8Y°²#)°<±€B±B1°°#I°RX ±°±í°±ý  ±°°<  ±°°< Y3525!463"!4632#"&732654&#"5!6“–º“þðýjãggggŒ92299229ŒîªkÀûÌ€•ªkû@áü4€•nŠ¿¿ŠŠ¿¿ŠNggNNggýD{{åÊ "-! ! ! ! '32654&#%!2+# ÚþJþÑþÏþR´12)þ÷þúþ†uy»ýÓ²ckkcþÁ?°´´°²ñÛþÎþÐþL´00¶eþ…þùþûþ‡y »wþ¯XQPXd‰ƒ…‡þ˜nþ;Cö0<67632#"'67327654'&#"#"'&57&547276545ˆ[«Û„ƒFIœy®eL )qz]E& J½þŸ‡EYƒq:?ß.è”0.A Æ‚¾Mke”½LP«Ú×§<+(ŒhÃ|H=þyþÞ|nŽ=B† üžî¤üïÆ{u.F/4_NÈTÕ 33!27&#%!2+!67654'&,Êd.ý@‘úþÿûþþnX<-]\,qúó ýj’dÛÓÕÚýˆZý™)VŸžV)sþøÙð!)%#'# ! % 7& 676'&B ôÝ3þÅþ‡y;:xÑý+lllþðli$ ›› Þ#››þÝï¥ab¥þ[þžþüþŽ 22×22ûjT%¶ýœµ%5û¯$¶c¶$Bÿî2 _327654'&'&'#"'&5476323276765""'&5476!6?232767#"'&B=]iS\Z—ÎV30FŸ¹n7;#FfS9!!ç< #5,h½";<¶‰„2XngšZR{,##9>;K!Q¡ýIag£Sûæ Àˆ‰D£5@7*'S:y}ž*‚7H0 5#!,I‘l» @3X§¿nh0ÞÍ{(2r:=OSÿãlñIX&54'&#"#"'&527654'&#"3"'&547632763227767654'&#"R(O*\xggŒfg-.@@?@@?\QA@@@S6—fggf—¢eÓ»p/$~AB}:1$ -*ü¤šMJJ@f·ŸŒ[¦+8ÇÎvuuv° zVWWW–›•XWWVÊVW\uvœuuu# bW1±W{|^1$h{ƒ€vC[SK\þ•GChfy— /È2Õ &.2&'&+3!.+!! !27&#676'&%3ûLDEx-MeÇþø5q>ÍþH¿J‹xþn§üu1ý•E˜A+ZY*ü²Ê—01/ÉþåO„~þh–bý‰ÕÖØÐb)¥ýj’ý™)V>U)-úó ©ƒÕ§¸ /¸!/¸ ¸и/¸ ܸи!¸ܸÜAêú]A)9IYiy‰™©¹ÉÙ ]¸ и /º9¸ /¸/¸/º+¸º +¸0132654&#+#!273 # #sþšš s­þÊÈûN®¾èþÍCéÏÔèI/ýÏ’‡†’ý_6ý¨ÕãÛ¬kÛêþ†þkþü•Éÿ%TÇ$+.3&##&'&''7#!27%7 67654#“ÑÈ?\üA>:AÍÙ¿KE6Tþ®oF^È~_ þº,¶8~ƒ|§T3JýÛ/ýîøýHD‚þh—0& ü°,¯Õ‚o®Œkغçþ]-Dƒbü‡g‹(Ø'4.#"#"&'532654&/.54632733###æUW'AG/E8piŒ4sG[d/EK7?8pcŠ|3iи¡¢¸ŠŒ‡‰·Y"*/( VAO[`*,2,* M=H\þ¬TýÈ”þØ(þlÿü0`!!#!!!!!!!3!!³þr˜þsàoþÕþ+öý…ï…àý›`€ü à`fþ÷fþ»f€üæf'“FÕ >@!  É  b b cbcÔäüäÔìÔì91ô<<ì2Ô<<Ä903#######5J®¤ªqÃ7ËrqËrÉÕÿý¾äþÑ/þB^þä^ÿ"hÄ %73# ' 3×þº,¶þ¢¦ÚÒýÇåžýo-þ£ÓM†‚o®üþFéú+žý„,õ’\™Õ %#!!!5!È8êüÈküÈOúÃ8üßd úóqdúódd XþL/ 654&#!5!5!5!!2!"'Xª£Á¹¥þð÷þ ÷ýÄ$þ'Ùþ'¬ß¦¹þþ»Ô§c£Ì†“¦e“e“¨þ°¨þ°aÔŠþÓf†JÿÿNÏç6ÿÿNÿãÏÊsþΕDU767654'&#"#"'&5733272632632!"'4'&'&#"'6763232767654'&'&#"Ž_}yj#1Q€–\$˜####‚,TGG\<‚„lG2ûe$°òþ×sa#0EKXQn#?QY>™k›DMý4þëÇgiàMq«Ìþí¢ÿã†ðE#"'&'&5476?&'&547632#"'&547654'&#"3"32767'_²ûilE_†m²l=Oc{ñˆT3-2") %+fa@aP/Z_|«{w:maZÂu> IhA¬"%@_©®Šl$=P”‹czS2VN-2!$+%$+@e—}N069n™¦a[u>_Tÿß M#"'&'!#!"'&547632327676=!7!&#"#"'&5476!27327î#X':'7á?<=ÿ**MÆþô€_4. B^l{>!þ—'Ba>ÁnG#&#w§4$Bš»00!ò£K=ýÜDc˜„€KÊ_4B( 03B{>ce‚¹DInFT=I,F´w§7K. 0É#Õ )5!!5!3#ü¦ý°Pʪ¸ªÉ9ÿÇBk32767"'&'&47'&'&'#"'&547632326765&#"6767632377632#"'&'&'&#"×,5(.'*'E`Ÿ97®y{7a;f7;>F3.^PeMD*#7@,j!HhH<=.%_yi¥pp3 T}€œ˜²B',$ *ý5Ü€/,,@!;Da97žT‘³þÄþÉþVMæ;©nwFþí»³^O?/,%!;>jytŸÖX<;}f?E'_n¥þúþôþ± Hô—˜''#  .hÿçJ) 4&#"322#"&54©WOmVPm˜ËÝ¢˜ËÝ÷t}þþÏt{ýØ£ÆþÿØ£Ægÿã²ð4 4'+5654/&4?'&547 '&5474/Ä‹c2üû›>B¬d=VEõÄ/b5Œšñc2ltc2¶c2Ðþuc1‚LS2œ?B¬dÖ,>8?]/c6¼›ñc1‚LS2ý–tc1‚LS2¶c1‚LS2ÿûÿã9ñ03#!".54?>3!4'.#!".54>323!2¾O,‡"ûô"…$„%@ý;5H *ÖY[¶ü#$‡"†x2 1[G(  Wÿ¸Að,!2#"&/#!"54?>3!!"&5462TPl 0%= -d,þmF"…$…þºmG- .7#*(/ ‚ý$þû"Sae(!‡Íq~B;Vÿ¸ºð&!"&54>323!2#"&'&5 ýmG * 5G 0%9 . ¦q~( 0 (/ ‚&ýJ“s!S'DQIF× 4632#"&3!53#5!¼pQOooOQpƒ˜ýo——ùTQooQOonûuyy5yZÿÕR; ! ! ! ! þHHþ¸þæþåé#ïþ[þŸþžþ[¥breþHþý¸Â ôÝ!#þÅþ‡y;:xÑ— L`  !!!!#!3#'!#33 # #—ƒþ¼þD—ƒµjÿ—wŠZþDZŒÖõöþÃRþëþé``€þ¶ýéþC5ü€ææ€þ³MþRþ.}þƒÞ$ÿðz`-1%5"'&'&5#2327#"'&5#!#"#463!#3#‰, †9áYl(Ht„ý*§þ²=Z2dr¥¶ý!††Z4@'!8¢ ýÖ¦zEB¯ ñÊbýãüüLs¨{dþYþ¯˜þsZ{3#"#4763 3×®UE‚El4FŒÅ©dGQõ´‰n ‚ËCFÁþ\þ§þxŸBýú¾*WŸbOZý=šþþÉþ¾ýýÈ0Õ 3%!!,Ê:ý*þnqúó ddúÕÉÕ3!3!!!!ÓÊûÊ þnýìþn8qúó úó úqúÕþwSÁ ! ! !!5 5¦ýþüúüð—üúüðùÆýþÚY*üÖü§çdüÖü§ccS£ÿã»ð!!6$3 !"$'53 !"kJýîu ^‹þuþ¢’þùopü‹þíþîk¨þþo¦SUþgþ“þ’þgHF×_`2/.2%©Õ!#!5!©Êý)¡+ª¨Õ!5!¨ü_×Õú+ª+ÿüçÕ!# #3çÙþbþeÙËfýšÇý9WJÕ " )327&#!3676654'&|²¨tKþ"þPýý"ûcõ­â“öþoûÊû¯ÍÐAfÕµ|ßcvþ~þ–ÕdúóA‹Aúó xûãPfUÂmZÿã­ #2!7#"547632!3 32767654'&#"ç* 6¯B8wxþ²!Nbb|Ëž"#>Ë|OO'vNþþ÷† ý2½¥wx87¥tžKsO= † =‚üí¨d01 ”P²²D10d^dú¬Tþdü6‚‚ŸžJthi[ÿã“{ (232767# '&5477632!7!654'&#"Ú N¡&# ¨G_yZ\klmkþô}Z5µ³üäfFý 9N©JC0<7h:‚ýJ(u*œo¦DM¢¡‘c“FPZd82vRsO 3#3#!!ɸ.¸Ô†²†$þ²ÚNéû9˜ü`ÿþV 3##676#732767!ɸ.¸fʆÐ#5H2KþÜÜ1i0/éNÞ)deéú¿ûеT0Hôd01™¬ûŒÖ``;ÿã¸ð&0 #473>32#"&'532654&7>54&#"ºþ;Hºt]þéühäƒñ2††02Þ¸S¥UWžDiƒ;2[UÔ _¦I@YËr„~•YWþí×€ác?}<¢Å$$¶/1oX3gÎQ¡X’Â?@Qˆ` $@   F ÄÄÔìì21@‡‡¼/äìÔì0!5!!5!ˆüÉþù`û “o“Ëÿÿ‰ÿãXð&{' 35u‹ýdÿÿ^ÿãXð&t' 35u‹ýdÿÿ‰ÿã^ð&{' 35 õ‹ýdÿÿ^ÿã^ð&t' 35 õ‹ýdÿÿbÿã^ð&u' 35 õ‹ýdÿÿ?ÿã^ð& ô' 35 õ‹ýdÿÿ‰ÿã~ð&{' 35 ö‹ýdÿÿfÿã~ð& õ' 35 ö‹ýdÿÿ‰ÿãwð&{' 35 ø‹ýdÿÿbÿãwð&u' 35 ø‹ýdÿÿfÿãwð& õ' 35 ø‹ýdÿÿlÿãwð& ÷' 35 ø‹ýdÿÿ‰ÿãð&{ 35ÿÿÉ“Õ,ÿÿÉ'Õ&,,”ÿÿÉ»Õ&,',”,(ÿÿÉQÕ&,9éÿÿhÕ9ÿÿ˜Õ&9,ÿÿ,Õ&9',,™ÿÿ ÀÕ&9',',™,-ÿÿÉÕ&,;Üÿÿ=;Õ;ÿÿ=®Õ&;,ÿÿ=BÕ&;',,¯ÿÿÉjÕ/ÿÿsÿã'ð&ÿÿɰÕ'ÿÿÉÕ0ÿÿÁyLÿÿÁé&LLpÿÿÁY&L'LpLàÿÿÁA&LYÂÿÿ=`Yÿÿ=½&YLDÿÿ=-&Y'LDL´ÿÿ=&Y'LD'L´L$ÿÿÁJ&L[Ñÿÿ;y`[ÿÿ;Ô&[L[ÿÿ;D&['L[LËÿÿÁyOÿÿqÿãç{FÿÿqÿãZGÿÿº{Py }Õ  ) !3 !## !5²–þhþPýŒþPþh–²Ÿô5þáþËôÊôþËþá5Õþ—þ€þ~þ–j‚€iúÑ.,ûw‰þéþÔþÒþèɰÕ#ûº +¸ º+¸º+¸¸ ¸ÐAêú]A)9IYiy‰™©¹ÉÙ ]¸ ¸ÐAêú]A)9IYiy‰™©¹ÉÙ ]¸¸%ܺ"+¸º+¸º+¸º +¸ 013 !#3 #32654&#! )“ô5þáþËôHðñÿHNŸ““Ÿþ蟲–þhþPþaY³.,²ÂÏÐÞý茊Þþ—þ€þ~þ–y }Õ(1C3 +3 !32654&+! ) #"35# !35#"&546!`HðñÿHô5þáþËôNŸ““ŸNÕýŒþPþh–²t²–þhü±NŸ““ŸNôþËþá5ôHÿñð/²ÂÏÐó.,ü°ŒŠü j‚€iþ—þ€þ~þ–ߊŒž²þéþÔþÒþè³ÃÐÏÂÿÿsÿã'ðHÿÿÿãõ{dÌ?8 ´  ÔÔÌ2@ @@ 00 ]1@  œ Ôì99ÌÌ0@  œ ü<<@ œü<<°KSX³ <<´œ ì´œìY5!!d‰xéÃû=éxUZ‰xéªéx£Ü @  œ Ôì99ÌÌ1´  ÔÔÌ2@ OO ?? ]0@  œ ü<<@ œü<<°KSX³ <<´œ ì´œìY3'#'-ZˆxèªêxÜþvxêû<ÄêxuÌP8 ´  ÔÔÌ2@ OO __ ]1@ œ Ôì99ÌÌ0@  œ ü<<@ œü<<°KSX³ <<´œ ì´œìY'7!5!'7Pþwxéû=Ãéx¯Zþwxéªéx£ÿùÕ @ œ Ôì99ÌÌ1´  ÔÔÌ2@ @@ PP ]0@  œ ü<<@ œü<<°KSX³ <<´œ ì´œìY#737‡ZþvxêªèxŠxêÄû<êxdÌP8Ú¶ ÔÌ2ÔÌ2@ PP_ _O O]1@   œ Ôì9Ì2Ì20@   œü<<@ œü<<@ œ ü<<@ œü<<°KSX· <<<<´œì´œì´ œ ì´œìY5!'7'7!d‰xé¼éx‰þwxéüDéxUZ‰xééxþwZþwxééx£ÿïÜÞ@   œ Ôì9Ì2Ì21¶ ÔÌ2ÔÌ2@__P POO@ @]0@   œü<<@ œü<<@ œ ü<<@ œü<<°KSX· <<<<´œì´œì´ œ ì´œìY3'7#7'-ZˆxèèxþxZþvxêêxÜþvxêüCêxþvŠxê½êx 4Ÿ³ 7!!# ?,þ¶^xü¢©t?©ü¢x^þ¶ 4Ÿ³ #'!5`?©ü¢x^þ¶³?ýÔJü¢x^© 4Ÿ³ %!5!73Ÿ?ýÔJü¢x^©s?©^xü¢J 4Ÿ³ %'3!_?©^xü¢J4?,þ¶^xü¢©dÌ?8'!5!!BÈ”—ýÿéxþw‰xédÈ”—š-þ¥Uéx‰Z‰xé[UþúªuÌP8!'7'7!'!5rÈ”—éx‰þwxéýœÈ”—þf×[UþúéxþwZþwxéþ¥Uª,ÓžP4327>76767632&'&'&#"#"'&/#7!í#/)85,0F"<;NJX[GR7<"#!2)85,/$#?2WG[XJN; ©?,þ¶ô!F0O<:" %7xþŸýéxUZ‰xéaxþÂþÂxaéxuÌP8 '7!' 7!'7PþwxéýþŸx>þÂxaêéx‰UþwxéþŸx>>xþŸéxþwdÌ?8 !5!3#•ûçéxþw‰x骪-éx‰Z‰xéYü¤¥Ü %'3'!!5èxˆZˆxèZü¤ªêxŠþvxêû檪uÌP8 †· œÔì2ÔÌ2@ O O _ _ ]1@  œ ÔÌÌü99ÌÌ0@  œ ü<<@ œ ü<<°KSX³  <<´œ ì´ œ ìY!#3!'7'8û窪éx‰þwx-þ§\þ§éxþwZþwx¥ÿùÕ !5!!7#7þ¨\þ¦èxþxZþxxè+ªªûæêxþvŠxê¥Ü7!!5!7'3'¯èxþx‚ü¤€þxxèèxˆZˆxèÂêxþvªªŠxêêxŠþvxêdÌ>†%52#!5! 767>54&'&'&>42/+-+-':1 üHéxþw‰xéÙÙܪ-)o=Ü  éxþwZþwxé(.46<=69)-dÌ>†>3276767654'&'&'&"5476767632+#5!5‘‚ 6 ©+/24>A1:'-+/24>‚©ý”éxþw‰xé×  ‚‚=69)-(.46=<69)-ÜÜéx‰Z‰xévÌP†>54'&'&'&"3)'7'7!#5#"'&'&'&5476767632# 6 +léx‰þwxéý”©‚>42/+-':1A>42/+ׂ  éxþwZþwxéÜÜ-)96<=64.(-)96=dÌP8X#532267676767632267676;'7'7#""'&'&'&'&'&""'&'&'&† éxþw‰xé 0$#$   "%'-0$' !  ' '- éx‰þwxé  ('Z&("  "(&Z'( -éx‰Z‰xé$ -#%"&* 'éxþwZþwxé ""&*  *&"" d¾PF%'!5!!'7'7! pþœéxþw‰x领 pdéx‰þwxéþ^¾:5éx‰Z‰xéo:þËéxþwZþwxé*ÿüØ %'7 ý!§^ßÁ bþ9YþÁ‹¾þXxýî¨û¸¾‹þÀÈbþñZ ò #!5 ªþéxþw‰xé‘ûoçéx‰Z‰xé¬[ò !'7'7!#¬—éx‰þwxéþª‘éxþwZþwxéüZÿã Õ !5!3 ýiéxþw‰xéíªDéx‰Z‰xéç¬ÿã[Õ 3!'7'7¬ªíéx‰þwxéD‘üéxþwZþwxéÝÿùÔ 7#7!5³éxþwZþwxéýÔÔü=éxþw‰xéªdÌ? !5!3?ü=éxþw‰xéª-éx‰Z‰xé,- eX&7#754767676 #4&'&'&"9èxþxZþvxê.-\ZnllnZ\-.ªBB54'&/#7!!#"'&'&'&54767D !BB54'&´x\-..0YXpl€…gtTY0../Z#þ¶,@ª#B"!BB@RN¾JV°]xþw‰x]TQ>°]x‰þwx]þ¬xL iiþ þ`iiTÁ4¬]x‰Z‰x]à4¬]xþwZþwx]JÒiiiiuÌP8!7'!7!5!7!'7'7!'7!5½giiþþÚyýìYu‚I0]x‰þwx]ýÌu‚Iþ«iiÒÒxÊK]xþwZþwx]ÊKxdÌ?8!!5!!¯ûÉ]xþw‰x]7ûQix]x‰Z‰x]xi¥Ü#'3'#'ñx\xˆZŠx^xh°ûP8^xŠþvx^ûȰhuÌP87'!5!'7'7!5$iiûQ7]x‰þwx]ûÉiix]xþwZþwx]x¥ÿùÕ737#73ñjhx^xþvZþxx\x%hh°ûÈ^xþvŠx^8dÌP8!7'!!5!'7'”iiüli…ý\]xþw‰x]¤]x‰þwxiiiá]x‰Z‰x]]xþwZþwx¤ÿðÜ7''3'7#7ñiiiá]x‰Z‰x]]xþwZþwx°ülii”iü{¤]x‰þwx]ý\]xþw‰x ÿѳ #7!##ÉPUý©?,ƒûUü°•vü°Uû„,?©ýUP¼ÿÑŸ³5#'#5!#5'ö•ü°Uûƒ,?©ýUv”ü°Uû©?ýÔ„ýU¼4Ÿ 753!5373öü°Uû©?ýÔƒýUP•qPUý„ýÔ?©ûUü° 433!'3É•PUýƒýÔ?©ûUq”PUý©?,„ûUdÌ?8!!!!5!!cÜû$ŠRü&xþw‰xÚû®¾xŠxx‰Z‰xxuÌP8!5!'!5!7'!5!Qû$ÜŠû®Úx‰þwxü&RFxŠxxþwZþwxxdÌ?8#''''#53777?(F´´´´´ncéxþw‰xé‹F´´´´´n-F´´´´´néx‰Z‰xéF´´´´´nuÌP8577773'7'7#'''un´´´´´F‹éx‰þwxécn´´´´´F-ªn´´´´´FéxþwZþwxén´´´´´F£Ü3'!!!!#!5!5!5!'-Zˆxè(þØ(þتþÚ&þÚ&êxÜþvxêþŽªªªþ¬Tªªªrêx£ÿùÕ#7!5!5!5!3!!!!7…ZþxxèþØ(þØ(ª&þÚ&þÚêxŠxêrªªªTþ¬ªªªþŽêxdÌ?8 5!!5!35!d‰xéqþéxªÿªÿUZ‰xéªéxaªªªª£Ü 3'#'3#3#-ZŠxêªêxbªªªªÜþvxêþŽrêxþVþªÿuÌP8  '7!5!'7%!#'#5Pþwxéþqéx‰ûÎÿÿªÿUþwxéªéxþw(ªªªª£ÿùÕ 737533-þvxêªêxþv‚ªªªŠxêrþŽêxþv4þþ¨ÿkË?9 !#3?ûîêxþvªªŠxêתêxŠþ~\þ€ŠxêuËI9 !'73#'7!uêxŠªªþvxêûî×êxþv€ü¤‚þvxê7†?~ 5!! !!Ïþö  ûôdþü ûôŒþöþöƒý}üüþïþ*^V 3! !!dþöþöƒý}üüþïþ*p þöûô düþûô H†P~ !! !!¸ûô  þ’ûô üŒƒþòƒ þÖþ^ÿÍVÕ #!# !!!dƒþòƒ þÖþe ûôþön ûôþ^V !! !3 3!!!Eþ*þïüüþïdƒþöþöƒrþ*rþò$èüþþ|è þöþþÔþ¤\d”^V )3! !3#!5#3 3 üšÈþïüüþïÈýÆÈžÈƒþöþöƒ\°üþýPd””x þö@t %#!5#3'!3!3! !33'ÓȞȡdþxd¡:üšÈþÑþÑÈýÙètø””Zddû®\’ýæýnªt^V%#!3!3! !3!5#3ĹØtIüš¹þþüüþþ¹þ¹tø”äØû\°üþýPìû”x^V%3 3!!! !!3 37áƒþöþöƒrþ*þïþèüüþèþïkŠþöþöŠ€dô þöý dôüþþè| þö€^V %#!5#3 3!3!! !!33 37ÓȞȃþöþöƒ:üšÈþïþèüüþèþïÈþÍŠþöþöŠ€ø””` þöü¨\˜üþþèþh þö€u†}~ 7!! !5#35! u\°üþýPd””x þöÏfÈþþÈ:Èýbȃ  ƒzMÕ!#7!!#Múc"?,þ¶^xü¢©ÕcúŽÕþŸ?©ü¢x^þ¶zMÕ35!3!5!73zpcþÞ?ýÔJü¢x^©crú+a?©^xü¢J^ÿÍV 3 3# '! !! !áƒþöþöƒƒ  þþþïüüþïe  þöüõþö dþüCüþuÌP8)5A '7!"'&'&'&'#5367676762!'7$"!&'&'!27676Pþwxéþ¡ 21@=“:C.2 ¾¾ 21@=“:C.2 _éx‰ü_R#)l$hþ˜$#R#$Uþwxé@21.2@ª@21.2@éxþw#þðÿÿwÿù;Ü' ¯, ±þÔuþtP'7!5!'7!5!'7!5!'7Pÿÿþwxéû=Ã××û=Ã××û=Ãéx‰ÿÿUÿÿZþwxéª×ת×תéxþwZÿÿdÀ?D5!3!!#!d‰xé3ªæþªýÍéxUZ‰xémþ“ªþ“méxuÀPD '7!#!5!3!'7Pþwxéýͪþæª3éx‰Uþwxéþ“mªmþ“éxþwdÀPD3!'7'7!#!5ª‰éx‰þwxéþwªþwéxþw‰xé×mþ“éxþwZþwxéþ“méx‰Z‰xédÀ?D5!333!!###!d‰x駪ªªþ⪪ªþYéxUZ‰xémþ“mþ“ªþ“mþ“méxuÀPD '7!###!5!333!'7PþwxéþYªªªþ⪪ª§éx‰Uþwxéþ“mþ“mªmþ“mþ“éxþwdÀPD333!'7'7!###!5œŒdŒ éx‰þwxéþàŒdŒþàéxþw‰xé×mþ“mþ“éxþwZþwxéþ“mþ“méx‰Z‰xé7Ä?@  !¥úJþB¾JˆôúAþƒ¾¾þƒ‚uÄ}@ 7'!5! úúPû¶J¾þBˆúúþÅ‚}þBþB7Ä}@7'! ! úúü–úý6þB¾Ê¾þBˆúúþ ôúAþƒ¾¾þƒ}þBþBhÕ %!3!3¼ýÛ ýÆÕˆ¡ˆÒýÇÇçüRÕþú+‡ÿãnðmº+¸A&6FVfv†–¦¶ÆÖ ]Aåõ]º+¸º +¸0132#&'&#"327673#"‡ ûû…B!ÊOœœOÊ!B…ûûþ÷ézÆcI7™þÍþÌþÌþÍ™7IcÅŒhÿçÁ-)b@'! '!Õ* $$*ÔÌÜÌ9991äÌÜÌÎÎ990K° TK° T[K°T[K°T[K°T[X½*@**ÿÀ878Y>54&#"#"&54632#"&54324&#"32ôIH7$$0e´ÖþßÕ˜ËÝ¢e‚ WOmVPmmW£Kƒt,>bþÊþùþ±þFØ£Æ[àt}þþÏt{É‹Õ !5!!5!!5‹ü>øýøýÕú+ªìªëªÉÿ¢‹5!#7#53!5!!5!733!‹ýKªc˜˜þÐd˜þ0ª4˜êþ☶Õú+^^ªìªëª``ªþëýkþì›ÿì]®(673#"'&'#7&'&$32 '&#" 32$767&'&Yj€iEdÈþ ¹»°80~iª?/cÆ`»¹°üÉô‘™šþÝRQQ$gý'-‘š™"SRR:;nSz²þ€þ¾_'œÒBT±€c¾_ ûé¥N“‘››‘@DüRO“‘››‘gÿú`Á8@ÔÌ91/ÄÌ90@cmpxyvn]] !3!¬þ^DýïàCúšîûÄú?ÿú`Á%! !¬¢ü¼3ý½fý½Ó<úñÁú?¯ÿìI®!!"$54$3!!!W?JŒ‰”¹ýGÀþ¾¾cÀ¹ýG”‰‹K@ õsJx‹NLŸÆ`»¹`ÈŸMOŠx] ¯þåI¯&/!!!!3!!"''&'&54$;7#"Ø–I$þ¢¹ý¯°$$¹ýGA?d–`,,±¾¾cÀêüÝFU ;¸°“Š}YI¯7ÊŸþ þŸ þî7c`»¹`ÈüÅJx‘H ¸ üNG’x]Ù›åg% $54$)!!3!+þØþÖ*(ºþFèiNvüŠ%Frߺ›öððöŽO:…Ž‘0QޝÿìI®&'&'&'!5!2#!5!676767!5¡?JŒ‰”ýG¹Àc¾¾þÀýG¹”‰‹K@ û 'Jx‹NLŸÆþ »¹þ ÈŸMOŠx] ¯þåI¯&/'7!5!!5!&#!5!2+4'&'&'3276765 –IþÜ^¹ýéQ°$$ýG¹A?d–`,,±¾¾þÀê#FT‚ ;¸°“Š}YIþå7ÊŸü ãŸ 7þøcþ »¹þ È;Jx‘H þH þNG’x]Ù›åg )5%2767!5&'&!5“(*þÖþØþFºèiNüŠv%FtÝþFgöñïöŽP:…Ž‘1RŽ,ëâ ¸/¸/01!!,¿âüœþwqÁ@×Ö¯ggÔìÔì1üìì20!#!#œÕðý ïÁø¶}ùƒœþwqÁ@ÖׯggÔìÔì1ü<üü03!3œïöðþwJùƒ}ø¶þw;Á ]@    ÔÄ91ÄÔÌÎ990@0QVPZ spvupz €€ Z pp{ t €€ ]]!! !!5 7êüA ýJïúÞÕýIÁÁý3ýÀ•!ãÙ-Û×¶œÔÄ1Ôì0!!ÙúþתÙÛ !#!5!3!!5!®¨ýÓ-¨-ýÓý+ƒªƒþ}ªתªÙÛÕ Wº+¸¸Ð¸¸ и¸ и¸ и/º +¸ º+¸¸¸и¸ Ð01!!#!5!3#®-ýÓ¨ýÓ-¨¨ þªþûªû5Ìþ‰ÿãÍð+@BŒ‘ÔÌ1ää0KSXííY"3#- ü\ ðùóÿÿŠÿ’<%?ŠP¯%73% %#'±þTU¬¨¬UþT¬UþT¨þTU‚÷“÷ïþ÷“÷÷“÷þï÷“ÿÿDG¾ÂrýÒÛH®F·ƒÔì1Ôì03#ÛÓÓFþ=ÿ×} *@    ÔÌ91ÔÌÄ903##'%\½sý®BþÁ}}`ùºs-Pbý;ÿÿ=ÿ×Ð& 8usàÿÿ=ÿ׿& 8 ôsàÝÝî %.#"326"&'#"&54632>3"31…UfvYR†½I•OF^ˆº§†_™HDža+…J1†CšXX„je†ˆþèw‹‡ߦ¯Ø~ŠŠƒ–‡¢XZÝÝÏî /ÿ@- !$'!!0 $*0ÔÄÔÄ99991ÔÄÔÄÀ9990@¾     $$$   $$ $ ***///***55500055 5 :::???:::EEE@@@EE E JJJOOOJJJV´° °!°"°&°'°(´)]]32654&#".#"326#"&54632>32#"&“1†Te€vYR…Ä1…UfvYR†F^ˆº§†_™HDža†¼§†^•/XZ‡ie†‡7XX„je†ˆ‡ߦ¯Ø~ŠŠƒá§¯ÖwË™I%!3!™û‚ªÔË~ü,¯IÕ%!3Iúf¹òüËÊÊÕúõ¯ÿ”IÕA¸/¸/º+¸¸Ðº9º9¸¸к901%&'&'3!!#4'!&'7`'JAWþÎã`òþLqR]+XþÉŒü* PÊ‹†s^þã(ýRs“§°Ê57756uíÿúÜÑ5º +¸ ¸ /¸/º 9º 9º 901 7&'7%%'6 676rý{Ž‹ÔþŠEG…þ%†yýÝ44RÀW!L!$îÒ¾³Æ ¡“¿Òñ&!L éþçþð{ž°þJP+3#°  +øfþJ›+ 7º+¸¸и¸и/¸/º9º 90137#'° ûPþµ ýMVÕüœ°oçü)g±nþJð+3#3#  @  +øáøfþJ›+{¸/¸/¸¸Ð¸/¸ܸи¸ ܸܸ ¸и¸ и¸и/¸/¸ /¸/º 9º 9º 9º 9013737##'   [P«   ]MæEü+qdý @oxûº×pü™÷AnÓ¢!3# iúhÃþÞþÝ¢û^¬üTÓ¢3 3#Ã#"Ãþ˜ú¢üT¬û^Ó¢32#4&#"#õñðõ¬”¥¦”¬P(*þÖþØý°7ôÓÓôýÉÓ¢332653#"¬”¦¥”¬õðñõRPýÉôÓÓô7ý°þØþÖ*uþM¶>2&#""&'7327㢗~”9GA¢—~”9Gâ§…}Œ‚¯ú°§…}Œ‚¯ÿÿuþMÛ& I I%ÿÿuþM& I' I% IJuþM¶-6?67632&#"#"'&'7327&'&5476767654'&'ãSOJMG7”9GcBnnVsSOJMG7”9G]InoSuŠ=,EG%,½=,HK%â§DAF7Œ‚¯þÖK|’œoUþ¾§DAF7Œ‚¯1Io›œsVý›/HgjG$þ4Ö.JhgH$uþMÛMQZc67632&#"!67632&#"#"'&'7327!#"'&'7327&'&54767!!67654'&ãSOJMG7”9G~SOJMG7”9GcBnnVsSOJMG7”9Gþ‚SOJMG7”9G]InoSu‰~þ‚¾=,HK% =,EG%â§DAF7Œ‚¯þâ7§DAF7Œ‚¯þÖK|’œoUþ¾§DAF7Œ‚¯$þçDAF7Œ‚¯0Io›œsVý’ñþ!Ö.JhgH$ºþ+/HgjG$uþMmqu~‡67632&#"!67632&#"!67632&#"#"'&'7327!#"'&'7327!#"'&'7327&'&54767!)!67654'&ãSOJMG7”9G~SOJMG7”9G~SOJMG7”9GcBnnVsSOJMG7”9Gþ‚SOJMG7”9Gþ‚SOJMG7”9G]InoSu,þ‚ýÛ~þ‚¾=,HK%2=,EG%â§DAF7Œ‚¯þâ7§DAF7Œ‚¯þâ7§DAF7Œ‚¯þÖK|’œoUþ¾§DAF7Œ‚¯$þçDAF7Œ‚¯$þçDAF7Œ‚¯0Io›œsVý’ñþñþ!Ö.JhgH$ºþ+/HgjG$uþL.3&#"7#'754'&'#"&'7327#4767>32";EY?w^H¾6¼H\O3,, HO€”;E+@/VfmVm HO€ö‚¯þ³?uœ]H½½H]sM3 üg¥‡z‚¯ˆ.Vr›mV_¥‡zuþM<%4'>7'7&#"7"&'7327&'&54767>2·=,HK%€˜=Q ‡Hl;EYLmHH§7'&#"'"&'7327&'&54767>2·=,HK%m#6,=iSH²;Ec‹¤HKÂsŸ˜€”;E]InoSuŸ˜€JÖ.JghH$6B0þ+‚@THþÖ?¤HK|Àþ¾¥‡z‚¯1Io›œsV<¤ˆzÿÿyÍžÕ' 7ÿžþ…' 7ðþ… 7GÿÿyÍžÕ' 7Gþ…' 7ð 7ÿžÿÿ¡ÍtÖ' 7ÿÆ 7ÿÆþ…ÿÿyÍžÕ' 7ð' 7ÿž' 7ðþ… 7ÿžþ…ÿÿÙ-Ûj' 7$ 0ÙŸÜj 3#3#!!ÓÓÓÓûÐXü¨þËþ•ªÿÿØŸÜj& 0' 7ÿýþW' 7ÿþ$' 7-þW 7.$ÿÿÙŸÛj& Z' 7þW 7$ÙÓÛ2#"'&'&'&#"5>32326Ûi³an’ ›^X¬bi³an“ ›^V©2³NE;=LT³NE;=KÙÓÛ23276767632.#"#"&'Ùg©V^› “na³ib¬X^› ’na³i2UK=;EN³TL=;EN¢1Ô).#"3".54>323265.#72#"&:QŸHRdhNiœ\dŽnxÂ>@°HRdhNiœ\dŽnxÄ.ttlH=Y›OšHL¢\}X[lH=Y›OšHL¢\}ÙWÛ­#"'"#322Û{ûædfftXª{ûædfftX×ý€ÖÜþ#€þ*þ$ÝÐ0!#.5476767654&'30´ND:323267#"''æcDX¬bi³a]y¬›¨eEV©gi³a`y«›S LT³NE+~FþŒ KU³NE,þ…FÙÛ¢ #"/&'&#"5>32326!!Ûi³an’›^X¬bi³an“ ›^V©ûeúþo³NE;=LT³NE;=Kˆ¨Ù`Ûô#"/&'&#"5>32326!!Ûi³an’›^X¬bi³an“›^V©ûeúþô²OE;=LS²NE; =KþkªÙbÛÓ%&32767#"'!!'7!5!7&#"5>32Ë%H\¯ i³aBPŸü﹉lþ噸‘ZX¬bi³an“3ïý}oþé -X"²OEºªþdšªó8LS²NE;IüÙ¸ÛÁ"#"/&'&#"5>32326!!!!Ûi³an’›^X¬bi³an“›^V©ûeúþúþÁ²OE;=LS²NE;?KþkªËªÙÛÁ.#"/&'&#"5>32326#5!7!5!7!!!!'Ûi³an’›^X¬bi³an“›^V©üLç•ÑýšŒoþKÐ…üɦoÁ²OE;=LS²NE;?KüLªËªŠsªËª sÙÿöÛB.32767#"'!!!!'7#5!7!5!7'&#"5>327b K`Jqi³a'+\+ýzlòü³h’>ùTmþ?u2›^X¬bi³an“c†’"%]²OE«ªËªÂNtªËªÚ=LS²NE;%úNÙÛô;?@.9*-" *œ19œ"œ œ<-<Ô<Ä21ÔìÔìÜüÔìÀ9999990#"'&'&'&#"5>32326#"'&'&'&#"5>32326Ûi³an’ ›^X¬bi³an“ ›^V©gi³an’ ›^X¬bi³an“ ›^V©o³NE;=LT³NE;=KÚ²OE;=LS²NE;=KÙÛÿ43267#"'3267#"/'&#"5>327&#"5>29+V©gi³a@LJ“ZV©gi³aƒ}¤‰9+X¬bi³a@MH’ZX¬bi³Â ¤a KU²OE»8KU³NE; þ˜@^ LT³NE»8LS²NE;f@Ù¸ÛÉ59#"/&'&#"5>32326#"/&'&#"5>32326!!Ûi³an’›^X¬bi³an“›^V©gi³aq›^X¬bi³an“Æ3V©ûeúþL²OE;=LS²NE;?KÒ²OE;=LS²NE;?KüîªÙyÛÑ5P#"/&'&#"5>32326#"/&'&#"5>32326#"/&'&#"5>32326Ûi³an’›^X¬bi³an“›^V©gi³an’›^X¬bi³an“›^V©gi³aq›^X¬bi³an“Æ3V©ײOE;=LS²NE;?KÒ²OE;=LS²NE;?KÒ²OE;=LS²NE;?KÙ¸ÛÁ"32?632.#"#"&'!5!5Ùg©V^›“na³ib¬X^›’na³iúþúþÁUK?;EN²SL=;EOþȪªþ‹ªªØ×Û+  %5 % $%5$[þáþœg&Yþ¢þà%Zþ£þÞþàþhÓ¦²•¦²—³¦²—¤²—Ù6ÛÎ9%676767!!"'&'&'!5!!5!676762!!&'&'&[C-8›þö7VYÎYW6 þöœ8.CC.8þd 6WYÎYV7 þe8-Ù,CE[¨<0[2332[39¨\DD+N+DD\¨93[2332[0<¨[EC,Ù`ÛÎ !5!676762!!&'&'&!![C.8þd 6WYÎYV7 þe8-ý;úþ++DD\¨93[2332[0<¨[EC,ýãªÿÿÙ`Ûÿ' 7¹ ÿÿÙÛÿ' 7ýº&  7¹ÿÿÙÞÿ' 7ÿþ¹&  70ý½ÿÿÙÝÿ' 7ÿþý½&  7.¹ÿÿÏ62Ï' 7ÿôþî' 7ÿô‰ WÿÿÍ63Ì& ô' 7…† 7…þîÙ`Û¢ 3654'!!5!&547!5!!æ44ò34wúþ~þ€þ‰ú0IG00GG2ðªª?8>;¨¨_8Ù`Û !!!!"264&'2#"&546Ùúþúþ…Hdd‘deH;k'**¨z{¤§¢¨ðªDbFE``‹bq+((d:s¡žvv£Ù`ÛK!!!! &!56Ùúþúþ‚áàþÿþæé¢¨ðªë—²—•²—Ù`Û!!!! 3# Ùúþúþ$´Ÿ¾¸¢¨ðª‚ýcÙþ'Ù`Û!!!!33#Ùúþúþ$¦¸¾Ÿþý´¢¨ðªþ'ÙýcÙ`ÛÊ!!!!!!'Ùúþúþú+]^*ò^ôó]¢¨ðªNþä°þä°°Ù`ÛÔ !!!!!3!Ùúþúþ‚¦Nßp!ýN¢¨ðªÀþNfýÙ`Û07GO!!!!#"3###535463!3267#"&546324&#"'53#5#"&4632264&"Ùúþúþ¤?$mmC???DíþÏNB&H#$J'`qk[Q_C<17HÆBB@,I\\I,@Íp`ctiG6B?9iÚýÐ=$#t¾u#g“SS“SÙ`Û*!!!!>32#4&#"#4&#"#3>32ÙúþúþŸ!]?U\Z79EPZ7:DPZZV:;S¢¨ðª==:xoþµHOM]QþÊHPL^PþÊ%U20=Ù`ÛÚ ,!!!!3#7#546?>54&#"5>32Ùúþúþ4eeb_--B6'Z0/`4\o$-,¢¨ðªÈN2A+,/-7#!^aO&E++ Ù'ÛÝ>@" Ïœ Ï œ  Ü<Ä291Ô<Ì2ü<ìþ<ì990!!!!!'7!5!7!Ù}®/þHÃ{üúþþ}®þÕ¶Ãý‡¢;fÕ¨ðªþÇfÓªðÙ¸ÛL !@  Ü<<Ü<<1ÔÜÜÜÜÜ0!!!!!!ÙúþúþúþתªýÀªÙÿÎÛ4!5!7!!!!!!'7!5!7!5!•ýD€™Q"þrñýµn¹üé™RþÝoþL¢ªèT”ªËªËªêT–ªËªÙÛ  )@    Ü<Ü<1ÔÜÜÜÜÜÜÜ0!!!!!!!!Ùúþúþúþúþ”ªªüKªªÙÛ¨ T@.œœœœBѧœ $# ü<ì2291/ìôì90KSXííííY" 5 !!Ûü@Àúþúþúþøþëþî²pªoüªÙÛ¨ V@/œœœœBѧœ$ # ü<<ì291/ìôì90KSXííííY"55 !5ÙúþÁAúþø°þ‘ªþ²ýǪªÚÿVÜ 3!! 5 !!Úúþü@Àúþúþúþªþëþî²pªoüªÚÿVÜ !!555 !5ÜúþúþÀBúþªªk°þ‘ªþ²ýǪªÚþ±Ü!5!7!5!7!!!!' 5'þ³Ú`ýÆȉŠ)Pþ"_=ý6ŠŠÞü@Àúþªªsª¤s1ªsª¥tFþëþî²pªoÚþ±Ü!5!7!5!7!!!!'55'þ³Ú`ýÆȉŠ)Pþ"_=ý6ŠŠþÜúþÀªªsª¤s1ªsª¥tF°þ‘ªþ²”.Ìß 5 5ÌüÆ:ûÊ6üþüÆ:ûÊ6þpþrÅŸ ÎþpþrÅŸ ”.Ìß 5555”6ûÊ:86ûÊ:ÎýöŸýøÅŽÎýöŸýøÅްþò'!67&'&54767&'676'&'{)#Y4JJ4Y#)þÀ)#Y4JJ4Y#) AAAAGF£žâßà㞢GGGG¢žãàß➣FGú2;;âÎá;<<;áþ2â;ØÜè5$?$%5%67$'W´É ßeþöþ»²Ä”‡·Èþûäd?þNÿÄ”])]²o&¶—²¯ bRô)`²q%µ ˜²¯ þŸRÙÛd%'%5% >ýz™‡“þ­ˆmþzÈþF<ß˶êþ½@6´¦ o@æh¶‹GpÙÿ Ûÿ%5'75%7-ý†™‡“ïüå­ˆmþá†ÈºþÄ%˶êC@þÊ´¦þàþ‘@æh¶‹GpÙÿ/ÛV !5!%5%%%!!'’þ‰/ôþƒ½xýËv¤H-þ‰réýÛf‹ý5L¤OlUýrªC¢ªÝ@=ÇV°lþÑŒ²žþíªÑ=Ùÿ/ÛV%'!5!75%7%5!!'‘ ÖþþøGWþbè[ý½„¤ÚýmmüÁN¤—L>üߪìw²‹õ§°·e=þ¨ˆª½þتÑ=Ùÿܨ$%#"'&'&'&#"5>32326 5Üj²bn’ š^X¬bh´`n” œ^V¨gü@Àúþð´ND:3232655Üj²bn’ š^X¬bh´`n” œ^V¨ûfúþÁ²NF<>LT²NF<>L>°þ‘ªþ²Ùÿ)ÜP14%&#"5>32%5%%%3267#"'&'&/' k X¬bh´`'+kýÆu¥E%þsäýák œ^V¨hj²bn’ "P¥vþ„1-LT´ND£ªÞ9A»T°jþÍŠ²œþãLT²NF<þñ=ß &T²N#¡w²‹ô¨°¸f=ý€J;ÐÿNÜ} 55 5ÚúþÀ8ü@Àúþ'°þ‘ªþ²»þëþî²pªoÐÿNÜ} 5 55Òü@ÀúþûúþÀ'þëþî²pªoö°þ‘ªþ²ÐþmÜ`!-%5%%%'5%%5 MMþÜ`ýºÂZ¦D„þOAòýè@ýFZ¦Dþt¸@þmþ¬*³_TW§ªÊˆ&þÔo°}þ䎲š¥ªÈþw&-r²~‘°›ÞbUÐþmÜ`!7/%5%%'%5%75%À®˜J¦’¤ýv±a¦d®ýì",ý©,ƒýV`¦bþL"ýÌ_D2,£/*/¼°Å¨&þO{ª˜”Ÿ°­Â¸²Äþ[&®}ªš”¢²­Ùÿ²ÛP %5$Ûþrýó ’þoüsaþa^þ~ï|¦|Ùÿ²ÛP 55%$Ùsüþo’ ýóaïþ|¦|þï‚^aÙÿ)ÛW!%5%5$Ûþgü—V¬þþ$Üþü}ƒ×¾‘®…ßþå]]þå×x„¦|€Ùÿ)ÛW3%55%$Ù¬Vü—þgƒü}þÜþ$¡…®‘þBW×þ€|¦„þˆ×]]ÙÿRÛW(%#"'&'&'&#"5>32326%5$Ûi³an’ ›^X¬bi³an“ ›^V©gþþ$Üþü}ƒ±³NE;=LT³NE;=K$þå]]þå×x„¦|€ÙÿRÛW(%#"'&'&'&#"5>3232655%$Ûi³an’ ›^X¬bi³an“ ›^V©ûeƒü}þÜþ$±³NE;=LT³NE;=K$×þ€|¦„þˆ×]]ÙÿƒÛ&%5$%67%'îðþÛÃEƒ¹žtºÖ‹$÷ãþ‚ë‚k—¡}u°U)¦?¥eKþtu•ï³uþÔíï"¦þ K 9'ÙþåÛ'567$'567&'Æð%þ=þ»þ⃹žtºÖ‹þÜ÷ã~ë‚þ•—¡}uRU)¦?¥ý›KŒu•ï³u,íïþÞ¦÷Küö9'Ì£è_%!"54763!!"3!èüÂÊþ슊È@üÀˆ¾^`ˆ@£ÈÆ‹–ÀˆŠ^`Ì£è_75!27654&#!5!2#Ì@ˆ`^¾ˆüÀ@ÈŠŠþìÊ£–`^ŠˆÀ–‹ÆÈþêÌÿ;èÏ #";3!!!!#"54763¢úˆ¾^`ˆ0ørªrnþdÊfýlpªpÈþꊊÈÉÀˆŠ^`&pþ–ýp–þ˜hÈÆ‹Ìÿ3èÇ 32654'&+ #!5!!5!32#úˆ¾^`ˆ0ørªrþ’œÊýš”pªpÈŠŠÈ9ÀˆŠ^`üÚþp––hþ˜þêÈÆ‹¾Ûè7!!!"'&54763!!"3!òéûéüÁÉŠ‹‹ŠÈ@üÀ‰¾_`ˆ@––,‹‹ÈÆ‹–ÀˆŠ^`Ùöè7!!5!27654&#!5!2#Ùéû@ˆ`_¾‰üÀ@ÈŠ‹‹ŠÉ––,–`^ŠˆÀ–‹ÆÈ‹‹¾ÿÛ× '!";!!!!'7!5!7&'&54763!7!!Ñþʉ¾_`ˆ'œ}ýE=øüÉa†LþéT>¹‚‹‹ŠÈsc†L0þ’RÀˆŠ^`–––í5¸––ƒ‹ÈÆ‹ï7¸–Ùÿö× '327654'&/!5!7+!!'7!5!7!5!^»ˆ`__BV™ý 5c†TpX‹‹ŠÉ÷?àüãb†LþÐm>þUéÂ`^Šˆ`C –ï7Ë XÆÈ‹‹––í5¸–––¾ÿjÛé )5!7!!'!"'&54763!!"3!Äþ.Bqx-ëý¥qxDüÁÉŠ‹‹ŠÈ@üÀ‰¾_`ˆ@––Z<––Zi‹‹ÈÆ‹–ÀˆŠ^`¾ÿjÛé )5!7!!'5!27654&#!5!2#Äþ.Bqx-ëý¥qxþ'@ˆ`_¾‰üÀ@ÈŠ‹‹ŠÉ––Z<––Zi–`^ŠˆÀ–‹ÆÈ‹‹Ó¢332653#"757!!¬”¦¥”¬õðñõîÄ54&'&'$  &'&'&547676!!#!5!ÅÖ]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cbÍdþœªþœdŽ''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcb„þ›ªþ›eªe»ÿãù$7!!"2767>54&'&'$  &'&'&547676¡rüŽ$Ö]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cbתa''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcb»ÿãù$3?"2767>54&'&'$  &'&'&547676''7'77ÅÖ]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cbíýüxüüyýüxüüŽ''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcbþ¾üüxüýyüüxüý»ÿãù$7 "2767>54&'&'$  &'&'&547676æpxýgÖ]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cb†pxý€''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcb»ÿãù$73#"2767>54&'&'$  &'&'&547676ðÔÔÕÖ]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cbþ‹''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcb»ÿãù$ 2L"264&'2#"&54>"2767>54&'&'$  &'&'&547676ZPnn noO@v+..¹†‡´¸ðÖ]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cbAoPOmmžp1.-rB„·´‡†ºÌ''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcb»ÿãù$+E %#'-73%"2767>54&'&'$  &'&'&547676ðþ½C4þÑfþÑ4Cþ½4/f/÷Ö]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cb1¯°X·þ­S·X°¯Y·Sþ­·''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcb»ÿãù$!;!!!!"2767>54&'&'$  &'&'&547676€ý€€ý€«Ö]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cbjˆÀˆô''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcb»ÿãù$37"2767>54&'&'$  &'&'&547676!!ÅÖ]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cb8€ý€Ž''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcbþª»ÿãù$!%!!!!#!5!QûX>úÂôdþœªþœd‰ûð›ú¿Yþ›ªþ›eªe»ÿãù$ !!!%!!¡rüŽPûX>úÂת\ûð›ú¿»ÿãù$   ' 7 %!%!!=þ•kyþ–þ–ykþ•yjjüûX>úÂìþ–þ–xjþ•yjjyþ•k$ûð›ú¿»ÿãù$ 3#!%!!ðÔÔþaûX>úÂþ†ûð›ú¿¯Jš@ ÜÜ<Ü1<ÜÜÜ033!!¯úäšýuýp¯Jš!#!5!3Jú䋯Iš!#!5Iýs€ýsšúå¯Iš35!3!¯€úå¯|š33!!¯Ný²šýuýp¯|š !#3!!!!.Ný²Ný²šþ$ä¯Jš !#3!!!!.úäúäšþ$ä¯Jš !3!!!#3¹üGþšýuýpš¯Jš !#33!!!#3.GVýªþšúfšýuýpš¯Jš!#3#3!!!!.c¹üG¹üGšúfšþ$ä¯ÿ¯Jë33!!!'!¯'SsþÅjý\þªs=þšýuÜ5ýYý6«ýp¯ÿ¯Jë!!!!'!#3!7!¨sêý­j½ýþþséþhx¥jýÃë5þäýÓ6÷þ$šþ$þää¯ÿ¯Jë!!'!#3!#3‚sþÅþ6þªs=þžüÿë5ýYý6«ýpšýuüñš¯ÿ¯Jë!#3!!!!!'!#37!‘ôsê:þŒjÞýçþþséþìþ²jþGšþ$-5þäýÓ6÷þ$šüÁääÙÛæ 51ü¢úþ Äþžýœ¦ÙÛæ ƒ^ü¢ª bbü:Èýï¦ÙÿžÛd 5! 5Ùªü¢úþbªªÄþžýœ¦ÙÿžÛd 5! Ùû¨^ü¢ªbªªbbü:Èýï¦yg‡¢62"'&'!"&462!6"264ŸS몧òQ3ýQ3Tò¢¦ëW4¯üdrOOsOOS¨ï¤Q3CB3R¢ò§U4CDPrOOqyg‡¢"&462!6762"'&'!$264&"aS몧òQ3¯3Tò¢¦ëW4ýQœrOOsOºS¨ï¤Q3CB3R¢ò§U4CDPrOOqbgR¢ 7!6762"'&'$&"26bÀ1[륢òS4šOsPOtO.¨D/Y§ò¢R3BŽPQqOOyÿ ;d 3#!!#3%!5!¨¨( ý󀨨þØýó dýó€ªýs €ªî<›!##5!#T~èNèÈì 35!3 3#ÈKûõÃ#"Ãþ˜úªªìüT¬û^Èì !!3# ÈKûµ@iúhÃþÞþÝìªú¾¢û^¬üTÈì !!3 3#ÈKûµ@Ã#"Ãþ˜ú쪠üT¬û^™~ )3!!&'.'&™û‚ªZV¥îF%ü,E=Î?~þë%Fî¤VZDý¼A?Î=™~ !53ïüÖ*ü,ÔªÔüÖªªÔû‚ÿúþw–Á # #·ßËý}ý}ËÝÁø¶wù‰Jÿúþw–Á 3 3Ùý!˃ƒËý#þwJù‰wø¶ŒþwÁ@ ÜÜÜÜ1@ ÜÌÌ0"# #4$HÛþÌ­½þ½­þÏãüû9àB(þØþ¾û ÇúåŒþwÁ@ ÜÜÜÜ1@ ÜÌÌ02$53 3HÛ4­þCþþC­1åãüÇû þ¾þØ(Bàû9úåÿÿþ#îu)ÿÿÛH®F 7ù1  !!'ù+]^*ò^ôó]ýþä°þä°°ÙÿÂ'B  ' Ù''üÙ›þâ>€ý°Pú€Nq^ýD^þ¢ÆÙÿÂ'B %  !'üÙüÙ''ýtþÊþ¢àNý²€ý°PÝþ^ýDÙÿÂ'B 5  5!Ù''üÙüÙŒ6âbàý²Nú€Pý°Ýäþ¢¼ÙÿÂ'B5 5ÙŒýtNüÙ>àáâÝû]ÝPÙÿÂ'B 5 'üÙüÙNýtŒ>Pý°Ý£ÝþþÙ`Ûô32?632.#"#"&'!5Ùg©V^›“na³ib¬X^›’na³iúþôUK= ;EN²SL=;EOþȪªÙ^Û¦ 3# 5¤ÓÓ7ûøúþþîþ‘þ“¶ѦÑÙ^Û¦ 3#55=ÓÓdúþþî¶þ/¦þ/¶m”. Ìß  5 5 5 ÌüÆ:ûÊ6ýüÆ:ûÊ6üþüÆ:ûÊ6þpþrÅŸ ÎþpþrÅŸ ÎþpþrÅŸ ”. Ìß 555555”6ûÊ:86ûÊ::6ûÊ:ÎýöŸýøÅŽÎýöŸýøÅŽÎýöŸýøÅŽÙþ.ÛÔ  5 !5! 5ÙÁü?úþúþü@ÀúþþÞ²þªþ‘þªNþëþî²pªoÙþ.ÛÔ 5 5!55Ûúþü?þ¿úþúþÀþÞ°oªp²þî9ªªø°þ‘ªþ²ÙÛ¨ %5 5!Ûúþü@þ¾°°oªp²þî9ªªÙÛ¨ 7 5 !5!ÙÁü?úþúþ°²þªþ‘þªÙÿ)ÛW5$%5$ÛþTüªi™þü}ƒþþ$Ü€þ_…®‘¾ú©×€|¦„x×þå]]Ùÿ)ÛW5$%$5Ù™iüªþTÜþ$þƒü}þ€×þB‘®…ý!]]×þˆ„¦|þ€Ùþ“Û!&!%'&'57&%5$%67&%7Ûþóþ*þズÕÿÚ?ðþص;öƒ¦½‚ÈâiöÚþ€@šþ]0qw^×%¤ý¡KA6#®(A‡F+¦3273267#"'' 5æcCX¬bh´`^xn›ieEV¨hj²b_zl›]ü@ÀúþLT´ND*óFé JV´ND+ðFÍþëþî²pªoÙþåܨ"%&#"5>3273267#"''55æcCX¬bh´`^xn›ieEV¨hj²b_zl›þ[úþÀLT´ND*óFé JV´ND+ðFͰþ‘ªþ²Ùþ¦ÛW&&#"5>3273267#"''%5$æcDX¬bi³a]ym›ieEV©gi³a`yl›]þþ$Üþü}ƒ. LT³NE+óFé KU³NE,ñF”þå]]þå×x„¦|€áþ¢ãW&&#"5>3273267#"''55%$îcDX¬bi³a]ym›ieEV©gi³a`yl›þ[ƒü}þÜþ$3 LT³NE+ôFê KU³NE,ðF˜×þ€|¦„þˆ×]]ÙþöÛ 7%'%5 '瞃Ùý¹ÛžÜýâL ‹Ðž‘þ  @þÁYû8ðýè@à¦\üïÄ9þ@aÎÙþöÛ ' 7%ÍžƒÙGÛžÜü´þô‹Ðž‘öþö@?YÈð@ýçà¦þ¤ý<9ü@þŸÎÙþ}Û…5!%57%!!'71ŽÏý| ýäIÁžÛý·…Îüìvž\'þ žÄ:þýqª†ß¦[×@þÅZû8ñþ»ªþß@áÐ_ÍÕþ}×…7!!'7#5!7%%%Õ¥éžé¿ý9ƒJüpvž\º]þFGjqœÈþé8@ýǹ¦þÛþÀªþß@áªäµýþ.õÐ !!#!#5!¸ õüöžþØøªþøªœÅû !'7'7!!5!5!âËéx‰þwxéþýýFb⼚éxþwZþwxéüªªªª#ÙÐ %! ! ! Ølþ”ý(þ”+þR­[®þSrvvýŠýèèýý°ýüP #53s຦ È–ýüêæ0þkþþTþ°ýüs*3#°ÃÃ*÷Ò°þP- #5s–È ¦º -êþþTþþk0æê°ýüP 53–È ¦º ýüêü¬ò•þýýÐþýêêýüP*#0PÃ*÷Ò.°þP- 3#຦ È–-êýêþýÐþý•ò¬ü°ýüP#!!sàþ#ýüðýüs*3#°ÃÃ*÷Ò°þP,!!sÝý`,ø«Ã°ýüP!5!þ# ýüUÃ÷èýüP*3#ÃÃ*÷Ò°þP,3!5!Ãý`Ý,÷èãýêX #4763!!"]ºo´þçeD9ýê×™ž°fVš¨ýü],#'&%'53 763”<(eºnKþû==Pnºe(!<˜þõýè  _A»E_  ýèþõ˜<£þX> 3!!"'&5]9Deþí´o>ùÜšVf°ž™×£ýô]>#3]ººýôJ¨ýê] 4'&#!5!2£9Deþç´oýê$šVf°ž™×ùä£ýüX,&'&3!3#76l<(eºnP==þûKnºe(!<˜ ýôþö_E»A_þöýô ˜<¨þ]> 3#!5!2765£ºo´þíeD9>ùä×™ž°fVš¯þu(3¯Æþ(÷Ø7†@Õ% !!!5 5!!3þü7Öûôdþö  þò†üüþïhûÂrƒþöþöƒvý˜ºÕÄ! !!Õùå ùå $û<ø–ÿFfü +   276764'&'&">  &vvýŠýŠrèèýþn66\]Ú]\6666\]Ú]\6¨Šîîþèî5þ•kØkþ•üæ\­þSü¤þSÈÚ]\6666\]Ú]\6666\þªîþèÿÿš!Žÿ‚ÿã¤>32#"&'#'%53%&  s:±{ÌÿÿÌ{±:¹þé!8¹#!þ¼r§þܧ§$¶daþ¼ýðþ¼ad¨æ]chÀƒaamü@–ççþjç’þ.‚Ð!3!3: ¨ü¨þØøý^¢˜ÿì”è &Ûº+¸º#+¸#º+¸A&6FVfv†–¦¶ÆÖ ]Aåõ]Aêú]A)9IYiy‰™©¹ÉÙ ]º+¸º +¸ º$%+¸$¸Ð01! 4$32! 4$#"35%33!”þ?þÂþÄþ?Îq¾ÁqÍúW¶þ¸­­þ¸¶|Ùì¡Úý—êþÁþA¿?ÆrÆÆþÈþäþp³G±±þ¹ýÿ~+˜/ü掘ÿì”è 8?º+¸º3&+¸3º+¸A&6FVfv†–¦¶ÆÖ ]Aåõ]Aêú]A)9IYiy‰™©¹ÉÙ ]¸3¸и/Aê&ú&]A&)&9&I&Y&i&y&‰&™&©&¹&É&Ù& ]º,9º+¸º +¸ º+¸º0)+¸001! 4$32! 4$#"!!56$7>54&#"5>32”þ?þÂþÄþ?Îq¾ÁqÍúW¶þ¸­­þ¸¶O´ý\R!>/_N;„sa‘=£Å0>²êþÁþA¿?ÆrÆÆþÈþäþp³G±±þ¹ýÿŽMñ"?U(?N&:«$—}:iF§˜ÿì”è Dµº+¸ºB5+¸Bº+¸A&6FVfv†–¦¶ÆÖ ]Aåõ]Aêú]A)9IYiy‰™©¹ÉÙ ]Aê5ú5]A5)595I5Y5i5y5‰5™5©5¹5É5Ù5 ]º5B9º,5B9¸,/Aê,ú,]A,),9,I,Y,i,y,‰,™,©,¹,É,Ù, ]¸ܺ&9º;9º+¸º +¸ º)"+¸)º?8+¸?º2/+¸2º/2901! 4$32! 4$#"#"&'532654&+532654&#"5>32”þ?þÂþÄþ?Îq¾ÁqÍúW¶þ¸­­þ¸¶¹ vØÃ@ˆX[}DuskcŒ‘ZX\[4yk_ˆ=¡ÁhêþÁþA¿?ÆrÆÆþÈþäþp³G±±þ¹–]œ¨0OLGNŒ<:,+¸>º2+¸201! 4$32! 4$#""32654&.#"632#"&5432”þ?þÂþÄþ?Îq¾ÁqÍúW¶þ¸­­þ¸¶¡N\\NN\\ÔTa/w €N ºÂ ¹ÀêÈ5jêþÁþA¿?ÆrÆÆþÈþäþp³G±±þ¹Ÿb[ZbbZ[bœ#”P =±”‘³ýçÚ ˜ÿì”è "ë¸#/¸$/¸Ü¸#¸и/¸ÜA&6FVfv†–¦¶ÆÖ ]Aåõ]¸¸ÜAêú]A)9IYiy‰™©¹ÉÙ ]º 9º!9º+¸º +¸ º!+¸01! 4$32! 4$#"!#!”þ?þÂþÄþ?Îq¾ÁqÍúW¶þ¸­­þ¸¶k«þ”ÁQþ1êþÁþA¿?ÆrÆÆþÈþäþp³G±±þ¹Kü£˜ÿì”è '?K º+¸º=+¸º1F+¸1º+¸A&6FVfv†–¦¶ÆÖ ]Aåõ]Aêú]A)9IYiy‰™©¹ÉÙ ]A&6FVfv†–¦¶ÆÖ ]Aåõ]AêFúF]AF)F9FIFYFiFyF‰F™F©F¹FÉFÙF ]º%F19¸%/Aê%ú%]A%)%9%I%Y%i%y%‰%™%©%¹%É%Ù% ]º+=9¸+/º4F19¸%¸7ܸ+¸@ܺ+¸º +¸ º":+¸"º.I+¸.ºC+¸Cº4C901! 4$32! 4$#""32654&%.54632#"&546732654&#"”þ?þÂþÄþ?Îq¾ÁqÍúW¶þ¸­­þ¸¶¯T__TT__þÆj·¶iv¾­­¾vWQMKRRKMQêþÁþA¿?ÆrÆÆþÈþäþp³G±±þ¹æPIIPQHIPIvStˆˆtSvƒ\Š——Š\ƒÁ=BB=>BB˜ÿì”è 4@‘º+¸º>)+¸>º+¸º/8+¸/A&6FVfv†–¦¶ÆÖ ]Aåõ]Aêú]A)9IYiy‰™©¹ÉÙ ]A>&>6>F>V>f>v>†>–>¦>¶>Æ>Ö> ]Aå>õ>]º)>9Aê8ú8]A8)898I8Y8i8y8‰8™8©8¹8É8Ù8 ]º+¸º +¸ º 2+¸ º,;+¸,º5&+¸501! 4$32! 4$#"532676#"&54632#"&2654&#"”þ?þÂþÄþ?Îq¾ÁqÍúW¶þ¸­­þ¸¶Ua.w €OŸºÂ ¹¿éÈ5kÙN[[NN\\êþÁþA¿?ÆrÆÆþÈþäþp³G±±þ¹ý‹œ$“O <¯”‘´ýèÚþö´b[[bb[[b˜ÿì”è &2>›º+¸º#+¸#º*<+¸*º60+¸6º+¸A&6FVfv†–¦¶ÆÖ ]Aåõ]Aêú]A)9IYiy‰™©¹ÉÙ ]Aê0ú0]A0)090I0Y0i0y0‰0™0©0¹0É0Ù0 ]Aê<ú<]A<)<9<I<Y<i<y<‰<™<©<¹<É<Ù< ]º+¸º +¸ º-9+¸-º$%+¸$º3'+¸3¸$¸Ð01! 4$32! 4$#"35733!"32654&'2#"&546”þ?þÂþÄþ?Îq¾ÁqÍúW¶þ¸­­þ¸¶Íž¬¼uŸþ>@EE@?FF?‚ˆˆ‚ƒˆˆêþÁþA¿?ÆrÆÆþÈþäþp³G±±þ¹þ>>'‰*ý6€Þ—£¢——¢£—{äÑÐääÐÑäÿìðåœ5!ùð¬¬ÿìšåò!ùšXþ¨ý–¸È3 ý– 2õÎÈý–È!È@ý– 2õÎÿìðåœ 5!!5!!5!±4üï)üï4𬬬¬¬¬ÿìšåò !!!!!±4üï)üï4šXþ¨Xþ¨Xþ¨ý–¸È 333     ý– üôÀ²ýNf üôÈý–È !!!È@þÀ@þÀ@ý– üôÀ²ýNf üôÿëðåœ 53353353353¼´³´²´½𬬬¬¬¬¬¬ÿìšæò 3333333¼´³´²´½šXþ¨Xþ¨Xþ¨Xþ¨ý–¸È 3333       –2ýÎø2ýÎsÙþ'ýsÙþ'Èý–È !!!!È@þÀ@þÀ@þÀ@–2ýÎø2ýÎsÙþ'ýsÙþ'ý–åœ!!ÍýÓý–¬û¦ý–åò!!ÍýÓý–\þ¨ûüÈý–åœ!!Èþ#ý–¬û¦Èý–åò!!Èþ#ý–\þ¨ûüÿìý–¸œ!5!ýÔÌý–Z¬úúÿìý–¸ò!!ýÔÌý–Xú¤ÿìý–œ!5!Èþ$ý–Z¬úúÿìý–ò!!Èþ$ý–Xú¤ðåÈ3! -ðØúÔ¬šåÈ3! -š.û*þ¨ÈðåÈ!!È@ÝðØúԬȚåÈ!!È@Ýš.û*þ¨ÿìð¸È5!3, ð¬,ú(ÿ울È!3, šXÖùÒÿìðÈ5!!Ü@ð¬,ú(ÿìšÈ!!Ü@šXÖùÒý–åÈ3!! -ýÓý– 2úÔ¬û¦ý–åÈ3!! -ýÓý– 2û*þ¨ûüÈý–åÈ #!!!P@ÝýÓý–ZØúÔ¬û¦Èý–åÈ 33!!ÈP -þ#ý–,úÔ¬û¦Èý–åÈ!!!È@Ýþ#ý– 2úÔ¬û¦Èý–åÈ #!!!P@ÝýÓý–.û*þ¨ûüÈý–åÈ 33!!ÈP -þ#ý–\Öû*þ¨ûüÈý–åÈ!!!È@Ýþ#ý– 2û*þ¨ûüÿìý–¸È!5!3ýÔ, ý–Z¬,õÎÿìý–¸È!!3ýÔ, ý–XÖõÎÿìý–È !5!!#ýÔÜ@Pý–Z¬,ú(û¦ÿìý–È !5!33Èþ$, Pý–Z¬,úÔúúÿìý–È!5!!Èþ$Ü@ý–Z¬,õÎÿìý–È !!!#ýÔÜ@Pý–XÖùÒûüÿìý–È !!33Èþ$, Pý–XÖû*ú¤ÿìý–È!!!Èþ$Ü@ý–XÖõÎÿìý–åœ!5!!ýÔùýÓý–Z¬¬û¦ÿìý–åò !!!!ýÔÌ-ýÓý–XV¬û¦ÿìý–åò !5!5!!ýÔ,ÍýÓý–Z¬Vþ¨ûüÿìý–åò!!!ýÔùýÓý–Xþ¨ûüÿìý–åœ!5!!Èþ$ùþ#ý–Z¬¬û¦ÿìý–åò !!!!Èþ$Ýþ#ý–XV¬û¦ÿìý–åò !5!5!!Èþ$Üþ#ý–Z¬Vþ¨ûüÿìý–åò!!!Èþ$ùþ#ý–Xþ¨ûüÿìðåÈ5!3!, -ð¬,úÔ¬ÿìšåÈ !3!!, -ýÓšXÖúÔ¬VÿìšåÈ 5!3!!5, -ý3ð¬,û*þ¨VÿìšåÈ!3!, -šXÖû*þ¨ÿìðåÈ5!!!Ü@Ýð¬,úÔ¬ÿìšåÈ !!!!Ü@Ýþ#šXÖúÔ¬VÿìšåÈ 5!!!!5Ü@Ýüãð¬,û*þ¨VÿìšåÈ!!!Ü@ÝšXÖû*þ¨ÿìý–åÈ #!5!3!¸ ýÔ, -ðû¦Z¬,úÔ¬ÿìý–åÈ !!3!!ýÔ, -ýÓý–XÖúÔ¬û¦ÿìý–åÈ !5!3!!ýÔ, -ýÓý–Z¬,û*þ¨ûüÿìý–åÈ !!3!!ýÔ, -ýÓý–XÖû*þ¨ûüÿìý–åÈ !5!!!!ýÔÜ@ÝýÓý–Z¬,úÔ¬û¦ÿìý–åÈ !5!3!!Èþ$, -þ#ý–Z¬,úÔ¬û¦ÿìý–åÈ !5!!!!Èþ$Ü@Ýþ#ý–Z¬,úÔ¬û¦ÿìý–åÈ !!!!!#ýÔÜ@Ýþ#Pý–XÖúÔ¬Vûüÿìý–åÈ #5!5!!!!Pþ$Ü@ÝýÓý–V¬,û*þ¨ûüÿìý–åÈ !!33!!Èþ$, PÝþ#ý–XÖû*V¬û¦ÿìý–åÈ !5!533!!Èþ$ÜP -þ#ý–Z¬VÖû*þ¨ûüÿìý–åÈ !!!!!ýÔÜ@ÝýÓý–XÖû*þ¨ûüÿìý–åÈ !!3!!Èþ$, -þ#ý–XÖû*þ¨ûüÿìý–åÈ !!!!!Èþ$Ü@Ýþ#ý–XÖúÔ¬û¦ÿìý–åÈ !5!!!!Èþ$Ü@Ýþ#ý–Z¬,û*þ¨ûüÿìý–åÈ !!!!!Èþ$Ü@Ýþ#ý–XÖû*þ¨ûüÿìðåœ5!35!, -𬬬¬ÿìšåò!!!¸-û,šXþ¨Xþ¨ý–¸È33   òÖû*ú¤ûüÈý–È!!È@þÀ@òÖû*ú¤ûüÿìDåH5!5!ùûùœ¬¬þ¨¬¬xý–XÈ333x   ý– 2õÎ 2õÎý–åH !!!!ÍýÓ-ýÓý–²¬¬¬üRxý–åœ !!##xmþs  ý–¬û¦Zû¦xý–åH !!3!!xmý3 -þsý–²¬úúZ¬üRÿìý–¸H !5!5!5!ýÔ,ýÔÌý–®¬¬¬úNÿìý–Xœ 5!###l   ð¬úúZû¦Zÿìý–XH !5!!!5!¸ý4lþ þt,ý–¬úN®¬û¦DåÈ 3!!! -ýÓ-D„û€¬¬¬xðåÈ 333!x   ðØúÔ,úÔ¬xDåÈ 3!3!¸ ü“ Íœ,û€¬þ¨„ú(¬ÿìD¸È 5!5!5!3,ýÔ, D¬¬¬€ù|ÿìðXÈ 5!333Œ   ð¬,úÔ,ú(ÿìDXÈ 5!35!3Œ ýÔÌ œ¬€úÔþ¨¬Øù|ý–åÈ 3!!!! -ýÓ-ýÓý– 2û€¬¬¬üRxý–åÈ 333!!x   þsý– 2õÎ 2úÔ¬û¦xý–åÈ 3!33!!¸ ü“  -þsœ,û€¬úú 2õÎZ¬üRÿìý–¸È !5!5!5!3ýÔ,ýÔ, ý–®¬¬¬€õÎÿìý–XÈ !5!333xþtŒ   ý–Z¬,õÎ 2õÎÿìý–XÈ 5!3!5!33Œ  þt,  œ¬€úÔúú®¬û¦ 2õÎÿìý–åH !5!!5!ýÔùýÓý4ùý–®¬¬üR¬¬ÿìý–åœ 5!!###ùþs   ð¬¬û¦Zû¦Zÿìý–åH 5!!5!3!!ùü“þt, -þsœ¬¬úú®¬û¦Z¬üRÿìDåÈ 5!5!3!ùû, -D¬¬X¬€û€¬ÿìðåÈ 5!333!Œ   ð¬,úÔ,úÔ¬ÿìDåÈ 5!5!333!ùûŒ   D¬¬X¬€úÔ,û€¬ÿìý–åÈ!5!5!5!3!!!!ýÔ,ýÔ, -ýÓ-ýÓý–®¬¬¬€û€¬¬¬üRÿìý–åÈ5!333!!###Œ   þs   ð¬,úÔ,úÔ¬û¦Zû¦Zÿìý–åÈ !!!!5!5!333!¸-þsþ þt,ýÔŒ   ý–Z¬üR®¬û¦¬€úÔ,û€¬ý–åœ 4763!!"Q[¨yþ‡Y[ý–`¡†¬~|ü ÿìý–¸œ 4'&#!5!2.-Yþˆx¨[Qý–`~=?¬†x¨ü ÿìð¸È 5!2653#xY[ Q[¨ð¬~|2ûΨx†ðåÈ !"'&533!åþ‡¨[Q [Yyð†x¨2ûÎ|~ÿ“ý–>È3mù²ûý– 2õÎÿ“ý–>È#3>²û²ý– 2ÿ“ý–>È # # 3 3>²ýÜýݲ}ýƒ²#$²ý„ý–cûûcúçÿìð|œ5!ð¬¬F¸È3 F‚ú~|ðåœ5!|ið¬¬ý–¸F3 ý–°ûPÿìš|ò!šXþ¨ÈFÈ!È@F‚ú~|šåò!|išXþ¨Èý–F!È@ý–°ûPÿìšåò5!5!!5iý—ð¬Vþ¨VÈý–È333ÈP Pý–°‚ú~ûPÿìšåò!!!iý—šXV¬VÈý–È#!#P@Pý–°‚ú~ûPÿÿÿì;( ãÿìþ;ÿ!Oþþûÿìþ;ÿö!Oþöþ ÿìþ;!Oþüñÿìþ;!Oþûìÿìþ;!Oþúçÿìþ;!Oþùâÿìþ;#!Oþ#øÝÿìþ;(!Oþ(÷Øÿìþq(!…þ(÷Øÿìþ§(!»þ(÷ØÿìþÝ(!ñþ(÷Øÿìþ(!'þ(÷ØÿìþI(!]þ(÷Øÿìþ(!“þ(÷Øÿìþµ(3Éþ(÷Øÿÿþ:( ë' ÿìþq( #'+/3!33!33!33!33!33!3§ÊüÊÊÊüÉòÊüÊÊÊüÉòÊüÊÊÊüÉþþûþûmþûþûnþûþûmþûþûnþûþûmþûþû ÿìþ4('/7?GOW_gow‡—Ÿ§¯·¿ÇÏ×ßçï÷ÿ5'#3%5'#3%5'#3%5'#35'#3%5'#3%5'#3%5'#35'#3%5'#3%5'#3%5'#35'#3%5'#3%5'#3%5'#35'#3%5'#3%5'#3%5'#35'#3%5'#3%5'#3%5'#35'#3%5'#3%5'#3%5'#35'#3%5'#3%5'#3%5'#3µ¿¿—¿¿—¿¿—¿¿ü¿¿—¿¿—¿¿—¿¿ú†¿¿—¿¿—¿¿—¿¿ü¿¿—¿¿—¿¿—¿¿ú†¿¿—¿¿—¿¿—¿¿ü¿¿—¿¿—¿¿—¿¿ú†¿¿—¿¿—¿¿—¿¿ü¿¿—¿¿—¿¿—¿¿(ûûûûûûûûÿûûûûûûûûÿûûûûûûûûÿûûûûûûûûÿûûûûûûûûÿûûûûûûûûÿûûûûûûûûÿûûûûûûûûÿìþ;(!%)-13#3#3!3!##!#3#3#3#3#3#3#ÉÉÉÉÉ^Ê^ÊÊý¢ÊÊÊ(ÊÊþlÊÊþlÊÊ(ÊÊþlÊÊþmÖÖþû÷Øþûþû¶þûýýŽþûýÿÿÿì#;( à#ÿÿqþ:( î…ÿìþ!&þûìÿÿþ9 õ'ÿÿÿì( õÿÿÿìþ9(& õ& ö ÷ÿÿÿìþ9(& ö ÷ÿÿÿìþ9(& õ& ÷ üÿÿÿìþ9(& ö& ÷ üÿÿ9( õ'ÿÿÿìþ9(& õ üÿÿÿìþ9(& õ& ö üºÿÕ$!ºü ùàºÿÕ$!!!,7úÉrŠ<úR ùàºÿÕ$ %3!254#!") ) ,äoääü‘ärVoVþªü‘þªZäätääüŒtVþªüŒþªÿÿºÿÕ$' ºÿÕ$ !%!5!5!5!5!5!5!5!5!5!ºúW7úÉ7úÉ7úÉ7úÉ7úÉü ùàr°r²r°r²r°ºÿÕ$ !%3#3#3#3#3#ºþá°°þܲ²þÞ°°þܲ²þÞ°°ü ùàt8úÈ8úÈ8úÈ8úÈ8ºÿÕ$ #'+/37;?CGKOSW[_cg35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#!L²²$°°"²²üš®®®®®®®®®® ²²²²²²²²$°°°°°°°°"²²²²²²²²$­­­­­­­­­­ûˆ®®®®®Ü®þ.²þ,°þ,²þ.®Ü®þ.²þ,°þ,²¸®þ.²þ,°þ,²¸®þ.²þ,°þ,²¸®þ.²þ,°þ,²þ.®þÞ ùàºÿÕ$ !33775353535ºúWââ„ûý!ûûä¾yûB¢üߢþ|¢âü ùàTâüþ}üüß<ûB½ûäü ýüƒââºÿÕ$ !%353555#5#5#57#ºþ¬âýû„ûäû!úÉy¾yûBûüßûþ|ââü ùàrââƒüý!üûä¾ûC¡üà¡þ}¡âºÿÕ$  $(-159=AFKOSW\aejos7'#7'7'#7'7'7'#7'7'7'75#7'7'7'7'7'37'75'7'7'7'37'75'7'37'35'!,2|5y2~~2O~~5’þþ~|~þ2~~2ì~~5’þý~}}þµ}}~þµ~~~‰}1yþý|~|þ³|~|þµ}||þµ|~|þ³}}|ÿz4|2ˆ~12þ´~~~þµ~|~þ¶~~~þ³5“4~»}22þµ~}~þµ4“5~4z2ú‰31|4ýä2~~1O~~4þÿ~|~üÌ1~}1ì~~4þý}}~þµ~}}þ¶~~~ì|1þý|~|þ´}~|þ¶|||þµ|~|þ´|}}þ4|1í~2™1þ´~~~þµ~|~þµ~~~þ´44~~1™1þµ}|~þµ44~~41þÞ ùາ7!ºøüüº²%!!!,üìrøˆüvüüºšÕŽ%!!ÕùåšôºšÕŽ!!!cúÉ©ùå ýðrôºÿ­"!ºóúùäºÿ­"!!!,ýñróˆ8úVùäš!Ž%!!˜ûnŠ‘šôš!Ž !!!büSþïäûnŠ‘ ýðrôÿ!$  ü ùàÿ!$! ±Åýüó ŠÊúÄ ùàþ7 üüüüþ7! ±¢þ¯þüüˆ¦üèüüÿ!$ü üðÿ!$ xÅû;rRffúŠ üðþ7øüþþ7 x¢ý^røÁSSü¯üþ!7üþ!7 xŒûtrÁSSü¯üþÿ!$!üò$ùàÿ!$ %!±bcúüò²û6Êrùàþ!øþüþ %!±QQü³øþ ýZ¦rüÿ!$ùàÿ!$ êÅúWýšÌýšùàþøþüþ ê¢üzøþ­¦þ­þü!þü!  #ŒúWþ­¦þ­þüÿ!$  üòüðüðÿ!$ žuvýŠüó üòýˆxxýˆüðüðÿ!$ >ÕÕþ+ý‹uvýŠüó üò×þ)þ)×ýˆxxýˆüðüðpþÿ‹) )$7632#"'327$%&#"%632#"'‚þ~€~þþ~€~þeM¥¦§¥Mþ³¥§¦¥þ>‡ÃÃÄÇþyÃÄÃÃïJ’JJ’ý¶’JJ6ýÀ``ÀþÀ``ûÿ„âqqâü|âqqþ#îu"@ÔÌ91ÔÌ990 úþþôþ þ üÏüÇ9%ûÛûÓ-pþÿ‹) 327$%&#"%632#"'åM¥¦§¥Mþ³¥§¦¥þ>‡ÃÃÄÇþyÃÄÃÓýÀ``ÀþÀ``ûÿ„âqqâü|âqqrÿ‰' '/7?G%&'&'6767&'&'7%'676727"'64'7&"'62&47\+;.81F9K5Ú8.42d;E9Gœ,:.80G9J6ü&8.;+d1O9FíLšL&_À`Jný¡LšL'`À_ü¸n<1& j(0=Ju &,A=N:0('<1& j(0=Ju &1<>EB0(úÔn_I I'[Ê[Jný¡I I'[Ê[pþÿ‹) %/36%632#"'327&#"6767&'&6p‡ÃÃÄÇþyÃÄÃà AAAA‰««–,+-,,-+öA@@ãªR„âqqâü|âqqÅû¾%ö%m±ýܱ[úÐ0$û %@%¢ü|±"pþÿ‹) )73276'&#"7632#"'327$%&#"%632#"'™r99:9rr9:99í°XWXX°°XXWXþM¥¦§¥Mþ³¥§¦¥þ>‡ÃÃÄÇþyÃÄÃØþøB!!BB!!þo–e33eþje33¯ýÀ``ÀþÀ``ûÿ„âqqâü|âqqpÿ‹ @ ÜÔÌ1ÔÄ04767632#"'&'&pih¶µÒѵ¶hiih¶µÑÒµ¶hiѶµiiiiµ¶ÑѶµiiiiµ¶pÿ‹ $32#"$27$%&#pÑkÒÑkÑÑþ•ÑÒþ•<§¥Mþ³¥§A¢kÒÒþ•þ^þ•ÒÒa`ÀþÀ`pÿ‹ $32#"$"3pÑkÒÑkÑÑþ•ÑÒþ•<¦¥þ³M¥¦A¢kÒÒþ•þ^þ•ÒÒÝ`ÀýÀ`pÿ‹ $32#"$327$pÑkÒÑkÑÑþ•ÑÒþ•\M¥¦§¥MA¢kÒÒþ•þ^þ•ÒÒ>þÀ``Àpÿ‹ $32#"$%&#"pÑkÒÑkÑÑþ•ÑÒþ•Õþ³¥§¦¥þ³A¢kÒÒþ•þ^þ•ÒÒ>À``Àþpÿ‹ $  $"327$!pÑk£kÑÑþ•þ]þ•<¦¥þ³M¥¦§¥MýgA¢kÒÒþ•þ^þ•ÒÒÝ`ÀýÀ``Àpÿ‹ $  $"!pÑk£kÑÑþ•þ]þ•<¦¥þ³˜A¢kÒÒþ•þ^þ•ÒÒÝ`Àþpþÿ})6%63"'p‡ÃÃÃÃR„âqùÖqºþÿÇ)#2ÇþyÃÃÃÃÖü|âq*qºÿìš( 2654&#"!¬ú¬«|~­þ¹àú}¬¬}|««üv<ùĺþ ( $%632#"'327$%&#"!IM¥¦§¥Mþ³¥§¦¥þ>‡ÃÃÄÇþyÃÄÃÃþ_O•þÀ``ÀýÀ``ü|âqqâ„âqqùH(÷غ ( !#%&#")%632ºOþyÃÄÃÃþy¦úÏM¦¥¦¦MûìÂâqqâþ>~Á``Áºþ  3327$3!#"'$º‡ÃÃÄÇú@1þ³¦¦¥¦þ³þþ>âqqâÂûìþ‚Á``Á) %63"‡Ãæ¥þ³Ââqv`Àþ) 2#%&#ÃÇuþ³¥¦)qâþ>À`þÿ 527$3¦¥MuþyÃþÿv`Àþ>âqþÿ "'$33ÃÃþyuM¥¦þÿqâÂþÀ`p‹)%632#%&#"p‡ÃÃÄÇuþ³¥§¦¥þ³Ââqqâþ>À``Àþpþÿ‹03327$3#"'$puM¥¦§¥MuþyÃÄÃÃþyþÀ``Àþ>âqqâÿ!$ü ùàÿ!$ü ùàÿ!$!ü ÿ!$!$ùà3Ñ…! 2654&#"4632"&nŠÈЉce‹;­~|«¬ú¬údŠŠdc‰‰c|««|}¬¬ºÿÕ$!%!!ºüòœýdü ùàr<ºÿÕ$!%!!ºúW›ýeü ùàr<ºÿÕ$!%!ºúW7ü ùàr<ºÿÕ$!%!ºúW7úÉü ùàr<ºÿÕ$ !%!!!!ºý+cýý,býžü ùàr<úÄ<ÿ!$ 462"! W|VV}ýÜÅýüó ,|VV|Vþ ÊúÄ ùàÿ!$! cýüó ŠÊúÄ ùàÿ!$! ±büó ŠÊúÄ ùàpþ„(  7& $  %ñÅâÄâÅþ;âþ<âýºýûþýýüþýûìþûƒƒƒƒú¨*––þÖûXþÖ––ºÿÕ$ !!!!!!,7ýý,rúWbýžŠ<ý)ý) ùàIeºÿÕ$ !!!!%!!,ÔcúÉrúWbýžMý)<úR ùàreºÿÕ$ !!!!%!!,bÕúÉrý+cýŠ×eúR ùàreºÿÕ$ !!!!!!,7ý+ýžrý+cýŠe×úR ùàIepÿ‹  $32#"$!327$%&'pÑkÒÑkÑÑþ•ÑÒþ•‰‰þÌ]ý£4¦¥¦¦Mþ³‰ŠA¢kÒÒþ•þ^þ•ÒÒÚO²þ¬rþ¬²``ÁüÁOý+pÿ‹  $32#"$67$%&#"!pÑkÒÑkÑÑþ•ÑÒþ•uЉMþ³¦¦¥¦þÌÏý14‰‰A¢kÒÒþ•þ^þ•ÒÒ^OÁüÁ``²þ¬rþ¬²Ocpÿ‹  $32#"$!%&#"67$!pÑkÒÑkÑÑþ•ÑÒþ•\M‰‰Ðþ̦¦¥¦„Љ4ý¢A¢kÒÒþ•þ^þ•ÒÒ¼ýÁOÕT²``û%O²Tpÿ‹  $32#"$327$!%&'pÑkÒÑkÑÑþ•ÑÒþ•\M¦¥¦¦4ý0‰‰âþ̉ŠA¢kÒÒþ•þ^þ•ÒÒ¼ýÁ``²TÕOýúT²Oýÿ!$7!!xŒûtr ’úR ÿ!$ %!#ŒúW²ûn’rùàÿ!$!xŒûtrŠ’úü ùàºÿyê¯!!!,Lû´r0Rû<6úʺÿyê¯!º0‡6úʺÿÝ"K%!!!,„ü|rhOŠünû’ºÿÝ"K!ºh#nû’ÿ!$! #ŒúWŠ’úü ùà «€Õ "*2:AI3#''%#&'52#"'&5476!!'5%!!'53'5%3'5%3#'sMM7:ø=üýü=È-0ÐY ¾G.¯b#·CýKSþ­uYþ§G†r=øýµ;ö>MMÕþ¢^›?þ?îþ@Ç7µá`½d§?\µgþíOOOOþè‚y>ý*<þ?vþ¢^hÿû—á"3263#!5276;'4?'4?26õÙu'6‡"gPù39†.4!  '*ÌC0.xáèV#m14He ®'1l1 “Z+ddÈÕ?33 #&'&+"'&#"/573;2?"#'57#&'#"#5676!5‹:¸+#9,–p!—ˆj[%+ > 7ÓVCÅCc":Àï8Õ}þV .e3B=ýSe` e9*¤=9 3@=Úß}ªÿÿ‚k %C`Œ·ã:d»æ;emu}©Óý'S3273&'3327&'67&'67&'67'32654'&'2327654&#"3672 $54767&'&47'&327632#"/#"57#"54?'&5432'&27632#"/#"57#"54?'&5432'&327632#"/#"57#"54?'&5432'&27632#"/#"57#"54?'&5432'&327632#"/#"57#"54?'&5432'&27632#"/"57#"54?'&5432'4327632#"/#"57#"54?'&5432'&27632#"/#"57#"54?'&5432'&27632#"/#"57#"54?'&5432'&27632#"/#"57#"4?'&54327'4327632#"/#"57#"54?'&54327'&27632#"/"57#"54?'&5432&'67&'67&'67'&327632#"/#"57#"54?'&5432'&27632#"/"57#"54?'&5432'&27632#"/"57#"54?'&5432'&27632#"/"57#"54?'&5432'&327632#"/#"57#"54?'&5432üB€~ %<z*+'þë)+(@&'$Ê|÷¯®ø|e‹<-A}]\ŠB-7“„1SLoWŽþäþjþã\vLLý©)(0/ (( .1(%%,* # $ )*f$% +) $ #*+f%%,* $ $ )*ûË  ü»\o÷  [ ®%)#þ·&'%ü&)#`#$ *) $ #+,üU  þQ  0 üE%% +) $ $*+‰&EC&V*,)-)-*,þ%&%&žf“‘ÐБ“fU 3HhfeefhH2Ùpu^èQFs¥£ææ£¥sKQèGýh!99!  !77!  Ñ4 4 22 K44 22 22  11  š  þã     ¨      ¡    7   Ù     úà%&%&â%'%&%'%&22  //  g     û     ‚     ý44 22 ƒ© ->O`q‚“¤µÆ×èù +&'&54?632332?654/&#"2#"/54762#"/54762#"/54762#"/54762#"/54762#"/54762#"/547672#"/54762#"/54762#"/5476%2#"/5476%2#"/5476%2#"/5476D.2`{4&/<) eˆ>þúO ,4H3R 07K÷ $  ¨ $  Š # › #  # ½ $  Š #  $   $  ýU $   # " $   #  7Q=KG<s-8PZy9z €_e""#/2dt0&2j ,: . 4 . = , ý , þü  -  - ú -  -  û  . Ó . ç  , Ê  -  …ÿ÷§É !! …Wº»Vþºþþ¹9ýÇþŸýÈ`þ 8…ÿ÷§É !! 7 ! !…Wº»Vþºþþ¹DŒu€˜þ‘Žþ9ýÇþŸýÈ`þ 8þN þæÂ·þIªëÕ 7%7&5476°9 ý}îV&þ7àýÝA“ Õ6$ ý…ýôæþ8'^4?† ªÙ!2 7%7&547!&'6íI@ýÁçY%þ1çýï4åû¨HFÙS"ýÅþÕþ="l-2ßúüDC[9ª‚Ø &! 4$32 4$ #"&54>2‚þJþÉþËþJÉhº½hÈúqŠ0Š´þ¼þ¬þ¼´^mNMn2Z^Z2ìþÉþKµ7ÂiÁÁþ™Äþèþw‰±B®®þ¾±NmmN1Z00Z}ŸÑ C"32654%"32654&%#"&54767654$ #"&767&54! ±”ggJIhûœIhhIJgg[¶‚¶ZQoyþ±þ þ±y}WZ¶‚€·[zÀADÀégJIggIJggJIhhIJgU\‚··‚\Q s™´ýý´™rW\þü··\޶ø^þ¢ø±}ŸÉ A4&#"26%4&#"326! 547&'&632 $54'&'&632hIJgg”güMgJIhhIJg#þ@þ¼þ¿þ@z[·€‚¶ZW}yOàOyoQZ¶‚¶[s‘IhhIJggJJggJIggþ ÷þ£]÷´[¶¶þþ[Xr—´ûû´˜q Q\¶¶þþ\‹}ÿýâÆ "32654&7#"32†ÉÉŽÉǾ˜þÎÙ×þÎ/Ú`Tš_ÈŽÉÉŽÈ;™þPþÏ1°2ÓY}žÉ1"264&"3264#"54327&5432#"'&'3x©©ð©¨³ò¨¨yx©ü¾&þÿ·µþÿÿ·¹€Üÿ·¸þÿ·µ Ú©ð©©ð©Z©ð©©ðýäTdµþÿµ·€‰IU·þÿ·µþÿ Œ kÕ#5AMYer€š§µÅÙ3#"'%&547654'!#"'4%$53!76=332654&#"#"&54632'#"&54632#"&54632&'&67632#"&'&676'.547>'.76$6&'&54%6&'&6>#"'.54>32#"'.54÷ [$gþi< D"ûœ"D =þif%LñçùWèð‘«ì¥¨êé©§êrƒ^]ƒƒ]^ƒŸ !! !! Ñ.› .þ *)X,)ý¯,*))+þ. } Õ›¤ª™Œ+G  G+Œ™ª¤™þvK˜K9_þâþê_9K˜Kýݧêꧦìì¥]„„]_ƒƒÞ""""ýs!!""W&. - ýì. - a)," Ã"  ))  ì  !)þ” /    ‘ pÕ%-5AMYdp|ˆ”¦Êð5#!4'&'5#2#"&546"264"264"2647>'.7>'.676&'&>&'&7>'.%7>'.676&'&676&'&53!76=3%#"'676%27+%&547654'7327&'$%'#327%654'&547ì1ËÃÄÊ8þú¦å楣çæ¸¸¼. . . . þò - -Y - -ýü))G))ý«))U*)þ>- - ~- - V†áØùÉØá†þ©K;þŠ yA øøC0Bøø Ax þ‰;K'6FJ> ìþÇþ$06þ#þÇë >JF6&Â@Ž@1Añþe›ñA1@Ž@Hç£¤ææ¤£ç­¸€€¸ . .ýµ . .E - -ýÿ- ,1))Õ),(9)(©))þu- ,æ - - Gœ77Wþõþ6Ê W77œGå D&& ¥ËÇe‹‹eÇË¥ &&D "(=ˆ—pp—ˆ=("¸uÕ !!'!¾°úPnàÕú8Èhûø·vÕ "!!'!##+572367676½³úMoà‡L)þ¹>u eÍ¢—I3?b›aÕú8ÈhûøžA:þFþ½;/Iƒ¦t³»x·vÕ !!'!  ##' ½³úMoàû÷›—_þh˜[þeþi[—þiÕú8Èhûø†þi—[þeþf[—þl[š›š §@36273 ##'5ñ) UþÒ.WþÔþÒW1þÏ@þ ÞUþþS÷þ Vùõdõv#,5>~3+&=43+&=4%3+&=43+&=43+&=43+&=43+&=4%33 #&'&+"'&#"/573;2?"#'57#&'#"#5676!5Ö\:V\9\:÷\:]:&]9[\:ý«:¸+#9,–p!—ˆj[%+ > 7ÓVCÅCc":Àï8Ï #8dÏ#7ãÏ$6¹Ï$8;Î$7iÏ$7ëÏ #9špþPL  )Z. ;6ýŸZV Z3%Y63 .87€ÂÆp ˜“Ù 3DMy!674#!!6?676545&#'323276767654#3#&'&'454632767!672!&=75$/563&43!32+'!67#>54&53# û ?ô I :W0 96;E,Q 2:&l6xý0 bˆm! oþÛ¸½®±"\ü>%Eþfþ™~ýñþe2UÖÉ6g!6V#p5Cü+ C þ˜? P9 @´7H4XþÍÇm†M7RV /‚M(=H: ,qLUD)8ˆWqk±’e-Pexúó —NW =$ U  þ/0c›™)H?õ2@[nDF8T$.J?¬Ù !' !žTú4X—ýÍKóGýÏÙþwû´L†þ5ü_¡K¬Ð !'7›ŒWú4Z~Ðþwû¿D€ŸÔS&5476322632%632#"'&'#64'#"'&'&54654&'&54767632xØJX%&XA,B:\8 [ÇEMH95##Fl% !9@!#jLÏ p_’ÎMi#"?8" %lF##58HN4hok@RRr*%tþëe BB9'7*$%) "fXSþÝçò5EIþêf" )%#,7'9CB «˜>E3#"'4332327$'#"$4727%672567654&5&§oJ°7.˜b9M þúƒD† þ²ý™,B3 qY 5*Ä*]d=HN9%‡å ˜sW$,þðJ ® ]T-MMñm@eöd: ,'Z MÞ 'cM&T)$$ <þ¥ „Iµ¬ç2%!"&54676737#&'&54>;7!"&546767!7!"&54>3!6763!26ýP+=6ˆ/2´þÿD>Rý+>2,+v*>ç>+2  ,2 =,2  =,3>,¬ç2463!2!2#!!#!32#3#!¬>*v+,1>+ýR=Dþÿ³20‡6=+ýP#,>3,=  2,= 2,  2+>²Ô{"D%4&#!"!0#"3!!"3!#";#"3&'6737#&'6737!"'67!7!&'63!67!2I0!þŸ6üÙOSÿ þžSS: ÝSS®>SS]]J«]]äþÆ]]hý\\, Bv*>Kñ%39’LKIOKHLKIhghghghgE?-ü³“LÊ!D72654'6#"'4#"'54#"'54#"'675674767#%±$4:JILLHOKHLKIhghgighgD>-ü²sJ1 b6'SSý cRRþÄ ßSS®?SS\\K¬\\ä;\\þ–ý]]üÔ!AþŠ*>K›±Ó{!C%254+'3254+'!254#!'!24+!&#!"463!!2!!#!3#3ÁSS?®SSß *vA!,]]ýj\\þÅä\\¬K\\ñIKLHKOIKL’93%üëN-?Eghghghgi“ÿùLÂ!C32=732=7325732'654&#'%2&'&5&'5&'±IKLHKOHLLIJ:4$üëN->Dghgighgh³SS=®SSÝ þÆSSb ýSS'6a!0J)K>*þŠB üÔ\\üþ˜]]:ä]]«J]]}¯ØO€‹•¤³ºÁÖÜãçëïó÷ûÿ &*.26:> 3656;2#'7+"/#"'+"5&54775%"'5476;25'7&56%635&56;374765'75'76=4'&+ +"'4!#"'4543$365&5&#%#754'&5&&547'5367&547+&'&'735&2?"5%75537'7'3533553535'32767&5%2?&#%55'575775775§1’:e ,$?F?Yø>êF_LA3E¾L¬¯HÑ3,8LYLäþÐlEF'!0<… k#gþšF  ™EeYÄ!! Gà€p&þ­iq.8ZN$ÏË%`BCëf F4ùü"4._?ñeËe3&{E(1þõ-ÖÙ+$Kt8¿ - ‡ þ–$þÖÌGs ¥sM ýùrEF›"ºã2 >_ý£pÌØÁlTErf^5.>=9|5"-l)d ,&>vv]cccWpC-+ d•8 Bpp>W]oØæaþxvuPp82,ŽD¨ ^8, ^B$K»œ+ "1®R[+Òe*ñ;Ð 2 ››W Q—›Pþ‚ I&? gpëo% w ^SA$ Ÿ2 9i-5n02¢þ†Ç¿ Ai&®IY^P]D›%ˆ\??\OWC ,,1 /211/=;7777=321811{908hN%b\Dh,)h?Ì17I21!122223 21¬Ø&2%2#"'&=477654'#"'5473Bq4|ýl anN iü¡¡l‹m b üµ9 bØMOŠbý >YÑaYÆ®58Šl7P ÌP@ ª‚Ø$0<FX + &=6&# 3 6=%&#"';27!5%67%!&'&'2+"'&=476‰rþÃÂÔ þ„þúcR¹¦§þÔë~²ßUêYþ­þÔ¨Ñ082.Ôþà_þWÒ†_þV"+Ò}þIR8D).P9H'Øþ¯Öþ°ý“ƒ®²S„¬]þÙ±ÂþÄâŠZ–¦YàûHYoþ’X(I_ Û þ’‘°;.2lOþÏP%.G6R%&I8dÈØ)Nl>54'67&54&#"&'632.547#"'&'#"'3267654'7327323.#'654'567654&&5476;'&'%&+"#"8DH$$yU ?L[>!Wt…Jþ([Fho*Ám¦.2¤\=w\`|€UP7¸:/E" @7? EPþ¦¢]Eixà Òp·‚F@¶T5û†ym´,±"&e¿B@q¦€²‘(‹A _Ã% #+B7!þêN &".ËOý²S$ªXE/K(Aa]dLP*'FCaYr= CÙ44mo C‚þÿ ¶ “(FKœWYŽüF•¡vb‰ph´'UD˜'R< $ˆ“dÿüöÑ#+?Vmƒ¢­²·¼ÁÉÐÕÚßåíô#327&"#"'7'632&'$54#&73254'&#"'5&567#&''5$'67'654'6'5$'67'654$'67&'654'''5$56732#"'&#"&'$'63&47"7&'7&'7&'7&'54'6546767675477&545?&''5&#" '6%35&'.54>23#67!&#"W  OB7[l#> Ì Fþˆ_Vh "ï "®@.,=6tJþè€4V®¶p1EQJþ“qMiÎ v–h£ýþópHI£®!:¯½JJJþ Í=4m\8B*Ò®?o þv!"ºt,`—s&*_~P1>5='g=>24<+ý-s[,*&sd1PT>3J@='h<42åJ-H#*þõYT_Y)*)X^TYþõ*$D  ?>}>  *0üt"J. ™Œ ‰&b54CUE ''¤!`9 !,(MTE *!… }q~=/+)f[4f !B" <@0&9c?"V+€GoM“K~a„? }b‰9e\ P&0@k"?c*‰G€E‰JŽX ?„e}9‰ \«ÎÂ4 ¥\6 '''' 6\¥ ªNÙ(&'65&'67327&+!65+"3yyys{Åw Êʃ£µ®©³¤cþ¦c¨³©®µÞ±±ŽqXŸþñe¸óó·Xcþ÷6þ µ®®µô6 cªÿýˆÙ ,35'533#3!'#'5!5!5#53!5!5#!!-Ê·«}} ”þcˆ±††þk–v¤G þôGþõ @<<3ff¢X¯ý苜…þ›‚q°X¢üÏ»GccGª›J 326&#!2+73 ### 3(ÑttþŠvÎÔÔÎÑÚÜþg®Ûï¦þÛ·þnܧýØüŸßØÙÞþÍíþBþ(þúþéᵪ²×33#!!#'!'57!5#'5735׫¥¥$þÜ«þÞ"££×›”q˜ü‚~˜q”›ªÿý‚Õ+!#!573#'5!3!'573!#'73!#'5»¶ ;jjýÅ þJªýÄss<ªÕwýÑ¡þIžýÈjj8ž·¡/w²{Ø,32#' 3%+ &5%6323'#57'53œÝÒïþ©Ñ^Vˆœ ŠQ6þ‘¬>ѨA±©B¬ÕØ’6þÊž¹þ’ÖG2k >ÀéªîYþ3É~»||É~ªƒÙObs32732753"'#"'4323$4'5;+"'#"'53275'&'&5?5572%#&'&5%634%476=%ê@.!%,BE,#!-Q²2" $nÞàL/P¥uHED8ˆ32#"&546324&"26%! ! – Å’ÉþbþäþÞþ{±•ÆÊ=&*<<*(;ýE;R::R;åþKþÉþÊþJ¶67µøŽÁÏš˜þ{þɬ²Àž)::)*<<**<<*):<'þÊþL´67·þIÿÿª‚Õ&é'é†é ÿÿªƒÔ&é'é…ê ÿÿª‚Õ&é'ê…é ÿÿª‚Õ&é'ê…ê ÿÿª‚Õ&ê'é…é ÿÿª‚Õ&ê'é…ê ÿÿª‚Õ&ê'ê…é ÿÿª‚Õ&ê'ê…ê ‡ÿê¥á @FLRX^djp3264'&#"&47367'676756273#'#'5&'&'7&'677&'67'%%&'&'%6767%&'ô0/CB^0/AC/ýpkTcR|Â'N(¶‰OfUippqUfOж''NµŠQaQhû!$ Žb€)·dŒþ¯ËL÷Qýk þðK´ÌRþt!% cþ'¸d&„//^„000Ã'N'·|P_PfppoQ`Qy¹'N'°ƒP\ QgppmQ \Pyº,  Mª ÆNþ>&«`‚7" bþK*ŒVô&"¬g{‰ þðM¥ ÂMª‚Ø %1=! !  54 #&'&#"#46324632#"&%4632#"&ª¶67µþKþÉþÊþJ˜]î_þ¡þþ£·EASvwSAFÍ’‘ÍäD10EE01DþD10EE01Dê7·þIþÉþÊþL´6õþŸaõù]þ£ý“U@SS@U’ÌÌÉ1DD10EE01DD10EEª‚Ø %1=! !  54 3327673#"&4632#"&%4632#"&ª¶67µþKþÉþÊþJ˜]î_þ¡þþ£úF@SwvT@EÍ‘’ÍÙD10EE01DþD10EE01Dê7·þIþÉþÊþL´6õþŸaõù]þ£þñU@SS@U‘ÍÍŽ1DD10EE01DD10EEª‚Ø %1! !  5# '&'32654&#"32654&#"ª¶67µþKþÉþÊþJ;lWPiþØhQøV<=UU=È-1×\ ÄH0µe%½FýKSþ­wZþ¦G†r=øý´;÷=NN$‚E| 1† ?’'Øþ¡_œ>ÿ?îþ@Ç7µâ`½d¨@\´hþíPPPPþç‚y?ý+<þ>wþ¡_VG{?,rC‚AšÝƒ×+ +"'5$76%&'547327676=&#~‹jþt³°1/Q}›þ²ˆ]•(Éþ¯+VžéRþ¥£ž×þ‡­ÆþxþÿbO±Ê àP >ÅþþnèS˜ô]] =fªPØ+! &56;2'5$%75#"3¯þuþïiŒ³±1.Pþì~šNˆ]•(þ7P,VŸèSZ¤žy­ÆˆcO±ËþõþpáO >Åí‘èS–õ\^ þÂþüf¯ÿ0:Û1>7#'#53'&'&54767&'&=33676=3#326'&i($…„lØÜÊÊ“m……$(($…Ž[Uu&tU[Ž…$þ÷&uU[·‚·[UV$ƒ½¼|dÑdÊËbÑ e|¼½ƒ$%ƒ¼ ‚ZSSZ‚ ¼ƒ%_TYþüªªYT¯þÿ*Ú $4&#"326&5432!!##53&w衤ç礡èüá©PïìP§‰³þð¬ýýº¢¤ää¤£ØØëîïLþ´ïñš~þø|þÿ|¯þÿ*Ú $32654&#"%#"54767!5!33#b衤ç礡è©þ°ïìþ°§‰³þð¬ýýº7¤ää¤£ØØëîïþ´Lïñš~|þÿ|þø¯ÿõ¥Õ $&$76+"'&5'476!7!ôtþÆtsstEus ¨éí¦¦¨¦ÈpiþŒîþ˜d5s qtþºtrtt<ýÖ¤¤¥ëꧦg\Žþuþ¢lãèSר5264&#"#43233#!5 zª©{y«–¸»mã——ü«ò««y¹þü¹¨{Åú(|—ÀjØ#53533#632#4654&#"#*jj˜²²o˜²ïŒ—›onš˜—´´—þ}mþþ»Zåy„îH{©ªzþFø2Ø 1"32654'#"&4767!!53#5!!3!!#3!!ÍpOO87O:=0L˜mk™L/>þàþΛ›2 — 1™™þÏþàŒO79NN97Â0LØ™™ØL1ŒþK—Ó˜þJ¶þJ¶˜ý-—µ'Ø<%#5#535&'&'5'73'3#'73'676=35'73'33â—°°¥z–‘˜hNg‘’—‘‘eMj‘˜–z¥¯»»»—‹z–×TŽŒ™™ŒŽT—hOÊ‹šš‹ý7Nj–YŽŒ™™ŒŽYÓ–y‹—ì?Ø! #!!!'!27674'&#ô™.d û;6þªzüý‘F‚H¢%QØÐM_þö\ý­‚ǃþ$‚P¤<]ÎÚ$!#"#&5463 67!2#654&#"Vþâ©"T†]£’tƒ„s“¢]†U"‚¨þâXÅ"€€„¡„»üû1((1»„¡„€"Äüûý¨·uØ." 6&'67>3"#"54767&'&#52•“ÎÎ&ÏÍ•ƒLVa¡¹{§ƒ.+’þÙÓÐþØ”)0«z¹ºHUM\ÏþÚÎÎ&Ï–=B´®lþÈl)•ÒÑþÙ'ÑÒ•*l8l®´B=ÀjÚ&'5 %$ 56?63#'¨ª[øW°¦¦°þ©ýþ¥ª¨˜tuétuéü4”ZZ—/ûâ/˜[[”5  ç@Eo&<"3264,'532'&54632264&" &$#"#"&547>B¾„„_^…þ^þÈþ”™ýl;‚ƒÍ“•ÎhIöý«^……¼†…9l™ýþ–:…ƒÍ“•ÎhIõ¸„¾……¾þ (+|Tl§“ÏÏþÚgML¶„¾„„¾„x)+{Tl¦”ÏÏ”’gMM ØM>54'.#"32463227#"&5454&#"#"&'&54767632254&”K2q'$#K1o'#0ß´¬ÚþÞ†GdAoc¤„–.% 3t88<­/3u77LJMŒq'##K2o'#$L1ð¡Éݰ»þ ´|XHwyoÇᆥ›<‘>b€WDs-Kx68<32>32#&'567'45'#&+"#4'3>$4&+"¨?w(ÆK>R0ƒD32>32gYYËËYËD,.:…?—#)³•˜Žv$·E?w(ÆK>Ro}v­¯vxJvÙÈüašAjâ×ütA¾¿O°]¼Æ€wϧÛÊý„©ƒØ!5!3##'!5!~ýÒ2˜þÿ˜üÃk<ýÒÆ@˜iý80þÿý80üÃk<˜ÀjØ)127632#"'#576&#"4'5267>327&'"SkQmÃy™Ž›z,~Ѝšzi2@:$šž„“¡(.-)zW]‚¡ Ÿ˜Øüžݾg‘«… ×vxþ-ÃýðaÞþíÉX[–ü&‘Ű9{¢'Q32263227632&#""'&#"#"'&#"#'3232762327632&#"#"'&#"#"'&"#'°Es- p¬86rV+)|m^?_354.#"!&'.54>325467675#53533#63232>54.#"P#3Jœ“TRJWVJQS“OMJ4"þ?õü¹*&ElnÆhPL$ llill %LOhÆnlD')ýÖ----Ç+)Q•PQ’((’QP•Q)+ý¸þÑ/þ 6ÄklÅj$?6FWWF6?$jÅlkÄ6 þ}++--âJØHNRh|¥»&'4>32"'4>32&'4>32&54>32&54>32#!5!'!567>54.#"32767>4.#"327732>4.#"327>54.#"732>54.#"M_ 669ï4S55.½+C55C&¹.66 V\+55 c ü£$µþ•·×üÿMç##$ 6ˆ»$#$­s`%#$þšd0"%)h¦ #"#û_33@þ¾]22-"ý40446üÊä/*33UýJ"+33^þ1ýÑ/þßáK=Ó0¤¤T* ####ýø ù #&$$&#ýÑ#&$$&# ý B #### üÚ*ê"$$" UÿþÖÖ!'-2!35!#3!53573#'5#5!35!75!!5'57!«s\\sûs]]s ª—ûîJRüÚRIJý~Ö››¢–ý·•££˜E—¢›úû77êƒ__ƒývt€€t4!ýݶvØ7CQ^&54767&'&'5676767&'&54>32! 535#5##3654."!2>4.#"Ë  <$))+N-N*)N-M,**%:  ü@ ¬¬v¬¬¢<-MTM-?ÞŠþK5:664”59<5&?HPPIK* ')+K**K+)' *KIPPH>&5<:6þu”N|l||l|þ²-I+N))N+@6þ¬:55:5QÛØ)5>o654&547!&54='&'654'67.5476;+"'5#"=6&'76767%25#654&'Fzê-ü6 ŠZ8.ž ,‹N0H!h6¢%`+EH )Ø#M ;,Jga#‡iR þ‚ k'þ Mè +1^hgþ½üo8: (@sŽ.PùÀmz nxþë?.#1þp#41§`&>%!ac,,ÅÀLHJ ­xþì}647| + OJJ)!0ÿÿû× P[32>4.#"32>54.#"!5&54767&'&546767&'&4>32'&'.#"¿:e79e89f76e`[ûÙS ¥’&(*UM,N)(N-KV)&&“¦ \@Eõ€õCAÁpd88dpg66ú»9: %N&KRS—* 'TM**MT' *—SRK&NþÛ :9„}qyƒƒyq}ÉcØ $TdhyŠ67&'&"!3!67>54.#"!&'.54>325467675#53533#63232>54.#"!57!&'.54>3234'67632!P#3Jœ“TRJWVJQS“OMJ4"þ?õü¹*&ElnÆhPL$ llill %LOhÆnlD')ýÖ----¤ýsÎþè=BDw@>=)ñ)==AwDB=þéÇ+)Q•PQ’((’QP•Q)+ý¸þÑ/þ 6ÄklÅj$?6FWWF6?$jÅlkÄ6 þ}++--ü¶ÈÈÎ !yCB{C!$$!C{BCy! âJØHLP&'4>32"'4>32&'4>32&54>32&54>32#!5!5!M_ 669ï4S55.½+C55C&¹.66 V\+55 c ü£$ý)×ý)û_33@þ¾]22-"ý40446üÊä/*33UýJ"+33^þ1ýÑ/ËNNþÖOOUÿþÖÖ%)5!5!!35!#3!53573#'5#5!35!Öý€Êüìü«s\\sûs]]s ª—ûî„^^ü/oo#››¢–ý·•££˜E—¢›úû77¶vØ4@4767&'&'5676767&'&54>32!&535#5##3¬  <$))+N-N*)N-M,**%:  ü@%¬¬v¬¬<5&?HPPIK* ')+K**K+)' *KIPPH>&5<:6þn”5|l||l|LàØ3?HN654&5473#!&5454'+#"#7&'654'67654&547;2547#";65'"3%:U"-ü6 •Bu Zg0krX0c-h8ªE+`%s H>É4wM-æ'9.QY / þ¬üo8: q§’hPSå¾mh #%Bzÿ1"0@þ)5"@YþóýR0ÿÿû×.&54767&'&546767&'&4>32; ¥’&(*UM,N)(N-KV)&&“¦ 9: %N&KRS—* 'TM**MT' *—SRK&NþÛ :9CèÔ##"'##56'##"/547?˜^Øí'¢5@š_*S×U&/U»L »;YÔ§þìþê9UP(§`Ý þå–—X…ÑI.·Ë‚¥¹sÑ222732#&547636=4'&# #4'&#"*Út pëÑz&Ýþ=<ý xÇQåÐÛ>h½G:þøV He½®k%ÑþíPF5ÓNP þþçýÙBí²¶Ò|-þÛäý¼»¡—&¬pþA&NÑà±FXÒÔ &&5 –<ýãþF:þþ^Ôýý;" €V –ýgýdœäGÔ7236;2"##'65##"'&5476;235&'&=476—Öe x<JTî`Ñ(GòeRÐUdõ¿föB3 VNT<×GÔã48u <ÊB<Íh  þ©m€MþëÉD:éS GEnQÉhBêÕ"<B+"'##56#+"'&575477;2732;276=4'3&'"—~Vµ"0‘b*S×V*8Ui QÎ"_|þ®Q ”)w`·Sg‰A ËæŽ? Õáþ6‹†ÑNÚ þè›—#eu®B? ÈÔgIÇþo‚…»5 ÚF”§(°ÏûpZR¶wÔ2367632#&5476(Ët*#\l‡Ñ~ ÐýïýΨÇTÔë]1¢klàSIúãý…±ÍÚÓ|-XÒÔ &47–÷EýÄ ýÎoÔýsU ýÝŠäHÜ2`g26;2"##'65##"'&5476;2&'5476&+"326733276=4/#"567654'&#"35&5›Ëhr=)ø\Ò"IñfRÑUdöÀg÷C3&=cØGð© kv ó=ˆ=NÒr%SZž¨U ý6vk »6)¸S<ÜÎF9„¦×8:Ód  þ§m€OþèËE:ëR p±&Ëiþ³›Ì  ÔC”]&'Ax†…¾.+Þ0 ‰nM,¶WÈûÎ`cØÿþTÔ!1M3#&'&'0546%3#&'&'45463#&'&'546 $&54673 $64'&'v ‘Ì £0¥A ’Í ¢1¦Y ’Í £1¦,¨¾¹þ±þ”þ±¹½¨ƒKV§.J/¦VLƒ9?›c‚yɦt3Zrˆí`í—Å»þÎû²N‹ ±Ñ[OÄ}¡šýБBr‘­þ1±a`°bb°`a±1)EM¨˜UU˜¨ME)¬ÿö·Õ3#"/4?23hHÄ0#ÔÓ!cZÕúý£-…‚@Ô¬ÿöoÕ3#'654'&'#"54732XW­ðz=ä\à9òÔ`YÕ'6?FŠ’` 1TFG*ûÖ™-¨ƒ@Öxÿ/³Õ#"=4?2%#"=4?2ý³À6Õ±'VQýÜ–Cت+YPÕÊúí›*¤~: ©ûÛ‰8›z"CÓ¼ÿöoÕ"'4723!# 5472!5kþûéémOü¥òþþìdXX[ÕûÕ¤Š;•ýZÏ$±}@áÏœœµÿú"Ù 3363'$654'"»-ª‘ãý³8¢•wÙü?íþÿþWXÖûÔþc1 ”¬0Ù 3%#'#3%#±)N(þ¯4Ùþ/¡ûcå Šý™þ}­4Ù(,377#'#'547#5773%%‡.wwzy.þà** þà ÙþÐ<<þ‹7‡Cþ׌þ¦A<Ž<{8‹Aþú†Mý–þ‡‹t¬PÙH#0#"#"'5654'5673;54'56732733273+&+#&"#&'565¶¨³P8 cc 9Sµ§ƒ:-Œ-:ƒ£µS8!cc 7P³¤ƒ:-Œ-:ƒZ#;17F-:ƒ¯µS8!cc!8Sµ¯ƒ:-F71;#ZþRµS9 cc 9Sµ„œÙ ;G7567&'&'3#6737'#&'7#&'6735'67#3335#5;0/_í^//þ†,/,-D--C-,.-äÐ zz Ðä~jihh~äÐ zz Ðä~hihj~ntt6tt´-.,-C..C.,.-n//_üR_//÷~ijhh~þNÐ yy в~hiii~ÖÑ zz ÑsŸ.þ€€.Ÿ ¬¬#.6CMhwŒ—¦¯!2732!'5675'&=32#$'57637&/&+"+&532?4/%32#'#&&=4?#'57335'3!273+#='!"/547354;2?!&=!(‹:Mb­þ¤R».qp7°þÓž,ÊÊ_qýð >MT,›•P$’ ´6œ…6$0_äý u3d´­Ud€tœÈ_}s*$Ä"ìRþÖt0XX__ç/iþký¸=Z¬G†8þÔ*F €1 þƬ.þ­ Å þÑŠfþõþï)MC =þêg9E¢k×O 9þË!(-ƒ);& Æ þ]¬þÔt!þ±y" ³þ¥†& 2| ¬ªb³a$ U+œ Ù #8M35733!&54?'7'327!!"'&%#'7367654'77'7'&#"'676Õ«ºÊ«þýó,&T>ë=c#]–þK9.‹U¯§ÒÒÆ:1ʈó%üæ©`T?ê7>54&#"5>32&54?'7'327!!"'&%#'7367654'77'7'&#"'676]Týñ@Í1$Jë=c#]–þK9.‹U¯§ÒÒÆ:1ʈó%üæ©`T?ê32&54?'7'327!!"'&%#'7367654'77'7'&#"'676Z _­3lFHe5^\VOosHGJI)`VKm1šSüj,&T>ë=c#]–þK9.‹U¯§ÒÒÆ:1ʈó%üæ©`T?êë=c#]–þK9.‹U¯§ÒÒÆ:1ʈó%üæ©`T?êë=c#]–þK9.‹U¯§ÒÒÆ:1ʈó%üæ©`T?êë=c#]–þK9.‹U¯§ÒÒÆ:1ʈó%üæ©`T?êë=c#]–þK9.‹U¯§ÒÒÆ:1ʈó%üæ©`T?êë=c#]–þK9.‹U¯§ÒÒÆ:1ʈó%üæ©`T?ê32#"&–¼eËÅþ›þ|þ›ÅÉeþ(®<X<®³þħ¨þñ“"32#"&$2#".46–¼eËÅþ›þ|þ›ÅÉeþ(®<X<®³þħ¨þñ“"@<#"4.#"–¼eËÅþ›þ|þ›ÅÉe:<#"< !<"#;ÙÁþ˜þzþÆÆc†hÁü– =B4.#"$32>4."–¼eËÅþ›þ|þ›ÅÉe:<#"< !<"#;ü¥"< !<"#<@;ÙÁþ˜þzþÆÆc†hÁü– =B54.#"##"'5##"$'&'0!5!5&'.4>32!!676767'%''H&(G()G'%H(ã%'©þËV W3WI„muþ‰w>DE}AB|GE=mþ“d^„JW4W V›sÖ'H''H'(H''Húò`XAK|@X1(Ô3"|ˆ}DD}ˆ|" 2ý/ "1X@|þµAX1# Ö/ 673&/'67 &'"&'6?&'3 ' âK[]œ><+Gg['fBôòBe&\hœ?(K?œ]\Kýã ˆŠ!½þÐ;32T $ù #µ¤ACÅþâ«,þí¶ÅMMMþv ÕA5p_9D-ïþ–þãM**¤  û”B@0"@R//>wA·&oc/D&3.YaQ/5"1'"þ´þuŠE62/uŠ= =!m- .... yÿì²Û 7%  %  32+#".=!"&'&'#&=4;7337_þìþì‹ý%þíþìŠ Ö8)Â0/­_^«^ýM^¬¼­1/Ì 9×53üü4í<üÄ&&<üÄ&Ñ*(üÇD>?GGzB6üÊC{GG?>D9/››Cþ½›}®Û&632#"&'.#"'#!#!#Ò¸ž62ÉK#+~KF0R!9'/N£Çxåí_TþâŠþãV_‡T '¦NQ9;:#8³HL"CþßD™ý|ý¦×þ)×þ)Z)Û 532>4.#";267#&=&$32735&'.4>2æ2[02[24Z1/[»–á­þ)'5*+þXÇë A54.#"%2#".54>''#/'7''7''7/5?'77'77'7?3777'†Œû‰ŠûŒü…†üŽ'H)(H('H((I\Hs=]SH$e$HR^323#67#&"#"/&'&547&#""'6%676V ón*[‘n%'ZxL0<{2;&b;0&8a>!U*~EmL‘K}`? {aˆ7c[ O&0>j!>a)†E~CˆK‘W‹ ={d{7ˆ [+M57LL75M-Z '*''*' Y (€5[£ J5( üÖ\d (5J £[4Œ ''Ó/7O_Ÿ«³»ËÓÛãï2#".54>&'32367&%2327654'&''67&'&'&'676765467654'&#"7>326323#"'##"'&'#"&'&54767&'&54767232&'&#"6&%6767&'&'&#"676&5467&'&6732767&–$$$$áOG3%V c˜â™c V%4GL944m/122102/.303112.OF}6&V eý´"w?>v"¤pt #8ˆŠ7! vn¤":;@A<:"¢nx !6Šˆ6# sp%./13/.UVT\<>"$!!þ• !"#">k•c V &6|FO 93399 <>#"#Ö><  "$ZTU./43..V5$##$Ù59gT;&'9Z^^Z9'':Tg9§'(''&()I8:9889: Z_59eU;'( ³ÀÀ³:8.>euvc>-7:°bccb°;7-?cwud?/8K¢WZZW¢ **D@@D+8(':Te95^&)(&''(ÖDA:AD.*!žY[[Yž!&Ö !-x†”67&'67&'4&6%67.'%4'6&#"&'6767&54?67&'&#"#&'#&'5&'"'67&'&47632>4.#"%2#".4>Î'7,3 3%/0þÜ),7ß=*#þ×0*+3.22'þ÷8  Yf·©T,1'¥¤').U¨¸fY >98 "2 B2;F_ XB?2C 3" 894i¼hg¼ik¾ce½"SŸ[XŸVWŸXZŸ„£§#eªjpÍMcNTvJKrZ1VlLWMI ©p jª…k%§nA V{ww[1‡ôô‡1[ ww{V @#fÜd-#JM 7B/"‰‰"0C7 NK",dÜf#ˆÎ½hh½Î¿ggQU ®XX® UdÈÔ %3!'#!52#"62#".54>Ÿ"ù­ ýh9ý|M463%&$$Ôú5 ª›ûO ÂDý›n;ý $$$$ªôØ33'554#$/ÑýŽ[ƒüQ‡wþ“ØýâGSGýUW GJG¯þÿXÚ .5CK&5432632!!#!##53&4&#"326!&&#"327&54654'X©Pï™}}›ìP§‰³þð¬þ~¬ýýºÄè¡C;Œ„7?¡èý_Xe‚jõ;A¤çç¤>7†'sssîïLFFþ´ïñš~þø|þÿþÿ|¤äžÚבØþ¼- þø Š䤣Ø”ÔÛþl¢£rr£¢¯þq)Õ-5DL&'&6767&'"'&'&'&5'476!7!! 76'&'&'6'&ôuœtss-5 œ—Êá¨ëí¦l&‡k¦¨¦ääpiþŒî„þ˜dþ˜=pDiûê/tEust,2—œ}tsŸ5sqtþºt-Ô›—1ü ¥¤k‰&i¥ëꧦ g\Žþ}þuþ¢läç  þ¢An?\ü27/rttžs,Í“™}šqt£¢þƒÉÐ)8GO'"'!!##53&'&54326!7!&'&36'&&5'47&#"327674'¡¨ë U`þð¬ýýº‰©Pïš}z“äpiþŒîþ˜dþÒuœ>7‹;C¥æüË‚Œ;C¤çç¤>Òxts”¥K) þø|þÿ|€îïLGD g\Žþuþ¢läçûsÚà”èžýþ™ÐÕž䤣Øhk¨¤rr¥£¯þƒ²Ø .4&#"326&54762!7!!!##53&w衤ç礡èüᩨ±æÁ”hþŒîþ™n ‹¸þð¬ýý½&¤ää¤£ØØëî羚 o[ŽþŽtþ¤‚Ñê‡ý|þÿ|ÿ ÿãÐô+D#"'&'&'&47>76327'7'%'27>764'&'."(F3"D"&%#}bV`ZZ^;D"&&$ƒ[X]:3Gþ9þ†á:ÎÀ‹]†þ:ýF=~=HS]³^X‚&% «iŠiD^‹¿þ29áþ½i‹üü\=<€<92-1X?:„<91*Ïþ£î=X62'%'!!#5!5!5&'&'.546767''7'''7"2767>54&'&'&î4p6³â9ÎÀŒ]³.(EGGE@Z-<þí–þí81VDEGFF'1þ9þT]ŒÀÎ9âTþ:þŠG5>+.11./:9Š5>+.11./:9‡ ž\Š¿þ2:âþa(E«b_«E@( ¸–ðð–¸ %CE«_b©G(HiŠjËâ:οŠ\ËiŠjÓ+.wBAw./+.wABw./€ÿã4ô+F!!#"'&'.546767675!5!' 2767>54&'&'&"¥þí<-Z@EGGEDVRbfNZ@EGGEDV18þí¬kbbjøC9:/.11.+>5Š9:/.11.+>5Õþç–‘ (@E«_b«EC%##(@E«b_«EC% ‘–­kaþŸjûP/.wBAw.+/.wABw.+ ¡Ä+F####"&'&'&54767>32333'7 '%32676764'&'.#"‚Ü–U (@E«_b«EC%##(@E«b_«EC% U–Ü­kaþŸjûÉ/.wBAw.+/.wABw.+Ÿþí<-Z@EGGEDVRbfNZ@EGGEDV18þí¬kþžþžjøC9:/.11.+>5Š9:/.11.+>55Å @  ÜìÔìÄ1ÔìÔì0432#"732654&#"ÄÄþéÄÄþ陽……½½……½ëÄþêÄÅþêÂ…½½…†½½5Å @  ÜÔÌ1ÔÄ0432#"ÄÄþéÄÄþéëÄþêÄÅþêúºK +@kk k kÜìÔK°TX¹ÿÀ8YìÄ1ÔìÔì04632#"&732654&#"úÏ‘‘ÏÏ‘‘ϘuSSuuSSuì’ÍÍ’‘ÎÎSuuSSvvdPK!)7eK° RX@ *.,&"($ k3,k($kk8ÔìÔìÔìÔì991@&"6k0k 8Ô<ì2Ô<ì299990Y4632632#"'#"&7323&547&#"%6547232654&#"dÏ‘RDDR‘ÏÏ‘RDDR‘ϘuS?>Su^222Z>?SuuSì’Í Í’‘Î!!ÎSuXqpWv28ML88LM{WpqXuSSvTZ`z8Rm3#"2767>54&'&/2"'&'.5467676"2767>54&'&/2"'&'.5467676––R#)$#R#$ $LK:C.25521@=“:C.25521@=ýR#)$#R#$ $LK:C.25521@=“:C.25521@=züàZF)(JG()K¥.2IF21.2FI21–F)(JG()K¥.2IF21.2FI21 ªJ7Qk>767632"'&'.'!"'&'.546767632$"2767>54&'&'$"2767>54&'&'÷#61@=HK:C.25521@=“:C.5%þÅ'21@=“:C.25521@=HK:C.6#¹R#$$#R#$$û÷R#)$#R#$ $5[51.2IF21.4`]21.2FI21.5[F)(GG()FF)(JG()KÒæR 5%%%xüÌÜÜþŽrÊü6þŽ׊eMºM^‚xþ„x‚±V–)7654'&'575#!&54767'5!s_vR$N:È:N$Rv_£þì¤{aT,X@X,Ta{´ß4b\)1¢%==%¢1)\b4ß´»:ê`¾\KDúúDK\¾`ê¯þÿ*Ú 4&#"326&'&5432#w衤ç礡èþ$º‰©PïìP§‰³¬¢¤ää¤£ØØþ…€îïLþ´ïñš~ý{…lPj…'#"'&#"'&'&'&47>7632327>76&'&'&/&'&'&47>762!2!%327>764'&'.#"&#"327>764'&'&ÍÖs®* 0$+$$$ 1#*# ZaZ%% NT12 4 #HH  ")mR‹èOeýbÕü  , 0  +  …Í ) . $J . %'.D"&B 1 $C mR )KÏy   µ !   V!Eµdz267>54&'."#"'%"'&'.5467676;27>4.'&+"'&'.54676762%632$"267>54&'&ý.&&.&m,mQÛþ‘j–P(!N!"(! aVf&&bZ55!("!N!(P–joÛQm,úæ.&&.&q    lü?W’,>&#< A#"< " (( " <"#A <#&>,’W?~    ÀlOOj…3!#!"'.'&47676?6767>'.'&#"#"'.'&47>763276;%32676764'.'&#"676764'.'&#"32ÍÖÕžeOèþuRd2!  HH# 7   ZTN +Za21#+$0 4$$$+$0 '±sý¹  *   * OÏK) Rd#!>& 3"9*$"D. ' - D! 2 . , T% #ý: & (  Iô˜èZx–´Òþ-4H67&'&'&+"'&'&'&476767632%632 #"'%#"'&'&'&54767676;276276767654'&'&'&"276767654'&'&'&""'&'&'&547676762"'&'&'&547676762'&'&'&547654'&'&'&";276-&#"+"276767654'&5476%327%&"'&'&476762I  Q\C--%("(/*0.,+"( /ŽX]â\ˆ9þþ<…\âþ£XŽ/"$)0*3')"* %1*0CR[þë        22 2 2 2 †%•'   &J  &%C\d#½í_*]OÙþ‘”hXC%&  J&   “ÙO]*ýÝÙ    Ù   ")&`&"'$"/' <%‹ZS  ÏÏ % SZ‹%< /'* "%5"-($# þÒ;ý‚8\= !  !  " þòÂ÷/V’C "  !  !  [uV/á+    Vÿã^ðau‡ 767>54&'&'&#"&54767632 '.5467&54732#"#"676767#"'&#"'67654 ozwbda_f_zxІ|wbdaM,krnulŒœšŽ†spsnun‹þÇŠ*D$ lµ©Q$" 6*D?"5'K(2- # ž>   :72 331cdíˆèi`4331cd퇼>˜mœwn<;;8roþ졘þðwp:;;BV0/MÍï8:D@*|sa  -F(7 "*=8&0!2  1-5$& 6:B4Vÿã^ð (B\w.'%&'&"632%6767>54$2"'&'.546767" 767>54&'&'&'2 '&'&547676©?'*&$ 1ó$-+h+-$F3782ˆ**?þ’1 $&þç>>9†|wbdabc`òzwbda_f_zxŠšŽ†spsnun‹þËŽ†spsnulŒwI_ý"2[$  £""ƒ þ ýgIƒ $[2!v 55 55 31cdí…ñcaf31cdíˆèi`43d;8roþ졘þðwp:;;8roœwn<;x,Aª-57'36%33#3#!2#!3#3##$'#7”$@d’’5«{s”Vdš]˜F0 0Fþø˜]šdV”s{«5þâ’’d@×(ÚÉ j–P‚PÆ,ÆP‚P–` ÉÚ„Ü0ù ")- !676762!"'&'&'&54!ö¸ûX¸$#R#+/®þRþŸþF¨þF$#R#$1þS­ýò¬h,þÔ  ªþÞþÝkþÓ-ª"ýs!ýßûã³}ïPÐãó476?6763&'&'&547632676767654'&547632!54'&'&54'&&#"'&/&'&'&#"#"'&'&/&'&#"&'&'&?6'&'#"'&'&#"!'476='654'&545454'327654'&'&327654'&/³%4-)"$0JK&  )7   ýß %0‡'# #6 +-L _ˆ_^/s4* 1( .266 |/(1   \«   ýþ#:7  l€S&   xë71]/~[#<$  o»_%@,†: $";vRþÔ $X$+|‰‰¶!5DX&PY;¶9Do6 b'n•2  83þeF] 4T&  &  /50$?- 1@& 3l K  C"P1Ö Ÿ·:03<D:5XI.)D&þ[+-1:   q/A8   g+©jl9Lp{‰7654'"'&#"+"'&54?67676763276323273#5%6767'&#"6"/67#"27632327654'73654'676547&Øp/l0&–J!cS%YþøE]{@C"$4>™-;% ¾Ì,(6áY>ømü¼!N$Xì6"/,(«4òsS?X$U>"sJ?K(`./4‰+2K2.ž0>ü°S ¢Zp0+þ 1^ð' þÇ;cs  /è^"|Y/ 4«28Û‡ƒ´Ï•l%é%oté5oA='Y$ a…£T* ''G+- %_kj~r}jL`І|ï\gÃK@/.85–c($¶šË¯ (2LS>54/##326?%%3254'654'3>7632#"&547>32'% ;66Ií ü€™ ’™ ƒ }¸ýgý„½ ?ý¤6ýûqýn   -> 9@ îH67; ù˜’ ˜’zýƒýh¸| ýó8 >ü¶6!qýúê    ôýÂB5–Ž>%+?F4&'&/76765'7! !'!654'!4'!!$467>2"&'&!654'£ Ò33Ò û¦^^^¯¯RXý¨ü®¯I´#ýJ2ýVªülÅPú#Þ ~!88!~ KØppØphÈþ¬þ¬È,þÄp <(##(#id¶šË¯ (2LS.#"227654&'''%'654+.#"65.'&54632#"'.6#"%  íI66; üo’ ™’ ¨Æ|™¸ýƒ>?%6!ýûqý   9 ý ;76Hî ý ’˜ ’ÕÆ |¸ýhýƒì> 8ˆ6ýúqým    BýÂX{[%G'23 %%.'&"27>7%$!"#232%"'&'.4676762%#"#Š2%ký¿      Aý•ýéþÛ™±·þœ>>dþIýñ±ID`nþíS   SþínGŠYn¹ 5>5 ¹nŠ­)(%$#"#64'232%%&'&'&"27676è&ý•ýìø22økýÚ**Å!þín`à`nþí!##3ÆW 2327632#"'&'&5476Å'( ï>‡ !þ~þ¶GH ".4F+Ž@xÂH )þ0ýü$Š™'*'í²Å 23277632#"'&'&54763Å'( ïe` ý}{*˜279HF`0@x¯JýÞL ²†1 ,”±A  ' 7 çÉŽþ8þ7ŽÉþ7ŽÉÉŽêþ7Éþ7ÉÉþ8ɯ?– ‘tþÉþŒþŒþÉtþŒ7tt7êþŒþÉtþŒ7tt7þŒuþÉñÿîœÜB2632#"'&'#"'&54767'&54763267632676ø ÐÄQ   x€¬Þ L$3 Ìäz(   6XŽÌÜ3âþñÆï  šÐàþŠ6*=P*> "#  ¨˜¸ÌüêR26#"'#"'&'+"'&'#"'&547&'&54767&&5476326763276T ñë””% $$YyæX$ ‚Äzc0 + j–çù ê:  (ÛþÇÌ¢1#: _¿þû‡$ #- °Ô½ =1 '2ĺÚ pDÕ #!!!!!%!!!!!!!!#!5!36þHþVª¸ªþ¦¾þBý¨þB¾XȾþBÈþB¾ÈÆ«þUþHþVª¸Pý¨þB¾X¿ýyÈþB¾È¿pDÕ !!!!!!""ýÞþpýÞ"²þpýÞ"#pDÕ35#7!!#!5!3ãîîïrýŽðýŽrðsîðýŽrðspDÕ!!%!!!!!!“Žþr"ýÞþpýÞ"#ŽþpýÞ"#RbÕ !!#!5!3ÒþpðþpðEðü«Uð lÕ3!!'#'!!#!!3!5@––þÔþŽ–––,r–ÈÜþÔ,Ü,©–þŽý_– –r,–ú,þÔÜý_¡Ü>vÕ #!!!!!'!!!!!!!!#!5!3þ˜þèhÈþèýøþè þèÈþèÈmþèþ„ý_¡|Pýäý_¡þHÜý_¡ÜpDÕK#";54&'&'&#'!326767657'&'&'.+3!76767>5{d³IB,$2$*DE³h{LGC_RQ|66R_CIJ{h³ED*$2$,BF¶d{LGC_RQû„66R_CIJ KIB`OT|87O\FGKzd¶GB+%2%+BI´dzKGF\OTû„87O`BHL{d¶GB+%2%+BI´d»ÿåùó  #!! !!! 373#'7#Zà¿ààþAààþAàà¿:¦¦L¦¦¦lØ­mllmÙþzØlþçmllmÙóþ|þ}þ}þ|„ƒƒdþáþà »d»»þ}¼c¼¼¼„»Tÿã`ðC54'&54762327632#"'&+"'&5476=#"#"'&476323(L,68x86,L ºzFvd0000dvFzº L,68x86,L ºzFvd0000dvFzº ºzFvd0000dvFzº L,68x86,L »yFvd0110dvFy» L,68x86,LVÿç^ðƒ&'##"&'&'&4767>32367675&'&'.5467676236767>32#"&'&'&'#"'&'.546767675& Ô  R.-R  R-.R " Ô *!""! ((\(( !""!#%  Ô " R.-R  R-.R  Ô  %#!""! ((\(( !""!*“*!""! ((\(( !""!#%  Õ  R.-R  R-.R " Õ  %#!""! ((\(( !""!* Ô " R.-R  R-.R  Ô Sÿãaðƒ4&'&'&'.546767622676767>32#"&'&'&'.#"'&'.54676767>5"#"&'&'&4767>32(,$ ((*& :.r06$&**& )'De!  'd8:b&$$&b:8d'  )a@/!  ')*&$6/r/6$&*)'  ')?c'  &d8:b&!$&b:=_& (bCc"  &d8:b& $&b:=_& (a?/!  ')*&$6/r/6$&*)'  ')De!  'd8:b&$$&b:8d'  )a@)' ((*& :.r06$&**& ((Tÿå`ò0267632#"'&'&'!&'&'&54676763267632#"'&'#"'&'&'&5476767!6767632#"'&'"'&'&'&54767#"'&'&'&5476767632!#"'&'&'&54767#"'&'&'&476767632&'&5476767632!#"'.'&5476767632&'&54767676Z   ( &        þÛ    <   4 þÛ         % (   ò   (  þÛ 2     6  þÚ         %    <    %  (   Wÿã_õ2767653"4'&'&W›†spsnulŒœœŒlunsps†ì;8ro¡þðwn<;;¬¢þ²þj¢¬þ>-¬¢›œý'†þO^†__†^þOqþ¸ýï4óþÙ4H4þ"hþdÿþdÿÿœÿ„0Õ!% %!-º@– þj– þjþÀþj •þk Õþ*ëþëêëþëëþ*Öëëê˜Õ37'73 #'ãxxîxxþ™þ.xÒðÒxþ.Òxþ.ðþ.x¹ÎÐÐÎÎ ÐþòýåÐþóþòÐ ýæþóÐpDÕ #'!5!73!Ô¹GþFdþFGºýrþEGºdºGþEr¸þFG»ýŽqþFGºd»GþFqýºGþEd@ÿãLð     - FOÔþFýºcþ,OOþ,cýºFþÔðý¹dþ,POþ,dý¹GþœÔOPÔþœ Tÿã`ð '%%%%%% % -õþÝwDþÛþáš{þáwwþe#wý¼%þf{wwŸ„¤‡þy¤þ|ŸŸþ|¤þy‡¤„…{þàxxþe#wý¼%þf{wwœþÝxEþÛþàþy¤þ| Ÿþ|¤þy‡¤„Ÿ „¤»ÿãùð % %  Zp/þA¿ýÑppýÑ¿þA/ðý¼Áþ}þ}Áý»EÁƒƒÁTÿã`ð     - Zq²þïôþ þNqqþNþ ôþï²ðþ þNrqþNþ õþî²qr²þîTÿã`ð% % -Zªy‰lþ”‰þ‡ªªþ‡‰þ”l‰yðþ”‰þ‡«ªþ‡‰þ”l‰yª«y‰Tÿã`ð%% %% -ZtGcïVþªïþGþñttþñGþïþªVïcGðþ©ïþGþñstþñGþïþ©WïcGtsGcïpDÕ/3%!!%#'''%!5!%777xªoª:UþÅœ.þc¾þF™.þd;UþÇ©oªxªoªþÆU:þe.šþE¾þc.™þÈU9©o¾þE™.þf:UþÅ«o«xªo¬þÄU9þg.˜þF¼þf.›þÅU:ªoªx«o©9UþÇ™.§ÿã ð›54'&5476276767632+"#"32;2#"'&'&/"'&5476=&'&'#"'&'&547676;232?&547'&#"+"'&'&54767632676'K,68x86,L qA'C<4GW>L ƒd  f‚ L>WG4L „d  dƒ L>WG454&'&/54'&5476276767632+"#"32;2#"'&'&/"'&5476=&'&'#"'&'&547676;232?&547'&#"+"'&'&54767632676o**YK,68x86,L qA'C<4GW>L ƒd  f‚ L>WG4L „d  dƒ L>WG42#'"372"'&'&/"'&476="'&547>µŸQ!//V–Z¢ *nN™+G80j@6R¨R6@j0/P1“N± ¢TžP#00V–Z¢ ,lO@W+G80j@6R¬N6@j03L/•N² ¡Ä ]H,`,H Yc¢!77™\Ê4OO4ÐVA7§gU3š',H^ ]H,`,L&3c¢!77™\Ê4OO7ÍVA7¥fV4š&,H^¡ÿãð™±É67654'&"327632#"'&'&/#"'&5476=#"'&'&5476763232?'&#"#"'&'&5476763254'&5476276767632#"'&#"#"'&#"327676%32767654'&'&#"#"Z8%1T1%8¨5e %ZF\ +m8BS/?JV@6RTXN6@VGB1QB8n* \FZ% e53e!&ZFZ *n8BS/?JV@6R¨R6@VGB1QB8m+ \FZ&!e3þ˜DA 5<; > +F$ÜH$F+ > ;<5 AÓcJ2QD++DQ2Jþ´ (5H,'9,J&0f‰) T|\`j4OO7g`\|T '‹g/& H,9',I4( (3J,&9-H &0f‰) T|\`j4OO4j`\|T '‹g/&J,9',H5(€""'!$(:UJJU:($!'""nF­w"2767>54&'&'767632"'"'&'.'"'&'.546767"'&'.546767632.546767632¢=>343343>==>343343>x>%85670-),(-%8/[0!-(,)-02y/8%0%)-02y/8%-(.'&$W/:#-(,)-02;>/;),)-02;>/8%-( 06{IF{6006{FI{605+'g>:c.&".c;=g'+&1N%&W'+&.c:>k#"$.c:>g'+,B:>g'+&.c;=?nF­\v¦½Ö%"'&'.546767"'&'.546767632.5467676267632"'"'&'.27654&'&'&"67&'&'&'276767&5467'&'&#"32767>54&/76767>54&'&'&#"Z0%8/y20-),(-!0[/8%-(,)0-<1:3%>(-%8/|/8%-(>%85670-),(-%8/[0!-(,)-02y/8%0M=  H C# B/g H Ö/*x#$  8## H g/B õPP  $#x*/ø%N1&+'g=;c."&.c:>g'.5 ?=;c.&&.c;=? 5+'g>:c.&".c;=g'+&1N8GG$> >$ ‚ýc.,bB$#>  ºIr0C >'#> þÂLM >#$Bb,.$ >#'> C0rI Tÿã`ð)T½æ:e©Ó&'#"&'&'&4767>3267'&#"327%32676764'&'.#"7632#"#.4767676324676762>322##"&'"'&'.5#"'.'&467"&'&'&4767>&'&'.'&'>76?&'326767767>5&'&'.#"767>7.'&/32>7674&'&'67'&'.#"67'&'.'67676767"2767>54&'&'"'&'.54?&'2767>54'7654&'&'&"67'&54676762:ä    äÎ$4 4$ww4 4 åxy   ûÊ%" !()-+U$"! ((\(( !"&S+-)(! '7M"# V2% A()-.R$"! ((\(( !"(O-,*(A"#2P"# "MÁŽ   ´ ¸! *4 2ë kk  4 2 uKK   ¦ ´    Ži2 4* !ý‰== 2 4  Í `_  wR#$$#R#$$  8 < c !<>  š   8 < d!!<>   "%UV*) !!$3R  R3&!-(-%Z& "#%(.2$( &&S+,))A!$3R  R3'A))XT$""#%(`$( " þ ´     Ži3+!x== 3 Í _`   þŽ    ´ ¹!+3ë kk 3 uKJ   ßF)(GG()Fþ$ä    äÍ%3 3%ww3 3 åxy   Vÿã^ð3N^"2767>54&'&/2"'&'.4676762 '&'&547676% %-—z35++++++53z35++++++5pWDM69?=;9JHªDM69?=;9JHSšŽ†spsnun‹þËŽ†spsnulŒœþ£þ}ƒ££ƒþ}£þ(.h<;h.((.h; +F$þ$þ‚> +F$Hþ‚ ;<5 AØ~ ;<5 AÓ¹+DQ2Jþ´ (5H,'9,J&0f‰) T|\`j4OO7g`\|T '‹g/& H,9',I4( (3J,&9-H &0f‰) T|\`j4OO4j`\|T '‹g/&J,9',H5(õþG+DQ2JÁÝ$(:UþÍÝ$(:U3Ý!'""ûÝ!'""¶þÕA''7'753'75377537'7'#5''#5'7#5'7'7âðÂ<†Ä<ÄxðÂ<†x†<ÂðxÄ<Ć<ÂððÂ<†Ä<ÄxðÂ<†x†<ÂðxÄ<Ć<ÂëŠphMrhr›à‹ohMããMhoþëŠà›rhrMhpŠ‹phMrhr›à‹þêohMããMho‹à›rhrMhpœÕ!%)-153%% %%#'-75%77%7?5x# <þö$þÝ <þ÷þÝxþÝþ÷< þÝ$þö< #««#««ý÷¬««šª««ýö««x«ÕþÌ©þ°šhš¨¨™hšþ¯©þÍ3©Qšh™¨¨šhšP©'ÅcÅccÅchcbbccbbgcÆcÆÆcÆ‚0ÕA37%37' 7'#%'#5'7#5'7'7-'7'753'7xŒdð ÈX<[Œdðþö ðdŒY<\ÈþùðdŒxŒdðþ÷È[ÿB-ÏDH2#"2767>5!"&54$3!57!#"'&'.5467676#Ý_>I-74þÍÞý×3TŒÈP>CPN±DG-2.1/&D9¨¾Ð 88 '.* !-8D_èÈ2ú{ûÛj·@F'%.3r@Md7+4VýªžÿÝð/2&'&54676762"'&'.546767Z y*,&'ˆ²‚†®ˆ'&%1]~|45,-++-,54|45,-++-,5ð(+&a4|dƒÎ΃fz4a&$(üF*.j=3"&'&'&54767>32Ôîòr²JŠ6464ˆNNˆ4646ŠJ´pòêŠþ`Â684F@NLBD64:866D@NLBD668Âþ^~*Ëž i654'&#"632327632!"'&5!267&'&#"#"'&54763247632327654'&547632#"— 6+Jo.^V|;-þË™it36?þÅ̺ÆfQMeæEJS?(*$ s]vh2K)*NL13^Úv:Mc*„Zœ™£þe—C0ª3N35%&-Kt\K%9S >BWN=!$?$8(F!5{^? Z„ Q67654 547&'&+327#"'#536767&'&'&5432&5476323254'&5432ß?-BO>=þþ‹v06&%K`dC+(‘k$'eM?$#=Hb B=)+8=.mØ9eb PB÷°>$3g:84þ!þEB7WPfG+1K«HŽP<Ff#&T'0P+A'þ“š<þú›œ¸±œ›ƒ}DC‘þä/'"05276767654'&'4‘rceNS((((¦`hmº©§„Œ@DDF†Š¡©þä/CD}ƒ›œ±¸œ›>C/GF†©½»¤§…‰CGþñ˜ !&547˜†‚ƒ…þ°–•”—æþ>þ2þ;åëÆàßÄìþñ˜ 0!!6P—”•–þ°…ƒ‚ìþ<ßàþ:ëåÅιþÛ! !ÛþÜþþ$þþüÛþü ! Ûÿþ"þþþüü#þ{! !{þ<ýl”Äý`þü9þ‘ ! 9 ý`Ä”ýlþüüUþ?! !?þþþìþþüwþ` ! wÿþêþþþüüÄþHZîjþæjî•îjÍjîlþð'7'7Zîjþæjî¼îjþæú3þæjîfþ²$#"&=4&+5326=46;#"3Ôù©lŽ==k©ùÔDV[noZV¾”Ýï—ts•ðÝ“XøŽŽœøX¡þ²N$326=467.=4&+532;#"+¡DVZon[VDÔù©k==Žl©ùÔ¾XøœŽŽøX“Ýð•st—ïÝ”˜ÿì”è º+¸º +¸ 01! 4$32!5##7#”þ?þÂþÄþ?Îq¾ÁqÍûÓiÚ¡þÿìÙêþÁþA¿?ÆrÆÆþý\Ž/˜+ý‚˜ÿì”è *º%+¸%º +¸ 01! 4$32>54&#">32!5!>”þ?þÂþÄþ?Îq¾ÁqÍýæ>0Å£=‘as„;N_/>!þúR¤þL}²êþÁþA¿?ÆrÆÆþéFi:}—$«:&N?(U?"ñMŽt§˜ÿì”è 6™º+Aêú]A)9IYiy‰™©¹ÉÙ ]¸1ܺ.+¸.º +¸ º!'+¸!º+¸º9º*'!901! 4$32%4&#">32+32#"&'32654&'26”þ?þÂþÄþ?Îq¾ÁqÍþ|Á¡=ˆ_ky4[\XZ‘ŒcksuD}[Xˆ@ÃØv hêþÁþA¿?ÆrÆÆþs‰— ?<:<ŒNGLO0¨œ]r˜ÿì”è º+¸º +¸ 01! 4$32! !3535##”þ?þÂþÄþ?Îq¾ÁqÍýþó þC½¶ÎêþÁþA¿?ÆrÆÆþþ¼~þƒŽÓÓH˜ÿì”è +‹º!+Aê!ú!]A!)!9!I!Y!i!y!‰!™!©!¹!É!Ù! ]º+¸º ++¸ º+¸º($+¸(º901! 4$32>32#"&'32654&#"75!5!”þ?þÂþÄþ?Îq¾ÁqÍûïYe2hvvhDw_X…@¾Õϰ?‘ýÃêþÁþA¿?ÆrÆÆþó%aVUa/¬¬˜•° «Ž˜ÿì”è 2ñ¸3/¸4/¸3¸и/¸4¸ܸÜAêú]A)9IYiy‰™©¹ÉÙ ]¸¸ÜA&6FVfv†–¦¶ÆÖ ]Aåõ]º +¸ º +¸ º+¸º,&+¸,º/&,901! 4$32#"&54632"32654&#"7>325.”þ?þÂþÄþ?Îq¾ÁqÍý¢\NN\\NN\qÈêÀ¹ Âº N€ w/aTJjêþÁþA¿?ÆrÆÆþþZbbZ[bb*þõÚçý³‘”±= P”#œ˜ÿì”è º+¸º +¸ 01! 4$32%!35!”þ?þÂþÄþ?Îq¾ÁqÍûÂÏþ¯ÁlýUêþÁþA¿?ÆrÆÆþvüæ]K˜ÿì”è 1=‹º+¸º+¸º +¸Aêú]A)9IYiy‰™©¹ÉÙ ]A&6FVfv†–¦¶ÆÖ ]Aåõ]Aê ú ]A ) 9 I Y i y ‰ ™ © ¹ É Ù ]º/9º;9¸;/Aê;ú;]A;);9;I;Y;i;y;‰;™;©;¹;É;Ù; ]¸5ܺ+¸º )+¸ º+¸º28+¸201! 4$32#"&5463232654&'>54&#"2#"&546”þ?þÂþÄþ?Îq¾ÁqÍý¹_TT__TT_ýâ¾­­¾vi¶·jvkKRRKMQQêþÁþA¿?ÆrÆÆþþlHQPIIPPIŠ——Š\ƒvStˆˆtSvƒÄB>=BB=>B˜ÿì”è &2é¸3/¸4/¸Ü¸ÜAêú]A)9IYiy‰™©¹ÉÙ ]¸3¸'и'/¸-ÜA-&-6-F-V-f-v-†-–-¦-¶-Æ-Ö- ]Aå-õ-]º+¸º +¸ º +¸º*0+¸*º# 901! 4$32254&#"326#"&'4632#"&”þ?þÂþÄþ?Îq¾ÁqÍüÑÈ鿹 ÂºŸO€ w.aUJk<\NN[[NN\êþÁþA¿?ÆrÆÆþýK Úèý´‘”¯< O“$œ„[bb[[bb˜ÿì”è $0Óº%+¸%º+¸º++¸Aêú]A)9IYiy‰™©¹ÉÙ ]Aê+ú+]A+)+9+I+Y+i+y+‰+™+©+¹+É+Ù+ ]º+¸º .+¸ ¸¸(Ü01! 4$32!5##7##"&5463232654&#"”þ?þÂþÄþ?Îq¾ÁqÍû$Ÿu¼¬ž‰F?@EE@?Fþpˆƒ‚ˆˆ‚ƒˆêþÁþA¿?ÆrÆÆþý©€Ê*‰'ýÂ$¢——¢£——£ÐääÐÑää ÿ–«=$>  767654'&'!5%3!!  '&'&54767ôþ̆„mommom„†4†„mommom„ý¥þá¡ýP\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6û}9“:û݈¨@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=6P  767654'&'!!567>54&#"5>32  '&'&54767ôþ̆„mommom„†4†„mommom„þ)4ý \=)N=…kP¥`aªFºÝ7I׺\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6û€ˆˆ_A.Xx;_x55£'(º›I„ZÞV@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=B\  767654'&'#"&'532654&+532654&#"5>32  '&'&54767ôþ̆„mommom„†4†„mommom„ttƒóàLŸUD W˜Ÿ”„‹‘x~‚zB˜\R«GºÕrþ=\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6ýyœt°Âœ'(xrjw…_Z\b§Ždˆ @>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«='A  767654'&'!33##!5  '&'&54767ôþ̆„mommom„†4†„mommom„Þþh˜*˪ª¡ýå+\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6íý‚ üõ†þæœò@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=7Q  767654'&'!!>32#"&'532654&#"  '&'&54767ôþ̆„mommom„†4†„mommom„ý£zþ#G#ÈéðÚKœSL•VŠ¢¢ŠAC\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6cˆþÛ Û»ÁÖ£)%’}|’X@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=%>X  767654'&'"32654&.#">32#"32  '&'&54767ôþ̆„mommom„†4†„mommom„þÖl€€lmÔ=|< © /ŽV´ÑÚµÏÛ â=|þ^\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6ý‹•‚€––€‚•ú“ØÚEKÛ¼¸Þ>-O@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«= :  767654'&'!#!  '&'&54767ôþ̆„mommom„†4†„mommom„ý\þN¨˜ýÂÖ\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6`Eûš#…@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=#9E_  767654'&'"2654&%.546  &54632654&#"  '&'&54767ôþ̆„mommom„†4†„mommom„þßs„„æ…„þêhtÌdÌthuƒÔþtÔ„9tihvvhit0\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6ý,{Ø{|kl{EŽg¦¦gŽžs­ºº­sž\hh\]hhÐ@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=2>X  767654'&'53267#"&54632#"&2654&#"  '&'&54767ôþ̆„mommom„†4†„mommom„ý§=|< © .VµÏÚ´ÐÚþôâ=}þmml€€J\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6û“×ÛDJÙ¼¸ÞþÃþÑþæþ¯•‚••‚••@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=+8Ca  76767654'&'&'"32654'.  735733!  '&'&'&5476767ôþ̆„mo5885om„†4†„mo5885om„T,+VUVV++ï2QPPQþΠPþ3–•ƒþp\˜–|~-,¡üg%“&û݈¨@>}~•—±¬—•~}>@@>}~•—¬±—•~}> ÿ–«= $!5!#%  '&'&54767°þø¡þâ{\˜–|~{{~|–˜þ¤˜–|~{{~|–ˆˆ#:“9üq @>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=6>7>54&#">32!5  '&'&54767£Ã×I7ݺFªa`©Lk…=N)þÃ\öýÕ\˜–|~{{~|–˜þ¤˜–|~{{~|– ÇÞZ„I›º('£55x_;xX.þ¿_ˆˆ@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=(B>54&#">32+32#"&'32654&  '&'&54767ir׸G¡\\˜Bz‚~x‘‹„”Ÿ˜W DUŸLàóƒþ2\˜–|~{{~|–˜þ¤˜–|~{{~|–ˆdާb\Z_…wjrx('œ°tœ=@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«= '! !335#$  '&'&54767œþhnþ¡ªªþo\˜–|~{{~|–˜þ¤˜–|~{{~|–³ý‚ ý œþæ† ý@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=7>32#"&'32654&#"!5  '&'&54767CAŠ¢¢ŠV™HSœKÚðéÈ#G#æþ\˜–|~{{~|–˜þ¤˜–|~{{~|–=ý¨’|}’''£ÖÁ»Û %ˆ@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«= $>2#"&546.#"32654&#">32  '&'&54767Pmml€€­C|=âþóÛϵÚÑ´VŽ/ © <|=þ\˜–|~{{~|–˜þ¤˜–|~{{~|–+•‚€––€‚•úþ¯þåþÓþÂÞ¸¼ÛKEÚØ«@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«= !35$  '&'&54767Ö>þh¨²ýÖ\˜–|~{{~|–˜þ¤˜–|~{{~|–@ˆûÝfEý@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«= +E2"&46' 654&'>54& 74632#"&  '&'&54767Yt„…æ„„/t„ԌԃuhtÌþœÌt-tihvvhit0\˜–|~{{~|–˜þ¤˜–|~{{~|–Ì{lk|{Ø{Ežs­ºº­sžŽg¦¦gŽå]hh]\hh‰@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=$>%32#"3267#"&'"&54632  '&'&54767!C}=â ÚдÚѳV. © <|=Al€€lmþÝ\˜–|~{{~|–˜þ¤˜–|~{{~|–®Q/=Þ¸¼ÙJDÛ×g•‚••‚••@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=  :2#"&546$  !5##7  '&'&54767™eddedddþ¾©©Bªû‘¡³´–\˜–|~{{~|–˜þ¤˜–|~{{~|–Õõ÷õööõ÷õ€þÃþÑþÓþÂ>-/ýˆˆ#&“%üq @>}~þÔ±¬þÔ~}>@@>}~,¬±,~}>ušPj !!5!!PþþÀpûÝ#þ@‚þpðpüpté 7%÷ý©µÔFýN‹´ªý4ýNGuÌP85 zûûDýæ<2ð2pþJþJüt” '-ZýK©ûþ˲Fýª´ÔGýNuPü!!u»¨\lý”þ¤¨ýE¾>ü~~ü>uu+"&'.546?!".4>3!'.5467>2þp4,ºü€,$$,€º,4›2.þp ,.º".2."º., þpuÌP8!5! šûÛ%¶þJZPŽþJþJuÌP8!5! šûÛ%¶þJÜHþJþJuÌP8 #3#3#3!!5 ¹ððþÀxxÈ<<éþo‘¶þJºþpþpþpîþJþJuÌP8 55!#3#3#3š¸þþ¸þoPððþÀxxÈ<<®Šþ΄„þΊXý¨Xý¨Xý¨XuÌP8!!5 šûÛ%¶þJºîþJþJäÀPD! 6ü¼–þ>lú”‚þñÂþ>þ>äÀPD ! þòDýRþ>lú”‚þñÂþ>þ>äÿøP  Bþ¢lú”‚ŠývývuÌPb3!5 5! '&'.u$##+* Z¶þJþMþM*+##$‚à0U%!ÆþJþJÆ!%Uu¢P84676763!5 5! u$##+* Z¶þJþMþM*+##$‚0U%!ÆþJþJÆ!%U0ìÿñÙ!! ^þŽr{þ…VXeýoýouÌP855!¼þDüqšžþ΄„þΞ0ušj%5!!53  !<ý9Çúèþª˜þhý9šîôîþþ>îþ¬ušj%5!!53  !<ý9Çúèþ˜þhý9šîôîþþ>îþ¬+Z° !73#57!!+ IŠdØý&–ý+ÑŠ„¬Šü·ÄÎôîýþÈþ2È&îþ¬+Z° 5!'53#'!!!+Õ–ÚØdŠü·±ü·ÄIЬý|úÈ&Èþ2Èýþî¤þ¬î˜˜2˜ !'!'!53 !ÜOýìdcnèdþ‚˜þhýžÈ”žþÈþ¶ž˜˜žþ 2˜ 3#5!7!!! Ünèdþnýd;ýc˜þh˜þÈþž”Èþèþ ž˜˜dd˜ !53#'5!'! !–]nè2þn2üÕ2òr-˜þhüÓ°Jžþdþc;dJúž˜˜ždd˜ 7!573#5!! !–2+2nè2þnü£òr-˜þhüÓLJd;cþdþžJúž˜˜ž<ÿØÄ¯6767632"'&'&'! <'CZmo~yti^Z\X^Vqo÷ti^?)XÊþ6nGCZ.//+]YÝ€zÚ_X0//+]>IžÊÊž ‚BP "&*.37#37#37#37#5!!!!3'#3'#3'#3'#á < ´ < ´ < ´ < x»»‡­Ãíþy»ýä_< <(< <(< <(< <ZððððððððPþ輂‚¼þèhððððððð¥pt> 7&#"7'7 !%¢¯*ޤBF¯þ8þ©þåþWU¨{°FC£*°þ9oþX¨:þWþæubP¢ 55!5!!'!þš¸¸šþ˜ý§XÈý¨ÈÈXȪø¼dd¼øPRÈÈȧÿÅt” '327'' !!i¯FB¤Ž*¯ÿ8þ‘¨þX:þå¨Á°*¢CF°ÿ9þ¨þåþXU¨§pt>*%&#">7'&'&">327&5467>7t¥BEH€¦¦#&NKþX$W/,0$"¨ D5Hp*G6¦¦¨$"!0,0Y"þW!F&'&#þ»GGC£uaP£'467#"!4676?'&'.5!3!.5P·›5ëê#$ý¨%"//"%X$# Ë5›‚e¼eJ(0Y! "X0(Je¼§ÿÆt”*.'.54?'#"&'2767.'32t)H5§§ þX"$ #0,0X"¨KN&#E€HEB¥”Ž£CGG¨¨&'&KþW"Y0,0$"¨E6Gs¬PX'<6%"'&'.54676$4676762"'&'&&'.54676762$/ö+ãz >ü_ $#R#afü‚þ·#R#)ž>xåþ”ÎbQuþý 88—RK…68ƒ# 88  þþvc–<å*676767632#"'&'&'&%.5467.546–A ''+/54<3¢‘þo¢8n23'9%%%%büüb%%%‚&:?$ fLLf#&#/:&'X23X'ñrrñ'X32X¢V2®c"'&'.54?654&'&'&#!"#!".4?64/&4676763!23!2767>54/&546767622ð þæZýœ ;:td Z ð‹ð  c ´  uuè ´ c  ð¢ñ2c"'&'.54?654&'&'&+"#!".4?64'&4676763!2;2767>54/&546767622þpW\xýj IJœ– ‚\W‹þ˜ Ûð  ““8 þüÛ þ˜u¦P^'#76767&'&/3#>7!5!!5!.'PˆSŒJl.. &GG& GlHŽSýÌi7*üÖånK Knü**7‚OU©nm¤'66'¤1ª¤”UýÕ=…HdŽ·)·ŽdH…=þ#îu ! !ùõþ þ óþ˜Òþ–jý.uûÛûÓ-1ýüްþò0 3%!#3!ÈþÔ€ððý€°ù¦Zddù¦d¯þò/ #3!53#5ËÈÈdý€ðð°ù¦¾øÞdZd·þò{3 #·ªþ檂üpüp¤þòh # 3hþæªþ檂üpÿÿ·þòÏ&ÀÀTÿÿ¤þò¼&ÁÁT[[Ü '#'#'##'‰Òx\xÒxjjxÒx\xÒÜý,x\ýeÓûȰhhûP8Óü›ì\xÔYÿùYÕ73373737+ý.x\xÒxjjxÒx\xý.Ôx\ìü›Ó8ûPhh°ûÈÓeý\xý,Ol„D=072767>54'&'&'&"7#7676767632#"'&ew@RN¾JV !'7$"!3!&'&'&'!#!2767676Þþwxéþ  !1cbîþìîbc1! ½½ "1cbîîbc1" `éxüâÖ]\LM& ®ª® &ML\;þRªþR &ML\]Ö]\LM&¯ZþwxéZQvcbddbcvQZª[RwcbddbcwR[éxV''LM\7=eþ›=7\ML'ýÆþ›e;6\ML''''LM\6dÌ 8 ´  ÔÔÌ2@ @@ 00 ]1@  œ Ôì99ÌÌ0@  œ ü<<@ œü<<°KSX³ <<´œ ì´œìY5!!d‰xé ‡öyéxUZ‰xéªéxuÌ 8 ´  ÔÔÌ2@ OO __ ]1@ œ Ôì99ÌÌ0@  œ ü<<@ œü<<°KSX³ <<´œ ì´œìY'7!5!'7 þwxéöy ‡éx¯ZþwxéªéxdÌ 8Ú¶ ÔÌ2ÔÌ2@ PP_ _O O]1@   œ Ôì9Ì2Ì20@   œü<<@ œü<<@ œ ü<<@ œü<<°KSX· <<<<´œì´œì´ œ ì´œìY5!'7'7!d‰xé€éx‰þwxé÷€éxUZ‰xééxþwZþwxééxdÌ 8!!5!! s÷]xþw‰x]ûöix]x‰Z‰x]xiuÌ 87'!5!'7'7!5 èiiöû]x‰þwx]÷iix]xþwZþwx]xdÌ 8!7'!!5!'7'Xii÷¨iIø˜]xþw‰x]h]x‰þwxiiiá]x‰Z‰x]]xþwZþwxdÌ 8 !5!3# Y÷#éxþw‰xéݪª-éx‰Z‰xéYü¤uÌ 8 #3!'7'7ªªÝéx‰þwxé-þ§\þ§éxþwZþwxédÌ 8 !5!53#5! Y÷¯]xþw‰x]Qªª÷7ii¡]x‰Z‰x]Íü¤EÒiiuÌ 8 !'7'7!#3!7'Q]x‰þwx]÷¯ªªÉiic]xþwZþwx]Í\þ»ÒiiuÌ 8%77777773'7'7#'''''''uF´´´´´´´´´´´´F‹éx‰þwxécn´´´´´´´´´´´´F×F´´´´´´´´´´´´FéxþwZþwxén´´´´´´´´´´´´Fÿÿ,X@,ÿÿ,ÝX ,Ýÿÿ,ÝX@',,Ýÿÿ,§XÓ,§ÿÿ,§X@',,§ÿÿ,§X ',Ý,§ÿÿ,§X@',',Ý,§ÿÿ„°@„ÿÿ,°@',„ÿÿ,ݰ@',Ý„ÿÿ,ݰ@',',Ý„ÿÿ,§°@',§„ÿÿ,§°@',',§„ÿÿ,§°@',Ý',§„ÿÿ,§°@',',Ý',§„ÿÿ„ݰ „Ýÿÿ,ݰ@',„Ýÿÿ,ݰ ',Ý„Ýÿÿ,ݰ@',',Ý„Ýÿÿ,§° ',§„Ýÿÿ,§°@',',§„Ýÿÿ,§° ',Ý',§„Ýÿÿ,§°@',',Ý',§„Ýÿÿ„ݰ@'„„Ýÿÿ,ݰ@','„„Ýÿÿ,ݰ@',Ý'„„Ýÿÿ,ݰ@',',Ý'„„Ýÿÿ,§°@',§'„„Ýÿÿ,§°@',',§'„„Ýÿÿ,§°@',Ý',§'„„Ýÿÿ,§°@',',Ý',§'„„Ýÿÿ„§°Ó„§ÿÿ,§°@',„§ÿÿ,§° ',Ý„§ÿÿ,§°@',',Ý„§ÿÿ,§°Ó',§„§ÿÿ,§°@',',§„§ÿÿ,§° ',Ý',§„§ÿÿ,§°@',',Ý',§„§ÿÿ„§°@'„„§ÿÿ,§°@','„„§ÿÿ,§°@',Ý'„„§ÿÿ,§°@',',Ý'„„§ÿÿ,§°@',§'„„§ÿÿ,§°@',',§'„„§ÿÿ,§°@',Ý',§'„„§ÿÿ,§°@',',Ý',§'„„§ÿÿ„§° '„Ý„§ÿÿ,§°@','„Ý„§ÿÿ,§° ',Ý'„Ý„§ÿÿ,§°@',',Ý'„Ý„§ÿÿ,§° ',§'„Ý„§ÿÿ,§°@',',§'„Ý„§ÿÿ,§° ',Ý',§'„Ý„§ÿÿ,§°@',',Ý',§'„Ý„§ÿÿ„§°@'„'„Ý„§ÿÿ,§°@','„'„Ý„§ÿÿ,§°@',Ý'„'„Ý„§ÿÿ,§°@',',Ý'„'„Ý„§ÿÿ,§°@',§'„'„Ý„§ÿÿ,§°@',',§'„'„Ý„§ÿÿ,§°@',Ý',§'„'„Ý„§ÿÿ,§°@',',Ý',§'„'„Ý„§ÿÿ,þpXÿœ,þpÿÿ,þpX@',,þpÿÿ,þpX ',Ý,þpÿÿ,þpX@',',Ý,þpÿÿ,þpXÓ',§,þpÿÿ,þpX@',',§,þpÿÿ,þpX ',Ý',§,þpÿÿ,þpX@',',Ý',§,þpÿÿ,þp°@'„,þpÿÿ,þp°@','„,þpÿÿ,þp°@',Ý'„,þpÿÿ,þp°@',',Ý'„,þpÿÿ,þp°@',§'„,þpÿÿ,þp°@',',§'„,þpÿÿ,þp°@',Ý',§'„,þpÿÿ,þp°@',',Ý',§'„,þpÿÿ,þp° '„Ý,þpÿÿ,þp°@','„Ý,þpÿÿ,þp° ',Ý'„Ý,þpÿÿ,þp°@',',Ý'„Ý,þpÿÿ,þp° ',§'„Ý,þpÿÿ,þp°@',',§'„Ý,þpÿÿ,þp° ',Ý',§'„Ý,þpÿÿ,þp°@',',Ý',§'„Ý,þpÿÿ,þp°@'„'„Ý,þpÿÿ,þp°@','„'„Ý,þpÿÿ,þp°@',Ý'„'„Ý,þpÿÿ,þp°@',',Ý'„'„Ý,þpÿÿ,þp°@',§'„'„Ý,þpÿÿ,þp°@',',§'„'„Ý,þpÿÿ,þp°@',Ý',§'„'„Ý,þpÿÿ,þp°@',',Ý',§'„'„Ý,þpÿÿ,þp°Ó'„§,þpÿÿ,þp°@','„§,þpÿÿ,þp° ',Ý'„§,þpÿÿ,þp°@',',Ý'„§,þpÿÿ,þp°Ó',§'„§,þpÿÿ,þp°@',',§'„§,þpÿÿ,þp° ',Ý',§'„§,þpÿÿ,þp°@',',Ý',§'„§,þpÿÿ,þp°@'„'„§,þpÿÿ,þp°@','„'„§,þpÿÿ,þp°@',Ý'„'„§,þpÿÿ,þp°@',',Ý'„'„§,þpÿÿ,þp°@',§'„'„§,þpÿÿ,þp°@',',§'„'„§,þpÿÿ,þp°@',Ý',§'„'„§,þpÿÿ,þp°@',',Ý',§'„'„§,þpÿÿ,þp° '„Ý'„§,þpÿÿ,þp°@','„Ý'„§,þpÿÿ,þp° ',Ý'„Ý'„§,þpÿÿ,þp°@',',Ý'„Ý'„§,þpÿÿ,þp° ',§'„Ý'„§,þpÿÿ,þp°@',',§'„Ý'„§,þpÿÿ,þp° ',Ý',§'„Ý'„§,þpÿÿ,þp°@',',Ý',§'„Ý'„§,þpÿÿ,þp°@'„'„Ý'„§,þpÿÿ,þp°@','„'„Ý'„§,þpÿÿ,þp°@',Ý'„'„Ý'„§,þpÿÿ,þp°@',',Ý'„'„Ý'„§,þpÿÿ,þp°@',§'„'„Ý'„§,þpÿÿ,þp°@',',§'„'„Ý'„§,þpÿÿ,þp°@',Ý',§'„'„Ý'„§,þpÿÿ,þp°@',',Ý',§'„'„Ý'„§,þpÿÿ„þp°ÿœ„þpÿÿ,þp°@',„þpÿÿ,þp° ',Ý„þpÿÿ,þp°@',',Ý„þpÿÿ,þp°Ó',§„þpÿÿ,þp°@',',§„þpÿÿ,þp° ',Ý',§„þpÿÿ,þp°@',',Ý',§„þpÿÿ„þp°@'„„þpÿÿ,þp°@','„„þpÿÿ,þp°@',Ý'„„þpÿÿ,þp°@',',Ý'„„þpÿÿ,þp°@',§'„„þpÿÿ,þp°@',',§'„„þpÿÿ,þp°@',Ý',§'„„þpÿÿ,þp°@',',Ý',§'„„þpÿÿ„þp° '„Ý„þpÿÿ,þp°@','„Ý„þpÿÿ,þp° ',Ý'„Ý„þpÿÿ,þp°@',',Ý'„Ý„þpÿÿ,þp° ',§'„Ý„þpÿÿ,þp°@',',§'„Ý„þpÿÿ,þp° ',Ý',§'„Ý„þpÿÿ,þp°@',',Ý',§'„Ý„þpÿÿ„þp°@'„'„Ý„þpÿÿ,þp°@','„'„Ý„þpÿÿ,þp°@',Ý'„'„Ý„þpÿÿ,þp°@',',Ý'„'„Ý„þpÿÿ,þp°@',§'„'„Ý„þpÿÿ,þp°@',',§'„'„Ý„þpÿÿ,þp°@',Ý',§'„'„Ý„þpÿÿ,þp°@',',Ý',§'„'„Ý„þpÿÿ„þp°Ó'„§„þpÿÿ,þp°@','„§„þpÿÿ,þp° ',Ý'„§„þpÿÿ,þp°@',',Ý'„§„þpÿÿ,þp°Ó',§'„§„þpÿÿ,þp°@',',§'„§„þpÿÿ,þp° ',Ý',§'„§„þpÿÿ,þp°@',',Ý',§'„§„þpÿÿ„þp°@'„'„§„þpÿÿ,þp°@','„'„§„þpÿÿ,þp°@',Ý'„'„§„þpÿÿ,þp°@',',Ý'„'„§„þpÿÿ,þp°@',§'„'„§„þpÿÿ,þp°@',',§'„'„§„þpÿÿ,þp°@',Ý',§'„'„§„þpÿÿ,þp°@',',Ý',§'„'„§„þpÿÿ„þp° '„Ý'„§„þpÿÿ,þp°@','„Ý'„§„þpÿÿ,þp° ',Ý'„Ý'„§„þpÿÿ,þp°@',',Ý'„Ý'„§„þpÿÿ,þp° ',§'„Ý'„§„þpÿÿ,þp°@',',§'„Ý'„§„þpÿÿ,þp° ',Ý',§'„Ý'„§„þpÿÿ,þp°@',',Ý',§'„Ý'„§„þpÿÿ„þp°@'„'„Ý'„§„þpÿÿ,þp°@','„'„Ý'„§„þpÿÿ,þp°@',Ý'„'„Ý'„§„þpÿÿ,þp°@',',Ý'„'„Ý'„§„þpÿÿ,þp°@',§'„'„Ý'„§„þpÿÿ,þp°@',',§'„'„Ý'„§„þpÿÿ,þp°@',Ý',§'„'„Ý'„§„þpÿÿ,þp°@',',Ý',§'„'„Ý'„§„þpÿÿ,þp°ÿœ',þp„þpÿÿ,þp°@',',þp„þpÿÿ,þp° ',Ý',þp„þpÿÿ,þp°@',',Ý',þp„þpÿÿ,þp°Ó',§',þp„þpÿÿ,þp°@',',§',þp„þpÿÿ,þp° ',Ý',§',þp„þpÿÿ,þp°@',',Ý',§',þp„þpÿÿ,þp°@'„',þp„þpÿÿ,þp°@','„',þp„þpÿÿ,þp°@',Ý'„',þp„þpÿÿ,þp°@',',Ý'„',þp„þpÿÿ,þp°@',§'„',þp„þpÿÿ,þp°@',',§'„',þp„þpÿÿ,þp°@',Ý',§'„',þp„þpÿÿ,þp°@',',Ý',§'„',þp„þpÿÿ,þp° '„Ý',þp„þpÿÿ,þp°@','„Ý',þp„þpÿÿ,þp° ',Ý'„Ý',þp„þpÿÿ,þp°@',',Ý'„Ý',þp„þpÿÿ,þp° ',§'„Ý',þp„þpÿÿ,þp°@',',§'„Ý',þp„þpÿÿ,þp° ',Ý',§'„Ý',þp„þpÿÿ,þp°@',',Ý',§'„Ý',þp„þpÿÿ,þp°@'„'„Ý',þp„þpÿÿ,þp°@','„'„Ý',þp„þpÿÿ,þp°@',Ý'„'„Ý',þp„þpÿÿ,þp°@',',Ý'„'„Ý',þp„þpÿÿ,þp°@',§'„'„Ý',þp„þpÿÿ,þp°@',',§'„'„Ý',þp„þpÿÿ,þp°@',Ý',§'„'„Ý',þp„þpÿÿ,þp°@',',Ý',§'„'„Ý',þp„þpÿÿ,þp°Ó'„§',þp„þpÿÿ,þp°@','„§',þp„þpÿÿ,þp° ',Ý'„§',þp„þpÿÿ,þp°@',',Ý'„§',þp„þpÿÿ,þp°Ó',§'„§',þp„þpÿÿ,þp°@',',§'„§',þp„þpÿÿ,þp° ',Ý',§'„§',þp„þpÿÿ,þp°@',',Ý',§'„§',þp„þpÿÿ,þp°@'„'„§',þp„þpÿÿ,þp°@','„'„§',þp„þpÿÿ,þp°@',Ý'„'„§',þp„þpÿÿ,þp°@',',Ý'„'„§',þp„þpÿÿ,þp°@',§'„'„§',þp„þpÿÿ,þp°@',',§'„'„§',þp„þpÿÿ,þp°@',Ý',§'„'„§',þp„þpÿÿ,þp°@',',Ý',§'„'„§',þp„þpÿÿ,þp° '„Ý'„§',þp„þpÿÿ,þp°@','„Ý'„§',þp„þpÿÿ,þp° ',Ý'„Ý'„§',þp„þpÿÿ,þp°@',',Ý'„Ý'„§',þp„þpÿÿ,þp° ',§'„Ý'„§',þp„þpÿÿ,þp°@',',§'„Ý'„§',þp„þpÿÿ,þp° ',Ý',§'„Ý'„§',þp„þpÿÿ,þp°@',',Ý',§'„Ý'„§',þp„þpÿÿ,þp°@'„'„Ý'„§',þp„þpÿÿ,þp°@','„'„Ý'„§',þp„þpÿÿ,þp°@',Ý'„'„Ý'„§',þp„þpÿÿ,þp°@',',Ý'„'„Ý'„§',þp„þpÿÿ,þp°@',§'„'„Ý'„§',þp„þpÿÿ,þp°@',',§'„'„Ý'„§',þp„þpÿÿ,þp°@',Ý',§'„'„Ý'„§',þp„þpÿÿ,þp°@',',Ý',§'„'„Ý'„§',þp„þpdÌ?8 !5!53#5!•üs]xþw‰x]ªªûûii¡]x‰Z‰x]Íü¤EÒiiuÌP8 !'7'7!#3!7']x‰þwx]üsªªiic]xþwZþwx]Í\þ»Òii´Ü 3'#'##-Z-x\xÒxÒx\®.ýÒx\ün Óû#ÝÓûö’\ÿù´Õ733737#x\xÒxÒx\xýÓZ'x\’ûöÓÝû#Ó ün\xýÒO€'µ=%"'&'&'&767670327676764'&'&'&½pk_V1..1Vbr‰xé`Xk_V1..1V_kpIêxþ¸XE?#!!';B¢]YQS@?#!!';BQ9€.-\ZnllnZ_.‰xé$-\ZnlÿlnZ\-.)èxF!F@RN¾JV>Žl§ùï˜mGСBk˜ðþî>DôdWŽû0Xd”Ýï—ts•ðÝ“þ²ß.W@#.  -&.%)/ÜK° TX¹)ÿÀ8YÌ299ÌÜ´]<Ü<Ì999991@© &$À-±/ôÌ2ÄôÌ2ì907&54&'>5!2;#"#!532654&+C­­I°02°Ký½ù§lŽ>>Žl§ùþù5ŒUUŒ5D>ð˜kB¡û0Gm˜ñ“Ýð•st—ïÝ”dXÐŽWÙþ2Ûù  5 1üªúþû¨VüªªÌdþÎýÌá¦á22üšhþ¦Ù'æ %#3 5'ªªþ ü¢úþÈü:Äþžýœ¦Ù'æ 73 ÙªL^ü¢ªÈû8bbü:Èýï¦ÙÿÂ'B 7Ù''üÙ›â>€ý°Pú€Nqþ¢ÆÙÿÂ'B 'Ù''üÙ›þ>€ý°Pú€Nq^ýDÙÿÂ'B Ù''üÙ>€ý°Pú€NÙÿÂ'B%  'üÙüÙ''ýt¢àNý²€ý°PÝþÙÿÂ'B5  5Ù''üÙüÙŒbàý²Nú€Pý°Ýäþ#îu úôþ þ uûÛûÓ-ÙÛ3!3!!#!#!5 ¨L¨3þͨþ´¨þÍ×-ýÓ-ýÓªýÓ-ýÓ-ªÙÛ333333#######5¨¨¶¨¶¨ÏϨ¶¨¶¨Ï×-ýÓ-ýÓ-ýÓªýÓ-ýÓ-ýÓ-ª:þkÆû7!!  767654'&'$  $'&'&547676h0þÐ8þÀŒ‰rtrrtr‰Œ@Œ‰rtrrtr‰þ ŽVŽŽGFFGŽŽþªþrþªŽŽGFFGŽŽèþ’È;:rsþ죟þìsr:;;:rsŸ£sr:ôެªÉŬªŽŽª¬Åɪ¬Ž:þkÆû3?  767654'&'$  $'&'&547676!!#!5! þÀŒ‰rtrrtr‰Œ@Œ‰rtrrtr‰þ ŽVŽŽGFFGŽŽþªþrþªŽŽGFFGŽ€ýs¨ýsB;:rsþ죟þìsr:;;:rsŸ£sr:ôެªÉŬªŽŽª¬Åɪ¬Ž€Kýsªýsª:þkÆû3?  767654'&'$  $'&'&547676   '  þÀŒ‰rtrrtr‰Œ@Œ‰rtrrtr‰þ ŽVŽŽGFFGŽŽþªþrþªŽŽGFFGŽ€]ÍÎxþ3Íwþ3þ2xÍþ3B;:rsþ죟þìsr:;;:rsŸ£sr:ôެªÉŬªŽŽª¬Åɪ¬Ž€èþ3Íxþ2þ3wÍþ3xÎÍÿÿuþM %' Io& I' I% IJuþM¶327!5!>2&#"!!"&' ;E þ€”2&#"!!!!"&' ;Eþø þä$Ÿ˜€”;Eþð þÜŸ˜€›‚¯Ϊð¨@¥‡z‚¯þÙ¨ðªþ¥‡zuþM¶&#"%"&'73275%>2";ECþµŸ˜€”;Eþ¾JŸ˜€ö‚¯ýç¶ ºým¥‡z‚¯¶ º“¥‡zuþM¶*3&#"&'67"&'7327&'&54767>2";E™Iq(P >6DŸ˜€”;E]InoSuŸ˜€þ=,HK%ö‚¯þÖ)ˆAH!þ+p$ þ¾¥‡z‚¯1Io›œsV<¤ˆzüEÖ.JghH$uþM-2&#"676='73'"&'7327&'&53>2";E+@/V]H½6¼H\nUm —€”;D [>wfP3,, —I6ö‚¯üx/Ur]H½½H]œlVþ¡¥‡z‚¯M>wšrN3 ™¥‡F4uþM¶!3#!!>2&#"!!"&'732²ÓÓwþ¥¢—~”9F 9þ¡ ©‘}”9G¦þýêr0®§…}Œ‚¯þõü¼þÿ­}Œ‚uþM¶+3#>2&#""&'73273264&²ÓÓc)¢—~”9GcBnnVs¢—~”9F (6o‡”¦þ~ç…|‚¯þÖK|þÒoUþ¾§…}Œ‚¯¶“ØuþMp.3#327264&#">2&#"632#"'"&'ÓÓþz;E-8pÆ–ŠqÕS¢—€”;E;D©ÎÜ›WI —€®þýµ‚¯3>6‘Ñ¡]¤ˆz‚¯þËéþÒÛ!þ£¥‡zuþM¶ 13#64&"327&'&767>2&#""&'­ÓÓË”ŠÖ¢;E]InoSuŸ˜€”;EcBnnVsŸ˜€°þzÑ‘Ïþ-‚¯1Io7sV<¤ˆz‚¯þÖK|þÒoUþ¾¥‡zuþM¶!%7!>2&#"!!"&'73273!#3˜;¢—~”9GþÄ©”9G ŬþÅ«“›þI§…}Œ‚¯þÐýþÞ­{Ž‚¯ tþêþÿ¾þMm-&#"!2#567&'!"&'7327!5!>2";Ed‹_``þë!Ÿ˜€”;D þÜ»`þÅ;`»*Ÿ˜I6ö‚¯ýïÆŒˆebýI¥‡z‚¯žº`:H:`º*¥‡F4uþM¶#&#"7'"&'7327'7'7>2";Exüüx±Ÿ˜€”;EŸzþüx²Ÿ˜€ö‚¯þXyüüx°ýô¥‡z‚¯â yüüx³Ø¥‡zuþM¶*327#467>2&#"#4'"&' ;E-A 4y›yŸ˜€”;E Z>Vy|-Ÿ˜€›‚¯¦2PœþÈIϼ+¥‡z‚¯þæEaÖþ·8ó2üJ¥‡zuþM¶'&#"63"&'7327&'&53>2";E*’yþ€”;E\?Vy~+Ÿ˜€ö‚¯ü&8þ·þŒ'þ¢¥‡z‚¯LFaÖIþÈõ1…¥‡zuþMÀù>32&#"#"&'7327!5ã¢KL~”9GA¢LK~”9Güïâ§…}Œ‚¯ú°§…}Œ‚¯g  kýb¶>32&#"#"&'73275!ã¢KL~”9GA¢LK~”9GþÉâ§…}Œ‚¯ú°§…}Œ‚¯ýР ÿÿ?œÅ™ÙÿÛ¦ 5 5ÛúþûøúþF¶Ѷeþ‘þ“¶ѦÑÙÿÛ¦ 55ÙúþúþFѶþ/ì¶þ/¦þ/¶mÿÿÙÿݦ' 7/ÿ»üÿÿÙÿÛ¦& 7þ»ýÿÿÙÿÛ'' 7áüÿÿÙÿÛ'' 7áýÿÿÙÿÝ' 7/ÌüÿÿÙÿÛ ' 7ÿþÇýÙþñÜN:A%#"'&'&'&#"5>32326#"'&'&'&#"5>32326 5Üj²bn’ š^X¬bh´`n” œ^V¨hj²bn’ š^X¬bh´`n” œ^V¨gü@ÀúþP³NE;=LT³NE;=K›²PD:32326#"'&'&'&#"5>3232655Üj²bn’ š^X¬bh´`n” œ^V¨hj²bn’ š^X¬bh´`n” œ^V¨ûeúþÀP³NE;=LT³NE;=K›²PD:327&#"56767326 5Üj²bDS4ŒWV¨hj²bm“\¤Y@/X¬bh´`ES3‹VX¬bhZmM’p[¤Y@1V¨gü@Àúþ–²PDƒ4KU³NE;é@âLT³NE‚4LR²N"*,é@ãJ^þëþî²pªoÙþ_ÜN5<#"'3267#"/'7&#"5>327&#"5>32732655Üj²bDS4ŒWV¨hj²bm“\¤Y@/X¬bh´`ES3‹VX¬bh´`n”[¤Y@1V¨ûeúþÀ–²PDƒ4KU³NE;é@âLT³NE‚4LR²ND:é@ãJ^°þ‘ªþ²Ùý„ÛT 5!5!-5 !5!Ûúþü‹uúþúþuü‹úþúþû°/ª0²Òý\ªû^ÕÒ²þЪþÑ~ªÙý„ÛT -55!55!Ùuü‹úþúþü‹þsûÕÒ²þЪþÑþ᪪ü°/ª0²ÒùªªÙÿÜN%#"/&'&#"5>32326!! 5Üj³an’š^X¬bh´`n”œ^V¨ûfúþü@Àúþ–²PD:32326!!55Üj³an’š^X¬bh´`n”œ^V¨ûfúþúþÀ–²PD:323265-5Ûi³an’›^X¬bi³an“›^V©gúþü‹þsuü‹úþ¾²OE;=LS²NE; =KJ°/ª0²Òú:ÕÒ²þЪþÑÙþÛ !(#"/&'&#"5>32326-5 5Ûi³an’›^X¬bi³an“›^V©ûeuü‹úþúþü‹¾²OE;=LS²NE; =KJÕÒ²þЪþÑû¿°/ª0²ÒÙþ,Û× -55!55!Ùuü‹úþúþü‹þs%ÕÒ²þЪþÑþ᪪(°/ª0²ÒùÙªªÙþ,Û× 5!5!-5 !5!Ûúþü‹uúþúþuü‹úþúþ%°/ª0²Òý\ª~ÕÒ²þЪþÑû^ªÙþ6Ûî 5 5 -55Ûúþü‹uúþúþuü‹úþ•°/ª0²ÒýV/°þÑý¦ÕÒ²þЪþÑþа/°Ùþ6Ûî -555 5Ùuü‹úþúþü‹uúþ•ÕÒ²þЪþÑþÛ°/°ý'°/ª0²ÒýK/°þÑÙÿ„Û& 55Ûúþúþûøpþ/¶Ñû¶ѦѶþ“Ùÿ„Û& 5 5Ùúþûøúþp¶þ/¶ý›om¶þ/¦þ/ÿÿÙÿ„Ý&' 7/þîÿÿÙÿ„Û&' 7ÿþþäÚÿ¶Ü{ 5!5 5!Úúþü@þ¾Ѫªû•°oªp²þî9ªªÚÿ¶Ü{ !5! 5 !5!ÜúþúþÀü@úþúþѪúë²þªþ‘þªÙÿÀÛÍ555Ùúþúþü@«²p²ýN²p²ü—°oªp²þîÙÿÀÛÍ 55 5ÛúþúþúþÀü@úþ«p²þþ p²þýU²þªþ‘ÙÜ(".#"#"&'5327>76325Üh¨V^œ ”n`´hb¬X^š ’nb²júþü@ÊTL>7632 5Üh¨V^œ ”n`´hb¬X^š ’nb²júýÁü?úþÊTL>ªªþÖªªÜVJ<:DN´TL<:DNüD°oªp²þîÙþ˜ÜÔ$+5!5!.#"#"&'53276767632 5Ùúþh¨V^œ ”n`´hb¬X^š ’nb²júýÀü@úþ>ªªþÖªªÜVJ<:DN´TL<:DNüD²þªþ‘ÙfÛÎ $!!!5!676762!!&'&'&!!Ùúþ‚C.8þd 6WYÎYV7 þe8-ý;úþZª{+DD\¨93[2332[0<¨[EC,üéªÙÿÏÛW7!!%5$Ùúþþþ$Üþü}ƒyª±þå]]þå×x„¦|€ÙÿÏÛW%!5505%$Ûúþƒü}þÜþ$yªª×þ€|¦„þˆ×]]Ùþ×ÛW !!'7!5!%5$¬–Zóý²…–Zþ N´þþ$Üþü}ƒqP¨ªøP¨ªþå]]þå×x„¦|€Ùþ×ÛW !!'7!5!55%$¬–Zóý²…–Zþ Ný²ƒü}þÜþ$qP¨ªøP¨ª×þ€|¦„þˆ×]]Ùÿ ÛK75!5!%5$ÙúþþÍýØ!:þ£ü[¥]3ªªþÖªªkþå-Q÷×tX¦VvÙÿ ÛK75!5!55$%$Ùúþúþ]¥ü[þ£:!ýØ3ªªþÖªªk×þŠV¦XþŒ×÷Q-ÙþqÛK!5!7!5!7!!!!'%5$&þ³Ú`ýÆȉŠ)Pþ"_=ý6ŠŠÞþÍýØ!:þ£ü[¥]êªsª¤s1ªsª¥tþå-Q÷×tX¦VvÙþqÛK!5!7!5!7!!!!'55$%$&þ³Ú`ýÆȉŠ)Pþ"_=ý6ŠŠþÜ]¥ü[þ£:!ýØêªsª¤s1ªsª¥t×þŠV¦XþŒ×÷Q-ÙþyÛ‹:E#"'&'&'&#"5>76326#"'&'&'&#"5>32>%5$Ûi³an’ ›^X¬bi²b`¡ ›^V©gi³an’ ›^X¬bi³an“ ªž°gþÍýØ!:þ£ü[¥](³NE;=LT³N9 A=Kš²OE;=LS²NE;C Eìþå-Q÷×tX¦VvÙþyÛ‹:E#"'&'&'&#"5>76326#"'&'&'&#"5>32>55$%$Ûi³an’ ›^X¬bi²b`¡ ›^V©gi³an’ ›^X¬bi³an“ ªž°ûe]¥ü[þ£:!ýØ(³NE;=LT³N9 A=Kš²OE;=LS²NE;C Eì×þŠV¦XþŒ×÷Q-ÙýíÜ‹6A#"'3267#"/'7&#"5>327&#"56767326%5$Üj²bDS4ŒWV¨hj²bm“\¤Y@/X¬bh´`ES3‹VX¬bhZmM’p[¤Y@1V¨gþÍýØ!:þ£ü[¥]$²PDƒ4KU³NE;é@âLT³NE‚4LR²N"*,é@ãJæþå-Q÷×tX¦VvÙýíÜ‹6A#"'3267#"/'7&#"5>327&#"5676732655$%$Üj²bDS4ŒWV¨hj²bm“\¤Y@/X¬bh´`ES3‹VX¬bhZmM’p[¤Y@1V¨ûe]¥ü[þ£:!ýØ$²PDƒ4KU³NE;é@âLT³NE‚4LR²N"*,é@ãJæ×þŠV¦XþŒ×÷Q-Ùþ¡Û®7 5Ùúþúþü@ÀúþÃþ²pôþ²p«þëþî²pªoÙþ¡Û®%5555ÛúþúþúþÀòþ²²²þ²i°þ‘ªþ²µÿÉŸ³ ' '!Â]ý#¿Ý\eÁý#þ´ÝÂÏN\ý#¿Ý]xý–Âý#LÝÁ ÿÉ ³ !77 ! ýþˆ\Ý¿ý#þ€ÏÂÝþ´ý#Nþˆ]ý#¿ÝýòÏÁý#þ´Ýµ4Ÿ !7 7:\ý#¿Ý]xý–Âý#LÝÁ]Ý¿ý#\eÁÝLý#Âý1 4  %''' !ý]Ý¿ý#\eÁÝLý#Âý1™\Ý¿ý#]þˆjÂÝþ´ý#Á7†P~ % ! !!5 5!3þü!üþýß…ýþö é †üüþïþþõƒƒþöþöƒƒ 7†?~% !!3þü ûô†üüþïþ*^V !!^üüþïþ* üþûô ^ÿÍVÕ!!!^ÖþÉ ûôþµÿÉŸ³' '!ŸÁý#þ´ÝÂÏäÂý#LÝÁ ÿÉ ³!  ÏÂÝþ´ý#äÏÁý#þ´Ýµ4Ÿ%7 7ÐÂý#LÝÁ4ÁÝLý#Âý1 4  ! ÁÝLý#Âý1ÂÝþ´ý#Á7†P~ % ! !3þü!üþý߆üüþïþþ^ÿÍV ! !! !EþþþïüüþïÉþüCüþuÿùR× #7!5!7ÈZþxxèü/{êxŠxêªþ:êxu-R '!5!'ÈŠxêû…Ñèxˆ þvxêþ:ªêxŠHÿù%× 7!!7Òþvxê{ü/èxþxŠxêƪþäêxþvH-% 3'!!'ÒZˆxèÑû…êx þvxêþäªÆêxºÿÕ$!%!!ºúW7úÉü ùàržºÿÕ$!!!ºúW7úÉü ùàžºÿÕ$!!,7úÉrŠ<úR ùàºÿÕ$!!cúÉrŠ<úR ùàÿ!$ výŠüó üòdxxýˆüðüðÿ!$ žuüó üòýˆðýˆüðüðÿ!$ ! žuvú} üòýˆxüðüðÿ!$! žëýŠüó üòxýˆüðüð ºÿÕ$ #)-17#535#5#5#5##5#5#5##5##53#5#5#5##5Õãqrrrrþ¥ÌêÊMrqêÌêÊþ¤rärrrrärrætr¶ÌÌ´ÊÊü$tttt¬ærtttttúÆrtæ¶ÌÌ´ÊÊÐtræ$ÿÊÐ# ! !ªzý0üªVVþºûà‹ü±O þmý“ü–ÿFfü   vvýŠýŠrèèý5þ•kØkþ•üæ\­þSü¤þS–ÿFfü7 –èèýó\­þSü¤þS"ÿ¹Ù‰ ! ÐþR®[®þRGèèýý jÕ3!!!!!!#535#53ÉÊ[þ¥[þ¥×ü_¿¿¿¿Õþþ~ª, *3###535#5333#y±±¸····¸±±¼ýÔ,8ýÈÿ×jÕ#3327673#"'!!&'&#"#>32ÉÊ &}f[×ü_ &}f[Õý, %$R†”þ/ª %$R†” Õ!2+##5332654&+!ÉÈû€€ûþÊ¿¿Êþššþ[ÕqrÛÝqqý¨ÏÑ’‡†’ÐÉþfTÕ$Ç@  $ !? %üì2üÄì9999Ì991@&  B •°• $•/ôìÔì999ôì990KSXíí9Y"²@&]@Bz%%%&'&&& &66FFhuuwˆˆ˜˜]]#.+;#"&! 32654&#A{>ÍÙ¿J‹xÜn†?MãÍÈüƒý‰þ’••’¼~þh–býñ–ªômÖØºOýƒ…Hÿ¢œ¼#(07#5#"''7&546;7&'&#"5>327354326=-¸?¼ˆ‡\g`n;ýû)ž T—`¶Te¾Zçx”_¨9»58¯þ¼>c™¹ýÅåc3Výªfa<}N…V{½À¿ E..ª''r³OËs+Aºþx.Ù´)þâ 3{ ÿèÿB“333#;#"'&'##53w1ÀªÀ ÑªKs½½ÕQ fªÖ‡‡žþÂ3ýÍþo‰NšP þÖr>ÿÿÉþ¿Õ-ºþå!#4&#"#3676323#d¸||•¬¹¹BYZuÁcc¸¸žŸž¾¤ý‡ýže22wxèýõþLÉþ¿jÕ%3###3!Á©ÅEý3ÊÊžýªþAÏý1Õý‰wýHºþåœ33 3###º¹%ëý®ÌŸ¸8ýǹüiãýôþEþL#ýÝ\þ¿èÕ !!#!5!s•üPÉû=°ügÕšûoþAš‘Xþå“` !!#!5!qjýLl¸ü}´ýe`¨üÛþR¨%sÿãwñ-@••Œ‘¯ üìÔì221/ìäôÄìÄî053#5# !232#"³ÄÄMì¥þòþ¬T¥ìüßêÌÍëëÍÌêíèú+ç„€«\\«€ýxþãþ»EEþ»ÉþfÕ! !+53265##É-}-ÍãMD†nþËþÄÕüøú“þòôª–·üúáhÕ %!#3!3¼ýÛ…åýÇÒˆ¡ˆÕÇçüRÕþ=à{6762354&#" #3$ )rQ²¹ƒÞTþìþ¢Ã¤úm*T:rr†¿áý¬û D ð # #3 3 67632#54&#"fþÉþþÅþÂþþŠÌ:9ã:54'&'&s~Ô&¢¢&Ô~~ÔþÚ¢¢þÚÔ~Õ.]Ø=@µN\ªµN\.]Ø=êÑzzÑþâžþâÑzzÑž}qäa ³!ˆSáÝûM!‰Rá}|påasÿ•§?#-n@.  '&$ /$ ‘.üìôììÄ9999991@ .'& ) )••‘Œ.äôìì/Ä9999999046$327#"''7&7&#"4'32>s~Ô&¢ãÄ ‚n€~ÔþÚ¢äÄ œnÕ‘ê§wÖœ\Š‘ý§wÖœ\êÑzvÄiÂjþÞžþâÑzwÅkÁj!žæ®˜^`¥á|å¯üg^`¥á–”Õ .@••• •¯  Ü<<<Ì2221/äìÜììÜì03#3#3#3#–þþþþþþþþÕÍßÍáÍáÍ)áÕ:@ ¯ ÜÜÄÌ1/<ä0@íí22íí # #3².èþ]þºæèºýFýâÕÉ;Õ -@    üüÜüÜüü1@ ‘• ­ /<ô<ìä03!#!#!ÊÔÊý"ÊÔÕýœüÇý9q><Õ@  ÔÄÜÄÄ9/ì1´€ ]@¯ /<ì220K°BPX@     ìììì@     @ ííY333 # #‚ÚÊ Øþ Øþ\þXÚÕþdœþsý3üø{ý…–¢Õ 1@• ¯•  Ü<Ì2Ü<Ì2´??]1/<ì2ô<ì20%3#3#3#3#¤þþþþýòþþþþÍÍÕÍûÅÍÕÍ\Õ 7@••  ôìÔÄ91/ìôì0@ BKSXííY" !!!!&æýâûT¬üœdDçúÕÕšûo–h’h $@    ÜìÜìÜìÌ1/<<Ì2203#3#3#ÆÌÌþhÌÌþhÌÌhÿÿÿÿÿÉ‹Õ0o–Õ !@ •¯• /Ì2üÌ21/ì2ôì20!!!!5!!o&þÓ.üÚ-þÒÕªûªªoÿâ1ð/,@!•‘ '•,Œ01*$ 0Ì2ÜìÜ2Ì1ä2ì2ô<ì20!"'53 !"563 676!2&# !27# '&Ð%4Âþ¬€rmyþðÿymr€OÇ4%%4ÂT€rmyÿþðymr€þ²È4*B6Ð!¯*:'(8)¯ Ï6AB6Ï ¯)þÈþØþÙþÆ*¯!Ð6oÌÕP@   Ô<<Ì2ì22Ô<<ü<<Ì21@ • • ¯/<ä2Ü<<ì22Ü<<ì2203!3!!!!#!#!5!!5!!‘Ê’ÊþëþëÊþnÊþÞ"þÞ"Ê’ÕþxˆþxªþŽªþy‡þy‡ªrªªþŽrÿÿÉ3դ̈Õ@•¯•üìÄ21/ìüì03!!!̼ýòÕªûªÿÿÉ“Õ,oÌÕ7@   /<<Ì2ü<<Ì21@•• ¯ /äÜ<ì2Ü<ì203!!!!#!5!!5!¿ÊCý½Cý½Êý°Pý°PÕþxªþŽªþy‡ªrªÉ•Õ7@ ¯üK°TX¹@8Y2ì21/ìÌÌ0@ 0 @ P ` Ÿ ]73#3#ÉÌÌÊÊÍÍÕû¦Ÿÿã¤Õ>@••‘Œ üÄìÔÄìÔì1äôììÄ0@ BKSXíY"47!5!32654'3! $Ÿ¾»ü¤¬ýx·ÅÛÉâÕË¿áþ»þ¹þÎþ¹ßwNªªþetäw–¤ˆˆ³Îà¡Îæùcÿã­ð #/9@1E- !'E0ü<ì2Ô<ì2ì1@¹ ¹‘0¹*¹$Œ0ôìÔìôìÔì02654&#""$54$322654&#""$54$32ˆ™··™™··™ùþÔ,ùù,þÔù™··™™··™ùþÔ,ùù,þÔPIIPPIIP¤¥˜—¦¦—˜¥ýPIIPPIIP¤¦—˜¥¥˜—¦sÿã§ð'(@ ) ‘(üìôìì1@ •#•‘Œ(äôìì046$32#"$&732>54.#"s~Ô&¢¢&Ô~~ÔþÚ¢¢þÚÔ~Õ\œÖwwÖœ\\œÖwwÖœ\êÑzzÑþâžþâÑzzÑž}á¥``¥á}|á¥``¥ásÿ‘§ð,P@  ! #.# ‘-üìôììÄ9991@ ! (•(•‘Œ-äôììÀ99046$32'#"$&73277654.#"s~Ô&¢¢&Ô~l¢§Äå¢þÚÔ~Õ\œÖw§þ‘ƒj\œÖwwÖœ\êžÐzzÐþâžžþàiÇkÊwzО|â¤`^¾jþI®å|â¤``¤âÉ;Õ -@   üüÜüÜüü1@ ‘ •­ /ôì2ä203!3!#ÉÊÞÊþ,Êdqý9ÇüýœdÉÇÕ (@ •¯•­•  Ü<<Ü<<Ì1/ìüìüì03#3#3#ÉþþþþþþQÍþIÍÕÍ–hÕ ?@•¯ •­ •   Ü<Ì2ÜÌÜ<Ì2¶??? ]1/<ì2üìü<ì20#53#533#3#3#hþþþþýþþþþþþþÍú+Í„ÍþIÍÕÍsÿã§ð'+>@- )(( ‘,üìôì9/Ìì²/)]1@+Î(­•#•‘Œ,äôììôì046$32#"$&732>54.#"3#s~Ô&¢¢&Ô~~ÔþÚ¢¢þÚÔ~Õ\œÖwwÖœ\\œÖwwÖœ\ÆþþêÑzzÑþâžþâÑzzÑž}á¥``¥á}|á¥``¥áÍsÿä§>,P@  %$#& !.! ‘-üìôììÄ9991@ #&$%(•(•‘Œ-äôììÄ99046$327#"$&732>54''&#"s~Ô&¢äÄ ƒžn~ÔþÚ¢¢þÚÔ~Õ\œÖwwÖœ\þ”‚p§wÖœ\êžÐzvÄiÂkþàžžþâÐzzО|â¤``¤â|å®þ?lÆ^`¤âsÿãrï%1=G@8&,20>üìô<ì2Ü<ì21@/•;• 5 )•#•‘#Œ>äôìì9/ì/ì0! #"&547 !&54632! 32654&#"4&#"326s†S“_ ™…„™þþþû™„…™ _þmþ­þz™,,,,,,,,égŸs'O;‘‘H6þ¾þâþâþ¾6H‘‘;O'sŸz<11<;22‡<11<;//dÀÕ #@• ­¯  Ô<Äü<Ä1/äô<ì203!!#!5!­ÊIý·Êý·IÕýjªýk•ªÿÿ=;Õ;sÿãrï3?Kf@•F4%+6:0Lüì2ô<ì2Ü<ì29/<ü<Ì1@•=•(I• C (7##•1•‘1ŒLäôìì9/ì/ì/<ì2ÌÄ0! #"&547"333###3&54632! 32654&#"4&#"326s†S“_ ™…„™î—»ÌééÌ»—…™A;…þïþ­þz™,,,,,,,,égŸs'O;‘‘H6¢Šßÿÿªÿÿߊ¢6H‘‘;OO4Ÿz<11<;22‡<11<;//É‹Õ;@ •••­•  üì2ÔÄÄÜ<ì21/ì2ìôìî20²]!!!33##!!!ɰýÌêêÌþïøü>ÕªþFÿÿªÿÿýãªÿÿhÕ"É;Õ@• üìÔìì1/ìô<0)3!3;ûŽÊÞÊÕúÕ+ÉyÕ=@ B• ü<Ô1/ôì20KSX@ììììY!# 5!!±èßþ!°ý8ßÀkªªýšsÛÕ#O@%$!  /<<ì22Ô<ì2ìÔ<ì2ì1@• • /<<Ô<ì2ô<<Ô<ì2032653#2#4&##"#3"3ÂÊŠòÓþ‡ÖÖyÓòŠÊŠòÓyÖÖþ‡Óò+ªþVâÈþîþºþÛþºþîÈâþVªâÈF%FÈâÉöÕ.@ ¯üK°TX¹@8YìÄÄ1/ìÄ0´í!##ÉÞþuÄÕý-úásÛÕ+f@- ,&'  #+ /<<<ì222Ô<ì2ÄìÔ<ì2ìÄ1@+¹* •  #•*'"/<<Ô<ì2ô<<Ô<ì29/<ì205!5"3332653#!!2#4&##"#35ÁÖþ‡ÓòŠÊŠòÓþ‡Ö¿þAÖyÓòŠÊŠòÓyÖ•ª>FÈâªþVâÈþîþº>ª=þºþîÈâþVªâÈF=6-éÕ@ ÜÌÜÌ1/ÌÄ20!3!3éüM•-¨þûÿÿªþ¼‚Õ'Šü6Šÿÿªþ¼‚Õ'‘ü6‘ÿÿªþ¼‚Õ'ü6ÿÿªþ¼‚Õ'ü6ÿÿªþ¼‚Õ'Šü6ÿÿªþ¼‚Õ&Šü6ÿÿªþ¼‚Õ'ü6‘ÿÿªþ¼‚Õ&‘ü6ÿÿªþ¼‚Õ'Šü6Žÿÿªþ¼ƒÕ&Š‹ü6ÿÿªþ¼‚Õ&‘Šü6ÿÿªþ¼‚Õ'‘ü6Šÿÿªþ¼‚Õ&ŠŒü6ÿÿªþ¼‚Õ'Šü6Œÿÿªþ¼‚Õ&‘ü6ÿÿªþ¼‚Õ&‘ü6ÿÿªþ¼ƒÕ'ü6‹ÿÿªþ¼‚Õ'Žü6ÿÿªþ¼ƒÕ'‹ü6‘ÿÿªþ¼‚Õ&Ž‘ü6ÿÿªþ¼‚Õ'ü6Œÿÿªþ¼‚Õ&Œü6ÿÿªþ¼‚Õ&‘ü6ÿÿªþ¼‚Õ'ü6‘ÿÿªþ¼‚Õ'ü6Šÿÿªþ¼‚Õ&Šü6ÿÿªþ¼‚Õ&ü6ÿÿªþ¼ƒÕ&‹Žü6ÿÿªþ¼‚Õ&ü6ÿÿªþ¼‚Õ&ŒŒü6ÿÿªþ¼ƒÕ&‹ü6ÿÿªþ¼‚Õ&Žü6ÿÿªþ¼‚Õ'ü6Šÿÿªþ¼‚Õ&Šü6ÿÿªþ¼‚Õ'‘ü6Œÿÿªþ¼‚Õ&‘Œü6ÿÿªþ¼‚Õ&ŽŒü6ÿÿªþ¼ƒÕ&Œ‹ü6ÿÿªþ¼‚Õ&ü6ÿÿªþ¼‚Õ'ü6ÿÿªþ¼ƒÕ&‹ü6ÿÿªþ¼‚Õ&Žü6ÿÿªþ¼ƒÕ&‹Šü6ÿÿªþ¼‚Õ&ŠŽü6ÿÿªþ¼ƒÕ&‹‘ü6ÿÿªþ¼‚Õ&‘Žü6ÿÿªþ¼ƒÕ'ü6‹ÿÿªþ¼‚Õ&Žü6ÿÿªþ¼ƒÕ&‹Œü6ÿÿªþ¼‚Õ&ŒŽü6ÿÿªþ¼‚Õ&ü6ÿÿªþ¼‚Õ&ü6ÿÿªþ¼‚Õ&Žü6ÿÿªþ¼ƒÕ&‹ü6ÿÿªþ¼‚Õ&Œü6ÿÿªþ¼‚Õ&Œü6ÿÿªþ¼‚Õ&ŽŽü6ÿÿªþ¼ƒÕ&‹‹ü6ÿÿªþ¼‚Õ&Žü6ÿÿªþ¼ƒÕ&‹ü6ÿÿªþ¼ƒÕ&Ž‹ü6ÿÿªþ¼‚Õ&ü6ÿÿªþ¼‚Õ&Œü6ÿÿªþ¼‚Õ'ü6Œ–:Ü #'+/37Ú·/$0(7,48Ü<Ü<<<<¶#+ 3'Ü<<<<Ü<¶ Ü<Ü<<<<¶ Ü<<<<Ü<°9̰XKRX°8K° bf °TX±30<32#4&#"#9þó`M1¸C±uÁȸ||•­MM 7ÑÔB³uÁƸ||•¬¹e,'"¼xMü¬fcðç¦ýaŸŸ¾¤‘?'¼»Gzýžedïèý\žŸž¾¤ûÝ®þVã5<!"'&76763!!32653#5#"&5#3!#"&5332765!"3 þÛ•^SWsvÝ™||•­¸¸C±uÁÈáÕþsC±uÁȸ||•WVþÛƒƒ¶^S‘ƒBWþLýaŸŸ¾¤{û ¬fcðçüûB¢Vfcðçfþ¡ŸŸ__¤{{Š®þV ›H!&#5#"&5332654/&763!6763232653#5#"'&=4&#"#9þó`M1¸C±uÁȸ||•­MM 7ÑÔc%ZkÁÆ>8nŒ­¸¸C±l¯bd||x¬¹e,'"¼xMü¬fcðç¦ýaŸŸ¾¤‘?'¼»Gzýž2ïèã—XO¾¤{û ¬fcx{ä䟞¾¤ûÝÿÿº[t`&ùþŠ VÈ 332673 &Vv aWV` v žþÞžKKJLÿÿ¶[`&(üÿS N~`6@  FüìÔ99Ä1·B¼© /ì2ô<0KSX·ííY%2767653)5!3$Wq…2!ºþþdþjÁ±/8ªs4÷þÖþtþV±¯ g` ##4673>=3|ëÿýuà‹¸Ë·þdþ7þ”¸ºÄþ<T £¦ëÚé"yýú¹›²þÕX½`#!5!óºüeÑü/Ѻ`!#3#4&#!5!2s¹¹ª¹n†üJ³ãÍŠývy–ôþòX»`35!26&#!5! #X-ë’¦×üÓyÛøòŽŸ’þøþØþ¿ïX»4=!3!#¨Tû\»¨þ¬¿“[ÅCþLþ¬zþèlþòº` 3!2%!4&#!º³ãÍûWïn†ý`ôþòý¢ê–X»` !#4&#!5!2»ºn†üK³ãÍy–ôþòX»`!#4&#!+5265#5!2»ºn†ýãµ rL¼±ãÍy–ýÅÖÀa¦;ôþòÙ-Û· Üüüì1µœ Ôü<Ä05!3!Ù-¨--ª-ýÓªÿÿº½–&$ÿÿº½–&$ÿÿº½–&ÿÿº½–&ÿÿ²þ»ƒ`& üìÿÿ²þuƒ`& ýìÿÿ²ƒ`& ÿ´þ\ÿÿX†`& ÿBÿÿCZ`& þœÿÿXh`&ÿÿÿºd`&ÿÿQÎ`'þúZÿÿX¦`&þÿÿºÿã¿`&&ÿÿQÖÎ`&ZþúÿÿXþV`&þäÿÿX`&ÿ:ÿÿX&þÚÿÿXž`&%ÿÿXÎ`&þ·ÿÿXÿã(`&ƒÿÿºþVd`&Iÿÿÿºd`&{ÿÿC!`&!þnÿÿÿºþVÜ`&"ÿÿX`&#ÿIÿÿº½`&$ÿÿˆ`&%<ÿÿºt–&þÆÿÿX†–& ÃÿÿX–&Šÿÿºd–&ÄXƒ3>=3##67'#3x]Gg¸²G.Ùþi=d¸ªB—·»`ýú‰Ô›²þó¹"þ:T„Ôë®)êCÿÿ‚þ ë'×9ÿnÿÿþ ï'×9ÿÙÿÿÿìþ ‡X&Ú×àÿÿÿÿìþ ~X'×àÿÛÿÿ‚þ ë'Ö¼ÿnÿÿþ ï'Ö¼ÿÙÿÿÿìþ óX&ÚÖcÿÿÿÿìþ ~X&ÛÖcÿÿÿ‚þ ë'ؼÿnÿÿþ ï'ؼÿÙÿÿÿìþ óX&ÚØcÿÿÿÿìþ ~X&ÛØcÿÿÿ‚ÿìë'×9„nÿÿÿìï'×9„Ùÿÿÿì‡â&Ú×àLÿÿÿì~â&Û×àLÿÿ‚ÿìë'ؼ„nÿÿÿìï&ÙØ¼„ÿÿÿìóâ&ÚØcLÿÿÿì~â&ÛØcLÿÿ‚ÿìë™',„ý¨nÿÿÿìï™&Ù,„ý¨ÿÿÿì0a&Ú,ÿ+þpÿÿÿì~a&Û,ÿ+þpÿÿÿ¤Ÿ'Õx~„ÿÿÿ¥\F&ÜÕx¶ÿÿÿì?&ÝÕ,~ÿÿÿì x&ÞÕ>èÿÿÿ¤Ÿ'Øxx„ÿÿÿ¥\F&ÜØx°ÿÿÿì?&ÝØ,xÿÿÿì x&ÞØ>âÿÿþ (f'ׯ;ÿÿþ >f'×£}¤ÿÿÿìþ>\/&¥× ÿ8ÿÿÿìþ>>/&¦× ÿ8ÿÿþ (f'ÔŠ;ÿÿþ >f'Ô&ÿç¤ÿÿÿìÿ8\/&¥Ôÿ8ÿÿÿìÿ8>/&¦Ôÿ8ÿÿþ (f'Ö––;ÿÿþ >f'Ö2¤ÿÿÿìþ>\/&¥Öÿ8ÿÿÿìþ>>/&¦Öÿ8ÿÿþ (f'Ø–¯;ÿÿþ >f'Ø2¤ÿÿÿìþ>\/&¥Øÿ8ÿÿÿìþ>>/&¦Øÿ8ÿÿÿ«þ „°'Õô ?ÿÿÿ«þ ~°&°Õô ÿÿÿ«þ Á/&?,¼þ>ÿÿÿ«þ ~/&°,¼þ>ÿÿ‚ÿ§)‡‚ÿ§Ù7%#"'$47332767654'&54767;#"'&/œc©Í·À€þ¶?¸AËh—¸Âž#6þÊ2 #déý­GG&+@X„A:g!axLQÿÿÿ«þ 6r'_ÿôþ>ðÿì‡X %+53276=3+HZ#c,1¸VV¸,1jÙÙ»ÿì~X%+53276=3;#"+M˜Z#c,1¸1,c7n–VV¸,1jÙÙj1,¸ÿÿ‚þóÀJRÿÿ‚þð¿òÿÿÿìþÔóX&YÔcþÔÿÿÿìþÔ~X&ZÔcþÔüpn"56$3çþ=æìÅßÔgi~wun52&$ßÅìæþ=Ôšuw~igý* '/&'&#"#67632O,$e5F¢qpÈ[?8WH7  $0G‡JI  Ö'327673#"'&'O,$a9G¢qpÈ[?8Wì7  $,K‡JI ÿÿºPšTÿ,ÿÿÿìlš&ITÿ,ÿÿºPýUÿ,i,k ;#"'&=3!1,cK‚Ž\W¸L71,¸\W+ÿÿþPÿöVÿ,ÿÿºPªWÿ,ÿÿÿìlª'Wÿ,Iÿÿ¹PýXÿ,ÿÿÿìlý'Xÿ,IÿÿþèPÿØYÿ,ÿÿÿìþèl¸'Yÿ,IÿÿÿôËdôZÿ,ÿÿÿìlô'Zÿ,Iÿÿá<[ÿ,ÿÿÿìl&I[ÿ,ÿÿ£UÞ/ÿÿÿµ…ƒ'\ÿÂ5ÿÿÿµ…ƒ&\ÿÂÿÿlÃ9']ÿÂ5ÿÿl„9&]ÿÂÿÿÿ«þ @µ']ÿÂþ>Qÿÿÿ«þ 6µ&ð]ÿÂþ>ÿÿlþ Ã'^ÿ5ÿÿlþ „&^ÿÿÿ‚þóÀµ']ÿôþ>Rÿÿ‚þð¿»&ò]XýDÿÿÿìÑç&Y]ÿ+þpÿÿÿì~ç&Z]ÿ+þpÿÿÁy5Á„ 3;#"'&Á¸1,cK‚šPWs¡ûkj1,¸\eÿÿ‚þ¢ë'Ó9þ¢nÿÿþ¢ï&ÙÓ9þ¢ÿÿÿìþÔ‡X&ÚÓàþÔÿÿÿìþÔ~X&ÛÓàþÔÿÿ‹ÿÆ 'Ôú„Pÿÿ‘^&ìÔ^„ÿÿ‚ÿìë 'Ô¼Šnÿÿÿìï &ÙÔ¼Šÿÿÿìóè&ÚÔcRÿÿÿì~è&ÛÔcRÿÿ‚ÿìë'Õ¼Šnÿÿÿìï&ÙÕ¼Šÿÿÿìóâ&ÚÕcRÿÿÿì~â&ÛÕcRÿÿþ (f'Ó;ÿÿþ >f&¤Ó¼ÿÎÿÿÿìþÔ\/&¥Ó þÔÿÿÿìþÔ>/&¦Ó þÔÿÿþ (f;þ >f0%3#"'&'&'!27# '&5767"#"5$3 "(1{R=IrbàJIÁÔ–úþ^©ƒÔ`‰ _Œ‡_Á&Èm3HZ¸¸–dœ²P·ü‰^¤v¸c–àße4)¸?6š [ _wÿì\/&'&'&5672+5327676SSgU´R¡HK¢¬ÜLX¦J‘KÝ£€dãht^¸#4bš4bBP¸H:jVÿì>/);#"'&'+53276767&'&'&5672~ÜAI2hrBVÑ~(;E)‘KÝ£€dãht^eSgU´R¡HK¢ 4bš)N"w¸¨6a.%P¸H:jV#¸ÿÿþ (°'Ó?;ÿÿþ >°&¤Ó?ÿÿÿì\L&¥Ó ¶ÿÿÿì>L&¦Ó ¶ÿÿ}ÿÚR=}ÿÚGR &'3;#"'#"'532767654"9¶ãaRQS,cK‚“a]Ï.-fgsT!"¬#?z™N‰†uIS,¸‚€!&¸* 1p*Dÿÿ}ÿÚ°'ÓE=ÿÿ}ÿÚG°&¬ÓEÿÿÿ«þ b&?ÿ«þ ~&3;#"'!5 767654x¸ I*eK‚‚2Dûþäþ¾0ËÚ# &pgM,¸>þê…—¸€ŠÐ:H~ÿÿÿ«þ b¶'Óq ?ÿÿÿ«þ ~¶&°Óq ÿÿ‚þ îA‚þ GîF%7653323;#"'#"'&''&'#&'$473327676'&/3¸N0%¸@nޏS,cK‚‘vDm% I0Š1_@8‰'T…ÁPx€mþíi¸l“_Qb_y^@@¸$:µ|_ÊÍ2©&þªaS,¸`[ F{Ÿ<³kª>GHö´Îܳ&%0žlŽ}=êœJ<~ÿìÿã î1%+53276=3327653763#"'&'#"'&€+8Lc‚Kc,P¸,+hm,%¸@nޏ\Kf%#?7‰0`DAbH<Š;!.¸,PdÀœ@dczgÂÍ2ª&þªÇq\ =„œ!1(ÿìÿã7î8#"'&'#"'&'+53276=3327653763;#"'ý%#?7‰0`DAbH<)+8Lc‚Kc,P¸,+hm,%¸@nޏS,cK‚‘vD =„œ!1(I;!.¸,PdÀœ@dczgÂÍ2ª&þªaS,¸`Zÿÿ‚þ °'Õâ Aÿÿ‚þ G°&´Õâ ÿÿÿìÿã °&µÕŠ ÿÿÿìÿã7°&¶ÕŠ ÿÿ‚þ æC‚þ áæ<I)"'&5#&'$47332767654'367676;#"/"3276'&'&uþì&4-JXîPx€mþíi¸l“_Qf[¢+!'« (s{l“HX}aº*=RK‚ƒgÌL~¨‘»í»‰%º€›MGHö´Îܳ&%DŠl“Š7(2’l^F"%GéMF ,¸\v7QlÂ?[F‡ÿì2å .327654'&#"!"'&'+53276=36767632Ш‘»íº‹%0LºþìJNA'f¬‚Kc,P¸-e_™KUskº¸ÊælÂ?[F‡ýÉ*#=Џ,PdrNP2†T‰?!'Dì©mxÿìå+8)"'&'+53276=36767632;#"/327654'&#"˜þèJNA'f¬‚Kc,P¸-e_™KUqm¾*=RK‚ƒgÌ਑»íº‹%0L*#=Џ,PdrNP2†T‰?!'DìKH ,¸\vælÂ?[F‡ÿÿ‚þ ¶'Óû Cÿÿ‚þ á¶&¼Óû ÿÿÿì2¶&½ÓÛ ÿÿÿì¶&¾ÓÛ ÿÿÜE¬))5!3%632;#"/%3276'&'&#"@ý¿þ‘o¸Ù\Dui¼*=RK‚ƒgÌýé»í»‰%0Pz±¸\û?c!'EëMF ,¸\v¸?]D‡QxÿìÔ %3276'&'&#")5!3%6329»í»‰%0Pz±uýÁþõ ¸Ù\Duiº¸Ê¸?]D‡Qxþ’¸\û?c!'Eë©mxÿì¤))5!3%632;#"/%3276'&'&#"8ý¿þõ ¸Ù\Dui¼*=RK‚ƒgÌýé»í»‰%0Pz±¸\û?c!'EëMF ,¸\v¸?]D‡QxÿÿÜ'ÓÏREÿÿ¬&ÄÓÏRÿÿÿìÔ&ÅÓÇRÿÿÿì¤&ÆÓÇRÿÿuþ ²*Guþ ²%+! '&7.54762;# '!2764"²˜þÿþ[b»=D}aî_[9^D¶U þöøš)k_ÁÔý1ˆÎþoc¼z’Œ2t*n@00@p[C+ @M¸äkl=žv–8`3$ÿìø*727&'&5763"327%+5<¡ÊK4XÌ}ûÚº>SF7J þ\þ¢²X¸];dŒ}M©‰ÿ4F!¸Å¤¸ÿìð$/%+532767&'&5476762;#""654'îÂÊv`kB;(aD hYîYh MXD=p`vʨ4/gg/¹¹¸($'UZ'-)74--47)-'bM,(¸U __ ÿÿuþ ²F'Ów°Gÿÿuþ ²L&ÌÓ©¶ÿÿÿìøF&ÍÓw°ÿÿÿìðL&ÎÓ£¶ÿÿÿ¤Ÿ'Óõ~„ÿÿÿ¥\L&ÜÓõ¶ÿÿÿì?&ÝÓ©~ÿÿÿì ~&ÞÓ»èÿÿkþG›'ÔR~oÿÿkþ À&ßÔ„kÿÿÿì?&àÔ,~ÿÿÿì ~&áÔ8èÿÿÿÈÇLÿÈÒ!D#"'5327654'&'&7676'&'$54733276763;#"'ÐJ&P DfXRNB8D-<9_¸h$$EB|=Q#!v+6ºú(  %þ¶{{qe›ÿì))5!27654'&54767;#"'&/6þ¶6”-6þÊ2 héý­GG&+@X„A:g!a_¸h$$EB|=Q#!v+6ºú(  %ý?¸+)x.›ÿÿþÈMþÈ#$%653;#"'#"'$&733276N¸1,cK‚pNyþû†UcEþÜ@¸A¦(IPm®I~ãjûkj1,¸3.(±B"[Š\ss~B"5ÿì¯ +5327653¯WPš‚Kc,1¸s²e\¸,1j•ÿìº%+5327653;#"SM˜‚Kc,1¸1,cK‚–VV¸,1j•ûkj1,¸ÿÿŒþ^óNŒþgt5%327654'&'&#"#"'&#4763&547632;#"bzL,5;(.;DÀ …Kµ2KÈxAZ¢M\HTª((&iK‚¯¨*9:X DD(©PNNOþ“m­f7*(”„?$G³C,,¸ÿìÿͦm$%#"'+5326767632%327654'&#"da“În@h t4W‡^Q°[aýð>Ÿ/4(*X.[4fb0¸G1µP8TY¸NE5EK&)Ÿ/4:''5)24fb0¸$#1µP8S§1>,¸ÄE5EX !a%ÿÿ“þµH¶'Ó? Šÿÿ“þ +¼&VÓ?&ÿÿÿì‡è'ÓàRÚÿÿÿì~è'ÓàRÛÿÿ‹ÿÆ ÞP‘^î $&'&'&'3;#"'&'#"'&5476¤ xRo´t¸$8pK‚ZI-&Šœ8:½Ìm*12e CY>)2Ñ'+¨®eO,¸3;I0š­Dÿìÿ½½å-=67654'&#"27&'&5476&'5#"'+5327654'&”$"':Aù4N--0M,Qߨ@(J¯ƒšx’‰«b 41}! @H=.%4-+#%vˆ iEN@TSZ '¹D³ÑÞ49g=ql)¸D%'“i.C!v-‹3j  °;AWE… ¸L9P)8K6(¸œS/V¸L_”+Y‡9›K1\Sÿÿ‚þóÀJR‚þð¿765&'&'&54767632;#"'&#"#"'$4733276L[/,4PT*uW€ ##rpl$-AIq€ÚYh¼uþÛ?¸A¦B³[M•!3!+ (;=A<^†Ä¸¬¥#0{bV` )g™ZZ™rNÿÿ‚þ ÀJ'Ôôþ Rÿÿ‚þ ¿'Ôôþ òÿÿÿìþÔóX&YÔcþÔÿÿÿìþÔ~X&ZÔcþÔÿÿÿ.ÿì¿í&ý\þ–,ÿÿÿ.ÿìÚí&þ\þ–,ÿÿÿåÿì¿£&ý]þ–,ÿÿÿåÿìÚ£&þ]þ–,ÿÿþ ¿&ý^þÈÿÿþ Ú&þ^þÈTÿì¿#"'5327367653¿‹7MÍžjK`Uqˆþ³ª%¸BþÔÚUG´ ¸ ˜FüA+7‰¸®TÿìÚ#"'5327367653;#"'&4;IÊ¡jK`Uqˆþ³ª%¸"@Pi¯f<[A´ ¸ ˜FüA+7‰¸®üD®Tž¸ó)ÿTL* 35'5467676?67654&#">32üüü–Ë,X\"$߸gÁ^a³Olƒ39ZZ8Lüüüý®þþ“{4<+VZ@ELŸÂ89¼CFnY1^5YV‚ešªà‚¨ !5!5!)5!ýþ­S2Sý½þ®RàÈÈÈÈÈÿÿª7‚'ÿXêFÿÿª:‚ 'bé:ÿÿª=‚ 'ÿ]éCÿÿª;‚ 'ê<bÿÿª=‚ 'ÿ]bÿÿª‚H'é€&é'é€éÿÿª‚H'é€'é€'éêÿÿª‚H'þ 'é€'é€éÿÿª‚H'é€&é'éê€ÿÿª‚H'ê€'é€'éêÿÿª‚H'ê€'é'é€þ ÿÿª‚H&é& 'é€éÿÿª‚H&ê& 'é€éÿÿª‚H'þ 'é'造ÿÿª‚H'ê'é€&éé€ÿÿª‚H'ê'é€'é€êÿÿª‚H'þ 'é€'é€êÿÿª‚H&é'ê€'êé€ÿÿª‚H&ê'é€'êê€ÿÿª‚H'þ 'ê€'êé€ÿÿª‚H& 'é€'êéÿÿª‚H& &ê'é€êÿÿª‚H& 'é€'êþ ÿÿª‚H' 'é€&éé€ÿÿª‚H&ê'é€'é€ ÿÿª‚H'þ ' 'é€é€ÿÿª‚H'ê€'é€&é ÿÿª‚H' &ê'é€ê€ÿÿª‚H' 'þ 'é€ê€ÿÿª‚H' 'é€& éÿÿª‚H' 'é€& êÿÿª‚H' & 'é€þ ÿÿª‚H'ê€'é'é€éÿÿª‚H'ê€&ê'éé€ÿÿª‚H'ê€'é'é€þ ÿÿª‚H'ê€'ê€'ééÿÿª‚H'ê€&ê'éê€ÿÿª‚H'ê€'þ 'éê€ÿÿª‚H'ê€'é& éÿÿª‚H'ê€'é& êÿÿª‚H'ê€& 'éþ ÿÿª‚H'ê€&é'é€êÿÿª‚H'ê€&ê'é€êÿÿª‚H'ê€'ê'é€þ ÿÿª‚H'ê€'ê'ê€éÿÿª‚H'ê€'ê€'êêÿÿª‚H'ê€'ê'ê€þ ÿÿª‚H'ê€&é'ê ÿÿª‚H'ê€'ê&ê ÿÿª‚H'ê€'þ 'ê ÿÿª‚H'ê€&é'é€ ÿÿª‚H'ê€' 'é€êÿÿª‚H'ê€'é€' þ ÿÿª‚H'ê€' &éê€ÿÿª‚H'ê€'ê€&ê ÿÿª‚H'ê€'ê€'þ  ÿÿª‚H'ê€&é&  ÿÿª‚H'ê€&ê&  ÿÿª‚H'ê€'þ &  ÿÿª‚H' &é'é€éÿÿª‚H' 'é€'éêÿÿª‚H' 'þ 'é€éÿÿª‚H' &é'éê€ÿÿª‚H' 'ê€'éêÿÿª‚H' 'ê€'éþ ÿÿª‚H' &é& éÿÿª‚H' &ê& éÿÿª‚H' 'þ 'é ÿÿª‚H' 'ê'é€éÿÿª‚H' 'ê'é€êÿÿª‚H' 'þ 'é€êÿÿª‚H' &é'ê€êÿÿª‚H' &ê'êê€ÿÿª‚H' 'þ 'ê€êÿÿª‚H' & 'êéÿÿª‚H' & &êêÿÿª‚H' & 'êþ ÿÿª‚H' ' 'é€éÿÿª‚H' &ê'é€ ÿÿª‚H' 'þ ' é€ÿÿª‚H' 'ê€&é ÿÿª‚H' ' &êê€ÿÿª‚H' ' 'þ ê€ÿÿª‚H' ' & éÿÿª‚H' ' & êÿÿª‚H' ' & þ ÜÕ  3%!#!! !þÍîþîY9w™ý€˜þ\{þå8qúó dú+¡þ_ü÷ÉNÕ  %*!2#!327&#363&#!3654/654'ÉfçúÀþþðûý†ê;33;êÖ$ $ýþÊ#ÐÐ>ÐÐÕÀ±å]aþáÈÚéý{wˆýÜúó ûDÜåD–6ÍÄ6è3Õ! )327&#!36'è²–þhþPýý’cõ  öþpÊÆßßÕþ—þ€þ~þ–qúóA‹Aúó ûk•{qœÉSÕ3%!!!!!!-ÊþÒxýÇý9øûvqúó ddýädýsdÉìÕ !!!!!#3É#ýoQý¯þn.ÊÊÕdýädýqúósÿã‹ð&&$#"32767!5!# !2dþü…»‡‡»‘eVþRuþæ þ¢þu‹^’oüR©©äaG@û;@&5çdýSU™mn™HFûcI¯þºþ»¯f¾Õ3%!#3!53#.ÊþnXddý¨ddqúó ddúódd ÿ–þfYÕ6765%!#!53265-V?OþÔÍãþí?†nqú±òd J^ê dú“þòôd–ÂÉ0Õ !3 #!3ÉŸü£’™üÂþpdÊÕý‰wý@üëÏý1qúó É2Õ !!!3É’×û—dÊÕúdoúó ÄoÕ !#!! !3!3Ýþ_GþbþnØ}×þÒÊúÊqû®RúÕüøú+qúó úó rÿãÚð'( ! '&76 7& 676'&&:¼¾½½þÆþż½½¼Glllþðli$ ›› Þ#››ûÌðÒÕþ þ¡ÔÓÓÒabÓÒúŽ22×22ûjT%¶ýœµ%5û¯$¶c¶$ýôˆÿÜŸö-6&/.4%&  %5 64&/.$ Pdˆ¬o©¨&œªn°žÎþÅ¢m”nÊÉþàþþûßg©zŠoÊ·Æ-[þÊš)'¹þÿNXd»''ã´pu‰éi$2ëþXîf|•’ý† /ÏŒôÿú°Õ 3%!!!!rÈüÀ¶ýîþpýìqúó ddúq±ÿãóÕ $!&%! 65! ÆX!û†!YþÓ‘€ €‘þ¬ýfþ¬qü™þæ‚ba@üÀþž`|gdü5ðÓÓðËü\þÜþÖ*$·Õ 3%! 3!šîÈþþ®ÙÚdýÇþÌqúó dûéú+D®Õ 3!3%! ! 3! !ÄDÈþ¼û5DÈþ¼þ»:9:9dþ‰þ|þÅþÂþ€qúó úó dûîûîú+úðlÕ 3%! 3 ! #(\Æü¤þ~¸v„bþL:þHþŠþ|d¶qúó dýÎ2ý„ü§2ýÎ{ÿü¬Õ 3!! #3nÚdýðþpýð”ªþ2ÈÌÊÂüòý9ÇüòªýVý{ÿãÅ{",34&'3!5#"&5463!54&#"5>3 5!">76a–=Kˆdþ°?¼ˆ¬Ëýû§—`¶Twßjþ°þþ6/^”;:þ5CˆzÓ†]ˆýYýªfaÁ¢½ÀH‹..t''üþ‹UýíNHGÜýg‹wt”ÿã-!>32#"&'!4'&'676763&#"327”N:±|ËÿÿË|±:þ²^,<<,9üR†ù¥KM_]¥ý¢daþ¼ýðþ¼ad¨tŸ‚= üz =OsKÚú¬TþdihtJžŸ‚‚qÿãç{#%#"!2&'&#"3276%çM¥]ýþÖ-U¢LEmGJXHCQRHVþ,${z$d$$>:##düWS%€êæƒ&”ÿã-!!5#"323327654'&'&#"ÅNþ²:±|ËÿÿË|±ýv9,<<,^(†ý¥]_MK¥¶^ùì¨daDDaþZžKsO= † =‚ú¬Tþdü6‚‚ŸžJthioÿã}{!327# 32!.#"}ý‹K_ÙÃmÃkþôþÇ)üåý#ÆÅiÌ©J@þb]u-)8 CþÚ÷qzþÛþóŽÓ¾ç/ã 3476%#"!!!#5354763g.9‡ñ®”:9„þ|þ±°°WX¼® -8‘û¶J_D8‹d97’ddüædd¼TVqþVð{#.=65326=#"325!!"&32767654'&#"jëülQžRµ´:±|ËÿÿË|±:NþÖþÍrÊy^,<<,9/¥KM_]¥úü=ÊŒoú—€,*½¿qdaDDad¨ü-þâþéwŸ‚= † =OsKýÂihtJžŸ‚‚ºH "34'&3'!>32!4&#"! GŒS5ü‡ëOIÆÔÛþ¬kk€•þ± h¾ý”@Á[:¶ú´Ldýžedïèý\Пž¾¤ýUæ5 33#!!J‡ ¹¹KOþ±üüh˜éËû ÿ×þV #676#532765!3#¨‡%G(=ôÝ1l$%OQRa¸¸ûеT0Hôd01™¬ûŒÖ``¾éº2 !3 #!3ºO„ŒýHÑ–ýmþ±d‡üiãýöýª#ýݰú´Læê&5#"'&5!3J=(G%‡õ¶RQOLi” H0Tµ0úZ``Ö~ûJœ^dº‡{"&1<!>32>32!4&#"!4&#"!3%34'&%34'&ºOIÆÔTÞÔÛþ¬kk€•þ¬kk€•þ±d‡[ GŒS5ã GŒS5`®ed¬J€vïèý\Пž¾«ý\Пž¾¤ýUüüh˜ h¾ý”@Á[: h¾ý”@Á[:ºH{ "34'&%3'!>32!4&#"! GŒS5ü‡ëOIÆÔÛþ¬kk€•þ± h¾ý”@Á[:üh˜d®edïèý\Пž¾¤ýUqÿãu{ #2#"27&"676'&sðþîðñþï‚3x33x3d4'pp'Ú3(pp({þÈþìþíþÇ98û× º ükp-€þ$€-Rü’-Û€-qþVð{-%!!>32#"&4'&'&'676#&#"32¿þ²N:±|ËÿÿË|±Š9,<<,^ü؆¥]_MK¥¨ý®¨daþ¼ýðþ¼a¦žKsO= üz =‚ýoHú¸Ê‚‚ŸžJthiqþVð{-%!!.#"326476767&'&3632#"¢Nþ²:±|ËÿÿË|±ýv9,<<,^(†ý¥]_MK¥¨ý®¨daþ¼ýðþ¼a¦žKsO= üz =‚ýoHú¸Ê‚‚ŸžJthiºß{3'!>32.#"!†êN:º…4I,œ§þ²üüh˜d®fc…˾ýzoÿãÇ{E67654'&/&'&5432654&/.54632.#"#"&'i'K&'q4¥=B%%U+.„39GÓS OjqL‘4vàÎf´LJ\_opPx3¡„÷ØZÃlù=vf03"3;@{R?Bsl37'*7CoTüþ78^UNO,,—ˆ¦µ z1$YXDL#/ž¤À%%7ˆž%&7#!!;!"&5#53Ð*‡\{þ…Ks½þ­Õ¢‡‡jU|ÿü7­N(þ¬dýU‰NdŸÒudT±ÿåD` "%&'&5##!5#"&5!3265!ù GŒS5C‡ëþ¬IÆÔÛTkk€•TS h¾lýÀÁ[:˜ühd®edïè¤ý0Ÿž¾¤«=±` 3%! 3!ÍYƒþ£þñT^^dþ\þÔüüh˜düT¬û Vò`3!3%!!3! !ñð‡òübð‡òþùTæåNæådþÛþÊñòþÇüüh˜üh˜dü–jü–jû –üjL` 3%! 3 ! #«—ýUþ¢|þ¥åþpþãþã|[üüh˜dþþ-ýsþÓ=þVÃ`7%! 3+53267Ò²>þ•þæ^]_lþP’|““XQ+üûÛ™Œdü—iû8Ç{dCYXb` 3%!!!5!\ývŒŠü‰ñýw‰ûö‰ýüüh˜ddühdd˜ÿÿhÕ$ÿÿÉìÕ%ÿÿsÿã'ð&ÿÿɰÕ'ÿÿÉ‹Õ(ÿÿÉ#Õ)ÿÿsÿã‹ð*ÿÿÉ;Õ+ÿÿÉ“Õ,ÿÿÿ–þf“Õ-ÿÿÉjÕ.ÿÿÉjÕ/ÿÿÉÕ0ÿÿÉ3Õ1ÿÿsÿãÙð2ÿÿÉÕ3ÿÿsþøÙð4ÿÿÉTÕ5ÿÿ‡ÿã¢ð6ÿÿÿúéÕ7ÿÿ²ÿã)Õ8ÿÿhÕ9ÿÿD¦Õ:ÿÿ=;Õ;ÿÿÿüçÕ<ÿÿ\Õ=ÿÿ{ÿã-{Dÿÿºÿã¤Eÿÿqÿãç{FÿÿqÿãZGÿÿqÿã{Hÿÿ/øIÿÿqþVZ{JÿÿºdKÿÿÁyLÿÿÿÛþVyMÿÿºœNÿÿÁyOÿÿº{Pÿÿºd{Qÿÿqÿãu{RÿÿºþV¤{SÿÿqþVZ{TÿÿºJ{UÿÿoÿãÇ{Vÿÿ7òžWÿÿ®ÿãX`Xÿÿ=`YÿÿV5`Zÿÿ;y`[ÿÿ=þV`\ÿÿXÛ`]ÿÿ‡ÿãðÿÿáZÕÿÿ–Jðÿÿœÿãsðÿÿd¤ÕÿÿžÿãdÕÿÿÿã–ðÿÿ¨hÕÿÿ‹ÿã‹ðÿÿÿã‡ðÿ¹šÇ @ÔÌ03#Çu™þˆü×ÿ)Ù¥@ ÎddÔüÜì1Ô<ì20K°TK°T[X½@ÿÀ878YK°TK° T[K°T[X½ÿÀ@878YK°TK°T[X½@ÿÀ878YK°TX½ÿÀ@878Y@````pppp]3#%3#þ^ËËþyËËÙËËËýsîþðö@BúÄÀ1ôÌ0KSXÉÉY"K° TX½ÿÀ@878YK°TX½@ÿÀ878Y@ %%6FVjg //]]3#þ7¹ä™öþøü¶ÿJéu@!  ÃÃúVV ÔìÔì99991ô<ìÔì2990K° TX½ÿÀ@878YK°TX½@ÿÀ878Y´ ]'.#"#4632326=3#"&ýü9 $(}gV$=09" (}gT";9! 2-ev 3)dwý îþ‹ö‰@BúÄÀ1ôÌ0KSXÉÉY"K° TX½ÿÀ@878YK°TX½@ÿÀ878Y@*$$5CUUŸŸ¯¯//]]#ýÇÄ™æöþøüÏîÿ1øw@ úÔÄ91ô<Ä90K° TX½ÿÀ@878YK°TX½@ÿÀ878YK°TX½ÿÀ@878Y@ //- ]3#'#ý¢¼Ó‹¦¦‹øþö²²üÏîÿ1ø†@ úÔÄ91ôÄ290K° TK° T[K° T[K° T[X½ÿÀ@878YK°TX½@ÿÀ878YK°TX½ÿÀ@878Y@ "  ]373ý¢Ó‹¦¦‹Óî ²²þöüÇÿ9ø #.#"#>32Çv cSRav  Ÿ6978w{züÇÿ9ø j@à úVVÔìÔì1ôüÌ20K° TX½ÿÀ@878YK°TX½@ÿÀ878YK°TK°T[X½ÿÀ@878Y332673#"&üÇv cSRav  Ÿø6978w{zýšþfÛG·ÎdÔì1Ôì0K°TK°T[X½@ÿÀ878YK°TX½ÿÀ@878Y3#ýšÌÌÛÍüæîÿ²ö@Ì1Ô<Ì203#3#þù¹ä™‹¹ä™öþøþøüNîÿö#!#ýÄ™äÄ™äöþøþø––53#–––––73#'3#ú––ú–––––– 3#3#'3#}––}––ú–––d–––ÿ– 3#3#'3#}––}––ú––d––––ÿ––3#3#––––d––ÿ– 3#3#3#3#ú––––ú––––d––d––ÿìï&;#"'&'#"'$&733$767654'3ïF??7Kÿÿÿì‡XYÿÿÿì~XZÿ¥\,>%!$'$&73!2%7&'&547676323!!"'654'&'&#"xhnþèþðþÏ}þ·@¸AËQ+è"R¼:4RQ‰P þôioh4"(=)1$+<'gŠ\^ˆsM6,|y$›K2S–%j¸ßAzG' <8BNÿì?Ù0654'&323276767'&54767632#!V)B,4((7(*Hý®ñT—O<?a‚Nb–NLZB`.NJ|m‘þ¿+M;3*)3P&þ· ]027EW4,”E$2Hf3ŒÐˆ,'ÿì !5;#"'+5327&'&54767632"67654'&'&f·$'“Ùˆ¹¹ˆÙ“'$¹A??8 D?$ 9úP–2*I1C2¸99¸(M.L,0W¸ 5+5DE2.4! kþ Àä.@%&'&'&547676323!!#'$'&5473!2766'&'&#"¸B.y9“(“)Wp8c2þô0-=€ž¯ÍþŽ^E>¸><Œ–Õl/"'"3 9Ld/  #+m¹=¥E2X‘:Ö¸zF‘NV¾Š}¦`k›L:‚DbZzWK# :<,; ÿÿÿì?ÙÝÿÿÿì Þÿÿÿì‡è&ÚÓàRÿÿÿì~è&ÛÓàR¶· %4'&"2>"'&4762<R8R8z?@¸?@@?¸@Ü(8)*8…¸@@@@¸@??ÿÿþï 'Ô¼Š'ä©þÙÿÿÿìþôè&Ú'ÔcRäPþôÿÿÿìþô~è&Û'ÔcRäPþôÿÿÿìï¶'Ö¼ Ùÿÿÿìóâ&ÚÖcLÿÿÿì~â&ÛÖcLÿÿþ >¯&¤]Šÿ8ÿÿÿì\K&¥]XþÔÿÿÿì>K&¦]XþÔÿÿþ >ª&¤×?ÿÿÿì\F&¥× °ÿÿÿì>F&¦× °ÿÿþ >ª&¤ÕÂÿÿÿì\F&¥Õ¶ÿÿÿì>F&¦Õ¶ÿÿþ >°&¤'Ó?Öçÿÿÿìþ>\L&¥'Öÿ8Ó ¶ÿÿÿìþ>>L&¦'Öœÿ8Ó ¶3_+ 5_ü¡_•þž–bÕþV'ÕJ@!B • ¯ 6Üìüì99Ì1/<ì299Üì0KSXííY"²]33+532765#Õ¸â¸RQµþéi&&ý¸Õûƒ}úÖ``œ01­}ûƒ` 2@ ©¼ F ü<<ì221/äÜ<ì20@  @ P ` p ]33###53ø¤¤¸´´`þ¤þ<ĤþòþV.` 54!333##"3276!þÑÁ¸µ¿5R µw{i&þVÝÍ`û ›p?`3A0ÿÿ’cè3'q½=ȼUÿÿ’aè4'q½ÿȼ[ÿÿ’^è3'мPq½=ÿÿ“cåZ'ÉðdȼUÿÿ“cåZ'ËŒdȼUÿÿ’aèZ'Éðdq½ÿÿÿ’aèZ'ËŒdq½ÿÿÿvj 3'ÊÀ\q½=ÿÿ‹cíZ'ͼbȼUÿÿvj V'ȼ}ÊÀ\ÿÿ‹cíW'ͼuм|ÿÿvj0Z'É@dÊÀ\ÿÿ‹c:'̼uÉ(Dÿÿ‹cm:'ËâD̼uÿÿvc u'̼uÊÀŒÿÿvV Y'ϼPÊÀpÿÿƒVõZ'ϼPÉðdÿÿƒVõZ'ϼPËŒdÿÿƒVõ‹'º«Ï¼Pÿÿ‹c['ºà̼uÿÿüîÿPj&²¸þøZ,,!!,þÔ,þÔÿãOÕ=32653#"&[ÂhqÊÓ÷`¾=ìQQ•Ëîüþæê,ÿÿÿ«þ &&_ùÿ«þ ö&3;#"'!5 767654x¸ I*eÃú‚2Dûþäþ¾0ËÚ# &pgM,¸>þê…—¸€ŠÐ:H~ÿÿþÈ#Ä'_¼àÿÿÿì`Ä'_ÿSáÿÿÿìºÄ'_ÿSâÿÿ‚þð¿F'_¼ýòÿÿÿìþÔ8@'_ÿ+þ 'ÔcþÔYÿÿÿìþÔ~@'_ÿ+þ 'ÔcþÔZÿÿÿ«þ ~r'_¼þ>°Á9 9µF üìÄK°SK°QZX¹ÿÀ8Y1´—‡/ìä0@  @ P ` p ð ]3;#"&5Á¸Li µ£û‚™aœÀÖÿÿ‘^îìÿÿqÿã%ðäÿÿqÿãqåÿÿ–þu `&óÿJOw`73#!!dž²†$þ²ÚNd˜ü`ÿþVw`#676#732767!5ʆÐ#5H2KþÜÜ1i0/éNÞ)deûеT0Hôd01™¬ûŒÖ``ÿÿÿÓþvg`'°ÿóÿÿ·þ‡ƒ`&óÔðØÃû3#3#ðÓÓÓÓÖþ#þ—öÕ !#3!53#—^ÉÊý¢ÉÊÕªûªª­• ?!5 ü¤?ªªÿÿÈË8ò'TXZÿÿÈË8 U'UXZÿÿȺ8è'ZôTÿÿÈË8'WXZÿÿÈË8 U'XXZÿÿȺ8 'Z,WÿÿÜ¿$ž'Wô]ÿÿÜ¿$ñ'Xô]ÁNÕ@ T¯üüüÄ1/ìì0333Á¸ÕÕú¾“ÿìNÕ@T¯ ÄüüüÄ1/ìì20%3!533yÕýžÕ¸“““BÿìyÕ@ T¯Äüüì1/ìì0)533yþsÕ¸“Bqÿ㦓8@ E EôìÔ¶0 ]99ìüÄ1@    Œ /ìôìÔì0 6& #" 3 ¹¹¹þú*NYÃþë†hí>þú¹¹¹ý †þëé“ÿìÿ㦓A@E E ÄôìÔ¶0 ]9ìüÄ1@     Œ  /<ì2ôìÔì0 6& "'!53&54 3 ¹¹¹þú*N²NþJíh†hí>þú¹¹¹ý “©Ãþëé“ÿìÿã!“8@ E EÄôìÔ¶0 ]99ìì1@    Œ /ìôìÔì0 6& &54 #"'!5 ¹¹¹þúíh†þëÃYNþJ>þú¹¹¹ýœ©Ãþëþzþë“=xÙ 4@   ÜÄ2üÄ2ÜÄ91@  ‡/ìì290)33!xýÞþç³³Âþçj*¯þ]£ýQýiÿìxÙ 6@   ÄÜÄ2üÄ2ÜÄ91@    ‡/ì2ì290%!5!33xütjþç³³Âþç“““—¯þ]£ýQýiÿì'Ù 4@     ÄÜÄ2üÄ2Ì91@   ‡ /ìì290#5!33jþç³³Âþç“—¯þ]£ýQüÖ=Ðq) #33Ðþìþ¢þ¢Ã¤úmˆ½ýCqý"ÿìÐq )5333!þìˆmúmˆþìþ¢“Þý"“½ÿìq)533#þìˆmú¤Ãþ¢“Þü½ºOq $@  üìÔüüÄ1¶£‡/ì2ô<0)3!33Oûk¹U¹Îqý"Þý"ÿìOq (@   ÄüìÔüüÄ1·£ ‡/ì22ô<0)533!33OúιU¹Î“Þý"Þý"ÿìq $@  ÄüìÔüì1¶£‡/ì2ô<0)533!3ûkιU¹“Þý"ÞºOq $@   ü<ÔüüÄ1· £ /ì2ôì035!!5!3ºüòÇΓK“ý"“ÿìOq $@   ÄüÔüüÄ1· £ /ì2ôì0#5!!5!3ÜüòÇΓK“ý"“ÿìq @ ÄüÔüì1¶ £ /ìôì0!5!!5ûkÜüòqü“K“qÔâ!&'.4> !2>4."RJr……ä 惃sKRü9[œ¸ZZ¸œ 1¨Å©bb©Å¨1 ý…“­p`88`p`88ÿìÔâ!#5!&'.4> !2>4."RJr……ä 惃sKRü9[œ¸ZZ¸œ“{ 1¨Å©bb©Å¨1 ý…“­p`88`p`88ÿìOâ#5!&'.4> 2>4."RJr……ä 惃sKRþQ[œ¸ZZ¸œ“{ 1¨Å©bb©Å¨1 üò­p`88`p`88ºO¦ &@    ÔÄüÜÌÌ21¶   /ìÜÜÜÌ03"3#!5!ò„…ñ>ûk•œ fšžüø“ÿìO¦ "·  ÄÔÄÜÌÌ21¶   /ìÜÜÜÌ03"3#!5!ò„…ñ>úcœ fšžüø“ÿì¦ $@   ÄÜüÜÌÌ21¶   /ìÜÜÜÌ03"3#!5!ò„…ñpûk•œ fšžüø“qµî7@ EüìÔ<ì2ÔüÜÄ1@    ‘ /ìôìÔ<ì2Ì0!!##"&6 !354'&"3.þCœø¼°±f^‹vÎü ]8Æmr^ÞþÄ<ÖUåf˜¶Éý"“qɃ]8˜Æƒÿìµî;@! E ÄüìÔ<ì2ÔüÜÄ1@   ‘ /ì2ôìÔ<ì2Ì0%!##"&6 !3!554'&"3.þCœø¼°±f^‹vÎù7é]8Æmr^“KþÄ<ÖUåf˜¶Éý"““ÞɃ]8˜Æƒÿìçî7@ EÄüìÔ<ì2ÔüÌ1@    ‘ /ìôìÔ<ì2Ì0%!##"&6 !!554'&"3.þCœø¼°±f^‹vúé]8Æmr^“KþÄ<ÖUåf˜¶Éü“ÞɃ]8˜ÆƒÁ•Õ ,@   üü<ü<ÜÄ1@   ¯  /ìôìÜì03!!!!!Áƒþ5Ëþ5Õ“þ/’ý´“ÿì•Õ 0@   Äüü<ü<ÜÄ1@    ¯  /ì2ôìÜì0#53!!!!!Õƒþ5Ëþ5“B“þ/’ý´“ÿìDÕ ,@    Äüü<ü<Ì1@    ¯ /ìôìÜì0)53!!!!yþsÕƒþ5Ëþ5“B“þ/’=•Õ ,@  Ü<ü<üüÄ1@   ¯  /ìôìÜì0!!5!!5!3þ5Ëþ5ƒÕß’Ñ“ú¾“ÿì•Õ 0@  ÄÜ<ü<üüÄ1@    ¯  /ì2ôìÜì0#5!!5!!5!3þ5Ëþ5ƒÕ“L’Ñ“ú¾“ÿìÀÕ ,@    ÄÜ<ü<üì1@    ¯ /ìôìÜì0)5!!5!!5!Àý,þ5Ëþ5ƒ“L’Ñ“ºŒÕ *@  üü<ÔìüÄ1@     ì2ìÔì0!!27654'&3!23œþÐ,R4,,=ýÙ¹UiXOÓÞýµ]Oz}I_ý"Õýœ‡_Ò¤‚“ÿìŒÕ.@  Äüü<ÔìüÄ1@    /ì22ìÔì0#533!23!!27654'&ιUiXOÓþþÐ,R4,,=“Býœ‡_Ò¤‚“Þýµ]Oz}I_ÿìÕ *@  Äüü<Ôìì1@     /ì2ìÔì0!!27654'&533!2#œþÐ,R4,,=ý ιUiXXXlÞýµ]Oz}I_ý"“Býœ‡_Ò­‡…ÁùÕ@@  ôܲ_]9üÔüÄ@    /ìôì999@  ìì10!4'&'5!!ª5M‰Ãcý™ˆ4B˜™_–ÜÜ9V“þïê¸æœ@9“ÿìùÕD@   Äôܲ_]9üÔüÄ@     /ì2ôì999@  ìì10#5!&'&'&'5!!» 5M‰Ãcý™ˆ4B˜“X]°–ÜÜ9V“þïê¸æœ@9“ÿì$Õ@@   Äôܲ_]9üÔì@     /ìôì999@  ìì10#5!&'&'&'5!» 5M‰Ãcý™ˆ4B “X]°–ÜÜ9V“þïê¸æþÉq=áÕ:@   ÔÜü9ÜÄ1@  /ìô̲]ìì´]0!533TþéºÕßþÇö9ú¾“ÿìáÕ >@  ÄÔÜü9ÜÄ1@  /ì2ô̲]ìì´]0#5!533hþéºÕ“LþÇö9ú¾“ÿì Õ:@  ÄÔÜü9Ì1@  /ìô̲]ìì´]0#5!53hþ麓LþÇö9ú+ÁÀ#1@%!$üìÔìÔüüÄ1@    # /ì22ÔìÔì03432>3234&#"!4&#"!ÁôÆ}x5%–ÓÒ^ˆÕþq¤ZþýH¤Zl”þî¦ÿK--ÒX€hý¹“|‚€Å•þncƒ§ÒòÿìÀ%5@'#&ÄüìÔìÔüüÄ1@    $ /ì222ÔìÔì0#53432>3234&#"!4&#"!ÕôÆ}x5%–ÓÒ^ˆÕþq¤ZþýH¤Zl”þ“[¦ÿK--ÒX€hý¹“|‚€Å•þncƒ§Òòÿìë#1@%!$ÄüìÔìÔüì1@    " /ì22ÔìÔì0#53432>324&#"!4&#"!ÕôÆ}x5%–ÓÒ^ˆº¤ZþýH¤Zl”þ“[¦ÿK--ÒX€hý&|‚€Å•þncƒ§Òò=ÜÕ -@   Üü<ü<üÜÄ1@    /ìüÜ<ü<0!!5!3!!!ˆþµK¸Kþµœ“Áþ?“ý“ÿìÜÕ1@   ÄÜü<ü<üÌÄ1@    /ì2ôÜ<ü<0#5!!5!3!!!œþµK¸Kþµœ“î“Áþ?“ý“ÿì‹Õ -@   ÄÜü<ü<üÌ1@    /ìôÜ<ü<0)5!!5!3!!@ý¬œþµK¸Kþµ“î“Áþ?“=XÕ>@ Üü<ü<Ü<ü<üÜÄ1@    /ì2ô<Ü<<ì220%!!5!3!3!!!þ=¹þµK¹øLþ´œ“îý““Áþ?Áþ?“ý“ÿìXÕB@  ÄÜü<ü<Ü<ü<üÜÄ1@    /ì22ô<Ü<<ì220#5!!5!3!3!!!%!œþµK¹øLþ´œý¬þ=“î“Áþ?Áþ?“ý““îýÿìÕ>@  ÄÜü<ü<Ü<ü<üÌ1@    /ì2ô<Ü<<ü<<0)5!!5!3!3!!!¼û0œþµK¹øLþ´¸þ=“î“Áþ?Áþ?“ýîýºOq %@   üìÔüüÄ1· £ /ì2ôì03!3!ºÇÎü$Uqý"“ÞýµKÿìOq *@    ÄüìÔüüÄ1@  £  /ì22ôì0#53!3!ÎÇÎü$U“Þý"“ÞýµKÿìq %@  ÄüìÔüì1·  £ /ì2ôì0)53!!ûkÎÇüòU“Þ“ýµK=Õ!!!ÆýtFsþ0†þhéBû~ÀÕú¾“ÿìÕ !5!!!ÆýtFýléþh†þhéBû~À“Bú¾“ÿìÃÕ!5!!ÆýtFýléþh†þ0Bû~À“Bú+ÁóÕ 8@!  üìÔ<ü<ÔìüÄ1@       /ì2ôìÜ<ì20327654'&+!!!2/!m¨]%i¤þ ;þ ô°„@ED\ŒÔ†qQE=4."RJr…CEoJRþµXEr„„rJSü9[œ¸ZZ¸œ† 1¦ÆSV/ ó“þ{ 2¦Æ¦1 ò“"p_88_p`88ÿìÔÕ*#5!5&'.4767675!5!!2>4."RJr…CEoJRþµXEr„„rJSü9[œ¸ZZ¸œ“ó 1¦ÆSV/ ó“þ{ 2¦Æ¦1 ò“"p_88_p`88ÿìOÕ(#5!5&'.4767675!5!2>4."RJr…CEoJRþµXEr„„rJSþQ[œ¸ZZ¸œ“ó 1¦ÆSV/ ó“þ{ 2¦Æ¦1 þ{"p_88_p`88ÁQÕ %@   üìÔìüÄ1·  /ìôüÌ0!!#!3Åþµ¹¼ÔBþÅÎú¾“ÿìQÕ *@  ÄüìÔìüÄ1@    /ì2ôüÌ0#5!!#!3Ùþµ¹¼Ô“¯þÅÎú¾“ÿì}Õ %@   ÄüìÔìì1·  /ìôüÌ0#5!!#!Ùþµ¹¼“¯þÅÎú+ÁQæ (@   üü<ÜüüÄ1·   /ìÔÌüÌ0!!#3!3Åþµ¹¹ÔOþü›þüü±“ÿìQæ -@   Äüü<ÜüüÄ1@     /ì2ÔÌüÌ0#5!!#3!3Ùþµ¹¹Ô“¼þü›þüü±“ÿì}æ (@    Äüü<Üüì1·   /ìÔÌüÌ0#5!!#3!Ùþµ¹¹“¼þü›þüüÁBÕ /@   ü<ìÜ<üüÄ1@      /ì2ôìÔì0!!!5!3z;þ ôþ ¬ÕÞýµKý"qÑ“ú¾“ÿìBÕ3@   Äü<ìÜ<üüÄ1@      /ì22ôìÔì0!53!!5!3z;ý7Õôþ ¬ÕÞýµKý"“ÞÑ“ú¾“ÿìmÕ /@    Äü<ìÜ<üì1@      /ì2ôìÔì0!53!!5!z;ý7Õôþ ¬ÞýµKý"“ÞÑ“ú+qÔÕ &2>4."&'.4767673! [œ¸ZZ¸œœRJr…CEoJR¸XEr„„rJS"p_88_p`88ü~† 1¦ÆSV/ †þ{ 2¦Æ¦1 ò“ÿìÔÕ (2>4."!5!5&'.4767673 [œ¸ZZ¸œlûRJr…CEoJR¸XEr„„rJS"p_88_p`88ý““ó 1¦ÆSV/ †þ{ 2¦Æ¦1 òÿìOÕ &2>4."5&'.4767673!5 [œ¸ZZ¸œœRJr…CEoJR¸XEr„„rJSý0"p_88_p`88ýó 1¦ÆSV/ †þ{ 2¦Æ¦1 þ{“qÔÕ*!&'.4767675!5!!!2>4."RJr…CEoJRþµNþµXEr„„rJSü9[œ¸ZZ¸œ† 1¦ÆSV/ ó““ò 2¦Æ¦1 ò“"p_88_p`88ÿìÔÕ ,%!5!5&'.4767675!5!!2>4."ÔûRJr…CEoJRþµNþµXEr„„rJSþQ[œ¸ZZ¸œ“““ó 1¦ÆSV/ ó““ò 2¦Æ¦1 òp_88_p`88ÿìOÕ*)5!5&'.4767675!5!!2>4."¼ý0RJr…CEoJRþµNþµXEr„„rJSþQ[œ¸ZZ¸œ“ó 1¦ÆSV/ ó““ò 2¦Æ¦1 p_88_p`88ÿÿüìûÿ œûþÿÿÿª†‚Õ'é†'éÊé ÿÿª†ƒÕ'é†'éÉê ÿÿª†‚Õ'é†'êÉé ÿÿª†‚Õ'é†'êÉê ÿÿª†‚Õ'ê†'éÉé ÿÿª†‚Õ'ê†'éÉê ÿÿª†‚Õ'ê†'êÉé ÿÿª†‚Õ'ê†'êÉê —à :@   Ô@ ? o ]Ü99ÔÜ99ÔÌ991¶ ÔÌ2Ü<Ì0#'##'##'d22¯222¯22dàÈddddÈÉþVüÕ!#!3!3#3ÄýjþðÄ–Éþ’†áûÕûáúÕªþVÁþV8`!##333#€·ýäì·í¸þÞ{ƒü}`üü9™þVÿã¬Ó$36767#"&546?>7>5#53ó¿!Ya^Ág¸ßHZX/'ÅËËÅ-93B$BüS #C¼98ŸL‰VV/5<4þú¾­,5^1Y7=pöãM_<õÃú²Ãú²÷Öý& r Umþ â÷ÖúQ r–Ífª‹55®Å´žªšq=3ۤ=´Ù‹žãd‹Û²‡á–œdž¨‹²ð²ž´Ù´Ù´Ù?“‡y}É–s)ÉÉšÉ3sÉ\É\ÿ–?ÉuÉçÉüÉLsÓÉLsɇãÿúÛ²yéD{=ãÿü{\°²Ç´Ùÿìªç{ºfqqìqÑ/qº9Á9ÿÛ¢º9Á˺ºåqºqJº+o#7®¼=‹V¼;¼=3X²´Ù‹55¬^R²\×Åsåž´ÙãdÕôÙ5^5bs®ž‹Û#5‰Å`åÁÁ‰Á‰Áb?yyyyyyË–sÉÉÉÉ\;\¢\ÿþ\3 üÉLsLsLsLsLs´LfÛ²Û²Û²Û²ãÿü×É ºç{ç{ç{ç{ç{ç{Û{fqìqìqìqìq9ÿÇ99ÿÞ9ÿôåqºåqåqåqåqåq´ÙåH®®®®¼=º¼=yç{yç{yç{–sfq–sfq–sfq–sfq)Éq3 qÉìqÉìqÉìqÉìqÉìq3sq3sq3sq3sqÉÿåTÉx\ÿä9ÿÓ\9ÿò\ÿõ9ÿä\°9–\É9Á¸ÉrÁ\ÿ–9ÿÛ?É¢º¢ºuÉXÁuÉ9ˆuÉÁuɼÁÿòFüɺüɺüɺ‚ÍüɺLsåqLsåqLsåqs/qÉJºÉJ‚ÉJº‡+o‡+o‡+o‡+oãÿú#7ãÿú#7ãÿú#7Û²®Û²®Û²®Û²®Û²®Û²®éD‹Vãÿü¼=ãÿü{\3X{\3X{\3XÑ/ áÿ—}ɺ} s–sfq3 ÿ—}ÉqåqƒLuꤚÿ–Ñÿ3s~ߺÔÉ\ ÷É¢¹9 ¼=˲üÿ–ºLsNgåv—sq7ÿ—¹Ér+dɰþò#7ã#7ãÿúÝ­°NÄÉóÿüØ={\3XT T\Ÿh3q–T]ŸhXº\Éðɬ]É `É dÉ <q¯ÉKɧÁsÉdÉaºyç{\ÿþ9ÿàLsåqÛ²®Û²®Û²®Û²®Û²®ìqyç{yç{ËÛ{3sq3sq?É¢ÿéLsåqLsåqT ŸX9ÿÛ `É dÉ <q3sqçÉuÉüɺyç{ËÛ{LfåHyç{yç{ÉìqÉìq\ÿ§9ÿÃ\9ÿãLsåqLsåqÇJ‚ÉJºÛ²®Û²®‡+oãÿú#7œ,GÉÿðâÉ´q–qâq{\3Xyç{ÉìqLsåqLsåqLsåqLsåqãÿü¼=ÌŠ¾ºÑ79ÿÛüqüqyÿý– f u ãÿ²+o3XÓPÕP} Û yÉìq\ÿ–9ÿÛ@sq Jãÿö¼ Í®qººefqq’qìqìqŽ|S…A…4…Pq9ÿÛ‘qq qÄ`Ä`®ºº9µ¦ùt*KæL:Á¦Á˺˺˺+ÿÛ#º³åqÝqÓ”GpPPOJºIº~„>tÔºÔº+o°ÿÙ°ÿÙ±7°þò#7#7ñqÉÁ¼=‹V¼=ãf3X3XŸXŸmXXXXLs£ºPqªq;ºVþòVººÑqXXqvqq˜7á7:7É/ Á<Á66JO<u1ufÿéu]H^H 6û&: ® ‹®‹²‹Äuuuuõuõu  ÁÁÁÁ3ÖÕsª3ÖÕªs²o²ouuuuMÁÇšîL¶ð†ÿÿïhuTzüuuõuòÖòÖòÖòÖòÖÁÕî¶ü¨ýqüÁü´üÙûìü¿ý˜ü×ý7üìüôüÅý¼üðü]ü¿ü¿þýýÿyü¨ýqý ý¼þUþðý€ý ý ý ý ýzýwýšüÕý(ýjý#ýLý¼üðücüÅü¿ü¿ü¿ü´üÙûìûìûŒýxúíûhúý¬üñüðücý+þûìü¨ýqü´ýüçýÆüÕýýýü¶ü¶ü¶ücý3ýxü¿ý+ýxÿ.üpüpüpüpý*üpüw: : ¶efqe²žs׊‹ÛøÿçøÿóDÿí€ÿò™ÿá›ÿÛµy}ÉuÉyÉ{\ÉLs\É?ÉyçÉüÉÉLsÉÓÉÉãÿúãÿüLs{=LsN\ãÿüFqc…<ºµ¦¡•FqÀ¼ åqS…Zkºåqµ¦·¿¼=®xJvkåqÑJº²qqÑd¡•GpŸ;Gp³‡µ¡•åq¡•³‡ê¦ôq—W½ÿá—WGp³AOpLsåq0‹²qšÉ«ÿ@G³G¿ìrwxs³‡sFqUÉë-~OÛd$s6˜såqã,J7Opºfq9ÿÛLsìqìÄ×ɺ–sçÉ5U s–s sÉÉJÿúáÉ–s‡\É\\ÿ–ÀT\ÉJÿú®ÉüÉà#Éy}É}ÉáÉ@eÉž(!‡üÉüÉ®ÉTçÉÉLsÉÓÉ–sãÿúà#ãy{=6É|¯ŽÉÀÉ©<É}É–o£Óˆç{ïp·º4ºˆkìq5FA…3º3ºÕºL º;ºåq;ººfq©<¼=×p¼;rºº–Rº‰º§>Qº·ºdq¼ÁÐtìqìq/4ºdq+o9Á9ÿô9ÿÛ8L0º7/Õº3º¼=;ºxs³‡*`ŠÓþÁ D3 GÉÁLsåk7ɘÁsS[Ú2Lsåq@R2@R2ðs<q sq pv9˜xs³‡–sfq;ûÚýý³ý³X÷ÖXøX.ÉjÁ}!·&ÓɺáÉ4ºfG¹8þÉ=ºž(5F!‡A…®ÉÕº®ÉÕº®!Õ=Ú2§*ÉIÁÉÁ¦ÉSÁ^s6q–sfqãÿú©<ãÿü¼=ãÿü¼={=¼;yÿút|¯º–|¯º–|¯º‡Ó‡Ó\Éž(5F?ÉÕ¿56].ÉIÁ6ÉrÁ|¯º–É2Á9Áyç{yç{ËÛ{ÉìqLuìqLuìqž(5F!‡A…T ŸXüÉ3ºüÉ3ºLsåqLsåqLsåq–odqà#¼=à#¼=à#¼=|¯º–áÉ4ºÉQºfG¹8{=¼;{=¼;}‘·q ‘-qÌÉô«nɵ«“6¨.çɽÁ3sGq/ÿú°ê¤S…TLï²Û²²²Û²&›t²Û²β²Û²u²—²äAÛ²¨²&²7\²ÛŒ¹\Û²Û²Û²S²&›²Û²²‡Û²ÛŒe²ãsR\Ls‡uu‹²^x"ž6^Z˺ºq"º®“qD®ºšº“qº;Á'º q®ºqº®F®9ÿÛ2  ºŸF˺  &º®‘®Ê®ºqÁÊ®/åqz®²ðw`D«ÿÿDÇÇcc/NDãdc\ÑÅ\шfc²ÞX•CÀXº.ºþXº0º.º¼XsXËXºEX.ºˆX™XNºÕº*C¦CMº¼XwºBĺ¢ºĺSº(º•Ûü‹Û?“ã9ÿµ9lÝÿ«9lC‚9Áˆ‚1‹ˆ‚ˆ‚***}}Ýÿ«Ýÿ« Ä‚ Ä‚ ¬‚ ¬‚ffÆuÆuXÿìK5k˜ÐôŒà“1‹Ýÿ«C‚C‚ÜÜÜÜÜÜÈì˜OOóL¸LLRLLL¯L‡LUL<L<LdL…™‹²\Wˆ‚5kVzˆ‚ˆ‚ˆ‚ˆ‚ˆ‚ˆ‚ˆ‚ˆ‚*******Ýÿ«Ýÿ«âÿ«Ýÿ«KKK)‚)‚Ðà“*Ýÿ«C‚C‚1‹L¸LLRLLLRLjLÐL<L<Ld‡ááááááÖÖ9Á’qd=¼=;º;ºÀq;º¡qÁ=xºåÁÍ=¬ÁÈ=D=;º=ßÁ=ÁËpÈ==Àq=Á=Á.ÁÀqÀqÙB¤¿[B[šÕ‚È‚È{d{dãÿì7Å]‚x‹‰Ülx‹€r[º")>WE_HHöY"º~h~h@€rx‹2Os N~sx‹MÊnû`P{Püšû@û@û@û@üþü§û`ûNzBz®ÿÓa\î¼d“ýûû>üNûüš‡ c c]cc Y]‚d–ji:~:~¹P†Z"ZPºZ|ZPZ}P¼P…ZPZXZ­‚³PP‚P|Z­‚­‚²P²P*FÕ‚­ZÄn­‚ÅP\Z­‚ˆZ­‚ZFdZW‚PPWF…ZdZddDPGd.d#ddadd%dvd-d/‚Cd$d/dWd/‚?d1<Nd/dBd/d-d-‚ˆd/d/‚éF.‚üZ#d{dddd‚d—dÃd.‚ndmd?dndyyyy'É'É'É'É'w'w®É­®É­®É­¼ÉɼÉÉ'ɼÉw¼Éw'w ÉX‰c^c^‰‰%‰‰ºH‰ ɉ‰‰¸E ÉïwyyyyÕwÕwÕwÕwÕwÕw®É­®É­®É­¼Éw¼Éw¼Éw¼ÉwÕw‰‰‰Û²Û²Û²Û²×w×w×w×w×y×y^ɲ^ɲ^ɲlÉ4wlÉ4w”É4y”É4y”ðy‰²²íwyFÉÉÉFŽFFÉÉáÉ*F…ɇɅɇÉáÉ*FáÉ*F…ɇɅɇɅðA‰A8F3ÉF3ÉFÉÉÉFFFÉÉáÉ*F…ɇɅɇÉáÉ*FáÉ*F…ɇɅɇɅðz‰z‰áwuÉuÉuÉáw.wáwuÉuÉþÉ&wøÉÉøÉÉþÉ&wþÉ&wøÉÉøÉÉøð‰‰‰ÐwÐFÐF• ÐwÐwÐwÐFÐFŽÉGwyÉÐFyÉÐFÐF͉Ÿ‰͉ÐwÐFÐFÐFÐwÐwÐwÐFÐFŽÉGwyÉ=FyÉ=FŽÉGwŽÉGwªÉ=FªÉ=F͉ÕwÓFÓÉÓÉÓÉÓFJFÓFÓÉÓÉ­ÉFVÉ+ÉVÉ+É­ÉF­ÉFVÉ+ÉVÉ+ÉVðY‰]‰Y‰²F²F²F"F"F"F"FGÉúFGÉúFGÉúF ÉÌF ÉÌF ÉÌF ÉÌF ‰wÉÉÉwWwwÉÉÁÉ?w‡ÉŒÉ‡ÉŒÉÁÉ?wÁÉ?w‡ÉŒÉ‡ÉŒÉ‡ðY‰‰à‰SÉSwSwSÉSÉSÉÓÉÓÉÓÉÓFÓFÓF­ÉFY‰Õwy–y–y–y–ÏMÏMÏwÏwdÉw‰Û²Û²Û²Û²Û²Û²×S×S×y×y”É4y‰¥F¥w¥w¥F¥F¥w¥w‚‰Éà‰`‰`‰`‰`‰`‰`‰`‰š‰¥F¥w¥F¥w ‰ ‰ ‰‰‰ ‰ ‰™‰•‰ÐFÐFÐwÐwÐFÐF͉%w%!%!%w%w%!%!Y É)É#s¿‰¿‰u`‰ z‰ ‰ ‰ ‰ ‰ ‰ ‰Ñÿìñÿì²ÿìsÿì 4ÿì õÿìñÿì²ÿìsÿì 3ÿì õÿìüÿì¿ÿì‚ÿì Eÿì ÿìñÿì²ÿìpÿì 2ÿì õÿìüÿìÿìOÿì £ÿì 3ÿìwÿìqÿì¼=½ Û{°>fq׺×$íºS‚9Á(¢ºª º3ºåqfyqyqy3/qåqåq2—Ð2Ð2©<˜ºå®•®/¼=‹V3X5xª³¼=ƒ—2—¹ZLr èuá//SçHÊ||ÿ½NÎYÅÅ÷H„G €ÿü°pû+"M"M>G/Mmu>GVGVGâTàR>GnzhuüuEuOGöGOGOGmu\#=nÂnüuV&7yûGSGé%nzu=nV&7yûKySGé%ºÊùt9‘>GöGöGOGâT_Ýÿé>G=nIÿzIIàÿVÿzá[qüuüuIÿéÖuEqOGOGâFKÿé\#^YGäu@zV&î7~7î7#7OGü[ü[ü[ü[üBüByç{}É®}ɺ}ɺ–sfq)Éq)Éq)Éq)Éq)ÉqÉìqÉìqÉìqÉìqÉìqšÉÑ/3sqɮɺÉÿíɺ\9ÿÓ\9ÿô?É¢º?É¢º?É¢ºuÉMÁuMÿýuÉ9ÿôuÉ9ÿÞçÉ˺çÉ˺çÉ˺üɺüɺüɺüɺLsåqLsåqLsåqLsåqÓɺÓɺÉJºÉJºÉJºÉJT‡+o‡+o‡+o‡+o‡+oãÿú#7ãÿú#7ãÿú#7ãÿú#7Û²®Û²®Û²®Û²®Û²®y¼=y¼=éD‹VéD‹VéD‹VéD‹VéD‹V{=¼;{=¼;ãÿü¼={\3X{\3X{\3Xº#‹V¼=ç{Ñ/yç{yç{yç{yç{yç{yç{yç{yç{yç{yç{yç{yç{ÉìqÉìqÉìqÉìqÉìqÉìqÉìqÉìq\Z9D\È9·LsåqLsåqLsåqLsåqLsåqLsåqLsåqNgåvNgåvNgåvNgåvNgåvÛ²®Û²®Ý­°Ý­°Ý­°Ý­°Ý­°ãÿü¼=ãÿü¼=ãÿü¼=ãÿü¼=FqFqFqFqFqFqFqFqyy'iªñS…S…S…S…S…S…°°ºÌ0lºººººººº²¯°¶7hx“µ›µ‘µÿ±µÿ»µµÿÓµÿ˵ÿÆ þÌêñåqåqåqåqåqåqoÉÂ̂á•¡•¡•¡•¡•¡•¡•¡•Eû.³‡³‡³‡³‡³‡³‡³‡³‡k¿·Ã‘Ç_žFqFqS…c…º<ºµÿµ¦åqåq¡•¡•³‡³‡FqFqFqFqFqFqFqFqyy'iªñºººººººº²¯°¶7hx“³‡³‡³‡³‡³‡³‡³‡³‡k¿·Ã‘Ç_žFqFqFqFqFqFqFqyy»ÿüŠy†¶†¶¶ºº<ºººpÿüøÿçrÿüøÿóɉ´¶µÿëµÿãµÿصµÿäµÿæ\ÿõ\ÍÿüDÿí~•¶¡•¡•¡•¡•ºº¡•¡•ãÿüãÿüÃÿü™ÿá{ª×ª³‡³‡³‡³‡³‡‡ÿü€ÿòaÿü›ÿÛNs†£V‹™Ìãdãddddÿì‹®‹²‹®‹²%®%®%®%®99¸3¸3­ìWìì‹Ü™ ¼q âqÑ(ý()(Ñ(ý()(¶ 3ž3Á´Ãâ“?“ÿìnÿ§nÿ§ÿª=ÝVþ‰°°`JݓݓúdìØØ=²nÿ§=™‘´Ùnÿ§´8°úN(´f´f‹Ûad´p‹Û‹ÛÇ5Wnz5?5f5\5l5Y5S9‰9‰9‰÷o÷g0u5W5‰5^5b5?5f5\5l5Y5S9‰9‰9‰÷o÷g"MVGOGuVGVs`…˺üu .É—Éé;F_( .Ð.D]1u!ªüü=ü=ü=üûPü=&C&C–süÃ#ÿÖ&<‰<ꤖoÃèI ÌÉH#Â;”jÃDNÿä‹ hÆR6”nœÈLsbBƒSVÈ,©yÉ(˜ÿü'yõ\ŸXNNîµD?ÉyJ\ ‚Ö}¼WØ¢JTšÉŽ9²högdÿûº(V FhZ —ž$Ò<ÈÊÉ|3£uuãÿüWªZì[ÏOÏÿ=;6QÁ‰Á^Á‰Á^ÁbÁ?Á‰ÁfÁ‰ÁbÁfÁl‹‰\ÉðÉ„ÉbÉyaõ ‰WÉ{=w= =uÉ–s)ÉçÉ9Á©ÁÁ~Á¼=}=í= ]=Á¼;”;;9Áfqq˺ öy)É öy se´d´£´u´£´d´£´ ´ ´ ´ ´d´u´,´´d´¥´u´¥´d´u´d´¥´u´¥´¥´d´v´d´v´d´d´*´Z´¬´Z´¬´Ý´d´-´O´Þ´p´Ó´´d´d´´£´u´u´´£´d´w´d´d´x´v´x´d´d´d´d´u´d´¥´u´¥´d´¤´ ´¼´¼´ ´d´u´d´u´£´£´d´£´u´£´k´u´7´^´H´^´^´^´@´^´^´^´u´z´z´^´u´w´u´d´u´d´d´u´d´7´u´7y‡#hÉÉø›ZÿúZÿúø¯ø¯¾Ùø¯ø¯¾Ù,œœd´Ù´Ù´ÙVþ‰Š´D‹Û===jݪݴ,¯,¯´í°ffÛÛÛÛ+uPuuu+uPuuu+u+u+uyy¡y´Ù´Ù´Ø´Ù´Ù´Ù´¢´ÙдٴٴٴٴٴٴٴٴٴٴٴٴشٴٴٴٶٶÙÏʹٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴڴڴڴÚ`”`”¶°´Ø´Ù´Ù´Ù´Ù´Ù´Ú´Ù´Ù´Ð´Ð´Ð´Ð´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ì´Ì´Ì´Ì´¾´Ù´¾´Ù´¾´¾ÛÛÛ´Ù´Ù´Ù´ÙÆÙÆÙ´»´»´»´»´»´»´»´»´»´»´»´»´»ø¯ø¯ø¯ø¯*¯*¯ø¯ø¯ø¯ø¯ø¯ø¯ø¯ø¯´Ù´Ù´Ù´Ùyy´b´y*îÛÈÛÈÛÈ´´ÿúÿúŒŒô‹ÛùÙÙÙÙٴٴٴ٠a” a”´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´á´Ù´Ù´Ù´Õ–ìììXø¯¾Ùø¯ø¯¾Ùø¯ø¯Xø¯¾Ùø¯¾ÙøÙÑJÑr’´£´£´£´£è;°Ç°Çxôxdxôxd´Ù÷´ÙÀ°À†À°À†+¯+* 8œ 8œ Pœ 8œ Œx Pü–µ¦º³‡Fq 8œü#°°°°°°°°°°£¨££¨£¨+¯´7ºü–'ÿƒ’,˜,˜,˜,˜,˜,˜,˜,˜,˜,˜ÑÿìÑÿìÑÑÈÑÿìÑÿìÑÑÈÑÿëÑÿìÑÑÈÑÑÑÈÑÈÑÿìÑÿìÑÿìÑÿìÑÑÑÈÑÈÑÿìÑÿìÑÿìÑÿìÑÑÑÈÑÈÑÈÑÈÑÈÑÈÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÑÈÑÿìÑxÑÑxÑxÑÿìÑÿìÑÿìÑÑxÑxÑÿìÑÿìÑÿìÑÑxÑxÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÑÿìÑÿìÑÑÿ“Ñÿ“Ñÿ“ÑÿìÑÑ|ÑÑÿìÑÈÑ|ÑÈÑÿìÑÈÑÿìÑÈ'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì''ÿì'ÿì'ÿì'ÿì'q'ÿì''ÿì'ÿì'ÿì'ÿì'ÿì''ÿì'ÿ캺ººººººººlºlºººgºgº'''''''''''''''''ûpôûpûrûpûpûpûpûpûpûpûpûp7p7ºTºúúúûpûp''''¸3ººººº'''ôpººººûpûpûpûp'''¤º¤ºܺܺ',«h,d,ª,ƒ,…,…•ª+ª,ª}}_}} ÷Œ ‘,¸,·,·Bš,d,˜,¬,¬,Ÿ,«,¬,¬,²ß“,±ß“,},¬,ª,dZdøª2ªEª\ª,ª,²,ª¯ª,«,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,‡,ª,ª,ª,ª,Ý,ªé¯Ù¯Ù¯,¯,S,À,ø,,ì,],·,À,ç,,m,«,E,©,À,°,A,É,â,U,¶,Q,0,É,â,U,¶,L,0,C,¹,X,ä,B,¶,X,ä,ØƬ¬,x,¼Ƶܬß­ü¬ „,¬,œ,œ,œ,œ,œ,œ,œ,œ,¬,ª,ª,ª,1ô–ô–ô–ô–ô–ô–,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,X,X,j,Æ, T},y,},),©,,,,džª¯¯¯ %¢6¯´ ´Ï´€´ ´´´ú´d´T´ ÀÒ´±Ù¯´´V´´I´V´V´x´„´³´+´¶´5´¶´X´Š´3´í´´¯´ñ´ü´p´p´p´p´R´ ´>´p´»´T´V´S´T´W´W´/´V´0´/´0´0´0´2´„´˜´p´@´T´»´T´T´T´p´§´§´¡´¡´n´n´T´V´¡´¶´œ´‚´¡´a´a´T´T,f,z,z,z,z,ª´´°´”®”xN®Nx´>´ž´N´n´X´~´ ´‘´‘´´´¹´Û´#´9´U´w´Ä´l´f´¡,˜,˜,˜,˜,˜,˜,˜,˜,˜,˜´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´u´ü´u´ü´u´u´u´u´u´u´u´ä´ä´ä´u´u´ì´u´u´u´+´+´´´´´<´‚´¥´u´§´§´u´§´s´–´¢´¢´uôö°ö¯·¤s·s¤´[´Y´O´O Bu xd xu xd xd xu xd xd xu xd xu xuÜÜ,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,´d´u´´wOwOßß´ÙÙÙÙÙÙÙÙô´Ù´Ù::: šu+u+u+u+u+u+u+u+u+u+u+ÿ¾+u+u+u+u+k´´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ú´Ú´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´µ´ ´µ´ ´7´7´^´^´µ´ ´µ´ ´7´^°u°u°H°Hºººº''''ºô$ü–ü–ü"u 9 uÿ×Ó ÉçH#ÿèɺ?É¢º{\3X@sçÉyà= D±V¼h<É‹ÁGp,qssu@xC@~–yyɃv–ÿÛ{\í–{\ssg–)É?>8–{\(–ÉoŸo:oüÉ÷Ì\É:o\ÉŸcssÉÉþ–ss–s$d{=–súÉyÉÉNs‰ÉNs6,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ªЖЖåqƒ/ / /¼/¼/}/ão « ® ‘® }® <®^ºVô¶NÙ 1X?º,X¿X׺uXX´ÙeºeºeºeºN²N²N²>X¡CÜX†º°Q~Xwº°Q"XTXXäX¦X,X6ºTºC€º"XeºÎ.º>XTXTºXˆ‚Û:ÿìjÿ숂Û:ÿìjÿ숂Û:ÿìjÿ숂Û:ÿìjÿ숂Û:ÿìjÿ숂Û:ÿìjÿìKHÓÿì ÿìKHÓÿì ÿì**òÿì*ÿì**òÿì*ÿì**òÿì*ÿì**òÿì*ÿìÝÿ«jÿ«Ýÿ«jÿ«)‚)‚Ïÿìkÿì)‚)‚Ïÿìkÿìà““Ýÿ«"ÿ«:ÿìjÿìC‚«‚:ÿìjÿìüpý*XXÿìXiXXXÿìXXÿìXXÿìXÿôXÿìXXÿìã9ÿµpÿµ9lplÝÿ«"ÿ«9lplC‚«‚:ÿìjÿì9ÁpÁˆ‚Û:ÿìjÿì1‹J‘ˆ‚Û:ÿìjÿ숂Û:ÿìjÿì**òÿì*ÿì**òÿì*ÿì**òÿì*ÿì}3}}3}Ýÿ«jÿ«Ýÿ«jÿ« Ä‚ 3‚´ÿì#ÿì Ä‚ 3‚´ÿì#ÿì ¬‚ Í‚Ëÿìðÿì ¬‚ Í‚Ëÿìðÿìf˜^ÿìÿìf˜^ÿìÿìÆuBuÆÿìÜÿìÆuBu/ÿìÜÿìKHÓÿì ÿì5k¬kÓÿì ÿ옾ÏÿìkÿìÐpÿì¦ÿìôŒSŒIÿì ÿìà““:ÿìjÿì1‹J‘8ÿì°ÿìÝÿ«"ÿ«C‚«‚C‚«‚:ÿìjÿìÿ.Æÿ.ÿåÆÿåÆTÆT4,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ªíÙÉèÖÉcÉ3s$f"ÿ–É=É3ÄLrˆªÿú¤±ÈÝDrl¨ÿü{ª”fqª”ìo¹/ªqåºÏæÏÿ×5ºÏæ "ºåºåqªqªqߺ+o¹7ê±Ü=HVhLÿ=¸Xy}É–s)ÉÉšÉ3sÉ\É\ÿ–?ÉuÉçÉüÉLsÓÉLsɇãÿúÛ²yéD{=ãÿü{\ç{ºfqqìqÑ/qº9Á9ÿÛ¢º9Á˺ºåqºqJº+o#7®¼=‹V¼;¼=3X‡á–œdž¨‹ÿ¹ü×ýsü¶ý üÏüÏüÇüÇýšüæüN––Û:ÿìjÿìHÓÿì ÿì¬kÓÿì ÿì:ÿìjÿì¶Û:ÿìjÿìÛ:ÿìjÿì*òÿì*ÿì*òÿì*ÿì*òÿì*ÿì*òÿì*ÿì_üÕ9îþòx’x’x’x“x“x’x’xvx‹xvx‹xvx‹x‹xvxvxƒxƒxƒx‹ü,âÿ«âÿ«pÿì¦ÿì«‚:ÿìjÿìjÿ«9ÁJ‘–qâq9–ÏOÏÿ9ÿÓ9·²ðŒ—´­ÈÈÈÈÈÈÜÜ:Á:ÿì:ÿì’q’ÿì’ÿìd=dÿìdÿì¼=¼ÿì¼ÿì;º;ÿì;ÿì;º;ÿì;ÿìÀqÀÿìÀÿì;º;ÿì;ÿì¡q¡ÿì¡ÿìÁÿìÿì=ÿìÿìxºxÿìxÿìåÁåÿìåÿìÍ=ÍÿìÍÿì¬Á¬ÿì¬ÿìÈ=ÈÿìÈÿìD=DÿìDÿì;º;ÿì;ÿì=ÿìÿìßÁßÿìßÿì=Á=ÿì=ÿìËpËÿìËÿìÈ=ÈÿìÈÿì=ÿìÿìÀqÀÿìÀÿì=Á=ÿì=ÿì=Á=ÿì=ÿì.Á.ÿì.ÿìÀqÀÿìÀÿìÀqÀÿìÀÿìüì,ª,ª,ª,ª,ª,ª,ª,ª³—.ÉjÁ?< þ0 ô$ÿÓ%ÿ·*K-r294K7ÿD9ÿˆ:ÿ­;ÿš<ÿ R&YÿÉ\ÿÜ‚ÿÓƒÿÓ„ÿÓ…ÿÓ†ÿÓ”9•9–9—9˜9Ÿÿ ´&µ&¶&·&¸&¿ÿÜÁÿÜÂÿÓÄÿÓÆÿÓàK&ÿD:ÿ $ÿÓ$ÿÜ$ÿÜ$$9$&ÿÜ$*ÿÜ$2ÿÜ$4ÿÜ$7ÿa$9ÿ}$:ÿ$<ÿa$FÿÜ$GÿÜ$HÿÜ$Iÿ·$RÿÜ$TÿÜ$WÿÜ$Yÿˆ$Zÿ­$\ÿu$mÿ·$‚9$ƒ9$„9$…9$†9$‰ÿÜ$”ÿÜ$•ÿÜ$–ÿÜ$—ÿÜ$˜ÿÜ$Ÿÿa$©ÿÜ$ªÿÜ$«ÿÜ$¬ÿÜ$­ÿÜ$´ÿÜ$µÿÜ$¶ÿÜ$·ÿÜ$¸ÿÜ$¿ÿu$Áÿu$Â9$Ä9$Æ9$ÈÿÜ$ÉÿÜ$ÊÿÜ$ËÿÜ$ÌÿÜ$ÍÿÜ$ÎÿÜ$ÏÿÜ$ÑÿÜ$ÓÿÜ$ÕÿÜ$×ÿÜ$ÙÿÜ$ÛÿÜ$ÝÿÜ$ÞÿÜ$àÿÜ$âÿÜ$ÿÜ$ÿÜ$ÿÜ$ÿÜ$ÿÜ$ÿÜ$$ÿa$%ÿÜ$&ÿa$'ÿÜ$6ÿ$7ÿ­$8ÿa$9ÿu$:ÿa$ˆÿÜ$¬ÿÜ$­ÿÜ$®ÿÜ$¯ÿÜ$Üÿa$ÝÿÜ$ðÿÜ$óÿÜ$ôÿa$õÿu$ +ÿ$ ,ÿ­$ -ÿ$ .ÿ­$ /ÿ$ 0ÿ­$ ™ÿa$ šÿu$ ¦þø$ §ÿ$ ¨/%&ÿÜ%*ÿÜ%2ÿÜ%6ÿÜ%9ÿÁ%:ÿ·%<ÿ%mÿÁ%}ÿÜ%‰ÿÜ%”ÿÜ%•ÿÜ%–ÿÜ%—ÿÜ%˜ÿÜ%Ÿÿ%ÈÿÜ%ÊÿÜ%ÌÿÜ%ÎÿÜ%ÞÿÜ%àÿÜ%âÿÜ%äÿÜ%ÿÜ%ÿÜ%ÿÜ%ÿÜ%ÿÜ% ÿÜ%"ÿÜ%6ÿ·%8ÿ%:ÿ%¬ÿÜ%®ÿÜ%ÚÿÜ%ðÿÜ% +ÿ·% -ÿ·% /ÿ·% ™ÿ% ¦ÿ% §ÿ% ¨ÿ­&<ÿÜ&mÿÜ&}ÿÜ&ŸÿÜ&8ÿÜ&:ÿÜ&ôÿÜ& ™ÿÜ& §&'$ÿÜ'9ÿÜ'<ÿ'mÿÜ'}ÿÜ'‚ÿÜ'ƒÿÜ'„ÿÜ'…ÿÜ'†ÿÜ'Ÿÿ'ÂÿÜ'ÄÿÜ'ÆÿÜ'8ÿ':ÿ'ôÿ' ™ÿ' ¦ÿÓ' §ÿÉ' ¨ÿD)þ·)ÿa)$ÿD)6ÿÜ)7ÿÜ)DÿD)Hÿ)Lÿk)Rÿ·)Uÿk)Xÿ)\ÿD)‚ÿD)ƒÿD)„ÿD)…ÿD)†ÿD)¢ÿD)£ÿD)¤ÿD)¥ÿD)¦ÿD)§ÿD)ªÿ)«ÿ)¬ÿ)­ÿ)´ÿ·)µÿ·)¶ÿ·)·ÿ·)¸ÿ·)»ÿ)¼ÿ)½ÿ)¾ÿ)¿ÿD)ÁÿD)ÂÿD)ÃÿD)ÄÿD)ÅÿD)ÆÿD)ÇÿD)Õÿ)×ÿ)Ùÿ)Ûÿ)Ýÿ)ñÿk)õÿk)ÿ·)ÿ·)ÿ·)ÿk)ÿk)ÿk)ÿÜ)ÿÜ) ÿÜ)"ÿÜ)$ÿÜ)&ÿÜ)(ÿÜ)+ÿ)-ÿ)/ÿ)1ÿ)3ÿ)5ÿ)9ÿD)­ÿ·)¯ÿ·)ÚÿÜ)ÜÿÜ)ñÿ·)õÿD) šÿD) ¦ÿÓ) ¨þˆ*7ÿ·*<ÿš*mÿÜ*}ÿÜ*Ÿÿš*&ÿ·*:ÿš* ¦ÿÓ* §ÿÓ* ¨ÿÉ+ÿÜ+ ¦ÿ·+ §ÿÁ+ ¨ÿ·-ÿ·-$ÿÜ-mÿÜ-}ÿÜ-‚ÿÜ-ƒÿÜ-„ÿÜ-…ÿÜ-†ÿÜ- ¦ÿ·- §ÿÁ- ¨ÿ.ÿ).$ÿÜ.&ÿ.2ÿ.7ÿa.8ÿÉ.:ÿ·.<ÿ·.DÿÜ.Hÿš.Rÿš.Xÿš.\ÿk.mÿ}.‚ÿÜ.ƒÿÜ.„ÿÜ.…ÿÜ.†ÿÜ.‰ÿ.”ÿ.•ÿ.–ÿ.—ÿ.˜ÿ.›ÿÉ.œÿÉ.ÿÉ.žÿÉ.Ÿÿ·.¢ÿÜ.£ÿÜ.¤ÿÜ.¥ÿÜ.¦ÿÜ.§ÿÜ.ªÿš.«ÿš.¬ÿš.­ÿš.´ÿš.µÿš.¶ÿš.·ÿš.¸ÿš.»ÿš.¼ÿš.½ÿš.¾ÿš.¿ÿk.Áÿk.Èÿ.Îÿ.Ýÿš.&ÿa.0ÿÉ.1ÿš.:ÿ·. ¦ÿÁ. §ÿÁ/ÿÜ/$//2ÿ·/7þæ/8ÿš/9ÿ/:ÿD/<þð/HÿÜ/RÿÜ/XÿÜ/\ÿD/‚//ƒ//„//…//†//”ÿ·/•ÿ·/–ÿ·/—ÿ·/˜ÿ·/›ÿš/œÿš/ÿš/žÿš/Ÿþð/ªÿÜ/«ÿÜ/¬ÿÜ/­ÿÜ/´ÿÜ/µÿÜ/¶ÿÜ/·ÿÜ/¸ÿÜ/»ÿÜ/¼ÿÜ/½ÿÜ/¾ÿÜ/¿ÿD/ÁÿD/ÝÿÜ/&þæ/0ÿš/1ÿÜ/:þð/ ¦þa/ §ýæ292ÿ­2ÿÜ2$ÿÜ29ÿÜ2;ÿ}2<ÿ2mÿÜ2‚ÿÜ2ƒÿÜ2„ÿÜ2…ÿÜ2†ÿÜ2Ÿÿ2:ÿ2 ¦ÿÓ2 §ÿÜ2 ¨ÿD3ÿÓ3þÁ3$ÿ}3<ÿÓ3Dÿ¤3Hÿ·3LÿÓ3QÿÜ3Rÿ·3UÿÜ3VÿÜ3XÿÜ3mÿÜ3‚ÿ}3ƒÿ}3„ÿ}3…ÿ}3†ÿ}3ŸÿÓ3¢ÿ¤3£ÿ¤3¤ÿ¤3¥ÿ¤3¦ÿ¤3§ÿ¤3ªÿ·3«ÿ·3¬ÿ·3­ÿ·3³ÿÜ3´ÿ·3µÿ·3¶ÿ·3·ÿ·3¸ÿ·3»ÿÜ3¼ÿÜ3½ÿÜ3¾ÿÜ3Ýÿ·3 ÿÜ3ÿÜ3ÿÜ3!ÿÜ3#ÿÜ31ÿÜ3:ÿÓ3 ¦&3 §&3 ¨þ·494 ¦ÿÓ4 §ÿÜ4 ¨ÿ}5ÿ­5ÿ·5ÿÁ5$ÿ­5&ÿš57ÿk59ÿ5:ÿ­5<ÿ}5DÿÓ5Hÿ¤5Rÿ¤5Xÿ¤5\ÿ5mÿ5}ÿÜ5‚ÿ­5ƒÿ­5„ÿ­5…ÿ­5†ÿ­5‰ÿš5Ÿÿ}5¢ÿÓ5£ÿÓ5¤ÿÓ5¥ÿÓ5¦ÿÓ5§ÿÓ5ªÿ¤5«ÿ¤5¬ÿ¤5­ÿ¤5´ÿ¤5µÿ¤5¶ÿ¤5·ÿ¤5¸ÿ¤5»ÿ¤5¼ÿ¤5½ÿ¤5¾ÿ¤5¿ÿ5Áÿ5Èÿš5Îÿš5Ýÿ¤5&ÿk51ÿ¤5:ÿ}5 ¦ÿk5 §ÿ}5 ¨ÿÜ6$&6‚&6ƒ&6„&6…&6†&7ÿD7ÿ 7ÿ7$ÿa7&ÿˆ77ÿÜ7Dþ­7Fþ¤7Hþ¤7LÿÁ7Rþ¤7UþÓ7Vþ­7XþÉ7Zþ­7\þÁ7mÿD7}ÿ7‚ÿa7ƒÿa7„ÿa7…ÿa7†ÿa7‰ÿˆ7¢ÿ7£þ­7¤ÿ7¥ÿ7¦ÿ7§ÿ7©þ¤7ªþà7«þ¤7¬þà7­þà7´þô7µþ¤7¶þô7·þô7¸þô7»þç7¼þÉ7½þç7¾þç7¿þÁ7ÁþÁ7Èÿˆ7Éþ¤7Îÿˆ7Ïþ¤7Ýþ¤7þÓ7þÓ7!þ­7#þ­7&ÿÜ71þÉ7 §ÿÓ7 ¨þø8=ÿÜ8?ÿÜ9ÿˆ9þø9ÿY9$ÿ}92ÿÜ9Dÿa9Hÿa9LÿÓ9Rÿa9Xÿu9\ÿÉ9mÿN9}ÿ9‚ÿ}9ƒÿ}9„ÿ}9…ÿ}9†ÿ}9”ÿÜ9•ÿÜ9–ÿÜ9—ÿÜ9˜ÿÜ9¢ÿa9£ÿa9¤ÿa9¥ÿa9¦ÿa9§ÿa9ªÿa9«ÿa9¬ÿa9­ÿa9´ÿa9µÿa9¶ÿa9·ÿa9¸ÿa9»ÿu9¼ÿu9½ÿu9¾ÿu9¿ÿÉ9ÁÿÉ9Ýÿa91ÿu9 ¨þæ:ÿ­:ÿ:ÿˆ:$ÿ:Dÿ}:Hÿˆ:LÿÓ:Rÿˆ:Uÿ¤:Xÿ·:\ÿÜ:mÿ:}ÿÜ:‚ÿ:ƒÿ:„ÿ:…ÿ:†ÿ:¢ÿ}:£ÿ}:¤ÿ}:¥ÿ}:¦ÿ}:§ÿ}:ªÿˆ:«ÿˆ:¬ÿˆ:­ÿˆ:´ÿˆ:µÿˆ:¶ÿˆ:·ÿˆ:¸ÿˆ:»ÿ·:¼ÿ·:½ÿ·:¾ÿ·:¿ÿÜ:ÁÿÜ:Ýÿˆ:ÿ¤:ÿ¤:1ÿ·: ¦ÿÜ: ¨þø;ÿš;&ÿk;2ÿ};7ÿÜ;Hÿ¤;mÿ;‰ÿk;”ÿ};•ÿ};–ÿ};—ÿ};˜ÿ};ªÿ¤;«ÿ¤;¬ÿ¤;­ÿ¤;Èÿk;Îÿk;Ýÿ¤;&ÿÜ; ¦ÿa; §ÿ­; ¨ÿÓ<ÿ <þa<þð<$ÿa<&ÿ<2ÿ<Dþæ<Hþð<Lÿ·<Rþð<Xÿ<mÿ<}ÿk<‚ÿa<ƒÿa<„ÿa<…ÿa<†ÿa<‰ÿ<”ÿ<•ÿ<–ÿ<—ÿ<˜ÿ<¢þæ<£þæ<¤þæ<¥þæ<¦þæ<§þæ<ªþð<«þð<¬þð<­þð<´þð<µþð<¶þð<·þð<¸þð<»ÿ<¼ÿ<½ÿ<¾ÿ<Èÿ<Îÿ<Ýþð<1ÿ< ¦ÿ< §ÿÜ< ¨þø=ÿÜ= ¦ÿÜ= §ÿÜ= ¨ÿÜH[ÿÜIÿIÿkIÿ·IWÿÜIZÿÜI\ÿÜImÿ·I}ÿÜI¿ÿÜIÁÿÜI'ÿÜI ¦AI ¨ÿNDÿÜNHÿ·NRÿ·NXÿÁN\ÿ·N¢ÿÜN£ÿÜN¤ÿÜN¥ÿÜN¦ÿÜN§ÿÜNªÿ·N«ÿ·N¬ÿ·N­ÿ·N´ÿ·Nµÿ·N¶ÿ·N·ÿ·N¸ÿ·N»ÿÁN¼ÿÁN½ÿÁN¾ÿÁN¿ÿ·NÁÿ·NÝÿ·N1ÿÁQ ¦ÿkQ §ÿQ ¨ÿ¤R&RÿÜR[ÿÁR ¦ÿkR §ÿ·R ¨ÿ}Uÿ}UÿDUÿÜUFÿÓUGÿÜUHÿÓUJÿÜUKÿÜUPÿÜUQÿÜURÿÓUTÿÜUUÿÜU[ÿÉUmÿ·U©ÿÓUªÿÓU«ÿÓU¬ÿÓU­ÿÓU³ÿÜU´ÿÓUµÿÓU¶ÿÓU·ÿÓU¸ÿÓUÉÿÓUÏÿÓUÑHUÝÿÓUáÿÜU ÿÜUÿÜUÿÜU §VU ¨þÉYÿÉYÿaYÿYmÿÜY}ÿÜY §ÿÜY ¨þðZÿDZÿZmÿÜZ}ÿÜZ ¨ÿ)[FÿÜ[HÿÁ[RÿÁ[©ÿÜ[ªÿÁ[«ÿÁ[¬ÿÁ[­ÿÁ[´ÿÁ[µÿÁ[¶ÿÁ[·ÿÁ[¸ÿÁ[ÉÿÜ[ÏÿÜ[ÝÿÁ\ÿÜ\þÜ\ÿk\mÿÜ\}ÿÜ\ ¨þÓm%ÿÜm&ÿÜm'ÿÜm*ÿÜm-ÿÜm7ÿm9ÿm:ÿÜm<ÿkmYÿÜmZÿÜm\ÿÜmˆ—m‰ÿÜmŸÿkm¿ÿÜmÁÿÜmÈÿÜmÎÿÜmÐÿÜmàÿÜm&ÿm:ÿk}$ÿ·}%ÿ·}&ÿÜ}'ÿÜ}-ÿÜ}2ÿÜ}7ÿD}9ÿN}:ÿ};ÿ}<ÿ}YÿÜ}ZÿÜ}\ÿÜ}‚ÿ·}ƒÿ·}„ÿ·}…ÿ·}†ÿ·}‰ÿÜ}”ÿÜ}•ÿÜ}–ÿÜ}—ÿÜ}˜ÿÜ}Ÿÿ}¿ÿÜ}ÁÿÜ}ÈÿÜ}ÎÿÜ}ÐÿÜ}&ÿD}:ÿ‚ÿÓ‚ÿÜ‚ÿÜ‚$9‚&ÿÜ‚*ÿÜ‚2ÿÜ‚4ÿÜ‚7ÿa‚9ÿ}‚:ÿ‚<ÿa‚FÿÜ‚GÿÜ‚HÿÜ‚Iÿ·‚RÿÜ‚TÿÜ‚WÿÜ‚Yÿˆ‚Zÿ­‚\ÿu‚mÿ·‚‚9‚ƒ9‚„9‚…9‚†9‚‰ÿÜ‚”ÿÜ‚•ÿÜ‚–ÿÜ‚—ÿÜ‚˜ÿÜ‚Ÿÿa‚©ÿÜ‚ªÿÜ‚«ÿÜ‚¬ÿÜ‚­ÿÜ‚´ÿÜ‚µÿÜ‚¶ÿÜ‚·ÿÜ‚¸ÿÜ‚¿ÿu‚Áÿu‚Â9‚Ä9‚Æ9‚ÈÿÜ‚ÉÿÜ‚ÊÿÜ‚ÌÿÜ‚ÍÿÜ‚ÎÿÜ‚ÏÿÜ‚ÑÿÜ‚ÕÿÜ‚×ÿÜ‚ÙÿÜ‚ÛÿÜ‚ÝÿÜ‚ÞÿÜ‚àÿÜ‚âÿÜ‚ÿÜ‚ÿÜ‚ÿÜ‚ÿÜ‚ÿÜ‚ÿÜ‚$ÿa‚%ÿÜ‚&ÿa‚'ÿÜ‚6ÿ‚7ÿ­‚8ÿa‚9ÿu‚:ÿa‚ðÿÜ‚ñÿÜ‚ +ÿ‚ .ÿ­‚ /ÿ‚ 0ÿ­‚ ™ÿa‚ šÿu‚ ¦þø‚ §ÿ‚ ¨/ƒÿÓƒÿ܃ÿ܃$9ƒ&ÿ܃*ÿ܃2ÿ܃4ÿ܃7ÿaƒ9ÿ}ƒ:ÿƒ<ÿaƒFÿ܃Gÿ܃Hÿ܃Iÿ·ƒRÿ܃Tÿ܃Wÿ܃YÿˆƒZÿ­ƒ\ÿuƒmÿ·ƒ‚9ƒƒ9ƒ„9ƒ…9ƒ†9ƒ‰ÿ܃”ÿ܃•ÿ܃–ÿ܃—ÿ܃˜ÿ܃Ÿÿaƒ©ÿ܃ªÿ܃«ÿ܃¬ÿ܃­ÿ܃´ÿ܃µÿ܃¶ÿ܃·ÿ܃¸ÿ܃¿ÿuƒÁÿuƒÂ9ƒÄ9ƒÆ9ƒÈÿ܃Éÿ܃Êÿ܃Ìÿ܃Íÿ܃Îÿ܃Ïÿ܃Ñÿ܃Õÿ܃×ÿ܃Ùÿ܃Ûÿ܃Ýÿ܃Þÿ܃àÿ܃âÿ܃ÿ܃ÿ܃ÿ܃ÿ܃ÿ܃ÿ܃$ÿaƒ%ÿ܃&ÿaƒ'ÿ܃6ÿƒ7ÿ­ƒ8ÿaƒ9ÿuƒ:ÿaƒðÿ܃ñÿ܃ +ÿƒ -ÿƒ .ÿ­ƒ /ÿƒ 0ÿ­ƒ ™ÿaƒ šÿuƒ ¦þøƒ §ÿƒ ¨/„ÿÓ„ÿÜ„ÿÜ„$9„&ÿÜ„*ÿÜ„2ÿÜ„4ÿÜ„7ÿa„9ÿ}„:ÿ„<ÿa„FÿÜ„GÿÜ„HÿÜ„Iÿ·„RÿÜ„TÿÜ„WÿÜ„Yÿˆ„Zÿ­„\ÿu„mÿ·„‚9„ƒ9„„9„…9„†9„‰ÿÜ„”ÿÜ„•ÿÜ„–ÿÜ„—ÿÜ„˜ÿÜ„Ÿÿa„©ÿÜ„ªÿÜ„«ÿÜ„¬ÿÜ„­ÿÜ„´ÿÜ„µÿÜ„¶ÿÜ„·ÿÜ„¸ÿÜ„¿ÿu„Áÿu„Â9„Ä9„Æ9„ÈÿÜ„ÉÿÜ„ÊÿÜ„ÌÿÜ„ÍÿÜ„ÎÿÜ„ÏÿÜ„ÑÿÜ„ÕÿÜ„×ÿÜ„ÙÿÜ„ÛÿÜ„ÝÿÜ„ÞÿÜ„àÿÜ„âÿÜ„ÿÜ„ÿÜ„ÿÜ„ÿÜ„ÿÜ„ÿÜ„$ÿa„%ÿÜ„&ÿa„'ÿÜ„6ÿ„7ÿ­„8ÿa„9ÿu„:ÿa„ðÿÜ„ñÿÜ„ +ÿ„ -ÿ„ .ÿ­„ /ÿ„ 0ÿ­„ ™ÿa„ šÿu„ ¦þø„ §ÿ„ ¨/…ÿÓ…ÿÜ…ÿÜ…$9…&ÿÜ…*ÿÜ…2ÿÜ…4ÿÜ…7ÿa…9ÿ}…:ÿ…<ÿa…FÿÜ…GÿÜ…HÿÜ…Iÿ·…RÿÜ…TÿÜ…WÿÜ…Yÿˆ…Zÿ­…\ÿu…mÿ·…‚9…ƒ9…„9……9…†9…‰ÿÜ…”ÿÜ…•ÿÜ…–ÿÜ…—ÿÜ…˜ÿÜ…Ÿÿa…©ÿÜ…ªÿÜ…«ÿÜ…¬ÿÜ…­ÿÜ…´ÿÜ…µÿÜ…¶ÿÜ…·ÿÜ…¸ÿÜ…¿ÿu…Áÿu…Â9…Ä9…Æ9…ÈÿÜ…ÉÿÜ…ÊÿÜ…ÌÿÜ…ÍÿÜ…ÎÿÜ…ÏÿÜ…ÑÿÜ…ÕÿÜ…×ÿÜ…ÙÿÜ…ÛÿÜ…ÝÿÜ…ÞÿÜ…àÿÜ…âÿÜ…ÿÜ…ÿÜ…ÿÜ…ÿÜ…ÿÜ…ÿÜ…$ÿa…%ÿÜ…&ÿa…'ÿÜ…6ÿ…7ÿ­…8ÿa…9ÿu…:ÿa…ðÿÜ… +ÿ… -ÿ… .ÿ­… /ÿ… 0ÿ­… ™ÿa… šÿu… ¦þø… §ÿ… ¨/†ÿÓ†ÿ܆ÿ܆$9†&ÿ܆*ÿ܆2ÿ܆4ÿ܆7ÿa†9ÿ}†:ÿ†<ÿa†Fÿ܆Gÿ܆Hÿ܆Iÿ·†Rÿ܆Tÿ܆Wÿ܆Yÿˆ†Zÿ­†\ÿu†mÿ·†‚9†ƒ9†„9†…9††9†‰ÿ܆”ÿ܆•ÿ܆–ÿ܆—ÿ܆˜ÿ܆Ÿÿa†©ÿ܆ªÿ܆«ÿ܆¬ÿ܆­ÿ܆´ÿ܆µÿ܆¶ÿ܆·ÿ܆¸ÿ܆¿ÿu†Áÿu†Â9†Ä9†Æ9†Èÿ܆Éÿ܆Êÿ܆Ìÿ܆Íÿ܆Îÿ܆Ïÿ܆Ñÿ܆Õÿ܆×ÿ܆Ùÿ܆Ûÿ܆Ýÿ܆Þÿ܆àÿ܆âÿ܆ÿ܆ÿ܆ÿ܆ÿ܆ÿ܆ÿ܆$ÿa†%ÿ܆&ÿa†'ÿ܆6ÿ†7ÿ­†8ÿa†9ÿu†:ÿa†ðÿ܆ñÿ܆ +ÿ† -ÿ† .ÿ­† /ÿ† 0ÿ­† ™ÿa† šÿu† ¦þø† §ÿ† ¨/ˆ ¦ÿ­ˆ §ÿ¤ˆ ¨ÿ‰<ÿ܉mÿ܉}ÿ܉Ÿÿ܉:ÿ܉ §&’$ÿÜ’9ÿÜ’<ÿ’mÿÜ’}ÿÜ’‚ÿÜ’ƒÿÜ’„ÿÜ’…ÿÜ’†ÿÜ’Ÿÿ’ÂÿÜ’ÄÿÜ’ÆÿÜ’8ÿ’:ÿ’ôÿ’ ™ÿ’ ¦ÿÓ’ §ÿÉ’ ¨ÿD”9”ÿ­”ÿÜ”$ÿÜ”9ÿÜ”;ÿ}”<ÿ”mÿÜ”‚ÿÜ”ƒÿÜ”„ÿÜ”…ÿÜ”†ÿÜ”Ÿÿ”:ÿ” ¦ÿÓ” §ÿÜ” ¨ÿD•9•ÿ­•ÿÜ•$ÿÜ•9ÿÜ•;ÿ}•<ÿ•mÿÜ•‚ÿÜ•ƒÿÜ•„ÿÜ•…ÿÜ•†ÿÜ•Ÿÿ•:ÿ• ¦ÿÓ• §ÿÜ• ¨ÿD–9–ÿ­–ÿÜ–$ÿÜ–9ÿÜ–;ÿ}–<ÿ–mÿÜ–‚ÿÜ–ƒÿÜ–„ÿÜ–…ÿÜ–†ÿÜ–Ÿÿ–:ÿ– ¦ÿÓ– §ÿÜ– ¨ÿD—9—ÿ­—ÿÜ—$ÿÜ—9ÿÜ—;ÿ}—<ÿ—mÿÜ—‚ÿÜ—ƒÿÜ—„ÿÜ—…ÿÜ—†ÿÜ—Ÿÿ—:ÿ— ¦ÿÓ— §ÿÜ— ¨ÿD˜9˜ÿ­˜ÿܘ$ÿܘ9ÿܘ;ÿ}˜<ÿ˜mÿܘ‚ÿܘƒÿܘ„ÿܘ…ÿܘ†ÿܘŸÿ˜:ÿ˜ ¦ÿÓ˜ §ÿܘ ¨ÿD›=ÿÜ›?ÿÜœ=ÿÜœ?ÿÜ=ÿÜ?ÿÜž=ÿÜž?ÿÜŸÿ ŸþaŸþðŸ$ÿaŸ&ÿŸ2ÿŸDþæŸHþðŸLÿ·ŸRþðŸXÿŸmÿŸ}ÿkŸ‚ÿaŸƒÿaŸ„ÿaŸ…ÿaŸ†ÿaŸ‰ÿŸ”ÿŸ•ÿŸ–ÿŸ—ÿŸ˜ÿŸ¢þ柣þ柤þ查þ柦þ柧þ柪þðŸ«þðŸ¬þðŸ­þðŸ´þðŸµþðŸ¶þðŸ·þðŸ¸þðŸ»ÿŸ¼ÿŸ½ÿŸ¾ÿŸÈÿŸÎÿŸÝþðŸ1ÿŸ ¦ÿŸ §ÿÜŸ ¨þø ÿk ÿ·  ¦ÿÜ  ¨ÿD¡&¡ ¦ÿ¡ §ÿ¡ ¨ÿ­ª[ÿÜ«[ÿܬ[ÿÜ­[ÿܲ ¦ÿ¤² §ÿ² ¨ÿ·³ ¦ÿk³ §ÿ³ ¨ÿ¤´&´ÿÜ´[ÿÁ´ ¦ÿk´ §ÿ·´ ¨ÿ}µ&µÿܵ[ÿÁµ ¦ÿkµ §ÿ·µ ¨ÿ}¶&¶ÿܶ[ÿÁ¶ ¦ÿk¶ §ÿ·¶ ¨ÿ}·&·ÿÜ·[ÿÁ· ¦ÿk· §ÿ·· ¨ÿ}¸&¸ÿܸ[ÿÁ¸ ¦ÿk¸ §ÿ·¸ ¨ÿ}¿ÿÜ¿þÜ¿ÿk¿mÿÜ¿}ÿÜ¿ ¨þÓÁÿÜÁþÜÁÿkÁmÿÜÁ}ÿÜÁ ¨þÓÂÿÓÂÿÜÂÿÜÂ$9Â&ÿÜÂ*ÿÜÂ2ÿÜÂ4ÿÜÂ7ÿaÂ9ÿ}Â:ÿÂ<ÿaÂFÿÜÂGÿÜÂHÿÜÂIÿ·ÂRÿÜÂTÿÜÂWÿÜÂYÿˆÂZÿ­Â\ÿuÂmÿ·Â‚9ƒ9„9Â…9†9”ÿÜ•ÿÜ–ÿÜ—ÿܘÿÜŸÿa©ÿܪÿÜ«ÿܬÿÜ­ÿÜ´ÿܵÿܶÿÜ·ÿܸÿÜ¿ÿuÂÁÿuÂÂ9ÂÄ9ÂÆ9ÂÈÿÜÂÊÿÜÂÌÿÜÂÍÿÜÂÎÿÜÂÑÿÜÂÓÿÜÂÕÿÜÂ×ÿÜÂÙÿÜÂÛÿÜÂÝÿÜÂÞÿÜÂâÿÜÂÿÜÂÿÜÂÿÜÂÿÜÂÿÜÂÿÜÂ$ÿaÂ%ÿÜÂ&ÿaÂ'ÿÜÂ6ÿÂ7ÿ­Â8ÿaÂ9ÿuÂ:ÿaÂðÿÜÂñÿÜ +ÿ -ÿ .ÿ­Â /ÿ 0ÿ­Â ™ÿa šÿu ¦þøÂ §ÿ ¨/ÄÿÓÄÿÜÄÿÜÄ$9Ä&ÿÜÄ*ÿÜÄ2ÿÜÄ4ÿÜÄ7ÿaÄ9ÿ}Ä:ÿÄ<ÿaÄFÿÜÄGÿÜÄHÿÜÄIÿ·ÄRÿÜÄTÿÜÄWÿÜÄYÿˆÄZÿ­Ä\ÿuÄmÿ·Ä‚9ă9Ä„9Ä…9Ć9Ä”ÿÜÄ•ÿÜÄ–ÿÜÄ—ÿÜĘÿÜÄŸÿaÄ©ÿÜĪÿÜÄ«ÿÜĬÿÜÄ­ÿÜÄ´ÿÜĵÿÜĶÿÜÄ·ÿÜĸÿÜÄ¿ÿuÄÁÿuÄÂ9ÄÄ9ÄÆ9ÄÈÿÜÄÊÿÜÄÌÿÜÄÍÿÜÄÎÿÜÄÑÿÜÄÓÿÜÄÕÿÜÄ×ÿÜÄÙÿÜÄÛÿÜÄÝÿÜÄÞÿÜÄâÿÜÄÿÜÄÿÜÄÿÜÄÿÜÄÿÜÄÿÜÄ$ÿaÄ%ÿÜÄ&ÿaÄ'ÿÜÄ6ÿÄ7ÿ­Ä8ÿaÄ9ÿuÄ:ÿaÄðÿÜÄñÿÜÄ +ÿÄ -ÿÄ .ÿ­Ä /ÿÄ 0ÿ­Ä ™ÿaÄ šÿuÄ ¦þøÄ §ÿÄ ¨/ÆÿÓÆÿÜÆÿÜÆ$9Æ&ÿÜÆ*ÿÜÆ2ÿÜÆ4ÿÜÆ7ÿaÆ9ÿ}Æ:ÿÆ<ÿaÆFÿÜÆGÿÜÆHÿÜÆIÿ·ÆRÿÜÆTÿÜÆWÿÜÆYÿˆÆZÿ­Æmÿ·Æ‚9ƃ9Æ„9Æ…9Ɔ9Æ”ÿÜÆ•ÿÜÆ–ÿÜÆ—ÿÜÆ˜ÿÜÆŸÿaÆ©ÿÜÆªÿÜÆ«ÿÜÆ¬ÿÜÆ­ÿÜÆ´ÿÜÆµÿÜÆ¶ÿÜÆ·ÿÜÆ¸ÿÜÆÂ9ÆÄ9ÆÆ9ÆÈÿÜÆÊÿÜÆÌÿÜÆÍÿÜÆÎÿÜÆÑÿÜÆÓÿÜÆÕÿÜÆ×ÿÜÆÙÿÜÆÛÿÜÆÝÿÜÆÞÿÜÆâÿÜÆÿÜÆÿÜÆÿÜÆÿÜÆÿÜÆ$ÿaÆ%ÿÜÆ&ÿaÆ'ÿÜÆ6ÿÆ7ÿ­Æ8ÿaÆ:ÿaÆðÿÜÆñÿÜÆ +ÿÆ -ÿÆ .ÿ­Æ /ÿÆ 0ÿ­Æ ™ÿaÆ ¦þøÆ §ÿÆ ¨/È<ÿÜÈmÿÜÈ}ÿÜÈŸÿÜÈ:ÿÜÈ §&Î<ÿÜÎmÿÜÎ}ÿÜΟÿÜÎ:ÿÜÎ §&Ð$ÿÜÐ9ÿÜÐ<ÿÐmÿÜÐ}ÿÜЂÿÜЃÿÜЄÿÜÐ…ÿÜІÿÜПÿÐÂÿÜÐÄÿÜÐÆÿÜÐ8ÿÐ:ÿÐôÿÐ ™ÿÐ ¦ÿÓÐ §ÿÉÐ ¨ÿDÒ$ÿÜÒ9ÿÜÒ<ÿÒmÿÜÒ}ÿÜÒ‚ÿÜÒƒÿÜÒ„ÿÜÒ…ÿÜÒ†ÿÜÒŸÿÒ:ÿÒ ¦ÿÓÒ §ÿÉÒ ¨ÿDÝ[ÿÜà7ÿ·à<ÿšàmÿÜà}ÿÜàŸÿšà&ÿ·à:ÿšà ¦ÿÓà §ÿÓà ¨ÿÉûÿÜû$/û2ÿ·û7þæû8ÿšû9ÿû:ÿDû<þðûHÿÜûRÿÜûXÿÜû\ÿDû‚/ûƒ/û„/û…/û†/û”ÿ·û•ÿ·û–ÿ·û—ÿ·û˜ÿ·û›ÿšûœÿšûÿšûžÿšûŸþðûªÿÜû«ÿÜû¬ÿÜû­ÿÜû´ÿÜûµÿÜû¶ÿÜû·ÿÜû¸ÿÜû»ÿÜû¼ÿÜû½ÿÜû¾ÿÜû¿ÿDûÁÿDûÝÿÜû&þæû0ÿšû1ÿÜû:þðû ¦þaû §ýæÿÿÜÿ$/ÿ2ÿ·ÿ7þæÿ8ÿšÿ9ÿÿ:ÿDÿ<þðÿHÿÜÿRÿÜÿXÿÜÿ\ÿDÿ‚/ÿƒ/ÿ„/ÿ…/ÿ†/ÿ”ÿ·ÿ•ÿ·ÿ–ÿ·ÿ—ÿ·ÿ˜ÿ·ÿ›ÿšÿœÿšÿÿšÿžÿšÿŸþðÿªÿÜÿ«ÿÜÿ¬ÿÜÿ­ÿÜÿ´ÿÜÿµÿÜÿ¶ÿÜÿ·ÿÜÿ¸ÿÜÿ»ÿÜÿ¼ÿÜÿ½ÿÜÿ¾ÿÜÿ¿ÿDÿÁÿDÿÝÿÜÿ&þæÿ0ÿšÿ1ÿÜÿ:þðÿ ¦þaÿ §ýæOÿ? ¦ÿk §ÿ ¨ÿ¤ÿ­ÿ·ÿÁ$ÿ­&ÿš7ÿk9ÿ:ÿ­<ÿ}DÿÓHÿ¤Rÿ¤Xÿ¤\ÿmÿ}ÿÜ‚ÿ­ƒÿ­„ÿ­…ÿ­†ÿ­‰ÿšŸÿ}¢ÿÓ£ÿÓ¤ÿÓ¥ÿÓ¦ÿÓ§ÿÓªÿ¤«ÿ¤¬ÿ¤­ÿ¤´ÿ¤µÿ¤¶ÿ¤·ÿ¤¸ÿ¤»ÿ¤¼ÿ¤½ÿ¤¾ÿ¤¿ÿÁÿÈÿšÎÿšÝÿ¤&ÿk1ÿ¤:ÿ} ¦ÿk §ÿ} ¨ÿÜÿ}ÿDÿÜFÿÓGÿÜHÿÓJÿÜKÿÜPÿÜQÿÜRÿÓTÿÜUÿÜ[ÿÉmÿ·©ÿÓªÿÓ«ÿÓ¬ÿÓ­ÿÓ³ÿÜ´ÿÓµÿÓ¶ÿÓ·ÿÓ¸ÿÓÉÿÓÏÿÓÑHÝÿÓáÿÜ ÿÜÿÜÿÜ §V ¨þÉÿ­ÿ·ÿÁ$ÿ­&ÿš7ÿk9ÿ:ÿ­<ÿ}DÿÓHÿ¤Rÿ¤Xÿ¤\ÿmÿ}ÿÜ‚ÿ­ƒÿ­„ÿ­…ÿ­†ÿ­‰ÿšŸÿ}¢ÿÓ£ÿÓ¤ÿÓ¥ÿÓ¦ÿÓ§ÿÓªÿ¤«ÿ¤¬ÿ¤­ÿ¤´ÿ¤µÿ¤¶ÿ¤·ÿ¤¸ÿ¤»ÿ¤¼ÿ¤½ÿ¤¾ÿ¤¿ÿÁÿÈÿšÎÿšÝÿ¤&ÿk1ÿ¤:ÿ} ¦ÿk §ÿ} ¨ÿÜÿ}ÿDÿÜFÿÓGÿÜHÿÓJÿÜKÿÜPÿÜQÿÜRÿÓTÿÜUÿÜ[ÿÉmÿ·©ÿÓªÿÓ«ÿÓ¬ÿÓ­ÿÓ³ÿÜ´ÿÓµÿÓ¶ÿÓ·ÿÓ¸ÿÓÉÿÓÏÿÓÑÿÜÝÿÓáÿÜ ÿÜÿÜÿÜ §V ¨þÉ $& ‚& ƒ& „& …& †&"$&"‚&"ƒ&"„&"…&"†&&ÿD&ÿ &ÿ&$ÿa&&ÿˆ&7ÿÜ&Dþ­&Fþ¤&Hþ¤&LÿÁ&Rþ¤&UþÓ&Vþ­&XþÉ&Zþ­&\þÁ&mÿD&}ÿ&‚ÿa&ƒÿa&„ÿa&…ÿa&†ÿa&‰ÿˆ&¢þ­&£þ­&¤þ­&¥þ­&¦þ­&§þ­&©þ¤&ªþ¤&«þ¤&¬þ¤&­þ¤&´þ¤&µþ¤&¶þ¤&·þ¤&¸þ¤&»þÉ&¼þÉ&½þÉ&¾þÉ&¿þÁ&ÁþÁ&Èÿˆ&Éþ¤&Îÿˆ&Ïþ¤&Ýþ¤&þÓ&þÓ&!þ­&#þ­&&ÿÜ&1þÉ& §ÿÓ& ¨þø0=ÿÜ0?ÿÜ:ÿ :þa:þð:$ÿa:&ÿ:2ÿ:Dþæ:Hþð:Lÿ·:Rþð:Xÿ:mÿ:}ÿk:‚ÿa:ƒÿa:„ÿa:…ÿa:†ÿa:‰ÿ:”ÿ:•ÿ:–ÿ:—ÿ:˜ÿ:¢þæ:£þæ:¤þæ:¥þæ:¦þæ:§þæ:ªþð:«þð:¬þð:­þð:´þð:µþð:¶þð:·þð:¸þð:»ÿ:¼ÿ:½ÿ:¾ÿ:Èÿ:Îÿ:Ýþð:1ÿ: ¦ÿ: §ÿÜ: ¨þø?ÿÜ? ¦ÿÜ? §ÿÜ? ¨ÿÜ š$ÿÓ š%ÿ· š*K š-r š29 š4K š7ÿD š9ÿˆ š:ÿ­ š;ÿš š<ÿ šR& šYÿÉ š\ÿÜ š‚ÿÓ šƒÿÓ š„ÿÓ š…ÿÓ š†ÿÓ š”9 š•9 š–9 š—9 š˜9 šŸÿ š´& šµ& š¶& š·& š¸& š¿ÿÜ šÁÿÜ šàK š&ÿD š:ÿ ¦$þø ¦%ÿÁ ¦&ÿ· ¦'ÿÁ ¦)ÿÁ ¦*ÿ· ¦+ÿÁ ¦-ÿÁ ¦.ÿÁ ¦/ÿÁ ¦2ÿ· ¦3ÿÁ ¦4ÿ· ¦5ÿÁ ¦;ÿˆ ¦=ÿÜ ¦Iÿ· ¦Qÿ ¦Rÿk ¦Uÿ ¦Yÿ· ¦Zÿ· ¦\ÿ· ¦‚þø ¦ƒþø ¦„þø ¦…þø ¦†þø ¦ˆþ} ¦‰ÿ· ¦”ÿ· ¦•ÿ· ¦–ÿ· ¦—ÿ· ¦˜ÿ· ¦ ÿÁ ¦¡ÿÁ ¦²ÿ· ¦³ÿ ¦´ÿk ¦µÿk ¦¶ÿk ¦·ÿk ¦¸ÿk ¦¿ÿ· ¦Áÿ· ¦Èÿ· ¦Îÿ· ¦ÐÿÁ ¦àÿ· ¦ûÿÁ ¦ÿÿÁ ¦ ÿ ¦ÿÁ ¦ÿ ¦ÿÁ ¦ÿ ¦?ÿÜ ¨$& ¨%ÿ· ¨&ÿ ¨'ÿ· ¨)ÿ· ¨*ÿ· ¨+ÿ· ¨-/ ¨.ÿ· ¨/ÿ· ¨2ÿ ¨3ÿ· ¨4ÿ ¨5ÿ· ¨7þæ ¨9þˆ ¨:ÿ ¨;ÿ· ¨<þˆ ¨IÿÜ ¨Qÿ· ¨Rÿ· ¨Uÿ· ¨Yÿ ¨Zÿ< ¨\ÿ ¨‚& ¨ƒ& ¨„& ¨…& ¨†& ¨ˆ& ¨‰ÿ ¨”ÿ ¨•ÿ ¨–ÿ ¨—ÿ ¨˜ÿ ¨Ÿþˆ ¨ ÿ· ¨¡ÿ· ¨²ÿ· ¨³ÿ· ¨´ÿ· ¨µÿ· ¨¶ÿ· ¨·ÿ· ¨¸ÿ· ¨¿ÿ ¨Áÿ ¨Èÿ ¨Îÿ ¨Ðÿ· ¨àÿ· ¨ûÿ· ¨ÿÿ· ¨ ÿ· ¨ÿ· ¨ÿ· ¨ÿ· ¨ÿ· ¨&þæ ¨:þˆDDDD¨ìDlÔ(˜ðŒà  D l ¸ < ¬ ¨ L äpDX¨ dÜ´40àxøX¬T°øhÔÐx„P d!\!Ì"P#0$ì%&T''t'À((X(„(Ô**˜+0+È,œ-4-ü.t.Ä/@000l101¨2L2ì3Œ3ü5\5Ø6\7€9¤;(<ô=À>œ>Ì?¸@<@<@ÌA˜BPChDŒDÔFFÔGøHÔI IØJKPKœLL„M$MàN0NäO@OlOÌP$P¬Q|QœQ¼QÜRÔRìSS0S`STÐU¨UÀUØUðVV8VPVhVŒV°W|W¬WÄWÜXX<XlY4ZlZ„ZœZÌ[[[¤\Ì\ð]]4]`]˜]Ø_”_¬_Ä_Ü``$`<`T`x`œbLbdb|b”b´bàc chdÜdôe e,e\etffDfpf˜fÄfäfügg,gDghg€g˜g°gÔgìhh,h<høii4iXi|i”i¬iÄiÜjj,jPjtjŒj¤jÈjàjøkk@k„l l lÄlèm m0mTmxmm¨mØn$nHnlnn´nÌnäoÔoìp$p<p`pxpœp´pèqdqôrr<rTrlrœrÈràsxtt@t`tŒt¬tÄtÜu|v¤v¼vÔvìww(wPwhw€w¨wÌwäwüx$xHx`xxx¤xÈyLyäzz4zdzˆz´zØzð{{,{D{\{t{˜{¼{à||$|<|T|l|„|œ|Ä}}è~°~Àt€€¨8ø‚´‚ăXƒÔ„|…T…°†`‡‡˜ˆP‰Š0‹‹\‹ÌŒˆœüŽDÔ䈠¸‘`’ ’¤“d” ”ô–<–L–è—€˜˜¬™8™P™hšš ›\,ž4Ÿ@Ÿü t ì¡X¡Ì¢`¢ì£`£ô¤4¤L¤Ì¤Ü¤ô¥ ¥$¥<¥T¥l¥„¥œ¥´¥Ô¥ô¦¦D¦\¦|¦œ¦À¦Ø¦ð§§ §8§P§h§€§§¨§À§Ø§ð¨¨ ¨ô©èªª,ªDªˆª ª¸ªÐªè«««@«X«p«ˆ« «¸¬P¬è­­­0­H­`­x­­¨­À­Ø­ð®® ®8®P®h®€®˜®°®È®à®ø¯¯(¯@¯X¯p¯ˆ¯ ¯¸¯Ð¯è°°°0°H°à±|±”±Ø²L²ð³ü´àµÌ¶Ä¶Ü¶ô· ·$·<·T·l·„·œ·´·Ì·ä·ü¸¸h¸ì¹T¹¸º˜»|»ì¼„½½€½Ô¾Œ¾ä¿h¿ðÀÌÁŒÁœÂ°ÃLÃèĨÅdÆŒÇÇhÇÈÉÉœÊ4ÊìˈÌhÍ(ÍØÎ¼Ï`ЀÐРѼ҈ÓÓôÔ¬ÕHÖ<×0׬ØDØðÙdÙtÙÈÚtÚüÛTÜ|ÝLÞ ß߸àLàôáˆâ4âäâôã\ãÄäPäÄåP嬿ççÀèÌé@éìêLêàëTëÔìxí0íÀîPðxññlò\ó|ôõ õ´öHöà÷|øøøèù¨ù¸úHú€ú¼ûtü0üìý|þDÿÿÈT$¸\(Œü€ €à8´ Xœ¬ÄÔä  T  ì L t œ  t Ð , \ l ˆ ¨ Ø ì  ( ” ä ø 0T€œ(ü\ˆÀô@h8˜ÌX¤Øì,@¬`ÈÜð\ÐDXlÔŒ¨ôDh„˜¬ÐôˆØü Lh˜ÈÜð\€”¨Ðô<Pdx¬ÀÔèüXt°Ð  @ l ´ è!H!d!x!Œ! !°!Ä!Ø!ü"$"L"l"è#\#t#¬#Ô#Ô$$,$@$€$”$¨$¼$Ø$ô%h%|%¤%Ô&&8&H&`&x&ˆ&Ø'' '0'L'h'„'œ'¸'Ð'è'ø((@(¬(¼(Ì(Ü)Œ)œ)¬** *0** *°*À+<+L+\,,,,À-p-”-¸-Ð-è...0/€00œ1€2P2ô3p484ˆ55Œ5œ6,6è6ø7t88´9H9¨:4:ô<<”=(=@=X=p=ˆ= >p??Ð?ì@@ÌA8AäBœCHC¼D,D<D´EE<E´FFÐGTG¼HH˜I€IøJhKKÌL`LøM4MlNN„N”N¤N´O$OO O°OÀOüP8P¸PÈPàPøQQ°R<RTSSS S0S@SØThTØTðUU UxUˆVVVPVÜVìWàX˜YDY„ZZxZˆZ˜Z¨Zð[[[ [¤\X\h\À]]x]ä^d^|^ð_œ`\`øaaÐblb¤c,c<d,dðe`e f0fggpg€gÈgØgèh,h<i$i4iŒjjdjÐkLkdkÔlxmm¬mÄndoo oÄoÔoäoôpp q4qÄqÜqôr rds<sLs°tt˜uuLuŒuèv@v¨wwŒxxðyÌz0z”z¤z´{{P{h{€|$|¨} ~Œt€0€H€`€Ä$p‚‚<‚d‚ŒƒÐ„Œ„¤„¼……„…ä†l†¬†ð‡P‡°ˆ<ˆÌ‰0‰‰¨‰ÀŠŠHŠ”ŠÜ‹(‹tŒŒ´$ôŽTŽì„œ‘Œ‘¤‘¼’’p’€““d“¨“ð”8”t”°”ø•@••Ü–<–L—(˜$˜<˜T˜d˜|˜”˜ð™T™ ™ìšdšÜ››T›œ›äœ0œ|œŒœ¸œØ@P`„¨¸Èàøžž(ž@žXžhžxžž¨žÀžØŸŸ4ŸDŸTŸlŸ„ŸœŸ´ŸÌŸäŸü  , D \ t À¡ ¡$¡<¡È¢T¢´££d£´¤,¤¨¥x¦D¦ä§€§ü¨x¨è©T©d©ÀªPªØ«,«€«« «ô¬H¬ð­˜®T®ø¯d°°”±,±Ø²`²Ü³D³ ´@´ˆ´Ðµ¶(¶¬··Œ¸(¸˜¹¹€¹Ôºl»»$»ˆ»˜¼¼Ì½P½`¾¾ ¾À¾Ð¾à¾ü¿<¿L¿ ¿ÄÀ”Á ÁÈÂPÂäÈÃøÄ|ÅtÆƈÆÈÇdÈXÈÔÈäÉäÊhËTÌÌ$ÌÐÍtÍ„ÎPÎ`ÏHÏÈÏØÐ\Ñ4ѰÑÀÑüÒØÓ Ó°ÔÌÕLÕŒÕÈÖÖ8ÖŒÖð××@×À×ìØ(ØPØ`ØÀØìÙÙ4Ù`Ù˜ÙÄÙìÚ4Ú„ÚÀÛpÛÌÜTÜ ÝÝDݘÝôÞpÞ¨ßßdßÈà(ààáápáôâœããœää¤å$å|ææ|æ”æ¬æÄæôç<ç\ç¸çèèXèÈèàèøéé(é@é\étéŒé¤é¼éÔê<êTê¨êÀëëëÜëôì¸ìÐí<íTíÔíìîîî4îðïPïÜïôð\ðÜñˆñ ñÌòlò”ò°ó<óXóÔôô`ôtôˆô°ôÌôüõTõÐöTö¼÷÷T÷¤øøPøø´øèùLùüúPúhú€ú˜ú¸úÐúèûûû0ûHû`ûxûû¨ûÀûØûðüü üÜüôý ý ý¸ýÐþ0þPþhþxþþ þ°þÀþÐþàÿ`ÿàDTdtøPœä0t´`ü,¨(l´(„h¼4´  ¬  „ Ð  œ ô € Ä ð p ¸lèpœä 0X Äì,p°ôP| ä´\¸”`ì°t4Üxä”X  !\""ü#¤$l%(%ä&Ä'L'h'ø(t(Œ(ð)`)Ø*\*¤+ +„+ü,˜-,-D-È.l.à/”/¼0D0à1,1@1Œ1ð2p2è3t3ø4œ5\5Ì6Ð7<8L949¸: :„; ;l;Øl>Ø?¨?ü@p@ÜA<A¤BdBøC4C„CÔDXD¨E E F FÀGG\G¸HHÌI I€JHJœKK|LLhLäMdMÐNN|O$O„OäPLP¸QQ”QàR<R¨S<S¤T,T„TüUhUàV,VœW0W€WìXhY Y€YìZ`ZÔ[L[À\ \\ð] ]p]Ü]ô^^^ˆ^ ^¸^Ð_@_X_p_ˆ_ _¸_Ð_è```0`H```x``¨`À`Ø`ðaa<a\a˜aÔbbTbˆbÐbècc0cTclc„cœc´cÄcÜcìddhd€d˜d°ee,eDe\eteŒe¤e¼eÔeìfff4fLfdf|f”føg(g8gPg¼gÔh<hThlh„hìiii4iLidi|i”i¬iÄiÜiôj j$j<jTjljÈjàjøkk(k¤k¼l8lPlÐlèmm€m˜m°mÈmàmønn(n@nXnpnˆn n¸nÐnèooxoÌoäoüpp,p€p˜pðqq`qxqqèrrr0rHr`rxrr¨rÀrØrðss s8sPshsÀsøt0tHt€t˜tÐtèuuu(u@uXupuˆu u¸uÐuèvvv0vHv`vxvvÌw,wLwÈwàx`xxxðyy y˜y°yÈyàyøzz(z@zXz¨zè{<{{¨{ü||h|€|˜|ì}}}4}L}d}|}”}¬}Ä}Ü}ô~ ~$~<~T~Œ~È4Œ¤ø€€(€€€˜€°€È€à€ø(@Xpˆ ¸Ðè‚‚P‚Ôƒƒ`ƒ¸ƒÐ„L„d„ä„ü……,…D…\…t…Œ…¤…¼…ԅ솆†4†L†À‡‡0‡Œ‡¤ˆˆˆ0ˆŒˆ¤ˆ¼ˆÔˆì‰‰‰4‰L‰d‰|‰”‰¬‰Ä‰Ü‰ôŠ ŠlŠ|Џ‹$‹‹ôŒ ŒpŒˆŒðpØðŽTŽlŽ„Žð,àø¬Ä‘|‘”’H’`’x’’ü“x“ô”p”ì•••˜•°–0–H–`–x–ð—T—¼—Ô˜8˜P˜´˜Ì™,™<™L™d™|™”™¬™Ä™Ü™ôš šŒ› ›œœ0œHœ`œxœœ¨œÀ4àž`žxžôŸ ŸŒŸ¤Ÿè $ ` x ´ Ì¡¡ ¡\¡à¡ð¢`¢¢ð£(£@£X£p£ˆ£ £¸£Ð£è¤¤,¤\¤˜¤Ü¥,¥T¥„¥À¦¦T¦ˆ¦Ô§8§´¨H¨x¨¼©©€ªªHª ªØ«p¬H¬p¬¤¬Ø­­`®<®¨®¸¯¯X¯ˆ°°<°x°ˆ°À°Ð°à°ð±±X±°²@²ü³4³l³°´ ´´ ´Üµ µ|µð¶¶¶ ¶p¶¶ ¶È¶Ø·4·D·x·Ä¸@¸¸À¸ð¹`¹¹¬¹Üºº0ºhº˜ºÈ»(»ä¼0¼œ¼Ä½½@½À¾H¾°¿ˆ¿ìÀTÀÈÁp”Ã(ÃLÀÄİÅ4ÅœÅØÆÆtÆ´ÇÇLÇÈÇðÈPȈÉÉŒÉäÉøÊ Ê Ê4ÊHÊ\ʸÊÌÊàË`Ëp˰ËìÌTÌ´Í8ÍÈÎXΜÎàÏhÏ´ÏìÐÐHЄÐÜÑÑPÑpÒÒ„ÒäÓHÓxÓèÔxÕ ÕpÕÈÖ0Ö¨Öì×P×xר×ôØPؼÙ(ÙHÙlÙÙ°ÙÜÚ Ú$Ú<ÚTÚlڄڜڴÚÌÚäÚüÛÛ,ÛDÛ\ÛtیۤۼÛÔÛìÜÜÜ4ÜLÜdÜ|Ü”ܬÜÌÜìÝÝÝ4ÝLÝdÝ|Ý”ݬÝÄÝÜÝôÞ Þ$Þ<ÞTÞlބޜ޴ÞÌÞäÞüßß,ßDß\ß|ß”߬ßÄßÜßôà à$à<àTàlà„àœà´àÌàäàüáá,áDá\átáŒá¬áÄáÜáôâ â$â<âTâlâ„âœâ´âÌâäâüãã,ãDã\ãtãŒã¬ãÌãäãüää,äDä\ätäŒä¤ä¼äÔäìååå4åLådå|å”å¬åÄåÜåôæ æ$æ<æTælæ„æœæ´æÌæäæüçç,çDç\çtçŒç¤ç¼çÔçìèèè4èLèdè|è”è¬èÄèÜèôé é$é<éTélé„éœé´éÌéäéüêê,êDê\êtêŒê¤ê¼êÔêìëëë4ëLëdë|ë”ë¬ëÄëÜëôì ì$ì<ìTìlì„ì¤ì¼ìÔììííí4íLídí|í”í¬íÄíÜíôî î$î<î\îtîŒî¤î¼îÔîìïïï4ïLïdï|ï”ï¬ïÄïÜïôð ð$ð<ðTðlð„ðœð´ðÌðäðüññ,ñDñ\ñtñŒñ¤ñ¼ñÔñìòòò4òLòhò€òœò¸òÐòèóóó0óHó`óxó”ó°óÌóäôôô4ôLôdô|ô”ô¬ôÄôÜôøõõ0õHõdõ€õœõ¸õÐõèööö0öHö`öxö”ö°öÌöä÷÷÷8÷T÷l÷„÷œ÷´÷Ì÷ä÷üøø0øHødø€ø˜ø°øÈøàøøùù(ù@ù\ùtùù¬ùÄùÜùôú ú$ú<úTúlú„ú ú¼úÔúðû û(ûDû\ûlû„û”û¬û¼ûÔûäûüü ü$ü4üLü\ütüŒü¤ü¼üÔüìýýý4ýLýdý|ý”ý¬ýÄýÜýôþ þ$þ<þTþlþ„þœþ´þÌþäþüÿÿ,ÿDÿ\ÿtÿŒÿ¤ÿ¼ÿÔÿì4Ld|”¬ÄÜô $<Tl„œ´ÌÜô„”¬ÄÜô $@Pl|”°Èàø(8Ph€˜´Äàø(@Xh€˜°Èàø$@Xhx¨ÀØð 8H`pÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜDpœÄÜô 0 l ¤ È $ € Ü  h ì , H ` „ Ø ð ð ð ð ð ð ð|Œ¬Ää8\Ì@pŒ|Ü,HÀð <p¨ØLd€¤´ÈPx¸(dÈø444444444444ˆÌØ<Ìô¤0d€¨à¤¸Ìàô0DXl€”¨¼Ðäø  ” D Ô!!|""„#h$8$ä%H%`''\'´)@)Ü*t++t,,¨,Ì,ì--<-t-¸-ð.°/ˆ001@1Ü2t2„2˜2°3ð4à505Œ5ü6¨7<88œ99\<<¬=`=Ð>p?ˆ@„A4BLBôC”CôD€DÔEE€EE F”FÈFØFèGàH¤I,I¨JpKPK|LÀMM¸NHNÔOLO”PPŒQ Q”QÄRR\RÌRìSS<SÀTpUUHU°VHV˜V¸VØVøWW8WXWxW˜W¸WØWøXX0X@XXXxXX X¸XØYYY(Y@Y`YpY€YY Y°YÈYèZZZ(ZHZpZˆZ˜Z°ZÐZàZð[[[”]]ð^^^À_p` `ÐaðccDctc¤cÔd dlee¼ffTf fìg4g€g¼gøh¼høiLiÌjXkkàlômTmœmÔn nDn|n´nìopoðp,p˜q@qèrXrÈrðssŒsüt tDt`t|t˜tàu(upu¸uÔuðvXvØw@w€wÀxx@xœxøy8yxy¸yøz8zxzÔ{0{ˆ{à|(|p|¼}}D}€}Ä~~H~ˆ~ì@ €€l€ì@„È‚$ƒƒƒ|ƒÀ„„d„¼……ˆ…¼…ð†@†|‡Pˆ4ˆhˆÐ‰‰ôŠ$Šˆ‹,‹€‹äŒˆŒÜHŒŽ$ŽPŽŒ h|ÈÜh€˜‘’œ’¼’à“Œ”8”T”À”蕬•Ø––@–€–Ж藗ԙ š´›Tœœä,HtŒÀðžžpžÐŸLŸ”Ÿô T À¡(¡¨¢¢°£@¤4¤Ô¥„¦l¦à§8§ô¨h¨€¨ ¨À¨à©©$©€©ìª4ªxª¸««H¬(¬¬­8­Ä®®|®è¯x°°L°Œ°ô±X± ±ä²l²Ø³,³€³ì´X´ØµP¶¶¸¶ü·D·Ð¸X¸”¸Ì¹ ¹pººŒºü»l»°»ô¼`¼Ì½ ½p½ì¾l¾Ø¿D¿¤¿¼ÀÀ\À ÀôÁLÁŒÁ̘ÃLÄÄØÅŒÆtÇXÈÈÌÉÉXɼÉôÊ0ÊTÊ|Ê ÊÄÊôË$ËTË”ËÐÌÌpÌÄÍ0Í`ÍŒÍÄÍüÎhÎÔÏ$ÏhÏŒÏÀÏøÐ,ЀаÐÜÑÑlÑÌÑÜÑìÒ ÒdÒ¤ÒäÓÓ@Ó¤ÓÜÔÔxÔØÕ0Õ„Õ¼ÕôÖHÖœ×0×ÄØ,Ø”ØàÙ,Ù¤ÚÚ¤Û,Û„ÛÜÜPÜÀÜäÝÝ(ÝLÝÀÞ(Þ€Þ˜ß ßlßààLàÀá(á„áøâ\âãã4ãlãœãÌãäää\ä|äœä¼äÜåå,åTå|åœåðæìçç4çTçtç”çìèDèèÈé4é”îLî¼ï0ï@ïPï`ïpï ïìð0ðhð„ð¼ðôññHñhñ„ñ¨ñÌñèòò<ò”òÌòèó óxó¬óÈôôHôðõõtõœ÷ ùû ý0ÿ< | è   < X Œ Ä ü 8 p ° ø D h Œ ° Ô ø@d„¨Ìð0PtœÄðDt ÈðDp˜ÈôDpœÄìDl¼è8d¸èP„¸ì XÈ4hœÐ(T€¬Ôü(Tˆ´à@l Ìø,\Ô8x¬ÜP€ÀL¨ÜDx˜´ô  , H d € œ ¸ Ô ø! !D!l!€!œ!¸!Ô!ð" "("D"`"|"˜"´"Ð"ì##$#8#ì&à'ˆ'œ'°'Ì'à'ô((((D(`(t(Œ(¨(Ä(ð)D)\)´*+P+Ø,`. .<.h.„.°.Ì.ø//L/h//¬/Ô/ð0080d0€0¬0È0ô11<1X1„1 1Ì1è2242h2¬3<33ø4ð5¤6`6Ä77t7Ð8,8”8ä9 949p9è:<::¼:è;;D;ˆ;Ì;è<<<4<|<¨<Ô<ü=$=`=¤=Ð=ø>d>¤>ä?$?d?ä@d@äAdAŒA´AÜBB$BPBlB”C„CðD¨MŒPpP¨Q Q\QÀRTS SìTPTôWxZXZ[[|[Ô]4^à_(_\`Pa$a¼bTccàd¤ehhðiljl0o˜pp qqxqürŒsÔuu v4vèww(wHwhwˆw¨wÈwèy\z,zü{¨|Ä}X}è~ ˆ€€h€ÄX‚‚l‚àƒxƒÜ„œ…|†L†À‡d‡°ˆL‰8‰¸Šà ¨ŽÄ ‘ ’´“¬”,”ô•Ü–p–ä—ˆ—Иp™8™Œ™¼šà›Ìœ œhœÌ,€Ìž`Ÿ  ¢£¤,¥h¦h§Œ¨À©°ª„«¬È® ¯$¯À°0°ä±Ø³´Œ¶L¶è·¨¸¸œ¸¸¸à¸ø¹¹(¹@¹Àºº”»Œ¼8½\¾¾ ¿DÀlÂTÅÆØÇ\ǨÈɜʔË(ÌÍÍøÎÔÏHÏÐÑ ÒXÓœÓØÔ\ÔÀÖP×´Ù@ÝÞŒààá@ãøå˜æ°çœè°é˜ê ê„êìë0ëpì<í4í´íèî$îhî˜îøïxð\ðôñ°ó0ô´øøtù$ùŒúú¨ûhûôütüðý`ý´þþ€þØÿœÿà8ˆø´`T€°  ˆÜd(ðÄHÈ(ˆÔ @ ¬!!€!è"L"h"„" "à#,#D#\$8$Ð%Œ%ü&p'(x(ä)T))Ì)ô* *H*t*œ*È*ô+ +„+è,d-.P.Ø/ð1„1ø4D5Ð7D89:4;<=(=ô? @8AhAèB˜C`CìDœEdEÜF´G|H@HpHœHÈHôI$I°IØJJTJ¨JÐKK0KPK KðLLLL”LÜM0M€MÌNNtNÌO8OÜP4P|PÔQ`QàRlS<SÌTôV V¬VèWWPWxW W¸WÐX(X|Y@ZZü[¬\\]|]¼]ü^X^”^Ð__h_ì_ì```0`D```|` `´`Ð`ìaa,aPata a´aÐaìbb,bPbtb b¼bàcc0cTc€c¬càcôdd,dPdldd´dàdüe eDepe”eÀeìf f<f`f„f°fÔgg,g`g„g°gÜhh<hph¤hàhôii,iPilii´iàiüj jDjpj”jÀjìk k<k`k„k°kÔll,l`l„l°lÜmm<mpm¤màmün nDnpn”nÀnìo oDopoœoÐoüp0pdp pÄpðqqPq|q°qär rLr€r´rðs$s`sœsàsôtt,tPtltt´tàtüu uDupu”uÀuìv v<v`v„v°vÔww,w`w„w°wÜxx<xpx¤xàxüy yDypy”yÀyìz zDzpzœzÐzü{0{d{ {Ä{ð||P|||°|ä} }L}€}´}ð~$~`~œ~à~ü Dp”Àì€ €D€p€œ€Ð€ü0d Äð‚‚P‚|‚°‚äƒ ƒLƒ€ƒ´ƒð„$„`„œ„à……0…\……¼…ð†$†`†Œ†À†ô‡0‡d‡ ‡Üˆ ˆLˆ€ˆ´ˆð‰$‰`‰œ‰àŠŠPŠŒŠÐ‹ ‹P‹”‹àŒ,ŒxŒÀÐŽ˜|\¨ä‘ ‘T‘ˆ‘°‘ä’’8’€’Ø“˜”l•P•x•à–\–È—t˜˜ˆ™™¬šPšÔ›l›èœpœôT´Äžž8žPžhž€ž˜ž°žÈŸ˜ d ´¡¡È¢„¢è£D£È¤H¤Ø¥h¥Ä¦(¦¦ô§0§l§„§œ§à¨(¨p¨À©8©´ªHªà«d«¬«ð¬T¬´­­\­Ô®H¯(°°Ø±¨±ô²<²„²Ì³³\³¸³à´´0´\´ˆ´´´àµµPµ„µ¼µô¶(¶T¶€¶¬¶Ô··4·d·”¸@¸|¸À¸è¹¹\¹œº ºh»¤¼T¼°¼À½½P½½Ä½ø¾¾à¿¿`¿ÐÀ0ÀÀ¸ÀàÁ`ÁÔœÀÄ(ÄÐňÅàÅðÆÆÆ Ç ÇÈ È€ÉÉàÊèËLË´ÌÌÜÍHÍ´ÎÎ ÎtÏ<ÏøÐÐHÐXÐØÑ4ÑÔÒ ÓHÔ,ÔŒÔäÕlÖ8ר ØtØ„ÙÀÚ@ÚPÚ”ÛÛÄÜÝÝDÝ\ÝtÝŒݤݼÝÔÝìÞÞÞ4ÞLÞdÞ|Þ”Þ¬ÞÄÞÜÞôß ß$ß<ßTßl߄ߜߴßÌßäßüàà,àDà\àtàŒà¤à¼àÔàìááá4áLádá|á”á¬áÄáÜáôâ â$â<âTâlâ„âœâ´âÌâäâüãã,ãDåðè ééÄêhêèëÈìˆíîîÌïtððÀñˆñ ñÔñìòdò¼òäó ó`ó óØôôPô”ô¬ôÄôÜôôõ õ$õ<õTõlõ„õœõ´õÌõäõüöö,öDö\ötöŒö¤ö¼öÔöì÷÷÷4÷L÷d÷|÷”÷ôø ø$ø<øTølø„øœø´øÌøäøüùù,ùDù\ùtùŒù¤ù¼ùÔùìúúú4úLúdú|ú”ú¬úÄúÜúôû û$û<ûTûlû„ûœû´ûÌûäûüüü,üDü\ütüŒü¤ü¼üÔüäýý ý°ýÈýàýøþþ þ˜þ°þÈþøÿ8ÿHÿXÿpÿˆÿˆÿˆÿˆÿˆÿˆÿˆÿˆÿˆÿˆÿˆÿˆÿˆÿˆÿˆÿˆÿˆÿ°ÿØ h|”¨Üð0H\tˆ ´ÌÜô $<Tl„œ´Ìäü @Xpˆ ¸Ðè0H`x¨ÀØð”ü€˜°ÈàðTl„”è(ü Œ , D \ t Œ œ x  ¨ À Ø ð   œŒ¤¼Ôìü„Ül„œ´Ìäü,D\tŒœhÔ\làXhx 8Phxð¬<Làð”¬ÄÜô $<Tl„Ø@@@@@@Ì <Xt¸à 4\ˆ°Ø(P|¤Ìø Hp˜Àì  < h  ¸ à!!0!\!„!¬!Ø""("P"x" "Ì"ô##H#p#˜#À#è$$<$d$Œ$¸$à%%0%X%€%¬%Ô%ü&(&P&x& &È&ð''D'l'˜'À'è((8(`(Œ(´(Ü))0)X)€)Ì*\*È++D+Ð, ,X,œ,Ì-(-Ä.`.˜/ /H/°00L0ð1Œ22 33€4H4¼4ô5P5”5à6œ77œ888Ô9 9ì:H:¼:ø;X;¬;ü<@>> >0>@>P>`>p>€>> >°>À>Ð>à>ð??? ?0?@?P?`?p?€?? ?°?À?Ð?à?ð@@@ @DAA¬B|C$CÀDlD E@E EÜFF FDFtF¤FÈGG|GŒGœH\HøI˜J`JpJ€J˜J°KK K@K`KxKK¨KÀKØKðLL L8LPLhL€L LÀLàMMMðN@N\NxN”N°NÌNèOO O<OXOtOO¬OÈOäPPP8PTPpPˆP¤PÜPôQHQ`QxQQ¨QÈQèRRdRtR„R”R¬RØS0SHS`S„S°SÌSäSüTT,TDT\TtTŒTÄUU<UÌVlVüWdWÔX<XlXœXÈYYpY¼ZZTZœ[[x[ä\@\˜\ð]ˆ^,^È_$_ˆ_ä`@`¤aa€bbˆcc¬d8dœeelff¼g`gÄh0h”i i´j@j”jðkDkxk°kälŒm<mänHn´oo°pTpìq<q”qärrPr„ssttdt¼u uduÄvvˆvüwhwèxlxìytzzˆzœzÀzä{{,{P{t{˜{¼|(|d| }–T+h @h>˜2 ãù  : ` ƒ²  (Z4;b ;¯;Å 0 Ë ï þ " F m "Ž :Ä %: h:ø ;— ;»Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. DejaVu changes are in public domain Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. DejaVu changes are in public domain DejaVu SansDejaVu SansBookBookDejaVu SansDejaVu SansDejaVu SansDejaVu SansVersion 2.24Version 2.24DejaVuSansDejaVuSansDejaVu fonts teamDejaVu fonts teamhttp://dejavu.sourceforge.nethttp://dejavu.sourceforge.netFonts are (c) Bitstream (see below). DejaVu changes are in public domain. Glyphs imported from Arev fonts are (c) Tavmjung Bah (see below) Bitstream Vera Fonts Copyright ------------------------------ Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera". This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names. The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org. Arev Fonts Copyright ------------------------------ Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the modifications to the Bitstream Vera Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Tavmjong Bah" or the word "Arev". This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Tavmjong Bah Arev" names. The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. Except as contained in this notice, the name of Tavmjong Bah shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from Tavmjong Bah. For further information, contact: tavmjong @ free . fr.Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. Glyphs imported from Arev fonts are (c) Tavmjung Bah (see below) Bitstream Vera Fonts Copyright ------------------------------ Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera". This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names. The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org. Arev Fonts Copyright ------------------------------ Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the modifications to the Bitstream Vera Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Tavmjong Bah" or the word "Arev". This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Tavmjong Bah Arev" names. The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. Except as contained in this notice, the name of Tavmjong Bah shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from Tavmjong Bah. For further information, contact: tavmjong @ free . fr.http://dejavu.sourceforge.net/wiki/index.php/Licensehttp://dejavu.sourceforge.net/wiki/index.php/LicenseDejaVu SansDejaVu SansBookBookÿ~Z–  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a¬£„…½–膎‹©¤ŠÚƒ“òó—ˆÃÞñžªõôö¢­ÉÇ®bcdËeÈÊÏÌÍÎéfÓÐѯgð‘ÖÔÕhëí‰jikmln oqprsutvwêxzy{}|¸¡~€ìîºýþ    ÿ øù !"#$%&'()*+ú×,-./0123456789:âã;<=>?@ABCDEFGHI°±JKLMNOPQRSûüäåTUVWXYZ[\]^_`abcdefghi»jklmæçnopqrstuvwxyz{|}~€¦‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³Øá´µ¶·¸¹º»¼½¾¿ÀÁÂÃÛÜÝàÙßÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYŸZ[\]^_`abcdefghijklmno›pqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ                           ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ                           ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾²³ ¿ À Á¶·Ä ´µÅ ‡ Ä Å Æ« Ç È É Ê Ë Ì ÍÆ Î Ï Ð Ñ Ò Ó Ô Õ¾¿ Ö × Ø Ù Ú Û Ü Ý Þ¼ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ                           ! " # $ % & ' (÷ ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a bŒ c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ                           ! " # $ % & ' ( ) * + , - . /˜ 0 1 2¨ 3 4 5 6 7 8 9 :š ;™ï < = > ? @ A B¥ C D E’ F G H I J K L M N O P Qœ R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m§ n o p q r s t u v w x y z { | } ~  € ‚ ƒ „ … † ‡”• ˆ ‰ Š ‹ Œ Ž ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ                           ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ      !"#$%&'()*+,¹-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâÀÁãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•– sfthyphenAmacronamacronAbreveabreveAogonekaogonek Ccircumflex ccircumflex Cdotaccent cdotaccentDcarondcaronDcroatEmacronemacronEbreveebreve Edotaccent edotaccentEogonekeogonekEcaronecaron Gcircumflex gcircumflex Gdotaccent gdotaccent Gcommaaccent gcommaaccent Hcircumflex hcircumflexHbarhbarItildeitildeImacronimacronIbreveibreveIogonekiogonekIJij Jcircumflex jcircumflex Kcommaaccent kcommaaccent kgreenlandicLacutelacute Lcommaaccent lcommaaccentLcaronlcaronLdotldotNacutenacute Ncommaaccent ncommaaccentNcaronncaron napostropheEngengOmacronomacronObreveobreve Ohungarumlaut ohungarumlautRacuteracute Rcommaaccent rcommaaccentRcaronrcaronSacutesacute Scircumflex scircumflex Tcommaaccent tcommaaccentTcarontcaronTbartbarUtildeutildeUmacronumacronUbreveubreveUringuring Uhungarumlaut uhungarumlautUogonekuogonek Wcircumflex wcircumflex Ycircumflex ycircumflexZacutezacute Zdotaccent zdotaccentlongsuni0180uni0181uni0182uni0183uni0184uni0185uni0186uni0187uni0188uni0189uni018Auni018Buni018Cuni018Duni018Euni018Funi0190uni0191uni0193uni0194uni0195uni0196uni0197uni0198uni0199uni019Auni019Buni019Cuni019Duni019Euni019FOhornohornuni01A2uni01A3uni01A4uni01A5uni01A6uni01A7uni01A8uni01A9uni01AAuni01ABuni01ACuni01ADuni01AEUhornuhornuni01B1uni01B2uni01B3uni01B4uni01B5uni01B6uni01B7uni01B8uni01B9uni01BAuni01BBuni01BCuni01BDuni01BEuni01BFuni01C0uni01C1uni01C2uni01C3uni01C4uni01C5uni01C6uni01C7uni01C8uni01C9uni01CAuni01CBuni01CCuni01CDuni01CEuni01CFuni01D0uni01D1uni01D2uni01D3uni01D4uni01D5uni01D6uni01D7uni01D8uni01D9uni01DAuni01DBuni01DCuni01DDuni01DEuni01DFuni01E0uni01E1uni01E2uni01E3uni01E4uni01E5Gcarongcaronuni01E8uni01E9uni01EAuni01EBuni01ECuni01EDuni01EEuni01EFuni01F0uni01F1uni01F2uni01F3uni01F4uni01F5uni01F6uni01F7uni01F8uni01F9 Aringacute aringacuteAEacuteaeacute Oslashacute oslashacuteuni0200uni0201uni0202uni0203uni0204uni0205uni0206uni0207uni0208uni0209uni020Auni020Buni020Cuni020Duni020Euni020Funi0210uni0211uni0212uni0213uni0214uni0215uni0216uni0217 Scommaaccent scommaaccentuni021Auni021Buni021Cuni021Duni021Euni021Funi0220uni0221uni0222uni0223uni0224uni0225uni0226uni0227uni0228uni0229uni022Auni022Buni022Cuni022Duni022Euni022Funi0230uni0231uni0232uni0233uni0234uni0235uni0236dotlessjuni0238uni0239uni023Auni023Buni023Cuni023Duni023Euni023Funi0240uni0241uni0242uni0243uni0244uni0245uni0246uni0247uni0248uni0249uni024Auni024Buni024Cuni024Duni024Euni024Funi0250uni0251uni0252uni0253uni0254uni0255uni0256uni0257uni0258uni0259uni025Auni025Buni025Cuni025Duni025Euni025Funi0260uni0261uni0262uni0263uni0264uni0265uni0266uni0267uni0268uni0269uni026Auni026Buni026Cuni026Duni026Euni026Funi0270uni0271uni0272uni0273uni0274uni0275uni0276uni0277uni0278uni0279uni027Auni027Buni027Cuni027Duni027Euni027Funi0280uni0281uni0282uni0283uni0284uni0285uni0286uni0287uni0288uni0289uni028Auni028Buni028Cuni028Duni028Euni028Funi0290uni0291uni0292uni0293uni0294uni0295uni0296uni0297uni0298uni0299uni029Auni029Buni029Cuni029Duni029Euni029Funi02A0uni02A1uni02A2uni02A3uni02A4uni02A5uni02A6uni02A7uni02A8uni02A9uni02AAuni02ABuni02ACuni02ADuni02AEuni02AFuni02B0uni02B1uni02B2uni02B3uni02B4uni02B5uni02B6uni02B7uni02B8uni02B9uni02BAuni02BBuni02BCuni02BDuni02BEuni02BFuni02C0uni02C1uni02C2uni02C3uni02C4uni02C5uni02C8uni02C9uni02CAuni02CBuni02CCuni02CDuni02CEuni02CFuni02D0uni02D1uni02D2uni02D3uni02D4uni02D5uni02D6uni02D7uni02DEuni02DFuni02E0uni02E1uni02E2uni02E3uni02E4uni02E5uni02E6uni02E7uni02E8uni02E9uni02ECuni02EDuni02EEuni02F3uni02F7 gravecomb acutecombuni0302 tildecombuni0304uni0305uni0306uni0307uni0308 hookabovecombuni030Auni030Buni030Cuni030Duni030Euni030Funi0310uni0311uni0312uni0313uni0314uni0315uni0316uni0317uni0318uni0319uni031Auni031Buni031Cuni031Duni031Euni031Funi0320uni0321uni0322 dotbelowcombuni0324uni0325uni0326uni0327uni0328uni0329uni032Auni032Buni032Cuni032Duni032Euni032Funi0330uni0331uni0332uni0333uni0334uni0335uni0336uni0337uni0338uni0339uni033Auni033Buni033Cuni033Duni033Euni033Funi0340uni0341uni0342uni0343uni0344uni0345uni0346uni0347uni0348uni0349uni034Auni034Buni034Cuni034Duni034Euni034Funi0351uni0352uni0353uni0357uni0358uni035Cuni035Duni035Euni035Funi0360uni0361uni0362uni0374uni0375uni037Auni037Buni037Cuni037Duni037Etonos dieresistonos Alphatonos anoteleia EpsilontonosEtatonos Iotatonos Omicrontonos Upsilontonos OmegatonosiotadieresistonosAlphaBetaGammauni0394EpsilonZetaEtaThetaIotaKappaLambdaMuNuXiOmicronPiRhoSigmaTauUpsilonPhiChiPsi IotadieresisUpsilondieresis alphatonos epsilontonosetatonos iotatonosupsilondieresistonosalphabetagammadeltaepsilonzetaetathetaiotakappalambdauni03BCnuxiomicronrhosigma1sigmatauupsilonphichipsiomega iotadieresisupsilondieresis omicrontonos upsilontonos omegatonosuni03D0theta1Upsilon1uni03D3uni03D4phi1omega1uni03D7uni03D8uni03D9uni03DAuni03DBuni03DCuni03DDuni03DEuni03DFuni03E0uni03E1uni03E2uni03E3uni03E4uni03E5uni03E6uni03E7uni03E8uni03E9uni03EAuni03EBuni03ECuni03EDuni03EEuni03EFuni03F0uni03F1uni03F2uni03F3uni03F4uni03F5uni03F6uni03F7uni03F8uni03F9uni03FAuni03FBuni03FCuni03FDuni03FEuni03FFuni0400uni0401uni0402uni0403uni0404uni0405uni0406uni0407uni0408uni0409uni040Auni040Buni040Cuni040Duni040Euni040Funi0410uni0411uni0412uni0413uni0414uni0415uni0416uni0417uni0418uni0419uni041Auni041Buni041Cuni041Duni041Euni041Funi0420uni0421uni0422uni0423uni0424uni0425uni0426uni0427uni0428uni0429uni042Auni042Buni042Cuni042Duni042Euni042Funi0430uni0431uni0432uni0433uni0434uni0435uni0436uni0437uni0438uni0439uni043Auni043Buni043Cuni043Duni043Euni043Funi0440uni0441uni0442uni0443uni0444uni0445uni0446uni0447uni0448uni0449uni044Auni044Buni044Cuni044Duni044Euni044Funi0450uni0451uni0452uni0453uni0454uni0455uni0456uni0457uni0458uni0459uni045Auni045Buni045Cuni045Duni045Euni045Funi0460uni0461uni0462uni0463uni0464uni0465uni0466uni0467uni0468uni0469uni046Auni046Buni046Cuni046Duni046Euni046Funi0470uni0471uni0472uni0473uni0474uni0475uni0476uni0477uni0478uni0479uni047Auni047Buni047Cuni047Duni047Euni047Funi0480uni0481uni0482uni0483uni0484uni0485uni0486uni0488uni0489uni048Auni048Buni048Cuni048Duni048Euni048Funi0490uni0491uni0492uni0493uni0494uni0495uni0496uni0497uni0498uni0499uni049Auni049Buni049Cuni049Duni049Euni049Funi04A0uni04A1uni04A2uni04A3uni04A4uni04A5uni04A6uni04A7uni04A8uni04A9uni04AAuni04ABuni04ACuni04ADuni04AEuni04AFuni04B0uni04B1uni04B2uni04B3uni04B4uni04B5uni04B6uni04B7uni04B8uni04B9uni04BAuni04BBuni04BCuni04BDuni04BEuni04BFuni04C0uni04C1uni04C2uni04C3uni04C4uni04C5uni04C6uni04C7uni04C8uni04C9uni04CAuni04CBuni04CCuni04CDuni04CEuni04CFuni04D0uni04D1uni04D2uni04D3uni04D4uni04D5uni04D6uni04D7uni04D8uni04D9uni04DAuni04DBuni04DCuni04DDuni04DEuni04DFuni04E0uni04E1uni04E2uni04E3uni04E4uni04E5uni04E6uni04E7uni04E8uni04E9uni04EAuni04EBuni04ECuni04EDuni04EEuni04EFuni04F0uni04F1uni04F2uni04F3uni04F4uni04F5uni04F6uni04F7uni04F8uni04F9uni04FAuni04FBuni04FCuni04FDuni04FEuni04FFuni0500uni0501uni0502uni0503uni0504uni0505uni0506uni0507uni0508uni0509uni050Auni050Buni050Cuni050Duni050Euni050Funi0510uni0511uni0512uni0513uni0531uni0532uni0533uni0534uni0535uni0536uni0537uni0538uni0539uni053Auni053Buni053Cuni053Duni053Euni053Funi0540uni0541uni0542uni0543uni0544uni0545uni0546uni0547uni0548uni0549uni054Auni054Buni054Cuni054Duni054Euni054Funi0550uni0551uni0552uni0553uni0554uni0555uni0556uni0559uni055Auni055Buni055Cuni055Duni055Euni055Funi0561uni0562uni0563uni0564uni0565uni0566uni0567uni0568uni0569uni056Auni056Buni056Cuni056Duni056Euni056Funi0570uni0571uni0572uni0573uni0574uni0575uni0576uni0577uni0578uni0579uni057Auni057Buni057Cuni057Duni057Euni057Funi0580uni0581uni0582uni0583uni0584uni0585uni0586uni0587uni0589uni058Auni05B0uni05B1uni05B2uni05B3uni05B4uni05B5uni05B6uni05B7uni05B8uni05B9uni05BAuni05BBuni05BCuni05BDuni05BEuni05BFuni05C0uni05C1uni05C2uni05C3uni05C6uni05C7uni05D0uni05D1uni05D2uni05D3uni05D4uni05D5uni05D6uni05D7uni05D8uni05D9uni05DAuni05DBuni05DCuni05DDuni05DEuni05DFuni05E0uni05E1uni05E2uni05E3uni05E4uni05E5uni05E6uni05E7uni05E8uni05E9uni05EAuni05F0uni05F1uni05F2uni05F3uni05F4uni060Cuni0615uni061Buni061Funi0621uni0622uni0623uni0624uni0625uni0626uni0627uni0628uni0629uni062Auni062Buni062Cuni062Duni062Euni062Funi0630uni0631uni0632uni0633uni0634uni0635uni0636uni0637uni0638uni0639uni063Auni0640uni0641uni0642uni0643uni0644uni0645uni0646uni0647uni0648uni0649uni064Auni064Buni064Cuni064Duni064Euni064Funi0650uni0651uni0652uni0653uni0654uni0655uni065Auni0660uni0661uni0662uni0663uni0664uni0665uni0666uni0667uni0668uni0669uni066Auni066Buni066Cuni066Duni066Euni066Funi0674uni0679uni067Auni067Buni067Cuni067Duni067Euni067Funi0680uni0681uni0682uni0683uni0684uni0685uni0686uni0687uni0691uni0692uni0695uni0698uni06A1uni06A4uni06A6uni06A9uni06AFuni06B5uni06BAuni06BFuni06C6uni06CCuni06CEuni06D5uni06F0uni06F1uni06F2uni06F3uni06F4uni06F5uni06F6uni06F7uni06F8uni06F9uni07C0uni07C1uni07C2uni07C3uni07C4uni07C5uni07C6uni07C7uni07C8uni07C9uni07CAuni07CBuni07CCuni07CDuni07CEuni07CFuni07D0uni07D1uni07D2uni07D3uni07D4uni07D5uni07D6uni07D7uni07D8uni07D9uni07DAuni07DBuni07DCuni07DDuni07DEuni07DFuni07E0uni07E1uni07E2uni07E3uni07E4uni07E5uni07E6uni07E7uni07EBuni07ECuni07EDuni07EEuni07EFuni07F0uni07F1uni07F2uni07F3uni07F4uni07F5uni07F8uni07F9uni07FAuni0E3Funi0E81uni0E82uni0E84uni0E87uni0E88uni0E8Auni0E8Duni0E94uni0E95uni0E96uni0E97uni0E99uni0E9Auni0E9Buni0E9Cuni0E9Duni0E9Euni0E9Funi0EA1uni0EA2uni0EA3uni0EA5uni0EA7uni0EAAuni0EABuni0EADuni0EAEuni0EAFuni0EB0uni0EB1uni0EB2uni0EB3uni0EB4uni0EB5uni0EB6uni0EB7uni0EB8uni0EB9uni0EBBuni0EBCuni0EBDuni0EC0uni0EC1uni0EC2uni0EC3uni0EC4uni0EC6uni0EC8uni0EC9uni0ECAuni0ECBuni0ECCuni0ECDuni0ED0uni0ED1uni0ED2uni0ED3uni0ED4uni0ED5uni0ED6uni0ED7uni0ED8uni0ED9uni0EDCuni0EDDuni10A0uni10A1uni10A2uni10A3uni10A4uni10A5uni10A6uni10A7uni10A8uni10A9uni10AAuni10ABuni10ACuni10ADuni10AEuni10AFuni10B0uni10B1uni10B2uni10B3uni10B4uni10B5uni10B6uni10B7uni10B8uni10B9uni10BAuni10BBuni10BCuni10BDuni10BEuni10BFuni10C0uni10C1uni10C2uni10C3uni10C4uni10C5uni10D0uni10D1uni10D2uni10D3uni10D4uni10D5uni10D6uni10D7uni10D8uni10D9uni10DAuni10DBuni10DCuni10DDuni10DEuni10DFuni10E0uni10E1uni10E2uni10E3uni10E4uni10E5uni10E6uni10E7uni10E8uni10E9uni10EAuni10EBuni10ECuni10EDuni10EEuni10EFuni10F0uni10F1uni10F2uni10F3uni10F4uni10F5uni10F6uni10F7uni10F8uni10F9uni10FAuni10FBuni10FCuni1401uni1402uni1403uni1404uni1405uni1406uni1407uni1409uni140Auni140Buni140Cuni140Duni140Euni140Funi1410uni1411uni1412uni1413uni1414uni1415uni1416uni1417uni1418uni1419uni141Auni141Buni141Duni141Euni141Funi1420uni1421uni1422uni1423uni1424uni1425uni1426uni1427uni1428uni1429uni142Auni142Buni142Cuni142Duni142Euni142Funi1430uni1431uni1432uni1433uni1434uni1435uni1437uni1438uni1439uni143Auni143Buni143Cuni143Duni143Euni143Funi1440uni1441uni1442uni1443uni1444uni1445uni1446uni1447uni1448uni1449uni144Auni144Cuni144Duni144Euni144Funi1450uni1451uni1452uni1454uni1455uni1456uni1457uni1458uni1459uni145Auni145Buni145Cuni145Duni145Euni145Funi1460uni1461uni1462uni1463uni1464uni1465uni1466uni1467uni1468uni1469uni146Auni146Buni146Cuni146Duni146Euni146Funi1470uni1471uni1472uni1473uni1474uni1475uni1476uni1477uni1478uni1479uni147Auni147Buni147Cuni147Duni147Euni147Funi1480uni1481uni1482uni1483uni1484uni1485uni1486uni1487uni1488uni1489uni148Auni148Buni148Cuni148Duni148Euni148Funi1490uni1491uni1492uni1493uni1494uni1495uni1496uni1497uni1498uni1499uni149Auni149Buni149Cuni149Duni149Euni149Funi14A0uni14A1uni14A2uni14A3uni14A4uni14A5uni14A6uni14A7uni14A8uni14A9uni14AAuni14ABuni14ACuni14ADuni14AEuni14AFuni14B0uni14B1uni14B2uni14B3uni14B4uni14B5uni14B6uni14B7uni14B8uni14B9uni14BAuni14BBuni14BCuni14BDuni14C0uni14C1uni14C2uni14C3uni14C4uni14C5uni14C6uni14C7uni14C8uni14C9uni14CAuni14CBuni14CCuni14CDuni14CEuni14CFuni14D0uni14D1uni14D2uni14D3uni14D4uni14D5uni14D6uni14D7uni14D8uni14D9uni14DAuni14DBuni14DCuni14DDuni14DEuni14DFuni14E0uni14E1uni14E2uni14E3uni14E4uni14E5uni14E6uni14E7uni14E8uni14E9uni14EAuni14ECuni14EDuni14EEuni14EFuni14F0uni14F1uni14F2uni14F3uni14F4uni14F5uni14F6uni14F7uni14F8uni14F9uni14FAuni14FBuni14FCuni14FDuni14FEuni14FFuni1500uni1501uni1502uni1503uni1504uni1505uni1506uni1507uni1510uni1511uni1512uni1513uni1514uni1515uni1516uni1517uni1518uni1519uni151Auni151Buni151Cuni151Duni151Euni151Funi1520uni1521uni1522uni1523uni1524uni1525uni1526uni1527uni1528uni1529uni152Auni152Buni152Cuni152Duni152Euni152Funi1530uni1531uni1532uni1533uni1534uni1535uni1536uni1537uni1538uni1539uni153Auni153Buni153Cuni153Duni153Euni1540uni1541uni1542uni1543uni1544uni1545uni1546uni1547uni1548uni1549uni154Auni154Buni154Cuni154Duni154Euni154Funi1550uni1552uni1553uni1554uni1555uni1556uni1557uni1558uni1559uni155Auni155Buni155Cuni155Duni155Euni155Funi1560uni1561uni1562uni1563uni1564uni1565uni1566uni1567uni1568uni1569uni156Auni1574uni1575uni1576uni1577uni1578uni1579uni157Auni157Buni157Cuni157Duni157Euni157Funi1580uni1581uni1582uni1583uni1584uni1585uni158Auni158Buni158Cuni158Duni158Euni158Funi1590uni1591uni1592uni1593uni1594uni1595uni1596uni15A0uni15A1uni15A2uni15A3uni15A4uni15A5uni15A6uni15A7uni15A8uni15A9uni15AAuni15ABuni15ACuni15ADuni15AEuni15AFuni15DEuni15E1uni1646uni1647uni166Euni166Funi1670uni1671uni1672uni1673uni1674uni1675uni1676uni1680uni1681uni1682uni1683uni1684uni1685uni1686uni1687uni1688uni1689uni168Auni168Buni168Cuni168Duni168Euni168Funi1690uni1691uni1692uni1693uni1694uni1695uni1696uni1697uni1698uni1699uni169Auni169Buni169Cuni1D00uni1D01uni1D02uni1D03uni1D04uni1D05uni1D06uni1D07uni1D08uni1D09uni1D0Auni1D0Buni1D0Cuni1D0Duni1D0Euni1D0Funi1D10uni1D11uni1D12uni1D13uni1D14uni1D16uni1D17uni1D18uni1D19uni1D1Auni1D1Buni1D1Cuni1D1Duni1D1Euni1D1Funi1D20uni1D21uni1D22uni1D23uni1D26uni1D27uni1D28uni1D29uni1D2Auni1D2Buni1D2Cuni1D2Duni1D2Euni1D30uni1D31uni1D32uni1D33uni1D34uni1D35uni1D36uni1D37uni1D38uni1D39uni1D3Auni1D3Buni1D3Cuni1D3Duni1D3Euni1D3Funi1D40uni1D41uni1D42uni1D43uni1D44uni1D45uni1D46uni1D47uni1D48uni1D49uni1D4Auni1D4Buni1D4Cuni1D4Duni1D4Euni1D4Funi1D50uni1D51uni1D52uni1D53uni1D54uni1D55uni1D56uni1D57uni1D58uni1D59uni1D5Auni1D5Buni1D5Duni1D5Euni1D5Funi1D60uni1D61uni1D62uni1D63uni1D64uni1D65uni1D66uni1D67uni1D68uni1D69uni1D6Auni1D77uni1D78uni1D7Buni1D85uni1D9Buni1D9Cuni1D9Duni1D9Euni1D9Funi1DA0uni1DA1uni1DA2uni1DA3uni1DA4uni1DA5uni1DA6uni1DA7uni1DA8uni1DA9uni1DAAuni1DABuni1DACuni1DADuni1DAEuni1DAFuni1DB0uni1DB1uni1DB2uni1DB3uni1DB4uni1DB5uni1DB6uni1DB7uni1DB8uni1DB9uni1DBAuni1DBBuni1DBCuni1DBDuni1DBEuni1DBFuni1DC4uni1DC5uni1DC6uni1DC7uni1DC8uni1DC9uni1E00uni1E01uni1E02uni1E03uni1E04uni1E05uni1E06uni1E07uni1E08uni1E09uni1E0Auni1E0Buni1E0Cuni1E0Duni1E0Euni1E0Funi1E10uni1E11uni1E12uni1E13uni1E14uni1E15uni1E16uni1E17uni1E18uni1E19uni1E1Auni1E1Buni1E1Cuni1E1Duni1E1Euni1E1Funi1E20uni1E21uni1E22uni1E23uni1E24uni1E25uni1E26uni1E27uni1E28uni1E29uni1E2Auni1E2Buni1E2Cuni1E2Duni1E2Euni1E2Funi1E30uni1E31uni1E32uni1E33uni1E34uni1E35uni1E36uni1E37uni1E38uni1E39uni1E3Auni1E3Buni1E3Cuni1E3Duni1E3Euni1E3Funi1E40uni1E41uni1E42uni1E43uni1E44uni1E45uni1E46uni1E47uni1E48uni1E49uni1E4Auni1E4Buni1E4Cuni1E4Duni1E4Euni1E4Funi1E50uni1E51uni1E52uni1E53uni1E54uni1E55uni1E56uni1E57uni1E58uni1E59uni1E5Auni1E5Buni1E5Cuni1E5Duni1E5Euni1E5Funi1E60uni1E61uni1E62uni1E63uni1E64uni1E65uni1E66uni1E67uni1E68uni1E69uni1E6Auni1E6Buni1E6Cuni1E6Duni1E6Euni1E6Funi1E70uni1E71uni1E72uni1E73uni1E74uni1E75uni1E76uni1E77uni1E78uni1E79uni1E7Auni1E7Buni1E7Cuni1E7Duni1E7Euni1E7FWgravewgraveWacutewacute Wdieresis wdieresisuni1E86uni1E87uni1E88uni1E89uni1E8Auni1E8Buni1E8Cuni1E8Duni1E8Euni1E8Funi1E90uni1E91uni1E92uni1E93uni1E94uni1E95uni1E96uni1E97uni1E98uni1E99uni1E9Auni1E9Buni1EA0uni1EA1uni1EA2uni1EA3uni1EA4uni1EA5uni1EA6uni1EA7uni1EA8uni1EA9uni1EAAuni1EABuni1EACuni1EADuni1EAEuni1EAFuni1EB0uni1EB1uni1EB2uni1EB3uni1EB4uni1EB5uni1EB6uni1EB7uni1EB8uni1EB9uni1EBAuni1EBBuni1EBCuni1EBDuni1EBEuni1EBFuni1EC0uni1EC1uni1EC2uni1EC3uni1EC4uni1EC5uni1EC6uni1EC7uni1EC8uni1EC9uni1ECAuni1ECBuni1ECCuni1ECDuni1ECEuni1ECFuni1ED0uni1ED1uni1ED2uni1ED3uni1ED4uni1ED5uni1ED6uni1ED7uni1ED8uni1ED9uni1EDAuni1EDBuni1EDCuni1EDDuni1EDEuni1EDFuni1EE0uni1EE1uni1EE2uni1EE3uni1EE4uni1EE5uni1EE6uni1EE7uni1EE8uni1EE9uni1EEAuni1EEBuni1EECuni1EEDuni1EEEuni1EEFuni1EF0uni1EF1Ygraveygraveuni1EF4uni1EF5uni1EF6uni1EF7uni1EF8uni1EF9uni1F00uni1F01uni1F02uni1F03uni1F04uni1F05uni1F06uni1F07uni1F08uni1F09uni1F0Auni1F0Buni1F0Cuni1F0Duni1F0Euni1F0Funi1F10uni1F11uni1F12uni1F13uni1F14uni1F15uni1F18uni1F19uni1F1Auni1F1Buni1F1Cuni1F1Duni1F20uni1F21uni1F22uni1F23uni1F24uni1F25uni1F26uni1F27uni1F28uni1F29uni1F2Auni1F2Buni1F2Cuni1F2Duni1F2Euni1F2Funi1F30uni1F31uni1F32uni1F33uni1F34uni1F35uni1F36uni1F37uni1F38uni1F39uni1F3Auni1F3Buni1F3Cuni1F3Duni1F3Euni1F3Funi1F40uni1F41uni1F42uni1F43uni1F44uni1F45uni1F48uni1F49uni1F4Auni1F4Buni1F4Cuni1F4Duni1F50uni1F51uni1F52uni1F53uni1F54uni1F55uni1F56uni1F57uni1F59uni1F5Buni1F5Duni1F5Funi1F60uni1F61uni1F62uni1F63uni1F64uni1F65uni1F66uni1F67uni1F68uni1F69uni1F6Auni1F6Buni1F6Cuni1F6Duni1F6Euni1F6Funi1F70uni1F71uni1F72uni1F73uni1F74uni1F75uni1F76uni1F77uni1F78uni1F79uni1F7Auni1F7Buni1F7Cuni1F7Duni1F80uni1F81uni1F82uni1F83uni1F84uni1F85uni1F86uni1F87uni1F88uni1F89uni1F8Auni1F8Buni1F8Cuni1F8Duni1F8Euni1F8Funi1F90uni1F91uni1F92uni1F93uni1F94uni1F95uni1F96uni1F97uni1F98uni1F99uni1F9Auni1F9Buni1F9Cuni1F9Duni1F9Euni1F9Funi1FA0uni1FA1uni1FA2uni1FA3uni1FA4uni1FA5uni1FA6uni1FA7uni1FA8uni1FA9uni1FAAuni1FABuni1FACuni1FADuni1FAEuni1FAFuni1FB0uni1FB1uni1FB2uni1FB3uni1FB4uni1FB6uni1FB7uni1FB8uni1FB9uni1FBAuni1FBBuni1FBCuni1FBDuni1FBEuni1FBFuni1FC0uni1FC1uni1FC2uni1FC3uni1FC4uni1FC6uni1FC7uni1FC8uni1FC9uni1FCAuni1FCBuni1FCCuni1FCDuni1FCEuni1FCFuni1FD0uni1FD1uni1FD2uni1FD3uni1FD6uni1FD7uni1FD8uni1FD9uni1FDAuni1FDBuni1FDDuni1FDEuni1FDFuni1FE0uni1FE1uni1FE2uni1FE3uni1FE4uni1FE5uni1FE6uni1FE7uni1FE8uni1FE9uni1FEAuni1FEBuni1FECuni1FEDuni1FEEuni1FEFuni1FF2uni1FF3uni1FF4uni1FF6uni1FF7uni1FF8uni1FF9uni1FFAuni1FFBuni1FFCuni1FFDuni1FFEuni2000uni2001uni2002uni2003uni2004uni2005uni2006uni2007uni2008uni2009uni200Auni200Buni200Cuni200Duni200Euni200Funi2010uni2011 figuredashuni2015uni2016 underscoredbl quotereverseduni201Funi2023onedotenleadertwodotenleaderuni2027uni202Auni202Buni202Cuni202Duni202Euni202Funi2031minuteseconduni2034uni2035uni2036uni2037uni2038uni203B exclamdbluni203Duni203Euni203Funi2040uni2041uni2042uni2043uni2045uni2046uni2047uni2048uni2049uni204Auni204Buni204Cuni204Duni204Euni204Funi2050uni2051uni2052uni2053uni2054uni2055uni2056uni2057uni2058uni2059uni205Auni205Buni205Cuni205Duni205Euni205Funi2060uni2061uni2062uni2063uni206Auni206Buni206Cuni206Duni206Euni206Funi2070uni2071uni2074uni2075uni2076uni2077uni2078uni2079uni207Auni207Buni207Cuni207Duni207Euni207Funi2080uni2081uni2082uni2083uni2084uni2085uni2086uni2087uni2088uni2089uni208Auni208Buni208Cuni208Duni208Euni2090uni2091uni2092uni2093uni2094uni20A0 colonmonetaryuni20A2lirauni20A5uni20A6pesetauni20A8uni20A9uni20AAdongEurouni20ADuni20AEuni20AFuni20B0uni20B1uni20B2uni20B3uni20B4uni20B5uni20D0uni20D1uni20D6uni20D7uni20DBuni20DCuni20E1uni2100uni2101uni2102uni2103uni2104uni2105uni2106uni2107uni2108uni2109uni210Buni210Cuni210Duni210Euni210Funi2110Ifrakturuni2112uni2113uni2114uni2115uni2116uni2117 weierstrassuni2119uni211Auni211BRfrakturuni211D prescriptionuni211Funi2120uni2121uni2123uni2124uni2125uni2126uni2127uni2128uni2129uni212Auni212Buni212Cuni212D estimateduni212Funi2130uni2131uni2132uni2133uni2134alephuni2136uni2137uni2138uni2139uni213Auni213Buni213Cuni213Duni213Euni213Funi2140uni2141uni2142uni2143uni2144uni2145uni2146uni2147uni2148uni2149uni214Buni214Eonethird twothirdsuni2155uni2156uni2157uni2158uni2159uni215A oneeighth threeeighths fiveeighths seveneighthsuni215Funi2160uni2161uni2162uni2163uni2164uni2165uni2166uni2167uni2168uni2169uni216Auni216Buni216Cuni216Duni216Euni216Funi2170uni2171uni2172uni2173uni2174uni2175uni2176uni2177uni2178uni2179uni217Auni217Buni217Cuni217Duni217Euni217Funi2180uni2181uni2182uni2183uni2184 arrowleftarrowup arrowright arrowdown arrowboth arrowupdnuni2196uni2197uni2198uni2199uni219Auni219Buni219Cuni219Duni219Euni219Funi21A0uni21A1uni21A2uni21A3uni21A4uni21A5uni21A6uni21A7 arrowupdnbseuni21A9uni21AAuni21ABuni21ACuni21ADuni21AEuni21AFuni21B0uni21B1uni21B2uni21B3uni21B4carriagereturnuni21B6uni21B7uni21B8uni21B9uni21BAuni21BBuni21BCuni21BDuni21BEuni21BFuni21C0uni21C1uni21C2uni21C3uni21C4uni21C5uni21C6uni21C7uni21C8uni21C9uni21CAuni21CBuni21CCuni21CDuni21CEuni21CF arrowdblleft arrowdblup arrowdblright arrowdbldown arrowdblbothuni21D5uni21D6uni21D7uni21D8uni21D9uni21DAuni21DBuni21DCuni21DDuni21DEuni21DFuni21E0uni21E1uni21E2uni21E3uni21E4uni21E5uni21E6uni21E7uni21E8uni21E9uni21EAuni21EBuni21ECuni21EDuni21EEuni21EFuni21F0uni21F1uni21F2uni21F3uni21F4uni21F5uni21F6uni21F7uni21F8uni21F9uni21FAuni21FBuni21FCuni21FDuni21FEuni21FF universaluni2201 existentialuni2204emptysetgradientelement notelementuni220Asuchthatuni220Cuni220Duni220Euni2210uni2213uni2214uni2215uni2216 asteriskmathuni2218uni2219uni221Buni221C proportional orthogonalangleuni2221uni2222uni2223uni2224uni2225uni2226 logicaland logicalor intersectionunionuni222Cuni222Duni222Euni222Funi2230uni2231uni2232uni2233 thereforeuni2235uni2236uni2237uni2238uni2239uni223Auni223Bsimilaruni223Duni223Euni223Funi2240uni2241uni2242uni2243uni2244 congruentuni2246uni2247uni2249uni224Auni224Buni224Cuni224Duni224Euni224Funi2250uni2251uni2252uni2253uni2254uni2255uni2256uni2257uni2258uni2259uni225Auni225Buni225Cuni225Duni225Euni225F equivalenceuni2262uni2263uni2266uni2267uni2268uni2269uni226Auni226Buni226Cuni226Duni226Euni226Funi2270uni2271uni2272uni2273uni2274uni2275uni2276uni2277uni2278uni2279uni227Auni227Buni227Cuni227Duni227Euni227Funi2280uni2281 propersubsetpropersuperset notsubsetuni2285 reflexsubsetreflexsupersetuni2288uni2289uni228Auni228Buni228Cuni228Duni228Euni228Funi2290uni2291uni2292uni2293uni2294 circleplusuni2296circlemultiplyuni2298uni2299uni229Auni229Buni229Cuni229Duni229Euni229Funi22A0uni22A1uni22A2uni22A3uni22A4 perpendicularuni22A6uni22A7uni22A8uni22A9uni22AAuni22ABuni22ACuni22ADuni22AEuni22AFuni22B2uni22B3uni22B4uni22B5uni22B6uni22B7uni22B8uni22B9uni22BAuni22BBuni22BCuni22BDuni22BEuni22BFuni22C0uni22C1uni22C2uni22C3uni22C4dotmathuni22C6uni22C8uni22C9uni22CAuni22CBuni22CCuni22CDuni22D6uni22D7uni22D8uni22D9uni22DAuni22DBuni22DCuni22DDuni22DEuni22DFuni22E0uni22E1uni22E2uni22E3uni22E4uni22E5uni22E6uni22E7uni22E8uni22E9uni22EAuni22EBuni22ECuni22EDuni22EEuni22EFuni22F0uni22F1uni22F2uni22F3uni22F4uni22F5uni22F6uni22F7uni22F8uni22F9uni22FAuni22FBuni22FCuni22FDuni22FEuni22FFuni2300uni2301houseuni2303uni2304uni2305uni2306uni2307uni2308uni2309uni230Auni230Buni230Cuni230Duni230Euni230F revlogicalnotuni2311uni2318uni2319uni231Cuni231Duni231Euni231F integraltp integralbtuni2324uni2325uni2326uni2327uni2328uni232Buni232Cuni2373uni2374uni2375uni237Auni237Duni2387uni2394uni239Buni239Cuni239Duni239Euni239Funi23A0uni23A1uni23A2uni23A3uni23A4uni23A5uni23A6uni23A7uni23A8uni23A9uni23AAuni23ABuni23ACuni23ADuni23AEuni23CEuni23CFuni23E3uni23E5uni2422uni2423uni2460uni2461uni2462uni2463uni2464uni2465uni2466uni2467uni2468uni2469SF100000uni2501SF110000uni2503uni2504uni2505uni2506uni2507uni2508uni2509uni250Auni250BSF010000uni250Duni250Euni250FSF030000uni2511uni2512uni2513SF020000uni2515uni2516uni2517SF040000uni2519uni251Auni251BSF080000uni251Duni251Euni251Funi2520uni2521uni2522uni2523SF090000uni2525uni2526uni2527uni2528uni2529uni252Auni252BSF060000uni252Duni252Euni252Funi2530uni2531uni2532uni2533SF070000uni2535uni2536uni2537uni2538uni2539uni253Auni253BSF050000uni253Duni253Euni253Funi2540uni2541uni2542uni2543uni2544uni2545uni2546uni2547uni2548uni2549uni254Auni254Buni254Cuni254Duni254Euni254FSF430000SF240000SF510000SF520000SF390000SF220000SF210000SF250000SF500000SF490000SF380000SF280000SF270000SF260000SF360000SF370000SF420000SF190000SF200000SF230000SF470000SF480000SF410000SF450000SF460000SF400000SF540000SF530000SF440000uni256Duni256Euni256Funi2570uni2571uni2572uni2573uni2574uni2575uni2576uni2577uni2578uni2579uni257Auni257Buni257Cuni257Duni257Euni257Fupblockuni2581uni2582uni2583dnblockuni2585uni2586uni2587blockuni2589uni258Auni258Blfblockuni258Duni258Euni258Frtblockltshadeshadedkshadeuni2594uni2595uni2596uni2597uni2598uni2599uni259Auni259Buni259Cuni259Duni259Euni259F filledboxH22073uni25A2uni25A3uni25A4uni25A5uni25A6uni25A7uni25A8uni25A9H18543H18551 filledrectuni25ADuni25AEuni25AFuni25B0uni25B1triagupuni25B3uni25B4uni25B5uni25B6uni25B7uni25B8uni25B9triagrtuni25BBtriagdnuni25BDuni25BEuni25BFuni25C0uni25C1uni25C2uni25C3triaglfuni25C5uni25C6uni25C7uni25C8uni25C9circleuni25CCuni25CDuni25CEH18533uni25D0uni25D1uni25D2uni25D3uni25D4uni25D5uni25D6uni25D7 invbullet invcircleuni25DAuni25DBuni25DCuni25DDuni25DEuni25DFuni25E0uni25E1uni25E2uni25E3uni25E4uni25E5 openbulletuni25E7uni25E8uni25E9uni25EAuni25EBuni25ECuni25EDuni25EEuni25EFuni25F0uni25F1uni25F2uni25F3uni25F4uni25F5uni25F6uni25F7uni25F8uni25F9uni25FAuni25FBuni25FCuni25FDuni25FEuni25FFuni2600uni2601uni2602uni2603uni2604uni2605uni2606uni2607uni2608uni2609uni260Auni260Buni260Cuni260Duni260Euni260Funi2610uni2611uni2612uni2613uni2614uni2615uni2616uni2617uni2618uni2619uni261Auni261Buni261Cuni261Duni261Euni261Funi2620uni2621uni2622uni2623uni2624uni2625uni2626uni2627uni2628uni2629uni262Auni262Buni262Cuni262Duni262Euni262Funi2630uni2631uni2632uni2633uni2634uni2635uni2636uni2637uni2638uni2639 smileface invsmilefacesununi263Duni263Euni263Ffemaleuni2641maleuni2643uni2644uni2645uni2646uni2647uni2648uni2649uni264Auni264Buni264Cuni264Duni264Euni264Funi2650uni2651uni2652uni2653uni2654uni2655uni2656uni2657uni2658uni2659uni265Auni265Buni265Cuni265Duni265Euni265Fspadeuni2661uni2662clubuni2664heartdiamonduni2667uni2668uni2669 musicalnotemusicalnotedbluni266Cuni266Duni266Euni266Funi2670uni2671uni2672uni2673uni2674uni2675uni2676uni2677uni2678uni2679uni267Auni267Buni267Cuni267Duni267Euni267Funi2680uni2681uni2682uni2683uni2684uni2685uni2686uni2687uni2688uni2689uni268Auni268Buni268Cuni268Duni268Euni268Funi2690uni2691uni2692uni2693uni2694uni2695uni2696uni2697uni2698uni2699uni269Auni269Buni269Cuni26A0uni26A1uni26A2uni26A3uni26A4uni26A5uni26A6uni26A7uni26A8uni26A9uni26AAuni26ABuni26ACuni26ADuni26AEuni26AFuni26B0uni26B1uni26B2uni2701uni2702uni2703uni2704uni2706uni2707uni2708uni2709uni270Cuni270Duni270Euni270Funi2710uni2711uni2712uni2713uni2714uni2715uni2716uni2717uni2718uni2719uni271Auni271Buni271Cuni271Duni271Euni271Funi2720uni2721uni2722uni2723uni2724uni2725uni2726uni2727uni2729uni272Auni272Buni272Cuni272Duni272Euni272Funi2730uni2731uni2732uni2733uni2734uni2735uni2736uni2737uni2738uni2739uni273Auni273Buni273Cuni273Duni273Euni273Funi2740uni2741uni2742uni2743uni2744uni2745uni2746uni2747uni2748uni2749uni274Auni274Buni274Duni274Funi2750uni2751uni2752uni2756uni2758uni2759uni275Auni275Buni275Cuni275Duni275Euni2761uni2762uni2763uni2764uni2765uni2766uni2767uni2768uni2769uni276Auni276Buni276Cuni276Duni276Euni276Funi2770uni2771uni2772uni2773uni2774uni2775uni2776uni2777uni2778uni2779uni277Auni277Buni277Cuni277Duni277Euni277Funi2780uni2781uni2782uni2783uni2784uni2785uni2786uni2787uni2788uni2789uni278Auni278Buni278Cuni278Duni278Euni278Funi2790uni2791uni2792uni2793uni2794uni2798uni2799uni279Auni279Buni279Cuni279Duni279Euni279Funi27A0uni27A1uni27A2uni27A3uni27A4uni27A5uni27A6uni27A7uni27A8uni27A9uni27AAuni27ABuni27ACuni27ADuni27AEuni27AFuni27B1uni27B2uni27B3uni27B4uni27B5uni27B6uni27B7uni27B8uni27B9uni27BAuni27BBuni27BCuni27BDuni27BEuni27E0uni27E6uni27E7uni27E8uni27E9uni27EAuni27EBuni27F0uni27F1uni27F2uni27F3uni27F4uni27F5uni27F6uni27F7uni27F8uni27F9uni27FAuni27FBuni27FCuni27FDuni27FEuni27FFuni2800uni2801uni2802uni2803uni2804uni2805uni2806uni2807uni2808uni2809uni280Auni280Buni280Cuni280Duni280Euni280Funi2810uni2811uni2812uni2813uni2814uni2815uni2816uni2817uni2818uni2819uni281Auni281Buni281Cuni281Duni281Euni281Funi2820uni2821uni2822uni2823uni2824uni2825uni2826uni2827uni2828uni2829uni282Auni282Buni282Cuni282Duni282Euni282Funi2830uni2831uni2832uni2833uni2834uni2835uni2836uni2837uni2838uni2839uni283Auni283Buni283Cuni283Duni283Euni283Funi2840uni2841uni2842uni2843uni2844uni2845uni2846uni2847uni2848uni2849uni284Auni284Buni284Cuni284Duni284Euni284Funi2850uni2851uni2852uni2853uni2854uni2855uni2856uni2857uni2858uni2859uni285Auni285Buni285Cuni285Duni285Euni285Funi2860uni2861uni2862uni2863uni2864uni2865uni2866uni2867uni2868uni2869uni286Auni286Buni286Cuni286Duni286Euni286Funi2870uni2871uni2872uni2873uni2874uni2875uni2876uni2877uni2878uni2879uni287Auni287Buni287Cuni287Duni287Euni287Funi2880uni2881uni2882uni2883uni2884uni2885uni2886uni2887uni2888uni2889uni288Auni288Buni288Cuni288Duni288Euni288Funi2890uni2891uni2892uni2893uni2894uni2895uni2896uni2897uni2898uni2899uni289Auni289Buni289Cuni289Duni289Euni289Funi28A0uni28A1uni28A2uni28A3uni28A4uni28A5uni28A6uni28A7uni28A8uni28A9uni28AAuni28ABuni28ACuni28ADuni28AEuni28AFuni28B0uni28B1uni28B2uni28B3uni28B4uni28B5uni28B6uni28B7uni28B8uni28B9uni28BAuni28BBuni28BCuni28BDuni28BEuni28BFuni28C0uni28C1uni28C2uni28C3uni28C4uni28C5uni28C6uni28C7uni28C8uni28C9uni28CAuni28CBuni28CCuni28CDuni28CEuni28CFuni28D0uni28D1uni28D2uni28D3uni28D4uni28D5uni28D6uni28D7uni28D8uni28D9uni28DAuni28DBuni28DCuni28DDuni28DEuni28DFuni28E0uni28E1uni28E2uni28E3uni28E4uni28E5uni28E6uni28E7uni28E8uni28E9uni28EAuni28EBuni28ECuni28EDuni28EEuni28EFuni28F0uni28F1uni28F2uni28F3uni28F4uni28F5uni28F6uni28F7uni28F8uni28F9uni28FAuni28FBuni28FCuni28FDuni28FEuni28FFuni2906uni2907uni290Auni290Buni2940uni2941uni2983uni2984uni29CEuni29CFuni29D0uni29D1uni29D2uni29D3uni29D4uni29D5uni29EBuni29FAuni29FBuni2A00uni2A01uni2A02uni2A0Cuni2A0Duni2A0Euni2A0Funi2A10uni2A11uni2A12uni2A13uni2A14uni2A15uni2A16uni2A17uni2A18uni2A19uni2A1Auni2A1Buni2A1Cuni2A2Funi2A7Duni2A7Euni2A7Funi2A80uni2A81uni2A82uni2A83uni2A84uni2A85uni2A86uni2A87uni2A88uni2A89uni2A8Auni2A8Buni2A8Cuni2A8Duni2A8Euni2A8Funi2A90uni2A91uni2A92uni2A93uni2A94uni2A95uni2A96uni2A97uni2A98uni2A99uni2A9Auni2A9Buni2A9Cuni2A9Duni2A9Euni2A9Funi2AA0uni2AAEuni2AAFuni2AB0uni2AB1uni2AB2uni2AB3uni2AB4uni2AB5uni2AB6uni2AB7uni2AB8uni2AB9uni2ABAuni2AF9uni2AFAuni2B00uni2B01uni2B02uni2B03uni2B04uni2B05uni2B06uni2B07uni2B08uni2B09uni2B0Auni2B0Buni2B0Cuni2B0Duni2B0Euni2B0Funi2B10uni2B11uni2B12uni2B13uni2B14uni2B15uni2B16uni2B17uni2B18uni2B19uni2B1Auni2B20uni2B21uni2B22uni2B23uni2C60uni2C61uni2C62uni2C63uni2C64uni2C65uni2C66uni2C67uni2C68uni2C69uni2C6Auni2C6Buni2C6Cuni2C6Duni2C6Euni2C6Funi2C71uni2C72uni2C73uni2C74uni2C75uni2C76uni2C77uni2D30uni2D31uni2D32uni2D33uni2D34uni2D35uni2D36uni2D37uni2D38uni2D39uni2D3Auni2D3Buni2D3Cuni2D3Duni2D3Euni2D3Funi2D40uni2D41uni2D42uni2D43uni2D44uni2D45uni2D46uni2D47uni2D48uni2D49uni2D4Auni2D4Buni2D4Cuni2D4Duni2D4Euni2D4Funi2D50uni2D51uni2D52uni2D53uni2D54uni2D55uni2D56uni2D57uni2D58uni2D59uni2D5Auni2D5Buni2D5Cuni2D5Duni2D5Euni2D5Funi2D60uni2D61uni2D62uni2D63uni2D64uni2D65uni2D6Funi4DC0uni4DC1uni4DC2uni4DC3uni4DC4uni4DC5uni4DC6uni4DC7uni4DC8uni4DC9uni4DCAuni4DCBuni4DCCuni4DCDuni4DCEuni4DCFuni4DD0uni4DD1uni4DD2uni4DD3uni4DD4uni4DD5uni4DD6uni4DD7uni4DD8uni4DD9uni4DDAuni4DDBuni4DDCuni4DDDuni4DDEuni4DDFuni4DE0uni4DE1uni4DE2uni4DE3uni4DE4uni4DE5uni4DE6uni4DE7uni4DE8uni4DE9uni4DEAuni4DEBuni4DECuni4DEDuni4DEEuni4DEFuni4DF0uni4DF1uni4DF2uni4DF3uni4DF4uni4DF5uni4DF6uni4DF7uni4DF8uni4DF9uni4DFAuni4DFBuni4DFCuni4DFDuni4DFEuni4DFFuniF000uniF001uniF6C5uniFB00uniFB03uniFB04uniFB05uniFB06uniFB13uniFB14uniFB15uniFB16uniFB17uniFB1DuniFB1EuniFB1FuniFB20uniFB21uniFB22uniFB23uniFB24uniFB25uniFB26uniFB27uniFB28uniFB29uniFB2AuniFB2BuniFB2CuniFB2DuniFB2EuniFB2FuniFB30uniFB31uniFB32uniFB33uniFB34uniFB35uniFB36uniFB38uniFB39uniFB3AuniFB3BuniFB3CuniFB3EuniFB40uniFB41uniFB43uniFB44uniFB46uniFB47uniFB48uniFB49uniFB4AuniFB4BuniFB4CuniFB4DuniFB4EuniFB4FuniFB52uniFB53uniFB54uniFB55uniFB56uniFB57uniFB58uniFB59uniFB5AuniFB5BuniFB5CuniFB5DuniFB5EuniFB5FuniFB60uniFB61uniFB62uniFB63uniFB64uniFB65uniFB66uniFB67uniFB68uniFB69uniFB6AuniFB6BuniFB6CuniFB6DuniFB6EuniFB6FuniFB70uniFB71uniFB72uniFB73uniFB74uniFB75uniFB76uniFB77uniFB78uniFB79uniFB7AuniFB7BuniFB7CuniFB7DuniFB7EuniFB7FuniFB80uniFB81uniFB8AuniFB8BuniFB8CuniFB8DuniFB8EuniFB8FuniFB90uniFB91uniFB92uniFB93uniFB94uniFB95uniFB9EuniFB9FuniFBD9uniFBDAuniFBE8uniFBE9uniFBFCuniFBFDuniFBFEuniFBFFuniFE00uniFE01uniFE02uniFE03uniFE04uniFE05uniFE06uniFE07uniFE08uniFE09uniFE0AuniFE0BuniFE0CuniFE0DuniFE0EuniFE0FuniFE20uniFE21uniFE22uniFE23uniFE70uniFE71uniFE72uniFE73uniFE74uniFE76uniFE77uniFE78uniFE79uniFE7AuniFE7BuniFE7CuniFE7DuniFE7EuniFE7FuniFE80uniFE81uniFE82uniFE83uniFE84uniFE85uniFE86uniFE87uniFE88uniFE89uniFE8AuniFE8BuniFE8CuniFE8DuniFE8EuniFE8FuniFE90uniFE91uniFE92uniFE93uniFE94uniFE95uniFE96uniFE97uniFE98uniFE99uniFE9AuniFE9BuniFE9CuniFE9DuniFE9EuniFE9FuniFEA0uniFEA1uniFEA2uniFEA3uniFEA4uniFEA5uniFEA6uniFEA7uniFEA8uniFEA9uniFEAAuniFEABuniFEACuniFEADuniFEAEuniFEAFuniFEB0uniFEB1uniFEB2uniFEB3uniFEB4uniFEB5uniFEB6uniFEB7uniFEB8uniFEB9uniFEBAuniFEBBuniFEBCuniFEBDuniFEBEuniFEBFuniFEC0uniFEC1uniFEC2uniFEC3uniFEC4uniFEC5uniFEC6uniFEC7uniFEC8uniFEC9uniFECAuniFECBuniFECCuniFECDuniFECEuniFECFuniFED0uniFED1uniFED2uniFED3uniFED4uniFED5uniFED6uniFED7uniFED8uniFED9uniFEDAuniFEDBuniFEDCuniFEDDuniFEDEuniFEDFuniFEE0uniFEE1uniFEE2uniFEE3uniFEE4uniFEE5uniFEE6uniFEE7uniFEE8uniFEE9uniFEEAuniFEEBuniFEECuniFEEDuniFEEEuniFEEFuniFEF0uniFEF1uniFEF2uniFEF3uniFEF4uniFEF5uniFEF6uniFEF7uniFEF8uniFEF9uniFEFAuniFEFBuniFEFCuniFEFFuniFFF9uniFFFAuniFFFBuniFFFCuniFFFDu1D300u1D301u1D302u1D303u1D304u1D305u1D306u1D307u1D308u1D309u1D30Au1D30Bu1D30Cu1D30Du1D30Eu1D30Fu1D310u1D311u1D312u1D313u1D314u1D315u1D316u1D317u1D318u1D319u1D31Au1D31Bu1D31Cu1D31Du1D31Eu1D31Fu1D320u1D321u1D322u1D323u1D324u1D325u1D326u1D327u1D328u1D329u1D32Au1D32Bu1D32Cu1D32Du1D32Eu1D32Fu1D330u1D331u1D332u1D333u1D334u1D335u1D336u1D337u1D338u1D339u1D33Au1D33Bu1D33Cu1D33Du1D33Eu1D33Fu1D340u1D341u1D342u1D343u1D344u1D345u1D346u1D347u1D348u1D349u1D34Au1D34Bu1D34Cu1D34Du1D34Eu1D34Fu1D350u1D351u1D352u1D353u1D354u1D355u1D356u1D538u1D539u1D53Bu1D53Cu1D53Du1D53Eu1D540u1D541u1D542u1D543u1D544u1D546u1D54Au1D54Bu1D54Cu1D54Du1D54Eu1D54Fu1D550u1D552u1D553u1D554u1D555u1D556u1D557u1D558u1D559u1D55Au1D55Bu1D55Cu1D55Du1D55Eu1D55Fu1D560u1D561u1D562u1D563u1D564u1D565u1D566u1D567u1D568u1D569u1D56Au1D56Bu1D5A0u1D5A1u1D5A2u1D5A3u1D5A4u1D5A5u1D5A6u1D5A7u1D5A8u1D5A9u1D5AAu1D5ABu1D5ACu1D5ADu1D5AEu1D5AFu1D5B0u1D5B1u1D5B2u1D5B3u1D5B4u1D5B5u1D5B6u1D5B7u1D5B8u1D5B9u1D5BAu1D5BBu1D5BCu1D5BDu1D5BEu1D5BFu1D5C0u1D5C1u1D5C2u1D5C3u1D5C4u1D5C5u1D5C6u1D5C7u1D5C8u1D5C9u1D5CAu1D5CBu1D5CCu1D5CDu1D5CEu1D5CFu1D5D0u1D5D1u1D5D2u1D5D3u1D7E2u1D7E3u1D7E4u1D7E5u1D7E6u1D7E7u1D7E8u1D7E9u1D7EAu1D7EB dlLtcaronDieresisAcuteTildeGrave CircumflexCaron uni0311.caseBreve Dotaccent Hungarumlaut Doubleacute arabic_dot arabic_2dots arabic_3dotsarabic_3dots_aarabic_2dots_a arabic_4dots uni066E.fina uni066E.init uni066E.medi uni06A1.fina uni06A1.init uni06A1.medi uni066F.fina uni066F.init uni066F.medi uni06BA.init uni06BA.medi arabic_ring uni067C.fina uni067C.init uni067C.medi uni067D.fina uni067D.init uni067D.medi uni0681.fina uni0681.init uni0681.medi uni0682.fina uni0682.init uni0682.medi uni0685.fina uni0685.init uni0685.medi uni06BF.fina uni06BF.init uni06BF.mediarabic_gaf_barEng.altuni0268.dotlessuni029D.dotless uni03080304 uni03040308 uni03070304 uni03080301 uni03080300 uni03040301 uni03040300 uni03030304 uni0308030C uni03030308 uni030C0307 uni03030301 uni03020301 uni03020300 uni03020303 uni03060303 uni03060301 uni03060300 uni03060309 uni03020309 uni03010307 brailledotJ.alt uni0695.finauniFEAE.fina.longstart uni06B5.fina uni06B5.init uni06B5.medi uni06CE.fina uni06CE.init uni06CE.medi uni0692.final.alt uni06D5.finauni0478.monographuni0479.monographiogonek.dotlessuni2148.dotlessuni2149.dotlessuni1E2D.dotlessuni1ECB.dotlessdcoI.alt arrow.base uni0651064B uni0651064C uni064B0651 uni0651064E uni0651064F uni064E0651 uni0654064E uni0654064F uni07CA.fina uni07CA.medi uni07CA.init uni07CB.fina uni07CB.medi uni07CB.init uni07CC.fina uni07CC.medi uni07CC.init uni07CD.fina uni07CD.medi uni07CD.init uni07CE.fina uni07CE.medi uni07CE.init uni07CF.fina uni07CF.medi uni07CF.init uni07D0.fina uni07D0.medi uni07D0.init uni07D1.fina uni07D1.medi uni07D1.init uni07D2.fina uni07D2.medi uni07D2.init uni07D3.fina uni07D3.medi uni07D3.init uni07D4.fina uni07D4.medi uni07D4.init uni07D5.fina uni07D5.medi uni07D5.init uni07D6.fina uni07D6.medi uni07D6.init uni07D7.fina uni07D7.medi uni07D7.init uni07D8.fina uni07D8.medi uni07D8.init uni07D9.fina uni07D9.medi uni07D9.init uni07DA.fina uni07DA.medi uni07DA.init uni07DB.fina uni07DB.medi uni07DB.init uni07DC.fina uni07DC.medi uni07DC.init uni07DD.fina uni07DD.medi uni07DD.init uni07DE.fina uni07DE.medi uni07DE.init uni07DF.fina uni07DF.medi uni07DF.init uni07E0.fina uni07E0.medi uni07E0.init uni07E1.fina uni07E1.medi uni07E1.init uni07E2.fina uni07E2.medi uni07E2.init uni07E3.fina uni07E3.medi uni07E3.init uni07E4.fina uni07E4.medi uni07E4.init uni07E5.fina uni07E5.medi uni07E5.init uni07E6.fina uni07E6.medi uni07E6.init uni07E7.fina uni07E7.medi uni07E7.init Ringabove uni2630.alt uni2631.alt uni2632.alt uni2633.alt uni2634.alt uni2635.alt uni2636.alt uni2637.alt uni047E.diacuni048A.brevelessuni048B.breveless uni2E18.u51¸€@ÿûþúù%ø2÷–öõþôþó%òñ–ð%ïŠAïþî–í–ìúëúêþé:èBçþæ2åäSå–äŠAäSãâ/ãúâ/áþàþß2ÞÝ–ÜþÛÚ}Ù»ØþÖŠAÖ}ÕÔGÕ}ÔGÓÒÓþÒÑþÐþÏþÎþÍ–ÌËÌþËÊ2ÉþÆ…ÆÅÄþÃþÂþÁþÀþ¿þ¾þ½þ¼þ»þº¹†%¹þ¸·»¸þ·¶]·»·€¶µ%¶]@ÿ¶@µ%´þ³–²þ±þ°þ¯þ®d­¬«%¬d«ª«%ª©ŠA©ú¨þ§þ¦þ¥¤þ£¢£2¢¡d ŠA –Ÿþž žþ œ›œd›š›š™ ˜þ—– —þ– •ŠA•–”“”(“’ú‘»‘þ]»€Ž%]@Ž%þŒ‹.Œþ‹.І%ŠA‰ˆ ‰ˆ ‡†%‡d†…†%…„þƒ‚ƒþ‚þ€þþ@ÿ~}}~þ}}|d{T{%zþyþxw v uþtúsúrúqúpþoþnþl!kþjBjSiþh}gBfþeþdþcþbþa:`ú^ ]þ[þZþYX YúX WW2VþUTUBTSSRQJQþP OþNMNþMLþKJKþJIJI IH GþF–E–DþC-CúB»AK@þ?þ>=>=<=<; <@ÿ; :þ9þ878ú76765 65 43 21 2þ1 0/ 0 / .- .- ,2+*%+d*)*%)('%(A'%&% &% $þ#þ"!! dú d BþúBBþdþþþþBþ-B}dþ  þ   þ  þ-þdþ@-þ-þ¸d…++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++pgfouine-1.2/include/reporting/artichow/font/README0000644000175000017500000000441511012376766020703 0ustar acmeacmeDejaVu fonts 2.24 (c)2004-2008 DejaVu fonts team ------------------------------------------------ The DejaVu fonts are a font family based on the Bitstream Vera Fonts (http://gnome.org/fonts/). Its purpose is to provide a wider range of characters (see status.txt for more information) while maintaining the original look and feel. DejaVu fonts are based on Bitstream Vera fonts version 1.10. Available fonts (Sans = sans serif, Mono = monospaced): DejaVu Sans Mono DejaVu Sans Mono Bold DejaVu Sans Mono Bold Oblique DejaVu Sans Mono Oblique DejaVu Sans DejaVu Sans Bold DejaVu Sans Bold Oblique DejaVu Sans Oblique DejaVu Sans ExtraLight (experimental) DejaVu Serif DejaVu Serif Bold DejaVu Serif Bold Italic (experimental) DejaVu Serif Italic (experimental) DejaVu Sans Condensed (experimental) DejaVu Sans Condensed Bold (experimental) DejaVu Sans Condensed Bold Oblique (experimental) DejaVu Sans Condensed Oblique (experimental) DejaVu Serif Condensed (experimental) DejaVu Serif Condensed Bold (experimental) DejaVu Serif Condensed Bold Italic (experimental) DejaVu Serif Condensed Italic (experimental) All fonts are also available as derivative called DejaVu LGC with support only for Latin, Greek and Cyrillic scripts. For license information see LICENSE. What's new is described in NEWS. Known bugs are in BUGS. All authors are mentioned in AUTHORS. Fonts are published in source form as SFD files (Spline Font Database from FontForge - http://fontforge.sf.net/) and in compiled form as TTF files (TrueType fonts). For more information go to http://dejavu.sourceforge.net/. Characters from Arev fonts, Copyright (c) 2006 by Tavmjong Bah: --------------------------- U+01BA, U+01BF, U+01F7, U+021C-U+021D, U+0220, U+0222-U+0223, U+02B9, U+02BA, U+02BD, U+02C2-U+02C5, U+02d4-U+02D5, U+02D7, U+02EC-U+02EE, U+0346-U+034E, U+0360, U+0362, U+03E2-03EF, U+0460-0463, U+0466-U+0486, U+0488-U+0489, U+04A8-U+04A9, U+0500-U+050F, U+2055-205E, U+20B0, U+20B2-U+20B3, U+2102, U+210D, U+210F, U+2111, U+2113, U+2115, U+2118-U+211A, U+211C-U+211D, U+2124, U+2135, U+213C-U+2140, U+2295-U+2298, U+2308-U+230B, U+26A2-U+26B1, U+2701-U+2704, U+2706-U+2709, U+270C-U+274B, U+2758-U+275A, U+2761-U+2775, U+2780-U+2794, U+2798-U+27AF, U+27B1-U+27BE, U+FB05-U+FB06 $Id: README,v 1.1 2008/05/13 20:45:42 gsmet Exp $ pgfouine-1.2/include/reporting/artichow/font/LICENSE0000644000175000017500000001132211012376766021023 0ustar acmeacmeFonts are (c) Bitstream (see below). DejaVu changes are in public domain. Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below) Bitstream Vera Fonts Copyright ------------------------------ Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera". This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names. The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org. Arev Fonts Copyright ------------------------------ Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the modifications to the Bitstream Vera Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Tavmjong Bah" or the word "Arev". This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Tavmjong Bah Arev" names. The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. Except as contained in this notice, the name of Tavmjong Bah shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from Tavmjong Bah. For further information, contact: tavmjong @ free . fr. $Id: LICENSE,v 1.1 2008/05/13 20:45:42 gsmet Exp $ pgfouine-1.2/include/reporting/artichow/Artichow.cfg.php0000644000175000017500000000224611012376766022104 0ustar acmeacmepgfouine-1.2/include/reporting/artichow/README0000644000175000017500000001121210352052224017710 0ustar acmeacme I. Installation II. Configuration III. Utilisation IV. Divers I. Installation ------------ *** Première installation *** L'installation de Artichow se résume à décompresser l'archive dans le dossier de votre choix sur votre serveur. Veillez simplement à télécharger l'archive dont vous avez vraiment besoin (PHP 5 ou PHP 4 & 5). Notez que Artichow requiert GD 2 et PHP 4.3.0 au minimum pour fonctionner. *** Mise à jour *** Lorsque vous souhaitez mettre à jour Artichow avec la dernière version, essayez de suivre pas à pas ces étapes : 1) Décompressez la dernière version de Artichow dans un dossier 2) Ecrasez le fichier Artichow.cfg.php avec votre ancien fichier 3) Copiez vos patterns dans le dossier patterns/ de la nouvelle version 4) Supprimez l'ancienne version de Artichow de votre disque 5) Copiez la nouvelle version là où était l'ancienne Une fois ces cinq étapes effectuées, vous n'aurez plus qu'à mettre éventuellement à jour vos graphiques, en fonction des dernières évolutions de l'API de Artichow. Pour cela, voyez le titre "Migrer d'une version à l'autre" sur la page : http://www.artichow.org/documentation II. Configuration ------------- Même si une utilisation normale de Artichow ne nécessite pas de configuration particulière, il existe un fichier Artichow.cfg.php qui permet de modifier quelques paramètres de la librairie. Vous pouvez notamment configurer le répertoire vers les polices de caractère en modifiant la constante ARTICHOW_FONT (par exemple en choisissant 'c:\Windows\font' si vous êtes sous Windows). Vous pouvez également redéfinir la variable $fonts. Cette variable contient une liste de polices TTF (sans l'extension) présentes dans votre répertoire ARTICHOW_FONT. Pour toutes les polices de cette liste, une classe du même nom est créée. Les polices ainsi définies peuvent ensuite être utilisées de cette manière : Il existe également une constante ARTICHOW_DEPRECATED. Si cette constante vaut TRUE, alors un message d'erreur sera affiché lorsque vous utiliserez une fonctionnalité dépréciée de Artichow. A l'inverse, avec la valeur FALSE, vous pourrez continuer à utiliser les fonctions dépréciées sans soucis. Cependant, dans un souci de compatibilité, il est préférable de mettre à jour vos graphiques dès lors qu'un message de ce type apparaît (et donc de laisser la constante à TRUE). Les fonctionnalités dépréciées sont toujours potentiellement susceptibles de disparaître d'une version à l'autre de la librairie. La constante ARTICHOW_PREFIX est vide par défaut et correspond à un préfixe qui est ajouté au nom de chaque classe utilisée sur Artichow. Certains noms de classe (Graph, Image, Text, Font, etc.) sont utilisés par d'autres librairies et cela peut aboutir à des conflits. Pour résoudre ce problème, choisissez par exemple 'xyz' comme préfixe et toutes les classes de Artichow s'appèleront désormais xyz[Nom normal]. Exemple d'utilisation de Artichow avec ARTICHOW_PREFIX à 'xyz' : title->set('Mon graphique'); $plot->title->setFont(new xyzFont4); $graph = new xyzGraph(400, 300); $graph->add($plot); $graph->draw(); ?> III. Utilisation ----------- Si vous utilisez la version conçue exclusivement pour PHP 5, vous pouvez vous référer aux exemples et aux tutoriels afin de bien prendre en main la librairie. Si vous utilisez la version pour PHP 4 & 5, référez vous également aux exemples et tutoriels mais faîtes attention lors de l'inclusion des fichiers de Artichow. N'incluez pas les fichiers de cette manière : Préférez plutôt : C'est la librairie qui se charge de sélectionner les bons fichiers en fonction de la version de PHP dont vous disposez. IV. Divers ------ La documentation de Artichow est disponible sur : http://www.artichow.org/documentation Des tutoriels sont accessibles sur : http://www.artichow.org/tutorial Un forum de support peut être trouvé sur : http://www.artichow.org/forum/ N'oubliez pas que Artichow est dans le domaine public. Vous pouvez donc faire CE QUE VOUS SOUHAITEZ avec cette librairie, y compris ajouter votre nom dans chaque fichier, et la redistribuer ainsi. Si vous souhaitez aider et participer au développement de Artichow, n'hésitez pas à consulter cette page : http://www.artichow.org/help pgfouine-1.2/include/reporting/artichow/Pattern.class.php0000644000175000017500000000015010352052224022261 0ustar acmeacmepgfouine-1.2/include/reporting/artichow/BarPlot.class.php0000644000175000017500000000015010352052224022207 0ustar acmeacmepgfouine-1.2/include/reporting/artichow/php5/0000755000175000017500000000000011516212335017713 5ustar acmeacmepgfouine-1.2/include/reporting/artichow/php5/Plot.class.php0000644000175000017500000007016411012376766022470 0ustar acmeacme */ define("PLOT_LEFT", 'left'); define("PLOT_RIGHT", 'right'); define("PLOT_TOP", 'top'); define("PLOT_BOTTOM", 'bottom'); define("PLOT_BOTH", 'both'); /* */ /** * Graph using X and Y axis * * @package Artichow */ abstract class awPlot extends awComponent { /** * Values for Y axis * * @var array */ protected $datay; /** * Values for X axis * * @var array */ protected $datax; /** * Grid properties * * @var Grid */ public $grid; /** * X axis * * @var Axis */ public $xAxis; /** * Y axis * * @var Axis */ public $yAxis; /** * Position of X axis * * @var int */ protected $xAxisPosition = awPlot::BOTTOM; /** * Set X axis on zero ? * * @var bool */ protected $xAxisZero = TRUE; /** * Set Y axis on zero ? * * @var bool */ protected $yAxisZero = FALSE; /** * Position of Y axis * * @var int */ protected $yAxisPosition = awPlot::LEFT; /** * Change min value for Y axis * * @var mixed */ private $yMin = NULL; /** * Change max value for Y axis * * @var mixed */ private $yMax = NULL; /** * Change min value for X axis * * @var mixed */ private $xMin = NULL; /** * Change max value for X axis * * @var mixed */ private $xMax = NULL; /** * Left axis * * @var int */ const LEFT = 'left'; /** * RIGHT axis * * @var int */ const RIGHT = 'right'; /** * Top axis * * @var int */ const TOP = 'top'; /** * Bottom axis * * @var int */ const BOTTOM = 'bottom'; /** * Both left/right or top/bottom axis * * @var int */ const BOTH = 'both'; /** * Build the plot * */ public function __construct() { parent::__construct(); $this->grid = new awGrid; $this->grid->setBackgroundColor(new awWhite); $this->padding->add(20, 0, 0, 20); $this->xAxis = new awAxis; $this->xAxis->addTick('major', new awTick(0, 5)); $this->xAxis->addTick('minor', new awTick(0, 3)); $this->xAxis->setTickStyle(awTick::OUT); $this->xAxis->label->setFont(new awDejaVuSans(7)); $this->yAxis = new awAxis; $this->yAxis->auto(TRUE); $this->yAxis->addTick('major', new awTick(0, 5)); $this->yAxis->addTick('minor', new awTick(0, 3)); $this->yAxis->setTickStyle(awTick::OUT); $this->yAxis->setNumberByTick('minor', 'major', 3); $this->yAxis->label->setFont(new awDejaVuSans(7)); $this->yAxis->title->setAngle(90); } /** * Get plot values * * @return array */ public function getValues() { return $this->datay; } /** * Reduce number of values in the plot * * @param int $number Reduce number of values to $number */ public function reduce($number) { $count = count($this->datay); $ratio = ceil($count / $number); if($ratio > 1) { $tmpy = $this->datay; $datay = array(); $datax = array(); $cbLabel = $this->xAxis->label->getCallbackFunction(); for($i = 0; $i < $count; $i += $ratio) { $slice = array_slice($tmpy, $i, $ratio); $datay[] = array_sum($slice) / count($slice); // Reduce data on X axis if needed if($cbLabel !== NULL) { $datax[] = $cbLabel($i + round($ratio / 2)); } } $this->setValues($datay); if($cbLabel !== NULL) { $this->xAxis->setLabelText($datax); } } } /** * Count values in the plot * * @return int */ public function getXAxisNumber() { list($min, $max) = $this->xAxis->getRange(); return ($max - $min + 1); } /** * Change X axis * * @param int $axis */ public function setXAxis($axis) { $this->xAxisPosition = $axis; } /** * Get X axis * * @return int */ public function getXAxis() { return $this->xAxisPosition; } /** * Set X axis on zero * * @param bool $zero */ public function setXAxisZero($zero) { $this->xAxisZero = (bool)$zero; } /** * Set Y axis on zero * * @param bool $zero */ public function setYAxisZero($zero) { $this->yAxisZero = (bool)$zero; } /** * Change Y axis * * @param int $axis */ public function setYAxis($axis) { $this->yAxisPosition = $axis; } /** * Get Y axis * * @return int */ public function getYAxis() { return $this->yAxisPosition; } /** * Change min value for Y axis * Set NULL for auto selection. * * @param float $value */ public function setYMin($value) { $this->yMin = $value; $this->yAxis->auto(FALSE); $this->updateAxis(); } /** * Change max value for Y axis * Set NULL for auto selection. * * @param float $value */ public function setYMax($value) { $this->yMax = $value; $this->yAxis->auto(FALSE); $this->updateAxis(); } /** * Change min value for X axis * Set NULL for auto selection. * * @param float $value */ public function setXMin($value) { $this->xMin = $value; $this->updateAxis(); } /** * Change max value for X axis * Set NULL for auto selection. * * @param float $value */ public function setXMax($value) { $this->xMax = $value; $this->updateAxis(); } /** * Get min value for Y axis * * @return float $value */ public function getYMin() { if($this->auto) { if(is_null($this->yMin)) { $min = array_min($this->datay); if($min > 0) { return 0; } } } return is_null($this->yMin) ? array_min($this->datay) : (float)$this->yMin; } /** * Get max value for Y axis * * @return float $value */ public function getYMax() { if($this->auto) { if(is_null($this->yMax)) { $max = array_max($this->datay); if($max < 0) { return 0; } } } return is_null($this->yMax) ? array_max($this->datay) : (float)$this->yMax; } /** * Get min value for X axis * * @return float $value */ public function getXMin() { return floor(is_null($this->xMin) ? array_min($this->datax) : $this->xMin); } /** * Get max value for X axis * * @return float $value */ public function getXMax() { return (ceil(is_null($this->xMax) ? array_max($this->datax) : (float)$this->xMax)) + ($this->getXCenter() ? 1 : 0); } /** * Get min value with spaces for Y axis * * @return float $value */ public function getRealYMin() { $min = $this->getYMin(); if($this->space->bottom !== NULL) { $interval = ($this->getYMax() - $min) * $this->space->bottom / 100; return $min - $interval; } else { return is_null($this->yMin) ? $min : (float)$this->yMin; } } /** * Get max value with spaces for Y axis * * @return float $value */ public function getRealYMax() { $max = $this->getYMax(); if($this->space->top !== NULL) { $interval = ($max - $this->getYMin()) * $this->space->top / 100; return $max + $interval; } else { return is_null($this->yMax) ? $max : (float)$this->yMax; } } public function init(awDrawer $drawer) { list($x1, $y1, $x2, $y2) = $this->getPosition(); // Get space informations list($leftSpace, $rightSpace, $topSpace, $bottomSpace) = $this->getSpace($x2 - $x1, $y2 - $y1); $this->xAxis->setPadding($leftSpace, $rightSpace); if($this->space->bottom > 0 or $this->space->top > 0) { list($min, $max) = $this->yAxis->getRange(); $interval = $max - $min; $this->yAxis->setRange( $min - $interval * $this->space->bottom / 100, $max + $interval * $this->space->top / 100 ); } // Auto-scaling mode $this->yAxis->autoScale(); // Number of labels is not specified if($this->yAxis->getLabelNumber() === NULL) { $number = round(($y2 - $y1) / 75) + 2; $this->yAxis->setLabelNumber($number); } $this->xAxis->line->setX($x1, $x2); $this->yAxis->line->setY($y2, $y1); // Set ticks /* */ $this->xAxis->tick('major')->setNumber($this->getXAxisNumber()); $this->yAxis->tick('major')->setNumber($this->yAxis->getLabelNumber()); /* */ /* -- $this->xAxis->ticks['major']->setNumber($this->getXAxisNumber()); $this->yAxis->ticks['major']->setNumber($this->yAxis->getLabelNumber()); -- */ // Center X axis on zero if($this->xAxisZero) { $this->xAxis->setYCenter($this->yAxis, 0); } // Center Y axis on zero if($this->yAxisZero) { $this->yAxis->setXCenter($this->xAxis, 0); } // Set axis labels $labels = array(); for($i = 0, $count = $this->getXAxisNumber(); $i < $count; $i++) { $labels[] = $i; } $this->xAxis->label->set($labels); parent::init($drawer); list($x1, $y1, $x2, $y2) = $this->getPosition(); list($leftSpace, $rightSpace) = $this->getSpace($x2 - $x1, $y2 - $y1); // Create the grid $this->createGrid(); // Draw the grid $this->grid->setSpace($leftSpace, $rightSpace, 0, 0); $this->grid->draw($drawer, $x1, $y1, $x2, $y2); } public function drawEnvelope(awDrawer $drawer) { list($x1, $y1, $x2, $y2) = $this->getPosition(); if($this->getXCenter()) { $size = $this->xAxis->getDistance(0, 1); $this->xAxis->label->move($size / 2, 0); $this->xAxis->label->hideLast(TRUE); } // Draw top axis if($this->xAxisPosition === awPlot::TOP or $this->xAxisPosition === awPlot::BOTH) { $top = clone $this->xAxis; if($this->xAxisZero === FALSE) { $top->line->setY($y1, $y1); } $top->label->setAlign(NULL, awLabel::TOP); $top->label->move(0, -3); $top->title->move(0, -25); $top->draw($drawer); } // Draw bottom axis if($this->xAxisPosition === awPlot::BOTTOM or $this->xAxisPosition === awPlot::BOTH) { $bottom = clone $this->xAxis; if($this->xAxisZero === FALSE) { $bottom->line->setY($y2, $y2); } $bottom->label->setAlign(NULL, awLabel::BOTTOM); $bottom->label->move(0, 3); $bottom->reverseTickStyle(); $bottom->title->move(0, 25); $bottom->draw($drawer); } // Draw left axis if($this->yAxisPosition === awPlot::LEFT or $this->yAxisPosition === awPlot::BOTH) { $left = clone $this->yAxis; if($this->yAxisZero === FALSE) { $left->line->setX($x1, $x1); } $left->label->setAlign(awLabel::RIGHT); $left->label->move(-6, 0); $left->title->move(-25, 0); $left->draw($drawer); } // Draw right axis if($this->yAxisPosition === awPlot::RIGHT or $this->yAxisPosition === awPlot::BOTH) { $right = clone $this->yAxis; if($this->yAxisZero === FALSE) { $right->line->setX($x2, $x2); } $right->label->setAlign(awLabel::LEFT); $right->label->move(6, 0); $right->reverseTickStyle(); $right->title->move(25, 0); $right->draw($drawer); } } protected function createGrid() { $max = $this->getRealYMax(); $min = $this->getRealYMin(); $number = $this->yAxis->getLabelNumber() - 1; if($number < 1) { return; } // Horizontal lines of the grid $h = array(); for($i = 0; $i <= $number; $i++) { $h[] = $i / $number; } // Vertical lines $major = $this->yAxis->tick('major'); $interval = $major->getInterval(); $number = $this->getXAxisNumber() - 1; $w = array(); if($number > 0) { for($i = 0; $i <= $number; $i++) { if($i%$interval === 0) { $w[] = $i / $number; } } } $this->grid->setGrid($w, $h); } /** * Change values of Y axis * This method ignores not numeric values * * @param array $datay * @param array $datax */ public function setValues($datay, $datax = NULL) { $this->checkArray($datay); foreach($datay as $key => $value) { unset($datay[$key]); $datay[(int)$key] = $value; } if($datax === NULL) { $datax = array(); for($i = 0; $i < count($datay); $i++) { $datax[] = $i; } } else { foreach($datax as $key => $value) { unset($datax[$key]); $datax[(int)$key] = $value; } } $this->checkArray($datax); if(count($datay) === count($datax)) { // Set values $this->datay = $datay; $this->datax = $datax; // Update axis with the new awvalues $this->updateAxis(); } else { trigger_error("Plots must have the same number of X and Y points", E_USER_ERROR); } } /** * Return begin and end values * * @return array */ protected function getLimit() { $i = 0; while(array_key_exists($i, $this->datay) and $this->datay[$i] === NULL) { $i++; } $start = $i; $i = count($this->datay) - 1; while(array_key_exists($i, $this->datay) and $this->datay[$i] === NULL) { $i--; } $stop = $i; return array($start, $stop); } /** * Return TRUE if labels must be centered on X axis, FALSE otherwise * * @return bool */ abstract public function getXCenter(); private function updateAxis() { $this->xAxis->setRange( $this->getXMin(), $this->getXMax() ); $this->yAxis->setRange( $this->getRealYMin(), $this->getRealYMax() ); } private function checkArray(&$array) { if(is_array($array) === FALSE) { trigger_error("You tried to set a value that is not an array", E_USER_ERROR); } foreach($array as $key => $value) { if(is_numeric($value) === FALSE and is_null($value) === FALSE) { trigger_error("Expected numeric values for the plot", E_USER_ERROR); } } if(count($array) < 1) { trigger_error("Your plot must have at least 1 value", E_USER_ERROR); } } } registerClass('Plot', TRUE); class awPlotAxis { /** * Left axis * * @var Axis */ public $left; /** * Right axis * * @var Axis */ public $right; /** * Top axis * * @var Axis */ public $top; /** * Bottom axis * * @var Axis */ public $bottom; /** * Build the group of axis */ public function __construct() { $this->left = new awAxis; $this->left->auto(TRUE); $this->left->label->setAlign(awLabel::RIGHT); $this->left->label->move(-6, 0); $this->yAxis($this->left); $this->left->setTickStyle(awTick::OUT); $this->left->title->move(-25, 0); $this->right = new awAxis; $this->right->auto(TRUE); $this->right->label->setAlign(awLabel::LEFT); $this->right->label->move(6, 0); $this->yAxis($this->right); $this->right->setTickStyle(awTick::IN); $this->right->title->move(25, 0); $this->top = new awAxis; $this->top->label->setAlign(NULL, awLabel::TOP); $this->top->label->move(0, -3); $this->xAxis($this->top); $this->top->setTickStyle(awTick::OUT); $this->top->title->move(0, -25); $this->bottom = new awAxis; $this->bottom->label->setAlign(NULL, awLabel::BOTTOM); $this->bottom->label->move(0, 3); $this->xAxis($this->bottom); $this->bottom->setTickStyle(awTick::IN); $this->bottom->title->move(0, 25); } protected function xAxis(awAxis $axis) { $axis->addTick('major', new awTick(0, 5)); $axis->addTick('minor', new awTick(0, 3)); $axis->label->setFont(new awDejaVuSans(7)); } protected function yAxis(awAxis $axis) { $axis->addTick('major', new awTick(0, 5)); $axis->addTick('minor', new awTick(0, 3)); $axis->setNumberByTick('minor', 'major', 3); $axis->label->setFont(new awDejaVuSans(7)); $axis->title->setAngle(90); } } registerClass('PlotAxis'); /** * A graph with axis can contain some groups of components * * @package Artichow */ class awPlotGroup extends awComponentGroup { /** * Grid properties * * @var Grid */ public $grid; /** * Left, right, top and bottom axis * * @var PlotAxis */ public $axis; /** * Set the X axis on zero * * @var bool */ protected $xAxisZero = TRUE; /** * Set the Y axis on zero * * @var bool */ protected $yAxisZero = FALSE; /** * Real axis used for Y axis * * @var string */ private $yRealAxis = awPlot::LEFT; /** * Real axis used for X axis * * @var string */ private $xRealAxis = awPlot::BOTTOM; /** * Change min value for Y axis * * @var mixed */ private $yMin = NULL; /** * Change max value for Y axis * * @var mixed */ private $yMax = NULL; /** * Change min value for X axis * * @var mixed */ private $xMin = NULL; /** * Change max value for X axis * * @var mixed */ private $xMax = NULL; /** * Build the PlotGroup * */ public function __construct() { parent::__construct(); $this->grid = new awGrid; $this->grid->setBackgroundColor(new awWhite); $this->axis = new awPlotAxis; } /** * Set the X axis on zero or not * * @param bool $zero */ public function setXAxisZero($zero) { $this->xAxisZero = (bool)$zero; } /** * Set the Y axis on zero or not * * @param bool $zero */ public function setYAxisZero($zero) { $this->yAxisZero = (bool)$zero; } /** * Change min value for Y axis * Set NULL for auto selection. * * @param float $value */ public function setYMin($value) { $this->axis->left->auto(FALSE); $this->axis->right->auto(FALSE); $this->yMin = $value; } /** * Change max value for Y axis * Set NULL for auto selection. * * @param float $value */ public function setYMax($value) { $this->axis->left->auto(FALSE); $this->axis->right->auto(FALSE); $this->yMax = $value; } /** * Change min value for X axis * Set NULL for auto selection. * * @param float $value */ public function setXMin($value) { $this->xMin = $value; } /** * Change max value for X axis * Set NULL for auto selection. * * @param float $value */ public function setXMax($value) { $this->xMax = $value; } /** * Get min value for X axis * * @return float $value */ public function getXMin() { return $this->getX('min'); } /** * Get max value for X axis * * @return float $value */ public function getXMax() { return $this->getX('max'); } private function getX($type) { switch($type) { case 'max' : if($this->xMax !== NULL) { return $this->xMax; } break; case 'min' : if($this->xMin !== NULL) { return $this->xMin; } break; } $value = NULL; $get = 'getX'.ucfirst($type); for($i = 0; $i < count($this->components); $i++) { $component = $this->components[$i]; if($value === NULL) { $value = $component->$get(); } else { $value = $type($value, $component->$get()); } } return $value; } /** * Get min value with spaces for Y axis * * @param string $axis Axis name * @return float $value */ public function getRealYMin($axis = NULL) { if($axis === NULL) { return NULL; } $min = $this->getRealY('min', $axis); $max = $this->getRealY('max', $axis); if($this->space->bottom !== NULL) { $interval = ($min - $max) * $this->space->bottom / 100; return $min + $interval; } else { return $min; } } /** * Get max value with spaces for Y axis * * @param string $axis Axis name * @return float $value */ public function getRealYMax($axis = NULL) { if($axis === NULL) { return NULL; } $min = $this->getRealY('min', $axis); $max = $this->getRealY('max', $axis); if($this->space->top !== NULL) { $interval = ($max - $min) * $this->space->top / 100; return $max + $interval; } else { return $max; } } private function getRealY($type, $axis) { switch($type) { case 'max' : if($this->yMax !== NULL) { return $this->yMax; } break; case 'min' : if($this->yMin !== NULL) { return $this->yMin; } break; } $value = NULL; $get = 'getY'.ucfirst($type); for($i = 0; $i < count($this->components); $i++) { $component = $this->components[$i]; switch($axis) { case awPlot::LEFT : case awPlot::RIGHT : $test = ($component->getYAxis() === $axis); break; default : $test = FALSE; } if($test) { if($value === NULL) { $value = $component->$get(); } else { $value = $type($value, $component->$get()); } } } return $value; } public function init(awDrawer $drawer) { list($x1, $y1, $x2, $y2) = $this->getPosition(); // Get PlotGroup space list($leftSpace, $rightSpace, $topSpace, $bottomSpace) = $this->getSpace($x2 - $x1, $y2 - $y1); // Count values in the group $values = $this->getXAxisNumber(); // Init the PlotGroup $this->axis->top->line->setX($x1, $x2); $this->axis->bottom->line->setX($x1, $x2); $this->axis->left->line->setY($y2, $y1); $this->axis->right->line->setY($y2, $y1); $this->axis->top->setPadding($leftSpace, $rightSpace); $this->axis->bottom->setPadding($leftSpace, $rightSpace); $xMin = $this->getXMin(); $xMax = $this->getXMax(); $this->axis->top->setRange($xMin, $xMax); $this->axis->bottom->setRange($xMin, $xMax); for($i = 0; $i < count($this->components); $i++) { /* */ $component = $this->components[$i]; /* */ /* -- $component = &$this->components[$i]; -- */ $component->auto($this->auto); // Copy space to the component $component->setSpace($this->space->left, $this->space->right, $this->space->top, $this->space->bottom); $component->xAxis->setPadding($leftSpace, $rightSpace); $component->xAxis->line->setX($x1, $x2); $component->yAxis->line->setY($y2, $y1); } // Set Y axis range foreach(array('left', 'right') as $axis) { if($this->isAxisUsed($axis)) { $min = $this->getRealYMin($axis); $max = $this->getRealYMax($axis); $interval = $max - $min; $this->axis->{$axis}->setRange( $min - $interval * $this->space->bottom / 100, $max + $interval * $this->space->top / 100 ); // Auto-scaling mode $this->axis->{$axis}->autoScale(); } } if($this->axis->left->getLabelNumber() === NULL) { $number = round(($y2 - $y1) / 75) + 2; $this->axis->left->setLabelNumber($number); } if($this->axis->right->getLabelNumber() === NULL) { $number = round(($y2 - $y1) / 75) + 2; $this->axis->right->setLabelNumber($number); } // Center labels on X axis if needed $test = array(awPlot::TOP => FALSE, awPlot::BOTTOM => FALSE); for($i = 0; $i < count($this->components); $i++) { /* */ $component = $this->components[$i]; /* */ /* -- $component = &$this->components[$i]; -- */ if($component->getValues() !== NULL) { $axis = $component->getXAxis(); if($test[$axis] === FALSE) { // Center labels for bar plots if($component->getXCenter()) { $size = $this->axis->{$axis}->getDistance(0, 1); $this->axis->{$axis}->label->move($size / 2, 0); $this->axis->{$axis}->label->hideLast(TRUE); $test[$axis] = TRUE; } } } } // Set axis labels $labels = array(); for($i = $xMin; $i <= $xMax; $i++) { $labels[] = $i; } if($this->axis->top->label->count() === 0) { $this->axis->top->label->set($labels); } if($this->axis->bottom->label->count() === 0) { $this->axis->bottom->label->set($labels); } // Set ticks /* */ $this->axis->top->tick('major')->setNumber($values); $this->axis->bottom->tick('major')->setNumber($values); $this->axis->left->tick('major')->setNumber($this->axis->left->getLabelNumber()); $this->axis->right->tick('major')->setNumber($this->axis->right->getLabelNumber()); /* */ /* -- $this->axis->top->ticks['major']->setNumber($values); $this->axis->bottom->ticks['major']->setNumber($values); $this->axis->left->ticks['major']->setNumber($this->axis->left->getLabelNumber()); $this->axis->right->ticks['major']->setNumber($this->axis->right->getLabelNumber()); -- */ // Set X axis on zero if($this->xAxisZero) { $axis = $this->selectYAxis(); $this->axis->bottom->setYCenter($axis, 0); $this->axis->top->setYCenter($axis, 0); } // Set Y axis on zero if($this->yAxisZero) { $axis = $this->selectXAxis(); $this->axis->left->setXCenter($axis, 1); $this->axis->right->setXCenter($axis, 1); } parent::init($drawer); list($leftSpace, $rightSpace, $topSpace, $bottomSpace) = $this->getSpace($x2 - $x1, $y2 - $y1); // Create the grid $this->createGrid(); // Draw the grid $this->grid->setSpace($leftSpace, $rightSpace, 0, 0); $this->grid->draw($drawer, $x1, $y1, $x2, $y2); } public function drawComponent(awDrawer $drawer, $x1, $y1, $x2, $y2, $aliasing) { $xMin = $this->getXMin(); $xMax = $this->getXMax(); $maxLeft = $this->getRealYMax(awPlot::LEFT); $maxRight = $this->getRealYMax(awPlot::RIGHT); $minLeft = $this->getRealYMin(awPlot::LEFT); $minRight = $this->getRealYMin(awPlot::RIGHT); foreach($this->components as $component) { $min = $component->getYMin(); $max = $component->getYMax(); // Set component minimum and maximum if($component->getYAxis() === awPlot::LEFT) { list($min, $max) = $this->axis->left->getRange(); $component->setYMin($min); $component->setYMax($max); } else { list($min, $max) = $this->axis->right->getRange(); $component->setYMin($min); $component->setYMax($max); } $component->setXAxisZero($this->xAxisZero); $component->setYAxisZero($this->yAxisZero); $component->xAxis->setRange($xMin, $xMax); $component->drawComponent( $drawer, $x1, $y1, $x2, $y2, $aliasing ); $component->setYMin($min); $component->setYMax($max); } } public function drawEnvelope(awDrawer $drawer) { list($x1, $y1, $x2, $y2) = $this->getPosition(); // Hide unused axis foreach(array(awPlot::LEFT, awPlot::RIGHT, awPlot::TOP, awPlot::BOTTOM) as $axis) { if($this->isAxisUsed($axis) === FALSE) { $this->axis->{$axis}->hide(TRUE); } } // Draw top axis $top = $this->axis->top; if($this->xAxisZero === FALSE) { $top->line->setY($y1, $y1); } $top->draw($drawer); // Draw bottom axis $bottom = $this->axis->bottom; if($this->xAxisZero === FALSE) { $bottom->line->setY($y2, $y2); } $bottom->draw($drawer); // Draw left axis $left = $this->axis->left; if($this->yAxisZero === FALSE) { $left->line->setX($x1, $x1); } $left->draw($drawer); // Draw right axis $right = $this->axis->right; if($this->yAxisZero === FALSE) { $right->line->setX($x2, $x2); } $right->draw($drawer); } /** * Is the specified axis used ? * * @param string $axis Axis name * @return bool */ protected function isAxisUsed($axis) { for($i = 0; $i < count($this->components); $i++) { $component = $this->components[$i]; switch($axis) { case awPlot::LEFT : case awPlot::RIGHT : if($component->getYAxis() === $axis) { return TRUE; } break; case awPlot::TOP : case awPlot::BOTTOM : if($component->getXAxis() === $axis) { return TRUE; } break; } } return FALSE; } protected function createGrid() { $max = $this->getRealYMax(awPlot::LEFT); $min = $this->getRealYMin(awPlot::RIGHT); // Select axis (left if possible, right otherwise) $axis = $this->selectYAxis(); $number = $axis->getLabelNumber() - 1; if($number < 1) { return; } // Horizontal lines of grid $h = array(); for($i = 0; $i <= $number; $i++) { $h[] = $i / $number; } // Vertical lines $major = $axis->tick('major'); $interval = $major->getInterval(); $number = $this->getXAxisNumber() - 1; $w = array(); if($number > 0) { for($i = 0; $i <= $number; $i++) { if($i%$interval === 0) { $w[] = $i / $number; } } } $this->grid->setGrid($w, $h); } protected function selectYAxis(){ // Select axis (left if possible, right otherwise) if($this->isAxisUsed(awPlot::LEFT)) { $axis = $this->axis->left; } else { $axis = $this->axis->right; } return $axis; } protected function selectXAxis(){ // Select axis (bottom if possible, top otherwise) if($this->isAxisUsed(awPlot::BOTTOM)) { $axis = $this->axis->bottom; } else { $axis = $this->axis->top; } return $axis; } protected function getXAxisNumber() { $offset = $this->components[0]; $max = $offset->getXAxisNumber(); for($i = 1; $i < count($this->components); $i++) { $offset = $this->components[$i]; $max = max($max, $offset->getXAxisNumber()); } return $max; } } registerClass('PlotGroup'); ?>pgfouine-1.2/include/reporting/artichow/php5/Pie.class.php0000644000175000017500000003031510352052222022241 0ustar acmeacme */ define("PIE_DARK", 1); define("PIE_COLORED", 2); define("PIE_AQUA", 3); define("PIE_EARTH", 4); /* */ /** * Pie * * @package Artichow */ class awPie extends awComponent { /** * A dark theme for pies * * * @var int */ const DARK = 1; /** * A colored theme for pies * * @var int */ const COLORED = 2; /** * A water theme for pies * * @var int */ const AQUA = 3; /** * A earth theme for pies * * @var int */ const EARTH = 4; /** * Pie values * * @var array */ protected $values; /** * Pie colors * * @var array */ protected $colors; /** * Pie legend * * @var array */ protected $legendValues = array(); /** * Intensity of the 3D effect * * @var int */ protected $size; /** * Border color * * @var Color */ protected $border; /** * Pie explode * * @var array */ protected $explode = array(); /** * Initial angle * * @var int */ protected $angle = 0; /** * Labels precision * * @var int */ protected $precision; /** * Labels number * * @var int */ protected $number; /** * Labels minimum * * @var int */ protected $minimum; /** * Labels position * * @var int */ protected $position = 15; /** * Labels of your pie * * @var Label */ public $label; /** * Build the plot * * @param array $values Pie values */ public function __construct($values, $colors = awPie::COLORED) { $this->setValues($values); if(is_array($colors)) { $this->colors = $colors; } else { switch($colors) { case awPie::AQUA : $this->colors = array( new awColor(131, 220, 215), new awColor(131, 190, 215), new awColor(131, 160, 215), new awColor(160, 140, 215), new awColor(190, 131, 215), new awColor(220, 131, 215) ); break; case awPie::EARTH : $this->colors = array( new awColor(97, 179, 110), new awColor(130, 179, 97), new awColor(168, 179, 97), new awColor(179, 147, 97), new awColor(179, 108, 97), new awColor(99, 107, 189), new awColor(99, 165, 189) ); break; case awPie::DARK : $this->colors = array( new awColor(140, 100, 170), new awColor(130, 170, 100), new awColor(160, 160, 120), new awColor(150, 110, 140), new awColor(130, 150, 160), new awColor(90, 170, 140) ); break; default : $this->colors = array( new awColor(187, 213, 151), new awColor(223, 177, 151), new awColor(111, 186, 132), new awColor(197, 160, 230), new awColor(165, 169, 63), new awColor(218, 177, 89), new awColor(116, 205, 121), new awColor(200, 201, 78), new awColor(127, 205, 177), new awColor(205, 160, 160), new awColor(190, 190, 190) ); break; } } parent::__construct(); $this->label = new awLabel; $this->label->setCallbackFunction('callbackPerCent'); } /** * Change legend values * * @param array $legend An array of values for each part of the pie */ public function setLegend($legend) { $this->legendValues = (array)$legend; } /** * Set a border all around the pie * * @param awColor $color A color for the border */ public function setBorder(awColor $color) { $this->border = $color; } /** * Change 3D effect intensity * * @param int $size Effect size */ public function set3D($size) { $this->size = (int)$size; } /** * Change initial angle * * @param int $angle New angle in degrees */ public function setStartAngle($angle) { $this->angle = (int)$angle; } /** * Change label precision * * @param int $precision New precision */ public function setLabelPrecision($precision) { $this->precision = (int)$precision; } /** * Change label position * * @param int $position New position in pixels */ public function setLabelPosition($position) { $this->position = (int)$position; } /** * Change label number * * @param int $number New number */ public function setLabelNumber($number) { $this->number = is_null($number) ? $number : (int)$number; } /** * Change label minimum * * @param int $minimum New minimum */ public function setLabelMinimum($minimum) { $this->minimum = is_null($minimum) ? $minimum : (int)$minimum; } /** * Change Pie explode * * @param array $explode */ public function explode($explode) { $this->explode = (array)$explode; } public function drawEnvelope(awDrawer $drawer) { } public function drawComponent(awDrawer $drawer, $x1, $y1, $x2, $y2, $aliasing) { $count = count($this->values); $sum = array_sum($this->values); $width = $x2 - $x1; $height = $y2 - $y1; if($aliasing) { $x = $width / 2; $y = $height / 2; } else { $x = $width / 2 + $x1; $y = $height / 2 + $y1; } $position = $this->angle; $values = array(); $parts = array(); $angles = 0; if($aliasing) { $side = new awSide(0, 0, 0, 0); } foreach($this->values as $key => $value) { $angle = ($value / $sum * 360); if($key === $count - 1) { $angle = 360 - $angles; } $angles += $angle; if(array_key_exists($key, $this->explode)) { $middle = 360 - ($position + $angle / 2); $posX = $this->explode[$key] * cos($middle * M_PI / 180); $posY = $this->explode[$key] * sin($middle * M_PI / 180) * -1; if($aliasing) { $explode = new awPoint( $posX * 2, $posY * 2 ); $side->set( max($side->left, $posX * -2), max($side->right, $posX * 2), max($side->top, $posY * -2), max($side->bottom, $posY * 2) ); } else { $explode = new awPoint( $posX, $posY ); } } else { $explode = new awPoint(0, 0); } $values[$key] = array( $position, ($position + $angle), $explode ); $color = $this->colors[$key % count($this->colors)]; $parts[$key] = new awPiePart($color); // Add part to the legend $legend = array_key_exists($key, $this->legendValues) ? $this->legendValues[$key] : $key; $this->legend->add($parts[$key], $legend, awLegend::BACKGROUND); $position += $angle; } if($aliasing) { $mainDrawer = $drawer; $x *= 2; $y *= 2; $width *= 2; $height *= 2; $this->size *= 2; $image = new awImage; $image->border->hide(); $image->setSize( $width + $side->left + $side->right, $height + $side->top + $side->bottom + $this->size + 1 /* bugs.php.net ! */ ); $drawer = $image->getDrawer( $width / $image->width, $height / $image->height, ($width / 2 + $side->left) / $image->width, ($height / 2 + $side->top) / $image->height ); } // Draw 3D effect for($i = $this->size; $i > 0; $i--) { foreach($values as $key => $value) { $color = clone $this->colors[$key % count($this->colors)]; $color->brightness(-50); list($from, $to, $explode) = $value; $drawer->filledArc($color, $explode->move($x, $y + $i), $width, $height, $from, $to); $color->free(); unset($color); if($this->border instanceof awColor) { $point = $explode->move($x, $y); if($i === $this->size) { $drawer->arc($this->border, $point->move(0, $this->size), $width, $height, $from, $to); } } } } foreach($values as $key => $value) { $color = $this->colors[$key % count($this->colors)]; list($from, $to, $explode) = $value; $drawer->filledArc($color, $explode->move($x, $y), $width, $height, $from, $to); if($this->border instanceof awColor) { $point = $explode->move($x, $y); $drawer->arc($this->border, $point, $width, $height, $from, $to); } } if($aliasing) { $x = $x / 2 + $x1; $y = $y / 2 + $y1; $width /= 2; $height /= 2; $this->size /= 2; foreach($values as $key => $value) { $old = $values[$key][2]; $values[$key][2] = new awPoint( $old->x / 2, $old->y / 2 ); } $mainDrawer->copyResizeImage( $image, new awPoint($x1 - $side->left / 2, $y1 - $side->top / 2), new awPoint($x1 - $side->left / 2 + $image->width / 2, $y1 - $side->top / 2 + $image->height/ 2), new awPoint(0, 0), new awPoint($image->width, $image->height), TRUE ); $drawer = $mainDrawer; } // Get labels values $pc = array(); foreach($this->values as $key => $value) { $pc[$key] = round($value / $sum * 100, $this->precision); } if($this->label->count() === 0) { // Check that there is no user defined values $this->label->set($pc); } $position = 0; foreach($pc as $key => $value) { // Limit number of labels to display if($position === $this->number) { break; } if(is_null($this->minimum) === FALSE and $value < $this->minimum) { continue; } $position++; list($from, $to, $explode) = $values[$key]; $angle = $from + ($to - $from) / 2; $angleRad = (360 - $angle) * M_PI / 180; $point = new awPoint( $x + $explode->x + cos($angleRad) * ($width / 2 + $this->position), $y + $explode->y - sin($angleRad) * ($height / 2 + $this->position) ); $angle %= 360; // We don't display labels on the 3D effect if($angle > 0 and $angle < 180) { $point = $point->move(0, -1 * sin($angleRad) * $this->size); } if($angle >= 45 and $angle < 135) { $this->label->setAlign(awLabel::CENTER, awLabel::BOTTOM); } else if($angle >= 135 and $angle < 225) { $this->label->setAlign(awLabel::RIGHT, awLabel::MIDDLE); } else if($angle >= 225 and $angle < 315) { $this->label->setAlign(awLabel::CENTER, awLabel::TOP); } else { $this->label->setAlign(awLabel::LEFT, awLabel::MIDDLE); } $this->label->draw( $drawer, $point, $key ); } } /** * Return margins around the component * * @return array Left, right, top and bottom margins */ public function getMargin() { // Get axis informations $leftAxis = $this->padding->left; $rightAxis = $this->padding->right; $topAxis = $this->padding->top; $bottomAxis = $this->padding->bottom; return array($leftAxis, $rightAxis, $topAxis, $bottomAxis); } /** * Change values of Y axis * This method ignores not numeric values * * @param array $values */ public function setValues($values) { $this->checkArray($values); $this->values = $values; } /** * Return values of Y axis * * @return array */ public function getValues() { return $this->values; } private function checkArray(&$array) { if(is_array($array) === FALSE) { trigger_error("You tried to set values that are not an array"); } foreach($array as $key => $value) { if(is_numeric($value) === FALSE) { unset($array[$key]); } } if(count($array) < 1) { trigger_error("Your graph must have at least 1 value"); } } } registerClass('Pie'); /** * Pie * * @package Artichow */ class awPiePart implements awLegendable { /** * Pie part color * * @var Color */ protected $color; /** * Build a new awPiePart * * @param awColor $color Pie part color */ public function __construct(awColor $color) { $this->color = $color; } /** * Get the background color or gradient of an element of the component * * @return Color, Gradient */ public function getLegendBackground() { return $this->color; } /** * Get the line thickness * * @return NULL */ public function getLegendLineThickness() { } /** * Get the line type * * @return NULL */ public function getLegendLineStyle() { } /** * Get the color of line * * @return NULL */ public function getLegendLineColor() { } /** * Get a mark object * * @return NULL */ public function getLegendMark() { } } registerClass('PiePart'); function callbackPerCent($value) { return $value.'%'; } ?>pgfouine-1.2/include/reporting/artichow/php5/LinePlot.class.php0000644000175000017500000002420610352052222023254 0ustar acmeacme */ define("LINEPLOT_LINE", 0); define("LINEPLOT_MIDDLE", 1); /* */ /** * LinePlot * * @package Artichow */ class awLinePlot extends awPlot implements awLegendable { /** * Add marks to your line plot * * @var Mark */ public $mark; /** * Labels on your line plot * * @var Label */ public $label; /** * Filled areas * * @var bool */ protected $areas = array(); /** * Is the line hidden * * @var bool */ protected $lineHide = FALSE; /** * Line color * * @var Color */ protected $lineColor; /** * Line mode * * @var int */ protected $lineMode = awLinePlot::LINE; /** * Line type * * @var int */ protected $lineStyle = awLine::SOLID; /** * Line thickness * * @var int */ protected $lineThickness = 1; /** * Line background * * @var Color, Gradient */ protected $lineBackground; /** * Line mode * * @var int */ const LINE = 0; /** * Line in the middle * * @var int */ const MIDDLE = 1; /** * Construct a new awLinePlot * * @param array $values Some numeric values for Y axis * @param int $mode */ public function __construct($values, $mode = awLinePlot::LINE) { parent::__construct(); $this->mark = new awMark; $this->label = new awLabel; $this->lineMode = (int)$mode; $this->setValues($values); } /** * Hide line * * @param bool $hide */ public function hideLine($hide) { $this->lineHide = (bool)$hide; } /** * Add a filled area * * @param int $start Begining of the area * @param int $end End of the area * @param mixed $background Background color or gradient of the area */ public function setFilledArea($start, $stop, $background) { if($stop <= $start) { trigger_error("End position can not be greater than begin position in awLinePlot::setFilledArea()", E_USER_ERROR); } $this->areas[] = array((int)$start, (int)$stop, $background); } /** * Change line color * * @param awColor $color */ public function setColor(awColor $color) { $this->lineColor = $color; } /** * Change line style * * @param int $style */ public function setStyle($style) { $this->lineStyle = (int)$style; } /** * Change line tickness * * @param int $tickness */ public function setThickness($tickness) { $this->lineThickness = (int)$tickness; } /** * Change line background color * * @param awColor $color */ public function setFillColor(awColor $color) { $this->lineBackground = $color; } /** * Change line background gradient * * @param awGradient $gradient */ public function setFillGradient(awGradient $gradient) { $this->lineBackground = $gradient; } /** * Get the line thickness * * @return int */ public function getLegendLineThickness() { return $this->lineThickness; } /** * Get the line type * * @return int */ public function getLegendLineStyle() { return $this->lineStyle; } /** * Get the color of line * * @return Color */ public function getLegendLineColor() { return $this->lineColor; } /** * Get the background color or gradient of an element of the component * * @return Color, Gradient */ public function getLegendBackground() { return $this->lineBackground; } /** * Get a mark object * * @return Mark */ public function getLegendMark() { return $this->mark; } public function drawComponent(awDrawer $drawer, $x1, $y1, $x2, $y2, $aliasing) { $max = $this->getRealYMax(); $min = $this->getRealYMin(); // Get start and stop values list($start, $stop) = $this->getLimit(); if($this->lineMode === awLinePlot::MIDDLE) { $inc = $this->xAxis->getDistance(0, 1) / 2; } else { $inc = 0; } // Build the polygon $polygon = new awPolygon; for($key = $start; $key <= $stop; $key++) { $value = $this->datay[$key]; if($value !== NULL) { $p = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($key, $value)); $p = $p->move($inc, 0); $polygon->set($key, $p); } } // Draw backgrounds if($this->lineBackground instanceof awColor or $this->lineBackground instanceof awGradient) { $backgroundPolygon = new awPolygon; $p = $this->xAxisPoint($start); $p = $p->move($inc, 0); $backgroundPolygon->append($p); // Add others points foreach($polygon->all() as $point) { $backgroundPolygon->append(clone $point); } $p = $this->xAxisPoint($stop); $p = $p->move($inc, 0); $backgroundPolygon->append($p); // Draw polygon background $drawer->filledPolygon($this->lineBackground, $backgroundPolygon); } $this->drawArea($drawer, $polygon); // Draw line $prev = NULL; // Line color if($this->lineHide === FALSE) { if($this->lineColor === NULL) { $this->lineColor = new awColor(0, 0, 0); } foreach($polygon->all() as $point) { if($prev !== NULL) { $drawer->line( $this->lineColor, new awLine( $prev, $point, $this->lineStyle, $this->lineThickness ) ); } $prev = $point; } $this->lineColor->free(); } // Draw marks and labels foreach($polygon->all() as $key => $point) { $this->mark->draw($drawer, $point); $this->label->draw($drawer, $point, $key); } } protected function drawArea(awDrawer $drawer, awPolygon $polygon) { $starts = array(); foreach($this->areas as $area) { list($start) = $area; $starts[$start] = TRUE; } // Draw filled areas foreach($this->areas as $area) { list($start, $stop, $background) = $area; $polygonArea = new awPolygon; $p = $this->xAxisPoint($start); $polygonArea->append($p); for($i = $start; $i <= $stop; $i++) { $p = clone $polygon->get($i); if($i === $stop and array_key_exists($stop, $starts)) { $p = $p->move(-1, 0); } $polygonArea->append($p); } $p = $this->xAxisPoint($stop); if(array_key_exists($stop, $starts)) { $p = $p->move(-1, 0); } $polygonArea->append($p); // Draw area $drawer->filledPolygon($background, $polygonArea); } } public function getXAxisNumber() { if($this->lineMode === awLinePlot::MIDDLE) { return count($this->datay) + 1; } else { return count($this->datay); } } protected function xAxisPoint($position) { $y = $this->xAxisZero ? 0 : $this->getRealYMin(); return awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($position, $y)); } public function getXCenter() { return ($this->lineMode === awLinePlot::MIDDLE); } } registerClass('LinePlot'); /** * Simple LinePlot * Useful to draw simple horizontal lines * * @package Artichow */ class awSimpleLinePlot extends awPlot implements awLegendable { /** * Line color * * @var Color */ protected $lineColor; /** * Line start * * @var int */ protected $lineStart; /** * Line stop * * @var int */ protected $lineStop; /** * Line value * * @var flaot */ protected $lineValue; /** * Line mode * * @var int */ protected $lineMode = awLinePlot::LINE; /** * Line type * * @var int */ protected $lineStyle = awLine::SOLID; /** * Line thickness * * @var int */ protected $lineThickness = 1; /** * Line mode * * @var int */ const LINE = 0; /** * Line in the middle * * @var int */ const MIDDLE = 1; /** * Construct a new awLinePlot * * @param float $value A Y value * @param int $start Line start index * @param int $stop Line stop index * @param int $mode Line mode */ public function __construct($value, $start, $stop, $mode = awLinePlot::LINE) { parent::__construct(); $this->lineMode = (int)$mode; $this->lineStart = (int)$start; $this->lineStop = (int)$stop; $this->lineValue = (float)$value; $this->lineColor = new awColor(0, 0, 0); } /** * Change line color * * @param awColor $color */ public function setColor(awColor $color) { $this->lineColor = $color; } /** * Change line style * * @param int $style */ public function setStyle($style) { $this->lineStyle = (int)$style; } /** * Change line tickness * * @param int $tickness */ public function setThickness($tickness) { $this->lineThickness = (int)$tickness; } /** * Get the line thickness * * @return int */ public function getLegendLineThickness() { return $this->lineThickness; } /** * Get the line type * * @return int */ public function getLegendLineStyle() { return $this->lineStyle; } /** * Get the color of line * * @return Color */ public function getLegendLineColor() { return $this->lineColor; } public function getLegendBackground() { return NULL; } public function getLegendMark() { return NULL; } public function drawComponent(awDrawer $drawer, $x1, $y1, $x2, $y2, $aliasing) { if($this->lineMode === awLinePlot::MIDDLE) { $inc = $this->xAxis->getDistance(0, 1) / 2; } else { $inc = 0; } $p1 = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($this->lineStart, $this->lineValue)); $p2 = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($this->lineStop, $this->lineValue)); $drawer->line( $this->lineColor, new awLine( $p1->move($inc, 0), $p2->move($inc, 0), $this->lineStyle, $this->lineThickness ) ); $this->lineColor->free(); } public function getXAxisNumber() { if($this->lineMode === awLinePlot::MIDDLE) { return count($this->datay) + 1; } else { return count($this->datay); } } protected function xAxisPoint($position) { $y = $this->xAxisZero ? 0 : $this->getRealYMin(); return awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($position, $y)); } public function getXCenter() { return ($this->lineMode === awLinePlot::MIDDLE); } } registerClass('SimpleLinePlot'); ?> pgfouine-1.2/include/reporting/artichow/php5/Image.class.php0000644000175000017500000002001510352052222022542 0ustar acmeacme */ define("IMAGE_JPEG", 1); define("IMAGE_PNG", 2); define("IMAGE_GIF", 3); /* */ /* * Check for GD2 */ if(function_exists('imagecreatetruecolor') === FALSE) { trigger_error("You must compile PHP with GD2 support to use Artichow", E_USER_ERROR); } require_once ARTICHOW."/inc/Shadow.class.php"; require_once ARTICHOW."/inc/Border.class.php"; /** * An image for a graph * * @package Artichow */ class awImage { /** * Graph width * * @var int */ public $width; /** * Graph height * * @var int */ public $height; /** * Use anti-aliasing ? * * @var bool */ protected $antiAliasing = FALSE; /** * Image format * * @var int */ protected $format = awImage::PNG; /** * Image background color * * @var Color */ protected $background; /** * GD resource * * @var resource */ protected $resource; /** * Image drawer * * @var Drawer */ protected $drawer; /** * Shadow * * @var Shadow */ public $shadow; /** * Image border * * @var Border */ public $border; /** * Use JPEG for image * * @var int */ const JPEG = IMG_JPG; /** * Use PNG for image * * @var int */ const PNG = IMG_PNG; /** * Use GIF for image * * @var int */ const GIF = IMG_GIF; /** * Build the image */ public function __construct() { $this->background = new awColor(255, 255, 255); $this->shadow = new awShadow(awShadow::RIGHT_BOTTOM); $this->border = new awBorder; } /** * Get drawer of the image * * @param int $w Drawer width (from 0 to 1) (default to 1) * @param int $h Drawer height (from 0 to 1) (default to 1) * @param float $x Position on X axis of the center of the drawer (default to 0.5) * @param float $y Position on Y axis of the center of the drawer (default to 0.5) * @return Drawer */ public function getDrawer($w = 1, $h = 1, $x = 0.5, $y = 0.5) { $this->create(); $this->drawer->setSize($w, $h); $this->drawer->setPosition($x, $y); return $this->drawer; } /** * Change the image size * * @var int $width Image width * @var int $height Image height */ public function setSize($width, $height) { if($width !== NULL) { $this->width = (int)$width; } if($height !== NULL) { $this->height = (int)$height; } } /** * Change image background color * * @param awColor $color */ public function setBackgroundColor(awColor $color) { $this->background = $color; } /** * Change image background gradient * * @param awGradient $gradient */ public function setBackgroundGradient(awGradient $gradient) { $this->background = $gradient; } /** * Can we use anti-aliasing ? * * @var bool $bool */ public function setAntiAliasing($bool) { $this->antiAliasing = (bool)$bool; } /** * Change image format * * @var int $format New image format */ public function setFormat($format) { if($format === awImage::JPEG or $format === awImage::PNG or $format === awImage::GIF) { $this->format = $format; } } /** * Create a new awimage */ public function create() { if($this->resource === NULL) { // Create image $this->resource = imagecreatetruecolor($this->width, $this->height); if(!$this->resource) { trigger_error("Unable to create a graph", E_USER_ERROR); } imagealphablending($this->resource, TRUE); if($this->antiAliasing and function_exists('imageantialias')) { imageantialias($this->resource, TRUE); } $this->drawer = new awDrawer($this->resource); $this->drawer->setImageSize($this->width, $this->height); // Original color $this->drawer->filledRectangle( new awWhite, new awLine( new awPoint(0, 0), new awPoint($this->width, $this->height) ) ); $shadow = $this->shadow->getSpace(); $p1 = new awPoint($shadow->left, $shadow->top); $p2 = new awPoint($this->width - $shadow->right - 1, $this->height - $shadow->bottom - 1); // Draw image background $this->drawer->filledRectangle($this->background, new awLine($p1, $p2)); $this->background->free(); // Draw image border $this->border->rectangle($this->drawer, $p1, $p2); } } /** * Draw a component on the image * * @var awComponent $component A component */ public function drawComponent(awComponent $component) { $shadow = $this->shadow->getSpace(); // Image shadow $border = $this->border->visible() ? 1 : 0; // Image border size $drawer = clone $this->drawer; $drawer->setImageSize( $this->width - $shadow->left - $shadow->right - $border * 2, $this->height - $shadow->top - $shadow->bottom - $border * 2 ); // No absolute size specified if($component->w === NULL and $component->h === NULL) { list($width, $height) = $drawer->setSize($component->width, $component->height); // Set component size in pixels $component->setAbsSize($width, $height); } else { $drawer->setAbsSize($component->w, $component->h); } if($component->top !== NULL and $component->left !== NULL) { $drawer->setAbsPosition( $border + $shadow->left + $component->left, $border + $shadow->top + $component->top ); } else { $drawer->setPosition($component->x, $component->y); } $drawer->movePosition($border + $shadow->left, $border + $shadow->top); list($x1, $y1, $x2, $y2) = $component->getPosition(); $component->init($drawer); $component->drawComponent($drawer, $x1, $y1, $x2, $y2, $this->antiAliasing); $component->drawEnvelope($drawer, $x1, $y1, $x2, $y2); $component->finalize($drawer); } protected function drawShadow() { $drawer = $this->getDrawer(); $this->shadow->draw( $drawer, new awPoint(0, 0), new awPoint($this->width, $this->height), awShadow::IN ); } /** * Send the image into a file or to the user browser * * @var string $file Save image into a file if you provide a file name */ public function send($file = NULL) { // Test if format is available if((imagetypes() & $this->format) === FALSE) { trigger_error("Format '".$this->format."' is not available on your system. Check that your PHP has been compiled with the good libraries."); } // Get some infos about this image switch($this->format) { case awImage::JPEG : $function = 'imagejpeg'; break; case awImage::PNG : $function = 'imagepng'; break; case awImage::GIF : $function = 'imagegif'; break; } // Create image if($file !== NULL) { $function($this->resource, $file); } else { // Test some text has been printed $data = ob_get_contents(); if($data !== '') { exit; } // Send headers to the browser header("Content-type: image/".$this->getFormat()); $function($this->resource); } } protected function getFormat() { switch($this->format) { case awImage::JPEG : return 'jpeg'; case awImage::PNG : return 'png'; case awImage::GIF : return 'gif'; } } } registerClass('Image'); /** * Load an image from a file * * @package Artichow */ class awFileImage extends awImage { /** * Build a new awimage * * @param string $file Image file name */ public function __construct($file) { $image = @getimagesize($file); if($image and in_array($image[2], array(2, 3))) { $this->setSize($image[0], $image[1]); switch($image[2]) { case 2 : $this->resource = imagecreatefromjpeg($file); break; case 3 : $this->resource = imagecreatefrompng($file); break; } $this->drawer = new awDrawer($this->resource); $this->drawer->setImageSize($this->width, $this->height); } else { trigger_error("Artichow does not support this image (must be in PNG or JPEG)", E_USER_ERROR); } } } registerClass('FileImage'); ?> pgfouine-1.2/include/reporting/artichow/php5/MathPlot.class.php0000644000175000017500000002063211012376766023275 0ustar acmeacmef = (string)$f; $this->fromX = is_null($fromX) ? NULL : (float)$fromX; $this->toX = is_null($toX) ? NULL : (float)$toX; $this->line = new awLine; $this->mark = new awMark; $this->color = new awBlack; } /** * Change line color * * @param awColor $color A new awcolor */ public function setColor(awColor $color) { $this->color = $color; } /** * Get line color * * @return Color */ public function getColor() { return $this->color; } /** * Get the background color or gradient of an element of the component * * @return Color, Gradient */ public function getLegendBackground() { } /** * Get the line thickness * * @return NULL */ public function getLegendLineThickness() { return $this->line->getThickness(); } /** * Get the line type * * @return NULL */ public function getLegendLineStyle() { return $this->line->getStyle(); } /** * Get the color of line * * @return NULL */ public function getLegendLineColor() { return $this->color; } /** * Get a mark object * * @return NULL */ public function getLegendMark() { return $this->mark; } } registerClass('MathFunction'); /** * For mathematics functions * * @package Artichow */ class awMathPlot extends awComponent { /** * Functions * * @var array */ protected $functions = array(); /** * Grid properties * * @var Grid */ public $grid; /** * X axis * * @var Axis */ public $xAxis; /** * Y axis * * @var Axis */ public $yAxis; /** * Extremum * * @var Side */ private $extremum = NULL; /** * Interval * * @var float */ private $interval = 1; /** * Build the plot * * @param int $xMin Minimum X value * @param int $xMax Maximum X value * @param int $yMax Maximum Y value * @param int $yMin Minimum Y value */ public function __construct($xMin, $xMax, $yMax, $yMin) { parent::__construct(); $this->setPadding(8, 8, 8, 8); $this->grid = new awGrid; // Hide grid by default $this->grid->hide(TRUE); // Set extremum $this->extremum = new awSide($xMin, $xMax, $yMax, $yMin); // Create axis $this->xAxis = new awAxis; $this->xAxis->setTickStyle(awTick::IN); $this->xAxis->label->hideValue(0); $this->initAxis($this->xAxis); $this->yAxis = new awAxis; $this->yAxis->setTickStyle(awTick::IN); $this->yAxis->label->hideValue(0); $this->initAxis($this->yAxis); } protected function initAxis(awAxis $axis) { $axis->setLabelPrecision(1); $axis->addTick('major', new awTick(0, 5)); $axis->addTick('minor', new awTick(0, 3)); $axis->addTick('micro', new awTick(0, 1)); $axis->setNumberByTick('minor', 'major', 1); $axis->setNumberByTick('micro', 'minor', 4); $axis->label->setFont(new awDejaVuSans(7)); } /** * Interval to calculate values * * @param float $interval */ public function setInterval($interval) { $this->interval = (float)$interval; } /** * Add a formula f(x) * * @param awMathFunction $function * @param string $name Name for the legend (can be NULL if you don't want to set a legend) * @param int $type Type for the legend */ public function add(awMathFunction $function, $name = NULL, $type = awLegend::LINE) { $this->functions[] = $function; if($name !== NULL) { $this->legend->add($function, $name, $type); } } public function init(awDrawer $drawer) { list($x1, $y1, $x2, $y2) = $this->getPosition(); $this->xAxis->line->setX($x1, $x2); $this->xAxis->label->setAlign(NULL, awLabel::BOTTOM); $this->xAxis->label->move(0, 3); $this->xAxis->setRange($this->extremum->left, $this->extremum->right); $this->yAxis->line->setY($y2, $y1); $this->yAxis->label->setAlign(awLabel::RIGHT); $this->yAxis->label->move(-6, 0); $this->yAxis->reverseTickStyle(); $this->yAxis->setRange($this->extremum->bottom, $this->extremum->top); $this->xAxis->setYCenter($this->yAxis, 0); $this->yAxis->setXCenter($this->xAxis, 0); if($this->yAxis->getLabelNumber() === NULL) { $number = $this->extremum->top - $this->extremum->bottom + 1; $this->yAxis->setLabelNumber($number); } if($this->xAxis->getLabelNumber() === NULL) { $number = $this->extremum->right - $this->extremum->left + 1; $this->xAxis->setLabelNumber($number); } // Set ticks /* */ $this->xAxis->tick('major')->setNumber($this->xAxis->getLabelNumber()); $this->yAxis->tick('major')->setNumber($this->yAxis->getLabelNumber()); /* */ /* -- $this->xAxis->ticks['major']->setNumber($this->xAxis->getLabelNumber()); $this->yAxis->ticks['major']->setNumber($this->yAxis->getLabelNumber()); -- */ // Set axis labels $labels = array(); for($i = 0, $count = $this->xAxis->getLabelNumber(); $i < $count; $i++) { $labels[] = $i; } $this->xAxis->label->set($labels); $labels = array(); for($i = 0, $count = $this->yAxis->getLabelNumber(); $i < $count; $i++) { $labels[] = $i; } $this->yAxis->label->set($labels); parent::init($drawer); // Create the grid $this->createGrid(); // Draw the grid $this->grid->draw($drawer, $x1, $y1, $x2, $y2); } public function drawEnvelope(awDrawer $drawer) { // Draw axis $this->xAxis->draw($drawer); $this->yAxis->draw($drawer); } public function drawComponent(awDrawer $drawer, $x1, $y1, $x2, $y2, $aliasing) { foreach($this->functions as $function) { $f = $function->f; $fromX = is_null($function->fromX) ? $this->extremum->left : $function->fromX; $toX = is_null($function->toX) ? $this->extremum->right : $function->toX; $old = NULL; for($i = $fromX; $i <= $toX; $i += $this->interval) { $p = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($i, $f($i))); if($p->y >= $y1 and $p->y <= $y2) { $function->mark->draw($drawer, $p); } if($old !== NULL) { $line = $function->line; $line->setLocation($old, $p); if( ($line->p1->y >= $y1 and $line->p1->y <= $y2) or ($line->p2->y >= $y1 and $line->p2->y <= $y2) ) { $drawer->line( $function->getColor(), $line ); } } $old = $p; } // Draw last point if needed if($old !== NULL and $i - $this->interval != $toX) { $p = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($toX, $f($toX))); if($p->y >= $y1 and $p->y <= $y2) { $function->mark->draw($drawer, $p); } $line = $function->line; $line->setLocation($old, $p); if( ($line->p1->y >= $y1 and $line->p1->y <= $y2) or ($line->p2->y >= $y1 and $line->p2->y <= $y2) ) { $drawer->line( $function->getColor(), $line ); } } } } protected function createGrid() { // Horizontal lines of the grid $major = $this->yAxis->tick('major'); $interval = $major->getInterval(); $number = $this->yAxis->getLabelNumber() - 1; $h = array(); if($number > 0) { for($i = 0; $i <= $number; $i++) { $h[] = $i / $number; } } // Vertical lines $major = $this->xAxis->tick('major'); $interval = $major->getInterval(); $number = $this->xAxis->getLabelNumber() - 1; $w = array(); if($number > 0) { for($i = 0; $i <= $number; $i++) { if($i%$interval === 0) { $w[] = $i / $number; } } } $this->grid->setGrid($w, $h); } } registerClass('MathPlot'); ?>pgfouine-1.2/include/reporting/artichow/php5/Pattern.class.php0000644000175000017500000000353410352052222023144 0ustar acmeacmeargs[$name] = $value; } } /** * Get an argument * * @param string $name * @param mixed $default Default value if the argument does not exist (default to NULL) * @return mixed Argument value */ protected function getArg($name, $default = NULL) { if(array_key_exists($name, $this->args)) { return $this->args[$name]; } else { return $default; } } /** * Change several arguments * * @param array $args New arguments */ public function setArgs($args) { if(is_array($args)) { foreach($args as $name => $value) { $this->setArg($name, $value); } } } } registerClass('Pattern', TRUE); ?>pgfouine-1.2/include/reporting/artichow/php5/BarPlot.class.php0000644000175000017500000001521410352052222023070 0ustar acmeacmelabel = new awLabel; $this->barPadding = new awSide(0.08, 0.08, 0, 0); $this->barShadow = new awShadow(awShadow::RIGHT_TOP); $this->barBorder = new awBorder; $this->setValues($values); $this->identifier = (int)$identifier; $this->number = (int)$number; $this->depth = (int)$depth; $this->move = new awSide; // Hide vertical grid $this->grid->hideVertical(TRUE); } /** * Change bars padding * This method is not compatible with awBarPlot::setBarPadding() * * @param float $left Left padding (between 0 and 1) * @param float $right Right padding (between 0 and 1) */ public function setBarPadding($left = NULL, $right = NULL) { $this->barPadding->set($left, $right); } /** * Change bars size * This method is not compatible with awBarPlot::setBarPadding() * * @param int $width Bars size (between 0 and 1) */ public function setBarSize($size) { $padding = (1 - $size) / 2; $this->barPadding->set($padding, $padding); } /** * Move bars * * @param int $x * @param int $y */ public function move($x, $y) { $this->move->set($x, NULL, $y, NULL); } /** * Change bars space * * @param int $space Space in pixels */ public function setBarSpace($space) { $this->barSpace = (int)$space; } /** * Change line background color * * @param awColor $color */ public function setBarColor(awColor $color) { $this->barBackground = $color; } /** * Change line background gradient * * @param awGradient $gradient */ public function setBarGradient(awGradient $gradient) { $this->barBackground = $gradient; } /** * Get the line thickness * * @return int */ public function getLegendLineThickness() { } /** * Get the line type * * @return int */ public function getLegendLineStyle() { } /** * Get the color of line * * @return Color */ public function getLegendLineColor() { } /** * Get the background color or gradient of an element of the component * * @return Color, Gradient */ public function getLegendBackground() { return $this->barBackground; } /** * Get a mark object * * @return Mark */ public function getLegendMark() { } public function drawComponent(awDrawer $drawer, $x1, $y1, $x2, $y2, $aliasing) { $count = count($this->datay); $max = $this->getRealYMax(NULL); $min = $this->getRealYMin(NULL); // Find zero for bars if($this->xAxisZero and $min <= 0 and $max >= 0) { $zero = 0; } else if($max < 0) { $zero = $max; } else { $zero = $min; } // Get base position $zero = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint(0, $zero)); // Distance between two values on the graph $distance = $this->xAxis->getDistance(0, 1); // Compute paddings $leftPadding = $this->barPadding->left * $distance; $rightPadding = $this->barPadding->right * $distance; $padding = $leftPadding + $rightPadding; $space = $this->barSpace * ($this->number - 1); $barSize = ($distance - $padding - $space) / $this->number; $barPosition = $leftPadding + $barSize * ($this->identifier - 1); for($key = 0; $key < $count; $key++) { $value = $this->datay[$key]; if($value !== NULL) { $position = awAxis::toPosition( $this->xAxis, $this->yAxis, new awPoint($key, $value) ); $barStart = $barPosition + ($this->identifier - 1) * $this->barSpace + $position->x; $barStop = $barStart + $barSize; $t1 = min($zero->y, $position->y); $t2 = max($zero->y, $position->y); if(round($t2 - $t1) == 0) { continue; } $p1 = new awPoint( round($barStart) + $this->depth + $this->move->left, round($t1) - $this->depth + $this->move->top ); $p2 = new awPoint( round($barStop) + $this->depth + $this->move->left, round($t2) - $this->depth + $this->move->top ); $this->drawBar($drawer, $p1, $p2); } } // Draw labels foreach($this->datay as $key => $value) { if($value !== NULL) { $position = awAxis::toPosition( $this->xAxis, $this->yAxis, new awPoint($key, $value) ); $point = new awPoint( $barPosition + ($this->identifier - 1) * $this->barSpace + $position->x + $barSize / 2 + 1 + $this->depth, $position->y - $this->depth ); $this->label->draw($drawer, $point, $key); } } } public function getXAxisNumber() { return count($this->datay) + 1; } // ça bidouille à fond ici ! public function getXMax() { return array_max($this->datax) + 1; } public function getXCenter() { return TRUE; } protected function drawBar(awDrawer $drawer, awPoint $p1, awPoint $p2) { // Draw shadow $this->barShadow->draw( $drawer, $p1, $p2, awShadow::OUT ); if(abs($p2->y - $p1->y) > 1) { $this->barBorder->rectangle( $drawer, $p1, $p2 ); if($this->barBackground !== NULL) { $size = $this->barBorder->visible() ? 1 : 0; $b1 = $p1->move($size, $size); $b2 = $p2->move(-1 * $size, -1 * $size); // Draw background $drawer->filledRectangle( $this->barBackground, new awLine($b1, $b2) ); } } } } registerClass('BarPlot'); ?> pgfouine-1.2/include/reporting/artichow/php5/inc/0000755000175000017500000000000011516212335020464 5ustar acmeacmepgfouine-1.2/include/reporting/artichow/php5/inc/Mark.class.php0000644000175000017500000001247710352052224023202 0ustar acmeacme */ define("MARK_CIRCLE", 1); define("MARK_SQUARE", 2); define("MARK_IMAGE", 3); define("MARK_STAR", 4); define("MARK_PAPERCLIP", 5); define("MARK_BOOK", 6); /* */ /** * Draw marks * * @package Artichow */ class awMark { /** * Circle mark * * @var int */ const CIRCLE = 1; /** * Quare mark * * @var int */ const SQUARE = 2; /** * Image mark * * @var int */ const IMAGE = 3; /** * Star mark * * @var int */ const STAR = 4; /** * Paperclip mark * * @var int */ const PAPERCLIP = 5; /** * Book mark * * @var int */ const BOOK = 6; /** * Must marks be hidden ? * * @var bool */ protected $hide; /** * Mark type * * @var int */ protected $type; /** * Mark size * * @var int */ protected $size = 8; /** * Fill mark * * @var Color, Gradient */ protected $fill; /** * Mark image * * @var Image */ protected $image; /** * To draw marks * * @var Drawer */ protected $drawer; /** * Move position from this vector * * @var Point */ protected $move; /** * Marks border * * @var Border */ public $border; /** * Build the mark */ public function __construct() { $this->fill = new awColor(255, 0, 0, 0); $this->border = new awBorder; $this->border->hide(); $this->move = new awPoint(0, 0); } /** * Change mark position * * @param int $x Add this interval to X coord * @param int $y Add this interval to Y coord */ public function move($x, $y) { $this->move = $this->move->move($x, $y); } /** * Hide marks ? * * @param bool $hide TRUE to hide marks, FALSE otherwise */ public function hide($hide = TRUE) { $this->hide = (bool)$hide; } /** * Show marks ? * * @param bool $show */ public function show($show = TRUE) { $this->hide = (bool)!$show; } /** * Change mark type * * @param int $size Size in pixels */ public function setSize($size) { $this->size = (int)$size; } /** * Change mark type * * @param int $type New mark type * @param int $size Mark size (can be NULL) */ public function setType($type, $size = NULL) { $this->type = (int)$type; if($size !== NULL) { $this->setSize($size); } } /** * Fill the mark with a color or a gradient * * @param mixed $fill A color or a gradient */ public function setFill($fill) { if($fill instanceof awColor or $fill instanceof awGradient) { $this->fill = $fill; } } /** * Set an image * Only for awMark::IMAGE type. * * @param Image An image */ public function setImage(awImage $image) { $this->image = $image; } /** * Draw the mark * * @param awDrawer $drawer * @param awPoint $point Mark center */ public function draw(awDrawer $drawer, awPoint $point) { // Hide marks ? if($this->hide) { return; } // Check if we can print marks if($this->type !== NULL) { $this->drawer = $drawer; $realPoint = $this->move->move($point->x, $point->y); switch($this->type) { case awMark::CIRCLE : $this->drawCircle($realPoint); break; case awMark::SQUARE : $this->drawSquare($realPoint); break; case awMark::IMAGE : $this->drawImage($realPoint); break; case awMark::STAR : $this->changeType('star'); $this->draw($drawer, $point); break; case awMark::PAPERCLIP : $this->changeType('paperclip'); $this->draw($drawer, $point); break; case awMark::BOOK : $this->changeType('book'); $this->draw($drawer, $point); break; } } } protected function changeType($image) { $this->setType(awMARK::IMAGE); $this->setImage(new awFileImage(ARTICHOW_IMAGE.DIRECTORY_SEPARATOR.$image.'.png')); } protected function drawCircle(awPoint $point) { $this->drawer->filledEllipse( $this->fill, $point, $this->size, $this->size ); $this->border->ellipse( $this->drawer, $point, $this->size, $this->size ); } protected function drawSquare(awPoint $point) { list($x, $y) = $point->getLocation(); $x1 = (int)($x - $this->size / 2); $x2 = $x1 + $this->size; $y1 = (int)($y - $this->size / 2); $y2 = $y1 + $this->size; $this->border->rectangle($this->drawer, new awPoint($x1, $y1), new awPoint($x2, $y2)); $size = $this->border->visible() ? 1 : 0; $this->drawer->filledRectangle( $this->fill, new awLine( new awPoint($x1 + $size, $y1 + $size), new awPoint($x2 - $size, $y2 - $size) ) ); } protected function drawImage(awPoint $point) { if($this->image instanceof awImage) { $width = $this->image->width; $height = $this->image->height; list($x, $y) = $point->getLocation(); $x1 = (int)($x - $width / 2); $x2 = $x1 + $width; $y1 = (int)($y - $width / 2); $y2 = $y1 + $height; $this->border->rectangle($this->drawer, new awPoint($x1 - 1, $y1 - 1), new awPoint($x2 + 1, $y2 + 1)); $this->drawer->copyImage($this->image, new awPoint($x1, $y1), new awPoint($x2, $y2)); } } } registerClass('Mark'); ?>pgfouine-1.2/include/reporting/artichow/php5/inc/Label.class.php0000644000175000017500000002415510433377174023341 0ustar acmeacme */ define("LABEL_LEFT", 1); define("LABEL_RIGHT", 2); define("LABEL_CENTER", 3); define("LABEL_TOP", 4); define("LABEL_BOTTOM", 5); define("LABEL_MIDDLE", 6); /* */ /** * Draw labels * * @package Artichow */ class awLabel implements awPositionable { /** * Label border * * @var int */ public $border; /** * Label texts * * @var array */ protected $texts; /** * Text font * * @var int */ protected $font; /** * Text angle * * @var int */ protected $angle = 0; /** * Text color * * @var Color */ protected $color; /** * Text background * * @var Color, Gradient */ private $background; /** * Callback function * * @var string */ private $function; /** * Callback function to format output * * @var string */ private $formatFunction; /** * Padding * * @var int */ private $padding; /** * Move position from this vector * * @var Point */ protected $move; /** * Label interval * * @var int */ protected $interval = 1; /** * Horizontal align * * @var int */ protected $hAlign = awLabel::CENTER; /** * Vertical align * * @var int */ protected $vAlign = awLabel::MIDDLE; /** * Hide all labels ? * * @var bool */ protected $hide = FALSE; /** * Keys to hide * * @var array */ protected $hideKey = array(); /** * Values to hide * * @var array */ protected $hideValue = array(); /** * Hide first label * * @var bool */ protected $hideFirst = FALSE; /** * Hide last label * * @var bool */ protected $hideLast = FALSE; /** * Build the label * * @param string $label First label */ public function __construct($label = NULL, $font = NULL, $color = NULL, $angle = 0) { if(is_array($label)) { $this->set($label); } else if(is_string($label)) { $this->set(array($label)); } if($font === NULL) { $font = new awFont2; } $this->setFont($font); $this->setAngle($angle); if($color instanceof awColor) { $this->setColor($color); } else { $this->setColor(new awColor(0, 0, 0)); } $this->move = new awPoint(0, 0); $this->border = new awBorder; $this->border->hide(); } /** * Get an element of the label from its key * * @param int $key Element key * @return string A value */ public function get($key) { return array_key_exists($key, $this->texts) ? $this->texts[$key] : NULL; } /** * Get all labels * * @return array */ public function all() { return $this->texts; } /** * Set one or several labels * * @param array $labels Array of string or a string */ public function set($labels) { if(is_string($labels)) { $this->texts = array($labels); } else if(is_array($labels)) { $this->texts = $labels; } } /** * Count number of texts in the label * * @return int */ public function count() { return is_array($this->texts) ? count($this->texts) : 0; } /** * Set a callback function for labels * * @param string $function */ public function setCallbackFunction($function) { $this->function = is_null($function) ? $function : (string)$function; } /** * Return the callback function for labels * * @return string */ public function getCallbackFunction() { return $this->function; } /** * Set a callback function to format the labels * * @param string $function */ public function setCallbackFormatFunction($function) { $this->formatFunction =& $function; } /** * Change labels format * * @param string $format New format (printf style: %.2f for example) */ public function setFormat($format) { $function = 'label'.time().'_'.(microtime() * 1000000); eval('function '.$function.'($value) { return sprintf("'.addcslashes($format, '"').'", $value); }'); $this->setCallbackFunction($function); } /** * Change font for label * * @param awFont $font New font * @param awColor $color Font color (can be NULL) */ public function setFont(awFont $font, $color = NULL) { $this->font = $font; if($color instanceof awColor) { $this->setColor($color); } } /** * Change font angle * * @param int $angle New angle */ public function setAngle($angle) { $this->angle = (int)$angle; } /** * Change font color * * @param awColor $color */ public function setColor($color) { $this->color = $color; } /** * Change text background * * @param mixed $background */ public function setBackground($background) { $this->background = $background; } /** * Change text background color * * @param Color */ public function setBackgroundColor(awColor $color) { $this->background = $color; } /** * Change text background gradient * * @param Gradient */ public function setBackgroundGradient(awGradient $gradient) { $this->background = $gradient; } /** * Change padding * * @param int $left Left padding * @param int $right Right padding * @param int $top Top padding * @param int $bottom Bottom padding */ public function setPadding($left, $right, $top, $bottom) { $this->padding = array((int)$left, (int)$right, (int)$top, (int)$bottom); } /** * Hide all labels ? * * @param bool $hide */ public function hide($hide = TRUE) { $this->hide = (bool)$hide; } /** * Show all labels ? * * @param bool $show */ public function show($show = TRUE) { $this->hide = (bool)!$show; } /** * Hide a key * * @param int $key The key to hide */ public function hideKey($key) { $this->hideKey[$key] = TRUE; } /** * Hide a value * * @param int $value The value to hide */ public function hideValue($value) { $this->hideValue[] = $value; } /** * Hide first label * * @param bool $hide */ public function hideFirst($hide) { $this->hideFirst = (bool)$hide; } /** * Hide last label * * @param bool $hide */ public function hideLast($hide) { $this->hideLast = (bool)$hide; } /** * Set label interval * * @param int */ public function setInterval($interval) { $this->interval = (int)$interval; } /** * Change label position * * @param int $x Add this interval to X coord * @param int $y Add this interval to Y coord */ public function move($x, $y) { $this->move = $this->move->move($x, $y); } /** * Change alignment * * @param int $h Horizontal alignment * @param int $v Vertical alignment */ public function setAlign($h = NULL, $v = NULL) { if($h !== NULL) { $this->hAlign = (int)$h; } if($v !== NULL) { $this->vAlign = (int)$v; } } /** * Get a text from the labele * * @param mixed $key Key in the array text * @return Text */ public function getText($key) { if(is_array($this->texts) and array_key_exists($key, $this->texts)) { $value = $this->texts[$key]; if(is_string($this->function)) { $value = call_user_func($this->function, $value); } if(!is_null($this->formatFunction)) { $value = call_user_func($this->formatFunction, $value); } $text = new awText($value); $text->setFont($this->font); $text->setAngle($this->angle); $text->setColor($this->color); if($this->background instanceof awColor) { $text->setBackgroundColor($this->background); } else if($this->background instanceof awGradient) { $text->setBackgroundGradient($this->background); } $text->border = $this->border; if($this->padding !== NULL) { call_user_func_array(array(&$text, 'setPadding'), $this->padding); } return $text; } else { return NULL; } } /** * Get max width of all texts * * @param awDrawer $drawer A drawer * @return int */ public function getMaxWidth(awDrawer $drawer) { return $this->getMax($drawer, 'getTextWidth'); } /** * Get max height of all texts * * @param awDrawer $drawer A drawer * @return int */ public function getMaxHeight(awDrawer $drawer) { return $this->getMax($drawer, 'getTextHeight'); } /** * Draw the label * * @param awDrawer $drawer * @param awPoint $p Label center * @param int $key Text position in the array of texts (default to zero) */ public function draw(awDrawer $drawer, awPoint $p, $key = 0) { if(($key % $this->interval) !== 0) { return; } // Hide all labels if($this->hide) { return; } // Key is hidden if(array_key_exists($key, $this->hideKey)) { return; } // Hide first label if($key === 0 and $this->hideFirst) { return; } // Hide last label if($key === count($this->texts) - 1 and $this->hideLast) { return; } $text = $this->getText($key); if($text !== NULL) { // Value must be hidden if(in_array($text->getText(), $this->hideValue)) { return; } $x = $p->x; $y = $p->y; // Get padding list($left, $right, $top, $bottom) = $text->getPadding(); $font = $text->getFont(); $width = $font->getTextWidth($text); $height = $font->getTextHeight($text); switch($this->hAlign) { case awLabel::RIGHT : $x -= ($width + $right); break; case awLabel::CENTER : $x -= ($width - $left + $right) / 2; break; case awLabel::LEFT : $x += $left; break; } switch($this->vAlign) { case awLabel::TOP : $y -= ($height + $bottom); break; case awLabel::MIDDLE : $y -= ($height - $top + $bottom) / 2; break; case awLabel::BOTTOM : $y += $top; break; } $drawer->string($text, $this->move->move($x, $y)); } } protected function getMax(awDrawer $drawer, $function) { $max = NULL; foreach($this->texts as $key => $text) { $text = $this->getText($key); $font = $text->getFont(); if(is_null($max)) { $max = $font->{$function}($text); } else { $max = max($max, $font->{$function}($text)); } } return $max; } } registerClass('Label'); ?>pgfouine-1.2/include/reporting/artichow/php5/inc/Text.class.php0000644000175000017500000000617610352052224023233 0ustar acmeacmesetText($text); $this->setFont($font); // Set default color to black if($color === NULL) { $color = new awColor(0, 0, 0); } $this->setColor($color); $this->setAngle($angle); $this->border = new awBorder; $this->border->hide(); } /** * Get text * * @return string */ public function getText() { return $this->text; } /** * Change text * * @param string $text New text */ public function setText($text) { $this->text = (string)$text; } /** * Change text font * * @param Font */ public function setFont(awFont $font) { $this->font = $font; } /** * Get text font * * @return int */ public function getFont() { return $this->font; } /** * Change text angle * * @param int */ public function setAngle($angle) { $this->angle = (int)$angle; } /** * Get text angle * * @return int */ public function getAngle() { return $this->angle; } /** * Change text color * * @param Color */ public function setColor(awColor $color) { $this->color = $color; } /** * Get text color * * @return Color */ public function getColor() { return $this->color; } /** * Change text background color * * @param awColor $color */ public function setBackgroundColor(awColor $color) { $this->background = $color; } /** * Change text background gradient * * @param awGradient $gradient */ public function setBackgroundGradient(awGradient $gradient) { $this->background = $gradient; } /** * Get text background * * @return Color, Gradient */ public function getBackground() { return $this->background; } /** * Change padding * * @param int $left Left padding * @param int $right Right padding * @param int $top Top padding * @param int $bottom Bottom padding */ public function setPadding($left, $right, $top, $bottom) { $this->padding = array((int)$left, (int)$right, (int)$top, (int)$bottom); } /** * Get current padding * * @return array */ public function getPadding() { return $this->padding; } } registerClass('Text'); ?> pgfouine-1.2/include/reporting/artichow/php5/inc/Axis.class.php0000644000175000017500000003463210352052224023211 0ustar acmeacme 'toProportionalValue', 'toPosition' => 'toProportionalPosition' ); /** * Build the axis * * @param float $min Begin of the range of the axis * @param float $max End of the range of the axis */ public function __construct($min = NULL, $max = NULL) { $this->line = new awVector( new awPoint(0, 0), new awPoint(0, 0) ); $this->label = new awLabel; $this->padding = new awSide; $this->title = new awLabel( NULL, NULL, NULL, 0 ); $this->setColor(new awBlack); if($min !== NULL and $max !== NULL) { $this->setRange($min, $max); } } /** * Enable/disable auto-scaling mode * * @param bool $auto */ public function auto($auto) { $this->auto = (bool)$auto; } /** * Get auto-scaling mode status * * @return bool */ public function isAuto() { return $this->auto; } /** * Hide axis * * @param bool $hide */ public function hide($hide = TRUE) { $this->hide = (bool)$hide; } /** * Show axis * * @param bool $show */ public function show($show = TRUE) { $this->hide = !(bool)$show; } /** * Return a tick object from its name * * @param string $name Tick object name * @return Tick */ public function tick($name) { /* */ return array_key_exists($name, $this->ticks) ? $this->ticks[$name] : NULL; /* */ /* -- if(array_key_exists($name, $this->ticks)) { return $tick = &$this->ticks[$name]; } else { return NULL; } -- */ } /** * Add a tick object * * @param string $name Tick object name * @param awTick $tick Tick object */ public function addTick($name, awTick $tick) { /* */ $this->ticks[$name] = $tick; /* */ /* -- $this->ticks[$name] = &$tick; -- */ } /** * Delete a tick object * * @param string $name Tick object name */ public function deleteTick($name) { if(array_key_exists($name, $this->ticks)) { unset($this->ticks[$name]); } } /** * Hide all ticks * * @param bool $hide Hide or not ? */ public function hideTicks($hide = TRUE) { /* */ foreach($this->ticks as $tick) { $tick->hide($hide); } /* */ /* -- foreach($this->ticks as $key => $tick) { $this->ticks[$key]->hide($hide); } -- */ } /** * Change ticks style * * @param int $style Ticks style */ public function setTickStyle($style) { /* */ foreach($this->ticks as $tick) { $tick->setStyle($style); } /* */ /* -- foreach($this->ticks as $key => $tick) { $this->ticks[$key]->setStyle($style); } -- */ } /** * Change ticks interval * * @param int $interval Ticks interval */ public function setTickInterval($interval) { /* */ foreach($this->ticks as $tick) { $tick->setInterval($interval); } /* */ /* -- foreach($this->ticks as $key => $tick) { $this->ticks[$key]->setInterval($interval); } -- */ } /** * Change number of ticks relative to others ticks * * @param awTick $to Change number of theses ticks * @param awTick $from Ticks reference * @param float $number Number of ticks by the reference */ public function setNumberByTick($to, $from, $number) { $this->ticks[$to]->setNumberByTick($this->ticks[$from], $number); } /** * Reverse ticks style */ public function reverseTickStyle() { /* */ foreach($this->ticks as $tick) { if($tick->getStyle() === awTick::IN) { $tick->setStyle(awTick::OUT); } else if($tick->getStyle() === awTick::OUT) { $tick->setStyle(awTick::IN); } } /* */ /* -- foreach($this->ticks as $key => $tick) { if($this->ticks[$key]->getStyle() === awTick::IN) { $this->ticks[$key]->setStyle(awTick::OUT); } else if($this->ticks[$key]->getStyle() === awTick::OUT) { $this->ticks[$key]->setStyle(awTick::IN); } } -- */ } /** * Change interval of labels * * @param int $interval Interval */ public function setLabelInterval($interval) { $this->auto(FALSE); $this->setTickInterval($interval); $this->label->setInterval($interval); } /** * Change number of labels * * @param int $number Number of labels to display (can be NULL) */ public function setLabelNumber($number) { $this->auto(FALSE); $this->labelNumber = is_null($number) ? NULL : (int)$number; } /** * Get number of labels * * @return int */ public function getLabelNumber() { return $this->labelNumber; } /** * Change precision of labels * * @param int $precision Precision */ public function setLabelPrecision($precision) { $this->auto(FALSE); $function = 'axis'.time().'_'.(microtime() * 1000000); eval('function '.$function.'($value) { return sprintf("%.'.(int)$precision.'f", $value); }'); $this->label->setCallbackFunction($function); } /** * Change text of labels * * @param array $texts Some texts */ public function setLabelText($texts) { if(is_array($texts)) { $this->auto(FALSE); $function = 'axis'.time().'_'.(microtime() * 1000000); eval('function '.$function.'($value) { $texts = '.var_export($texts, TRUE).'; return $texts[$value]; }'); $this->label->setCallbackFunction($function); } } /** * Get the position of a point * * @param awAxis $xAxis X axis * @param awAxis $yAxis Y axis * @param awPoint $p Position of the point * @return Point Position on the axis */ public static function toPosition(awAxis $xAxis, awAxis $yAxis, awPoint $p) { $p1 = $xAxis->getPointFromValue($p->x); $p2 = $yAxis->getPointFromValue($p->y); return new awPoint( round($p1->x), round($p2->y) ); } /** * Change title alignment * * @param int $alignment New Alignment */ public function setTitleAlignment($alignment) { switch($alignment) { case awLabel::TOP : $this->setTitlePosition(1); $this->title->setAlign(NULL, awLabel::BOTTOM); break; case awLabel::BOTTOM : $this->setTitlePosition(0); $this->title->setAlign(NULL, awLabel::TOP); break; case awLabel::LEFT : $this->setTitlePosition(0); $this->title->setAlign(awLabel::LEFT); break; case awLabel::RIGHT : $this->setTitlePosition(1); $this->title->setAlign(awLabel::RIGHT); break; } } /** * Change title position on the axis * * @param float $position A new awposition between 0 and 1 */ public function setTitlePosition($position) { $this->titlePosition = (float)$position; } /** * Change axis and axis title color * * @param awColor $color */ public function setColor(awColor $color) { $this->color = $color; $this->title->setColor($color); } /** * Change axis padding * * @param int $left Left padding in pixels * @param int $right Right padding in pixels */ public function setPadding($left, $right) { $this->padding->set($left, $right); } /** * Get axis padding * * @return Side */ public function getPadding() { return $this->padding; } /** * Change axis range * * @param float $min * @param float $max */ public function setRange($min, $max) { if($min !== NULL) { $this->range[0] = (float)$min; } if($max !== NULL) { $this->range[1] = (float)$max; } } /** * Get axis range * * @return array */ public function getRange() { return $this->range; } /** * Change axis range callback function * * @param string $toValue Transform a position between 0 and 1 to a value * @param string $toPosition Transform a value to a position between 0 and 1 on the axis */ public function setRangeCallback($toValue, $toPosition) { $this->rangeCallback = array( 'toValue' => (string)$toValue, 'toPosition' => (string)$toPosition ); } /** * Center X values of the axis * * @param awAxis $axis An axis * @param float $value The reference value on the axis */ public function setXCenter(awAxis $axis, $value) { // Check vector angle if($this->line->isVertical() === FALSE) { trigger_error("setXCenter() can only be used on vertical axes", E_USER_ERROR); } $p = $axis->getPointFromValue($value); $this->line->setX( $p->x, $p->x ); } /** * Center Y values of the axis * * @param awAxis $axis An axis * @param float $value The reference value on the axis */ public function setYCenter(awAxis $axis, $value) { // Check vector angle if($this->line->isHorizontal() === FALSE) { trigger_error("setYCenter() can only be used on horizontal axes", E_USER_ERROR); } $p = $axis->getPointFromValue($value); $this->line->setY( $p->y, $p->y ); } /** * Get the distance between to values on the axis * * @param float $from The first value * @param float $to The last value * @return Point */ public function getDistance($from, $to) { $p1 = $this->getPointFromValue($from); $p2 = $this->getPointFromValue($to); return $p1->getDistance($p2); } /** * Get a point on the axis from a value * * @param float $value * @return Point */ protected function getPointFromValue($value) { $callback = $this->rangeCallback['toPosition']; list($min, $max) = $this->range; $position = $callback($value, $min, $max); return $this->getPointFromPosition($position); } /** * Get a point on the axis from a position * * @param float $position A position between 0 and 1 * @return Point */ protected function getPointFromPosition($position) { $vector = $this->getVector(); $angle = $vector->getAngle(); $size = $vector->getSize(); return $vector->p1->move( cos($angle) * $size * $position, -1 * sin($angle) * $size * $position ); } /** * Draw axis * * @param awDrawer $drawer A drawer */ public function draw(awDrawer $drawer) { if($this->hide) { return; } $vector = $this->getVector(); // Draw axis ticks $this->drawTicks($drawer, $vector); // Draw axis line $this->line($drawer); // Draw labels $this->drawLabels($drawer); // Draw axis title $p = $this->getPointFromPosition($this->titlePosition); $this->title->draw($drawer, $p); } public function autoScale() { if($this->isAuto() === FALSE) { return; } list($min, $max) = $this->getRange(); $interval = $max - $min; $partMax = $max / $interval; $partMin = $min / $interval; $difference = log($interval) / log(10); $difference = floor($difference); $pow = pow(10, $difference); $intervalNormalize = $interval / $pow; if($difference <= 0) { $precision = $difference * -1 + 1; if($intervalNormalize > 2) { $precision--; } } else { $precision = 0; } if($min != 0 and $max != 0) { $precision++; } $this->setLabelPrecision($precision); if($intervalNormalize <= 1.5) { $intervalReal = 1.5; $labelNumber = 4; } else if($intervalNormalize <= 2) { $intervalReal = 2; $labelNumber = 5; } else if($intervalNormalize <= 3) { $intervalReal = 3; $labelNumber = 4; } else if($intervalNormalize <= 4) { $intervalReal = 4; $labelNumber = 5; } else if($intervalNormalize <= 5) { $intervalReal = 5; $labelNumber = 6; } else if($intervalNormalize <= 8) { $intervalReal = 8; $labelNumber = 5; } else if($intervalNormalize <= 10) { $intervalReal = 10; $labelNumber = 6; } if($min == 0) { $this->setRange( $min, $intervalReal * $pow ); } else if($max == 0) { $this->setRange( $intervalReal * $pow * -1, 0 ); } $this->setLabelNumber($labelNumber); } protected function line(awDrawer $drawer) { $drawer->line( $this->color, $this->line ); } protected function drawTicks(awDrawer $drawer, awVector $vector) { foreach($this->ticks as $tick) { $tick->setColor($this->color); $tick->draw($drawer, $vector); } } protected function drawLabels($drawer) { if($this->labelNumber !== NULL) { list($min, $max) = $this->range; $number = $this->labelNumber - 1; if($number < 1) { return; } $function = $this->rangeCallback['toValue']; $labels = array(); for($i = 0; $i <= $number; $i++) { $labels[] = $function($i / $number, $min, $max); } $this->label->set($labels); } $labels = $this->label->count(); for($i = 0; $i < $labels; $i++) { $p = $this->getPointFromValue($this->label->get($i)); $this->label->draw($drawer, $p, $i); } } protected function getVector() { $angle = $this->line->getAngle(); // Compute paddings $vector = new awVector( $this->line->p1->move( cos($angle) * $this->padding->left, -1 * sin($angle) * $this->padding->left ), $this->line->p2->move( -1 * cos($angle) * $this->padding->right, -1 * -1 * sin($angle) * $this->padding->right ) ); return $vector; } public function __clone() { $this->label = clone $this->label; $this->line = clone $this->line; $this->title = clone $this->title; foreach($this->ticks as $name => $tick) { $this->ticks[$name] = clone $tick; } } } registerClass('Axis'); function toProportionalValue($position, $min, $max) { return $min + ($max - $min) * $position; } function toProportionalPosition($value, $min, $max) { if($max - $min == 0) { return 0; } return ($value - $min) / ($max - $min); } ?>pgfouine-1.2/include/reporting/artichow/php5/inc/Font.class.php0000644000175000017500000001453410433377174023230 0ustar acmeacmefont = $font; } /** * Draw a text * * @param awDrawer $drawer * @param awPoint $p Draw text at this point * @param awText $text The text */ public function draw(awDrawer $drawer, awPoint $p, awText $text) { $angle = $text->getAngle(); if($angle !== 90 and $angle !== 0) { trigger_error("You can only use 0° and 90°", E_USER_ERROR); } if($angle === 90) { $function = 'imagestringup'; } else { $function = 'imagestring'; } if($angle === 90) { $add = $this->getTextHeight($text); } else { $add = 0; } $color = $text->getColor(); $rgb = $color->getColor($drawer->resource); $lines = explode("\n", $text->getText()); for($i = 0; $i < count($lines); $i++) { $function( $drawer->resource, $this->font, $drawer->x + $p->x, $drawer->y + $p->y + $add + $i * $this->getLineHeight($text), $lines[$i], $rgb ); } } /** * Get the width of a string * * @param awText $text A string */ public function getTextWidth(awText $text) { if($text->getAngle() === 90) { $text->setAngle(45); return $this->getTextHeight($text); } else if($text->getAngle() === 45) { $text->setAngle(90); } $font = $text->getFont(); $fontWidth = imagefontwidth($font->font); if($fontWidth === FALSE) { trigger_error("Unable to get font size", E_USER_ERROR); } $lines = explode("\n", $text->getText()); /* this is the correct algorithm but I consider only the first line for my needs $textLength = 0; for($i = 0; $i < count($lines); $i++) { $textLength = max($textLength, strlen($lines[$i])); }*/ $textLength = strlen($lines[0]); return (int)$fontWidth * $textLength; } /** * Get the height of a line * * @param awText $text A line */ public function getLineHeight(awText $text) { if($text->getAngle() === 90) { $text->setAngle(45); return $this->getTextWidth($text); } else if($text->getAngle() === 45) { $text->setAngle(90); } $font = $text->getFont(); $fontHeight = imagefontheight($font->font); if($fontHeight === FALSE) { trigger_error("Unable to get font size", E_USER_ERROR); } return (int)$fontHeight; } /** * Get the height of a string * * @param awText $text A string */ function getTextHeight(awText $text) { $lines = explode("\n", $text->getText()); $lineCount = count($lines); return $this->getLineHeight($text) * $lineCount; } } registerClass('Font'); /** * TTF fonts * * @package Artichow */ class awTTFFont extends awFont { /** * Font size * * @var int */ public $size; /** * Font file * * @param string $font Font file * @param int $size Font size */ public function __construct($font, $size) { parent::__construct($font); $this->size = (int)$size; } /** * Draw a text * * @param awDrawer $drawer * @param awPoint $p Draw text at this point * @param awText $text The text */ public function draw(awDrawer $drawer, awPoint $p, awText $text) { // Make easier font positionment $text->setText($text->getText()." "); $color = $text->getColor(); $rgb = $color->getColor($drawer->resource); $box = imagettfbbox($this->size, $text->getAngle(), $this->font, $text->getText()); $height = - $box[5]; $box = imagettfbbox($this->size, 90, $this->font, $text->getText()); $width = abs($box[6] - $box[2]); // Restore old text $text->setText(substr($text->getText(), 0, strlen($text->getText()) - 1)); imagettftext( $drawer->resource, $this->size, $text->getAngle(), $drawer->x + $p->x + $width * sin($text->getAngle() / 180 * M_PI), $drawer->y + $p->y + $height, $rgb, $this->font, $text->getText() ); } /** * Get the width of a string * * @param awText $text A string */ public function getTextWidth(awText $text) { $box = imagettfbbox($this->size, $text->getAngle(), $this->font, $text->getText()); if($box === FALSE) { trigger_error("Unable to get font size", E_USER_ERROR); return; } list(, , $x2, $y2, , , $x1, $y1) = $box; return abs($x2 - $x1); } /** * Get the height of a string * * @param awText $text A string */ public function getTextHeight(awText $text) { $box = imagettfbbox($this->size, $text->getAngle(), $this->font, $text->getText()); if($box === FALSE) { trigger_error("Unable to get font size", E_USER_ERROR); return; } list(, , $x2, $y2, , , $x1, $y1) = $box; return abs($y2 - $y1); } } registerClass('TTFFont'); /* */ $php = ''; for($i = 1; $i <= 5; $i++) { $php .= ' class awFont'.$i.' extends awFont { public function __construct() { parent::__construct('.$i.'); } } '; if(ARTICHOW_PREFIX !== 'aw') { $php .= ' class '.ARTICHOW_PREFIX.'Font'.$i.' extends awFont'.$i.' { } '; } } eval($php); $php = ''; foreach($fonts as $font) { $php .= ' class aw'.$font.' extends awTTFFont { public function __construct($size) { parent::__construct(\''.(ARTICHOW_FONT.DIRECTORY_SEPARATOR.$font.'.ttf').'\', $size); } } '; if(ARTICHOW_PREFIX !== 'aw') { $php .= ' class '.ARTICHOW_PREFIX.$font.' extends aw'.$font.' { } '; } } eval($php); /* */ /* -- $php = ''; for($i = 1; $i <= 5; $i++) { $php .= ' class awFont'.$i.' extends awFont { function awFont'.$i.'() { parent::awFont('.$i.'); } } '; if(ARTICHOW_PREFIX !== 'aw') { $php .= ' class '.ARTICHOW_PREFIX.'Font'.$i.' extends awFont'.$i.' { } '; } } eval($php); $php = ''; foreach($fonts as $font) { $php .= ' class aw'.$font.' extends awTTFFont { function aw'.$font.'($size) { parent::awTTFFont(\''.(ARTICHOW_FONT.DIRECTORY_SEPARATOR.$font.'.ttf').'\', $size); } } '; if(ARTICHOW_PREFIX !== 'aw') { $php .= ' class '.ARTICHOW_PREFIX.$font.' extends aw'.$font.' { } '; } } eval($php); -- */ ?> pgfouine-1.2/include/reporting/artichow/php5/inc/Color.class.php0000644000175000017500000001156110352052224023357 0ustar acmeacmered = (int)$red; $this->green = (int)$green; $this->blue = (int)$blue; $this->alpha = (int)round($alpha * 127 / 100); } /** * Return a GDised color * * @param resource $resource A GD resource * @return int */ public function getColor($resource) { $this->resource = $resource; if($this->color === NULL) { if($this->alpha === 0 or function_exists('imagecolorallocatealpha') === FALSE) { $this->color = imagecolorallocate($this->resource, $this->red, $this->green, $this->blue); } else { $this->color = imagecolorallocatealpha($this->resource, $this->red, $this->green, $this->blue, $this->alpha); } } return $this->color; } /** * Change color brightness * * @param int $brightness Add this intensity to the color (betweeen -255 and +255) */ public function brightness($brightness) { $brightness = (int)$brightness; $this->red = min(255, max(0, $this->red + $brightness)); $this->green = min(255, max(0, $this->green + $brightness)); $this->blue = min(255, max(0, $this->blue + $brightness)); } /** * Get RGB and alpha values of your color * * @return array */ public function rgba() { return array($this->red, $this->green, $this->blue, $this->alpha); } /** * Free resources used for this color */ public function free() { if($this->resource !== NULL) { @imagecolordeallocate($this->resource, $this->color); $this->resource = NULL; } } public function __destruct() { $this->free(); } } registerClass('Color'); $colors = array( 'Black' => array(0, 0, 0), 'AlmostBlack' => array(48, 48, 48), 'VeryDarkGray' => array(88, 88, 88), 'DarkGray' => array(128, 128, 128), 'MidGray' => array(160, 160, 160), 'LightGray' => array(195, 195, 195), 'VeryLightGray' => array(220, 220, 220), 'White' => array(255, 255, 255), 'VeryDarkRed' => array(64, 0, 0), 'DarkRed' => array(128, 0, 0), 'MidRed' => array(192, 0, 0), 'Red' => array(255, 0, 0), 'LightRed' => array(255, 192, 192), 'VeryDarkGreen' => array(0, 64, 0), 'DarkGreen' => array(0, 128, 0), 'MidGreen' => array(0, 192, 0), 'Green' => array(0, 255, 0), 'LightGreen' => array(192, 255, 192), 'VeryDarkBlue' => array(0, 0, 64), 'DarkBlue' => array(0, 0, 128), 'MidBlue' => array(0, 0, 192), 'Blue' => array(0, 0, 255), 'LightBlue' => array(192, 192, 255), 'VeryDarkYellow' => array(64, 64, 0), 'DarkYellow' => array(128, 128, 0), 'MidYellow' => array(192, 192, 0), 'Yellow' => array(255, 255, 2), 'LightYellow' => array(255, 255, 192), 'VeryDarkCyan' => array(0, 64, 64), 'DarkCyan' => array(0, 128, 128), 'MidCyan' => array(0, 192, 192), 'Cyan' => array(0, 255, 255), 'LightCyan' => array(192, 255, 255), 'VeryDarkMagenta' => array(64, 0, 64), 'DarkMagenta' => array(128, 0, 128), 'MidMagenta' => array(192, 0, 192), 'Magenta' => array(255, 0, 255), 'LightMagenta' => array(255, 192, 255), 'DarkOrange' => array(192, 88, 0), 'Orange' => array(255, 128, 0), 'LightOrange' => array(255, 168, 88), 'VeryLightOrange' => array(255, 220, 168), 'DarkPink' => array(192, 0, 88), 'Pink' => array(255, 0, 128), 'LightPink' => array(255, 88, 168), 'VeryLightPink' => array(255, 168, 220), 'DarkPurple' => array(88, 0, 192), 'Purple' => array(128, 0, 255), 'LightPurple' => array(168, 88, 255), 'VeryLightPurple' => array(220, 168, 255), ); /* */ $php = ''; foreach($colors as $name => $color) { list($red, $green, $blue) = $color; $php .= ' class aw'.$name.' extends awColor { public function __construct($alpha = 0) { parent::__construct('.$red.', '.$green.', '.$blue.', $alpha); } } '; if(ARTICHOW_PREFIX !== 'aw') { $php .= ' class '.ARTICHOW_PREFIX.$name.' extends aw'.$name.' { } '; } } eval($php); /* */ /* -- $php = ''; foreach($colors as $name => $color) { list($red, $green, $blue) = $color; $php .= ' class aw'.$name.' extends awColor { function aw'.$name.'($alpha = 0) { parent::awColor('.$red.', '.$green.', '.$blue.', $alpha); } } '; if(ARTICHOW_PREFIX !== 'aw') { $php .= ' class '.ARTICHOW_PREFIX.$name.' extends aw'.$name.' { } '; } } eval($php); -- */ ?> pgfouine-1.2/include/reporting/artichow/php5/inc/Tick.class.php0000644000175000017500000001326010352052224023171 0ustar acmeacme */ define("TICK_IN", 0); define("TICK_OUT", 1); define("TICK_IN_OUT", 2); /* */ /** * Handle ticks * * @package Artichow */ class awTick { /** * Ticks style * * @var int */ protected $style = awTick::IN; /** * Ticks size * * @var int */ protected $size; /** * Ticks color * * @var Color */ protected $color; /** * Ticks number * * @var int */ protected $number; /** * Ticks number by other tick * * @var array */ protected $numberByTick; /** * Ticks interval * * @var int */ protected $interval = 1; /** * Hide ticks * * @var bool */ protected $hide = FALSE; /** * Hide first tick * * @var bool */ protected $hideFirst = FALSE; /** * Hide last tick * * @var bool */ protected $hideLast = FALSE; /** * In mode * * @param int */ const IN = 0; /** * Out mode * * @param int */ const OUT = 1; /** * In and out mode * * @param int */ const IN_OUT = 2; /** * Build the ticks * * @param int $number Number of ticks * @param int $size Ticks size */ public function __construct($number, $size) { $this->setSize($size); $this->setNumber($number); $this->setColor(new awBlack); $this->style = awTick::IN; } /** * Change ticks style * * @param int $style */ public function setStyle($style) { $this->style = (int)$style; } /** * Get ticks style * * @return int */ public function getStyle() { return $this->style; } /** * Change ticks color * * @param awColor $color */ public function setColor(awColor $color) { $this->color = $color; } /** * Change ticks size * * @param int $size */ public function setSize($size) { $this->size = (int)$size; } /** * Change interval of ticks * * @param int $interval */ public function setInterval($interval) { $this->interval = (int)$interval; } /** * Get interval between each tick * * @return int */ public function getInterval() { return $this->interval; } /** * Change number of ticks * * @param int $number */ public function setNumber($number) { $this->number = (int)$number; } /** * Get number of ticks * * @return int */ public function getNumber() { return $this->number; } /** * Change number of ticks relative to others ticks * * @param awTick $tick Ticks reference * @param int $number Number of ticks */ public function setNumberByTick(awTick $tick, $number) { /* */ $this->numberByTick = array($tick, (int)$number); /* */ /* -- $this->numberByTick = array(&$tick, (int)$number); -- */ } /** * Hide ticks * * @param bool $hide */ public function hide($hide) { $this->hide = (bool)$hide; } /** * Hide first tick * * @param bool $hide */ public function hideFirst($hide) { $this->hideFirst = (bool)$hide; } /** * Hide last tick * * @param bool $hide */ public function hideLast($hide) { $this->hideLast = (bool)$hide; } /** * Draw ticks on a vector * * @param awDrawer $drawer A drawer * @param awVector $vector A vector */ public function draw(awDrawer $drawer, awVector $vector) { if($this->numberByTick !== NULL) { list($tick, $number) = $this->numberByTick; $this->number = 1 + ($tick->getNumber() - 1) * ($number + 1); $this->interval = $tick->getInterval(); } if($this->number < 2 or $this->hide) { return; } $angle = $vector->getAngle(); // echo "INIT:".$angle."
"; switch($this->style) { case awTick::IN : $this->drawTicks($drawer, $vector, NULL, $angle + M_PI / 2); break; case awTick::OUT : $this->drawTicks($drawer, $vector, $angle + 3 * M_PI / 2, NULL); break; default : $this->drawTicks($drawer, $vector, $angle + M_PI / 2, $angle + 3 * M_PI / 2); break; } } protected function drawTicks(awDrawer $drawer, awVector $vector, $from, $to) { // Draw last tick if($this->hideLast === FALSE) { //echo ''; if(($this->number - 1) % $this->interval === 0) { $this->drawTick($drawer, $vector->p2, $from, $to); } //echo ''; } $number = $this->number - 1; $size = $vector->getSize(); // Get tick increment in pixels $inc = $size / $number; // Check if we must hide the first tick $start = $this->hideFirst ? $inc : 0; $stop = $inc * $number; $position = 0; for($i = $start; round($i, 6) < $stop; $i += $inc) { if($position % $this->interval === 0) { $p = $vector->p1->move( round($i * cos($vector->getAngle()), 6), round($i * sin($vector->getAngle() * -1), 6) ); $this->drawTick($drawer, $p, $from, $to); } $position++; } //echo '

'; } protected function drawTick(awDrawer $drawer, awPoint $p, $from, $to) { // echo $this->size.':'.$angle.'|'.cos($angle).'/'; // The round avoid some errors in the calcul // For example, 12.00000008575245 becomes 12 $p1 = $p; $p2 = $p; if($from !== NULL) { $p1 = $p1->move( round($this->size * cos($from), 6), round($this->size * sin($from) * -1, 6) ); } if($to !== NULL) { $p2 = $p2->move( round($this->size * cos($to), 6), round($this->size * sin($to) * -1, 6) ); } //echo $p1->x.':'.$p2->x.'('.$p1->y.':'.$p2->y.')'.'/'; $vector = new awVector( $p1, $p2 ); $drawer->line( $this->color, $vector ); } } registerClass('Tick'); ?>pgfouine-1.2/include/reporting/artichow/php5/inc/Shadow.class.php0000644000175000017500000001730610352052224023531 0ustar acmeacme */ define("SHADOW_LEFT_TOP", 1); define("SHADOW_LEFT_BOTTOM", 2); define("SHADOW_RIGHT_TOP", 3); define("SHADOW_RIGHT_BOTTOM", 4); define("SHADOW_IN", 1); define("SHADOW_OUT", 2); /* */ /** * Draw shadows * */ class awShadow { /** * Shadow on left and top sides * * @var int */ const LEFT_TOP = 1; /** * Shadow on left and bottom sides * * @var int */ const LEFT_BOTTOM = 2; /** * Shadow on right and top sides * * @var int */ const RIGHT_TOP = 3; /** * Shadow on right and bottom sides * * @var int */ const RIGHT_BOTTOM = 4; /** * In mode * * @var int */ const IN = 1; /** * Out mode * * @var int */ const OUT = 2; /** * Shadow size * * @var int */ private $size = 0; /** * Hide shadow ? * * @var bool */ protected $hide = FALSE; /** * Shadow color * * @var Color */ private $color; /** * Shadow position * * @var int */ private $position; /** * Smooth shadow ? * * @var bool */ private $smooth = FALSE; /** * Shadow constructor * * @param int $position Shadow position */ public function __construct($position) { $this->setPosition($position); } /** * Hide shadow ? * * @param bool $hide */ public function hide($hide = TRUE) { $this->hide = (bool)$hide; } /** * Show shadow ? * * @param bool $show */ public function show($show = TRUE) { $this->hide = (bool)!$show; } /** * Change shadow size * * @param int $size * @param bool $smooth Smooth the shadow (facultative argument) */ public function setSize($size, $smooth = NULL) { $this->size = (int)$size; if($smooth !== NULL) { $this->smooth($smooth); } } /** * Change shadow color * * @param awColor $color */ public function setColor($color) { $this->color = (int)$color; } /** * Change shadow position * * @param int $position */ public function setPosition($position) { $this->position = (int)$position; } /** * Smooth shadow ? * * @param bool $smooth */ public function smooth($smooth) { $this->smooth = (bool)$smooth; } /** * Get the space taken by the shadow * * @return Side */ public function getSpace() { return new awSide( ($this->position === awShadow::LEFT_TOP or $this->position === awShadow::LEFT_BOTTOM) ? $this->size : 0, ($this->position === awShadow::RIGHT_TOP or $this->position === awShadow::RIGHT_BOTTOM) ? $this->size : 0, ($this->position === awShadow::LEFT_TOP or $this->position === awShadow::RIGHT_TOP) ? $this->size : 0, ($this->position === awShadow::LEFT_BOTTOM or $this->position === awShadow::RIGHT_BOTTOM) ? $this->size : 0 ); } /** * Draw shadow * * @param awDrawer $drawer * @param awPoint $p1 Top-left point * @param awPoint $p2 Right-bottom point * @param int Drawing mode */ public function draw(awDrawer $drawer, awPoint $p1, awPoint $p2, $mode) { if($this->hide) { return; } if($this->size <= 0) { return; } $drawer = clone $drawer; $color = ($this->color instanceof awColor) ? $this->color : new awColor(125, 125, 125); switch($this->position) { case awShadow::RIGHT_BOTTOM : if($mode === awShadow::OUT) { $t1 = $p1->move(0, 0); $t2 = $p2->move($this->size + 1, $this->size + 1); } else { // PHP 4 compatibility $t1 = $p1->move(0, 0); $t2 = $p2->move(0, 0); } $width = $t2->x - $t1->x; $height = $t2->y - $t1->y; $drawer->setAbsPosition($t1->x + $drawer->x, $t1->y + $drawer->y); $drawer->filledRectangle( $color, new awLine( new awPoint($width - $this->size, $this->size), new awPoint($width - 1, $height - 1) ) ); $drawer->filledRectangle( $color, new awLine( new awPoint($this->size, $height - $this->size), new awPoint($width - $this->size - 1, $height - 1) ) ); $this->smoothPast($drawer, $color, $width, $height); break; case awShadow::LEFT_TOP : if($mode === awShadow::OUT) { $t1 = $p1->move(- $this->size, - $this->size); $t2 = $p2->move(0, 0); } else { // PHP 4 compatibility $t1 = $p1->move(0, 0); $t2 = $p2->move(0, 0); } $width = $t2->x - $t1->x; $height = $t2->y - $t1->y; $drawer->setAbsPosition($t1->x + $drawer->x, $t1->y + $drawer->y); $height = max($height + 1, $this->size); $drawer->filledRectangle( $color, new awLine( new awPoint(0, 0), new awPoint($this->size - 1, $height - $this->size - 1) ) ); $drawer->filledRectangle( $color, new awLine( new awPoint($this->size, 0), new awPoint($width - $this->size - 1, $this->size - 1) ) ); $this->smoothPast($drawer, $color, $width, $height); break; case awShadow::RIGHT_TOP : if($mode === awShadow::OUT) { $t1 = $p1->move(0, - $this->size); $t2 = $p2->move($this->size + 1, 0); } else { // PHP 4 compatibility $t1 = $p1->move(0, 0); $t2 = $p2->move(0, 0); } $width = $t2->x - $t1->x; $height = $t2->y - $t1->y; $drawer->setAbsPosition($t1->x + $drawer->x, $t1->y + $drawer->y); $height = max($height + 1, $this->size); $drawer->filledRectangle( $color, new awLine( new awPoint($width - $this->size, 0), new awPoint($width - 1, $height - $this->size - 1) ) ); $drawer->filledRectangle( $color, new awLine( new awPoint($this->size, 0), new awPoint($width - $this->size - 1, $this->size - 1) ) ); $this->smoothFuture($drawer, $color, $width, $height); break; case awShadow::LEFT_BOTTOM : if($mode === awShadow::OUT) { $t1 = $p1->move(- $this->size, 0); $t2 = $p2->move(0, $this->size + 1); } else { // PHP 4 compatibility $t1 = $p1->move(0, 0); $t2 = $p2->move(0, 0); } $width = $t2->x - $t1->x; $height = $t2->y - $t1->y; $drawer->setAbsPosition($t1->x + $drawer->x, $t1->y + $drawer->y); $drawer->filledRectangle( $color, new awLine( new awPoint(0, $this->size), new awPoint($this->size - 1, $height - 1) ) ); $drawer->filledRectangle( $color, new awLine( new awPoint($this->size, $height - $this->size), new awPoint($width - $this->size - 1, $height - 1) ) ); $this->smoothFuture($drawer, $color, $width, $height); break; } } private function smoothPast(awDrawer $drawer, awColor $color, $width, $height) { if($this->smooth) { for($i = 0; $i < $this->size; $i++) { for($j = 0; $j <= $i; $j++) { $drawer->point( $color, new awPoint($i, $j + $height - $this->size) ); } } for($i = 0; $i < $this->size; $i++) { for($j = 0; $j <= $i; $j++) { $drawer->point( $color, new awPoint($width - $this->size + $j, $i) ); } } } } private function smoothFuture(awDrawer $drawer, awColor $color, $width, $height) { if($this->smooth) { for($i = 0; $i < $this->size; $i++) { for($j = 0; $j <= $i; $j++) { $drawer->point( $color, new awPoint($i, $this->size - $j - 1) ); } } for($i = 0; $i < $this->size; $i++) { for($j = 0; $j <= $i; $j++) { $drawer->point( $color, new awPoint($width - $this->size + $j, $height - $i - 1) ); } } } } } registerClass('Shadow'); ?>pgfouine-1.2/include/reporting/artichow/php5/inc/Drawer.class.php0000644000175000017500000005632310352052224023532 0ustar acmeacmeresource = $resource; } /** * Change the image size * * @param int $width Image width * @param int $height Image height */ public function setImageSize($width, $height) { $this->width = $width; $this->height = $height; } /** * Inform the drawer of the position of your image * * @param float $x Position on X axis of the center of the component * @param float $y Position on Y axis of the center of the component */ public function setPosition($x, $y) { // Calcul absolute position $this->x = round($x * $this->width - $this->w / 2); $this->y = round($y * $this->height - $this->h / 2); } /** * Inform the drawer of the position of your image * This method need absolutes values * * @param int $x Left-top corner X position * @param int $y Left-top corner Y position */ public function setAbsPosition($x, $y) { $this->x = $x; $this->y = $y; } /** * Move the position of the image * * @param int $x Add this value to X axis * @param int $y Add this value to Y axis */ public function movePosition($x, $y) { $this->x += (int)$x; $this->y += (int)$y; } /** * Inform the drawer of the size of your image * Height and width must be between 0 and 1. * * @param int $w Image width * @param int $h Image height * @return array Absolute width and height of the image */ public function setSize($w, $h) { // Calcul absolute size $this->w = round($w * $this->width); $this->h = round($h * $this->height); return $this->getSize(); } /** * Inform the drawer of the size of your image * You can set absolute size with this method. * * @param int $w Image width * @param int $h Image height */ public function setAbsSize($w, $h) { $this->w = $w; $this->h = $h; return $this->getSize(); } /** * Get the size of the component handled by the drawer * * @return array Absolute width and height of the component */ public function getSize() { return array($this->w, $this->h); } /** * Draw an image here * * @param awImage $image Image * @param int $p1 Image top-left point * @param int $p2 Image bottom-right point */ public function copyImage(awImage $image, awPoint $p1, awPoint $p2) { list($x1, $y1) = $p1->getLocation(); list($x2, $y2) = $p2->getLocation(); $drawer = $image->getDrawer(); imagecopy($this->resource, $drawer->resource, $this->x + $x1, $this->y + $y1, 0, 0, $x2 - $x1, $y2 - $y1); } /** * Draw an image here * * @param awImage $image Image * @param int $d1 Destination top-left position * @param int $d2 Destination bottom-right position * @param int $s1 Source top-left position * @param int $s2 Source bottom-right position * @param bool $resample Resample image ? (default to TRUE) */ public function copyResizeImage(awImage $image, awPoint $d1, awPoint $d2, awPoint $s1, awPoint $s2, $resample = TRUE) { if($resample) { $function = 'imagecopyresampled'; } else { $function = 'imagecopyresized'; } $drawer = $image->getDrawer(); $function( $this->resource, $drawer->resource, $this->x + $d1->x, $this->y + $d1->y, $s1->x, $s1->y, $d2->x - $d1->x, $d2->y - $d1->y, $s2->x - $s1->x, $s2->y - $s1->y ); } /** * Draw a string * * @var awText $text Text to print * @param awPoint $point Draw the text at this point */ public function string(awText $text, awPoint $point) { $font = $text->getFont(); if($text->getBackground() !== NULL or $text->border->visible()) { list($left, $right, $top, $bottom) = $text->getPadding(); $width = $font->getTextWidth($text); $height = $font->getTextHeight($text); $x1 = floor($point->x - $left); $y1 = floor($point->y - $top); $x2 = $x1 + $width + $left + $right; $y2 = $y1 + $height + $top + $bottom; $this->filledRectangle( $text->getBackground(), awLine::build($x1, $y1, $x2, $y2) ); $text->border->rectangle( $this, new awPoint($x1 - 1, $y1 - 1), new awPoint($x2 + 1, $y2 + 1) ); } $font->draw($this, $point, $text); } /** * Draw a pixel * * @param awColor $color Pixel color * @param awPoint $p */ public function point(awColor $color, awPoint $p) { if($p->isHidden() === FALSE) { $rgb = $color->getColor($this->resource); imagesetpixel($this->resource, $this->x + round($p->x), $this->y + round($p->y), $rgb); } } /** * Draw a colored line * * @param awColor $color Line color * @param awLine $line * @param int $thickness Line tickness */ public function line(awColor $color, awLine $line) { if($line->thickness > 0 and $line->isHidden() === FALSE) { $rgb = $color->getColor($this->resource); $thickness = $line->thickness; list($p1, $p2) = $line->getLocation(); $this->startThickness($thickness); switch($line->getStyle()) { case awLine::SOLID : imageline($this->resource, $this->x + round($p1->x), $this->y + round($p1->y), $this->x + round($p2->x), $this->y + round($p2->y), $rgb); break; case awLine::DOTTED : $size = sqrt(pow($p2->y - $p1->y, 2) + pow($p2->x - $p1->x, 2)); $cos = ($p2->x - $p1->x) / $size; $sin = ($p2->y - $p1->y) / $size; for($i = 0; $i <= $size; $i += 2) { $p = new awPoint( round($i * $cos + $p1->x), round($i * $sin + $p1->y) ); $this->point($color, $p); } break; case awLine::DASHED : $width = $p2->x - $p1->x; $height = $p2->y - $p1->y; $size = sqrt(pow($height, 2) + pow($width, 2)); if($size == 0) { return; } $cos = $width / $size; $sin = $height / $size; for($i = 0; $i <= $size; $i += 6) { $t1 = new awPoint( round($i * $cos + $p1->x), round($i * $sin + $p1->y) ); $function = ($height > 0) ? 'min' : 'max'; $t2 = new awPoint( round(min(($i + 3) * $cos, $width) + $p1->x), round($function(($i + 3) * $sin, $height) + $p1->y) ); $this->line($color, new awLine($t1, $t2)); } break; } $this->stopThickness($thickness); } } /** * Draw a color arc * @param awColor $color Arc color * @param awPoint $center Point center * @param int $width Ellipse width * @param int $height Ellipse height * @param int $from Start angle * @param int $to End angle */ public function arc(awColor $color, awPoint $center, $width, $height, $from, $to) { imagefilledarc( $this->resource, $this->x + $center->x, $this->y + $center->y, $width, $height, $from, $to, $color->getColor($this->resource), IMG_ARC_EDGED | IMG_ARC_NOFILL ); } /** * Draw an arc with a background color * * @param awColor $color Arc background color * @param awPoint $center Point center * @param int $width Ellipse width * @param int $height Ellipse height * @param int $from Start angle * @param int $to End angle */ public function filledArc(awColor $color, awPoint $center, $width, $height, $from, $to) { imagefilledarc( $this->resource, $this->x + $center->x, $this->y + $center->y, $width, $height, $from, $to, $color->getColor($this->resource), IMG_ARC_PIE ); } /** * Draw a colored ellipse * * @param awColor $color Ellipse color * @param awPoint $center Ellipse center * @param int $width Ellipse width * @param int $height Ellipse height */ public function ellipse(awColor $color, awPoint $center, $width, $height) { list($x, $y) = $center->getLocation(); $rgb = $color->getColor($this->resource); imageellipse( $this->resource, $this->x + $x, $this->y + $y, $width, $height, $rgb ); } /** * Draw an ellipse with a background * * @param mixed $background Background (can be a color or a gradient) * @param awPoint $center Ellipse center * @param int $width Ellipse width * @param int $height Ellipse height */ public function filledEllipse($background, awPoint $center, $width, $height) { if($background instanceof awColor) { list($x, $y) = $center->getLocation(); $rgb = $background->getColor($this->resource); imagefilledellipse( $this->resource, $this->x + $x, $this->y + $y, $width, $height, $rgb ); } else if($background instanceof awGradient) { list($x, $y) = $center->getLocation(); $x1 = $x - round($width / 2); $y1 = $y - round($height / 2); $x2 = $x1 + $width; $y2 = $y1 + $height; $gradientDrawer = new awGradientDrawer($this); $gradientDrawer->filledEllipse( $background, $x1, $y1, $x2, $y2 ); } } /** * Draw a colored rectangle * * @param awColor $color Rectangle color * @param awLine $line Rectangle diagonale * @param awPoint $p2 */ public function rectangle(awColor $color, awLine $line) { $p1 = $line->p1; $p2 = $line->p2; switch($line->getStyle()) { case awLine::SOLID : $thickness = $line->getThickness(); $this->startThickness($thickness); $rgb = $color->getColor($this->resource); imagerectangle($this->resource, $this->x + $p1->x, $this->y + $p1->y, $this->x + $p2->x, $this->y + $p2->y, $rgb); $this->stopThickness($thickness); break; default : // Top side $line->setLocation( new awPoint($p1->x, $p1->y), new awPoint($p2->x, $p1->y) ); $this->line($color, $line); // Right side $line->setLocation( new awPoint($p2->x, $p1->y), new awPoint($p2->x, $p2->y) ); $this->line($color, $line); // Bottom side $line->setLocation( new awPoint($p1->x, $p2->y), new awPoint($p2->x, $p2->y) ); $this->line($color, $line); // Left side $line->setLocation( new awPoint($p1->x, $p1->y), new awPoint($p1->x, $p2->y) ); $this->line($color, $line); break; } } /** * Draw a rectangle with a background * * @param mixed $background Background (can be a color or a gradient) * @param awLine $line Rectangle diagonale */ public function filledRectangle($background, awLine $line) { $p1 = $line->p1; $p2 = $line->p2; if($background instanceof awColor) { $rgb = $background->getColor($this->resource); imagefilledrectangle($this->resource, $this->x + $p1->x, $this->y + $p1->y, $this->x + $p2->x, $this->y + $p2->y, $rgb); } else if($background instanceof awGradient) { $gradientDrawer = new awGradientDrawer($this); $gradientDrawer->filledRectangle($background, $p1, $p2); } } /** * Draw a polygon * * @param awColor $color Polygon color * @param Polygon A polygon */ public function polygon(awColor $color, awPolygon $polygon) { switch($polygon->getStyle()) { case awPolygon::SOLID : $thickness = $line->getThickness(); $this->startThickness($thickness); $points = $this->getPolygonPoints($polygon); $rgb = $color->getColor($this->resource); imagepolygon($this->resource, $points, $polygon->count(), $rgb); $this->stopThickness($thickness); break; default : if($polygon->count() > 1) { $prev = $polygon->get(0); $line = new awLine; $line->setStyle($polygon->getStyle()); $line->setThickness($polygon->getThickness()); for($i = 1; $i < $polygon->count(); $i++) { $current = $polygon->get($i); $line->setLocation($prev, $current); $this->line($color, $line); $prev = $current; } } } } /** * Draw a polygon with a background * * @param mixed $background Background (can be a color or a gradient) * @param Polygon A polygon */ public function filledPolygon($background, awPolygon $polygon) { if($background instanceof awColor) { $points = $this->getPolygonPoints($polygon); $rgb = $background->getColor($this->resource); imagefilledpolygon($this->resource, $points, $polygon->count(), $rgb); } else if($background instanceof awGradient) { $gradientDrawer = new awGradientDrawer($this); $gradientDrawer->filledPolygon($background, $polygon); } } private function getPolygonPoints(awPolygon $polygon) { $points = array(); foreach($polygon->all() as $point) { $points[] = $point->x + $this->x; $points[] = $point->y + $this->y; } return $points; } private function startThickness($thickness) { if($thickness > 1) { // Beurk :'( imageantialias($this->resource, FALSE); imagesetthickness($this->resource, $thickness); } } private function stopThickness($thickness) { if($thickness > 1) { imagesetthickness($this->resource, 1); imageantialias($this->resource, TRUE); } } } registerClass('Drawer'); /** * To your gradients * * @package Artichow */ class awGradientDrawer { /** * A drawer * * @var Drawer */ protected $drawer; /** * Build your GradientDrawer * * @var awDrawer $drawer */ public function __construct(awDrawer $drawer) { $this->drawer = $drawer; } public function drawFilledFlatTriangle(awGradient $gradient, awPoint $a, awPoint $b, awPoint $c) { if($gradient->angle !== 0) { trigger_error("Flat triangles can only be used with 0 degree gradients", E_USER_ERROR); } // Look for right-angled triangle if($a->x !== $b->x and $b->x !== $c->x) { trigger_error("Not right-angled flat triangles are not supported yet", E_USER_ERROR); } if($a->x === $b->x) { $d = $a; $e = $c; } else { $d = $c; $e = $a; } $this->init($gradient, $b->y - $d->y); for($i = $c->y + 1; $i < $b->y; $i++) { $color = $this->color($i - $d->y); $pos = ($i - $d->y) / ($b->y - $d->y); $p1 = new awPoint($e->x, $i); $p2 = new awPoint(1 + floor($e->x - $pos * ($e->x - $d->x)), $i); $this->drawer->filledRectangle($color, new awLine($p1, $p2)); $color->free(); unset($color); } } public function filledRectangle(awGradient $gradient, awPoint $p1, awPoint $p2) { list($x1, $y1) = $p1->getLocation(); list($x2, $y2) = $p2->getLocation(); if($y1 < $y2) { $y1 ^= $y2 ^= $y1 ^= $y2; } if($x2 < $x1) { $x1 ^= $x2 ^= $x1 ^= $x2; } if($gradient instanceof awLinearGradient) { $this->rectangleLinearGradient($gradient, new awPoint($x1, $y1), new awPoint($x2, $y2)); } else { trigger_error("This gradient is not supported by rectangles", E_USER_ERROR); } } public function filledPolygon(awGradient $gradient, awPolygon $polygon) { if($gradient instanceof awLinearGradient) { $this->polygonLinearGradient($gradient, $polygon); } else { trigger_error("This gradient is not supported by polygons", E_USER_ERROR); } } protected function rectangleLinearGradient(awLinearGradient $gradient, awPoint $p1, awPoint $p2) { list($x1, $y1) = $p1->getLocation(); list($x2, $y2) = $p2->getLocation(); if($y1 - $y2 > 0) { if($gradient->angle === 0) { $this->init($gradient, $y1 - $y2); for($i = $y2; $i <= $y1; $i++) { $color = $this->color($i - $y2); $p1 = new awPoint($x1, $i); $p2 = new awPoint($x2, $i); $this->drawer->filledRectangle($color, new awLine($p1, $p2)); $color->free(); unset($color); } } else if($gradient->angle === 90) { $this->init($gradient, $x2 - $x1); for($i = $x1; $i <= $x2; $i++) { $color = $this->color($i - $x1); $p1 = new awPoint($i, $y2); $p2 = new awPoint($i, $y1); $this->drawer->filledRectangle($color, new awLine($p1, $p2)); $color->free(); unset($color); } } } } public function filledEllipse(awGradient $gradient, $x1, $y1, $x2, $y2) { if($y1 < $y2) { $y1 ^= $y2 ^= $y1 ^= $y2; } if($x2 < $x1) { $x1 ^= $x2 ^= $x1 ^= $x2; } if($gradient instanceof awRadialGradient) { $this->ellipseRadialGradient($gradient, $x1, $y1, $x2, $y2); } else if($gradient instanceof awLinearGradient) { $this->ellipseLinearGradient($gradient, $x1, $y1, $x2, $y2); } else { trigger_error("This gradient is not supported by ellipses", E_USER_ERROR); } } protected function ellipseRadialGradient(awGradient $gradient, $x1, $y1, $x2, $y2) { if($y1 - $y2 > 0) { if($y1 - $y2 != $x2 - $x1) { trigger_error("Radial gradients are only implemented on circle, not ellipses"); } $c = new awPoint($x1 + ($x2 - $x1) / 2, $y1 + ($y2 - $y1) / 2); $r = ($x2 - $x1) / 2; $ok = array(); // Init gradient $this->init($gradient, $r); for($i = 0; $i <= $r; $i += 0.45) { $p = ceil((2 * M_PI * $i)); if($p > 0) { $interval = 360 / $p; } else { $interval = 360; } $color = $this->color($i); for($j = 0; $j < 360; $j += $interval) { $rad = ($j / 360) * (2 * M_PI); $x = round($i * cos($rad)); $y = round($i * sin($rad)); $l = sqrt($x * $x + $y * $y); if($l <= $r) { if( array_key_exists((int)$x, $ok) === FALSE or array_key_exists((int)$y, $ok[$x]) === FALSE ) { // Print the point $this->drawer->point($color, new awPoint($c->x + $x, $c->y + $y)); $ok[(int)$x][(int)$y] = TRUE; } } } $color->free(); unset($color); } } } protected function ellipseLinearGradient(awGradient $gradient, $x1, $y1, $x2, $y2) { // Gauche->droite : 90° if($y1 - $y2 > 0) { if($y1 - $y2 != $x2 - $x1) { trigger_error("Linear gradients are only implemented on circle, not ellipses"); } $r = ($x2 - $x1) / 2; // Init gradient $this->init($gradient, $x2 - $x1); for($i = -$r; $i <= $r; $i++) { $h = sin(acos($i / $r)) * $r; $color = $this->color($i + $r); if($gradient->angle === 90) { // Print the line $p1 = new awPoint( $x1 + $i + $r, round(max($y2 + $r - $h + 1, $y2)) ); $p2 = new awPoint( $x1 + $i + $r, round(min($y1 - $r + $h - 1, $y1)) ); } else { // Print the line $p1 = new awPoint( round(max($x1 + $r - $h + 1, $x1)), $y2 + $i + $r ); $p2 = new awPoint( round(min($x2 - $r + $h - 1, $x2)), $y2 + $i + $r ); } $this->drawer->filledRectangle($color, new awLine($p1, $p2)); $color->free(); unset($color); } } } protected function polygonLinearGradient(awLinearGradient $gradient, awPolygon $polygon) { $count = $polygon->count(); if($count >= 3) { $left = $polygon->get(0); $right = $polygon->get($count - 1); if($gradient->angle === 0) { // Get polygon maximum and minimum $offset = $polygon->get(0); $max = $min = $offset->y; for($i = 1; $i < $count - 1; $i++) { $offset = $polygon->get($i); $max = max($max, $offset->y); $min = min($min, $offset->y); } $this->init($gradient, $max - $min); $prev = $polygon->get(1); $sum = 0; for($i = 2; $i < $count - 1; $i++) { $current = $polygon->get($i); $interval = 1; if($i !== $count - 2) { $current->x -= $interval; } if($current->x - $prev->x > 0) { // Draw rectangle $x1 = $prev->x; $x2 = $current->x; $y1 = max($prev->y, $current->y); $y2 = $left->y; $gradient = new awLinearGradient( $this->color($max - $min - ($y2 - $y1)), $this->color($max - $min), 0 ); if($y1 > $y2) { $y2 = $y1; } $this->drawer->filledRectangle( $gradient, awLine::build($x1, $y1, $x2, $y2) ); $top = ($prev->y < $current->y) ? $current : $prev; $bottom = ($prev->y >= $current->y) ? $current : $prev; $gradient = new awLinearGradient( $this->color($bottom->y - $min), $this->color($max - $min - ($y2 - $y1)), 0 ); $gradientDrawer = new awGradientDrawer($this->drawer); $gradientDrawer->drawFilledFlatTriangle( $gradient, new awPoint($prev->x, min($prev->y, $current->y)), $top, new awPoint($current->x, min($prev->y, $current->y)) ); unset($gradientDrawer); $sum += $current->x - $prev->x; } $prev = $current; $prev->x += $interval; } } else if($gradient->angle === 90) { $width = $right->x - $left->x; $this->init($gradient, $width); $pos = 1; $next = $polygon->get($pos++); $this->next($polygon, $pos, $prev, $next); for($i = 0; $i <= $width; $i++) { $x = $left->x + $i; $y1 = round($prev->y + ($next->y - $prev->y) * (($i + $left->x - $prev->x) / ($next->x - $prev->x))); $y2 = $left->y; // Draw line $color = $this->color($i); // YaPB : PHP does not handle alpha on lines $this->drawer->filledRectangle($color, awLine::build($x, $y1, $x, $y2)); $color->free(); unset($color); // Jump to next point if($next->x == $i + $left->x) { $this->next($polygon, $pos, $prev, $next); } } } } } private function next($polygon, &$pos, &$prev, &$next) { do { $prev = $next; $next = $polygon->get($pos++); } while($next->x - $prev->x == 0 and $pos < $polygon->count()); } /** * Start colors * * @var int */ private $r1, $g1, $b1, $a1; /** * Stop colors * * @var int */ private $r2, $g2, $b2, $a2; /** * Gradient size in pixels * * @var int */ private $size; private function init(awGradient $gradient, $size) { list( $this->r1, $this->g1, $this->b1, $this->a1 ) = $gradient->from->rgba(); list( $this->r2, $this->g2, $this->b2, $this->a2 ) = $gradient->to->rgba(); $this->size = $size; } private function color($pos) { return new awColor( $this->getRed($pos), $this->getGreen($pos), $this->getBlue($pos), $this->getAlpha($pos) ); } private function getRed($pos) { return (int)round($this->r1 + ($pos / $this->size) * ($this->r2 - $this->r1)); } private function getGreen($pos) { return (int)round($this->g1 + ($pos / $this->size) * ($this->g2 - $this->g1)); } private function getBlue($pos) { return (int)round($this->b1 + ($pos / $this->size) * ($this->b2 - $this->b1)); } private function getAlpha($pos) { return (int)round(($this->a1 + ($pos / $this->size) * ($this->a2 - $this->a1)) / 127 * 100); } } registerClass('GradientDrawer'); ?> pgfouine-1.2/include/reporting/artichow/php5/inc/Border.class.php0000644000175000017500000000514310352052224023515 0ustar acmeacmesetStyle($style); if($color instanceof awColor) { $this->setColor($color); } else { $this->setColor(new awBlack); } } /** * Change border color * This method automatically shows the border if it is hidden * * @param awColor $color */ public function setColor(awColor $color) { $this->color = $color; $this->show(); } /** * Change border style * * @param int $style */ public function setStyle($style) { $this->style = (int)$style; } /** * Hide border ? * * @param bool $hide */ public function hide($hide = TRUE) { $this->hide = (bool)$hide; } /** * Show border ? * * @param bool $show */ public function show($show = TRUE) { $this->hide = (bool)!$show; } /** * Is the border visible ? * * @return bool */ public function visible() { return !$this->hide; } /** * Draw border as a rectangle * * @param awDrawer $drawer * @param awPoint $p1 Top-left corner * @param awPoint $p2 Bottom-right corner */ public function rectangle(awDrawer $drawer, awPoint $p1, awPoint $p2) { // Border is hidden if($this->hide) { return; } $line = new awLine; $line->setStyle($this->style); $line->setLocation($p1, $p2); $drawer->rectangle($this->color, $line); } /** * Draw border as an ellipse * * @param awDrawer $drawer * @param awPoint $center Ellipse center * @param int $width Ellipse width * @param int $height Ellipse height */ public function ellipse(awDrawer $drawer, awPoint $center, $width, $height) { // Border is hidden if($this->hide) { return; } switch($this->style) { case awLine::SOLID : $drawer->ellipse($this->color, $center, $width, $height); break; default : trigger_error("Dashed and dotted borders and not yet implemented on ellipses", E_USER_ERROR); break; } } } registerClass('Border'); ?>pgfouine-1.2/include/reporting/artichow/php5/inc/Math.class.php0000644000175000017500000001664310352052224023200 0ustar acmeacmestyle = (int)$style; } /** * Return shape style * * @return int */ public function getStyle() { return $this->style; } /** * Change shape thickness * * @param int $thickness Shape thickness in pixels */ public function setThickness($thickness) { $this->thickness = (int)$thickness; } /** * Return shape thickness * * @return int */ public function getThickness() { return $this->thickness; } /** * Hide the shape * * @param bool $hide */ public function hide($hide) { $this->hide = (bool)$hide; } /** * Show the shape * * @param bool $shape */ public function show($shape) { $this->hide = (bool)!$shape; } /** * Is the line hidden ? * * @return bool */ public function isHidden() { return $this->hide; } } registerClass('Shape', TRUE); /** * Describe a point * * @package Artichow */ class awPoint extends awShape { /** * X coord * * @var float */ public $x; /** * Y coord * * @var float */ public $y; /** * Build a new awpoint * * @param float $x * @param float $y */ public function __construct($x, $y) { $this->setLocation($x, $y); } /** * Change X value * * @param float $x */ public function setX($x) { $this->x = (float)$x; } /** * Change Y value * * @param float $y */ public function setY($y) { $this->y = (float)$y; } /** * Change point location * * @param float $x * @param float $y */ public function setLocation($x, $y) { $this->setX($x); $this->setY($y); } /** * Get point location * * @param array Point location */ public function getLocation() { return array($this->x, $this->y); } /** * Get distance to another point * * @param awPoint $p A point * @return float */ public function getDistance(awPoint $p) { return sqrt(pow($p->x - $this->x, 2) + pow($p->y - $this->y, 2)); } /** * Move the point to another location * * @param Point A Point with the new awlocation */ public function move($x, $y) { return new awPoint( $this->x + $x, $this->y + $y ); } } registerClass('Point'); /* */ define("LINE_SOLID", 1); define("LINE_DOTTED", 2); define("LINE_DASHED", 3); /* */ /** * Describe a line * * @package Artichow */ class awLine extends awShape { /** * Line first point * * @param Point */ public $p1; /** * Line second point * * @param Point */ public $p2; /** * Build a new awline * * @param awPoint $p1 First point * @param awPoint $p2 Second point * @param int $type Style of line (default to solid) * @param int $thickness Line thickness (default to 1) */ public function __construct($p1 = NULL, $p2 = NULL, $type = awLine::SOLID, $thickness = 1) { $this->setLocation($p1, $p2); $this->setStyle($type); $this->setThickness($thickness); } /** * Build a line from 4 coords * * @param int $x1 Left position * @param int $y1 Top position * @param int $x2 Right position * @param int $y2 Bottom position */ public static function build($x1, $y1, $x2, $y2) { return new awLine( new awPoint($x1, $y1), new awPoint($x2, $y2) ); } /** * Change X values of the line * * @param int $x1 Begin value * @param int $x2 End value */ public function setX($x1, $x2) { $this->p1->setX($x1); $this->p2->setX($x2); } /** * Change Y values of the line * * @param int $y1 Begin value * @param int $y2 End value */ public function setY($y1, $y2) { $this->p1->setY($y1); $this->p2->setY($y2); } /** * Change line location * * @param awPoint $p1 First point * @param awPoint $p2 Second point */ public function setLocation($p1, $p2) { if(is_null($p1) or $p1 instanceof awPoint) { $this->p1 = $p1; } if(is_null($p2) or $p2 instanceof awPoint) { $this->p2 = $p2; } } /** * Get line location * * @param array Line location */ public function getLocation() { return array($this->p1, $this->p2); } /** * Get the line size * * @return float */ public function getSize() { $square = pow($this->p2->x - $this->p1->x, 2) + pow($this->p2->y - $this->p1->y, 2); return sqrt($square); } /** * Test if the line can be considered as a point * * @return bool */ public function isPoint() { return ($this->p1->x === $this->p2->x and $this->p1->y === $this->p2->y); } /** * Test if the line is a vertical line * * @return bool */ public function isVertical() { return ($this->p1->x === $this->p2->x); } /** * Test if the line is an horizontal line * * @return bool */ public function isHorizontal() { return ($this->p1->y === $this->p2->y); } } registerClass('Line'); /** * A vector is a type of line * The sense of the vector goes from $p1 to $p2. * * @package Artichow */ class awVector extends awLine { /** * Get vector angle in radians * * @return float */ public function getAngle() { if($this->isPoint()) { return 0.0; } $size = $this->getSize(); $width = ($this->p2->x - $this->p1->x); $height = ($this->p2->y - $this->p1->y) * -1; if($width >= 0 and $height >= 0) { return acos($width / $size); } else if($width <= 0 and $height >= 0) { return acos($width / $size); } else { $height *= -1; if($width >= 0 and $height >= 0) { return 2 * M_PI - acos($width / $size); } else if($width <= 0 and $height >= 0) { return 2 * M_PI - acos($width / $size); } } } } registerClass('Vector'); /* */ define("POLYGON_SOLID", 1); define("POLYGON_DOTTED", 2); define("POLYGON_DASHED", 3); /* */ /** * Describe a polygon * * @package Artichow */ class awPolygon extends awShape { /** * Polygon points * * @var array */ protected $points = array(); /** * Set a point in the polygon * * @param int $pos Point position * @param awPoint $point */ public function set($pos, $point) { if(is_null($point) or $point instanceof awPoint) { $this->points[$pos] = $point; } } /** * Add a point at the end of the polygon * * @param awPoint $point */ public function append($point) { if(is_null($point) or $point instanceof awPoint) { $this->points[] = $point; } } /** * Get a point at a position in the polygon * * @param int $pos Point position * @return Point */ public function get($pos) { return $this->points[$pos]; } /** * Count number of points in the polygon * * @return int */ public function count() { return count($this->points); } /** * Returns all points in the polygon * * @return array */ public function all() { return $this->points; } } registerClass('Polygon'); ?>pgfouine-1.2/include/reporting/artichow/php5/inc/Legend.class.php0000644000175000017500000003113310352052224023474 0ustar acmeacme */ define("LEGEND_LINE", 1); define("LEGEND_BACKGROUND", 2); define("LEGEND_MARK", 3); define("LEGEND_MARKONLY", 4); define("LEGEND_MODEL_RIGHT", 1); define("LEGEND_MODEL_BOTTOM", 2); define("LEGEND_LEFT", 1); define("LEGEND_RIGHT", 2); define("LEGEND_CENTER", 3); define("LEGEND_TOP", 4); define("LEGEND_BOTTOM", 5); define("LEGEND_MIDDLE", 6); /* */ /** * Some legends * * @package Artichow */ class awLegend implements awPositionable { /** * Legends added * * @var array */ protected $legends = array(); /** * The current component * * @var Component */ protected $component; /** * Background color or gradient * * @var Color, Gradient */ protected $background; /** * Text color * * @var Color */ protected $textColor; /** * Text font * * @var Font */ protected $textFont; /** * Text margin * * @var Side */ protected $textMargin; /** * Number of columns * * @var int */ protected $columns = NULL; /** * Number of rows * * @var int */ protected $rows = NULL; /** * Legend position * * @var Point */ protected $position; /** * Hide legend ? * * @var bool */ protected $hide = FALSE; /** * Space between each legend * * @var int */ protected $space = 4; /** * Horizontal alignment * * @var int */ protected $hAlign; /** * Vertical alignment * * @var int */ protected $vAlign; /** * Margin * * @var array Array for left, right, top and bottom margins */ private $margin; /** * Legend shadow * * @var Shadow */ public $shadow; /** * Legend border * * @var Border */ public $border; /** * Line legend * * @var int */ const LINE = 1; /** * Color/Gradient background legend * * @var int */ const BACKGROUND = 2; /** * Use marks and line as legend * * @var int */ const MARK = 3; /** * Use marks as legend * * @var int */ const MARKONLY = 4; /** * Right side model * * @var int */ const MODEL_RIGHT = 1; /** * Bottom side model * * @var int */ const MODEL_BOTTOM = 2; /** * Build the legend * * @param int $model Legend model */ public function __construct($model = awLegend::MODEL_RIGHT) { $this->shadow = new awShadow(awShadow::LEFT_BOTTOM); $this->border = new awBorder; $this->textMargin = new awSide(4); $this->setModel($model); } /** * Set a predefined model for the legend * * @param int $model */ public function setModel($model) { $this->setBackgroundColor(new awColor(255, 255, 255, 15)); $this->setPadding(8, 8, 8, 8); $this->setTextFont(new awFont2); $this->shadow->setSize(3); switch($model) { case awLegend::MODEL_RIGHT : $this->setColumns(1); $this->setAlign(awLegend::RIGHT, awLegend::MIDDLE); $this->setPosition(0.96, 0.50); break; case awLegend::MODEL_BOTTOM : $this->setRows(1); $this->setAlign(awLegend::CENTER, awLegend::TOP); $this->setPosition(0.50, 0.92); break; default : $this->setPosition(0.5, 0.5); break; } } /** * Hide legend ? * * @param bool $hide TRUE to hide legend, FALSE otherwise */ public function hide($hide = TRUE) { $this->hide = (bool)$hide; } /** * Show legend ? * * @param bool $show */ public function show($show = TRUE) { $this->hide = (bool)!$show; } /** * Add a Legendable object to the legend * * @param awLegendable $legendable * @param string $title Legend title * @param int $type Legend type (default to awLegend::LINE) */ public function add(awLegendable $legendable, $title, $type = awLegend::LINE) { $legend = array($legendable, $title, $type); $this->legends[] = $legend; } /** * Change legend padding * * @param int $left * @param int $right * @param int $top * @param int $bottom */ public function setPadding($left, $right, $top, $bottom) { $this->padding = array((int)$left, (int)$right, (int)$top, (int)$bottom); } /** * Change space between each legend * * @param int $space */ public function setSpace($space) { $this->space = (int)$space; } /** * Change alignment * * @param int $h Horizontal alignment * @param int $v Vertical alignment */ public function setAlign($h = NULL, $v = NULL) { if($h !== NULL) { $this->hAlign = (int)$h; } if($v !== NULL) { $this->vAlign = (int)$v; } } /** * Change number of columns * * @param int $columns */ public function setColumns($columns) { $this->rows = NULL; $this->columns = (int)$columns; } /** * Change number of rows * * @param int $rows */ public function setRows($rows) { $this->columns = NULL; $this->rows = (int)$rows; } /** * Change legend position * X and Y positions must be between 0 and 1. * * @param float $x * @param float $y */ public function setPosition($x = NULL, $y = NULL) { $x = (is_null($x) and !is_null($this->position)) ? $this->position->x : $x; $y = (is_null($y) and !is_null($this->position)) ? $this->position->y : $y; $this->position = new awPoint($x, $y); } /** * Get legend position * * @return Point */ public function getPosition() { return $this->position; } /** * Change text font * * @param awFont $font */ public function setTextFont(awFont $font) { $this->textFont = $font; } /** * Change text margin * * @param int $left * @param int $right */ public function setTextMargin($left, $right) { $this->textMargin->set($left, $right); } /** * Change text color * * @param awColor $color */ public function setTextColor(awColor $color) { $this->textColor = $color; } /** * Change background * * @param mixed $background */ public function setBackground($background) { $this->background = $background; } /** * Change background color * * @param awColor $color */ public function setBackgroundColor(awColor $color) { $this->background = $color; } /** * Change background gradient * * @param awGradient $gradient */ public function setBackgroundGradient(awGradient $gradient) { $this->background = $gradient; } /** * Count the number of Legendable objects in the legend * * @return int */ public function count() { return count($this->legends); } public function draw(awDrawer $drawer) { if($this->hide) { return; } $count = $this->count(); // No legend to print if($count === 0) { return; } // Get text widths and heights of each element of the legend $widths = array(); $heights = array(); $texts = array(); for($i = 0; $i < $count; $i++) { list(, $title, ) = $this->legends[$i]; $text = new awText( $title, $this->textFont, $this->textColor, 0 ); $font = $text->getFont(); $widths[$i] = $font->getTextWidth($text) + $this->textMargin->left + $this->textMargin->right; $heights[$i] = $font->getTextHeight($text); $texts[$i] = $text; } // Maximum height of the font used $heightMax = array_max($heights); // Get number of columns if($this->columns !== NULL) { $columns = $this->columns; } else if($this->rows !== NULL) { $columns = ceil($count / $this->rows); } else { $columns = $count; } // Number of rows $rows = (int)ceil($count / $columns); // Get maximum with of each column $widthMax = array(); for($i = 0; $i < $count; $i++) { // Get column width $column = $i % $columns; if(array_key_exists($column, $widthMax) === FALSE) { $widthMax[$column] = $widths[$i]; } else { $widthMax[$column] = max($widthMax[$column], $widths[$i]); } } $width = $this->padding[0] + $this->padding[1] - $this->space; for($i = 0; $i < $columns; $i++) { $width += $this->space + 5 + 10 + $widthMax[$i]; } $height = ($heightMax + $this->space) * $rows - $this->space + $this->padding[2] + $this->padding[3]; // Look for legends position list($x, $y) = $drawer->getSize(); $p = new awPoint( $this->position->x * $x, $this->position->y * $y ); switch($this->hAlign) { case awLegend::CENTER : $p->x -= $width / 2; break; case awLegend::RIGHT : $p->x -= $width; break; } switch($this->vAlign) { case awLegend::MIDDLE : $p->y -= $height / 2; break; case awLegend::BOTTOM : $p->y -= $height; break; } // Draw legend shadow $this->shadow->draw( $drawer, $p, $p->move($width, $height), awShadow::OUT ); // Draw legends base $this->drawBase($drawer, $p, $width, $height); // Draw each legend for($i = 0; $i < $count; $i++) { list($component, $title, $type) = $this->legends[$i]; $column = $i % $columns; $row = (int)floor($i / $columns); // Get width of all previous columns $previousColumns = 0; for($j = 0; $j < $column; $j++) { $previousColumns += $this->space + 10 + 5 + $widthMax[$j]; } // Draw legend text $drawer->string( $texts[$i], $p->move( $this->padding[0] + $previousColumns + 10 + 5 + $this->textMargin->left, $this->padding[2] + $row * ($heightMax + $this->space) + $heightMax / 2 - $heights[$i] / 2 ) ); // Draw legend icon switch($type) { case awLegend::LINE : case awLegend::MARK : case awLegend::MARKONLY : // Get vertical position $x = $this->padding[0] + $previousColumns; $y = $this->padding[2] + $row * ($heightMax + $this->space) + $heightMax / 2 - $component->getLegendLineThickness(); // Draw two lines if($component->getLegendLineColor() !== NULL) { $color = $component->getLegendLineColor(); if($color instanceof awColor and $type !== awLegend::MARKONLY) { $drawer->line( $color, new awLine( $p->move( $x, // YaPB ?? $y + $component->getLegendLineThickness() / 2 ), $p->move( $x + 10, $y + $component->getLegendLineThickness() / 2 ), $component->getLegendLineStyle(), $component->getLegendLineThickness() ) ); $color->free(); unset($color); } } if($type === awLegend::MARK or $type === awLegend::MARKONLY) { $mark = $component->getLegendMark(); if($mark !== NULL) { $mark->draw( $drawer, $p->move( $x + 5.5, $y + $component->getLegendLineThickness() / 2 ) ); } unset($mark); } break; case awLegend::BACKGROUND : // Get vertical position $x = $this->padding[0] + $previousColumns; $y = $this->padding[2] + $row * ($heightMax + $this->space) + $heightMax / 2 - 5; $from = $p->move( $x, $y ); $to = $p->move( $x + 10, $y + 10 ); $background = $component->getLegendBackground(); if($background !== NULL) { $drawer->filledRectangle( $component->getLegendBackground(), new awLine($from, $to) ); // Draw rectangle border $this->border->rectangle( $drawer, $from->move(0, 0), $to->move(0, 0) ); } unset($background, $from, $to); break; } } } private function drawBase(awDrawer $drawer, awPoint $p, $width, $height) { $this->border->rectangle( $drawer, $p, $p->move($width, $height) ); $size = $this->border->visible() ? 1 : 0; $drawer->filledRectangle( $this->background, new awLine( $p->move($size, $size), $p->move($width - $size, $height - $size) ) ); } } registerClass('Legend'); /** * You can add a legend to components which implements this interface * * @package Artichow */ interface awLegendable { /** * Get the line type * * @return int */ public function getLegendLineStyle(); /** * Get the line thickness * * @return int */ public function getLegendLineThickness(); /** * Get the color of line * * @return Color */ public function getLegendLineColor(); /** * Get the background color or gradient of an element of the component * * @return Color, Gradient */ public function getLegendBackground(); /** * Get a Mark object * * @return Mark */ public function getLegendMark(); } registerInterface('Legendable'); ?>pgfouine-1.2/include/reporting/artichow/php5/inc/Grid.class.php0000644000175000017500000001120710352052224023163 0ustar acmeacmecolor = new awColor(210, 210, 210); $this->background = new awColor(255, 255, 255, 100); } /** * Hide grid ? * * @param bool $hide */ public function hide($hide = TRUE) { $this->hide = (bool)$hide; } /** * Hide horizontal lines ? * * @param bool $hideHorizontal */ public function hideHorizontal($hide = TRUE) { $this->hideHorizontal = (bool)$hide; } /** * Hide vertical lines ? * * @param bool $hideVertical */ public function hideVertical($hide = TRUE) { $this->hideVertical = (bool)$hide; } /** * Change grid color * * @param awColor $color */ public function setColor(awColor $color) { $this->color = $color; } /** * Remove grid background */ public function setNoBackground() { $this->background = NULL; } /** * Change grid background color * * @param awColor $color */ public function setBackgroundColor(awColor $color) { $this->background = $color; } /** * Change line type * * @param int $type */ public function setType($type) { $this->type = (int)$type; } /** * Change grid interval * * @param int $hInterval * @param int $vInterval */ public function setInterval($hInterval, $vInterval) { $this->interval = array((int)$hInterval, (int)$vInterval); } /** * Set grid space * * @param int $left Left space in pixels * @param int $right Right space in pixels * @param int $top Top space in pixels * @param int $bottom Bottom space in pixels */ public function setSpace($left, $right, $top, $bottom) { $this->space = array((int)$left, (int)$right, (int)$top, (int)$bottom); } /** * Change the current grid * * @param array $xgrid Vertical lines * @param array $ygrid Horizontal lines */ public function setGrid($xgrid, $ygrid) { $this->xgrid = $xgrid; $this->ygrid = $ygrid; } /** * Draw grids * * @param awDrawer $drawer A drawer object * @param int $x1 * @param int $y1 * @param int $x2 * @param int $y2 */ public function draw(awDrawer $drawer, $x1, $y1, $x2, $y2) { if($this->background instanceof awColor) { // Draw background color $drawer->filledRectangle( $this->background, awLine::build($x1, $y1, $x2, $y2) ); $this->background->free(); } if($this->hide === FALSE) { $this->drawGrid( $drawer, $this->color, $this->hideVertical ? array() : $this->xgrid, $this->hideHorizontal ? array() : $this->ygrid, $x1, $y1, $x2, $y2, $this->type, $this->space, $this->interval[0], $this->interval[1] ); } $this->color->free(); } private function drawGrid( awDrawer $drawer, awColor $color, $nx, $ny, $x1, $y1, $x2, $y2, $type, $space, $hInterval, $vInterval ) { list($left, $right, $top, $bottom) = $space; $width = $x2 - $x1 - $left - $right; $height = $y2 - $y1 - $top - $bottom; foreach($nx as $key => $n) { if(($key % $vInterval) === 0) { $pos = (int)round($x1 + $left + $n * $width); $drawer->line( $color, new awLine( new awPoint($pos, $y1), new awPoint($pos, $y2), $type ) ); } } foreach($ny as $key => $n) { if(($key % $hInterval) === 0) { $pos = (int)round($y1 + $top + $n * $height); $drawer->line( $color, new awLine( new awPoint($x1, $pos), new awPoint($x2, $pos), $type ) ); } } } } registerClass('Grid'); ?>pgfouine-1.2/include/reporting/artichow/php5/inc/Tools.class.php0000644000175000017500000000472710352052224023407 0ustar acmeacmeset($left, $right, $top, $bottom); } /** * Change side values * * @param mixed $left * @param mixed $right * @param mixed $top * @param mixed $bottom */ public function set($left = NULL, $right = NULL, $top = NULL, $bottom = NULL) { if($left !== NULL) { $this->left = (float)$left; } if($right !== NULL) { $this->right = (float)$right; } if($top !== NULL) { $this->top = (float)$top; } if($bottom !== NULL) { $this->bottom = (float)$bottom; } } /** * Add values to each side * * @param mixed $left * @param mixed $right * @param mixed $top * @param mixed $bottom */ public function add($left = NULL, $right = NULL, $top = NULL, $bottom = NULL) { if($left !== NULL) { $this->left += (float)$left; } if($right !== NULL) { $this->right += (float)$right; } if($top !== NULL) { $this->top += (float)$top; } if($bottom !== NULL) { $this->bottom += (float)$bottom; } } } registerClass('Side'); ?>pgfouine-1.2/include/reporting/artichow/php5/inc/Gradient.class.php0000644000175000017500000000413110352052224024031 0ustar acmeacmefrom = $from; $this->to = $to; } /** * Free memory used by the colors of the gradient */ public function free() { $this->from->free(); $this->to->free(); } public function __destruct( ){ $this->free(); } } registerClass('Gradient', TRUE); /** * Create a linear gradient * * @package Artichow */ class awLinearGradient extends awGradient { /** * Gradient angle * * @var int */ public $angle; /** * Build the linear gradient * * @param awColor $from From color * @param awColor $to To color * @param int $angle Gradient angle */ public function __construct($from, $to, $angle) { parent::__construct( $from, $to ); $this->angle = $angle; } } registerClass('LinearGradient'); /** * Create a bilinear gradient * * @package Artichow */ class awBilinearGradient extends awLinearGradient { /** * Gradient center * * @var int Center between 0 and 1 */ public $center; /** * Build the bilinear gradient * * @param awColor $from From color * @param awColor $to To color * @param int $angle Gradient angle * @param int $center Gradient center */ public function __construct($from, $to, $angle, $center = 0.5) { parent::__construct( $from, $to, $angle ); $this->center = $center; } } registerClass('BilinearGradient'); /** * Create a radial gradient * * @package Artichow */ class awRadialGradient extends awGradient { } registerClass('RadialGradient'); ?> pgfouine-1.2/include/reporting/artichow/php5/AntiSpam.class.php0000644000175000017500000001023410352052222023236 0ustar acmeacmestring = (string)$string; } /** * Create a random string * * @param int $length String length * @return string String created */ public function setRand($length) { $length = (int)$length; $this->string = ''; $letters = 'aAbBCDeEFgGhHJKLmMnNpPqQRsStTuVwWXYZz2345679'; $number = strlen($letters); for($i = 0; $i < $length; $i++) { $this->string .= $letters{mt_rand(0, $number - 1)}; } return $this->string; } /** * Set noise on image * * @param int $nois Noise intensity (from 0 to 10) */ public function setNoise($noise) { if($noise < 0) { $noise = 0; } if($noise > 10) { $noise = 10; } $this->noise = (int)$noise; } /** * Save string value in session * You can use check() to verify the value later * * @param string $qName A name that identify the anti-spam image */ public function save($qName) { $this->session(); $session = 'artichow_'.(string)$qName; $_SESSION[$session] = $this->string; } /** * Verify user entry * * @param string $qName A name that identify the anti-spam image * @param string $value User-defined value * @param bool $case TRUE for case insensitive check, FALSE for case sensitive check ? (default to TRUE) * @return bool TRUE if the value is correct, FALSE otherwise */ public function check($qName, $value, $case = TRUE) { $this->session(); $session = 'artichow_'.(string)$qName; return ( array_key_exists($session, $_SESSION) === TRUE and $case ? (strtolower($_SESSION[$session]) === strtolower((string)$value)) : ($_SESSION[$session] === (string)$value) ); } /** * Draw image */ public function draw() { $fonts = array( ARTICHOW_FONT.DIRECTORY_SEPARATOR.'Tuffy.ttf', ARTICHOW_FONT.DIRECTORY_SEPARATOR.'TuffyBold.ttf', ARTICHOW_FONT.DIRECTORY_SEPARATOR.'TuffyItalic.ttf', ARTICHOW_FONT.DIRECTORY_SEPARATOR.'TuffyBoldItalic.ttf' ); $sizes = array(12, 12.5, 13, 13.5, 14, 15, 16, 17, 18, 19); $widths = array(); $heights = array(); $texts = array(); for($i = 0; $i < strlen($this->string); $i++) { $fontKey = array_rand($fonts); $sizeKey = array_rand($sizes); $font = new awTTFFont( $fonts[$fontKey], $sizes[$sizeKey] ); $text = new awText( $this->string{$i}, $font, NULL, mt_rand(-15, 15) ); $widths[] = $font->getTextWidth($text); $heights[] = $font->getTextHeight($text); $texts[] = $text; } $width = array_sum($widths); $height = array_max($heights); $totalWidth = $width + 10 + count($texts) * 10; $totalHeight = $height + 20; $this->setSize($totalWidth, $totalHeight); $this->create(); for($i = 0; $i < strlen($this->string); $i++) { $this->drawer->string( $texts[$i], new awPoint( 5 + array_sum(array_slice($widths, 0, $i)) + $widths[$i] / 2 + $i * 10, 10 + ($height - $heights[$i]) / 2 ) ); } $this->drawNoise($totalWidth, $totalHeight); $this->send(); } protected function drawNoise($width, $height) { $points = $this->noise * 30; $color = new awColor(0, 0, 0); for($i = 0; $i < $points; $i++) { $this->drawer->point( $color, new awPoint( mt_rand(0, $width), mt_rand(0, $height) ) ); } } protected function session() { // Start session if needed if(!session_id()) { session_start(); } } } registerClass('AntiSpam'); ?> pgfouine-1.2/include/reporting/artichow/php5/common.php0000644000175000017500000000364710352052222021720 0ustar acmeacme 0) { do { $min = array_pop($array); if(is_numeric($min === FALSE)) { $min = NULL; } } while(count($array) > 0 and $min === NULL); if($min !== NULL) { $min = (float)$min; } foreach($array as $value) { if(is_numeric($value) and (float)$value < $min) { $min = (float)$value; } } return $min; } return NULL; } /* * Get the maximum of an array and ignore non numeric values */ function array_max($array) { if(is_array($array) and count($array) > 0) { do { $max = array_pop($array); if(is_numeric($max === FALSE)) { $max = NULL; } } while(count($array) > 0 and $max === NULL); if($max !== NULL) { $max = (float)$max; } foreach($array as $value) { if(is_numeric($value) and (float)$value > $max) { $max = (float)$value; } } return $max; } return NULL; } /* * Register a class with the prefix in configuration file */ function registerClass($class, $abstract = FALSE) { if(ARTICHOW_PREFIX === 'aw') { return; } /* */ if($abstract) { $abstract = 'abstract'; } else { $abstract = ''; } /* */ /* -- $abstract = ''; -- */ eval($abstract." class ".ARTICHOW_PREFIX.$class." extends aw".$class." { }"); } /* * Register an interface with the prefix in configuration file */ function registerInterface($interface) { if(ARTICHOW_PREFIX === 'aw') { return; } /* */ eval("interface ".ARTICHOW_PREFIX.$interface." extends aw".$interface." { }"); /* */ } ?> pgfouine-1.2/include/reporting/artichow/php5/ScatterPlot.class.php0000644000175000017500000001202210352052222023763 0ustar acmeacmemark = new awMark; $this->mark->setType(awMark::CIRCLE); $this->mark->setSize(7); $this->mark->border->show(); $this->label = new awLabel; $this->setValues($datay, $datax); $this->setColor(new awBlack); } /** * Display plot as impulses * * @param awColor $impulse Impulses color (or NULL to disable impulses) */ public function setImpulse($color) { $this->impulse = $color; } /** * Link scatter plot points * * @param bool $link * @param awColor $color Line color (default to black) */ public function link($link, $color = NULL) { $this->link = (bool)$link; if($color instanceof awColor) { $this->setColor($color); } } /** * Ignore null values for Y data and continue linking * * @param bool $link */ public function linkNull($link) { $this->linkNull = (bool)$link; } /** * Change line color * * @param awColor $color */ public function setColor(awColor $color) { $this->lineColor = $color; } /** * Change line style * * @param int $style */ public function setStyle($style) { $this->lineStyle = (int)$style; } /** * Change line tickness * * @param int $tickness */ public function setThickness($tickness) { $this->lineThickness = (int)$tickness; } /** * Get the line thickness * * @return int */ public function getLegendLineThickness() { return $this->lineThickness; } /** * Get the line type * * @return int */ public function getLegendLineStyle() { return $this->lineStyle; } /** * Get the color of line * * @return Color */ public function getLegendLineColor() { return $this->lineColor; } /** * Get the background color or gradient of an element of the component * * @return Color, Gradient */ public function getLegendBackground() { return NULL; } /** * Get a mark object * * @return Mark */ public function getLegendMark() { return $this->mark; } public function drawComponent(awDrawer $drawer, $x1, $y1, $x2, $y2, $aliasing) { $count = count($this->datay); // Get start and stop values list($start, $stop) = $this->getLimit(); // Build the polygon $polygon = new awPolygon; for($key = 0; $key < $count; $key++) { $x = $this->datax[$key]; $y = $this->datay[$key]; if($y !== NULL) { $p = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($x, $y)); $polygon->set($key, $p); } else if($this->linkNull === FALSE) { $polygon->set($key, NULL); } } // Link points if needed if($this->link) { $prev = NULL; foreach($polygon->all() as $point) { if($prev !== NULL and $point !== NULL) { $drawer->line( $this->lineColor, new awLine( $prev, $point, $this->lineStyle, $this->lineThickness ) ); } $prev = $point; } $this->lineColor->free(); } // Draw impulses if($this->impulse instanceof awColor) { foreach($polygon->all() as $key => $point) { if($point !== NULL) { $zero = awAxis::toPosition( $this->xAxis, $this->yAxis, new awPoint($key, 0) ); $drawer->line( $this->impulse, new awLine( $zero, $point, awLine::SOLID, 1 ) ); } } } // Draw marks and labels foreach($polygon->all() as $key => $point) { $this->mark->draw($drawer, $point); $this->label->draw($drawer, $point, $key); } } protected function xAxisPoint($position) { $y = $this->xAxisZero ? 0 : $this->getRealYMin(); return awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($position, $y)); } public function getXCenter() { return FALSE; } } registerClass('ScatterPlot'); ?> pgfouine-1.2/include/reporting/artichow/php5/Component.class.php0000644000175000017500000001701411012376766023507 0ustar acmeacmecomponents = array(); } /** * Add a component to the group * * @param awComponent $component A component */ public function add(awComponent $component) { $this->components[] = $component; } } registerClass('ComponentGroup', TRUE); abstract class awComponent { /** * Component drawer * * @var Drawer */ protected $drawer; /** * Component width * * @var float */ public $width = 1.0; /** * Component height * * @var float */ public $height = 1.0; /** * Position X of the center the graph (from 0 to 1) * * @var float */ public $x = 0.5; /** * Position Y of the center the graph (from 0 to 1) * * @var float */ public $y = 0.5; /** * Component absolute width (in pixels) * * * @var int */ public $w; /** * Component absolute height (in pixels) * * * @var int */ public $h; /** * Left-top corner Y position * * @var float */ public $top; /** * Left-top corner X position * * @var float */ public $left; /** * Component background color * * @var Color */ protected $background; /** * Component padding * * @var Side */ protected $padding; /** * Component space * * @var Side */ protected $space; /** * Component title * * @var Label */ public $title; /** * Adjust automatically the component ? * * @var bool */ protected $auto = TRUE; /** * Legend * * @var Legend */ public $legend; /** * Build the component */ public function __construct() { // Component legend $this->legend = new awLegend(); $this->padding = new awSide(25, 25, 25, 25); $this->space = new awSide(0, 0, 0, 0); // Component title $this->title = new awLabel( NULL, new awDejaVuSans(10), NULL, 0 ); $this->title->setAlign(awLabel::CENTER, awLabel::TOP); } /** * Adjust automatically the component ? * * @param bool $auto */ public function auto($auto) { $this->auto = (bool)$auto; } /** * Change the size of the component * * @param int $width Component width (from 0 to 1) * @param int $height Component height (from 0 to 1) */ public function setSize($width, $height) { $this->width = (float)$width; $this->height = (float)$height; } /** * Change the absolute size of the component * * @param int $w Component width (in pixels) * @param int $h Component height (in pixels) */ public function setAbsSize($w, $h) { $this->w = (int)$w; $this->h = (int)$h; } /** * Change component background color * * @param awColor $color (can be null) */ public function setBackgroundColor($color) { if($color === NULL or $color instanceof awColor) { $this->background = $color; } } /** * Change component background gradient * * @param awGradient $gradient (can be null) */ public function setBackgroundGradient($gradient) { if($gradient === NULL or $gradient instanceof awGradient) { $this->background = $gradient; } } /** * Change component background image * * @param awImage $image (can be null) */ public function setBackgroundImage($image) { if($image === NULL or $image instanceof awImage) { $this->background = $image; } } /** * Return the component background * * @return Color, Gradient */ public function getBackground() { return $this->background; } /** * Change component padding * * @param int $left Padding in pixels (NULL to keep old value) * @param int $right Padding in pixels (NULL to keep old value) * @param int $top Padding in pixels (NULL to keep old value) * @param int $bottom Padding in pixels (NULL to keep old value) */ public function setPadding($left = NULL, $right = NULL, $top = NULL, $bottom = NULL) { $this->padding->set($left, $right, $top, $bottom); } /** * Change component space * * @param float $left Space in % (NULL to keep old value) * @param float $right Space in % (NULL to keep old value) * @param float $bottom Space in % (NULL to keep old value) * @param float $top Space in % (NULL to keep old value) */ public function setSpace($left = NULL, $right = NULL, $bottom = NULL, $top = NULL) { $this->space->set($left, $right, $bottom, $top); } /** * Change the absolute position of the component on the graph * * @var int $x Left-top corner X position * @var int $y Left-top corner Y position */ public function setAbsPosition($left, $top) { $this->left = (int)$left; $this->top = (int)$top; } /** * Set the center of the component * * @param int $x Position on X axis of the center of the component * @param int $y Position on Y axis of the center of the component */ public function setCenter($x, $y) { $this->x = (float)$x; $this->y = (float)$y; } /** * Get component coords with its padding * * @return array Coords of the component */ public function getPosition() { // Get component coords $x1 = $this->padding->left; $y1 = $this->padding->top; $x2 = $this->w - $this->padding->right; $y2 = $this->h - $this->padding->bottom; return array($x1, $y1, $x2, $y2); } /** * Init the drawing of the component */ public function init(awDrawer $drawer) { // Set component background $background = $this->getBackground(); if($background !== NULL) { $p1 = new awPoint(0, 0); $p2 = new awPoint($this->w - 1, $this->h - 1); if($background instanceof awImage) { $drawer->copyImage( $background, $p1, $p2 ); } else { $drawer->filledRectangle( $background, new awLine($p1, $p2) ); } } } /** * Finalize the drawing of the component */ public function finalize(awDrawer $drawer) { // Draw component title $point = new awPoint( $this->w / 2, $this->padding->top - 8 ); $this->title->draw($drawer, $point); // Draw legend $this->legend->draw($drawer); } /** * Draw the grid around your component * * @param Drawer A drawer * @return array Coords for the component */ abstract public function drawEnvelope(awDrawer $drawer); /** * Draw the component on the graph * Component should be drawed into specified coords * * @param Drawer A drawer * @param int $x1 * @param int $y1 * @param int $x2 * @param int $y2 * @param bool $aliasing Use anti-aliasing to draw the component ? */ abstract public function drawComponent(awDrawer $drawer, $x1, $y1, $x2, $y2, $aliasing); /** * Get space width in pixels * * @param int $width Component width * @param int $height Component height * @return array */ protected function getSpace($width, $height) { $left = (int)($width * $this->space->left / 100); $right = (int)($width * $this->space->right / 100); $top = (int)($height * $this->space->top / 100); $bottom = (int)($height * $this->space->bottom / 100); return array($left, $right, $top, $bottom); } } registerClass('Component', TRUE); ?> pgfouine-1.2/include/reporting/artichow/php5/Artichow.class.php0000644000175000017500000001366011012376766023330 0ustar acmeacme */ if(is_file(dirname(__FILE__)."/Artichow.cfg.php")) { // For PHP 4+5 version require_once dirname(__FILE__)."/Artichow.cfg.php"; } /* */ // Some useful files require_once ARTICHOW."/Component.class.php"; require_once ARTICHOW."/Image.class.php"; require_once ARTICHOW."/common.php"; require_once ARTICHOW."/inc/Grid.class.php"; require_once ARTICHOW."/inc/Tools.class.php"; require_once ARTICHOW."/inc/Drawer.class.php"; require_once ARTICHOW."/inc/Math.class.php"; require_once ARTICHOW."/inc/Tick.class.php"; require_once ARTICHOW."/inc/Axis.class.php"; require_once ARTICHOW."/inc/Legend.class.php"; require_once ARTICHOW."/inc/Mark.class.php"; require_once ARTICHOW."/inc/Label.class.php"; require_once ARTICHOW."/inc/Text.class.php"; require_once ARTICHOW."/inc/Color.class.php"; require_once ARTICHOW."/inc/Font.class.php"; require_once ARTICHOW."/inc/Gradient.class.php"; // Catch all errors ob_start(); /** * A graph * * @package Artichow */ class awGraph extends awImage { /** * Graph name * * @var string */ protected $name; /** * Cache timeout * * @var int */ protected $timeout = 0; /** * Graph timing ? * * @var bool */ protected $timing; /** * Components * * @var array */ private $components = array(); /** * Graph title * * @var Label */ public $title; /** * Construct a new awgraph * * @param int $width Graph width * @param int $height Graph height * @param string $name Graph name for the cache (must be unique). Let it null to not use the cache. * @param int $timeout Cache timeout (unix timestamp) */ public function __construct($width = NULL, $height = NULL, $name = NULL, $timeout = 0) { parent::__construct(); $this->setSize($width, $height); if(ARTICHOW_CACHE) { $this->name = $name; $this->timeout = $timeout; // Clean sometimes all the cache if(mt_rand(0, 5000) === 0) { awGraph::cleanCache(); } if($this->name !== NULL) { $file = ARTICHOW."/cache/".$this->name."-time"; if(is_file($file)) { $type = awGraph::cleanGraphCache($file); if($type === NULL) { awGraph::deleteFromCache($this->name); } else { header("Content-Type: image/".$type); readfile(ARTICHOW."/cache/".$this->name.""); exit; } } } } $this->title = new awLabel( NULL, new awDejaVuSans(16), NULL, 0 ); $this->title->setAlign(awLabel::CENTER, awLabel::BOTTOM); } /** * Delete a graph from the cache * * @param string $name Graph name * @return bool TRUE on success, FALSE on failure */ public static function deleteFromCache($name) { if(ARTICHOW_CACHE) { if(is_file(ARTICHOW."/cache/".$name."-time")) { unlink(ARTICHOW."/cache/".$name.""); unlink(ARTICHOW."/cache/".$name."-time"); } } } /** * Delete all graphs from the cache */ public static function deleteAllCache() { if(ARTICHOW_CACHE) { $dp = opendir(ARTICHOW."/cache"); while($file = readdir($dp)) { if($file !== '.' and $file != '..') { unlink(ARTICHOW."/cache/".$file); } } } } /** * Clean cache */ public static function cleanCache() { if(ARTICHOW_CACHE) { $glob = glob(ARTICHOW."/cache/*-time"); foreach($glob as $file) { $type = awGraph::cleanGraphCache($file); if($type === NULL) { $name = ereg_replace(".*/(.*)\-time", "\\1", $file); awGraph::deleteFromCache($name); } } } } /** * Enable/Disable graph timing * * @param bool $timing */ public function setTiming($timing) { $this->timing = (bool)$timing; } /** * Add a component to the graph * * @param awComponent $component */ public function add(awComponent $component) { $this->components[] = $component; } /** * Build the graph and draw component on it * Image is sent to the user browser */ public function draw() { if($this->timing) { $time = microtimeFloat(); } $this->create(); foreach($this->components as $component) { $this->drawComponent($component); } $this->drawTitle(); $this->drawShadow(); if($this->timing) { $this->drawTiming(microtimeFloat() - $time); } $this->send(); if(ARTICHOW_CACHE) { if($this->name !== NULL) { $data = ob_get_contents(); if(is_writable(ARTICHOW."/cache") === FALSE) { trigger_error("Cache directory is not writable"); } $file = ARTICHOW."/cache/".$this->name.""; file_put_contents($file, $data); $file .= "-time"; file_put_contents($file, $this->timeout."\n".$this->getFormat()); } } } private function drawTitle() { $drawer = $this->getDrawer(); $point = new awPoint( $this->width / 2, 10 ); $this->title->draw($drawer, $point); } private function drawTiming($time) { $drawer = $this->getDrawer(); $label = new awLabel; $label->set("(".sprintf("%.3f", $time)." s)"); $label->setAlign(awLabel::LEFT, awLabel::TOP); $label->border->show(); $label->setPadding(1, 0, 0, 0); $label->setBackgroundColor(new awColor(230, 230, 230, 25)); $label->draw($drawer, new awPoint(5, $drawer->height - 5)); } private static function cleanGraphCache($file) { list( $time, $type ) = explode("\n", file_get_contents($file)); $time = (int)$time; if($time !== 0 and $time < time()) { return NULL; } else { return $type; } } } registerClass('Graph'); /* * To preserve PHP 4 compatibility */ function microtimeFloat() { list($usec, $sec) = explode(" ", microtime()); return (float)$usec + (float)$sec; } ?> pgfouine-1.2/include/reporting/artichow/php5/Graph.class.php0000644000175000017500000001574311012376766022615 0ustar acmeacme */ if(is_file(dirname(__FILE__)."/Artichow.cfg.php")) { // For PHP 4+5 version require_once dirname(__FILE__)."/Artichow.cfg.php"; } /* */ // Some useful files require_once ARTICHOW."/common.php"; require_once ARTICHOW."/Component.class.php"; require_once ARTICHOW."/Image.class.php"; require_once ARTICHOW."/inc/Grid.class.php"; require_once ARTICHOW."/inc/Tools.class.php"; require_once ARTICHOW."/inc/Drawer.class.php"; require_once ARTICHOW."/inc/Math.class.php"; require_once ARTICHOW."/inc/Tick.class.php"; require_once ARTICHOW."/inc/Axis.class.php"; require_once ARTICHOW."/inc/Legend.class.php"; require_once ARTICHOW."/inc/Mark.class.php"; require_once ARTICHOW."/inc/Label.class.php"; require_once ARTICHOW."/inc/Text.class.php"; require_once ARTICHOW."/inc/Color.class.php"; require_once ARTICHOW."/inc/Font.class.php"; require_once ARTICHOW."/inc/Gradient.class.php"; // Catch all errors ob_start(); /** * A graph * * @package Artichow */ class awGraph extends awImage { /** * Graph name * * @var string */ protected $name; /** * Cache timeout * * @var int */ protected $timeout = 0; /** * Graph timing ? * * @var bool */ protected $timing; /** * Components * * @var array */ private $components = array(); /** * Some labels to add to the component * * @var array */ protected $labels = array(); /** * Graph title * * @var Label */ public $title; /** * Construct a new graph * * @param int $width Graph width * @param int $height Graph height * @param string $name Graph name for the cache (must be unique). Let it null to not use the cache. * @param int $timeout Cache timeout (unix timestamp) */ public function __construct($width = NULL, $height = NULL, $name = NULL, $timeout = 0) { parent::__construct(); $this->setSize($width, $height); $this->name = $name; $this->timeout = $timeout; // Clean sometimes all the cache if(mt_rand(0, 5000) === 0) { awGraph::cleanCache(); } if($this->name !== NULL) { $file = ARTICHOW."/cache/".$this->name."-time"; if(is_file($file)) { $type = awGraph::cleanGraphCache($file); if($type === NULL) { awGraph::deleteFromCache($this->name); } else { header("Content-Type: image/".$type); readfile(ARTICHOW."/cache/".$this->name.""); exit; } } } $this->title = new awLabel( NULL, new awDejaVuSans(16), NULL, 0 ); $this->title->setAlign(awLabel::CENTER, awLabel::BOTTOM); } /** * Delete a graph from the cache * * @param string $name Graph name * @return bool TRUE on success, FALSE on failure */ public static function deleteFromCache($name) { if(is_file(ARTICHOW."/cache/".$name."-time")) { unlink(ARTICHOW."/cache/".$name.""); unlink(ARTICHOW."/cache/".$name."-time"); } } /** * Delete all graphs from the cache */ public static function deleteAllCache() { $dp = opendir(ARTICHOW."/cache"); while($file = readdir($dp)) { if($file !== '.' and $file != '..') { unlink(ARTICHOW."/cache/".$file); } } } /** * Clean cache */ public static function cleanCache() { $glob = glob(ARTICHOW."/cache/*-time"); foreach($glob as $file) { $type = awGraph::cleanGraphCache($file); if($type === NULL) { $name = ereg_replace(".*/(.*)\-time", "\\1", $file); awGraph::deleteFromCache($name); } } } /** * Enable/Disable Graph timing * * @param bool $timing */ public function setTiming($timing) { $this->timing = (bool)$timing; } /** * Add a component to the graph * * @param awComponent $component */ public function add(awComponent $component) { $this->components[] = $component; } /** * Add a label to the component * * @param awLabel $label * @param int $x Position on X axis of the center of the text * @param int $y Position on Y axis of the center of the text */ public function addLabel(awLabel $label, $x, $y) { $this->labels[] = array( $label, $x, $y ); } /** * Add a label to the component with aboslute position * * @param awLabel $label * @param awPoint $point Text position */ public function addAbsLabel(awLabel $label, awPoint $point) { $this->labels[] = array( $label, $point ); } /** * Build the graph and draw component on it * Image is sent to the user browser * * @param string $file Save the image in the specified file. Let it null to print image to screen. */ public function draw($file = NULL) { if($this->timing) { $time = microtimeFloat(); } $this->create(); foreach($this->components as $component) { $this->drawComponent($component); } $this->drawTitle(); $this->drawShadow(); $this->drawLabels(); if($this->timing) { $this->drawTiming(microtimeFloat() - $time); } $this->send($file); if($file === NULL) { $data = ob_get_contents(); if($this->name !== NULL) { if(is_writable(ARTICHOW."/cache") === FALSE) { trigger_error("Cache directory is not writable"); } $file = ARTICHOW."/cache/".$this->name.""; file_put_contents($file, $data); $file .= "-time"; file_put_contents($file, $this->timeout."\n".$this->getFormat()); } } } private function drawLabels() { $drawer = $this->getDrawer(); foreach($this->labels as $array) { if(count($array) === 3) { // Text in relative position list($label, $x, $y) = $array; $point = new awPoint( $x * $this->width, $y * $this->height ); } else { // Text in absolute position list($label, $point) = $array; } $label->draw($drawer, $point); } } private function drawTitle() { $drawer = $this->getDrawer(); $point = new awPoint( $this->width / 2, 10 ); $this->title->draw($drawer, $point); } private function drawTiming($time) { $drawer = $this->getDrawer(); $label = new awLabel; $label->set("(".sprintf("%.3f", $time)." s)"); $label->setAlign(awLabel::LEFT, awLabel::TOP); $label->border->show(); $label->setPadding(1, 0, 0, 0); $label->setBackgroundColor(new awColor(230, 230, 230, 25)); $label->draw($drawer, new awPoint(5, $drawer->height - 5)); } private static function cleanGraphCache($file) { list( $time, $type ) = explode("\n", file_get_contents($file)); $time = (int)$time; if($time !== 0 and $time < time()) { return NULL; } else { return $type; } } } registerClass('Graph'); /* * To preserve PHP 4 compatibility */ function microtimeFloat() { list($usec, $sec) = explode(" ", microtime()); return (float)$usec + (float)$sec; } ?> pgfouine-1.2/include/reporting/artichow/AntiSpam.class.php0000644000175000017500000000015110352052224022361 0ustar acmeacmepgfouine-1.2/include/reporting/artichow/ScatterPlot.class.php0000644000175000017500000000015410352052224023114 0ustar acmeacmepgfouine-1.2/include/reporting/artichow/patterns/0000755000175000017500000000000011516212335020677 5ustar acmeacmepgfouine-1.2/include/reporting/artichow/patterns/BarDepth.php0000644000175000017500000000417010352052225023100 0ustar acmeacmebarShadow->setSize(2); $plot->barShadow->smooth(TRUE); $plot->barShadow->setColor(new Color(160, 160, 160, 10)); return $plot; } function create() { $group = new PlotGroup; $group->setSpace(2, 2, 2, 0); $group->setPadding(30, 10, NULL, NULL); $group->grid->hideVertical(TRUE); $group->grid->setType(LINE_DASHED); $yForeground = $this->getArg('yForeground'); $yBackground = $this->getArg('yBackground'); $legendForeground = $this->getArg('legendForeground'); $legendBackground = $this->getArg('legendBackground'); $colorForeground = $this->getArg('colorForeground', new LightBlue(10)); $colorBackground = $this->getArg('colorBackground', new Orange(25)); if($yForeground === NULL) { trigger_error("Argument 'yForeground' must not be NULL", E_USER_ERROR); } // Background if($yBackground !== NULL) { $plot = $this->getPlot($yBackground, 6); $plot->setBarColor($colorBackground); $group->add($plot); if($legendBackground !== NULL) { $group->legend->add($plot, $legendBackground, LEGEND_BACKGROUND); } } // Foreground $plot = $this->getPlot($yForeground, 0); $plot->setBarColor($colorForeground); $group->add($plot); if($legendForeground !== NULL) { $group->legend->add($plot, $legendForeground, LEGEND_BACKGROUND); } $group->axis->bottom->hideTicks(TRUE); $group->legend->shadow->setSize(0); $group->legend->setAlign(LEGEND_CENTER); $group->legend->setSpace(6); $group->legend->setTextFont(new Tuffy(8)); $group->legend->setPosition(0.50, 0.10); $group->legend->setBackgroundColor(new Color(255, 255, 255, 10)); $group->legend->setColumns(2); return $group; } } ?>pgfouine-1.2/include/reporting/artichow/patterns/LightLine.php0000644000175000017500000000215110352052225023263 0ustar acmeacmegetArg('legend'); $y = $this->getArg('y'); if($y === NULL) { trigger_error("Argument 'y' must not be NULL", E_USER_ERROR); } $plot = new LinePlot($y); $plot->setSize(0.7, 1); $plot->setCenter(0.35, 0.5); $plot->setPadding(35, 15, 35, 30); $plot->setColor(new Orange()); $plot->setFillColor(new LightOrange(80)); $plot->grid->setType(LINE_DASHED); $plot->mark->setType(MARK_CIRCLE); $plot->mark->setFill(new MidRed); $plot->mark->setSize(6); $plot->legend->setPosition(1, 0.5); $plot->legend->setAlign(LEGEND_LEFT); $plot->legend->shadow->smooth(TRUE); if($legend !== NULL) { $plot->legend->add($plot, $legend, LEGEND_MARK); } return $plot; } } ?>pgfouine-1.2/include/reporting/artichow/Graph.class.php0000644000175000017500000000014610352052224021712 0ustar acmeacmepgfouine-1.2/include/reporting/ReportAggregator.class.php0000644000175000017500000001126411244576733022333 0ustar acmeacmelogReader =& $logReader; $this->outputFilePath = $outputFilePath; } function addReportBlock($reportBlockName) { $reportBlock = new $reportBlockName($this); $this->reportBlocks[] =& $reportBlock; } function & getListener($listenerName) { return $this->logReader->getListener($listenerName); } function getOutput() { $output = ''; $output .= $this->getHeader(); $output .= $this->getBody(); $output .= $this->getFooter(); return $output; } function output() { if($this->outputFilePath) { $outputFilePointer = @fopen($this->outputFilePath, 'w'); if($outputFilePointer) { fwrite($outputFilePointer, $this->getOutput()); fclose($outputFilePointer); } else { stderr('cannot open file '.$this->outputFilePath.' for writing'); } } else { echo $this->getOutput(); } } function getNeeds() { $needs = array(); $count = count($this->reportBlocks); for($i = 0; $i < $count; $i++) { $needs = array_merge($needs, $this->reportBlocks[$i]->getNeeds()); } $needs = array_unique($needs); return $needs; } function getFileName() { return $this->logReader->getFileName(); } function getTimeToParse() { return $this->logReader->getTimeToParse(); } function getLineParsedCount() { return $this->logReader->getLineParsedCount(); } function getFirstLineTimestamp() { return $this->logReader->getFirstLineTimestamp(); } function getLastLineTimestamp() { return $this->logReader->getLastLineTimestamp(); } function pad($string, $length) { return str_pad($string, $length, ' ', STR_PAD_LEFT); } function getPercentage($number, $total) { if($total > 0) { $percentage = $number*100/$total; } else { $percentage = 0; } return $this->pad(number_format($percentage, 1), 5); } function formatInteger($integer) { return number_format($integer); } function formatTimestamp($timestamp) { return formatTimestamp($timestamp); } function getDurationForUnit($duration) { if(CONFIG_DURATION_UNIT == 'ms') { $duration = $duration * 1000; } return $duration; } function formatDuration($duration, $decimals = 2, $decimalPoint = '.', $thousandSeparator = ',') { if(CONFIG_DURATION_UNIT == 'ms') { $duration = $duration * 1000; } return number_format($duration, $decimals, $decimalPoint, $thousandSeparator); } function formatLongDuration($duration, $decimals = 1) { $formattedDuration = ''; if($duration > 60) { $duration = intval($duration); if($duration > 3600) { $formattedDuration .= intval($duration/3600).'h'; $duration = $duration % 3600; } if($duration > 59) { $minutes = intval($duration/60); if(!empty($formattedDuration)) { $minutes = str_pad($minutes, 2, '0', STR_PAD_LEFT); } $formattedDuration .= $minutes.'m'; $duration = $duration % 60; } if($duration > 0) { $formattedDuration .= intval($duration).'s'; } } elseif($duration < 0.1 && CONFIG_DURATION_UNIT == 'ms') { $formattedDuration = round($duration * 1000).'ms'; } else { $formattedDuration = $this->formatDuration($duration, $decimals).'s'; } return $formattedDuration; } function shortenQueryText($queryText) { if(CONFIG_MAX_QUERY_LENGTH > 0 && strlen($queryText) > CONFIG_MAX_QUERY_LENGTH) { return substr($queryText, 0, CONFIG_MAX_QUERY_LENGTH).'...'; } else { return $queryText; } } function formatRealQuery($query, $prepend = '', $append = '') { return $prepend.$this->shortenQueryText($query->getText()).$append; } function containsReportBlock($reportBlockName) { $count = count($this->reportBlocks); for($i = 0; $i < $count; $i++) { if(is_a($this->reportBlocks[$i], $reportBlockName)) { return true; } } return false; } } ?>pgfouine-1.2/include/reporting/HtmlWithGraphsReportAggregator.class.php0000644000175000017500000000350410764774374025166 0ustar acmeacmeHtmlReportAggregator($logReader, $outputFilePath); } function getHtmlOutput(& $reportBlock) { if(method_exists($reportBlock, 'getHtmlWithGraphs')) { $html = $reportBlock->getHtmlWithGraphs(); } else { $html = $reportBlock->getHtml(); } return $html; } function getImagePath($imageName) { $directory = dirname($this->outputFilePath); $imagePath = $directory.'/'.$this->getImageBaseName($imageName); return $imagePath; } function getImageBaseName($imageName) { $fileName = basename($this->outputFilePath); if(strpos($fileName, '.') > 0) { $baseName = substr($fileName, 0, strrpos($fileName, '.')); } else { $baseName = $fileName; } $imageBaseName = $baseName.'_'.$imageName.'.png'; return $imageBaseName; } } ?>pgfouine-1.2/include/reporting/web/0000755000175000017500000000000011516212335015774 5ustar acmeacmepgfouine-1.2/include/reporting/web/css/0000755000175000017500000000000011516212335016564 5ustar acmeacmepgfouine-1.2/include/reporting/web/css/common.css0000644000175000017500000001207110466463563020605 0ustar acmeacmebody { background-color: #FFFFFF; } * { font-family: Verdana, Arial, Helvetica; } div, p, th, td { font-size:12px; } a {color:rgb(180, 80, 80);text-decoration:underline} a:hover {color:rgb(180, 80, 80);text-decoration:none} h1 { font-size:16px; color:#FFFFFF; font-weight:normal; padding:6px; background-color:rgb(180, 80, 80); margin-bottom:0px; } h2 { margin-top:15px; margin-bottom:10px; font-weight:normal; font-size:14px; padding:2px 10px 2px 0px; border-bottom:1px solid #7B8CBE; color:#7B8CBE; } h2 a, h2 a:hover { color:black; text-decoration:none; } h3 { color:#FFB462; border-bottom:1px solid #FFB462; font-weight:bold; font-size:12px; margin-bottom:10px; padding-bottom:2px; } div.menu { background-color:rgb(220,230,252); padding:4px; margin-bottom:20px; } div.menu a { padding-right:3px; padding-left:3px; color:black; text-decoration:none; } div.menu a:hover { padding-right:3px; padding-left:3px; padding-top:2px; padding-bottom:2px; text-decoration:none; background-color:rgb(180, 80, 80); color:white; -moz-border-radius:3px; } div.information { border:1px solid #FFB462; -moz-border-radius:6px; padding:10px; margin-top:5px; background-color:#FEE3C4; } .tip { background-color:#EBF0FC; -moz-border-radius:10px; padding:6px; margin:5px; } ul { padding-left: 14px; padding-top: 0px; padding-bottom: 0px; margin-bottom: 0px; margin-top: 0px; } ul li { list-style-type: square; } div.reports { padding:4px; } table.queryList td, table.queryList th { padding: 2px; } table.queryList th { background-color: #DDDDDD; border:1px solid #CCCCCC; } table.queryList th.left { text-align:left !important; } table.queryList tr.row0 td { background-color: #FFFFFF; border: 1px solid #EEEEEE; } table.queryList tr.row1 td { background-color: #EEEEEE; border: 1px solid #EEEEEE; } table.queryList td.top { vertical-align:top; } table.queryList td.right { text-align:right; } table.queryList td.center { text-align:center; } table.queryList td.relevantInformation { font-weight:bold; } table.queryList div.examples { background-color:#EBF0FC; border:1px solid #FFFFFF; -moz-border-radius:10px; padding:6px; margin:5px; } table.queryList div.examples div.example0 { padding:2px; } table.queryList div.examples div.example1 { background-color:#FFFFFF; padding:2px; border:1px solid #EBF0FC; -moz-border-radius:5px; } .normal { color: green; font-weight:bold; } .warning { color: orange; font-weight:bold; } .fatal { color: red; font-weight:bold; font-style:italic; } div.tooltipLink { position:relative; cursor:pointer; } div.tooltipLink span.information { border-bottom:1px dotted gray; z-index:10; } div.tooltipLink div.tooltip { display:none; background-color:#EBF0FC; border:1px solid #FFFFFF; -moz-border-radius:10px; padding:6px; width:250px; } div.tooltipLink div.tooltip table { background-color:white; width:250px; } div.tooltipLink div.tooltip table tr.row0 td { background-color: #FFFFFF; border: 1px solid #EEEEEE; } div.tooltipLink div.tooltip table tr.row1 td { background-color: #EEEEEE; border: 1px solid #EEEEEE; } div.tooltipLink div.tooltip th { font-size:10px; } div.tooltipLink div.tooltip td { font-size:9px; font-weight:normal; padding:1px; } div.tooltipLink:hover div.tooltip { display:block; z-index:20; position:absolute; top:1.5em; left:2em; } table.queryList div.queryNotice { color: #8D8D8D; font-style:italic; } table.queryList div.error { color: #D53131; font-weight:bold; } table.queryList div.errorInformation { color: #8D8D8D; font-style:italic; } table.queryList input { border:1px solid black; background-color:#FFFFFF; padding:1px; font-size:11px; } table.sortable a.sortheader { color: black; text-decoration: none; } table.sortable a.sortheader:hover { color: rgb(180, 80, 80); } table.sortable span.sortarrow { color: black; text-decoration: none; font-weight:bold; } .indexInformation { background-color:#EBF0FC; -moz-border-radius:10px; padding-left:20px; padding-right:20px; padding-top:10px; padding-bottom:10px; margin:5px; } .indexInformation table.queryList { margin-top:10px; } div.footer { font-size:12px; margin-top:30px; margin-bottom:400px; background-color:rgb(180, 80, 80); padding:5px; text-align:right; color:white; } div.footer a, div.footer a:hover { color:white; text-decoration:underline; } div#littleToc { display:none; } html>body div#littleToc { display:block; background-color:white; color:black; position:fixed; bottom:10px; right:10px; width:160px; font-size:11px; text-align:left; border:1px dotted #BBBBBB; } div#littleToc div#littleTocContent { display:none; padding:2px; } div#littleToc:hover { width:205px; } div#littleToc:hover div#littleTocContent { display:block; border-right:5px solid #BBBBBB; } div#littleToc div#littleTocTitle { font-weight:bold; text-align:center;padding:2px; } div#littleToc:hover div#littleTocTitle { display:none; } div#littleToc ul { padding:0px; text-indent:0px; margin:0px; } div#littleToc li { font-size:11px; list-style-type:none; padding:0px; text-indent:0px; margin:0px; } div#littleToc a { color:#000000; padding:2px; margin:2px; display:block; text-decoration:none; border:1px solid #CCCCCC; } div#littleToc a:hover { text-decoration:none; background-color:#DDDDDD; }pgfouine-1.2/include/reporting/web/js/0000755000175000017500000000000011516212335016410 5ustar acmeacmepgfouine-1.2/include/reporting/web/js/sorttable.js0000644000175000017500000001470310460105203020742 0ustar acmeacmeaddEvent(window, "load", sortables_init); var SORT_COLUMN_INDEX; function sortables_init() { // Find all tables with class sortable and make them sortable if (!document.getElementsByTagName) return; tbls = document.getElementsByTagName("table"); for (ti=0;ti 0) { var firstRow = table.rows[0]; } if (!firstRow) return; // We have a first row: assume it's the header, and make its contents clickable links for (var i=0;i' + txt+'   '; } } function ts_getInnerText(el) { if (typeof el == "string") return el; if (typeof el == "undefined") { return el }; if (el.innerText) return el.innerText; //Not needed but it is faster var str = ""; var cs = el.childNodes; var l = cs.length; for (var i = 0; i < l; i++) { switch (cs[i].nodeType) { case 1: //ELEMENT_NODE str += ts_getInnerText(cs[i]); break; case 3: //TEXT_NODE str += cs[i].nodeValue; break; } } return str; } function ts_resortTable(lnk,clid) { // get the span var span; for (var ci=0;cipgfouine-1.2/include/reporting/geshi/0000755000175000017500000000000011516212335016316 5ustar acmeacmepgfouine-1.2/include/reporting/geshi/geshi.php0000644000175000017500000060275311172452234020145 0ustar acmeacme, Benny Baumann * @copyright (C) 2004 - 2007 Nigel McNie, (C) 2007 - 2008 Benny Baumann * @license http://gnu.org/copyleft/gpl.html GNU GPL * */ // // GeSHi Constants // You should use these constant names in your programs instead of // their values - you never know when a value may change in a future // version // /** The version of this GeSHi file */ define('GESHI_VERSION', '1.0.8.3'); // Define the root directory for the GeSHi code tree if (!defined('GESHI_ROOT')) { /** The root directory for GeSHi */ define('GESHI_ROOT', dirname(__FILE__) . DIRECTORY_SEPARATOR); } /** The language file directory for GeSHi @access private */ define('GESHI_LANG_ROOT', GESHI_ROOT . 'geshi' . DIRECTORY_SEPARATOR); // Define if GeSHi should be paranoid about security if (!defined('GESHI_SECURITY_PARANOID')) { /** Tells GeSHi to be paranoid about security settings */ define('GESHI_SECURITY_PARANOID', false); } // Line numbers - use with enable_line_numbers() /** Use no line numbers when building the result */ define('GESHI_NO_LINE_NUMBERS', 0); /** Use normal line numbers when building the result */ define('GESHI_NORMAL_LINE_NUMBERS', 1); /** Use fancy line numbers when building the result */ define('GESHI_FANCY_LINE_NUMBERS', 2); // Container HTML type /** Use nothing to surround the source */ define('GESHI_HEADER_NONE', 0); /** Use a "div" to surround the source */ define('GESHI_HEADER_DIV', 1); /** Use a "pre" to surround the source */ define('GESHI_HEADER_PRE', 2); /** Use a pre to wrap lines when line numbers are enabled or to wrap the whole code. */ define('GESHI_HEADER_PRE_VALID', 3); /** * Use a "table" to surround the source: * * * * * *
$header
$linenumbers
$code>
$footer
* * this is essentially only a workaround for Firefox, see sf#1651996 or take a look at * https://bugzilla.mozilla.org/show_bug.cgi?id=365805 * @note when linenumbers are disabled this is essentially the same as GESHI_HEADER_PRE */ define('GESHI_HEADER_PRE_TABLE', 4); // Capatalisation constants /** Lowercase keywords found */ define('GESHI_CAPS_NO_CHANGE', 0); /** Uppercase keywords found */ define('GESHI_CAPS_UPPER', 1); /** Leave keywords found as the case that they are */ define('GESHI_CAPS_LOWER', 2); // Link style constants /** Links in the source in the :link state */ define('GESHI_LINK', 0); /** Links in the source in the :hover state */ define('GESHI_HOVER', 1); /** Links in the source in the :active state */ define('GESHI_ACTIVE', 2); /** Links in the source in the :visited state */ define('GESHI_VISITED', 3); // Important string starter/finisher // Note that if you change these, they should be as-is: i.e., don't // write them as if they had been run through htmlentities() /** The starter for important parts of the source */ define('GESHI_START_IMPORTANT', ''); /** The ender for important parts of the source */ define('GESHI_END_IMPORTANT', ''); /**#@+ * @access private */ // When strict mode applies for a language /** Strict mode never applies (this is the most common) */ define('GESHI_NEVER', 0); /** Strict mode *might* apply, and can be enabled or disabled by {@link GeSHi->enable_strict_mode()} */ define('GESHI_MAYBE', 1); /** Strict mode always applies */ define('GESHI_ALWAYS', 2); // Advanced regexp handling constants, used in language files /** The key of the regex array defining what to search for */ define('GESHI_SEARCH', 0); /** The key of the regex array defining what bracket group in a matched search to use as a replacement */ define('GESHI_REPLACE', 1); /** The key of the regex array defining any modifiers to the regular expression */ define('GESHI_MODIFIERS', 2); /** The key of the regex array defining what bracket group in a matched search to put before the replacement */ define('GESHI_BEFORE', 3); /** The key of the regex array defining what bracket group in a matched search to put after the replacement */ define('GESHI_AFTER', 4); /** The key of the regex array defining a custom keyword to use for this regexp's html tag class */ define('GESHI_CLASS', 5); /** Used in language files to mark comments */ define('GESHI_COMMENTS', 0); /** Used to work around missing PHP features **/ define('GESHI_PHP_PRE_433', !(version_compare(PHP_VERSION, '4.3.3') === 1)); /** make sure we can call stripos **/ if (!function_exists('stripos')) { // the offset param of preg_match is not supported below PHP 4.3.3 if (GESHI_PHP_PRE_433) { /** * @ignore */ function stripos($haystack, $needle, $offset = null) { if (!is_null($offset)) { $haystack = substr($haystack, $offset); } if (preg_match('/'. preg_quote($needle, '/') . '/', $haystack, $match, PREG_OFFSET_CAPTURE)) { return $match[0][1]; } return false; } } else { /** * @ignore */ function stripos($haystack, $needle, $offset = null) { if (preg_match('/'. preg_quote($needle, '/') . '/', $haystack, $match, PREG_OFFSET_CAPTURE, $offset)) { return $match[0][1]; } return false; } } } /** some old PHP / PCRE subpatterns only support up to xxx subpatterns in regular expressions. Set this to false if your PCRE lib is up to date @see GeSHi->optimize_regexp_list() **/ define('GESHI_MAX_PCRE_SUBPATTERNS', 500); /** it's also important not to generate too long regular expressions be generous here... but keep in mind, that when reaching this limit we still have to close open patterns. 12k should do just fine on a 16k limit. @see GeSHi->optimize_regexp_list() **/ define('GESHI_MAX_PCRE_LENGTH', 12288); //Number format specification /** Basic number format for integers */ define('GESHI_NUMBER_INT_BASIC', 1); //Default integers \d+ /** Enhanced number format for integers like seen in C */ define('GESHI_NUMBER_INT_CSTYLE', 2); //Default C-Style \d+[lL]? /** Number format to highlight binary numbers with a suffix "b" */ define('GESHI_NUMBER_BIN_SUFFIX', 16); //[01]+[bB] /** Number format to highlight binary numbers with a prefix % */ define('GESHI_NUMBER_BIN_PREFIX_PERCENT', 32); //%[01]+ /** Number format to highlight binary numbers with a prefix 0b (C) */ define('GESHI_NUMBER_BIN_PREFIX_0B', 64); //0b[01]+ /** Number format to highlight octal numbers with a leading zero */ define('GESHI_NUMBER_OCT_PREFIX', 256); //0[0-7]+ /** Number format to highlight octal numbers with a suffix of o */ define('GESHI_NUMBER_OCT_SUFFIX', 512); //[0-7]+[oO] /** Number format to highlight hex numbers with a prefix 0x */ define('GESHI_NUMBER_HEX_PREFIX', 4096); //0x[0-9a-fA-F]+ /** Number format to highlight hex numbers with a suffix of h */ define('GESHI_NUMBER_HEX_SUFFIX', 8192); //[0-9][0-9a-fA-F]*h /** Number format to highlight floating-point numbers without support for scientific notation */ define('GESHI_NUMBER_FLT_NONSCI', 65536); //\d+\.\d+ /** Number format to highlight floating-point numbers without support for scientific notation */ define('GESHI_NUMBER_FLT_NONSCI_F', 131072); //\d+(\.\d+)?f /** Number format to highlight floating-point numbers with support for scientific notation (E) and optional leading zero */ define('GESHI_NUMBER_FLT_SCI_SHORT', 262144); //\.\d+e\d+ /** Number format to highlight floating-point numbers with support for scientific notation (E) and required leading digit */ define('GESHI_NUMBER_FLT_SCI_ZERO', 524288); //\d+(\.\d+)?e\d+ //Custom formats are passed by RX array // Error detection - use these to analyse faults /** No sourcecode to highlight was specified * @deprecated */ define('GESHI_ERROR_NO_INPUT', 1); /** The language specified does not exist */ define('GESHI_ERROR_NO_SUCH_LANG', 2); /** GeSHi could not open a file for reading (generally a language file) */ define('GESHI_ERROR_FILE_NOT_READABLE', 3); /** The header type passed to {@link GeSHi->set_header_type()} was invalid */ define('GESHI_ERROR_INVALID_HEADER_TYPE', 4); /** The line number type passed to {@link GeSHi->enable_line_numbers()} was invalid */ define('GESHI_ERROR_INVALID_LINE_NUMBER_TYPE', 5); /**#@-*/ /** * The GeSHi Class. * * Please refer to the documentation for GeSHi 1.0.X that is available * at http://qbnz.com/highlighter/documentation.php for more information * about how to use this class. * * @package geshi * @author Nigel McNie , Benny Baumann * @copyright (C) 2004 - 2007 Nigel McNie, (C) 2007 - 2008 Benny Baumann */ class GeSHi { /**#@+ * @access private */ /** * The source code to highlight * @var string */ var $source = ''; /** * The language to use when highlighting * @var string */ var $language = ''; /** * The data for the language used * @var array */ var $language_data = array(); /** * The path to the language files * @var string */ var $language_path = GESHI_LANG_ROOT; /** * The error message associated with an error * @var string * @todo check err reporting works */ var $error = false; /** * Possible error messages * @var array */ var $error_messages = array( GESHI_ERROR_NO_SUCH_LANG => 'GeSHi could not find the language {LANGUAGE} (using path {PATH})', GESHI_ERROR_FILE_NOT_READABLE => 'The file specified for load_from_file was not readable', GESHI_ERROR_INVALID_HEADER_TYPE => 'The header type specified is invalid', GESHI_ERROR_INVALID_LINE_NUMBER_TYPE => 'The line number type specified is invalid' ); /** * Whether highlighting is strict or not * @var boolean */ var $strict_mode = false; /** * Whether to use CSS classes in output * @var boolean */ var $use_classes = false; /** * The type of header to use. Can be one of the following * values: * * - GESHI_HEADER_PRE: Source is outputted in a "pre" HTML element. * - GESHI_HEADER_DIV: Source is outputted in a "div" HTML element. * - GESHI_HEADER_NONE: No header is outputted. * * @var int */ var $header_type = GESHI_HEADER_PRE; /** * Array of permissions for which lexics should be highlighted * @var array */ var $lexic_permissions = array( 'KEYWORDS' => array(), 'COMMENTS' => array('MULTI' => true), 'REGEXPS' => array(), 'ESCAPE_CHAR' => true, 'BRACKETS' => true, 'SYMBOLS' => false, 'STRINGS' => true, 'NUMBERS' => true, 'METHODS' => true, 'SCRIPT' => true ); /** * The time it took to parse the code * @var double */ var $time = 0; /** * The content of the header block * @var string */ var $header_content = ''; /** * The content of the footer block * @var string */ var $footer_content = ''; /** * The style of the header block * @var string */ var $header_content_style = ''; /** * The style of the footer block * @var string */ var $footer_content_style = ''; /** * Tells if a block around the highlighted source should be forced * if not using line numbering * @var boolean */ var $force_code_block = false; /** * The styles for hyperlinks in the code * @var array */ var $link_styles = array(); /** * Whether important blocks should be recognised or not * @var boolean * @deprecated * @todo REMOVE THIS FUNCTIONALITY! */ var $enable_important_blocks = false; /** * Styles for important parts of the code * @var string * @deprecated * @todo As above - rethink the whole idea of important blocks as it is buggy and * will be hard to implement in 1.2 */ var $important_styles = 'font-weight: bold; color: red;'; // Styles for important parts of the code /** * Whether CSS IDs should be added to the code * @var boolean */ var $add_ids = false; /** * Lines that should be highlighted extra * @var array */ var $highlight_extra_lines = array(); /** * Styles of lines that should be highlighted extra * @var array */ var $highlight_extra_lines_styles = array(); /** * Styles of extra-highlighted lines * @var string */ var $highlight_extra_lines_style = 'background-color: #ffc;'; /** * The line ending * If null, nl2br() will be used on the result string. * Otherwise, all instances of \n will be replaced with $line_ending * @var string */ var $line_ending = null; /** * Number at which line numbers should start at * @var int */ var $line_numbers_start = 1; /** * The overall style for this code block * @var string */ var $overall_style = 'font-family:monospace;'; /** * The style for the actual code * @var string */ var $code_style = 'font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;'; /** * The overall class for this code block * @var string */ var $overall_class = ''; /** * The overall ID for this code block * @var string */ var $overall_id = ''; /** * Line number styles * @var string */ var $line_style1 = 'font-weight: normal; vertical-align:top;'; /** * Line number styles for fancy lines * @var string */ var $line_style2 = 'font-weight: bold; vertical-align:top;'; /** * Style for line numbers when GESHI_HEADER_PRE_TABLE is chosen * @var string */ var $table_linenumber_style = 'width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;'; /** * Flag for how line numbers are displayed * @var boolean */ var $line_numbers = GESHI_NO_LINE_NUMBERS; /** * Flag to decide if multi line spans are allowed. Set it to false to make sure * each tag is closed before and reopened after each linefeed. * @var boolean */ var $allow_multiline_span = true; /** * The "nth" value for fancy line highlighting * @var int */ var $line_nth_row = 0; /** * The size of tab stops * @var int */ var $tab_width = 8; /** * Should we use language-defined tab stop widths? * @var int */ var $use_language_tab_width = false; /** * Default target for keyword links * @var string */ var $link_target = ''; /** * The encoding to use for entity encoding * NOTE: Used with Escape Char Sequences to fix UTF-8 handling (cf. SF#2037598) * @var string */ var $encoding = 'utf-8'; /** * Should keywords be linked? * @var boolean */ var $keyword_links = true; /** * Currently loaded language file * @var string * @since 1.0.7.22 */ var $loaded_language = ''; /** * Wether the caches needed for parsing are built or not * * @var bool * @since 1.0.8 */ var $parse_cache_built = false; /** * Work around for Suhosin Patch with disabled /e modifier * * Note from suhosins author in config file: *
* The /e modifier inside preg_replace() allows code execution. * Often it is the cause for remote code execution exploits. It is wise to * deactivate this feature and test where in the application it is used. * The developer using the /e modifier should be made aware that he should * use preg_replace_callback() instead *
* * @var array * @since 1.0.8 */ var $_kw_replace_group = 0; var $_rx_key = 0; /** * some "callback parameters" for handle_multiline_regexps * * @since 1.0.8 * @access private * @var string */ var $_hmr_before = ''; var $_hmr_replace = ''; var $_hmr_after = ''; var $_hmr_key = 0; /**#@-*/ /** * Creates a new GeSHi object, with source and language * * @param string The source code to highlight * @param string The language to highlight the source with * @param string The path to the language file directory. This * is deprecated! I've backported the auto path * detection from the 1.1.X dev branch, so now it * should be automatically set correctly. If you have * renamed the language directory however, you will * still need to set the path using this parameter or * {@link GeSHi->set_language_path()} * @since 1.0.0 */ function GeSHi($source = '', $language = '', $path = '') { if (!empty($source)) { $this->set_source($source); } if (!empty($language)) { $this->set_language($language); } $this->set_language_path($path); } /** * Returns an error message associated with the last GeSHi operation, * or false if no error has occured * * @return string|false An error message if there has been an error, else false * @since 1.0.0 */ function error() { if ($this->error) { //Put some template variables for debugging here ... $debug_tpl_vars = array( '{LANGUAGE}' => $this->language, '{PATH}' => $this->language_path ); $msg = str_replace( array_keys($debug_tpl_vars), array_values($debug_tpl_vars), $this->error_messages[$this->error]); return "
GeSHi Error: $msg (code {$this->error})
"; } return false; } /** * Gets a human-readable language name (thanks to Simon Patterson * for the idea :)) * * @return string The name for the current language * @since 1.0.2 */ function get_language_name() { if (GESHI_ERROR_NO_SUCH_LANG == $this->error) { return $this->language_data['LANG_NAME'] . ' (Unknown Language)'; } return $this->language_data['LANG_NAME']; } /** * Sets the source code for this object * * @param string The source code to highlight * @since 1.0.0 */ function set_source($source) { $this->source = $source; $this->highlight_extra_lines = array(); } /** * Sets the language for this object * * @note since 1.0.8 this function won't reset language-settings by default anymore! * if you need this set $force_reset = true * * @param string The name of the language to use * @since 1.0.0 */ function set_language($language, $force_reset = false) { if ($force_reset) { $this->loaded_language = false; } //Clean up the language name to prevent malicious code injection $language = preg_replace('#[^a-zA-Z0-9\-_]#', '', $language); $language = strtolower($language); //Retreive the full filename $file_name = $this->language_path . $language . '.php'; if ($file_name == $this->loaded_language) { // this language is already loaded! return; } $this->language = $language; $this->error = false; $this->strict_mode = GESHI_NEVER; //Check if we can read the desired file if (!is_readable($file_name)) { $this->error = GESHI_ERROR_NO_SUCH_LANG; return; } // Load the language for parsing $this->load_language($file_name); } /** * Sets the path to the directory containing the language files. Note * that this path is relative to the directory of the script that included * geshi.php, NOT geshi.php itself. * * @param string The path to the language directory * @since 1.0.0 * @deprecated The path to the language files should now be automatically * detected, so this method should no longer be needed. The * 1.1.X branch handles manual setting of the path differently * so this method will disappear in 1.2.0. */ function set_language_path($path) { if(strpos($path,':')) { //Security Fix to prevent external directories using fopen wrappers. if(DIRECTORY_SEPARATOR == "\\") { if(!preg_match('#^[a-zA-Z]:#', $path) || false !== strpos($path, ':', 2)) { return; } } else { return; } } if(preg_match('#[^/a-zA-Z0-9_\.\-\\\s:]#', $path)) { //Security Fix to prevent external directories using fopen wrappers. return; } if(GESHI_SECURITY_PARANOID && false !== strpos($path, '/.')) { //Security Fix to prevent external directories using fopen wrappers. return; } if(GESHI_SECURITY_PARANOID && false !== strpos($path, '..')) { //Security Fix to prevent external directories using fopen wrappers. return; } if ($path) { $this->language_path = ('/' == $path[strlen($path) - 1]) ? $path : $path . '/'; $this->set_language($this->language); // otherwise set_language_path has no effect } } /** * Sets the type of header to be used. * * If GESHI_HEADER_DIV is used, the code is surrounded in a "div".This * means more source code but more control over tab width and line-wrapping. * GESHI_HEADER_PRE means that a "pre" is used - less source, but less * control. Default is GESHI_HEADER_PRE. * * From 1.0.7.2, you can use GESHI_HEADER_NONE to specify that no header code * should be outputted. * * @param int The type of header to be used * @since 1.0.0 */ function set_header_type($type) { //Check if we got a valid header type if (!in_array($type, array(GESHI_HEADER_NONE, GESHI_HEADER_DIV, GESHI_HEADER_PRE, GESHI_HEADER_PRE_VALID, GESHI_HEADER_PRE_TABLE))) { $this->error = GESHI_ERROR_INVALID_HEADER_TYPE; return; } //Set that new header type $this->header_type = $type; } /** * Sets the styles for the code that will be outputted * when this object is parsed. The style should be a * string of valid stylesheet declarations * * @param string The overall style for the outputted code block * @param boolean Whether to merge the styles with the current styles or not * @since 1.0.0 */ function set_overall_style($style, $preserve_defaults = false) { if (!$preserve_defaults) { $this->overall_style = $style; } else { $this->overall_style .= $style; } } /** * Sets the overall classname for this block of code. This * class can then be used in a stylesheet to style this object's * output * * @param string The class name to use for this block of code * @since 1.0.0 */ function set_overall_class($class) { $this->overall_class = $class; } /** * Sets the overall id for this block of code. This id can then * be used in a stylesheet to style this object's output * * @param string The ID to use for this block of code * @since 1.0.0 */ function set_overall_id($id) { $this->overall_id = $id; } /** * Sets whether CSS classes should be used to highlight the source. Default * is off, calling this method with no arguments will turn it on * * @param boolean Whether to turn classes on or not * @since 1.0.0 */ function enable_classes($flag = true) { $this->use_classes = ($flag) ? true : false; } /** * Sets the style for the actual code. This should be a string * containing valid stylesheet declarations. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority * * Note: Use this method to override any style changes you made to * the line numbers if you are using line numbers, else the line of * code will have the same style as the line number! Consult the * GeSHi documentation for more information about this. * * @param string The style to use for actual code * @param boolean Whether to merge the current styles with the new styles * @since 1.0.2 */ function set_code_style($style, $preserve_defaults = false) { if (!$preserve_defaults) { $this->code_style = $style; } else { $this->code_style .= $style; } } /** * Sets the styles for the line numbers. * * @param string The style for the line numbers that are "normal" * @param string|boolean If a string, this is the style of the line * numbers that are "fancy", otherwise if boolean then this * defines whether the normal styles should be merged with the * new normal styles or not * @param boolean If set, is the flag for whether to merge the "fancy" * styles with the current styles or not * @since 1.0.2 */ function set_line_style($style1, $style2 = '', $preserve_defaults = false) { //Check if we got 2 or three parameters if (is_bool($style2)) { $preserve_defaults = $style2; $style2 = ''; } //Actually set the new styles if (!$preserve_defaults) { $this->line_style1 = $style1; $this->line_style2 = $style2; } else { $this->line_style1 .= $style1; $this->line_style2 .= $style2; } } /** * Sets whether line numbers should be displayed. * * Valid values for the first parameter are: * * - GESHI_NO_LINE_NUMBERS: Line numbers will not be displayed * - GESHI_NORMAL_LINE_NUMBERS: Line numbers will be displayed * - GESHI_FANCY_LINE_NUMBERS: Fancy line numbers will be displayed * * For fancy line numbers, the second parameter is used to signal which lines * are to be fancy. For example, if the value of this parameter is 5 then every * 5th line will be fancy. * * @param int How line numbers should be displayed * @param int Defines which lines are fancy * @since 1.0.0 */ function enable_line_numbers($flag, $nth_row = 5) { if (GESHI_NO_LINE_NUMBERS != $flag && GESHI_NORMAL_LINE_NUMBERS != $flag && GESHI_FANCY_LINE_NUMBERS != $flag) { $this->error = GESHI_ERROR_INVALID_LINE_NUMBER_TYPE; } $this->line_numbers = $flag; $this->line_nth_row = $nth_row; } /** * Sets wether spans and other HTML markup generated by GeSHi can * span over multiple lines or not. Defaults to true to reduce overhead. * Set it to false if you want to manipulate the output or manually display * the code in an ordered list. * * @param boolean Wether multiline spans are allowed or not * @since 1.0.7.22 */ function enable_multiline_span($flag) { $this->allow_multiline_span = (bool) $flag; } /** * Get current setting for multiline spans, see GeSHi->enable_multiline_span(). * * @see enable_multiline_span * @return bool */ function get_multiline_span() { return $this->allow_multiline_span; } /** * Sets the style for a keyword group. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority * * @param int The key of the keyword group to change the styles of * @param string The style to make the keywords * @param boolean Whether to merge the new styles with the old or just * to overwrite them * @since 1.0.0 */ function set_keyword_group_style($key, $style, $preserve_defaults = false) { //Set the style for this keyword group if (!$preserve_defaults) { $this->language_data['STYLES']['KEYWORDS'][$key] = $style; } else { $this->language_data['STYLES']['KEYWORDS'][$key] .= $style; } //Update the lexic permissions if (!isset($this->lexic_permissions['KEYWORDS'][$key])) { $this->lexic_permissions['KEYWORDS'][$key] = true; } } /** * Turns highlighting on/off for a keyword group * * @param int The key of the keyword group to turn on or off * @param boolean Whether to turn highlighting for that group on or off * @since 1.0.0 */ function set_keyword_group_highlighting($key, $flag = true) { $this->lexic_permissions['KEYWORDS'][$key] = ($flag) ? true : false; } /** * Sets the styles for comment groups. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority * * @param int The key of the comment group to change the styles of * @param string The style to make the comments * @param boolean Whether to merge the new styles with the old or just * to overwrite them * @since 1.0.0 */ function set_comments_style($key, $style, $preserve_defaults = false) { if (!$preserve_defaults) { $this->language_data['STYLES']['COMMENTS'][$key] = $style; } else { $this->language_data['STYLES']['COMMENTS'][$key] .= $style; } } /** * Turns highlighting on/off for comment groups * * @param int The key of the comment group to turn on or off * @param boolean Whether to turn highlighting for that group on or off * @since 1.0.0 */ function set_comments_highlighting($key, $flag = true) { $this->lexic_permissions['COMMENTS'][$key] = ($flag) ? true : false; } /** * Sets the styles for escaped characters. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority * * @param string The style to make the escape characters * @param boolean Whether to merge the new styles with the old or just * to overwrite them * @since 1.0.0 */ function set_escape_characters_style($style, $preserve_defaults = false, $group = 0) { if (!$preserve_defaults) { $this->language_data['STYLES']['ESCAPE_CHAR'][$group] = $style; } else { $this->language_data['STYLES']['ESCAPE_CHAR'][$group] .= $style; } } /** * Turns highlighting on/off for escaped characters * * @param boolean Whether to turn highlighting for escape characters on or off * @since 1.0.0 */ function set_escape_characters_highlighting($flag = true) { $this->lexic_permissions['ESCAPE_CHAR'] = ($flag) ? true : false; } /** * Sets the styles for brackets. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority * * This method is DEPRECATED: use set_symbols_style instead. * This method will be removed in 1.2.X * * @param string The style to make the brackets * @param boolean Whether to merge the new styles with the old or just * to overwrite them * @since 1.0.0 * @deprecated In favour of set_symbols_style */ function set_brackets_style($style, $preserve_defaults = false) { if (!$preserve_defaults) { $this->language_data['STYLES']['BRACKETS'][0] = $style; } else { $this->language_data['STYLES']['BRACKETS'][0] .= $style; } } /** * Turns highlighting on/off for brackets * * This method is DEPRECATED: use set_symbols_highlighting instead. * This method will be remove in 1.2.X * * @param boolean Whether to turn highlighting for brackets on or off * @since 1.0.0 * @deprecated In favour of set_symbols_highlighting */ function set_brackets_highlighting($flag) { $this->lexic_permissions['BRACKETS'] = ($flag) ? true : false; } /** * Sets the styles for symbols. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority * * @param string The style to make the symbols * @param boolean Whether to merge the new styles with the old or just * to overwrite them * @param int Tells the group of symbols for which style should be set. * @since 1.0.1 */ function set_symbols_style($style, $preserve_defaults = false, $group = 0) { // Update the style of symbols if (!$preserve_defaults) { $this->language_data['STYLES']['SYMBOLS'][$group] = $style; } else { $this->language_data['STYLES']['SYMBOLS'][$group] .= $style; } // For backward compatibility if (0 == $group) { $this->set_brackets_style ($style, $preserve_defaults); } } /** * Turns highlighting on/off for symbols * * @param boolean Whether to turn highlighting for symbols on or off * @since 1.0.0 */ function set_symbols_highlighting($flag) { // Update lexic permissions for this symbol group $this->lexic_permissions['SYMBOLS'] = ($flag) ? true : false; // For backward compatibility $this->set_brackets_highlighting ($flag); } /** * Sets the styles for strings. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority * * @param string The style to make the escape characters * @param boolean Whether to merge the new styles with the old or just * to overwrite them * @since 1.0.0 */ function set_strings_style($style, $preserve_defaults = false) { if (!$preserve_defaults) { $this->language_data['STYLES']['STRINGS'][0] = $style; } else { $this->language_data['STYLES']['STRINGS'][0] .= $style; } } /** * Turns highlighting on/off for strings * * @param boolean Whether to turn highlighting for strings on or off * @since 1.0.0 */ function set_strings_highlighting($flag) { $this->lexic_permissions['STRINGS'] = ($flag) ? true : false; } /** * Sets the styles for numbers. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority * * @param string The style to make the numbers * @param boolean Whether to merge the new styles with the old or just * to overwrite them * @since 1.0.0 */ function set_numbers_style($style, $preserve_defaults = false) { if (!$preserve_defaults) { $this->language_data['STYLES']['NUMBERS'][0] = $style; } else { $this->language_data['STYLES']['NUMBERS'][0] .= $style; } } /** * Turns highlighting on/off for numbers * * @param boolean Whether to turn highlighting for numbers on or off * @since 1.0.0 */ function set_numbers_highlighting($flag) { $this->lexic_permissions['NUMBERS'] = ($flag) ? true : false; } /** * Sets the styles for methods. $key is a number that references the * appropriate "object splitter" - see the language file for the language * you are highlighting to get this number. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority * * @param int The key of the object splitter to change the styles of * @param string The style to make the methods * @param boolean Whether to merge the new styles with the old or just * to overwrite them * @since 1.0.0 */ function set_methods_style($key, $style, $preserve_defaults = false) { if (!$preserve_defaults) { $this->language_data['STYLES']['METHODS'][$key] = $style; } else { $this->language_data['STYLES']['METHODS'][$key] .= $style; } } /** * Turns highlighting on/off for methods * * @param boolean Whether to turn highlighting for methods on or off * @since 1.0.0 */ function set_methods_highlighting($flag) { $this->lexic_permissions['METHODS'] = ($flag) ? true : false; } /** * Sets the styles for regexps. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority * * @param string The style to make the regular expression matches * @param boolean Whether to merge the new styles with the old or just * to overwrite them * @since 1.0.0 */ function set_regexps_style($key, $style, $preserve_defaults = false) { if (!$preserve_defaults) { $this->language_data['STYLES']['REGEXPS'][$key] = $style; } else { $this->language_data['STYLES']['REGEXPS'][$key] .= $style; } } /** * Turns highlighting on/off for regexps * * @param int The key of the regular expression group to turn on or off * @param boolean Whether to turn highlighting for the regular expression group on or off * @since 1.0.0 */ function set_regexps_highlighting($key, $flag) { $this->lexic_permissions['REGEXPS'][$key] = ($flag) ? true : false; } /** * Sets whether a set of keywords are checked for in a case sensitive manner * * @param int The key of the keyword group to change the case sensitivity of * @param boolean Whether to check in a case sensitive manner or not * @since 1.0.0 */ function set_case_sensitivity($key, $case) { $this->language_data['CASE_SENSITIVE'][$key] = ($case) ? true : false; } /** * Sets the case that keywords should use when found. Use the constants: * * - GESHI_CAPS_NO_CHANGE: leave keywords as-is * - GESHI_CAPS_UPPER: convert all keywords to uppercase where found * - GESHI_CAPS_LOWER: convert all keywords to lowercase where found * * @param int A constant specifying what to do with matched keywords * @since 1.0.1 */ function set_case_keywords($case) { if (in_array($case, array( GESHI_CAPS_NO_CHANGE, GESHI_CAPS_UPPER, GESHI_CAPS_LOWER))) { $this->language_data['CASE_KEYWORDS'] = $case; } } /** * Sets how many spaces a tab is substituted for * * Widths below zero are ignored * * @param int The tab width * @since 1.0.0 */ function set_tab_width($width) { $this->tab_width = intval($width); //Check if it fit's the constraints: if ($this->tab_width < 1) { //Return it to the default $this->tab_width = 8; } } /** * Sets whether or not to use tab-stop width specifed by language * * @param boolean Whether to use language-specific tab-stop widths * @since 1.0.7.20 */ function set_use_language_tab_width($use) { $this->use_language_tab_width = (bool) $use; } /** * Returns the tab width to use, based on the current language and user * preference * * @return int Tab width * @since 1.0.7.20 */ function get_real_tab_width() { if (!$this->use_language_tab_width || !isset($this->language_data['TAB_WIDTH'])) { return $this->tab_width; } else { return $this->language_data['TAB_WIDTH']; } } /** * Enables/disables strict highlighting. Default is off, calling this * method without parameters will turn it on. See documentation * for more details on strict mode and where to use it. * * @param boolean Whether to enable strict mode or not * @since 1.0.0 */ function enable_strict_mode($mode = true) { if (GESHI_MAYBE == $this->language_data['STRICT_MODE_APPLIES']) { $this->strict_mode = ($mode) ? GESHI_ALWAYS : GESHI_NEVER; } } /** * Disables all highlighting * * @since 1.0.0 * @todo Rewrite with array traversal * @deprecated In favour of enable_highlighting */ function disable_highlighting() { $this->enable_highlighting(false); } /** * Enables all highlighting * * The optional flag parameter was added in version 1.0.7.21 and can be used * to enable (true) or disable (false) all highlighting. * * @since 1.0.0 * @param boolean A flag specifying whether to enable or disable all highlighting * @todo Rewrite with array traversal */ function enable_highlighting($flag = true) { $flag = $flag ? true : false; foreach ($this->lexic_permissions as $key => $value) { if (is_array($value)) { foreach ($value as $k => $v) { $this->lexic_permissions[$key][$k] = $flag; } } else { $this->lexic_permissions[$key] = $flag; } } // Context blocks $this->enable_important_blocks = $flag; } /** * Given a file extension, this method returns either a valid geshi language * name, or the empty string if it couldn't be found * * @param string The extension to get a language name for * @param array A lookup array to use instead of the default one * @since 1.0.5 * @todo Re-think about how this method works (maybe make it private and/or make it * a extension->lang lookup?) * @todo static? */ function get_language_name_from_extension( $extension, $lookup = array() ) { if ( !is_array($lookup) || empty($lookup)) { $lookup = array( 'actionscript' => array('as'), 'ada' => array('a', 'ada', 'adb', 'ads'), 'apache' => array('conf'), 'asm' => array('ash', 'asm', 'inc'), 'asp' => array('asp'), 'bash' => array('sh'), 'bf' => array('bf'), 'c' => array('c', 'h'), 'c_mac' => array('c', 'h'), 'caddcl' => array(), 'cadlisp' => array(), 'cdfg' => array('cdfg'), 'cobol' => array('cbl'), 'cpp' => array('cpp', 'hpp', 'C', 'H', 'CPP', 'HPP'), 'csharp' => array('cs'), 'css' => array('css'), 'd' => array('d'), 'delphi' => array('dpk', 'dpr', 'pp', 'pas'), 'diff' => array('diff', 'patch'), 'dos' => array('bat', 'cmd'), 'gettext' => array('po', 'pot'), 'gml' => array('gml'), 'gnuplot' => array('plt'), 'groovy' => array('groovy'), 'haskell' => array('hs'), 'html4strict' => array('html', 'htm'), 'ini' => array('ini', 'desktop'), 'java' => array('java'), 'javascript' => array('js'), 'klonec' => array('kl1'), 'klonecpp' => array('klx'), 'latex' => array('tex'), 'lisp' => array('lisp'), 'lua' => array('lua'), 'matlab' => array('m'), 'mpasm' => array(), 'mysql' => array('sql'), 'nsis' => array(), 'objc' => array(), 'oobas' => array(), 'oracle8' => array(), 'oracle10' => array(), 'pascal' => array('pas'), 'perl' => array('pl', 'pm'), 'php' => array('php', 'php5', 'phtml', 'phps'), 'povray' => array('pov'), 'providex' => array('pvc', 'pvx'), 'prolog' => array('pl'), 'python' => array('py'), 'qbasic' => array('bi'), 'reg' => array('reg'), 'ruby' => array('rb'), 'sas' => array('sas'), 'scala' => array('scala'), 'scheme' => array('scm'), 'scilab' => array('sci'), 'smalltalk' => array('st'), 'smarty' => array(), 'tcl' => array('tcl'), 'vb' => array('bas'), 'vbnet' => array(), 'visualfoxpro' => array(), 'whitespace' => array('ws'), 'xml' => array('xml', 'svg'), 'z80' => array('z80', 'asm', 'inc') ); } foreach ($lookup as $lang => $extensions) { if (in_array($extension, $extensions)) { return $lang; } } return ''; } /** * Given a file name, this method loads its contents in, and attempts * to set the language automatically. An optional lookup table can be * passed for looking up the language name. If not specified a default * table is used * * The language table is in the form *
array(
     *   'lang_name' => array('extension', 'extension', ...),
     *   'lang_name' ...
     * );
* * @param string The filename to load the source from * @param array A lookup array to use instead of the default one * @todo Complete rethink of this and above method * @since 1.0.5 */ function load_from_file($file_name, $lookup = array()) { if (is_readable($file_name)) { $this->set_source(file_get_contents($file_name)); $this->set_language($this->get_language_name_from_extension(substr(strrchr($file_name, '.'), 1), $lookup)); } else { $this->error = GESHI_ERROR_FILE_NOT_READABLE; } } /** * Adds a keyword to a keyword group for highlighting * * @param int The key of the keyword group to add the keyword to * @param string The word to add to the keyword group * @since 1.0.0 */ function add_keyword($key, $word) { if (!in_array($word, $this->language_data['KEYWORDS'][$key])) { $this->language_data['KEYWORDS'][$key][] = $word; //NEW in 1.0.8 don't recompile the whole optimized regexp, simply append it if ($this->parse_cache_built) { $subkey = count($this->language_data['CACHED_KEYWORD_LISTS'][$key]) - 1; $this->language_data['CACHED_KEYWORD_LISTS'][$key][$subkey] .= '|' . preg_quote($word, '/'); } } } /** * Removes a keyword from a keyword group * * @param int The key of the keyword group to remove the keyword from * @param string The word to remove from the keyword group * @param bool Wether to automatically recompile the optimized regexp list or not. * Note: if you set this to false and @see GeSHi->parse_code() was already called once, * for the current language, you have to manually call @see GeSHi->optimize_keyword_group() * or the removed keyword will stay in cache and still be highlighted! On the other hand * it might be too expensive to recompile the regexp list for every removal if you want to * remove a lot of keywords. * @since 1.0.0 */ function remove_keyword($key, $word, $recompile = true) { $key_to_remove = array_search($word, $this->language_data['KEYWORDS'][$key]); if ($key_to_remove !== false) { unset($this->language_data['KEYWORDS'][$key][$key_to_remove]); //NEW in 1.0.8, optionally recompile keyword group if ($recompile && $this->parse_cache_built) { $this->optimize_keyword_group($key); } } } /** * Creates a new keyword group * * @param int The key of the keyword group to create * @param string The styles for the keyword group * @param boolean Whether the keyword group is case sensitive ornot * @param array The words to use for the keyword group * @since 1.0.0 */ function add_keyword_group($key, $styles, $case_sensitive = true, $words = array()) { $words = (array) $words; if (empty($words)) { // empty word lists mess up highlighting return false; } //Add the new keyword group internally $this->language_data['KEYWORDS'][$key] = $words; $this->lexic_permissions['KEYWORDS'][$key] = true; $this->language_data['CASE_SENSITIVE'][$key] = $case_sensitive; $this->language_data['STYLES']['KEYWORDS'][$key] = $styles; //NEW in 1.0.8, cache keyword regexp if ($this->parse_cache_built) { $this->optimize_keyword_group($key); } } /** * Removes a keyword group * * @param int The key of the keyword group to remove * @since 1.0.0 */ function remove_keyword_group ($key) { //Remove the keyword group internally unset($this->language_data['KEYWORDS'][$key]); unset($this->lexic_permissions['KEYWORDS'][$key]); unset($this->language_data['CASE_SENSITIVE'][$key]); unset($this->language_data['STYLES']['KEYWORDS'][$key]); //NEW in 1.0.8 unset($this->language_data['CACHED_KEYWORD_LISTS'][$key]); } /** * compile optimized regexp list for keyword group * * @param int The key of the keyword group to compile & optimize * @since 1.0.8 */ function optimize_keyword_group($key) { $this->language_data['CACHED_KEYWORD_LISTS'][$key] = $this->optimize_regexp_list($this->language_data['KEYWORDS'][$key]); $space_as_whitespace = false; if(isset($this->language_data['PARSER_CONTROL'])) { if(isset($this->language_data['PARSER_CONTROL']['KEYWORDS'])) { if(isset($this->language_data['PARSER_CONTROL']['KEYWORDS']['SPACE_AS_WHITESPACE'])) { $space_as_whitespace = $this->language_data['PARSER_CONTROL']['KEYWORDS']['SPACE_AS_WHITESPACE']; } if(isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$key]['SPACE_AS_WHITESPACE'])) { if(isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$key]['SPACE_AS_WHITESPACE'])) { $space_as_whitespace = $this->language_data['PARSER_CONTROL']['KEYWORDS'][$key]['SPACE_AS_WHITESPACE']; } } } } if($space_as_whitespace) { foreach($this->language_data['CACHED_KEYWORD_LISTS'][$key] as $rxk => $rxv) { $this->language_data['CACHED_KEYWORD_LISTS'][$key][$rxk] = str_replace(" ", "\\s+", $rxv); } } } /** * Sets the content of the header block * * @param string The content of the header block * @since 1.0.2 */ function set_header_content($content) { $this->header_content = $content; } /** * Sets the content of the footer block * * @param string The content of the footer block * @since 1.0.2 */ function set_footer_content($content) { $this->footer_content = $content; } /** * Sets the style for the header content * * @param string The style for the header content * @since 1.0.2 */ function set_header_content_style($style) { $this->header_content_style = $style; } /** * Sets the style for the footer content * * @param string The style for the footer content * @since 1.0.2 */ function set_footer_content_style($style) { $this->footer_content_style = $style; } /** * Sets whether to force a surrounding block around * the highlighted code or not * * @param boolean Tells whether to enable or disable this feature * @since 1.0.7.20 */ function enable_inner_code_block($flag) { $this->force_code_block = (bool)$flag; } /** * Sets the base URL to be used for keywords * * @param int The key of the keyword group to set the URL for * @param string The URL to set for the group. If {FNAME} is in * the url somewhere, it is replaced by the keyword * that the URL is being made for * @since 1.0.2 */ function set_url_for_keyword_group($group, $url) { $this->language_data['URLS'][$group] = $url; } /** * Sets styles for links in code * * @param int A constant that specifies what state the style is being * set for - e.g. :hover or :visited * @param string The styles to use for that state * @since 1.0.2 */ function set_link_styles($type, $styles) { $this->link_styles[$type] = $styles; } /** * Sets the target for links in code * * @param string The target for links in the code, e.g. _blank * @since 1.0.3 */ function set_link_target($target) { if (!$target) { $this->link_target = ''; } else { $this->link_target = ' target="' . $target . '"'; } } /** * Sets styles for important parts of the code * * @param string The styles to use on important parts of the code * @since 1.0.2 */ function set_important_styles($styles) { $this->important_styles = $styles; } /** * Sets whether context-important blocks are highlighted * * @param boolean Tells whether to enable or disable highlighting of important blocks * @todo REMOVE THIS SHIZ FROM GESHI! * @deprecated * @since 1.0.2 */ function enable_important_blocks($flag) { $this->enable_important_blocks = ( $flag ) ? true : false; } /** * Whether CSS IDs should be added to each line * * @param boolean If true, IDs will be added to each line. * @since 1.0.2 */ function enable_ids($flag = true) { $this->add_ids = ($flag) ? true : false; } /** * Specifies which lines to highlight extra * * The extra style parameter was added in 1.0.7.21. * * @param mixed An array of line numbers to highlight, or just a line * number on its own. * @param string A string specifying the style to use for this line. * If null is specified, the default style is used. * If false is specified, the line will be removed from * special highlighting * @since 1.0.2 * @todo Some data replication here that could be cut down on */ function highlight_lines_extra($lines, $style = null) { if (is_array($lines)) { //Split up the job using single lines at a time foreach ($lines as $line) { $this->highlight_lines_extra($line, $style); } } else { //Mark the line as being highlighted specially $lines = intval($lines); $this->highlight_extra_lines[$lines] = $lines; //Decide on which style to use if ($style === null) { //Check if we should use default style unset($this->highlight_extra_lines_styles[$lines]); } else if ($style === false) { //Check if to remove this line unset($this->highlight_extra_lines[$lines]); unset($this->highlight_extra_lines_styles[$lines]); } else { $this->highlight_extra_lines_styles[$lines] = $style; } } } /** * Sets the style for extra-highlighted lines * * @param string The style for extra-highlighted lines * @since 1.0.2 */ function set_highlight_lines_extra_style($styles) { $this->highlight_extra_lines_style = $styles; } /** * Sets the line-ending * * @param string The new line-ending * @since 1.0.2 */ function set_line_ending($line_ending) { $this->line_ending = (string)$line_ending; } /** * Sets what number line numbers should start at. Should * be a positive integer, and will be converted to one. * * Warning: Using this method will add the "start" * attribute to the <ol> that is used for line numbering. * This is not valid XHTML strict, so if that's what you * care about then don't use this method. Firefox is getting * support for the CSS method of doing this in 1.1 and Opera * has support for the CSS method, but (of course) IE doesn't * so it's not worth doing it the CSS way yet. * * @param int The number to start line numbers at * @since 1.0.2 */ function start_line_numbers_at($number) { $this->line_numbers_start = abs(intval($number)); } /** * Sets the encoding used for htmlspecialchars(), for international * support. * * NOTE: This is not needed for now because htmlspecialchars() is not * being used (it has a security hole in PHP4 that has not been patched). * Maybe in a future version it may make a return for speed reasons, but * I doubt it. * * @param string The encoding to use for the source * @since 1.0.3 */ function set_encoding($encoding) { if ($encoding) { $this->encoding = strtolower($encoding); } } /** * Turns linking of keywords on or off. * * @param boolean If true, links will be added to keywords * @since 1.0.2 */ function enable_keyword_links($enable = true) { $this->keyword_links = (bool) $enable; } /** * Setup caches needed for styling. This is automatically called in * parse_code() and get_stylesheet() when appropriate. This function helps * stylesheet generators as they rely on some style information being * preprocessed * * @since 1.0.8 * @access private */ function build_style_cache() { //Build the style cache needed to highlight numbers appropriate if($this->lexic_permissions['NUMBERS']) { //First check what way highlighting information for numbers are given if(!isset($this->language_data['NUMBERS'])) { $this->language_data['NUMBERS'] = 0; } if(is_array($this->language_data['NUMBERS'])) { $this->language_data['NUMBERS_CACHE'] = $this->language_data['NUMBERS']; } else { $this->language_data['NUMBERS_CACHE'] = array(); if(!$this->language_data['NUMBERS']) { $this->language_data['NUMBERS'] = GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_FLT_NONSCI; } for($i = 0, $j = $this->language_data['NUMBERS']; $j > 0; ++$i, $j>>=1) { //Rearrange style indices if required ... if(isset($this->language_data['STYLES']['NUMBERS'][1<<$i])) { $this->language_data['STYLES']['NUMBERS'][$i] = $this->language_data['STYLES']['NUMBERS'][1<<$i]; unset($this->language_data['STYLES']['NUMBERS'][1<<$i]); } //Check if this bit is set for highlighting if($j&1) { //So this bit is set ... //Check if it belongs to group 0 or the actual stylegroup if(isset($this->language_data['STYLES']['NUMBERS'][$i])) { $this->language_data['NUMBERS_CACHE'][$i] = 1 << $i; } else { if(!isset($this->language_data['NUMBERS_CACHE'][0])) { $this->language_data['NUMBERS_CACHE'][0] = 0; } $this->language_data['NUMBERS_CACHE'][0] |= 1 << $i; } } } } } } /** * Setup caches needed for parsing. This is automatically called in parse_code() when appropriate. * This function makes stylesheet generators much faster as they do not need these caches. * * @since 1.0.8 * @access private */ function build_parse_cache() { // cache symbol regexp //As this is a costy operation, we avoid doing it for multiple groups ... //Instead we perform it for all symbols at once. // //For this to work, we need to reorganize the data arrays. if ($this->lexic_permissions['SYMBOLS'] && !empty($this->language_data['SYMBOLS'])) { $this->language_data['MULTIPLE_SYMBOL_GROUPS'] = count($this->language_data['STYLES']['SYMBOLS']) > 1; $this->language_data['SYMBOL_DATA'] = array(); $symbol_preg_multi = array(); // multi char symbols $symbol_preg_single = array(); // single char symbols foreach ($this->language_data['SYMBOLS'] as $key => $symbols) { if (is_array($symbols)) { foreach ($symbols as $sym) { $sym = $this->hsc($sym); if (!isset($this->language_data['SYMBOL_DATA'][$sym])) { $this->language_data['SYMBOL_DATA'][$sym] = $key; if (isset($sym[1])) { // multiple chars $symbol_preg_multi[] = preg_quote($sym, '/'); } else { // single char if ($sym == '-') { // don't trigger range out of order error $symbol_preg_single[] = '\-'; } else { $symbol_preg_single[] = preg_quote($sym, '/'); } } } } } else { $symbols = $this->hsc($symbols); if (!isset($this->language_data['SYMBOL_DATA'][$symbols])) { $this->language_data['SYMBOL_DATA'][$symbols] = 0; if (isset($symbols[1])) { // multiple chars $symbol_preg_multi[] = preg_quote($symbols, '/'); } else if ($symbols == '-') { // don't trigger range out of order error $symbol_preg_single[] = '\-'; } else { // single char $symbol_preg_single[] = preg_quote($symbols, '/'); } } } } //Now we have an array with each possible symbol as the key and the style as the actual data. //This way we can set the correct style just the moment we highlight ... // //Now we need to rewrite our array to get a search string that $symbol_preg = array(); if (!empty($symbol_preg_multi)) { rsort($symbol_preg_multi); $symbol_preg[] = implode('|', $symbol_preg_multi); } if (!empty($symbol_preg_single)) { rsort($symbol_preg_single); $symbol_preg[] = '[' . implode('', $symbol_preg_single) . ']'; } $this->language_data['SYMBOL_SEARCH'] = implode("|", $symbol_preg); } // cache optimized regexp for keyword matching // remove old cache $this->language_data['CACHED_KEYWORD_LISTS'] = array(); foreach (array_keys($this->language_data['KEYWORDS']) as $key) { if (!isset($this->lexic_permissions['KEYWORDS'][$key]) || $this->lexic_permissions['KEYWORDS'][$key]) { $this->optimize_keyword_group($key); } } // brackets if ($this->lexic_permissions['BRACKETS']) { $this->language_data['CACHE_BRACKET_MATCH'] = array('[', ']', '(', ')', '{', '}'); if (!$this->use_classes && isset($this->language_data['STYLES']['BRACKETS'][0])) { $this->language_data['CACHE_BRACKET_REPLACE'] = array( '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">[|>', '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">]|>', '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">(|>', '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">)|>', '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">{|>', '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">}|>', ); } else { $this->language_data['CACHE_BRACKET_REPLACE'] = array( '<| class="br0">[|>', '<| class="br0">]|>', '<| class="br0">(|>', '<| class="br0">)|>', '<| class="br0">{|>', '<| class="br0">}|>', ); } } //Build the parse cache needed to highlight numbers appropriate if($this->lexic_permissions['NUMBERS']) { //Check if the style rearrangements have been processed ... //This also does some preprocessing to check which style groups are useable ... if(!isset($this->language_data['NUMBERS_CACHE'])) { $this->build_style_cache(); } //Number format specification //All this formats are matched case-insensitively! static $numbers_format = array( GESHI_NUMBER_INT_BASIC => '(? '(? '(? '(? '(? '(? '(? '(? '(? '(? '(? '(? '(?language_data['NUMBERS_RXCACHE'] = array(); foreach($this->language_data['NUMBERS_CACHE'] as $key => $rxdata) { if(is_string($rxdata)) { $regexp = $rxdata; } else { //This is a bitfield of number flags to highlight: //Build an array, implode them together and make this the actual RX $rxuse = array(); for($i = 1; $i <= $rxdata; $i<<=1) { if($rxdata & $i) { $rxuse[] = $numbers_format[$i]; } } $regexp = implode("|", $rxuse); } $this->language_data['NUMBERS_RXCACHE'][$key] = "/(?)($regexp)(?!\|>)/i"; } } $this->parse_cache_built = true; } /** * Returns the code in $this->source, highlighted and surrounded by the * nessecary HTML. * * This should only be called ONCE, cos it's SLOW! If you want to highlight * the same source multiple times, you're better off doing a whole lot of * str_replaces to replace the <span>s * * @since 1.0.0 */ function parse_code () { // Start the timer $start_time = microtime(); // Firstly, if there is an error, we won't highlight if ($this->error) { //Escape the source for output $result = $this->hsc($this->source); //This fix is related to SF#1923020, but has to be applied regardless of //actually highlighting symbols. $result = str_replace(array('', ''), array(';', '|'), $result); // Timing is irrelevant $this->set_time($start_time, $start_time); $this->finalise($result); return $result; } // make sure the parse cache is up2date if (!$this->parse_cache_built) { $this->build_parse_cache(); } // Replace all newlines to a common form. $code = str_replace("\r\n", "\n", $this->source); $code = str_replace("\r", "\n", $code); // Add spaces for regular expression matching and line numbers // $code = "\n" . $code . "\n"; // Initialise various stuff $length = strlen($code); $COMMENT_MATCHED = false; $stuff_to_parse = ''; $endresult = ''; // "Important" selections are handled like multiline comments // @todo GET RID OF THIS SHIZ if ($this->enable_important_blocks) { $this->language_data['COMMENT_MULTI'][GESHI_START_IMPORTANT] = GESHI_END_IMPORTANT; } if ($this->strict_mode) { // Break the source into bits. Each bit will be a portion of the code // within script delimiters - for example, HTML between < and > $k = 0; $parts = array(); $matches = array(); $next_match_pointer = null; // we use a copy to unset delimiters on demand (when they are not found) $delim_copy = $this->language_data['SCRIPT_DELIMITERS']; $i = 0; while ($i < $length) { $next_match_pos = $length + 1; // never true foreach ($delim_copy as $dk => $delimiters) { if(is_array($delimiters)) { foreach ($delimiters as $open => $close) { // make sure the cache is setup properly if (!isset($matches[$dk][$open])) { $matches[$dk][$open] = array( 'next_match' => -1, 'dk' => $dk, 'open' => $open, // needed for grouping of adjacent code blocks (see below) 'open_strlen' => strlen($open), 'close' => $close, 'close_strlen' => strlen($close), ); } // Get the next little bit for this opening string if ($matches[$dk][$open]['next_match'] < $i) { // only find the next pos if it was not already cached $open_pos = strpos($code, $open, $i); if ($open_pos === false) { // no match for this delimiter ever unset($delim_copy[$dk][$open]); continue; } $matches[$dk][$open]['next_match'] = $open_pos; } if ($matches[$dk][$open]['next_match'] < $next_match_pos) { //So we got a new match, update the close_pos $matches[$dk][$open]['close_pos'] = strpos($code, $close, $matches[$dk][$open]['next_match']+1); $next_match_pointer =& $matches[$dk][$open]; $next_match_pos = $matches[$dk][$open]['next_match']; } } } else { //So we should match an RegExp as Strict Block ... /** * The value in $delimiters is expected to be an RegExp * containing exactly 2 matching groups: * - Group 1 is the opener * - Group 2 is the closer */ if(!GESHI_PHP_PRE_433 && //Needs proper rewrite to work with PHP >=4.3.0; 4.3.3 is guaranteed to work. preg_match($delimiters, $code, $matches_rx, PREG_OFFSET_CAPTURE, $i)) { //We got a match ... $matches[$dk] = array( 'next_match' => $matches_rx[1][1], 'dk' => $dk, 'close_strlen' => strlen($matches_rx[2][0]), 'close_pos' => $matches_rx[2][1], ); } else { // no match for this delimiter ever unset($delim_copy[$dk]); continue; } if ($matches[$dk]['next_match'] <= $next_match_pos) { $next_match_pointer =& $matches[$dk]; $next_match_pos = $matches[$dk]['next_match']; } } } // non-highlightable text $parts[$k] = array( 1 => substr($code, $i, $next_match_pos - $i) ); ++$k; if ($next_match_pos > $length) { // out of bounds means no next match was found break; } // highlightable code $parts[$k][0] = $next_match_pointer['dk']; //Only combine for non-rx script blocks if(is_array($delim_copy[$next_match_pointer['dk']])) { // group adjacent script blocks, e.g. should be one block, not three! $i = $next_match_pos + $next_match_pointer['open_strlen']; while (true) { $close_pos = strpos($code, $next_match_pointer['close'], $i); if ($close_pos == false) { break; } $i = $close_pos + $next_match_pointer['close_strlen']; if ($i == $length) { break; } if ($code[$i] == $next_match_pointer['open'][0] && ($next_match_pointer['open_strlen'] == 1 || substr($code, $i, $next_match_pointer['open_strlen']) == $next_match_pointer['open'])) { // merge adjacent but make sure we don't merge things like foreach ($matches as $submatches) { foreach ($submatches as $match) { if ($match['next_match'] == $i) { // a different block already matches here! break 3; } } } } else { break; } } } else { $close_pos = $next_match_pointer['close_pos'] + $next_match_pointer['close_strlen']; $i = $close_pos; } if ($close_pos === false) { // no closing delimiter found! $parts[$k][1] = substr($code, $next_match_pos); ++$k; break; } else { $parts[$k][1] = substr($code, $next_match_pos, $i - $next_match_pos); ++$k; } } unset($delim_copy, $next_match_pointer, $next_match_pos, $matches); $num_parts = $k; if ($num_parts == 1 && $this->strict_mode == GESHI_MAYBE) { // when we have only one part, we don't have anything to highlight at all. // if we have a "maybe" strict language, this should be handled as highlightable code $parts = array( 0 => array( 0 => '', 1 => '' ), 1 => array( 0 => null, 1 => $parts[0][1] ) ); $num_parts = 2; } } else { // Not strict mode - simply dump the source into // the array at index 1 (the first highlightable block) $parts = array( 0 => array( 0 => '', 1 => '' ), 1 => array( 0 => null, 1 => $code ) ); $num_parts = 2; } //Unset variables we won't need any longer unset($code); //Preload some repeatedly used values regarding hardquotes ... $hq = isset($this->language_data['HARDQUOTE']) ? $this->language_data['HARDQUOTE'][0] : false; $hq_strlen = strlen($hq); //Preload if line numbers are to be generated afterwards //Added a check if line breaks should be forced even without line numbers, fixes SF#1727398 $check_linenumbers = $this->line_numbers != GESHI_NO_LINE_NUMBERS || !empty($this->highlight_extra_lines) || !$this->allow_multiline_span; //preload the escape char for faster checking ... $escaped_escape_char = $this->hsc($this->language_data['ESCAPE_CHAR']); // this is used for single-line comments $sc_disallowed_before = ""; $sc_disallowed_after = ""; if (isset($this->language_data['PARSER_CONTROL'])) { if (isset($this->language_data['PARSER_CONTROL']['COMMENTS'])) { if (isset($this->language_data['PARSER_CONTROL']['COMMENTS']['DISALLOWED_BEFORE'])) { $sc_disallowed_before = $this->language_data['PARSER_CONTROL']['COMMENTS']['DISALLOWED_BEFORE']; } if (isset($this->language_data['PARSER_CONTROL']['COMMENTS']['DISALLOWED_AFTER'])) { $sc_disallowed_after = $this->language_data['PARSER_CONTROL']['COMMENTS']['DISALLOWED_AFTER']; } } } //Fix for SF#1932083: Multichar Quotemarks unsupported $is_string_starter = array(); if ($this->lexic_permissions['STRINGS']) { foreach ($this->language_data['QUOTEMARKS'] as $quotemark) { if (!isset($is_string_starter[$quotemark[0]])) { $is_string_starter[$quotemark[0]] = (string)$quotemark; } else if (is_string($is_string_starter[$quotemark[0]])) { $is_string_starter[$quotemark[0]] = array( $is_string_starter[$quotemark[0]], $quotemark); } else { $is_string_starter[$quotemark[0]][] = $quotemark; } } } // Now we go through each part. We know that even-indexed parts are // code that shouldn't be highlighted, and odd-indexed parts should // be highlighted for ($key = 0; $key < $num_parts; ++$key) { $STRICTATTRS = ''; // If this block should be highlighted... if (!($key & 1)) { // Else not a block to highlight $endresult .= $this->hsc($parts[$key][1]); unset($parts[$key]); continue; } $result = ''; $part = $parts[$key][1]; $highlight_part = true; if ($this->strict_mode && !is_null($parts[$key][0])) { // get the class key for this block of code $script_key = $parts[$key][0]; $highlight_part = $this->language_data['HIGHLIGHT_STRICT_BLOCK'][$script_key]; if ($this->language_data['STYLES']['SCRIPT'][$script_key] != '' && $this->lexic_permissions['SCRIPT']) { // Add a span element around the source to // highlight the overall source block if (!$this->use_classes && $this->language_data['STYLES']['SCRIPT'][$script_key] != '') { $attributes = ' style="' . $this->language_data['STYLES']['SCRIPT'][$script_key] . '"'; } else { $attributes = ' class="sc' . $script_key . '"'; } $result .= ""; $STRICTATTRS = $attributes; } } if ($highlight_part) { // Now, highlight the code in this block. This code // is really the engine of GeSHi (along with the method // parse_non_string_part). // cache comment regexps incrementally $next_comment_regexp_key = ''; $next_comment_regexp_pos = -1; $next_comment_multi_pos = -1; $next_comment_single_pos = -1; $comment_regexp_cache_per_key = array(); $comment_multi_cache_per_key = array(); $comment_single_cache_per_key = array(); $next_open_comment_multi = ''; $next_comment_single_key = ''; $escape_regexp_cache_per_key = array(); $next_escape_regexp_key = ''; $next_escape_regexp_pos = -1; $length = strlen($part); for ($i = 0; $i < $length; ++$i) { // Get the next char $char = $part[$i]; $char_len = 1; // update regexp comment cache if needed if (isset($this->language_data['COMMENT_REGEXP']) && $next_comment_regexp_pos < $i) { $next_comment_regexp_pos = $length; foreach ($this->language_data['COMMENT_REGEXP'] as $comment_key => $regexp) { $match_i = false; if (isset($comment_regexp_cache_per_key[$comment_key]) && ($comment_regexp_cache_per_key[$comment_key]['pos'] >= $i || $comment_regexp_cache_per_key[$comment_key]['pos'] === false)) { // we have already matched something if ($comment_regexp_cache_per_key[$comment_key]['pos'] === false) { // this comment is never matched continue; } $match_i = $comment_regexp_cache_per_key[$comment_key]['pos']; } else if ( //This is to allow use of the offset parameter in preg_match and stay as compatible with older PHP versions as possible (GESHI_PHP_PRE_433 && preg_match($regexp, substr($part, $i), $match, PREG_OFFSET_CAPTURE)) || (!GESHI_PHP_PRE_433 && preg_match($regexp, $part, $match, PREG_OFFSET_CAPTURE, $i)) ) { $match_i = $match[0][1]; if (GESHI_PHP_PRE_433) { $match_i += $i; } $comment_regexp_cache_per_key[$comment_key] = array( 'key' => $comment_key, 'length' => strlen($match[0][0]), 'pos' => $match_i ); } else { $comment_regexp_cache_per_key[$comment_key]['pos'] = false; continue; } if ($match_i !== false && $match_i < $next_comment_regexp_pos) { $next_comment_regexp_pos = $match_i; $next_comment_regexp_key = $comment_key; if ($match_i === $i) { break; } } } } $string_started = false; if (isset($is_string_starter[$char])) { // Possibly the start of a new string ... //Check which starter it was ... //Fix for SF#1932083: Multichar Quotemarks unsupported if (is_array($is_string_starter[$char])) { $char_new = ''; foreach ($is_string_starter[$char] as $testchar) { if ($testchar === substr($part, $i, strlen($testchar)) && strlen($testchar) > strlen($char_new)) { $char_new = $testchar; $string_started = true; } } if ($string_started) { $char = $char_new; } } else { $testchar = $is_string_starter[$char]; if ($testchar === substr($part, $i, strlen($testchar))) { $char = $testchar; $string_started = true; } } $char_len = strlen($char); } if ($string_started && $i != $next_comment_regexp_pos) { // Hand out the correct style information for this string $string_key = array_search($char, $this->language_data['QUOTEMARKS']); if (!isset($this->language_data['STYLES']['STRINGS'][$string_key]) || !isset($this->language_data['STYLES']['ESCAPE_CHAR'][$string_key])) { $string_key = 0; } // parse the stuff before this $result .= $this->parse_non_string_part($stuff_to_parse); $stuff_to_parse = ''; if (!$this->use_classes) { $string_attributes = ' style="' . $this->language_data['STYLES']['STRINGS'][$string_key] . '"'; } else { $string_attributes = ' class="st'.$string_key.'"'; } // now handle the string $string = "" . GeSHi::hsc($char); $start = $i + $char_len; $string_open = true; if(empty($this->language_data['ESCAPE_REGEXP'])) { $next_escape_regexp_pos = $length; } do { //Get the regular ending pos ... $close_pos = strpos($part, $char, $start); if(false === $close_pos) { $close_pos = $length; } if($this->lexic_permissions['ESCAPE_CHAR']) { // update escape regexp cache if needed if (isset($this->language_data['ESCAPE_REGEXP']) && $next_escape_regexp_pos < $start) { $next_escape_regexp_pos = $length; foreach ($this->language_data['ESCAPE_REGEXP'] as $escape_key => $regexp) { $match_i = false; if (isset($escape_regexp_cache_per_key[$escape_key]) && ($escape_regexp_cache_per_key[$escape_key]['pos'] >= $start || $escape_regexp_cache_per_key[$escape_key]['pos'] === false)) { // we have already matched something if ($escape_regexp_cache_per_key[$escape_key]['pos'] === false) { // this comment is never matched continue; } $match_i = $escape_regexp_cache_per_key[$escape_key]['pos']; } else if ( //This is to allow use of the offset parameter in preg_match and stay as compatible with older PHP versions as possible (GESHI_PHP_PRE_433 && preg_match($regexp, substr($part, $start), $match, PREG_OFFSET_CAPTURE)) || (!GESHI_PHP_PRE_433 && preg_match($regexp, $part, $match, PREG_OFFSET_CAPTURE, $start)) ) { $match_i = $match[0][1]; if (GESHI_PHP_PRE_433) { $match_i += $start; } $escape_regexp_cache_per_key[$escape_key] = array( 'key' => $escape_key, 'length' => strlen($match[0][0]), 'pos' => $match_i ); } else { $escape_regexp_cache_per_key[$escape_key]['pos'] = false; continue; } if ($match_i !== false && $match_i < $next_escape_regexp_pos) { $next_escape_regexp_pos = $match_i; $next_escape_regexp_key = $escape_key; if ($match_i === $start) { break; } } } } //Find the next simple escape position if('' != $this->language_data['ESCAPE_CHAR']) { $simple_escape = strpos($part, $this->language_data['ESCAPE_CHAR'], $start); if(false === $simple_escape) { $simple_escape = $length; } } else { $simple_escape = $length; } } else { $next_escape_regexp_pos = $length; $simple_escape = $length; } if($simple_escape < $next_escape_regexp_pos && $simple_escape < $length && $simple_escape < $close_pos) { //The nexxt escape sequence is a simple one ... $es_pos = $simple_escape; //Add the stuff not in the string yet ... $string .= $this->hsc(substr($part, $start, $es_pos - $start)); //Get the style for this escaped char ... if (!$this->use_classes) { $escape_char_attributes = ' style="' . $this->language_data['STYLES']['ESCAPE_CHAR'][0] . '"'; } else { $escape_char_attributes = ' class="es0"'; } //Add the style for the escape char ... $string .= "" . GeSHi::hsc($this->language_data['ESCAPE_CHAR']); //Get the byte AFTER the ESCAPE_CHAR we just found $es_char = $part[$es_pos + 1]; if ($es_char == "\n") { // don't put a newline around newlines $string .= "\n"; $start = $es_pos + 2; } else if (ord($es_char) >= 128) { //This is an non-ASCII char (UTF8 or single byte) //This code tries to work around SF#2037598 ... if(function_exists('mb_substr')) { $es_char_m = mb_substr(substr($part, $es_pos+1, 16), 0, 1, $this->encoding); $string .= $es_char_m . ''; } else if (!GESHI_PHP_PRE_433 && 'utf-8' == $this->encoding) { if(preg_match("/[\xC2-\xDF][\x80-\xBF]". "|\xE0[\xA0-\xBF][\x80-\xBF]". "|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}". "|\xED[\x80-\x9F][\x80-\xBF]". "|\xF0[\x90-\xBF][\x80-\xBF]{2}". "|[\xF1-\xF3][\x80-\xBF]{3}". "|\xF4[\x80-\x8F][\x80-\xBF]{2}/s", $part, $es_char_m, null, $es_pos + 1)) { $es_char_m = $es_char_m[0]; } else { $es_char_m = $es_char; } $string .= $this->hsc($es_char_m) . ''; } else { $es_char_m = $this->hsc($es_char); } $start = $es_pos + strlen($es_char_m) + 1; } else { $string .= $this->hsc($es_char) . ''; $start = $es_pos + 2; } } else if ($next_escape_regexp_pos < $length && $next_escape_regexp_pos < $close_pos) { $es_pos = $next_escape_regexp_pos; //Add the stuff not in the string yet ... $string .= $this->hsc(substr($part, $start, $es_pos - $start)); //Get the key and length of this match ... $escape = $escape_regexp_cache_per_key[$next_escape_regexp_key]; $escape_str = substr($part, $es_pos, $escape['length']); $escape_key = $escape['key']; //Get the style for this escaped char ... if (!$this->use_classes) { $escape_char_attributes = ' style="' . $this->language_data['STYLES']['ESCAPE_CHAR'][$escape_key] . '"'; } else { $escape_char_attributes = ' class="es' . $escape_key . '"'; } //Add the style for the escape char ... $string .= "" . $this->hsc($escape_str) . ''; $start = $es_pos + $escape['length']; } else { //Copy the remainder of the string ... $string .= $this->hsc(substr($part, $start, $close_pos - $start + $char_len)) . ''; $start = $close_pos + $char_len; $string_open = false; } } while($string_open); if ($check_linenumbers) { // Are line numbers used? If, we should end the string before // the newline and begin it again (so when
  • s are put in the source // remains XHTML compliant) // note to self: This opens up possibility of config files specifying // that languages can/cannot have multiline strings??? $string = str_replace("\n", "\n", $string); } $result .= $string; $string = ''; $i = $start - 1; continue; } else if ($this->lexic_permissions['STRINGS'] && $hq && $hq[0] == $char && substr($part, $i, $hq_strlen) == $hq) { // The start of a hard quoted string if (!$this->use_classes) { $string_attributes = ' style="' . $this->language_data['STYLES']['STRINGS']['HARD'] . '"'; $escape_char_attributes = ' style="' . $this->language_data['STYLES']['ESCAPE_CHAR']['HARD'] . '"'; } else { $string_attributes = ' class="st_h"'; $escape_char_attributes = ' class="es_h"'; } // parse the stuff before this $result .= $this->parse_non_string_part($stuff_to_parse); $stuff_to_parse = ''; // now handle the string $string = ''; // look for closing quote $start = $i + $hq_strlen; while ($close_pos = strpos($part, $this->language_data['HARDQUOTE'][1], $start)) { $start = $close_pos + 1; if ($this->lexic_permissions['ESCAPE_CHAR'] && $part[$close_pos - 1] == $this->language_data['HARDCHAR']) { // make sure this quote is not escaped foreach ($this->language_data['HARDESCAPE'] as $hardescape) { if (substr($part, $close_pos - 1, strlen($hardescape)) == $hardescape) { // check wether this quote is escaped or if it is something like '\\' $escape_char_pos = $close_pos - 1; while ($escape_char_pos > 0 && $part[$escape_char_pos - 1] == $this->language_data['HARDCHAR']) { --$escape_char_pos; } if (($close_pos - $escape_char_pos) & 1) { // uneven number of escape chars => this quote is escaped continue 2; } } } } // found closing quote break; } //Found the closing delimiter? if (!$close_pos) { // span till the end of this $part when no closing delimiter is found $close_pos = $length; } //Get the actual string $string = substr($part, $i, $close_pos - $i + 1); $i = $close_pos; // handle escape chars and encode html chars // (special because when we have escape chars within our string they may not be escaped) if ($this->lexic_permissions['ESCAPE_CHAR'] && $this->language_data['ESCAPE_CHAR']) { $start = 0; $new_string = ''; while ($es_pos = strpos($string, $this->language_data['ESCAPE_CHAR'], $start)) { // hmtl escape stuff before $new_string .= $this->hsc(substr($string, $start, $es_pos - $start)); // check if this is a hard escape foreach ($this->language_data['HARDESCAPE'] as $hardescape) { if (substr($string, $es_pos, strlen($hardescape)) == $hardescape) { // indeed, this is a hardescape $new_string .= "" . $this->hsc($hardescape) . ''; $start = $es_pos + strlen($hardescape); continue 2; } } // not a hard escape, but a normal escape // they come in pairs of two $c = 0; while (isset($string[$es_pos + $c]) && isset($string[$es_pos + $c + 1]) && $string[$es_pos + $c] == $this->language_data['ESCAPE_CHAR'] && $string[$es_pos + $c + 1] == $this->language_data['ESCAPE_CHAR']) { $c += 2; } if ($c) { $new_string .= "" . str_repeat($escaped_escape_char, $c) . ''; $start = $es_pos + $c; } else { // this is just a single lonely escape char... $new_string .= $escaped_escape_char; $start = $es_pos + 1; } } $string = $new_string . $this->hsc(substr($string, $start)); } else { $string = $this->hsc($string); } if ($check_linenumbers) { // Are line numbers used? If, we should end the string before // the newline and begin it again (so when
  • s are put in the source // remains XHTML compliant) // note to self: This opens up possibility of config files specifying // that languages can/cannot have multiline strings??? $string = str_replace("\n", "\n", $string); } $result .= "" . $string . ''; $string = ''; continue; } else { //Have a look for regexp comments if ($i == $next_comment_regexp_pos) { $COMMENT_MATCHED = true; $comment = $comment_regexp_cache_per_key[$next_comment_regexp_key]; $test_str = $this->hsc(substr($part, $i, $comment['length'])); //@todo If remove important do remove here if ($this->lexic_permissions['COMMENTS']['MULTI']) { if (!$this->use_classes) { $attributes = ' style="' . $this->language_data['STYLES']['COMMENTS'][$comment['key']] . '"'; } else { $attributes = ' class="co' . $comment['key'] . '"'; } $test_str = "" . $test_str . ""; // Short-cut through all the multiline code if ($check_linenumbers) { // strreplace to put close span and open span around multiline newlines $test_str = str_replace( "\n", "\n", str_replace("\n ", "\n ", $test_str) ); } } $i += $comment['length'] - 1; // parse the rest $result .= $this->parse_non_string_part($stuff_to_parse); $stuff_to_parse = ''; } // If we haven't matched a regexp comment, try multi-line comments if (!$COMMENT_MATCHED) { // Is this a multiline comment? if (!empty($this->language_data['COMMENT_MULTI']) && $next_comment_multi_pos < $i) { $next_comment_multi_pos = $length; foreach ($this->language_data['COMMENT_MULTI'] as $open => $close) { $match_i = false; if (isset($comment_multi_cache_per_key[$open]) && ($comment_multi_cache_per_key[$open] >= $i || $comment_multi_cache_per_key[$open] === false)) { // we have already matched something if ($comment_multi_cache_per_key[$open] === false) { // this comment is never matched continue; } $match_i = $comment_multi_cache_per_key[$open]; } else if (($match_i = stripos($part, $open, $i)) !== false) { $comment_multi_cache_per_key[$open] = $match_i; } else { $comment_multi_cache_per_key[$open] = false; continue; } if ($match_i !== false && $match_i < $next_comment_multi_pos) { $next_comment_multi_pos = $match_i; $next_open_comment_multi = $open; if ($match_i === $i) { break; } } } } if ($i == $next_comment_multi_pos) { $open = $next_open_comment_multi; $close = $this->language_data['COMMENT_MULTI'][$open]; $open_strlen = strlen($open); $close_strlen = strlen($close); $COMMENT_MATCHED = true; $test_str_match = $open; //@todo If remove important do remove here if ($this->lexic_permissions['COMMENTS']['MULTI'] || $open == GESHI_START_IMPORTANT) { if ($open != GESHI_START_IMPORTANT) { if (!$this->use_classes) { $attributes = ' style="' . $this->language_data['STYLES']['COMMENTS']['MULTI'] . '"'; } else { $attributes = ' class="coMULTI"'; } $test_str = "" . $this->hsc($open); } else { if (!$this->use_classes) { $attributes = ' style="' . $this->important_styles . '"'; } else { $attributes = ' class="imp"'; } // We don't include the start of the comment if it's an // "important" part $test_str = ""; } } else { $test_str = $this->hsc($open); } $close_pos = strpos( $part, $close, $i + $open_strlen ); if ($close_pos === false) { $close_pos = $length; } // Short-cut through all the multiline code $rest_of_comment = $this->hsc(substr($part, $i + $open_strlen, $close_pos - $i - $open_strlen + $close_strlen)); if (($this->lexic_permissions['COMMENTS']['MULTI'] || $test_str_match == GESHI_START_IMPORTANT) && $check_linenumbers) { // strreplace to put close span and open span around multiline newlines $test_str .= str_replace( "\n", "\n", str_replace("\n ", "\n ", $rest_of_comment) ); } else { $test_str .= $rest_of_comment; } if ($this->lexic_permissions['COMMENTS']['MULTI'] || $test_str_match == GESHI_START_IMPORTANT) { $test_str .= ''; } $i = $close_pos + $close_strlen - 1; // parse the rest $result .= $this->parse_non_string_part($stuff_to_parse); $stuff_to_parse = ''; } } // If we haven't matched a multiline comment, try single-line comments if (!$COMMENT_MATCHED) { // cache potential single line comment occurances if (!empty($this->language_data['COMMENT_SINGLE']) && $next_comment_single_pos < $i) { $next_comment_single_pos = $length; foreach ($this->language_data['COMMENT_SINGLE'] as $comment_key => $comment_mark) { $match_i = false; if (isset($comment_single_cache_per_key[$comment_key]) && ($comment_single_cache_per_key[$comment_key] >= $i || $comment_single_cache_per_key[$comment_key] === false)) { // we have already matched something if ($comment_single_cache_per_key[$comment_key] === false) { // this comment is never matched continue; } $match_i = $comment_single_cache_per_key[$comment_key]; } else if ( // case sensitive comments ($this->language_data['CASE_SENSITIVE'][GESHI_COMMENTS] && ($match_i = stripos($part, $comment_mark, $i)) !== false) || // non case sensitive (!$this->language_data['CASE_SENSITIVE'][GESHI_COMMENTS] && (($match_i = strpos($part, $comment_mark, $i)) !== false))) { $comment_single_cache_per_key[$comment_key] = $match_i; } else { $comment_single_cache_per_key[$comment_key] = false; continue; } if ($match_i !== false && $match_i < $next_comment_single_pos) { $next_comment_single_pos = $match_i; $next_comment_single_key = $comment_key; if ($match_i === $i) { break; } } } } if ($next_comment_single_pos == $i) { $comment_key = $next_comment_single_key; $comment_mark = $this->language_data['COMMENT_SINGLE'][$comment_key]; $com_len = strlen($comment_mark); // This check will find special variables like $# in bash // or compiler directives of Delphi beginning {$ if ((empty($sc_disallowed_before) || ($i == 0) || (false === strpos($sc_disallowed_before, $part[$i-1]))) && (empty($sc_disallowed_after) || ($length <= $i + $com_len) || (false === strpos($sc_disallowed_after, $part[$i + $com_len])))) { // this is a valid comment $COMMENT_MATCHED = true; if ($this->lexic_permissions['COMMENTS'][$comment_key]) { if (!$this->use_classes) { $attributes = ' style="' . $this->language_data['STYLES']['COMMENTS'][$comment_key] . '"'; } else { $attributes = ' class="co' . $comment_key . '"'; } $test_str = "" . $this->hsc($this->change_case($comment_mark)); } else { $test_str = $this->hsc($comment_mark); } //Check if this comment is the last in the source $close_pos = strpos($part, "\n", $i); $oops = false; if ($close_pos === false) { $close_pos = $length; $oops = true; } $test_str .= $this->hsc(substr($part, $i + $com_len, $close_pos - $i - $com_len)); if ($this->lexic_permissions['COMMENTS'][$comment_key]) { $test_str .= ""; } // Take into account that the comment might be the last in the source if (!$oops) { $test_str .= "\n"; } $i = $close_pos; // parse the rest $result .= $this->parse_non_string_part($stuff_to_parse); $stuff_to_parse = ''; } } } } // Where are we adding this char? if (!$COMMENT_MATCHED) { $stuff_to_parse .= $char; } else { $result .= $test_str; unset($test_str); $COMMENT_MATCHED = false; } } // Parse the last bit $result .= $this->parse_non_string_part($stuff_to_parse); $stuff_to_parse = ''; } else { $result .= $this->hsc($part); } // Close the that surrounds the block if ($STRICTATTRS != '') { $result = str_replace("\n", "\n", $result); $result .= ''; } $endresult .= $result; unset($part, $parts[$key], $result); } //This fix is related to SF#1923020, but has to be applied regardless of //actually highlighting symbols. /** NOTE: memorypeak #3 */ $endresult = str_replace(array('', ''), array(';', '|'), $endresult); // // Parse the last stuff (redundant?) // $result .= $this->parse_non_string_part($stuff_to_parse); // Lop off the very first and last spaces // $result = substr($result, 1, -1); // We're finished: stop timing $this->set_time($start_time, microtime()); $this->finalise($endresult); return $endresult; } /** * Swaps out spaces and tabs for HTML indentation. Not needed if * the code is in a pre block... * * @param string The source to indent (reference!) * @since 1.0.0 * @access private */ function indent(&$result) { /// Replace tabs with the correct number of spaces if (false !== strpos($result, "\t")) { $lines = explode("\n", $result); $result = null;//Save memory while we process the lines individually $tab_width = $this->get_real_tab_width(); $tab_string = ' ' . str_repeat(' ', $tab_width); for ($key = 0, $n = count($lines); $key < $n; $key++) { $line = $lines[$key]; if (false === strpos($line, "\t")) { continue; } $pos = 0; $length = strlen($line); $lines[$key] = ''; // reduce memory $IN_TAG = false; for ($i = 0; $i < $length; ++$i) { $char = $line[$i]; // Simple engine to work out whether we're in a tag. // If we are we modify $pos. This is so we ignore HTML // in the line and only workout the tab replacement // via the actual content of the string // This test could be improved to include strings in the // html so that < or > would be allowed in user's styles // (e.g. quotes: '<' '>'; or similar) if ($IN_TAG) { if ('>' == $char) { $IN_TAG = false; } $lines[$key] .= $char; } else if ('<' == $char) { $IN_TAG = true; $lines[$key] .= '<'; } else if ('&' == $char) { $substr = substr($line, $i + 3, 5); $posi = strpos($substr, ';'); if (false === $posi) { ++$pos; } else { $pos -= $posi+2; } $lines[$key] .= $char; } else if ("\t" == $char) { $str = ''; // OPTIMISE - move $strs out. Make an array: // $tabs = array( // 1 => ' ', // 2 => '  ', // 3 => '   ' etc etc // to use instead of building a string every time $tab_end_width = $tab_width - ($pos % $tab_width); //Moved out of the look as it doesn't change within the loop if (($pos & 1) || 1 == $tab_end_width) { $str .= substr($tab_string, 6, $tab_end_width); } else { $str .= substr($tab_string, 0, $tab_end_width+5); } $lines[$key] .= $str; $pos += $tab_end_width; if (false === strpos($line, "\t", $i + 1)) { $lines[$key] .= substr($line, $i + 1); break; } } else if (0 == $pos && ' ' == $char) { $lines[$key] .= ' '; ++$pos; } else { $lines[$key] .= $char; ++$pos; } } } $result = implode("\n", $lines); unset($lines);//We don't need the lines separated beyond this --- free them! } // Other whitespace // BenBE: Fix to reduce the number of replacements to be done $result = preg_replace('/^ /m', ' ', $result); $result = str_replace(' ', '  ', $result); if ($this->line_numbers == GESHI_NO_LINE_NUMBERS) { if ($this->line_ending === null) { $result = nl2br($result); } else { $result = str_replace("\n", $this->line_ending, $result); } } } /** * Changes the case of a keyword for those languages where a change is asked for * * @param string The keyword to change the case of * @return string The keyword with its case changed * @since 1.0.0 * @access private */ function change_case($instr) { switch ($this->language_data['CASE_KEYWORDS']) { case GESHI_CAPS_UPPER: return strtoupper($instr); case GESHI_CAPS_LOWER: return strtolower($instr); default: return $instr; } } /** * Handles replacements of keywords to include markup and links if requested * * @param string The keyword to add the Markup to * @return The HTML for the match found * @since 1.0.8 * @access private * * @todo Get rid of ender in keyword links */ function handle_keyword_replace($match) { $k = $this->_kw_replace_group; $keyword = $match[0]; $before = ''; $after = ''; if ($this->keyword_links) { // Keyword links have been ebabled if (isset($this->language_data['URLS'][$k]) && $this->language_data['URLS'][$k] != '') { // There is a base group for this keyword // Old system: strtolower //$keyword = ( $this->language_data['CASE_SENSITIVE'][$group] ) ? $keyword : strtolower($keyword); // New system: get keyword from language file to get correct case if (!$this->language_data['CASE_SENSITIVE'][$k] && strpos($this->language_data['URLS'][$k], '{FNAME}') !== false) { foreach ($this->language_data['KEYWORDS'][$k] as $word) { if (strcasecmp($word, $keyword) == 0) { break; } } } else { $word = $keyword; } $before = '<|UR1|"' . str_replace( array( '{FNAME}', '{FNAMEL}', '{FNAMEU}', '.'), array( str_replace('+', '%20', urlencode($this->hsc($word))), str_replace('+', '%20', urlencode($this->hsc(strtolower($word)))), str_replace('+', '%20', urlencode($this->hsc(strtoupper($word)))), ''), $this->language_data['URLS'][$k] ) . '">'; $after = ''; } } return $before . '<|/'. $k .'/>' . $this->change_case($keyword) . '|>' . $after; } /** * handles regular expressions highlighting-definitions with callback functions * * @note this is a callback, don't use it directly * * @param array the matches array * @return The highlighted string * @since 1.0.8 * @access private */ function handle_regexps_callback($matches) { // before: "' style=\"' . call_user_func(\"$func\", '\\1') . '\"\\1|>'", return ' style="' . call_user_func($this->language_data['STYLES']['REGEXPS'][$this->_rx_key], $matches[1]) . '"'. $matches[1] . '|>'; } /** * handles newlines in REGEXPS matches. Set the _hmr_* vars before calling this * * @note this is a callback, don't use it directly * * @param array the matches array * @return string * @since 1.0.8 * @access private */ function handle_multiline_regexps($matches) { $before = $this->_hmr_before; $after = $this->_hmr_after; if ($this->_hmr_replace) { $replace = $this->_hmr_replace; $search = array(); foreach (array_keys($matches) as $k) { $search[] = '\\' . $k; } $before = str_replace($search, $matches, $before); $after = str_replace($search, $matches, $after); $replace = str_replace($search, $matches, $replace); } else { $replace = $matches[0]; } return $before . '<|!REG3XP' . $this->_hmr_key .'!>' . str_replace("\n", "|>\n<|!REG3XP" . $this->_hmr_key . '!>', $replace) . '|>' . $after; } /** * Takes a string that has no strings or comments in it, and highlights * stuff like keywords, numbers and methods. * * @param string The string to parse for keyword, numbers etc. * @since 1.0.0 * @access private * @todo BUGGY! Why? Why not build string and return? */ function parse_non_string_part($stuff_to_parse) { $stuff_to_parse = ' ' . $this->hsc($stuff_to_parse); // Regular expressions foreach ($this->language_data['REGEXPS'] as $key => $regexp) { if ($this->lexic_permissions['REGEXPS'][$key]) { if (is_array($regexp)) { if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) { // produce valid HTML when we match multiple lines $this->_hmr_replace = $regexp[GESHI_REPLACE]; $this->_hmr_before = $regexp[GESHI_BEFORE]; $this->_hmr_key = $key; $this->_hmr_after = $regexp[GESHI_AFTER]; $stuff_to_parse = preg_replace_callback( "/" . $regexp[GESHI_SEARCH] . "/{$regexp[GESHI_MODIFIERS]}", array($this, 'handle_multiline_regexps'), $stuff_to_parse); $this->_hmr_replace = false; $this->_hmr_before = ''; $this->_hmr_after = ''; } else { $stuff_to_parse = preg_replace( '/' . $regexp[GESHI_SEARCH] . '/' . $regexp[GESHI_MODIFIERS], $regexp[GESHI_BEFORE] . '<|!REG3XP'. $key .'!>' . $regexp[GESHI_REPLACE] . '|>' . $regexp[GESHI_AFTER], $stuff_to_parse); } } else { if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) { // produce valid HTML when we match multiple lines $this->_hmr_key = $key; $stuff_to_parse = preg_replace_callback( "/(" . $regexp . ")/", array($this, 'handle_multiline_regexps'), $stuff_to_parse); $this->_hmr_key = ''; } else { $stuff_to_parse = preg_replace( "/(" . $regexp . ")/", "<|!REG3XP$key!>\\1|>", $stuff_to_parse); } } } } // Highlight numbers. As of 1.0.8 we support diffent types of numbers $numbers_found = false; if ($this->lexic_permissions['NUMBERS'] && preg_match('#\d#', $stuff_to_parse )) { $numbers_found = true; //For each of the formats ... foreach($this->language_data['NUMBERS_RXCACHE'] as $id => $regexp) { //Check if it should be highlighted ... $stuff_to_parse = preg_replace($regexp, "<|/NUM!$id/>\\1|>", $stuff_to_parse); } } // Highlight keywords $disallowed_before = "(?|^&"; $disallowed_after = "(?![a-zA-Z0-9_\|%\\-&;"; if ($this->lexic_permissions['STRINGS']) { $quotemarks = preg_quote(implode($this->language_data['QUOTEMARKS']), '/'); $disallowed_before .= $quotemarks; $disallowed_after .= $quotemarks; } $disallowed_before .= "])"; $disallowed_after .= "])"; $parser_control_pergroup = false; if (isset($this->language_data['PARSER_CONTROL'])) { if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS'])) { $x = 0; // check wether per-keyword-group parser_control is enabled if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_BEFORE'])) { $disallowed_before = $this->language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_BEFORE']; ++$x; } if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_AFTER'])) { $disallowed_after = $this->language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_AFTER']; ++$x; } $parser_control_pergroup = (count($this->language_data['PARSER_CONTROL']['KEYWORDS']) - $x) > 0; } } // if this is changed, don't forget to change it below // if (!empty($disallowed_before)) { // $disallowed_before = "(?language_data['KEYWORDS']) as $k) { if (!isset($this->lexic_permissions['KEYWORDS'][$k]) || $this->lexic_permissions['KEYWORDS'][$k]) { $case_sensitive = $this->language_data['CASE_SENSITIVE'][$k]; $modifiers = $case_sensitive ? '' : 'i'; // NEW in 1.0.8 - per-keyword-group parser control $disallowed_before_local = $disallowed_before; $disallowed_after_local = $disallowed_after; if ($parser_control_pergroup && isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$k])) { if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$k]['DISALLOWED_BEFORE'])) { $disallowed_before_local = $this->language_data['PARSER_CONTROL']['KEYWORDS'][$k]['DISALLOWED_BEFORE']; } if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$k]['DISALLOWED_AFTER'])) { $disallowed_after_local = $this->language_data['PARSER_CONTROL']['KEYWORDS'][$k]['DISALLOWED_AFTER']; } } $this->_kw_replace_group = $k; //NEW in 1.0.8, the cached regexp list // since we don't want PHP / PCRE to crash due to too large patterns we split them into smaller chunks for ($set = 0, $set_length = count($this->language_data['CACHED_KEYWORD_LISTS'][$k]); $set < $set_length; ++$set) { $keywordset =& $this->language_data['CACHED_KEYWORD_LISTS'][$k][$set]; // Might make a more unique string for putting the number in soon // Basically, we don't put the styles in yet because then the styles themselves will // get highlighted if the language has a CSS keyword in it (like CSS, for example ;)) $stuff_to_parse = preg_replace_callback( "/$disallowed_before_local({$keywordset})(?!\(?:htm|php))$disallowed_after_local/$modifiers", array($this, 'handle_keyword_replace'), $stuff_to_parse ); } } } // // Now that's all done, replace /[number]/ with the correct styles // foreach (array_keys($this->language_data['KEYWORDS']) as $k) { if (!$this->use_classes) { $attributes = ' style="' . (isset($this->language_data['STYLES']['KEYWORDS'][$k]) ? $this->language_data['STYLES']['KEYWORDS'][$k] : "") . '"'; } else { $attributes = ' class="kw' . $k . '"'; } $stuff_to_parse = str_replace("<|/$k/>", "<|$attributes>", $stuff_to_parse); } if ($numbers_found) { // Put number styles in foreach($this->language_data['NUMBERS_RXCACHE'] as $id => $regexp) { //Commented out for now, as this needs some review ... // if ($numbers_permissions & $id) { //Get the appropriate style ... //Checking for unset styles is done by the style cache builder ... if (!$this->use_classes) { $attributes = ' style="' . $this->language_data['STYLES']['NUMBERS'][$id] . '"'; } else { $attributes = ' class="nu'.$id.'"'; } //Set in the correct styles ... $stuff_to_parse = str_replace("/NUM!$id/", $attributes, $stuff_to_parse); // } } } // Highlight methods and fields in objects if ($this->lexic_permissions['METHODS'] && $this->language_data['OOLANG']) { $oolang_spaces = "[\s]*"; $oolang_before = ""; $oolang_after = "[a-zA-Z][a-zA-Z0-9_]*"; if (isset($this->language_data['PARSER_CONTROL'])) { if (isset($this->language_data['PARSER_CONTROL']['OOLANG'])) { if (isset($this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_BEFORE'])) { $oolang_before = $this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_BEFORE']; } if (isset($this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_AFTER'])) { $oolang_after = $this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_AFTER']; } if (isset($this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_SPACES'])) { $oolang_spaces = $this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_SPACES']; } } } foreach ($this->language_data['OBJECT_SPLITTERS'] as $key => $splitter) { if (false !== strpos($stuff_to_parse, $splitter)) { if (!$this->use_classes) { $attributes = ' style="' . $this->language_data['STYLES']['METHODS'][$key] . '"'; } else { $attributes = ' class="me' . $key . '"'; } $stuff_to_parse = preg_replace("/($oolang_before)(" . preg_quote($this->language_data['OBJECT_SPLITTERS'][$key], '/') . ")($oolang_spaces)($oolang_after)/", "\\1\\2\\3<|$attributes>\\4|>", $stuff_to_parse); } } } // // Highlight brackets. Yes, I've tried adding a semi-colon to this list. // You try it, and see what happens ;) // TODO: Fix lexic permissions not converting entities if shouldn't // be highlighting regardless // if ($this->lexic_permissions['BRACKETS']) { $stuff_to_parse = str_replace( $this->language_data['CACHE_BRACKET_MATCH'], $this->language_data['CACHE_BRACKET_REPLACE'], $stuff_to_parse ); } //FIX for symbol highlighting ... if ($this->lexic_permissions['SYMBOLS'] && !empty($this->language_data['SYMBOLS'])) { //Get all matches and throw away those witin a block that is already highlighted... (i.e. matched by a regexp) $n_symbols = preg_match_all("/<\|(?:|[^>])+>(?:(?!\|>).*?)\|>|<\/a>|(?:" . $this->language_data['SYMBOL_SEARCH'] . ")+/", $stuff_to_parse, $pot_symbols, PREG_OFFSET_CAPTURE | PREG_SET_ORDER); $global_offset = 0; for ($s_id = 0; $s_id < $n_symbols; ++$s_id) { $symbol_match = $pot_symbols[$s_id][0][0]; if (strpos($symbol_match, '<') !== false || strpos($symbol_match, '>') !== false) { // already highlighted blocks _must_ include either < or > // so if this conditional applies, we have to skip this match // BenBE: UNLESS the block contains or if(strpos($symbol_match, '') === false && strpos($symbol_match, '') === false) { continue; } } // if we reach this point, we have a valid match which needs to be highlighted $symbol_length = strlen($symbol_match); $symbol_offset = $pot_symbols[$s_id][0][1]; unset($pot_symbols[$s_id]); $symbol_end = $symbol_length + $symbol_offset; $symbol_hl = ""; // if we have multiple styles, we have to handle them properly if ($this->language_data['MULTIPLE_SYMBOL_GROUPS']) { $old_sym = -1; // Split the current stuff to replace into its atomic symbols ... preg_match_all("/" . $this->language_data['SYMBOL_SEARCH'] . "/", $symbol_match, $sym_match_syms, PREG_PATTERN_ORDER); foreach ($sym_match_syms[0] as $sym_ms) { //Check if consequtive symbols belong to the same group to save output ... if (isset($this->language_data['SYMBOL_DATA'][$sym_ms]) && ($this->language_data['SYMBOL_DATA'][$sym_ms] != $old_sym)) { if (-1 != $old_sym) { $symbol_hl .= "|>"; } $old_sym = $this->language_data['SYMBOL_DATA'][$sym_ms]; if (!$this->use_classes) { $symbol_hl .= '<| style="' . $this->language_data['STYLES']['SYMBOLS'][$old_sym] . '">'; } else { $symbol_hl .= '<| class="sy' . $old_sym . '">'; } } $symbol_hl .= $sym_ms; } unset($sym_match_syms); //Close remaining tags and insert the replacement at the right position ... //Take caution if symbol_hl is empty to avoid doubled closing spans. if (-1 != $old_sym) { $symbol_hl .= "|>"; } } else { if (!$this->use_classes) { $symbol_hl = '<| style="' . $this->language_data['STYLES']['SYMBOLS'][0] . '">'; } else { $symbol_hl = '<| class="sy0">'; } $symbol_hl .= $symbol_match . '|>'; } $stuff_to_parse = substr_replace($stuff_to_parse, $symbol_hl, $symbol_offset + $global_offset, $symbol_length); // since we replace old text with something of different size, // we'll have to keep track of the differences $global_offset += strlen($symbol_hl) - $symbol_length; } } //FIX for symbol highlighting ... // Add class/style for regexps foreach (array_keys($this->language_data['REGEXPS']) as $key) { if ($this->lexic_permissions['REGEXPS'][$key]) { if (is_callable($this->language_data['STYLES']['REGEXPS'][$key])) { $this->_rx_key = $key; $stuff_to_parse = preg_replace_callback("/!REG3XP$key!(.*)\|>/U", array($this, 'handle_regexps_callback'), $stuff_to_parse); } else { if (!$this->use_classes) { $attributes = ' style="' . $this->language_data['STYLES']['REGEXPS'][$key] . '"'; } else { if (is_array($this->language_data['REGEXPS'][$key]) && array_key_exists(GESHI_CLASS, $this->language_data['REGEXPS'][$key])) { $attributes = ' class="' . $this->language_data['REGEXPS'][$key][GESHI_CLASS] . '"'; } else { $attributes = ' class="re' . $key . '"'; } } $stuff_to_parse = str_replace("!REG3XP$key!", "$attributes", $stuff_to_parse); } } } // Replace with . for urls $stuff_to_parse = str_replace('', '.', $stuff_to_parse); // Replace <|UR1| with link_styles[GESHI_LINK])) { if ($this->use_classes) { $stuff_to_parse = str_replace('<|UR1|', 'link_target . ' href=', $stuff_to_parse); } else { $stuff_to_parse = str_replace('<|UR1|', 'link_target . ' style="' . $this->link_styles[GESHI_LINK] . '" href=', $stuff_to_parse); } } else { $stuff_to_parse = str_replace('<|UR1|', 'link_target . ' href=', $stuff_to_parse); } // // NOW we add the span thingy ;) // $stuff_to_parse = str_replace('<|', '', '', $stuff_to_parse ); return substr($stuff_to_parse, 1); } /** * Sets the time taken to parse the code * * @param microtime The time when parsing started * @param microtime The time when parsing ended * @since 1.0.2 * @access private */ function set_time($start_time, $end_time) { $start = explode(' ', $start_time); $end = explode(' ', $end_time); $this->time = $end[0] + $end[1] - $start[0] - $start[1]; } /** * Gets the time taken to parse the code * * @return double The time taken to parse the code * @since 1.0.2 */ function get_time() { return $this->time; } /** * Merges arrays recursively, overwriting values of the first array with values of later arrays * * @since 1.0.8 * @access private */ function merge_arrays() { $arrays = func_get_args(); $narrays = count($arrays); // check arguments // comment out if more performance is necessary (in this case the foreach loop will trigger a warning if the argument is not an array) for ($i = 0; $i < $narrays; $i ++) { if (!is_array($arrays[$i])) { // also array_merge_recursive returns nothing in this case trigger_error('Argument #' . ($i+1) . ' is not an array - trying to merge array with scalar! Returning false!', E_USER_WARNING); return false; } } // the first array is in the output set in every case $ret = $arrays[0]; // merege $ret with the remaining arrays for ($i = 1; $i < $narrays; $i ++) { foreach ($arrays[$i] as $key => $value) { if (is_array($value) && isset($ret[$key])) { // if $ret[$key] is not an array you try to merge an scalar value with an array - the result is not defined (incompatible arrays) // in this case the call will trigger an E_USER_WARNING and the $ret[$key] will be false. $ret[$key] = $this->merge_arrays($ret[$key], $value); } else { $ret[$key] = $value; } } } return $ret; } /** * Gets language information and stores it for later use * * @param string The filename of the language file you want to load * @since 1.0.0 * @access private * @todo Needs to load keys for lexic permissions for keywords, regexps etc */ function load_language($file_name) { if ($file_name == $this->loaded_language) { // this file is already loaded! return; } //Prepare some stuff before actually loading the language file $this->loaded_language = $file_name; $this->parse_cache_built = false; $this->enable_highlighting(); $language_data = array(); //Load the language file require $file_name; // Perhaps some checking might be added here later to check that // $language data is a valid thing but maybe not $this->language_data = $language_data; // Set strict mode if should be set $this->strict_mode = $this->language_data['STRICT_MODE_APPLIES']; // Set permissions for all lexics to true // so they'll be highlighted by default foreach (array_keys($this->language_data['KEYWORDS']) as $key) { if (!empty($this->language_data['KEYWORDS'][$key])) { $this->lexic_permissions['KEYWORDS'][$key] = true; } else { $this->lexic_permissions['KEYWORDS'][$key] = false; } } foreach (array_keys($this->language_data['COMMENT_SINGLE']) as $key) { $this->lexic_permissions['COMMENTS'][$key] = true; } foreach (array_keys($this->language_data['REGEXPS']) as $key) { $this->lexic_permissions['REGEXPS'][$key] = true; } // for BenBE and future code reviews: // we can use empty here since we only check for existance and emptiness of an array // if it is not an array at all but rather false or null this will work as intended as well // even if $this->language_data['PARSER_CONTROL'] is undefined this won't trigger a notice if (!empty($this->language_data['PARSER_CONTROL']['ENABLE_FLAGS'])) { foreach ($this->language_data['PARSER_CONTROL']['ENABLE_FLAGS'] as $flag => $value) { // it's either true or false and maybe is true as well $perm = $value !== GESHI_NEVER; if ($flag == 'ALL') { $this->enable_highlighting($perm); continue; } if (!isset($this->lexic_permissions[$flag])) { // unknown lexic permission continue; } if (is_array($this->lexic_permissions[$flag])) { foreach ($this->lexic_permissions[$flag] as $key => $val) { $this->lexic_permissions[$flag][$key] = $perm; } } else { $this->lexic_permissions[$flag] = $perm; } } unset($this->language_data['PARSER_CONTROL']['ENABLE_FLAGS']); } //Fix: Problem where hardescapes weren't handled if no ESCAPE_CHAR was given //You need to set one for HARDESCAPES only in this case. if(!isset($this->language_data['HARDCHAR'])) { $this->language_data['HARDCHAR'] = $this->language_data['ESCAPE_CHAR']; } //NEW in 1.0.8: Allow styles to be loaded from a separate file to override defaults $style_filename = substr($file_name, 0, -4) . '.style.php'; if (is_readable($style_filename)) { //Clear any style_data that could have been set before ... if (isset($style_data)) { unset($style_data); } //Read the Style Information from the style file include $style_filename; //Apply the new styles to our current language styles if (isset($style_data) && is_array($style_data)) { $this->language_data['STYLES'] = $this->merge_arrays($this->language_data['STYLES'], $style_data); } } } /** * Takes the parsed code and various options, and creates the HTML * surrounding it to make it look nice. * * @param string The code already parsed (reference!) * @since 1.0.0 * @access private */ function finalise(&$parsed_code) { // Remove end parts of important declarations // This is BUGGY!! My fault for bad code: fix coming in 1.2 // @todo Remove this crap if ($this->enable_important_blocks && (strpos($parsed_code, $this->hsc(GESHI_START_IMPORTANT)) === false)) { $parsed_code = str_replace($this->hsc(GESHI_END_IMPORTANT), '', $parsed_code); } // Add HTML whitespace stuff if we're using the
    header if ($this->header_type != GESHI_HEADER_PRE && $this->header_type != GESHI_HEADER_PRE_VALID) { $this->indent($parsed_code); } // purge some unnecessary stuff /** NOTE: memorypeak #1 */ $parsed_code = preg_replace('#]+>(\s*)#', '\\1', $parsed_code); // If we are using IDs for line numbers, there needs to be an overall // ID set to prevent collisions. if ($this->add_ids && !$this->overall_id) { $this->overall_id = 'geshi-' . substr(md5(microtime()), 0, 4); } // Get code into lines /** NOTE: memorypeak #2 */ $code = explode("\n", $parsed_code); $parsed_code = $this->header(); // If we're using line numbers, we insert
  • s and appropriate // markup to style them (otherwise we don't need to do anything) if ($this->line_numbers != GESHI_NO_LINE_NUMBERS && $this->header_type != GESHI_HEADER_PRE_TABLE) { // If we're using the
     header, we shouldn't add newlines because
                // the 
     will line-break them (and the 
  • s already do this for us) $ls = ($this->header_type != GESHI_HEADER_PRE && $this->header_type != GESHI_HEADER_PRE_VALID) ? "\n" : ''; // Set vars to defaults for following loop $i = 0; // Foreach line... for ($i = 0, $n = count($code); $i < $n;) { //Reset the attributes for a new line ... $attrs = array(); // Make lines have at least one space in them if they're empty // BenBE: Checking emptiness using trim instead of relying on blanks if ('' == trim($code[$i])) { $code[$i] = ' '; } // If this is a "special line"... if ($this->line_numbers == GESHI_FANCY_LINE_NUMBERS && $i % $this->line_nth_row == ($this->line_nth_row - 1)) { // Set the attributes to style the line if ($this->use_classes) { //$attr = ' class="li2"'; $attrs['class'][] = 'li2'; $def_attr = ' class="de2"'; } else { //$attr = ' style="' . $this->line_style2 . '"'; $attrs['style'][] = $this->line_style2; // This style "covers up" the special styles set for special lines // so that styles applied to special lines don't apply to the actual // code on that line $def_attr = ' style="' . $this->code_style . '"'; } } else { if ($this->use_classes) { //$attr = ' class="li1"'; $attrs['class'][] = 'li1'; $def_attr = ' class="de1"'; } else { //$attr = ' style="' . $this->line_style1 . '"'; $attrs['style'][] = $this->line_style1; $def_attr = ' style="' . $this->code_style . '"'; } } //Check which type of tag to insert for this line if ($this->header_type == GESHI_HEADER_PRE_VALID) { $start = ""; $end = '
  • '; } else { // Span or div? $start = ""; $end = ''; } ++$i; // Are we supposed to use ids? If so, add them if ($this->add_ids) { $attrs['id'][] = "$this->overall_id-$i"; } //Is this some line with extra styles??? if (in_array($i, $this->highlight_extra_lines)) { if ($this->use_classes) { if (isset($this->highlight_extra_lines_styles[$i])) { $attrs['class'][] = "lx$i"; } else { $attrs['class'][] = "ln-xtra"; } } else { array_push($attrs['style'], $this->get_line_style($i)); } } // Add in the line surrounded by appropriate list HTML $attr_string = ''; foreach ($attrs as $key => $attr) { $attr_string .= ' ' . $key . '="' . implode(' ', $attr) . '"'; } $parsed_code .= "$start{$code[$i-1]}$end
  • $ls"; unset($code[$i - 1]); } } else { $n = count($code); if ($this->use_classes) { $attributes = ' class="de1"'; } else { $attributes = ' style="'. $this->code_style .'"'; } if ($this->header_type == GESHI_HEADER_PRE_VALID) { $parsed_code .= ''; } elseif ($this->header_type == GESHI_HEADER_PRE_TABLE) { if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) { if ($this->use_classes) { $attrs = ' class="ln"'; } else { $attrs = ' style="'. $this->table_linenumber_style .'"'; } $parsed_code .= ''; // get linenumbers // we don't merge it with the for below, since it should be better for // memory consumption this way // @todo: but... actually it would still be somewhat nice to merge the two loops // the mem peaks are at different positions for ($i = 0; $i < $n; ++$i) { $close = 0; // fancy lines if ($this->line_numbers == GESHI_FANCY_LINE_NUMBERS && $i % $this->line_nth_row == ($this->line_nth_row - 1)) { // Set the attributes to style the line if ($this->use_classes) { $parsed_code .= ''; } else { // This style "covers up" the special styles set for special lines // so that styles applied to special lines don't apply to the actual // code on that line $parsed_code .= '' .''; } $close += 2; } //Is this some line with extra styles??? if (in_array($i + 1, $this->highlight_extra_lines)) { if ($this->use_classes) { if (isset($this->highlight_extra_lines_styles[$i])) { $parsed_code .= ""; } else { $parsed_code .= ""; } } else { $parsed_code .= "get_line_style($i) . "\">"; } ++$close; } $parsed_code .= $this->line_numbers_start + $i; if ($close) { $parsed_code .= str_repeat('', $close); } else if ($i != $n) { $parsed_code .= "\n"; } } $parsed_code .= ''; } $parsed_code .= ''; } // No line numbers, but still need to handle highlighting lines extra. // Have to use divs so the full width of the code is highlighted $close = 0; for ($i = 0; $i < $n; ++$i) { // Make lines have at least one space in them if they're empty // BenBE: Checking emptiness using trim instead of relying on blanks if ('' == trim($code[$i])) { $code[$i] = ' '; } // fancy lines if ($this->line_numbers == GESHI_FANCY_LINE_NUMBERS && $i % $this->line_nth_row == ($this->line_nth_row - 1)) { // Set the attributes to style the line if ($this->use_classes) { $parsed_code .= ''; } else { // This style "covers up" the special styles set for special lines // so that styles applied to special lines don't apply to the actual // code on that line $parsed_code .= '' .''; } $close += 2; } //Is this some line with extra styles??? if (in_array($i + 1, $this->highlight_extra_lines)) { if ($this->use_classes) { if (isset($this->highlight_extra_lines_styles[$i])) { $parsed_code .= ""; } else { $parsed_code .= ""; } } else { $parsed_code .= "get_line_style($i) . "\">"; } ++$close; } $parsed_code .= $code[$i]; if ($close) { $parsed_code .= str_repeat('', $close); $close = 0; } elseif ($i + 1 < $n) { $parsed_code .= "\n"; } unset($code[$i]); } if ($this->header_type == GESHI_HEADER_PRE_VALID || $this->header_type == GESHI_HEADER_PRE_TABLE) { $parsed_code .= ''; } if ($this->header_type == GESHI_HEADER_PRE_TABLE && $this->line_numbers != GESHI_NO_LINE_NUMBERS) { $parsed_code .= ''; } } $parsed_code .= $this->footer(); } /** * Creates the header for the code block (with correct attributes) * * @return string The header for the code block * @since 1.0.0 * @access private */ function header() { // Get attributes needed /** * @todo Document behaviour change - class is outputted regardless of whether * we're using classes or not. Same with style */ $attributes = ' class="' . $this->language; if ($this->overall_class != '') { $attributes .= " ".$this->overall_class; } $attributes .= '"'; if ($this->overall_id != '') { $attributes .= " id=\"{$this->overall_id}\""; } if ($this->overall_style != '') { $attributes .= ' style="' . $this->overall_style . '"'; } $ol_attributes = ''; if ($this->line_numbers_start != 1) { $ol_attributes .= ' start="' . $this->line_numbers_start . '"'; } // Get the header HTML $header = $this->header_content; if ($header) { if ($this->header_type == GESHI_HEADER_PRE || $this->header_type == GESHI_HEADER_PRE_VALID) { $header = str_replace("\n", '', $header); } $header = $this->replace_keywords($header); if ($this->use_classes) { $attr = ' class="head"'; } else { $attr = " style=\"{$this->header_content_style}\""; } if ($this->header_type == GESHI_HEADER_PRE_TABLE && $this->line_numbers != GESHI_NO_LINE_NUMBERS) { $header = "$header"; } else { $header = "$header"; } } if (GESHI_HEADER_NONE == $this->header_type) { if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) { return "$header"; } return $header . ($this->force_code_block ? '
    ' : ''); } // Work out what to return and do it if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) { if ($this->header_type == GESHI_HEADER_PRE) { return "$header"; } else if ($this->header_type == GESHI_HEADER_DIV || $this->header_type == GESHI_HEADER_PRE_VALID) { return "$header"; } else if ($this->header_type == GESHI_HEADER_PRE_TABLE) { return "$header"; } } else { if ($this->header_type == GESHI_HEADER_PRE) { return "$header" . ($this->force_code_block ? '
    ' : ''); } else { return "$header" . ($this->force_code_block ? '
    ' : ''); } } } /** * Returns the footer for the code block. * * @return string The footer for the code block * @since 1.0.0 * @access private */ function footer() { $footer = $this->footer_content; if ($footer) { if ($this->header_type == GESHI_HEADER_PRE) { $footer = str_replace("\n", '', $footer);; } $footer = $this->replace_keywords($footer); if ($this->use_classes) { $attr = ' class="foot"'; } else { $attr = " style=\"{$this->footer_content_style}\""; } if ($this->header_type == GESHI_HEADER_PRE_TABLE && $this->line_numbers != GESHI_NO_LINE_NUMBERS) { $footer = "$footer"; } else { $footer = "$footer
    "; } } if (GESHI_HEADER_NONE == $this->header_type) { return ($this->line_numbers != GESHI_NO_LINE_NUMBERS) ? '' . $footer : $footer; } if ($this->header_type == GESHI_HEADER_DIV || $this->header_type == GESHI_HEADER_PRE_VALID) { if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) { return "$footer
    "; } return ($this->force_code_block ? '
    ' : '') . "$footer"; } elseif ($this->header_type == GESHI_HEADER_PRE_TABLE) { if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) { return "$footer"; } return ($this->force_code_block ? '' : '') . "$footer"; } else { if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) { return "$footer"; } return ($this->force_code_block ? '' : '') . "$footer"; } } /** * Replaces certain keywords in the header and footer with * certain configuration values * * @param string The header or footer content to do replacement on * @return string The header or footer with replaced keywords * @since 1.0.2 * @access private */ function replace_keywords($instr) { $keywords = $replacements = array(); $keywords[] = '
      to have no effect at all if there are line numbers // (
        s have margins that should be destroyed so all layout is // controlled by the set_overall_style method, which works on the //
         or 
        container). Additionally, set default styles for lines if (!$economy_mode || $this->line_numbers != GESHI_NO_LINE_NUMBERS) { //$stylesheet .= "$selector, {$selector}ol, {$selector}ol li {margin: 0;}\n"; $stylesheet .= "$selector.de1, $selector.de2 {{$this->code_style}}\n"; } // Add overall styles // note: neglect economy_mode, empty styles are meaningless if ($this->overall_style != '') { $stylesheet .= "$selector {{$this->overall_style}}\n"; } // Add styles for links // note: economy mode does not make _any_ sense here // either the style is empty and thus no selector is needed // or the appropriate key is given. foreach ($this->link_styles as $key => $style) { if ($style != '') { switch ($key) { case GESHI_LINK: $stylesheet .= "{$selector}a:link {{$style}}\n"; break; case GESHI_HOVER: $stylesheet .= "{$selector}a:hover {{$style}}\n"; break; case GESHI_ACTIVE: $stylesheet .= "{$selector}a:active {{$style}}\n"; break; case GESHI_VISITED: $stylesheet .= "{$selector}a:visited {{$style}}\n"; break; } } } // Header and footer // note: neglect economy_mode, empty styles are meaningless if ($this->header_content_style != '') { $stylesheet .= "$selector.head {{$this->header_content_style}}\n"; } if ($this->footer_content_style != '') { $stylesheet .= "$selector.foot {{$this->footer_content_style}}\n"; } // Styles for important stuff // note: neglect economy_mode, empty styles are meaningless if ($this->important_styles != '') { $stylesheet .= "$selector.imp {{$this->important_styles}}\n"; } // Simple line number styles if ((!$economy_mode || $this->line_numbers != GESHI_NO_LINE_NUMBERS) && $this->line_style1 != '') { $stylesheet .= "{$selector}li, {$selector}.li1 {{$this->line_style1}}\n"; } if ((!$economy_mode || $this->line_numbers != GESHI_NO_LINE_NUMBERS) && $this->table_linenumber_style != '') { $stylesheet .= "{$selector}.ln {{$this->table_linenumber_style}}\n"; } // If there is a style set for fancy line numbers, echo it out if ((!$economy_mode || $this->line_numbers == GESHI_FANCY_LINE_NUMBERS) && $this->line_style2 != '') { $stylesheet .= "{$selector}.li2 {{$this->line_style2}}\n"; } // note: empty styles are meaningless foreach ($this->language_data['STYLES']['KEYWORDS'] as $group => $styles) { if ($styles != '' && (!$economy_mode || (isset($this->lexic_permissions['KEYWORDS'][$group]) && $this->lexic_permissions['KEYWORDS'][$group]))) { $stylesheet .= "$selector.kw$group {{$styles}}\n"; } } foreach ($this->language_data['STYLES']['COMMENTS'] as $group => $styles) { if ($styles != '' && (!$economy_mode || (isset($this->lexic_permissions['COMMENTS'][$group]) && $this->lexic_permissions['COMMENTS'][$group]) || (!empty($this->language_data['COMMENT_REGEXP']) && !empty($this->language_data['COMMENT_REGEXP'][$group])))) { $stylesheet .= "$selector.co$group {{$styles}}\n"; } } foreach ($this->language_data['STYLES']['ESCAPE_CHAR'] as $group => $styles) { if ($styles != '' && (!$economy_mode || $this->lexic_permissions['ESCAPE_CHAR'])) { // NEW: since 1.0.8 we have to handle hardescapes if ($group === 'HARD') { $group = '_h'; } $stylesheet .= "$selector.es$group {{$styles}}\n"; } } foreach ($this->language_data['STYLES']['BRACKETS'] as $group => $styles) { if ($styles != '' && (!$economy_mode || $this->lexic_permissions['BRACKETS'])) { $stylesheet .= "$selector.br$group {{$styles}}\n"; } } foreach ($this->language_data['STYLES']['SYMBOLS'] as $group => $styles) { if ($styles != '' && (!$economy_mode || $this->lexic_permissions['SYMBOLS'])) { $stylesheet .= "$selector.sy$group {{$styles}}\n"; } } foreach ($this->language_data['STYLES']['STRINGS'] as $group => $styles) { if ($styles != '' && (!$economy_mode || $this->lexic_permissions['STRINGS'])) { // NEW: since 1.0.8 we have to handle hardquotes if ($group === 'HARD') { $group = '_h'; } $stylesheet .= "$selector.st$group {{$styles}}\n"; } } foreach ($this->language_data['STYLES']['NUMBERS'] as $group => $styles) { if ($styles != '' && (!$economy_mode || $this->lexic_permissions['NUMBERS'])) { $stylesheet .= "$selector.nu$group {{$styles}}\n"; } } foreach ($this->language_data['STYLES']['METHODS'] as $group => $styles) { if ($styles != '' && (!$economy_mode || $this->lexic_permissions['METHODS'])) { $stylesheet .= "$selector.me$group {{$styles}}\n"; } } // note: neglect economy_mode, empty styles are meaningless foreach ($this->language_data['STYLES']['SCRIPT'] as $group => $styles) { if ($styles != '') { $stylesheet .= "$selector.sc$group {{$styles}}\n"; } } foreach ($this->language_data['STYLES']['REGEXPS'] as $group => $styles) { if ($styles != '' && (!$economy_mode || (isset($this->lexic_permissions['REGEXPS'][$group]) && $this->lexic_permissions['REGEXPS'][$group]))) { if (is_array($this->language_data['REGEXPS'][$group]) && array_key_exists(GESHI_CLASS, $this->language_data['REGEXPS'][$group])) { $stylesheet .= "$selector."; $stylesheet .= $this->language_data['REGEXPS'][$group][GESHI_CLASS]; $stylesheet .= " {{$styles}}\n"; } else { $stylesheet .= "$selector.re$group {{$styles}}\n"; } } } // Styles for lines being highlighted extra if (!$economy_mode || (count($this->highlight_extra_lines)!=count($this->highlight_extra_lines_styles))) { $stylesheet .= "{$selector}.ln-xtra, {$selector}li.ln-xtra, {$selector}div.ln-xtra {{$this->highlight_extra_lines_style}}\n"; } $stylesheet .= "{$selector}span.xtra { display:block; }\n"; foreach ($this->highlight_extra_lines_styles as $lineid => $linestyle) { $stylesheet .= "{$selector}.lx$lineid, {$selector}li.lx$lineid, {$selector}div.lx$lineid {{$linestyle}}\n"; } return $stylesheet; } /** * Get's the style that is used for the specified line * * @param int The line number information is requested for * @access private * @since 1.0.7.21 */ function get_line_style($line) { //$style = null; $style = null; if (isset($this->highlight_extra_lines_styles[$line])) { $style = $this->highlight_extra_lines_styles[$line]; } else { // if no "extra" style assigned $style = $this->highlight_extra_lines_style; } return $style; } /** * this functions creates an optimized regular expression list * of an array of strings. * * Example: * $list = array('faa', 'foo', 'foobar'); * => string 'f(aa|oo(bar)?)' * * @param $list array of (unquoted) strings * @param $regexp_delimiter your regular expression delimiter, @see preg_quote() * @return string for regular expression * @author Milian Wolff * @since 1.0.8 * @access private */ function optimize_regexp_list($list, $regexp_delimiter = '/') { $regex_chars = array('.', '\\', '+', '*', '?', '[', '^', ']', '$', '(', ')', '{', '}', '=', '!', '<', '>', '|', ':', $regexp_delimiter); sort($list); $regexp_list = array(''); $num_subpatterns = 0; $list_key = 0; // the tokens which we will use to generate the regexp list $tokens = array(); $prev_keys = array(); // go through all entries of the list and generate the token list $cur_len = 0; for ($i = 0, $i_max = count($list); $i < $i_max; ++$i) { if ($cur_len > GESHI_MAX_PCRE_LENGTH) { // seems like the length of this pcre is growing exorbitantly $regexp_list[++$list_key] = $this->_optimize_regexp_list_tokens_to_string($tokens); $num_subpatterns = substr_count($regexp_list[$list_key], '(?:'); $tokens = array(); $cur_len = 0; } $level = 0; $entry = preg_quote((string) $list[$i], $regexp_delimiter); $pointer = &$tokens; // properly assign the new entry to the correct position in the token array // possibly generate smaller common denominator keys while (true) { // get the common denominator if (isset($prev_keys[$level])) { if ($prev_keys[$level] == $entry) { // this is a duplicate entry, skip it continue 2; } $char = 0; while (isset($entry[$char]) && isset($prev_keys[$level][$char]) && $entry[$char] == $prev_keys[$level][$char]) { ++$char; } if ($char > 0) { // this entry has at least some chars in common with the current key if ($char == strlen($prev_keys[$level])) { // current key is totally matched, i.e. this entry has just some bits appended $pointer = &$pointer[$prev_keys[$level]]; } else { // only part of the keys match $new_key_part1 = substr($prev_keys[$level], 0, $char); $new_key_part2 = substr($prev_keys[$level], $char); if (in_array($new_key_part1[0], $regex_chars) || in_array($new_key_part2[0], $regex_chars)) { // this is bad, a regex char as first character $pointer[$entry] = array('' => true); array_splice($prev_keys, $level, count($prev_keys), $entry); $cur_len += strlen($entry); continue; } else { // relocate previous tokens $pointer[$new_key_part1] = array($new_key_part2 => $pointer[$prev_keys[$level]]); unset($pointer[$prev_keys[$level]]); $pointer = &$pointer[$new_key_part1]; // recreate key index array_splice($prev_keys, $level, count($prev_keys), array($new_key_part1, $new_key_part2)); $cur_len += strlen($new_key_part2); } } ++$level; $entry = substr($entry, $char); continue; } // else: fall trough, i.e. no common denominator was found } if ($level == 0 && !empty($tokens)) { // we can dump current tokens into the string and throw them away afterwards $new_entry = $this->_optimize_regexp_list_tokens_to_string($tokens); $new_subpatterns = substr_count($new_entry, '(?:'); if (GESHI_MAX_PCRE_SUBPATTERNS && $num_subpatterns + $new_subpatterns > GESHI_MAX_PCRE_SUBPATTERNS) { $regexp_list[++$list_key] = $new_entry; $num_subpatterns = $new_subpatterns; } else { if (!empty($regexp_list[$list_key])) { $new_entry = '|' . $new_entry; } $regexp_list[$list_key] .= $new_entry; $num_subpatterns += $new_subpatterns; } $tokens = array(); $cur_len = 0; } // no further common denominator found $pointer[$entry] = array('' => true); array_splice($prev_keys, $level, count($prev_keys), $entry); $cur_len += strlen($entry); break; } unset($list[$i]); } // make sure the last tokens get converted as well $new_entry = $this->_optimize_regexp_list_tokens_to_string($tokens); if (GESHI_MAX_PCRE_SUBPATTERNS && $num_subpatterns + substr_count($new_entry, '(?:') > GESHI_MAX_PCRE_SUBPATTERNS) { $regexp_list[++$list_key] = $new_entry; } else { if (!empty($regexp_list[$list_key])) { $new_entry = '|' . $new_entry; } $regexp_list[$list_key] .= $new_entry; } return $regexp_list; } /** * this function creates the appropriate regexp string of an token array * you should not call this function directly, @see $this->optimize_regexp_list(). * * @param &$tokens array of tokens * @param $recursed bool to know wether we recursed or not * @return string * @author Milian Wolff * @since 1.0.8 * @access private */ function _optimize_regexp_list_tokens_to_string(&$tokens, $recursed = false) { $list = ''; foreach ($tokens as $token => $sub_tokens) { $list .= $token; $close_entry = isset($sub_tokens['']); unset($sub_tokens['']); if (!empty($sub_tokens)) { $list .= '(?:' . $this->_optimize_regexp_list_tokens_to_string($sub_tokens, true) . ')'; if ($close_entry) { // make sub_tokens optional $list .= '?'; } } $list .= '|'; } if (!$recursed) { // do some optimizations // common trailing strings // BUGGY! //$list = preg_replace_callback('#(?<=^|\:|\|)\w+?(\w+)(?:\|.+\1)+(?=\|)#', create_function( // '$matches', 'return "(?:" . preg_replace("#" . preg_quote($matches[1], "#") . "(?=\||$)#", "", $matches[0]) . ")" . $matches[1];'), $list); // (?:p)? => p? $list = preg_replace('#\(\?\:(.)\)\?#', '\1?', $list); // (?:a|b|c|d|...)? => [abcd...]? // TODO: a|bb|c => [ac]|bb static $callback_2; if (!isset($callback_2)) { $callback_2 = create_function('$matches', 'return "[" . str_replace("|", "", $matches[1]) . "]";'); } $list = preg_replace_callback('#\(\?\:((?:.\|)+.)\)#', $callback_2, $list); } // return $list without trailing pipe return substr($list, 0, -1); } } // End Class GeSHi if (!function_exists('geshi_highlight')) { /** * Easy way to highlight stuff. Behaves just like highlight_string * * @param string The code to highlight * @param string The language to highlight the code in * @param string The path to the language files. You can leave this blank if you need * as from version 1.0.7 the path should be automatically detected * @param boolean Whether to return the result or to echo * @return string The code highlighted (if $return is true) * @since 1.0.2 */ function geshi_highlight($string, $language, $path = null, $return = false) { $geshi = new GeSHi($string, $language, $path); $geshi->set_header_type(GESHI_HEADER_NONE); if ($return) { return '' . $geshi->parse_code() . ''; } echo '' . $geshi->parse_code() . ''; if ($geshi->error()) { return false; } return true; } } ?>pgfouine-1.2/include/reporting/geshi/docs/0000755000175000017500000000000011516212335017246 5ustar acmeacmepgfouine-1.2/include/reporting/geshi/docs/COPYING0000644000175000017500000004313110336177512020311 0ustar acmeacme GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. pgfouine-1.2/include/reporting/geshi/docs/BUGS0000644000175000017500000000353411172452234017740 0ustar acmeacme BUGS - list of known bugs in GeSHi Version 1.0.8 - Number highlighting is quite poor [possibly better now] - I'm not happy with URLS - there still could be extra bugs, and it's rather unflexible (see TODO for a possible fix) - "Important" sections for some reason seem to have their spans added after every newline up until the next lexic, instead of stopping at the part. In fact, context sensitiveness is quite poor... - Using the extra line number highlighting feature without actually using line numbers will result in malformed XHTML (not sure about this one though...) - Slow!!! Especially for source with lots of strings in it. GeSHi will work acceptably for sourcecode under 5K (for simple language files like SQL, a 100K file can be highlighted in just 6 seconds), but above about 25K things get a little slow... If you're using this as part of some larger software, you may want to think about making some sort of "cache" effect to speed things up and reduce server load. - The result is built by string replacement instead of by building another string based on the source, that would be much safer. The focus of releases beyond 1.0.7 will be on changing this behaviour, which may well fix some of the other bugs mentioned above. - As of 1.0.7.1, dots (.) are allowed before keywords. This may change highlighting of some things slightly, if you notice anything odd about the highlighting then please report it to me. - Perl/Javascript /.../ regex syntax is only supported basically and there's no guarantee it is working all the time. - The
         header output is not XHTML compliant. Please use the 
        header instead. Send any bug reports to BenBE@omorphia.de, or submit them via the bug tracker at sourceforge (http://sourceforge.net/tracker/?group_id=114997&atid=670231) pgfouine-1.2/include/reporting/geshi/docs/THANKS0000644000175000017500000001666711172452234020203 0ustar acmeacme THANKS - List of credits for GeSHi I owe these people/groups my thanks for help with GeSHi. Thanks, guys! - Amit Gupta - Thanks for all that constructive criticism - it's a great help for making GeSHi even better. And thanks for the Wordpress plugin! (Anyone who is interested in the plugin can visit: http://blog.igeek.info/still-fresh/category/wp-plugins/igsyntax-hiliter/) - Andreas Gohr - Thanks for language files and for using GeSHi for DokuWiki (http://www.splitbrain.org/dokuwiki/wiki:dokuwiki). And thanks for all your criticisms and for that stylesheet-maker code :). Also, thanks for the UTF-8 patch. - Andreas von Oettingen - Thanks for those great ideas! :) - bbspliff - Thanks for pointing out that bug (pity I already found it though ;)) - Benny Baumann - Thanks for your innumerable suggestions for improvements, and your work on Delphi support :) - Ben Keen - Thanks for the language files and pointing out some ideas for future releases. Lookin' forward to seeing that software soon! ;) - Brian Cheesman - Thanks for using GeSHi in phpCvsView, and for the suggestion about extension => language lookup - Christian Weiske - Thanks for the inspiration for creating advanced regexp highlighting :D - Cliff Stanford - Thanks for the hardquote support for C# and Perl (can be used elsewhere I'm sure) - David Gartner - Thanks for using GeSHi in net2ftp, and for the idea about a load_from_file method - forum.qbasicnews.com - Thanks for putting up with the crappy versions that I "forced" on you guys before ;) - Jack Lloyd - Thanks for pointing out the versioning and method CSS bugs, and giving me the extra C/C++ keywords - Karim Scheik - Thanks for the php5 support report - Marcin Gryszkalis - Thanks for those links for C, Java, Perl - M. Uli Kusterer - Thanks for the idea about URL case conversion - Milian Wolff - Thanks for the loads of optimizations - Thanks for helping with implementation of various features - Roberto Armellin - Thanks for pointing out some flaws in GeSHi (that will be solved in 1.2 guaranteed) - Sterling Christensen - Thanks for those links to language specs - Tux - Thanks for making all those language files :D - zbw - Thanks for proving a phpBB port was possible PEOPE WHO MADE LANGUAGE FILES - ABAP Andres Picazo - Actionscript Steffen Krause (french translation by NikO) - ActionScript 3 Jordi Boggiano (version for ActionScript3 and MXML) - Ada Tux - Apache Tux - Applescript Stephan Klimek - Apt sources.list Milian Wolff - ASM Tux - ASP Amit Gupta - AutoIT mastrboy - AviSynth Ryan Jones - Bash Andreas Gohr - Basic4GL Matthew Webb - BlitzBasic P�draig O`Connel - BNF Rowan Rodrik van der Molen - Boo Marcus Griep - Brainfuck \ Brainfork Benny Baumann - C++ Dennis Bayer, M. Uli Kusterer - C++/QT Iulian M - C# Alan Juden - C for Macs M. Uli Kusterer - CADDCL Roberto Rossi - CadLisp Roberto Rossi - CDFG John Horigan - CIL Marcus Griep - COBOL Benny Baumann - ColdFusion Diego - D Thomas Kuehne - DCS Stelio Passaris - Delphi Járja Norbert, Benny Baumann - Div Gabriel Lorenzo - DOS Alessandro Staltari - Eiffel Zoran Simic - eMail \ mbox Benny Baumann - FreeBasic Roberto Rossi - Fortran Cedric Arrabie - glSlang Benny Baumann - Gettext Milian Wolff - GNU make Neil Bird - Gnuplot Milian Wolff - GML José Jorge Enríquez Rodríguez - Groovy Ivan F. Villanueva B. - Haskell Dagit - HQ9+ Benny Baumann - Ini Deguix - Inno Thomas Klinger - INTERCAL Benny Baumann - Java 5 Clemens Bruckmann - Javascript Ben Keen - KiXtart Riley McArdle - KLone C Mickael Auger - KLone C++ Mickael Auger - LaTeX Matthais Pospiech - Lisp Roberto Rossi - Locomotive Basic Nacho Cabanes - LOLcode Benny Baumann - LScript Beau McGuigan - LSL2 William Fry - Lua Roberto Rossi - m86k Benny Baumann - mIRC Alberto de Areba Sánchez - Modula-3 Martin Bishop - MPASM Bakalex - MXML David Spurr - MySQL Carl Fürstenberg, Marjolein Katsma - NSIS Tux, Deguix - Oberon-2 Mike Mol - Objective C M. Uli Kusterer - Ocaml Flaie - Ocaml-brief Flaie - OpenOffice.org BASIC Roberto Rossi - Oracle 8 Guy Wicks - Oracle 11i Simon Redhead - Pascal Tux - Perl Andreas Gohr, Ben Keen - PIC16xxx assembler Phil Mattison - Pixel Bender Richard Olsson - PL/SQL Victor Engmark - POV-Ray Carl Fürstenberg - PowerShell Frode Aarebrot - Progress Marco Aurelio de Pasqual - Prolog Benny Baumann - ProvideX Jeff Wilder - Python Roberto Rossi - Rails Moises Deniz - Rebol Lecanu Guillaume - Reg SmokingRope - Robots Christian Lescuyer - Ruby Amit Gupta, Moises Deniz - SAS Galen Johnson - SDLBasic Roberto Rossi - Scheme Jon Raphaelson - SciLab Christophe David - Smalltalk Bananeweizen - Smarty Alan Juden - T-SQL Duncan Lock - TeraTerm Boris Maisuradze - Text SmokingRope - TCL Reid van Melle - thinBasic Eros Olmi - TypoScript Jan-Philipp Halle - Uno IDL Cedric Bosdonnat - VB Roberto Rossi - VB.NET Alan Juden - Verilog Günter Dannoritzer - VIM Script Swaroop C H - Visual FoxPro Roberto Armellin - Visual Prolog Thomas Linder Puls - Whitespace Benny Baumann - Winbatch Craig Storey - X++ Simon Butcher - Xorg config Milian Wolff - Z80 Assembler Benny Baumann Do you want your name in here? Help me out! Make a language file, or suggest a new feature, or make a plugin for GeSHi for some other software, then tell me about it!pgfouine-1.2/include/reporting/geshi/docs/TODO0000644000175000017500000000624211172452234017744 0ustar acmeacme TODO - List of things to do as of 2005/01/29 Suggestions for things to add are welcome, if you have a feature request you can either post it to the forums: http://qbnz.com/highlighter/forum.php Or to the feature request tracker: http://sourceforge.net/tracker/?group_id=114997&atid=670234 TODO for version 1.0.8.x - Rework the load_from_file method and the one for getting a file extension, as documented in the source. - use analogous vars to $next_comment_regexp_pos for more GeSHi structures, should reduce number of functions called and hence improve performance - make a set of default colours which can be used in the language files. this way we can give languages a uniform look and maybe even add "themes" - Get better coverage in our coderepo - README / INSTALL / ... file for phpdoc integration => take geshi-doc.*? - rework HARDQUOTE + styles, currently this is a bit of a mess imo (milian) - Allow per-keywordgroup AutoCaps/NoCaps - Complete API to support latest features set_number_style ($key missing) set_string_style ($key missing) set_case_keywords (support for per_keywordgroup AutoCaps) TODO for version 1.2.0 - Rewrite engine to use remove/replace method (will hopefully almost eliminate the need for regular expressions except for numbers/methods etc). This will also assist for making different output formats [DONE] - "Intelligent" output format - eg if the user doesn't want lines to wrap and wants line numbers don't use
          , use the method instead. (This saves on output) - Clear split between "public" and "private" methods [DONE] - PHP5 version - "Themes" for styles - basically pre-made stylesheets that can be used to highlight code of any language in a similar manner [DONE] - "Dialects" for languages - eg php4, php5. One master language definition file, and a bunch of "specialised" dialect files for each language Ability to specify a "specialised" dialect as default? [DONE] - Look at load/memory usage and try to reduce - Make tabs into tab-stops like a normal editor [DONE] - Ability to add more than one multiline comment or string [DONE] - Ability to specify that strings cannot be multiline [DONE] - Create a "wrapper" class for ultra-easy use - Code written in a style that conforms to a phpdoc utility [DONE, PEAR] - Dig functions/methods out of code and where they are called make an internal link back to their definition TODO for version 2.0.0 - Support for multiple output formats (XHTML, XML, PDF, RTF etc) [DONE IN 1.2] - Support for auto-indent/code "beautifing" - Option for "Lite" highlighting - aims for speed and low server load - "Intelligent" highlighting inside comments, and ability to highlight source in multiple languages at once (eg PHP+HTML) [DONE IN 1.2] - Perhaps a script on the GeSHi site that would map urls to appropriate definitions and relocate the user? (eg, java documentation is structured in such a way that urls are not able to be used with GeSHi. Instead the URL could become: http://qbnz.com/highlighter/redirect.php?lang=java&kw=KeyWord and that script would redirect to the correct location. [BETTER FIX IN 1.2] $Id: TODO 1727 2008-08-08 13:36:52Z benbe $ pgfouine-1.2/include/reporting/geshi/docs/README0000644000175000017500000000266211172452234020136 0ustar acmeacme GeSHi - GEneric Syntax HIghlighter ---------------------------------- Version 1.0.8 Author: Nigel McNie, Benny Baumann Email: nigel@geshi.org, BenBE@omorphia.de GeSHi Website: http://qbnz.com/highlighter GeSHi is a generic syntax highlighter, written in PHP. You simply input the source code you wish to highlight with the language you wish to use, and the output will be a file syntax highlighted to XHTML standards. For more information on how to use GeSHi, please consult the documentation. If you got this readme from a GeSHi package, then the documentation is available in the docs/ directory. Documentation is also available at http://qbnz.com/highlighter/documentation.php If you think you've found a bug in GeSHi, contact me with a bug report at BenBE@omorphia.de, or submit it to the bug tracker at http://sourceforge.net/tracker/?group_id=114997&atid=670231. Be aware that minor highlighting errors may well just be incorrect language files, but if you do find something major please contact me. And if you're using GeSHi as a plugin/mod for some other software, please tell me about it! It's worth a link to you, and I can give you specialist help if you need it. GeSHi is free software, released under the GNU GPL. Please see the COPYING file for more information. If you do modify this program, please tell me about it! Perhaps you've made a good improvement that I can learn from :) pgfouine-1.2/include/reporting/geshi/docs/CHANGES0000644000175000017500000011332311172452234020246 0ustar acmeacme CHANGES - Changelog for GeSHi (geshi.php only) Changes to the code are listed under the version they occured in, with who suggested it by each one (if there's nobody listed as suggesting it I dreamed it up :)). Users who suggested an idea often also provided the code that was used as a basis for the changes - thanks to all who suggested these ideas and gave me the code to show me how! Language files listed under each version were made by the author beside them, and then modified by me for consistency/bug fixing. Please send any bug reports to BenBE@omorphia.de, or use the bug report tracker at sourceforge (http://sourceforge.net/tracker/?group_id=114997&atid=670231) Version 1.0.8.3 - Added language files * DCS (Stelio Passaris) * Locomotive Basic (Nacho Cabanes) * LSL2 (Linden Scripting Language) (William Fry) * Modula-3 (Martin Bishop) * Oberon-2 (Mike Mol) * Rebol (Lecanu Guillaume) - Fixed a problem where HardEscapes weren't working when no escape char was given (BenBE) - Added a PARSER_CONTROL setting to treat whitespace inside of keywords in the language file as "any whitespace" in the source (i.e. "CREATE TABLE" in SQL will match "CREATE\s+TABLE" instead of literally matching) (BenBE) - Added a possibility to allow setting the style for escape characters (BenBE) - Improvements to language files (BenBE) * Added some missing Perl keywords and obscure default variables (BenBE) * Allow for escaped colons to appear in CSS names (BenBE, simon) * Added multiline continuation suppoert of preprocessor defines for C, C for Mac, C++ and CC++ with Qt support (BenBE) * keywords for C-based languages are case-sensitive (BenBE) * Broken AutoIt highlighting (BenBE) * Problem with escaped backslash in PHP and D (BenBE) * Added some more functions for PHP (BenBE) * Some changes for AppleScript (Stefan Klieme) * Forbid highlighting keywords followed by / in bash (BenBE) * Updated the LaTeX file to link some keywords (BenBE) * Additional text rendered when matching special variables for PowerShell (BenBE) * Added some more keywords for ABAP (BenBE, Sandra Rossi, Jacob Laursen) Version 1.0.8.2 - Added language files * Brainfuck \ Brainfork (Benny Baumann) * HQ9+ (Benny Baumann) * INTERCAL (Benny Baumann) * LOLcode (Benny Baumann) * LScript (Beau McGuigan) * Pixel Bender (Richard Olsson) * ProvideX (Jeff Wilder) * VIM Script (Swaroop C H) * Visual Prolog (Thomas Linder Puls) * Whitespace (Benny Baumann) - Changed priority for COMMENT_REGEXP compared to String highlighting (BenBE) - Fixed correct escaping of spaces inside of URLs (BenBE) - Updated the list of common file extensions (BenBE) - Updated the language file check script in contrib/ (BenBE) - Fixed a problem with link targets resulting in unclickable links (SF#2379120, BenBE) - Fixed an undefined variable issue in langcheck.php (BenBE) - Improvements to language files (BenBE) * eMail Header highlighting now uses the correct delimiters for keywords (BenBE) * eMail (RFC822\mbox) highlighting now highlights IPs, MIME types and subfield assignments correctly (BenBE) * Minor style changes in COBOL to improve loading performance (BenBE) * Added some missing keywords for D (BenBE) * Removed duplicate keywords from Progres, SAS and TSQL (BenBE) * Fixed Heredoc Syntax for Bash (SF#2185319, BenBE) * Moved symbol-lookalike sequences from keyword groups to separate symbol group for languages asp, klonec, klonecpp, php, php-brief (BenBE) * Fixed a lot of duplicate keyword warnings (BenBE) * Added missing keywords to the Python language file, introducing support for Python 3.0. (SF#2441839, milian) * Updated documentation links for TypoScript (SF#2014276, BenBE) * Fixed a problem with tag and attribute names in XML highlighting (SF#2276119, BenBE) * Improved MySQL language file (BenBE, JavaWoman) * Some commentss accidentially mistaken for DocComments (SF#2454897, BenBE) * Added improved Escape Char handling for c, c_mac, cpp and cpp_qt (SF#2458743, BenBE) Version 1.0.8.1 - Added language files * AviSynth (Ryan Jones) * eMail \ mbox (Benny Baumann) * GNU Make (Neil Bird) * Oracle 11i support (Simon Redhead) * Prolog (Benny Baumann) * SciLab (Christophe David) * TeraTerm macro language (Boris Maisuradze) - Added support for Escape Regular Expressions (BenBE) * Implemented C-style Escapes in PHP (BenBE) * Introduced support for \xAB and \007 style Char Escapes in PHP (BenBE) * Implemented Variable Highlighting in PHP (BenBE) * Implemented Variable Highlighting in Bash (milian) - Fixed a problem with PCRE patterns for Keyword matching sometimes producing very large strings, that could not be handled by some versions of PCRE lib, causing broken highlighting an Regexp Compile errors (BenBE, milian) - Fixed broken highlighting of bash commands like `dbus-send --dest=org.....`, i.e. the dest was highlighted as variable declaration (milian) - Fixed broken highlighting of some symbols in their escaped form (BenBE) ( and were accidentially filtered even though they are valid) - Fixed a "memory leak" in the *_regexp_caches (milian) - Fixed broken Escape chars if classes were disabled - start_line_numbers_at() was ignored when GESHI_HEADER_PRE_TABLE was set (revulo) - Fixed a problem allowing Remote Code Inclusion under certain circumstances (BenBE) - Changes to default CSS in order to make the GESHI_HEADER_PRE_TABLE align properly, even on Windows / Mac systems with strange fonts (milian, revulo, ^RT) - Minor style changes to the following languages: * cpp-qt (milian) * MySQL (BenBE) * PHP (BenBE) - Improvements to language files (BenBE, milian) * Added MinSpareThread\MaxSpareThreads to Apache highlighter (BenBE) * Added new Keyword group for APT sources.list highlighter (BenBE) * Fixed highlighting in LaTeX for \begin{} and \end{}, i.e. the stuff inside the curly braces. (milian, thanks for the report go to Matthias Pospiech) * Improved String support for D (BenBE) * MySQL was seriously broken (BenBE) * Reworked Keyword groups for MySQL to allow for more configuration (BenBE) * Improved Mirc script language file (milian) * Improved C++ Qt language file (milian) * Minor bug with Transpose Operator in Matlab (BenBE, Daniele de Rigo) * Highlighting of Batch Files for Windows (BenBE) * Updated AutoIt to include latest changes for AutoIt v3.2.12.1 (BenBE, Thierry) * Fixed duplicate keyword warnings for Perl, Tcl and Typoscript (BenBE) * Fixed Doc-URL getting reparsed by highlighted keywords of other groups (BenBE, Jordi Boggiano) Version 1.0.8 - Added language files * APT sources.list (milian) * Boo (Marcus Griep) * CIL (Common Intermediate Language, .NET Assembly) (Marcus Griep) * COBOL (Benny Baumann) * Gnuplot (milian) * KLoneC (Mickael Auger) * KLoneC++ (Mickael Auger) * PIC16xxx assembler (Phil Mattison) * POV-Ray (Carl Fürstenberg) * PowerShell (Frode Aarebrot) * Progress (Marco Aurelio de Pasqual) * TypoScript (Jan-Philipp Halle) * Xorg configuration (milian) - Make GeSHi's constructor arguments optional, so something like `$foo = new GeSHi;` is possible. (milian) - Added an optimizer for lists to regular expressions. Using these cached lists results in a speedup of approx. 50%. The slightly increased memory consumption (~150KB for PHP language file) is more than worth it! (milian) - Some more memory & speed optimizations all over GeSHi (milian) * Reduced memory overhead when highlighting keywords (BenBE) * Keyword Linking now uses considerably less strtolower calls (milian) * Cache Symbol Search Regexp and make Symbol Highlighting faster (milian) * Use more native functions like substr_replace and strcasecmp to speed things up (milian) * Use considerably less strlen() calls on various points by caching the results (milian) * Properly set comments to be case insensitive where appropriate to increase performance (milian) * Improve the performance of the strict mode tokenizer, making highlighting of languages like HTML, ColdFusion or XML faster (milian) * Setup caches for parsing on demand to make stylesheet generators fast (milian) - Various improvements to Strict Block Handling (BenBE, milian) * Added support for RegExp-based Strict Blocks (BenBE) * Fixed highlighting incorrectly stopping at ?> in PHP (SF#1330968, BenBE) * Languages with STRICT_MODE_APPLIES = GESHI_MAYBE default to strict mode now. When no highlightable code is found in this mode, we fallback to the same setting as if GESHI_NEVER was set. That way it should not be needed to call enable_strictmode() manually. (milian) - Added new GESHI_HEADER_PRE_VALID type which uses the following markup: (milian) * With line numbers:
          header
          1. ...
          2. ...
          * Without line numbers:
          header...CODE...
          => valid HTML and no need for   indentation - Added new GESHI_HEADER_PRE_TABLE type which can be used to prevent linenumber-selection in Firefox on copy'n'paste. (milian) - set_language will not reset any language settings by default anymore. * Added $force_reset param for to force full reload of a language. (milian) * Make sure strict_mode is set properly when doing repeated set_language calls (milian) - Fixed some problems with old PHP versions (SF#1975625, milian, BenBE) - Fixed broken use with Suhosin Patch when /e modifier was disabled (SF#2021800, BenBE) - Added support for external style information files to override language defaults without modifying language files (BenBE) - The overall_class is now up to the user, and the language-code is _always_ added as a class (milian) - Fixed Economy Mode for GeSHi::get_stylesheet() - now it just makes so much more sense! (milian) - Fixed Economy Mode when COMMENT_REGEXP are used (BenBE) - Changed the default encoding to use UTF-8, due to SF#2037598, BenBE) - Improved overall string support: * Added support for multichar string delimiters (SF#1932083, BenBE) * Fixed problems of unfinished strings and comments producing invalid XHTML (SF#1996353, BenBE) * Multichar Quotemarks sometimes had inconsistent behaviour (BenBE) * Support for multiple styles of strings depending on the starter (BenBE) * Properly handle escapes in strings, i.e. '\\' was not working properly before (milian) * Fixed escape char support when an escape char is followed by multi-byte chars (SF#2037598, BenBE) - Improved flexibility in language files (BenBE, milian) * Added PARSER_CONTROL for OOLANG method highlighting (SF#1923060, BenBE) * Added possibility to define strict blocks using an Regexp (BenBE) * Removed explicit escaping of / in Regular Expressions (BenBE) * Ignoring empty keyword groups when highlighting (milian) * Make language_permissions configurable in language files via ['PARSER_CONTROL']['ENABLE_FLAGS'] this makes is_a calls unneeded and thus prevents PHP notices in PHP 5.x (milian) * Extended support for number formats now covering the most common formats (SF#1923058, BenBE) * Lifted a limitation that keywords had to have at least 2 subsequent letters (BenBE) * Changed behaviour of PARSER_CONTROL now allowing to provide the full Lookahead and Lookbehind expressions used as delimiters inside keywords instead of a simple char group (BenBE) * Fixed improper handling of newlines in REGEXPS so this does not produce invalid html anylonger (milian) - Some typos and mistakes in the documentation (BenBE) - Added a script to contrib/ to verify language files are correct (BenBE) - Fixed loads of compliancy warnings detected with that automated compliance testing script (BenBE) - Many other improvements to various language files (BenBE, milian) * Reduce strict errors & notices for language files (milian) * Fixed symbol highlighting with C++ sometimes missing keywords after ; and comments (BenBE) * Improved comment handling with TCL (Lars Hellström, BenBE) * Fixed broken handling with XML comments (BenBE, SF#1849233) * Fixed HTML comments spawning multiple lines producing invalid XHTML output (SF#1738173, BenBE) * Added support for parameters beginning with dash in BASH language (BenBE) * Support Apache's configuration sections, see http://httpd.apache.org/docs/2.2/sections.html (milian) * Minor issue with PHP Heredoc and Nowdoc syntax sometimes not getting highlighted (BenBE) * Updated Objective-C language file (SF#2013961, Quinn Taylor, BenBE) * Added some keywords for VHDL (beshig, BenBE) * Fixed severly broken ColdFusion language file (milian) * Fixed some incorrectly highlighted things with the CSS language file (milian, BenBE) * Improved Smarty language file (milian) * Improved CSS language file (milian) * Improved Pascal language file (milian) * Improved LaTeX language file (Ðндрей Парамонов, BenBE) * Fixed a regular expression in mIRC language file that caused a warning message to be issued (BenBE) * Removed <, > and / from HTML names, now only containing the real tag names (BenBE) * Use spaces instead of tabs for indendation in language files to have a consistent coding standard accross geshi files (milian) * Added some comment styles, keywords and added index highlighting (Chusslove Illich, ЧаÑлав Илић) - Removed some private methods which were only called at exactly one place (milian) * format_header_content * format_footer_content * get_attributes - Second part of default style changes. Affected in this release: * C++ * C++ (QT) * CSS * VHDL Version 1.0.7.22 - Added language files * glSlang (BenBE) * KiXtart (Riley McArdle) * Lotus Notes @Formulas (Richard Civil) * LotusScript (Richard Civil) * MXML (David Spurr) * Scala (Franco Lombardo) * ActionScript 3 (Jordi Boggiano) * GNU Gettext .po/.pot (Milian Wolff) * Verilog (Günter Dannoritzer) - Fixed a problem not yet addressed in 1.0.7.21 regarding highlighting of symbols that caused some extra characters to be added in the output or broke highlighting and standard compliance due to missing escaping of internally used characters (SF#192320 and SF#1926259, BenBE) - Fixed missing style information for ocaml language file (The_PHP_Jedi) - Fixed a bug causing masses of warnings in rendered output if language file miss style information (The_PHP_Jedi, BenBE) - Missing tab width information could lead to warnings (BenBE) - Missing symbol information for ASP (SF#1952038, nfsupport, BenBE) - Empty delimiter message with OOoBasic (BenBE, Ccornell) - Escaping of comments in LaTeX ignored (SF#1749806, BenBE) - Modified Math environment $$ in LaTeX to be non-greedy (BenBE) - Added possibility to match a regexp as comment (SF#1914640, SF#1945301, SF#1934832, BenBE) - Introduced C-Style multiline continuation comments (SF#1914640, SF#1945301, BenBE) - Introduced Fortran Comments (SF#1914640, SF#1934832, BenBE) - Implemented Heredoc and Nowdoc Syntax for PHP and Perl (SF#1914640, BenBE) - Implemented Compiler Directives for Delphi (SF#1914640, BenBE) - Implemented minimalistic support for JavaScript \ Perl Regular Expressions (SF#1786665, SF#1754333, SF#1956631, BenBE) - Fixed Strings in Matlab to be handled as comments instead of regexps, to prevent keywords being linked (BenBE) - Applied PARSER_CONTROL fix of CPP for CPP-QT-Derivative (BenBE) - Fixed incorrect treatment of unequally long multiline comment separators (related to SF #1891630, BenBE) - Added PARSER_CONTROL settings for keywords in ASM language file (SF#1835148, BenBE) - Fixed missing CASSE_SENSITIVE entry for DOS language file (SF#1956314, BenBE) - Fixed accidential highlighting of keywords in argument names (SF#1956456, Milian Wolff, BenBE) - Fixed yet again some #-related bash problem (SF#1956459, Milian Wolff, BenBE) - Added backticks as symbols (Milian Wolff) - Example script remembers selections and source submitted (Milian Wolff) - Example script allows remembered source and preselected language to be cleared (Milian Wolff) - Example script now properly includes geshi and doesn't suppress error messages anylonger. (Milian Wolff) - Code cleanup by using direct string indexing instead of substr with length 1 (Milian Wolff) - Optimized generation of code parts in strict mode (Milian Wolff) - Optimized COMMENT_REGEXP by using an incremental regexp cache (Milian Wolff, BenBE) - Fixed a problem that rarely skipped highlighting of escaped chars which usually should have gotten highlighted (BenBE) - Optimized generation of highlighted strings to use fast skip forward while highlighting them (Milian Wolff, BenBE) - Optimization using basic rework of indent function improving tab expansion performance (BenBE) - Lots of other minor optimizations based on coding style improvements (Milian Wolff) - Implemented setting to force spans to be closed before newlines, see SF#1727398 (Milian Wolff) - Added missing credits for D language file to THANKS file (SF#1720899, BenBE) - Optimization to prevent loading the current language file twice (Milian Wolff) - Optimization: Use file_get_contents() to load sourcecode from files. Even if GeSHi worked with PHP 4.1 before, it doesn't now. (Milian Wolff) - Added description of extra language features (SF#1970248, BenBE) - Added support for highlighting the C# using and namespace directives (SF #1395677, BenBE) - Added support for highlighting the Java import and package directives (SF #1395677, BenBE) - Fixed minor problem in Haskell cuasing accidential start of comment (SF#1987221, BenBE) - Fixed minor issue causing loads of warnings if a language files defines no symbols (BenBE) - Updated some aspects of the documentation and included further hints (BenBE) - First of series of color scheme changes. Affected languages (sofar): * Assembler (x86) * Bash * C * C# * Delphi * Fortran77 * glSlang * Java & Java 5 * JavaScript * OCaml * OpenOffice.org Basic * Pascal * Perl * PHP and PHP-Brief Version 1.0.7.21 - Added language files * Basic4GL (Matthew Webb) - Fixed problem with mIRC language highlighting spaces only (BenBE) - Language files can now specify a function to be called to decide the colour of a regular expression match - Added single quote to Lua (Darrin Roenfanz) - Compare comments case insensitively (fixes AutoIT comments somewhat) (Daniel Gordon) - Fixed symbols not being highlighted at all (SF #1767953, BenBE) - Fixed brackets not correctly managed (SF #1767954, BenBE) - Changed default languages for some extensions - Included color and character information for symbol highlighting in some languages (BenBE) - Fixed a problem with extension detection if default was used (BenBE) - Fixed a highlighting problem with the LaTeX language (SF #1776182, BenBE) - Added a new parameter for enable_highlighting to reduce source duplication (SF #1786104, BenBE) - Updated doxygen documentation to include since tags and some missing parameters - Disabled symbol highlighting by default (doesn't affect brackets, cf. documentation) (BenBE) - Added a check for set_case_keywords for the given param to be supported (BenBE) - Minor rework of the HTML documentation layout \ W3C compliance (BenBE) - Fixed highlighting error in bash language avoiding keywords in comments (SF #1786314, SF #1564839, BenBE) - Fixed template params for C++ and C# not being highlighted (SF #1772919, BenBE) - Fixed more reported problems about mirc highlighting - Added some missing keywords for VB.NET - Fixed some warnings in DOS language file (Florian Angehrn) - Add possibility to handle more than one extra line style (SF #1698255, German Rumm, BenBE) - Fixed handling of URLs when output case differs from URL case (SF #1815504, Tom Samstag, BenBE) - Fixed POD (Plain Old Documentation) format problems breaking highlighting of Perl (SF #1891630, Shannon Wynter, BenBE) - Fixed a problem with mIRC when & was used for identifiers (SF #1875552, BenBE) Version 1.0.7.20 - Added language files * Genero (logic) and Per (forms) (FOURJ's Genero 4GL) (Lars Gersmann) * Haskell (Dagit) * ABAP (Andres Picazo) * Motorola 68k Assembler (for MC68HC908GP32 Microcontroller) (BenBE) * Dot (Adrien Friggeri) - Fixed java documentation search for keywords to actually go to the documentation (spaze) - Applied fix for bug 1688864 (bad regexes) (Tim Starling) - Fixed comment CSS rule in visualfoxpro - ThinBASIC language update (Eros Olmi) - mIRC language update (BenBE) - Fixed outdated documentation URL of Perl language file (RuralMoon by BenBE) - Fixed tab replacement code not generating the correct number of spaces in some cases (Guillermo Calvo) - Fixed two typos in Z80 language file - Applied fix for bug 1730168 (Daniel Naber) - Applied fix for bug 1705482 (Jason Frame) * Configurable line endings (Replace \n by custom string) * per-language tab-widths (Adjustable for width>=1) * Included defaults for ASM (x86, m68k, z80), C, C (Mac), C++, C++ (QT), C#, Delphi, CSS,, HTML, PHP, PHP (Brief), QBasic, Ruby, XML - Added a possibility to force generation of a surrounding tag around the highlighted source - Applied fix for additional keywords for the bash language (cf. http://bash.thefreebizhost.com/bash_geshi.php, BenBE / Jan G) - Fix bad colour definition in GML language (Andreas Gohr) - Fixed phpdoc comments not being indented one space if they should be (Andy Hassall) Version 1.0.7.19 - Added language files * X++ (Simon Butcher) * Rails (Moises Deniz) - Fixed invalid HTML being generated and doctypes not being highlighted over multiple lines properly when line numbers are on (Validome) - Improved the ruby syntax highlighting by basing it off the Rails file - Changed some regular expressions to possibly help with badly performing regex support in PHP (Tim Starling) - Allow {TIME}, {LANGUAGE} and {VERSION} to be used in the header as well as the normal
          '; $previousDay = ''; for($i = 0; $i < $hourCount; $i++) { $hour = $hours[$i]; $hourTimestamp = strtotime($hour); $counter =& $hourlyStatistics[$hour]; $currentDay = date('Y-m-d', $hourTimestamp); if($currentDay != $previousDay) { $day = date('M j', $hourTimestamp); $previousDay = $currentDay; } else { $day = ' '; } if($counter->getQueryCount() > 0) { $queryDuration = $counter->getQueryDuration() / $counter->getQueryCount(); } else { $queryDuration = ' '; } if($counter->getSelectCount() > 0) { $selectDuration = $counter->getSelectDuration() / $counter->getSelectCount(); } else { $selectDuration = ' '; } $writeCount = $counter->getInsertCount() + $counter->getDeleteCount() + $counter->getUpdateCount(); if($writeCount > 0) { $writeDuration = ($counter->getInsertDuration() + $counter->getDeleteDuration() + $counter->getUpdateDuration()) / $writeCount; } else { $writeDuration = ' '; } $html .= ' '; } $html .= '
          Day Time Queries SELECT queries Write queries
          Count Av. duration ('.CONFIG_DURATION_UNIT.') Count Av. duration ('.CONFIG_DURATION_UNIT.') INSERT UPDATE DELETE Av. duration ('.CONFIG_DURATION_UNIT.')
          '.$day.' '.date('ga', $hourTimestamp).' '.$counter->getQueryCount().' '.$this->formatDuration($queryDuration).' '.$counter->getSelectCount().' '.$this->formatDuration($selectDuration).' '.$counter->getInsertCount().' '.$counter->getUpdateCount().' '.$counter->getDeleteCount().' '.$this->formatDuration($writeDuration).'
          '; return $html; } function getHtmlWithGraphs() { $statsListener =& $this->reportAggregator->getListener('HourlyCountersListener'); $graphsGenerated = $this->generateGraphs($statsListener); $html = $this->getHtml(); if(in_array('hourly_queries_per_second', $graphsGenerated)) { $html .= '

          Queries per second

          '; } if(in_array('hourly_all_queries', $graphsGenerated)) { $html .= '

          Hourly queries

          '; } if(in_array('hourly_select_queries', $graphsGenerated)) { $html .= '

          Hourly SELECT queries

          '; } if(in_array('hourly_write_queries', $graphsGenerated)) { $html .= '

          Hourly write queries

          '; } return $html; } function generateGraphs(& $statsListener) { $graphsGenerated = array(); $hourlyStatistics =& $statsListener->getHourlyStatistics(); $hours = array_keys($hourlyStatistics); $minHour = strtotime(min($hours)); $maxHour = strtotime(max($hours)); $hourCount = ($maxHour - $minHour) / 3600; $hoursAxis = array(); $queryCountValues = array(); $queryDurationValues = array(); $selectCountValues = array(); $selectDurationValues = array(); $insertCountValues = array(); $deleteCountValues = array(); $updateCountValues = array(); $globalCountValues = array(); $writeDurationValues = array(); for($currentHour = $minHour; $currentHour <= $maxHour; $currentHour += 3600) { $formattedHour = date('Y-m-d H:00:00', $currentHour); if($hourCount <= 25 || (date('G', $currentHour) % 6 == 0)) { if($currentHour == $minHour || date('G', $currentHour) == 0) { $hoursAxis[] = date("ga\nM j", $currentHour); } else { $hoursAxis[] = date("ga", $currentHour); } } else { $hoursAxis[] = ''; } if(isset($hourlyStatistics[$formattedHour])) { $counter =& $hourlyStatistics[$formattedHour]; $queryCountValues[] = $counter->getQueryCount(); if($counter->getQueryCount() > 0) { $queryDurationValues[] = $this->getDurationForUnit($counter->getQueryDuration() / $counter->getQueryCount()); } else { $queryDurationValues[] = NULL; } $selectCountValues[] = $counter->getSelectCount(); if($counter->getSelectCount() > 0) { $selectDurationValues[] = $this->getDurationForUnit($counter->getSelectDuration() / $counter->getSelectCount()); } else { $selectDurationValues[] = NULL; } $insertCountValues[] = $counter->getInsertCount(); $deleteCountValues[] = $counter->getDeleteCount(); $updateCountValues[] = $counter->getUpdateCount(); $writeCount = $counter->getInsertCount() + $counter->getDeleteCount() + $counter->getUpdateCount(); if($writeCount > 0) { $writeDurationValues[] = $this->getDurationForUnit(($counter->getInsertDuration() + $counter->getDeleteDuration() + $counter->getUpdateDuration()) / $writeCount); } else { $writeDurationValues[] = NULL; } unset($counter); } else { $queryCountValues[] = 0; $queryDurationValues[] = NULL; $selectCountValues[] = 0; $selectDurationValues[] = NULL; $insertCountValues[] = 0; $deleteCountValues[] = 0; $updateCountValues[] = 0; $writeDurationValues[] = NULL; } } $queryDurationValues = $this->filterNull($queryDurationValues); $selectDurationValues = $this->filterNull($selectDurationValues); $writeDurationValues = $this->filterNull($writeDurationValues); $peaksStatistics =& $statsListener->getQueryPeaksStatistics(); if(empty($peaksStatistics)) { return $graphsGenerated; } $currentTimestamp = key($peaksStatistics) - (key($peaksStatistics) % 3600); $lastTimestamp = max(array_keys($peaksStatistics)); $firstData = false; $xAxis = array(); $average = array(); $min = array(); $max = array(); while($currentTimestamp <= $lastTimestamp) { if($currentTimestamp % 3600 == 0) { $xAxis[] = date('ga', $currentTimestamp); } else { $xAxis[] = ''; } if(isset($peaksStatistics[$currentTimestamp])) { $firstData = true; $average[] = array_sum($peaksStatistics[$currentTimestamp])/(5*60); $min[] = min($peaksStatistics[$currentTimestamp]); $max[] = max($peaksStatistics[$currentTimestamp]); } elseif($firstData) { $average[] = 0; $min[] = 0; $max[] = 0; } else { $average[] = null; $min[] = null; $max[] = null; } $currentTimestamp += 5 * 60; } // Queries per second if($this->countValidValues($max) > 2) { $graph = new Graph(840, 250); $graph->setAntiAliasing(true); $graph->setBackgroundColor(new Color(0xFF, 0xFF, 0xFF)); $graph->title->set('Queries per second (5 minutes average)'); $graph->title->setPadding(30, 30, 2, 2); $graph->title->setFont(new DejaVuSans(8)); $graph->title->setColor(new Color(0x00, 0x00, 0x00)); $graph->title->setBackgroundColor(new Color(0xFE, 0xE3, 0xC4)); $graph->title->border->show(); $graph->title->border->setColor(new Color(0xFF, 0xB4, 0x62)); $group = new PlotGroup(); $group->setSize(0.82, 1); $group->setCenter(0.41, 0.5); $group->setPadding(40, 40, 30, 27); $group->setSpace(1, 1); $group->grid->setColor(new Color(0xC4, 0xC4, 0xC4)); $group->grid->setType(LINE_DASHED); $group->grid->setInterval(1, 12); $group->grid->setBackgroundColor(new White); $group->axis->left->label->setFont(new Font2); $group->axis->left->label->setCallbackFormatFunction(array(&$this, 'formatQueryNumber')); $group->axis->bottom->setLabelText($xAxis); $group->axis->bottom->label->setFont(new Font1); $group->axis->bottom->setTickInterval(12); $group->legend->setAlign(LEGEND_RIGHT, LEGEND_BOTTOM); $group->legend->setPosition(1.21, 0.88); $group->legend->setTextFont(new DejaVuSans(8)); $group->legend->setSpace(10); $plot = new LinePlot($max); $plot->setColor(new MidRed); $plot->setFillColor(new LightRed(80)); $group->legend->add($plot, 'Maximum', LEGEND_MARK); $group->add($plot); $plot = new LinePlot($average); $plot->setColor(new Orange()); $plot->setFillColor(new LightOrange(80)); $group->legend->add($plot, 'Average', LEGEND_MARK); $group->add($plot); $plot = new LinePlot($min); $plot->setColor(new DarkGreen); $plot->setFillColor(new LightGreen(80)); $group->legend->add($plot, 'Minimum', LEGEND_MARK); $group->add($plot); $graph->add($group); $graph->draw($this->reportAggregator->getImagePath('hourly_queries_per_second')); $graphsGenerated[] = 'hourly_queries_per_second'; } // All queries if($this->countValidValues($queryCountValues) > 2) { $graph = new Graph(840, 250); $graph->setAntiAliasing(true); $graph->setBackgroundColor(new Color(0xFF, 0xFF, 0xFF)); $graph->title->set('All queries'); $graph->title->setPadding(30, 30, 2, 2); $graph->title->setFont(new DejaVuSans(8)); $graph->title->setColor(new Color(0x00, 0x00, 0x00)); $graph->title->setBackgroundColor(new Color(0xFE, 0xE3, 0xC4)); $graph->title->border->show(); $graph->title->border->setColor(new Color(0xFF, 0xB4, 0x62)); $group = new PlotGroup(); $group->setSize(0.82, 1); $group->setCenter(0.41, 0.5); $group->setPadding(40, 40, 30, 27); $group->setSpace(1, 1); $group->grid->setColor(new Color(0xC4, 0xC4, 0xC4)); $group->grid->setType(LINE_DASHED); $group->grid->setBackgroundColor(new White); $group->axis->left->setColor(new MidRed); $group->axis->left->label->setFont(new Font2); $group->axis->left->label->setCallbackFormatFunction(array(&$this, 'formatQueryNumber')); $group->axis->right->setColor(new DarkGreen); $group->axis->right->label->setFont(new Font2); $group->axis->bottom->setLabelText($hoursAxis); $group->axis->bottom->label->setFont(new Font1); $group->legend->setAlign(LEGEND_RIGHT, LEGEND_BOTTOM); $group->legend->setPosition(1.21, 0.88); $group->legend->setTextFont(new DejaVuSans(8)); $group->legend->setSpace(10); $plot = new LinePlot($queryCountValues, LINEPLOT_MIDDLE); $plot->setColor(new Orange()); $plot->setFillColor(new LightOrange(80)); $plot->mark->setType(MARK_CIRCLE); $plot->mark->setFill(new MidRed); if($hourCount <= 25) { $plot->mark->setSize(6); } else { $plot->mark->setSize(2); } $group->legend->add($plot, 'Number of queries', LEGEND_MARK); $group->add($plot); $plot = new LinePlot($queryDurationValues, LINEPLOT_MIDDLE); $plot->setColor(new Color(120, 120, 30, 10)); $plot->setFillColor(new Color(120, 120, 60, 90)); $plot->mark->setType(MARK_SQUARE); $plot->mark->setFill(new DarkGreen); if($hourCount <= 25) { $plot->mark->setSize(5); } else { $plot->mark->setSize(2); } $plot->setYAxis(PLOT_RIGHT); $plot->setYMax(max($queryDurationValues)); $group->legend->add($plot, 'Average duration ('.CONFIG_DURATION_UNIT.')', LEGEND_MARK); $group->add($plot); $graph->add($group); $graph->draw($this->reportAggregator->getImagePath('hourly_all_queries')); $graphsGenerated[] = 'hourly_all_queries'; } // SELECT queries if($this->countValidValues($selectCountValues) > 2) { $graph = new Graph(840, 250); $graph->setAntiAliasing(true); $graph->setBackgroundColor(new Color(0xFF, 0xFF, 0xFF)); $graph->title->set('SELECT queries'); $graph->title->setPadding(30, 30, 2, 2); $graph->title->setFont(new DejaVuSans(8)); $graph->title->setColor(new Color(0x00, 0x00, 0x00)); $graph->title->setBackgroundColor(new Color(0xFE, 0xE3, 0xC4)); $graph->title->border->show(); $graph->title->border->setColor(new Color(0xFF, 0xB4, 0x62)); $group = new PlotGroup(); $group->setSize(0.82, 1); $group->setCenter(0.41, 0.5); $group->setPadding(40, 40, 30, 27); $group->setSpace(1, 1); $group->grid->setColor(new Color(0xC4, 0xC4, 0xC4)); $group->grid->setType(LINE_DASHED); $group->grid->setBackgroundColor(new White); $group->axis->left->setColor(new MidRed); $group->axis->left->label->setFont(new Font2); $group->axis->right->setColor(new DarkGreen); $group->axis->right->label->setFont(new Font2); $group->axis->bottom->setLabelText($hoursAxis); $group->axis->bottom->label->setFont(new Font1); $group->legend->setAlign(LEGEND_RIGHT, LEGEND_BOTTOM); $group->legend->setPosition(1.21, 0.88); $group->legend->setTextFont(new DejaVuSans(8)); $group->legend->setSpace(10); $plot = new LinePlot($selectCountValues, LINEPLOT_MIDDLE); $plot->setColor(new Orange()); $plot->setFillColor(new LightOrange(80)); $plot->mark->setType(MARK_CIRCLE); $plot->mark->setFill(new MidRed); if($hourCount <= 25) { $plot->mark->setSize(6); } else { $plot->mark->setSize(2); } $group->legend->add($plot, 'Number of queries', LEGEND_MARK); $group->add($plot); $plot = new LinePlot($selectDurationValues, LINEPLOT_MIDDLE); $plot->setColor(new Color(120, 120, 30, 10)); $plot->setFillColor(new Color(120, 120, 60, 90)); $plot->mark->setType(MARK_SQUARE); $plot->mark->setFill(new DarkGreen); if($hourCount <= 24) { $plot->mark->setSize(5); } else { $plot->mark->setSize(2); } $plot->setYAxis(PLOT_RIGHT); $plot->setYMax(max($selectDurationValues)); $group->legend->add($plot, 'Average duration (s)', LEGEND_MARK); $group->add($plot); $graph->add($group); $graph->draw($this->reportAggregator->getImagePath('hourly_select_queries')); $graphsGenerated[] = 'hourly_select_queries'; } // write queries if($this->countValidValues($updateCountValues) > 2 || $this->countValidValues($insertCountValues) > 2 || $this->countValidValues($deleteCountValues) > 2) { $graph = new Graph(840, 250); $graph->setAntiAliasing(true); $graph->setBackgroundColor(new Color(0xFF, 0xFF, 0xFF)); $graph->title->set('Write queries'); $graph->title->setPadding(30, 30, 2, 2); $graph->title->setFont(new DejaVuSans(8)); $graph->title->setColor(new Color(0x00, 0x00, 0x00)); $graph->title->setBackgroundColor(new Color(0xFE, 0xE3, 0xC4)); $graph->title->border->show(); $graph->title->border->setColor(new Color(0xFF, 0xB4, 0x62)); $group = new PlotGroup(); $group->setSize(0.82, 1); $group->setCenter(0.41, 0.5); $group->setPadding(40, 40, 30, 27); $group->setSpace(1, 1); $group->grid->setColor(new Color(0xC4, 0xC4, 0xC4)); $group->grid->setType(LINE_DASHED); $group->grid->setBackgroundColor(new White); $group->axis->left->label->setFont(new Font2); $group->axis->right->setColor(new DarkGreen); $group->axis->right->label->setFont(new Font2); $group->axis->bottom->setLabelText($hoursAxis); $group->axis->bottom->label->setFont(new Font1); $group->legend->setAlign(LEGEND_RIGHT, LEGEND_BOTTOM); $group->legend->setPosition(1.21, 0.88); $group->legend->setTextFont(new DejaVuSans(8)); $group->legend->setSpace(10); $plot1 = $updateCountValues; $plot2 = arrayAdd($updateCountValues, $insertCountValues); $plot3 = arrayAdd($plot2, $deleteCountValues); $plot = new BarPlot($plot3); $plot->setBarColor(new Color(180, 80, 80)); $plot->setBarPadding(0.10, 0.10); $group->legend->add($plot, 'DELETE queries', LEGEND_BACKGROUND); $group->add($plot); $plot = new BarPlot($plot2); $plot->setBarColor(new Color(0xEB, 0xF0, 0xFC)); $plot->setBarPadding(0.10, 0.10); $group->legend->add($plot, 'INSERT queries', LEGEND_BACKGROUND); $group->add($plot); $plot = new BarPlot($plot1); $plot->setBarColor(new Color(0xFE, 0xE3, 0xC4)); $plot->setBarPadding(0.10, 0.10); $group->legend->add($plot, 'UPDATE queries', LEGEND_BACKGROUND); $group->add($plot); $plot = new LinePlot($writeDurationValues, LINEPLOT_MIDDLE); $plot->setColor(new Color(120, 120, 30, 10)); $plot->setFillColor(new Color(120, 120, 60, 90)); $plot->mark->setType(MARK_SQUARE); $plot->mark->setFill(new DarkGreen); if($hourCount <= 25) { $plot->mark->setSize(5); } else { $plot->mark->setSize(2); } $plot->setYAxis(PLOT_RIGHT); $group->legend->add($plot, 'Average duration (s)', LEGEND_MARK); $group->add($plot); $graph->add($group); $graph->draw($this->reportAggregator->getImagePath('hourly_write_queries')); $graphsGenerated[] = 'hourly_write_queries'; } return $graphsGenerated; } function formatQueryNumber($queryNumber) { if($queryNumber % 1000 == 0 && $queryNumber > 9999) { $queryNumber = ($queryNumber / 1000).'k'; } return $queryNumber; } function filterNull($array) { for($i = 0, $max = count($array); $i < $max; $i++) { $previousNotNull = false; $followingNotNull = false; if(is_null($array[$i])) { for($j = 0; $j < $i; $j++) { if(!is_null($array[$j])) { $previousNotNull = true; } } for($j = $i + 1, $max2 = count($array); $j < $max2; $j++) { if(!is_null($array[$j])) { $followingNotNull = true; } } if($previousNotNull && $followingNotNull) { $array[$i] = 0; } } } return $array; } function countValidValues($array) { $count = 0; for($i = 0, $max = count($array); $i < $max; $i++) { if(!is_null($array[$i]) && $array[$i] > 0) { $count ++; } } return $count; } } ?>pgfouine-1.2/include/reporting/reports/QueriesByTypeReport.class.php0000644000175000017500000000611310764774401024514 0ustar acmeacmeReport($reportAggregator, 'Queries by type', array('GlobalCountersListener')); } function getText() { $listener =& $this->reportAggregator->getListener('GlobalCountersListener'); $text = ''; $queriesCount = $listener->getIdentifiedQueryCount(); $selectCount = $listener->getSelectCount(); $insertCount = $listener->getInsertCount(); $updateCount = $listener->getUpdateCount(); $deleteCount = $listener->getDeleteCount(); $pad = strlen($queriesCount); if($selectCount > 0) { $text .= 'SELECT: '.$this->pad($selectCount, $pad).' '.$this->getPercentage($selectCount, $queriesCount).'%'; $text .= "\n"; } if($insertCount > 0) { $text .= 'INSERT: '.$this->pad($insertCount, $pad).' '.$this->getPercentage($insertCount, $queriesCount).'%'; $text .= "\n"; } if($updateCount > 0) { $text .= 'UPDATE: '.$this->pad($updateCount, $pad).' '.$this->getPercentage($updateCount, $queriesCount).'%'; $text .= "\n"; } if($deleteCount > 0) { $text .= 'DELETE: '.$this->pad($deleteCount, $pad).' '.$this->getPercentage($deleteCount, $queriesCount).'%'; $text .= "\n"; } return $text; } function getHtml() { $listener =& $this->reportAggregator->getListener('GlobalCountersListener'); $queriesCount = $listener->getIdentifiedQueryCount(); $typeCount = array(); if($listener->getSelectCount()) { $typeCount['SELECT'] = $listener->getSelectCount(); } if($listener->getInsertCount()) { $typeCount['INSERT'] = $listener->getInsertCount(); } if($listener->getUpdateCount()) { $typeCount['UPDATE'] = $listener->getUpdateCount(); } if($listener->getDeleteCount()) { $typeCount['DELETE'] = $listener->getDeleteCount(); } $html = ' '; $i = 0; foreach($typeCount AS $type => $count) { $html .= ''; $html .= "\n"; $i++; } $html .= '
          Type Count Percentage
          '.$type.' '.$this->formatInteger($count).' '.$this->getPercentage($count, $queriesCount).'
          '; return $html; } } ?>pgfouine-1.2/include/reporting/reports/Report.class.php0000644000175000017500000000573111244576733022030 0ustar acmeacmereportAggregator =& $reportAggregator; $this->title = $title; $this->needs = $needs; $this->displayTitle = $displayTitle; } function getTitle() { return $this->title; } function getNeeds() { return $this->needs; } function getTextTitle() { if($this->displayTitle) { $title = "\n##### ".$this->title." #####\n\n"; } else { $title = ''; } return $title; } function getHtmlTitle() { if($this->displayTitle) { $title = '

          '.$this->title.' ^

          '; } else { $title = ''; } return $title; } function pad($string, $length) { return $this->reportAggregator->pad($string, $length); } function getPercentage($number, $total) { return $this->reportAggregator->getPercentage($number, $total); } function formatInteger($integer) { return $this->reportAggregator->formatInteger($integer); } function formatTimestamp($timestamp) { return $this->reportAggregator->formatTimestamp($timestamp); } function getDurationForUnit($duration) { return $this->reportAggregator->getDurationForUnit($duration); } function formatDuration($duration, $decimals = 2, $decimalPoint = '.', $thousandSeparator = ',') { return $this->reportAggregator->formatDuration($duration, $decimals, $decimalPoint, $thousandSeparator); } function formatLongDuration($duration) { return $this->reportAggregator->formatLongDuration($duration); } function getReportClass() { return get_class($this); } function getRowStyle($i) { return 'row'.($i%2); } function highlightSql($sql, $prepend = '', $append = '') { return $this->reportAggregator->highlightSql($sql, $prepend, $append); } function formatRealQuery(& $query, $prepend = '', $append = '') { return $this->reportAggregator->formatRealQuery($query, $prepend, $append); } function shortenQueryText($queryText) { return $this->reportAggregator->shortenQueryText($queryText); } } ?>pgfouine-1.2/include/reporting/reports/NormalizedQueriesMostFrequentReport.class.php0000644000175000017500000000514111244576733027763 0ustar acmeacmeNormalizedReport($reportAggregator, 'Most frequent queries'); } function getText() { $listener =& $this->reportAggregator->getListener('NormalizedQueriesListener'); $text = ''; $queries =& $listener->getMostFrequentQueries(); $count = count($queries); for($i = 0; $i < $count; $i++) { $query =& $queries[$i]; $text .= ($i+1).') '.$this->formatInteger($query->getTimesExecuted()).' - '.$this->formatLongDuration($query->getTotalDuration()).' - '.$this->shortenQueryText($query->getNormalizedText())."\n"; $text .= "--\n"; } return $text; } function getHtml() { $listener =& $this->reportAggregator->getListener('NormalizedQueriesListener'); $html = ' '; $queries =& $listener->getMostFrequentQueries(); $count = count($queries); for($i = 0; $i < $count; $i++) { $query =& $queries[$i]; $html .= ''; $html .= "\n"; } $html .= '
          Rank Times executed Total duration Av. duration ('.CONFIG_DURATION_UNIT.') Query
          '.($i+1).' '.$this->formatLongDuration($query->getTotalDuration()).' '.$this->formatDuration($query->getAverageDuration()).' '.$this->getNormalizedQueryWithExamplesHtml($i, $query).'
          '; return $html; } } ?>pgfouine-1.2/include/reporting/reports/CsvQueriesHistoryReport.class.php0000644000175000017500000000363611244607450025415 0ustar acmeacmeReport($reportAggregator, 'Queries history in CSV format', array('QueriesHistoryListener'), false); } function getText() { $listener =& $this->reportAggregator->getListener('QueriesHistoryListener'); $text = ''; $queries =& $listener->getQueriesHistory(); $count = count($queries); for($i = 0; $i < $count; $i++) { $query =& $queries[$i]; $line = array( $i+1, $this->formatTimestamp($query->getTimestamp()), $query->getConnectionId(), $query->getDatabase(), $query->getUser(), $query->getDuration(), $query->getText(), ); $text .= str_putcsv($line, ',', '"'); unset($query); } return rtrim($text, "\n"); } function getHtml() { $html = '

          Report not supported by HTML format

          '; return $html; } } ?>pgfouine-1.2/include/reporting/reports/TsungSessionsReport.class.php0000644000175000017500000000516710764775351024606 0ustar acmeacmeReport($reportAggregator, 'Tsung sessions', array('TsungSessionsListener'), false); } function getText() { $listener =& $this->reportAggregator->getListener('TsungSessionsListener'); $sessions =& $listener->getSessions(); $sessionsCount = count($sessions); $probabilityLeft = 100; $text = ''; $text .= ''."\n"; for($i = 0; $i < $sessionsCount; $i++) { if($i == ($sessionsCount - 1)) { $currentProbability = $probabilityLeft; } else { $currentProbability = (int) (100 / $sessionsCount); $probabilityLeft -= $currentProbability; } $connectionId = key($sessions); $queries =& current($sessions); $queriesCount = count($queries); $text .= "\t".''."\n"; for($j = 0; $j < $queriesCount; $j++) { $query =& $queries[$j]; if($j == 0) { $text .= "\t\t".''."\n"; } if(isset($lastQuery)) { $thinkTime = (int) ($query->getTimestamp() - ($lastQuery->getTimestamp() + $lastQuery->getDuration())); if($thinkTime >= 1) { $text .= "\t\t".''."\n"; } unset($lastQuery); } $text .= "\t\t".'getText().']]>'."\n"; $lastQuery =& $query; unset($query); } $text .= "\t".''."\n"; next($sessions); } $text .= ''."\n"; return $text; } function getHtml() { $html = '

          Report not supported by HTML format

          '; return $html; } } ?>pgfouine-1.2/include/reporting/reports/NormalizedQueriesMostTimeReport.class.php0000644000175000017500000000513611244576733027074 0ustar acmeacmeNormalizedReport($reportAggregator, 'Queries that took up the most time'); } function getText() { $listener =& $this->reportAggregator->getListener('NormalizedQueriesListener'); $text = ''; $queries =& $listener->getQueriesMostTime(); $count = count($queries); for($i = 0; $i < $count; $i++) { $query =& $queries[$i]; $text .= ($i+1).') '.$this->formatLongDuration($query->getTotalDuration()).' - '.$this->formatInteger($query->getTimesExecuted()).' - '.$this->shortenQueryText($query->getNormalizedText())."\n"; $text .= "--\n"; } return $text; } function getHtml() { $listener =& $this->reportAggregator->getListener('NormalizedQueriesListener'); $html = ' '; $queries =& $listener->getQueriesMostTime(); $count = count($queries); for($i = 0; $i < $count; $i++) { $query =& $queries[$i]; $html .= ''; $html .= "\n"; } $html .= '
          Rank Total duration Times executed Av. duration ('.CONFIG_DURATION_UNIT.') Query
          '.($i+1).' '.$this->formatLongDuration($query->getTotalDuration()).' '.$this->formatDuration($query->getAverageDuration()).' '.$this->getNormalizedQueryWithExamplesHtml($i, $query).'
          '; return $html; } } ?>pgfouine-1.2/include/reporting/reports/OverallStatsReport.class.php0000644000175000017500000001073510764774377024406 0ustar acmeacmeReport($reportAggregator, 'Overall statistics', array('GlobalCountersListener')); } function getText() { $statsListener =& $this->reportAggregator->getListener('GlobalCountersListener'); $normalizedListener =& $this->reportAggregator->getListener('NormalizedQueriesListener'); $errorCountersListener =& $this->reportAggregator->getListener('GlobalErrorCountersListener'); $normalizedErrorsListener =& $this->reportAggregator->getListener('NormalizedErrorsListener'); $text = ''; if($normalizedListener) { $text .= 'Number of unique normalized queries: '.$this->formatInteger($normalizedListener->getUniqueQueryCount())."\n"; } $text .= 'Number of queries: '.$this->formatInteger($statsListener->getQueryCount())."\n". 'Total query duration: '.$this->formatLongDuration($statsListener->getQueryDuration())."\n" ; if($errorCountersListener) { $text .= 'Number of errors: '.$this->formatInteger($errorCountersListener->getErrorCount())."\n"; if($normalizedErrorsListener) { $text .= 'Number of unique normalized errors: '.$this->formatInteger($normalizedErrorsListener->getUniqueErrorCount())."\n"; } } return $text; } function getHtml() { $statsListener =& $this->reportAggregator->getListener('GlobalCountersListener'); $normalizedListener =& $this->reportAggregator->getListener('NormalizedQueriesListener'); $errorCountersListener =& $this->reportAggregator->getListener('GlobalErrorCountersListener'); $normalizedErrorsListener =& $this->reportAggregator->getListener('NormalizedErrorsListener'); $html = ''; $html .= '
            '; if($normalizedListener) { $html .= '
          • Number of unique normalized queries: '.$this->formatInteger($normalizedListener->getUniqueQueryCount()).'
          • '; } $html .= '
          • Number of queries: '.$this->formatInteger($statsListener->getQueryCount()); if($statsListener->getQueryCount() != $statsListener->getIdentifiedQueryCount()) { $html .= ' (identified: '.$this->formatInteger($statsListener->getIdentifiedQueryCount()).')'; } $html .= '
          • '; $html .= '
          • Total query duration: '.$this->formatLongDuration($statsListener->getQueryDuration()); if($statsListener->getQueryDuration() != $statsListener->getIdentifiedQueryDuration()) { $html .= ' (identified: '.$this->formatLongDuration($statsListener->getIdentifiedQueryDuration()).')'; } $firstQueryTime = ($statsListener->getFirstQueryTimestamp() == MAX_TIMESTAMP) ? 'no query detected' : $this->formatTimestamp($statsListener->getFirstQueryTimestamp()); $lastQueryTime = ($statsListener->getLastQueryTimestamp() == MIN_TIMESTAMP) ? 'no query detected' : $this->formatTimestamp($statsListener->getLastQueryTimestamp()); $html .= '
          • '; $html .= '
          • First query: '.$firstQueryTime.'
          • '; $html .= '
          • Last query: '.$lastQueryTime.'
          • '; $peakTimestamps = $statsListener->getQueryPeakTimestamps(); if($peakTimestamps) { array_walk($peakTimestamps, array(&$this, 'walkFormatTimestamp')); $html .= '
          • Query peak: '.$this->formatInteger($statsListener->getQueryPeakQueryCount()).' queries/s at '.implode(', ', $peakTimestamps).'
          • '; } if($errorCountersListener) { $html .= '
          • Number of errors: '.$this->formatInteger($errorCountersListener->getErrorCount()).'
          • '; if($normalizedErrorsListener) { $html .= '
          • Number of unique normalized errors: '.$this->formatInteger($normalizedErrorsListener->getUniqueErrorCount()).'
          • '; } } $html .= '
          '; return $html; } function walkFormatTimestamp(& $value, $key) { $value = $this->formatTimestamp($value); } } ?>pgfouine-1.2/include/reporting/reports/SlowestQueriesReport.class.php0000644000175000017500000000440610764774400024742 0ustar acmeacmeReport($reportAggregator, 'Slowest queries', array('SlowestQueriesListener')); } function getText() { $listener =& $this->reportAggregator->getListener('SlowestQueriesListener'); $text = ''; $queries =& $listener->getSortedQueries(); $count = count($queries); for($i = 0; $i < $count; $i++) { $query =& $queries[$i]; $text .= ($i+1).') '.$this->formatDuration($query->getDuration()).' '.CONFIG_DURATION_UNIT.' - '.$this->formatRealQuery($query)."\n"; $text .= "--\n"; unset($query); } return $text; } function getHtml() { $listener =& $this->reportAggregator->getListener('SlowestQueriesListener'); $html = ' '; $queries =& $listener->getSortedQueries(); $count = count($queries); for($i = 0; $i < $count; $i++) { $query =& $queries[$i]; $title = $query->getDetailedInformation(); $html .= ''; $html .= "\n"; unset($query); } $html .= '
          Rank Duration ('.CONFIG_DURATION_UNIT.') Query
          '.($i+1).' '.$this->formatDuration($query->getDuration()).' '.$this->formatRealQuery($query).'
          '; return $html; } } ?>pgfouine-1.2/include/reporting/reports/QueriesHistoryPerPidReport.class.php0000644000175000017500000000445410764775351026060 0ustar acmeacmeReport($reportAggregator, 'Queries history per PID', array('QueriesHistoryListener')); } function getHtml() { $listener =& $this->reportAggregator->getListener('QueriesHistoryListener'); $queries =& $listener->getQueriesHistoryPerConnection(); $count = count($queries); $currentConnectionId = 0; $html = ''; for($i = 0; $i < $count; $i++) { $query =& $queries[$i]; if($currentConnectionId != $query->getConnectionId()) { if($currentConnectionId != 0) { $html .= ''; } $html .= '

          Pid: '.$query->getConnectionId().'

          '; $html .= ' '; $currentConnectionId = $query->getConnectionId(); } $title = $query->getDetailedInformation(); $html .= ''; $html .= "\n"; unset($query); } if($currentConnectionId != 0) { $html .= '
          Rank Time Query Duration ('.CONFIG_DURATION_UNIT.')
          '.($i+1).' '.$this->formatTimestamp($query->getTimestamp()).' '.$this->formatRealQuery($query).' '.$this->formatDuration($query->getDuration()).'
          '; } return $html; } } ?>pgfouine-1.2/include/reporting/reports/NormalizedReport.class.php0000644000175000017500000000633611244576733024057 0ustar acmeacmeReport($reportAggregator, $title.' (N)', $needs); } function getNormalizedQueryWithExamplesHtml($counter, & $normalizedQuery) { $examples =& $normalizedQuery->getFilteredExamplesArray(); $exampleCount = count($examples); $html = ''; if($normalizedQuery->getTimesExecuted() == 1 || !$exampleCount) { $html .= $this->formatRealQuery($normalizedQuery->getQuery()); } else { $html .= $this->highlightSql($this->shortenQueryText($normalizedQuery->getNormalizedText())); $buttonId = 'button_'.$this->getReportClass().'_'.$counter; $divId = 'examples_'.$this->getReportClass().'_'.$counter; $html .= ''; $html .= ''; } return $html; } function getHourlyStatisticsTooltip(& $normalizedQuery) { $html = ''; $html .= '
          '; $hourlyStatistics = $normalizedQuery->getHourlyStatistics(); $html .= ''; $i = 0; $previousDay = ''; foreach($hourlyStatistics AS $hour => $hourlyCounter) { $hourTimestamp = strtotime($hour); $currentDay = date('Y-m-d', $hourTimestamp); if($currentDay != $previousDay) { $day = date('M j', $hourTimestamp); $previousDay = $currentDay; } else { $day = ' '; } $html .= ''; $i++; } $html .= '
          Day Time Count Av. Duration
          '.$day.' '.date('ga', $hourTimestamp).' '.$this->formatInteger($hourlyCounter['count']).' '.$this->formatDuration(($hourlyCounter['duration']/$hourlyCounter['count'])).'
          '; $html .= '
          '; return $html; } } ?>pgfouine-1.2/include/reporting/reports/NormalizedQueriesSlowestAverageReport.class.php0000644000175000017500000000512311244576733030262 0ustar acmeacmeNormalizedReport($reportAggregator, 'Slowest queries'); } function getText() { $listener =& $this->reportAggregator->getListener('NormalizedQueriesListener'); $text = ''; $queries =& $listener->getSlowestQueries(); $count = count($queries); for($i = 0; $i < $count; $i++) { $query =& $queries[$i]; $text .= ($i+1).') '.$this->formatDuration($query->getAverageDuration()).' - '.$this->formatInteger($query->getTimesExecuted()).' - '.$this->shortenQueryText($query->getNormalizedText())."\n"; $text .= "--\n"; } return $text; } function getHtml() { $listener =& $this->reportAggregator->getListener('NormalizedQueriesListener'); $html = ' '; $queries =& $listener->getSlowestQueries(); $count = count($queries); for($i = 0; $i < $count; $i++) { $query =& $queries[$i]; $html .= ''; $html .= "\n"; } $html .= '
          Rank Av. duration ('.CONFIG_DURATION_UNIT.') Times executed Total duration Query
          '.($i+1).' '.$this->formatDuration($query->getAverageDuration()).' '.$this->formatLongDuration($query->getTotalDuration()).' '.$this->getNormalizedQueryWithExamplesHtml($i, $query).'
          '; return $html; } } ?>pgfouine-1.2/include/reporting/reports/NormalizedErrorsReport.class.php0000644000175000017500000000560410764774400025246 0ustar acmeacmeReport($reportAggregator, $title.' (N)', $needs); } function getNormalizedErrorWithExamplesHtml($counter, & $normalizedError) { $html = ''; $examples =& $normalizedError->getFilteredExamplesArray(); $exampleCount = count($examples); if($exampleCount) { $buttonId = 'button_'.$this->getReportClass().'_'.$counter; $divId = 'examples_'.$this->getReportClass().'_'.$counter; $html .= ''; $html .= ''; } return $html; } function getHourlyStatisticsTooltip(& $normalizedError) { $html = ''; $html .= '
          '; $hourlyStatistics = $normalizedError->getHourlyStatistics(); $html .= ''; $i = 0; foreach($hourlyStatistics AS $hour => $hourlyCounter) { $hourTimestamp = strtotime($hour); if(date('H', $hourTimestamp) == 0 || $i == 0) { $day = date('M j', $hourTimestamp); } else { $day = ' '; } $html .= ''; $i++; } $html .= '
          Day Time Count
          '.$day.' '.date('ga', $hourTimestamp).' '.$this->formatInteger($hourlyCounter['count']).'
          '; $html .= '
          '; return $html; } } ?>pgfouine-1.2/include/reporting/reports/NormalizedErrorsMostFrequentReport.class.php0000644000175000017500000000635610764774377027645 0ustar acmeacmeNormalizedErrorsReport($reportAggregator, 'Most frequent errors'); } function getText() { $listener =& $this->reportAggregator->getListener('NormalizedErrorsListener'); $text = ''; $errors =& $listener->getMostFrequentErrors(); $count = count($errors); for($i = 0; $i < $count; $i++) { $error =& $errors[$i]; $text .= ($i+1).') '.$this->formatInteger($error->getTimesExecuted()).' - '.$error->getNormalizedText()."\n"; if($error->isTextAStatement()) { $text .= 'Error: '.$error->getError()."\n"; } if($error->getDetail()) { $text .= 'Detail: '.$error->getDetail()."\n"; } if($error->getHint()) { $text .= 'Hint: '.$error->getHint()."\n"; } $text .= "--\n"; } return $text; } function getHtml() { $listener =& $this->reportAggregator->getListener('NormalizedErrorsListener'); $errors =& $listener->getMostFrequentErrors(); $count = count($errors); if($count == 0) { $html = '

          No error found

          '; } else { $html = ' '; for($i = 0; $i < $count; $i++) { $error =& $errors[$i]; if($error->isTextAStatement()) { $errorText = $error->getError(); } else { $errorText = $error->getNormalizedText(); } $html .= ''; $html .= "\n"; } $html .= '
          Rank Times reported Error
          '.($i+1).'
          Error: '.$error->getError().'
          '; if($error->getDetail() || $error->getHint()) { $html .= '
          '; if($error->getDetail()) { $html .= 'Detail: '.$error->getDetail(); $html .= '
          '; } if($error->getHint()) { $html .= 'Hint: '.$error->getHint(); $html .= '
          '; } $html .= '
          '; } if($error->isTextAStatement()) { $html .= $this->highlightSql($error->getNormalizedText()); } $html .= $this->getNormalizedErrorWithExamplesHtml($i, $error).'
          '; } return $html; } } ?>pgfouine-1.2/include/reporting/reports/QueriesHistoryReport.class.php0000644000175000017500000000456310764775351024755 0ustar acmeacmeReport($reportAggregator, 'Queries history', array('QueriesHistoryListener')); } function getText() { $listener =& $this->reportAggregator->getListener('QueriesHistoryListener'); $text = ''; $queries =& $listener->getQueriesHistory(); $count = count($queries); for($i = 0; $i < $count; $i++) { $query =& $queries[$i]; $text .= ($i+1).') '.$this->formatTimestamp($query->getTimestamp()).' - '.$this->formatDuration($query->getDuration()).' - '.$this->formatRealQuery($query)."\n"; $text .= "--\n"; unset($query); } return $text; } function getHtml() { $listener =& $this->reportAggregator->getListener('QueriesHistoryListener'); $html = ' '; $queries =& $listener->getQueriesHistory(); $count = count($queries); for($i = 0; $i < $count; $i++) { $query =& $queries[$i]; $title = $query->getDetailedInformation(); $html .= ''; $html .= "\n"; unset($query); } $html .= '
          Rank Time Query Duration ('.CONFIG_DURATION_UNIT.')
          '.($i+1).' '.$this->formatTimestamp($query->getTimestamp()).' '.$this->formatRealQuery($query).' '.$this->formatDuration($query->getDuration()).'
          '; return $html; } } ?>pgfouine-1.2/include/GenericLogReader.class.php0000644000175000017500000001437011170362313020167 0ustar acmeacmefileName = $fileName; $this->lineParserName = $lineParserName; $this->accumulatorName = $accumulatorName; $this->displayHelp = $displayHelp; } function addReportAggregator(& $reportAggregator) { $this->reportAggregators[] =& $reportAggregator; } function & getReportAggregators() { return $this->reportAggregators; } function parse() { global $lineParsedCounter; $this->prepare(); $startTimestamp = time(); $accumulator = new $this->accumulatorName; $lineParser = new $this->lineParserName; foreach(array_keys($this->listeners) AS $listenerName) { $listener =& $this->listeners[$listenerName]; foreach($listener->getSubscriptions() AS $eventType) { $accumulator->addListener($eventType, $listener); } } if(DEBUG) { debug('Using parser: '.$this->lineParserName); debug('Using accumulator: '.$this->accumulatorName); debug('Using listeners: '.implode(', ', array_keys($this->listeners))); } $filePointer = @fopen($this->fileName, 'r'); if(!$filePointer) { trigger_error('File '.$this->fileName.' is not readable.', E_USER_ERROR); } $lineParsedCounter = 0; $lineDetected = false; if(DEBUG) debug(getMemoryUsage()); if(PROFILE) { $GLOBALS['profiler'] = new Profiler(); $GLOBALS['profiler']->start(); } $this->readFile($accumulator, $filePointer, $lineParser, $lineParsedCounter, $lineDetected); DEBUG && debug('Before close - '.getMemoryUsage()); $accumulator->close(); DEBUG && debug('After close - '.getMemoryUsage()); fclose($filePointer); $this->timeToParse = time() - $startTimestamp; $this->lineParsedCounter = $lineParsedCounter; DEBUG && debug("\nParsed ".$lineParsedCounter.' lines in '.$this->timeToParse.' s'); if(PROFILE) { $GLOBALS['profiler']->end(); $GLOBALS['profiler']->displayProfile(); } if(!$lineParsedCounter) { stderr('Log file is empty.'); exit(0); } if(!$lineDetected && $this->displayHelp) { stderr('pgFouine did not find any valid PostgreSQL log line in your log file:'); stderr('* check that PostgreSQL uses an english locale for logging (lc_messages in your postgresql.conf),'); stderr('* check that you use the -logtype option (syslog, stderr) according to your log file,'); stderr('* if you use syslog and log_line_prefix, check that your log_line_prefix has a trailing space,'); stderr('* if you use stderr, check that your log_line_prefix is of the form \'%t [%p]: [%l-1] \'.'); stderr('If you think your log file and your options are correct, please contact the author (gsmet on #postgresql@freenode or guillaume-pg at smet dot org).'); exit(1); } } function readFile(& $accumulator, & $filePointer, &$lineParser, &$lineParsedCounter, &$lineDetected) { $currentTimestamp = time(); while (!feof($filePointer)) { $text = rtrim(fgets($filePointer), "\r\n"); if(empty($text)) { continue; } $lineParsedCounter ++; $line =& $lineParser->parse($text); if($line) { if(!isset($this->firstLineTimestamp)) { $this->firstLineTimestamp = $line->getTimestamp(); } $this->lastLineTimestamp = $line->getTimestamp(); $accumulator->append($line); if(!is_a($line, 'PostgreSQLContinuationLine')) { $lineDetected = true; } } if($lineParsedCounter % 20000 == 0 && isset($this->lastLineTimestamp)) { if(DEBUG) { debug(' Garbage collector:'); debug(' before: '.getMemoryUsage()); } $accumulator->garbageCollect($this->lastLineTimestamp); if(DEBUG) { debug(' after: '.getMemoryUsage()); } } if($lineParsedCounter % 100000 == 0) { stderr('parsed '.$lineParsedCounter.' lines'); if(DEBUG) { $currentTime = time() - $currentTimestamp; $currentTimestamp = time(); debug(' '.getMemoryUsage()); debug(' Time: '.$currentTime.' s'); } } } } function output() { for($i = 0; $i < count($this->reportAggregators); $i++) { $this->reportAggregators[$i]->output(); } } function prepare() { $needs = array(); for($i = 0; $i < count($this->reportAggregators); $i++) { $needs = array_merge($needs, $this->reportAggregators[$i]->getNeeds()); } $needs = array_unique($needs); foreach($needs AS $need) { $this->addListener($need); } } function getLineParsedCounter() { return $this->lineParsedCounter; } function addListener($listenerName) { $listener = new $listenerName(); $this->listeners[$listenerName] =& $listener; } function & getListener($listenerName) { if(isset($this->listeners[$listenerName])) { $listener =& $this->listeners[$listenerName]; } else { $listener = false; } return $listener; } function getFileName() { return $this->fileName; } function getTimeToParse() { return $this->timeToParse; } function getLineParsedCount() { return $this->lineParsedCounter; } function getFirstLineTimestamp() { return $this->firstLineTimestamp; } function getLastLineTimestamp() { return $this->lastLineTimestamp; } } ?>pgfouine-1.2/include/LogStream.class.php0000644000175000017500000001450011170362313016716 0ustar acmeacmegetCommandNumber(); $this->lastLineTimestamp = $line->getTimestamp(); if((!$this->currentBlock || ((($lineCommandNumber != $this->currentBlock->getCommandNumber()) || ($line->getLineNumber() == 1)) && $this->currentBlock->isComplete()) || is_a($line, 'PostgreSQLErrorLine')) && !$line->isContextual() ) { // if one of this condition is true: // 1. we don't have a current block (e.g. we just started a new log stream) // 2. the command number of the added line is different from the block command number // 3. the line number of the added line is 1 and the current block is complete // 4. the added line is an error line: it's an independant object // we will try to open a new log block if($this->currentBlock) { // if we have an existing log block AND if the block is declared complete, we probably want to close it if(is_a($line, 'PostgreSQLQueryStartWithDurationLine') && $this->currentBlock->getLineCount() == 1 && ($firstLine =& $this->currentBlock->getFirstLine()) && is_a($firstLine, 'PostgreSQLDurationLine') && $firstLine->getDuration() == $line->getDuration()) { // if we have a duration line with the same duration than the current query with duration, it's because log_duration and log_min_duration_statement // are enabled at the same time so we have both a duration line and a query with duration line for the same query. // we ignore this block (the duration from log_duration) and we only consider the following one (from log_min_duration_statement) } elseif($this->currentBlock->isComplete()) { // we close the block and get the associated log object $logObject =& $this->currentBlock->close(); } } if($line->getLineNumber() == 1) { // if the line number of the added line is 1, we begin a new log block $this->currentBlock = new LogBlock($this, $lineCommandNumber, $line); } else { // otherwise our log file probably begins with an incomplete block // we only raise an error in DEBUG mode as it is very common and is not a blocking problem if(DEBUG) { stderr('we just closed a LogBlock, line number should be 1 and is '.$line->getLineNumber(), true); stderr('line command number: '.$lineCommandNumber); if($this->currentBlock) { stderr('current block command number: '.$this->currentBlock->getCommandNumber()); } $this->currentBlock = false; } } } elseif($this->currentBlock) { // we add all the lines associated with the block to the current block if(is_a($line, 'PostgreSQLContinuationLine')) { // it is just a continuation line so we just add the text to the text of the last line) if($line->getText()) { $lastLine =& last($this->currentBlock->getLines()); $lastLine->appendText($line->getText()); } } else { $this->currentBlock->addLine($line); } } return $logObject; } /** * defines the parameters of the connection * * @param string $host hostname * @param string $port port used to connect to the database */ function setHostConnection($host, $port) { $this->host = $host; $this->port = $port; } /** * defines the account information used to log in to the database * * @param string $user user * @param string $database database */ function setUserDatabase($user, $database) { $this->user = $user; $this->database = $database; } /** * returns the host name used to connect to the database * * @return string host name */ function getHost() { return $this->host; } /** * returns the port used to connect to the database * * @return string port */ function getPort() { return $this->port; } /** * returns the user used to connect to the database * * @return string user */ function getUser() { return $this->user; } /** * returns the database used * * @return string database */ function getDatabase() { return $this->database; } /** * flushes the potential remaining log block (usually the last one before the connection * was closed) * * @param object $accumulator current accumulator */ function flush(& $accumulator) { if($this->currentBlock && $this->currentBlock->isComplete()) { $logObject =& $this->currentBlock->close(); if($logObject) { $logObject->accumulateTo($accumulator); } } $this->currentBlock = false; } /** * add a prepared statement to the list * * @param object $preparedStatement the PreparedStatement object to add */ function addPreparedStatement(& $preparedStatement) { $name = $preparedStatement->getName(); $this->preparedStatements[$name] =& $preparedStatement; } /** * returns a prepared statement by name * * @param string $name name of the prepared statement * @param string $portalName name of the portal */ function & getPreparedStatement($name, $portalName) { return $this->preparedStatements[$name]; } function getLastLineTimestamp() { return $this->lastLineTimestamp; } } ?>pgfouine-1.2/include/QueryLogObject.class.php0000644000175000017500000000422310764774404017740 0ustar acmeacme 1 && !$text) stderr('Empty text for QueryLogObject', true); $this->LogObject($connectionId, $user, $db, $text, $ignored); } function getEventType() { return EVENT_QUERY; } function addSubQuery(& $queryLogObject) { $this->subQueries[] =& $queryLogObject; } function & getSubQueries() { return $this->subQueries; } function appendContext($context) { if(!empty($this->subQueries)) { $subQuery =& last($this->subQueries); $subQuery->setContext($context); } else { $this->setContext($context); } } function isSelect() { return $this->check('select'); } function isDelete() { return $this->check('delete'); } function isInsert() { return $this->check('insert'); } function isUpdate() { return $this->check('update'); } function check($start) { $queryStart = strtolower(substr(trim($this->text), 0, 10)); return (strpos($queryStart, $start) === 0); } function isIgnored() { return (parent::isIgnored() || (CONFIG_ONLY_SELECT && !$this->isSelect())); } function setDuration($duration) { $this->duration = $duration; } function getDuration() { return $this->duration; } } ?>pgfouine-1.2/include/ErrorLogObject.class.php0000644000175000017500000000453610764774404017733 0ustar acmeacmeerror = $text; $this->LogObject($connectionId, $user, $db, $text); } function getEventType() { return EVENT_ERROR; } function appendStatement($text) { if(DEBUG > 1 && empty($text)) stderr('Empty text for error statement', true); // the text may have been appended so we copy it in error before overwriting it $this->error = $this->text; $this->text = $text; $this->textIsAStatement = true; } function appendHint($hint) { if(DEBUG > 1 && empty($hint)) stderr('Empty text for error hint', true); $this->hint = $hint; } function appendDetail($detail) { if(DEBUG > 1 && empty($detail)) stderr('Empty text for error detail', true); $this->detail = $detail; } function appendContext($context) { if(DEBUG > 1 && empty($context)) stderr('Empty text for error context', true); $this->setContext($context); } function isIgnored() { if(parent::isIgnored() || $this->error == 'terminating connection due to administrator command' || $this->error == 'the database system is shutting down' ) { return true; } else { return false; } } function getError() { return $this->error; } function getHint() { return $this->hint; } function getDetail() { return $this->detail; } function isTextAStatement() { return $this->textIsAStatement; } } ?>pgfouine-1.2/include/UselessLogObject.class.php0000644000175000017500000000213011341237457020243 0ustar acmeacmepgfouine-1.2/include/postgresql/0000755000175000017500000000000011516212335015411 5ustar acmeacmepgfouine-1.2/include/postgresql/parsers/0000755000175000017500000000000011516212335017070 5ustar acmeacmepgfouine-1.2/include/postgresql/parsers/CsvlogPostgreSQLParser.class.php0000644000175000017500000000461511013243235025244 0ustar acmeacmesetConnectionInformation($database, $user); $currentLine->setContextInformation($timestamp, $connectionId, $commandNumber, $i + 1); unset($currentLine); } return $lines; } } ?>pgfouine-1.2/include/postgresql/parsers/SyslogPostgreSQLParser.class.php0000644000175000017500000000531411341235241025266 0ustar acmeacmeregexpSyslogContext = new RegExp('/^((?:[0-9]{4}\-[0-9]{2}\-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2})|(?:(?:[0-9]{4} )?[A-Z][a-z]{2} [ 0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}))..*? '.$syslogString.'\[(\d{1,7})\]: .*?\[(\d{1,20})(?:\-(\d{1,5}))?\] /'); } function & parse($data) { $syslogContextMatch =& $this->regexpSyslogContext->match($data); if($syslogContextMatch === false) { $line = false; return $line; } $matches = $syslogContextMatch->getMatches(); $text = $syslogContextMatch->getPostMatch(); if(count($matches) < 4 || !$text) { $line = false; return $line; } $formattedDate = $matches[1][0]; $timestamp = $this->getTimestampFromFormattedDate($formattedDate); $connectionId = $matches[2][0]; $commandNumber = $matches[3][0]; if(isset($matches[4][0])) { $lineNumber = $matches[4][0]; } else { $lineNumber = 1; } $line =& parent::parse($text); if($line) { $line->setContextInformation($timestamp, $connectionId, $commandNumber, $lineNumber); } return $line; } function getTimestampFromFormattedDate($formattedDate) { $matches = array(); if(preg_match('/^[0-9]{4}([- ])/', $formattedDate, $matches)) { if ($matches[1] == ' ') { $timestamp = strtotime(preg_replace('/^([0-9]{4} )([a-z]{3}[ ]+[0-9]{1,2})/i', '\2 \1', $formattedDate)); } else { $timestamp = strtotime($formattedDate); } } else { $dateFormat = '/(^[a-z]{3}[ ]+[0-9]{1,2})/i'; $timestamp = strtotime(preg_replace($dateFormat, '\1 '.date('Y'), $formattedDate)); if($timestamp > time()) { $timestamp = strtotime(preg_replace($dateFormat, '\1 '.(date('Y')-1), $formattedDate)); } } if($timestamp < 0) { $timestamp = 0; } return $timestamp; } } ?>pgfouine-1.2/include/postgresql/parsers/StderrPostgreSQLParser.class.php0000644000175000017500000000466211174667646025304 0ustar acmeacmeregexpStderrContext = new RegExp('/^([0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2})(?: [A-Z]{2,4})? .*?\[(\d{1,7})\]: \[(\d{1,10})(?:\-(\d{1,5}))?\] /'); } function & parse($data) { $contextMatch =& $this->regexpStderrContext->match($data); if($contextMatch === false) { if($this->lineNumber) { $text = $data; $timestamp = $this->timestamp; $connectionId = $this->connectionId; $commandNumber = $this->commandNumber; $lineNumber = ++$this->lineNumber; } else { $line = false; return $line; } } else { $matches = $contextMatch->getMatches(); $text = $contextMatch->getPostMatch(); if(count($matches) < 4 || !$text) { $line = false; return $line; } $formattedDate = $matches[1][0]; $timestamp = strtotime($formattedDate); if($timestamp < 0) { $timestamp = 0; } $connectionId = $matches[2][0]; $commandNumber = $matches[3][0]; if(isset($matches[4][0])) { $lineNumber = $matches[4][0]; } else { $lineNumber = 1; } $this->timestamp = $timestamp; $this->connectionId = $connectionId; $this->commandNumber = $commandNumber; $this->lineNumber = $lineNumber; } $line =& parent::parse($text); if($line) { $line->setContextInformation($timestamp, $connectionId, $commandNumber, $lineNumber); } return $line; } } ?>pgfouine-1.2/include/postgresql/parsers/PostgreSQLParser.class.php0000644000175000017500000001345411247304154024076 0ustar acmeacmematch($text); if($logLineMatch) { $logLinePrefix = trim($logLineMatch->getMatch(1)); $keyword = $logLineMatch->getMatch(2); $postMatch = $logLineMatch->getPostMatch(); if($keyword == 'LOG' || $keyword == 'DEBUG') { $queryMatch =& $postgreSQLRegexps['RegularQueryStartPart']->match($postMatch); if($queryMatch) { $line = new PostgreSQLQueryStartLine($queryMatch->getPostMatch()); } elseif($durationMatch =& $postgreSQLRegexps['DurationPart']->match($postMatch)) { $additionalInformation = trim($durationMatch->getPostMatch()); if($additionalInformation == '') { $line = new PostgreSQLDurationLine(trim($durationMatch->getMatch(1)), $durationMatch->getMatch(2)); } else { $additionalInformation = $postgreSQLRegexps['QueryStartPart']->replace($additionalInformation, ''); if($preparedStatementMatch =& $postgreSQLRegexps['PreparedStatementPart']->match($additionalInformation)) { $action = strtolower($preparedStatementMatch->getMatch(1)); $statementInformation = explode('/', $preparedStatementMatch->getMatch(2)); if(count($statementInformation) > 1) { $preparedStatementName = $statementInformation[0]; $portalName = $statementInformation[1]; } else { $preparedStatementName = $statementInformation[0]; $portalName = ''; } $text = $preparedStatementMatch->getPostMatch(); if($action == 'execute') { $line = new PostgreSQLPreparedStatementExecuteWithDurationLine($preparedStatementName, $portalName, $text, trim($durationMatch->getMatch(1)), $durationMatch->getMatch(2)); } else { $line = new PostgreSQLPreparedStatementUselessLine(); } } else { $line = new PostgreSQLQueryStartWithDurationLine($additionalInformation, trim($durationMatch->getMatch(1)), $durationMatch->getMatch(2)); } } } elseif($statusMatch =& $postgreSQLRegexps['StatusPart']->match($postMatch)) { $line = new PostgreSQLStatusLine($postMatch); } elseif($preparedStatementMatch =& $postgreSQLRegexps['PreparedStatementPart']->match($postgreSQLRegexps['QueryStartPart']->replace($postMatch, ''))) { $action = strtolower($preparedStatementMatch->getMatch(1)); $statementInformation = explode('/', $preparedStatementMatch->getMatch(2)); if(count($statementInformation) > 1) { $preparedStatementName = $statementInformation[0]; $portalName = $statementInformation[1]; } else { $preparedStatementName = $statementInformation[0]; $portalName = ''; } $text = $preparedStatementMatch->getPostMatch(); if($action == 'execute' || $action == 'execute from fetch') { $line = new PostgreSQLPreparedStatementExecuteLine($preparedStatementName, $portalName, $text); } else { $line = new PostgreSQLPreparedStatementUselessLine(); } } else { // we ignore a lot of common log lines as they are not interesting // but we still raise an error if we don't recognize a log line // as it may provide useful information about an unusual activity if(!CONFIG_QUIET && ( strpos($postMatch, 'transaction ID wrap limit is') !== 0 && strpos($postMatch, 'archived transaction log file') !== 0 && strpos($postMatch, 'disconnection: session time: ') !== 0 && strpos($postMatch, 'autovacuum: processing database') !== 0 && strpos($postMatch, 'recycled transaction log file') !== 0 && strpos($postMatch, 'removing transaction log file "') !== 0 && strpos($postMatch, 'removing file "') !== 0 && strpos($postMatch, 'could not receive data from client') !== 0 && strpos($postMatch, 'checkpoints are occurring too frequently (') !== 0 && strpos($postMatch, 'invalid length of startup packet') !== 0 && strpos($postMatch, 'incomplete startup packet') !== 0 )) { stderr('Unrecognized LOG or DEBUG line: '.$text, true); } $line = false; } } elseif($keyword == 'WARNING' || $keyword == 'ERROR' || $keyword == 'FATAL' || $keyword == 'PANIC') { $line = new PostgreSQLErrorLine($postMatch); } elseif($keyword == 'CONTEXT') { $line = new PostgreSQLContextLine($postMatch); } elseif($keyword == 'STATEMENT') { $line = new PostgreSQLStatementLine($postMatch); } elseif($keyword == 'HINT') { $line = new PostgreSQLHintLine($postMatch); } elseif($keyword == 'DETAIL') { $line = new PostgreSQLDetailLine($postMatch); } elseif($keyword == 'NOTICE') { $line = new PostgreSQLNoticeLine($postMatch); } elseif($keyword == 'LOCATION') { $line = new PostgreSQLLocationLine($postMatch); } else { $line = false; } if($line) { $line->setLogLinePrefix($logLinePrefix); } } else { // probably a continuation line. We let the PostgreSQLContinuationLine decide if it is one or not $line = new PostgreSQLContinuationLine($text); } return $line; } } ?>pgfouine-1.2/include/postgresql/lines/0000755000175000017500000000000011516212335016523 5ustar acmeacmepgfouine-1.2/include/postgresql/lines/PostgreSQLStatementLine.class.php0000644000175000017500000000205510764774401025055 0ustar acmeacmeappendStatement($this->text); } } } ?>pgfouine-1.2/include/postgresql/lines/PostgreSQLPreparedStatementUselessLine.class.php0000644000175000017500000000221610764775351030110 0ustar acmeacmePostgreSQLLogLine(''); } function & getLogObject(& $logStream) { $logObject = new UselessLogObject(); return $logObject; } function complete() { return true; } } ?>pgfouine-1.2/include/postgresql/lines/PostgreSQLLogLine.class.php0000644000175000017500000000602711013243235023615 0ustar acmeacmetext = rtrim($text); $this->duration = $duration; if(DEBUG > 1 && !$text) stderr('Empty text for line', true); } function appendText($text) { $this->text .= $text; } function getText() { return $this->text; } function parseDuration($timeString, $unit) { if($unit == 'ms') { $duration = (floatval($timeString) / 1000); } elseif($unit == 'us') { $duration = (floatval($timeString) / 1000000); } else { $duration = floatval($timeString); } return $duration; } function getLogObject(& $logStream) { return false; } function appendTo(& $logObject) { return false; } function setContextInformation($timestamp, $connectionId, $commandNumber, $lineNumber) { $this->timestamp = $timestamp; $this->connectionId = $connectionId; $this->commandNumber = $commandNumber; $this->lineNumber = $lineNumber; } function setConnectionInformation($database, $user) { $this->database = $database; $this->user = $user; } function getTimestamp() { return $this->timestamp; } function getConnectionId() { return $this->connectionId; } function getCommandNumber() { return $this->commandNumber; } function getLineNumber() { return $this->lineNumber; } function getDatabase() { return $this->database; } function getUser() { return $this->user; } function complete() { return false; } function isIgnored() { return $this->ignore; } function getDuration() { return $this->duration; } function setLogLinePrefix($logLinePrefix) { global $postgreSQLRegexps; $logPrefixValues =& $postgreSQLRegexps['LogLinePrefix']->matchAll($logLinePrefix); for($i = 0, $max = count($logPrefixValues); $i < $max; $i++) { if($logPrefixValues[$i][1] == 'db') { $this->database = $logPrefixValues[$i][2]; } elseif($logPrefixValues[$i][1] == 'user') { $this->user = $logPrefixValues[$i][2]; } } } function isContextual() { return false; } } ?>pgfouine-1.2/include/postgresql/lines/PostgreSQLQueryStartLine.class.php0000644000175000017500000000425410764774403025241 0ustar acmeacmePostgreSQLLogLine($this->filterQuery($text), $duration); } // TODO: remove this test from here and implement a -ignore option function filterQuery($text) { $loweredText = strtolower(trim($text)); $this->ignore = (strpos($loweredText, 'begin') !== false) || (strpos($loweredText, 'vacuum') !== false) || ($loweredText == 'select 1'); return $text; } function & getLogObject(& $logStream) { $database = $this->database ? $this->database : $logStream->getDatabase(); $user = $this->user ? $this->user : $logStream->getUser(); $query = new QueryLogObject($this->getConnectionId(), $user, $database, $this->text, $this->ignore); $query->setContextInformation($this->timestamp, $this->commandNumber); return $query; } function appendTo(& $logObject) { $query = new QueryLogObject($this->getConnectionId(), $logObject->getUser(), $logObject->getDatabase(), $this->text, $this->ignore); $query->setContextInformation($this->timestamp, $this->commandNumber); $logObject->addSubQuery($query); } function appendText($text) { if(CONFIG_KEEP_FORMATTING && (substr($text, 0, 1) == "\t" || substr($text, 0, 2) == ' ') && strlen($this->text) > 0) { $this->text .= "\n"; } $this->text .= $text; } } ?>pgfouine-1.2/include/postgresql/lines/PostgreSQLDetailLine.class.php0000644000175000017500000000203710764774404024316 0ustar acmeacmeappendDetail($this->text); } function isContextual() { return true; } } ?>pgfouine-1.2/include/postgresql/lines/PostgreSQLContinuationLine.class.php0000644000175000017500000000230211341305441025540 0ustar acmeacmePostgreSQLLogLine($text); } function isContextual() { return true; } } ?>pgfouine-1.2/include/postgresql/lines/PostgreSQLQueryStartWithDurationLine.class.php0000644000175000017500000000311510764774403027576 0ustar acmeacmePostgreSQLQueryStartLine($text, $this->parseDuration($timeString, $unit)); } function & getLogObject(& $logStream) { $database = $this->database ? $this->database : $logStream->getDatabase(); $user = $this->user ? $this->user : $logStream->getUser(); $query = new QueryLogObject($this->getConnectionId(), $user, $database, $this->text, $this->ignore); $query->setDuration($this->duration); $query->setContextInformation($this->timestamp, $this->commandNumber); return $query; } function complete() { return true; } } ?>pgfouine-1.2/include/postgresql/lines/PostgreSQLDurationLine.class.php0000644000175000017500000000330410764774404024677 0ustar acmeacmePostgreSQLLogLine('', $this->parseDuration($timeString, $unit)); } function & getLogObject(& $logStream) { if($this->lineNumber == 1) { $database = $this->database ? $this->database : $logStream->getDatabase(); $user = $this->user ? $this->user : $logStream->getUser(); $durationLogObject = new DurationLogObject($this->getConnectionId(), $user, $database, $this->duration); $durationLogObject->setContextInformation($this->timestamp, $this->commandNumber); } else { stderr('Duration for no previous query', true); $durationLogObject = false; } return $durationLogObject; } function appendTo(& $logObject) { $logObject->setDuration($this->duration); } function complete() { return true; } } ?>pgfouine-1.2/include/postgresql/lines/PostgreSQLPreparedStatementExecuteWithDurationLine.class.php0000644000175000017500000000270610764775351032435 0ustar acmeacmePostgreSQLPreparedStatementExecuteLine($statementName, $portalName, $text, $this->parseDuration($timeString, $unit)); } function & getLogObject(& $logStream) { $preparedStatement =& parent::getLogObject($logStream); $preparedStatement->setDuration($this->duration); return $preparedStatement; } function complete() { return true; } } ?>pgfouine-1.2/include/postgresql/lines/PostgreSQLHintLine.class.php0000644000175000017500000000203310764774403024011 0ustar acmeacmeappendHint($this->text); } function isContextual() { return true; } } ?>pgfouine-1.2/include/postgresql/lines/PostgreSQLLocationLine.class.php0000644000175000017500000000204011007573031024636 0ustar acmeacmesetLocation($this->text); } function isContextual() { return true; } } ?>pgfouine-1.2/include/postgresql/lines/PostgreSQLNoticeLine.class.php0000644000175000017500000000213711013243235024313 0ustar acmeacmecommandNumber == $logObject->getCommandNumber()) { $logObject->addNotice($this->text); } } function isContextual() { return true; } } ?>pgfouine-1.2/include/postgresql/lines/PostgreSQLErrorLine.class.php0000644000175000017500000000247110764774404024207 0ustar acmeacmedatabase ? $this->database : $logStream->getDatabase(); $user = $this->user ? $this->user : $logStream->getUser(); $error = new ErrorLogObject($this->getConnectionId(), $user, $database, $this->text); $error->setContextInformation($this->timestamp, $this->commandNumber); return $error; } function complete() { return true; } } ?>pgfouine-1.2/include/postgresql/lines/PostgreSQLStatusLine.class.php0000644000175000017500000000274510764774404024405 0ustar acmeacmematch($this->text); if($connectionReceived) { $logStream->setHostConnection($connectionReceived->getMatch(1), $connectionReceived->getMatch(2)); return false; } $connectionAuthorized =& $postgreSQLRegexps['ConnectionAuthorized']->match($this->text); if($connectionAuthorized) { $logStream->setUserDatabase($connectionAuthorized->getMatch(1), $connectionAuthorized->getMatch(2)); } return false; } function complete() { return true; } } ?>pgfouine-1.2/include/postgresql/lines/PostgreSQLContextLine.class.php0000644000175000017500000000342510764774403024541 0ustar acmeacmematch($text); if($statementMatch) { $this->PostgreSQLLogLine(substr($statementMatch->getPostMatch(), -1, 1)); } else { $functionMatch =& $postgreSQLRegexps['ContextSqlFunction']->match($text); if($functionMatch) { $this->PostgreSQLLogLine($functionMatch->getMatch(2)); } else { $this->recognized = false; $this->PostgreSQLLogLine($text); } } } function appendTo(& $logObject) { if(is_a($logObject, 'ErrorLogObject')) { $logObject->appendContext($this->text); } else { if(DEBUG && !$this->recognized) stderr('Unrecognized context or context for an error', true); $logObject->appendContext($this->text); } return false; } function isContextual() { return true; } } ?>pgfouine-1.2/include/postgresql/lines/PostgreSQLPreparedStatementExecuteLine.class.php0000644000175000017500000000510110764775351030063 0ustar acmeacmePostgreSQLLogLine($text, $duration); $this->statementName = $statementName; $this->portalName = $portalName; if(substr(trim($text), 0, 1) == '(') { $this->parameters = $this->parseParameters(trim($text, ' ();')); } } function & getLogObject(& $logStream) { $database = $this->database ? $this->database : $logStream->getDatabase(); $user = $this->user ? $this->user : $logStream->getUser(); $preparedStatement = new PreparedStatementLogObject($this->getConnectionId(), $user, $database, $this->statementName, $this->portalName, $this->text, $this->ignore); $preparedStatement->setContextInformation($this->timestamp, $this->commandNumber); $preparedStatement->setParameters($this->parameters); return $preparedStatement; } function parseParameters($parameters) { $parametersLength = strlen($parameters); $parametersArray = array(); $currentParameter = ''; $quote = false; $escape = false; for($i = 0; $i < $parametersLength; $i++) { $char = $parameters{$i}; if($char == '\'') { if($escape) { $escape = false; } else { $quote = !$quote; } } elseif($char == '\\') { $escape = !$escape; } elseif($char == ',') { if(!$quote) { $parametersArray[] = trim($currentParameter); $currentParameter = ''; continue; } } else { $escape = false; } $currentParameter .= $char; } if(strlen($currentParameter) > 0) { $parametersArray[] = trim($currentParameter); } return $parametersArray; } } ?>pgfouine-1.2/include/postgresql/vacuum/0000755000175000017500000000000011516212335016711 5ustar acmeacmepgfouine-1.2/include/postgresql/vacuum/listeners/0000755000175000017500000000000011516212335020721 5ustar acmeacmepgfouine-1.2/include/postgresql/vacuum/listeners/VacuumedTablesListener.class.php0000644000175000017500000000434610764775351027177 0ustar acmeacmesetNumber($this->counter++); $this->vacuumedTables[] =& $vacuumedTable; } function close() { } function getSubscriptions() { return array(EVENT_VACUUM_TABLE/*, EVENT_ANALYZE_TABLE*/); } function & getVacuumedTables() { return $this->vacuumedTables; } function & getVacuumedTablesSortedByPercentageOfRowVersionsRemoved() { $vacuumedTables = $this->vacuumedTables; usort($vacuumedTables, array($this, 'comparePercentageOfRowVersionsRemoved')); return $vacuumedTables; } function comparePercentageOfRowVersionsRemoved(& $a, & $b) { $aPercentage = getExactPercentage($a->getNumberOfRemovableRows(), $a->getTotalNumberOfRows()); $bPercentage = getExactPercentage($b->getNumberOfRemovableRows(), $b->getTotalNumberOfRows()); if($aPercentage == $bPercentage) { return $this->compareNumberOfRowVersionsRemoved($a, $b); } elseif($aPercentage < $bPercentage) { return 1; } else { return -1; } } function compareNumberOfRowVersionsRemoved(& $a, & $b) { if($a->getNumberOfRemovableRows() == $b->getNumberOfRemovableRows()) { return 0; } elseif($a->getNumberOfRemovableRows() < $b->getNumberOfRemovableRows()) { return 1; } else { return -1; } } } ?>pgfouine-1.2/include/postgresql/vacuum/listeners/VacuumOverallListener.class.php0000644000175000017500000000713610764775351027060 0ustar acmeacmestatistics['numberOfTables'] = 0; $this->statistics['numberOfPages'] = 0; $this->statistics['numberOfPagesRemoved'] = 0; $this->statistics['numberOfRowVersions'] = 0; $this->statistics['numberOfRemovableRowVersions'] = 0; $this->statistics['duration'] = 0; $this->statistics['cpuUsage'] = 0; } function fireEvent(& $vacuumedTable) { $this->statistics['numberOfTables'] ++; $this->statistics['numberOfPages'] += $vacuumedTable->getNumberOfPages(); $this->statistics['numberOfPagesRemoved'] += $vacuumedTable->getNumberOfPagesRemoved(); $this->statistics['numberOfRowVersions'] += $vacuumedTable->getTotalNumberOfRows(); $this->statistics['numberOfRemovableRowVersions'] += $vacuumedTable->getNumberOfRemovableRows(); $this->statistics['duration'] += $vacuumedTable->getDuration(); $this->statistics['cpuUsage'] += $vacuumedTable->getCpuUsage(); if(!isset($this->statisticsPerDatabase[$vacuumedTable->getDatabase()]['numberOfTables'])) { $this->statisticsPerDatabase[$vacuumedTable->getDatabase()]['numberOfTables'] = 0; $this->statisticsPerDatabase[$vacuumedTable->getDatabase()]['numberOfPages'] = 0; $this->statisticsPerDatabase[$vacuumedTable->getDatabase()]['numberOfPagesRemoved'] = 0; $this->statisticsPerDatabase[$vacuumedTable->getDatabase()]['numberOfRowVersions'] = 0; $this->statisticsPerDatabase[$vacuumedTable->getDatabase()]['numberOfRemovableRowVersions'] = 0; $this->statisticsPerDatabase[$vacuumedTable->getDatabase()]['duration'] = 0; $this->statisticsPerDatabase[$vacuumedTable->getDatabase()]['cpuUsage'] = 0; } $this->statisticsPerDatabase[$vacuumedTable->getDatabase()]['numberOfTables'] ++; $this->statisticsPerDatabase[$vacuumedTable->getDatabase()]['numberOfPages'] += $vacuumedTable->getNumberOfPages(); $this->statisticsPerDatabase[$vacuumedTable->getDatabase()]['numberOfPagesRemoved'] += $vacuumedTable->getNumberOfPagesRemoved(); $this->statisticsPerDatabase[$vacuumedTable->getDatabase()]['numberOfRowVersions'] += $vacuumedTable->getTotalNumberOfRows(); $this->statisticsPerDatabase[$vacuumedTable->getDatabase()]['numberOfRemovableRowVersions'] += $vacuumedTable->getNumberOfRemovableRows(); $this->statisticsPerDatabase[$vacuumedTable->getDatabase()]['duration'] += $vacuumedTable->getDuration(); $this->statisticsPerDatabase[$vacuumedTable->getDatabase()]['cpuUsage'] += $vacuumedTable->getCpuUsage(); } function close() { } function getSubscriptions() { return array(EVENT_VACUUM_TABLE); } function getStatisticsPerDatabase() { return $this->statisticsPerDatabase; } function getStatistics() { return $this->statistics; } } ?>pgfouine-1.2/include/postgresql/vacuum/listeners/FSMInformationListener.class.php0000644000175000017500000000244410764775351027123 0ustar acmeacmefsmInformation); $this->fsmInformation =& $fsmInformation; } function close() { } function getSubscriptions() { return array(EVENT_FSM_INFORMATION); } function getFSMInformation() { return $this->fsmInformation; } } ?>pgfouine-1.2/include/postgresql/vacuum/PostgreSQLVacuumRegexps.lib.php0000644000175000017500000000734311007545332024721 0ustar acmeacmepgfouine-1.2/include/postgresql/vacuum/parsers/0000755000175000017500000000000011516212335020370 5ustar acmeacmepgfouine-1.2/include/postgresql/vacuum/parsers/PostgreSQLVacuumParser.class.php0000644000175000017500000001275310764775351026576 0ustar acmeacmeregexpSyslogContext = new RegExp('/^([A-Z][a-z]{2} [ 0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}) .*? '.$syslogString.'\[(\d{1,5})\]: \[(\d{1,20})(?:\-(\d{1,5}))?\] /'); } function & parse($text) { global $postgreSQLRegexps, $postgreSQLVacuumRegexps; $line = false; $logLineMatch =& $postgreSQLRegexps['LogLine']->match($text); if($logLineMatch) { $logLinePrefix = trim($logLineMatch->getMatch(1)); $keyword = $logLineMatch->getMatch(2); $postMatch = $logLineMatch->getPostMatch(); if($keyword == 'INFO') { $actionOnTableMatch =& $postgreSQLVacuumRegexps['VacuumingOrAnalyzingTable']->match($postMatch); $removableInformationMatch =& $postgreSQLVacuumRegexps['RemovableInformation']->match($postMatch); $operationInformationMatch =& $postgreSQLVacuumRegexps['OperationInformation']->match($postMatch); $fsmInformationMatch =& $postgreSQLVacuumRegexps['FSMInformation']->match($postMatch); $indexInformationMatch =& $postgreSQLVacuumRegexps['IndexCleanupInformation']->match($postMatch); if($actionOnTableMatch) { $matchCount = $actionOnTableMatch->getMatchCount(); if($actionOnTableMatch->getMatch(1) == 'vacuuming') { $lineType = 'PostgreSQLVacuumingTableLine'; } else { $lineType = 'PostgreSQLAnalyzingTableLine'; } if($matchCount == 3) { $schema = 'public'; $table = $actionOnTableMatch->getMatch(2); } else { $schema = $actionOnTableMatch->getMatch(2); $table = $actionOnTableMatch->getMatch(3); } $line = new $lineType($schema, $table); } elseif($removableInformationMatch) { $numberOfRemovableRows = $removableInformationMatch->getMatch(1); $numberOfNonRemovableRows = $removableInformationMatch->getMatch(2); $numberOfPages = $removableInformationMatch->getMatch(3); $line = new PostgreSQLVacuumRemovableInformationLine($numberOfRemovableRows, $numberOfNonRemovableRows, $numberOfPages); } elseif($operationInformationMatch) { $numberOfRowVersionsMoved = $operationInformationMatch->getMatch(1); $numberOfPagesRemoved = $operationInformationMatch->getMatch(2) - $operationInformationMatch->getMatch(3); $line = new PostgreSQLVacuumOperationInformationLine($numberOfRowVersionsMoved, $numberOfPagesRemoved); } elseif($fsmInformationMatch) { $currentNumberOfPages = $fsmInformationMatch->getMatch(1); $currentNumberOfRelations = $fsmInformationMatch->getMatch(2); $line = new PostgreSQLFSMInformationLine($currentNumberOfPages, $currentNumberOfRelations); } elseif($indexInformationMatch) { $indexName = $indexInformationMatch->getMatch(1); $numberOfRowVersions = $indexInformationMatch->getMatch(2); $numberOfPages = $indexInformationMatch->getMatch(3); $line = new PostgreSQLIndexCleanupInformationLine($indexName, $numberOfRowVersions, $numberOfPages); } } elseif($keyword == 'DETAIL') { $vacuumDetailMatch =& $postgreSQLVacuumRegexps['VacuumDetail']->match($postMatch); $cpuDetailMatch =& $postgreSQLVacuumRegexps['CpuDetailLine']->match($postMatch); $fsmInformationDetailMatch =& $postgreSQLVacuumRegexps['FSMInformationDetail']->match($postMatch); $indexDetail1Match =& $postgreSQLVacuumRegexps['IndexCleanupDetail1']->match($postMatch); $indexDetail2Match =& $postgreSQLVacuumRegexps['IndexCleanupDetail2']->match($postMatch); if($vacuumDetailMatch) { $line = new PostgreSQLVacuumDetailLine($postMatch); } elseif($cpuDetailMatch) { $systemCpuUsage = (float) $cpuDetailMatch->getMatch(1); $userCpuUsage = (float) $cpuDetailMatch->getMatch(2); $duration = (float) $cpuDetailMatch->getMatch(3); $line = new PostgreSQLVacuumCpuDetailLine($systemCpuUsage, $userCpuUsage, $duration); } elseif($fsmInformationDetailMatch) { $line = new PostgreSQLFSMInformationDetailLine($postMatch); } elseif($indexDetail1Match || $indexDetail2Match) { $line = new PostgreSQLIndexCleanupDetailLine($postMatch); } } } else { $vacuumingDatabaseMatch =& $postgreSQLVacuumRegexps['VacuumingDatabase']->match($text); $vacuumEndMatch =& $postgreSQLVacuumRegexps['VacuumEnd']->match($text); if($vacuumingDatabaseMatch) { $line = new PostgreSQLVacuumingDatabaseLine($vacuumingDatabaseMatch->getMatch(1)); } elseif($vacuumEndMatch) { $line = new PostgreSQLVacuumEndLine(); } else { // probably a continuation line $line = new PostgreSQLVacuumContinuationLine($text); } } return $line; } } ?>pgfouine-1.2/include/postgresql/vacuum/lines/0000755000175000017500000000000011516212335020023 5ustar acmeacmepgfouine-1.2/include/postgresql/vacuum/lines/PostgreSQLIndexCleanupInformationLine.class.php0000644000175000017500000000272210764775351031204 0ustar acmeacmePostgreSQLVacuumLogLine(''); $this->indexName = $indexName; $this->numberOfRowVersions = $numberOfRowVersions; $this->numberOfPages = $numberOfPages; } function appendTo(& $logObject) { $indexInformation = new VacuumIndexInformation($logObject, $this->indexName, $this->numberOfRowVersions, $this->numberOfPages); $logObject->addIndexInformation($indexInformation); } } ?>pgfouine-1.2/include/postgresql/vacuum/lines/PostgreSQLVacuumLogLine.class.php0000644000175000017500000000272210764775351026321 0ustar acmeacmetext = trim($text); } function appendText($text) { $this->text .= $text; } function getLogObject(& $logStream) { return false; } function appendTo(& $logObject) { return false; } function complete() { return false; } function getTimestamp() { return false; } function getText() { return $this->text; } function getLineNumber() { return 1; } function initializeLogObject(& $logStream, & $logObject) { $logObject->setDatabase($logStream->getDatabase()); } } ?>pgfouine-1.2/include/postgresql/vacuum/lines/PostgreSQLVacuumDetailLine.class.php0000644000175000017500000000645110764775351027005 0ustar acmeacmePostgreSQLVacuumLogLine($text); } function appendTo(& $logObject) { global $postgreSQLVacuumRegexps; $detailVacuumFullMatch =& $postgreSQLVacuumRegexps['VacuumFullDetailLine']->match($this->text); $detailVacuumMatch =& $postgreSQLVacuumRegexps['VacuumDetailLine']->match($this->text); if($detailVacuumFullMatch) { $nonRemovableDeadRows = $detailVacuumFullMatch->getMatch(1); $nonRemovableRowMinSize = $detailVacuumFullMatch->getMatch(2); $nonRemovableRowMaxSize = $detailVacuumFullMatch->getMatch(3); $unusedItemPointers = $detailVacuumFullMatch->getMatch(4); $totalFreeSpace = $detailVacuumFullMatch->getMatch(5); $numberOfPagesToEmpty = $detailVacuumFullMatch->getMatch(6); $numberOfPagesToEmptyAtTheEndOfTheTable = $detailVacuumFullMatch->getMatch(7); $numberOfPagesWithFreeSpace = $detailVacuumFullMatch->getMatch(8); $freeSpace = $detailVacuumFullMatch->getMatch(9); $systemCpuUsage = (float) $detailVacuumFullMatch->getMatch(10); $userCpuUsage = (float) $detailVacuumFullMatch->getMatch(11); $duration = (float) $detailVacuumFullMatch->getMatch(12); $logObject->setDetailedInformation($nonRemovableDeadRows, $nonRemovableRowMinSize, $nonRemovableRowMaxSize, $unusedItemPointers, $totalFreeSpace, $numberOfPagesToEmpty, $numberOfPagesToEmptyAtTheEndOfTheTable, $numberOfPagesWithFreeSpace, $freeSpace, $systemCpuUsage, $userCpuUsage, $duration); } elseif($detailVacuumMatch) { $nonRemovableDeadRows = $detailVacuumMatch->getMatch(1); $nonRemovableRowMinSize = '-'; $nonRemovableRowMaxSize = '-'; $unusedItemPointers = $detailVacuumMatch->getMatch(2); $totalFreeSpace = '-'; $numberOfPagesToEmpty = $detailVacuumMatch->getMatch(3); $numberOfPagesToEmptyAtTheEndOfTheTable = '-'; $numberOfPagesWithFreeSpace = '-'; $freeSpace = '-'; $systemCpuUsage = (float) $detailVacuumMatch->getMatch(4); $userCpuUsage = (float) $detailVacuumMatch->getMatch(5); $duration = (float) $detailVacuumMatch->getMatch(6); $logObject->setDetailedInformation($nonRemovableDeadRows, $nonRemovableRowMinSize, $nonRemovableRowMaxSize, $unusedItemPointers, $totalFreeSpace, $numberOfPagesToEmpty, $numberOfPagesToEmptyAtTheEndOfTheTable, $numberOfPagesWithFreeSpace, $freeSpace, $systemCpuUsage, $userCpuUsage, $duration); } } } ?>pgfouine-1.2/include/postgresql/vacuum/lines/PostgreSQLFSMInformationLine.class.php0000644000175000017500000000260510764775351027252 0ustar acmeacmecurrentNumberOfPages = $currentNumberOfPages; $this->currentNumberOfRelations = $currentNumberOfRelations; } function & getLogObject(& $logStream) { $fsmInformation = new FSMInformationLogObject($this->currentNumberOfPages, $this->currentNumberOfRelations); return $fsmInformation; } } ?>pgfouine-1.2/include/postgresql/vacuum/lines/PostgreSQLAnalyzingTableLine.class.php0000644000175000017500000000240110764775351027315 0ustar acmeacmeschema = $schema; $this->table = $table; } function & getLogObject(& $logStream) { $analyzeInformation = new AnalyzeTableLogObject($logStream->getDatabase(), $this->schema, $this->table); return $analyzeInformation; } } ?>pgfouine-1.2/include/postgresql/vacuum/lines/PostgreSQLVacuumEndLine.class.php0000644000175000017500000000173610764775351026312 0ustar acmeacmepgfouine-1.2/include/postgresql/vacuum/lines/PostgreSQLVacuumContinuationLine.class.php0000644000175000017500000000220510764775351030246 0ustar acmeacmePostgreSQLVacuumLogLine($text); } function getText() { return ' '.parent::getText(); } } ?>pgfouine-1.2/include/postgresql/vacuum/lines/PostgreSQLIndexCleanupDetailLine.class.php0000644000175000017500000000351310764775351030120 0ustar acmeacmePostgreSQLVacuumLogLine($text); } function appendTo(& $logObject) { global $postgreSQLVacuumRegexps; $detailMatch =& $postgreSQLVacuumRegexps['IndexCleanupDetailLine']->match($this->text); if($detailMatch) { $numberOfRemovedRowVersions = $detailMatch->getMatch(1) ? $detailMatch->getMatch(1) : 0; $numberOfDeletedPages = $detailMatch->getMatch(2); $numberOfReusablePages = $detailMatch->getMatch(3); $systemCpuUsage = (float) $detailMatch->getMatch(4); $userCpuUsage = (float) $detailMatch->getMatch(5); $duration = (float) $detailMatch->getMatch(6); $lastIndexInformation =& $logObject->getLastIndexInformation(); if($lastIndexInformation) { $lastIndexInformation->setDetailedInformation($numberOfRemovedRowVersions, $numberOfDeletedPages, $numberOfReusablePages, $systemCpuUsage, $userCpuUsage, $duration); } } } } ?>pgfouine-1.2/include/postgresql/vacuum/lines/PostgreSQLVacuumingTableLine.class.php0000644000175000017500000000237610764775351027332 0ustar acmeacmeschema = $schema; $this->table = $table; } function & getLogObject(& $logStream) { $vacuumInformation = new VacuumTableLogObject($logStream->getDatabase(), $this->schema, $this->table); return $vacuumInformation; } } ?>pgfouine-1.2/include/postgresql/vacuum/lines/PostgreSQLVacuumOperationInformationLine.class.php0000644000175000017500000000270010764775351031742 0ustar acmeacmePostgreSQLVacuumLogLine(); $this->numberOfRowVersionsMoved = $numberOfRowVersionsMoved; $this->numberOfPagesRemoved = $numberOfPagesRemoved; } function appendTo(& $logObject) { $logObject->setNumberOfRowVersionsMoved($this->numberOfRowVersionsMoved); $logObject->setNumberOfPagesRemoved($this->numberOfPagesRemoved); } } ?>pgfouine-1.2/include/postgresql/vacuum/lines/PostgreSQLVacuumingDatabaseLine.class.php0000644000175000017500000000043610457645012027767 0ustar acmeacmePostgreSQLVacuumLogLine(); $this->database = $database; } function getDatabase() { return $this->database; } } ?>pgfouine-1.2/include/postgresql/vacuum/lines/PostgreSQLFSMInformationDetailLine.class.php0000644000175000017500000000313510764775351030374 0ustar acmeacmePostgreSQLVacuumLogLine($text); } function appendTo(& $logObject) { global $postgreSQLVacuumRegexps; $detailMatch =& $postgreSQLVacuumRegexps['FSMDetailLine']->match($this->text); if($detailMatch) { $pageSlotsInUse = $detailMatch->getMatch(1); $pageSlotsRequired = $detailMatch->getMatch(2); $maxNumberOfPageSlots = $detailMatch->getMatch(3); $maxNumberOfRelations = $detailMatch->getMatch(4); $size = $detailMatch->getMatch(5); $logObject->setDetailedInformation($pageSlotsInUse, $pageSlotsRequired, $maxNumberOfPageSlots, $maxNumberOfRelations, $size); } } } ?>pgfouine-1.2/include/postgresql/vacuum/lines/PostgreSQLVacuumCpuDetailLine.class.php0000644000175000017500000000264410764775351027455 0ustar acmeacmePostgreSQLVacuumLogLine(); $this->systemCpuUsage = $systemCpuUsage; $this->userCpuUsage = $userCpuUsage; $this->duration = $duration; } function appendTo(& $logObject) { $logObject->addSystemCpuUsage($this->systemCpuUsage); $logObject->addUserCpuUsage($this->userCpuUsage); $logObject->addDuration($this->duration); } } ?>pgfouine-1.2/include/postgresql/vacuum/lines/PostgreSQLVacuumRemovableInformationLine.class.php0000644000175000017500000000311210764775351031714 0ustar acmeacmePostgreSQLVacuumLogLine(); $this->numberOfRemovableRows = $numberOfRemovableRows; $this->numberOfNonRemovableRows = $numberOfNonRemovableRows; $this->numberOfPages = $numberOfPages; } function appendTo(& $logObject) { $logObject->setNumberOfRemovableRows($this->numberOfRemovableRows); $logObject->setNumberOfNonRemovableRows($this->numberOfNonRemovableRows); $logObject->setNumberOfPages($this->numberOfPages); } } ?>pgfouine-1.2/include/postgresql/vacuum/objects/0000755000175000017500000000000011516212335020342 5ustar acmeacmepgfouine-1.2/include/postgresql/vacuum/objects/FSMInformationLogObject.class.php0000644000175000017500000000443310764775351026627 0ustar acmeacmecurrentNumberOfPageSlots = $currentNumberOfPageSlots; $this->currentNumberOfRelations = $currentNumberOfRelations; } function getEventType() { return EVENT_FSM_INFORMATION; } function setDetailedInformation($pageSlotsInUse, $pageSlotsRequired, $maxNumberOfPageSlots, $maxNumberOfRelations, $size ) { $this->pageSlotsInUse = $pageSlotsInUse; $this->pageSlotsRequired = $pageSlotsRequired; $this->maxNumberOfPageSlots = $maxNumberOfPageSlots; $this->maxNumberOfRelations = $maxNumberOfRelations; $this->size = $size; } function getcurrentNumberOfPageSlots() { return $this->currentNumberOfPageSlots; } function getCurrentNumberOfRelations() { return $this->currentNumberOfRelations; } function getPageSlotsInUse() { return $this->pageSlotsInUse; } function getPageSlotsRequired() { return $this->pageSlotsRequired; } function getMaxNumberOfPageSlots() { return $this->maxNumberOfPageSlots; } function getMaxNumberOfRelations() { return $this->maxNumberOfRelations; } function getSize() { return $this->size; } } ?>pgfouine-1.2/include/postgresql/vacuum/objects/VacuumLogObject.class.php0000644000175000017500000000313010764775351025225 0ustar acmeacmedatabase = $database; $this->schema = $schema; $this->table = $table; $this->ignored = $ignored; } function getEventType() { return false; } function accumulateTo(& $accumulator) { if(!$this->isIgnored()) { $accumulator->fireEvent($this); } } function isIgnored() { return $this->ignored; } /** * returns the database used * * @return string database */ function getDatabase() { return $this->database; } function getSchema() { return $this->schema; } function getTable() { return $this->table; } } ?>pgfouine-1.2/include/postgresql/vacuum/objects/AnalyzeTableLogObject.class.php0000644000175000017500000000254710764775351026353 0ustar acmeacmeVacuumLogObject($database, $schema, $table, $ignored); } function getEventType() { return EVENT_ANALYZE_TABLE; } function isIgnored() { $path = $this->database.'.'.$this->schema.'.'.$this->table; if(strpos($path, CONFIG_FILTER) === 0) { $filtered = false; } else { $filtered = true; } return ($this->ignored || $filtered); } } ?>pgfouine-1.2/include/postgresql/vacuum/objects/VacuumIndexInformation.class.php0000644000175000017500000000557610764775351026652 0ustar acmeacmevacuumedTable =& $vacuumedTable; $this->indexName = $indexName; $this->numberOfRowVersions = $numberOfRowVersions; $this->numberOfPages = $numberOfPages; } function setDetailedInformation($numberOfRemovedRowVersions, $numberOfDeletedPages, $numberOfReusablePages, $systemCpuUsage, $userCpuUsage, $duration) { $this->numberOfRemovedRowVersions = $numberOfRemovedRowVersions; $this->numberOfDeletedPages = $numberOfDeletedPages; $this->numberOfReusablePages = $numberOfReusablePages; $this->systemCpuUsage = $systemCpuUsage; $this->userCpuUsage = $userCpuUsage; $this->duration = $duration; if($this->vacuumedTable->hasDuration()) { // it's a vacuum full, we add the index rusage to get the global rusage $this->vacuumedTable->addSystemCpuUsage($this->getSystemCpuUsage()); $this->vacuumedTable->addUserCpuUsage($this->getUserCpuUsage()); $this->vacuumedTable->addDuration($this->getDuration()); } } function getIndexName() { return $this->indexName; } function getNumberOfRowVersions() { return $this->numberOfRowVersions; } function getNumberOfPages() { return $this->numberOfPages; } function getNumberOfRemovedRowVersions() { return $this->numberOfRemovedRowVersions; } function getNumberOfDeletedPages() { return $this->numberOfDeletedPages; } function getNumberOfReusablePages() { return $this->numberOfReusablePages; } function getDuration() { return $this->duration; } function getCpuUsage() { return $this->systemCpuUsage + $this->userCpuUsage; } function getSystemCpuUsage() { return $this->systemCpuUsage; } function getUserCpuUsage() { return $this->userCpuUsage; } } ?>pgfouine-1.2/include/postgresql/vacuum/objects/VacuumTableLogObject.class.php0000644000175000017500000001261510764775351026205 0ustar acmeacmeVacuumLogObject($database, $schema, $table, $ignored); } function getEventType() { return EVENT_VACUUM_TABLE; } function setNumberOfRemovableRows($numberOfRemovableRows) { $this->numberOfRemovableRows = $numberOfRemovableRows; } function setNumberOfNonRemovableRows($numberOfNonRemovableRows) { $this->numberOfNonRemovableRows = $numberOfNonRemovableRows; } function setNumberOfPages($numberOfPages) { $this->numberOfPages = $numberOfPages; } function setNumberOfRowVersionsMoved($numberOfRowVersionsMoved) { $this->numberOfRowVersionsMoved = $numberOfRowVersionsMoved; } function setNumberOfPagesRemoved($numberOfPagesRemoved) { $this->numberOfPagesRemoved = $numberOfPagesRemoved; } function setDetailedInformation($nonRemovableDeadRows, $nonRemovableRowMinSize, $nonRemovableRowMaxSize, $unusedItemPointers, $totalFreeSpace, $numberOfPagesToEmpty, $numberOfPagesToEmptyAtTheEndOfTheTable, $numberOfPagesWithFreeSpace, $freeSpace, $systemCpuUsage, $userCpuUsage, $duration) { $this->numberOfNonRemovableDeadRows = $nonRemovableDeadRows; $this->nonRemovableRowMinSize = $nonRemovableRowMinSize; $this->nonRemovableRowMaxSize = $nonRemovableRowMaxSize; $this->numberOfUnusedItemPointers = $unusedItemPointers; $this->totalFreeSpace = $totalFreeSpace; $this->numberOfPagesToEmpty = $numberOfPagesToEmpty; $this->numberOfPagesToEmptyAtTheEndOfTheTable = $numberOfPagesToEmptyAtTheEndOfTheTable; $this->numberOfPagesWithFreeSpace = $numberOfPagesWithFreeSpace; $this->freeSpace = $freeSpace; $this->hasDuration = true; $this->systemCpuUsage = $systemCpuUsage; $this->userCpuUsage = $userCpuUsage; $this->duration = $duration; } function getTablePath() { $tablePath = ''; if($this->database != UNKNOWN_DATABASE) { $tablePath .= $this->database.' - '; } $tablePath .= $this->schema.'.'.$this->table; return $tablePath; } function getNumberOfPages() { return $this->numberOfPages; } function getNumberOfPagesRemoved() { return $this->numberOfPagesRemoved; } function getTotalNumberOfRows() { return $this->numberOfRemovableRows + $this->numberOfNonRemovableRows; } function getNumberOfRemovableRows() { return $this->numberOfRemovableRows; } function getNumberOfNonRemovableDeadRows() { return $this->numberOfNonRemovableDeadRows; } function getNonRemovableRowMinSize() { return $this->nonRemovableRowMinSize; } function getNonRemovableRowMaxSize() { return $this->nonRemovableRowMaxSize; } function getNumberOfUnusedItemPointers() { return $this->numberOfUnusedItemPointers; } function getCpuUsage() { return $this->systemCpuUsage + $this->userCpuUsage; } function addSystemCpuUsage($systemCpuUsage) { $this->systemCpuUsage += $systemCpuUsage; } function getSystemCpuUsage() { return $this->systemCpuUsage; } function addUserCpuUsage($userCpuUsage) { $this->userCpuUsage += $userCpuUsage; } function getUserCpuUsage() { return $this->userCpuUsage; } function addDuration($duration) { $this->duration += $duration; } function getDuration() { return $this->duration; } function hasDuration() { return $this->hasDuration; } function addIndexInformation(& $indexInformation) { $this->indexesInformation[] =& $indexInformation; } function & getLastIndexInformation() { return last($this->indexesInformation); } function & getIndexesInformation() { return $this->indexesInformation; } function setNumber($number) { $this->number = $number; } function getNumber() { return $this->number; } function isIgnored() { $path = $this->database.'.'.$this->schema.'.'.$this->table; if(!CONFIG_FILTER || (strpos($path, CONFIG_FILTER) === 0)) { $filtered = false; } else { $filtered = true; } return ($this->ignored || $filtered); } } ?>pgfouine-1.2/include/postgresql/vacuum/reporting/0000755000175000017500000000000011516212335020722 5ustar acmeacmepgfouine-1.2/include/postgresql/vacuum/reporting/reports/0000755000175000017500000000000011516212335022420 5ustar acmeacmepgfouine-1.2/include/postgresql/vacuum/reporting/reports/VacuumOverallReport.class.php0000644000175000017500000001012310764775351030233 0ustar acmeacmeReport($reportAggregator, 'Vacuum overall statistics', array('VacuumOverallListener')); } function getText() { return 'This report doesn\'t support the text format at the moment.'; } function getHtml() { $listener =& $this->reportAggregator->getListener('VacuumOverallListener'); $statisticsPerDatabase = $listener->getStatisticsPerDatabase(); $statistics = $listener->getStatistics(); $html = ''; $html .= ' '; foreach($statisticsPerDatabase AS $database => $databaseStatistics) { $html .= ''; } if(count($statisticsPerDatabase) > 1) { $html .= ''; } $html .= '
            Tables Pages Pages truncated % Row versions Removable row versions % CPU usage Duration
          '.$database.' '.$this->formatInteger($databaseStatistics['numberOfTables']).' '.$this->formatInteger($databaseStatistics['numberOfPages']).' '.$this->formatInteger($databaseStatistics['numberOfPagesRemoved']).' '.$this->getPercentage($databaseStatistics['numberOfPagesRemoved'], $databaseStatistics['numberOfPages']).' '.$this->formatInteger($databaseStatistics['numberOfRowVersions']).' '.$this->formatInteger($databaseStatistics['numberOfRemovableRowVersions']).' '.$this->getPercentage($databaseStatistics['numberOfRemovableRowVersions'], $databaseStatistics['numberOfRowVersions']).' '.$this->formatLongDuration($databaseStatistics['cpuUsage']).' '.$this->formatLongDuration($databaseStatistics['duration']).'
          Overall '.$this->formatInteger($statistics['numberOfTables']).' '.$this->formatInteger($statistics['numberOfPages']).' '.$this->formatInteger($statistics['numberOfPagesRemoved']).' '.$this->getPercentage($statistics['numberOfPagesRemoved'], $statistics['numberOfPages']).' '.$this->formatInteger($statistics['numberOfRowVersions']).' '.$this->formatInteger($statistics['numberOfRemovableRowVersions']).' '.$this->getPercentage($statistics['numberOfRemovableRowVersions'], $statistics['numberOfRowVersions']).' '.$this->formatLongDuration($statistics['cpuUsage']).' '.$this->formatLongDuration($statistics['duration']).'
          '; return $html; } } ?>pgfouine-1.2/include/postgresql/vacuum/reporting/reports/VacuumedTablesDetailsReport.class.php0000644000175000017500000001047510764775351031672 0ustar acmeacmeReport($reportAggregator, 'Vacuumed tables details', array('VacuumedTablesListener')); } function getText() { return 'This report doesn\'t support the text format at the moment.'; } function getHtml() { $listener =& $this->reportAggregator->getListener('VacuumedTablesListener'); $vacuumedTables =& $listener->getVacuumedTables(); $vacuumedTablesCount = count($vacuumedTables); $html = ''; for($i = 0; $i < $vacuumedTablesCount; $i++) { $vacuumedTable =& $vacuumedTables[$i]; $html .= '

          '.$vacuumedTable->getNumber().' - '.$vacuumedTable->getTablePath().'

          '; $html .= '
          '; $html .= '
          • Pages: '.$vacuumedTable->getNumberOfPages().'
          • '; $html .= '
          • Pages truncated: '.$vacuumedTable->getNumberOfPagesRemoved().' ( '.$this->getPercentage($vacuumedTable->getNumberOfPagesRemoved(), $vacuumedTable->getNumberOfPages()).'% )
          • '; $html .= '
          • Row versions: '.$vacuumedTable->getTotalNumberOfRows().'
          • Removable row versions: '.$vacuumedTable->getNumberOfRemovableRows().' ( '.$this->getPercentage($vacuumedTable->getNumberOfRemovableRows(), $vacuumedTable->getTotalNumberOfRows()).'% )
          • Non removable dead rows: '.$vacuumedTable->getNumberOfNonRemovableDeadRows().'
          • '; if($vacuumedTable->getNonRemovableRowMinSize() != '-') { $html .= '
          • Non removable row size: from '.$vacuumedTable->getNonRemovableRowMinSize().' bytes to '.$vacuumedTable->getNonRemovableRowMaxSize().' bytes
          • '; } $html .= '
          • Unused item pointers: '.$vacuumedTable->getNumberOfUnusedItemPointers().'
          • CPU usage: sys: '.$this->formatLongDuration($vacuumedTable->getSystemCpuUsage()).' / user: '.$this->formatLongDuration($vacuumedTable->getUserCpuUsage()).'
          • Duration: '.$this->formatLongDuration($vacuumedTable->getDuration()).'
          '; $indexesInformation =& $vacuumedTable->getIndexesInformation(); $numberOfIndexes = count($indexesInformation); if($numberOfIndexes > 0) { $html .= ''; for($j = 0; $j < $numberOfIndexes; $j++) { $indexInformation = $indexesInformation[$j]; $html .= ''; unset($indexInformation); } $html .= '
          Index Pages Deleted pages Reusable pages Row versions Removed row versions CPU usage Duration
          '.$indexInformation->getIndexName().' '.$indexInformation->getNumberOfPages().' '.$indexInformation->getNumberOfDeletedPages().' '.$indexInformation->getNumberOfReusablePages().' '.$indexInformation->getNumberOfRowVersions().' '.$indexInformation->getNumberOfRemovedRowVersions().' sys: '.$this->formatLongDuration($indexInformation->getSystemCpuUsage()).' / user: '.$this->formatLongDuration($indexInformation->getUserCpuUsage()).' '.$this->formatLongDuration($indexInformation->getDuration()).'
          '; } unset($indexesInformation); $html .= '
          '; } return $html; } } ?>pgfouine-1.2/include/postgresql/vacuum/reporting/reports/VacuumedTablesReport.class.php0000644000175000017500000000700110764775351030353 0ustar acmeacmeReport($reportAggregator, 'Vacuumed tables', array('VacuumedTablesListener')); $reportAggregator->addScript('sorttable.js'); } function getText() { return 'This report doesn\'t support the text format at the moment.'; } function getHtml() { $listener =& $this->reportAggregator->getListener('VacuumedTablesListener'); $vacuumedTables =& $listener->getVacuumedTablesSortedByPercentageOfRowVersionsRemoved(); $vacuumedTablesCount = count($vacuumedTables); $html = ''; $html .= '

          Click on a column header to sort the rows. Note that it can be quite long to sort all the rows if you vacuumed a lot of tables.

          '; if($this->reportAggregator->containsReportBlock('VacuumedTablesDetailsReport')) { $html .= ''; } $html .= ' '; for($i = 0; $i < $vacuumedTablesCount; $i++) { $vacuumedTable =& $vacuumedTables[$i]; $html .= ''; if($this->reportAggregator->containsReportBlock('VacuumedTablesDetailsReport')) { $html .= ''; } $html .= ''; } $html .= '
          # Table Pages Pages truncated % Row versions Removable row versions % CPU usage DurationDetails
          '.$vacuumedTable->getNumber().' '.$vacuumedTable->getTablePath().' '.$vacuumedTable->getNumberOfPages().' '.$vacuumedTable->getNumberOfPagesRemoved().' '.$this->getPercentage($vacuumedTable->getNumberOfPagesRemoved(), $vacuumedTable->getNumberOfPages()).' '.$vacuumedTable->getTotalNumberOfRows().' '.$vacuumedTable->getNumberOfRemovableRows().' '.$this->getPercentage($vacuumedTable->getNumberOfRemovableRows(), $vacuumedTable->getTotalNumberOfRows()).' '.$this->formatDuration($vacuumedTable->getCpuUsage(), 2, '.', '').' '.$this->formatDuration($vacuumedTable->getDuration(), 2, '.', '').'Details
          '; return $html; } } ?>pgfouine-1.2/include/postgresql/vacuum/reporting/reports/FSMInformationReport.class.php0000644000175000017500000000615110764775351030307 0ustar acmeacmeReport($reportAggregator, 'FSM information', array('FSMInformationListener')); } function getText() { return 'This report doesn\'t support the text format at the moment.'; } function getHtml() { $listener =& $this->reportAggregator->getListener('FSMInformationListener'); $fsmInformation =& $listener->getFSMInformation(); $html = ''; if($fsmInformation) { $html .= '
            '; $html .= '
          • FSM size: '.$this->formatInteger($fsmInformation->getSize()).' kB
          • '; $html .= '
          '; $html .= '
          '; $html .= ' '; $pageSlotsUsedPercentage = $this->getPercentage($fsmInformation->getPageSlotsRequired(), $fsmInformation->getMaxNumberOfPageSlots()); $style = 'normal'; if($pageSlotsUsedPercentage > 85) { $style = 'warning'; } if($pageSlotsUsedPercentage > 99) { $style = 'fatal'; } $html .= ''; $relationSlotsUsedPercentage = $this->getPercentage($fsmInformation->getCurrentNumberOfRelations(), $fsmInformation->getMaxNumberOfRelations()); $style = 'normal'; if($relationSlotsUsedPercentage > 85) { $style = 'warning'; } if($relationSlotsUsedPercentage > 99) { $style = 'error'; } $html .= ''; $html .= "\n"; $html .= '
            Current value Limit Percentage
          Page slots '.$this->formatInteger($fsmInformation->getPageSlotsRequired()).' '.$this->formatInteger($fsmInformation->getMaxNumberOfPageSlots()).' '.$pageSlotsUsedPercentage.' %
          Relations '.$this->formatInteger($fsmInformation->getCurrentNumberOfRelations()).' '.$this->formatInteger($fsmInformation->getMaxNumberOfRelations()).' '.$relationSlotsUsedPercentage.' %
          '; } else { $html .= '

          FSM information not available.

          '; } return $html; } } ?>pgfouine-1.2/include/postgresql/vacuum/VacuumLogStream.class.php0000644000175000017500000000545310764775351023633 0ustar acmeacmecurrentBlock) { $logObject =& $this->currentBlock->close(); } $this->currentBlock = new LogBlock($this, $line->getLineNumber(), $line); } elseif(is_a($line, 'PostgreSQLVacuumingDatabaseLine')) { $this->database = $line->getDatabase(); } elseif(is_a($line, 'PostgreSQLVacuumEndLine')) { if($this->currentBlock) { $logObject =& $this->currentBlock->close(); } } elseif($this->currentBlock) { if(is_a($line, 'PostgreSQLVacuumContinuationLine')) { // it is just a continuation line so we just add the text to the text of the last line) if($line->getText()) { $lastLine =& last($this->currentBlock->getLines()); $lastLine->appendText($line->getText()); } } else { $this->currentBlock->addLine($line); } } return $logObject; } /** * returns the database used * * @return string database */ function getDatabase() { return $this->database; } /** * flushes the potential remaining log block (usually the last one before the connection * was closed) * * @param object $accumulator current accumulator */ function flush(& $accumulator) { if($this->currentBlock && $this->currentBlock->isComplete()) { $logObject =& $this->currentBlock->close(); if($logObject) { $logObject->accumulateTo($accumulator); } } $this->currentBlock = false; } } ?>pgfouine-1.2/include/postgresql/vacuum/vacuum.lib.php0000644000175000017500000000535610764775351021520 0ustar acmeacmepgfouine-1.2/include/postgresql/vacuum/PostgreSQLVacuumAccumulator.class.php0000644000175000017500000000223210764775351026131 0ustar acmeacmestream = new VacuumLogStream(); } function append(& $line) { $logObject =& $this->stream->append($line); if($logObject) { $logObject->accumulateTo($this); } } } ?>pgfouine-1.2/include/postgresql/PostgreSQLRegexps.lib.php0000644000175000017500000000505711166215253022242 0ustar acmeacmepgfouine-1.2/include/postgresql/postgresql.lib.php0000644000175000017500000000415711013243235021074 0ustar acmeacmepgfouine-1.2/include/postgresql/PostgreSQLAccumulator.class.php0000644000175000017500000000443511174641555023451 0ustar acmeacmestream = new LogStream(); } function append(& $line) { if($connectionId = $line->getConnectionId()) { if(!isset($this->working[$connectionId])) { $this->working[$connectionId] = new LogStream(); } $query =& $this->working[$connectionId]->append($line); } else { $query =& $this->stream->append($line); } if($query) { $query->accumulateTo($this); } } function flushLogStreams() { // flush default stream $this->stream->flush($this); // flush streams with connection id $logStreamsKeys = array_keys($this->working); foreach($logStreamsKeys AS $key) { $logStream =& $this->working[$key]; $logStream->flush($this); unset($logStream); } } function garbageCollect($lastLineTimestamp) { if($this->stream->getLastLineTimestamp() < ($lastLineTimestamp - 60)) { $this->stream->flush($this); } if(DEBUG) { stderr(' before: '.count($this->working).' log streams'); } $logStreamsKeys = array_keys($this->working); foreach($logStreamsKeys AS $key) { $logStream =& $this->working[$key]; if($logStream->getLastLineTimestamp() < ($lastLineTimestamp - 60)) { $logStream->flush($this); unset($logStream); unset($this->working[$key]); } } if(DEBUG) { stderr(' after: '.count($this->working).' log streams'); } } } ?>pgfouine-1.2/include/lib/0000755000175000017500000000000011516212335013754 5ustar acmeacmepgfouine-1.2/include/lib/common.lib.php0000644000175000017500000001434311244607450016533 0ustar acmeacme 0) { $percentage = $number*100/$total; } else { $percentage = 0; } return $percentage; } function normalizeWhitespaces($text, $keepOnlyIndent = false) { if($keepOnlyIndent) { $toReplace = '/(?<=[^\s])[ \t]+/m'; } else { $text = trim($text); $toReplace = '/\s+/'; } $text = preg_replace($toReplace, ' ', $text); return $text; } function &last(& $array) { if(empty($array)) { $last = false; } else { end($array); $last =& $array[key($array)]; } return $last; } function &pop(& $array) { if(empty($array)) { $last = false; } else { $last =& last($array); array_pop($array); } return $last; } function arrayAdd($array1, $array2) { $size = count($array1); $sum = array(); for($i = 0; $i < $size; $i++) { $sum[] = $array1[$i] + $array2[$i]; } return $sum; } function str_putcsv($input, $delimiter = ',', $enclosure = '"') { $fp = fopen('php://temp', 'r+'); fputcsv($fp, $input, $delimiter, $enclosure); rewind($fp); $data = fread($fp, 1048576); fclose($fp); return $data; } class RegExp { var $pattern; function RegExp($pattern) { $this->pattern = $pattern; } function & match($text) { $found = preg_match($this->pattern, $text, $matches, PREG_OFFSET_CAPTURE); $match = false; if($found) { $match = new RegExpMatch($text, $matches); } return $match; } function & matchAll($text) { $matches = array(); $found = preg_match_all($this->pattern, $text, $matches, PREG_SET_ORDER); return $matches; } function replace($text, $replacement) { return preg_replace($this->pattern, $replacement, $text); } function getPattern() { return $this->pattern; } } class RegExpMatch { var $text; var $matches = array(); function RegExpMatch($text, & $matches) { $this->text = $text; $this->matches =& $matches; } function & getMatches() { return $this->matches; } function getMatch($position) { if(isset($this->matches[$position])) { return $this->matches[$position][0]; } else { return false; } } function getPostMatch() { $postMatch = substr($this->text, $this->matches[0][1] + strlen($this->matches[0][0])); return $postMatch; } function getMatchCount() { return count($this->matches); } } class QueryCounter { var $queryCount = 0; var $queryDuration = 0; var $identifiedQueryCount = 0; var $identifiedQueryDuration = 0; var $selectCount = 0; var $selectDuration = 0; var $updateCount = 0; var $updateDuration = 0; var $insertCount = 0; var $insertDuration = 0; var $deleteCount = 0; var $deleteDuration = 0; function incrementQuery($duration) { $this->queryCount ++; $this->queryDuration += $duration; } function incrementIdentifiedQuery($duration) { $this->identifiedQueryCount ++; $this->identifiedQueryDuration += $duration; } function incrementSelect($duration) { $this->selectCount ++; $this->selectDuration += $duration; } function incrementUpdate($duration) { $this->updateCount ++; $this->updateDuration += $duration; } function incrementInsert($duration) { $this->insertCount ++; $this->insertDuration += $duration; } function incrementDelete($duration) { $this->deleteCount ++; $this->deleteDuration += $duration; } function getQueryCount() { return $this->queryCount; } function getQueryDuration() { return $this->queryDuration; } function getIdentifiedQueryCount() { return $this->identifiedQueryCount; } function getIdentifiedQueryDuration() { return $this->identifiedQueryDuration; } function getSelectCount() { return $this->selectCount; } function getSelectDuration() { return $this->selectDuration; } function getUpdateCount() { return $this->updateCount; } function getUpdateDuration() { return $this->updateDuration; } function getInsertCount() { return $this->insertCount; } function getInsertDuration() { return $this->insertDuration; } function getDeleteCount() { return $this->deleteCount; } function getDeleteDuration() { return $this->deleteDuration; } } ?>pgfouine-1.2/include/lib/Profiler.class.php0000644000175000017500000001147710764774405017404 0ustar acmeacmestart = microtime(); } function end() { $this->end = microtime(); $this->aggregateData(); } function startStage($stage) { $this->currentStage .= (empty($this->currentStage) ? '' : '>').$stage; $stagePath = $this->currentStage; if(!isset($this->stages[$stagePath])) { $this->stages[$stagePath] = array(); $this->stages[$stagePath]['count'] = 0; $this->stages[$stagePath]['time'] = array(); } $this->stages[$stagePath]['time'][] = microtime(); } function endStage($stage, $tag = false) { $this->stages[$this->currentStage]['time'][] = microtime(); $this->stages[$this->currentStage]['count'] ++; if($tag) { $count = count($this->stages[$this->currentStage]['time']); $this->addToTag($tag, $this->stages[$this->currentStage]['time'][$count-2], $this->stages[$this->currentStage]['time'][$count-1]); } $this->currentStage = substr($this->currentStage, 0, strrpos($this->currentStage, '>')); } function addToTag($tag, $start, $end) { if(!isset($this->tags[$tag])) { $this->tags[$tag] = array(); $this->tags[$tag]['count'] = 0; $this->tags[$tag]['time'] = array(); } $this->tags[$tag]['count'] ++; $this->tags[$tag]['time'][] = $start; $this->tags[$tag]['time'][] = $end; } function getTags() { return $this->tags; } function getCurrentStage() { return $this->currentStage; } function getStages() { return $this->stages; } function aggregateData() { $this->totalTime = getTime($this->end) - getTime($this->start); foreach($this->stages AS $stageName => $stage) { $count = count($stage['time']); $totalDuration = 0; for($i = 0; $i < $count; $i+=2) { $totalDuration += getTime($stage['time'][$i+1]) - getTime($stage['time'][$i]); } unset($this->stages[$stageName]['time']); $this->stages[$stageName]['duration'] = $totalDuration; } foreach($this->tags AS $tagName => $tag) { $count = count($tag['time']); $totalDuration = 0; for($i = 0; $i < $count; $i+=2) { $totalDuration += getTime($tag['time'][$i+1]) - getTime($tag['time'][$i]); } unset($this->tags[$tagName]['time']); $this->tags[$tagName]['duration'] = $totalDuration; } } function displayProfile() { stderr(''); stderr('###################################################'); stderr('# Profile #'); stderr('###################################################'); stderr(''); stderr('Total time: '.number_format($this->totalTime, 5)); if(!empty($this->stages)) { stderr(''); stderr('# Stages'); stderr(''); foreach($this->stages AS $stagePath => $stage) { if(strpos($stagePath, '>') !== false) { $stageName = substr($stagePath, strrpos($stagePath, '>') + 1); } else { $stageName = $stagePath; } $level = substr_count($stagePath, '>'); $line = str_repeat(' ', $level); $line .= $stageName; $line .= ': '; $line .= number_format($stage['duration'], 5).' ('; $line .= 'cnt: '.$stage['count']; if($stage['count'] > 1) { $line .= ' - avg: '.number_format($stage['duration']/$stage['count'], 5); } $line .= ' - pct: '.number_format(($stage['duration']/$this->totalTime)*100, 2).'%'; $line .= ')'; stderr($line); } } if(!empty($this->tags)) { stderr(''); stderr('# Tags'); stderr(''); foreach($this->tags AS $tagName => $tag) { $line = $tagName; $line .= ': '; $line .= number_format($tag['duration'], 5).' ('; $line .= 'cnt: '.$tag['count']; if($tag['count'] > 1) { $line .= ' - avg: '.number_format($tag['duration']/$tag['count'], 5); } $line .= ' - pct: '.number_format(($tag['duration']/$this->totalTime)*100, 2).'%'; $line .= ')'; stderr($line); } } stderr(''); } } ?>pgfouine-1.2/include/LogObject.class.php0000644000175000017500000001054511175035433016703 0ustar acmeacmeconnectionId = $connectionId; $this->user = $user; $this->database = $database; $this->text = $text; $this->ignored = $ignored; } function setContextInformation($timestamp, $commandNumber) { $this->timestamp = $timestamp; $this->commandNumber = $commandNumber; } function getCommandNumber() { return $this->commandNumber; } function getTimestamp() { return $this->timestamp; } function getEventType() { return false; } function append($text) { if(DEBUG > 1 && !$text) stderr('Empty text for append', true); $this->text .= ' '.$text; } function addNotice($notice) { $this->notices[] = $notice; } function getNotices() { return $this->notices; } function setContext($context) { $this->context = normalizeWhitespaces($context); } function getNormalizedText() { $regexpRemoveText = "/'[^']*'/"; $regexpRemoveNumbers = '/([^a-zA-Z_\$-])-?([0-9]+)/'; $regexpRemoveHexadecimalNumbers = '/([^a-z_\$-])0x[0-9a-f]{1,10}/i'; $regexpRemoveIn = '/(IN\s*)\([\'0x,\s]*\)/i'; $text = $this->text; if($text) { $text = normalizeWhitespaces($text, CONFIG_KEEP_FORMATTING); $text = str_replace("\\'", '', $text); $text = preg_replace($regexpRemoveText, "''", $text); $text = preg_replace("/''('')+/", "''", $text); $text = preg_replace($regexpRemoveNumbers, '${1}0', $text); $text = preg_replace($regexpRemoveHexadecimalNumbers, '${1}0x', $text); $text = preg_replace($regexpRemoveIn, '${1}(...)', $text); } return $text; } function accumulateTo(& $accumulator) { if(!$this->isIgnored()) { $this->text = normalizeWhitespaces($this->text, CONFIG_KEEP_FORMATTING); $accumulator->fireEvent($this); } } function isIgnored() { if(CONFIG_DATABASE && $this->database != CONFIG_DATABASE) { return true; } if(CONFIG_DATABASE_REGEXP && !preg_match(CONFIG_DATABASE_REGEXP, $this->database)) { return true; } if(CONFIG_DATABASE_LIST && !in_array($this->database, explode(',', CONFIG_DATABASE_LIST))) { return true; } if(CONFIG_USER && $this->user != CONFIG_USER) { return true; } if(CONFIG_USER_REGEXP && !preg_match(CONFIG_USER_REGEXP, $this->user)) { return true; } if(CONFIG_USER_LIST && !in_array($this->user, explode(',', CONFIG_USER_LIST))) { return true; } if((CONFIG_TIMESTAMP_FILTER && ($this->timestamp < CONFIG_FROM_TIMESTAMP || $this->timestamp > CONFIG_TO_TIMESTAMP))) { $this->ignored = true; } return $this->ignored; } function getConnectionId() { return $this->connectionId; } function getDatabase() { return $this->database; } function getUser() { return $this->user; } function getText() { return $this->text; } function getContext() { return $this->context; } function getDetailedInformation() { $detailedInformation = formatTimestamp($this->getTimestamp()); if($this->getUser() && $this->getDatabase()) { $detailedInformation .= ' - '.$this->getUser().'@'.$this->getDatabase(); } return $detailedInformation; } function appendDetail($detail) { } function setNumber($number) { $this->number = $number; } function getNumber() { return $this->number; } function setLocation($location) { $this->location = $location; } function getLocation() { return $this->location; } } ?>pgfouine-1.2/README0000644000175000017500000000054010337432011012435 0ustar acmeacmepgFouine is a PostgreSQL log analyzer designed to parse big log files with a low memory footprint. You can generate text or HTML reports containing aggregated information about the queries executed by your database. Example: pgfouine.php -file path/to/your/log/file.log > report.html For comprehensive usage information, just run: pgfouine.php -help pgfouine-1.2/rpm-specific/0000755000175000017500000000000011516212335014144 5ustar acmeacmepgfouine-1.2/rpm-specific/sources/0000755000175000017500000000000011516212335015627 5ustar acmeacmepgfouine-1.2/rpm-specific/sources/pgfouine-tutorial.txt0000644000175000017500000000672110543261573022062 0ustar acmeacmeInstallation instructions & Tutorial Installation You can either untar the pgFouine tarball or install the RPM package. * If you use the tarball, pgFouine is installed locally and can be run with ./pgfouine.php in the directory where you installed it. * If you install the RPM package, pgFouine is installed globally and you can run pgFouine with pgfouine.php. How to enable query logging PostgreSQL 7.x Edit your postgresql.conf file (usually located in /var/lib/pgsql/data/) and set the following configuration directives: * To log queries slower than n milliseconds: syslog = 2 log_min_duration_statement = n log_duration = false log_statement = false To log every query executed, set log_min_duration_statement to 0. Set it to -1 to disable query logging. * To log queries slower than n milliseconds AND duration for ALL queries (it only works with PostgreSQL 7.x; pgFouine counts every duration only once): syslog = 2 log_min_duration_statement = n log_duration = true log_statement = false Then edit your /etc/syslog.conf to set up a PostgreSQL facility: local0.* -/var/log/pgsql You should also ignore PostgreSQL facility for the default log file otherwise you will log the queries twice: *.info;mail.none;authpriv.none;cron.none;local0.none /var/log/messages Restart syslogd and PostgreSQL. Apart from the extra I/O, the overhead of logging is barely noticeable. You can set syslog to send the log to another server through the network with @ip.ad.dr.ess. PostgreSQL 8.x Syslog configuration Edit your postgresql.conf file (usually located in /var/lib/pgsql/data/) and set the following configuration directives: * To enable syslog logging: log_destination = 'syslog' redirect_stderr = off silent_mode = on * To log queries slower than n milliseconds: log_min_duration_statement = n log_duration = off log_statement = 'none' To log every query executed, set log_min_duration_statement to 0. Set it to -1 to disable query logging. Then edit your /etc/syslog.conf to set up a PostgreSQL facility: local0.* -/var/log/pgsql You should also ignore PostgreSQL facility for the default log file otherwise you will log the queries twice: *.info;mail.none;authpriv.none;cron.none;local0.none /var/log/messages Restart syslogd and PostgreSQL. Apart from the extra I/O, the overhead of logging is barely noticeable. You can set syslog to send the log to another server through the network with @ip.ad.dr.ess. Filter on database and/or user You can filter your log file on database and user using the -database and -user options. To do so, you need to configure the following log_line_prefix: log_line_prefix = 'user=%u,db=%d' Using stderr log file Using the following configuration, you can log to stderr instead of syslog. This is not recommended as we cannot guarantee the consistency of statements if they are multilines. log_destination = 'stderr' redirect_stderr = on log_line_prefix = '%t [%p]: [%l-1] ' Usage pgFouine is an easy to use command line tool. The following command generates an HTML report with all default options: $ pgfouine.php -file your/log/file.log > your-report.html The following command line displays a text report with only 10 queries in each list to the standard output: $ pgfouine.php -file your/log/file.log -top 10 -format text By using pgfouine.php -help, you can display the usage information. pgfouine-1.2/rpm-specific/patches/0000755000175000017500000000000011516212335015573 5ustar acmeacmepgfouine-1.2/rpm-specific/patches/pgfouine-0.7-include_path.patch0000644000175000017500000000120310503075114023360 0ustar acmeacme--- pgfouine_vacuum.php.orig 2006-08-11 00:13:57.797229593 +0200 +++ pgfouine_vacuum.php 2006-08-11 00:15:16.800770504 +0200 @@ -30,6 +30,8 @@ error_reporting(E_ALL); } +ini_set('include_path', '@INCLUDEPATH@'); + include('version.php'); require_once('include/lib/common.lib.php'); require_once('include/base.lib.php'); --- pgfouine.php.orig 2006-08-11 00:17:07.628330143 +0200 +++ pgfouine.php 2006-08-11 00:18:39.298492488 +0200 @@ -30,6 +30,8 @@ error_reporting(E_ALL); } +ini_set('include_path', '@INCLUDEPATH@'); + include('version.php'); require_once('include/lib/common.lib.php'); require_once('include/base.lib.php'); pgfouine-1.2/RELEASE0000644000175000017500000000073211174670723012601 0ustar acmeacmeHow to release pgFouine: - update the ChangeLog with the release date - tag (RELEASE_X_X) and branch (BRANCH_X_X) - build the tarball, the .src.rpm and the .rpm files (use a cvs export to create the tarball) - publish the tarball to http://pgfouine.projects.postgresql.org/releases/ - publish the files on pgFoundry - update the website with the release date, the changelog and the files urls - email David Fetter to be included in PWN - publish the new version on freshmeatpgfouine-1.2/pgfouine_vacuum.php0000755000175000017500000001702210764774405015514 0ustar acmeacme#! /usr/bin/php -qC [-report [outputfile=]] [-filter ] -file log file to analyze - read the log from stdin instead of -file -report [outputfile=] list of report blocks separated by a comma report blocks can be: overall, fsm, vacuumedtables, details you can add several -report options if you want to generate several reports at once -filter filter of the form: database or database.schema filter is applied on output only -title define the title of the reports -memorylimit <n> PHP memory limit in MB. Default is 128. -debug debug mode -profile profile mode -help this help '; if($error) { exit(1); } else { exit(0); } } function checkOutputFilePath($filePath) { if(!$filePath) { return false; } $tmpOutputFilePath = $filePath; $tmpOutputDirectory = dirname($tmpOutputFilePath); $tmpOutputFileName = basename($tmpOutputFilePath); if(file_exists($tmpOutputFilePath) && (!is_file($tmpOutputFilePath) || !is_writable($tmpOutputFilePath))) { usage($tmpOutputFilePath.' already exists and is not a file or is not writable'); return false; } elseif(!is_dir($tmpOutputDirectory) || !is_writable($tmpOutputDirectory)) { usage($tmpOutputDirectory.' is not a directory, does not exist or is not writable'); return false; } elseif(!$tmpOutputFileName) { usage('cannot find a valid basename in '.$tmpOutputFilePath); return false; } else { $outputFilePath = realpath($tmpOutputDirectory).'/'.$tmpOutputFileName; return $outputFilePath; } } if(isset($_SERVER['argv']) && (!isset($argv) || empty($argv))) { $argv = $_SERVER['argv']; } if(is_array($argv)) { $executable = array_shift($argv); } else { $argv = array(); $executable = 'unknown'; } $options = array(); $argvCount = count($argv); for($i = 0; $i < $argvCount; $i++) { if(strpos($argv[$i], '-') === 0) { if($argv[$i] == '-') { define('CONFIG_STDIN', true); } else { $optionKey = substr($argv[$i], 1); $value = false; if(($i+1 < $argvCount) && (strpos($argv[$i+1], '-') !== 0)) { $value = $argv[$i+1]; $i++; } if($optionKey == 'report' || $optionKey == 'reports') { if(!isset($options['reports'])) { $options['reports'] = array(); } $options['reports'][] = $value; } else { $options[$optionKey] = $value; } } } else { usage('invalid options format'); } } if(isset($options['memorylimit']) && ((int) $options['memorylimit']) > 0) { $memoryLimit = (int) $options['memorylimit']; } else { $memoryLimit = 128; } ini_set('memory_limit', $memoryLimit.'M'); if(!defined('CONFIG_STDIN')) { define('CONFIG_STDIN', false); } if(isset($options['help']) || isset($options['h']) || isset($options['-help'])) { usage(); } if(isset($options['debug'])) { define('DEBUG', 1); } else { define('DEBUG', 0); } if(isset($options['profile'])) { define('PROFILE', 1); } else { define('PROFILE', 0); } define('CONFIG_ONLY_SELECT', false); define('CONFIG_KEEP_FORMATTING', false); define('CONFIG_DURATION_UNIT', 's'); define('CONFIG_TIMESTAMP_FILTER', false); define('CONFIG_DATABASE', false); define('CONFIG_USER', false); if(!CONFIG_STDIN) { if(!isset($options['file'])) { usage('the -file option is required'); } elseif(!$options['file']) { usage('you have to specify a file path'); } elseif(!is_readable($options['file'])) { usage('file '.$options['file'].' cannot be read'); } else { $filePath = realpath($options['file']); } } else { $filePath = 'php://stdin'; } if(isset($options['filter']) && !empty($options['filter'])) { define('CONFIG_FILTER', $options['filter']); } else { define('CONFIG_FILTER', false); } if(isset($options['title'])) { define('CONFIG_REPORT_TITLE', $options['title']); } else { define('CONFIG_REPORT_TITLE', 'pgFouine: PostgreSQL VACUUM log analysis report'); } $outputToFiles = false; $supportedReportBlocks = array( 'overall' => 'VacuumOverallReport', 'vacuumedtables' => 'VacuumedTablesReport', 'details' => 'VacuumedTablesDetailsReport', 'fsm' => 'FSMInformationReport' ); $defaultReportBlocks = array('fsm', 'overall', 'vacuumedtables', 'details'); $reports = array(); if(isset($options['reports'])) { foreach($options['reports'] AS $report) { if(strpos($report, '=') !== false) { list($outputFilePath, $blocks) = explode('=', $report); $outputToFiles = true; } elseif(strpos($report, '.') !== false) { $outputFilePath = $report; $blocks = 'default'; $outputToFiles = true; } else { $outputFilePath = false; $blocks = $report; $outputToFiles = false; } if($blocks == 'default') { $selectedBlocks = $defaultReportBlocks; $notSupportedBlocks = array(); } elseif($blocks == 'all') { $selectedBlocks = array_keys($supportedReportBlocks); $notSupportedBlocks = array(); } else { $selectedBlocks = explode(',', $blocks); $notSupportedBlocks = array_diff($selectedBlocks, array_keys($supportedReportBlocks)); } if(empty($notSupportedBlocks)) { $outputFilePath = checkOutputFilePath($outputFilePath); $reports[] = array( 'blocks' => $selectedBlocks, 'file' => $outputFilePath ); } else { usage('report types not supported: '.implode(',', $notSupportedBlocks)); } } } else { $reports[] = array( 'blocks' => $defaultReportBlocks, 'file' => false ); } $aggregator = 'HtmlReportAggregator'; $parser = 'PostgreSQLVacuumParser'; $logReader = new GenericLogReader($filePath, $parser, 'PostgreSQLVacuumAccumulator'); foreach($reports AS $report) { $reportAggregator = new $aggregator($logReader, $report['file']); foreach($report['blocks'] AS $block) { $reportAggregator->addReportBlock($supportedReportBlocks[$block]); } $logReader->addReportAggregator($reportAggregator); unset($reportAggregator); } $logReader->parse(); $logReader->output(); fclose($stderr); ?>��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������pgfouine-1.2/version.php����������������������������������������������������������������������������0000644�0001750�0001750�00000000044�11341307461�013760� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php define('VERSION', '1.2'); ?>��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������pgfouine-1.2/AUTHORS��������������������������������������������������������������������������������0000644�0001750�0001750�00000000236�10335411376�012640� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������pgFouine is written by: * Guillaume Smet <guillaume-pg at smet dot org> It is based on the main principles of PQA designed by Tom Copeland and Thomas Favier.������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������pgfouine-1.2/pgfouine.spec��������������������������������������������������������������������������0000644�0001750�0001750�00000006416�11341307461�014263� 0����������������������������������������������������������������������������������������������������ustar �acme����������������������������acme�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Summary: PgFouine PostgreSQL log analyzer Name: pgfouine Version: 1.2 Release: 1%{?dist} BuildArch: noarch License: GPLv2+ Group: Development/Tools Source0: http://pgfouine.projects.postgresql.org/releases/%{name}-%{version}.tar.gz Source2: pgfouine-tutorial.txt URL: http://pgfouine.projects.postgresql.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Patch1: pgfouine-0.7-include_path.patch %description pgFouine is a PostgreSQL log analyzer. It generates text or HTML reports from PostgreSQL log files. These reports contain the list of the slowest queries, the queries that take the most time and so on. pgFouine can also: - analyze VACUUM VERBOSE output to help you improve your VACUUM strategy, - generate Tsung sessions file to benchmark your PostgreSQL server. %prep %setup -q %patch1 -p0 sed -i 's!@INCLUDEPATH@!%{_datadir}/%{name}!' pgfouine_vacuum.php sed -i 's!@INCLUDEPATH@!%{_datadir}/%{name}!' pgfouine.php cp %{SOURCE2} . %build %install # cleaning build environment rm -rf %{buildroot} # creating required directories install -m 755 -d %{buildroot}/%{_datadir}/%{name} install -m 755 -d %{buildroot}/%{_bindir} # installing pgFouine for i in include version.php; do cp -rp $i %{buildroot}/%{_datadir}/%{name}/ done install -m 755 pgfouine.php %{buildroot}/%{_bindir}/ install -m 755 pgfouine_vacuum.php %{buildroot}/%{_bindir}/ %clean rm -rf %{buildroot} %files %defattr(-, root, root) %doc AUTHORS ChangeLog COPYING THANKS README RELEASE pgfouine-tutorial.txt %attr(0755, root, root) %{_bindir}/pgfouine.php %attr(0755, root, root) %{_bindir}/pgfouine_vacuum.php %{_datadir}/%{name} %changelog * Wed Feb 24 2010 Guillaume Smet <guillaume.smet@gmail.com> 1.2-1 - Update to 1.2 * Sun Apr 26 2009 Guillaume Smet <guillaume-pg@smet.org> - 1.1-1 - Update to 1.1 * Thu Aug 28 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 1.0-3 - fix license tag * Sun Jun 3 2007 Devrim Gunduz <devrim@CommandPrompt.com> - 1.0-2 - Bumped up spec version * Sun Apr 1 2007 Devrim Gunduz <devrim@CommandPrompt.com> - 1.0-1 - Update to 1.0 * Tue Dec 12 2006 Devrim Gunduz <devrim@CommandPrompt.com> - 0.7.2-1 - Update to 0.7.2 * Thu Nov 30 2006 Devrim Gunduz <devrim@CommandPrompt.com> - 0.7.1-2 - Added tutorial.txt per bugzilla review * Sat Oct 28 2006 Guillaume Smet <guillaume-pg@smet.org> - 0.7.1-1 - released 0.7.1 * Sun Sep 3 2006 Guillaume Smet <guillaume-pg@smet.org> - 0.7-4 - fixed spec according to bugzilla #202901 comment #2 * Thu Aug 18 2006 Devrim Gunduz <devrim@CommandPrompt.com> - 0.7-3 - fixed spec, per bugzilla review * Thu Aug 17 2006 Devrim Gunduz <devrim@CommandPrompt.com> - 0.7-2 - fixed rpmlint warnings, and made cosmetic changes * Thu Aug 17 2006 Guillaume Smet <guillaume-pg@smet.org> - released 0.7 * Thu Aug 10 2006 Guillaume Smet <guillaume-pg@smet.org> - fixed RPM packaging for 0.7 * Wed Jul 19 2006 Guillaume Smet <guillaume-pg@smet.org> - added pgfouine_vacuum.php * Sun May 21 2006 Guillaume Smet <guillaume-pg@smet.org> - released 0.6 * Sun Mar 26 2006 Guillaume Smet <guillaume-pg@smet.org> - released 0.5 * Tue Jan 10 2006 Guillaume Smet <guillaume-pg@smet.org> - released 0.2.1 * Sun Dec 4 2005 Guillaume Smet <guillaume-pg@smet.org> - released 0.2 * Fri Nov 18 2005 Guillaume Smet <guillaume-pg@smet.org> - initial RPM packaging ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������