├── .config └── gitphp.conf.php ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .include ├── Acl.php ├── Application.php ├── Config.php ├── Db.php ├── Db_Result.php ├── Error.php ├── Gitosis.php ├── Http_Response.php ├── Jira.php ├── JiraRestClient.php ├── Log.php ├── MessageException.php ├── Model_Gitosis.php ├── Redmine.php ├── RedmineRestClient.php ├── Resource.php ├── Session.php ├── Tracker.php ├── User.php ├── Util.php ├── cache │ ├── Cache.php │ ├── Memcache.php │ └── memcache_cache_handler.php ├── controller │ ├── Api.php │ ├── Base.php │ ├── Blame.php │ ├── Blob.php │ ├── Blobdiff.php │ ├── Branchdiff.php │ ├── CheckSession.php │ ├── Comment.php │ ├── Commit.php │ ├── Commitdiff.php │ ├── ControllerInterface.php │ ├── DiffBase.php │ ├── Feed.php │ ├── Git.php │ ├── GitosisAccess.php │ ├── GitosisBase.php │ ├── GitosisRepositories.php │ ├── GitosisUsers.php │ ├── Heads.php │ ├── History.php │ ├── Log.php │ ├── Login.php │ ├── Logout.php │ ├── Message.php │ ├── Project.php │ ├── ProjectCreate.php │ ├── ProjectList.php │ ├── Review.php │ ├── Search.php │ ├── SearchText.php │ ├── Snapshot.php │ ├── Tag.php │ ├── Tags.php │ └── Tree.php ├── git │ ├── Archive.php │ ├── Blob.php │ ├── BranchDiff.php │ ├── Commit.php │ ├── DiffContext.php │ ├── DiffExe.php │ ├── DiffHighlighter.php │ ├── FileDiff.php │ ├── FilesystemObject.php │ ├── GitExe.php │ ├── GitObject.php │ ├── Head.php │ ├── Project.php │ ├── ProjectList.php │ ├── ProjectListArray.php │ ├── ProjectListBase.php │ ├── Ref.php │ ├── Tag.php │ ├── TmpDir.php │ ├── Tree.php │ └── TreeDiff.php └── smartyplugins │ ├── block.t.php │ ├── function.scripturl.php │ ├── modifier.agestring.php │ ├── modifier.buglink.php │ └── modifier.highlight.php ├── .locale ├── de_DE │ ├── README │ ├── gitphp.mo │ └── gitphp.po ├── fr_FR │ ├── gitphp.mo │ └── gitphp.po ├── gitphp.pot ├── ru_RU │ ├── gitphp.mo │ └── gitphp.po └── zh_CN │ ├── README │ ├── gitphp.mo │ └── gitphp.po ├── .prettierrc ├── .setup ├── Dockerfile ├── add_user.php ├── etc │ ├── mysql │ │ ├── debian.cnf │ │ └── my.cnf │ ├── nginx │ │ ├── conf.d │ │ │ └── default.conf │ │ └── nginx.conf │ └── php │ │ └── 7.0 │ │ └── fpm │ │ ├── php.ini │ │ └── pool.d │ │ └── www.conf └── local │ ├── init.sh │ ├── mysql.tgz │ └── schema.sql ├── .templates ├── atom.tpl ├── blame.tpl ├── blamedata.tpl ├── blob.tpl ├── blobdiff.tpl ├── blobdiffplain.tpl ├── blobheaders.tpl ├── blobplain.tpl ├── branchdiff.tpl ├── branchdiffplain.tpl ├── commit.tpl ├── commitdiff.tpl ├── commitdiffplain.tpl ├── committip.tpl ├── data.tpl ├── extensions_filter.tpl ├── filediff.tpl ├── filediffsidebyside.tpl ├── footer.tpl ├── git.tpl ├── gitosis.tpl ├── gitosisaccess.tpl ├── gitosismenu.tpl ├── gitosisrepositories.tpl ├── gitosisusers.tpl ├── header.tpl ├── headlist.tpl ├── heads.tpl ├── history.tpl ├── log.tpl ├── login.tpl ├── message.tpl ├── nav.tpl ├── opml.tpl ├── path.tpl ├── project.tpl ├── projectcreate.tpl ├── projectindex.tpl ├── projectlist.tpl ├── refbadges.tpl ├── review.jira.tpl ├── review.mail.tpl ├── review.redmine.tpl ├── review.tpl ├── rss.tpl ├── sbs_non_treediff.tpl ├── sbs_treediff.tpl ├── search.tpl ├── searchfiles.tpl ├── sexy_highlighter.tpl ├── shortlog.tpl ├── shortloglist.tpl ├── snapshot.tpl ├── tag.tpl ├── taglist.tpl ├── tags.tpl ├── tagtip.tpl ├── title.tpl ├── tree.tpl ├── treelist.tpl ├── unified_diff_contents.tpl └── unified_treediff.tpl ├── LICENSE ├── bootstrap.php ├── css ├── ext │ └── jquery.qtip.css ├── fix_lineheight.css ├── gitphp.css ├── gitphpskin.css ├── review.css └── treediff.css ├── images ├── Delete.svg ├── File.svg ├── Folder.svg ├── Search.svg ├── arrow-down.svg ├── check.svg ├── codeisok-logo.png ├── favicon.png ├── ic_settings.svg ├── loader.gif └── login-pattern.png ├── index.php ├── js ├── blame.js ├── blame.min.js ├── diff.js ├── ext │ ├── jquery-1.4.2.min.js │ ├── jquery-1.8.2.min.js │ ├── jquery.cookie.js │ └── jquery.qtip.min.js ├── lang.js ├── lang.min.js ├── projectlist.js ├── review.js ├── sbs_review.js ├── session_checker.js ├── suppresseddiff.js ├── tooltips.js ├── tooltips.min.js ├── tree.js └── utils.js ├── lib ├── geshi │ ├── docs │ │ ├── BUGS │ │ ├── CHANGES │ │ ├── COPYING │ │ ├── README │ │ ├── THANKS │ │ ├── TODO │ │ ├── api │ │ │ ├── __filesource │ │ │ │ └── fsource_geshi_core_geshi.php.html │ │ │ ├── blank.html │ │ │ ├── classtrees_geshi.html │ │ │ ├── elementindex.html │ │ │ ├── elementindex_geshi.html │ │ │ ├── errors.html │ │ │ ├── geshi │ │ │ │ └── core │ │ │ │ │ ├── GeSHi.html │ │ │ │ │ └── _geshi.php.html │ │ │ ├── index.html │ │ │ ├── li_geshi.html │ │ │ ├── media │ │ │ │ ├── banner.css │ │ │ │ ├── images │ │ │ │ │ ├── AbstractClass.png │ │ │ │ │ ├── AbstractClass_logo.png │ │ │ │ │ ├── AbstractMethod.png │ │ │ │ │ ├── AbstractPrivateClass.png │ │ │ │ │ ├── AbstractPrivateClass_logo.png │ │ │ │ │ ├── AbstractPrivateMethod.png │ │ │ │ │ ├── Class.png │ │ │ │ │ ├── Class_logo.png │ │ │ │ │ ├── Constant.png │ │ │ │ │ ├── Constructor.png │ │ │ │ │ ├── Destructor.png │ │ │ │ │ ├── Function.png │ │ │ │ │ ├── Global.png │ │ │ │ │ ├── I.png │ │ │ │ │ ├── Index.png │ │ │ │ │ ├── Interface.png │ │ │ │ │ ├── Interface_logo.png │ │ │ │ │ ├── L.png │ │ │ │ │ ├── Lminus.png │ │ │ │ │ ├── Lplus.png │ │ │ │ │ ├── Method.png │ │ │ │ │ ├── Page.png │ │ │ │ │ ├── Page_logo.png │ │ │ │ │ ├── PrivateClass.png │ │ │ │ │ ├── PrivateClass_logo.png │ │ │ │ │ ├── PrivateMethod.png │ │ │ │ │ ├── PrivateVariable.png │ │ │ │ │ ├── StaticMethod.png │ │ │ │ │ ├── StaticVariable.png │ │ │ │ │ ├── T.png │ │ │ │ │ ├── Tminus.png │ │ │ │ │ ├── Tplus.png │ │ │ │ │ ├── Variable.png │ │ │ │ │ ├── blank.png │ │ │ │ │ ├── class_folder.png │ │ │ │ │ ├── empty.png │ │ │ │ │ ├── file.png │ │ │ │ │ ├── folder.png │ │ │ │ │ ├── function_folder.png │ │ │ │ │ ├── next_button.png │ │ │ │ │ ├── next_button_disabled.png │ │ │ │ │ ├── package.png │ │ │ │ │ ├── package_folder.png │ │ │ │ │ ├── previous_button.png │ │ │ │ │ ├── previous_button_disabled.png │ │ │ │ │ ├── private_class_logo.png │ │ │ │ │ ├── tutorial.png │ │ │ │ │ ├── tutorial_folder.png │ │ │ │ │ └── up_button.png │ │ │ │ └── stylesheet.css │ │ │ ├── packages.html │ │ │ └── todolist.html │ │ ├── geshi-doc.html │ │ ├── geshi-doc.txt │ │ └── phpdoc.ini │ ├── geshi.php │ └── geshi │ │ ├── 4cs.php │ │ ├── abap.php │ │ ├── actionscript.php │ │ ├── actionscript3.php │ │ ├── ada.php │ │ ├── apache.php │ │ ├── applescript.php │ │ ├── apt_sources.php │ │ ├── asm.php │ │ ├── asp.php │ │ ├── autoconf.php │ │ ├── autohotkey.php │ │ ├── autoit.php │ │ ├── avisynth.php │ │ ├── awk.php │ │ ├── bash.php │ │ ├── basic4gl.php │ │ ├── bf.php │ │ ├── bibtex.php │ │ ├── blitzbasic.php │ │ ├── bnf.php │ │ ├── boo.php │ │ ├── c.php │ │ ├── c_mac.php │ │ ├── caddcl.php │ │ ├── cadlisp.php │ │ ├── cfdg.php │ │ ├── cfm.php │ │ ├── chaiscript.php │ │ ├── cil.php │ │ ├── clojure.php │ │ ├── cmake.php │ │ ├── cobol.php │ │ ├── cpp-qt.php │ │ ├── cpp.php │ │ ├── csharp.php │ │ ├── css.php │ │ ├── cuesheet.php │ │ ├── d.php │ │ ├── dcs.php │ │ ├── delphi.php │ │ ├── diff.php │ │ ├── div.php │ │ ├── dos.php │ │ ├── dot.php │ │ ├── ecmascript.php │ │ ├── eiffel.php │ │ ├── email.php │ │ ├── erlang.php │ │ ├── fo.php │ │ ├── fortran.php │ │ ├── freebasic.php │ │ ├── fsharp.php │ │ ├── gambas.php │ │ ├── gdb.php │ │ ├── genero.php │ │ ├── genie.php │ │ ├── gettext.php │ │ ├── glsl.php │ │ ├── gml.php │ │ ├── gnuplot.php │ │ ├── groovy.php │ │ ├── gwbasic.php │ │ ├── haskell.php │ │ ├── hicest.php │ │ ├── hq9plus.php │ │ ├── html4strict.php │ │ ├── icon.php │ │ ├── idl.php │ │ ├── ini.php │ │ ├── inno.php │ │ ├── intercal.php │ │ ├── io.php │ │ ├── j.php │ │ ├── java.php │ │ ├── java5.php │ │ ├── javascript.php │ │ ├── jquery.php │ │ ├── kixtart.php │ │ ├── klonec.php │ │ ├── klonecpp.php │ │ ├── latex.php │ │ ├── lisp.php │ │ ├── locobasic.php │ │ ├── logtalk.php │ │ ├── lolcode.php │ │ ├── lotusformulas.php │ │ ├── lotusscript.php │ │ ├── lscript.php │ │ ├── lsl2.php │ │ ├── lua.php │ │ ├── m68k.php │ │ ├── magiksf.php │ │ ├── make.php │ │ ├── mapbasic.php │ │ ├── matlab.php │ │ ├── mirc.php │ │ ├── mmix.php │ │ ├── modula2.php │ │ ├── modula3.php │ │ ├── mpasm.php │ │ ├── mxml.php │ │ ├── mysql.php │ │ ├── newlisp.php │ │ ├── nsis.php │ │ ├── oberon2.php │ │ ├── objc.php │ │ ├── ocaml-brief.php │ │ ├── ocaml.php │ │ ├── oobas.php │ │ ├── oracle11.php │ │ ├── oracle8.php │ │ ├── oxygene.php │ │ ├── oz.php │ │ ├── pascal.php │ │ ├── pcre.php │ │ ├── per.php │ │ ├── perl.php │ │ ├── perl6.php │ │ ├── pf.php │ │ ├── php-brief.php │ │ ├── php.php │ │ ├── pic16.php │ │ ├── pike.php │ │ ├── pixelbender.php │ │ ├── plsql.php │ │ ├── postgresql.php │ │ ├── povray.php │ │ ├── powerbuilder.php │ │ ├── powershell.php │ │ ├── progress.php │ │ ├── prolog.php │ │ ├── properties.php │ │ ├── providex.php │ │ ├── purebasic.php │ │ ├── python.php │ │ ├── q.php │ │ ├── qbasic.php │ │ ├── rails.php │ │ ├── rebol.php │ │ ├── reg.php │ │ ├── robots.php │ │ ├── rpmspec.php │ │ ├── rsplus.php │ │ ├── ruby.php │ │ ├── sas.php │ │ ├── scala.php │ │ ├── scheme.php │ │ ├── scilab.php │ │ ├── sdlbasic.php │ │ ├── smalltalk.php │ │ ├── smarty.php │ │ ├── sql.php │ │ ├── systemverilog.php │ │ ├── tcl.php │ │ ├── teraterm.php │ │ ├── text.php │ │ ├── thinbasic.php │ │ ├── tsql.php │ │ ├── typoscript.php │ │ ├── unicon.php │ │ ├── vala.php │ │ ├── vb.php │ │ ├── vbnet.php │ │ ├── verilog.php │ │ ├── vhdl.php │ │ ├── vim.php │ │ ├── visualfoxpro.php │ │ ├── visualprolog.php │ │ ├── whitespace.php │ │ ├── whois.php │ │ ├── winbatch.php │ │ ├── xbasic.php │ │ ├── xml.php │ │ ├── xorg_conf.php │ │ ├── xpp.php │ │ └── z80.php ├── mergely │ ├── clike.js │ ├── codemirror.css │ ├── codemirror.js │ ├── codemirror.min.js │ ├── codemirror.min.js.orig │ ├── codemirror.readme │ ├── mergely.css │ ├── mergely.js │ ├── mergely.min.js │ └── searchcursor.js ├── php-gettext │ ├── AUTHORS │ ├── COPYING │ ├── Makefile │ ├── README │ ├── gettext.inc │ ├── gettext.php │ ├── streams.php │ └── tests │ │ ├── LocalesTest.php │ │ └── ParsingTest.php ├── smarty-gettext │ ├── COPYING │ ├── ChangeLog │ ├── README │ ├── block.t.php │ └── tsmarty2c.php ├── smarty │ ├── BUGS │ ├── COPYING.lib │ ├── ChangeLog │ ├── FAQ │ ├── INSTALL │ ├── NEWS │ ├── QUICK_START │ ├── README │ ├── RELEASE_NOTES │ ├── TODO │ ├── demo │ │ ├── configs │ │ │ └── test.conf │ │ ├── index.php │ │ └── templates │ │ │ ├── footer.tpl │ │ │ ├── header.tpl │ │ │ └── index.tpl │ └── libs │ │ ├── Config_File.class.php │ │ ├── Smarty.class.php │ │ ├── Smarty_Compiler.class.php │ │ ├── debug.tpl │ │ ├── internals │ │ ├── core.assemble_plugin_filepath.php │ │ ├── core.assign_smarty_interface.php │ │ ├── core.create_dir_structure.php │ │ ├── core.display_debug_console.php │ │ ├── core.get_include_path.php │ │ ├── core.get_microtime.php │ │ ├── core.get_php_resource.php │ │ ├── core.is_secure.php │ │ ├── core.is_trusted.php │ │ ├── core.load_plugins.php │ │ ├── core.load_resource_plugin.php │ │ ├── core.process_cached_inserts.php │ │ ├── core.process_compiled_include.php │ │ ├── core.read_cache_file.php │ │ ├── core.rm_auto.php │ │ ├── core.rmdir.php │ │ ├── core.run_insert_handler.php │ │ ├── core.smarty_include_php.php │ │ ├── core.write_cache_file.php │ │ ├── core.write_compiled_include.php │ │ ├── core.write_compiled_resource.php │ │ └── core.write_file.php │ │ └── plugins │ │ ├── block.textformat.php │ │ ├── compiler.assign.php │ │ ├── function.assign_debug_info.php │ │ ├── function.config_load.php │ │ ├── function.counter.php │ │ ├── function.cycle.php │ │ ├── function.debug.php │ │ ├── function.eval.php │ │ ├── function.fetch.php │ │ ├── function.html_checkboxes.php │ │ ├── function.html_image.php │ │ ├── function.html_options.php │ │ ├── function.html_radios.php │ │ ├── function.html_select_date.php │ │ ├── function.html_select_time.php │ │ ├── function.html_table.php │ │ ├── function.mailto.php │ │ ├── function.math.php │ │ ├── function.popup.php │ │ ├── function.popup_init.php │ │ ├── modifier.capitalize.php │ │ ├── modifier.cat.php │ │ ├── modifier.count_characters.php │ │ ├── modifier.count_paragraphs.php │ │ ├── modifier.count_sentences.php │ │ ├── modifier.count_words.php │ │ ├── modifier.date_format.php │ │ ├── modifier.debug_print_var.php │ │ ├── modifier.default.php │ │ ├── modifier.escape.php │ │ ├── modifier.indent.php │ │ ├── modifier.lower.php │ │ ├── modifier.nl2br.php │ │ ├── modifier.regex_replace.php │ │ ├── modifier.replace.php │ │ ├── modifier.spacify.php │ │ ├── modifier.string_format.php │ │ ├── modifier.strip.php │ │ ├── modifier.strip_tags.php │ │ ├── modifier.truncate.php │ │ ├── modifier.upper.php │ │ ├── modifier.wordwrap.php │ │ ├── outputfilter.trimwhitespace.php │ │ ├── shared.escape_special_chars.php │ │ └── shared.make_timestamp.php └── syntaxhighlighter │ ├── scripts │ ├── XRegExp.js │ ├── shAutoloader.js │ ├── shBrushAS3.js │ ├── shBrushAppleScript.js │ ├── shBrushBash.js │ ├── shBrushCSharp.js │ ├── shBrushColdFusion.js │ ├── shBrushCpp.js │ ├── shBrushCss.js │ ├── shBrushDelphi.js │ ├── shBrushDiff.js │ ├── shBrushErlang.js │ ├── shBrushGolang.js │ ├── shBrushGroovy.js │ ├── shBrushJScript.js │ ├── shBrushJava.js │ ├── shBrushJavaFX.js │ ├── shBrushKotlin.js │ ├── shBrushObjC.js │ ├── shBrushPerl.js │ ├── shBrushPhp.js │ ├── shBrushPlain.js │ ├── shBrushPowerShell.js │ ├── shBrushProtobuf.js │ ├── shBrushPython.js │ ├── shBrushRst.js │ ├── shBrushRuby.js │ ├── shBrushSass.js │ ├── shBrushScala.js │ ├── shBrushSql.js │ ├── shBrushVb.js │ ├── shBrushXml.js │ ├── shBrushYaml.js │ ├── shCore.js │ └── shLegacy.js │ ├── styles │ ├── shCore.css │ ├── shCoreDefault.css │ ├── shCoreDjango.css │ ├── shCoreEclipse.css │ ├── shCoreEmacs.css │ ├── shCoreFadeToGrey.css │ ├── shCoreMDUltra.css │ ├── shCoreMidnight.css │ ├── shCoreRDark.css │ ├── shThemeDefault.css │ ├── shThemeDjango.css │ ├── shThemeEclipse.css │ ├── shThemeEmacs.css │ ├── shThemeFadeToGrey.css │ ├── shThemeMDUltra.css │ ├── shThemeMidnight.css │ └── shThemeRDark.css │ └── syntaxhighlighter.php ├── package-lock.json ├── package.json ├── readme.md ├── ssh_serve.php ├── start.sh ├── templates_c └── .gitignore ├── update_auth_keys.php └── update_cache.php /.eslintignore: -------------------------------------------------------------------------------- 1 | lib/ 2 | js/ext/ 3 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | browser: true, 4 | es6: true, 5 | }, 6 | extends: 'eslint:recommended', 7 | globals: { 8 | Atomics: 'readonly', 9 | SharedArrayBuffer: 'readonly', 10 | $: 'readonly', 11 | jQuery: 'readonly', 12 | }, 13 | parserOptions: { 14 | ecmaVersion: 2018, 15 | }, 16 | rules: {}, 17 | }; 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .DS_Store 3 | .unrealsync 4 | repositories/* 5 | .setup/storage/* 6 | php_errors.log 7 | update_cache.lock 8 | node_modules 9 | .vscode 10 | -------------------------------------------------------------------------------- /.include/Db_Result.php: -------------------------------------------------------------------------------- 1 | result = $result; 14 | } 15 | 16 | public function freeResult() 17 | { 18 | mysqli_free_result($this->result); 19 | } 20 | 21 | public function fetchAssoc() 22 | { 23 | $result = mysqli_fetch_assoc($this->result); 24 | return $result === null ? self::NO_MORE_ROWS : $result; 25 | } 26 | 27 | public function fetchRow() 28 | { 29 | $result = mysqli_fetch_row($this->result); 30 | return $result === null ? self::NO_MORE_ROWS : $result; 31 | } 32 | 33 | public function getFieldName($num) 34 | { 35 | $field_data = mysqli_fetch_field_direct($this->result, $num); 36 | if ($field_data) { 37 | return $field_data->name; 38 | } 39 | return false; 40 | } 41 | 42 | public function getRowsNum() 43 | { 44 | return mysqli_num_rows($this->result); 45 | } 46 | 47 | public function getFieldsNum() 48 | { 49 | return mysqli_num_fields($this->result); 50 | } 51 | 52 | public function seekData($row_number) 53 | { 54 | mysqli_data_seek($this->result, $row_number); 55 | } 56 | 57 | public static function isResultOk($result) 58 | { 59 | return $result instanceof \mysqli_result; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /.include/Gitosis.php: -------------------------------------------------------------------------------- 1 | GetValue(self::CONFIG_AUTHORIZED_KEYS_FILE, '.ssh/authorized_keys'); 15 | self::$key_file_location = \GitPHP\Config::GIT_HOME . $key_file; 16 | } 17 | return self::$key_file_location; 18 | } 19 | 20 | public static function addKey($user, $key) 21 | { 22 | $ssh_command = self::formatKeyString('.', $user, $key) . PHP_EOL; 23 | return (false !== file_put_contents(self::getAuthorizedKeysFile(), $ssh_command, FILE_APPEND)); 24 | } 25 | 26 | public static function formatKeyString($base_dir, $user, $key) 27 | { 28 | $key = trim($key); 29 | $ssh_command = 'command="' . $base_dir . '/ssh_serve.php ' . $user 30 | . '",no-port-forwarding,no-agent-forwarding,no-X11-forwarding,no-pty ' . $key; 31 | return $ssh_command; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /.include/MessageException.php: -------------------------------------------------------------------------------- 1 | Error = $error; 25 | $this->StatusCode = $statusCode; 26 | parent::__construct($message, $code); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /.include/controller/CheckSession.php: -------------------------------------------------------------------------------- 1 | headers[] = 'Content-Type: application/json; charset=UTF-8'; 19 | } 20 | 21 | public function Render() 22 | { 23 | $response = array('success' => true); 24 | echo json_encode($response); 25 | die; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.include/controller/ControllerInterface.php: -------------------------------------------------------------------------------- 1 | 4 | * @maintainer Aleksandr Izmaylov 5 | */ 6 | 7 | namespace GitPHP\Controller; 8 | 9 | /** 10 | * Interface ControllerInterface 11 | * @package GitPHP\Controller 12 | */ 13 | interface ControllerInterface 14 | { 15 | /** 16 | * Called to render page 17 | * @return mixed 18 | */ 19 | public function Render(); 20 | } 21 | -------------------------------------------------------------------------------- /.include/controller/GitosisBase.php: -------------------------------------------------------------------------------- 1 | ModelGitosis = new \GitPHP\Model_Gitosis(); 32 | parent::__construct(); 33 | if (!$this->Session->getUser()->isGitosisAdmin()) { 34 | $this->redirect('/'); 35 | } 36 | } 37 | 38 | protected function GetTemplate() 39 | { 40 | return 'gitosis.tpl'; 41 | } 42 | 43 | protected function GetCacheKey() {} 44 | 45 | public function GetName($local = false) 46 | { 47 | return 'gitosis'; 48 | } 49 | 50 | protected function ReadQuery() {} 51 | 52 | protected function LoadData() 53 | { 54 | $this->tpl->assign('adminarea', 1); 55 | $this->tpl->assign('sections', static::$_sections); 56 | $this->tpl->assign( 57 | 'current_section', 58 | $this->getCurrentSection() 59 | ); 60 | $this->tpl->assign('form_errors', $this->_form_errors); 61 | } 62 | 63 | abstract protected function getCurrentSection(); 64 | } 65 | -------------------------------------------------------------------------------- /.include/controller/Heads.php: -------------------------------------------------------------------------------- 1 | project) { 10 | throw new \GitPHP\MessageException(__('Project is required'), true); 11 | } 12 | } 13 | 14 | /** 15 | * GetTemplate 16 | * 17 | * Gets the template for this controller 18 | * 19 | * @access protected 20 | * @return string template filename 21 | */ 22 | protected function GetTemplate() 23 | { 24 | return 'heads.tpl'; 25 | } 26 | 27 | /** 28 | * GetCacheKey 29 | * 30 | * Gets the cache key for this controller 31 | * 32 | * @access protected 33 | * @return string cache key 34 | */ 35 | protected function GetCacheKey() 36 | { 37 | return ''; 38 | } 39 | 40 | /** 41 | * GetName 42 | * 43 | * Gets the name of this controller's action 44 | * 45 | * @access public 46 | * @param boolean $local true if caller wants the localized action name 47 | * @return string action name 48 | */ 49 | public function GetName($local = false) 50 | { 51 | if ($local) { 52 | return __('heads'); 53 | } 54 | return 'heads'; 55 | } 56 | 57 | /** 58 | * ReadQuery 59 | * 60 | * Read query into parameters 61 | * 62 | * @access protected 63 | */ 64 | protected function ReadQuery() {} 65 | 66 | /** 67 | * LoadData 68 | * 69 | * Loads data for this template 70 | * 71 | * @access protected 72 | */ 73 | protected function LoadData() 74 | { 75 | $head = $this->project->GetHeadCommit(); 76 | $this->tpl->assign("head", $head); 77 | 78 | $head_list = $this->project->GetHeads(); 79 | if (isset($head_list) && (count($head_list) > 0)) { 80 | $this->tpl->assign("headlist", $head_list); 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /.include/controller/Logout.php: -------------------------------------------------------------------------------- 1 | Session->isAuthorized()) { 55 | $this->Session->logout(); 56 | $this->redirect('/'); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /.include/controller/Tag.php: -------------------------------------------------------------------------------- 1 | project) { 10 | throw new \GitPHP\MessageException(__('Project is required'), true); 11 | } 12 | } 13 | 14 | /** 15 | * GetTemplate 16 | * 17 | * Gets the template for this controller 18 | * 19 | * @access protected 20 | * @return string template filename 21 | */ 22 | protected function GetTemplate() 23 | { 24 | if (isset($this->params['jstip']) && $this->params['jstip']) { 25 | return 'tagtip.tpl'; 26 | } 27 | return 'tag.tpl'; 28 | } 29 | 30 | /** 31 | * GetCacheKey 32 | * 33 | * Gets the cache key for this controller 34 | * 35 | * @access protected 36 | * @return string cache key 37 | */ 38 | protected function GetCacheKey() 39 | { 40 | return isset($this->params['hash']) ? sha1($this->params['hash']) : ''; 41 | } 42 | 43 | /** 44 | * GetName 45 | * 46 | * Gets the name of this controller's action 47 | * 48 | * @access public 49 | * @param boolean $local true if caller wants the localized action name 50 | * @return string action name 51 | */ 52 | public function GetName($local = false) 53 | { 54 | if ($local) { 55 | return __('tag'); 56 | } 57 | return 'tag'; 58 | } 59 | 60 | /** 61 | * ReadQuery 62 | * 63 | * Read query into parameters 64 | * 65 | * @access protected 66 | */ 67 | protected function ReadQuery() 68 | { 69 | if (isset($_GET['h'])) { 70 | $this->params['hash'] = $_GET['h']; 71 | } 72 | 73 | if (isset($_GET['o']) && ($_GET['o'] == 'jstip')) { 74 | $this->params['jstip'] = true; 75 | \GitPHP\Log::GetInstance()->SetEnabled(false); 76 | } 77 | } 78 | 79 | /** 80 | * LoadData 81 | * 82 | * Loads data for this template 83 | * 84 | * @access protected 85 | */ 86 | protected function LoadData() 87 | { 88 | $head = $this->project->GetHeadCommit(); 89 | $this->tpl->assign('head', $head); 90 | 91 | $tag = $this->project->GetTag($this->params['hash']); 92 | 93 | $this->tpl->assign("tag", $tag); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /.include/controller/Tags.php: -------------------------------------------------------------------------------- 1 | project) { 10 | throw new \GitPHP\MessageException(__('Project is required'), true); 11 | } 12 | } 13 | 14 | /** 15 | * GetTemplate 16 | * 17 | * Gets the template for this controller 18 | * 19 | * @access protected 20 | * @return string template filename 21 | */ 22 | protected function GetTemplate() 23 | { 24 | return 'tags.tpl'; 25 | } 26 | 27 | /** 28 | * GetCacheKey 29 | * 30 | * Gets the cache key for this controller 31 | * 32 | * @access protected 33 | * @return string cache key 34 | */ 35 | protected function GetCacheKey() 36 | { 37 | return ''; 38 | } 39 | 40 | /** 41 | * GetName 42 | * 43 | * Gets the name of this controller's action 44 | * 45 | * @access public 46 | * @param boolean $local true if caller wants the localized action name 47 | * @return string action name 48 | */ 49 | public function GetName($local = false) 50 | { 51 | if ($local) { 52 | return __('tags'); 53 | } 54 | return 'tags'; 55 | } 56 | 57 | /** 58 | * ReadQuery 59 | * 60 | * Read query into parameters 61 | * 62 | * @access protected 63 | */ 64 | protected function ReadQuery() {} 65 | 66 | /** 67 | * LoadData 68 | * 69 | * Loads data for this template 70 | * 71 | * @access protected 72 | */ 73 | protected function LoadData() 74 | { 75 | $head = $this->project->GetHeadCommit(); 76 | $this->tpl->assign("head", $head); 77 | 78 | $taglist = $this->project->GetTags(); 79 | if (isset($taglist) && (count($taglist) > 0)) { 80 | $this->tpl->assign("taglist", $taglist); 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /.include/git/DiffContext.php: -------------------------------------------------------------------------------- 1 | skip_suppress = $skip_suppress; 18 | return $this; 19 | } 20 | 21 | public function getSkipSuppress() 22 | { 23 | return $this->skip_suppress; 24 | } 25 | 26 | public function setRenames($renames) 27 | { 28 | $this->renames = $renames; 29 | return $this; 30 | } 31 | 32 | public function getRenames() 33 | { 34 | return $this->renames; 35 | } 36 | 37 | public function setContext($context) 38 | { 39 | $this->context = $context; 40 | return $this; 41 | } 42 | 43 | public function getContext() 44 | { 45 | return $this->context; 46 | } 47 | 48 | public function setIgnoreFormatting($ignore_formatting) 49 | { 50 | $this->ignore_formatting = $ignore_formatting; 51 | return $this; 52 | } 53 | 54 | public function getIgnoreFormatting() 55 | { 56 | return $this->ignore_formatting; 57 | } 58 | 59 | public function setIgnoreWhitespace($ignore_whitespace) 60 | { 61 | $this->ignore_whitespace = $ignore_whitespace; 62 | return $this; 63 | } 64 | 65 | public function getIgnoreWhitespace() 66 | { 67 | return $this->ignore_whitespace; 68 | } 69 | 70 | public function setShowHidden($show_hidden) 71 | { 72 | $this->show_hidden = $show_hidden; 73 | return $this; 74 | } 75 | 76 | public function getShowHidden() 77 | { 78 | return $this->show_hidden; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /.include/git/Head.php: -------------------------------------------------------------------------------- 1 | commit) { 44 | $this->commit = $this->project->GetCommit($this->GetHash()); 45 | } 46 | 47 | return $this->commit; 48 | } 49 | 50 | /** 51 | * CompareAge 52 | * 53 | * Compares two heads by age 54 | * 55 | * @access public 56 | * @static 57 | * @param self $a first head 58 | * @param self $b second head 59 | * @return integer comparison result 60 | */ 61 | public static function CompareAge($a, $b) 62 | { 63 | $aObj = $a->GetCommit(); 64 | $bObj = $b->GetCommit(); 65 | if ($aObj->GetAge() === $bObj->GetAge()) return 0; 66 | return ($aObj->GetAge() < $bObj->GetAge() ? -1 : 1); 67 | } 68 | 69 | /** 70 | * Checks that head exists in repository 71 | * 72 | * @return bool 73 | */ 74 | public function Exists() 75 | { 76 | try { 77 | $this->GetHash(); 78 | return true; 79 | } catch (\Exception $e) { 80 | return false; 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /.include/git/ProjectList.php: -------------------------------------------------------------------------------- 1 | getRepositories(true) as $project) { 51 | $git_projects[] = $project['project']; 52 | $git_projects_settings[$project['project']] = array( 53 | 'description' => $project['description'], 54 | 'category' => $project['category'], 55 | 'notify_email' => $project['notify_email'], 56 | ); 57 | } 58 | 59 | self::$instance = new \GitPHP\Git\ProjectListArray($git_projects); 60 | self::$instance->ApplySettings($git_projects_settings); 61 | } 62 | } 63 | 64 | -------------------------------------------------------------------------------- /.include/git/ProjectListArray.php: -------------------------------------------------------------------------------- 1 | projectConfig = $project_array; 23 | 24 | parent::__construct(); 25 | } 26 | 27 | /** 28 | * PopulateProjects 29 | * 30 | * Populates the internal list of projects 31 | * 32 | * @access protected 33 | * @throws \Exception if file cannot be read 34 | */ 35 | protected function PopulateProjects() 36 | { 37 | foreach ($this->projectConfig as $project) { 38 | $this->projects[$project] = $project; 39 | } 40 | } 41 | 42 | /** 43 | * GetProject 44 | * 45 | * Gets a particular project 46 | * 47 | * @access public 48 | * @param string $project the project to find 49 | * 50 | * @return \GitPHP\Git\Project mixed project object or null 51 | * @throws \Exception 52 | */ 53 | public function GetProject($project) 54 | { 55 | if (empty($project)) { 56 | return null; 57 | } 58 | 59 | if (isset($this->projects[$project])) { 60 | if (is_string($this->projects[$project])) { 61 | try { 62 | $ProjectObject = new \GitPHP\Git\Project($project); 63 | } catch (\Exception $e) { 64 | unset($this->projects[$project]); 65 | return null; 66 | } 67 | // unfortunately we need to set this early because ApplyProjectSettings uses it 68 | $this->projects[$project] = $ProjectObject; 69 | 70 | $this->ApplyProjectSettings($project, $this->projectSettings[$project]); 71 | } 72 | return $this->projects[$project]; 73 | } 74 | 75 | return null; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /.include/smartyplugins/function.scripturl.php: -------------------------------------------------------------------------------- 1 | 8 | * @copyright Copyright (c) 2010 Christopher Han 9 | * @package GitPHP 10 | * @subpackage Smarty 11 | */ 12 | 13 | /** 14 | * scripturl smarty function 15 | * 16 | * @param array $params function parameters 17 | * @param mixed $smarty smarty object 18 | * @return string script url 19 | */ 20 | function smarty_function_scripturl($params, &$smarty) 21 | { 22 | if (\GitPHP\Config::GetInstance()->HasKey('self')) { 23 | $selfurl = \GitPHP\Config::GetInstance()->GetValue('self'); 24 | if (!empty($selfurl)) { 25 | if (substr($selfurl, -4) != '.php') { 26 | $selfurl = \GitPHP\Util::AddSlash($selfurl); 27 | } 28 | return $selfurl; 29 | } 30 | } 31 | 32 | if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on')) 33 | $scriptstr = 'https://'; 34 | else 35 | $scriptstr = 'http://'; 36 | 37 | $scriptstr .= $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; 38 | 39 | return $scriptstr; 40 | } 41 | 42 | ?> 43 | -------------------------------------------------------------------------------- /.include/smartyplugins/modifier.agestring.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010 Christopher Han 10 | * @package GitPHP 11 | * @subpackage Smarty 12 | */ 13 | 14 | /** 15 | * agestring smarty modifier 16 | * 17 | * @param int $age age in seconds 18 | * @return string human readable string 19 | */ 20 | function smarty_modifier_agestring($age) 21 | { 22 | if ($age > 60*60*24*365*2) { 23 | 24 | $years = (int)($age/60/60/24/365); 25 | return sprintf(__n('%1$d year ago', '%1$d years ago', $years), $years); 26 | 27 | } else if ($age > 60*60*24*(365/12)*2) { 28 | 29 | $months = (int)($age/60/60/24/(365/12)); 30 | return sprintf(__n('%1$d month ago', '%1$d months ago', $months), $months); 31 | 32 | } else if ($age > 60*60*24*7*2) { 33 | 34 | $weeks = (int)($age/60/60/24/7); 35 | return sprintf(__n('%1$d week ago', '%1$d weeks ago', $weeks), $weeks); 36 | 37 | } else if ($age > 60*60*24*2) { 38 | 39 | $days = (int)($age/60/60/24); 40 | return sprintf(__n('%1$d day ago', '%1$d days ago', $days), $days); 41 | 42 | } else if ($age > 60*60*2) { 43 | 44 | $hours = (int)($age/60/60); 45 | return sprintf(__n('%1$d hour ago', '%1$d hours ago', $hours), $hours); 46 | 47 | } else if ($age > 60*2) { 48 | 49 | $min = (int)($age/60); 50 | return sprintf(__n('%1$d min ago', '%1$d min ago', $min), $min); 51 | 52 | } else if ($age > 2) { 53 | 54 | $sec = (int)$age; 55 | return sprintf(__n('%1$d sec ago', '%1$d sec ago', $sec), $sec); 56 | 57 | } 58 | 59 | return __('right now'); 60 | } 61 | 62 | ?> 63 | -------------------------------------------------------------------------------- /.include/smartyplugins/modifier.buglink.php: -------------------------------------------------------------------------------- 1 | 8 | * @copyright Copyright (c) 2010 Christopher Han 9 | * @package GitPHP 10 | * @subpackage Smarty 11 | */ 12 | 13 | /** 14 | * buglink smarty modifier 15 | * 16 | * @param string $text text to find bug references in 17 | * @param string $pattern search pattern 18 | * @param string $link link pattern 19 | * @return string text with bug references linked 20 | */ 21 | function smarty_modifier_buglink($text, $pattern = null, $link = null) 22 | { 23 | if (empty($text) || empty($pattern) || empty($link)) 24 | return $text; 25 | 26 | $fullLink = '${0}'; 27 | 28 | return preg_replace($pattern, $fullLink, $text); 29 | } 30 | -------------------------------------------------------------------------------- /.include/smartyplugins/modifier.highlight.php: -------------------------------------------------------------------------------- 1 | 8 | * @copyright Copyright (c) 2010 Christopher Han 9 | * @package GitPHP 10 | * @subpackage Smarty 11 | */ 12 | 13 | /** 14 | * highlight smarty modifier 15 | * 16 | * @param string $haystack string to search in 17 | * @param string $needle substring to search for 18 | * @param int $trimlen length to trim string to 19 | * @param bool $escape true to html escape the string 20 | * @param string $highlightclass CSS class to highlight with 21 | * @return string highlighted string 22 | */ 23 | function smarty_modifier_highlight($haystack, $needle, $trimlen = NULL, $escape = false, $highlightclass = 'searchmatch') 24 | { 25 | if (false !== $offset = stripos($haystack, $needle)) { 26 | $regs = [$haystack, substr($haystack, 0, $offset), substr($haystack, $offset, strlen($needle)), substr($haystack, $offset + strlen($needle))]; 27 | if (isset($trimlen) && ($trimlen > 0)) { 28 | $linelen = strlen($regs[0]); 29 | if ($linelen > $trimlen) { 30 | $matchlen = strlen($regs[2]); 31 | $remain = floor(($trimlen - $matchlen) / 2); 32 | $leftlen = strlen($regs[1]); 33 | $rightlen = strlen($regs[3]); 34 | if ($leftlen > $remain) { 35 | $leftremain = $remain; 36 | if ($rightlen < $remain) 37 | $leftremain += ($remain - $rightlen); 38 | $regs[1] = "…" . substr($regs[1], ($leftlen - ($leftremain - 3))); 39 | } 40 | if ($rightlen > $remain) { 41 | $rightremain = $remain; 42 | if ($leftlen < $remain) 43 | $rightremain += ($remain - $leftlen); 44 | $regs[3] = substr($regs[3],0,$rightremain-3) . "…"; 45 | } 46 | } 47 | } 48 | if ($escape) { 49 | $regs[1] = htmlspecialchars($regs[1]); 50 | $regs[2] = htmlspecialchars($regs[2]); 51 | $regs[3] = htmlspecialchars($regs[3]); 52 | } 53 | $ret = $regs[1] . "" . $regs[3]; 57 | return $ret; 58 | } 59 | 60 | return $haystack; 61 | } 62 | 63 | ?> 64 | -------------------------------------------------------------------------------- /.locale/de_DE/README: -------------------------------------------------------------------------------- 1 | German Translation for GitPHP by Andy Tandler 2 | 3 | To Install the Language you need only few Steps: 4 | 5 | 1. Copy Directory de_DE into locale, where the File gitphp.pot is located. 6 | 7 | 2. Open include/Resource.class.php and search for function LocaleToName. 8 | Add this case to the switch: 9 | 10 | case 'de_DE': 11 | return 'Deutsch'; 12 | 13 | 3. If you want that German is the pre-selected Language in your GitPHP, 14 | open config/gitphp.conf.php and add this Line: 15 | 16 | $gitphp_conf['locale'] = 'de_DE'; 17 | -------------------------------------------------------------------------------- /.locale/de_DE/gitphp.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/.locale/de_DE/gitphp.mo -------------------------------------------------------------------------------- /.locale/fr_FR/gitphp.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/.locale/fr_FR/gitphp.mo -------------------------------------------------------------------------------- /.locale/ru_RU/gitphp.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/.locale/ru_RU/gitphp.mo -------------------------------------------------------------------------------- /.locale/zh_CN/README: -------------------------------------------------------------------------------- 1 | GitPHP的中文简体语言包由seefan 提供 2 | 3 | 要安装语言包请进行以下几个步骤: 4 | 5 | 1. 将 zh_CN 拷贝到 locale 目录下, 那个目录下已经有一个 gitphp.pot 文件. 6 | 7 | 2. 打开 include/Resource.class.php ,查找 function LocaleToName. 8 | 将以上内容加到 switch里: 9 | 10 | case 'zh_CN': 11 | return '中文简体'; 12 | 13 | 3. 如何你想 GitPHP 预先选中“中文简体”, 14 | 打开 config/gitphp.conf.php 后加入以下一行内容: 15 | 16 | $gitphp_conf['locale'] = 'zh_CN'; 17 | 18 | -------------------------------------------------------------------------------- /.locale/zh_CN/gitphp.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/.locale/zh_CN/gitphp.mo -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 100, 3 | "singleQuote": true, 4 | "tabWidth": 4 5 | } 6 | -------------------------------------------------------------------------------- /.setup/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | MAINTAINER Ilya Ageev 3 | 4 | ENV MYSQL_ROOT_PASSWORD root 5 | 6 | RUN export DEBIAN_FRONTEND=noninteractive \ 7 | && apt-get update -y \ 8 | && apt-get install -y --no-install-recommends \ 9 | gnupg \ 10 | software-properties-common 11 | 12 | RUN add-apt-repository ppa:ondrej/php \ 13 | && bash -c "debconf-set-selections <<< 'mysql-server-5.7 mysql-server/root_password password $MYSQL_ROOT_PASSWORD'" \ 14 | && bash -c "debconf-set-selections <<< 'mysql-server-5.7 mysql-server/root_password_again password $MYSQL_ROOT_PASSWORD'" \ 15 | && echo "UTC" > /etc/timezone 16 | 17 | RUN export DEBIAN_FRONTEND=noninteractive \ 18 | && apt-get update -y \ 19 | && apt-get install -y --no-install-recommends \ 20 | nginx \ 21 | mysql-server-5.7 \ 22 | php7.0-curl \ 23 | php7.0-fpm \ 24 | php7.0-gd \ 25 | php7.0-imagick \ 26 | php7.0-json \ 27 | php7.0-mbstring \ 28 | php7.0-mysqlnd \ 29 | php7.0-soap \ 30 | php7.0-xml \ 31 | php7.0-cli \ 32 | strace \ 33 | vim \ 34 | openssh-server \ 35 | git \ 36 | sendmail \ 37 | imagemagick \ 38 | exiftool \ 39 | && rm -rf /var/lib/apt/lists/* 40 | 41 | RUN useradd -ms /bin/bash git && usermod -G www-data git 42 | 43 | RUN mkdir -pv /local/logs 44 | COPY etc/ /etc/ 45 | COPY local/ /local/ 46 | 47 | VOLUME /var/lib/mysql 48 | VOLUME /home/git 49 | VOLUME /local/codeisok 50 | 51 | EXPOSE 80 22 52 | CMD bash /local/init.sh 53 | -------------------------------------------------------------------------------- /.setup/add_user.php: -------------------------------------------------------------------------------- 1 | #!/usr/bin/php 2 | &1"); 9 | if ($res['code'] !== 0) { 10 | $res = run('useradd -d /home/' . $user . ' -m ' . $user . ' -s /bin/bash'); 11 | if ($res['code'] === 0) { 12 | echo "Provide ssh-key:\n"; 13 | $ssh_key = fgets(STDIN); 14 | $ssh_path = '/home/' . $user . '/.ssh'; 15 | if (mkdir($ssh_path, 0700)) { 16 | chown($ssh_path, $user); 17 | if (file_put_contents($ssh_path . '/authorized_keys', $ssh_key, FILE_APPEND) !== false) { 18 | chmod($ssh_path . '/authorized_keys', 0600); 19 | chown($ssh_path . '/authorized_keys', $user); 20 | $res = run('usermod ' . $user . ' -G ubuntu'); 21 | if ($res['code'] === 0) { 22 | echo "Done.\n"; 23 | } else { 24 | echo "Can't add group to user.\n"; 25 | } 26 | } else { 27 | echo "Can't add key to authorized_keys file.\n"; 28 | } 29 | } else { 30 | echo "Can't create .ssh dir in user home folder.\n"; 31 | } 32 | } else { 33 | echo "Can't do useradd.\n"; 34 | } 35 | } else { 36 | echo "User already exists.\n"; 37 | } 38 | } else { 39 | usage(); 40 | } 41 | 42 | function usage() { 43 | echo "Usage: " . basename(__FILE__) . " -u\n"; 44 | } 45 | 46 | function run($cmd) { 47 | $out = []; 48 | $code = 0; 49 | exec($cmd, $out, $code); 50 | return ['code' => $code, 'output' => implode("\n", $out)]; 51 | } 52 | -------------------------------------------------------------------------------- /.setup/etc/mysql/debian.cnf: -------------------------------------------------------------------------------- 1 | # Automatically generated for Debian scripts. DO NOT TOUCH! 2 | [client] 3 | host = localhost 4 | user = debian-sys-maint 5 | password = 1GHJhgsxKHKAD789jhaKA 6 | socket = /var/run/mysqld/mysqld.sock 7 | [mysql_upgrade] 8 | host = localhost 9 | user = debian-sys-maint 10 | password = 1GHJhgsxKHKAD789jhaKA 11 | socket = /var/run/mysqld/mysqld.sock 12 | basedir = /usr 13 | -------------------------------------------------------------------------------- /.setup/etc/nginx/conf.d/default.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | # Make site accessible from http://localhost/ 6 | server_name localhost; 7 | 8 | root /local/codeisok/; 9 | index index.php; 10 | 11 | error_log /local/logs/codeisok.error.log error; 12 | access_log /local/logs/codeisok.access.log; 13 | 14 | location ~ \.php$ { 15 | include /etc/nginx/fastcgi_params; 16 | fastcgi_pass unix:/run/php/php7.0-fpm.sock; 17 | fastcgi_param fastcgi_index index.php; 18 | fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; 19 | } 20 | 21 | location ~ /api/ { 22 | include /etc/nginx/fastcgi_params; 23 | fastcgi_pass unix:/run/php/php7.0-fpm.sock; 24 | fastcgi_param fastcgi_index index.php; 25 | fastcgi_param SCRIPT_FILENAME $document_root/index.php; 26 | } 27 | 28 | location ~ /r/([0-9]+)$ { 29 | set $review_id $1; 30 | fastcgi_pass unix:/run/php/php7.0-fpm.sock; 31 | fastcgi_param SCRIPT_FILENAME /local/codeisok/index.php; 32 | include /etc/nginx/fastcgi_params; 33 | set $query a=reviews&review=$review_id&$query_string; 34 | fastcgi_param QUERY_STRING $query; 35 | rewrite ^ "http://${host}/?${query}" break; 36 | } 37 | 38 | rewrite ^/(.*).git$ /$1 permanent; 39 | 40 | location ~ /\. { 41 | deny all; 42 | } 43 | 44 | location ~ /repositories { 45 | deny all; 46 | } 47 | 48 | location ~ \.css { 49 | add_header Content-Type text/css; 50 | } 51 | 52 | location ~ \.js { 53 | add_header Content-Type application/x-javascript; 54 | } 55 | 56 | location ~ \.png { 57 | add_header Content-Type image/png; 58 | } 59 | 60 | location ~ \.gif { 61 | add_header Content-Type image/gif; 62 | } 63 | 64 | location / { 65 | include /etc/nginx/fastcgi_params; 66 | fastcgi_pass unix:/run/php/php7.0-fpm.sock; 67 | fastcgi_param fastcgi_index index.php; 68 | fastcgi_param SCRIPT_FILENAME $document_root/index.php; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /.setup/etc/nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | user git; 2 | worker_processes auto; 3 | pid /run/nginx.pid; 4 | 5 | events { 6 | worker_connections 1024; 7 | } 8 | 9 | http { 10 | sendfile on; 11 | tcp_nopush on; 12 | tcp_nodelay on; 13 | keepalive_timeout 65; 14 | types_hash_max_size 2048; 15 | client_max_body_size 450M; 16 | 17 | log_format main '$remote_addr - $remote_user [$time_local] $request_method $scheme://$http_host$request_uri ' 18 | '"$status" $body_bytes_sent "$http_referer" ' 19 | '"$http_user_agent" "$http_x_forwarded_for" "$request_time" "$upstream_response_time"'; 20 | 21 | error_log /local/logs/error.log; 22 | access_log /local/logs/access.log main; 23 | 24 | gzip on; 25 | gzip_disable "msie6"; 26 | gzip_types text/html text/plain text/css application/xml application/x-javascript application/javascript application/json; 27 | 28 | include /etc/nginx/mime.types; 29 | default_type application/octet-stream; 30 | 31 | include /etc/nginx/conf.d/*.conf; 32 | } 33 | -------------------------------------------------------------------------------- /.setup/local/init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #first run, mysql init setup should be done 4 | if [ ! -d "/var/lib/mysql/mysql" ]; then 5 | cd /local 6 | tar -xzf mysql.tgz 7 | mv mysql/* /var/lib/mysql/ 8 | chown mysql:mysql -R /var/lib/mysql 9 | fi 10 | 11 | service mysql start 12 | service php7.0-fpm start 13 | service ssh start 14 | 15 | mysql -uroot -proot < /local/schema.sql 16 | 17 | #first run, git home should be initialised 18 | if [ ! -d "/home/git/.ssh" ]; then 19 | mkdir /home/git/.ssh && chmod 0700 /home/git/.ssh 20 | touch /home/git/.ssh/authorized_keys && chmod 0600 /home/git/.ssh/authorized_keys 21 | chown -R git.git /home/git 22 | ln -s /local/codeisok/ssh_serve.php /home/git/ssh_serve.php 23 | mkdir /local/codeisok/repositories 24 | chown git.git /local/codeisok/repositories 25 | fi 26 | 27 | 28 | #sendmail init 29 | hostname=$(hostname) 30 | localhost=$(head -n 1 /etc/hosts | awk '{print $2}') 31 | echo "127.0.0.1 $localhost $localhost.localdomain $hostname $hostname.localdomain" >> /etc/hosts 32 | service sendmail start 33 | 34 | if [ -t 1 ]; then 35 | # Interactive mode, stdout is terminal 36 | service nginx start 37 | bash 38 | else 39 | nginx -g 'daemon off;' 40 | fi 41 | -------------------------------------------------------------------------------- /.setup/local/mysql.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/.setup/local/mysql.tgz -------------------------------------------------------------------------------- /.templates/atom.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * atom.tpl 3 | * gitphp: A PHP git repository browser 4 | * Component: Atom feed template 5 | * 6 | * Copyright (C) 2010 Christian Weiske 7 | *} 8 | 9 | 10 | {$project->GetProject()} 11 | {$project->GetProject()} log 12 | 13 | 14 | {scripturl}?p={$project->GetProject()|urlencode} 15 | {if $log} 16 | {$log.0->GetCommitterEpoch()|date_format:"%FT%T+00:00"} 17 | {/if} 18 | 19 | {foreach from=$log item=logitem} 20 | 21 | {scripturl}?p={$project->GetProject()|urlencode}&a=commit&h={$logitem->GetHash()} 22 | {$logitem->GetTitle()|escape:'html'} 23 | 24 | {$logitem->GetAuthorName()|escape:'html'} 25 | 26 | {$logitem->GetCommitterEpoch()|date_format:"%FT%T+00:00"} 27 | {$logitem->GetCommitterEpoch()|date_format:"%FT%T+00:00"} 28 | 29 | {$logitem->GetTitle()|escape:'html'} 30 | 31 |
32 |

33 | {foreach from=$logitem->GetComment() item=line} 34 | {$line|htmlspecialchars}
35 | {/foreach} 36 |

37 |
    38 | {foreach from=$logitem->DiffToParent() item=diffline} 39 |
  • {$diffline->GetToFile()|htmlspecialchars}
  • 40 | {/foreach} 41 |
42 |
43 |
44 |
45 | {/foreach} 46 | 47 |
48 | -------------------------------------------------------------------------------- /.templates/blame.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * blame.tpl 3 | * gitphp: A PHP git repository browser 4 | * Component: Blame view template 5 | * 6 | * Copyright (C) 2010 Christopher Han 7 | *} 8 | {include file='header.tpl'} 9 | 10 | 22 | 23 | {include file='title.tpl' titlecommit=$commit} 24 | 25 | {include file='path.tpl' pathobject=$blob target='blob'} 26 | 27 |
28 | {if $geshi} 29 | {$geshihead} 30 | 31 | {include file='blamedata.tpl'} 32 | 33 | {$geshibody} 34 | {$geshifoot} 35 | {else} 36 | 37 | {foreach from=$blob->GetData(true) item=blobline name=blob} 38 | {assign var=blamecommit value=$blame[$smarty.foreach.blob.iteration]} 39 | {if $blamecommit} 40 | {cycle values="light,dark" assign=rowclass} 41 | {/if} 42 | 43 | 48 | 53 | 54 | 55 | 56 | {/foreach} 57 |
44 | {if $blamecommit} 45 | {$blamecommit->GetAuthorEpoch()|date_format:"%Y-%m-%d %H:%M:%S"} 46 | {/if} 47 | 49 | {if $blamecommit} 50 | {$blamecommit->GetAuthor()} 51 | {/if} 52 | {$smarty.foreach.blob.iteration}{$blobline|escape}
58 | {/if} 59 |
60 | 61 | {include file='footer.tpl'} 62 | -------------------------------------------------------------------------------- /.templates/blamedata.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * blamedata.tpl 3 | * gitphp: A PHP git repository browser 4 | * Component: Blame data column template 5 | * 6 | * Copyright (C) 2010 Christopher Han 7 | *} 8 | 9 | {foreach from=$blob->GetData(true) item=blobline name=blob} 10 | {assign var=blamecommit value=$blame[$smarty.foreach.blob.iteration]} 11 | {if $blamecommit} 12 | {if $opened}{/if} 13 |
14 | {assign var=opened value=true} 15 | {$blamecommit->GetAuthorEpoch()|date_format:"%Y-%m-%d %H:%M:%S"} 16 | {$blamecommit->GetAuthorName()|escape} 17 | {/if} 18 |
19 | {/foreach} 20 | {if $opened}
{/if} 21 | -------------------------------------------------------------------------------- /.templates/blobdiffplain.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * blobdiffplain.tpl 3 | * gitphp: A PHP git repository browser 4 | * Component: Blobdiff plain template 5 | * 6 | * Copyright (C) 2009 Christopher Han 7 | *} 8 | {assign var="diff" value=$filediff->GetDiff($file, false)} 9 | {if $escape} 10 | {$diff|escape:'html'} 11 | {else} 12 | {$diff} 13 | {/if} 14 | -------------------------------------------------------------------------------- /.templates/blobheaders.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * blobheaders.tpl 3 | * gitphp: A PHP git repository browser 4 | * Component: Blob header dummy template 5 | * 6 | * Copyright (C) 2009 Christopher Han 7 | *} 8 | {$blobheaders} 9 | -------------------------------------------------------------------------------- /.templates/blobplain.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * blobplain.tpl 3 | * gitphp: A PHP git repository browser 4 | * Component: Blob plain template 5 | * 6 | * Copyright (C) 2009 Christopher Han 7 | *} 8 | {$blob->GetData()} 9 | -------------------------------------------------------------------------------- /.templates/branchdiffplain.tpl: -------------------------------------------------------------------------------- 1 | {foreach from=$branchdiff item=filediff} 2 | {$filediff->GetDiff('', true, false, false)} 3 | {/foreach} 4 | -------------------------------------------------------------------------------- /.templates/commitdiffplain.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * commitdiffplain.tpl 3 | * gitphp: A PHP git repository browser 4 | * Component: Plaintext diff template 5 | * 6 | * Copyright (C) 2006 Christopher Han 7 | *} 8 | From: {$commit->GetAuthor()} 9 | Date: {$commit->GetAuthorEpoch()|date_format:"%a, %d %b %Y %H:%M:%S %z"} 10 | Subject: {$commit->GetTitle()} 11 | {assign var=tag value=$commit->GetContainingTag()} 12 | {if $tag} 13 | X-Git-Tag: {$tag->GetName()} 14 | {/if} 15 | X-Git-Url: {scripturl}?p={$project->GetProject()|urlencode}&a=commitdiff&h={$commit->GetHash()} 16 | --- 17 | {foreach from=$commit->GetComment() item=line} 18 | {$line} 19 | {/foreach} 20 | --- 21 | 22 | 23 | {foreach from=$commit_tree_diff item=filediff} 24 | {$filediff->GetDiff('', true, false, false)} 25 | {/foreach} 26 | -------------------------------------------------------------------------------- /.templates/committip.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * committip.tpl 3 | * gitphp: A PHP git repository browser 4 | * Component: Commit tooltip template 5 | * 6 | * Copyright (C) 2010 Christopher Han 7 | *} 8 |
9 | {t}author{/t}: {$commit->GetAuthor()} ({$commit->GetAuthorEpoch()|date_format:"%Y-%m-%d %H:%M:%S"}) 10 |
11 | {t}committer{/t}: {$commit->GetCommitter()} ({$commit->GetCommitterEpoch()|date_format:"%Y-%m-%d %H:%M:%S"}) 12 |

13 | {foreach from=$commit->GetComment() item=line} 14 | {$line|escape}
15 | {/foreach} 16 |
17 | -------------------------------------------------------------------------------- /.templates/data.tpl: -------------------------------------------------------------------------------- 1 | {$data} 2 | -------------------------------------------------------------------------------- /.templates/extensions_filter.tpl: -------------------------------------------------------------------------------- 1 | {if $extensions} 2 |
3 | {foreach from=$statuses item=st} 4 | {$st} 5 | {/foreach} 6 | {foreach from=$extensions item=ext} 7 | {$ext} 8 | {/foreach} 9 | {foreach from=$folders item=folder} 10 | {$folder} 11 | {/foreach} 12 | (+Shift for single select) 13 |
14 | {/if} -------------------------------------------------------------------------------- /.templates/filediff.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * filediff.tpl 3 | * gitphp: A PHP git repository browser 4 | * Component: Single file diff template 5 | * 6 | * Copyright (C) 2009 Christopher Han 7 | *} 8 | {assign var="decoration" value=$filediff->GetDecorationData()} 9 | {if $filediff->getDiffTypeImage()} 10 | {$diff} 11 | {else} 12 | {if $filediff->getDiffTooLarge() && $sexy} 13 |

14 | Please wait 15 | Diff suppressed. Click to show. 16 |

17 | {else} 18 | {if $sexy} 19 |
{foreach from=$diff item=diffline}{$diffline}
20 | {/foreach}
21 | {else} 22 |
23 | {foreach from=$diff item=diffline} 24 | {if substr($diffline,0,1)=="+"} 25 | {$diffline} 26 | {elseif substr($diffline,0,1)=="-"} 27 | {$diffline} 28 | {elseif substr($diffline,0,1)=="@"} 29 | {$diffline} 30 | {else} 31 | {$diffline} 32 | {/if} 33 | {/foreach} 34 |
35 | {/if} 36 | {/if} 37 | {/if} 38 | -------------------------------------------------------------------------------- /.templates/footer.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * footer.tpl 3 | * gitphp: A PHP git repository browser 4 | * Component: Page footer template 5 | * 6 | * Copyright (C) 2006 Christopher Han 7 | *} 8 | 39 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /.templates/git.tpl: -------------------------------------------------------------------------------- 1 | {$result} -------------------------------------------------------------------------------- /.templates/gitosis.tpl: -------------------------------------------------------------------------------- 1 | {include file='header.tpl'} 2 | {include file='gitosismenu.tpl'} 3 | 4 | {assign var=current_template value="gitosis`$current_section`.tpl"} 5 | {include file=$current_template} 6 | 7 | {include file='footer.tpl'} 8 | -------------------------------------------------------------------------------- /.templates/gitosismenu.tpl: -------------------------------------------------------------------------------- 1 | 13 | -------------------------------------------------------------------------------- /.templates/headlist.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * Headlist 3 | * 4 | * Head list template fragment 5 | * 6 | * @author Christopher Han 7 | * @copyright Copyright (c) 2010 Christopher Han 8 | * @packge GitPHP 9 | * @subpackage Template 10 | *} 11 | 12 | 13 | {* Loop and display each head *} 14 | {foreach from=$headlist item=head name=heads} 15 | {assign var=headcommit value=$head->GetCommit()} 16 | 17 | 18 | 29 | 30 | {/foreach} 31 | {if $hasmoreheads} 32 | 33 | 34 | 35 | {/if} 36 |
{$headcommit->GetAge()|agestring} 19 | {$head->GetName()} 20 | 21 | 28 |
Show More
37 | 38 | -------------------------------------------------------------------------------- /.templates/heads.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * heads.tpl 3 | * gitphp: A PHP git repository browser 4 | * Component: Head view template 5 | * 6 | * Copyright (C) 2009 Christopher Han 7 | *} 8 | {include file='header.tpl'} 9 | 10 | {* Nav *} 11 | 14 | 15 | {include file='title.tpl' target='summary'} 16 | 17 | {include file='headlist.tpl'} 18 | 19 | {include file='footer.tpl'} 20 | 21 | -------------------------------------------------------------------------------- /.templates/login.tpl: -------------------------------------------------------------------------------- 1 | {include file='header.tpl' no_user_header=1} 2 | 3 | 24 | 25 | {* {include file='footer.tpl'} *} 26 | -------------------------------------------------------------------------------- /.templates/message.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * message.tpl 3 | * gitphp: A PHP git repository browser 4 | * Component: Warning/error message template 5 | * 6 | * Copyright (C) 2009 Christopher Han 7 | *} 8 | {include file='header.tpl'} 9 | 10 |
{$message}
11 | 12 | {include file='footer.tpl'} 13 | -------------------------------------------------------------------------------- /.templates/opml.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * opml.tpl 3 | * gitphp: A PHP git repository browser 4 | * Component: OPML template 5 | * 6 | * Copyright (C) 2009 Christopher Han 7 | *} 8 | 9 | 10 | 11 | {$pagetitle} OPML Export 12 | 13 | 14 | 15 | 16 | {foreach from=$projectlist item=proj} 17 | 18 | 19 | {/foreach} 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /.templates/path.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * Path 3 | * 4 | * Path template 5 | * 6 | * @author Christopher Han 7 | * @copyright Copyright (c) 2010 Christopher Han 8 | * @package GitPHP 9 | * @subpackage Template 10 | *} 11 | 12 | {if $pathobject} 13 |
14 | {assign var=pathobjectcommit value=$pathobject->GetCommit()} 15 | {assign var=pathobjecttree value=$pathobjectcommit->GetTree()} 16 | [{$project->GetProject()}] / 17 | {foreach from=$pathobject->GetPathTree() item=pathtreepiece} 18 | {$pathtreepiece->GetName()} / 19 | {/foreach} 20 | {if $pathobject instanceof \GitPHP\Git\Blob} 21 | {if $target == 'blobplain'} 22 | {$pathobject->GetName()} 23 | {elseif $target == 'blob'} 24 | {$pathobject->GetName()} 25 | {else} 26 | {$pathobject->GetName()} 27 | {/if} 28 | {elseif $pathobject->GetName()} 29 | {if $target == 'tree'} 30 | {$pathobject->GetName()} / 31 | {else} 32 | {$pathobject->GetName()} / 33 | {/if} 34 | {/if} 35 |
36 | {/if} 37 | -------------------------------------------------------------------------------- /.templates/project.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * project.tpl 3 | * gitphp: A PHP git repository browser 4 | * Component: Project summary template 5 | * 6 | * Copyright (C) 2009 Christopher Han 7 | *} 8 | {include file='header.tpl'} 9 | 10 | 13 | 14 | {include file='title.tpl'} 15 | 16 | {* Project brief *} 17 |
18 | 19 | 20 | 21 | {if $head} 22 | 23 | {/if} 24 | {if $project->GetCloneUrl()} 25 | 26 | {/if} 27 | {if $project->GetPushUrl()} 28 | 29 | {/if} 30 |
{t}Description{/t}{$project->GetDescription()}
{t}Owner{/t}{$project->GetOwner()|escape:'html'}
{t}Last change{/t}{$head->GetCommitterEpoch()|date_format:"%a, %d %b %Y %H:%M:%S %z"}
{t}clone url{/t}{$project->GetCloneUrl()}
{t}Push url{/t}{$project->GetPushUrl()}
31 | 32 |
33 |
34 | 35 | {if !$head} 36 | {include file='title.tpl' target='shortlog' disablelink=true} 37 | {else} 38 | {include file='title.tpl' target='shortlog'} 39 | {/if} 40 | 41 | {include file='shortloglist.tpl' source='summary'} 42 | 43 | {if $taglist} 44 | {include file='title.tpl' target='tags'} 45 | {include file='taglist.tpl'} 46 | {/if} 47 | 48 | {if $headlist} 49 | {include file='title.tpl' target='heads'} 50 | {include file='headlist.tpl'} 51 | {/if} 52 | 53 | {include file='footer.tpl'} 54 | -------------------------------------------------------------------------------- /.templates/projectindex.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * projectindex.tpl 3 | * gitphp: A PHP git repository browser 4 | * Component: Project index template 5 | * 6 | * Copyright (C) 2009 Christopher Han 7 | *} 8 | {foreach from=$projectlist item=proj} 9 | {$proj->GetProject()} 10 | {/foreach} 11 | -------------------------------------------------------------------------------- /.templates/refbadges.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * Refbadges 3 | * 4 | * Ref badges template 5 | * 6 | * @author Christopher Han 7 | * @copyright Copyright (c) 2010 Christopher Han 8 | * @package GitPHP 9 | * @subpackage Template 10 | *} 11 | 12 | 13 | {foreach from=$commit->GetHeads() item=commithead} 14 | 15 | {$commithead->GetName()} 16 | 17 | {/foreach} 18 | {assign var=in_build_shown value=false} 19 | {foreach from=$commit->GetTags()|@array_reverse item=committag name=refbadgestags} 20 | {if substr($committag->GetName(),0,8) == "in-build"} 21 | {if $in_build_shown} 22 | {assign var=hide_tag value=true} 23 | {else} 24 | {assign var=hide_tag value=false} 25 | {/if} 26 | {assign var=in_build_shown value=true} 27 | {else} 28 | {assign var=hide_tag value=false} 29 | {/if} 30 | 31 | LightTag()}class="tagTip"{/if}>{$committag->GetName()} 32 | 33 | {if $smarty.foreach.refbadgestags.last && $smarty.foreach.refbadgestags.total > 2} 34 | .. 35 | {/if} 36 | {/foreach} 37 | {foreach from=$commit->GetReviews() item=review} 38 | 39 | {if $review.hash_base} 40 | Review {$review.review_id} 41 | {else} 42 | Review {$review.review_id} 43 | {/if} 44 | 45 | {/foreach} 46 | 47 | -------------------------------------------------------------------------------- /.templates/review.jira.tpl: -------------------------------------------------------------------------------- 1 | {foreach from=$DIFF_OBJS item=DIFF_OBJ} 2 | {foreach from=$DIFF_OBJ.HEADER item=HEAD} 3 | {$HEAD.header} 4 | {/foreach} 5 | {foreach from=$DIFF_OBJ.TOP_COMMENT item=TC} 6 | {ldelim}code{rdelim}{ldelim}quote{rdelim}{$TC.date} {$TC.author}: {$TC.comment}{ldelim}quote{rdelim}{ldelim}code{rdelim} 7 | {/foreach} 8 | {foreach from=$DIFF_OBJ.LINE item=L} 9 | {if isset($L.SEPARATOR)} 10 | {foreach from=$L.SEPARATOR item=S} 11 | {ldelim}code{rdelim} 12 | ---- 13 | {ldelim}code{rdelim} 14 | {/foreach} 15 | {/if} 16 | {$L.line_numbers}{$L.line} 17 | {foreach from=$L.COMMENT item=C} 18 | {ldelim}code{rdelim}{ldelim}quote{rdelim}{$C.date} {$C.author}: {$C.comment}{ldelim}quote{rdelim}{ldelim}code{rdelim} 19 | {/foreach} 20 | {/foreach} 21 | {/foreach} 22 | -------------------------------------------------------------------------------- /.templates/review.mail.tpl: -------------------------------------------------------------------------------- 1 | {foreach from=$DIFF_OBJS item=DIFF_OBJ} 2 | {foreach from=$DIFF_OBJ.HEADER item=HEAD} 3 |
{$HEAD.header}
4 | {/foreach} 5 | 6 | {foreach from=$DIFF_OBJ.TOP_COMMENT item=TC} 7 |
8 | {$TC.date} {$TC.author}: 9 | {$TC.comment} 10 |
11 | {/foreach} 12 | 13 | {foreach from=$DIFF_OBJ.LINE item=L} 14 | {if isset($L.SEPARATOR)} 15 | {foreach from=$L.SEPARATOR item=S} 16 |
17 | {/foreach} 18 | {/if} 19 |
{$L.line_numbers}{$L.line}
20 | {foreach from=$L.COMMENT item=C} 21 |
22 | {$C.date} {$C.author}: 23 | {$C.comment} 24 |
25 | {/foreach} 26 | {/foreach} 27 | {/foreach} 28 | -------------------------------------------------------------------------------- /.templates/review.redmine.tpl: -------------------------------------------------------------------------------- 1 | {foreach from=$DIFF_OBJS item=DIFF_OBJ} 2 | {foreach from=$DIFF_OBJ.HEADER item=HEAD} 3 | {$HEAD.header} 4 | {/foreach} 5 | {foreach from=$DIFF_OBJ.TOP_COMMENT item=TC} 6 | 7 | >*{$TC.date} {$TC.author}:* _{$TC.comment}_ 8 |
 9 | {/foreach}
10 | {foreach from=$DIFF_OBJ.LINE item=L}
11 | {if isset($L.SEPARATOR)}
12 | {foreach from=$L.SEPARATOR item=S}
13 | 
14 | ---- 15 |
16 | {/foreach}
17 | {/if}
18 | {$L.line_numbers}{$L.line}
19 | {foreach from=$L.COMMENT item=C}
20 | 
21 | >*{$C.date} {$C.author}:* _{$C.comment}_ 22 |
23 | {/foreach}
24 | {/foreach}
25 | {/foreach}
26 | 


--------------------------------------------------------------------------------
/.templates/review.tpl:
--------------------------------------------------------------------------------
 1 | 
 2 | {include file="header.tpl"}
 3 | 
 4 | 
 7 | 
 8 | 
 9 | 
10 |     
11 |         
12 |             
13 |             
14 |             
15 |             
16 |             
17 |         
18 |     
19 |     
20 |         {foreach from=$snapshots item=snapshot}
21 |             
22 |                 
25 |                 
32 |                 
35 |                 
38 |                 
41 |             
42 |         {/foreach}
43 |         
44 |             
52 |         
53 |     
54 | 
ReviewTicket / Review NameComments countTypeLink
23 | {$snapshot.review_id} 24 | 26 | {if $snapshot.ticket_url} 27 | {$snapshot.ticket} 28 | {else} 29 | {$snapshot.ticket} 30 | {/if} 31 | 33 | {$snapshot.count} 34 | 36 | {$snapshot.review_type} 37 | 39 | {$snapshot.title} 40 |
45 | {if $to_start_link} 46 | ← to start 47 | {/if} 48 | {if $more_link} 49 | more → 50 | {/if} 51 |
55 | 56 | {include file="footer.tpl"} 57 | -------------------------------------------------------------------------------- /.templates/rss.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * rss.tpl 3 | * gitphp: A PHP git repository browser 4 | * Component: RSS template 5 | * 6 | * Copyright (C) 2009 Christopher Han 7 | *} 8 | 9 | 10 | 11 | {$project->GetProject()} 12 | {scripturl}?p={$project->GetProject()|urlencode}&a=summary 13 | {$project->GetProject()} log 14 | en 15 | 16 | {foreach from=$log item=logitem} 17 | 18 | {$logitem->GetCommitterEpoch()|date_format:"%d %b %R"} - {$logitem->GetTitle()|escape:'html'} 19 | {$logitem->GetAuthor()|escape:'html'} 20 | {$logitem->GetCommitterEpoch()|date_format:"%a, %d %b %Y %H:%M:%S %z"} 21 | {scripturl}?p={$project->GetProject()|urlencode}&a=commit&h={$logitem->GetHash()} 22 | {scripturl}?p={$project->GetProject()|urlencode}&a=commit&h={$logitem->GetHash()} 23 | {$logitem->GetTitle()|escape:'html'} 24 | 25 | GetComment() item=line} 27 | {$line}
28 | {/foreach} 29 | {foreach from=$logitem->DiffToParent() item=diffline} 30 | {$diffline->GetToFile()}
31 | {/foreach} 32 | ]]> 33 |
34 |
35 | {/foreach} 36 | 37 |
38 |
39 | -------------------------------------------------------------------------------- /.templates/sbs_non_treediff.tpl: -------------------------------------------------------------------------------- 1 |
2 | 3 | {foreach from=$diff_source item=filediff} 4 | 5 | 8 | 11 | 12 | 13 | {/foreach} 14 |
6 | {$filediff->getStatus()} 7 | 9 | {$filediff->getToFile()} 10 |
15 |
16 | 17 |
18 | {include file='filediffsidebyside.tpl' diffsplit=$filediff->GetDiffSplit()} 19 |
-------------------------------------------------------------------------------- /.templates/sbs_treediff.tpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 22 | 23 |
24 |
25 |
    26 |
27 |
28 | 29 |
30 | 31 |
32 | {include file='filediffsidebyside.tpl' diffsplit=$filediff->GetDiffSplit() noCompareBlock=true} 33 |
34 |
-------------------------------------------------------------------------------- /.templates/sexy_highlighter.tpl: -------------------------------------------------------------------------------- 1 | {if $highlighter_brushes} 2 | {literal} 3 |
4 | 5 |
6 | 7 |
8 |
9 |
Comment
10 |
Cancel
11 |
12 |
13 |
14 | 15 |
16 |
17 | 18 | 19 |
20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | 28 | {/literal} 29 | 51 | {/if} 52 | -------------------------------------------------------------------------------- /.templates/shortlog.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * shortlog.tpl 3 | * gitphp: A PHP git repository browser 4 | * Component: Shortlog view template 5 | * 6 | * Copyright (C) 2009 Christopher Han 7 | *} 8 | {include file='header.tpl'} 9 | 10 | {* Nav *} 11 | {include file='nav.tpl' current=$controller logcommit=$commit treecommit=$commit logmark=$mark} 12 | 13 |
14 | {if ($commit && $head) && (($commit->GetHash() != $head->GetHash()) || ($page > 0))} 15 | {t}HEAD{/t} 16 | {/if} 17 | 18 | {if $page > 0} 19 | {t}Prev{/t} 20 | {/if} 21 | 22 | {if $hasmorerevs} 23 | {t}Next{/t} 24 | {/if} 25 |
26 |
27 | 28 | {if $mark} 29 | 35 | {/if} 36 | 37 | {include file='title.tpl' target='summary'} 38 | 39 | {include file='shortloglist.tpl' source=$controller} 40 | 41 | {include file='footer.tpl'} 42 | 43 | -------------------------------------------------------------------------------- /.templates/snapshot.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * snapshots.tpl 3 | * gitphp: A PHP git repository browser 4 | * Component: Snapshot template 5 | * 6 | * Copyright (C) 2009 Christopher Han 7 | *} 8 | {$archive} 9 | -------------------------------------------------------------------------------- /.templates/tag.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * tag.tpl 3 | * gitphp: A PHP git repository browser 4 | * Component: Tag view template 5 | * 6 | * Copyright (C) 2009 Christopher Han 7 | *} 8 | {include file='header.tpl'} 9 | 10 | {* Nav *} 11 | 14 | {* Tag data *} 15 | {assign var=object value=$tag->GetObject()} 16 | {assign var=objtype value=$tag->GetType()} 17 |
18 | {$tag->GetName()} 19 |
20 |
21 | 22 | 23 | 24 | {if $objtype == 'commit'} 25 | 26 | 27 | {elseif $objtype == 'tag'} 28 | 29 | 30 | {/if} 31 | 32 | {if $tag->GetTagger()} 33 | 34 | 35 | 36 | 37 | 38 | 39 | 47 | 48 | {/if} 49 |
{t}object{/t}{$object->GetHash()}{$object->GetHash()}
{t}author{/t}{$tag->GetTagger()}
{$tag->GetTaggerEpoch()|date_format:"%a, %d %b %Y %H:%M:%S %z"} 40 | {assign var=hourlocal value=$tag->GetTaggerLocalEpoch()|date_format:"%H"} 41 | {if $hourlocal < 6} 42 | ({$tag->GetTaggerLocalEpoch()|date_format:"%R"} {$tag->GetTaggerTimezone()}) 43 | {else} 44 | ({$tag->GetTaggerLocalEpoch()|date_format:"%R"} {$tag->GetTaggerTimezone()}) 45 | {/if} 46 |
50 |
51 |
52 | {assign var=bugpattern value=$project->GetBugPattern()} 53 | {assign var=bugurl value=$project->GetBugUrl()} 54 | {foreach from=$tag->GetComment() item=line} 55 | {$line|htmlspecialchars|buglink:$bugpattern:$bugurl}
56 | {/foreach} 57 |
58 | 59 | {include file='footer.tpl'} 60 | 61 | -------------------------------------------------------------------------------- /.templates/tags.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * tags.tpl 3 | * gitphp: A PHP git repository browser 4 | * Component: Tag view template 5 | * 6 | * Copyright (C) 2009 Christopher Han 7 | *} 8 | {include file='header.tpl'} 9 | 10 | {* Nav *} 11 | 14 | 15 | {include file='title.tpl' target='summary'} 16 | 17 | {* Display tags *} 18 | 19 | {include file='taglist.tpl'} 20 | 21 | {include file='footer.tpl'} 22 | 23 | -------------------------------------------------------------------------------- /.templates/tagtip.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * Tagtip 3 | * 4 | * Tag tooltip template 5 | * 6 | * @author Christopher Han 7 | * @copyright Copyright (c) 2010 Christopher Han 8 | * @package GitPHP 9 | * @subpackage Template 10 | *} 11 | 12 |
13 | {t}tag{/t}: {$tag->GetName()} 14 |
15 | {foreach from=$tag->GetComment() item=line} 16 |
{$line} 17 | {/foreach} 18 |
19 | -------------------------------------------------------------------------------- /.templates/tree.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * tree.tpl 3 | * gitphp: A PHP git repository browser 4 | * Component: Tree view template 5 | * 6 | * Copyright (C) 2009 Christopher Han 7 | *} 8 | {include file='header.tpl'} 9 | 10 | {* Nav *} 11 | {include file='nav.tpl' current='tree' logcommit=$commit} 12 | 13 | {include file='title.tpl' titlecommit=$commit hasPageSearch=true} 14 | 15 | {include file='path.tpl' pathobject=$tree target='tree'} 16 | 17 |
18 | {* List files *} 19 | 20 | {include file='treelist.tpl'} 21 |
22 |
23 | 24 | {include file='footer.tpl'} 25 | 26 | -------------------------------------------------------------------------------- /.templates/unified_diff_contents.tpl: -------------------------------------------------------------------------------- 1 | {foreach from=$diff_source item=filediff} 2 | {assign var="diff" value=$filediff->GetDiff('', true, true)} 3 |
4 | 5 |
6 | {if ($filediff->GetStatus() == 'D') || ($filediff->GetStatus() == 'M') || ($filediff->GetStatus() == 'R')} 7 | {assign var=localfromtype value=$filediff->GetFromFileType(1)} 8 | {* $localfromtype}:{if $filediff->GetFromFile()}a/{$filediff->GetFromFile()}{else}{$filediff->GetFromHash()}{/if *} 9 | {$localfromtype}: {if $filediff->GetFromFile()}a/{$filediff->GetFromFile()}{else}{$filediff->GetFromHash()}{/if} 10 | {if $filediff->GetStatus() == 'D'} 11 | {t}(deleted){/t} 12 | {/if} 13 | {/if} 14 | 15 | {if $filediff->GetStatus() == 'M' || $filediff->GetStatus() == 'R'} 16 | > 17 | {/if} 18 | 19 | {if ($filediff->GetStatus() == 'A') || ($filediff->GetStatus() == 'M') || ($filediff->GetStatus() == 'R')} 20 | {assign var=localtotype value=$filediff->GetToFileType(1)} 21 | {* $localtotype}:{if $filediff->GetToFile()}b/{$filediff->GetToFile()}{else}{$filediff->GetToHash()}{/if *} 22 | {$localtotype}: {if $filediff->GetToFile()}b/{$filediff->GetToFile()}{else}{$filediff->GetToHash()}{/if} 23 | 24 | {if $filediff->GetStatus() == 'A'} 25 | {t}(new){/t} 26 | {/if} 27 | {/if} 28 |
29 | {include file='filediff.tpl' diff=$diff} 30 |
31 | {/foreach} 32 | -------------------------------------------------------------------------------- /.templates/unified_treediff.tpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 |
16 | {* This is rendered for non-JS support *} 17 |
18 | 19 | {include file='extensions_filter.tpl' stasuses=$statuses extensions=$extensions folders=$folders} 20 | 21 | 29 |
30 | 31 |
32 | 33 |
34 | {include file='unified_diff_contents.tpl' diff_source=$diff_source} 35 |
36 |
-------------------------------------------------------------------------------- /css/fix_lineheight.css: -------------------------------------------------------------------------------- 1 | .syntaxhighlighter a, 2 | .syntaxhighlighter div, 3 | .syntaxhighlighter code, 4 | .syntaxhighlighter table, 5 | .syntaxhighlighter table td, 6 | .syntaxhighlighter table tr, 7 | .syntaxhighlighter table tbody, 8 | .syntaxhighlighter table thead, 9 | .syntaxhighlighter table caption, 10 | .syntaxhighlighter textarea { 11 | line-height: 1em !important; 12 | } 13 | td#blameData { 14 | line-height: 1em !important; 15 | } -------------------------------------------------------------------------------- /images/Delete.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /images/File.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /images/Folder.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /images/Search.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /images/arrow-down.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /images/check.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /images/codeisok-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/images/codeisok-logo.png -------------------------------------------------------------------------------- /images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/images/favicon.png -------------------------------------------------------------------------------- /images/ic_settings.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /images/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/images/loader.gif -------------------------------------------------------------------------------- /images/login-pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/images/login-pattern.png -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | timerStart(); 13 | $Application->init(); 14 | \GitPHP\Log::GetInstance()->timerStop('GitPHP\Application::init()', 1); 15 | 16 | \GitPHP\Log::GetInstance()->timerStart(); 17 | $Application->run(); 18 | \GitPHP\Log::GetInstance()->timerStop('GitPHP\Application::run()', 1); 19 | 20 | \GitPHP\Log::GetInstance()->Log('debug', \GitPHP\Config::GetInstance()->GetValue('debug', false)); 21 | 22 | /* StatSlow ;) */ 23 | \GitPHP\Log::GetInstance()->printHtmlHeader(); 24 | \GitPHP\Log::GetInstance()->printHtml(); 25 | \GitPHP\Log::GetInstance()->printHtmlFooter(); 26 | -------------------------------------------------------------------------------- /js/blame.js: -------------------------------------------------------------------------------- 1 | /* 2 | * GitPHP Javascript blame 3 | * 4 | * Load blame data into blob page asynchronously 5 | * 6 | * @author Christopher Han 7 | * @copyright Copyright (c) 2010 Christopher Han 8 | * @package GitPHP 9 | */ 10 | 11 | function initBlame() { 12 | 13 | var url = window.location.href.match(/^([^\?]+\/)/); 14 | if (!url) { 15 | return; 16 | } 17 | url = url[1]; 18 | 19 | var blameLink = $('a#blameLink'); 20 | 21 | blameLink.toggle(function() { 22 | 23 | var blameCol = $('table#blobData td#blameData'); 24 | if (blameCol && blameCol.size() > 0) { 25 | blameCol.show('fast'); 26 | } else { 27 | var col = jQuery(document.createElement('td')); 28 | col.attr('id', 'blameData'); 29 | col.css('display', 'none'); 30 | 31 | var p = jQuery(document.createElement('p')); 32 | p.text(GITPHP_RES_LOADING_BLAME_DATA); 33 | p.appendTo(col); 34 | 35 | var div = jQuery(document.createElement('div')); 36 | div.css('text-align', 'center'); 37 | 38 | var img = jQuery(document.createElement('img')); 39 | img.attr('src', url + "images/loader.gif"); 40 | img.attr('alt', GITPHP_RES_LOADING); 41 | img.appendTo(div); 42 | 43 | div.appendTo(col); 44 | 45 | $('table#blobData tr:first').prepend(col); 46 | col.show('fast'); 47 | 48 | $.get(blameLink.attr('href'), { o: 'js' }, 49 | function(data) { 50 | 51 | blameCol = $('td#blameData'); 52 | 53 | var insertBlame = function() { 54 | blameCol.html(data).addClass('de1'); 55 | initCommitTips(); 56 | } 57 | 58 | if (blameCol.css('display') == 'none') { 59 | insertBlame(); 60 | } else { 61 | blameCol.fadeOut('fast', function() { 62 | insertBlame(); 63 | blameCol.fadeIn('fast'); 64 | }); 65 | } 66 | }); 67 | } 68 | 69 | return false; 70 | }, 71 | function() { 72 | $('table#blobData td#blameData').hide('fast'); 73 | 74 | return false; 75 | }); 76 | }; 77 | 78 | $(document).ready(function() { 79 | initBlame(); 80 | }); 81 | -------------------------------------------------------------------------------- /js/blame.min.js: -------------------------------------------------------------------------------- 1 | function initBlame(){var a=window.location.href.match(/^([^\?]+\/)/);if(!a){return}a=a[1];var b=$("a#blameLink");b.toggle(function(){var e=$("table#blobData td#blameData");if(e&&e.size()>0){e.show("fast")}else{var d=jQuery(document.createElement("td"));d.attr("id","blameData");d.css("display","none");var f=jQuery(document.createElement("p"));f.text(GITPHP_RES_LOADING_BLAME_DATA);f.appendTo(d);var g=jQuery(document.createElement("div"));g.css("text-align","center");var c=jQuery(document.createElement("img"));c.attr("src",a+"images/loader.gif");c.attr("alt",GITPHP_RES_LOADING);c.appendTo(g);g.appendTo(d);$("table#blobData tr:first").prepend(d);d.show("fast");$.get(b.attr("href"),{o:"js"},function(i){e=$("td#blameData");var h=function(){e.html(i).addClass("de1");initCommitTips()};if(e.css("display")=="none"){h()}else{e.fadeOut("fast",function(){h();e.fadeIn("fast")})}})}return false},function(){$("table#blobData td#blameData").hide("fast");return false})}$(document).ready(function(){initBlame()}); -------------------------------------------------------------------------------- /js/ext/jquery.cookie.js: -------------------------------------------------------------------------------- 1 | /** 2 | * jQuery Cookie plugin 3 | * 4 | * Copyright (c) 2010 Klaus Hartl (stilbuero.de) 5 | * Dual licensed under the MIT and GPL licenses: 6 | * http://www.opensource.org/licenses/mit-license.php 7 | * http://www.gnu.org/licenses/gpl.html 8 | * 9 | */ 10 | jQuery.cookie = function (key, value, options) { 11 | 12 | // key and at least value given, set cookie... 13 | if (arguments.length > 1 && String(value) !== "[object Object]") { 14 | options = jQuery.extend({}, options); 15 | 16 | if (value === null || value === undefined) { 17 | options.expires = -1; 18 | } 19 | 20 | if (typeof options.expires === 'number') { 21 | var days = options.expires, t = options.expires = new Date(); 22 | t.setDate(t.getDate() + days); 23 | } 24 | 25 | value = String(value); 26 | 27 | return (document.cookie = [ 28 | encodeURIComponent(key), '=', 29 | options.raw ? value : encodeURIComponent(value), 30 | options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 31 | options.path ? '; path=' + options.path : '', 32 | options.domain ? '; domain=' + options.domain : '', 33 | options.secure ? '; secure' : '' 34 | ].join('')); 35 | } 36 | 37 | // key and possibly options given, get cookie... 38 | options = value || {}; 39 | var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent; 40 | return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null; 41 | }; 42 | -------------------------------------------------------------------------------- /js/lang.js: -------------------------------------------------------------------------------- 1 | /* 2 | * GitPHP Javascript language selector 3 | * 4 | * Changes the language as soon as it's selected, 5 | * rather than requiring a submit 6 | * 7 | * @author Christopher Han 8 | * @copyright Copyright (c) 2010 Christopher Han 9 | * @package GitPHP 10 | */ 11 | 12 | function initLangSelector() { 13 | $("#selLang").change(function() { 14 | $("#frmLangSelect").submit(); 15 | }); 16 | $("#btnLangSet").remove(); 17 | }; 18 | 19 | $(document).ready(function() { 20 | initLangSelector(); 21 | }); 22 | -------------------------------------------------------------------------------- /js/lang.min.js: -------------------------------------------------------------------------------- 1 | function initLangSelector(){$("#selLang").change(function(){$("#frmLangSelect").submit()});$("#btnLangSet").remove()}$(document).ready(function(){initLangSelector()}); -------------------------------------------------------------------------------- /js/session_checker.js: -------------------------------------------------------------------------------- 1 | /* 2 | Проверяет правильную залогиненность и заодно подключение к интернету, 3 | чтобы при заполнении больших форм информировать о том, что данные могут потеряться. 4 | */ 5 | var SessionChecker = new (function(window) { 6 | this.config = { 7 | request_timeout: 10000, // 10 sec 8 | timer_interval: { 9 | ok: 30000, // 30 sec 10 | problem: 3000 // 3 sec 11 | } 12 | }; 13 | this.statuses = { 14 | ok: 1, 15 | problem: 2 16 | }; 17 | 18 | this.check = function() { 19 | $.ajax({ 20 | type: "GET", 21 | url: "/index.php?a=check_session", 22 | data: { nocache: new Date().getTime() }, 23 | dataType: "json", 24 | context: this, 25 | timeout: this.config.request_timeout, 26 | success: this.success, 27 | error: this.error 28 | }); 29 | }; 30 | 31 | this.success = function(data, textStatus, jqXHR) { 32 | if (data.success) { 33 | this.status = this.statuses.ok; 34 | } else { 35 | this.status = this.statuses.problem; 36 | } 37 | this.setTimer(); 38 | }; 39 | 40 | this.error = function(xhr, status, e) { 41 | this.status = this.statuses.problem; 42 | this.setTimer(); 43 | }; 44 | 45 | this.setTimer = function() { 46 | var timer_interval = this.config.timer_interval['problem']; 47 | var me = this; 48 | if (this.status == this.statuses.ok) { 49 | timer_interval = this.config.timer_interval['ok']; 50 | $(this.block).hide(); 51 | } else { 52 | $(this.block).show(); 53 | } 54 | clearInterval(this.interval); 55 | this.interval = setInterval(function() { me.check(); }, timer_interval); 56 | }; 57 | 58 | this.status = this.statuses.ok; 59 | this.block = '#session_checker'; 60 | return this; 61 | })(window); 62 | -------------------------------------------------------------------------------- /js/suppresseddiff.js: -------------------------------------------------------------------------------- 1 | function show_suppressed_diff($node) { 2 | //avoid scrolling to anchors when diff is loaded 3 | var uri = window.location.toString(); 4 | if (uri.indexOf("#") > 0) { 5 | var clean_uri = uri.substring(0, uri.indexOf("#")); 6 | window.history.replaceState({}, document.title, clean_uri); 7 | } 8 | 9 | var isJquery = $node instanceof jQuery; 10 | 11 | if (!isJquery) { 12 | $node = $(this); 13 | } 14 | 15 | $node.parent().find('a').hide(); 16 | $node.parent().find('img').show(); 17 | 18 | var pre = $('
');
19 | 
20 | 	pre.appendTo($node.parent().parent());
21 | 
22 | 	pre.load(
23 | 		$node.attr('href'),
24 | 		function() {
25 |             $brush = $node.data().brush;
26 |             $(this).addClass("brush: " + $brush);
27 | 			$(this).parent().find('p').remove();
28 |             SyntaxHighlighter.vars.discoveredBrushes = null;
29 | 			SyntaxHighlighterApply();
30 | 		}
31 | 	);
32 | 
33 | 	return false;
34 | }
35 | 
36 | $('.show_suppressed_diff').live('click', show_suppressed_diff);
37 | 


--------------------------------------------------------------------------------
/js/tooltips.min.js:
--------------------------------------------------------------------------------
1 | function initSnapshotTips(){$("a.snapshotTip").each(function(){var a=$(this).attr("href");var c="
"+GITPHP_RES_SNAPSHOT+": ";var d=true;for(var b in GITPHP_SNAPSHOT_FORMATS){if(!d){c+=" | "}c+=''+GITPHP_SNAPSHOT_FORMATS[b]+"";d=false}c+="
";$(this).qtip({content:{text:c},show:{event:"click"},hide:{fixed:true,delay:150},style:{classes:"ui-tooltip-light ui-tooltip-shadow"},position:{adjust:{screen:true}}});$(this).click(function(){return false})})}function initCommitTips(){var b=window.location.href.match(/p=([^&]+)/);if(!b){return}b=unescape(b[1]);var a=window.location.href.match(/^([^\?]+\/)/);if(!a){return}a=a[1];$("a.commitTip").each(function(){var c=$(this).attr("href").match(/h=([0-9a-fA-F]{40}|HEAD)/);if(!c){return}c=c[1];$(this).qtip({content:{text:''+GITPHP_RES_LOADING+'',ajax:{url:"index.php",data:{p:b,a:"commit",o:"jstip",h:c},type:"GET"}},style:{classes:"ui-tooltip-light ui-tooltip-shadow"},position:{adjust:{screen:true}}})})}function initTagTips(){var b=window.location.href.match(/p=([^&]+)/);if(!b){return}b=unescape(b[1]);var a=window.location.href.match(/^([^\?]+\/)/);if(!a){return}a=a[1];$("a.tagTip").each(function(){var c=$(this).attr("href").match(/h=([^&]+)/);if(!c){return}c=c[1];$(this).qtip({content:{text:''+GITPHP_RES_LOADING+'',ajax:{url:"index.php",data:{p:b,a:"tag",o:"jstip",h:c},type:"GET"}},style:{classes:"ui-tooltip-light ui-tooltip-shadow"},position:{adjust:{screen:true}}})})}$(document).ready(function(){initCommitTips();initTagTips();initSnapshotTips()}); -------------------------------------------------------------------------------- /lib/geshi/docs/BUGS: -------------------------------------------------------------------------------- 1 | 2 | BUGS - list of known bugs in GeSHi 3 | Version 1.0.8 4 | 5 | - Number highlighting is quite poor [possibly better now] 6 | - I'm not happy with URLS - there still could be extra bugs, and it's rather unflexible 7 | (see TODO for a possible fix) 8 | - "Important" sections for some reason seem to have their spans added after every 9 | newline up until the next lexic, instead of stopping at the part. In fact, 10 | context sensitiveness is quite poor... 11 | - Using the extra line number highlighting feature without actually using line numbers 12 | will result in malformed XHTML (not sure about this one though...) 13 | - Slow!!! Especially for source with lots of strings in it. GeSHi will work acceptably 14 | for sourcecode under 5K (for simple language files like SQL, a 100K file can be 15 | highlighted in just 6 seconds), but above about 25K things get a little slow... If 16 | you're using this as part of some larger software, you may want to think about 17 | making some sort of "cache" effect to speed things up and reduce server load. 18 | - The result is built by string replacement instead of by building another string based 19 | on the source, that would be much safer. The focus of releases beyond 1.0.7 will be on 20 | changing this behaviour, which may well fix some of the other bugs mentioned above. 21 | - As of 1.0.7.1, dots (.) are allowed before keywords. This may change highlighting of some 22 | things slightly, if you notice anything odd about the highlighting then please report 23 | it to me. 24 | - Perl/Javascript /.../ regex syntax is only supported basically and there's no 25 | guarantee it is working all the time. 26 | - The
 header output is not XHTML compliant. Please use the 
header instead. 27 | 28 | Send any bug reports to BenBE@omorphia.de, or submit them via the bug tracker at 29 | sourceforge (http://sourceforge.net/tracker/?group_id=114997&atid=670231) 30 | -------------------------------------------------------------------------------- /lib/geshi/docs/README: -------------------------------------------------------------------------------- 1 | 2 | GeSHi - GEneric Syntax HIghlighter 3 | ---------------------------------- 4 | Version 1.0.8 5 | 6 | Author: Nigel McNie, Benny Baumann 7 | Email: nigel@geshi.org, BenBE@omorphia.de 8 | GeSHi Website: http://qbnz.com/highlighter 9 | 10 | GeSHi is a generic syntax highlighter, written in PHP. You simply 11 | input the source code you wish to highlight with the language you 12 | wish to use, and the output will be a file syntax highlighted to 13 | XHTML standards. 14 | 15 | For more information on how to use GeSHi, please consult the 16 | documentation. If you got this readme from a GeSHi package, then 17 | the documentation is available in the docs/ directory. Documentation 18 | is also available at http://qbnz.com/highlighter/documentation.php 19 | 20 | If you think you've found a bug in GeSHi, contact me with a bug 21 | report at BenBE@omorphia.de, or submit it to the bug tracker at 22 | http://sourceforge.net/tracker/?group_id=114997&atid=670231. Be 23 | aware that minor highlighting errors may well just be incorrect 24 | language files, but if you do find something major please contact me. 25 | 26 | And if you're using GeSHi as a plugin/mod for some other software, 27 | please tell me about it! It's worth a link to you, and I can give 28 | you specialist help if you need it. 29 | 30 | GeSHi is free software, released under the GNU GPL. Please see the 31 | COPYING file for more information. If you do modify this program, 32 | please tell me about it! Perhaps you've made a good improvement that 33 | I can learn from :) 34 | -------------------------------------------------------------------------------- /lib/geshi/docs/api/blank.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | GeSHi 1.0.8 4 | 5 | 6 | 7 | 8 |

GeSHi 1.0.8

9 | Welcome to geshi!
10 |
11 | This documentation was generated by phpDocumentor v1.4.2
12 | 13 | -------------------------------------------------------------------------------- /lib/geshi/docs/api/classtrees_geshi.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

14 | 15 |

16 |

Root class GeSHi

17 | 19 | 20 |

21 | Documentation generated on Thu, 25 Dec 2008 14:34:34 +0100 by phpDocumentor 1.4.2 22 |

23 | 24 | -------------------------------------------------------------------------------- /lib/geshi/docs/api/errors.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | phpDocumentor Parser Errors and Warnings 7 | 8 | 9 | 10 | 11 | Post-parsing
12 | 13 |

geshi.php

14 |

Errors:


15 | Error on line 569 - DocBlock has multiple @access tags, illegal. ignoring additional tag "@access private"
16 |

17 | Documentation generated on Thu, 25 Dec 2008 14:34:53 +0100 by phpDocumentor 1.4.2 18 |

19 | 20 | -------------------------------------------------------------------------------- /lib/geshi/docs/api/index.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | GeSHi 1.0.8 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | <H2>Frame Alert</H2> 20 | <P>This document is designed to be viewed using the frames feature. 21 | If you see this message, you are using a non-frame-capable web client.</P> 22 | 23 | 24 | -------------------------------------------------------------------------------- /lib/geshi/docs/api/li_geshi.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
geshi
12 |
13 | 14 |
15 | 16 |
Description
17 |
18 | Class trees
19 | Index of elements
20 | Todo List
21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
Sub-packagecore
30 |
31 |
32 |
 Classes
33 |
ClassGeSHi
34 |
 Functions
35 |
Functiongeshi_highlight
36 |
 Files
37 |
Filegeshi.php
38 |
39 |
40 | 41 | 42 |
43 |
44 |

phpDocumentor v 1.4.2

45 | 46 | -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/banner.css: -------------------------------------------------------------------------------- 1 | body 2 | { 3 | background-color: #EEEEEE; 4 | margin: 0px; 5 | padding: 0px; 6 | } 7 | 8 | /* Banner (top bar) classes */ 9 | 10 | .banner { } 11 | 12 | .banner-menu 13 | { 14 | text-align: right; 15 | clear: both; 16 | padding: .5em; 17 | border-top: 2px solid #AAAAAA; 18 | } 19 | 20 | .banner-title 21 | { 22 | text-align: right; 23 | font-size: 20pt; 24 | font-weight: bold; 25 | margin: .2em; 26 | } 27 | 28 | .package-selector 29 | { 30 | background-color: #DDDDDD; 31 | border: 1px solid #AAAAAA; 32 | color: #000090; 33 | } 34 | -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/AbstractClass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/AbstractClass.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/AbstractClass_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/AbstractClass_logo.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/AbstractMethod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/AbstractMethod.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/AbstractPrivateClass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/AbstractPrivateClass.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/AbstractPrivateClass_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/AbstractPrivateClass_logo.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/AbstractPrivateMethod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/AbstractPrivateMethod.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Class.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/Class.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Class_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/Class_logo.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Constant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/Constant.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Constructor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/Constructor.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Destructor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/Destructor.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/Function.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Global.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/Global.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/I.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/I.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/Index.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Interface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/Interface.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Interface_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/Interface_logo.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/L.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/L.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Lminus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/Lminus.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Lplus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/Lplus.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Method.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/Method.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/Page.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Page_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/Page_logo.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/PrivateClass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/PrivateClass.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/PrivateClass_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/PrivateClass_logo.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/PrivateMethod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/PrivateMethod.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/PrivateVariable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/PrivateVariable.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/StaticMethod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/StaticMethod.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/StaticVariable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/StaticVariable.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/T.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/T.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Tminus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/Tminus.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Tplus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/Tplus.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Variable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/Variable.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/blank.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/class_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/class_folder.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/empty.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/file.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/folder.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/function_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/function_folder.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/next_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/next_button.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/next_button_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/next_button_disabled.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/package.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/package.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/package_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/package_folder.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/previous_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/previous_button.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/previous_button_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/previous_button_disabled.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/private_class_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/private_class_logo.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/tutorial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/tutorial.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/tutorial_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/tutorial_folder.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/up_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/docs/api/media/images/up_button.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/packages.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 28 | 29 | -------------------------------------------------------------------------------- /lib/geshi/docs/api/todolist.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Todo List 7 | 8 | 9 | 10 | 11 |

Todo List

12 |

geshi

13 |

GeSHi::disable_highlighting()

14 |
    15 |
  • Rewrite with array traversal
  • 16 |
17 |

GeSHi::enable_highlighting()

18 |
    19 |
  • Rewrite with array traversal
  • 20 |
21 |

GeSHi::enable_important_blocks()

22 |
    23 |
  • REMOVE THIS SHIZ FROM GESHI!
  • 24 |
25 |

GeSHi::get_language_name_from_extension()

26 |
    27 |
  • Re-think about how this method works (maybe make it private and/or make it a extension->lang lookup?)
  • 28 |
  • static?
  • 29 |
30 |

GeSHi::highlight_lines_extra()

31 |
    32 |
  • Some data replication here that could be cut down on
  • 33 |
34 |

GeSHi::load_from_file()

35 |
    36 |
  • Complete rethink of this and above method
  • 37 |
38 |

39 | Documentation generated on Thu, 25 Dec 2008 14:34:53 +0100 by phpDocumentor 1.4.2 40 |

41 | 42 | -------------------------------------------------------------------------------- /lib/geshi/geshi/erlang.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/geshi/erlang.php -------------------------------------------------------------------------------- /lib/geshi/geshi/xbasic.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/geshi/geshi/xbasic.php -------------------------------------------------------------------------------- /lib/mergely/codemirror.readme: -------------------------------------------------------------------------------- 1 | To build own codemirror with mode, use this command: 2 | ./bin/compress --local uglifyjs lib/codemirror.min.js mode/clike/*.js > ../gitphp/lib/mergely/codemirror.min.js 3 | -------------------------------------------------------------------------------- /lib/mergely/mergely.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2014 by Jamie Peabody, http://www.mergely.com 3 | * All rights reserved. 4 | * Version: 3.3.6 2014-01-25 5 | */ 6 | 7 | /* required */ 8 | .mergely-column textarea { width: 80px; height: 200px; } 9 | .mergely-column { float: left; } 10 | .mergely-margin { float: left; } 11 | .mergely-canvas { float: left; width: 28px; } 12 | 13 | /* resizeable */ 14 | .mergely-resizer { width: 100%; height: 100%; } 15 | 16 | /* style configuration */ 17 | .mergely-column { border: 1px solid #ccc; } 18 | .mergely-active { border: 1px solid #a3d1ff; } 19 | 20 | .mergely.a.rhs {background-color: #eaffea;} 21 | .mergely.a.lhs.start.end.first { border-bottom: 0; border-top: 1px solid #a3d1ff; } 22 | 23 | .mergely.d.lhs { background-color: #edc0c0; } 24 | .mergely.d.lhs.end, 25 | .mergely.d.rhs.start.end {/* border-bottom: 1px solid #ff7f7f; */} 26 | .mergely.d.rhs.start.end.first { border-bottom: 0; border-top: 1px solid #ff7f7f; } 27 | .mergely.d.lhs.start {/* border-top: 1px solid #ff7f7f; */} 28 | 29 | .mergely.c.lhs, 30 | .mergely.c.rhs {/* background-color: #fafafa; */} 31 | .mergely.c.lhs.start, 32 | .mergely.c.rhs.start {/* border-top: 1px solid #a3a3a3; */} 33 | .mergely.c.lhs.end, 34 | .mergely.c.rhs.end {/* border-bottom: 1px solid #a3a3a3; */} 35 | 36 | .mergely.ch.a.rhs {background-color: #a6f3a6;} 37 | .mergely.ch.d.lhs {background-color: #f8cbcb;} 38 | 39 | .mergely.a.lhs.start.end { border-bottom: 1px solid #a3d1ff; } -------------------------------------------------------------------------------- /lib/php-gettext/AUTHORS: -------------------------------------------------------------------------------- 1 | Danilo Segan 2 | Nico Kaiser (contributed most changes between 1.0.2 and 1.0.3, bugfix for 1.0.5) 3 | Steven Armstrong (gettext.inc, leading to 1.0.6) 4 | -------------------------------------------------------------------------------- /lib/php-gettext/Makefile: -------------------------------------------------------------------------------- 1 | PACKAGE = php-gettext-$(VERSION) 2 | VERSION = 1.0.10 3 | 4 | DIST_FILES = \ 5 | gettext.php \ 6 | gettext.inc \ 7 | streams.php \ 8 | AUTHORS \ 9 | README \ 10 | COPYING \ 11 | Makefile \ 12 | examples/index.php \ 13 | examples/pigs_dropin.php \ 14 | examples/pigs_fallback.php \ 15 | examples/locale/sr_CS/LC_MESSAGES/messages.po \ 16 | examples/locale/sr_CS/LC_MESSAGES/messages.mo \ 17 | examples/locale/de_CH/LC_MESSAGES/messages.po \ 18 | examples/locale/de_CH/LC_MESSAGES/messages.mo \ 19 | examples/update \ 20 | tests/LocalesTest.php \ 21 | tests/ParsingTest.php 22 | 23 | check: 24 | phpunit --verbose tests 25 | 26 | dist: check 27 | if [ -d $(PACKAGE) ]; then \ 28 | rm -rf $(PACKAGE); \ 29 | fi; \ 30 | mkdir $(PACKAGE); \ 31 | if [ -d $(PACKAGE) ]; then \ 32 | cp -rp --parents $(DIST_FILES) $(PACKAGE); \ 33 | tar cvzf $(PACKAGE).tar.gz $(PACKAGE); \ 34 | rm -rf $(PACKAGE); \ 35 | fi; 36 | 37 | clean: 38 | rm -f $(PACKAGE).tar.gz 39 | -------------------------------------------------------------------------------- /lib/php-gettext/tests/ParsingTest.php: -------------------------------------------------------------------------------- 1 | assertEquals( 12 | 'nplurals=2; plural=n == 1 ? 0 : 1;', 13 | $parser->extract_plural_forms_header_from_po_header("")); 14 | 15 | // Extracting it from the middle of the header works. 16 | $this->assertEquals( 17 | 'nplurals=1; plural=0;', 18 | $parser->extract_plural_forms_header_from_po_header( 19 | "Content-type: text/html; charset=UTF-8\n" 20 | ."Plural-Forms: nplurals=1; plural=0;\n" 21 | ."Last-Translator: nobody\n" 22 | )); 23 | 24 | // It's also case-insensitive. 25 | $this->assertEquals( 26 | 'nplurals=1; plural=0;', 27 | $parser->extract_plural_forms_header_from_po_header( 28 | "PLURAL-forms: nplurals=1; plural=0;\n" 29 | )); 30 | 31 | // It falls back to default if it's not on a separate line. 32 | $this->assertEquals( 33 | 'nplurals=2; plural=n == 1 ? 0 : 1;', 34 | $parser->extract_plural_forms_header_from_po_header( 35 | "Content-type: text/html; charset=UTF-8" // note the missing \n here 36 | ."Plural-Forms: nplurals=1; plural=0;\n" 37 | ."Last-Translator: nobody\n" 38 | )); 39 | 40 | } 41 | 42 | } 43 | ?> 44 | -------------------------------------------------------------------------------- /lib/smarty-gettext/ChangeLog: -------------------------------------------------------------------------------- 1 | 2005-07-27 Sagi Bashari 2 | * README: 3 | - Redone 4 | 5 | * smarty-gettext.php: 6 | - Renamed file to block.t.php 7 | 8 | * block.t.php: 9 | - Rename smarty_translate() to smarty_block_t() 10 | - Rename strarg() to smarty_gettext_strarg 11 | - Better comments, new installation method 12 | - url escaping method 13 | 14 | * tsmarty2c.php: 15 | - Use 'env php' as php bin path 16 | - Output file name along with ripped strings 17 | - Comments, wrapping 18 | 19 | 2004-04-30 Sagi Bashari 20 | 21 | * README: 22 | - replace smarty_gettext with smarty-gettext 23 | - correct package name, project urls, add vrsion 24 | 25 | * tsmarty2.c: 26 | - check if file extension exists before checking if is in array (Florian Lanthaler ) 27 | - correct package name, project urls, add version 28 | 29 | * smarty_gettext: 30 | - rename to smarty-gettext 31 | - correct package name, project urls, add version 32 | 33 | 2004-03-01 Sagi Bashari 34 | 35 | * tsmarty2c.php: 36 | - added support for directories (originally by Uros Gruber ) 37 | - fixed bug that prevented more than 1 block per line (reported by Eneko Lacunza ) 38 | - convert new line to \n in output string 39 | 40 | * smarty_gettext.php: 41 | - run nl2br() when escaping html 42 | -------------------------------------------------------------------------------- /lib/smarty/BUGS: -------------------------------------------------------------------------------- 1 | Smarty is supported only in PHP 4.0.6 or later. 2 | 3 | Smarty versions previous to 2.0 require the PEAR libraries. Be sure to include 4 | the path to the PEAR libraries in your php include_path. Config_file.class.php 5 | uses the PEAR library for its error handling routines. PEAR comes with the PHP 6 | distribution. Unix users check /usr/local/lib/php, windows users check 7 | C:/php/pear. 8 | -------------------------------------------------------------------------------- /lib/smarty/ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/smarty/ChangeLog -------------------------------------------------------------------------------- /lib/smarty/INSTALL: -------------------------------------------------------------------------------- 1 | REQUIREMENTS: 2 | 3 | Smarty requires PHP 4.0.6 or later. 4 | See the on-line documentation for complete install instructions. 5 | 6 | INSTALLATION (quick): 7 | 8 | * copy the files under the libs/ directory to a directory that is in your PHP 9 | include_path, or set the SMARTY_DIR constant and put them in this directory. 10 | (if you upgrade from versions before 2.5.0 be aware that up to Smarty 2.4.2 11 | all necessary files where in the distribution's root directory, but are now 12 | in libs/.) 13 | 14 | * for each application using Smarty, create a "templates", "configs", and a 15 | "templates_c" directory, be sure to set the appropriate directory settings in 16 | Smarty for them. If they are located in the same directory as your 17 | application, they shouldn't need to be modified. Be sure the "templates_c" 18 | directory is writable by your web server user (usually nobody). chown 19 | nobody:nobody templates_c; chmod 700 templates_c You can also chmod 777 this 20 | directory, but be aware of security issues for multi-user systems. If you are 21 | using Smarty's built-in caching, create a "cache" directory and also chown 22 | nobody:nobody. 23 | 24 | * setup your php and template files. A good working example is in the on-line 25 | documentation. 26 | 27 | * TECHNICAL NOTE: If you do not have access to the php.ini file, you can change 28 | non-server settings (such as your include_path) with the ini_set() command. 29 | example: ini_set("include_path",".:/usr/local/lib/php"); 30 | -------------------------------------------------------------------------------- /lib/smarty/NEWS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/codeisok/7dc2e7ba603550107e63711ffb9913489e181596/lib/smarty/NEWS -------------------------------------------------------------------------------- /lib/smarty/TODO: -------------------------------------------------------------------------------- 1 | * handle asp style tags in $php_handler 2 | * fix all E_NOTICE warnings 3 | * make simple math easier 4 | * caching all but parts of the template 5 | * change plugins so $smarty variable always comes first 6 | * get cache ttl with function call 7 | FIX: make inserts use normal functions before plugins 8 | UPD: change it so that if template comes from some resource, 9 | that resource stays as the default, no need to specify it 10 | in includes. 11 | -------------------------------------------------------------------------------- /lib/smarty/demo/configs/test.conf: -------------------------------------------------------------------------------- 1 | title = Welcome to Smarty! 2 | cutoff_size = 40 3 | 4 | [setup] 5 | bold = true 6 | -------------------------------------------------------------------------------- /lib/smarty/demo/index.php: -------------------------------------------------------------------------------- 1 | compile_check = true; 8 | $smarty->debugging = true; 9 | 10 | $smarty->assign("Name","Fred Irving Johnathan Bradley Peppergill"); 11 | $smarty->assign("FirstName",array("John","Mary","James","Henry")); 12 | $smarty->assign("LastName",array("Doe","Smith","Johnson","Case")); 13 | $smarty->assign("Class",array(array("A","B","C","D"), array("E", "F", "G", "H"), 14 | array("I", "J", "K", "L"), array("M", "N", "O", "P"))); 15 | 16 | $smarty->assign("contacts", array(array("phone" => "1", "fax" => "2", "cell" => "3"), 17 | array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234"))); 18 | 19 | $smarty->assign("option_values", array("NY","NE","KS","IA","OK","TX")); 20 | $smarty->assign("option_output", array("New York","Nebraska","Kansas","Iowa","Oklahoma","Texas")); 21 | $smarty->assign("option_selected", "NE"); 22 | 23 | $smarty->display('index.tpl'); 24 | 25 | ?> 26 | -------------------------------------------------------------------------------- /lib/smarty/demo/templates/footer.tpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /lib/smarty/demo/templates/header.tpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | {popup_init src="/javascripts/overlib.js"} 4 | {$title} - {$Name} 5 | 6 | 7 | -------------------------------------------------------------------------------- /lib/smarty/demo/templates/index.tpl: -------------------------------------------------------------------------------- 1 | {config_load file=test.conf section="setup"} 2 | {include file="header.tpl" title=foo} 3 | 4 |
 5 | 
 6 | {* bold and title are read from the config file *}
 7 | {if #bold#}{/if}
 8 | {* capitalize the first letters of each word of the title *}
 9 | Title: {#title#|capitalize}
10 | {if #bold#}{/if}
11 | 
12 | The current date and time is {$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
13 | 
14 | The value of global assigned variable $SCRIPT_NAME is {$SCRIPT_NAME}
15 | 
16 | Example of accessing server environment variable SERVER_NAME: {$smarty.server.SERVER_NAME}
17 | 
18 | The value of {ldelim}$Name{rdelim} is {$Name}
19 | 
20 | variable modifier example of {ldelim}$Name|upper{rdelim}
21 | 
22 | {$Name|upper}
23 | 
24 | 
25 | An example of a section loop:
26 | 
27 | {section name=outer loop=$FirstName}
28 | {if $smarty.section.outer.index is odd by 2}
29 | 	{$smarty.section.outer.rownum} . {$FirstName[outer]} {$LastName[outer]}
30 | {else}
31 | 	{$smarty.section.outer.rownum} * {$FirstName[outer]} {$LastName[outer]}
32 | {/if}
33 | {sectionelse}
34 | 	none
35 | {/section}
36 | 
37 | An example of section looped key values:
38 | 
39 | {section name=sec1 loop=$contacts}
40 | 	phone: {$contacts[sec1].phone}
41 | fax: {$contacts[sec1].fax}
42 | cell: {$contacts[sec1].cell}
43 | {/section} 44 |

45 | 46 | testing strip tags 47 | {strip} 48 | 49 | 50 | 55 | 56 |
51 | 52 | This is a test 53 | 54 |
57 | {/strip} 58 | 59 |

60 | 61 | This is an example of the html_select_date function: 62 | 63 |
64 | {html_select_date start_year=1998 end_year=2010} 65 |
66 | 67 | This is an example of the html_select_time function: 68 | 69 |
70 | {html_select_time use_24_hours=false} 71 |
72 | 73 | This is an example of the html_options function: 74 | 75 |
76 | 79 |
80 | 81 | {include file="footer.tpl"} 82 | -------------------------------------------------------------------------------- /lib/smarty/libs/internals/core.assemble_plugin_filepath.php: -------------------------------------------------------------------------------- 1 | plugins_dir as $_plugin_dir) { 26 | 27 | $_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename; 28 | 29 | // see if path is relative 30 | if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $_plugin_dir)) { 31 | $_relative_paths[] = $_plugin_dir; 32 | // relative path, see if it is in the SMARTY_DIR 33 | if (@is_readable(SMARTY_DIR . $_plugin_filepath)) { 34 | $_return = SMARTY_DIR . $_plugin_filepath; 35 | break; 36 | } 37 | } 38 | // try relative to cwd (or absolute) 39 | if (@is_readable($_plugin_filepath)) { 40 | $_return = $_plugin_filepath; 41 | break; 42 | } 43 | } 44 | 45 | if($_return === false) { 46 | // still not found, try PHP include_path 47 | if(isset($_relative_paths)) { 48 | foreach ((array)$_relative_paths as $_plugin_dir) { 49 | 50 | $_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename; 51 | 52 | $_params = array('file_path' => $_plugin_filepath); 53 | require_once(SMARTY_CORE_DIR . 'core.get_include_path.php'); 54 | if(smarty_core_get_include_path($_params, $smarty)) { 55 | $_return = $_params['new_file_path']; 56 | break; 57 | } 58 | } 59 | } 60 | } 61 | $_filepaths_cache[$_plugin_filename] = $_return; 62 | return $_return; 63 | } 64 | 65 | /* vim: set expandtab: */ 66 | 67 | ?> 68 | -------------------------------------------------------------------------------- /lib/smarty/libs/internals/core.assign_smarty_interface.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: assign_smarty_interface
13 | * Purpose: assign the $smarty interface variable 14 | * @param array Format: null 15 | * @param Smarty 16 | */ 17 | function smarty_core_assign_smarty_interface($params, &$smarty) 18 | { 19 | if (isset($smarty->_smarty_vars) && isset($smarty->_smarty_vars['request'])) { 20 | return; 21 | } 22 | 23 | $_globals_map = array('g' => 'HTTP_GET_VARS', 24 | 'p' => 'HTTP_POST_VARS', 25 | 'c' => 'HTTP_COOKIE_VARS', 26 | 's' => 'HTTP_SERVER_VARS', 27 | 'e' => 'HTTP_ENV_VARS'); 28 | 29 | $_smarty_vars_request = array(); 30 | 31 | foreach (preg_split('!!', strtolower($smarty->request_vars_order)) as $_c) { 32 | if (isset($_globals_map[$_c])) { 33 | $_smarty_vars_request = array_merge($_smarty_vars_request, $GLOBALS[$_globals_map[$_c]]); 34 | } 35 | } 36 | $_smarty_vars_request = @array_merge($_smarty_vars_request, $GLOBALS['HTTP_SESSION_VARS']); 37 | 38 | $smarty->_smarty_vars['request'] = $_smarty_vars_request; 39 | } 40 | 41 | /* vim: set expandtab: */ 42 | 43 | ?> 44 | -------------------------------------------------------------------------------- /lib/smarty/libs/internals/core.display_debug_console.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: display_debug_console
13 | * Purpose: display the javascript debug console window 14 | * @param array Format: null 15 | * @param Smarty 16 | */ 17 | function smarty_core_display_debug_console($params, &$smarty) 18 | { 19 | // we must force compile the debug template in case the environment 20 | // changed between separate applications. 21 | 22 | if(empty($smarty->debug_tpl)) { 23 | // set path to debug template from SMARTY_DIR 24 | $smarty->debug_tpl = SMARTY_DIR . 'debug.tpl'; 25 | if($smarty->security && is_file($smarty->debug_tpl)) { 26 | $smarty->secure_dir[] = realpath($smarty->debug_tpl); 27 | } 28 | $smarty->debug_tpl = 'file:' . SMARTY_DIR . 'debug.tpl'; 29 | } 30 | 31 | $_ldelim_orig = $smarty->left_delimiter; 32 | $_rdelim_orig = $smarty->right_delimiter; 33 | 34 | $smarty->left_delimiter = '{'; 35 | $smarty->right_delimiter = '}'; 36 | 37 | $_compile_id_orig = $smarty->_compile_id; 38 | $smarty->_compile_id = null; 39 | 40 | $_compile_path = $smarty->_get_compile_path($smarty->debug_tpl); 41 | if ($smarty->_compile_resource($smarty->debug_tpl, $_compile_path)) 42 | { 43 | ob_start(); 44 | $smarty->_include($_compile_path); 45 | $_results = ob_get_contents(); 46 | ob_end_clean(); 47 | } else { 48 | $_results = ''; 49 | } 50 | 51 | $smarty->_compile_id = $_compile_id_orig; 52 | 53 | $smarty->left_delimiter = $_ldelim_orig; 54 | $smarty->right_delimiter = $_rdelim_orig; 55 | 56 | return $_results; 57 | } 58 | 59 | /* vim: set expandtab: */ 60 | 61 | ?> 62 | -------------------------------------------------------------------------------- /lib/smarty/libs/internals/core.get_include_path.php: -------------------------------------------------------------------------------- 1 | 45 | -------------------------------------------------------------------------------- /lib/smarty/libs/internals/core.get_microtime.php: -------------------------------------------------------------------------------- 1 | 24 | -------------------------------------------------------------------------------- /lib/smarty/libs/internals/core.is_secure.php: -------------------------------------------------------------------------------- 1 | security || $smarty->security_settings['INCLUDE_ANY']) { 21 | return true; 22 | } 23 | 24 | if ($params['resource_type'] == 'file') { 25 | $_rp = realpath($params['resource_name']); 26 | if (isset($params['resource_base_path'])) { 27 | foreach ((array)$params['resource_base_path'] as $curr_dir) { 28 | if ( ($_cd = realpath($curr_dir)) !== false && 29 | strncmp($_rp, $_cd, strlen($_cd)) == 0 && 30 | substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR ) { 31 | return true; 32 | } 33 | } 34 | } 35 | if (!empty($smarty->secure_dir)) { 36 | foreach ((array)$smarty->secure_dir as $curr_dir) { 37 | if ( ($_cd = realpath($curr_dir)) !== false) { 38 | if($_cd == $_rp) { 39 | return true; 40 | } elseif (strncmp($_rp, $_cd, strlen($_cd)) == 0 && 41 | substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR) { 42 | return true; 43 | } 44 | } 45 | } 46 | } 47 | } else { 48 | // resource is not on local file system 49 | return call_user_func_array( 50 | $smarty->_plugins['resource'][$params['resource_type']][0][2], 51 | array($params['resource_name'], &$smarty)); 52 | } 53 | 54 | return false; 55 | } 56 | 57 | /* vim: set expandtab: */ 58 | 59 | ?> 60 | -------------------------------------------------------------------------------- /lib/smarty/libs/internals/core.is_trusted.php: -------------------------------------------------------------------------------- 1 | trusted_dir)) { 23 | $_rp = realpath($params['resource_name']); 24 | foreach ((array)$smarty->trusted_dir as $curr_dir) { 25 | if (!empty($curr_dir) && is_readable ($curr_dir)) { 26 | $_cd = realpath($curr_dir); 27 | if (strncmp($_rp, $_cd, strlen($_cd)) == 0 28 | && substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR ) { 29 | $_smarty_trusted = true; 30 | break; 31 | } 32 | } 33 | } 34 | } 35 | 36 | } else { 37 | // resource is not on local file system 38 | $_smarty_trusted = call_user_func_array($smarty->_plugins['resource'][$params['resource_type']][0][3], 39 | array($params['resource_name'], $smarty)); 40 | } 41 | 42 | return $_smarty_trusted; 43 | } 44 | 45 | /* vim: set expandtab: */ 46 | 47 | ?> 48 | -------------------------------------------------------------------------------- /lib/smarty/libs/internals/core.process_compiled_include.php: -------------------------------------------------------------------------------- 1 | _cache_including; 20 | $smarty->_cache_including = true; 21 | 22 | $_return = $params['results']; 23 | 24 | foreach ($smarty->_cache_info['cache_serials'] as $_include_file_path=>$_cache_serial) { 25 | $smarty->_include($_include_file_path, true); 26 | } 27 | 28 | foreach ($smarty->_cache_info['cache_serials'] as $_include_file_path=>$_cache_serial) { 29 | $_return = preg_replace_callback('!(\{nocache\:('.$_cache_serial.')#(\d+)\})!s', 30 | array(&$smarty, '_process_compiled_include_callback'), 31 | $_return); 32 | } 33 | $smarty->_cache_including = $_cache_including; 34 | return $_return; 35 | } 36 | 37 | ?> 38 | -------------------------------------------------------------------------------- /lib/smarty/libs/internals/core.rmdir.php: -------------------------------------------------------------------------------- 1 | keep root) 10 | * WARNING: no tests, it will try to remove what you tell it! 11 | * 12 | * @param string $dirname 13 | * @param integer $level 14 | * @param integer $exp_time 15 | * @return boolean 16 | */ 17 | 18 | // $dirname, $level = 1, $exp_time = null 19 | 20 | function smarty_core_rmdir($params, &$smarty) 21 | { 22 | if(!isset($params['level'])) { $params['level'] = 1; } 23 | if(!isset($params['exp_time'])) { $params['exp_time'] = null; } 24 | 25 | if($_handle = @opendir($params['dirname'])) { 26 | 27 | while (false !== ($_entry = readdir($_handle))) { 28 | if ($_entry != '.' && $_entry != '..') { 29 | if (@is_dir($params['dirname'] . DIRECTORY_SEPARATOR . $_entry)) { 30 | $_params = array( 31 | 'dirname' => $params['dirname'] . DIRECTORY_SEPARATOR . $_entry, 32 | 'level' => $params['level'] + 1, 33 | 'exp_time' => $params['exp_time'] 34 | ); 35 | smarty_core_rmdir($_params, $smarty); 36 | } 37 | else { 38 | $smarty->_unlink($params['dirname'] . DIRECTORY_SEPARATOR . $_entry, $params['exp_time']); 39 | } 40 | } 41 | } 42 | closedir($_handle); 43 | } 44 | 45 | if ($params['level']) { 46 | return @rmdir($params['dirname']); 47 | } 48 | return (bool)$_handle; 49 | 50 | } 51 | 52 | /* vim: set expandtab: */ 53 | 54 | ?> 55 | -------------------------------------------------------------------------------- /lib/smarty/libs/internals/core.smarty_include_php.php: -------------------------------------------------------------------------------- 1 | $params['smarty_file']); 24 | require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php'); 25 | smarty_core_get_php_resource($_params, $smarty); 26 | $_smarty_resource_type = $_params['resource_type']; 27 | $_smarty_php_resource = $_params['php_resource']; 28 | 29 | if (!empty($params['smarty_assign'])) { 30 | ob_start(); 31 | if ($_smarty_resource_type == 'file') { 32 | $smarty->_include($_smarty_php_resource, $params['smarty_once'], $params['smarty_include_vars']); 33 | } else { 34 | $smarty->_eval($_smarty_php_resource, $params['smarty_include_vars']); 35 | } 36 | $smarty->assign($params['smarty_assign'], ob_get_contents()); 37 | ob_end_clean(); 38 | } else { 39 | if ($_smarty_resource_type == 'file') { 40 | $smarty->_include($_smarty_php_resource, $params['smarty_once'], $params['smarty_include_vars']); 41 | } else { 42 | $smarty->_eval($_smarty_php_resource, $params['smarty_include_vars']); 43 | } 44 | } 45 | } 46 | 47 | 48 | /* vim: set expandtab: */ 49 | 50 | ?> 51 | -------------------------------------------------------------------------------- /lib/smarty/libs/internals/core.write_compiled_resource.php: -------------------------------------------------------------------------------- 1 | compile_dir)) { 18 | // compile_dir not writable, see if it exists 19 | if(!@is_dir($smarty->compile_dir)) { 20 | $smarty->trigger_error('the $compile_dir \'' . $smarty->compile_dir . '\' does not exist, or is not a directory.', E_USER_ERROR); 21 | return false; 22 | } 23 | $smarty->trigger_error('unable to write to $compile_dir \'' . realpath($smarty->compile_dir) . '\'. Be sure $compile_dir is writable by the web server user.', E_USER_ERROR); 24 | return false; 25 | } 26 | 27 | $_params = array('filename' => $params['compile_path'], 'contents' => $params['compiled_content'], 'create_dirs' => true); 28 | require_once(SMARTY_CORE_DIR . 'core.write_file.php'); 29 | smarty_core_write_file($_params, $smarty); 30 | return true; 31 | } 32 | 33 | /* vim: set expandtab: */ 34 | 35 | ?> 36 | -------------------------------------------------------------------------------- /lib/smarty/libs/internals/core.write_file.php: -------------------------------------------------------------------------------- 1 | $_dirname); 22 | require_once(SMARTY_CORE_DIR . 'core.create_dir_structure.php'); 23 | smarty_core_create_dir_structure($_params, $smarty); 24 | } 25 | 26 | // write to tmp file, then rename it to avoid file locking race condition 27 | $_tmp_file = tempnam($_dirname, 'wrt'); 28 | 29 | if (!($fd = @fopen($_tmp_file, 'wb'))) { 30 | $_tmp_file = $_dirname . DIRECTORY_SEPARATOR . uniqid('wrt'); 31 | if (!($fd = @fopen($_tmp_file, 'wb'))) { 32 | $smarty->trigger_error("problem writing temporary file '$_tmp_file'"); 33 | return false; 34 | } 35 | } 36 | 37 | fwrite($fd, $params['contents']); 38 | fclose($fd); 39 | 40 | if (DIRECTORY_SEPARATOR == '\\' || !@rename($_tmp_file, $params['filename'])) { 41 | // On platforms and filesystems that cannot overwrite with rename() 42 | // delete the file before renaming it -- because windows always suffers 43 | // this, it is short-circuited to avoid the initial rename() attempt 44 | @unlink($params['filename']); 45 | @rename($_tmp_file, $params['filename']); 46 | } 47 | @chmod($params['filename'], $smarty->_file_perms); 48 | 49 | return true; 50 | } 51 | 52 | /* vim: set expandtab: */ 53 | 54 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/compiler.assign.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: assign
13 | * Purpose: assign a value to a template variable 14 | * @link http://smarty.php.net/manual/en/language.custom.functions.php#LANGUAGE.FUNCTION.ASSIGN {assign} 15 | * (Smarty online manual) 16 | * @author Monte Ohrt (initial author) 17 | * @author messju mohr (conversion to compiler function) 18 | * @param string containing var-attribute and value-attribute 19 | * @param Smarty_Compiler 20 | */ 21 | function smarty_compiler_assign($tag_attrs, &$compiler) 22 | { 23 | $_params = $compiler->_parse_attrs($tag_attrs); 24 | 25 | if (!isset($_params['var'])) { 26 | $compiler->_syntax_error("assign: missing 'var' parameter", E_USER_WARNING); 27 | return; 28 | } 29 | 30 | if (!isset($_params['value'])) { 31 | $compiler->_syntax_error("assign: missing 'value' parameter", E_USER_WARNING); 32 | return; 33 | } 34 | 35 | return "\$this->assign({$_params['var']}, {$_params['value']});"; 36 | } 37 | 38 | /* vim: set expandtab: */ 39 | 40 | ?> 41 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/function.assign_debug_info.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: assign_debug_info
13 | * Purpose: assign debug info to the template
14 | * @author Monte Ohrt 15 | * @param array unused in this plugin, this plugin uses {@link Smarty::$_config}, 16 | * {@link Smarty::$_tpl_vars} and {@link Smarty::$_smarty_debug_info} 17 | * @param Smarty 18 | */ 19 | function smarty_function_assign_debug_info($params, &$smarty) 20 | { 21 | $assigned_vars = $smarty->_tpl_vars; 22 | ksort($assigned_vars); 23 | if (@is_array($smarty->_config[0])) { 24 | $config_vars = $smarty->_config[0]; 25 | ksort($config_vars); 26 | $smarty->assign("_debug_config_keys", array_keys($config_vars)); 27 | $smarty->assign("_debug_config_vals", array_values($config_vars)); 28 | } 29 | 30 | $included_templates = $smarty->_smarty_debug_info; 31 | 32 | $smarty->assign("_debug_keys", array_keys($assigned_vars)); 33 | $smarty->assign("_debug_vals", array_values($assigned_vars)); 34 | 35 | $smarty->assign("_debug_tpls", $included_templates); 36 | } 37 | 38 | /* vim: set expandtab: */ 39 | 40 | ?> 41 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/function.counter.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: counter
14 | * Purpose: print out a counter value 15 | * @author Monte Ohrt 16 | * @link http://smarty.php.net/manual/en/language.function.counter.php {counter} 17 | * (Smarty online manual) 18 | * @param array parameters 19 | * @param Smarty 20 | * @return string|null 21 | */ 22 | function smarty_function_counter($params, &$smarty) 23 | { 24 | static $counters = array(); 25 | 26 | $name = (isset($params['name'])) ? $params['name'] : 'default'; 27 | if (!isset($counters[$name])) { 28 | $counters[$name] = array( 29 | 'start'=>1, 30 | 'skip'=>1, 31 | 'direction'=>'up', 32 | 'count'=>1 33 | ); 34 | } 35 | $counter =& $counters[$name]; 36 | 37 | if (isset($params['start'])) { 38 | $counter['start'] = $counter['count'] = (int)$params['start']; 39 | } 40 | 41 | if (!empty($params['assign'])) { 42 | $counter['assign'] = $params['assign']; 43 | } 44 | 45 | if (isset($counter['assign'])) { 46 | $smarty->assign($counter['assign'], $counter['count']); 47 | } 48 | 49 | if (isset($params['print'])) { 50 | $print = (bool)$params['print']; 51 | } else { 52 | $print = empty($counter['assign']); 53 | } 54 | 55 | if ($print) { 56 | $retval = $counter['count']; 57 | } else { 58 | $retval = null; 59 | } 60 | 61 | if (isset($params['skip'])) { 62 | $counter['skip'] = $params['skip']; 63 | } 64 | 65 | if (isset($params['direction'])) { 66 | $counter['direction'] = $params['direction']; 67 | } 68 | 69 | if ($counter['direction'] == "down") 70 | $counter['count'] -= $counter['skip']; 71 | else 72 | $counter['count'] += $counter['skip']; 73 | 74 | return $retval; 75 | 76 | } 77 | 78 | /* vim: set expandtab: */ 79 | 80 | ?> 81 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/function.debug.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: debug
14 | * Date: July 1, 2002
15 | * Purpose: popup debug window 16 | * @link http://smarty.php.net/manual/en/language.function.debug.php {debug} 17 | * (Smarty online manual) 18 | * @author Monte Ohrt 19 | * @version 1.0 20 | * @param array 21 | * @param Smarty 22 | * @return string output from {@link Smarty::_generate_debug_output()} 23 | */ 24 | function smarty_function_debug($params, &$smarty) 25 | { 26 | if (isset($params['output'])) { 27 | $smarty->assign('_smarty_debug_output', $params['output']); 28 | } 29 | require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php'); 30 | return smarty_core_display_debug_console(null, $smarty); 31 | } 32 | 33 | /* vim: set expandtab: */ 34 | 35 | ?> 36 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/function.eval.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: eval
14 | * Purpose: evaluate a template variable as a template
15 | * @link http://smarty.php.net/manual/en/language.function.eval.php {eval} 16 | * (Smarty online manual) 17 | * @author Monte Ohrt 18 | * @param array 19 | * @param Smarty 20 | */ 21 | function smarty_function_eval($params, &$smarty) 22 | { 23 | 24 | if (!isset($params['var'])) { 25 | $smarty->trigger_error("eval: missing 'var' parameter"); 26 | return; 27 | } 28 | 29 | if($params['var'] == '') { 30 | return; 31 | } 32 | 33 | $smarty->_compile_source('evaluated template', $params['var'], $_var_compiled); 34 | 35 | ob_start(); 36 | $smarty->_eval('?>' . $_var_compiled); 37 | $_contents = ob_get_contents(); 38 | ob_end_clean(); 39 | 40 | if (!empty($params['assign'])) { 41 | $smarty->assign($params['assign'], $_contents); 42 | } else { 43 | return $_contents; 44 | } 45 | } 46 | 47 | /* vim: set expandtab: */ 48 | 49 | ?> 50 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/function.popup_init.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: popup_init
14 | * Purpose: initialize overlib 15 | * @link http://smarty.php.net/manual/en/language.function.popup.init.php {popup_init} 16 | * (Smarty online manual) 17 | * @author Monte Ohrt 18 | * @param array 19 | * @param Smarty 20 | * @return string 21 | */ 22 | function smarty_function_popup_init($params, &$smarty) 23 | { 24 | $zindex = 1000; 25 | 26 | if (!empty($params['zindex'])) { 27 | $zindex = $params['zindex']; 28 | } 29 | 30 | if (!empty($params['src'])) { 31 | return '' . "\n" 32 | . '' . "\n"; 33 | } else { 34 | $smarty->trigger_error("popup_init: missing src parameter"); 35 | } 36 | } 37 | 38 | /* vim: set expandtab: */ 39 | 40 | ?> 41 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifier.capitalize.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: capitalize
14 | * Purpose: capitalize words in the string 15 | * @link http://smarty.php.net/manual/en/language.modifiers.php#LANGUAGE.MODIFIER.CAPITALIZE 16 | * capitalize (Smarty online manual) 17 | * @author Monte Ohrt 18 | * @param string 19 | * @return string 20 | */ 21 | function smarty_modifier_capitalize($string, $uc_digits = false) 22 | { 23 | smarty_modifier_capitalize_ucfirst(null, $uc_digits); 24 | return preg_replace_callback('!\'?\b\w(\w|\')*\b!', 'smarty_modifier_capitalize_ucfirst', $string); 25 | } 26 | 27 | function smarty_modifier_capitalize_ucfirst($string, $uc_digits = null) 28 | { 29 | static $_uc_digits = false; 30 | 31 | if(isset($uc_digits)) { 32 | $_uc_digits = $uc_digits; 33 | return; 34 | } 35 | 36 | if(substr($string[0],0,1) != "'" && !preg_match("!\d!",$string[0]) || $_uc_digits) 37 | return ucfirst($string[0]); 38 | else 39 | return $string[0]; 40 | } 41 | 42 | 43 | ?> 44 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifier.cat.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: cat
14 | * Date: Feb 24, 2003 15 | * Purpose: catenate a value to a variable 16 | * Input: string to catenate 17 | * Example: {$var|cat:"foo"} 18 | * @link http://smarty.php.net/manual/en/language.modifier.cat.php cat 19 | * (Smarty online manual) 20 | * @author Monte Ohrt 21 | * @version 1.0 22 | * @param string 23 | * @param string 24 | * @return string 25 | */ 26 | function smarty_modifier_cat($string, $cat) 27 | { 28 | return $string . $cat; 29 | } 30 | 31 | /* vim: set expandtab: */ 32 | 33 | ?> 34 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifier.count_characters.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: count_characteres
14 | * Purpose: count the number of characters in a text 15 | * @link http://smarty.php.net/manual/en/language.modifier.count.characters.php 16 | * count_characters (Smarty online manual) 17 | * @author Monte Ohrt 18 | * @param string 19 | * @param boolean include whitespace in the character count 20 | * @return integer 21 | */ 22 | function smarty_modifier_count_characters($string, $include_spaces = false) 23 | { 24 | if ($include_spaces) 25 | return(strlen($string)); 26 | 27 | return preg_match_all("/[^\s]/",$string, $match); 28 | } 29 | 30 | /* vim: set expandtab: */ 31 | 32 | ?> 33 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifier.count_paragraphs.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: count_paragraphs
14 | * Purpose: count the number of paragraphs in a text 15 | * @link http://smarty.php.net/manual/en/language.modifier.count.paragraphs.php 16 | * count_paragraphs (Smarty online manual) 17 | * @author Monte Ohrt 18 | * @param string 19 | * @return integer 20 | */ 21 | function smarty_modifier_count_paragraphs($string) 22 | { 23 | // count \r or \n characters 24 | return count(preg_split('/[\r\n]+/', $string)); 25 | } 26 | 27 | /* vim: set expandtab: */ 28 | 29 | ?> 30 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifier.count_sentences.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: count_sentences 14 | * Purpose: count the number of sentences in a text 15 | * @link http://smarty.php.net/manual/en/language.modifier.count.paragraphs.php 16 | * count_sentences (Smarty online manual) 17 | * @author Monte Ohrt 18 | * @param string 19 | * @return integer 20 | */ 21 | function smarty_modifier_count_sentences($string) 22 | { 23 | // find periods with a word before but not after. 24 | return preg_match_all('/[^\s]\.(?!\w)/', $string, $match); 25 | } 26 | 27 | /* vim: set expandtab: */ 28 | 29 | ?> 30 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifier.count_words.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: count_words
14 | * Purpose: count the number of words in a text 15 | * @link http://smarty.php.net/manual/en/language.modifier.count.words.php 16 | * count_words (Smarty online manual) 17 | * @author Monte Ohrt 18 | * @param string 19 | * @return integer 20 | */ 21 | function smarty_modifier_count_words($string) 22 | { 23 | // split text by ' ',\r,\n,\f,\t 24 | $split_array = preg_split('/\s+/',$string); 25 | // count matches that contain alphanumerics 26 | $word_count = preg_grep('/[a-zA-Z0-9\\x80-\\xff]/', $split_array); 27 | 28 | return count($word_count); 29 | } 30 | 31 | /* vim: set expandtab: */ 32 | 33 | ?> 34 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifier.date_format.php: -------------------------------------------------------------------------------- 1 | _get_plugin_filepath('shared', 'make_timestamp'); 12 | /** 13 | * Smarty date_format modifier plugin 14 | * 15 | * Type: modifier
16 | * Name: date_format
17 | * Purpose: format datestamps via strftime
18 | * Input:
19 | * - string: input date string 20 | * - format: strftime format for output 21 | * - default_date: default date if $string is empty 22 | * @link http://smarty.php.net/manual/en/language.modifier.date.format.php 23 | * date_format (Smarty online manual) 24 | * @author Monte Ohrt 25 | * @param string 26 | * @param string 27 | * @param string 28 | * @return string|void 29 | * @uses smarty_make_timestamp() 30 | */ 31 | function smarty_modifier_date_format($string, $format = '%b %e, %Y', $default_date = '') 32 | { 33 | if ($string != '') { 34 | $timestamp = smarty_make_timestamp($string); 35 | } elseif ($default_date != '') { 36 | $timestamp = smarty_make_timestamp($default_date); 37 | } else { 38 | return; 39 | } 40 | if (DIRECTORY_SEPARATOR == '\\') { 41 | $_win_from = array('%D', '%h', '%n', '%r', '%R', '%t', '%T'); 42 | $_win_to = array('%m/%d/%y', '%b', "\n", '%I:%M:%S %p', '%H:%M', "\t", '%H:%M:%S'); 43 | if (strpos($format, '%e') !== false) { 44 | $_win_from[] = '%e'; 45 | $_win_to[] = sprintf('%\' 2d', date('j', $timestamp)); 46 | } 47 | if (strpos($format, '%l') !== false) { 48 | $_win_from[] = '%l'; 49 | $_win_to[] = sprintf('%\' 2d', date('h', $timestamp)); 50 | } 51 | $format = str_replace($_win_from, $_win_to, $format); 52 | } 53 | return strftime($format, $timestamp); 54 | } 55 | 56 | /* vim: set expandtab: */ 57 | 58 | ?> 59 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifier.default.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: default
14 | * Purpose: designate default value for empty variables 15 | * @link http://smarty.php.net/manual/en/language.modifier.default.php 16 | * default (Smarty online manual) 17 | * @author Monte Ohrt 18 | * @param string 19 | * @param string 20 | * @return string 21 | */ 22 | function smarty_modifier_default($string, $default = '') 23 | { 24 | if (!isset($string) || $string === '') 25 | return $default; 26 | else 27 | return $string; 28 | } 29 | 30 | /* vim: set expandtab: */ 31 | 32 | ?> 33 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifier.indent.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: indent
14 | * Purpose: indent lines of text 15 | * @link http://smarty.php.net/manual/en/language.modifier.indent.php 16 | * indent (Smarty online manual) 17 | * @author Monte Ohrt 18 | * @param string 19 | * @param integer 20 | * @param string 21 | * @return string 22 | */ 23 | function smarty_modifier_indent($string,$chars=4,$char=" ") 24 | { 25 | return preg_replace('!^!m',str_repeat($char,$chars),$string); 26 | } 27 | 28 | ?> 29 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifier.lower.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: lower
14 | * Purpose: convert string to lowercase 15 | * @link http://smarty.php.net/manual/en/language.modifier.lower.php 16 | * lower (Smarty online manual) 17 | * @author Monte Ohrt 18 | * @param string 19 | * @return string 20 | */ 21 | function smarty_modifier_lower($string) 22 | { 23 | return strtolower($string); 24 | } 25 | 26 | ?> 27 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifier.nl2br.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: nl2br
14 | * Date: Feb 26, 2003 15 | * Purpose: convert \r\n, \r or \n to <
> 16 | * Input:
17 | * - contents = contents to replace 18 | * - preceed_test = if true, includes preceeding break tags 19 | * in replacement 20 | * Example: {$text|nl2br} 21 | * @link http://smarty.php.net/manual/en/language.modifier.nl2br.php 22 | * nl2br (Smarty online manual) 23 | * @version 1.0 24 | * @author Monte Ohrt 25 | * @param string 26 | * @return string 27 | */ 28 | function smarty_modifier_nl2br($string) 29 | { 30 | return nl2br($string); 31 | } 32 | 33 | /* vim: set expandtab: */ 34 | 35 | ?> 36 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifier.regex_replace.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: regex_replace
14 | * Purpose: regular expression search/replace 15 | * @link http://smarty.php.net/manual/en/language.modifier.regex.replace.php 16 | * regex_replace (Smarty online manual) 17 | * @author Monte Ohrt 18 | * @param string 19 | * @param string|array 20 | * @param string|array 21 | * @return string 22 | */ 23 | function smarty_modifier_regex_replace($string, $search, $replace) 24 | { 25 | if(is_array($search)) { 26 | foreach($search as $idx => $s) 27 | $search[$idx] = _smarty_regex_replace_check($s); 28 | } else { 29 | $search = _smarty_regex_replace_check($search); 30 | } 31 | 32 | return preg_replace($search, $replace, $string); 33 | } 34 | 35 | function _smarty_regex_replace_check($search) 36 | { 37 | if (($pos = strpos($search,"\0")) !== false) 38 | $search = substr($search,0,$pos); 39 | if (preg_match('!([a-zA-Z\s]+)$!s', $search, $match) && (strpos($match[1], 'e') !== false)) { 40 | /* remove eval-modifier from $search */ 41 | $search = substr($search, 0, -strlen($match[1])) . preg_replace('![e\s]+!', '', $match[1]); 42 | } 43 | return $search; 44 | } 45 | 46 | /* vim: set expandtab: */ 47 | 48 | ?> 49 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifier.replace.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: replace
14 | * Purpose: simple search/replace 15 | * @link http://smarty.php.net/manual/en/language.modifier.replace.php 16 | * replace (Smarty online manual) 17 | * @author Monte Ohrt 18 | * @param string 19 | * @param string 20 | * @param string 21 | * @return string 22 | */ 23 | function smarty_modifier_replace($string, $search, $replace) 24 | { 25 | return str_replace($search, $replace, $string); 26 | } 27 | 28 | /* vim: set expandtab: */ 29 | 30 | ?> 31 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifier.spacify.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: spacify
14 | * Purpose: add spaces between characters in a string 15 | * @link http://smarty.php.net/manual/en/language.modifier.spacify.php 16 | * spacify (Smarty online manual) 17 | * @author Monte Ohrt 18 | * @param string 19 | * @param string 20 | * @return string 21 | */ 22 | function smarty_modifier_spacify($string, $spacify_char = ' ') 23 | { 24 | return implode($spacify_char, 25 | preg_split('//', $string, -1, PREG_SPLIT_NO_EMPTY)); 26 | } 27 | 28 | /* vim: set expandtab: */ 29 | 30 | ?> 31 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifier.string_format.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: string_format
14 | * Purpose: format strings via sprintf 15 | * @link http://smarty.php.net/manual/en/language.modifier.string.format.php 16 | * string_format (Smarty online manual) 17 | * @author Monte Ohrt 18 | * @param string 19 | * @param string 20 | * @return string 21 | */ 22 | function smarty_modifier_string_format($string, $format) 23 | { 24 | return sprintf($format, $string); 25 | } 26 | 27 | /* vim: set expandtab: */ 28 | 29 | ?> 30 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifier.strip.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: strip
14 | * Purpose: Replace all repeated spaces, newlines, tabs 15 | * with a single space or supplied replacement string.
16 | * Example: {$var|strip} {$var|strip:" "} 17 | * Date: September 25th, 2002 18 | * @link http://smarty.php.net/manual/en/language.modifier.strip.php 19 | * strip (Smarty online manual) 20 | * @author Monte Ohrt 21 | * @version 1.0 22 | * @param string 23 | * @param string 24 | * @return string 25 | */ 26 | function smarty_modifier_strip($text, $replace = ' ') 27 | { 28 | return preg_replace('!\s+!', $replace, $text); 29 | } 30 | 31 | /* vim: set expandtab: */ 32 | 33 | ?> 34 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifier.strip_tags.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: strip_tags
14 | * Purpose: strip html tags from text 15 | * @link http://smarty.php.net/manual/en/language.modifier.strip.tags.php 16 | * strip_tags (Smarty online manual) 17 | * @author Monte Ohrt 18 | * @param string 19 | * @param boolean 20 | * @return string 21 | */ 22 | function smarty_modifier_strip_tags($string, $replace_with_space = true) 23 | { 24 | if ($replace_with_space) 25 | return preg_replace('!<[^>]*?>!', ' ', $string); 26 | else 27 | return strip_tags($string); 28 | } 29 | 30 | /* vim: set expandtab: */ 31 | 32 | ?> 33 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifier.truncate.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: truncate
14 | * Purpose: Truncate a string to a certain length if necessary, 15 | * optionally splitting in the middle of a word, and 16 | * appending the $etc string or inserting $etc into the middle. 17 | * @link http://smarty.php.net/manual/en/language.modifier.truncate.php 18 | * truncate (Smarty online manual) 19 | * @author Monte Ohrt 20 | * @param string 21 | * @param integer 22 | * @param string 23 | * @param boolean 24 | * @param boolean 25 | * @return string 26 | */ 27 | function smarty_modifier_truncate($string, $length = 80, $etc = '...', 28 | $break_words = false, $middle = false) 29 | { 30 | if ($length == 0) 31 | return ''; 32 | 33 | if (strlen($string) > $length) { 34 | $length -= min($length, strlen($etc)); 35 | if (!$break_words && !$middle) { 36 | $string = preg_replace('/\s+?(\S+)?$/', '', substr($string, 0, $length+1)); 37 | } 38 | if(!$middle) { 39 | return substr($string, 0, $length) . $etc; 40 | } else { 41 | return substr($string, 0, $length/2) . $etc . substr($string, -$length/2); 42 | } 43 | } else { 44 | return $string; 45 | } 46 | } 47 | 48 | /* vim: set expandtab: */ 49 | 50 | ?> 51 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifier.upper.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: upper
14 | * Purpose: convert string to uppercase 15 | * @link http://smarty.php.net/manual/en/language.modifier.upper.php 16 | * upper (Smarty online manual) 17 | * @author Monte Ohrt 18 | * @param string 19 | * @return string 20 | */ 21 | function smarty_modifier_upper($string) 22 | { 23 | return strtoupper($string); 24 | } 25 | 26 | ?> 27 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifier.wordwrap.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: wordwrap
14 | * Purpose: wrap a string of text at a given length 15 | * @link http://smarty.php.net/manual/en/language.modifier.wordwrap.php 16 | * wordwrap (Smarty online manual) 17 | * @author Monte Ohrt 18 | * @param string 19 | * @param integer 20 | * @param string 21 | * @param boolean 22 | * @return string 23 | */ 24 | function smarty_modifier_wordwrap($string,$length=80,$break="\n",$cut=false) 25 | { 26 | return wordwrap($string,$length,$break,$cut); 27 | } 28 | 29 | ?> 30 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/shared.escape_special_chars.php: -------------------------------------------------------------------------------- 1 | 13 | * Purpose: used by other smarty functions to escape 14 | * special chars except for already escaped ones 15 | * @author Monte Ohrt 16 | * @param string 17 | * @return string 18 | */ 19 | function smarty_function_escape_special_chars($string) 20 | { 21 | if(!is_array($string)) { 22 | $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string); 23 | $string = htmlspecialchars($string); 24 | $string = str_replace(array('%%%SMARTY_START%%%','%%%SMARTY_END%%%'), array('&',';'), $string); 25 | } 26 | return $string; 27 | } 28 | 29 | /* vim: set expandtab: */ 30 | 31 | ?> 32 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/shared.make_timestamp.php: -------------------------------------------------------------------------------- 1 | 11 | * Purpose: used by other smarty functions to make a timestamp 12 | * from a string. 13 | * @author Monte Ohrt 14 | * @param string 15 | * @return string 16 | */ 17 | function smarty_make_timestamp($string) 18 | { 19 | if(empty($string)) { 20 | // use "now": 21 | $time = time(); 22 | 23 | } elseif (preg_match('/^\d{14}$/', $string)) { 24 | // it is mysql timestamp format of YYYYMMDDHHMMSS? 25 | $time = mktime(substr($string, 8, 2),substr($string, 10, 2),substr($string, 12, 2), 26 | substr($string, 4, 2),substr($string, 6, 2),substr($string, 0, 4)); 27 | 28 | } elseif (is_numeric($string)) { 29 | // it is a numeric string, we handle it as timestamp 30 | $time = (int)$string; 31 | 32 | } else { 33 | // strtotime should handle it 34 | $time = strtotime($string); 35 | if ($time == -1 || $time === false) { 36 | // strtotime() was not able to parse $string, use "now": 37 | $time = time(); 38 | } 39 | } 40 | return $time; 41 | 42 | } 43 | 44 | /* vim: set expandtab: */ 45 | 46 | ?> 47 | -------------------------------------------------------------------------------- /lib/syntaxhighlighter/scripts/shBrushDiff.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | this.regexList = [ 25 | { regex: /^\+\+\+.*$/gm, css: 'script' }, 26 | { regex: /^\-\-\-.*$/gm, css: 'script' }, 27 | { regex: /^\s.*$/gm, css: 'color1' }, 28 | { regex: /^@@.*@@$/gm, css: 'variable' }, 29 | { regex: /^\+[^\+\n\r]{1}.*$/gm, css: 'color4' }, 30 | { regex: /^\+$/gm, css: 'color4' }, 31 | { regex: /^\-($|([^\-]{1}.*$))/gm, css: 'color3' }, 32 | ]; 33 | }; 34 | 35 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 36 | Brush.aliases = ['diff', 'patch']; 37 | 38 | SyntaxHighlighter.brushes.Diff = Brush; 39 | 40 | // CommonJS 41 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 42 | })(); 43 | -------------------------------------------------------------------------------- /lib/syntaxhighlighter/scripts/shBrushErlang.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributed by Jean-Lou Dupont 25 | // http://jldupont.blogspot.com/2009/06/erlang-syntax-highlighter.html 26 | 27 | // According to: http://erlang.org/doc/reference_manual/introduction.html#1.5 28 | var keywords = 'after and andalso band begin bnot bor bsl bsr bxor '+ 29 | 'case catch cond div end fun if let not of or orelse '+ 30 | 'query receive rem try when xor'+ 31 | // additional 32 | ' module export import define'; 33 | 34 | this.regexList = [ 35 | { regex: new RegExp("[A-Z][A-Za-z0-9_]+", 'g'), css: 'constants' }, 36 | { regex: new RegExp("\\%.+", 'gm'), css: 'comments' }, 37 | { regex: new RegExp("\\?[A-Za-z0-9_]+", 'g'), css: 'preprocessor' }, 38 | { regex: new RegExp("[a-z0-9_]+:[a-z0-9_]+", 'g'), css: 'functions' }, 39 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, 40 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, 41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } 42 | ]; 43 | }; 44 | 45 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 46 | Brush.aliases = ['erl', 'erlang']; 47 | 48 | SyntaxHighlighter.brushes.Erland = Brush; 49 | 50 | // CommonJS 51 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 52 | })(); 53 | -------------------------------------------------------------------------------- /lib/syntaxhighlighter/scripts/shBrushJava.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var keywords = 'abstract assert boolean break byte case catch char class const ' + 25 | 'continue default do double else enum extends ' + 26 | 'false final finally float for goto if implements import ' + 27 | 'instanceof int interface long native new null ' + 28 | 'package private protected public return ' + 29 | 'short static strictfp super switch synchronized this throw throws true ' + 30 | 'transient try void volatile while'; 31 | 32 | this.regexList = [ 33 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments 34 | { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments 35 | { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments 36 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings 37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings 38 | { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers 39 | { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno 40 | { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword 41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword 42 | ]; 43 | 44 | this.forHtmlScript({ 45 | left : /(<|<)%[@!=]?/g, 46 | right : /%(>|>)/g 47 | }); 48 | }; 49 | 50 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 51 | Brush.aliases = ['java']; 52 | 53 | SyntaxHighlighter.brushes.Java = Brush; 54 | 55 | // CommonJS 56 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 57 | })(); 58 | -------------------------------------------------------------------------------- /lib/syntaxhighlighter/scripts/shBrushKotlin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var keywords = 'abstract annotation as break by catch class companion const constructor continue crossinline data ' + 25 | 'do dynamic else enum external false final finally for fun get if import in infix inline inner interface internal ' + 26 | 'is lateinit noinline null object open operator out override package private protected public reified return sealed ' + 27 | 'set super tailrec this throw true try val var vararg when where while'; 28 | 29 | this.regexList = [ 30 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments 31 | { regex: /\/\*([^\*][\s\S]*?)?\*\//gm, css: 'comments' }, // multiline comments 32 | { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments 33 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings 34 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings 35 | { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers 36 | { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno 37 | { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword 38 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // kotlin keyword 39 | ]; 40 | 41 | this.forHtmlScript({ 42 | left : /(<|<)%[@!=]?/g, 43 | right : /%(>|>)/g 44 | }); 45 | }; 46 | 47 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 48 | Brush.aliases = ['kotlin']; 49 | 50 | SyntaxHighlighter.brushes.Kotlin = Brush; 51 | 52 | // CommonJS 53 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 54 | })(); 55 | -------------------------------------------------------------------------------- /lib/syntaxhighlighter/scripts/shBrushPlain.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | }; 25 | 26 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 27 | Brush.aliases = ['text', 'plain']; 28 | 29 | SyntaxHighlighter.brushes.Plain = Brush; 30 | 31 | // CommonJS 32 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 33 | })(); 34 | -------------------------------------------------------------------------------- /lib/syntaxhighlighter/scripts/shBrushProtobuf.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | */ 5 | ;(function() 6 | { 7 | // CommonJS 8 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 9 | 10 | function Brush() 11 | { 12 | var keywords = '^message|^package|^option|^import|^extend|^service|^enum'; 13 | 14 | var field_rules = 'optional|required|repeated|default'; 15 | 16 | var types = 'double|float|int32|int64|uint32|uint64|sint32|sint64|long|fixed32|fixed64|sfixed|sfixed64|bool|string|bytes'; 17 | 18 | this.regexList = [ 19 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments 20 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multy line comments 21 | { regex: new RegExp(this.getKeywords(types), 'gm'), css: 'color1 bold' }, 22 | { regex: new RegExp(this.getKeywords(field_rules), 'gm'), css: 'constants' }, 23 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, 24 | { regex: /\s+[A-Z_]*/gm, css: 'color6' }, 25 | { regex: /true|false/gm, css: 'color3' }, 26 | { regex: /\s+[0-9]*/gm, css: 'color3' } //Field numbers 27 | ]; 28 | 29 | this.forHtmlScript({ 30 | left : /(<|<)%[@!=]?/g, 31 | right : /%(>|>)/g 32 | }); 33 | }; 34 | 35 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 36 | Brush.aliases = ['protobuf']; 37 | 38 | SyntaxHighlighter.brushes.Protobuf = Brush; 39 | 40 | // CommonJS 41 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 42 | })(); 43 | -------------------------------------------------------------------------------- /lib/syntaxhighlighter/scripts/shBrushRst.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | */ 5 | ;(function() 6 | { 7 | // CommonJS 8 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 9 | 10 | function Brush() 11 | { 12 | this.regexList = [ 13 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, 14 | { regex: /\.\.\s[A-Za-z-]+::/gm, css: 'keyword' }, 15 | { regex: /:[\w\s\-]*:/gm, css: 'color2' }, 16 | { regex: /`.*`/gm, css: 'variable' }, 17 | { regex: /".*"/gm, css: 'variable' }, 18 | { regex: /\s+[A-Z_]*/gm, css: 'color6' }, 19 | { regex: /~~.*~~/gm, css: 'color1 bold' }, 20 | { regex: /\s\|\s/gm, css: 'keyword bold' }, 21 | { regex: /\*\*.*\*\*/gm, css: 'color8 bold' } 22 | ]; 23 | 24 | this.forHtmlScript({ 25 | left : /(<|<)%[@!=]?/g, 26 | right : /%(>|>)/g 27 | }); 28 | }; 29 | 30 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 31 | Brush.aliases = ['rst']; 32 | 33 | SyntaxHighlighter.brushes.Rst = Brush; 34 | 35 | // CommonJS 36 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 37 | })(); 38 | -------------------------------------------------------------------------------- /lib/syntaxhighlighter/scripts/shBrushRuby.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributed by Erik Peterson. 25 | 26 | var keywords = 'alias and BEGIN begin break case class def define_method defined do each else elsif ' + 27 | 'END end ensure false for if in module new next nil not or raise redo rescue retry return ' + 28 | 'self super then throw true undef unless until when while yield'; 29 | 30 | var builtins = 'Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload ' + 31 | 'Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol ' + 32 | 'ThreadGroup Thread Time TrueClass'; 33 | 34 | this.regexList = [ 35 | { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments 36 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings 37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings 38 | { regex: /\b[A-Z0-9_]+\b/g, css: 'constants' }, // constants 39 | { regex: /:[a-z][A-Za-z0-9_]*/g, css: 'color2' }, // symbols 40 | { regex: /(\$|@@|@)\w+/g, css: 'variable bold' }, // $global, @instance, and @@class variables 41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords 42 | { regex: new RegExp(this.getKeywords(builtins), 'gm'), css: 'color1' } // builtins 43 | ]; 44 | 45 | this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); 46 | }; 47 | 48 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 49 | Brush.aliases = ['ruby', 'rails', 'ror', 'rb']; 50 | 51 | SyntaxHighlighter.brushes.Ruby = Brush; 52 | 53 | // CommonJS 54 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 55 | })(); 56 | -------------------------------------------------------------------------------- /lib/syntaxhighlighter/scripts/shBrushScala.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributed by Yegor Jbanov and David Bernard. 25 | 26 | var keywords = 'val sealed case def true trait implicit forSome import match object null finally super ' + 27 | 'override try lazy for var catch throw type extends class while with new final yield abstract ' + 28 | 'else do if return protected private this package false'; 29 | 30 | var keyops = '[_:=><%#@]+'; 31 | 32 | this.regexList = [ 33 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments 34 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments 35 | { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // multi-line strings 36 | { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double-quoted string 37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings 38 | { regex: /0x[a-f0-9]+|\d+(\.\d+)?/gi, css: 'value' }, // numbers 39 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords 40 | { regex: new RegExp(keyops, 'gm'), css: 'keyword' } // scala keyword 41 | ]; 42 | } 43 | 44 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 45 | Brush.aliases = ['scala']; 46 | 47 | SyntaxHighlighter.brushes.Scala = Brush; 48 | 49 | // CommonJS 50 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 51 | })(); 52 | -------------------------------------------------------------------------------- /lib/syntaxhighlighter/scripts/shBrushXml.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | function process(match, regexInfo) 25 | { 26 | var constructor = SyntaxHighlighter.Match, 27 | code = match[0], 28 | tag = new XRegExp('(<|<)[\\s\\/\\?]*(?[:\\w-\\.]+)', 'xg').exec(code), 29 | result = [] 30 | ; 31 | 32 | if (match.attributes != null) 33 | { 34 | var attributes, 35 | regex = new XRegExp('(? [\\w:\\-\\.]+)' + 36 | '\\s*=\\s*' + 37 | '(? ".*?"|\'.*?\'|\\w+)', 38 | 'xg'); 39 | 40 | while ((attributes = regex.exec(code)) != null) 41 | { 42 | result.push(new constructor(attributes.name, match.index + attributes.index, 'color1')); 43 | result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string')); 44 | } 45 | } 46 | 47 | if (tag != null) 48 | result.push( 49 | new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword') 50 | ); 51 | 52 | return result; 53 | } 54 | 55 | this.regexList = [ 56 | { regex: new XRegExp('(\\<|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\>|>)', 'gm'), css: 'color2' }, // 57 | { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // 58 | { regex: new XRegExp('(<|<)[\\s\\/\\?]*(\\w+)(?.*?)[\\s\\/\\?]*(>|>)', 'sg'), func: process } 59 | ]; 60 | }; 61 | 62 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 63 | Brush.aliases = ['xml', 'xhtml', 'xslt', 'html']; 64 | 65 | SyntaxHighlighter.brushes.Xml = Brush; 66 | 67 | // CommonJS 68 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 69 | })(); 70 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "codeisok", 3 | "version": "1.0.0", 4 | "description": "Git code browsing and code review tool", 5 | "directories": { 6 | "lib": "lib" 7 | }, 8 | "scripts": { 9 | "lint": "eslint .", 10 | "lint:fix": "eslint . --fix" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/badoo/codeisok.git" 15 | }, 16 | "author": "Nikhil Verma ", 17 | "license": "GPL-3.0-or-later", 18 | "bugs": { 19 | "url": "https://github.com/badoo/codeisok/issues" 20 | }, 21 | "homepage": "https://github.com/badoo/codeisok#readme", 22 | "devDependencies": { 23 | "eslint": "^6.8.0" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CURRENT_DIR=`pwd` 4 | DATABASE_DIR=$CURRENT_DIR/.setup/storage/database 5 | GIT_HOME=$CURRENT_DIR/.setup/storage/git 6 | 7 | docker run \ 8 | --name codeisok \ 9 | -p 80:80 \ 10 | -p 22:22 \ 11 | -v $CURRENT_DIR:/local/codeisok \ 12 | -v $DATABASE_DIR:/var/lib/mysql \ 13 | -v $GIT_HOME:/home/git/ \ 14 | --rm \ 15 | -it \ 16 | codeisok 17 | -------------------------------------------------------------------------------- /templates_c/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /update_cache.php: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | getRepositories(); 12 | if ($repositories === false) { 13 | echo date('r') . ": Cannot receive repositories from DB\n"; 14 | return; 15 | } 16 | 17 | foreach ($repositories as $repository) { 18 | try { 19 | echo date('r') . ": Running for {$repository['project']}\n"; 20 | $Project = new \GitPHP\Git\Project($repository['project']); 21 | $Project->UpdateUnmergedCommitsCache(); 22 | $Project->UpdateHeadsCache(); 23 | } catch (\Exception $e) { 24 | echo date('r') . ": Error: {$e->getMessage()}"; 25 | } 26 | } 27 | } 28 | } 29 | 30 | $fp = fopen(__DIR__ . "/update_cache.lock", 'w+'); 31 | if (!flock($fp, LOCK_EX | LOCK_NB)) { 32 | exit(0); 33 | } 34 | 35 | $Application = new GitPHP\Application(); 36 | $Application->init(); 37 | 38 | $Script = new UpdateCache(); 39 | $Script->run(); 40 | --------------------------------------------------------------------------------