def test_is_web_app(self):
     ctx = {}
     eq_(True, is_web_app(ctx))
     ctx['WEB_SERVER'] = 'nginx'
     eq_(True, is_web_app(ctx))
     ctx['WEB_SERVER'] = 'httpd'
     eq_(True, is_web_app(ctx))
     ctx['WEB_SERVER'] = 'none'
     eq_(False, is_web_app(ctx))
Example #2
0
 def test_is_web_app(self):
     ctx = {}
     eq_(True, is_web_app(ctx))
     ctx["WEB_SERVER"] = "nginx"
     eq_(True, is_web_app(ctx))
     ctx["WEB_SERVER"] = "httpd"
     eq_(True, is_web_app(ctx))
     ctx["WEB_SERVER"] = "none"
     eq_(False, is_web_app(ctx))
Example #3
0
 def test_is_web_app(self):
     ctx = {}
     eq_(True, is_web_app(ctx))
     ctx['WEB_SERVER'] = 'nginx'
     eq_(True, is_web_app(ctx))
     ctx['WEB_SERVER'] = 'httpd'
     eq_(True, is_web_app(ctx))
     ctx['WEB_SERVER'] = 'none'
     eq_(False, is_web_app(ctx))
def compile(install):
    print 'Installing PHP'
    ctx = install.builder._ctx
    validate_php_version(ctx)
    validate_php_extensions(ctx)
    convert_php_extensions(ctx)
    build_php_environment(ctx)
    (install
        .package('PHP')
        .config()
            .from_application('.bp-config/php')
            .or_from_build_pack('defaults/config/php/{PHP_VERSION}')
            .to('php/etc')
            .rewrite()
            .done()
        .modules('PHP')
            .find_modules_with_regex('^extension=(.*).so$')
            .from_application('php/etc/php.ini')
            .find_modules_with_regex('^zend_extension=(.*).so$')
            .from_application('php/etc/php.ini')
            .find_modules_with_regex('^zend_extension="(?:.*/)?(.*).so"$')
            .from_application('php/etc/php.ini')
            .include_modules_from('PHP_MODULES')
            .include_module(is_web_app(ctx) and 'fpm' or 'cli')
            .done())
    return 0
Example #5
0
def compile(install):
    print 'Installing PHP'
    ctx = install.builder._ctx
    validate_php_version(ctx)
    validate_php_extensions(ctx)
    convert_php_extensions(ctx)
    build_php_environment(ctx)
    (install
        .package('PHP')
        .config()
            .from_application('.bp-config/php')  # noqa
            .or_from_build_pack('defaults/config/php/{PHP_VERSION}')
            .to('php/etc')
            .rewrite()
            .done()
        .modules('PHP')
            .find_modules_with_regex('^extension=(.*).so$')
            .from_application('php/etc/php.ini')
            .find_modules_with_regex('^zend_extension=(.*).so$')
            .from_application('php/etc/php.ini')
            .find_modules_with_regex('^zend_extension="(?:.*/)?(.*).so"$')
            .from_application('php/etc/php.ini')
            .include_modules_from('PHP_MODULES')
            .include_module(is_web_app(ctx) and 'fpm' or 'cli')
            .done())
    return 0
Example #6
0
def compile(install):
    print "Installing PHP"
    ctx = install.builder._ctx
    convert_php_extensions(ctx)
    build_php_environment(ctx)
    (
        install.package("PHP")
        .config()
        .from_application(".bp-config/php")
        .or_from_build_pack("defaults/config/php/{PHP_VERSION}")
        .to("php/etc")
        .rewrite()
        .done()
        .modules("PHP")
        .find_modules_with_regex("^extension=(.*).so$")
        .from_application("php/etc/php.ini")
        .find_modules_with_regex("^zend_extension=(.*).so$")
        .from_application("php/etc/php.ini")
        .find_modules_with_regex('^zend_extension="(?:.*/)?(.*).so"$')
        .from_application("php/etc/php.ini")
        .include_modules_from("PHP_MODULES")
        .include_module(is_web_app(ctx) and "fpm" or "cli")
        .done()
    )
    return 0
Example #7
0
def service_commands(ctx):
    if is_web_app(ctx):
        return {
            'hhvm': ('$HOME/hhvm/hhvm', '--mode server',
                     '-c $HOME/hhvm/etc/config.hdf')
        }
    else:
        app = find_stand_alone_app_to_run(ctx)
        return {'hhvm-app': ('$HOME/hhvm/hhvm', app)}
Example #8
0
def service_commands(ctx):
    if is_web_app(ctx):
        return {
            'php-fpm': ('$HOME/php/sbin/php-fpm', '-p "$HOME/php/etc"',
                        '-y "$HOME/php/etc/php-fpm.conf"'),
            'php-fpm-logs': ('tail', '-F $HOME/../logs/php-fpm.log')
        }
    else:
        app = find_stand_alone_app_to_run(ctx)
        return {'php-app': ('$HOME/php/bin/php', '-c "$HOME/php/etc"', app)}
Example #9
0
 def _service_commands(self):
     if is_web_app(self._ctx):
         return {
             'php-fpm':
             ('$HOME/php/sbin/php-fpm', '-p "$HOME/php/etc"',
              '-y "$HOME/php/etc/php-fpm.conf"', '-c "$HOME/php/etc"')
         }
     else:
         app = find_stand_alone_app_to_run(self._ctx)
         return {
             'php-app': ('$HOME/php/bin/php', '-c "$HOME/php/etc"', app)
         }
Example #10
0
 def _service_commands(self):
     if is_web_app(self._ctx):
         return {
             'php-fpm':
             ('$HOME/php/sbin/php-fpm', '-p "$HOME/php/etc"',
              '-y "$HOME/php/etc/php-fpm.conf"', '-c "$HOME/php/etc"')
         }
     else:
         app = find_stand_alone_app_to_run(self._ctx)
         return {
             'php-app': ('$HOME/php/bin/php', '-c "$HOME/php/etc"', app)
         }
Example #11
0
def service_commands(ctx):
    if is_web_app(ctx):
        return {
            "php-fpm": (
                "$HOME/php/sbin/php-fpm",
                '-p "$HOME/php/etc"',
                '-y "$HOME/php/etc/php-fpm.conf"',
                '-c "$HOME/php/etc"',
            ),
            "php-fpm-logs": ("tail", "-F $HOME/../logs/php-fpm.log"),
        }
    else:
        app = find_stand_alone_app_to_run(ctx)
        return {"php-app": ("$HOME/php/bin/php", '-c "$HOME/php/etc"', app)}
Example #12
0
def service_commands(ctx):
    if is_web_app(ctx):
        return {
            'hhvm': (
                '$HOME/hhvm/hhvm',
                '--mode server',
                '-c $HOME/hhvm/etc/config.hdf')
        }
    else:
        app = find_stand_alone_app_to_run(ctx)
        return {
            'hhvm-app': (
                '$HOME/hhvm/hhvm',
                app)
        }
Example #13
0
 def _service_commands(self):
     if is_web_app(self._ctx):
         return {
             'hhvm': (
                 '$HOME/hhvm/usr/bin/hhvm',
                 '--mode server',
                 '-c $HOME/hhvm/etc/server.ini',
                 '-c $HOME/hhvm/etc/php.ini')
         }
     else:
         app = find_stand_alone_app_to_run(self._ctx)
         return {
             'hhvm-app': (
                 '$HOME/hhvm/usr/bin/hhvm',
                 '-c $HOME/hhvm/etc/php.ini',
                 app)
         }
Example #14
0
def service_commands(ctx):
    if is_web_app(ctx):
        return {
            'php-fpm': (
                '$HOME/php/sbin/php-fpm',
                '-p "$HOME/php/etc"',
                '-y "$HOME/php/etc/php-fpm.conf"'),
            'php-fpm-logs': (
                'tail',
                '-F $HOME/../logs/php-fpm.log')
        }
    else:
        app = find_stand_alone_app_to_run(ctx)
        return {
            'php-app': (
                '$HOME/php/bin/php',
                '-c "$HOME/php/etc"',
                app)
        }