├── themes └── default │ ├── views │ ├── admin │ │ ├── about.php │ │ ├── top.php │ │ ├── index.php │ │ └── dbs.php │ ├── footer.php │ ├── exception.php │ ├── collection │ │ ├── removeCollection.php │ │ ├── collectionValidate.php │ │ ├── explainQuery.php │ │ ├── queryHistory.php │ │ ├── collectionDuplicate.php │ │ ├── collectionStats.php │ │ ├── collectionRename.php │ │ ├── collectionProps.php │ │ ├── createRow.php │ │ ├── modifyRow.php │ │ ├── collectionIndexes.php │ │ ├── createIndex.php │ │ └── create2dIndex.php │ ├── db │ │ ├── repairDatabase.php │ │ ├── dropDatabase.php │ │ ├── dropDatabaseResult.php │ │ ├── profile.php │ │ ├── addUser.php │ │ ├── auth.php │ │ ├── index.php │ │ ├── dbImport.php │ │ ├── newCollection.php │ │ ├── dbExport.php │ │ ├── profileLevel.php │ │ └── dbTransfer.php │ ├── server │ │ ├── killOp.php │ │ ├── status.php │ │ ├── createDatabase.php │ │ ├── databases.php │ │ ├── command.php │ │ ├── processlist.php │ │ ├── execute.php │ │ ├── index.php │ │ └── replication.php │ ├── header.php │ ├── plugins │ │ └── index.php │ └── login │ │ └── index.php │ ├── images │ ├── add.png │ ├── cross.png │ ├── error.png │ ├── grid.png │ ├── key.png │ ├── table.png │ ├── world.png │ ├── accept.png │ ├── connect.png │ ├── report.png │ ├── server.png │ ├── database.png │ ├── databases.png │ ├── page_copy.png │ ├── exclamation.png │ ├── arrow_refresh.png │ ├── menuitem_hover.png │ ├── page_white_edit.png │ ├── submenu_bullet.png │ ├── table-systemjs.png │ ├── page_white_delete.png │ ├── page_white_swoosh.png │ ├── page_white_paintbrush.png │ ├── ui-icons_222222_256x240.png │ ├── ui-icons_2e83ff_256x240.png │ ├── ui-icons_454545_256x240.png │ ├── ui-icons_888888_256x240.png │ ├── ui-icons_cd0a0a_256x240.png │ ├── ui-icons_ffffff_256x240.png │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ ├── ui-bg_flat_75_ffffff_40x100.png │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ ├── ui-bg_glass_65_ffffff_1x400.png │ ├── ui-bg_glass_75_dadada_1x400.png │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ ├── ui-bg_glass_95_fef1ec_1x400.png │ └── ui-bg_highlight-soft_75_cccccc_1x100.png │ └── css │ ├── collection.css │ ├── global.css │ └── layout-default-1.3.0.css ├── favicon.ico ├── logs └── README.txt ├── app ├── plugins │ └── README.txt ├── configs │ └── rplugin.php ├── lib │ ├── mongo │ │ ├── RMongoException.php │ │ ├── RMongo.php │ │ └── RObject.php │ ├── page │ │ ├── lang │ │ │ ├── zh.php │ │ │ ├── zh_cn.php │ │ │ ├── default.php │ │ │ ├── en.php │ │ │ ├── en_us.php │ │ │ ├── de_de.php │ │ │ ├── ru_ru.php │ │ │ └── es_es.php │ │ └── RPageStyle1.php │ ├── ext │ │ └── RExtController.php │ ├── core │ │ ├── REvent.php │ │ ├── RFilter.php │ │ └── RPlugin.php │ └── mime │ │ └── types.php ├── controllers │ ├── index.php │ ├── plugins.php │ ├── logout.php │ ├── login.php │ └── admin.php ├── models │ ├── MMongo.php │ ├── MDb.php │ ├── MCollection.php │ └── MUser.php ├── langs │ ├── ja_jp │ │ └── message.php │ ├── zh_cn │ │ └── message.php │ ├── zh_tw │ │ └── message.php │ ├── pt_br │ │ └── message.php │ ├── pt_pt │ │ └── message.php │ ├── de_de │ │ └── message.php │ └── es_es │ │ └── message.php ├── classes │ ├── VarEval.php │ └── VarExportor.php └── funcs │ ├── rock.php │ └── functions.php ├── robots.txt ├── INSTALL.txt ├── index.php ├── LICENSE.txt ├── config.php ├── config.sample.php ├── README.txt └── CHANGELOG.txt /themes/default/views/admin/about.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/favicon.ico -------------------------------------------------------------------------------- /logs/README.txt: -------------------------------------------------------------------------------- 1 | Query logs goes here, you should make this directory writeable. 2 | -------------------------------------------------------------------------------- /app/plugins/README.txt: -------------------------------------------------------------------------------- 1 | Put plugins here, and enable them in app/configs/rplugin.php 2 | -------------------------------------------------------------------------------- /robots.txt: -------------------------------------------------------------------------------- 1 | # 2 | # robots.txt for RockMongo 3 | # 4 | 5 | User-agent: * 6 | Disallow: / -------------------------------------------------------------------------------- /themes/default/views/footer.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/configs/rplugin.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/default/images/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/add.png -------------------------------------------------------------------------------- /themes/default/images/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/cross.png -------------------------------------------------------------------------------- /themes/default/images/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/error.png -------------------------------------------------------------------------------- /themes/default/images/grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/grid.png -------------------------------------------------------------------------------- /themes/default/images/key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/key.png -------------------------------------------------------------------------------- /themes/default/images/table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/table.png -------------------------------------------------------------------------------- /themes/default/images/world.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/world.png -------------------------------------------------------------------------------- /themes/default/images/accept.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/accept.png -------------------------------------------------------------------------------- /themes/default/images/connect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/connect.png -------------------------------------------------------------------------------- /themes/default/images/report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/report.png -------------------------------------------------------------------------------- /themes/default/images/server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/server.png -------------------------------------------------------------------------------- /themes/default/images/database.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/database.png -------------------------------------------------------------------------------- /themes/default/images/databases.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/databases.png -------------------------------------------------------------------------------- /themes/default/images/page_copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/page_copy.png -------------------------------------------------------------------------------- /themes/default/views/exception.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
-------------------------------------------------------------------------------- /themes/default/images/exclamation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/exclamation.png -------------------------------------------------------------------------------- /themes/default/images/arrow_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/arrow_refresh.png -------------------------------------------------------------------------------- /themes/default/images/menuitem_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/menuitem_hover.png -------------------------------------------------------------------------------- /themes/default/images/page_white_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/page_white_edit.png -------------------------------------------------------------------------------- /themes/default/images/submenu_bullet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/submenu_bullet.png -------------------------------------------------------------------------------- /themes/default/images/table-systemjs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/table-systemjs.png -------------------------------------------------------------------------------- /themes/default/images/page_white_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/page_white_delete.png -------------------------------------------------------------------------------- /themes/default/images/page_white_swoosh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/page_white_swoosh.png -------------------------------------------------------------------------------- /themes/default/images/page_white_paintbrush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/page_white_paintbrush.png -------------------------------------------------------------------------------- /themes/default/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /themes/default/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /themes/default/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /themes/default/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /themes/default/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /themes/default/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /themes/default/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /themes/default/images/ui-bg_flat_75_ffffff_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/ui-bg_flat_75_ffffff_40x100.png -------------------------------------------------------------------------------- /themes/default/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /themes/default/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /themes/default/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /themes/default/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /themes/default/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /themes/default/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iwind/rockmongo/HEAD/themes/default/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /app/lib/mongo/RMongoException.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | class RMongoException extends MongoException { 8 | 9 | } 10 | 11 | ?> -------------------------------------------------------------------------------- /app/controllers/index.php: -------------------------------------------------------------------------------- 1 | redirect("admin.index"); 9 | } 10 | } 11 | 12 | 13 | ?> -------------------------------------------------------------------------------- /themes/default/views/collection/removeCollection.php: -------------------------------------------------------------------------------- 1 |

» .

2 | -------------------------------------------------------------------------------- /app/controllers/plugins.php: -------------------------------------------------------------------------------- 1 | plugins = RPlugin::plugins(); 11 | 12 | $this->display(); 13 | } 14 | } 15 | 16 | ?> -------------------------------------------------------------------------------- /themes/default/views/db/repairDatabase.php: -------------------------------------------------------------------------------- 1 |

»

2 | 3 |
4 | : 5 |
6 | 7 |
8 |
-------------------------------------------------------------------------------- /themes/default/views/collection/collectionValidate.php: -------------------------------------------------------------------------------- 1 |

»

2 | 3 |
4 | 5 |
6 | 7 |
8 |
9 | -------------------------------------------------------------------------------- /app/controllers/logout.php: -------------------------------------------------------------------------------- 1 | redirect("login.index"); 14 | } 15 | } 16 | 17 | ?> -------------------------------------------------------------------------------- /themes/default/views/collection/explainQuery.php: -------------------------------------------------------------------------------- 1 | 2 |

3 | 4 | 5 | 6 |
7 | 8 |
9 | 10 |
11 |
12 | -------------------------------------------------------------------------------- /app/lib/page/lang/zh.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/lib/page/lang/zh_cn.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/default/views/server/killOp.php: -------------------------------------------------------------------------------- 1 |

"> » ''

2 | 3 | 4 | 5 |
6 | 7 |
8 | 9 |
10 |
11 | -------------------------------------------------------------------------------- /app/lib/page/lang/default.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/lib/page/lang/en.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/lib/page/lang/en_us.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/lib/page/lang/de_de.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/lib/page/lang/ru_ru.php: -------------------------------------------------------------------------------- 1 | 18 | -------------------------------------------------------------------------------- /app/lib/page/lang/es_es.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/default/views/server/status.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | $value):?> 10 | 11 | 12 | 13 | 14 | 15 |
({serverStatus:1})
16 | -------------------------------------------------------------------------------- /themes/default/views/db/dropDatabase.php: -------------------------------------------------------------------------------- 1 |

»

2 | 3 |

4 | ? 5 |

6 |

7 | 8 |

9 | " onclick="window.location='$db,"confirm"=>1))); ?>'"/> " onclick="window.location='$db))); ?>'"/> -------------------------------------------------------------------------------- /themes/default/views/db/dropDatabaseResult.php: -------------------------------------------------------------------------------- 1 |

»

2 | 3 |
4 | 5 |
6 | 7 |
8 |
9 | 10 |

11 | " onclick="window.location=''"/> 12 |

13 | 14 | -------------------------------------------------------------------------------- /themes/default/views/server/createDatabase.php: -------------------------------------------------------------------------------- 1 |

"> »

2 | 3 | 4 | 5 |

6 | 7 | 8 |

9 | 10 | 11 | 12 | 15 | 16 | 17 |
18 | :
19 | " autofocus="autofocus" />
20 | " /> 21 |
22 | -------------------------------------------------------------------------------- /themes/default/css/collection.css: -------------------------------------------------------------------------------- 1 | /** fields and hints list **/ 2 | .fieldsmenu { 3 | float:right; 4 | margin-right:100px; 5 | margin-top:0px; 6 | background-color:#eee; 7 | border-left:1px #ccc solid; 8 | border-top:1px #ccc solid; 9 | border-right:2px #ccc solid; 10 | border-bottom:2px #ccc solid; 11 | padding-left:3px; 12 | position:absolute; 13 | display:none; 14 | width:400px; 15 | } 16 | .fieldsmenu ul {list-style-type:none; margin:0; padding:0} 17 | .fieldsmenu ul li {float:left; width:200px} 18 | 19 | /** operation menu **/ 20 | #field_menu a {display:block; } 21 | #field_menu a:hover {display:block; background-color:#ccc } 22 | #field_menu a:active {display:block; color:blue } 23 | 24 | /** colors **/ 25 | a.disabled { color:gray } 26 | a.disabled:active { color: gray } -------------------------------------------------------------------------------- /themes/default/views/collection/queryHistory.php: -------------------------------------------------------------------------------- 1 | 2 |

3 | 4 | 5 |
6 | 7 |
8 | 9 |
10 | 11 | 12 | 13 | 19 | 20 | 21 |
14 |
15 |
[">]
16 |
17 |
18 |
22 |
-------------------------------------------------------------------------------- /themes/default/views/db/profile.php: -------------------------------------------------------------------------------- 1 |

»

2 | 3 |
4 | $db))); ?>" class="current"> | $db))); ?>"> | 5 | $db))); ?>" onclick="return window.confirm(' \'\'?')"> 6 |
7 | 8 |

9 | 10 | 11 |
12 | : sec));?>
13 | 14 |
15 | 16 | 17 |

-------------------------------------------------------------------------------- /themes/default/views/header.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | RockMongo 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /INSTALL.txt: -------------------------------------------------------------------------------- 1 | Installation 2 | -------------------------------------- 3 | 1. Install PHP runtime environment if you don't have one yet, such like Apache Httpd, Nginx ... 4 | 2. Install MongoDB PHP driver (http://us.php.net/manual/en/mongo.installation.php) 5 | 3. Download the package from http://rockmongo.com/downloads 6 | 4. Unzip the files into your disk, under root of your site 7 | 5. Open the config.php with your convenient editor, change host, port, admins and so on to yours 8 | 6. Visit the index.php in your browser, for example: http://localhost/rockmongo/index.php 9 | 7. Login with admin username and password, which is set "admin" and "admin" as default 10 | 8. Play with your MongoDBs! 11 | 12 | Upgrade from old version 13 | -------------------------------------- 14 | 1.Copy all files excluding config.php to your old version directory 15 | 2.Done! 16 | 17 | 18 | How to install -------------------------------------------------------------------------------- /themes/default/views/db/addUser.php: -------------------------------------------------------------------------------- 1 |

»

2 | 3 |
4 | $db))); ?>"> | 5 | $db))); ?>" class="current"> 6 |
7 | 8 |
9 |

10 |
11 | :
12 | "/>
13 | :
14 |
15 | :
16 |
17 |
18 |
19 | "/> 20 |
21 |
-------------------------------------------------------------------------------- /app/models/MMongo.php: -------------------------------------------------------------------------------- 1 | » 2 | 3 | 4 |

5 | 6 |

7 | 8 | 9 |

10 | 11 |

12 | 15 | 16 | 17 |
18 | :
19 |
20 | :
21 | "/>
22 |
23 | checked="checked"/>
24 |
25 | checked="checked"/>
26 | "/> 27 |
-------------------------------------------------------------------------------- /themes/default/views/server/databases.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | "> 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
$db["name"]))); ?>">
-------------------------------------------------------------------------------- /themes/default/views/db/auth.php: -------------------------------------------------------------------------------- 1 |

»

2 | 3 |
4 | $db))); ?>" class="current">Users | 5 | $db))); ?>">Add User 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
IDUserRead OnlyOperation
$db,"user"=>$user["user"]))); ?>" onclick="return window.confirm('Are you sure to remove user \'\'?')">Remove
24 | 25 |

26 | Official Document: Enable Authentication 27 |

-------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | Here for installation documents on PHP.net."); 24 | } 25 | 26 | // enforce Mongo support for int64 data type (Kyryl Bilokurov ) 27 | if (PHP_INT_SIZE == 8) { 28 | ini_set("mongo.native_long", 1); 29 | ini_set("mongo.long_as_object", 1); 30 | } 31 | 32 | /** 33 | * Initializing configuration files and RockMongo 34 | */ 35 | require "config.php"; 36 | require "rock.php"; 37 | rock_check_version(); 38 | rock_init_lang(); 39 | rock_init_plugins(); 40 | Rock::start(); 41 | 42 | ?> -------------------------------------------------------------------------------- /themes/default/views/collection/collectionStats.php: -------------------------------------------------------------------------------- 1 |

» [">]

2 | 3 | 4 | 5 | 6 | 7 | $stat):?> 8 | 9 | 10 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | $stat):?> 28 | 29 | 30 | 33 | 34 | 35 | 36 |
db..stats()
" . var_export($stat, true) . ""); 13 | } 14 | else { 15 | if (in_array($name, array( "size", "storageSize", "lastExtentSize", "totalIndexSize", "avgObjSize" ))) { 16 | $stat = "" . r_human_bytes($stat) . ""; 17 | } 18 | h($stat); 19 | } 20 | ?>
{top:1}
37 | -------------------------------------------------------------------------------- /themes/default/views/collection/collectionRename.php: -------------------------------------------------------------------------------- 1 |

»

2 | 3 | 4 |

5 | 6 | 7 |

8 | 9 | 10 |
11 | 12 | :
13 |
14 | :
15 | " autofocus="autofocus"/>
16 |
17 | checked="checked" />
18 | "/> 19 |
20 | 21 | 22 | 23 |
24 | 25 |
26 | 27 |
28 |
29 | 30 | 31 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /themes/default/views/server/command.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | » 6 | 7 | 8 |

9 | 10 | 11 |
12 | 13 |
14 | : 15 | 20 | : 25 |
26 | "/> 27 |
28 | 29 | 30 | 31 |
32 | 33 |
34 | 35 |
36 |
37 | -------------------------------------------------------------------------------- /themes/default/views/collection/collectionProps.php: -------------------------------------------------------------------------------- 1 |

»

2 | 3 | 4 |

5 | 6 |

7 | 8 | 9 |

10 | 11 |

12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
Capped Collection Options
checked="checked" />
bytes
documents
" />
39 | 40 |
41 | 42 |
-------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The New BSD License 2 | 3 | Copyright (c) 2010, iwind.liu 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 7 | 8 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 9 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 10 | Neither the name of the RockMongo nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /themes/default/views/db/index.php: -------------------------------------------------------------------------------- 1 | 36 | 37 |

38 | 39 |
40 | 41 |
42 | 43 | 44 | 45 | 46 | 47 | $value):?> 48 | 49 | 50 | 51 | 52 | 53 |
Database Statistics ({dbStats:1})
-------------------------------------------------------------------------------- /themes/default/views/collection/createRow.php: -------------------------------------------------------------------------------- 1 | 17 | 18 |

»

19 | 20 | 21 |

22 | 23 | 24 |

25 | 26 | 27 |
28 | :
29 | 33 |
34 | 35 |
36 |
37 | 38 |
39 | "/> 40 |
-------------------------------------------------------------------------------- /themes/default/views/db/dbImport.php: -------------------------------------------------------------------------------- 1 |

»

2 | 3 |

4 | 5 |

6 | 9 | 10 | 11 |

.js file exported with RockMongo:

12 | 13 |
14 | 15 | JS File:
16 | "/> 17 |
18 | 19 |
20 |

21 | 22 |

23 | 26 | 27 |

.json file exported with mongoexport:

28 | 29 |
30 | 31 | Import to collection name:
32 | JSON File:
33 | "/> 34 |
-------------------------------------------------------------------------------- /themes/default/views/db/newCollection.php: -------------------------------------------------------------------------------- 1 |

»

2 | 3 | 4 |

5 | 6 |

7 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 |
Capped Collection Options
checked="checked" />
bytes
documents
" />
37 |
38 | 39 |

Here for more details »

-------------------------------------------------------------------------------- /themes/default/views/db/dbExport.php: -------------------------------------------------------------------------------- 1 | 6 | 7 |

»

8 | 9 | 10 |
11 | 12 | 13 | [] 14 | 23 |
24 |
25 |
26 | checked="checked" />
27 | :
28 | 29 | 30 |

31 | "/> 32 |
33 | 34 | 35 | :
36 | 37 | -------------------------------------------------------------------------------- /themes/default/views/db/profileLevel.php: -------------------------------------------------------------------------------- 1 |

»

2 | 3 |
4 | $db))); ?>"> | 5 | $db))); ?>" class="current"> | 6 | $db))); ?>" onclick="return window.confirm(' \'\'?')"> 7 |
8 | 9 |
10 |
11 | 12 | : 13 |
14 |
19 | 22 | "/> 23 |
24 |
25 | 26 | -------------------------------------------------------------------------------- /app/controllers/login.php: -------------------------------------------------------------------------------- 1 | isAjax()) { 9 | render_view("header"); 10 | } 11 | } 12 | 13 | /** 14 | * login page and post 15 | */ 16 | public function doIndex() { 17 | global $MONGO; 18 | 19 | $password = trim(xn("password")); 20 | $this->username = trim(xn("username")); 21 | $this->db = trim(xn("db")); 22 | $this->hostIndex = xi("host"); 23 | $this->languages = rock_load_languages(); 24 | $this->expires = array( 25 | 3 => "3 " . rock_lang("hours"), 26 | 720 => "1 " . rock_lang("month"), 27 | ); 28 | $this->moreOptions = xi("more"); 29 | 30 | if ($this->isPost()) { 31 | //server exists? 32 | if (!isset($MONGO["servers"][$this->hostIndex])) { 33 | $this->message = "Server does not exist"; 34 | return; 35 | } 36 | 37 | //authenticate 38 | $server = MServer::serverWithIndex($this->hostIndex); 39 | if (!$server->auth($this->username, $password, $this->db)) { 40 | $this->message = rock_lang("can_not_auth"); 41 | $this->display(); 42 | return; 43 | } 44 | 45 | //remember user 46 | import("models.MUser"); 47 | MUser::login($this->username, $password, $this->hostIndex, $this->db, xi("expire") * 3600); 48 | 49 | //remember lang 50 | setcookie("ROCK_LANG", x("lang"), time() + 365 * 86400); 51 | 52 | //jump to admin page 53 | $this->redirect("admin.index", array( "host" => $this->hostIndex )); 54 | } 55 | else { 56 | $this->display(); 57 | } 58 | } 59 | } 60 | 61 | ?> -------------------------------------------------------------------------------- /themes/default/views/collection/modifyRow.php: -------------------------------------------------------------------------------- 1 | 17 | 18 |

» '' []

19 | 20 | 21 |

22 | 23 |

24 | 25 | 26 |

27 | 28 |

29 | 30 | 31 |
32 | :
33 |
37 | _id:
38 | " size="72"/> 39 |
40 | :
41 |
42 | "/> " onclick="window.location=''"/> 43 |
-------------------------------------------------------------------------------- /themes/default/views/collection/collectionIndexes.php: -------------------------------------------------------------------------------- 1 |

» [">]

2 | 3 |
4 | [ $db, 7 | "collection" => $collection 8 | ))); 9 | ?>">] 10 | [ $db, 13 | "collection" => $collection 14 | ))); 15 | ?>">] 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 37 | 38 | 39 |
Y $db, 33 | "collection" => $collection, 34 | "index" => $index["name"] 35 | ))); 36 | ?>" onclick="return window.confirm(' \'\'?');">
-------------------------------------------------------------------------------- /app/lib/ext/RExtController.php: -------------------------------------------------------------------------------- 1 | redirectUrl($this->path($action, $params), $js); 15 | exit(); 16 | } 17 | 18 | /** 19 | * Redirect to another URL 20 | * 21 | * @param string $url URL 22 | * @param string $js Whether use javascript 23 | */ 24 | function redirectUrl($url, $js = false) { 25 | if ($js) { 26 | echo ''; 27 | exit(); 28 | } 29 | header("location:{$url}"); 30 | exit(); 31 | } 32 | 33 | /** 34 | * Contruct a path from action name 35 | * 36 | * @param string $action Action name, like "update", "update.go" 37 | * @param array $params Parameters 38 | * @return string 39 | */ 40 | function path($action, array $params = array()) { 41 | if (!strstr($action, ".")) { 42 | $action = $this->name() . "." . $action; 43 | } 44 | $url = $_SERVER["PHP_SELF"] . "?action=" . $action; 45 | if (!empty($params)) { 46 | $url .= "&" . http_build_query($params); 47 | } 48 | return $url; 49 | } 50 | 51 | /** 52 | * Determine if it is a POST request 53 | * 54 | * @return boolean 55 | */ 56 | function isPost() { 57 | return ($_SERVER["REQUEST_METHOD"] == "POST"); 58 | } 59 | 60 | /** 61 | * Is from AJAX request? 62 | * 63 | * @return boolean 64 | */ 65 | function isAjax() { 66 | return (isset($_SERVER["HTTP_X_REQUESTED_WITH"]) && $_SERVER["HTTP_X_REQUESTED_WITH"] == "XMLHttpRequest"); 67 | } 68 | } 69 | 70 | ?> -------------------------------------------------------------------------------- /themes/default/views/plugins/index.php: -------------------------------------------------------------------------------- 1 | 2 |

There are no plugins installed, [Go and download plugins here]   [How to install plugins?]   [Develop New plugins]

3 | 4 |
5 |

[Go and download more plugins here]   [How to install plugins?]   [Develop New plugins]

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
DirNameCodeAuthorDescriptionVersionEnabled
" target="_blank">Y") : h("N") ?>
29 | 30 | 31 | -------------------------------------------------------------------------------- /themes/default/views/admin/top.php: -------------------------------------------------------------------------------- 1 | 13 | 14 |
15 |
16 | 21 | | | " target="right" title="">" target="right" title=""> 22 |
23 |
| | " target="right">Plugins | | "width:100px", "onchange" => "window.top.location='index.php?action=admin.changeLang&lang='+this.value" )); ?> | " target="right">RockMongo v
24 |
25 |
-------------------------------------------------------------------------------- /themes/default/views/server/processlist.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | "ID", 12 | "desc" => "Description", 13 | "client" => "Client", 14 | "active" => "Active", 15 | "lockType" => "LockType", 16 | "waitingForLock" => "Waiting", 17 | "secs_running" => "SecsRunning", 18 | "op" => "Operation", 19 | "ns" => "NameSpace" 20 | ) as $param => $desc):?> 21 | 22 | 23 | 24 | 25 | 26 | "ID", 28 | "desc" => "Description", 29 | "client" => "Client", 30 | "active" => "Active", 31 | "lockType" => "LockType", 32 | "waitingForLock" => "Waiting", 33 | "secs_running" => "SecsRunning", 34 | "op" => "Operation", 35 | "ns" => "NameSpace", 36 | ) as $param => $desc):?> 37 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 |
(db.$cmd.sys.inprog.find({$all:1}))
rowspan="2"> 38 | 39 | 40 | 1):?> [$prog["opid"]))); ?>" onclick="return window.confirm(' \'\'?')">] 41 | 46 | 47 |

-----
-------------------------------------------------------------------------------- /app/models/MDb.php: -------------------------------------------------------------------------------- 1 | execute($code, $params); 14 | if (!$query["ok"]) { 15 | exit("Execute failed:" . $query["errmsg"] . "
\n
" . $code . "
"); 16 | } 17 | return $query["retval"]; 18 | } 19 | 20 | /** 21 | * List collections in a DB 22 | * 23 | * @param MongoDB $db DB 24 | * @return array 25 | */ 26 | static function listCollections(MongoDB $db) { 27 | $server = MServer::currentServer(); 28 | 29 | $names = array(); 30 | $query = $db->execute("function (){ return db.getCollectionNames(); }", array()); 31 | if ($query["ok"]) { 32 | $names= $query["retval"]; 33 | } 34 | else{ 35 | $colls = $db->listCollections(true); 36 | foreach($colls as $coll){ 37 | $names[] = $coll->getName(); 38 | } 39 | } 40 | 41 | $ret = array(); 42 | foreach ($names as $name) { 43 | if ($server->shouldHideCollection($name)) { 44 | continue; 45 | } 46 | if (preg_match("/^system\\./", $name)) { 47 | continue; 48 | } 49 | $ret[] = $name; 50 | } 51 | sort($ret); 52 | 53 | //system collections 54 | if (!$server->uiHideSystemCollections()) { 55 | foreach ($names as $name) { 56 | if ($server->shouldHideCollection($name)) { 57 | continue; 58 | } 59 | if (preg_match("/^system\\./", $name)) { 60 | $ret[] = $name; 61 | } 62 | } 63 | } 64 | $collections = array(); 65 | foreach ($ret as $v) { 66 | if ($v === "") {//older MongoDB version (maybe before 1.7) allow empty collection name 67 | continue; 68 | } 69 | $collections[] = $db->selectCollection($v); 70 | } 71 | return $collections; 72 | } 73 | } 74 | 75 | ?> -------------------------------------------------------------------------------- /themes/default/views/server/execute.php: -------------------------------------------------------------------------------- 1 | 19 |
20 | 21 |
22 | 23 | » Javascript API 24 | 25 | 26 | 27 |

28 | 29 | 30 |
31 | 32 |
33 |
style="display:none"> 34 | 35 | $argument): ?> 36 |
37 | #[JSON]

38 |
39 | 40 | 41 |
42 | : 43 | :"/> 48 |
49 | 50 |
51 | 52 | 53 | 54 |
55 | 56 |
57 | 58 |
59 |
60 | -------------------------------------------------------------------------------- /app/lib/core/REvent.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | class REvent { 10 | private static $_events = array(); 11 | private static $_listeners = array(); 12 | 13 | /** 14 | * Dispatch event 15 | * 16 | * @param string $event Event name 17 | * @param array $params 18 | */ 19 | public static function dispatch($event, array $params = array()) { 20 | if (empty(self::$_listeners[$event])) { 21 | return; 22 | } 23 | if (isset(self::$_events[$event]["enabled"]) && !self::$_events[$event]["enabled"]) { 24 | return; 25 | } 26 | foreach (rock_array_sort(self::$_listeners[$event], "priority") as $index => $listener) { 27 | call_user_func_array($listener["callback"], array($params)); 28 | if (isset(self::$_events[$event]["enabled"]) && !self::$_events[$event]["enabled"]) { 29 | return; 30 | } 31 | } 32 | } 33 | 34 | /** 35 | * Add a event listener 36 | * 37 | * @param string $event Event name 38 | * @param callback|string $callback Event listener 39 | * @param integer $priority Listener priority 40 | */ 41 | public static function listen($event, $callback, $priority = -1) { 42 | if ($priority == -1) { 43 | if (isset(self::$_listeners[$event])) { 44 | $priority = count(self::$_listeners[$event]); 45 | } 46 | } 47 | self::$_listeners[$event][] = array( 48 | "callback" => $callback, 49 | "priority" => $priority 50 | ); 51 | } 52 | 53 | /** 54 | * Stop event propagation 55 | * 56 | * @param string $event Event name 57 | */ 58 | public static function stop($event) { 59 | self::$_events[$event]["enabled"] = false; 60 | } 61 | 62 | /** 63 | * Remove a event listener 64 | * 65 | * @param string $event Event name 66 | * @param callback|string $callback Event listener 67 | */ 68 | public static function remove($event, $callback) { 69 | if (empty(self::$_listeners[$event])) { 70 | return; 71 | } 72 | 73 | foreach (self::$_listeners[$event] as $index => $listener) { 74 | if ($listener["callback"] == $callback) { 75 | unset(self::$_listeners[$event][$index]); 76 | } 77 | } 78 | } 79 | } 80 | 81 | ?> -------------------------------------------------------------------------------- /app/lib/page/RPageStyle1.php: -------------------------------------------------------------------------------- 1 | 6 | * @link http://ifphp.cn 7 | * @version $Id$ 8 | * @package if 9 | * @subpackage plugin.pager 10 | */ 11 | 12 | /** 13 | * 仿Yahoo搜索的分页 14 | * 15 | * @version $Id$ 16 | * @package if 17 | * @subpackage plugin.pager 18 | * @since 1.0 19 | */ 20 | import("@.RPage"); 21 | class RPageStyle1 extends RPage { 22 | function __toString() { 23 | $pages = array(); 24 | $pageNum = $this->length(); 25 | $currPageNo = $this->current(); 26 | $query = $this->query(); 27 | $size = $this->size(); 28 | $total = $this->total(); 29 | $pageSetNum = $this->pageSetNum(); 30 | $middlePageNum = ceil($pageSetNum/2); 31 | if ($pageNum > 0) { 32 | if ($currPageNo <= $middlePageNum) { 33 | $start = 1; 34 | $end = min($pageNum, $pageSetNum); 35 | } 36 | else if ($currPageNo + $middlePageNum - 1 > $pageNum) { 37 | $start = max(1, $pageNum - $pageSetNum - 1); 38 | $end = $pageNum; 39 | } 40 | else { 41 | $start = max(1, $currPageNo - $middlePageNum); 42 | $end = min($currPageNo + $middlePageNum - 1, $pageNum); 43 | } 44 | if ($pageNum > 1) { 45 | $pages[] = "url(1) . "\" title=\"First Page\">«  "; 46 | } 47 | if ($currPageNo > 1) { 48 | $pages[] = "url($currPageNo - 1) . "\" title=\"Previous {$size}\">" . $this->message("pager_prev") . "  "; 49 | } 50 | for ($i = $start; $i <= $end; $i++) { 51 | $_start = $size * ($i - 1) + 1; 52 | $_end = min($size * $i, $total); 53 | if ($i != $currPageNo) { 54 | $pages[] = "url($i) . "\" title=\"Results {$_start} - {$_end}\">{$i}"; 55 | } 56 | else { 57 | $pages[] = "url($i) . "\" title=\"Results {$_start} - {$_end}\">{$i}"; 58 | } 59 | } 60 | if ($currPageNo < $pageNum) { 61 | $pages[] = "  url($currPageNo + 1) . "\" title=\"Next {$size}\">" . $this->message("pager_next") . ""; 62 | } 63 | if ($pageNum > 1) { 64 | $pages[] = "url($pageNum) . "\" title=\"Last Page\">»  "; 65 | } 66 | } 67 | 68 | $string = implode("  ", $pages); 69 | 70 | return $string; 71 | } 72 | } -------------------------------------------------------------------------------- /app/langs/ja_jp/message.php: -------------------------------------------------------------------------------- 1 | 7 | * @version 1.0 8 | */ 9 | 10 | $message["TRANSLATION_NAME"] = "日本語 - Jananese"; 11 | $message["TRANSLATION_ID"] = 4; 12 | 13 | /** connection **/ 14 | $message["can_not_connect"] = "MongoDB connection exception: %s. Please check your configuration."; 15 | 16 | /** buttons and titles **/ 17 | $message["server"] = "サーバー"; 18 | $message["status"] = "ステータス"; 19 | $message["databases"] = "データベース"; 20 | $message["processlist"] = "Processlist"; 21 | $message["command"] = "コマンド"; 22 | $message["execute"] = "実行"; 23 | $message["master_slave"] = "マスター/スレーブ"; 24 | $message["query"] = "クエリー"; 25 | $message["refresh"] = "リフレッシュ"; 26 | $message["insert"] = "挿入"; 27 | $message["clear"] = "Clear"; 28 | $message["delete"] = "削除"; 29 | $message["update"] = "更新"; 30 | $message["duplicate"] = "重複"; 31 | $message["text"] = "Text"; 32 | $message["statistics"] = "統計"; 33 | $message["export"] = "輸出"; 34 | $message["import"] = "インポート"; 35 | $message["transfer"] = "転送"; 36 | $message["drop"] = "ドロップ"; 37 | $message["more"] = "もっと"; 38 | $message["rename"] = "リネーム"; 39 | $message["indexes"] = "インデックス"; 40 | $message["properties"] = "プロパティ"; 41 | $message["validate"] = "検証"; 42 | $message["repair"] = "修理"; 43 | $message["authentication"] = "認証"; 44 | $message["profile"] = "Profile"; 45 | $message["create_collection"] = "New Collection"; 46 | $message["create_collection_full"] = "Create new Collection"; 47 | $message["create_database"] = "Create new Database"; 48 | $message["save"] = "保存"; 49 | $message["back"] = "バック"; 50 | 51 | /** collection operations **/ 52 | $message["submit_query"] = "Submit Query"; 53 | $message["explain"] = "Explain"; 54 | $message["clear_conditions"] = "Clear Conditions"; 55 | $message["rows_per_page"] = "Rows per Page"; 56 | $message["action"] = "アクション"; 57 | $message["limit"] = "制限"; 58 | 59 | /** top bar **/ 60 | $message["tools"] = "ツール"; 61 | $message["manuals"] = "マニュアル"; 62 | $message["logout"] = "ログアウト"; 63 | 64 | /** about **/ 65 | $message["about_content"] = 'RockMongo is a MongoDB administration tool, written in PHP 5. 66 | 67 |

See http://rockmongo.com for more details.

68 | 69 |

If you have any questions, please send email to me: iwind.liu@gmail.com .

'; 70 | 71 | ?> -------------------------------------------------------------------------------- /config.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /config.sample.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/langs/zh_cn/message.php: -------------------------------------------------------------------------------- 1 | 7 | * @version 1.0 8 | */ 9 | 10 | $message["TRANSLATION_NAME"] = "简体中文 - Chinese simplified"; 11 | $message["TRANSLATION_ID"] = 2; 12 | 13 | /** login interface **/ 14 | $message["admin"] = "管理员"; 15 | $message["password"] = "密码"; 16 | $message["language"] = "语言"; 17 | $message["hour"] = "小时"; 18 | $message["hours"] = "小时"; 19 | $message["month"] = "月"; 20 | $message["alive"] = "有效期"; 21 | 22 | /** connection **/ 23 | $message["can_not_connect"] = "MongoDB连接错误: %s. 请检查配置是否正确."; 24 | 25 | $message["overview"] = "全局"; 26 | $message["server"] = "服务器"; 27 | $message["status"] = "状态"; 28 | $message["databases"] = "数据库"; 29 | $message["processlist"] = "进程"; 30 | $message["command"] = "命令"; 31 | $message["execute"] = "代码执行"; 32 | $message["master_slave"] = "主/从"; 33 | $message["query"] = "查询"; 34 | $message["refresh"] = "刷新"; 35 | $message["insert"] = "插入"; 36 | $message["clear"] = "清除"; 37 | $message["delete"] = "删除"; 38 | $message["update"] = "更新"; 39 | $message["duplicate"] = "复制"; 40 | $message["text"] = "文本"; 41 | $message["statistics"] = "统计"; 42 | $message["export"] = "导出"; 43 | $message["import"] = "导入"; 44 | $message["transfer"] = "克隆"; 45 | $message["drop"] = "删除"; 46 | $message["more"] = "更多"; 47 | $message["rename"] = "更名"; 48 | $message["indexes"] = "索引"; 49 | $message["properties"] = "属性"; 50 | $message["validate"] = "校验"; 51 | $message["repair"] = "修复"; 52 | $message["authentication"] = "用户"; 53 | $message["profile"] = "调试信息"; 54 | $message["create_collection"] = "创建集合"; 55 | $message["create_collection_full"] = "创建集合"; 56 | $message["create_database"] = "创建数据库"; 57 | $message["save"] = "保存"; 58 | $message["back"] = "返回"; 59 | 60 | 61 | $message["submit_query"] = "查询"; 62 | $message["explain"] = "分析"; 63 | $message["clear_conditions"] = "清除条件"; 64 | $message["rows_per_page"] = "每页显示数"; 65 | $message["action"] = "动作"; 66 | $message["limit"] = "条数"; 67 | $message["new_field"] = "新字段"; 68 | 69 | $message["tools"] = "工具"; 70 | $message["manuals"] = "手册"; 71 | $message["logout"] = "退出"; 72 | 73 | /** about **/ 74 | $message["loginandrock"] = "登录"; 75 | $message["about_content"] = 'RockMongo是可视化的MongoDB管理工具. 76 | 77 |

请访问 http://rockmongo.com 获取更多信息.

78 | 79 |

如果有任何问题和反馈,请发送邮件到:iwind.liu@gmail.com .

'; 80 | 81 | ?> -------------------------------------------------------------------------------- /app/langs/zh_tw/message.php: -------------------------------------------------------------------------------- 1 | 7 | * @version 1.0 8 | */ 9 | 10 | $message["TRANSLATION_NAME"] = "繁體中文 - Chinese traditional"; 11 | $message["TRANSLATION_ID"] = 3; 12 | 13 | /** login interface **/ 14 | $message["admin"] = "管理員"; 15 | $message["password"] = "密碼"; 16 | $message["language"] = "語言"; 17 | $message["hour"] = "小時"; 18 | $message["hours"] = "小時"; 19 | $message["month"] = "月"; 20 | $message["alive"] = "有效期"; 21 | 22 | /** connection **/ 23 | $message["can_not_connect"] = "MongoDB連接錯誤: %s. 請檢查配置是否正確."; 24 | 25 | $message["overview"] = "全局"; 26 | $message["server"] = "服務器"; 27 | $message["status"] = "狀態"; 28 | $message["databases"] = "數據庫"; 29 | $message["processlist"] = "進程"; 30 | $message["command"] = "命令"; 31 | $message["execute"] = "代碼執行"; 32 | $message["master_slave"] = "主/從"; 33 | $message["query"] = "查詢"; 34 | $message["refresh"] = "刷新"; 35 | $message["insert"] = "插入"; 36 | $message["clear"] = "清除"; 37 | $message["delete"] = "刪除"; 38 | $message["update"] = "更新"; 39 | $message["duplicate"] = "復制"; 40 | $message["text"] = "文本"; 41 | $message["statistics"] = "統計"; 42 | $message["export"] = "導出"; 43 | $message["import"] = "導入"; 44 | $message["transfer"] = "克隆"; 45 | $message["drop"] = "刪除"; 46 | $message["more"] = "更多"; 47 | $message["rename"] = "更名"; 48 | $message["indexes"] = "索引"; 49 | $message["properties"] = "屬性"; 50 | $message["validate"] = "校驗"; 51 | $message["repair"] = "修復"; 52 | $message["authentication"] = "用戶"; 53 | $message["profile"] = "調試信息"; 54 | $message["create_collection"] = "創建集合"; 55 | $message["create_collection_full"] = "創建集合"; 56 | $message["create_database"] = "創建數據庫"; 57 | $message["save"] = "保存"; 58 | $message["back"] = "返回"; 59 | 60 | 61 | $message["submit_query"] = "查詢"; 62 | $message["explain"] = "分析"; 63 | $message["clear_conditions"] = "清除條件"; 64 | $message["rows_per_page"] = "每頁顯示數"; 65 | $message["action"] = "動作"; 66 | $message["limit"] = "條數"; 67 | $message["new_field"] = "新字段"; 68 | 69 | $message["tools"] = "工具"; 70 | $message["manuals"] = "手冊"; 71 | $message["logout"] = "退出"; 72 | 73 | /** about **/ 74 | $message["loginandrock"] = "登錄"; 75 | $message["about_content"] = 'RockMongo是可視化的MongoDB管理工具. 76 | 77 |

請訪問 http://rockmongo.com 獲取更多信息.

78 | 79 |

如果有任何問題和反饋,請發送郵件到:iwind.liu@gmail.com .

'; 80 | 81 | ?> -------------------------------------------------------------------------------- /themes/default/views/server/index.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
(db.serverCmdLineOpts())
13 |
14 | 15 | 16 | 17 | 18 | 19 | $value):?> 20 | 21 | 22 | 23 | 24 | 25 |
26 |
27 | 28 | 29 | 30 | 31 | 32 | $value):?> 33 | 34 | 35 | 36 | 37 | 38 |
39 |
40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | $value):?> 51 | 52 | 53 | 54 | 55 | 56 | 57 |
58 | 59 |
60 | 61 | 62 | 63 | 64 | 65 | $value):?> 66 | 67 | 68 | 69 | 70 | 71 |
({buildinfo:1})
72 | 73 |
74 | -------------------------------------------------------------------------------- /themes/default/views/server/replication.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | $value):?> 10 | 11 | 12 | 13 | 14 | 15 |
(db.getReplicationInfo())
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | $value):?> 25 | 26 | 27 | 28 | 29 | 30 |
( "local", "collection" => "me" ))); ?>">local.me)
31 | 32 | 33 | 34 |
35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | $value):?> 45 | 46 | 47 | 48 | 49 | 50 | 51 |
( "local", "collection" => "slaves" ))); ?>">local.slaves)
52 | 53 | 54 | 55 |
56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | $value):?> 66 | 67 | 68 | 69 | 70 | 71 | 72 |
( "local", "collection" => "sources" ))); ?>">local.sources)
73 | -------------------------------------------------------------------------------- /themes/default/css/global.css: -------------------------------------------------------------------------------- 1 | * {font-size:12px; font-family:'Courier New', Arial} 2 | html,body {height:100%} 3 | body {margin:0; padding:0;} 4 | a { text-decoration:none; color:#004499; line-height:1.5 } 5 | a:hover {color:blue} 6 | 7 | /** select options **/ 8 | .select_hosts { width:150px; } 9 | 10 | /** common **/ 11 | .clear { clear:both} 12 | .page span a { font-weight:bold; color:red} 13 | blockquote { padding:0px; margin:0; border:1px #ccc solid; background-color:#eee } 14 | .error { padding:0px; margin:10px 0; border:1px #ccc solid; background-color:#eee;color:red } 15 | .message { padding:0px; margin:10px 0; border:1px #ccc solid; background-color:#eee;color:green } 16 | .operation {padding:3px;border-bottom:1px #999 solid;margin-bottom:5px;} 17 | .operation a {font-size:12px;} 18 | .operation a.current { font-weight:bold;text-decoration:underline } 19 | .gap {height:20px} 20 | .big {font-size:14px} 21 | h3 {padding-bottom:0;margin-top:0;padding-bottom:3px;border-bottom:1px #cc9 solid;margin-bottom:7px; font-size:12px } 22 | h3 a {font-size:12px} 23 | ul.list { list-style:none; width:600px; margin:0; padding:0; } 24 | ul.list li {float:left; width:200px;} 25 | img {border:0} 26 | 27 | 28 | /** collection **/ 29 | .query {background-color:#eeefff} 30 | .field_orders p { height:14px; margin-top:0 } 31 | 32 | .menu, #field_menu, .doc_menu { 33 | float:right; 34 | margin-right:100px; 35 | margin-top:0px; 36 | background-color:#eee; 37 | border-left:1px #ccc solid; 38 | border-top:1px #ccc solid; 39 | border-right:2px #ccc solid; 40 | border-bottom:2px #ccc solid; 41 | padding-left:3px; 42 | padding-right:3px; 43 | position:absolute; 44 | display:none; 45 | min-width:100px; 46 | } 47 | 48 | /** leftbar **/ 49 | .leftbar-page { background-color:#eeefff;height:100%; } 50 | .leftbar-page .server-btn { margin-left:20px; } 51 | .leftbar-page .world-btn { margin-left:20px; margin-bottom:3px; } 52 | .leftbar-page .line { margin-bottom:10px; border-bottom:1px #ccc solid; } 53 | .leftbar-page .dbs { margin:0; padding:0; list-style:none; } 54 | .leftbar-page .dbs li { background-color:#eeefff; padding-left:20px; } 55 | .leftbar-page .dbs ul {padding:0;margin:0;list-style:none;} 56 | .leftbar-page .dbs ul li {padding-left:20;border-bottom:0} 57 | .leftbar-page .dbs .collections { } 58 | 59 | /** topbar **/ 60 | .top-page {border-bottom:1px #666 solid; background-color:#ccc; } 61 | .top-page select { height:18px; background-color:#ccc; border:0 } 62 | .top-page .left {float:left} 63 | .top-page .right {float:right} -------------------------------------------------------------------------------- /app/langs/pt_br/message.php: -------------------------------------------------------------------------------- 1 | 7 | * @version 1.1 8 | */ 9 | 10 | $message["TRANSLATION_NAME"] = "Português - Brazilian Portuguese"; 11 | $message["TRANSLATION_ID"] = 5; 12 | 13 | /** Conexão **/ 14 | $message["can_not_connect"] = "Impossível conectar com o MongoDB: %s. Verifique sua configuração"; 15 | 16 | /** Botões e Títulos **/ 17 | $message["server"] = "Servidor"; 18 | $message["status"] = "Status"; 19 | $message["databases"] = "Bancos"; 20 | $message["processlist"] = "Processos"; 21 | $message["command"] = "Comando"; 22 | $message["execute"] = "Executar"; 23 | $message["master_slave"] = "Master/Slave"; 24 | $message["query"] = "Query"; 25 | $message["refresh"] = "Atualizar"; 26 | $message["insert"] = "Inserir"; 27 | $message["clear"] = "Limpar"; 28 | $message["delete"] = "Deletar"; 29 | $message["update"] = "Atualizar"; 30 | $message["duplicate"] = "Duplicar"; 31 | $message["text"] = "Texto"; 32 | $message["statistics"] = "Estatísticas"; 33 | $message["export"] = "Exportar"; 34 | $message["import"] = "Importar"; 35 | $message["transfer"] = "Transferir"; 36 | $message["drop"] = "Deletar"; 37 | $message["more"] = "Mais"; 38 | $message["rename"] = "Renomear"; 39 | $message["indexes"] = "Índices"; 40 | $message["properties"] = "Propriedades"; 41 | $message["validate"] = "Validar"; 42 | $message["repair"] = "Reparar"; 43 | $message["authentication"] = "Autenticação"; 44 | $message["profile"] = "Perfil"; 45 | $message["create_collection"] = "Nova Coleção"; 46 | $message["create_collection_full"] = "Criar nova Coleção"; 47 | $message["create_database"] = "Criar novo Banco"; 48 | $message["save"] = "Salvar"; 49 | $message["back"] = "Voltar"; 50 | 51 | /** Operações de Coleções **/ 52 | $message["submit_query"] = "Enviar Query"; 53 | $message["explain"] = "Explicar"; 54 | $message["clear_conditions"] = "Limpar Condições"; 55 | $message["rows_per_page"] = "Linhas por Página"; 56 | $message["action"] = "Ação"; 57 | $message["limit"] = "Limite"; 58 | 59 | /** Barra do Topo **/ 60 | $message["tools"] = "Ferramentas"; 61 | $message["manuals"] = "Manuais"; 62 | $message["logout"] = "Sair"; 63 | 64 | /** Sobre **/ 65 | $message["about_content"] = 'RockMongo é uma ferramenta de administração para o MongoDB, escrito em PHP 5. 66 | 67 |

Visite http://rockmongo.com para mais detalhes.

68 | 69 |

Se vocêem alguma dúvida, me envie um email: iwind.liu@gmail.com .

'; 70 | 71 | ?> -------------------------------------------------------------------------------- /app/langs/pt_pt/message.php: -------------------------------------------------------------------------------- 1 | 7 | * @version 1.1 8 | */ 9 | 10 | $message["TRANSLATION_NAME"] = "Português - Portugal"; 11 | $message["TRANSLATION_ID"] = 11; 12 | 13 | /** Conexão **/ 14 | $message["can_not_connect"] = "Impossível conectar com o MongoDB: %s. Verifique a configuração"; 15 | 16 | /** Botões e Títulos **/ 17 | $message["server"] = "Servidor"; 18 | $message["status"] = "Estado"; 19 | $message["databases"] = "Base de Dados"; 20 | $message["processlist"] = "Processos"; 21 | $message["command"] = "Comando"; 22 | $message["execute"] = "Executar"; 23 | $message["master_slave"] = "Master/Slave"; 24 | $message["query"] = "Query"; 25 | $message["refresh"] = "Atualizar"; 26 | $message["insert"] = "Inserir"; 27 | $message["clear"] = "Limpar"; 28 | $message["delete"] = "Apagar"; 29 | $message["update"] = "Atualizar"; 30 | $message["duplicate"] = "Duplicar"; 31 | $message["text"] = "Texto"; 32 | $message["statistics"] = "Estatísticas"; 33 | $message["export"] = "Exportar"; 34 | $message["import"] = "Importar"; 35 | $message["transfer"] = "Transferir"; 36 | $message["drop"] = "Apagar"; 37 | $message["more"] = "Mais"; 38 | $message["rename"] = "Renomear"; 39 | $message["indexes"] = "Índices"; 40 | $message["properties"] = "Propriedades"; 41 | $message["validate"] = "Validar"; 42 | $message["repair"] = "Reparar"; 43 | $message["authentication"] = "Autenticação"; 44 | $message["profile"] = "Perfil"; 45 | $message["create_collection"] = "Nova Coleção"; 46 | $message["create_collection_full"] = "Criar nova Coleção"; 47 | $message["create_database"] = "Criar nova Base de Dados"; 48 | $message["save"] = "Salvar"; 49 | $message["back"] = "Voltar"; 50 | 51 | /** Operações de Coleções **/ 52 | $message["submit_query"] = "Enviar Query"; 53 | $message["explain"] = "Explicar"; 54 | $message["clear_conditions"] = "Limpar Condições"; 55 | $message["rows_per_page"] = "Linhas por Página"; 56 | $message["action"] = "Ação"; 57 | $message["limit"] = "Limite"; 58 | 59 | /** Barra do Topo **/ 60 | $message["tools"] = "Ferramentas"; 61 | $message["manuals"] = "Manuais"; 62 | $message["logout"] = "Sair"; 63 | 64 | /** Sobre **/ 65 | $message["about_content"] = 'RockMongo é uma ferramenta de administração para o MongoDB, escrito em PHP 5. 66 | 67 |

Visite http://rockmongo.com para mais detalhes.

68 | 69 |

Se têm alguma dúvida, envie um email para: iwind.liu@gmail.com .

'; 70 | 71 | ?> -------------------------------------------------------------------------------- /app/lib/core/RFilter.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | class RFilter { 10 | private static $_filters = array(); 11 | private static $_dataTypes = array(); 12 | 13 | /** 14 | * Apply filters to data 15 | * 16 | * @param string $dataType Data Type 17 | * @param mixed $data Data to be filtered 18 | * @param array $params parameters will be passed to "filter callback function" 19 | */ 20 | public static function apply($dataType, &$data, array $params = array()) { 21 | if (empty(self::$_filters[$dataType])) { 22 | return; 23 | } 24 | if (isset(self::$_dataTypes[$dataType]["enabled"]) && !self::$_dataTypes[$dataType]["enabled"]) { 25 | return; 26 | } 27 | $newParams = array( &$data ); 28 | foreach ($params as $param) { 29 | $newParams[] = $param; 30 | } 31 | 32 | foreach (rock_array_sort(self::$_filters[$dataType], "priority") as $index => $filter) { 33 | call_user_func_array($filter["callback"], $newParams); 34 | if (isset(self::$_dataTypes[$dataType]["enabled"]) && !self::$_dataTypes[$dataType]["enabled"]) { 35 | return; 36 | } 37 | } 38 | } 39 | 40 | /** 41 | * Add a new filter 42 | * 43 | * @param string $dataType Data type 44 | * @param callback|string $filter Filter function 45 | * @param unknown_type $priority 46 | */ 47 | public static function add($dataType, $filter, $priority = -1) { 48 | if ($priority == -1) { 49 | if (isset(self::$_filters[$dataType])) { 50 | $priority = count(self::$_filters[$dataType]); 51 | } 52 | } 53 | self::$_filters[$dataType][] = array( 54 | "callback" => $filter, 55 | "priority" => $priority 56 | ); 57 | } 58 | 59 | /** 60 | * Stop filter chain 61 | * 62 | * @param string $dataType Data type 63 | */ 64 | public static function stop($dataType) { 65 | self::$_dataTypes[$dataType]["enabled"] = false; 66 | } 67 | 68 | /** 69 | * Remove a filter 70 | * 71 | * @param string $dataType Data type 72 | * @param callback|string $filter Filter function 73 | */ 74 | public static function remove($dataType, $filter) { 75 | if (empty(self::$_filters[$dataType])) { 76 | return; 77 | } 78 | $indexes = array(); 79 | foreach (self::$_filters[$dataType] as $index => $_filter) { 80 | if ($_filter["callback"] == $filter) { 81 | $indexes[] = $index; 82 | } 83 | } 84 | if (!empty($indexes)) { 85 | foreach (array_reverse($indexes) as $index) { 86 | unset(self::$_filters[$dataType][$index]); 87 | } 88 | } 89 | } 90 | } 91 | 92 | ?> -------------------------------------------------------------------------------- /app/controllers/admin.php: -------------------------------------------------------------------------------- 1 | topUrl = $this->path("admin.top"); 9 | $this->leftUrl = $this->path("admin.dbs"); 10 | $this->rightUrl = $this->path("server.index"); 11 | 12 | $this->display(); 13 | } 14 | 15 | /** top frame **/ 16 | public function doTop() { 17 | $this->logoutUrl = $this->path("logout.index"); 18 | $this->admin = $this->_admin->username(); 19 | 20 | $this->servers = $this->_admin->servers(); 21 | $this->serverIndex = $this->_admin->hostIndex(); 22 | 23 | $isMasterRet = null; 24 | try { 25 | $isMasterRet = $this->_mongo->selectDB($this->_admin->defaultDb())->command(array( "isMaster" => 1 )); 26 | if ($isMasterRet["ok"]) { 27 | $this->isMaster = $isMasterRet["ismaster"]; 28 | } 29 | else { 30 | $this->isMaster = true; 31 | } 32 | } catch (MongoCursorException $e) { 33 | $this->isMaster = null; 34 | } 35 | 36 | $this->display(); 37 | } 38 | 39 | /** show dbs in left frame **/ 40 | public function doDbs() { 41 | $dbs = $this->_server->listDbs(); 42 | $this->dbs = array_values(rock_array_sort($dbs["databases"], "name")); 43 | $this->baseUrl = $this->path("admin.dbs"); 44 | $this->tableUrl = $this->path("collection.index"); 45 | $this->showDbSelector = false; 46 | 47 | //add collection count 48 | foreach ($this->dbs as $index => $db) { 49 | $collectionCount = count(MDb::listCollections($this->_mongo->selectDB($db["name"]))); 50 | $db["collectionCount"] = $collectionCount; 51 | if (isset($db["sizeOnDisk"])) { 52 | $db["size"] = round($db["sizeOnDisk"]/1024/1024, 2);//M 53 | } 54 | $this->dbs[$index] = $db; 55 | } 56 | 57 | //current db 58 | $db = x("db"); 59 | 60 | $this->tables = array(); 61 | if ($db) { 62 | $mongodb = $this->_mongo->selectDB($db); 63 | $tables = MDb::listCollections($mongodb); 64 | foreach ($tables as $table) { 65 | $this->tables[$table->getName()] = $table->count(); 66 | } 67 | } 68 | $this->display(); 69 | } 70 | 71 | /** about project and us **/ 72 | public function doAbout() { 73 | $this->display(); 74 | } 75 | 76 | /** change current host **/ 77 | public function doChangeHost() { 78 | $index = xi("index"); 79 | MUser::userInSession()->changeHost($index); 80 | $this->redirect("admin.index", array( "host" => $index )); 81 | } 82 | 83 | /** 84 | * change language of UI interface 85 | * 86 | */ 87 | public function doChangeLang() { 88 | setcookie("ROCK_LANG", x("lang"), time() + 365 * 86400); 89 | header("location:index.php"); 90 | } 91 | } 92 | 93 | 94 | ?> -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | Introduction 2 | -------------------------------------- 3 | RockMongo is a MongoDB administration tool, written in PHP 5, very easy to install and use. 4 | 5 | 6 | Installation 7 | -------------------------------------- 8 | 1. Install PHP runtime environment if you don't have one yet, such like Apache Httpd, Nginx ... 9 | 2. Install MongoDB PHP driver (http://us.php.net/manual/en/mongo.installation.php) 10 | 3. Download the package from http://rockmongo.com/downloads 11 | 4. Unzip the files into your disk, under root of your site 12 | 5. Open the config.php with your convenient editor, change host, port, admins and so on to yours 13 | 6. Visit the index.php in your browser, for example: http://localhost/rockmongo/index.php 14 | 7. Login with admin username and password, which is set "admin" and "admin" as default 15 | 8. Play with your MongoDBs! 16 | 17 | 18 | Upgrade from old version 19 | -------------------------------------- 20 | 1.Copy all files excluding config.php to your old version directory 21 | 2.Done! 22 | 23 | 24 | Contributors 25 | -------------------------------------- 26 | iwind.liu Leader 27 | leblanc.simon French translation 28 | Klaus Silveira Brazilian translation 29 | bmansion Some small changes 30 | Vladimir Razuvaev Implement features. 31 | Anton Zering German translation 32 | Borda Juan Ignacio Panels Layout 33 | Diego Baravalle Spanish Translation 34 | 35 | 36 | Thanks 37 | -------------------------------------- 38 | * Many thanks to led24.de for cute icons. 39 | * Thank Michal Migurski() for perfect Services_JSON class. 40 | * Thank OFC, we borrowed json_format() function to make JSON pretty. 41 | * Thank jQuery, a popular javascript library. 42 | * Thank snipplr.com for mime types mapping. 43 | * Also thank these guys (Marcin, Tyler, Richard, Idan, ...) who spent their time on 44 | sending feedbacks and advices to me, and let me know i am not alone. 45 | * Thank Klaus Silveira for Brazilian translation 46 | * Thank leblanc.simon for French translation 47 | 48 | Bugs & Issues 49 | -------------------------------------- 50 | Please feel free to report any bugs and issues to me, my email is: iwind.liu@gmail.com . 51 | 52 | 53 | Source Code Repository 54 | -------------------------------------- 55 | Repositories are located at 56 | https://github.com/iwind/rockmongo.git 57 | 58 | 59 | Contributing 60 | -------------------------------------- 61 | Somebody who want to contribute to the project, may help us by doing these: 62 | * Translate messages from English to other languages (you can see them in app/langs directory) 63 | * Make donations here: http://rockmongo.com/donation 64 | -------------------------------------------------------------------------------- /themes/default/views/collection/createIndex.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 33 | 34 |

» $db, 37 | "collection" => $collection 38 | ))); 39 | ?>"> »

40 | 41 | 42 |

43 | 44 | 45 |

46 | [Here is official documents] 47 |

48 | 49 |
50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 |
"/>
71 |
-------------------------------------------------------------------------------- /themes/default/views/db/dbTransfer.php: -------------------------------------------------------------------------------- 1 | 6 | 7 |

»

8 | 9 | 10 |

11 | 12 |

13 | 14 | 15 |

16 | 17 |

18 | 21 | 22 | 23 |
24 |
25 |

[]

26 |
    27 | 28 | 29 | 30 | 31 |
  • 32 | 33 | 34 |
35 |
36 |
37 |
38 |
39 |

40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 |
:
:
:
?checked="checked" value="1"/>
:
:
66 |
67 |
68 |
69 |

70 | checked="checked"/> 71 |

72 |
73 |
74 |

75 | "/> 76 |
77 |
-------------------------------------------------------------------------------- /app/models/MCollection.php: -------------------------------------------------------------------------------- 1 | selectCollection($collection)->findOne(); 6 | if (empty($one)) { 7 | return array(); 8 | } 9 | $fields = array(); 10 | self::_fieldsFromRow($fields, $one); 11 | return $fields; 12 | } 13 | 14 | private static function _fieldsFromRow(&$fields, $row, $prefix = null) { 15 | foreach ($row as $field => $value) { 16 | if (is_integer($field) || is_float($field)) { 17 | continue; 18 | } 19 | $namespace = (is_null($prefix)) ? $field : $prefix . "." . $field; 20 | $fields[] = $namespace; 21 | if (is_array($value)) { 22 | self::_fieldsFromRow($fields, $value, $namespace); 23 | } 24 | } 25 | } 26 | 27 | /** 28 | * If a row is GridFS row 29 | * 30 | * @param array $row record data 31 | * @return boolean 32 | */ 33 | public static function isFile(array $row) { 34 | return isset($row["filename"]) && isset($row["chunkSize"]); 35 | } 36 | 37 | /** 38 | * get .chunks collection name from .files collection name 39 | * 40 | * @param string $filesCollection 41 | * @return string 42 | */ 43 | public static function chunksCollection($filesCollection) { 44 | return preg_replace("/\\.files$/", ".chunks", $filesCollection); 45 | } 46 | 47 | /** 48 | * read collection information 49 | * 50 | * @param MongoDB $db database 51 | * @param string $collection collection name 52 | */ 53 | public static function info(MongoDB $db, $collection) { 54 | $ret = $db->command(array( "collStats" => $collection )); 55 | 56 | if (!$ret["ok"]) { 57 | exit("There is something wrong:{$ret['errmsg']}, please refresh the page to try again."); 58 | } 59 | if (!isset($ret["retval"]["options"])) { 60 | $ret["retval"]["options"] = array(); 61 | } 62 | $isCapped = 0; 63 | $size = 0; 64 | $max = 0; 65 | $options = $ret["retval"]["options"]; 66 | if (isset($options["capped"])) { 67 | $isCapped = $options["capped"]; 68 | } 69 | if (isset($options["size"])) { 70 | $size = $options["size"]; 71 | } 72 | if (isset($options["max"])) { 73 | $max = $options["max"]; 74 | } 75 | return array( "capped" => $isCapped, "size" => $size, "max" => $max ); 76 | } 77 | 78 | /** 79 | * Create collection 80 | * 81 | * @param MongoDB $db MongoDB 82 | * @param string $name Collection name 83 | * @param array $options Options, capped, size, max 84 | */ 85 | public static function createCollection(MongoDB $db, $name, array $options) { 86 | if (RMongo::compareVersion("1.4.0") >= 0) { 87 | $db->createCollection($name, $options); 88 | } 89 | else { 90 | $db->createCollection($name, isset($options["capped"]) ? $options["capped"] : false, isset($options["size"]) ? $options["size"] : 0, isset($options["max"]) ? $options["max"] : 0); 91 | } 92 | } 93 | } 94 | 95 | ?> -------------------------------------------------------------------------------- /themes/default/views/login/index.php: -------------------------------------------------------------------------------- 1 | 32 | 33 |
34 |

35 |
36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 71 | 72 | 73 | 74 | 81 | 82 | 83 | 84 | 85 | 86 |
Log-in:
Host
:
:
Non-Admin users:
DB Name(s):
More »
"/>
87 |
88 | 89 | 90 |
-------------------------------------------------------------------------------- /themes/default/views/collection/create2dIndex.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 33 | 34 |

» $db, 37 | "collection" => $collection 38 | ))); 39 | ?>"> »

40 | 41 | 42 |

43 | 44 | 45 |

46 | [Here is official documents] 47 |

48 | 49 |
50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 |
* : -180
* : 180
* : 26
"/>
79 |
-------------------------------------------------------------------------------- /app/models/MUser.php: -------------------------------------------------------------------------------- 1 | _username = $username; 16 | } 17 | 18 | public function username() { 19 | return $this->_username; 20 | } 21 | 22 | public function setPassword($password) { 23 | $this->_password = $password; 24 | } 25 | 26 | public function password() { 27 | return $this->_password; 28 | } 29 | 30 | public function setHostIndex($hostIndex) { 31 | $this->_hostIndex = $hostIndex; 32 | } 33 | 34 | public function hostIndex() { 35 | return $this->_hostIndex; 36 | } 37 | 38 | public function setDb($db) { 39 | $this->_db = $db; 40 | } 41 | 42 | public function defaultDb() { 43 | $dbs = $this->dbs(); 44 | return $dbs[0]; 45 | } 46 | 47 | public function dbs() { 48 | if (empty($this->_db)) { 49 | import("@.MServer"); 50 | $server = MServer::serverWithIndex($this->_hostIndex); 51 | $mongoDb = "admin"; 52 | if (!$server->mongoAuth()) { 53 | $authDb = MServer::serverWithIndex($this->_hostIndex)->mongoDb(); 54 | if ($authDb) { 55 | $mongoDb = $authDb; 56 | } 57 | } 58 | return array($mongoDb); 59 | } 60 | if (is_array($this->_db)) { 61 | return array_values($this->_db); 62 | } 63 | return preg_split("/\\s*,\\s*/", $this->_db); 64 | } 65 | 66 | public function setTimeout($timeout) { 67 | $this->_timeout = $timeout; 68 | } 69 | 70 | /** 71 | * Validate User 72 | * 73 | * @return boolean 74 | */ 75 | public function validate() { 76 | import("@.MServer"); 77 | $server = MServer::serverWithIndex($this->_hostIndex); 78 | if (empty($server)) { 79 | return false; 80 | } 81 | return $server->auth($this->_username, $this->_password, $this->_db); 82 | } 83 | 84 | public function servers() { 85 | global $MONGO; 86 | return $MONGO["servers"]; 87 | } 88 | 89 | public function changeHost($hostIndex) { 90 | $_SESSION["login"]["index"] = $hostIndex; 91 | } 92 | 93 | public static function login($username, $password, $hostIndex, $db, $timeout) { 94 | $_SESSION["login"] = array( 95 | "username" => $username, 96 | "password" => $password, 97 | "index" => $hostIndex, 98 | "db" => $db 99 | ); 100 | setcookie(session_name(), session_id(), time() + $timeout); 101 | } 102 | 103 | /** 104 | * Enter description here ... 105 | * 106 | * @return MUser 107 | */ 108 | public static function userInSession() { 109 | if (array_key_exists("login", $_SESSION) 110 | && array_key_exists("username", $_SESSION["login"]) 111 | && array_key_exists("password", $_SESSION["login"]) 112 | && array_key_exists("index", $_SESSION["login"]) 113 | && array_key_exists("db", $_SESSION["login"])) { 114 | 115 | $user = new MUser(); 116 | $user->setUsername($_SESSION["login"]["username"]); 117 | $user->setPassword($_SESSION["login"]["password"]); 118 | $user->setHostIndex($_SESSION["login"]["index"]); 119 | $user->setDb($_SESSION["login"]["db"]); 120 | return $user; 121 | } 122 | return null; 123 | } 124 | } 125 | 126 | ?> -------------------------------------------------------------------------------- /themes/default/css/layout-default-1.3.0.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Default Layout Theme 3 | * 4 | * Created for jquery.layout 5 | * 6 | * Copyright (c) 2010 7 | * Fabrizio Balliano (http://www.fabrizioballiano.net) 8 | * Kevin Dalman (http://allpro.net) 9 | * 10 | * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) 11 | * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. 12 | * 13 | * Last Updated: 2010-02-10 14 | * NOTE: For best code readability, view this with a fixed-space font and tabs equal to 4-chars 15 | */ 16 | 17 | /* 18 | * DEFAULT FONT 19 | * Just to make demo-pages look better - not actually relevant to Layout! 20 | */ 21 | body { 22 | font-family: Geneva, Arial, Helvetica, sans-serif; 23 | font-size: 100%; 24 | *font-size: 80%; 25 | } 26 | 27 | /* 28 | * PANES & CONTENT-DIVs 29 | */ 30 | .ui-layout-pane { /* all 'panes' */ 31 | background: #FFF; 32 | border: 1px solid #BBB; 33 | /* DO NOT add scrolling (or padding) to 'panes' that have a content-div, 34 | otherwise you may get double-scrollbars - on the pane AND on the content-div 35 | */ 36 | padding: 0px; 37 | overflow: auto; 38 | } 39 | /* (scrolling) content-div inside pane allows for fixed header(s) and/or footer(s) */ 40 | .ui-layout-content { 41 | padding: 10px; 42 | position: relative; /* contain floated or positioned elements */ 43 | overflow: auto; /* add scrolling to content-div */ 44 | } 45 | 46 | /* 47 | * RESIZER-BARS 48 | */ 49 | .ui-layout-resizer { /* all 'resizer-bars' */ 50 | background: #DDD; 51 | border: 1px solid #BBB; 52 | border-width: 0; 53 | } 54 | .ui-layout-resizer-drag { /* REAL resizer while resize in progress */ 55 | } 56 | .ui-layout-resizer-hover { /* affects both open and closed states */ 57 | } 58 | /* NOTE: It looks best when 'hover' and 'dragging' are set to the same color, 59 | otherwise color shifts while dragging when bar can't keep up with mouse */ 60 | .ui-layout-resizer-open-hover , /* hover-color to 'resize' */ 61 | .ui-layout-resizer-dragging { /* resizer beging 'dragging' */ 62 | background: #C4E1A4; 63 | } 64 | .ui-layout-resizer-dragging { /* CLONED resizer being dragged */ 65 | border-left: 1px solid #BBB; 66 | border-right: 1px solid #BBB; 67 | } 68 | /* NOTE: Add a 'dragging-limit' color to provide visual feedback when resizer hits min/max size limits */ 69 | .ui-layout-resizer-dragging-limit { /* CLONED resizer at min or max size-limit */ 70 | background: #E1A4A4; /* red */ 71 | } 72 | 73 | .ui-layout-resizer-closed-hover { /* hover-color to 'slide open' */ 74 | background: #EBD5AA; 75 | } 76 | .ui-layout-resizer-sliding { /* resizer when pane is 'slid open' */ 77 | opacity: .10; /* show only a slight shadow */ 78 | filter: alpha(opacity=10); 79 | } 80 | .ui-layout-resizer-sliding-hover { /* sliding resizer - hover */ 81 | opacity: 1.00; /* on-hover, show the resizer-bar normally */ 82 | filter: alpha(opacity=100); 83 | } 84 | /* sliding resizer - add 'outside-border' to resizer on-hover 85 | * this sample illustrates how to target specific panes and states */ 86 | .ui-layout-resizer-north-sliding-hover { border-bottom-width: 1px; } 87 | .ui-layout-resizer-south-sliding-hover { border-top-width: 1px; } 88 | .ui-layout-resizer-west-sliding-hover { border-right-width: 1px; } 89 | .ui-layout-resizer-east-sliding-hover { border-left-width: 1px; } 90 | 91 | /* 92 | * TOGGLER-BUTTONS 93 | */ 94 | .ui-layout-toggler { 95 | border: 1px solid #BBB; /* match pane-border */ 96 | background-color: #BBB; 97 | } 98 | .ui-layout-resizer-hover .ui-layout-toggler { 99 | opacity: .60; 100 | filter: alpha(opacity=60); 101 | } 102 | .ui-layout-toggler-hover , /* need when NOT resizable */ 103 | .ui-layout-resizer-hover .ui-layout-toggler-hover { /* need specificity when IS resizable */ 104 | background-color: #FC6; 105 | opacity: 1.00; 106 | filter: alpha(opacity=100); 107 | } 108 | .ui-layout-toggler-north , 109 | .ui-layout-toggler-south { 110 | border-width: 0 1px; /* left/right borders */ 111 | } 112 | .ui-layout-toggler-west , 113 | .ui-layout-toggler-east { 114 | border-width: 1px 0; /* top/bottom borders */ 115 | } 116 | /* hide the toggler-button when the pane is 'slid open' */ 117 | .ui-layout-resizer-sliding ui-layout-toggler { 118 | display: none; 119 | } 120 | /* 121 | * style the text we put INSIDE the togglers 122 | */ 123 | .ui-layout-toggler .content { 124 | color: #666; 125 | font-size: 12px; 126 | font-weight: bold; 127 | width: 100%; 128 | padding-bottom: 0.35ex; /* to 'vertically center' text inside text-span */ 129 | } 130 | 131 | -------------------------------------------------------------------------------- /app/lib/core/RPlugin.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | class RPlugin { 10 | private static $_plugins = array(); 11 | private static $_loaded = false; 12 | 13 | public function onBefore() { 14 | 15 | } 16 | 17 | public function onAfter() { 18 | 19 | } 20 | 21 | /** 22 | * Read plugin help 23 | * 24 | */ 25 | public function help() { 26 | return array( 27 | "name" => "Default Plugin", 28 | "author" => "rock", 29 | "version" => "1.0" 30 | ); 31 | } 32 | 33 | /** 34 | * Register a plugin 35 | * 36 | * @param string $pluginClass plugin class name 37 | * @param integer $priority priority 38 | * @throws Exception 39 | */ 40 | public static function register($pluginClass, $priority = -1) { 41 | if ($priority == -1) { 42 | $priority = count(self::$_plugins); 43 | } 44 | if (!is_subclass_of($pluginClass, "RPlugin")) { 45 | throw new Exception("plugin class '{$pluginClass}' must be inherited from RPlugin"); 46 | } 47 | self::$_plugins[] = array( "obj" => new $pluginClass, "priority" => $priority ); 48 | } 49 | 50 | /** 51 | * Call onBefore() method in plugin 52 | * 53 | */ 54 | public static function callBefore() { 55 | $plugins = rock_array_sort(self::$_plugins, "priority"); 56 | foreach ($plugins as $plugin) { 57 | $plugin["obj"]->onBefore(); 58 | } 59 | } 60 | 61 | /** 62 | * Call onAfter() method in plugin 63 | * 64 | */ 65 | public static function callAfter() { 66 | $plugins = rock_array_sort(self::$_plugins, "priority", false); 67 | foreach ($plugins as $plugin) { 68 | $plugin["obj"]->onAfter(); 69 | } 70 | } 71 | 72 | /** 73 | * Load all of plugins 74 | * 75 | * You should put all plugins to app/plugins: 76 | * $ROCK-MONGO 77 | * apps/ 78 | * plugins/ 79 | * mapreduce/ 80 | * ace/ 81 | * systemjs/ 82 | * other plugins ... 83 | * 84 | * But we also support another deploy way: 85 | * $ROCK-MONGO 86 | * apps/ 87 | * plugins/ 88 | * csv/ 89 | * sharding/ 90 | * other plugins ... 91 | */ 92 | public static function load() { 93 | if (self::$_loaded) { 94 | return; 95 | } 96 | $plugins = array(); 97 | require(__ROOT__ . DS . "configs" . DS . "rplugin.php"); 98 | if (empty($plugins) || !is_array($plugins)) { 99 | return; 100 | } 101 | foreach ($plugins as $name => $plugin) { 102 | if ($plugin["enabled"]) { 103 | $dir = __ROOT__ . DS . "plugins" . DS . $name; 104 | if (!is_dir($dir)) { 105 | $dir = dirname(dirname(__ROOT__)) . DS . "plugins" . DS . $name; 106 | } 107 | $initFile = $dir . DS . "init.php"; 108 | if (is_file($initFile)) { 109 | require $dir . DS . "init.php"; 110 | } 111 | else { 112 | trigger_error("could not find initialize file '{$initFile}' for plugin '{$name}', you can disable it in app/configs/rplugin.php"); 113 | } 114 | } 115 | } 116 | 117 | self::$_loaded = true; 118 | } 119 | 120 | /** 121 | * Get all plugins 122 | * 123 | * @return array 124 | * @since 1.1.6 125 | */ 126 | public static function plugins() { 127 | $configPlugins = array(); 128 | $plugins = array(); 129 | require(__ROOT__ . DS . "configs" . DS . "rplugin.php"); 130 | if (empty($plugins) || !is_array($plugins)) { 131 | return $configPlugins; 132 | } 133 | foreach ($plugins as $name => $plugin) { 134 | $dir = __ROOT__ . DS . "plugins" . DS . $name; 135 | if (!is_dir($dir)) { 136 | $dir = dirname(dirname(__ROOT__)) . DS . "plugins" . DS . $name; 137 | } 138 | $pluginConfig = array( 139 | "name" => null, 140 | "dir" => $name, 141 | "code" => null, 142 | "author" => null, 143 | "description" => null, 144 | "version" => null, 145 | "url" => null, 146 | "enabled" => isset($plugin["enabled"]) ? $plugin["enabled"] : false 147 | ); 148 | 149 | $descFile = $dir . "/desc.php"; 150 | if (is_file($descFile)) { 151 | $config = require($descFile); 152 | if (isset($config["name"])) { 153 | $pluginConfig["name"] = $config["name"]; 154 | } 155 | if (isset($config["code"])) { 156 | $pluginConfig["code"] = $config["code"]; 157 | } 158 | if (isset($config["author"])) { 159 | $pluginConfig["author"] = $config["author"]; 160 | } 161 | if (isset($config["description"])) { 162 | $pluginConfig["description"] = $config["description"]; 163 | } 164 | if (isset($config["version"])) { 165 | $pluginConfig["version"] = $config["version"]; 166 | } 167 | if (isset($config["url"])) { 168 | $pluginConfig["url"] = $config["url"]; 169 | } 170 | } 171 | 172 | $configPlugins[] = $pluginConfig; 173 | } 174 | 175 | return $configPlugins; 176 | } 177 | } 178 | 179 | ?> -------------------------------------------------------------------------------- /themes/default/views/admin/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | RockMongo 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 34 | 82 | 83 | 84 | 85 | 86 |
87 | 88 |
89 |
90 | 91 | 92 |
93 | 94 |
95 | 96 | 97 |
98 | 99 | 100 |
101 | 102 |
103 | 104 | 105 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /app/classes/VarEval.php: -------------------------------------------------------------------------------- 1 | _source = $source; 30 | 31 | $this->_format = $format; 32 | if (!$this->_format) { 33 | $this->_format = "array"; 34 | } 35 | 36 | $this->_db = $db; 37 | } 38 | 39 | /** 40 | * execute the code 41 | * 42 | * @return mixed 43 | */ 44 | function execute() { 45 | if ($this->_format == "array") { 46 | return $this->_runPHP(); 47 | } 48 | else if ($this->_format == "json") { 49 | return $this->_runJson(); 50 | } 51 | } 52 | 53 | private function _runPHP() { 54 | $this->_source = "return " . $this->_source . ";"; 55 | if (function_exists("token_get_all")) {//tokenizer extension may be disabled 56 | $php = "_source . "\n?>"; 57 | $tokens = token_get_all($php); 58 | foreach ($tokens as $token) { 59 | $type = $token[0]; 60 | if (is_long($type)) { 61 | if (in_array($type, array( 62 | T_OPEN_TAG, 63 | T_RETURN, 64 | T_WHITESPACE, 65 | T_ARRAY, 66 | T_LNUMBER, 67 | T_DNUMBER, 68 | T_CONSTANT_ENCAPSED_STRING, 69 | T_DOUBLE_ARROW, 70 | T_CLOSE_TAG, 71 | T_NEW, 72 | T_DOUBLE_COLON 73 | ))) { 74 | continue; 75 | } 76 | 77 | if ($type == T_STRING) { 78 | $func = strtolower($token[1]); 79 | if (in_array($func, array( 80 | //keywords allowed 81 | "mongoid", 82 | "mongocode", 83 | "mongodate", 84 | "mongoregex", 85 | "mongobindata", 86 | "mongoint32", 87 | "mongoint64", 88 | "mongodbref", 89 | "mongominkey", 90 | "mongomaxkey", 91 | "mongotimestamp", 92 | "true", 93 | "false", 94 | "null", 95 | "__set_state", 96 | "stdclass" 97 | ))) { 98 | continue; 99 | } 100 | } 101 | exit("For your security, we stoped data parsing at '(" . token_name($type) . ") " . $token[1] . "'."); 102 | } 103 | } 104 | } 105 | return eval($this->_source); 106 | } 107 | 108 | private function _runJson() { 109 | $timezone = @date_default_timezone_get(); 110 | date_default_timezone_set("UTC"); 111 | $ret = $this->_db->execute('function () { 112 | if (typeof(ISODate) == "undefined") { 113 | function ISODate (isoDateStr) { 114 | if (!isoDateStr) { 115 | return new Date; 116 | } 117 | var isoDateRegex = /(\d{4})-?(\d{2})-?(\d{2})([T ](\d{2})(:?(\d{2})(:?(\d{2}(\.\d+)?))?)?(Z|([+-])(\d{2}):?(\d{2})?)?)?/; 118 | var res = isoDateRegex.exec(isoDateStr); 119 | if (!res) { 120 | throw "invalid ISO date"; 121 | } 122 | var year = parseInt(res[1], 10) || 1970; 123 | var month = (parseInt(res[2], 10) || 1) - 1; 124 | var date = parseInt(res[3], 10) || 0; 125 | var hour = parseInt(res[5], 10) || 0; 126 | var min = parseInt(res[7], 10) || 0; 127 | var sec = parseFloat(res[9]) || 0; 128 | var ms = Math.round(sec % 1 * 1000); 129 | sec -= ms / 1000; 130 | var time = Date.UTC(year, month, date, hour, min, sec, ms); 131 | if (res[11] && res[11] != "Z") { 132 | var ofs = 0; 133 | ofs += (parseInt(res[13], 10) || 0) * 60 * 60 * 1000; 134 | ofs += (parseInt(res[14], 10) || 0) * 60 * 1000; 135 | if (res[12] == "+") { 136 | ofs *= -1; 137 | } 138 | time += ofs; 139 | } 140 | return new Date(time); 141 | }; 142 | }; 143 | 144 | function r_util_convert_empty_object_to_string(obj) { 145 | if (r_util_is_empty(obj)) { 146 | return "__EMPTYOBJECT__"; 147 | } 148 | if (typeof(obj) == "object") { 149 | for (var k in obj) { 150 | obj[k] = r_util_convert_empty_object_to_string(obj[k]); 151 | } 152 | } 153 | return obj; 154 | }; 155 | 156 | function r_util_is_empty(obj) { 157 | if (obj == null || typeof(obj) != "object" || (obj.constructor != Object)) { 158 | return false; 159 | } 160 | for(var k in obj) { 161 | if(obj.hasOwnProperty(k)) { 162 | return false; 163 | } 164 | } 165 | 166 | return true; 167 | }; 168 | var o = ' . $this->_source . '; return r_util_convert_empty_object_to_string(o); }' 169 | ); 170 | 171 | $this->_fixEmptyObject($ret); 172 | date_default_timezone_set($timezone); 173 | if ($ret["ok"]) { 174 | return $ret["retval"]; 175 | } 176 | return json_decode($this->_source, true); 177 | } 178 | 179 | private function _fixEmptyObject(&$object) { 180 | if (is_array($object)) { 181 | foreach ($object as &$v) { 182 | $this->_fixEmptyObject($v); 183 | } 184 | } 185 | else if (is_string($object) && $object === "__EMPTYOBJECT__") { 186 | $object = new stdClass(); 187 | } 188 | } 189 | } 190 | 191 | ?> -------------------------------------------------------------------------------- /themes/default/views/admin/dbs.php: -------------------------------------------------------------------------------- 1 | 95 | 96 |
97 | 98 | 99 |
100 | 131 |
132 |
133 | -------------------------------------------------------------------------------- /app/funcs/rock.php: -------------------------------------------------------------------------------- 1 | $row) { 18 | if (is_array($row)) { 19 | $value = rock_array_get($row, $key); 20 | if ($keepIndex) { 21 | $ret[$index] = $value; 22 | } 23 | else { 24 | $ret[] = $value; 25 | } 26 | } 27 | } 28 | return $ret; 29 | } 30 | 31 | /** 32 | * sort multiple-array by key 33 | * 34 | * @param array $array array to sort 35 | * @param mixed $key string|array 36 | * @param boolean $asc if asc 37 | * @return array 38 | */ 39 | function rock_array_sort(array $array, $key = null, $asc = true) { 40 | if (empty($array)) { 41 | return $array; 42 | } 43 | if (empty($key)) { 44 | $asc ? asort($array) : arsort($array); 45 | } 46 | else { 47 | $GLOBALS["ROCK_ARRAY_SORT_KEY_" . nil] = $key; 48 | uasort($array, 49 | $asc ? create_function('$p1,$p2', '$key=$GLOBALS["ROCK_ARRAY_SORT_KEY_" . nil];$p1=rock_array_get($p1,$key);$p2=rock_array_get($p2,$key);if ($p1>$p2){return 1;}elseif($p1==$p2){return 0;}else{return -1;}') 50 | : 51 | create_function('$p1,$p2', '$key=$GLOBALS["rock_ARRAY_SORT_KEY_" . nil];$p1=rock_array_get($p1,$key);$p2=rock_array_get($p2,$key);if ($p1<$p2){return 1;}elseif($p1==$p2){return 0;}else{return -1;}') 52 | ); 53 | unset($GLOBALS["ROCK_ARRAY_SORT_KEY_" . nil]); 54 | } 55 | return $array; 56 | } 57 | 58 | /** 59 | * read cookie 60 | * 61 | * @param string $name Cookie Name 62 | * @param mixed $default default value 63 | * @return mixed 64 | */ 65 | function rock_cookie($name, $default = null) { 66 | return isset($_COOKIE[$name]) ? $_COOKIE[$name] : $default; 67 | } 68 | 69 | /** 70 | * Construct a real ID from a mixed ID 71 | * 72 | * @param mixed $id id in mixed type 73 | */ 74 | function rock_real_id($id) { 75 | if (is_object($id)) { 76 | return $id; 77 | } 78 | if (preg_match("/^rid_(\\w+):(.+)$/", $id, $match)) { 79 | $type = $match[1]; 80 | $value = $match[2]; 81 | switch ($type) { 82 | case "string": 83 | return $value; 84 | case "float": 85 | return floatval($value); 86 | case "double": 87 | return doubleval($value); 88 | case "boolean": 89 | return (bool)$value; 90 | case "integer": 91 | return intval($value); 92 | case "long": 93 | return doubleval($value); 94 | case "object": 95 | return new MongoId($value); 96 | case "MongoInt32": 97 | return new MongoInt32($value); 98 | case "MongoInt64": 99 | return new MongoInt64($value); 100 | case "mixed": 101 | $eval = new VarEval(base64_decode($value)); 102 | $realId = $eval->execute(); 103 | return $realId; 104 | } 105 | return; 106 | } 107 | 108 | if (is_numeric($id)) { 109 | return floatval($id); 110 | } 111 | if (preg_match("/^[0-9a-z]{24}$/i", $id)) { 112 | return new MongoId($id); 113 | } 114 | return $id; 115 | } 116 | 117 | /** 118 | * Format ID to string 119 | * 120 | * @param mixed $id object ID 121 | */ 122 | function rock_id_string($id) { 123 | if (is_object($id) && $id instanceof MongoId) { 124 | return "rid_object:" . $id->__toString(); 125 | } 126 | if (is_object($id)) { 127 | return "rid_" . get_class($id) . ":" . $id->__toString(); 128 | } 129 | if (is_scalar($id)) { 130 | return "rid_" . gettype($id) . ":" . $id; 131 | } 132 | return "rid_mixed:" . base64_encode(var_export($id, true)); 133 | } 134 | 135 | /** 136 | * Output a variable 137 | * 138 | * @param mixed $var a variable 139 | */ 140 | function h($var) { 141 | if (is_array($var)) { 142 | echo json_encode($var); 143 | return; 144 | } 145 | if (is_null($var)) { 146 | echo "NULL"; 147 | return; 148 | } 149 | if (is_bool($var)) { 150 | echo $var ? "TRUE":"FALSE"; 151 | return; 152 | } 153 | echo $var; 154 | } 155 | /** 156 | * Output a variable escaped 157 | * 158 | * @param mixed $var a variable 159 | */ 160 | function h_escape($var) { 161 | if (is_array($var)) { 162 | echo htmlspecialchars(json_encode($var)); 163 | return; 164 | } 165 | if (is_null($var)) { 166 | echo ""; 167 | return; 168 | } 169 | if (is_bool($var)) { 170 | echo $var; 171 | return; 172 | } 173 | echo htmlspecialchars($var); 174 | } 175 | 176 | /** 177 | * Output a I18N message 178 | * 179 | * @param string $var message key 180 | */ 181 | function hm($var) { 182 | echo rock_lang($var); 183 | } 184 | 185 | /** 186 | * Load all lanugages 187 | * 188 | * @return array 189 | */ 190 | function rock_load_languages() { 191 | $dir = __ROOT__ . DS . "langs"; 192 | $handler = opendir($dir); 193 | $languages = array(); 194 | while(($file = readdir($handler)) !== false) { 195 | $langDir = $dir . DS . $file; 196 | if (is_dir($langDir) && preg_match("/^\\w+_\\w+$/", $file)) { 197 | $message = array( 198 | "TRANSLATION_NAME" => "" 199 | ); 200 | require $langDir . DS . "message.php"; 201 | $languages[$file] = array( "code" => $file, "name" => $message["TRANSLATION_NAME"], "id" => $message["TRANSLATION_ID"]); 202 | } 203 | } 204 | closedir($handler); 205 | $languages = rock_array_sort($languages, "id"); 206 | return rock_array_combine($languages, "code", "name"); 207 | } 208 | 209 | /** 210 | * Get current path of theme 211 | * 212 | * @return string 213 | * @since 1.1.0 214 | */ 215 | function rock_theme_path() { 216 | global $MONGO; 217 | if (isset($MONGO["features"]["theme"])) { 218 | return "themes/" . $MONGO["features"]["theme"]; 219 | } 220 | else { 221 | return "themes/default"; 222 | } 223 | } 224 | 225 | /** 226 | * Get real value from one string 227 | * 228 | * @param MongoDB $mongodb current mongodb 229 | * @param integer $dataType data type 230 | * @param string $format data format 231 | * @param string $value value in string format 232 | * @return mixed 233 | * @throws Exception 234 | * @since 1.1.0 235 | */ 236 | function rock_real_value($mongodb, $dataType, $format, $value) { 237 | $realValue = null; 238 | switch ($dataType) { 239 | case "integer": 240 | case "float": 241 | case "double": 242 | $realValue = doubleval($value); 243 | break; 244 | case "string": 245 | $realValue = $value; 246 | break; 247 | case "boolean": 248 | $realValue = ($value == "true"); 249 | break; 250 | case "null": 251 | $realValue = NULL; 252 | break; 253 | case "mixed": 254 | $eval = new VarEval($value, $format, $mongodb); 255 | $realValue = $eval->execute(); 256 | if ($realValue === false) { 257 | throw new Exception("Unable to parse mixed value, just check syntax!"); 258 | } 259 | break; 260 | } 261 | return $realValue; 262 | } 263 | 264 | ?> -------------------------------------------------------------------------------- /app/lib/mime/types.php: -------------------------------------------------------------------------------- 1 | "text/h323", 4 | "acx" => "application/internet-property-stream", 5 | "ai" => "application/postscript", 6 | "aif" => "audio/x-aiff", 7 | "aifc" => "audio/x-aiff", 8 | "aiff" => "audio/x-aiff", 9 | "asf" => "video/x-ms-asf", 10 | "asr" => "video/x-ms-asf", 11 | "asx" => "video/x-ms-asf", 12 | "au" => "audio/basic", 13 | "avi" => "video/x-msvideo", 14 | "axs" => "application/olescript", 15 | "bas" => "text/plain", 16 | "bcpio" => "application/x-bcpio", 17 | "bin" => "application/octet-stream", 18 | "bmp" => "image/bmp", 19 | "c" => "text/plain", 20 | "cat" => "application/vnd.ms-pkiseccat", 21 | "cdf" => "application/x-cdf", 22 | "cer" => "application/x-x509-ca-cert", 23 | "class" => "application/octet-stream", 24 | "clp" => "application/x-msclip", 25 | "cmx" => "image/x-cmx", 26 | "cod" => "image/cis-cod", 27 | "cpio" => "application/x-cpio", 28 | "crd" => "application/x-mscardfile", 29 | "crl" => "application/pkix-crl", 30 | "crt" => "application/x-x509-ca-cert", 31 | "csh" => "application/x-csh", 32 | "css" => "text/css", 33 | "dcr" => "application/x-director", 34 | "der" => "application/x-x509-ca-cert", 35 | "dir" => "application/x-director", 36 | "dll" => "application/x-msdownload", 37 | "dms" => "application/octet-stream", 38 | "doc" => "application/msword", 39 | "dot" => "application/msword", 40 | "dvi" => "application/x-dvi", 41 | "dxr" => "application/x-director", 42 | "eps" => "application/postscript", 43 | "etx" => "text/x-setext", 44 | "evy" => "application/envoy", 45 | "exe" => "application/octet-stream", 46 | "fif" => "application/fractals", 47 | "flr" => "x-world/x-vrml", 48 | "gif" => "image/gif", 49 | "gtar" => "application/x-gtar", 50 | "gz" => "application/x-gzip", 51 | "h" => "text/plain", 52 | "hdf" => "application/x-hdf", 53 | "hlp" => "application/winhlp", 54 | "hqx" => "application/mac-binhex40", 55 | "hta" => "application/hta", 56 | "htc" => "text/x-component", 57 | "htm" => "text/html", 58 | "html" => "text/html", 59 | "htt" => "text/webviewhtml", 60 | "ico" => "image/x-icon", 61 | "ief" => "image/ief", 62 | "iii" => "application/x-iphone", 63 | "ins" => "application/x-internet-signup", 64 | "isp" => "application/x-internet-signup", 65 | "jfif" => "image/pipeg", 66 | "jpe" => "image/jpeg", 67 | "jpeg" => "image/jpeg", 68 | "jpg" => "image/jpeg", 69 | "js" => "application/x-javascript", 70 | "latex" => "application/x-latex", 71 | "lha" => "application/octet-stream", 72 | "lsf" => "video/x-la-asf", 73 | "lsx" => "video/x-la-asf", 74 | "lzh" => "application/octet-stream", 75 | "m13" => "application/x-msmediaview", 76 | "m14" => "application/x-msmediaview", 77 | "m3u" => "audio/x-mpegurl", 78 | "man" => "application/x-troff-man", 79 | "mdb" => "application/x-msaccess", 80 | "me" => "application/x-troff-me", 81 | "mht" => "message/rfc822", 82 | "mhtml" => "message/rfc822", 83 | "mid" => "audio/mid", 84 | "mny" => "application/x-msmoney", 85 | "mov" => "video/quicktime", 86 | "movie" => "video/x-sgi-movie", 87 | "mp2" => "video/mpeg", 88 | "mp3" => "audio/mpeg", 89 | "mpa" => "video/mpeg", 90 | "mpe" => "video/mpeg", 91 | "mpeg" => "video/mpeg", 92 | "mpg" => "video/mpeg", 93 | "mpp" => "application/vnd.ms-project", 94 | "mpv2" => "video/mpeg", 95 | "ms" => "application/x-troff-ms", 96 | "mvb" => "application/x-msmediaview", 97 | "nws" => "message/rfc822", 98 | "oda" => "application/oda", 99 | "p10" => "application/pkcs10", 100 | "p12" => "application/x-pkcs12", 101 | "p7b" => "application/x-pkcs7-certificates", 102 | "p7c" => "application/x-pkcs7-mime", 103 | "p7m" => "application/x-pkcs7-mime", 104 | "p7r" => "application/x-pkcs7-certreqresp", 105 | "p7s" => "application/x-pkcs7-signature", 106 | "pbm" => "image/x-portable-bitmap", 107 | "pdf" => "application/pdf", 108 | "pfx" => "application/x-pkcs12", 109 | "pgm" => "image/x-portable-graymap", 110 | "pko" => "application/ynd.ms-pkipko", 111 | "pma" => "application/x-perfmon", 112 | "pmc" => "application/x-perfmon", 113 | "pml" => "application/x-perfmon", 114 | "pmr" => "application/x-perfmon", 115 | "pmw" => "application/x-perfmon", 116 | "pnm" => "image/x-portable-anymap", 117 | "pot" => "application/vnd.ms-powerpoint", 118 | "ppm" => "image/x-portable-pixmap", 119 | "pps" => "application/vnd.ms-powerpoint", 120 | "ppt" => "application/vnd.ms-powerpoint", 121 | "prf" => "application/pics-rules", 122 | "ps" => "application/postscript", 123 | "pub" => "application/x-mspublisher", 124 | "qt" => "video/quicktime", 125 | "ra" => "audio/x-pn-realaudio", 126 | "ram" => "audio/x-pn-realaudio", 127 | "ras" => "image/x-cmu-raster", 128 | "rgb" => "image/x-rgb", 129 | "rmi" => "audio/mid", 130 | "roff" => "application/x-troff", 131 | "rtf" => "application/rtf", 132 | "rtx" => "text/richtext", 133 | "scd" => "application/x-msschedule", 134 | "sct" => "text/scriptlet", 135 | "setpay" => "application/set-payment-initiation", 136 | "setreg" => "application/set-registration-initiation", 137 | "sh" => "application/x-sh", 138 | "shar" => "application/x-shar", 139 | "sit" => "application/x-stuffit", 140 | "snd" => "audio/basic", 141 | "spc" => "application/x-pkcs7-certificates", 142 | "spl" => "application/futuresplash", 143 | "src" => "application/x-wais-source", 144 | "sst" => "application/vnd.ms-pkicertstore", 145 | "stl" => "application/vnd.ms-pkistl", 146 | "stm" => "text/html", 147 | "svg" => "image/svg+xml", 148 | "sv4cpio" => "application/x-sv4cpio", 149 | "sv4crc" => "application/x-sv4crc", 150 | "t" => "application/x-troff", 151 | "tar" => "application/x-tar", 152 | "tcl" => "application/x-tcl", 153 | "tex" => "application/x-tex", 154 | "texi" => "application/x-texinfo", 155 | "texinfo" => "application/x-texinfo", 156 | "tgz" => "application/x-compressed", 157 | "tif" => "image/tiff", 158 | "tiff" => "image/tiff", 159 | "tr" => "application/x-troff", 160 | "trm" => "application/x-msterminal", 161 | "tsv" => "text/tab-separated-values", 162 | "txt" => "text/plain", 163 | "uls" => "text/iuls", 164 | "ustar" => "application/x-ustar", 165 | "vcf" => "text/x-vcard", 166 | "vrml" => "x-world/x-vrml", 167 | "wav" => "audio/x-wav", 168 | "wcm" => "application/vnd.ms-works", 169 | "wdb" => "application/vnd.ms-works", 170 | "wks" => "application/vnd.ms-works", 171 | "wmf" => "application/x-msmetafile", 172 | "wps" => "application/vnd.ms-works", 173 | "wri" => "application/x-mswrite", 174 | "wrl" => "x-world/x-vrml", 175 | "wrz" => "x-world/x-vrml", 176 | "xaf" => "x-world/x-vrml", 177 | "xbm" => "image/x-xbitmap", 178 | "xla" => "application/vnd.ms-excel", 179 | "xlc" => "application/vnd.ms-excel", 180 | "xlm" => "application/vnd.ms-excel", 181 | "xls" => "application/vnd.ms-excel", 182 | "xlt" => "application/vnd.ms-excel", 183 | "xlw" => "application/vnd.ms-excel", 184 | "xof" => "x-world/x-vrml", 185 | "xpm" => "image/x-xpixmap", 186 | "xwd" => "image/x-xwindowdump", 187 | "z" => "application/x-compress", 188 | "zip" => "application/zip"); 189 | 190 | ?> -------------------------------------------------------------------------------- /app/lib/mongo/RMongo.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | class RMongo { 8 | private static $_lastId; 9 | 10 | private $_mongo; 11 | 12 | /** 13 | * Contruct a new object 14 | * 15 | * @param string $server Server definition 16 | * @param array $options Options 17 | */ 18 | public function __construct($server, array $options = array()) { 19 | if (class_exists("MongoClient")) { 20 | $this->_mongo = new MongoClient($server, $options); 21 | } 22 | else { 23 | $this->_mongo = new Mongo($server, $options); 24 | } 25 | } 26 | 27 | /** 28 | * Closes this connection 29 | * 30 | * @param boolean|string $connection Connection 31 | * @return boolean 32 | */ 33 | public function close($connection) { 34 | return $this->_mongo->close($connection); 35 | } 36 | 37 | /** 38 | * Connects to a database server 39 | */ 40 | public function connect() { 41 | return $this->_mongo->connect(); 42 | } 43 | 44 | /** 45 | * Drops a database 46 | * 47 | * @param mixed $db The database to drop. Can be a MongoDB object or the name of the database 48 | * @return array 49 | */ 50 | public function dropDB($db) { 51 | if (!is_object($db)) { 52 | $db = $this->selectDB($db); 53 | } 54 | if (method_exists($db, "drop")) { 55 | return $db->drop(); 56 | } 57 | if (method_exists($this->_mongo, "dropDB")) { 58 | $this->_mongo->dropDB($db); 59 | } 60 | } 61 | 62 | /** 63 | * Force server to response error 64 | */ 65 | public function forceError() { 66 | if (method_exists($this->_mongo, "forceError")) { 67 | return $this->_mongo->forceError(); 68 | } 69 | return false; 70 | } 71 | 72 | /** 73 | * Gets a database 74 | * 75 | * @param string $dbname The database name 76 | * @return MongoDB 77 | */ 78 | public function __get($dbname) { 79 | return $this->_mongo->$dbname; 80 | } 81 | 82 | /** 83 | * Updates status for all associated hosts 84 | * 85 | * @return array 86 | * @todo implement it under different versions 87 | */ 88 | public function getHosts() { 89 | if (method_exists($this->_mongo, "getHosts")) { 90 | return $this->_mongo->getHosts(); 91 | } 92 | return array(); 93 | } 94 | 95 | /** 96 | * Get the read preference for this connection 97 | * 98 | * @return array 99 | * @todo implement it under different versions 100 | */ 101 | public function getReadPreference() { 102 | if (method_exists($this->_mongo, "getReadPreference")) { 103 | return $this->_mongo->getReadPreference(); 104 | } 105 | return array(); 106 | } 107 | 108 | /** 109 | * Get last erro 110 | * 111 | * @return array 112 | */ 113 | public function lastError() { 114 | if (method_exists($this->_mongo, "lastError")) { 115 | return $this->_mongo->lastError(); 116 | } 117 | return array(); 118 | } 119 | 120 | /** 121 | * Lists all of the databases available 122 | * 123 | * @return array 124 | */ 125 | public function listDBs() { 126 | return $this->_mongo->listDBs(); 127 | } 128 | 129 | /** 130 | * Connect pair servers 131 | * 132 | * @return boolean 133 | */ 134 | public function pairConnect() { 135 | if (method_exists($this->_mongo, "pairConnect")) { 136 | return $this->_mongo->pairConnect(); 137 | } 138 | return false; 139 | } 140 | 141 | /** 142 | * Create pair persist connection 143 | * 144 | * @param string $username 145 | * @param string $password 146 | * @return boolean 147 | */ 148 | public function pairPersistConnect($username = "" , $password = "") { 149 | if (method_exists($this->_mongo, "pairPersistConnect")) { 150 | return $this->_mongo->pairPersistConnect($username, $password); 151 | } 152 | return false; 153 | } 154 | 155 | /** 156 | * Create persist connection 157 | * 158 | * @param string $username Username 159 | * @param string $password Password 160 | * @return boolean 161 | */ 162 | public function persistConnect($username = "" , $password = "" ) { 163 | if (method_exists($this->_mongo, "persistConnect")) { 164 | return $this->_mongo->persistConnect($username, $password); 165 | } 166 | return false; 167 | } 168 | 169 | /** 170 | * Get previous error 171 | * 172 | * @return array 173 | */ 174 | public function prevError() { 175 | if (method_exists($this->_mongo, "prevError")) { 176 | return $this->_mongo->prevError(); 177 | } 178 | return array(); 179 | } 180 | 181 | /** 182 | * Reset error 183 | * 184 | * @return array 185 | */ 186 | public function resetError() { 187 | if (method_exists($this->_mongo, "resetError")) { 188 | return $this->_mongo->resetError(); 189 | } 190 | return array(); 191 | } 192 | 193 | /** 194 | * Gets a database collection 195 | * 196 | * @param string $db The database name 197 | * @param string $collection The collection name 198 | * @return MongoCollection 199 | */ 200 | public function selectCollection($db, $collection) { 201 | return $this->_mongo->selectCollection($db, $collection); 202 | } 203 | 204 | /** 205 | * Gets a database 206 | * 207 | * @param string $db The database name 208 | * @return MongoDB 209 | */ 210 | public function selectDB($db) { 211 | return $this->_mongo->selectDB($db); 212 | } 213 | 214 | /** 215 | * Set the read preference for this connection 216 | * 217 | * @param int $readPreference The read preference mode: Mongo::RP_PRIMARY, Mongo::RP_PRIMARY_PREFERRED, Mongo::RP_SECONDARY, Mongo::RP_SECONDARY_PREFERRED, or Mongo::RP_NEAREST 218 | * @param array $tags An array of zero or more tag sets, where each tag set is itself an array of criteria used to match tags on replica set members 219 | * @return boolean 220 | */ 221 | public function setReadPreference($readPreference, array $tags = array()) { 222 | if (method_exists($this->_mongo, "setReadPreference")) { 223 | return $this->_mongo->setReadPreference($readPreference, $tags); 224 | } 225 | return false; 226 | } 227 | 228 | /** 229 | * Change slaveOkay setting for this connection 230 | * 231 | * @param boolean $ok If reads should be sent to secondary members of a replica set for all possible queries using this Mongo instance 232 | * @return boolean 233 | */ 234 | public function setSlaveOkay($ok) { 235 | if (method_exists($this->_mongo, "setSlaveOkay")) { 236 | return $this->_mongo->setSlaveOkay($ok); 237 | } 238 | return false; 239 | } 240 | 241 | /** 242 | * String representation of this connection 243 | * 244 | * @return string 245 | */ 246 | public function __toString() { 247 | return $this->_mongo->__toString(); 248 | } 249 | 250 | /** 251 | * Get mongo driver version 252 | * 253 | * @return string 254 | * @since 1.1.4 255 | */ 256 | public static function getVersion() { 257 | if (class_exists("MongoClient")) { 258 | return MongoClient::VERSION; 259 | } 260 | if (class_exists("Mongo")) { 261 | return Mongo::VERSION; 262 | } 263 | return "0"; 264 | } 265 | 266 | /** 267 | * Compare another version with current version 268 | * 269 | * @param string $version Version to compare 270 | * @return integer -1,0,1 271 | * @since 1.1.4 272 | */ 273 | public static function compareVersion($version) { 274 | $currentVersion = self::getVersion(); 275 | preg_match("/^[\\.\\d]+/", $currentVersion, $match); 276 | $number = $match[0]; 277 | return version_compare($number, $version); 278 | } 279 | 280 | static function setLastInsertId($lastId) { 281 | self::$_lastId = $lastId; 282 | } 283 | 284 | /** 285 | * Enter description here... 286 | * 287 | * @return string 288 | */ 289 | static function lastInsertId() { 290 | return self::$_lastId; 291 | } 292 | } 293 | 294 | ?> -------------------------------------------------------------------------------- /CHANGELOG.txt: -------------------------------------------------------------------------------- 1 | v1.1.6 - 2014-06-05 2 | * Turkish translation thanks for M. Yılmaz SÜSLÜ 3 | * 2d index support 4 | * Compatible with php_mongo 1.4.x & 1.5.x 5 | * Compatible with PHP 5.5.x 6 | * Add URI, E-mail, Picture URLs field value recognition 7 | * Open log_query feature, can log your query to file, execute them later 8 | * Add docs_render option:http://rockmongo.com/wiki/configuration?lang=en_us#%23%23%23%23docs_render%0D 9 | * Bug Fix: array display as object 10 | * Bug Fix: update array or object field 11 | * View microtime as date string 12 | * Add "Query Examples" link under query box 13 | * Support empty object 14 | * Support unix domain sockets 15 | * Fix $_SERVER["PHP_SELF"] under nginx cgi 16 | * Fixed cookie vulnerability as reported in CVE-2013-5107 (thanks for synthomat) 17 | 18 | v1.1.5 - 2012-12-20 19 | * Fix authenticate with php_mongo >= 1.3.0 20 | 21 | v1.1.4 - 2012-12-01 22 | * Make compatible with php_mongo 1.3.0 23 | * Support composite _id 24 | * Fix gridfs downloads and view chunks issue 25 | * Fix h() function error 26 | * Fix Slave link on topbar 27 | * Fix User auth error (after you remove some servers) 28 | * Fix issue when query with numberic field 29 | 30 | v1.1.3 - 2012-11-07 31 | * Fix UTF-8 characters display issue(PHP 5.4.x) 32 | * Add portuguese (Portugal) translation, by Luis Romao 33 | 34 | v1.1.2 - 2012-05-07 35 | * Italian translation, thanks to Andrea Cardinale 36 | * NumberInt, NumberLong 37 | 38 | v1.1.1 - 2012-05-04 39 | * Russian translation, thanks to Станислав Воробьёв 40 | * Fix host switch bug 41 | * Fix date_default_timezone_get() warning 42 | * new French translation 43 | * improve importing and exporting 44 | * Fix broken on sharding collections 45 | * add $MONGO["servers"][$i]["mongo_options"] option, see http://rockmongo.com/wiki/configuration?lang=en_us#%23%23%23%23+mongo_options%0D 46 | * fix mongo_timeout issue 47 | * JSON format importing 48 | 49 | 50 | v1.1.0(beta) - 2011-04-17 51 | * Upgrade Notice 52 | * from 1.0.x to v1.1.0: if you will not use new features, just overwrite files, excluding config.php, that's all; Or you should re-configure the system 53 | * *Implement basic theme feature* 54 | * *[configuration New Configurations]* 55 | * *[plugin Implement Plug-in feature:Filters, Events and Plug-in controllers]* 56 | * Load language packages automatically 57 | * Choose language after log-in on the top bar 58 | * Automatic language proposition based on browser settings 59 | * Fix a display bug on IE9 60 | * Change timezone from default to UTC 61 | * Represent date using ISODate() 62 | * Add confirmation to "Apply to all" buttons 63 | * Change all of float_value options to double_value 64 | * Fix db[`_`name] bug, now your collection name's prefix can be "`_`" 65 | * Fix empty collection issue 66 | * Support numberic `_`id string 67 | 68 | v1.0.12 - 2011-03-08 69 | * Fix date format in tooltip 70 | * Fix MongoCursor->fields() undefined error 71 | * Convert unicode in json to utf-8 when editing 72 | * Edit installation construction 73 | * Add Chinese tranditional translation 74 | * Fixed features for capped collection 75 | * Fix slashes bug when magic_quotes_gpc is on in php.ini 76 | * Fix bug: field "0" can not be updated or removed 77 | * Remember data format when query 78 | * Add "Logout" link when no servers can be connected 79 | * Fix records count in left bar when no data in the collection 80 | 81 | v1.0.11 - 2011-01-09 82 | * Add true, false and null to allowed PHP codes in saving data 83 | * Highlight current collection in left menu when it reload 84 | * Support JSON format in inserting and updating 85 | * Added feature to show only user-defined set of databases (to avoid costly listDBs call) 86 | * Add mongoint32, mongoint64 to allowed tokens in PHP array 87 | * Spanish and German translation 88 | * Fix token_get_all undefined issue 89 | * Add panels layout (thank Borda Juan Ignacio) 90 | * Fix NULL field updating bug 91 | * When host is unable to connect, you can choose another host 92 | 93 | v1.0.10 - 2010-11-16 94 | * Added docblock comments to translation files, updated brazilian translation, 95 | updated english translation, created additional localization variables (contato) 96 | * Convert \uxxxx in JSON to UTF-8 chars 97 | * Fix display bug on Opera 98 | * Choose SESSION lifetime in sign in form 99 | * Refresh records count in a collection when click collection name on left bar 100 | * Allow float number in query criteria 101 | * Prompt error message when insert/update fail 102 | * Add auth_enabled option to disable authentication, see FAQ for details 103 | * Fix field selection bug when it's in an array list 104 | 105 | v1.0.9 - 2010-10-26 106 | * replace eval() with safer VarEval class 107 | * fix records sorting bug 108 | * support query in json format 109 | * support tab key in textarea 110 | * fix explain query 111 | * collections can be exported as a .gz file 112 | * add brazilian and french translation 113 | * query history: in config.php set the feature to on 114 | 115 | v1.0.8 - 2010-09-14 116 | * Make operations on single field more easily, now you can update, rename, remove, 117 | clear (set to null), query, create indexes on a field, just click field name in 118 | record to get surprise 119 | * Add new field to a record or to whole collection 120 | * Autocomplete field in index creation 121 | * Add go "TOP" link 122 | * Refresh single record without whole page reloading 123 | * Add a simple menu to number, let you view number as bytes or a date time 124 | * Shorten long text, and then you click "..." to see full text 125 | 126 | v1.0.7.r87 - 2010-09-05 127 | * fix hints bug 128 | * some slight GUI changes 129 | 130 | v1.0.7 - 2010-09-04 131 | * Add more collection statistics with command {top:1} 132 | * Add full processlist, connections is included 133 | * Expend and collapse single record 134 | * Now you can specify query result fields and hints in query 135 | * GridFS is supported, you can view chunks and download the full file 136 | * Some slight improvements 137 | * Change font size from 11px to 12px 138 | * Use a few icons 139 | * Keep record operations always displayed 140 | 141 | v1.0.6 - 2010-08-29 142 | * improved GUI 143 | * I18N, English, chinese and japanese is supported 144 | * More replication information 145 | * connection to mongos is supported 146 | 147 | v1.0.5 - 2010-8-20 148 | * NOTICE:move configurations from index.php to config.php 149 | * drop all collections in a db 150 | * clear all collections in a db 151 | * make _id index un-dropable 152 | * collection property modification (capped, max, size ...) 153 | * rename collection 154 | * data transfer: transfer collections to other servers 155 | * export and import collections (JSON data format) 156 | * Master/Slave information 157 | 158 | v1.0.4.r39 - 2010-08-12 159 | * fix pagination problem 160 | * check unauthorized exception 161 | * fix issue when use double quotes in query 162 | 163 | v1.0.4.r37 - 2010-08-04 164 | * fix bugs when using non-standard _id 165 | 166 | v1.0.4.r34 167 | * change frameset to iframe 168 | * switch hosts without re-login 169 | * add manual links 170 | * processlist 171 | * fix bugs 172 | 173 | v1.0.3.r24 174 | * database profiling 175 | * database user management 176 | * fix jQuery path error in some cases 177 | * fix object data representation in JSON and PHP format 178 | * server command line 179 | * validate collection 180 | * repair database 181 | * explain query 182 | 183 | v1.0.2 - 2010-07-17 184 | * server statistics, databases 185 | * execute command and code 186 | * database statistics and drop 187 | * a better GUI 188 | * remove some unused php files 189 | 190 | v1.0.1 - 2010-07-15 191 | * switch PHP Array and JSON data format 192 | * choose record size per page 193 | * switch data to text in textarea, so we can copy it easily 194 | 195 | v1.0 - 2010-07-13 196 | * basic version 197 | -------------------------------------------------------------------------------- /app/lib/mongo/RObject.php: -------------------------------------------------------------------------------- 1 | setAttrs($attrs); 25 | } 26 | 27 | /** 28 | * Set field value 29 | * 30 | * @param string $name field name 31 | * @param mixed $value field value 32 | */ 33 | function setAttr($name, $value) { 34 | if ($name == "_id") { 35 | $this->setId($value); 36 | return; 37 | } 38 | $this->_attrs = rock_array_set($this->_attrs, $name, $value); 39 | $this->_execOperator('$set', $name, $value); 40 | } 41 | 42 | /** 43 | * Set fields values 44 | * 45 | * @param array $attrs fields values 46 | */ 47 | function setAttrs(array $attrs) { 48 | foreach ($attrs as $field => $value) { 49 | $this->setAttr($field, $value); 50 | } 51 | } 52 | 53 | /** 54 | * Set original fields values 55 | * 56 | * @param array $attrs fields 57 | */ 58 | function setSource(array $attrs) { 59 | if (isset($attrs["_id"])) { 60 | $this->setId($attrs["_id"]); 61 | } 62 | $this->_attrs = array_merge($this->_attrs, $attrs); 63 | } 64 | 65 | private function _execOperator($operator, $attr, $newValue) { 66 | if (!isset($this->_operations[$operator])) { 67 | $this->_operations[$operator] = array(); 68 | } 69 | $this->_operations[$operator][$attr] = $newValue; 70 | } 71 | 72 | 73 | /** 74 | * Return current object ID, can determine if the object is saved 75 | * 76 | * @return MongoId 77 | */ 78 | function id() { 79 | return $this->_id; 80 | } 81 | 82 | /** 83 | * Return current object ID string value 84 | * 85 | * @return string 86 | */ 87 | function idValue() { 88 | return $this->_id ? $this->_id->__toString() : null; 89 | } 90 | 91 | /** 92 | * Set current object id 93 | * 94 | * @param string|MongoId $id New id, must contains 24 chars 95 | */ 96 | function setId($id) { 97 | $this->_id = ($id); 98 | } 99 | 100 | /** 101 | * Increase numeric field value 102 | * 103 | * @param string $attr Field 104 | * @param integer $count The count to increase 105 | */ 106 | function increase($attr, $count = 1) { 107 | $this->_execOperator('$inc', $attr, $count); 108 | } 109 | 110 | /** 111 | * Remove field 112 | * 113 | * Later, you need to $obj->pull($attrParent, null) to remove NULL field 114 | * 115 | * @param string $attr Field 116 | * @param boolean $pullNull Should remove NULL field automatically? 117 | */ 118 | function remove($attr, $pullNull = true) { 119 | if ($pullNull) { 120 | $this->_execOperator('$unset', $attr, 1); 121 | $this->save(); 122 | if (strstr($attr, ".")) { 123 | $parent = substr($attr, 0, strrpos($attr, ".")); 124 | $this->pull($parent, null); 125 | } 126 | } 127 | else { 128 | $this->_execOperator('$unset', $attr, 1); 129 | } 130 | } 131 | 132 | /** 133 | * Push value to collection 134 | * 135 | * @param string $attr Field 136 | * @param mixed $value Value 137 | * @param boolean|string|integer $genId Should generate ID? 138 | */ 139 | function push($attr, $value, $genId = false) { 140 | if (is_bool($genId) && $genId) { 141 | $attr .= "." . strtoupper(uniqid("ID_")); 142 | $this->setAttr($attr, $value); 143 | } 144 | elseif (is_string($genId) || is_integer($genId)) { 145 | $attr .= "." . $genId; 146 | $this->setAttr($attr, $value); 147 | } 148 | else { 149 | $this->_execOperator('$push', $attr, $value); 150 | } 151 | } 152 | 153 | /** 154 | * Add values to collection 155 | * 156 | * @param string $attr Field 157 | * @param array $values Values 158 | */ 159 | function pushAll($attr, array $values) { 160 | $this->_execOperator('$pushAll', $attr, $values); 161 | } 162 | 163 | function addToSet($attr, $value) { 164 | $this->_execOperator('$addToSet', $attr, $value); 165 | } 166 | 167 | function addAllToSet($attr, array $values) { 168 | $this->_execOperator('$addToSet', $attr, array( '$each' => $values )); 169 | } 170 | 171 | function pop($attr) { 172 | $this->_execOperator('$pop', $attr, 1); 173 | } 174 | 175 | function shift($attr) { 176 | $this->_execOperator('$pop', $attr, -1); 177 | } 178 | 179 | /** 180 | * Pull specified value in field 181 | * 182 | * @param string $attr Field 183 | * @param mixed $value Value 184 | */ 185 | function pull($attr, $value) { 186 | $this->_execOperator('$pull', $attr, $value); 187 | } 188 | 189 | function pullAll($attr, array $values) { 190 | $this->_execOperator('$pullAll', $attr, $values); 191 | } 192 | 193 | /** 194 | * Save current object to MongoDB 195 | * 196 | * @param boolean $refresh Should refresh the object fields values? 197 | * @return boolean 198 | */ 199 | function save($refresh = false) { 200 | if (!$this->_collection) { 201 | import("@.RMongoException"); 202 | throw new RMongoException("Object is not in any collection, please use setCollection() to method to set a collection."); 203 | } 204 | $bool = true; 205 | if ($this->_id) {//if exists 206 | if (!empty($this->_operations)) { 207 | $bool = $this->_collection->update(array( "_id" => $this->_id ), $this->_operations, array( 208 | "upsert" => false, 209 | "multiple" => false 210 | )); 211 | if ($refresh) { 212 | $bool = $this->refresh(); 213 | } 214 | } 215 | } 216 | else { 217 | $bool = $this->_collection->insert($this->_attrs, true); 218 | if ($bool) { 219 | $this->_id = $this->_attrs["_id"]; 220 | import("@.RMongo"); 221 | RMongo::setLastInsertId($this->_id->__toString()); 222 | } 223 | } 224 | $this->_operations = array(); 225 | return $bool; 226 | } 227 | 228 | /** 229 | * Refresh the current object 230 | * 231 | * @return boolean 232 | */ 233 | function refresh() { 234 | if (!$this->_collection) { 235 | import("@.RMongoException"); 236 | throw new RMongoException("Object is not in any collection, please use setCollection() to method to set a collection."); 237 | } 238 | if (!$this->_id) { 239 | return true; 240 | } 241 | $this->setSource($this->_collection->findOne( array( "_id" => $this->_id ) )); 242 | return true; 243 | } 244 | 245 | function setCollection(MongoCollection $collection) { 246 | $this->_collection = $collection; 247 | } 248 | 249 | function attr($name) { 250 | return rock_array_get($this->_attrs, $name); 251 | } 252 | 253 | /** 254 | * Get all fields values 255 | * 256 | * @return array 257 | */ 258 | function attrs() { 259 | return $this->_attrs; 260 | } 261 | 262 | /** 263 | * Delete the object 264 | * 265 | */ 266 | function delete() { 267 | if ($this->_collection && $this->_id) { 268 | $this->_collection->remove(array( "_id" => $this->_id )); 269 | } 270 | $this->_id = null; 271 | $this->_attrs = array(); 272 | } 273 | 274 | function __get($name) { 275 | return $this->attr($name); 276 | } 277 | 278 | /** 279 | * Determine offset exists 280 | * 281 | * For ArrayAccess implementation 282 | * 283 | * @param integer $index 284 | * @return boolean 285 | * @since 1.0 286 | */ 287 | function offsetExists($index) { 288 | return !is_null($this->attr($index)); 289 | } 290 | 291 | /** 292 | * Get value at specified offset 293 | * 294 | * For ArrayAccess implementation 295 | * 296 | * @param integer $index Offset 297 | * @return mixed 298 | */ 299 | function offsetGet($index) { 300 | return $this->attr($index); 301 | } 302 | 303 | /** 304 | * Set value at specified offset 305 | * 306 | * For ArrayAccess implementation 307 | * 308 | * @param integer $index 偏移量 309 | * @param mixed $item 值 310 | */ 311 | function offsetSet($index, $item) { 312 | $this->setAttr($index, $item); 313 | } 314 | 315 | /** 316 | * Unset value at specified offset 317 | * 318 | * For ArrayAccess implementation 319 | * 320 | * @param integer $index Offset 321 | */ 322 | function offsetUnset($index) { 323 | $this->setAttr($index, null); 324 | } 325 | } 326 | 327 | ?> -------------------------------------------------------------------------------- /app/langs/de_de/message.php: -------------------------------------------------------------------------------- 1 | 7 | * @version 1.0 8 | */ 9 | 10 | $message["TRANSLATION_NAME"] = "Deutsch - German"; 11 | $message["TRANSLATION_ID"] = 8; 12 | 13 | /** Login interface **/ 14 | $message["admin"] = "Benutzer"; 15 | $message["password"] = "Passwort"; 16 | $message["language"] = "Sprache"; 17 | $message["hour"] = "Stunde"; 18 | $message["hours"] = "Stunden"; 19 | $message["month"] = "Monat"; 20 | $message["alive"] = "Sessiondauer"; 21 | 22 | /** Connection **/ 23 | $message["can_not_connect"] = "MongoDB-Ausnahme beim Verbinden: %s. Bitte überprüfen Sie ihre Einstellungen."; 24 | 25 | /** Buttons and titles **/ 26 | $message["overview"] = "Übersicht"; 27 | $message["server"] = "Server"; 28 | $message["status"] = "Status"; 29 | $message["databases"] = "Datenbanken"; 30 | $message["processlist"] = "Prozessliste"; 31 | $message["command"] = "Befehl"; 32 | $message["execute"] = "Ausführen"; 33 | $message["master"] = "Master"; 34 | $message["masters"] = "Masters"; 35 | $message["slave"] = "Slave"; 36 | $message["slaves"] = "Slaves"; 37 | $message["master_slave"] = "Master/Slave"; 38 | $message["query"] = "Abfrage"; 39 | $message["refresh"] = "Neu laden"; 40 | $message["insert"] = "Einfügen"; 41 | $message["add"] = "Hinzufügen"; 42 | $message["clear"] = "Leeren"; 43 | $message["delete"] = "Löschen"; 44 | $message["remove"] = "Entfernen"; 45 | $message["argument"] = "Argument"; 46 | $message["update"] = "Update"; 47 | $message["duplicate"] = "Duplizieren"; 48 | $message["text"] = "Text"; 49 | $message["yes"] = "Ja"; 50 | $message["no"] = "Nein"; 51 | $message["statistics"] = "Statistiken"; 52 | $message["export"] = "Export"; 53 | $message["import"] = "Import"; 54 | $message["transfer"] = "Transfer"; 55 | $message["drop"] = "Löschen"; 56 | $message["more"] = "Mehr"; 57 | $message["rename"] = "Umbenennen"; 58 | $message["indexes"] = "Indizes"; 59 | $message["properties"] = "Eigenschaften"; 60 | $message["validate"] = "Validieren"; 61 | $message["repair"] = "Reparieren"; 62 | $message["all"] = "Alle"; 63 | $message["authentication"] = "Authentifikation"; 64 | $message["profile"] = "Profil"; 65 | $message["create_collection"] = "Neue Kolletion"; 66 | $message["create_collection_full"] = "Neue Sammlung erstellen"; 67 | $message["create_database"] = "Neue Datenbank erstellen"; 68 | $message["save"] = "Speichern"; 69 | $message["back"] = "Zurück"; 70 | $message["server_status"] = "Serverstatus"; 71 | $message["command_line"] = "Befehlszeile"; 72 | $message["connection"] = "Verbindung"; 73 | $message["web"] = "Web"; 74 | $message["directives"] = "Rechtlinien"; 75 | $message["directive"] = "Rechtlinie"; 76 | $message["global_value"] = "Globaler Wert"; 77 | $message["local_value"] = "Lokaler Wert"; 78 | $message["build_info"] = "Build-Information"; 79 | $message["kill"] = "Abbrechen"; 80 | $message["killop"] = "Sind Sie sicher, dass Sie den Vorgang abbrechen möchten?"; 81 | $message["killoperation"] = "Vorgang abbrechen"; 82 | $message["create"] = "Erstellen"; 83 | $message["name"] = "Name"; 84 | $message["newname"] = "Neuer Name"; 85 | $message["oldname"] = "Alter Name"; 86 | $message["iscapped"] = "Größe beschränken"; 87 | $message["size"] = "Größe"; 88 | $message["max"] = "Max"; 89 | $message["modifyrow"] = "Zeile ändern"; 90 | $message["data"] = "Data"; 91 | $message["validarray"] = "Data muss ein valides PHP-Array sein, wie:"; 92 | $message["responseserver"] = "Antwort vom Server:"; 93 | $message["db"] = "DB"; 94 | $message["gotodbs"] = "Gehe zur Datenbank"; 95 | $message["dropdatabase"] = "Datenbank löschen"; 96 | $message["dropwarning"] = "Warnung: Möchten Sie die Datenbank wirklich löschen?"; 97 | $message["dropwarning2"] = "Alle Inhalte in der Datenbank gehen verloren!"; 98 | $message["createrow"] = "Zeile erstellen"; 99 | $message["storagesize"] = "Speichergröße"; 100 | $message["datasize"] = "Datengröße"; 101 | $message["indexsize"] = "Indexgröße"; 102 | $message["collections"] = "Sammlungen"; 103 | $message["objects"] = "Objekte"; 104 | $message["repairdbmsg"] = "Möchten Sie die Datenbank wirklich reparieren?"; 105 | $message["nocollections"] = "Es ist keine Sammlung vorhanden - Sie können nichts übertragen."; 106 | $message["nocollections2"] = "Keine Sammlung vorhanden"; 107 | $message["download"] = "Download?"; 108 | $message["compressed"] = "Komprimiert"; 109 | $message["rowsexported"] = "Zeilen exportiert"; 110 | $message["createnewcollection"] = "Neue Sammlung innerhalb der Datenbank erstellen"; 111 | $message["target"] = "Ziel"; 112 | $message["host"] = "Host"; 113 | $message["copyindexes"] = "Indizes kopieren?"; 114 | $message["confirm"] = "Bestätigen"; 115 | $message["fields"] = "Felder"; 116 | $message["unique"] = "Einzigartig"; 117 | $message["key"] = "Schlüssel"; 118 | $message["operation"] = "Operation"; 119 | $message["removeduplicates"] = "Duplikate entfernen?"; 120 | $message["listdbcommands"] = "Liste der Datenbankbefehle"; 121 | $message["format"] = "Format"; 122 | $message["execute_command"] = "Befehl ausführen"; 123 | $message["validate"] = "Validieren"; 124 | $message["dropifexists"] = "Löschen wenn vorhanden?"; 125 | $message["warningprops"] = "Hinweis: Um eine neue Sammlung zu erstellen, werden wir eine neue Sammlung erstellen, alle Daten umkopieren und die alte Sammlung löschen. Dieser Vorgang kann bei einer großen Sammlung sehr lange dauern."; 126 | $message["warningindex"] = "Möchten Sie den Index wirklich löschen?"; 127 | $message["createindex"] = "Neuen Index erstellen"; 128 | $message["copycollection"] = "Sammlung kopieren"; 129 | $message["to"] = "Nach"; 130 | $message["removeifexists"] = "Ziel löschen wenn vorhanden?"; 131 | 132 | /** Add user **/ 133 | $message["users"] = "Benutzer"; 134 | $message["adduser"] = "Benutzer anlegen"; 135 | $message["username"] = "Benutzername"; 136 | $message["confirm_pass"] = "Passwort bestätigen"; 137 | $message["readonly"] = "Nur-Lesen?"; 138 | $message["addreplace"] = "Anlegen oder ersetzen"; 139 | 140 | /** Manual links **/ 141 | $message["querying"] = "Abfrage"; 142 | $message["updating"] = "Updating"; 143 | $message["commands"] = "Befehle"; 144 | $message["jsapi"] = "JS API"; 145 | $message["phpmongo"] = "PHP Mongo"; 146 | 147 | /** Replication **/ 148 | $message["repstatus"] = "Replicationsstatus"; 149 | $message["me"] = "Ich"; 150 | 151 | $message["repstatus"] = "Datenbank reparieren"; 152 | $message["response_from_server"] = "Antwort vom Server"; 153 | 154 | $message["dropped_from_database"] = "wurde aus der Datenbank entfernt"; 155 | 156 | $message["noqueryhistory"] = "Noch keine Abfrage im Verlauf"; 157 | $message["requery"] = "Neu abfragen"; 158 | 159 | $message["date"] = "Datum"; 160 | $message["change_level"] = "Stufe ändern"; 161 | $message["clear_profile"] = "Möchten Sie das Datenbank-Profil wirklich löschen?"; 162 | $message["choose_profiling_level"] = "Aktuelle Profiling-Stufe"; 163 | $message["profiling_level1"] = "0 - aus"; 164 | $message["profiling_level2"] = "1 - logge langsame Vorgänge (>N ms)"; 165 | $message["profiling_level3"] = "2 - logge alle Vorgänge"; 166 | $message["timecost"] = "Time cost"; 167 | 168 | /** Collection operations **/ 169 | $message["submit_query"] = "Abfrage ausführen"; 170 | $message["explain"] = "Erklären"; 171 | $message["clear_conditions"] = "Bedingungen löschen"; 172 | $message["rows_per_page"] = "Zeilen pro Seite"; 173 | $message["action"] = "Aktionen"; 174 | $message["limit"] = "Grenze"; 175 | $message["new_field"] = "Neues Feld"; 176 | 177 | /** Top bar **/ 178 | $message["tools"] = "Werkzeuge"; 179 | $message["manuals"] = "Anleitungen"; 180 | $message["logout"] = "Ausloggen"; 181 | 182 | $message["switch_hosts"] = "Host wechseln"; 183 | 184 | /** About **/ 185 | $message["about_content"] = 'RockMongo ist ein in PHP5 geschriebenes MongoDB Administrationswerkzeug. 186 | 187 |

Siehe http://rockmongo.com für mehr Details.

188 | 189 |

Wenn Sie Fragen haben sollten, können Sie mir eine E-Mail senden: iwind.liu@gmail.com .

'; 190 | 191 | /** Login **/ 192 | $message["loginandrock"] = "Login und abrocken"; 193 | $message["changeconfig"] = "Vielleicht möchten Sie ihren Benutzernamen und Passwort in config.php ändern."; 194 | $message["rockmongocredits"] = "Powered by RockMongo v" . (ROCK_MONGO_VERSION) . ", auf neue Version prüfen."; 195 | 196 | ?> -------------------------------------------------------------------------------- /app/classes/VarExportor.php: -------------------------------------------------------------------------------- 1 | _db = $db; 21 | $this->_var = $var; 22 | } 23 | 24 | /** 25 | * Export the variable to a string 26 | * 27 | * @param string $type variable type (array or json) 28 | * @param boolean $fieldLabel if add label to fields 29 | * @return string 30 | */ 31 | function export($type = MONGO_EXPORT_PHP, $fieldLabel = false) { 32 | if ($fieldLabel) { 33 | $this->_var = $this->_addLabelToArray($this->_var); 34 | } 35 | if ($type == MONGO_EXPORT_PHP) { 36 | return $this->_exportPHP(); 37 | } 38 | return $this->_exportJSON(); 39 | } 40 | 41 | /** 42 | * Export the variable to PHP 43 | * 44 | * @return string 45 | */ 46 | private function _exportPHP() { 47 | $var = $this->_formatVar($this->_var); 48 | $string = var_export($var, true); 49 | $params = array(); 50 | foreach ($this->_phpParams as $index => $value) { 51 | $params["'" . $this->_param($index) . "'"] = $value; 52 | } 53 | 54 | return strtr($string, $params); 55 | } 56 | 57 | /** 58 | * Substr utf-8 version 59 | * 60 | * @param unknown_type $str 61 | * @param unknown_type $from 62 | * @param unknown_type $len 63 | * @return unknown 64 | * @author sajjad at sajjad dot biz (copied from PHP manual) 65 | */ 66 | private function _utf8_substr($str,$from,$len) { 67 | return function_exists('mb_substr') ? 68 | mb_substr($str, $from, $len, 'UTF-8') : 69 | preg_replace('#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'. $from .'}'.'((?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'. $len .'}).*#s','$1', $str); 70 | } 71 | 72 | private function _addLabelToArray($array, $prev = "") { 73 | $ret = array(); 74 | $cutLength = 150; 75 | foreach ($array as $key => $value) { 76 | if (is_string($key)) { 77 | $newKey = $prev . ($prev === ""?"":".") . "rockfield." . $key; 78 | if (is_string($value) && strlen($value) > $cutLength) { 79 | $value = $this->_utf8_substr($value, 0, $cutLength); 80 | $value = $value . " __rockmore.{$newKey}.rockmore__"; 81 | } 82 | $ret[$newKey . ".rockfield"] = $value; 83 | if (is_array($value)) { 84 | $ret[$newKey . ".rockfield"] = $this->_addLabelToArray($value, $newKey); 85 | } 86 | } 87 | else { 88 | $ret[$key] = $value; 89 | } 90 | } 91 | return $ret; 92 | } 93 | 94 | private function _exportJSON() { 95 | if (function_exists("json_encode")) { 96 | $service = "json_encode"; 97 | } else { 98 | import("classes.Services_JSON"); 99 | $json = new Services_JSON(); 100 | $service = array(&$json, 'encode'); 101 | } 102 | $var = $this->_formatVarAsJSON($this->_var, $service); 103 | $string = call_user_func($service, $var); 104 | 105 | //Remove "\/" escape 106 | $string = str_replace('\/', "/", $string); 107 | 108 | $params = array(); 109 | foreach ($this->_jsonParams as $index => $value) { 110 | $params['"' . $this->_param($index) . '"'] = $value; 111 | } 112 | return json_unicode_to_utf8(json_format(strtr($string, $params))); 113 | } 114 | 115 | private function _param($index) { 116 | return "%{MONGO_PARAM_{$index}}"; 117 | } 118 | 119 | private function _formatVar($var) { 120 | if (is_scalar($var) || is_null($var)) { 121 | switch (gettype($var)) { 122 | case "integer": 123 | if (class_exists("MongoInt32")) { 124 | // producing MongoInt32 to keep type unchanged (Kyryl Bilokurov ) 125 | $this->_paramIndex ++; 126 | $this->_phpParams[$this->_paramIndex] = 'new MongoInt32(' . $var . ')'; 127 | return $this->_param($this->_paramIndex); 128 | } 129 | default: 130 | return $var; 131 | } 132 | } 133 | if (is_array($var)) { 134 | foreach ($var as $index => $value) { 135 | $var[$index] = $this->_formatVar($value); 136 | } 137 | return $var; 138 | } 139 | if (is_object($var)) { 140 | $this->_paramIndex ++; 141 | switch (get_class($var)) { 142 | case "stdClass": 143 | $this->_phpParams[$this->_paramIndex] = array(); 144 | return $this->_param($this->_paramIndex); 145 | case "MongoId": 146 | $this->_phpParams[$this->_paramIndex] = 'new MongoId("' . $var->__toString() . '")'; 147 | return $this->_param($this->_paramIndex); 148 | case "MongoInt32": 149 | $this->_phpParams[$this->_paramIndex] = 'new MongoInt32(' . $var->__toString() . ')'; 150 | return $this->_param($this->_paramIndex); 151 | case "MongoInt64": 152 | $this->_phpParams[$this->_paramIndex] = 'new MongoInt64(' . $var->__toString() . ')'; 153 | return $this->_param($this->_paramIndex); 154 | case "MongoDate": 155 | $this->_phpParams[$this->_paramIndex] = 'new MongoDate(' . $var->sec . ', ' . $var->usec . ')'; 156 | return $this->_param($this->_paramIndex); 157 | case "MongoRegex": 158 | $this->_phpParams[$this->_paramIndex] = 'new MongoRegex(\'/' . $var->regex . '/' . $var->flags . '\')'; 159 | return $this->_param($this->_paramIndex); 160 | case "MongoTimestamp": 161 | $this->_phpParams[$this->_paramIndex] = 'new MongoTimestamp(' . $var->sec . ', ' . $var->inc . ')'; 162 | return $this->_param($this->_paramIndex); 163 | case "MongoMinKey": 164 | $this->_phpParams[$this->_paramIndex] = 'new MongoMinKey()'; 165 | return $this->_param($this->_paramIndex); 166 | case "MongoMaxKey": 167 | $this->_phpParams[$this->_paramIndex] = 'new MongoMaxKey()'; 168 | return $this->_param($this->_paramIndex); 169 | case "MongoCode": 170 | $this->_phpParams[$this->_paramIndex] = 'new MongoCode("' . addcslashes($var->code, '"') . '", ' . var_export($var->scope, true) . ')'; 171 | return $this->_param($this->_paramIndex); 172 | default: 173 | if (method_exists($var, "__toString")) { 174 | return $var->__toString(); 175 | } 176 | } 177 | } 178 | return $var; 179 | } 180 | 181 | private function _formatVarAsJSON($var, $jsonService) { 182 | if (is_scalar($var) || is_null($var)) { 183 | switch (gettype($var)) { 184 | case "integer": 185 | $this->_paramIndex ++; 186 | $this->_jsonParams[$this->_paramIndex] = 'NumberInt(' . $var . ')'; 187 | return $this->_param($this->_paramIndex); 188 | default: 189 | return $var; 190 | } 191 | } 192 | if (is_array($var)) { 193 | foreach ($var as $index => $value) { 194 | $var[$index] = $this->_formatVarAsJSON($value, $jsonService); 195 | } 196 | return $var; 197 | } 198 | if (is_object($var)) { 199 | $this->_paramIndex ++; 200 | switch (get_class($var)) { 201 | case "MongoId": 202 | $this->_jsonParams[$this->_paramIndex] = 'ObjectId("' . $var->__toString() . '")'; 203 | return $this->_param($this->_paramIndex); 204 | case "MongoInt32": 205 | $this->_jsonParams[$this->_paramIndex] = 'NumberInt(' . $var->__toString() . ')'; 206 | return $this->_param($this->_paramIndex); 207 | case "MongoInt64": 208 | $this->_jsonParams[$this->_paramIndex] = 'NumberLong(' . $var->__toString() . ')'; 209 | return $this->_param($this->_paramIndex); 210 | case "MongoDate": 211 | $timezone = @date_default_timezone_get(); 212 | date_default_timezone_set("UTC"); 213 | $this->_jsonParams[$this->_paramIndex] = "ISODate(\"" . date("Y-m-d", $var->sec) . "T" . date("H:i:s.", $var->sec) . ($var->usec/1000) . "Z\")"; 214 | date_default_timezone_set($timezone); 215 | return $this->_param($this->_paramIndex); 216 | case "MongoTimestamp": 217 | $this->_jsonParams[$this->_paramIndex] = call_user_func($jsonService, array( 218 | "t" => $var->inc * 1000, 219 | "i" => $var->sec 220 | )); 221 | return $this->_param($this->_paramIndex); 222 | case "MongoMinKey": 223 | $this->_jsonParams[$this->_paramIndex] = call_user_func($jsonService, array( '$minKey' => 1 )); 224 | return $this->_param($this->_paramIndex); 225 | case "MongoMaxKey": 226 | $this->_jsonParams[$this->_paramIndex] = call_user_func($jsonService, array( '$minKey' => 1 )); 227 | return $this->_param($this->_paramIndex); 228 | case "MongoCode": 229 | $this->_jsonParams[$this->_paramIndex] = $var->__toString(); 230 | return $this->_param($this->_paramIndex); 231 | default: 232 | if (method_exists($var, "__toString")) { 233 | return $var->__toString(); 234 | } 235 | return ''; 236 | } 237 | } 238 | } 239 | } 240 | 241 | ?> -------------------------------------------------------------------------------- /app/funcs/functions.php: -------------------------------------------------------------------------------- 1 | " . $char . "";//iwind 52 | if(!$in_string) { 53 | $new_json .= $char . "
" . str_repeat($tab, $indent_level+1); 54 | $indent_level++; 55 | } 56 | else { 57 | $new_json .= "["; 58 | } 59 | break; 60 | case '}': 61 | case ']': 62 | $char = "" . $char . "";//iwind 63 | if(!$in_string) 64 | { 65 | $indent_level--; 66 | $new_json .= "
" . str_repeat($tab, $indent_level) . $char; 67 | } 68 | else 69 | { 70 | $new_json .= "]"; 71 | } 72 | break; 73 | case ',': 74 | $char = "" . $char . "";//iwind 75 | if(!$in_string) { 76 | $new_json .= ",
" . str_repeat($tab, $indent_level); 77 | } 78 | else { 79 | $new_json .= ","; 80 | } 81 | break; 82 | case ':': 83 | $char = "" . $char . "";//iwind 84 | if($in_string) { 85 | $new_json .= ":"; 86 | } 87 | else { 88 | $new_json .= $char; 89 | } 90 | break; 91 | case '"': 92 | if($c > 0 && $json[$c-1] != '\\') { 93 | $in_string = !$in_string; 94 | if ($in_string) { 95 | $new_json .= "" . $char; 96 | } 97 | else { 98 | $new_json .= $char . ""; 99 | } 100 | break; 101 | } 102 | else if ($c == 0) { 103 | $in_string = !$in_string; 104 | $new_json .= "" . $char; 105 | break; 106 | } 107 | default: 108 | if (!$in_string && trim($char) !== "") { 109 | $char = "" . $char . ""; 110 | } 111 | else { 112 | if ($char == "&" || $char == "'" || $char == "\"" || $char == "<" || $char == ">") { 113 | $char = htmlspecialchars($char); 114 | } 115 | } 116 | $new_json .= $char; 117 | break; 118 | } 119 | } 120 | $new_json = preg_replace_callback("{(([\\da-zA-Z_\\.]+))+}", create_function('$match',' 121 | $string = str_replace("", "", $match[0]); 122 | $string = str_replace("", "", $string); 123 | return "" . $string . ""; 124 | '), $new_json); 125 | return $new_json; 126 | } 127 | 128 | 129 | /** 130 | * PHP Integration of Open Flash Chart 131 | * Copyright (C) 2008 John Glazebrook 132 | * 133 | * This library is free software; you can redistribute it and/or 134 | * modify it under the terms of the GNU Lesser General Public 135 | * License as published by the Free Software Foundation; either 136 | * version 2.1 of the License, or (at your option) any later version. 137 | * 138 | * This library is distributed in the hope that it will be useful, 139 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 140 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 141 | * Lesser General Public License for more details. 142 | * 143 | * You should have received a copy of the GNU Lesser General Public 144 | * License along with this library; if not, write to the Free Software 145 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 146 | */ 147 | 148 | 149 | /** 150 | * Format JSON to pretty style 151 | * 152 | * @param string $json JSON to format 153 | * @return string 154 | */ 155 | function json_format($json) 156 | { 157 | $tab = " "; 158 | $new_json = ""; 159 | $indent_level = 0; 160 | $in_string = false; 161 | 162 | /* 163 | commented out by monk.e.boy 22nd May '08 164 | because my web server is PHP4, and 165 | json_* are PHP5 functions... 166 | 167 | $json_obj = json_decode($json); 168 | 169 | if($json_obj === false) 170 | return false; 171 | 172 | $json = json_encode($json_obj); 173 | */ 174 | $len = strlen($json); 175 | 176 | for($c = 0; $c < $len; $c++) 177 | { 178 | $char = $json[$c]; 179 | switch($char) 180 | { 181 | case '{': 182 | case '[': 183 | if(!$in_string) 184 | { 185 | $new_json .= $char . "\n" . str_repeat($tab, $indent_level+1); 186 | $indent_level++; 187 | } 188 | else 189 | { 190 | $new_json .= $char; 191 | } 192 | break; 193 | case '}': 194 | case ']': 195 | if(!$in_string) 196 | { 197 | $indent_level--; 198 | $new_json .= "\n" . str_repeat($tab, $indent_level) . $char; 199 | } 200 | else 201 | { 202 | $new_json .= $char; 203 | } 204 | break; 205 | case ',': 206 | if(!$in_string) 207 | { 208 | $new_json .= ",\n" . str_repeat($tab, $indent_level); 209 | } 210 | else 211 | { 212 | $new_json .= $char; 213 | } 214 | break; 215 | case ':': 216 | if(!$in_string) 217 | { 218 | $new_json .= ": "; 219 | } 220 | else 221 | { 222 | $new_json .= $char; 223 | } 224 | break; 225 | case '"': 226 | if($c > 0 && $json[$c-1] != '\\') 227 | { 228 | $in_string = !$in_string; 229 | } 230 | default: 231 | $new_json .= $char; 232 | break; 233 | } 234 | } 235 | 236 | return $new_json; 237 | } 238 | 239 | /** 240 | * Format bytes to human size 241 | * 242 | * @param integer $bytes Size in byte 243 | * @param integer $precision Precision 244 | * @return string size in k, m, g.. 245 | * @since 1.1.7 246 | */ 247 | function r_human_bytes($bytes, $precision = 2) { 248 | if ($bytes == 0) { 249 | return 0; 250 | } 251 | if ($bytes < 1024) { 252 | return $bytes . "B"; 253 | } 254 | if ($bytes < 1024 * 1024) { 255 | return round($bytes/1024, $precision) . "k"; 256 | } 257 | if ($bytes < 1024 * 1024 * 1024) { 258 | return round($bytes/1024/1024, $precision) . "m"; 259 | } 260 | if ($bytes < 1024 * 1024 * 1024 * 1024) { 261 | return round($bytes/1024/1024/1024, $precision) . "g"; 262 | } 263 | return $bytes; 264 | } 265 | 266 | /** 267 | * Get collection display icon 268 | * 269 | * @param string $collectionName Collection name 270 | * @return string 271 | * @since 1.1.8 272 | */ 273 | function r_get_collection_icon($collectionName) { 274 | if (preg_match("/\\.(files|chunks)$/", $collectionName)){ 275 | return "grid"; 276 | } 277 | if (preg_match("/^system\\.js$/", $collectionName)) { 278 | return "table-systemjs"; 279 | } 280 | return "table"; 281 | } 282 | 283 | ?> -------------------------------------------------------------------------------- /app/langs/es_es/message.php: -------------------------------------------------------------------------------- 1 | 7 | * @version 1.0 8 | */ 9 | 10 | $message["TRANSLATION_NAME"] = "Español - Spanish"; 11 | $message["TRANSLATION_ID"] = 7; 12 | 13 | /** Login interface **/ 14 | $message["admin"] = "Administrador"; 15 | $message["password"] = "Contraseña"; 16 | $message["language"] = "Idioma"; 17 | $message["hour"] = "Hora"; 18 | $message["hours"] = "Horas"; 19 | $message["month"] = "Mes"; 20 | $message["alive"] = "Activo"; 21 | 22 | /** Connection **/ 23 | $message["can_not_connect"] = "Exepción en la conexión de MongoDB: %s. Por favor verifique su configuración."; 24 | 25 | /** Buttons and titles **/ 26 | $message["overview"] = "Visión general"; 27 | $message["server"] = "Servidor"; 28 | $message["status"] = "Estados"; 29 | $message["databases"] = "Bases de datos"; 30 | $message["processlist"] = "Processlist"; 31 | $message["command"] = "Comando"; 32 | $message["execute"] = "Ejecutar"; 33 | $message["master"] = "Maestro"; 34 | $message["masters"] = "Maestros"; 35 | $message["slave"] = "Esclavo"; 36 | $message["slaves"] = "Esclavos"; 37 | $message["master_slave"] = "Maestro/Esclavo"; 38 | $message["query"] = "Consulta"; 39 | $message["refresh"] = "Refrescar"; 40 | $message["insert"] = "Insertar"; 41 | $message["add"] = "Agregar"; 42 | $message["clear"] = "Limpiar"; 43 | $message["delete"] = "Eliminar"; 44 | $message["remove"] = "Eliminar"; 45 | $message["argument"] = "Argumento"; 46 | $message["update"] = "Actualizar"; 47 | $message["duplicate"] = "Duplicar"; 48 | $message["text"] = "Texto"; 49 | $message["yes"] = "Sí"; 50 | $message["no"] = "No"; 51 | $message["statistics"] = "Estadística"; 52 | $message["export"] = "Exportar"; 53 | $message["import"] = "Importar"; 54 | $message["transfer"] = "Transferir"; 55 | $message["drop"] = "Eliminar"; 56 | $message["more"] = "Más"; 57 | $message["rename"] = "Renombrar"; 58 | $message["indexes"] = "Índices"; 59 | $message["properties"] = "Propiedades"; 60 | $message["validate"] = "Validar"; 61 | $message["repair"] = "Reparar"; 62 | $message["all"] = "Todo"; 63 | $message["authentication"] = "Autenticación"; 64 | $message["profile"] = "Perfil"; 65 | $message["create_collection"] = "Nueva colección"; 66 | $message["create_collection_full"] = "Crear nueva colección"; 67 | $message["create_database"] = "Crear nueva base de datos"; 68 | $message["save"] = "Guardar"; 69 | $message["back"] = "Volver"; 70 | $message["server_status"] = "Estado del servidor"; 71 | $message["command_line"] = "Línea de comandos"; 72 | $message["connection"] = "Conexión"; 73 | $message["web"] = "Web"; 74 | $message["directives"] = "Directivas"; 75 | $message["directive"] = "Directiva"; 76 | $message["global_value"] = "Valor global"; 77 | $message["local_value"] = "Valor local"; 78 | $message["build_info"] = "Información de compilación"; 79 | $message["kill"] = "Destruir"; 80 | $message["killop"] = "¿Está usted seguro que quiere destruir la op?"; 81 | $message["killoperation"] = "Destruir operación"; 82 | $message["create"] = "Crear"; 83 | $message["name"] = "Nombre"; 84 | $message["newname"] = "Nuevo nombre"; 85 | $message["oldname"] = "Nombre anterior"; 86 | $message["iscapped"] = "Con tope"; 87 | $message["size"] = "Tamaño"; 88 | $message["max"] = "Máximo"; 89 | $message["modifyrow"] = "Modificar fila"; 90 | $message["data"] = "Datos"; 91 | $message["validarray"] = "Los datos deben tener formato de array PHP válido, de esta forma:"; 92 | $message["responseserver"] = "Respuesta desde el servidor:"; 93 | $message["db"] = "BD"; 94 | $message["gotodbs"] = "Ir a las bases de datos"; 95 | $message["dropdatabase"] = "Eliminar Base de datos"; 96 | $message["dropwarning"] = "Advertencia: ¿Está usted seguro que quiere eliminar la base de datos?"; 97 | $message["dropwarning2"] = "¡Se perderá toda la información en la base de datos!"; 98 | $message["createrow"] = "Crear fila"; 99 | $message["storagesize"] = "Tamaño de almacenamiento"; 100 | $message["datasize"] = "Tamaño de datos"; 101 | $message["indexsize"] = "Tamaño de índice"; 102 | $message["collections"] = "Colecciones"; 103 | $message["objects"] = "Objetos"; 104 | $message["repairdbmsg"] = "¿Está usted seguro que quiere reparar la base de datos?"; 105 | $message["nocollections"] = "No existen colecciones, no se puede transferir"; 106 | $message["nocollections2"] = "No hay ninguna colección todavía"; 107 | $message["download"] = "¿Descargar?"; 108 | $message["compressed"] = "Comprimido"; 109 | $message["rowsexported"] = "filas exportadas"; 110 | $message["createnewcollection"] = "Crear nueva colección en la base de datos"; 111 | $message["target"] = "Objetivo"; 112 | $message["host"] = "Host"; 113 | $message["copyindexes"] = "¿Copiar índices?"; 114 | $message["confirm"] = "Confirmar"; 115 | $message["fields"] = "Campos"; 116 | $message["unique"] = "Único"; 117 | $message["key"] = "Clave"; 118 | $message["operation"] = "Operació"; 119 | $message["removeduplicates"] = "¿Eliminar duplicados?"; 120 | $message["listdbcommands"] = "Lista de comandos de la base de datos"; 121 | $message["format"] = "Formato"; 122 | $message["execute_command"] = "Ejecutar comando"; 123 | $message["validate"] = "Validar"; 124 | $message["dropifexists"] = "¿Eliminar si existe?"; 125 | $message["warningprops"] = "Aviso: Para cambiar las opciones de la colección, se creará una nueva, se copiará toda la información de la colección anterior, y luego se eliminá. Esto proceso podrá tomar mucho tiempo en completarse cuando se tenga una colección grande."; 126 | $message["warningindex"] = "Está usted seguro que quiere eliminar el índice?"; 127 | $message["createindex"] = "Crear índice nuevo"; 128 | $message["copycollection"] = "Copiar colección"; 129 | $message["to"] = "A"; 130 | $message["removeifexists"] = "¿Eliminar objetivo si existe?"; 131 | 132 | /** Add user **/ 133 | $message["users"] = "Usuarios"; 134 | $message["adduser"] = "Agregar usuario"; 135 | $message["username"] = "Nombre de usuario"; 136 | $message["confirm_pass"] = "Confirmar contraseña"; 137 | $message["readonly"] = "¿Sólo lectura?"; 138 | $message["addreplace"] = "Agregar o reemplazar"; 139 | 140 | /** Manual links **/ 141 | $message["querying"] = "Consultas"; 142 | $message["updating"] = "Actualizaciones"; 143 | $message["commands"] = "Comandos"; 144 | $message["jsapi"] = "JS API"; 145 | $message["phpmongo"] = "PHP Mongo"; 146 | 147 | /** Replication **/ 148 | $message["repstatus"] = "Estado de replicación"; 149 | $message["me"] = "Yo"; 150 | 151 | $message["repstatus"] = "Reparar base de datos"; 152 | $message["response_from_server"] = "Respuesta desde el servidor"; 153 | 154 | $message["dropped_from_database"] = "ha sido eliminado de la base de datos"; 155 | 156 | $message["noqueryhistory"] = "No hay antecedentes de consulta todavía."; 157 | $message["requery"] = "Re-consulta"; 158 | 159 | $message["date"] = "Fecha"; 160 | $message["change_level"] = "Cambiar nivel"; 161 | $message["clear_profile"] = "¿Está seguro de borrar el perfil de la base de datos?"; 162 | $message["choose_profiling_level"] = "Elija el nivel de perfil actual"; 163 | $message["profiling_level1"] = "0 - apagado"; 164 | $message["profiling_level2"] = "1 - registrar operaciones lentas (>N ms)"; 165 | $message["profiling_level3"] = "2 - registrar todas las operaciones"; 166 | $message["timecost"] = "Costo en tiempo"; 167 | 168 | /** Collection operations **/ 169 | $message["submit_query"] = "Enviar Consulta"; 170 | $message["explain"] = "Desarrollar"; 171 | $message["clear_conditions"] = "Limpiar condiciones"; 172 | $message["rows_per_page"] = "Filas por página"; 173 | $message["action"] = "Acción"; 174 | $message["limit"] = "Límite"; 175 | $message["new_field"] = "Nuevo campo"; 176 | 177 | /** Top bar **/ 178 | $message["tools"] = "Herramientas"; 179 | $message["manuals"] = "Manuales"; 180 | $message["logout"] = "Cerrar sesión"; 181 | 182 | $message["switch_hosts"] = "Cambiar Hosts"; 183 | 184 | /** About **/ 185 | $message["about_content"] = 'RockMongo es una herramienta de administración para MongoDB, escrita en PHP 5. 186 | 187 |

Vea http://rockmongo.com para más detalles.

188 | 189 |

Si tiene alguna pregunta, por favor envíeme un correo electrónico a: iwind.liu@gmail.com .

'; 190 | 191 | /** Login **/ 192 | $message["loginandrock"] = "Iniciar sesión and Rock"; 193 | $message["changeconfig"] = "Debe cambiar su nombre de usuario y contraseña en el config.php."; 194 | $message["rockmongocredits"] = "Desarrollado por RockMongo v" . (ROCK_MONGO_VERSION) . ", echa un vistazo a la nueva versión aquí."; 195 | 196 | ?> 197 | --------------------------------------------------------------------------------