juzaweb/installer
Composer 安装命令:
composer require juzaweb/installer
包简介
Juzaweb CMS installer
关键字:
README 文档
README
A comprehensive installation package for Juzaweb CMS that provides a web-based installation wizard and command-line installation support.
Features
- Web-based Installation Wizard: User-friendly interface for installing Juzaweb CMS
- System Requirements Check: Validates PHP version and required extensions
- Permissions Verification: Ensures proper folder permissions
- Environment Configuration: Easy setup of database and application settings
- Database Installation: Automated database migration and seeding
- Admin Account Creation: Quick setup of the first administrator account
- Command-line Installation: Support for automated installation via Artisan command
Installation
This package is automatically included with Juzaweb CMS. No separate installation is required.
Requirements
PHP Version
- PHP >= 8.2
Required PHP Extensions
- OpenSSL
- PDO
- Mbstring
- Tokenizer
- JSON
- cURL
Apache Modules
- mod_rewrite
Folder Permissions
The following directories must be writable (775):
storage/bootstrap/cache/resources/public/
Usage
Web-based Installation
- Navigate to your application URL in a web browser
- The installer will automatically redirect you to the installation wizard
- Follow the step-by-step process:
- Welcome: Introduction to the installer
- Requirements: System requirements verification
- Permissions: Folder permissions check
- Environment: Database and application configuration
- Database: Database installation
- Admin: Create administrator account
- Final: Complete installation
Command-line Installation
Use the Artisan command for automated installation:
php artisan install
This command will guide you through the installation process via the command line.
Configuration
Publishing Configuration
To customize the installer configuration, publish the config file:
php artisan vendor:publish --tag=installer_config
This will create config/installer.php where you can customize:
- Minimum PHP version
- Required PHP extensions
- Required Apache modules
- Folder permissions
- Environment form validation rules
Publishing Assets
To publish the installer assets (CSS, JS, images):
php artisan vendor:publish --tag=installer-assets
Assets will be published to public/vendor/installer/.
Middleware
The package registers the following middleware:
Installed Middleware
- Automatically applied to
themeandadminmiddleware groups - Redirects to the installer if the application is not yet installed
- Prevents access to the application until installation is complete
CanInstall Middleware
- Registered as
installmiddleware alias - Protects the installer routes
- Prevents re-installation if the application is already installed
Routes
The installer provides the following routes under the /install prefix:
GET /install- Welcome pageGET /install/requirements- Requirements checkGET /install/permissions- Permissions checkGET /install/environment- Environment configuration formPOST /install/environment- Save environment configurationGET /install/database- Database installationGET /install/admin- Admin account creation formPOST /install/admin- Save admin accountGET /install/final- Installation completion
Helper Functions
isActive()
Set the active class to the current opened menu.
/** * @param array|string $route Route name(s) to check * @param string $className CSS class name (default: 'active') * @return string|false Returns the class name if active, empty string or false otherwise */ isActive($route, $className = 'active')
Examples:
// Single route <li class="{{ isActive('install.welcome') }}">Welcome</li> // Multiple routes <li class="{{ isActive(['install.requirements', 'install.permissions']) }}">System Check</li> // Custom class name <li class="{{ isActive('install.database', 'current') }}">Database</li>
Events
The package dispatches the following events:
Juzaweb\Installer\Events\EnvironmentSaved- Fired when environment configuration is savedJuzaweb\Installer\Events\LaravelInstallerFinished- Fired when installation is completed
Testing
The package includes a comprehensive test suite using PHPUnit and Orchestra Testbench.
Running Tests
# Run all tests composer test # Run tests with coverage composer test-coverage # Run specific test file vendor/bin/phpunit tests/Feature/InstallerRoutesTest.php # Run tests with verbose output vendor/bin/phpunit --testdox
Test Coverage
The test suite includes comprehensive coverage for both validation failures and success scenarios:
Feature Tests:
InstallerRoutesTest- Tests for all GET routes (welcome, requirements, permissions, environment)EnvironmentPostTest- Environment configuration POST endpoint- Validation Tests (6 tests): Required fields, data types, max lengths, input preservation
- Success Tests (4 tests): Valid credentials, database connection, redirect flow, environment file saving
AdminPostTest- Admin account creation POST endpoint- Validation Tests (11 tests): Required fields, email format, password rules, confirmation, max lengths
- Success Tests (6 tests): User creation, password hashing, various email formats, special characters, success messages
InstallerMiddlewareTest- Tests for middleware behavior and CSRF protection
Unit Tests:
HelperFunctionsTest- Tests for theisActive()helper function
Total Test Cases: 30+ tests covering:
- ✅ Route accessibility
- ✅ Form validation rules (required, format, length)
- ✅ Error handling and redirects
- ✅ Input preservation on validation failure
- ✅ Successful form submissions
- ✅ Database operations (mocked)
- ✅ Password hashing
- ✅ Middleware functionality
- ✅ CSRF protection
Code Formatting
The package uses Laravel Pint for code formatting:
# Format code composer format # Check code style without fixing vendor/bin/pint --test
Continuous Integration
The package uses GitHub Actions for automated testing. Tests run on:
- PHP 8.2 and 8.3
- Laravel 11.x
- Ubuntu latest
The CI workflow runs on every push and pull request to main, master, and develop branches.
Security
- The installer automatically disables itself after successful installation
- Environment files are protected and not accessible via web
- Database credentials are validated before saving
- Admin password is hashed using Laravel's secure hashing
Troubleshooting
Installation Page Not Loading
If the installation page doesn't load:
- Check that your web server is properly configured
- Ensure
.htaccess(Apache) or nginx configuration is correct - Verify that
mod_rewriteis enabled (Apache)
Permission Errors
If you encounter permission errors:
chmod -R 775 storage bootstrap/cache resources public chown -R www-data:www-data storage bootstrap/cache resources public
Database Connection Failed
If database connection fails:
- Verify database credentials
- Ensure the database exists
- Check that the database user has proper permissions
- Confirm the database server is running
License
This package is open-sourced software licensed under the MIT license.
Support
For support and documentation, visit:
- Homepage: https://cms.juzaweb.com
juzaweb/installer 适用场景与选型建议
juzaweb/installer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.14k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2021 年 08 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「installer」 「juzaweb cms」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 juzaweb/installer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 juzaweb/installer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 juzaweb/installer 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Juzaweb CMS is a Content Management System (CMS) developed based on Laravel Framework and web platform whose sole purpose is to make your development workflow simple again. Project develop by Juzaweb
Subscription payment support
GraphQL authentication for your headless Craft CMS applications.
Set Links with a specific language parameter
Installs Aura packages to the Aura system "package" directory.
Supercharged text field validation.
统计信息
- 总下载量: 2.14k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 3
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2021-08-11