[wp-hackers] Questions Related To Improving WP Installation

Andrew Nacin wp at andrewnacin.com
Sat Jan 23 20:31:29 UTC 2010


Dan,
I've commented to the ticket both on this and on the patch you posted. Beau
has it right, we can check for existence of the table using that queryq. We
also wouldn't be able to run get_users_of_blog() anyway, as we don't load
that part of the API.

On Sat, Jan 23, 2010 at 3:25 PM, Beau Lebens <beau at dentedreality.com.au>wrote:

> > 2 ) Is there a better way to get the number of users in the database than
> > using: count( get_users_of_blog() ), because that function creates an
> error
> > due to the fact that there isn't a database table during step 2 of the
> > install process.
>
> If this is during the installation process, and the table doesn't even
> exist yet, isn't it a fair bet that there are no users?
>
> Failing that (perhaps installing against an existing table for a
> shared install of some sort?) Maybe you need to do a direct, manual
> check first to confirm that the table exists (SHOW TABLES LIKE
> '{$prefix}users'), and then use get_users_of_blog() if it does, or
> assume no users if the table doesn't exist.


More information about the wp-hackers mailing list