承接 glavweb/silex-static-page-generator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

glavweb/silex-static-page-generator

Composer 安装命令:

composer require glavweb/silex-static-page-generator

包简介

The Silex Static Page Generator package

README 文档

README

Get the package using composer

Add the SilexStaticPageGenerator by running this command from the terminal at the root of your Silex project:

php composer.phar require glavweb/silex-static-page-generator

Register the command in the console file:

#!/usr/bin/env php
<?php

set_time_limit(0);

require __DIR__ . '/../vendor/autoload.php';

use Symfony\Component\Console\Application as ConsoleApplication;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;
use Glavweb\SilexStaticPageGenerator\Command\GenerateStaticPagesCommand;

$input = new ArgvInput();
$env = $input->getParameterOption(['--env', '-e'], 'dev');
$debug = !$input->hasParameterOption(['--no-debug', '']) && $env !== 'prod';

if ($debug) {
    Debug::enable();
}

$app = new Application();
$app->prepare('prod');

$console = new ConsoleApplication();

// ... register commands

$baseUrl = ''; // define the project URL in your the config file
$webDir  = realpath(__DIR__ . '/../web');

$console->add(new GenerateStaticPagesCommand(
    $app['routes'],
    $app['controllers'],
    $app['url_generator'],
    $baseUrl,           // Base URL, as example: http://my_project.com
    $webDir . '/static' // The place where will generate static pages
));

$console->run($input);

Note: You need define "$baseUrl" and "$webDir".

Usage

Run command "generate:static-pages":

php bin/console generate:static-pages

will be generated pages in folder defined in the console file ($webDir . '/static').

统计信息

  • 总下载量: 69
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2017-02-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固