From 2f4a618900e2c3b6ea14c68cbeb5897cd2ac1a04 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 29 May 2008 12:25:56 +0000 Subject: ok... i hope i haven't messed too much with the code and everything is still working. Changes: - Ascraeus now uses constants for the phpbb root path and the php extension. This ensures more security for external applications and modifications (no more overwriting of root path and extension possible through insecure mods and register globals enabled) as well as no more globalizing needed. - A second change implemented here is an additional short-hand-notation for append_sid(). It is allowed to omit the root path and extension now (for example calling append_sid('memberlist')) - in this case the root path and extension get added automatically. The hook is called after these are added. git-svn-id: file:///svn/phpbb/trunk@8572 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/develop/search_fill.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'phpBB/develop/search_fill.php') diff --git a/phpBB/develop/search_fill.php b/phpBB/develop/search_fill.php index 371c8c74cc..23acee6a1a 100644 --- a/phpBB/develop/search_fill.php +++ b/phpBB/develop/search_fill.php @@ -23,9 +23,9 @@ die("Please read the first lines of this script for instructions on how to enabl set_time_limit(0); define('IN_PHPBB', true); -$phpbb_root_path = '../'; -$phpEx = substr(strrchr(__FILE__, '.'), 1); -include($phpbb_root_path . 'common.'.$phpEx); +define('PHPBB_ROOT_PATH', './../'); +define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1)); +include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT); // Start session management $user->session_begin(); @@ -34,12 +34,12 @@ $user->setup(); $search_type = $config['search_type']; -if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) +if (!file_exists(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT)) { trigger_error('NO_SUCH_SEARCH_MODULE'); } -require($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx); +require(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT); $error = false; $search = new $search_type($error); -- cgit v1.2.1 From 19aed179e53f9660a7202e2e50816e1cef0f7be9 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 28 Dec 2008 23:30:09 +0000 Subject: $config to phpbb::$config git-svn-id: file:///svn/phpbb/trunk@9242 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/develop/search_fill.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/develop/search_fill.php') diff --git a/phpBB/develop/search_fill.php b/phpBB/develop/search_fill.php index 23acee6a1a..af2dd6a288 100644 --- a/phpBB/develop/search_fill.php +++ b/phpBB/develop/search_fill.php @@ -32,7 +32,7 @@ $user->session_begin(); $auth->acl($user->data); $user->setup(); -$search_type = $config['search_type']; +$search_type = phpbb::$config['search_type']; if (!file_exists(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT)) { @@ -76,7 +76,7 @@ for(;$postcounter <= $max_post_id; $postcounter += $batchsize) $batchstart = $postcounter + 1; $batchend = $postcounter + $batchsize; $batchcount++; - + $sql = "SELECT * FROM " . POSTS_TABLE . " WHERE post_id @@ -92,7 +92,7 @@ for(;$postcounter <= $max_post_id; $postcounter += $batchsize) $db->sql_freeresult($result); $post_rows = sizeof($rowset); - + if( $post_rows ) { -- cgit v1.2.1 From 794c5749696c9fa2595ed3a1d7c836a0d984e11c Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 22 Feb 2009 15:29:18 +0000 Subject: remove global and change $user-> to phpbb::$user-> git-svn-id: file:///svn/phpbb/trunk@9334 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/develop/search_fill.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/develop/search_fill.php') diff --git a/phpBB/develop/search_fill.php b/phpBB/develop/search_fill.php index af2dd6a288..4d80b19f55 100644 --- a/phpBB/develop/search_fill.php +++ b/phpBB/develop/search_fill.php @@ -28,9 +28,9 @@ define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1)); include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT); // Start session management -$user->session_begin(); -$auth->acl($user->data); -$user->setup(); +phpbb::$user->session_begin(); +$auth->acl(phpbb::$user->data); +phpbb::$user->setup(); $search_type = phpbb::$config['search_type']; -- cgit v1.2.1 From 95b69cfa7f66e721cea3f8a5d62ad1cb2b822cfc Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 22 Feb 2009 15:48:29 +0000 Subject: $auth-> to phpbb::$acl-> git-svn-id: file:///svn/phpbb/trunk@9335 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/develop/search_fill.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/develop/search_fill.php') diff --git a/phpBB/develop/search_fill.php b/phpBB/develop/search_fill.php index 4d80b19f55..ef683109a3 100644 --- a/phpBB/develop/search_fill.php +++ b/phpBB/develop/search_fill.php @@ -29,7 +29,7 @@ include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT); // Start session management phpbb::$user->session_begin(); -$auth->acl(phpbb::$user->data); +phpbb::$acl->init(phpbb::$user->data); phpbb::$user->setup(); $search_type = phpbb::$config['search_type']; -- cgit v1.2.1 From 84f795e9fbd172924280593d575bf4587c9b40e5 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 22 Feb 2009 18:06:05 +0000 Subject: $db-> to phpbb::$db-> git-svn-id: file:///svn/phpbb/trunk@9336 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/develop/search_fill.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'phpBB/develop/search_fill.php') diff --git a/phpBB/develop/search_fill.php b/phpBB/develop/search_fill.php index ef683109a3..8819c428fd 100644 --- a/phpBB/develop/search_fill.php +++ b/phpBB/develop/search_fill.php @@ -56,13 +56,13 @@ print "\n\n"; // $sql = "SELECT COUNT(*) as total, MAX(post_id) as max_post_id FROM ". POSTS_TABLE; -if ( !($result = $db->sql_query($sql)) ) +if ( !($result = phpbb::$db->sql_query($sql)) ) { - $error = $db->sql_error(); + $error = phpbb::$db->sql_error(); die("Couldn't get maximum post ID :: " . $sql . " :: " . $error['message']); } -$max_post_id = $db->sql_fetchrow($result); +$max_post_id = phpbb::$db->sql_fetchrow($result); $totalposts = $max_post_id['total']; $max_post_id = $max_post_id['max_post_id']; @@ -82,14 +82,14 @@ for(;$postcounter <= $max_post_id; $postcounter += $batchsize) WHERE post_id BETWEEN $batchstart AND $batchend"; - if( !($result = $db->sql_query($sql)) ) + if( !($result = phpbb::$db->sql_query($sql)) ) { - $error = $db->sql_error(); + $error = phpbb::$db->sql_error(); die("Couldn't get post_text :: " . $sql . " :: " . $error['message']); } - $rowset = $db->sql_fetchrowset($result); - $db->sql_freeresult($result); + $rowset = phpbb::$db->sql_fetchrowset($result); + phpbb::$db->sql_freeresult($result); $post_rows = sizeof($rowset); @@ -97,7 +97,7 @@ for(;$postcounter <= $max_post_id; $postcounter += $batchsize) { // $sql = "LOCK TABLES ".POST_TEXT_TABLE." WRITE"; - // $result = $db->sql_query($sql); + // $result = phpbb::$db->sql_query($sql); print "\n

\nRestart from posting $batchstart
\n"; // For every post in the batch: @@ -111,7 +111,7 @@ for(;$postcounter <= $max_post_id; $postcounter += $batchsize) $search->index('post', $rowset[$post_nr]['post_id'], $rowset[$post_nr]['post_text'], $rowset[$post_nr]['post_subject'], $rowset[$post_nr]['poster_id']); } // $sql = "UNLOCK TABLES"; - // $result = $db->sql_query($sql); + // $result = phpbb::$db->sql_query($sql); } } -- cgit v1.2.1 From bf8ac19eaa8d74f9dfd6d597190f5664e7339382 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 4 Oct 2009 18:13:59 +0000 Subject: Move trunk/phpBB to old_trunk/phpBB git-svn-id: file:///svn/phpbb/trunk@10210 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/develop/search_fill.php | 129 ------------------------------------------ 1 file changed, 129 deletions(-) delete mode 100644 phpBB/develop/search_fill.php (limited to 'phpBB/develop/search_fill.php') diff --git a/phpBB/develop/search_fill.php b/phpBB/develop/search_fill.php deleted file mode 100644 index 8819c428fd..0000000000 --- a/phpBB/develop/search_fill.php +++ /dev/null @@ -1,129 +0,0 @@ -session_begin(); -phpbb::$acl->init(phpbb::$user->data); -phpbb::$user->setup(); - -$search_type = phpbb::$config['search_type']; - -if (!file_exists(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT)) -{ - trigger_error('NO_SUCH_SEARCH_MODULE'); -} - -require(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT); - -$error = false; -$search = new $search_type($error); - -if ($error) -{ - trigger_error($error); -} - -print "\n\n"; - -// -// Fetch a batch of posts_text entries -// -$sql = "SELECT COUNT(*) as total, MAX(post_id) as max_post_id - FROM ". POSTS_TABLE; -if ( !($result = phpbb::$db->sql_query($sql)) ) -{ - $error = phpbb::$db->sql_error(); - die("Couldn't get maximum post ID :: " . $sql . " :: " . $error['message']); -} - -$max_post_id = phpbb::$db->sql_fetchrow($result); - -$totalposts = $max_post_id['total']; -$max_post_id = $max_post_id['max_post_id']; - -$postcounter = (!isset($HTTP_GET_VARS['batchstart'])) ? 0 : $HTTP_GET_VARS['batchstart']; - -$batchsize = 200; // Process this many posts per loop -$batchcount = 0; -for(;$postcounter <= $max_post_id; $postcounter += $batchsize) -{ - $batchstart = $postcounter + 1; - $batchend = $postcounter + $batchsize; - $batchcount++; - - $sql = "SELECT * - FROM " . POSTS_TABLE . " - WHERE post_id - BETWEEN $batchstart - AND $batchend"; - if( !($result = phpbb::$db->sql_query($sql)) ) - { - $error = phpbb::$db->sql_error(); - die("Couldn't get post_text :: " . $sql . " :: " . $error['message']); - } - - $rowset = phpbb::$db->sql_fetchrowset($result); - phpbb::$db->sql_freeresult($result); - - $post_rows = sizeof($rowset); - - if( $post_rows ) - { - - // $sql = "LOCK TABLES ".POST_TEXT_TABLE." WRITE"; - // $result = phpbb::$db->sql_query($sql); - print "\n

\nRestart from posting $batchstart
\n"; - - // For every post in the batch: - for($post_nr = 0; $post_nr < $post_rows; $post_nr++ ) - { - print "."; - flush(); - - $post_id = $rowset[$post_nr]['post_id']; - - $search->index('post', $rowset[$post_nr]['post_id'], $rowset[$post_nr]['post_text'], $rowset[$post_nr]['post_subject'], $rowset[$post_nr]['poster_id']); - } - // $sql = "UNLOCK TABLES"; - // $result = phpbb::$db->sql_query($sql); - - } -} - -print "
Removing common words (words that appear in more than 50% of the posts)
\n"; -flush(); -$search->tidy(); -print "Removed words that where too common.
"; - -echo "
Done"; - -?> - - - -- cgit v1.2.1 From 2e17e448deed073f8614bb555a8ef20c57291c2a Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 4 Oct 2009 18:14:59 +0000 Subject: Copy 3.0.x branch to trunk git-svn-id: file:///svn/phpbb/trunk@10211 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/develop/search_fill.php | 129 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 phpBB/develop/search_fill.php (limited to 'phpBB/develop/search_fill.php') diff --git a/phpBB/develop/search_fill.php b/phpBB/develop/search_fill.php new file mode 100644 index 0000000000..371c8c74cc --- /dev/null +++ b/phpBB/develop/search_fill.php @@ -0,0 +1,129 @@ +session_begin(); +$auth->acl($user->data); +$user->setup(); + +$search_type = $config['search_type']; + +if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) +{ + trigger_error('NO_SUCH_SEARCH_MODULE'); +} + +require($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx); + +$error = false; +$search = new $search_type($error); + +if ($error) +{ + trigger_error($error); +} + +print "\n\n"; + +// +// Fetch a batch of posts_text entries +// +$sql = "SELECT COUNT(*) as total, MAX(post_id) as max_post_id + FROM ". POSTS_TABLE; +if ( !($result = $db->sql_query($sql)) ) +{ + $error = $db->sql_error(); + die("Couldn't get maximum post ID :: " . $sql . " :: " . $error['message']); +} + +$max_post_id = $db->sql_fetchrow($result); + +$totalposts = $max_post_id['total']; +$max_post_id = $max_post_id['max_post_id']; + +$postcounter = (!isset($HTTP_GET_VARS['batchstart'])) ? 0 : $HTTP_GET_VARS['batchstart']; + +$batchsize = 200; // Process this many posts per loop +$batchcount = 0; +for(;$postcounter <= $max_post_id; $postcounter += $batchsize) +{ + $batchstart = $postcounter + 1; + $batchend = $postcounter + $batchsize; + $batchcount++; + + $sql = "SELECT * + FROM " . POSTS_TABLE . " + WHERE post_id + BETWEEN $batchstart + AND $batchend"; + if( !($result = $db->sql_query($sql)) ) + { + $error = $db->sql_error(); + die("Couldn't get post_text :: " . $sql . " :: " . $error['message']); + } + + $rowset = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + + $post_rows = sizeof($rowset); + + if( $post_rows ) + { + + // $sql = "LOCK TABLES ".POST_TEXT_TABLE." WRITE"; + // $result = $db->sql_query($sql); + print "\n

\nRestart from posting $batchstart
\n"; + + // For every post in the batch: + for($post_nr = 0; $post_nr < $post_rows; $post_nr++ ) + { + print "."; + flush(); + + $post_id = $rowset[$post_nr]['post_id']; + + $search->index('post', $rowset[$post_nr]['post_id'], $rowset[$post_nr]['post_text'], $rowset[$post_nr]['post_subject'], $rowset[$post_nr]['poster_id']); + } + // $sql = "UNLOCK TABLES"; + // $result = $db->sql_query($sql); + + } +} + +print "
Removing common words (words that appear in more than 50% of the posts)
\n"; +flush(); +$search->tidy(); +print "Removed words that where too common.
"; + +echo "
Done"; + +?> + + + -- cgit v1.2.1 From a1a1b61ae8507276f7191be84a8782c0b0218f9c Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Thu, 9 Feb 2012 22:22:32 +0200 Subject: [ticket/10637] Leftovers from implementation of extensions in develop tools Replacing code in development tools that was missed in ticket 10323 PHPBB3-10637 --- phpBB/develop/search_fill.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'phpBB/develop/search_fill.php') diff --git a/phpBB/develop/search_fill.php b/phpBB/develop/search_fill.php index 371c8c74cc..4c0b607778 100644 --- a/phpBB/develop/search_fill.php +++ b/phpBB/develop/search_fill.php @@ -34,13 +34,11 @@ $user->setup(); $search_type = $config['search_type']; -if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) +if (!class_exists($search_type)) { trigger_error('NO_SUCH_SEARCH_MODULE'); } -require($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx); - $error = false; $search = new $search_type($error); -- cgit v1.2.1 From 7c406e1e8123758c20b92c7ff424bbf9b9190cf2 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Wed, 15 Aug 2012 22:05:26 +0530 Subject: [ticket/11052] update search backend constructor everywhere PHPBB3-11052 --- phpBB/develop/search_fill.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/develop/search_fill.php') diff --git a/phpBB/develop/search_fill.php b/phpBB/develop/search_fill.php index 4c0b607778..2a4dfb212c 100644 --- a/phpBB/develop/search_fill.php +++ b/phpBB/develop/search_fill.php @@ -40,7 +40,7 @@ if (!class_exists($search_type)) } $error = false; -$search = new $search_type($error); +$search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user); if ($error) { -- cgit v1.2.1 From 1e45a05000687994137adb7e415a9a39f9afd371 Mon Sep 17 00:00:00 2001 From: brunoais Date: Wed, 11 Mar 2015 17:46:42 +0000 Subject: [ticket/13685] Add phpbb_dispatcher to fulltext search constructors PHPBB3-13685 --- phpBB/develop/search_fill.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/develop/search_fill.php') diff --git a/phpBB/develop/search_fill.php b/phpBB/develop/search_fill.php index 2a4dfb212c..07c4024b2f 100644 --- a/phpBB/develop/search_fill.php +++ b/phpBB/develop/search_fill.php @@ -40,7 +40,7 @@ if (!class_exists($search_type)) } $error = false; -$search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user); +$search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher); if ($error) { -- cgit v1.2.1