seedproject-web/api/cli/rebuild.php
Carlos Arias 1f33296e30 feat: user auth (email + Google OAuth), Mailer, and CLI bridges
Generic framework features, code-only — the tables come from the schema snapshot:

- controllers/account.php — email signup (verified) + Google OAuth (server-side auth-code
  flow, async-popup friendly); native password_hash sessions on sp_users; sp_oauth_accounts +
  sp_user_tokens; PublicController origin+throttle guards; {ok,data,error} envelope.
- Helpers/Mailer.php — transactional email: Brevo HTTP API (Guzzle) -> SMTP fallback
  (PHPMailer) -> logs; config in sp_settings (encrypted).
- cli/rebuild.php — queue a static rebuild (sp_settings rebuild_pending flag) after DB edits.
- cli/resources.php — read a curated source registry (mde_resources) per agent_type.
- db/seed_google_oauth.php, db/seed_email.php — env-seeded encrypted secrets into sp_settings.
- templates/emails/verify.html — verification email template.
- composer.json — declare guzzlehttp/guzzle ^7.10 (account.php + Mailer use GuzzleHttp\Client).

Depends on the schema-snapshot branch (sp_users / sp_oauth_accounts / sp_user_tokens /
sp_settings / mde_resources) plus `composer require guzzlehttp/guzzle`. No data.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FMQeUnUrAeexcZ7P2Hxa6G
2026-07-11 09:14:25 -05:00

20 lines
751 B
PHP

<?php
/**
* Queue a static-site rebuild.
*
* Sets the sp_settings 'rebuild_pending' flag that scripts/deploy-watch.sh polls (~every 3
* min) and clears after building. Run this after a MANUAL database edit — e.g. adding a
* directory listing or a link — so the change gets baked into the static pages.
*
* php api/cli/rebuild.php
*/
require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/../config.php';
\Db::execute("DELETE FROM sp_settings WHERE keyval = 'rebuild_pending'");
\Db::execute(
"INSERT INTO sp_settings (keyval, `group`, metval, status) VALUES ('rebuild_pending', 'deploy', ?, 1)",
[json_encode(['at' => date('c'), 'by' => 'cli'])]
);
echo "Rebuild queued — deploy-watch will build within ~3 min.\n";