You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by "Brent Theisen (JIRA)" <ji...@apache.org> on 2009/02/18 19:34:02 UTC

[jira] Created: (SHINDIG-927) Check for existence of config/local.php in include path

Check for existence of config/local.php in include path
-------------------------------------------------------

                 Key: SHINDIG-927
                 URL: https://issues.apache.org/jira/browse/SHINDIG-927
             Project: Shindig
          Issue Type: Improvement
          Components: PHP
    Affects Versions: trunk
         Environment: CentOS
            Reporter: Brent Theisen
            Priority: Trivial
             Fix For: trunk


I'm using an svn external to deploy shindig on production Linux servers as well as our development team's MacBooks.  So, I need a config/local.php for both production and our local development environment.  That way, I can have compress_javascript off and debug on when I'm developing locally but still have the correct setup in production.

The directory structure and config files are like so:
htdocs/shindig/   (svn:externals property set to shindig trunk)
htdocs/shindig_configs/local/config/local.php
htdocs/shindig_configs/prod/config/local.php

Then for the Apache httpd.conf for prod I set the include path to something like "htdocs/shindig_configs/prod:.:/htdocs/shindig".  For the local development httpd.conf I have the same include path directive except the first path is htdocs/shindig_configs/local.

But this doesn't work until changing the file_exists() call in Config.php to a fopen() that looks for the file in the include path.  I'm including the patch I'm using in the hopes you guys might commit it.  Thanks.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SHINDIG-927) Check for existence of config/local.php in include path

Posted by "Chris Chabot (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-927?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Chabot resolved SHINDIG-927.
----------------------------------

    Resolution: Fixed

Hey Brent,

While the patch would work, I think it would be easier (and without the risk of performance impact) to solve this differently:

The local.php is mean't to to live outside of svn, however if you do have it included in your own local svn repo, you could easily do something like:

<?php
$shindigConfig = array(
.. long list of shared settings..
);

if (strpos('CentOS', $_SERVER["SERVER_SOFTWARE"]) !== false) {
  // this is the production system running CentOS
  $shindigConfig['compress_javascript'] = true;
  $shindigConfig['debug'] = false;
} else {
  // this is a developer's macbook
  $shindigConfig['compress_javascript'] = false;
  $shindigConfig['debug'] = true;
}

That would do everything you want it to do, and avoid having to depend on include_path's (which aren't always modifiable, and slow to set) to get multiple configs.

Hope that helps!

> Check for existence of config/local.php in include path
> -------------------------------------------------------
>
>                 Key: SHINDIG-927
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-927
>             Project: Shindig
>          Issue Type: Improvement
>          Components: PHP
>    Affects Versions: trunk
>         Environment: CentOS
>            Reporter: Brent Theisen
>            Priority: Trivial
>             Fix For: trunk
>
>         Attachments: fix-927-bug.patch
>
>   Original Estimate: 0.02h
>  Remaining Estimate: 0.02h
>
> I'm using an svn external to deploy shindig on production Linux servers as well as our development team's MacBooks.  So, I need a config/local.php for both production and our local development environment.  That way, I can have compress_javascript off and debug on when I'm developing locally but still have the correct setup in production.
> The directory structure and config files are like so:
> htdocs/shindig/   (svn:externals property set to shindig trunk)
> htdocs/shindig_configs/local/config/local.php
> htdocs/shindig_configs/prod/config/local.php
> Then for the Apache httpd.conf for prod I set the include path to something like "htdocs/shindig_configs/prod:.:/htdocs/shindig".  For the local development httpd.conf I have the same include path directive except the first path is htdocs/shindig_configs/local.
> But this doesn't work until changing the file_exists() call in Config.php to a fopen() that looks for the file in the include path.  I'm including the patch I'm using in the hopes you guys might commit it.  Thanks.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SHINDIG-927) Check for existence of config/local.php in include path

Posted by "Brent Theisen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12680172#action_12680172 ] 

Brent Theisen commented on SHINDIG-927:
---------------------------------------

Thanks Chris but that doesn't really work for me.  I've got about ten people who need to run shindig locally, half of which are designers and strictly HTML types who would need me to tell them every time they need to copy a change to local.php in to the shindig external part of their working copy.

Guess I'll just commit the shindig codebase in to my own repo.

> Check for existence of config/local.php in include path
> -------------------------------------------------------
>
>                 Key: SHINDIG-927
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-927
>             Project: Shindig
>          Issue Type: Improvement
>          Components: PHP
>    Affects Versions: trunk
>         Environment: CentOS
>            Reporter: Brent Theisen
>            Priority: Trivial
>             Fix For: trunk
>
>         Attachments: fix-927-bug.patch
>
>   Original Estimate: 0.02h
>  Remaining Estimate: 0.02h
>
> I'm using an svn external to deploy shindig on production Linux servers as well as our development team's MacBooks.  So, I need a config/local.php for both production and our local development environment.  That way, I can have compress_javascript off and debug on when I'm developing locally but still have the correct setup in production.
> The directory structure and config files are like so:
> htdocs/shindig/   (svn:externals property set to shindig trunk)
> htdocs/shindig_configs/local/config/local.php
> htdocs/shindig_configs/prod/config/local.php
> Then for the Apache httpd.conf for prod I set the include path to something like "htdocs/shindig_configs/prod:.:/htdocs/shindig".  For the local development httpd.conf I have the same include path directive except the first path is htdocs/shindig_configs/local.
> But this doesn't work until changing the file_exists() call in Config.php to a fopen() that looks for the file in the include path.  I'm including the patch I'm using in the hopes you guys might commit it.  Thanks.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SHINDIG-927) Check for existence of config/local.php in include path

Posted by "Brent Theisen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-927?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brent Theisen updated SHINDIG-927:
----------------------------------

    Attachment: fix-927-bug.patch

Replace file_exist() call with fopen() call that looks for config/local.php in the include paths.

> Check for existence of config/local.php in include path
> -------------------------------------------------------
>
>                 Key: SHINDIG-927
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-927
>             Project: Shindig
>          Issue Type: Improvement
>          Components: PHP
>    Affects Versions: trunk
>         Environment: CentOS
>            Reporter: Brent Theisen
>            Priority: Trivial
>             Fix For: trunk
>
>         Attachments: fix-927-bug.patch
>
>   Original Estimate: 0.02h
>  Remaining Estimate: 0.02h
>
> I'm using an svn external to deploy shindig on production Linux servers as well as our development team's MacBooks.  So, I need a config/local.php for both production and our local development environment.  That way, I can have compress_javascript off and debug on when I'm developing locally but still have the correct setup in production.
> The directory structure and config files are like so:
> htdocs/shindig/   (svn:externals property set to shindig trunk)
> htdocs/shindig_configs/local/config/local.php
> htdocs/shindig_configs/prod/config/local.php
> Then for the Apache httpd.conf for prod I set the include path to something like "htdocs/shindig_configs/prod:.:/htdocs/shindig".  For the local development httpd.conf I have the same include path directive except the first path is htdocs/shindig_configs/local.
> But this doesn't work until changing the file_exists() call in Config.php to a fopen() that looks for the file in the include path.  I'm including the patch I'm using in the hopes you guys might commit it.  Thanks.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.