问:
Turn off bundling/minification while debugging in WebForms
I want to be able to minify/bundle my javascript files in a production environment while having them unminified/unbundled when debugging locally; however, the default WebForms site in VS2012 does not appear to allow for it.

Steps to reproduce my issue:

Create a new "ASP.NET Web Forms Application" (c# in my case)

Start without debugging and view resources in browser

Notice unminified jquery/modernizr files but bundled/minified MsAjaxJS and WebFormsJs

web.config, by default has:

```<code><compilation debug="true" targetFramework="4.5">
</code>```

And I've even tried modifying the Global.asax by explicitly telling BundleTable not to optimize:

```<code>void Application_Start(object sender, EventArgs e)
{
    // Code that runs on application startup
    BundleTable.EnableOptimizations = false;
    BundleConfig.RegisterBundles(BundleTable.Bundles);
    AuthConfig.RegisterOpenAuth();
    RouteConfig.RegisterRoutes(RouteTable.Routes);
}
</code>```

Yet, I still get undebuggable javascript files:

This site (which I realize is for MVC) tells me that either debug="true" in the web.config or BundleTable.EnableOptimizations = false; in Global.asax should turn off the functionality. And this site, (which is for WebForms and is linked from the first), doesn't mention turning it off for debugging.

How might I (cleanly) tell my project to only minify/bundle when debug="false"?

(I'm using ASP.NET 4.5)

EDIT:

This question and this question are similar, but they both only offer a solution using Scripts.Render(). Is there a way to accomplish this with the templated method of using the ScriptManager?

答:
I had a similar issue before. I solved my problem by putting this code

```<code>BundleTable.EnableOptimizations = false;
</code>```

after

```<code>BundleConfig.RegisterBundles(BundleTable.Bundles);
</code>```

Body:
I want to be able to minify/bundle my javascript files in a production environment while having them unminified/unbundled when debugging locally; however, the default WebForms site in VS2012 does not appear to allow for it.

Steps to reproduce my issue:

Create a new "ASP.NET Web Forms Application" (c# in my case)

Start without debugging and view resources in browser

Notice unminified jquery/modernizr files but bundled/minified MsAjaxJS and WebFormsJs

web.config, by default has:

<compilation debug="true" targetFramework="4.5">

And I've even tried modifying the Global.asax by explicitly telling BundleTable not to optimize:

void Application_Start(object sender, EventArgs e)
{
    // Code that runs on application startup
    BundleTable.EnableOptimizations = false;
    BundleConfig.RegisterBundles(BundleTable.Bundles);
    AuthConfig.RegisterOpenAuth();
    RouteConfig.RegisterRoutes(RouteTable.Routes);
}

Yet, I still get undebuggable javascript files:

This site (which I realize is for MVC) tells me that either debug="true" in the web.config or BundleTable.EnableOptimizations = false; in Global.asax should turn off the functionality. And this site, (which is for WebForms and is linked from the first), doesn't mention turning it off for debugging.

How might I (cleanly) tell my project to only minify/bundle when debug="false"?

(I'm using ASP.NET 4.5)

EDIT:

This question and this question are similar, but they both only offer a solution using Scripts.Render(). Is there a way to accomplish this with the templated method of using the ScriptManager?

Body:
I had a similar issue before. I solved my problem by putting this code

BundleTable.EnableOptimizations = false;

after

BundleConfig.RegisterBundles(BundleTable.Bundles);


来源: stackexchange

问:
Laravel Validation Rules If Value Exists in Another Field Array
I am working in Laravel 5.4 and I have a slightly specific validation rules need but I think this should be easily doable without having to extend the class. Just not sure how to make this work..

What I would like to do is to make the 'music_instrument' form field mandatory if program array contains 'Music'.

I found this thread How to set require if value is chosen in another multiple choice field in validation of laravel? but it is not a solution (because it never got resolved in the first place) and the reason it doesn't work is because the submitted array indexes aren't constant (not selected check boxes aren't considered in indexing the submission result...)

My case looks like this:

```<code><form action="" method="post">
    <fieldset>

        <input name="program[]" value="Anthropology" type="checkbox">Anthropology
        <input name="program[]" value="Biology"      type="checkbox">Biology
        <input name="program[]" value="Chemistry"    type="checkbox">Chemistry
        <input name="program[]" value="Music"        type="checkbox">Music
        <input name="program[]" value="Philosophy"   type="checkbox">Philosophy
        <input name="program[]" value="Zombies"      type="checkbox">Zombies

        <input name="music_instrument" type="text" value"">

        <button type="submit">Submit</button>

    </fieldset>
</form>
</code>```

If I select some of the options from the list of check boxes I can potentially have this result in my $request values

```<code>[program] => Array
    (
        [0] => Anthropology
        [1] => Biology
        [2] => Music
        [3] => Philosophy
    )

[music_instrument] => 'Guitar'
</code>```

Looking at validation rules here: https://laravel.com/docs/5.4/validation#available-validation-rules I think something like his should work but i am literally getting nothing:

```<code>  $validator = Validator::make($request->all(),[
        'program'           => 'required',
        'music_instrument'  => 'required_if:program,in:Music'
  ]);
</code>```

I was hoping this would work too but no luck:

```<code>'music_instrument'  => 'required_if:program,in_array:Music',
</code>```

Thoughts? Suggestions?

Thank you!

答:
Haven't tried that, but in general array fields you usually write like this: program.*, so maybe something like this will work:

```<code>  $validator = Validator::make($request->all(),[
        'program'           => 'required',
        'music_instrument'  => 'required_if:program.*,in:Music'
  ]);
</code>```

If it won't work, obviously you can do it also in the other way for example like this:

```<code>$rules = ['program' => 'required'];

if (in_array('Music', $request->input('program', []))) {
    $rules['music_instrument'] = 'required';
}

$validator = Validator::make($request->all(), $rules);
</code>```

ContentLicense: CC BY-SA 3.0

Body:
I am working in Laravel 5.4 and I have a slightly specific validation rules need but I think this should be easily doable without having to extend the class. Just not sure how to make this work..

What I would like to do is to make the 'music_instrument' form field mandatory if program array contains 'Music'.

I found this thread How to set require if value is chosen in another multiple choice field in validation of laravel? but it is not a solution (because it never got resolved in the first place) and the reason it doesn't work is because the submitted array indexes aren't constant (not selected check boxes aren't considered in indexing the submission result...)

My case looks like this:

<form action="" method="post">
    <fieldset>

        <input name="program[]" value="Anthropology" type="checkbox">Anthropology
        <input name="program[]" value="Biology"      type="checkbox">Biology
        <input name="program[]" value="Chemistry"    type="checkbox">Chemistry
        <input name="program[]" value="Music"        type="checkbox">Music
        <input name="program[]" value="Philosophy"   type="checkbox">Philosophy
        <input name="program[]" value="Zombies"      type="checkbox">Zombies

        <input name="music_instrument" type="text" value"">

        <button type="submit">Submit</button>

    </fieldset>
</form>

If I select some of the options from the list of check boxes I can potentially have this result in my $request values

[program] => Array
    (
        [0] => Anthropology
        [1] => Biology
        [2] => Music
        [3] => Philosophy
    )

[music_instrument] => 'Guitar'

Looking at validation rules here: https://laravel.com/docs/5.4/validation#available-validation-rules I think something like his should work but i am literally getting nothing:

  $validator = Validator::make($request->all(),[
        'program'           => 'required',
        'music_instrument'  => 'required_if:program,in:Music'
  ]);

I was hoping this would work too but no luck:

'music_instrument'  => 'required_if:program,in_array:Music',

Thoughts? Suggestions?

Thank you!

Body:
Haven't tried that, but in general array fields you usually write like this: program.*, so maybe something like this will work:

  $validator = Validator::make($request->all(),[
        'program'           => 'required',
        'music_instrument'  => 'required_if:program.*,in:Music'
  ]);

If it won't work, obviously you can do it also in the other way for example like this:

$rules = ['program' => 'required'];

if (in_array('Music', $request->input('program', []))) {
    $rules['music_instrument'] = 'required';
}

$validator = Validator::make($request->all(), $rules);


问:
Error 500 - Get Download drive.files.export
I am running into an issue with google drive files that are larger than 5 MB (Maybe?) in size. I am trying to download them and export them as application/pdf but runs into error 500.

I am using the following code to retrieve and download the drive file (doc, ppt, or xls):

```<code>- (void)downloadFile:(NSString *)fileID
         completionBlock:(void (^)(NSString *))onCompletionBlock
               failBlock:(void (^)(NSError *))onDownloadFailBlock {

    GTLRQuery *query = [GTLRDriveQuery_FilesExport queryForMediaWithFileId:fileID mimeType:@"application/pdf"];
    GTLRDriveService *service = self.driveService;

    [service executeQuery:query
          completionHandler:^(GTLRServiceTicket *callbackTicket,
                            GTLRDataObject *dataObject,
                            NSError *callbackError) {
            if (callbackError == nil) {
                // The file downloaded successfully; its data is available as dataObject.data
                // File has been downloaded
            } else {
                if (onDownloadFailBlock) {
                    onDownloadFailBlock(callbackError);
                }
                return;
            }
    }];
}
</code>```

Below is an log that I get using GTMSessionFetcher:

```<code>Download drive.files.export

2017-03-30 22:37:50 +0000  elapsed: 29.406sec
Request: GET https://www.googleapis.com/drive/v3/files/[fileID]/export?alt=media&mimeType=application%2Fpdf
Request headers:
  Accept: application/json
  Authorization: Bearer _snip_
  Cache-Control: no-cache
  Content-Type: application/json; charset=utf-8
  User-Agent: org.cocoapods.GoogleAPIClientForREST/1.2.1 google-api-objc-client/3.0 iPhone/10.2 hw/sim (gzip)

Response: status 500
Response headers:
  Cache-Control: private, max-age=0
  Content-Encoding: gzip
  Content-Length: 123
  Content-Type: application/json; charset=UTF-8
  Date: Thu, 30 Mar 2017 22:37:50 GMT
  Expires: Thu, 30 Mar 2017 22:37:50 GMT
  Server: GSE
  Vary: Origin, X-Origin
  alt-svc: quic=":443"; ma=2592000; v="37,36,35"
  x-content-type-options: nosniff
  x-frame-options: SAMEORIGIN
  x-xss-protection: 1; mode=block

Response body: (180 bytes)
{
  "error" : {
    "message" : "Internal Error",
    "errors" : [
      {
        "reason" : "internalError",
        "message" : "Internal Error",
        "domain" : "global"
      }
    ],
    "code" : 500
  }
}
</code>```

For what's it worth, it seems to me there is a server limit of 30 seconds when it will throw back this error - 500. For files that are less than 5 MB in size, it is doing it correctly and I am able to get back the pdf file. This is usually done under 30 seconds and also, it means it is not an authentication issue.

I have also tried changing the mimeType to vnd.openxmlformats-officedocument.wordprocessingml.document and I would get a 403 error that says "message": "This file is too large to be exported.".

Any idea how to go around this problem?

Thank you.

答:
500 errors are very often the result of timeouts within the internal Drive infrastructure. That would be compatible with the symptoms you are seeing. So a large file is taking so long to render to .pdf that the infrastructure is timing out.

The standard advice is that 500 errors should be backed off and retried using an exponential backoff algorithm. In your case I suggest start the backoff at 5s and that once you've backed off and retried for a total of 30s, if it still fails you should give up.

Body:
I am running into an issue with google drive files that are larger than 5 MB (Maybe?) in size. I am trying to download them and export them as application/pdf but runs into error 500.

I am using the following code to retrieve and download the drive file (doc, ppt, or xls):

- (void)downloadFile:(NSString *)fileID
         completionBlock:(void (^)(NSString *))onCompletionBlock
               failBlock:(void (^)(NSError *))onDownloadFailBlock {

    GTLRQuery *query = [GTLRDriveQuery_FilesExport queryForMediaWithFileId:fileID mimeType:@"application/pdf"];
    GTLRDriveService *service = self.driveService;

    [service executeQuery:query
          completionHandler:^(GTLRServiceTicket *callbackTicket,
                            GTLRDataObject *dataObject,
                            NSError *callbackError) {
            if (callbackError == nil) {
                // The file downloaded successfully; its data is available as dataObject.data
                // File has been downloaded
            } else {
                if (onDownloadFailBlock) {
                    onDownloadFailBlock(callbackError);
                }
                return;
            }
    }];
}

Below is an log that I get using GTMSessionFetcher:

Download drive.files.export

2017-03-30 22:37:50 +0000  elapsed: 29.406sec
Request: GET https://www.googleapis.com/drive/v3/files/[fileID]/export?alt=media&mimeType=application%2Fpdf
Request headers:
  Accept: application/json
  Authorization: Bearer _snip_
  Cache-Control: no-cache
  Content-Type: application/json; charset=utf-8
  User-Agent: org.cocoapods.GoogleAPIClientForREST/1.2.1 google-api-objc-client/3.0 iPhone/10.2 hw/sim (gzip)

Response: status 500
Response headers:
  Cache-Control: private, max-age=0
  Content-Encoding: gzip
  Content-Length: 123
  Content-Type: application/json; charset=UTF-8
  Date: Thu, 30 Mar 2017 22:37:50 GMT
  Expires: Thu, 30 Mar 2017 22:37:50 GMT
  Server: GSE
  Vary: Origin, X-Origin
  alt-svc: quic=":443"; ma=2592000; v="37,36,35"
  x-content-type-options: nosniff
  x-frame-options: SAMEORIGIN
  x-xss-protection: 1; mode=block

Response body: (180 bytes)
{
  "error" : {
    "message" : "Internal Error",
    "errors" : [
      {
        "reason" : "internalError",
        "message" : "Internal Error",
        "domain" : "global"
      }
    ],
    "code" : 500
  }
}

For what's it worth, it seems to me there is a server limit of 30 seconds when it will throw back this error - 500. For files that are less than 5 MB in size, it is doing it correctly and I am able to get back the pdf file. This is usually done under 30 seconds and also, it means it is not an authentication issue.

I have also tried changing the mimeType to vnd.openxmlformats-officedocument.wordprocessingml.document and I would get a 403 error that says "message": "This file is too large to be exported.".

Any idea how to go around this problem?

Thank you.


问:
Apply function in summarise using ddply to find percentage of frequencies
I have a table similar to this one:

```<code>id   name    gender     age      count
1    apple    Male      13-20      25
1    apple    Male      21-40      30
1    apple    Female    13-20      60
1    apple    Female    21-40      42
2    banana   Male      13-20      45
2    banana   Male      21-40      12
2    banana   Female    13-20      22
2    banana   Female    21-40      74
3    orange   Male      13-20      52
3    orange   Male      21-40      25
3    orange   Female    13-20      30
3    orange   Female    21-40      48
</code>```

I want a resulting table with frequency with respect to apple(reference group) like this:

```<code>id   gender     banana_wrt_apple   orange_wrt_apple
1    Male        57/55               77/55
2    Female      96/102              78/102
</code>```

How can I do this using ddply and summarise?

答:
Move to dplyr. It is the "replacement" for plyr.

You can use summarise two times, but that will take a lot of hacking. This is a terrible data format to be honest.

```<code>df %>%
  group_by(gender, name) %>%
  summarise(tot_count = sum(count)) %>%
  group_by(gender) %>%
  do(data.frame(banana_wrt_apple = paste0(.$tot_count[2], "/", .$tot_count[1]),
                orange_wrt_apple = paste0(.$tot_count[3], "/", .$tot_count[1])))

  gender banana_wrt_apple orange_wrt_apple
  <fctr>            <chr>            <chr>
1 Female           96/102           78/102
2   Male            57/55            77/55
</code>```

Data

```<code>df = structure(list(id = c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 3L, 3L,
3L, 3L), name = structure(c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 3L,
3L, 3L, 3L), .Label = c("apple", "banana", "orange"), class = "factor"),
    gender = structure(c(2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L,
    2L, 1L, 1L), .Label = c("Female", "Male"), class = "factor"),
    age = structure(c(1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L,
    1L, 2L), .Label = c("13-20", "21-40"), class = "factor"),
    count = c(25L, 30L, 60L, 42L, 45L, 12L, 22L, 74L, 52L, 25L,
    30L, 48L)), .Names = c("id", "name", "gender", "age", "count"
), class = "data.frame", row.names = c(NA, -12L))
</code>```

Body:
I have a table similar to this one:

id   name    gender     age      count
1    apple    Male      13-20      25
1    apple    Male      21-40      30
1    apple    Female    13-20      60
1    apple    Female    21-40      42
2    banana   Male      13-20      45
2    banana   Male      21-40      12
2    banana   Female    13-20      22
2    banana   Female    21-40      74
3    orange   Male      13-20      52
3    orange   Male      21-40      25
3    orange   Female    13-20      30
3    orange   Female    21-40      48

I want a resulting table with frequency with respect to apple(reference group) like this:

id   gender     banana_wrt_apple   orange_wrt_apple
1    Male        57/55               77/55
2    Female      96/102              78/102

How can I do this using ddply and summarise?

Body:
Move to dplyr. It is the "replacement" for plyr.

You can use summarise two times, but that will take a lot of hacking. This is a terrible data format to be honest.

df %>%
  group_by(gender, name) %>%
  summarise(tot_count = sum(count)) %>%
  group_by(gender) %>%
  do(data.frame(banana_wrt_apple = paste0(.$tot_count[2], "/", .$tot_count[1]),
                orange_wrt_apple = paste0(.$tot_count[3], "/", .$tot_count[1])))

  gender banana_wrt_apple orange_wrt_apple
  <fctr>            <chr>            <chr>
1 Female           96/102           78/102
2   Male            57/55            77/55

Data

df = structure(list(id = c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 3L, 3L,
3L, 3L), name = structure(c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 3L,
3L, 3L, 3L), .Label = c("apple", "banana", "orange"), class = "factor"),
    gender = structure(c(2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L,
    2L, 1L, 1L), .Label = c("Female", "Male"), class = "factor"),
    age = structure(c(1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L,
    1L, 2L), .Label = c("13-20", "21-40"), class = "factor"),
    count = c(25L, 30L, 60L, 42L, 45L, 12L, 22L, 74L, 52L, 25L,
    30L, 48L)), .Names = c("id", "name", "gender", "age", "count"
), class = "data.frame", row.names = c(NA, -12L))


问:
Eclipse type hierarchy stack overflow
I am repeatedly getting stack overflow errors on eclipse. It corresponds to adding Apache's PDFBox 2.0 to my build path and incorporating and modifying some code I found on SO. This eclipse bug report seems pertinent.
   I have tried refreshing, closing and reopening the project, deleting the .index files etc.
Here is the eclipse log:

```<code>!STACK 0
org.eclipse.recommenders.utils.Logs$LogTraceException
    at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:381)
    at org.eclipse.recommenders.utils.Logs.log(Logs.java:134)
    at org.eclipse.recommenders.internal.types.rcp.ProjectTypesIndex.needsRebuild(ProjectTypesIndex.java:169)
    at org.eclipse.recommenders.internal.types.rcp.ProjectTypesIndex.startUp(ProjectTypesIndex.java:122)
    at com.google.common.util.concurrent.AbstractIdleService$2$1.run(AbstractIdleService.java:54)
    at com.google.common.util.concurrent.Callables$3.run(Callables.java:93)
    at java.lang.Thread.run(Thread.java:745)

!ENTRY org.eclipse.core.jobs 4 2 2017-03-31 14:07:44.593
!MESSAGE An internal error occurred during: "Indexing type hierarchy of project ‘penelope-vision’".
!STACK 0
java.lang.StackOverflowError
    at java.util.HashMap.hash(HashMap.java:338)
    at java.util.HashMap.get(HashMap.java:556)
    at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.getAllSupertypes0(TypeHierarchy.java:503)
    at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.getAllSupertypes0(TypeHierarchy.java:522)
    at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.getAllSupertypes0(TypeHierarchy.java:522)
    at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.getAllSupertypes0(TypeHierarchy.java:522)
    at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.getAllSupertypes0(TypeHierarchy.java:522)
    at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.getAllSupertypes0(TypeHierarchy.java:522)
</code>```

The last line is repeated many times.

答:
While it is an acknowledged bug by Eclipse community, you can take the following workarounds:

1) Try to use a newer version of Eclipse (Oxygen or Neon).

2) Backup your projects from the workspace. Delete your workspace. Start Eclipse and let it create a new one. Then copy over your projects from backup to the new workspace.

Title: Eclipse type hierarchy stack overflow

Body:
I am repeatedly getting stack overflow errors on eclipse. It corresponds to adding Apache's PDFBox 2.0 to my build path and incorporating and modifying some code I found on SO. This eclipse bug report seems pertinent.
   I have tried refreshing, closing and reopening the project, deleting the .index files etc.
Here is the eclipse log:

!STACK 0
org.eclipse.recommenders.utils.Logs$LogTraceException
    at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:381)
    at org.eclipse.recommenders.utils.Logs.log(Logs.java:134)
    at org.eclipse.recommenders.internal.types.rcp.ProjectTypesIndex.needsRebuild(ProjectTypesIndex.java:169)
    at org.eclipse.recommenders.internal.types.rcp.ProjectTypesIndex.startUp(ProjectTypesIndex.java:122)
    at com.google.common.util.concurrent.AbstractIdleService$2$1.run(AbstractIdleService.java:54)
    at com.google.common.util.concurrent.Callables$3.run(Callables.java:93)
    at java.lang.Thread.run(Thread.java:745)

!ENTRY org.eclipse.core.jobs 4 2 2017-03-31 14:07:44.593
!MESSAGE An internal error occurred during: "Indexing type hierarchy of project ‘penelope-vision’".
!STACK 0
java.lang.StackOverflowError
    at java.util.HashMap.hash(HashMap.java:338)
    at java.util.HashMap.get(HashMap.java:556)
    at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.getAllSupertypes0(TypeHierarchy.java:503)
    at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.getAllSupertypes0(TypeHierarchy.java:522)
    at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.getAllSupertypes0(TypeHierarchy.java:522)
    at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.getAllSupertypes0(TypeHierarchy.java:522)
    at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.getAllSupertypes0(TypeHierarchy.java:522)
    at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.getAllSupertypes0(TypeHierarchy.java:522)

The last line is repeated many times.


问:
PHPUNIT xdebug codecoverage not working in console (mac) MAMP 1.9 PRO
Hi i have issues with my xdebug connection to PHPUnit.

when running:

```<code>phpunit --coverage-html ./report unit
</code>```

i get:

```<code>PHPUnit 3.4.15 by Sebastian Bergmann.

The Xdebug extension is not loaded.
</code>```

when i run php -v

```<code>PHP 5.2.13 (cli) (built: Mar  5 2010 16:23:44)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
    with eAccelerator v0.9.6, Copyright (c) 2004-2010 eAccelerator, by eAccelerator
    with Xdebug v2.0.5, Copyright (c) 2002-2008, by Derick Rethans
</code>```

when i run php -m

```<code>[PHP Modules]
bcmath
bz2
calendar
ctype
curl
date
dbase
dom
eAccelerator
exif
filter
ftp
gd
gettext
hash
iconv
imap
json
ldap
libxml
mbstring
mcrypt
mysql
mysqli
openssl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pgsql
posix
Reflection
session
SimpleXML
soap
sockets
SPL
SQLite
standard
tokenizer
xdebug
xml
xmlreader
xmlwriter
xsl
yaz
zlib

[Zend Modules]
Xdebug
eAccelerator
</code>```

this is my php_info()

```PHP Version 5.2.13

System  Darwin Mikael-B-Ortenheims-MacBook-Pro.local 10.5.0 Darwin Kernel Version 10.5.0: Fri Nov 5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/RELEASE_I386 i386
Build Date  Mar 5 2010 16:19:29
Configure Command    './configure' '--with-mysql=/Applications/MAMP/Library' '--with-apxs2=/Applications/MAMP/Library/bin/apxs' '--with-gd' '--with-jpeg-dir=/Applications/MAMP/Library' '--with-png-dir=/Applications/MAMP/Library' '--with-zlib' '--with-freetype-dir=/Applications/MAMP/Library' '--prefix=/Applications/MAMP/bin/php5.2' '--exec-prefix=/Applications/MAMP/bin/php5.2' '--sysconfdir=/Applications/MAMP/conf/php5.2' '--with-soap' '--with-config-file-path=/Applications/MAMP/conf/php5.2' '--enable-track-vars' '--enable-bcmath' '--enable-ftp' '--enable-gd-native-ttf' '--with-bz2=/usr' '--with-ldap' '--with-mysqli=/Applications/MAMP/Library/bin/mysql_config' '--with-sqlite' '--with-ttf' '--with-t1lib=/Applications/MAMP/Library' '--enable-mbstring=all' '--with-curl=/Applications/MAMP/Library' '--enable-dbx' '--enable-sockets' '--enable-bcmath' '--with-imap=shared,/Applications/MAMP/Library/lib/imap-2007e' '--enable-soap' '--with-kerberos' '--enable-calendar' '--with-pgsql=shared,/Applications/MAMP/Library/pg' '--enable-dbase' '--enable-exif' '--with-libxml-dir=/Applications/MAMP/Library' '--with-gettext=shared,/Applications/MAMP/Library' '--with-xsl=/Applications/MAMP/Library' '--with-pdo-mysql=shared,/Applications/MAMP/Library' '--with-pdo-pgsql=shared,/Applications/MAMP/Library/pg' '--with-mcrypt=shared,/Applications/MAMP/Library' '--with-openssl'
Server API  Apache 2.0 Handler
Virtual Directory Support   disabled
Configuration File (php.ini) Path   /Applications/MAMP/conf/php5.2
Loaded Configuration File   /Library/Application Support/appsolute/MAMP PRO/conf/php.ini
Scan this dir for additional .ini files (none)
additional .ini files parsed    (none)
PHP API 20041225
PHP Extension   20060613
Zend Extension  220060519
Debug Build no
Thread Safety   disabled
Zend Memory Manager enabled
IPv6 Support    enabled
Registered PHP Streams  https, ftps, compress.zlib, compress.bzip2, php, file, data, http, ftp
Registered Stream Socket Transports tcp, udp, unix, udg, ssl, sslv3, sslv2, tls
Registered Stream Filters   zlib.*, bzip2.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
    with Xdebug v2.0.5, Copyright (c) 2002-2008, by Derick Rethans

PHP Credits

Configuration

PHP Core

Directive   Local Value Master Value
allow_call_time_pass_reference  On  On
allow_url_fopen On  On
allow_url_include   Off Off
always_populate_raw_post_data   Off Off
arg_separator.input &   &
arg_separator.output    &   &
asp_tags    Off Off
auto_append_file    no value    no value
auto_globals_jit    On  On
auto_prepend_file   no value    no value
browscap    no value    no value
default_charset no value    no value
default_mimetype    text/html   text/html
define_syslog_variables Off Off
disable_classes no value    no value
disable_functions   no value    no value
display_errors  On  On
display_startup_errors  On  On
doc_root    no value    no value
docref_ext  no value    no value
docref_root no value    no value
enable_dl   On  On
error_append_string no value    no value
error_log   /Applications/MAMP/logs/php_error.log   /Applications/MAMP/logs/php_error.log
error_prepend_string    no value    no value
error_reporting 6143    6143
expose_php  On  On
extension_dir   /Applications/MAMP/bin/php5.2/lib/php/extensions/no-debug-non-zts-20060613/ /Applications/MAMP/bin/php5.2/lib/php/extensions/no-debug-non-zts-20060613/
file_uploads    On  On
highlight.bg    #FFFFFF #FFFFFF
highlight.comment   #FF8000 #FF8000
highlight.default   #0000BB #0000BB
highlight.html  #000000 #000000
highlight.keyword   #007700 #007700
highlight.string    #DD0000 #DD0000
html_errors On  On
ignore_repeated_errors  Off Off
ignore_repeated_source  Off Off
ignore_user_abort   Off Off
implicit_flush  Off Off
include_path    .:/Applications/MAMP/bin/php5.2/lib/php .:/Applications/MAMP/bin/php5.2/lib/php
log_errors  On  On
log_errors_max_len  1024    1024
magic_quotes_gpc    On  On
magic_quotes_runtime    Off Off
magic_quotes_sybase Off Off
mail.force_extra_parameters no value    no value
max_execution_time  30  30
max_file_uploads    20  20
max_input_nesting_level 64  64
max_input_time  60  60
memory_limit    32M 32M
open_basedir    no value    no value
output_buffering    no value    no value
output_handler  no value    no value
post_max_size   32M 32M
precision   12  12
realpath_cache_size 16K 16K
realpath_cache_ttl  120 120
register_argc_argv  On  On
register_globals    Off Off
register_long_arrays    On  On
report_memleaks On  On
report_zend_debug   On  On
safe_mode   Off Off
safe_mode_exec_dir  no value    no value
safe_mode_gid   Off Off
safe_mode_include_dir   no value    no value
sendmail_from   no value    no value
sendmail_path   /usr/sbin/sendmail -t -i    /usr/sbin/sendmail -t -i
serialize_precision 100 100
short_open_tag  On  On
SMTP    localhost   localhost
smtp_port   25  25
sql.safe_mode   Off Off
track_errors    Off Off
unserialize_callback_func   no value    no value
upload_max_filesize 32M 32M
upload_tmp_dir  /Applications/MAMP/tmp/php  /Applications/MAMP/tmp/php
user_dir    no value    no value
variables_order EGPCS   EGPCS
xmlrpc_error_number 0   0
xmlrpc_errors   Off Off
y2k_compliance  On  On
zend.ze1_compatibility_mode Off Off

apache2handler

Apache Version  Apache
Apache API Version  20020903
Server Administrator    you@example.com
Hostname:Port   localhost:8888
User/Group  mikaelbortenheim(501)/-1
Max Requests    Per Child: 0 - Keep Alive: on - Max Per Connection: 100
Timeouts    Connection: 300 - Keep-Alive: 15
Virtual Server  Yes
Server Root /Applications/MAMP/Library
Loaded Modules  core prefork http_core mod_so mod_access mod_auth mod_auth_anon mod_auth_dbm mod_auth_digest mod_file_cache mod_echo mod_charset_lite mod_cache mod_disk_cache mod_mem_cache mod_example mod_case_filter mod_case_filter_in mod_ext_filter mod_include mod_deflate mod_log_config mod_env mod_mime_magic mod_cern_meta mod_expires mod_headers mod_usertrack mod_setenvif mod_proxy proxy_connect proxy_ftp proxy_http mod_bucketeer mod_mime mod_dav mod_status mod_autoindex mod_asis mod_info mod_cgi mod_cgid mod_dav_fs mod_vhost_alias mod_negotiation mod_dir mod_imap mod_actions mod_speling mod_userdir mod_alias mod_rewrite mod_php5

Directive   Local Value Master Value
engine  1   1
last_modified   0   0
xbithack    0   0

Apache Environment

Variable    Value
HTTP_HOST   localhost:8888
HTTP_USER_AGENT Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_5; en-us) AppleWebKit/533.18.1 (KHTML, like Gecko) Version/5.0.2 Safari/533.18.5
HTTP_ACCEPT application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
HTTP_REFERER    http://localhost:8888/MAMP/English/index.php?language=English
HTTP_ACCEPT_LANGUAGE    en-us
HTTP_ACCEPT_ENCODING    gzip, deflate
HTTP_COOKIE SQLiteManager_currentLangue=2
HTTP_CONNECTION keep-alive
PATH    /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin
SERVER_SIGNATURE    no value
SERVER_SOFTWARE Apache
SERVER_NAME localhost
SERVER_ADDR ::1
SERVER_PORT 8888
REMOTE_HOST localhost
REMOTE_ADDR ::1
DOCUMENT_ROOT   /Users/mikaelbortenheim/Sites/PHP
SERVER_ADMIN    you@example.com
SCRIPT_FILENAME /Library/Application Support/appsolute/MAMP PRO/mamp/phpinfo.php
REMOTE_PORT 65402
GATEWAY_INTERFACE   CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD  GET
QUERY_STRING    no value
REQUEST_URI /MAMP/phpinfo.php
SCRIPT_NAME /MAMP/phpinfo.php

HTTP Headers Information

HTTP Request Headers
HTTP Request    GET /MAMP/phpinfo.php HTTP/1.1
Host    localhost:8888
User-Agent  Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_5; en-us) AppleWebKit/533.18.1 (KHTML, like Gecko) Version/5.0.2 Safari/533.18.5
Accept  application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Referer http://localhost:8888/MAMP/English/index.php?language=English
Accept-Language en-us
Accept-Encoding gzip, deflate
Cookie  SQLiteManager_currentLangue=2
Connection  keep-alive
HTTP Response Headers
X-Powered-By    PHP/5.2.13
Keep-Alive  timeout=15, max=93
Connection  Keep-Alive
Transfer-Encoding   chunked
Content-Type    text/html

bcmath

BCMath support  enabled

bz2

BZip2 Support   Enabled
Stream Wrapper support  compress.bz2://
Stream Filter support   bzip2.decompress, bzip2.compress
BZip2 Version   1.0.5, 10-Dec-2007

calendar

Calendar support    enabled

ctype

ctype functions enabled

curl

cURL support    enabled
cURL Information    libcurl/7.20.0 OpenSSL/0.9.7l zlib/1.2.3 libidn/1.15

date

date/time support   enabled
"Olson" Timezone Database Version   2010.2
Timezone Database   internal
Default timezone    Europe/Berlin

Directive   Local Value Master Value
date.default_latitude   31.7667 31.7667
date.default_longitude  35.2333 35.2333
date.sunrise_zenith 90.583333   90.583333
date.sunset_zenith  90.583333   90.583333
date.timezone   no value    no value

dom

DOM/XML enabled
DOM/XML API Version 20031129
libxml Version  2.7.6
HTML Support    enabled
XPath Support   enabled
XPointer Support    enabled
Schema Support  enabled
RelaxNG Support enabled

exif

EXIF Support    enabled
EXIF Version    1.4 $Id: exif.c 293036 2010-01-03 09:23:27Z sebastian $
Supported EXIF Version  0220
Supported filetypes JPEG,TIFF

filter

Input Validation and Filtering  enabled
Revision    $Revision: 293051 $

Directive   Local Value Master Value
filter.default  unsafe_raw  unsafe_raw
filter.default_flags    no value    no value

ftp

FTP support enabled

gd

GD Support  enabled
GD Version  bundled (2.0.34 compatible)
FreeType Support    enabled
FreeType Linkage    with freetype
FreeType Version    2.3.9
T1Lib Support   enabled
GIF Read Support    enabled
GIF Create Support  enabled
JPG Support enabled
PNG Support enabled
WBMP Support    enabled
XBM Support enabled

gettext

GetText Support enabled

hash

hash support    enabled
Hashing Engines md2 md4 md5 sha1 sha256 sha384 sha512 ripemd128 ripemd160 ripemd256 ripemd320 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru gost adler32 crc32 crc32b haval128,3 haval160,3 haval192,3 haval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 haval128,5 haval160,5 haval192,5 haval224,5 haval256,5

iconv

iconv support   enabled
iconv implementation    libiconv
iconv library version   1.13

Directive   Local Value Master Value
iconv.input_encoding    ISO-8859-1  ISO-8859-1
iconv.internal_encoding ISO-8859-1  ISO-8859-1
iconv.output_encoding   ISO-8859-1  ISO-8859-1

imap

IMAP c-Client Version   2007e
Kerberos Support    enabled

json

json support    enabled
json version    1.2.1

ldap

LDAP Support    enabled
RCS Version $Id: ldap.c 293036 2010-01-03 09:23:27Z sebastian $
Total Links 0/unlimited
API Version 3001
Vendor Name OpenLDAP
Vendor Version  20219

libxml

libXML support  active
libXML Version  2.7.6
libXML streams  enabled

mbstring

Multibyte Support   enabled
Multibyte string engine libmbfl
Multibyte (japanese) regex support  enabled
Multibyte regex (oniguruma) version 4.4.4
Multibyte regex (oniguruma) backtrack check On

mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1.

Directive   Local Value Master Value
mbstring.detect_order   no value    no value
mbstring.encoding_translation   Off Off
mbstring.func_overload  0   0
mbstring.http_input pass    pass
mbstring.http_output    pass    pass
mbstring.internal_encoding  no value    no value
mbstring.language   neutral neutral
mbstring.strict_detection   Off Off
mbstring.substitute_character   no value    no value

mcrypt

mcrypt support  enabled
Version 2.5.8
Api No  20021217
Supported ciphers   cast-128 gost rijndael-128 twofish arcfour cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes
Supported modes cbc cfb ctr ecb ncfb nofb ofb stream

Directive   Local Value Master Value
mcrypt.algorithms_dir   no value    no value
mcrypt.modes_dir    no value    no value

mysql

MySQL Support   enabled
Active Persistent Links 0
Active Links    0
Client API version  5.1.44
MYSQL_MODULE_TYPE   external
MYSQL_SOCKET    /Applications/MAMP/tmp/mysql/mysql.sock
MYSQL_INCLUDE   -I/Applications/MAMP/Library/include/mysql
MYSQL_LIBS  -L/Applications/MAMP/Library/lib/mysql -lmysqlclient

Directive   Local Value Master Value
mysql.allow_persistent  On  On
mysql.connect_timeout   60  60
mysql.default_host  no value    no value
mysql.default_password  no value    no value
mysql.default_port  no value    no value
mysql.default_socket    /Applications/MAMP/tmp/mysql/mysql.sock /Applications/MAMP/tmp/mysql/mysql.sock
mysql.default_user  no value    no value
mysql.max_links Unlimited   Unlimited
mysql.max_persistent    Unlimited   Unlimited
mysql.trace_mode    Off Off

mysqli

MysqlI Support  enabled
Client API library version  5.1.44
Client API header version   5.1.44
MYSQLI_SOCKET   /Applications/MAMP/tmp/mysql/mysql.sock

Directive   Local Value Master Value
mysqli.default_host no value    no value
mysqli.default_port 3306    3306
mysqli.default_pw   no value    no value
mysqli.default_socket   no value    no value
mysqli.default_user no value    no value
mysqli.max_links    Unlimited   Unlimited
mysqli.reconnect    Off Off

openssl

OpenSSL support enabled
OpenSSL Version OpenSSL 0.9.7i 14 Oct 2005

pcre

PCRE (Perl Compatible Regular Expressions) Support  enabled
PCRE Library Version    7.9 2009-04-11

Directive   Local Value Master Value
pcre.backtrack_limit    100000  100000
pcre.recursion_limit    100000  100000

PDO

PDO support enabled
PDO drivers sqlite, sqlite2, pgsql, mysql

pdo_mysql

PDO Driver for MySQL, client library version    5.1.44

pdo_pgsql

PDO Driver for PostgreSQL   enabled
PostgreSQL(libpq) Version   8.4.2
Module version  1.0.2
Revision     $Id: pdo_pgsql.c 293036 2010-01-03 09:23:27Z sebastian $

pdo_sqlite

PDO Driver for SQLite 3.x   enabled
PECL Module version (bundled) 1.0.1 $Id: pdo_sqlite.c 293036 2010-01-03 09:23:27Z sebastian $
SQLite Library  3.3.7

pgsql

PostgreSQL Support  enabled
PostgreSQL(libpq) Version   8.4.2
Multibyte character support enabled
SSL support enabled
Active Persistent Links 0
Active Links    0

Directive   Local Value Master Value
pgsql.allow_persistent  On  On
pgsql.auto_reset_persistent Off Off
pgsql.ignore_notice Off Off
pgsql.log_notice    Off Off
pgsql.max_links Unlimited   Unlimited
pgsql.max_persistent    Unlimited   Unlimited

posix

Revision    $Revision: 293036 $

Reflection

Reflection  enabled
Version $Id: php_reflection.c 293850 2010-01-22 14:21:17Z jani $

session

Session Support enabled
Registered save handlers    files user sqlite
Registered serializer handlers  php php_binary

Directive   Local Value Master Value
session.auto_start  Off Off
session.bug_compat_42   On  On
session.bug_compat_warn On  On
session.cache_expire    180 180
session.cache_limiter   nocache nocache
session.cookie_domain   no value    no value
session.cookie_httponly Off Off
session.cookie_lifetime 0   0
session.cookie_path /   /
session.cookie_secure   Off Off
session.entropy_file    no value    no value
session.entropy_length  0   0
session.gc_divisor  100 100
session.gc_maxlifetime  1440    1440
session.gc_probability  1   1
session.hash_bits_per_character 4   4
session.hash_function   0   0
session.name    PHPSESSID   PHPSESSID
session.referer_check   no value    no value
session.save_handler    files   files
session.save_path   /Applications/MAMP/tmp/php  /Applications/MAMP/tmp/php
session.serialize_handler   php php
session.use_cookies On  On
session.use_only_cookies    Off Off
session.use_trans_sid   0   0

SimpleXML

Simplexml support   enabled
Revision    $Revision: 293036 $
Schema support  enabled

soap

Soap Client enabled
Soap Server enabled

Directive   Local Value Master Value
soap.wsdl_cache 1   1
soap.wsdl_cache_dir /tmp    /tmp
soap.wsdl_cache_enabled 1   1
soap.wsdl_cache_limit   5   5
soap.wsdl_cache_ttl 86400   86400

sockets

Sockets Support enabled

SPL

SPL support enabled
Interfaces  Countable, OuterIterator, RecursiveIterator, SeekableIterator, SplObserver, SplSubject
Classes AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, DirectoryIterator, DomainException, EmptyIterator, FilterIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RegexIterator, RuntimeException, SimpleXMLIterator, SplFileInfo, SplFileObject, SplObjectStorage, SplTempFileObject, UnderflowException, UnexpectedValueException

SQLite

SQLite support  enabled
PECL Module version 2.0-dev $Id: sqlite.c 293036 2010-01-03 09:23:27Z sebastian $
SQLite Library  2.8.17
SQLite Encoding iso8859

Directive   Local Value Master Value
sqlite.assoc_case   0   0

standard

Regex Library   Bundled library enabled
Dynamic Library Support enabled
Path to sendmail    /usr/sbin/sendmail -t -i

Directive   Local Value Master Value
assert.active   1   1
assert.bail 0   0
assert.callback no value    no value
assert.quiet_eval   0   0
assert.warning  1   1
auto_detect_line_endings    0   0
default_socket_timeout  60  60
safe_mode_allowed_env_vars  PHP_    PHP_
safe_mode_protected_env_vars    LD_LIBRARY_PATH LD_LIBRARY_PATH
url_rewriter.tags   a=href,area=href,frame=src,input=src,form=,fieldset=    a=href,area=href,frame=src,input=src,form=,fieldset=
user_agent  no value    no value

tokenizer

Tokenizer Support   enabled

xdebug

xdebug support  enabled
Version 2.0.5

Supported protocols Revision
DBGp - Common DeBuGger Protocol $Revision: 1.125.2.6 $
GDB - GNU Debugger protocol $Revision: 1.87 $
PHP3 - PHP 3 Debugger protocol  $Revision: 1.22 $

Directive   Local Value Master Value
xdebug.auto_trace   Off Off
xdebug.collect_includes On  On
xdebug.collect_params   0   0
xdebug.collect_return   Off Off
xdebug.collect_vars Off Off
xdebug.default_enable   On  On
xdebug.dump.COOKIE  no value    no value
xdebug.dump.ENV no value    no value
xdebug.dump.FILES   no value    no value
xdebug.dump.GET no value    no value
xdebug.dump.POST    no value    no value
xdebug.dump.REQUEST no value    no value
xdebug.dump.SERVER  no value    no value
xdebug.dump.SESSION no value    no value
xdebug.dump_globals On  On
xdebug.dump_once    On  On
xdebug.dump_undefined   Off Off
xdebug.extended_info    On  On
xdebug.idekey   mikaelbortenheim    no value
xdebug.manual_url   http://www.php.net  http://www.php.net
xdebug.max_nesting_level    100 100
xdebug.profiler_aggregate   Off Off
xdebug.profiler_append  Off Off
xdebug.profiler_enable  Off Off
xdebug.profiler_enable_trigger  Off Off
xdebug.profiler_output_dir  /tmp    /tmp
xdebug.profiler_output_name cachegrind.out.%p   cachegrind.out.%p
xdebug.remote_autostart Off Off
xdebug.remote_enable    On  On
xdebug.remote_handler   dbgp    dbgp
xdebug.remote_host  localhost   localhost
xdebug.remote_log   no value    no value
xdebug.remote_mode  req req
xdebug.remote_port  9000    9000
xdebug.show_exception_trace Off Off
xdebug.show_local_vars  Off Off
xdebug.show_mem_delta   Off Off
xdebug.trace_format 0   0
xdebug.trace_options    0   0
xdebug.trace_output_dir /tmp    /tmp
xdebug.trace_output_name    trace.%c    trace.%c
xdebug.var_display_max_children 128 128
xdebug.var_display_max_data 512 512
xdebug.var_display_max_depth    3   3

xml

XML Support active
XML Namespace Support   active
libxml2 Version 2.7.6

xmlreader

XMLReader   enabled

xmlwriter

XMLWriter   enabled

xsl

XSL enabled
libxslt Version 1.1.26
libxslt compiled against libxml Version 2.7.6
EXSLT   enabled
libexslt Version    1.1.26

yaz

YAZ Support enabled
PHP/YAZ Version 1.0.14
YAZ Version 4.0.1
Compiled with YAZ version   4.0.1

zlib

ZLib Support    enabled
Stream Wrapper support  compress.zlib://
Stream Filter support   zlib.inflate, zlib.deflate
Compiled Version    1.2.3
Linked Version  1.2.3

Directive   Local Value Master Value
zlib.output_compression Off Off
zlib.output_compression_level   -1  -1
zlib.output_handler no value    no value

Additional Modules

Module Name
dbase

Environment

Variable    Value
SHELL   /bin/bash
TMPDIR  /var/folders/57/57ldIbUwEfapCAykVGuP-E+++TI/-Tmp-/
Apple_PubSub_Socket_Render  /tmp/launch-q1YyNj/Render
USER    mikaelbortenheim
COMMAND_MODE    legacy
SSH_AUTH_SOCK   /tmp/launch-h4iFnb/Listeners
__CF_USER_TEXT_ENCODING 0x1F5:0:0
PATH    /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin
PWD /
SHLVL   1
HOME    /Users/mikaelbortenheim
DYLD_LIBRARY_PATH   /Applications/MAMP/Library/lib:
PYTHONPATH  /Applications/Quick Search Box.app/Contents/Frameworks/Vermilion.framework/Resources
LOGNAME mikaelbortenheim
DISPLAY /tmp/launch-fxEJxI/org.x:0
SECURITYSESSIONID   308f98
_   /Applications/MAMP/Library/bin/httpd

PHP Variables

Variable    Value
_REQUEST["SQLiteManager_currentLangue"] 2
_COOKIE["SQLiteManager_currentLangue"]  2
_SERVER["HTTP_HOST"]    localhost:8888
_SERVER["HTTP_USER_AGENT"]  Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_5; en-us) AppleWebKit/533.18.1 (KHTML, like Gecko) Version/5.0.2 Safari/533.18.5
_SERVER["HTTP_ACCEPT"]  application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
_SERVER["HTTP_REFERER"] http://localhost:8888/MAMP/English/index.php?language=English
_SERVER["HTTP_ACCEPT_LANGUAGE"] en-us
_SERVER["HTTP_ACCEPT_ENCODING"] gzip, deflate
_SERVER["HTTP_COOKIE"]  SQLiteManager_currentLangue=2
_SERVER["HTTP_CONNECTION"]  keep-alive
_SERVER["PATH"] /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin
_SERVER["SERVER_SIGNATURE"] no value
_SERVER["SERVER_SOFTWARE"]  Apache
_SERVER["SERVER_NAME"]  localhost
_SERVER["SERVER_ADDR"]  ::1
_SERVER["SERVER_PORT"]  8888
_SERVER["REMOTE_HOST"]  localhost
_SERVER["REMOTE_ADDR"]  ::1
_SERVER["DOCUMENT_ROOT"]    /Users/mikaelbortenheim/Sites/PHP
_SERVER["SERVER_ADMIN"] you@example.com
_SERVER["SCRIPT_FILENAME"]  /Library/Application Support/appsolute/MAMP PRO/mamp/phpinfo.php
_SERVER["REMOTE_PORT"]  65402
_SERVER["GATEWAY_INTERFACE"]    CGI/1.1
_SERVER["SERVER_PROTOCOL"]  HTTP/1.1
_SERVER["REQUEST_METHOD"]   GET
_SERVER["QUERY_STRING"] no value
_SERVER["REQUEST_URI"]  /MAMP/phpinfo.php
_SERVER["SCRIPT_NAME"]  /MAMP/phpinfo.php
_SERVER["PHP_SELF"] /MAMP/phpinfo.php
_SERVER["REQUEST_TIME"] 1290244798
_SERVER["argv"]
Array
(
)
_SERVER["argc"] 0
_ENV["SHELL"]   /bin/bash
_ENV["TMPDIR"]  /var/folders/57/57ldIbUwEfapCAykVGuP-E+++TI/-Tmp-/
_ENV["Apple_PubSub_Socket_Render"]  /tmp/launch-q1YyNj/Render
_ENV["USER"]    mikaelbortenheim
_ENV["COMMAND_MODE"]    legacy
_ENV["SSH_AUTH_SOCK"]   /tmp/launch-h4iFnb/Listeners
_ENV["__CF_USER_TEXT_ENCODING"] 0x1F5:0:0
_ENV["PATH"]    /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin
_ENV["PWD"] /
_ENV["SHLVL"]   1
_ENV["HOME"]    /Users/mikaelbortenheim
_ENV["DYLD_LIBRARY_PATH"]   /Applications/MAMP/Library/lib:
_ENV["PYTHONPATH"]  /Applications/Quick Search Box.app/Contents/Frameworks/Vermilion.framework/Resources
_ENV["LOGNAME"] mikaelbortenheim
_ENV["DISPLAY"] /tmp/launch-fxEJxI/org.x:0
_ENV["SECURITYSESSIONID"]   308f98
_ENV["_"]   /Applications/MAMP/Library/bin/httpd

PHP License

This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net.
```

to help me with this do you need any more info?
code_coverage works in the browser.

thanks

答:
check if the referenced php in the phpunit script is the same as you use in console

which php (output could be: /usr/local/zend/bin/php)

vi /path/to/phpunit (first line could be. #!/usr/bin/php) (best: #!/usr/bin/env php)

if #!/usr/bin/env php isn't working try to set your MAMP php-bin by hand
#!/Applications/MAMP/bin/php5/bin/php (< i'm not using MAMP so you have to check this)

Edit
You could try this:
Remove the sym-link from /usr/bin

change the phpunit back to #!/usr/bin/env php (check if its still executable)

export your MAMP php-bin path to $PATH

export PATH=/Applications/MAMP/bin/php5/bin:$PATH (please verify the path first)

which php should now point to /Applications/MAMP/bin/php5/bin/php

try to run phpunit --coverage-html ./report unit

ContentLicense: CC BY-SA 2.5

Body:
Hi i have issues with my xdebug connection to PHPUnit.

when running:

phpunit --coverage-html ./report unit

i get:

PHPUnit 3.4.15 by Sebastian Bergmann.

The Xdebug extension is not loaded.

when i run php -v

PHP 5.2.13 (cli) (built: Mar  5 2010 16:23:44)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
    with eAccelerator v0.9.6, Copyright (c) 2004-2010 eAccelerator, by eAccelerator
    with Xdebug v2.0.5, Copyright (c) 2002-2008, by Derick Rethans

when i run php -m

[PHP Modules]
bcmath
bz2
calendar
ctype
curl
date
dbase
dom
eAccelerator
exif
filter
ftp
gd
gettext
hash
iconv
imap
json
ldap
libxml
mbstring
mcrypt
mysql
mysqli
openssl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pgsql
posix
Reflection
session
SimpleXML
soap
sockets
SPL
SQLite
standard
tokenizer
xdebug
xml
xmlreader
xmlwriter
xsl
yaz
zlib

[Zend Modules]
Xdebug
eAccelerator

this is my php_info()

PHP Version 5.2.13

System  Darwin Mikael-B-Ortenheims-MacBook-Pro.local 10.5.0 Darwin Kernel Version 10.5.0: Fri Nov 5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/RELEASE_I386 i386
Build Date  Mar 5 2010 16:19:29
Configure Command    './configure' '--with-mysql=/Applications/MAMP/Library' '--with-apxs2=/Applications/MAMP/Library/bin/apxs' '--with-gd' '--with-jpeg-dir=/Applications/MAMP/Library' '--with-png-dir=/Applications/MAMP/Library' '--with-zlib' '--with-freetype-dir=/Applications/MAMP/Library' '--prefix=/Applications/MAMP/bin/php5.2' '--exec-prefix=/Applications/MAMP/bin/php5.2' '--sysconfdir=/Applications/MAMP/conf/php5.2' '--with-soap' '--with-config-file-path=/Applications/MAMP/conf/php5.2' '--enable-track-vars' '--enable-bcmath' '--enable-ftp' '--enable-gd-native-ttf' '--with-bz2=/usr' '--with-ldap' '--with-mysqli=/Applications/MAMP/Library/bin/mysql_config' '--with-sqlite' '--with-ttf' '--with-t1lib=/Applications/MAMP/Library' '--enable-mbstring=all' '--with-curl=/Applications/MAMP/Library' '--enable-dbx' '--enable-sockets' '--enable-bcmath' '--with-imap=shared,/Applications/MAMP/Library/lib/imap-2007e' '--enable-soap' '--with-kerberos' '--enable-calendar' '--with-pgsql=shared,/Applications/MAMP/Library/pg' '--enable-dbase' '--enable-exif' '--with-libxml-dir=/Applications/MAMP/Library' '--with-gettext=shared,/Applications/MAMP/Library' '--with-xsl=/Applications/MAMP/Library' '--with-pdo-mysql=shared,/Applications/MAMP/Library' '--with-pdo-pgsql=shared,/Applications/MAMP/Library/pg' '--with-mcrypt=shared,/Applications/MAMP/Library' '--with-openssl'
Server API  Apache 2.0 Handler
Virtual Directory Support   disabled
Configuration File (php.ini) Path   /Applications/MAMP/conf/php5.2
Loaded Configuration File   /Library/Application Support/appsolute/MAMP PRO/conf/php.ini
Scan this dir for additional .ini files (none)
additional .ini files parsed    (none)
PHP API 20041225
PHP Extension   20060613
Zend Extension  220060519
Debug Build no
Thread Safety   disabled
Zend Memory Manager enabled
IPv6 Support    enabled
Registered PHP Streams  https, ftps, compress.zlib, compress.bzip2, php, file, data, http, ftp
Registered Stream Socket Transports tcp, udp, unix, udg, ssl, sslv3, sslv2, tls
Registered Stream Filters   zlib.*, bzip2.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
    with Xdebug v2.0.5, Copyright (c) 2002-2008, by Derick Rethans

PHP Credits

Configuration

PHP Core

Directive   Local Value Master Value
allow_call_time_pass_reference  On  On
allow_url_fopen On  On
allow_url_include   Off Off
always_populate_raw_post_data   Off Off
arg_separator.input &   &
arg_separator.output    &   &
asp_tags    Off Off
auto_append_file    no value    no value
auto_globals_jit    On  On
auto_prepend_file   no value    no value
browscap    no value    no value
default_charset no value    no value
default_mimetype    text/html   text/html
define_syslog_variables Off Off
disable_classes no value    no value
disable_functions   no value    no value
display_errors  On  On
display_startup_errors  On  On
doc_root    no value    no value
docref_ext  no value    no value
docref_root no value    no value
enable_dl   On  On
error_append_string no value    no value
error_log   /Applications/MAMP/logs/php_error.log   /Applications/MAMP/logs/php_error.log
error_prepend_string    no value    no value
error_reporting 6143    6143
expose_php  On  On
extension_dir   /Applications/MAMP/bin/php5.2/lib/php/extensions/no-debug-non-zts-20060613/ /Applications/MAMP/bin/php5.2/lib/php/extensions/no-debug-non-zts-20060613/
file_uploads    On  On
highlight.bg    #FFFFFF #FFFFFF
highlight.comment   #FF8000 #FF8000
highlight.default   #0000BB #0000BB
highlight.html  #000000 #000000
highlight.keyword   #007700 #007700
highlight.string    #DD0000 #DD0000
html_errors On  On
ignore_repeated_errors  Off Off
ignore_repeated_source  Off Off
ignore_user_abort   Off Off
implicit_flush  Off Off
include_path    .:/Applications/MAMP/bin/php5.2/lib/php .:/Applications/MAMP/bin/php5.2/lib/php
log_errors  On  On
log_errors_max_len  1024    1024
magic_quotes_gpc    On  On
magic_quotes_runtime    Off Off
magic_quotes_sybase Off Off
mail.force_extra_parameters no value    no value
max_execution_time  30  30
max_file_uploads    20  20
max_input_nesting_level 64  64
max_input_time  60  60
memory_limit    32M 32M
open_basedir    no value    no value
output_buffering    no value    no value
output_handler  no value    no value
post_max_size   32M 32M
precision   12  12
realpath_cache_size 16K 16K
realpath_cache_ttl  120 120
register_argc_argv  On  On
register_globals    Off Off
register_long_arrays    On  On
report_memleaks On  On
report_zend_debug   On  On
safe_mode   Off Off
safe_mode_exec_dir  no value    no value
safe_mode_gid   Off Off
safe_mode_include_dir   no value    no value
sendmail_from   no value    no value
sendmail_path   /usr/sbin/sendmail -t -i    /usr/sbin/sendmail -t -i
serialize_precision 100 100
short_open_tag  On  On
SMTP    localhost   localhost
smtp_port   25  25
sql.safe_mode   Off Off
track_errors    Off Off
unserialize_callback_func   no value    no value
upload_max_filesize 32M 32M
upload_tmp_dir  /Applications/MAMP/tmp/php  /Applications/MAMP/tmp/php
user_dir    no value    no value
variables_order EGPCS   EGPCS
xmlrpc_error_number 0   0
xmlrpc_errors   Off Off
y2k_compliance  On  On
zend.ze1_compatibility_mode Off Off

apache2handler

Apache Version  Apache
Apache API Version  20020903
Server Administrator    you@example.com
Hostname:Port   localhost:8888
User/Group  mikaelbortenheim(501)/-1
Max Requests    Per Child: 0 - Keep Alive: on - Max Per Connection: 100
Timeouts    Connection: 300 - Keep-Alive: 15
Virtual Server  Yes
Server Root /Applications/MAMP/Library
Loaded Modules  core prefork http_core mod_so mod_access mod_auth mod_auth_anon mod_auth_dbm mod_auth_digest mod_file_cache mod_echo mod_charset_lite mod_cache mod_disk_cache mod_mem_cache mod_example mod_case_filter mod_case_filter_in mod_ext_filter mod_include mod_deflate mod_log_config mod_env mod_mime_magic mod_cern_meta mod_expires mod_headers mod_usertrack mod_setenvif mod_proxy proxy_connect proxy_ftp proxy_http mod_bucketeer mod_mime mod_dav mod_status mod_autoindex mod_asis mod_info mod_cgi mod_cgid mod_dav_fs mod_vhost_alias mod_negotiation mod_dir mod_imap mod_actions mod_speling mod_userdir mod_alias mod_rewrite mod_php5

Directive   Local Value Master Value
engine  1   1
last_modified   0   0
xbithack    0   0

Apache Environment

Variable    Value
HTTP_HOST   localhost:8888
HTTP_USER_AGENT Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_5; en-us) AppleWebKit/533.18.1 (KHTML, like Gecko) Version/5.0.2 Safari/533.18.5
HTTP_ACCEPT application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
HTTP_REFERER    http://localhost:8888/MAMP/English/index.php?language=English
HTTP_ACCEPT_LANGUAGE    en-us
HTTP_ACCEPT_ENCODING    gzip, deflate
HTTP_COOKIE SQLiteManager_currentLangue=2
HTTP_CONNECTION keep-alive
PATH    /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin
SERVER_SIGNATURE    no value
SERVER_SOFTWARE Apache
SERVER_NAME localhost
SERVER_ADDR ::1
SERVER_PORT 8888
REMOTE_HOST localhost
REMOTE_ADDR ::1
DOCUMENT_ROOT   /Users/mikaelbortenheim/Sites/PHP
SERVER_ADMIN    you@example.com
SCRIPT_FILENAME /Library/Application Support/appsolute/MAMP PRO/mamp/phpinfo.php
REMOTE_PORT 65402
GATEWAY_INTERFACE   CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD  GET
QUERY_STRING    no value
REQUEST_URI /MAMP/phpinfo.php
SCRIPT_NAME /MAMP/phpinfo.php

HTTP Headers Information

HTTP Request Headers
HTTP Request    GET /MAMP/phpinfo.php HTTP/1.1
Host    localhost:8888
User-Agent  Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_5; en-us) AppleWebKit/533.18.1 (KHTML, like Gecko) Version/5.0.2 Safari/533.18.5
Accept  application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Referer http://localhost:8888/MAMP/English/index.php?language=English
Accept-Language en-us
Accept-Encoding gzip, deflate
Cookie  SQLiteManager_currentLangue=2
Connection  keep-alive
HTTP Response Headers
X-Powered-By    PHP/5.2.13
Keep-Alive  timeout=15, max=93
Connection  Keep-Alive
Transfer-Encoding   chunked
Content-Type    text/html

bcmath

BCMath support  enabled

bz2

BZip2 Support   Enabled
Stream Wrapper support  compress.bz2://
Stream Filter support   bzip2.decompress, bzip2.compress
BZip2 Version   1.0.5, 10-Dec-2007

calendar

Calendar support    enabled

ctype

ctype functions enabled

curl

cURL support    enabled
cURL Information    libcurl/7.20.0 OpenSSL/0.9.7l zlib/1.2.3 libidn/1.15

date

date/time support   enabled
"Olson" Timezone Database Version   2010.2
Timezone Database   internal
Default timezone    Europe/Berlin

Directive   Local Value Master Value
date.default_latitude   31.7667 31.7667
date.default_longitude  35.2333 35.2333
date.sunrise_zenith 90.583333   90.583333
date.sunset_zenith  90.583333   90.583333
date.timezone   no value    no value

dom

DOM/XML enabled
DOM/XML API Version 20031129
libxml Version  2.7.6
HTML Support    enabled
XPath Support   enabled
XPointer Support    enabled
Schema Support  enabled
RelaxNG Support enabled

exif

EXIF Support    enabled
EXIF Version    1.4 $Id: exif.c 293036 2010-01-03 09:23:27Z sebastian $
Supported EXIF Version  0220
Supported filetypes JPEG,TIFF

filter

Input Validation and Filtering  enabled
Revision    $Revision: 293051 $

Directive   Local Value Master Value
filter.default  unsafe_raw  unsafe_raw
filter.default_flags    no value    no value

ftp

FTP support enabled

gd

GD Support  enabled
GD Version  bundled (2.0.34 compatible)
FreeType Support    enabled
FreeType Linkage    with freetype
FreeType Version    2.3.9
T1Lib Support   enabled
GIF Read Support    enabled
GIF Create Support  enabled
JPG Support enabled
PNG Support enabled
WBMP Support    enabled
XBM Support enabled

gettext

GetText Support enabled

hash

hash support    enabled
Hashing Engines md2 md4 md5 sha1 sha256 sha384 sha512 ripemd128 ripemd160 ripemd256 ripemd320 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru gost adler32 crc32 crc32b haval128,3 haval160,3 haval192,3 haval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 haval128,5 haval160,5 haval192,5 haval224,5 haval256,5

iconv

iconv support   enabled
iconv implementation    libiconv
iconv library version   1.13

Directive   Local Value Master Value
iconv.input_encoding    ISO-8859-1  ISO-8859-1
iconv.internal_encoding ISO-8859-1  ISO-8859-1
iconv.output_encoding   ISO-8859-1  ISO-8859-1

imap

IMAP c-Client Version   2007e
Kerberos Support    enabled

json

json support    enabled
json version    1.2.1

ldap

LDAP Support    enabled
RCS Version $Id: ldap.c 293036 2010-01-03 09:23:27Z sebastian $
Total Links 0/unlimited
API Version 3001
Vendor Name OpenLDAP
Vendor Version  20219

libxml

libXML support  active
libXML Version  2.7.6
libXML streams  enabled

mbstring

Multibyte Support   enabled
Multibyte string engine libmbfl
Multibyte (japanese) regex support  enabled
Multibyte regex (oniguruma) version 4.4.4
Multibyte regex (oniguruma) backtrack check On

mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1.

Directive   Local Value Master Value
mbstring.detect_order   no value    no value
mbstring.encoding_translation   Off Off
mbstring.func_overload  0   0
mbstring.http_input pass    pass
mbstring.http_output    pass    pass
mbstring.internal_encoding  no value    no value
mbstring.language   neutral neutral
mbstring.strict_detection   Off Off
mbstring.substitute_character   no value    no value

mcrypt

mcrypt support  enabled
Version 2.5.8
Api No  20021217
Supported ciphers   cast-128 gost rijndael-128 twofish arcfour cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes
Supported modes cbc cfb ctr ecb ncfb nofb ofb stream

Directive   Local Value Master Value
mcrypt.algorithms_dir   no value    no value
mcrypt.modes_dir    no value    no value

mysql

MySQL Support   enabled
Active Persistent Links 0
Active Links    0
Client API version  5.1.44
MYSQL_MODULE_TYPE   external
MYSQL_SOCKET    /Applications/MAMP/tmp/mysql/mysql.sock
MYSQL_INCLUDE   -I/Applications/MAMP/Library/include/mysql
MYSQL_LIBS  -L/Applications/MAMP/Library/lib/mysql -lmysqlclient

Directive   Local Value Master Value
mysql.allow_persistent  On  On
mysql.connect_timeout   60  60
mysql.default_host  no value    no value
mysql.default_password  no value    no value
mysql.default_port  no value    no value
mysql.default_socket    /Applications/MAMP/tmp/mysql/mysql.sock /Applications/MAMP/tmp/mysql/mysql.sock
mysql.default_user  no value    no value
mysql.max_links Unlimited   Unlimited
mysql.max_persistent    Unlimited   Unlimited
mysql.trace_mode    Off Off

mysqli

MysqlI Support  enabled
Client API library version  5.1.44
Client API header version   5.1.44
MYSQLI_SOCKET   /Applications/MAMP/tmp/mysql/mysql.sock

Directive   Local Value Master Value
mysqli.default_host no value    no value
mysqli.default_port 3306    3306
mysqli.default_pw   no value    no value
mysqli.default_socket   no value    no value
mysqli.default_user no value    no value
mysqli.max_links    Unlimited   Unlimited
mysqli.reconnect    Off Off

openssl

OpenSSL support enabled
OpenSSL Version OpenSSL 0.9.7i 14 Oct 2005

pcre

PCRE (Perl Compatible Regular Expressions) Support  enabled
PCRE Library Version    7.9 2009-04-11

Directive   Local Value Master Value
pcre.backtrack_limit    100000  100000
pcre.recursion_limit    100000  100000

PDO

PDO support enabled
PDO drivers sqlite, sqlite2, pgsql, mysql

pdo_mysql

PDO Driver for MySQL, client library version    5.1.44

pdo_pgsql

PDO Driver for PostgreSQL   enabled
PostgreSQL(libpq) Version   8.4.2
Module version  1.0.2
Revision     $Id: pdo_pgsql.c 293036 2010-01-03 09:23:27Z sebastian $

pdo_sqlite

PDO Driver for SQLite 3.x   enabled
PECL Module version (bundled) 1.0.1 $Id: pdo_sqlite.c 293036 2010-01-03 09:23:27Z sebastian $
SQLite Library  3.3.7

pgsql

PostgreSQL Support  enabled
PostgreSQL(libpq) Version   8.4.2
Multibyte character support enabled
SSL support enabled
Active Persistent Links 0
Active Links    0

Directive   Local Value Master Value
pgsql.allow_persistent  On  On
pgsql.auto_reset_persistent Off Off
pgsql.ignore_notice Off Off
pgsql.log_notice    Off Off
pgsql.max_links Unlimited   Unlimited
pgsql.max_persistent    Unlimited   Unlimited

posix

Revision    $Revision: 293036 $

Reflection

Reflection  enabled
Version $Id: php_reflection.c 293850 2010-01-22 14:21:17Z jani $

session

Session Support enabled
Registered save handlers    files user sqlite
Registered serializer handlers  php php_binary

Directive   Local Value Master Value
session.auto_start  Off Off
session.bug_compat_42   On  On
session.bug_compat_warn On  On
session.cache_expire    180 180
session.cache_limiter   nocache nocache
session.cookie_domain   no value    no value
session.cookie_httponly Off Off
session.cookie_lifetime 0   0
session.cookie_path /   /
session.cookie_secure   Off Off
session.entropy_file    no value    no value
session.entropy_length  0   0
session.gc_divisor  100 100
session.gc_maxlifetime  1440    1440
session.gc_probability  1   1
session.hash_bits_per_character 4   4
session.hash_function   0   0
session.name    PHPSESSID   PHPSESSID
session.referer_check   no value    no value
session.save_handler    files   files
session.save_path   /Applications/MAMP/tmp/php  /Applications/MAMP/tmp/php
session.serialize_handler   php php
session.use_cookies On  On
session.use_only_cookies    Off Off
session.use_trans_sid   0   0

SimpleXML

Simplexml support   enabled
Revision    $Revision: 293036 $
Schema support  enabled

soap

Soap Client enabled
Soap Server enabled

Directive   Local Value Master Value
soap.wsdl_cache 1   1
soap.wsdl_cache_dir /tmp    /tmp
soap.wsdl_cache_enabled 1   1
soap.wsdl_cache_limit   5   5
soap.wsdl_cache_ttl 86400   86400

sockets

Sockets Support enabled

SPL

SPL support enabled
Interfaces  Countable, OuterIterator, RecursiveIterator, SeekableIterator, SplObserver, SplSubject
Classes AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, DirectoryIterator, DomainException, EmptyIterator, FilterIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RegexIterator, RuntimeException, SimpleXMLIterator, SplFileInfo, SplFileObject, SplObjectStorage, SplTempFileObject, UnderflowException, UnexpectedValueException

SQLite

SQLite support  enabled
PECL Module version 2.0-dev $Id: sqlite.c 293036 2010-01-03 09:23:27Z sebastian $
SQLite Library  2.8.17
SQLite Encoding iso8859

Directive   Local Value Master Value
sqlite.assoc_case   0   0

standard

Regex Library   Bundled library enabled
Dynamic Library Support enabled
Path to sendmail    /usr/sbin/sendmail -t -i

Directive   Local Value Master Value
assert.active   1   1
assert.bail 0   0
assert.callback no value    no value
assert.quiet_eval   0   0
assert.warning  1   1
auto_detect_line_endings    0   0
default_socket_timeout  60  60
safe_mode_allowed_env_vars  PHP_    PHP_
safe_mode_protected_env_vars    LD_LIBRARY_PATH LD_LIBRARY_PATH
url_rewriter.tags   a=href,area=href,frame=src,input=src,form=,fieldset=    a=href,area=href,frame=src,input=src,form=,fieldset=
user_agent  no value    no value

tokenizer

Tokenizer Support   enabled

xdebug

xdebug support  enabled
Version 2.0.5

Supported protocols Revision
DBGp - Common DeBuGger Protocol $Revision: 1.125.2.6 $
GDB - GNU Debugger protocol $Revision: 1.87 $
PHP3 - PHP 3 Debugger protocol  $Revision: 1.22 $

Directive   Local Value Master Value
xdebug.auto_trace   Off Off
xdebug.collect_includes On  On
xdebug.collect_params   0   0
xdebug.collect_return   Off Off
xdebug.collect_vars Off Off
xdebug.default_enable   On  On
xdebug.dump.COOKIE  no value    no value
xdebug.dump.ENV no value    no value
xdebug.dump.FILES   no value    no value
xdebug.dump.GET no value    no value
xdebug.dump.POST    no value    no value
xdebug.dump.REQUEST no value    no value
xdebug.dump.SERVER  no value    no value
xdebug.dump.SESSION no value    no value
xdebug.dump_globals On  On
xdebug.dump_once    On  On
xdebug.dump_undefined   Off Off
xdebug.extended_info    On  On
xdebug.idekey   mikaelbortenheim    no value
xdebug.manual_url   http://www.php.net  http://www.php.net
xdebug.max_nesting_level    100 100
xdebug.profiler_aggregate   Off Off
xdebug.profiler_append  Off Off
xdebug.profiler_enable  Off Off
xdebug.profiler_enable_trigger  Off Off
xdebug.profiler_output_dir  /tmp    /tmp
xdebug.profiler_output_name cachegrind.out.%p   cachegrind.out.%p
xdebug.remote_autostart Off Off
xdebug.remote_enable    On  On
xdebug.remote_handler   dbgp    dbgp
xdebug.remote_host  localhost   localhost
xdebug.remote_log   no value    no value
xdebug.remote_mode  req req
xdebug.remote_port  9000    9000
xdebug.show_exception_trace Off Off
xdebug.show_local_vars  Off Off
xdebug.show_mem_delta   Off Off
xdebug.trace_format 0   0
xdebug.trace_options    0   0
xdebug.trace_output_dir /tmp    /tmp
xdebug.trace_output_name    trace.%c    trace.%c
xdebug.var_display_max_children 128 128
xdebug.var_display_max_data 512 512
xdebug.var_display_max_depth    3   3

xml

XML Support active
XML Namespace Support   active
libxml2 Version 2.7.6

xmlreader

XMLReader   enabled

xmlwriter

XMLWriter   enabled

xsl

XSL enabled
libxslt Version 1.1.26
libxslt compiled against libxml Version 2.7.6
EXSLT   enabled
libexslt Version    1.1.26

yaz

YAZ Support enabled
PHP/YAZ Version 1.0.14
YAZ Version 4.0.1
Compiled with YAZ version   4.0.1

zlib

ZLib Support    enabled
Stream Wrapper support  compress.zlib://
Stream Filter support   zlib.inflate, zlib.deflate
Compiled Version    1.2.3
Linked Version  1.2.3

Directive   Local Value Master Value
zlib.output_compression Off Off
zlib.output_compression_level   -1  -1
zlib.output_handler no value    no value

Additional Modules

Module Name
dbase

Environment

Variable    Value
SHELL   /bin/bash
TMPDIR  /var/folders/57/57ldIbUwEfapCAykVGuP-E+++TI/-Tmp-/
Apple_PubSub_Socket_Render  /tmp/launch-q1YyNj/Render
USER    mikaelbortenheim
COMMAND_MODE    legacy
SSH_AUTH_SOCK   /tmp/launch-h4iFnb/Listeners
__CF_USER_TEXT_ENCODING 0x1F5:0:0
PATH    /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin
PWD /
SHLVL   1
HOME    /Users/mikaelbortenheim
DYLD_LIBRARY_PATH   /Applications/MAMP/Library/lib:
PYTHONPATH  /Applications/Quick Search Box.app/Contents/Frameworks/Vermilion.framework/Resources
LOGNAME mikaelbortenheim
DISPLAY /tmp/launch-fxEJxI/org.x:0
SECURITYSESSIONID   308f98
_   /Applications/MAMP/Library/bin/httpd

PHP Variables

Variable    Value
_REQUEST["SQLiteManager_currentLangue"] 2
_COOKIE["SQLiteManager_currentLangue"]  2
_SERVER["HTTP_HOST"]    localhost:8888
_SERVER["HTTP_USER_AGENT"]  Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_5; en-us) AppleWebKit/533.18.1 (KHTML, like Gecko) Version/5.0.2 Safari/533.18.5
_SERVER["HTTP_ACCEPT"]  application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
_SERVER["HTTP_REFERER"] http://localhost:8888/MAMP/English/index.php?language=English
_SERVER["HTTP_ACCEPT_LANGUAGE"] en-us
_SERVER["HTTP_ACCEPT_ENCODING"] gzip, deflate
_SERVER["HTTP_COOKIE"]  SQLiteManager_currentLangue=2
_SERVER["HTTP_CONNECTION"]  keep-alive
_SERVER["PATH"] /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin
_SERVER["SERVER_SIGNATURE"] no value
_SERVER["SERVER_SOFTWARE"]  Apache
_SERVER["SERVER_NAME"]  localhost
_SERVER["SERVER_ADDR"]  ::1
_SERVER["SERVER_PORT"]  8888
_SERVER["REMOTE_HOST"]  localhost
_SERVER["REMOTE_ADDR"]  ::1
_SERVER["DOCUMENT_ROOT"]    /Users/mikaelbortenheim/Sites/PHP
_SERVER["SERVER_ADMIN"] you@example.com
_SERVER["SCRIPT_FILENAME"]  /Library/Application Support/appsolute/MAMP PRO/mamp/phpinfo.php
_SERVER["REMOTE_PORT"]  65402
_SERVER["GATEWAY_INTERFACE"]    CGI/1.1
_SERVER["SERVER_PROTOCOL"]  HTTP/1.1
_SERVER["REQUEST_METHOD"]   GET
_SERVER["QUERY_STRING"] no value
_SERVER["REQUEST_URI"]  /MAMP/phpinfo.php
_SERVER["SCRIPT_NAME"]  /MAMP/phpinfo.php
_SERVER["PHP_SELF"] /MAMP/phpinfo.php
_SERVER["REQUEST_TIME"] 1290244798
_SERVER["argv"]
Array
(
)
_SERVER["argc"] 0
_ENV["SHELL"]   /bin/bash
_ENV["TMPDIR"]  /var/folders/57/57ldIbUwEfapCAykVGuP-E+++TI/-Tmp-/
_ENV["Apple_PubSub_Socket_Render"]  /tmp/launch-q1YyNj/Render
_ENV["USER"]    mikaelbortenheim
_ENV["COMMAND_MODE"]    legacy
_ENV["SSH_AUTH_SOCK"]   /tmp/launch-h4iFnb/Listeners
_ENV["__CF_USER_TEXT_ENCODING"] 0x1F5:0:0
_ENV["PATH"]    /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin
_ENV["PWD"] /
_ENV["SHLVL"]   1
_ENV["HOME"]    /Users/mikaelbortenheim
_ENV["DYLD_LIBRARY_PATH"]   /Applications/MAMP/Library/lib:
_ENV["PYTHONPATH"]  /Applications/Quick Search Box.app/Contents/Frameworks/Vermilion.framework/Resources
_ENV["LOGNAME"] mikaelbortenheim
_ENV["DISPLAY"] /tmp/launch-fxEJxI/org.x:0
_ENV["SECURITYSESSIONID"]   308f98
_ENV["_"]   /Applications/MAMP/Library/bin/httpd

PHP License

This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net.

to help me with this do you need any more info?
code_coverage works in the browser.

thanks


问:
What does Antimonotonicity and monotonicity constraint mean?
I have looked through the web for this answer and what I get is a similar definition for both of them. This is what I found:

Monotone constraints possess the following property. If an itemset S violates a monotone constraint C, then any of its subsets also violates C. Equivalently, all supersets of an itemset satisfying a monotone constraint C also satisfy C (i.e., C is upward closed).  Monotone

Anti-monotone constraints possess the following nice property. If an itemset S satisfies an anti-monotone constraint C, then all of its subsets also satisfy C (i.e., C is downward closed). Equivalently, any superset of an itemset violating an anti-monotone constraint C also violates C. Anti-monotone

Quoting the definitions in the links:

A constraint C is monotone if and only if for all itemsets S and S′:
  if S ⊇ S′ and S violates C, then S′ violates C.

A constraint C is anti-monotone if and only if for all itemsets S and S′:
  if S ⊇ S′and S satisfies C, then S′ satisfies C.

Can anyone please explain it to me what's the difference between them? Preferably with an example.

答:
With the first definition, if S violates C, a superset of it might not also violate C but a subset must... If S satisfies C, a superset of it must also satisfy C but a subset might not.

The second definition is the other way around... if S violates C, a superset of it must also violate C but a subset might not... and if S satisfies C, a superset of it might not also satisfy C but a subset must.


问:
R shiny and leaflet: Trying to update Spatial Polygon Dataframe using reactive expression
I have written code for inputs and a leaflet map that work independently, but error when I try to get them to be dependent on each other. Overall, I am trying to allow these 4 sliders to be adjusted to provide "weights" which are then used to calculate new fields in my Spatial Polygon Dataframe. I then want to take that updated file and put it into Leaflet. I then want to be able to further filter the polygons by score with another slider.

I have followed this RStudio Tutorial closely to format my code. Basically, I'm using reactive expressions to do my calculations, defining them as a variable (eg NewVar <- reactive({...})), and then trying to use that variable in subsequent code in the data argument (eg data = NewVar()). My code would error when I did that and also when I referred to columns with ~ (eg values = ~Column). But I couldn't refer to columns using $Column because it is a function now, not a Spatial Polygon DataFrame. I tried to fix this by, within the reactive function, assigning the function to a variable (eg SPDF <- NewVar()) and then using values = SPDF$Column. That is also erroring (Warning: Error in <-: invalid (NULL) left side of assignment) and (Warning: Error in : trying to get slot "data" from an object of a basic class ("numeric") with no slots).

I'm pasting the entire code below. Please do let me know if anything stands out - or to help me understand how to properly call on a column from a reactive expression that did calculations on a Spatial Polygon Dataframe.

```<code># Build UI
ui <- fluidPage(

titlePanel("UNCWI Score Evaluation"),

sidebarLayout(

sidebarPanel(
sliderInput(inputId = "weightir", label = "Weight for IR",
          value = 0.19, min = 0, max = 1),
sliderInput(inputId = "weightul", label = "Weight for Upland Protection",
          value = 0.31, min = 0, max = 1),
sliderInput(inputId = "weightva", label = "Weight for Vulnerable Areas",
          value = 0.21, min = 0, max = 1),
sliderInput(inputId = "weightwsc", label = "Weight for WSC",
          value = 0.29, min = 0, max = 1),
actionButton("run", "Run")
),

mainPanel(
leafletOutput("map"),
sliderInput("range", "Scores", min = 0.0, max= 10.0, value = as.numeric(c("0.0", "10.0")), step = 0.1),
actionButton("export", "Export Shapefile")
)
))

# Render Outputs
server <- function(input, output) {
defaultData <- eventReactive(input$run, {
# Multiply by Weights
merge.proj@data$IR_WtScore <- round(merge.proj@data$MEAN_IR_Sc*input$weightir, digits = 1)
merge.proj@data$UL_WtScore <- round(merge.proj@data$MEAN_UL_Sc*input$weightul, digits = 1)
merge.proj@data$VA_WtScore <- round(merge.proj@data$MEAN_VA_Sc*input$weightva, digits = 1)
merge.proj@data$WSC_WtScore <- round(merge.proj@data$MEAN_WSC_S*input$weightwsc, digits = 1)
# Find Total Score
merge.proj@data$Total_Score <- merge.proj@data$IR_WtScore + merge.proj@data$UL_WtScore + merge.proj@data$VA_WtScore + merge.proj@data$WSC_WtScore
})

# Plot with leaflet

# Palette for map
colorpal <-  reactive({
merge.proj <- defaultData()
colorNumeric(palette = "YlOrRd",
domain = merge.proj$Total_Score)
})

# Label Option for map
labels <- reactive({
merge.proj <- defaultData()
lsprintf("<strong>Parcel ID: </strong>%s<br/><strong>Total Score:</strong>%g", merge.proj$PARCEL_ID, merge.proj$Total_Score) %>% lapply(htmltools::HTML)
})

# Render Default Map
output$map <- renderLeaflet ({leaflet() %>%
        merge.proj <- defaultData()
        pal <- colorpal()
        lab <- labels()
  addTiles() %>%
  addPolygons(data=merge.proj,
              fillColor = ~pal(Total_Score),
              weight = 1,
              opacity = 1,
              color = "white",
              dashArray = "3",
              fillOpacity = 0.7,
              highlight = highlightOptions(
                weight = 3,
                color = "#666",
                dashArray = "",
                fillOpacity = 0.7,
                bringToFront = TRUE),
              label = lab,
              labelOptions = labelOptions(
                style = list("font-weight" = "normal", padding = "3px 8px"),
                textsize = "15px",
                direction = "auto")) %>%
  addLegend(position = "bottomleft",pal = pal, opacity = 0.7, values = merge.proj$Total_Score, title = "<strong>Total Score</strong>")
})

# Update map to parcel score slider

# Subset data
  filteredData <- reactive({
    merge.proj <- defaultData()
merge.proj[merge.proj@data$Total_Score >= input$range[1] & merge.proj@data$Total_Score <= input$range[2],]
})

# New Palette
  colorpal2 <-  reactive({
    merge.proj <- filteredData()
    colorNumeric(palette = "YlOrRd",
      domain = merge.proj$Total_Score)
  })

# Label Option
  labels2 <- reactive({
    merge.proj <- filteredData()
    sprintf("<strong>Parcel ID: </strong>%s<br/><strong>Total Score: </strong>%g", merge.proj$PARCEL_ID, merge.proj$Total_Score) %>% lapply(htmltools::HTML)
})

#Leaflet Proxy
  observe({
    merge.proj <- filteredData()
    pal2 <- colorpal2()
    lab2 <- labels2()

    leafletProxy("map", data = filteredData()) %>%
      clearShapes() %>%
      addPolygons(
        fillColor = ~pal2(Total_Score),
        weight = 1,
        opacity = 1,
        color = "white",
        dashArray = "3",
        fillOpacity = 0.7,
        highlight = highlightOptions(
          weight = 3,
          color = "#666",
          dashArray = "",
          fillOpacity = 0.7,
          bringToFront = TRUE),
        label = lab2,
        labelOptions = labelOptions(
          style = list("font-weight" = "normal", padding = "3px 8px"),
          textsize = "15px",
          direction = "auto"))
})

#Update Legend
observe({
    proxy <- leafletProxy("map", data = filteredData())

    pal2 <- colorpal2()
    proxy %>% clearControls()
    proxy %>% addLegend(position = "bottomleft",pal = pal2, opacity = 0.7, values = ~Total_Score, title = "<strong>Total Score</strong>")
})

# Export new shapefile
observeEvent(input$export, {
    merge.proj <- filteredData()
writeOGR(merge.proj, dsn = "Data", layer = "UNCWI_Output", driver = "ESRI Shapefile")
})
}

shinyApp(ui = ui, server = server)
</code>```

答:
I got my code to work by moving leaflet() %>% below where I define the variables in the renderLeaflet({}) portion of the code. See below:</p>

```<code># Build UI
ui <- fluidPage(

titlePanel("UNCWI Score Evaluation"),

sidebarLayout(

sidebarPanel(
sliderInput(inputId = "weightir", label = "Weight for IR",
          value = 0.19, min = 0, max = 1),
sliderInput(inputId = "weightul", label = "Weight for Upland Protection",
          value = 0.31, min = 0, max = 1),
sliderInput(inputId = "weightva", label = "Weight for Vulnerable Areas",
          value = 0.21, min = 0, max = 1),
sliderInput(inputId = "weightwsc", label = "Weight for WSC",
          value = 0.29, min = 0, max = 1),
actionButton("run", "Run")
),

mainPanel(
leafletOutput("map"),
sliderInput("range", "Scores", min = 0.0, max= 10.0, value = as.numeric(c("0.0", "10.0")), step = 0.1),
actionButton("export", "Export Shapefile")
)
))

# Render Outputs
server <- function(input, output) {
defaultData <- eventReactive(input$run, {
# Multiply by Weights
merge.proj@data$IR_WtScore <- round(merge.proj@data$MEAN_IR_Sc*input$weightir, digits = 1)
merge.proj@data$UL_WtScore <- round(merge.proj@data$MEAN_UL_Sc*input$weightul, digits = 1)
merge.proj@data$VA_WtScore <- round(merge.proj@data$MEAN_VA_Sc*input$weightva, digits = 1)
merge.proj@data$WSC_WtScore <- round(merge.proj@data$MEAN_WSC_S*input$weightwsc, digits = 1)
# Find Total Score
merge.proj@data$Total_Score <- merge.proj@data$IR_WtScore + merge.proj@data$UL_WtScore + merge.proj@data$VA_WtScore + merge.proj@data$WSC_WtScore
})

# Plot with leaflet

# Palette for map
colorpal <-  reactive({
merge.proj <- defaultData()
colorNumeric(palette = "YlOrRd",
domain = merge.proj$Total_Score)
})

# Label Option for map
labels <- reactive({
merge.proj <- defaultData()
lsprintf("<strong>Parcel ID: </strong>%s<br/><strong>Total Score:</strong>%g", merge.proj$PARCEL_ID, merge.proj$Total_Score) %>% lapply(htmltools::HTML)
})

# Render Default Map
output$map <- renderLeaflet ({
        merge.proj <- defaultData()
        pal <- colorpal()
        lab <- labels()
  leaflet() %>%
  addTiles() %>%
  addPolygons(data=merge.proj,
              fillColor = ~pal(Total_Score),
              weight = 1,
              opacity = 1,
              color = "white",
              dashArray = "3",
              fillOpacity = 0.7,
              highlight = highlightOptions(
                weight = 3,
                color = "#666",
                dashArray = "",
                fillOpacity = 0.7,
                bringToFront = TRUE),
              label = lab,
              labelOptions = labelOptions(
                style = list("font-weight" = "normal", padding = "3px 8px"),
                textsize = "15px",
                direction = "auto")) %>%
  addLegend(position = "bottomleft",pal = pal, opacity = 0.7, values = merge.proj$Total_Score, title = "<strong>Total Score</strong>")
})

# Update map to parcel score slider

# Subset data
  filteredData <- reactive({
    merge.proj <- defaultData()
merge.proj[merge.proj@data$Total_Score >= input$range[1] & merge.proj@data$Total_Score <= input$range[2],]
})

# New Palette
  colorpal2 <-  reactive({
    merge.proj <- filteredData()
    colorNumeric(palette = "YlOrRd",
      domain = merge.proj$Total_Score)
  })

# Label Option
  labels2 <- reactive({
    merge.proj <- filteredData()
    sprintf("<strong>Parcel ID: </strong>%s<br/><strong>Total Score: </strong>%g", merge.proj$PARCEL_ID, merge.proj$Total_Score) %>% lapply(htmltools::HTML)
})

#Leaflet Proxy
  observe({
    merge.proj <- filteredData()
    pal2 <- colorpal2()
    lab2 <- labels2()

    leafletProxy("map", data = filteredData()) %>%
      clearShapes() %>%
      addPolygons(
        fillColor = ~pal2(Total_Score),
        weight = 1,
        opacity = 1,
        color = "white",
        dashArray = "3",
        fillOpacity = 0.7,
        highlight = highlightOptions(
          weight = 3,
          color = "#666",
          dashArray = "",
          fillOpacity = 0.7,
          bringToFront = TRUE),
        label = lab2,
        labelOptions = labelOptions(
          style = list("font-weight" = "normal", padding = "3px 8px"),
          textsize = "15px",
          direction = "auto"))
})

#Update Legend
observe({
    proxy <- leafletProxy("map", data = filteredData())

    pal2 <- colorpal2()
    proxy %>% clearControls()
    proxy %>% addLegend(position = "bottomleft",pal = pal2, opacity = 0.7, values = ~Total_Score, title = "<strong>Total Score</strong>")
})

# Export new shapefile
observeEvent(input$export, {
    merge.proj <- filteredData()
writeOGR(merge.proj, dsn = "Data", layer = "UNCWI_Output", driver = "ESRI Shapefile")
})
}

shinyApp(ui = ui, server = server)
</code>```

Body:
I have written code for inputs and a leaflet map that work independently, but error when I try to get them to be dependent on each other. Overall, I am trying to allow these 4 sliders to be adjusted to provide "weights" which are then used to calculate new fields in my Spatial Polygon Dataframe. I then want to take that updated file and put it into Leaflet. I then want to be able to further filter the polygons by score with another slider.

I have followed this RStudio Tutorial closely to format my code. Basically, I'm using reactive expressions to do my calculations, defining them as a variable (eg NewVar <- reactive({...})), and then trying to use that variable in subsequent code in the data argument (eg data = NewVar()). My code would error when I did that and also when I referred to columns with ~ (eg values = ~Column). But I couldn't refer to columns using $Column because it is a function now, not a Spatial Polygon DataFrame. I tried to fix this by, within the reactive function, assigning the function to a variable (eg SPDF <- NewVar()) and then using values = SPDF$Column. That is also erroring (Warning: Error in <-: invalid (NULL) left side of assignment) and (Warning: Error in : trying to get slot "data" from an object of a basic class ("numeric") with no slots).

I'm pasting the entire code below. Please do let me know if anything stands out - or to help me understand how to properly call on a column from a reactive expression that did calculations on a Spatial Polygon Dataframe.

# Build UI
ui <- fluidPage(

titlePanel("UNCWI Score Evaluation"),

sidebarLayout(

sidebarPanel(
sliderInput(inputId = "weightir", label = "Weight for IR",
          value = 0.19, min = 0, max = 1),
sliderInput(inputId = "weightul", label = "Weight for Upland Protection",
          value = 0.31, min = 0, max = 1),
sliderInput(inputId = "weightva", label = "Weight for Vulnerable Areas",
          value = 0.21, min = 0, max = 1),
sliderInput(inputId = "weightwsc", label = "Weight for WSC",
          value = 0.29, min = 0, max = 1),
actionButton("run", "Run")
),

mainPanel(
leafletOutput("map"),
sliderInput("range", "Scores", min = 0.0, max= 10.0, value = as.numeric(c("0.0", "10.0")), step = 0.1),
actionButton("export", "Export Shapefile")
)
))

# Render Outputs
server <- function(input, output) {
defaultData <- eventReactive(input$run, {
# Multiply by Weights
merge.proj@data$IR_WtScore <- round(merge.proj@data$MEAN_IR_Sc*input$weightir, digits = 1)
merge.proj@data$UL_WtScore <- round(merge.proj@data$MEAN_UL_Sc*input$weightul, digits = 1)
merge.proj@data$VA_WtScore <- round(merge.proj@data$MEAN_VA_Sc*input$weightva, digits = 1)
merge.proj@data$WSC_WtScore <- round(merge.proj@data$MEAN_WSC_S*input$weightwsc, digits = 1)
# Find Total Score
merge.proj@data$Total_Score <- merge.proj@data$IR_WtScore + merge.proj@data$UL_WtScore + merge.proj@data$VA_WtScore + merge.proj@data$WSC_WtScore
})

# Plot with leaflet

# Palette for map
colorpal <-  reactive({
merge.proj <- defaultData()
colorNumeric(palette = "YlOrRd",
domain = merge.proj$Total_Score)
})

# Label Option for map
labels <- reactive({
merge.proj <- defaultData()
lsprintf("Parcel ID: %s
Total Score:%g", merge.proj$PARCEL_ID, merge.proj$Total_Score) %>% lapply(htmltools::HTML)
})

# Render Default Map
output$map <- renderLeaflet ({leaflet() %>%
        merge.proj <- defaultData()
        pal <- colorpal()
        lab <- labels()
  addTiles() %>%
  addPolygons(data=merge.proj,
              fillColor = ~pal(Total_Score),
              weight = 1,
              opacity = 1,
              color = "white",
              dashArray = "3",
              fillOpacity = 0.7,
              highlight = highlightOptions(
                weight = 3,
                color = "#666",
                dashArray = "",
                fillOpacity = 0.7,
                bringToFront = TRUE),
              label = lab,
              labelOptions = labelOptions(
                style = list("font-weight" = "normal", padding = "3px 8px"),
                textsize = "15px",
                direction = "auto")) %>%
  addLegend(position = "bottomleft",pal = pal, opacity = 0.7, values = merge.proj$Total_Score, title = "Total Score")
})

# Update map to parcel score slider

# Subset data
  filteredData <- reactive({
    merge.proj <- defaultData()
merge.proj[merge.proj@data$Total_Score >= input$range[1] & merge.proj@data$Total_Score <= input$range[2],]
})

# New Palette
  colorpal2 <-  reactive({
    merge.proj <- filteredData()
    colorNumeric(palette = "YlOrRd",
      domain = merge.proj$Total_Score)
  })

# Label Option
  labels2 <- reactive({
    merge.proj <- filteredData()
    sprintf("Parcel ID: %s
Total Score: %g", merge.proj$PARCEL_ID, merge.proj$Total_Score) %>% lapply(htmltools::HTML)
})

#Leaflet Proxy
  observe({
    merge.proj <- filteredData()
    pal2 <- colorpal2()
    lab2 <- labels2()

    leafletProxy("map", data = filteredData()) %>%
      clearShapes() %>%
      addPolygons(
        fillColor = ~pal2(Total_Score),
        weight = 1,
        opacity = 1,
        color = "white",
        dashArray = "3",
        fillOpacity = 0.7,
        highlight = highlightOptions(
          weight = 3,
          color = "#666",
          dashArray = "",
          fillOpacity = 0.7,
          bringToFront = TRUE),
        label = lab2,
        labelOptions = labelOptions(
          style = list("font-weight" = "normal", padding = "3px 8px"),
          textsize = "15px",
          direction = "auto"))
})

#Update Legend
observe({
    proxy <- leafletProxy("map", data = filteredData())

    pal2 <- colorpal2()
    proxy %>% clearControls()
    proxy %>% addLegend(position = "bottomleft",pal = pal2, opacity = 0.7, values = ~Total_Score, title = "Total Score")
})

# Export new shapefile
observeEvent(input$export, {
    merge.proj <- filteredData()
writeOGR(merge.proj, dsn = "Data", layer = "UNCWI_Output", driver = "ESRI Shapefile")
})
}

shinyApp(ui = ui, server = server)

Body:
I got my code to work by moving leaflet() %>% below where I define the variables in the renderLeaflet({}) portion of the code. See below:

# Build UI
ui <- fluidPage(

titlePanel("UNCWI Score Evaluation"),

sidebarLayout(

sidebarPanel(
sliderInput(inputId = "weightir", label = "Weight for IR",
          value = 0.19, min = 0, max = 1),
sliderInput(inputId = "weightul", label = "Weight for Upland Protection",
          value = 0.31, min = 0, max = 1),
sliderInput(inputId = "weightva", label = "Weight for Vulnerable Areas",
          value = 0.21, min = 0, max = 1),
sliderInput(inputId = "weightwsc", label = "Weight for WSC",
          value = 0.29, min = 0, max = 1),
actionButton("run", "Run")
),

mainPanel(
leafletOutput("map"),
sliderInput("range", "Scores", min = 0.0, max= 10.0, value = as.numeric(c("0.0", "10.0")), step = 0.1),
actionButton("export", "Export Shapefile")
)
))

# Render Outputs
server <- function(input, output) {
defaultData <- eventReactive(input$run, {
# Multiply by Weights
merge.proj@data$IR_WtScore <- round(merge.proj@data$MEAN_IR_Sc*input$weightir, digits = 1)
merge.proj@data$UL_WtScore <- round(merge.proj@data$MEAN_UL_Sc*input$weightul, digits = 1)
merge.proj@data$VA_WtScore <- round(merge.proj@data$MEAN_VA_Sc*input$weightva, digits = 1)
merge.proj@data$WSC_WtScore <- round(merge.proj@data$MEAN_WSC_S*input$weightwsc, digits = 1)
# Find Total Score
merge.proj@data$Total_Score <- merge.proj@data$IR_WtScore + merge.proj@data$UL_WtScore + merge.proj@data$VA_WtScore + merge.proj@data$WSC_WtScore
})

# Plot with leaflet

# Palette for map
colorpal <-  reactive({
merge.proj <- defaultData()
colorNumeric(palette = "YlOrRd",
domain = merge.proj$Total_Score)
})

# Label Option for map
labels <- reactive({
merge.proj <- defaultData()
lsprintf("<strong>Parcel ID: </strong>%s<br/><strong>Total Score:</strong>%g", merge.proj$PARCEL_ID, merge.proj$Total_Score) %>% lapply(htmltools::HTML)
})

# Render Default Map
output$map <- renderLeaflet ({
        merge.proj <- defaultData()
        pal <- colorpal()
        lab <- labels()
  leaflet() %>%
  addTiles() %>%
  addPolygons(data=merge.proj,
              fillColor = ~pal(Total_Score),
              weight = 1,
              opacity = 1,
              color = "white",
              dashArray = "3",
              fillOpacity = 0.7,
              highlight = highlightOptions(
                weight = 3,
                color = "#666",
                dashArray = "",
                fillOpacity = 0.7,
                bringToFront = TRUE),
              label = lab,
              labelOptions = labelOptions(
                style = list("font-weight" = "normal", padding = "3px 8px"),
                textsize = "15px",
                direction = "auto")) %>%
  addLegend(position = "bottomleft",pal = pal, opacity = 0.7, values = merge.proj$Total_Score, title = "<strong>Total Score</strong>")
})

# Update map to parcel score slider

# Subset data
  filteredData <- reactive({
    merge.proj <- defaultData()
merge.proj[merge.proj@data$Total_Score >= input$range[1] & merge.proj@data$Total_Score <= input$range[2],]
})

# New Palette
  colorpal2 <-  reactive({
    merge.proj <- filteredData()
    colorNumeric(palette = "YlOrRd",
      domain = merge.proj$Total_Score)
  })

# Label Option
  labels2 <- reactive({
    merge.proj <- filteredData()
    sprintf("<strong>Parcel ID: </strong>%s<br/><strong>Total Score: </strong>%g", merge.proj$PARCEL_ID, merge.proj$Total_Score) %>% lapply(htmltools::HTML)
})

#Leaflet Proxy
  observe({
    merge.proj <- filteredData()
    pal2 <- colorpal2()
    lab2 <- labels2()

    leafletProxy("map", data = filteredData()) %>%
      clearShapes() %>%
      addPolygons(
        fillColor = ~pal2(Total_Score),
        weight = 1,
        opacity = 1,
        color = "white",
        dashArray = "3",
        fillOpacity = 0.7,
        highlight = highlightOptions(
          weight = 3,
          color = "#666",
          dashArray = "",
          fillOpacity = 0.7,
          bringToFront = TRUE),
        label = lab2,
        labelOptions = labelOptions(
          style = list("font-weight" = "normal", padding = "3px 8px"),
          textsize = "15px",
          direction = "auto"))
})

#Update Legend
observe({
    proxy <- leafletProxy("map", data = filteredData())

    pal2 <- colorpal2()
    proxy %>% clearControls()
    proxy %>% addLegend(position = "bottomleft",pal = pal2, opacity = 0.7, values = ~Total_Score, title = "<strong>Total Score</strong>")
})

# Export new shapefile
observeEvent(input$export, {
    merge.proj <- filteredData()
writeOGR(merge.proj, dsn = "Data", layer = "UNCWI_Output", driver = "ESRI Shapefile")
})
}

shinyApp(ui = ui, server = server)