├── README ├── cache └── .gitignore ├── composer.json ├── config ├── .gitignore ├── gitphp.conf.php.example └── projects.conf.php.example ├── css ├── .gitignore ├── blueskin.css ├── blueskin │ ├── page_footer.png │ ├── page_header.png │ └── table_row.png ├── ext │ └── jquery.qtip.css ├── geshi_custom.css ├── gitphp.css ├── gitphpskin.css └── print.css ├── doc ├── AUTHORS ├── COPYING ├── README └── TRANSLATING ├── images ├── blame-loader.gif ├── git-logo.png ├── search-loader.gif ├── tooltip-loader.gif └── tree-loader.gif ├── include ├── AutoLoader.class.php ├── Config.class.php ├── DebugLog.class.php ├── Mime.class.php ├── Resource.class.php ├── Util.class.php ├── cache │ ├── Cache.class.php │ ├── CacheResource_Memcache.class.php │ ├── CacheStrategy.interface.php │ ├── Cache_File.class.php │ ├── Cache_Memcache.class.php │ ├── Cache_Memcached.class.php │ ├── Cacheable.interface.php │ └── MemoryCache.class.php ├── controller │ ├── ControllerBase.class.php │ ├── Controller_Blame.class.php │ ├── Controller_Blob.class.php │ ├── Controller_Blobdiff.class.php │ ├── Controller_Commit.class.php │ ├── Controller_Commitdiff.class.php │ ├── Controller_DiffBase.class.php │ ├── Controller_Feed.class.php │ ├── Controller_Graph.class.php │ ├── Controller_GraphData.class.php │ ├── Controller_Heads.class.php │ ├── Controller_History.class.php │ ├── Controller_Log.class.php │ ├── Controller_Message.class.php │ ├── Controller_Project.class.php │ ├── Controller_ProjectList.class.php │ ├── Controller_Remotes.class.php │ ├── Controller_Search.class.php │ ├── Controller_Snapshot.class.php │ ├── Controller_Tag.class.php │ ├── Controller_Tags.class.php │ └── Controller_Tree.class.php ├── exception │ ├── AmbiguousHashException.class.php │ ├── DirectoryNotFoundException.class.php │ ├── DirectoryTraversalException.class.php │ ├── FileNotFoundException.class.php │ ├── InvalidConfigFileException.class.php │ ├── InvalidDirectoryConfigurationException.class.php │ ├── InvalidDirectoryException.class.php │ ├── InvalidFileException.class.php │ ├── InvalidGitExecutableException.class.php │ ├── InvalidGitRepositoryException.class.php │ ├── InvalidHashException.class.php │ ├── InvalidProjectParameterException.class.php │ ├── InvalidSearchTypeException.class.php │ ├── MessageException.class.php │ ├── MissingMemcacheException.class.php │ ├── MissingProjectParameterException.class.php │ ├── MissingProjectrootException.class.php │ ├── ProjectListFileReadException.class.php │ ├── ProjectrootBoundException.class.php │ ├── SearchDisabledException.class.php │ └── SearchLengthException.class.php ├── git │ ├── Commit.class.php │ ├── CommitSearch.class.php │ ├── FileBlame.class.php │ ├── FileDiff.class.php │ ├── FileHistory.class.php │ ├── FileSearch.class.php │ ├── FileSearchResult.class.php │ ├── FilesystemObject.class.php │ ├── GitConfig.class.php │ ├── GitExe.class.php │ ├── GitLog.class.php │ ├── GitObject.class.php │ ├── GitObjectLoader.class.php │ ├── GitObjectManager.class.php │ ├── Head.class.php │ ├── HeadList.class.php │ ├── Observable.interface.php │ ├── Observer.interface.php │ ├── Pack.class.php │ ├── Pagination.interface.php │ ├── Project.class.php │ ├── Ref.class.php │ ├── RefList.class.php │ ├── RemoteHeadList.class.php │ ├── RevList.class.php │ ├── TagList.class.php │ ├── Tree.class.php │ ├── TreeDiff.class.php │ ├── archive │ │ ├── Archive.class.php │ │ ├── ArchiveStrategy.interface.php │ │ ├── Archive_Bzip2.class.php │ │ ├── Archive_Gzip.class.php │ │ ├── Archive_Tar.class.php │ │ └── Archive_Zip.class.php │ ├── blob │ │ ├── Blob.class.php │ │ ├── BlobLoadStrategy.interface.php │ │ ├── BlobLoad_Base.class.php │ │ ├── BlobLoad_Git.class.php │ │ └── BlobLoad_Raw.class.php │ ├── filemimetype │ │ ├── FileMimeTypeReader.class.php │ │ ├── FileMimeTypeStrategy.interface.php │ │ ├── FileMimeType_Extension.class.php │ │ ├── FileMimeType_FileExe.class.php │ │ └── FileMimeType_Fileinfo.class.php │ ├── projectlist │ │ ├── ProjectList.class.php │ │ ├── ProjectListArray.class.php │ │ ├── ProjectListArrayLegacy.class.php │ │ ├── ProjectListBase.class.php │ │ ├── ProjectListDirectory.class.php │ │ ├── ProjectListFile.class.php │ │ ├── ProjectListManifest.class.php │ │ └── ProjectListScmManager.class.php │ └── tag │ │ ├── Tag.class.php │ │ ├── TagLoadStrategy.interface.php │ │ ├── TagLoad_Git.class.php │ │ └── TagLoad_Raw.class.php ├── helpers.php ├── router │ ├── Route.class.php │ └── Router.class.php ├── smartyplugins │ ├── block.t.php │ ├── function.agestring.php │ ├── function.geturl.php │ ├── function.localfiletype.php │ ├── modifier.buglink.php │ ├── modifier.commithash.php │ └── modifier.highlight.php └── version.php ├── index.php ├── js ├── .gitignore ├── blob.js ├── blobdiff.js ├── commitactivity.js ├── commitdiff.js ├── common.js ├── ext │ ├── d3.v2.min.js │ ├── jquery-migrate.min.js │ ├── jquery.js │ ├── jquery.min.js │ ├── jquery.min.map │ ├── jquery.qtip.js │ ├── modernizr.custom.js │ ├── require.js │ └── require.min.js ├── languagedist.js ├── modules │ ├── blameasync.js │ ├── commitactivitygraph.js │ ├── getproject.js │ ├── geturl.js │ ├── hassearchreset.js │ ├── hilight.parents.js │ ├── lang.js │ ├── languagedistgraph.js │ ├── projectsearch.js │ ├── resources.js │ ├── sidebyside.tools.js │ ├── sidebysidecommitdiff.js │ ├── snapshotformats.js │ ├── tooltip.commit.js │ ├── tooltip.snapshot.js │ ├── tooltip.tag.js │ └── treedrilldown.js ├── projectlist.js └── tree.js ├── lib ├── closure │ ├── COPYING │ ├── README │ └── compiler.jar ├── geshi │ ├── contrib │ │ ├── aliased.php │ │ ├── cssgen.php │ │ ├── cssgen.sh │ │ ├── cssgen2.php │ │ ├── example.php │ │ ├── langcheck.php │ │ └── langwiz.php │ ├── 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 │ │ ├── 6502acme.php │ │ ├── 6502kickass.php │ │ ├── 6502tasm.php │ │ ├── 68000devpac.php │ │ ├── abap.php │ │ ├── actionscript.php │ │ ├── actionscript3.php │ │ ├── ada.php │ │ ├── algol68.php │ │ ├── apache.php │ │ ├── applescript.php │ │ ├── apt_sources.php │ │ ├── asm.php │ │ ├── asp.php │ │ ├── autoconf.php │ │ ├── autohotkey.php │ │ ├── autoit.php │ │ ├── avisynth.php │ │ ├── awk.php │ │ ├── bascomavr.php │ │ ├── bash.php │ │ ├── basic4gl.php │ │ ├── bf.php │ │ ├── bibtex.php │ │ ├── blitzbasic.php │ │ ├── bnf.php │ │ ├── boo.php │ │ ├── c.php │ │ ├── c_loadrunner.php │ │ ├── c_mac.php │ │ ├── caddcl.php │ │ ├── cadlisp.php │ │ ├── cfdg.php │ │ ├── cfm.php │ │ ├── chaiscript.php │ │ ├── cil.php │ │ ├── clojure.php │ │ ├── cmake.php │ │ ├── cobol.php │ │ ├── coffeescript.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 │ │ ├── drupal6.php │ │ ├── e.php │ │ ├── ecmascript.php │ │ ├── eiffel.php │ │ ├── email.php │ │ ├── epc.php │ │ ├── erlang.php │ │ ├── euphoria.php │ │ ├── f1.php │ │ ├── falcon.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 │ │ ├── go.php │ │ ├── groovy.php │ │ ├── gwbasic.php │ │ ├── haskell.php │ │ ├── hicest.php │ │ ├── hq9plus.php │ │ ├── html4strict.php │ │ ├── html5.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 │ │ ├── lb.php │ │ ├── lisp.php │ │ ├── llvm.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 │ │ ├── objeck.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 │ │ ├── pli.php │ │ ├── plsql.php │ │ ├── postgresql.php │ │ ├── povray.php │ │ ├── powerbuilder.php │ │ ├── powershell.php │ │ ├── proftpd.php │ │ ├── progress.php │ │ ├── prolog.php │ │ ├── properties.php │ │ ├── providex.php │ │ ├── purebasic.php │ │ ├── pycon.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 │ │ ├── uscript.php │ │ ├── vala.php │ │ ├── vb.php │ │ ├── vbnet.php │ │ ├── verilog.php │ │ ├── vhdl.php │ │ ├── vim.php │ │ ├── visualfoxpro.php │ │ ├── visualprolog.php │ │ ├── whitespace.php │ │ ├── whois.php │ │ ├── winbatch.php │ │ ├── windev.php │ │ ├── xbasic.php │ │ ├── xml.php │ │ ├── xorg_conf.php │ │ ├── xpp.php │ │ ├── yaml.php │ │ ├── z80.php │ │ └── zxbasic.php ├── php-diff │ ├── README │ ├── example │ │ ├── a.txt │ │ ├── b.txt │ │ ├── example.php │ │ └── styles.css │ └── lib │ │ ├── Diff.php │ │ └── Diff │ │ ├── Renderer │ │ ├── Abstract.php │ │ ├── Html │ │ │ ├── Array.php │ │ │ ├── Inline.php │ │ │ └── SideBySide.php │ │ └── Text │ │ │ ├── Context.php │ │ │ └── Unified.php │ │ └── SequenceMatcher.php ├── php-gettext │ ├── AUTHORS │ ├── COPYING │ ├── Makefile │ ├── README │ ├── examples │ │ ├── index.php │ │ ├── locale │ │ │ ├── de_CH │ │ │ │ └── LC_MESSAGES │ │ │ │ │ ├── messages.mo │ │ │ │ │ └── messages.po │ │ │ └── sr_CS │ │ │ │ └── LC_MESSAGES │ │ │ │ ├── messages.mo │ │ │ │ └── messages.po │ │ ├── pigs_dropin.php │ │ ├── pigs_fallback.php │ │ └── update │ ├── gettext.inc │ ├── gettext.php │ ├── streams.php │ └── tests │ │ ├── LocalesTest.php │ │ └── ParsingTest.php ├── repo │ └── Pickle.inc.php ├── requirejs │ └── r.js ├── rhino │ ├── LICENSE.txt │ └── js.jar ├── smarty-gettext │ ├── COPYING │ ├── ChangeLog │ ├── README │ ├── block.t.php │ └── tsmarty2c.php └── smarty │ ├── COPYING.lib │ ├── README │ ├── SMARTY_2_BC_NOTES.txt │ ├── SMARTY_3.0_BC_NOTES.txt │ ├── SMARTY_3.1_NOTES.txt │ ├── change_log.txt │ ├── demo │ ├── configs │ │ └── test.conf │ ├── index.php │ ├── plugins │ │ ├── cacheresource.apc.php │ │ ├── cacheresource.memcache.php │ │ ├── cacheresource.mysql.php │ │ ├── resource.extendsall.php │ │ ├── resource.mysql.php │ │ └── resource.mysqls.php │ └── templates │ │ ├── footer.tpl │ │ ├── header.tpl │ │ └── index.tpl │ └── libs │ ├── Smarty.class.php │ ├── SmartyBC.class.php │ ├── debug.tpl │ ├── plugins │ ├── block.textformat.php │ ├── function.counter.php │ ├── function.cycle.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 │ ├── modifier.capitalize.php │ ├── modifier.date_format.php │ ├── modifier.debug_print_var.php │ ├── modifier.escape.php │ ├── modifier.regex_replace.php │ ├── modifier.replace.php │ ├── modifier.spacify.php │ ├── modifier.truncate.php │ ├── modifiercompiler.cat.php │ ├── modifiercompiler.count_characters.php │ ├── modifiercompiler.count_paragraphs.php │ ├── modifiercompiler.count_sentences.php │ ├── modifiercompiler.count_words.php │ ├── modifiercompiler.default.php │ ├── modifiercompiler.escape.php │ ├── modifiercompiler.from_charset.php │ ├── modifiercompiler.indent.php │ ├── modifiercompiler.lower.php │ ├── modifiercompiler.noprint.php │ ├── modifiercompiler.string_format.php │ ├── modifiercompiler.strip.php │ ├── modifiercompiler.strip_tags.php │ ├── modifiercompiler.to_charset.php │ ├── modifiercompiler.unescape.php │ ├── modifiercompiler.upper.php │ ├── modifiercompiler.wordwrap.php │ ├── outputfilter.trimwhitespace.php │ ├── shared.escape_special_chars.php │ ├── shared.literal_compiler_param.php │ ├── shared.make_timestamp.php │ ├── shared.mb_str_replace.php │ ├── shared.mb_unicode.php │ ├── shared.mb_wordwrap.php │ └── variablefilter.htmlspecialchars.php │ └── sysplugins │ ├── smarty_cacheresource.php │ ├── smarty_cacheresource_custom.php │ ├── smarty_cacheresource_keyvaluestore.php │ ├── smarty_config_source.php │ ├── smarty_internal_cacheresource_file.php │ ├── smarty_internal_compile_append.php │ ├── smarty_internal_compile_assign.php │ ├── smarty_internal_compile_block.php │ ├── smarty_internal_compile_break.php │ ├── smarty_internal_compile_call.php │ ├── smarty_internal_compile_capture.php │ ├── smarty_internal_compile_config_load.php │ ├── smarty_internal_compile_continue.php │ ├── smarty_internal_compile_debug.php │ ├── smarty_internal_compile_eval.php │ ├── smarty_internal_compile_extends.php │ ├── smarty_internal_compile_for.php │ ├── smarty_internal_compile_foreach.php │ ├── smarty_internal_compile_function.php │ ├── smarty_internal_compile_if.php │ ├── smarty_internal_compile_include.php │ ├── smarty_internal_compile_include_php.php │ ├── smarty_internal_compile_insert.php │ ├── smarty_internal_compile_ldelim.php │ ├── smarty_internal_compile_nocache.php │ ├── smarty_internal_compile_private_block_plugin.php │ ├── smarty_internal_compile_private_function_plugin.php │ ├── smarty_internal_compile_private_modifier.php │ ├── smarty_internal_compile_private_object_block_function.php │ ├── smarty_internal_compile_private_object_function.php │ ├── smarty_internal_compile_private_print_expression.php │ ├── smarty_internal_compile_private_registered_block.php │ ├── smarty_internal_compile_private_registered_function.php │ ├── smarty_internal_compile_private_special_variable.php │ ├── smarty_internal_compile_rdelim.php │ ├── smarty_internal_compile_section.php │ ├── smarty_internal_compile_setfilter.php │ ├── smarty_internal_compile_while.php │ ├── smarty_internal_compilebase.php │ ├── smarty_internal_config.php │ ├── smarty_internal_config_file_compiler.php │ ├── smarty_internal_configfilelexer.php │ ├── smarty_internal_configfileparser.php │ ├── smarty_internal_data.php │ ├── smarty_internal_debug.php │ ├── smarty_internal_filter_handler.php │ ├── smarty_internal_function_call_handler.php │ ├── smarty_internal_get_include_path.php │ ├── smarty_internal_nocache_insert.php │ ├── smarty_internal_parsetree.php │ ├── smarty_internal_resource_eval.php │ ├── smarty_internal_resource_extends.php │ ├── smarty_internal_resource_file.php │ ├── smarty_internal_resource_php.php │ ├── smarty_internal_resource_registered.php │ ├── smarty_internal_resource_stream.php │ ├── smarty_internal_resource_string.php │ ├── smarty_internal_smartytemplatecompiler.php │ ├── smarty_internal_template.php │ ├── smarty_internal_templatebase.php │ ├── smarty_internal_templatecompilerbase.php │ ├── smarty_internal_templatelexer.php │ ├── smarty_internal_templateparser.php │ ├── smarty_internal_utility.php │ ├── smarty_internal_write_file.php │ ├── smarty_resource.php │ ├── smarty_resource_custom.php │ ├── smarty_resource_recompiled.php │ ├── smarty_resource_uncompiled.php │ └── smarty_security.php ├── locale ├── .gitignore ├── de_DE │ ├── README │ └── gitphp.po ├── es_ES │ └── gitphp.po ├── fr_FR │ └── gitphp.po ├── gitphp.pot ├── id_ID │ └── gitphp.po ├── it_IT │ └── gitphp.po ├── ja_JP │ └── gitphp.po ├── ru_RU │ └── gitphp.po ├── tr_TR │ └── gitphp.po └── zh_CN │ ├── README │ └── gitphp.po ├── setup.sh ├── templates ├── .gitignore ├── atom.tpl ├── blame.tpl ├── blamedata.tpl ├── blob.tpl ├── blobdiff.tpl ├── blobdiffplain.tpl ├── blobheaders.tpl ├── blobplain.tpl ├── commit.tpl ├── commitdiff.tpl ├── commitdiffplain.tpl ├── committip.tpl ├── filediff.tpl ├── filediffsidebyside.tpl ├── graph.tpl ├── graphdata.tpl ├── headlist.tpl ├── heads.tpl ├── history.tpl ├── log.tpl ├── main.tpl ├── message.tpl ├── nav.tpl ├── opml.tpl ├── path.tpl ├── project.tpl ├── projectbase.tpl ├── projectindex.tpl ├── projectlist.tpl ├── projectmessage.tpl ├── refbadges.tpl ├── remotelist.tpl ├── remotes.tpl ├── rss.tpl ├── search.tpl ├── searchfiles.tpl ├── shortlog.tpl ├── shortloglist.tpl ├── snapshot.tpl ├── tag.tpl ├── taglist.tpl ├── tags.tpl ├── tagtip.tpl ├── title.tpl ├── tree.tpl └── treelist.tpl ├── templates_c └── .gitignore ├── test ├── ConfigTest.php ├── DebugLogTest.php ├── UtilTest.php ├── bootstrap.php ├── cache │ ├── CacheTest.php │ └── MemoryCacheTest.php ├── git │ ├── GitObjectTest.php │ ├── blob │ │ ├── BlobLoad_GitTest.php │ │ ├── BlobLoad_RawTest.php │ │ └── BlobTest.php │ ├── commit │ │ └── CommitTest.php │ ├── project │ │ └── ProjectTest.php │ └── tag │ │ └── TagTest.php ├── phpunit.xml ├── resources │ ├── externalrepo.git │ │ └── HEAD │ ├── testdir │ │ ├── .hiddentestfile │ │ ├── testdir2 │ │ │ ├── testdir4 │ │ │ │ └── testfile4.txt │ │ │ └── testfile2.txt │ │ ├── testdir3 │ │ │ └── testfile3.txt │ │ └── testfile1.txt │ └── testprojectroot │ │ ├── category │ │ └── subrepo.git │ │ │ └── HEAD │ │ ├── testrepo.git │ │ ├── HEAD │ │ └── description │ │ └── testrepoexported.git │ │ ├── HEAD │ │ └── git-daemon-export-ok └── router │ └── RouteTest.php └── util ├── gibberize.sh ├── jsheader.js ├── minify.sh ├── msgfmt.sh ├── pack.sh ├── phpdoc.ini ├── phpdoc.xml └── xgettext.sh /cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tpruvot/gitphp-repo", 3 | "description": "A repo compatible fork of GitPHP", 4 | "authors": [ 5 | { 6 | "name": "Tanguy Pruvot" 7 | }, 8 | { 9 | "name": "Chris Han" 10 | } 11 | ], 12 | "require": { 13 | "php": ">=5.2.0" 14 | }, 15 | "autoload": { 16 | "psr-0": { 17 | "GitPHP": "include/" 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /config/.gitignore: -------------------------------------------------------------------------------- 1 | gitphp.conf.php 2 | projects.conf.php 3 | -------------------------------------------------------------------------------- /css/.gitignore: -------------------------------------------------------------------------------- 1 | geshi.css 2 | geshi_custom.css 3 | *.min.css 4 | *.gz 5 | -------------------------------------------------------------------------------- /css/blueskin/page_footer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/css/blueskin/page_footer.png -------------------------------------------------------------------------------- /css/blueskin/page_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/css/blueskin/page_header.png -------------------------------------------------------------------------------- /css/blueskin/table_row.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/css/blueskin/table_row.png -------------------------------------------------------------------------------- /css/geshi_custom.css: -------------------------------------------------------------------------------- 1 | /* never use italic for comments */ 2 | 3 | #blobData .co1, 4 | #blobData .co2, 5 | #blobData .coMULTI { 6 | font-style: normal; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /css/print.css: -------------------------------------------------------------------------------- 1 | /* common */ 2 | a { text-decoration: none; } 3 | body { margin: 0; } 4 | 5 | /* hide useless objects */ 6 | div.lang_select, 7 | div.page_footer a.rss_logo, 8 | div.debug_footer { 9 | display: none; 10 | } 11 | 12 | div.page_nav { 13 | max-height: 25px; overflow: hidden; padding: 0 4px; 14 | display: none; /* comment to debug print css */ 15 | } 16 | 17 | /* portrait only, try to reduce overall font size */ 18 | @media (orientation: portrait) { 19 | body { font-size: 7pt; } 20 | div.page_header { font-size: 11pt; } 21 | a,span,td,div,em { font-size: inherit; } 22 | span.tag, span.head { font-size: inherit; } 23 | div.attr_footer { font-size: 5pt; } 24 | } 25 | 26 | form div.search, 27 | .projectSearch, 28 | .projectList th.actions { 29 | display: none; 30 | } 31 | 32 | /* short log */ 33 | table.shortlog { 34 | padding-left: 0; 35 | padding-right: 0; 36 | margin: 0; 37 | } 38 | 39 | td.link { 40 | display: none; 41 | } 42 | 43 | /* full log */ 44 | div.title_text .log_link { 45 | display: none; 46 | } 47 | div.title_text em { 48 | padding-left: 8px; 49 | } 50 | div.title, div.title_text { 51 | page-break-inside: avoid; 52 | page-break-after: avoid; 53 | } 54 | div.log_body { 55 | page-break-inside: avoid; 56 | border-bottom: 1px solid gray; 57 | } 58 | 59 | #blobData td.ln { 60 | border-right-color: transparent; 61 | } 62 | 63 | span.timestamp { 64 | display: inline-block; 65 | line-height: 16px; 66 | margin-right: 4px; 67 | } 68 | -------------------------------------------------------------------------------- /doc/AUTHORS: -------------------------------------------------------------------------------- 1 | # 2 | # N: Name 3 | # E: Email 4 | # W: Web address 5 | # P: PGP key ID and fingerprint 6 | # D: Description 7 | # 8 | 9 | N: Christopher Han (xiphux) 10 | E: xiphux@gmail.com 11 | W: http://www.gitphp.org 12 | W: http://www.xiphux.com 13 | D: Original implementation and lead developer 14 | 15 | N: Tanguy Pruvot 16 | W: http://github.com/tpruvot/GitPHP 17 | D: github project, allow non-bare folders tracking, android repo browsing, enhanced sidebyside 18 | -------------------------------------------------------------------------------- /images/blame-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/images/blame-loader.gif -------------------------------------------------------------------------------- /images/git-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/images/git-logo.png -------------------------------------------------------------------------------- /images/search-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/images/search-loader.gif -------------------------------------------------------------------------------- /images/tooltip-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/images/tooltip-loader.gif -------------------------------------------------------------------------------- /images/tree-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/images/tree-loader.gif -------------------------------------------------------------------------------- /include/Mime.class.php: -------------------------------------------------------------------------------- 1 | 55 | -------------------------------------------------------------------------------- /include/cache/CacheStrategy.interface.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Cache 9 | */ 10 | interface GitPHP_CacheStrategy_Interface 11 | { 12 | /** 13 | * Gets an item from the cache 14 | * 15 | * @param string $key cache key 16 | * @return mixed cached object or false if not found 17 | */ 18 | public function Get($key); 19 | 20 | /** 21 | * Sets an item into the cache 22 | * 23 | * @param string $key cache key 24 | * @param mixed $value object to cache 25 | * @param int $lifetime cached object lifetime 26 | */ 27 | public function Set($key, $value, $lifetime); 28 | 29 | /** 30 | * Check if an item exists 31 | * 32 | * @param string $key cache key 33 | * @return boolean true if exists 34 | */ 35 | public function Exists($key); 36 | 37 | /** 38 | * Delete an item from the cache 39 | * 40 | * @param string $key cache key 41 | */ 42 | public function Delete($key); 43 | 44 | /** 45 | * Clear the cache 46 | */ 47 | public function Clear(); 48 | } 49 | -------------------------------------------------------------------------------- /include/cache/Cacheable.interface.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Cache 9 | */ 10 | interface GitPHP_Cacheable_Interface 11 | { 12 | /** 13 | * Gets the cache key to use for this object 14 | * 15 | * @return string cache key 16 | */ 17 | public function GetCacheKey(); 18 | } 19 | -------------------------------------------------------------------------------- /include/controller/Controller_Commit.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2010 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Controller 9 | */ 10 | class GitPHP_Controller_Commit extends GitPHP_ControllerBase 11 | { 12 | 13 | /** 14 | * Initialize controller 15 | */ 16 | public function Initialize() 17 | { 18 | parent::Initialize(); 19 | 20 | if (empty($this->params['hash'])) 21 | $this->params['hash'] = 'HEAD'; 22 | 23 | if (!empty($this->params['output']) && ($this->params['output'] == 'jstip')) 24 | $this->DisableLogging(); 25 | } 26 | 27 | /** 28 | * Gets the template for this controller 29 | * 30 | * @return string template filename 31 | */ 32 | protected function GetTemplate() 33 | { 34 | if (isset($this->params['output']) && $this->params['output'] == 'jstip') { 35 | return 'committip.tpl'; 36 | } 37 | return 'commit.tpl'; 38 | } 39 | 40 | /** 41 | * Gets the cache key for this controller 42 | * 43 | * @return string cache key 44 | */ 45 | protected function GetCacheKey() 46 | { 47 | return $this->params['hash']; 48 | } 49 | 50 | /** 51 | * Gets the name of this controller's action 52 | * 53 | * @param boolean $local true if caller wants the localized action name 54 | * @return string action name 55 | */ 56 | public function GetName($local = false) 57 | { 58 | if ($local && $this->resource) { 59 | return $this->resource->translate('commit'); 60 | } 61 | return 'commit'; 62 | } 63 | 64 | /** 65 | * Loads data for this template 66 | */ 67 | protected function LoadData() 68 | { 69 | $commit = $this->GetProject()->GetCommit($this->params['hash']); 70 | if (!is_object($commit)) 71 | throw new GitPHP_InvalidHashException($this->params['hash']); 72 | 73 | $this->tpl->assign('commit', $commit); 74 | $this->tpl->assign('tree', $commit->GetTree()); 75 | $treediff = $commit->DiffToParent($this->exe); 76 | $treediff->SetRenames(true); 77 | $this->tpl->assign('treediff', $treediff); 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /include/controller/Controller_Graph.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Controller 9 | */ 10 | class GitPHP_Controller_Graph extends GitPHP_ControllerBase 11 | { 12 | /** 13 | * Initialize controller 14 | */ 15 | public function Initialize() 16 | { 17 | parent::Initialize(); 18 | 19 | if (!$this->config->GetValue('graphs')) { 20 | throw new Exception('Graphing has been disabled'); 21 | } 22 | 23 | if (empty($this->params['graphtype'])) 24 | $this->params['graphtype'] = 'commitactivity'; 25 | } 26 | 27 | /** 28 | * Gets the template for this controller 29 | * 30 | * @return string template filename 31 | */ 32 | protected function GetTemplate() 33 | { 34 | return 'graph.tpl'; 35 | } 36 | 37 | /** 38 | * Gets the cache key for this controller 39 | * 40 | * @return string cache key 41 | */ 42 | protected function GetCacheKey() 43 | { 44 | return isset($this->params['graphtype']) ? $this->params['graphtype'] : ''; 45 | } 46 | 47 | /** 48 | * Gets the name of this controller's action 49 | * 50 | * @param boolean $local true if caller wants the localized action name 51 | * @return string action name 52 | */ 53 | public function GetName($local = false) 54 | { 55 | if ($local && $this->resource) { 56 | return $this->resource->translate('graph'); 57 | } 58 | return 'graph'; 59 | } 60 | 61 | /** 62 | * Loads data for this template 63 | */ 64 | protected function LoadData() 65 | { 66 | $head = $this->GetProject()->GetHeadCommit(); 67 | $this->tpl->assign('head', $head); 68 | if (!$head) 69 | $this->tpl->assign('enablesearch', false); 70 | 71 | if (!empty($this->params['graphtype'])) 72 | $this->tpl->assign('graphtype', $this->params['graphtype']); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /include/controller/Controller_Heads.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2010 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Controller 9 | */ 10 | class GitPHP_Controller_Heads extends GitPHP_ControllerBase 11 | { 12 | /** 13 | * Initialize controller 14 | */ 15 | public function Initialize() 16 | { 17 | parent::Initialize(); 18 | 19 | if (empty($this->params['page'])) 20 | $this->params['page'] = 0; 21 | } 22 | 23 | /** 24 | * Gets the template for this controller 25 | * 26 | * @return string template filename 27 | */ 28 | protected function GetTemplate() 29 | { 30 | return 'heads.tpl'; 31 | } 32 | 33 | /** 34 | * Gets the cache key for this controller 35 | * 36 | * @return string cache key 37 | */ 38 | protected function GetCacheKey() 39 | { 40 | return $this->params['page']; 41 | } 42 | 43 | /** 44 | * Gets the name of this controller's action 45 | * 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 && $this->resource) { 52 | return $this->resource->translate('heads'); 53 | } 54 | return 'heads'; 55 | } 56 | 57 | /** 58 | * Loads data for this template 59 | */ 60 | protected function LoadData() 61 | { 62 | $head = $this->GetProject()->GetHeadCommit(); 63 | $this->tpl->assign("head",$head); 64 | 65 | $this->tpl->assign('page', $this->params['page']); 66 | $skip = $this->params['page'] * 100; 67 | 68 | $headlist = $this->GetProject()->GetHeadList()->GetOrderedHeads('-committerdate', 101, $skip); 69 | if (isset($headlist) && (count($headlist) > 0)) { 70 | if (count($headlist) > 100) { 71 | $headlist = array_slice($headlist, 0, 100); 72 | $this->tpl->assign('hasmoreheads', true); 73 | } 74 | $this->tpl->assign("headlist", $headlist); 75 | } 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /include/controller/Controller_Remotes.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @package GitPHP 7 | * @subpackage Controller 8 | */ 9 | class GitPHP_Controller_Remotes extends GitPHP_ControllerBase 10 | { 11 | 12 | /** 13 | * Initialize controller 14 | */ 15 | public function Initialize() 16 | { 17 | parent::Initialize(); 18 | 19 | if (empty($this->params['page'])) 20 | $this->params['page'] = 0; 21 | } 22 | 23 | /** 24 | * Gets the template for this controller 25 | * 26 | * @return string template filename 27 | */ 28 | protected function GetTemplate() 29 | { 30 | return 'remotes.tpl'; 31 | } 32 | 33 | /** 34 | * Gets the cache key for this controller 35 | * 36 | * @return string cache key 37 | */ 38 | protected function GetCacheKey() 39 | { 40 | return $this->params['page']; 41 | } 42 | 43 | /** 44 | * Gets the name of this controller's action 45 | * 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 && $this->resource) { 52 | return $this->resource->translate('remotes'); 53 | } 54 | return 'remotes'; 55 | } 56 | 57 | /** 58 | * Loads data for this template 59 | */ 60 | protected function LoadData() 61 | { 62 | 63 | $this->tpl->assign('page', $this->params['page']); 64 | $skip = $this->params['page'] * 100; 65 | 66 | $headlist = $this->GetProject()->GetRemoteHeadList()->GetOrderedHeads('-committerdate', 101, $skip); 67 | if (isset($headlist) && (count($headlist) > 0)) { 68 | if (count($headlist) > 100) { 69 | $headlist = array_slice($headlist, 0, 100); 70 | $this->tpl->assign('hasmoreheads', true); 71 | } 72 | $this->tpl->assign("remotelist",$headlist); 73 | } 74 | 75 | $head = $this->GetProject()->GetHeadCommit(); 76 | $this->tpl->assign("head",$head); 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /include/controller/Controller_Tag.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2010 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Controller 9 | */ 10 | class GitPHP_Controller_Tag extends GitPHP_ControllerBase 11 | { 12 | 13 | /** 14 | * Initialize controller 15 | */ 16 | public function Initialize() 17 | { 18 | parent::Initialize(); 19 | 20 | if (!empty($this->params['output']) && ($this->params['output'] == 'jstip')) 21 | $this->DisableLogging(); 22 | 23 | if (!isset($this->params['tag'])) 24 | $this->params['tag'] = $this->params['hash']; 25 | } 26 | 27 | /** 28 | * Gets the template for this controller 29 | * 30 | * @return string template filename 31 | */ 32 | protected function GetTemplate() 33 | { 34 | if (isset($this->params['output']) && ($this->params['output'] == 'jstip')) { 35 | return 'tagtip.tpl'; 36 | } 37 | return 'tag.tpl'; 38 | } 39 | 40 | /** 41 | * Gets the cache key for this controller 42 | * 43 | * @return string cache key 44 | */ 45 | protected function GetCacheKey() 46 | { 47 | return isset($this->params['tag']) ? sha1($this->params['tag']) : ''; 48 | } 49 | 50 | /** 51 | * Gets the name of this controller's action 52 | * 53 | * @param boolean $local true if caller wants the localized action name 54 | * @return string action name 55 | */ 56 | public function GetName($local = false) 57 | { 58 | if ($local && $this->resource) { 59 | return $this->resource->translate('tag'); 60 | } 61 | return 'tag'; 62 | } 63 | 64 | /** 65 | * Loads data for this template 66 | */ 67 | protected function LoadData() 68 | { 69 | $head = $this->GetProject()->GetHeadCommit(); 70 | $this->tpl->assign('head', $head); 71 | 72 | $tag = $this->GetProject()->GetTagList()->GetTag($this->params['tag']); 73 | 74 | $this->tpl->assign("tag", $tag); 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /include/controller/Controller_Tags.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2010 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Controller 9 | */ 10 | class GitPHP_Controller_Tags extends GitPHP_ControllerBase 11 | { 12 | 13 | /** 14 | * Initialize controller 15 | */ 16 | public function Initialize() 17 | { 18 | parent::Initialize(); 19 | 20 | if (empty($this->params['page'])) 21 | $this->params['page'] = 0; 22 | } 23 | 24 | /** 25 | * Gets the template for this controller 26 | * 27 | * @return string template filename 28 | */ 29 | protected function GetTemplate() 30 | { 31 | return 'tags.tpl'; 32 | } 33 | 34 | /** 35 | * Gets the cache key for this controller 36 | * 37 | * @return string cache key 38 | */ 39 | protected function GetCacheKey() 40 | { 41 | return $this->params['page']; 42 | } 43 | 44 | /** 45 | * Gets the name of this controller's action 46 | * 47 | * @param boolean $local true if caller wants the localized action name 48 | * @return string action name 49 | */ 50 | public function GetName($local = false) 51 | { 52 | if ($local && $this->resource) { 53 | return $this->resource->translate('tags'); 54 | } 55 | return 'tags'; 56 | } 57 | 58 | /** 59 | * Loads data for this template 60 | */ 61 | protected function LoadData() 62 | { 63 | $head = $this->GetProject()->GetHeadCommit(); 64 | $this->tpl->assign("head",$head); 65 | 66 | $this->tpl->assign('page', $this->params['page']); 67 | $skip = $this->params['page'] * 100; 68 | 69 | $taglist = $this->GetProject()->GetTagList()->GetOrderedTags('-creatordate', 101, $skip); 70 | if (isset($taglist) && (count($taglist) > 0)) { 71 | if (count($taglist) > 100) { 72 | $taglist = array_slice($taglist, 0, 100); 73 | $this->tpl->assign('hasmoretags', true); 74 | } 75 | $this->tpl->assign("taglist",$taglist); 76 | } 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /include/exception/AmbiguousHashException.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Exception 9 | */ 10 | class GitPHP_AmbiguousHashException extends GitPHP_MessageException 11 | { 12 | /** 13 | * Hash 14 | * 15 | * @var string 16 | */ 17 | public $Hash; 18 | 19 | /** 20 | * Constructor 21 | * 22 | * @param string $hash hash 23 | * @param string $message message 24 | * @param integer $code exception code 25 | */ 26 | public function __construct($hash, $message = '', $code = 0) 27 | { 28 | $this->Hash = $hash; 29 | if (empty($message)) 30 | $message = sprintf('Ambiguous abbreviated hash %1$s', $hash); 31 | parent::__construct($message, true, 200, $code); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /include/exception/DirectoryNotFoundException.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Exception 9 | */ 10 | class GitPHP_DirectoryNotFoundException extends GitPHP_MessageException 11 | { 12 | /** 13 | * Directory 14 | * 15 | * @var string 16 | */ 17 | public $Directory; 18 | 19 | /** 20 | * Constructor 21 | * 22 | * @param string $dir directory 23 | * @param string $message message 24 | * @param int $code exception code 25 | */ 26 | public function __construct($dir, $message = '', $code = 0) 27 | { 28 | $this->Directory = $dir; 29 | if (empty($message)) 30 | $message = sprintf('Directory %1$s not found', $dir); 31 | parent::__construct($message, true, 404, $code); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /include/exception/DirectoryTraversalException.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Exception 9 | */ 10 | class GitPHP_DirectoryTraversalException extends GitPHP_MessageException 11 | { 12 | /** 13 | * Path 14 | * 15 | * @var string 16 | */ 17 | public $Path; 18 | 19 | /** 20 | * Constructor 21 | * 22 | * @param string $path path 23 | * @param string $message message 24 | * @param int $code exception code 25 | */ 26 | public function __construct($path, $message = '', $code = 0) 27 | { 28 | $this->Path = $path; 29 | if (empty($message)) 30 | $message = sprintf('%1$s is attempting directory traversal', $path); 31 | parent::__construct($message, true, 200, $code); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /include/exception/FileNotFoundException.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Exception 9 | */ 10 | class GitPHP_FileNotFoundException extends GitPHP_MessageException 11 | { 12 | /** 13 | * File 14 | * 15 | * @var string 16 | */ 17 | public $File; 18 | 19 | /** 20 | * Constructor 21 | * 22 | * @param string $file file 23 | * @param string $message message 24 | * @param int $code exception code 25 | */ 26 | public function __construct($file, $message = '', $code = 0) 27 | { 28 | $this->File = $file; 29 | if (empty($message)) 30 | $message = sprintf('File %1$s not found', $file); 31 | parent::__construct($message, true, 404, $code); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /include/exception/InvalidConfigFileException.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Exception 9 | */ 10 | class GitPHP_InvalidConfigFileException extends GitPHP_MessageException 11 | { 12 | /** 13 | * File 14 | * 15 | * @var string 16 | */ 17 | public $File; 18 | 19 | /** 20 | * Constructor 21 | * 22 | * @param string $file file 23 | * @param string $message message 24 | * @param int $code exception code 25 | */ 26 | public function __construct($file, $message = '', $code = 0) 27 | { 28 | $this->File = $file; 29 | if (empty($message)) 30 | $message = sprintf('Could not load config file %1$s', $file); 31 | parent::__construct($message, true, 500, $code); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /include/exception/InvalidDirectoryConfigurationException.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Exception 9 | */ 10 | class GitPHP_InvalidDirectoryConfigurationException extends GitPHP_MessageException 11 | { 12 | /** 13 | * Directory 14 | * 15 | * @var string 16 | */ 17 | public $Directory; 18 | 19 | /** 20 | * Constructor 21 | * 22 | * @param string $dir directory 23 | * @param string $message message 24 | * @param int $code exception code 25 | */ 26 | public function __construct($dir, $message = '', $code = 0) 27 | { 28 | $this->Directory = $dir; 29 | if (empty($message)) 30 | $message = sprintf('%1$s is not a directory', $dir); 31 | parent::__construct($message, true, 500, $code); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /include/exception/InvalidDirectoryException.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Exception 9 | */ 10 | class GitPHP_InvalidDirectoryException extends GitPHP_MessageException 11 | { 12 | /** 13 | * Directory 14 | * 15 | * @var string 16 | */ 17 | public $Directory; 18 | 19 | /** 20 | * Constructor 21 | * 22 | * @param string $dir directory 23 | * @param string $message message 24 | * @param int $code exception code 25 | */ 26 | public function __construct($dir, $message = '', $code = 0) 27 | { 28 | $this->Directory = $dir; 29 | if (empty($message)) 30 | $message = sprintf('%1$s is not a directory', $dir); 31 | parent::__construct($message, true, 200, $code); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /include/exception/InvalidFileException.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Exception 9 | */ 10 | class GitPHP_InvalidFileException extends GitPHP_MessageException 11 | { 12 | /** 13 | * File 14 | * 15 | * @var string 16 | */ 17 | public $File; 18 | 19 | /** 20 | * Constructor 21 | * 22 | * @param string $file file 23 | * @param string $message message 24 | * @param int $code exception code 25 | */ 26 | public function __construct($file, $message = '', $code = 0) 27 | { 28 | $this->File = $file; 29 | if (empty($message)) 30 | $message = sprintf('%1$s is not a file', $file); 31 | parent::__construct($message, true, 200, $code); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /include/exception/InvalidGitExecutableException.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Exception 9 | */ 10 | class GitPHP_InvalidGitExecutableException extends GitPHP_MessageException 11 | { 12 | /** 13 | * Executable 14 | * 15 | * @var string 16 | */ 17 | public $Executable; 18 | 19 | /** 20 | * Constructor 21 | * 22 | * @param string $exe executable 23 | * @param string $message message 24 | * @param int $code exception code 25 | */ 26 | public function __construct($exe, $message = '', $code = 0) 27 | { 28 | $this->Executable = $exe; 29 | if (empty($message)) 30 | $message = sprintf('Could not run the git executable "%1$s". You may need to set the "%2$s" config value.', $exe, 'gitbin'); 31 | parent::__construct($message, true, 500, $code); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /include/exception/InvalidGitRepositoryException.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Exception 9 | */ 10 | class GitPHP_InvalidGitRepositoryException extends GitPHP_MessageException 11 | { 12 | /** 13 | * Repository 14 | * 15 | * @var string 16 | */ 17 | public $Repository; 18 | 19 | /** 20 | * Constructor 21 | * 22 | * @param string $repo repository 23 | * @param string $message message 24 | * @param int $code exception code 25 | */ 26 | public function __construct($repo, $message = '', $code = 0) 27 | { 28 | $this->Repository = $repo; 29 | if (empty($message)) 30 | $message = sprintf('%1$s is not a git repository', $repo); 31 | parent::__construct($message, true, 200, $code); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /include/exception/InvalidHashException.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Exception 9 | */ 10 | class GitPHP_InvalidHashException extends GitPHP_MessageException 11 | { 12 | /** 13 | * Hash 14 | * 15 | * @var string 16 | */ 17 | public $Hash; 18 | 19 | /** 20 | * Constructor 21 | * 22 | * @param string $hash hash 23 | * @param string $message message 24 | * @param integer $code exception code 25 | */ 26 | public function __construct($hash, $message = '', $code = 0) 27 | { 28 | $this->Hash = $hash; 29 | if (empty($message)) 30 | $message = 'Invalid hash %1$s'; 31 | parent::__construct($message, true, 200, $code); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /include/exception/InvalidProjectParameterException.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Exception 9 | */ 10 | class GitPHP_InvalidProjectParameterException extends GitPHP_MessageException 11 | { 12 | /** 13 | * Specified project 14 | * 15 | * @var string 16 | */ 17 | public $Project; 18 | 19 | /** 20 | * Constructor 21 | * 22 | * @param string $project project 23 | * @param string $message message 24 | * @param int $code code 25 | */ 26 | public function __construct($project, $message = '', $code = 0) 27 | { 28 | $this->Project = $project; 29 | if (empty($message)) 30 | $message = sprintf('Invalid project %1$s', $project); 31 | parent::__construct($message, true, 200, $code); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /include/exception/InvalidSearchTypeException.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Exception 9 | */ 10 | class GitPHP_InvalidSearchTypeException extends GitPHP_MessageException 11 | { 12 | /** 13 | * Constructor 14 | * 15 | * @param string $message string 16 | * @param integer $code exception code 17 | */ 18 | public function __construct($message = '', $code = 0) 19 | { 20 | if (empty($message)) 21 | $message = 'Invalid search type'; 22 | parent::__construct($message, true, 200, $code); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /include/exception/MessageException.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2010 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Exception 9 | */ 10 | class GitPHP_MessageException extends Exception 11 | { 12 | 13 | /** 14 | * Whether this is an error or informational 15 | * 16 | * @var boolean 17 | */ 18 | public $Error; 19 | 20 | /** 21 | * HTTP status code 22 | * 23 | * @var integer 24 | */ 25 | public $StatusCode; 26 | 27 | /** 28 | * Constructor 29 | * 30 | * @param string $message message string 31 | * @param boolean $error true if this is an error rather than informational 32 | * @param integer $statusCode HTTP status code to return 33 | * @param integer $code exception code 34 | */ 35 | public function __construct($message, $error = false, $statusCode = 200, $code = 0) { 36 | $this->Error = $error; 37 | $this->StatusCode = $statusCode; 38 | parent::__construct($message, $code); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /include/exception/MissingMemcacheException.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Exception 9 | */ 10 | class GitPHP_MissingMemcacheException extends GitPHP_MessageException 11 | { 12 | /** 13 | * Constructor 14 | * 15 | * @param string $message message 16 | * @param int $code exception code 17 | */ 18 | public function __construct($message = '', $code = 0) 19 | { 20 | if (empty($message)) 21 | $message = 'The Memcached or Memcache PHP extension is required for Memcache support'; 22 | parent::__construct($message, true, 500, $code); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /include/exception/MissingProjectParameterException.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Exception 9 | */ 10 | class GitPHP_MissingProjectParameterException extends GitPHP_MessageException 11 | { 12 | /** 13 | * Constructor 14 | * 15 | * @param string $message message 16 | * @param int $code code 17 | */ 18 | public function __construct($message = '', $code = 0) 19 | { 20 | if (empty($message)) 21 | $message = 'Project is required'; 22 | parent::__construct($message, true, 200, $code); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /include/exception/MissingProjectrootException.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Exception 9 | */ 10 | class GitPHP_MissingProjectrootException extends GitPHP_MessageException 11 | { 12 | /** 13 | * Constructor 14 | * 15 | * @param string $message 16 | * @param int $code exception code 17 | */ 18 | public function __construct($message = '', $code = 0) 19 | { 20 | if (empty($message)) 21 | $message = 'A projectroot must be set in the config'; 22 | parent::__construct($message, true, 500, $code); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /include/exception/ProjectListFileReadException.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Exception 9 | */ 10 | class GitPHP_ProjectListFileReadException extends GitPHP_MessageException 11 | { 12 | /** 13 | * File 14 | * 15 | * @var string 16 | */ 17 | public $File; 18 | 19 | /** 20 | * Constructor 21 | * 22 | * @param string $file file 23 | * @param string $message message 24 | * @param int $code exception code 25 | */ 26 | public function __construct($file, $message = '', $code = 0) 27 | { 28 | $this->File = $file; 29 | if (empty($message)) 30 | $message = sprintf('Failed to open project list file %1$s', $file); 31 | parent::__construct($message, true, 500, $code); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /include/exception/ProjectrootBoundException.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Exception 9 | */ 10 | class GitPHP_ProjectrootBoundException extends GitPHP_MessageException 11 | { 12 | /** 13 | * Path 14 | * 15 | * @var string 16 | */ 17 | public $Path; 18 | 19 | /** 20 | * Constructor 21 | * 22 | * @param string $path path 23 | * @param string $message message 24 | * @param int $code exception code 25 | */ 26 | public function __construct($path, $message = '', $code = 0) 27 | { 28 | $this->Path = $path; 29 | if (empty($message)) 30 | $message = sprintf('%1$s is outside of the projectroot', $path); 31 | parent::__construct($message, true, 200, $code); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /include/exception/SearchDisabledException.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Exception 9 | */ 10 | class GitPHP_SearchDisabledException extends GitPHP_MessageException 11 | { 12 | /** 13 | * Whether this exception is for file searching 14 | * 15 | * @var boolean 16 | */ 17 | public $FileSearch; 18 | 19 | /** 20 | * Constructor 21 | * 22 | * @param boolean $fileSearch true if filesearch 23 | * @param string $message message 24 | * @param int $code code 25 | */ 26 | public function __construct($fileSearch = false, $message = '', $code = 0) 27 | { 28 | $this->FileSearch = $fileSearch; 29 | if (empty($message)) { 30 | if ($fileSearch) 31 | $message = 'File search has been disabled'; 32 | else 33 | $message = 'Search has been disabled'; 34 | } 35 | parent::__construct($message, true, 200, $code); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /include/exception/SearchLengthException.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Exception 9 | */ 10 | class GitPHP_SearchLengthException extends GitPHP_MessageException 11 | { 12 | /** 13 | * Minimum length 14 | * 15 | * @var int 16 | */ 17 | public $MinimumLength; 18 | 19 | /** 20 | * Constructor 21 | * 22 | * @param int $minLength minimum search length 23 | * @param string $message message 24 | * @param int $code exception code 25 | */ 26 | public function __construct($minLength, $message = '', $code = 0) 27 | { 28 | $this->MinimumLength = $minLength; 29 | if (empty($message)) { 30 | if ($minLength == 1) 31 | $message = 'You must enter search text of at least %1$d character'; 32 | else 33 | $message = 'You must enter search text of at least %1$d characters'; 34 | $message = sprintf($message, $minLength); 35 | } 36 | parent::__construct($message, true, 200, $code); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /include/git/Head.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2010 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Git 9 | */ 10 | class GitPHP_Head extends GitPHP_Ref 11 | { 12 | 13 | /** 14 | * Instantiates head 15 | * 16 | * @param mixed $project the project 17 | * @param string $head head name 18 | * @param string $headHash head hash 19 | * @throws Exception exception on invalid head or hash 20 | */ 21 | public function __construct($project, $head, $headHash = '', $refDir='heads') 22 | { 23 | parent::__construct($project, $refDir, $head, $headHash); 24 | } 25 | 26 | /** 27 | * Gets the commit for this head 28 | * 29 | * @return mixed commit object for this tag 30 | */ 31 | public function GetCommit() 32 | { 33 | return $this->GetProject()->GetCommit($this->GetHash()); 34 | } 35 | 36 | /** 37 | * Compares two heads by age 38 | * 39 | * @param mixed $a first head 40 | * @param mixed $b second head 41 | * @return integer comparison result 42 | */ 43 | public static function CompareAge($a, $b) 44 | { 45 | $aObj = $a->GetCommit(); 46 | $bObj = $b->GetCommit(); 47 | return GitPHP_Commit::CompareAge($aObj, $bObj); 48 | } 49 | 50 | /** 51 | * Generates a head hash key 52 | * 53 | * @param mixed $proj project 54 | * @param string $head head name 55 | * @return string cache key 56 | */ 57 | public static function CacheKey($proj, $head) 58 | { 59 | if (is_object($proj)) 60 | return 'project|' . $proj->GetProject . '|head|' . $head; 61 | 62 | return 'project|' . $proj . '|head|' . $head; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /include/git/Observable.interface.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Git 9 | */ 10 | interface GitPHP_Observable_Interface 11 | { 12 | /** 13 | * Add a new observer 14 | * 15 | * @param GitPHP_Observer_Interface $observer observer 16 | */ 17 | public function AddObserver($observer); 18 | 19 | /** 20 | * Remove an observer 21 | * 22 | * @param GitPHP_Observer_Interface $observer observer 23 | */ 24 | public function RemoveObserver($observer); 25 | } 26 | -------------------------------------------------------------------------------- /include/git/Observer.interface.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Git 9 | */ 10 | interface GitPHP_Observer_Interface 11 | { 12 | /** 13 | * Change type for data that can be cached 14 | * 15 | * @var int 16 | */ 17 | const CacheableDataChange = 1; 18 | 19 | /** 20 | * Change type for logger message 21 | * 22 | * @var int 23 | */ 24 | const LoggableChange = 2; 25 | 26 | /** 27 | * Notify that observable object changed 28 | * 29 | * @param GitPHP_Observable_Interface $object object 30 | * @param int $changeType type of change 31 | * @param array $args argument array 32 | */ 33 | public function ObjectChanged($object, $changeType, $args = array()); 34 | } 35 | -------------------------------------------------------------------------------- /include/git/Pagination.interface.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Git 9 | */ 10 | interface GitPHP_Pagination_Interface 11 | { 12 | /** 13 | * Gets the limit 14 | * 15 | * @return int limit 16 | */ 17 | public function GetLimit(); 18 | 19 | /** 20 | * Sets the limit 21 | * 22 | * @param int $limit limit 23 | */ 24 | public function SetLimit($limit); 25 | 26 | /** 27 | * Gets the skip number 28 | * 29 | * @return int skip number 30 | */ 31 | public function GetSkip(); 32 | 33 | /** 34 | * Sets the skip number 35 | * 36 | * @param int $skip skip number 37 | */ 38 | public function SetSkip($skip); 39 | } 40 | -------------------------------------------------------------------------------- /include/git/archive/ArchiveStrategy.interface.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Git\Archive 9 | */ 10 | interface GitPHP_ArchiveStrategy_Interface 11 | { 12 | /** 13 | * Set executable for this archive 14 | * 15 | * @param GitPHP_GitExe $exe git exe 16 | */ 17 | public function SetExe($exe); 18 | 19 | /** 20 | * Open a descriptor for this archive 21 | * 22 | * @param GitPHP_Archive $archive archive 23 | * @return boolean true on success 24 | */ 25 | public function Open($archive); 26 | 27 | /** 28 | * Read a chunk of the archive data 29 | * 30 | * @param int $size size of data to read 31 | * @return string|boolean archive data or false 32 | */ 33 | public function Read($size = 1048576); 34 | 35 | /** 36 | * Close archive descriptor 37 | */ 38 | public function Close(); 39 | 40 | /** 41 | * Gets the file extension for this format 42 | * 43 | * @return string extension 44 | */ 45 | public function Extension(); 46 | 47 | /** 48 | * Gets the mime type for this format 49 | * 50 | * @return string mime type 51 | */ 52 | public function MimeType(); 53 | 54 | /** 55 | * Gets whether this archiver is valid 56 | * 57 | * @return boolean true if valid 58 | */ 59 | public function Valid(); 60 | } 61 | -------------------------------------------------------------------------------- /include/git/blob/BlobLoadStrategy.interface.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Git\Blob 9 | */ 10 | interface GitPHP_BlobLoadStrategy_Interface 11 | { 12 | /** 13 | * Gets the data for a blob 14 | * 15 | * @param GitPHP_Blob $blob blob 16 | * @return string blob data 17 | */ 18 | public function Load($blob); 19 | 20 | /** 21 | * Gets the size of a blob 22 | * 23 | * @param GitPHP_Blob $blob blob 24 | * @return int blob size 25 | */ 26 | public function Size($blob); 27 | } 28 | -------------------------------------------------------------------------------- /include/git/blob/BlobLoad_Base.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2013 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Git\Blob 9 | */ 10 | abstract class GitPHP_BlobLoad_Base implements GitPHP_BlobLoadStrategy_Interface 11 | { 12 | /** 13 | * Executable 14 | * 15 | * @var GitPHP_GitExe 16 | */ 17 | protected $exe; 18 | 19 | /** 20 | * Constructor 21 | * 22 | * @param GitPHP_GitExe $exe executable 23 | */ 24 | public function __construct($exe) 25 | { 26 | if (!$exe) 27 | throw new Exception('Git exe is required'); 28 | 29 | $this->exe = $exe; 30 | } 31 | 32 | /** 33 | * Load blob size using git 34 | * 35 | * @param GitPHP_Blob $blob blob 36 | * @return int blob size 37 | */ 38 | protected function LoadSize($blob) 39 | { 40 | if (!$blob) 41 | return; 42 | 43 | $args = array(); 44 | $args[] = '-s'; 45 | $args[] = $blob->GetHash(); 46 | 47 | return $this->exe->Execute($blob->GetProject()->GetPath(), GIT_CAT_FILE, $args); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /include/git/blob/BlobLoad_Git.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Git\Blob 9 | */ 10 | class GitPHP_BlobLoad_Git extends GitPHP_BlobLoad_Base 11 | { 12 | /** 13 | * Gets the data for a blob 14 | * 15 | * @param GitPHP_Blob $blob blob 16 | * @return string blob data 17 | */ 18 | public function Load($blob) 19 | { 20 | if (!$blob) 21 | return; 22 | 23 | $args = array(); 24 | $args[] = 'blob'; 25 | $args[] = $blob->GetHash(); 26 | 27 | return $this->exe->Execute($blob->GetProject()->GetPath(), GIT_CAT_FILE, $args); 28 | } 29 | 30 | /** 31 | * Gets the size of a blob 32 | * 33 | * @param GitPHP_Blob $blob blob 34 | * @return int blob size 35 | */ 36 | public function Size($blob) 37 | { 38 | return $this->LoadSize($blob); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /include/git/blob/BlobLoad_Raw.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Git\Blob 9 | */ 10 | class GitPHP_BlobLoad_Raw extends GitPHP_BlobLoad_Base 11 | { 12 | /** 13 | * Object loader 14 | * 15 | * @var GitPHP_GitObjectLoader 16 | */ 17 | protected $objectLoader; 18 | 19 | /** 20 | * Constructor 21 | * 22 | * @param GitPHP_GitObjectLoader $objectLoader object loader 23 | * @param GitPHP_GitExe $exe git exe 24 | */ 25 | public function __construct($objectLoader, $exe) 26 | { 27 | if (!$objectLoader) 28 | throw new Exception('Git object loader is required'); 29 | 30 | $this->objectLoader = $objectLoader; 31 | 32 | parent::__construct($exe); 33 | } 34 | 35 | /** 36 | * Gets the data for a blob 37 | * 38 | * @param GitPHP_Blob $blob blob 39 | * @return string blob data 40 | */ 41 | public function Load($blob) 42 | { 43 | if (!$blob) 44 | return; 45 | 46 | return $this->objectLoader->GetObject($blob->GetHash()); 47 | } 48 | 49 | /** 50 | * Gets the size of a blob 51 | * 52 | * @param GitPHP_Blob $blob blob 53 | * @return int blob size 54 | */ 55 | public function Size($blob) 56 | { 57 | if (!$blob) 58 | return; 59 | 60 | if ($blob->DataLoaded()) 61 | return strlen($blob->GetData()); 62 | 63 | return $this->LoadSize($blob); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /include/git/filemimetype/FileMimeTypeStrategy.interface.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Git\FileMimeType 9 | */ 10 | interface GitPHP_FileMimeTypeStrategy_Interface 11 | { 12 | /** 13 | * Gets the mime type for a blob 14 | * 15 | * @param GitPHP_Blob $blob blob 16 | * @return string mime type 17 | */ 18 | public function GetMime($blob); 19 | 20 | /** 21 | * Gets whether this mimetype strategy is valid 22 | * 23 | * @return bool true if valid 24 | */ 25 | public function Valid(); 26 | } 27 | -------------------------------------------------------------------------------- /include/git/filemimetype/FileMimeType_Extension.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Git\FileMimeType 9 | */ 10 | class GitPHP_FileMimeType_Extension implements GitPHP_FileMimeTypeStrategy_Interface 11 | { 12 | /** 13 | * Gets the mime type for a blob 14 | * 15 | * @param GitPHP_Blob $blob blob 16 | * @return string mime type 17 | */ 18 | public function GetMime($blob) 19 | { 20 | if (!$blob) 21 | return false; 22 | 23 | $file = $blob->GetName(); 24 | 25 | if (empty($file)) 26 | return ''; 27 | 28 | $dotpos = strrpos($file, '.'); 29 | if ($dotpos !== FALSE) 30 | $file = substr($file, $dotpos+1); 31 | switch ($file) { 32 | case 'jpg': 33 | case 'jpeg': 34 | case 'jpe': 35 | return 'image/jpeg'; 36 | break; 37 | case 'gif': 38 | return 'image/gif'; 39 | break; 40 | case 'png'; 41 | return 'image/png'; 42 | break; 43 | } 44 | 45 | return ''; 46 | } 47 | 48 | /** 49 | * Gets whether this mimetype strategy is valid 50 | * 51 | * @return bool true if valid 52 | */ 53 | public function Valid() 54 | { 55 | return true; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /include/git/filemimetype/FileMimeType_FileExe.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Git\FileMimeType 9 | */ 10 | class GitPHP_FileMimeType_FileExe implements GitPHP_FileMimeTypeStrategy_Interface 11 | { 12 | /** 13 | * Gets the mime type for a blob 14 | * 15 | * @param GitPHP_Blob $blob blob 16 | * @return string mime type 17 | */ 18 | public function GetMime($blob) 19 | { 20 | if (!$blob) 21 | return false; 22 | 23 | $data = $blob->GetData(); 24 | if (empty($data)) 25 | return false; 26 | 27 | $descspec = array( 28 | 0 => array('pipe', 'r'), 29 | 1 => array('pipe', 'w') 30 | ); 31 | 32 | $proc = proc_open('file -b --mime -', $descspec, $pipes); 33 | if (is_resource($proc)) { 34 | fwrite($pipes[0], $data); 35 | fclose($pipes[0]); 36 | $mime = stream_get_contents($pipes[1]); 37 | fclose($pipes[1]); 38 | proc_close($proc); 39 | 40 | if ($mime && strpos($mime, '/')) { 41 | if (strpos($mime, ';')) { 42 | $mime = strtok($mime, ';'); 43 | } 44 | return $mime; 45 | } 46 | } 47 | 48 | return false; 49 | } 50 | 51 | /** 52 | * Gets whether this mimetype strategy is valid 53 | * 54 | * @return bool true if valid 55 | */ 56 | public function Valid() 57 | { 58 | return !GitPHP_Util::IsWindows(); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /include/git/filemimetype/FileMimeType_Fileinfo.class.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Git\FileMimeType 9 | */ 10 | class GitPHP_FileMimeType_Fileinfo implements GitPHP_FileMimeTypeStrategy_Interface 11 | { 12 | 13 | /** 14 | * Magic database 15 | * 16 | * @var string 17 | */ 18 | protected $magicdb = null; 19 | 20 | /** 21 | * Constructor 22 | * 23 | * @param string $magicdb magic db 24 | */ 25 | public function __construct($magicdb = null) 26 | { 27 | $this->magicdb = $magicdb; 28 | } 29 | 30 | /** 31 | * Gets the mime type for a blob 32 | * 33 | * @param GitPHP_Blob $blob blob 34 | * @return string mime type 35 | */ 36 | public function GetMime($blob) 37 | { 38 | if (!$blob) 39 | return false; 40 | 41 | $data = $blob->GetData(); 42 | if (empty($data)) 43 | return false; 44 | 45 | $mime = ''; 46 | $finfo = @finfo_open(FILEINFO_MIME, $this->magicdb); 47 | if ($finfo) { 48 | $mime = finfo_buffer($finfo, $data, FILEINFO_MIME); 49 | if ($mime && strpos($mime, '/')) { 50 | if (strpos($mime, ';')) { 51 | $mime = strtok($mime, ';'); 52 | } 53 | } 54 | finfo_close($finfo); 55 | } 56 | 57 | return $mime; 58 | } 59 | 60 | /** 61 | * Gets whether this mimetype strategy is valid 62 | * 63 | * @return bool true if valid 64 | */ 65 | public function Valid() 66 | { 67 | return function_exists('finfo_buffer') && (($this->magicdb == null) || is_readable($this->magicdb)); 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /include/git/tag/TagLoadStrategy.interface.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Git\Tag 9 | */ 10 | interface GitPHP_TagLoadStrategy_Interface 11 | { 12 | /** 13 | * Gets the data for a tag 14 | * 15 | * @param GitPHP_Tag $tag tag 16 | * @return array array of tag data 17 | */ 18 | public function Load($tag); 19 | } 20 | -------------------------------------------------------------------------------- /include/helpers.php: -------------------------------------------------------------------------------- 1 | translate($str); 18 | return $str; 19 | } 20 | 21 | /** 22 | * Gettext wrapper function for readability, plural form 23 | * 24 | * @param string $singular singular form of string 25 | * @param string $plural plural form of string 26 | * @param int $count number of items 27 | * @return string translated string 28 | */ 29 | function __n($singular, $plural, $count) 30 | { 31 | if (GitPHP_Resource::Instantiated()) 32 | return GitPHP_Resource::GetInstance()->ngettext($singular, $plural, $count); 33 | if ($count > 1) 34 | return $plural; 35 | return $singular; 36 | } 37 | 38 | /** 39 | * Log shortcut 40 | */ 41 | function LOGI($line) 42 | { 43 | GitPHP_DebugLog::GetInstance()->Log($line); 44 | } 45 | -------------------------------------------------------------------------------- /include/smartyplugins/function.geturl.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Smarty 9 | * 10 | * @param array $params parameter array 11 | * @param Smarty_Internal_Template $template smarty template 12 | * @return string url 13 | */ 14 | function smarty_function_geturl($params, Smarty_Internal_Template $template) 15 | { 16 | $full = false; 17 | if (!empty($params['fullurl']) && ($params['fullurl'] == true)) { 18 | $full = true; 19 | } 20 | unset($params['fullurl']); 21 | 22 | $escape = true; 23 | if (isset($params['escape']) && ($params['escape'] == false)) 24 | $escape = false; 25 | unset($params['escape']); 26 | 27 | $router = $template->getTemplateVars('router'); 28 | if (!$router) { 29 | trigger_error("geturl: missing router"); 30 | return; 31 | } 32 | 33 | $finalurl = $router->GetUrl($params, $full); 34 | if ($escape) 35 | $finalurl = htmlspecialchars($finalurl, ENT_COMPAT, 'UTF-8', false); 36 | 37 | return $finalurl; 38 | } 39 | -------------------------------------------------------------------------------- /include/smartyplugins/function.localfiletype.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Smarty 9 | * 10 | * @param array $params param array 11 | * @param Smarty_Internal_Template $template smarty template 12 | */ 13 | function smarty_function_localfiletype($params, Smarty_Internal_Template $template) 14 | { 15 | if (empty($params['type'])) { 16 | trigger_error("localfiletype: missing 'type' parameter"); 17 | return; 18 | } 19 | 20 | $type = $params['type']; 21 | 22 | $resource = $template->getTemplateVars('resource'); 23 | 24 | $output = null; 25 | 26 | switch ($type) { 27 | case GitPHP_FilesystemObject::FileType: 28 | if ($resource) 29 | $output = $resource->translate('file'); 30 | else 31 | $output = 'file'; 32 | break; 33 | case GitPHP_FilesystemObject::SymlinkType: 34 | if ($resource) 35 | $output = $resource->translate('symlink'); 36 | else 37 | $output = 'symlink'; 38 | break; 39 | case GitPHP_FilesystemObject::DirectoryType: 40 | if ($resource) 41 | $output = $resource->translate('directory'); 42 | else 43 | $output = 'directory'; 44 | break; 45 | default: 46 | if ($resource) 47 | $output = $resource->translate('unknown'); 48 | else 49 | $output = 'unknown'; 50 | break; 51 | } 52 | 53 | if (!empty($params['assign'])) 54 | $template->assign($params['assign'], $output); 55 | else 56 | return $output; 57 | } 58 | -------------------------------------------------------------------------------- /include/smartyplugins/modifier.buglink.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2010 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Smarty 9 | * 10 | * @param string $text text to find bug references in 11 | * @param string $pattern search pattern 12 | * @param string $link link pattern 13 | * @return string text with bug references linked 14 | */ 15 | function smarty_modifier_buglink($text, $pattern = null, $link = null) 16 | { 17 | if (empty($text) || empty($pattern) || empty($link)) 18 | return $text; 19 | 20 | $fullLink = '${0}'; 21 | 22 | return preg_replace($pattern, $fullLink, $text); 23 | } 24 | -------------------------------------------------------------------------------- /include/smartyplugins/modifier.commithash.php: -------------------------------------------------------------------------------- 1 | 6 | * @package GitPHP 7 | * @subpackage Smarty 8 | * 9 | * @param string $text text to find bug references in 10 | * @param string $project name used in url 11 | * @return string text with bug references linked 12 | */ 13 | function smarty_modifier_commithash($text, $projName = '') 14 | { 15 | if (empty($text)) 16 | return $text; 17 | 18 | // default to current project 19 | if (empty($projName) && isset($_REQUEST['p'])) { 20 | $projName = $_REQUEST['p']; 21 | } 22 | 23 | // $vars = Smarty::$global_tpl_vars; 24 | // $script = $vars['SCRIPT_NAME']->value; 25 | 26 | $link = '?p='.$projName.'&a=commit&h=${1}'; 27 | 28 | $pattern = '/\\b([0-9a-f]{7,40})\\b/'; 29 | 30 | if (preg_match($pattern, $text, $regs)) { 31 | 32 | $fullLink = '${1}'; 33 | 34 | $atag = preg_replace($pattern, $fullLink, $text); 35 | 36 | // abbreviate 37 | $atag = str_replace($regs[1].'', substr($regs[1],0,7).'', $atag); 38 | 39 | return $atag; 40 | } 41 | 42 | return $text; 43 | } 44 | -------------------------------------------------------------------------------- /include/smartyplugins/modifier.highlight.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2010 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Smarty 9 | * 10 | * @param string $haystack string to search in 11 | * @param string $needle substring to search for 12 | * @param int $trimlen length to trim string to 13 | * @param bool $escape true to html escape the string 14 | * @param string $highlightclass CSS class to highlight with 15 | * @return string highlighted string 16 | */ 17 | function smarty_modifier_highlight($haystack, $needle, $trimlen = NULL, $escape = false, $highlightclass = 'searchmatch') 18 | { 19 | if (preg_match("/(.*)(" . quotemeta($needle) . ")(.*)/i",$haystack,$regs)) { 20 | if (isset($trimlen) && ($trimlen > 0)) { 21 | $linelen = strlen($regs[0]); 22 | if ($linelen > $trimlen) { 23 | $matchlen = strlen($regs[2]); 24 | $remain = floor(($trimlen - $matchlen) / 2); 25 | $leftlen = strlen($regs[1]); 26 | $rightlen = strlen($regs[3]); 27 | if ($leftlen > $remain) { 28 | $leftremain = $remain; 29 | if ($rightlen < $remain) 30 | $leftremain += ($remain - $rightlen); 31 | $regs[1] = "…" . substr($regs[1], ($leftlen - ($leftremain - 3))); 32 | } 33 | if ($rightlen > $remain) { 34 | $rightremain = $remain; 35 | if ($leftlen < $remain) 36 | $rightremain += ($remain - $leftlen); 37 | $regs[3] = substr($regs[3],0,$rightremain-3) . "…"; 38 | } 39 | } 40 | } 41 | if ($escape) { 42 | $regs[1] = htmlspecialchars($regs[1]); 43 | $regs[2] = htmlspecialchars($regs[2]); 44 | $regs[3] = htmlspecialchars($regs[3]); 45 | } 46 | $ret = $regs[1] . "" . $regs[3]; 50 | return $ret; 51 | } 52 | 53 | return $haystack; 54 | } 55 | -------------------------------------------------------------------------------- /include/version.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2008-2010 Christopher Han 7 | * @package GitPHP 8 | */ 9 | 10 | /** 11 | * Defines the version 12 | */ 13 | $gitphp_version = "0.2.7.7"; 14 | 15 | /** 16 | * Defines the app string (app name in pages title) 17 | */ 18 | $gitphp_appstring = "gitphp repo"; 19 | 20 | ?> 21 | -------------------------------------------------------------------------------- /js/.gitignore: -------------------------------------------------------------------------------- 1 | *.gz 2 | -------------------------------------------------------------------------------- /js/blob.js: -------------------------------------------------------------------------------- 1 | /* 2 | * GitPHP Javascript blob loader 3 | * 4 | * Initializes script modules used on the blob page 5 | * 6 | * @author Christopher Han 7 | * @copyright Copyright (c) 2011 Christopher Han 8 | * @package GitPHP 9 | * @subpackage Javascript 10 | */ 11 | 12 | define(["jquery", "modules/blameasync"], 13 | function($, blameAsync) { 14 | $(function() { 15 | blameAsync.init($('table#blobData'), $('a#blameLink')); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /js/blobdiff.js: -------------------------------------------------------------------------------- 1 | /* 2 | * GitPHP Javascript blobdiff loader 3 | * 4 | * Initializes script modules used on the blob page 5 | * 6 | * @author Tanguy Pruvot 7 | * @package GitPHP 8 | * @subpackage Javascript 9 | */ 10 | 11 | define(["jquery", "modules/sidebyside.tools", "common"], 12 | function($, sbsTools, common) { 13 | sbsTools.init(); 14 | // global side by side tools 15 | window.toggleTabs = function(refElem) { return sbsTools.toggleTabs(refElem); }; 16 | window.toggleNumbers = function(refElem) { return sbsTools.toggleNumbers(refElem); }; 17 | window.toggleLeft = function(refElem) { return sbsTools.toggleLeft(refElem); }; 18 | window.toggleRight = function(refElem) { return sbsTools.toggleRight(refElem); }; 19 | window.scrollToDiff = function(refElem, focusClass) { return sbsTools.scrollToDiff(refElem, focusClass); }; 20 | }); 21 | -------------------------------------------------------------------------------- /js/commitactivity.js: -------------------------------------------------------------------------------- 1 | /* 2 | * GitPHP Javascript commit graph loader 3 | * 4 | * Initialized script modules used on the commit activity graph 5 | * 6 | * @author Christopher Han 7 | * @copyright Copyright (c) 2012 Christopher Han 8 | * @package GitPHP 9 | * @subpackage Javascript 10 | */ 11 | 12 | define(["jquery", "modules/commitactivitygraph", "common"], function($, commitActivityGraph) { 13 | $(function() { 14 | commitActivityGraph.init('div#graph'); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /js/commitdiff.js: -------------------------------------------------------------------------------- 1 | /* 2 | * GitPHP Javascript commitdiff loader 3 | * 4 | * Initializes script modules used on the commitdiff page 5 | * 6 | * @author Christopher Han 7 | * @copyright Copyright (c) 2011 Christopher Han 8 | * @package GitPHP 9 | * @subpackage Javascript 10 | */ 11 | 12 | define(["jquery", "modules/sidebyside.tools"], 13 | function($, sbsTools) { 14 | jQuery(function(){ 15 | var toc = $('div.commitDiffSBS div.SBSTOC'); 16 | var content = $('div.SBSContent'); 17 | if ((toc.size() > 0) && (content.size() > 0)) { 18 | require(["jquery", "modules/sidebysidecommitdiff"], 19 | function($, sbsDiff) { 20 | $(function() { 21 | sbsDiff.init(toc, content); 22 | }); 23 | } 24 | ); 25 | } 26 | 27 | sbsTools.init(); 28 | // global side by side tools 29 | window.toggleTabs = function(refElem) { return sbsTools.toggleTabs(refElem); }; 30 | window.toggleNumbers = function(refElem) { return sbsTools.toggleNumbers(refElem); }; 31 | window.toggleLeft = function(refElem) { return sbsTools.toggleLeft(refElem); }; 32 | window.toggleRight = function(refElem) { return sbsTools.toggleRight(refElem); }; 33 | window.scrollToDiff = function(refElem, focusClass) { return sbsTools.scrollToDiff(refElem, focusClass); }; 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /js/common.js: -------------------------------------------------------------------------------- 1 | /* 2 | * GitPHP Javascript common loader 3 | * 4 | * Initializes script modules used across all pages 5 | * 6 | * @author Christopher Han 7 | * @copyright Copyright (c) 2011 Christopher Han 8 | * @package GitPHP 9 | * @subpackage Javascript 10 | */ 11 | 12 | define(["jquery", "migrate", "modules/getproject", "modules/lang", "modules/tooltip.snapshot"], 13 | function(jQuery, migrate, project, lang, tooltipSnapshot) { 14 | 15 | $ = jQuery; 16 | 17 | lang($('div.lang_select')); 18 | tooltipSnapshot($('a.snapshotTip')); 19 | 20 | if (project) { 21 | 22 | require(["jquery", "modules/tooltip.commit", "modules/tooltip.tag", "modules/hilight.parents"], 23 | function($, tooltipCommit, tooltipTag, highlightParents) { 24 | $(function() { 25 | highlightParents($('table.shortlog td.hash')); 26 | tooltipCommit($('a.commitTip')); 27 | tooltipTag($('a.tagTip')); 28 | }); 29 | } 30 | ); 31 | 32 | } 33 | } 34 | ); 35 | -------------------------------------------------------------------------------- /js/languagedist.js: -------------------------------------------------------------------------------- 1 | /* 2 | * GitPHP Javascript language distribution graph loader 3 | * 4 | * Initialized script modules used on the language distribution graph 5 | * 6 | * @author Christopher Han 7 | * @copyright Copyright (c) 2012 Christopher Han 8 | * @package GitPHP 9 | * @subpackage Javascript 10 | */ 11 | 12 | define(["jquery", "modules/languagedistgraph", "common"], function($, languageDistGraph) { 13 | $(function() { 14 | languageDistGraph.init('div#graph'); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /js/modules/getproject.js: -------------------------------------------------------------------------------- 1 | /* 2 | * GetProject 3 | * 4 | * Gets the page project for use in ajax requests 5 | * 6 | * @author Christopher Han 7 | * @copyright Copyright (c) 2011 Christopher Han 8 | * @package GitPHP 9 | * @subpackage Javascript 10 | */ 11 | 12 | define(['module'], 13 | function(module) { 14 | return module.config().project || null; 15 | } 16 | ); 17 | -------------------------------------------------------------------------------- /js/modules/geturl.js: -------------------------------------------------------------------------------- 1 | /* 2 | * GetUrl 3 | * 4 | * Gets the page url for use in ajax requests 5 | * 6 | * @author Christopher Han 7 | * @copyright Copyright (c) 2011 Christopher Han 8 | * @package GitPHP 9 | * @subpackage Javascript 10 | */ 11 | 12 | define(['module'], 13 | function(module) { 14 | return module.config().baseurl; 15 | } 16 | ); 17 | -------------------------------------------------------------------------------- /js/modules/hassearchreset.js: -------------------------------------------------------------------------------- 1 | define(['modernizr'], function() { 2 | var tested = false; 3 | 4 | return function() { 5 | if (!tested) { 6 | Modernizr.testStyles( 7 | '#modernizr, x::-webkit-search-cancel-button { width: 9px; }', 8 | function (elem, rule) { 9 | Modernizr.addTest('searchreset', elem.offsetWidth == 9); 10 | } 11 | ); 12 | tested = true; 13 | } 14 | 15 | return Modernizr.searchreset; 16 | }; 17 | }); 18 | -------------------------------------------------------------------------------- /js/modules/hilight.parents.js: -------------------------------------------------------------------------------- 1 | /* 2 | * GitPHP Javascript parents hilight 3 | * 4 | * Hilight commit's parents in short log history 5 | * 6 | * @author Tanguy Pruvot 7 | * @package GitPHP 8 | * @subpackage Javascript 9 | */ 10 | define(["jquery"], 11 | function($) { 12 | 13 | function splitParentHashes(jEl) { 14 | var hashes = jEl.attr('title').trim(); 15 | jEl.removeAttr('title'); 16 | return hashes.split(' '); 17 | } 18 | 19 | return function(elements) { 20 | elements.each(function(){ 21 | 22 | var jThis = $(this); 23 | var jTR = jThis.parents('tr:first'); 24 | if (jTR.size()) { 25 | 26 | var jTable = jTR.parents('table.shortlog:first'); 27 | var arHashes = splitParentHashes(jTR); 28 | var arParents = []; 29 | for (var phash in arHashes) { 30 | var hash = arHashes[phash]; 31 | jTD = jTable.find("td.hash:contains('" + hash + "')"); 32 | arParents.push(jTD.parents('tr:first').first()); 33 | } 34 | jTR.data('parents', arParents); 35 | 36 | // only hilight merge commits (2 or 3 parents) 37 | if (arParents.length > 1) { 38 | jTR.mouseenter(function() { 39 | var arParents = jQuery(this).data('parents'); 40 | if (arParents) for (var tr in arParents) { 41 | jQuery(arParents[tr]).addClass('hoverParent'); 42 | } 43 | }) 44 | .mouseleave(function() { 45 | var arParents = jQuery(this).data('parents'); 46 | if (arParents) for (var tr in arParents) { 47 | jQuery(arParents[tr]).removeClass('hoverParent'); 48 | } 49 | }); 50 | } 51 | } 52 | }); 53 | } 54 | } 55 | ); 56 | -------------------------------------------------------------------------------- /js/modules/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) 2011 Christopher Han 9 | * @package GitPHP 10 | * @subpackage Javascript 11 | */ 12 | 13 | define(["jquery"], 14 | function($) { 15 | return function(langSelContainer) { 16 | langSelContainer.find('select').change( 17 | function() { 18 | langSelContainer.find('form').submit(); 19 | } 20 | ); 21 | langSelContainer.find('input[type="submit"]').remove(); 22 | } 23 | } 24 | ); 25 | -------------------------------------------------------------------------------- /js/modules/resources.js: -------------------------------------------------------------------------------- 1 | /* 2 | * GitPHP resources 3 | * 4 | * Passes resource strings from config to other modules 5 | * 6 | * @author Christopher Han 7 | * @copyright Copyright (c) 2012 Christopher Han 8 | * @package GitPHP 9 | * @subpackage Javascript 10 | */ 11 | 12 | define(['module'], 13 | function (module) { 14 | return module.config().resources; 15 | } 16 | ); 17 | -------------------------------------------------------------------------------- /js/modules/snapshotformats.js: -------------------------------------------------------------------------------- 1 | /* 2 | * GitPHP snapshot formats 3 | * 4 | * Passes snapshot formats from config to other modules 5 | * 6 | * @author Christopher Han 7 | * @copyright Copyright (c) 2012 Christopher Han 8 | * @package GitPHP 9 | * @subpackage Javascript 10 | */ 11 | 12 | define(['module'], 13 | function (module) { 14 | return module.config().formats || null; 15 | } 16 | ); 17 | -------------------------------------------------------------------------------- /js/modules/tooltip.commit.js: -------------------------------------------------------------------------------- 1 | /* 2 | * GitPHP Javascript commit tooltip 3 | * 4 | * Displays commit messages in a tooltip 5 | * 6 | * @author Christopher Han 7 | * @copyright Copyright (c) 2011 Christopher Han 8 | * @package GitPHP 9 | * @subpackage Javascript 10 | */ 11 | 12 | define(["jquery", "modules/geturl", "modules/getproject", 'modules/resources'], 13 | function($, url, project, resources) { 14 | 15 | function getCommitHash(element) { 16 | var hash = element.attr('href').match(/h=([0-9a-fA-F]{7,40}|HEAD)/); 17 | if (!hash) { 18 | hash = element.attr('href').match(/\/commits\/([0-9a-fA-F]{7,40}|HEAD)/); 19 | } 20 | return hash ? hash[1] : null; 21 | } 22 | 23 | function buildTipConfig(hash) { 24 | return { 25 | content: { 26 | text: '' + resources.Loading + '', 27 | ajax: { 28 | url: url, 29 | data: { 30 | p: project, 31 | a: 'commit', 32 | o: 'jstip', 33 | h: hash 34 | }, 35 | type: 'GET' 36 | } 37 | }, 38 | style: { 39 | classes: 'ui-tooltip-gitphp qtip-light qtip-shadow' 40 | }, 41 | position: { 42 | adjust: { 43 | screen: true 44 | }, 45 | viewport: $(window) 46 | } 47 | } 48 | } 49 | 50 | return function(elements) { 51 | 52 | if (elements && (elements.size() > 0)) { 53 | require(['qtip'], function() { 54 | elements.each(function(){ 55 | var jThis = $(this); 56 | var hash = getCommitHash(jThis); 57 | if (!hash) { 58 | return; 59 | } 60 | var config = buildTipConfig(hash); 61 | jThis.qtip(config); 62 | }); 63 | }); 64 | } 65 | } 66 | } 67 | ); 68 | -------------------------------------------------------------------------------- /js/modules/tooltip.snapshot.js: -------------------------------------------------------------------------------- 1 | /* 2 | * GitPHP Javascript snapshot tooltip 3 | * 4 | * Displays choices of snapshot format in a tooltip 5 | * 6 | * @author Christopher Han 7 | * @copyright Copyright (c) 2011 Christopher Han 8 | * @package GitPHP 9 | * @subpackage Javascript 10 | */ 11 | 12 | define(["jquery", 'modules/snapshotformats', 'modules/resources'], 13 | function($, formats, resources) { 14 | 15 | function buildTipContent(href) { 16 | var content = '
' + resources.Snapshot + ': '; 17 | var first = true; 18 | var cleanurl = href.indexOf('/snapshot') != -1; 19 | for (var type in formats) { 20 | if (formats.hasOwnProperty(type)) { 21 | if (!first) { 22 | content += ' | '; 23 | } 24 | if (cleanurl) { 25 | var newhref = href.replace("/snapshot", "/" + type); 26 | content += '' + formats[type] + ''; 27 | } else { 28 | content += '' + formats[type] + ''; 29 | } 30 | first = false; 31 | } 32 | } 33 | content += '
'; 34 | return content; 35 | } 36 | 37 | function buildTipConfig(content) { 38 | return { 39 | content: { 40 | text: content 41 | }, 42 | show: { 43 | event: 'click' 44 | }, 45 | hide: { 46 | fixed: true, 47 | delay: 150 48 | }, 49 | style: { 50 | classes: 'ui-tooltip-gitphp qtip-light qtip-shadow' 51 | }, 52 | position: { 53 | adjust: { 54 | screen: true 55 | }, 56 | viewport: $(window) 57 | } 58 | } 59 | } 60 | 61 | return function(elements) { 62 | if (elements && (elements.size() > 0)) { 63 | require(['qtip'], function() { 64 | elements.each(function(){ 65 | var jThis = $(this); 66 | var href = jThis.attr('href'); 67 | var content = buildTipContent(href); 68 | var config = buildTipConfig(content); 69 | jThis.qtip(config); 70 | jThis.click(function() { return false; }); 71 | }); 72 | }); 73 | } 74 | } 75 | } 76 | ); 77 | -------------------------------------------------------------------------------- /js/modules/tooltip.tag.js: -------------------------------------------------------------------------------- 1 | /* 2 | * GitPHP Javascript tag tooltip 3 | * 4 | * Displays tag messages in a tooltip 5 | * 6 | * @author Christopher Han 7 | * @copyright Copyright (c) 2011 Christopher Han 8 | * @package GitPHP 9 | * @subpackage Javascript 10 | */ 11 | 12 | define(["jquery", "modules/geturl", "modules/getproject", 'modules/resources'], 13 | function($, url, project, resources) { 14 | 15 | function getTagName(element) { 16 | var tag = element.attr('href').match(/[ht]=([^&]+)/); 17 | if (!tag) { 18 | tag = element.attr('href').match(/\/tags\/([^\/\?]+)/); 19 | } 20 | return tag ? tag[1] : null; 21 | } 22 | 23 | function buildTipConfig(tag) { 24 | return { 25 | content: { 26 | text: '' + resources.Loading + '', 27 | ajax: { 28 | url: url, 29 | data: { 30 | p: project, 31 | a: 'tag', 32 | o: 'jstip', 33 | t: tag, 34 | h: tag 35 | }, 36 | type: 'GET' 37 | } 38 | }, 39 | style: { 40 | classes: 'ui-tooltip-gitphp qtip-light qtip-shadow' 41 | }, 42 | position: { 43 | adjust: { 44 | screen: true 45 | }, 46 | viewport: $(window) 47 | } 48 | } 49 | } 50 | 51 | return function(elements) { 52 | if (elements && (elements.size() > 0)) { 53 | require(['qtip'], function() { 54 | elements.each(function(){ 55 | var jThis = $(this); 56 | var tag = getTagName(jThis); 57 | if (!tag) { 58 | return; 59 | } 60 | var config = buildTipConfig(tag); 61 | jThis.qtip(config); 62 | }); 63 | }); 64 | } 65 | } 66 | } 67 | ); 68 | -------------------------------------------------------------------------------- /js/projectlist.js: -------------------------------------------------------------------------------- 1 | /* 2 | * GitPHP Javascript projectlist loader 3 | * 4 | * Initializes script modules used on the projectlist page 5 | * 6 | * @author Christopher Han 7 | * @copyright Copyright (c) 2011 Christopher Han 8 | * @package GitPHP 9 | * @subpackage Javascript 10 | */ 11 | 12 | define(["jquery", "modules/projectsearch", "common"], function($, projectSearch) { 13 | $(function() { 14 | projectSearch.init($('table.projectList'), $('div.projectSearch')); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /js/tree.js: -------------------------------------------------------------------------------- 1 | /* 2 | * GitPHP Javascript tree loader 3 | * 4 | * Initializes script modules used on the tree page 5 | * 6 | * @author Christopher Han 7 | * @copyright Copyright (c) 2011 Christopher Han 8 | * @package GitPHP 9 | * @subpackage Javascript 10 | */ 11 | 12 | define(["jquery", "modules/treedrilldown"], function($, treeDrill) { 13 | jQuery(function($) { 14 | treeDrill.init($('table.treeTable')); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /lib/closure/compiler.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/closure/compiler.jar -------------------------------------------------------------------------------- /lib/geshi/contrib/cssgen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # not used in gitphp, this generate a single css file with all languages styles 4 | 5 | php cssgen2.php > ../../../css/geshi.css 6 | -------------------------------------------------------------------------------- /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: Benny Baumann, Nigel McNie 7 | Email: BenBE@geshi.org, nigel@geshi.org 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 :) -------------------------------------------------------------------------------- /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/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/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/AbstractClass.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/AbstractClass_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/AbstractClass_logo.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/AbstractMethod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/AbstractMethod.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/AbstractPrivateClass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/AbstractPrivateClass.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/AbstractPrivateClass_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/AbstractPrivateClass_logo.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/AbstractPrivateMethod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/AbstractPrivateMethod.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Class.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/Class.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Class_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/Class_logo.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Constant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/Constant.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Constructor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/Constructor.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Destructor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/Destructor.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/Function.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Global.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/Global.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/I.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/I.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/Index.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Interface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/Interface.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Interface_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/Interface_logo.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/L.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/L.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Lminus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/Lminus.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Lplus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/Lplus.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Method.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/Method.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/Page.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Page_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/Page_logo.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/PrivateClass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/PrivateClass.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/PrivateClass_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/PrivateClass_logo.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/PrivateMethod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/PrivateMethod.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/PrivateVariable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/PrivateVariable.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/StaticMethod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/StaticMethod.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/StaticVariable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/StaticVariable.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/T.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/T.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Tminus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/Tminus.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Tplus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/Tplus.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/Variable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/Variable.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/blank.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/class_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/class_folder.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/empty.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/file.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/folder.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/function_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/function_folder.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/next_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/next_button.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/next_button_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/next_button_disabled.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/package.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/package.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/package_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/package_folder.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/previous_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/previous_button.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/previous_button_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/previous_button_disabled.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/private_class_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/private_class_logo.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/tutorial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/tutorial.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/tutorial_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/docs/api/media/images/tutorial_folder.png -------------------------------------------------------------------------------- /lib/geshi/docs/api/media/images/up_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/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/xbasic.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/geshi/geshi/xbasic.php -------------------------------------------------------------------------------- /lib/php-diff/example/a.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello World! 5 | 6 | 7 |

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

8 | 9 |

A heading we'll be removing

10 | 11 |

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

12 | 13 | -------------------------------------------------------------------------------- /lib/php-diff/example/b.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Goodbye Cruel World! 5 | 6 | 7 |

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

8 | 9 | 10 |

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

11 | 12 |

Just a small amount of new text...

13 | 14 | -------------------------------------------------------------------------------- /lib/php-diff/example/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: #fff; 3 | font-family: Arial; 4 | font-size: 12px; 5 | } 6 | .Differences { 7 | width: 100%; 8 | border-collapse: collapse; 9 | border-spacing: 0; 10 | empty-cells: show; 11 | } 12 | 13 | .Differences thead th { 14 | text-align: left; 15 | border-bottom: 1px solid #000; 16 | background: #aaa; 17 | color: #000; 18 | padding: 4px; 19 | } 20 | .Differences tbody th { 21 | text-align: right; 22 | background: #ccc; 23 | width: 4em; 24 | padding: 1px 2px; 25 | border-right: 1px solid #000; 26 | vertical-align: top; 27 | font-size: 13px; 28 | } 29 | 30 | .Differences td { 31 | padding: 1px 2px; 32 | font-family: Consolas, monospace; 33 | font-size: 13px; 34 | } 35 | 36 | .DifferencesSideBySide .ChangeInsert td.Left { 37 | background: #dfd; 38 | } 39 | 40 | .DifferencesSideBySide .ChangeInsert td.Right { 41 | background: #cfc; 42 | } 43 | 44 | .DifferencesSideBySide .ChangeDelete td.Left { 45 | background: #f88; 46 | } 47 | 48 | .DifferencesSideBySide .ChangeDelete td.Right { 49 | background: #faa; 50 | } 51 | 52 | .DifferencesSideBySide .ChangeReplace .Left { 53 | background: #fe9; 54 | } 55 | 56 | .DifferencesSideBySide .ChangeReplace .Right { 57 | background: #fd8; 58 | } 59 | 60 | .Differences ins, .Differences del { 61 | text-decoration: none; 62 | } 63 | 64 | .DifferencesSideBySide .ChangeReplace ins, .DifferencesSideBySide .ChangeReplace del { 65 | background: #fc0; 66 | } 67 | 68 | .Differences .Skipped { 69 | background: #f7f7f7; 70 | } 71 | 72 | .DifferencesInline .ChangeReplace .Left, 73 | .DifferencesInline .ChangeDelete .Left { 74 | background: #fdd; 75 | } 76 | 77 | .DifferencesInline .ChangeReplace .Right, 78 | .DifferencesInline .ChangeInsert .Right { 79 | background: #dfd; 80 | } 81 | 82 | .DifferencesInline .ChangeReplace ins { 83 | background: #9e9; 84 | } 85 | 86 | .DifferencesInline .ChangeReplace del { 87 | background: #e99; 88 | } 89 | 90 | pre { 91 | width: 100%; 92 | overflow: auto; 93 | } -------------------------------------------------------------------------------- /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.11 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/examples/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | PHP-gettext examples 4 | 5 | 6 |

PHP-gettext

7 | 8 |

Introduction

9 |

PHP-gettext provides a simple gettext replacement that works independently from the system's gettext abilities. 10 | It can read MO files and use them for translating strings.

11 |

This version has the ability to cache all strings and translations to speed up the string lookup. 12 | While the cache is enabled by default, it can be switched off with the second parameter in the constructor (e.g. when using very large MO files 13 | that you don't want to keep in memory)

14 | 15 | 16 |

Examples

17 | 21 | 22 |
23 |

Copyright (c) 2003-2006 Danilo Segan

24 |

Copyright (c) 2005-2006 Steven Armstrong

25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /lib/php-gettext/examples/locale/de_CH/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/php-gettext/examples/locale/de_CH/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /lib/php-gettext/examples/locale/de_CH/LC_MESSAGES/messages.po: -------------------------------------------------------------------------------- 1 | # Sample translation for PHP-gettext 1.0 2 | # Copyright (c) 2003 Danilo Segan 3 | # 4 | msgid "" 5 | msgstr "" 6 | "Project-Id-Version: pigs\n" 7 | "Report-Msgid-Bugs-To: \n" 8 | "POT-Creation-Date: 2003-10-23 04:50+0200\n" 9 | "PO-Revision-Date: 2003-11-01 23:40+0100\n" 10 | "Last-Translator: Danilo Segan \n" 11 | "Language-Team: Serbian (sr) \n" 12 | "MIME-Version: 1.0\n" 13 | "Content-Type: text/plain; charset=UTF-8\n" 14 | "Content-Transfer-Encoding: 8bit\n" 15 | #"Plural-Forms: nplurals=2; plural=n != 1;\n" 16 | 17 | #: pigs.php:19 18 | msgid "" 19 | "This is how the story goes.\n" 20 | "\n" 21 | msgstr "" 22 | "Und so geht die Geschichte.\n" 23 | "\n" 24 | 25 | #: pigs.php:21 26 | #, php-format 27 | msgid "%d pig went to the market\n" 28 | msgid_plural "%d pigs went to the market\n" 29 | msgstr[0] "%d Schwein ging zum Markt\n" 30 | msgstr[1] "%d Schweine gingen zum Markt\n" 31 | -------------------------------------------------------------------------------- /lib/php-gettext/examples/locale/sr_CS/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/php-gettext/examples/locale/sr_CS/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /lib/php-gettext/examples/locale/sr_CS/LC_MESSAGES/messages.po: -------------------------------------------------------------------------------- 1 | # Sample translation for PHP-gettext 1.0 2 | # Copyright (c) 2003,2006 Danilo Segan 3 | # 4 | msgid "" 5 | msgstr "" 6 | "Project-Id-Version: pigs\n" 7 | "Report-Msgid-Bugs-To: \n" 8 | "POT-Creation-Date: 2003-10-23 04:50+0200\n" 9 | "PO-Revision-Date: 2006-02-02 21:06+0100\n" 10 | "Last-Translator: Danilo Segan \n" 11 | "Language-Team: Serbian (sr) \n" 12 | "MIME-Version: 1.0\n" 13 | "Content-Type: text/plain; charset=UTF-8\n" 14 | "Content-Transfer-Encoding: 8bit\n" 15 | "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " 16 | "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" 17 | 18 | #: pigs.php:19 19 | msgid "" 20 | "This is how the story goes.\n" 21 | "\n" 22 | msgstr "Овако иде прича.\n\n" 23 | 24 | #: pigs.php:21 25 | #, php-format 26 | msgid "%d pig went to the market\n" 27 | msgid_plural "%d pigs went to the market\n" 28 | msgstr[0] "%d мало прасе је отишло на пијац\n" 29 | msgstr[1] "%d мала прасета су отишла на пијац\n" 30 | msgstr[2] "%d малих прасића је отишло на пијац\n" 31 | -------------------------------------------------------------------------------- /lib/php-gettext/examples/update: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEMPLATE=pigs.pot 3 | xgettext -kT_ngettext:1,2 -kT_ -L PHP -o $TEMPLATE pigs_dropin.php 4 | if [ "x$1" = "x-p" ]; then 5 | msgfmt --statistics $TEMPLATE 6 | else 7 | if [ -f $1.po ]; then 8 | msgmerge -o .tmp$1.po $1.po $TEMPLATE 9 | mv .tmp$1.po $1.po 10 | msgfmt --statistics $1.po 11 | else 12 | echo "Usage: $0 [-p|]" 13 | fi 14 | fi 15 | -------------------------------------------------------------------------------- /lib/repo/Pickle.inc.php: -------------------------------------------------------------------------------- 1 | GetPath() . '/.repopickle_config' 10 | */ 11 | function ReadRepoPickleConfig($repopickle_config) 12 | { 13 | $config = file_get_contents($repopickle_config); 14 | 15 | if (substr($config,0,1) != "\x80") { // PROTO 2 16 | return array(); 17 | } 18 | 19 | $f = explode("\x71",$config); // BINPUT (followed by 1-byte index) 20 | 21 | array_shift($f); //skip first 22 | array_pop($f); // and last items 23 | 24 | $secure = 255; 25 | $keys = array(); 26 | $values = array(); 27 | foreach ($f as $k => $item) { 28 | 29 | $a = unpack('C*', $item); 30 | $n = array_shift($a); 31 | $op = reset($a); // get first item 32 | 33 | $next_is_value = ($op == 0x5D); // EMPTY_LIST ie "=>" 34 | if ($next_is_value) { 35 | $key = $k - 1; 36 | continue; 37 | } 38 | $t = array_shift($a); 39 | 40 | append_remain: 41 | if ($t == 0x61 or $t == 0x28) { // APPEND or MARK 42 | $t = array_shift($a); 43 | $item =substr($item, 1); 44 | } 45 | 46 | $new = $item; 47 | if ($t == 0x55) { //'U' SHORT_BINSTRING (<= 255) 48 | $sz = array_shift($a); 49 | $new = substr($item,3,$sz); 50 | $remain = substr($item, 3+$sz); 51 | } 52 | 53 | if (isset($key)) { 54 | $values[$key] = $new; 55 | unset($key); 56 | } else { 57 | $keys[$k] = $new; 58 | } 59 | 60 | if (!empty($remain) && $secure > 0) { 61 | $item = $remain; 62 | $secure--; 63 | goto append_remain; 64 | } 65 | } 66 | $repo_config = array_combine($keys, $values); 67 | return $repo_config; 68 | } 69 | ?> -------------------------------------------------------------------------------- /lib/rhino/js.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/rhino/js.jar -------------------------------------------------------------------------------- /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/SMARTY_3.0_BC_NOTES.txt: -------------------------------------------------------------------------------- 1 | == Smarty2 backward compatibility == 2 | All Smarty2 specific API functions and deprecated functionallity has been moved 3 | to the SmartyBC class. 4 | 5 | == {php} Tag == 6 | The {php} tag is no longer available in the standard Smarty calls. 7 | The use of {php} tags is deprecated and only available in the SmartyBC class. 8 | 9 | == {include_php} Tag == 10 | The {include_php} tag is no longer available in the standard Smarty calls. 11 | The use of {include_php} tags is deprecated and only available in the SmartyBC class. 12 | 13 | == php template resource == 14 | The support of the php template resource is removed. 15 | 16 | == $cache_dir, $compile_dir, $config_dir, $template_dir access == 17 | The mentioned properties can't be accessed directly any longer. You must use 18 | corresponding getter/setters like addConfigDir(), setConfigDir(), getConfigDir() 19 | 20 | == obsolete Smarty class properties == 21 | The following no longer used properties are removed: 22 | $allow_php_tag 23 | $allow_php_template 24 | $deprecation_notices -------------------------------------------------------------------------------- /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 | force_compile = true; 15 | $smarty->debugging = true; 16 | $smarty->caching = true; 17 | $smarty->cache_lifetime = 120; 18 | 19 | $smarty->assign("Name","Fred Irving Johnathan Bradley Peppergill",true); 20 | $smarty->assign("FirstName",array("John","Mary","James","Henry")); 21 | $smarty->assign("LastName",array("Doe","Smith","Johnson","Case")); 22 | $smarty->assign("Class",array(array("A","B","C","D"), array("E", "F", "G", "H"), 23 | array("I", "J", "K", "L"), array("M", "N", "O", "P"))); 24 | 25 | $smarty->assign("contacts", array(array("phone" => "1", "fax" => "2", "cell" => "3"), 26 | array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234"))); 27 | 28 | $smarty->assign("option_values", array("NY","NE","KS","IA","OK","TX")); 29 | $smarty->assign("option_output", array("New York","Nebraska","Kansas","Iowa","Oklahoma","Texas")); 30 | $smarty->assign("option_selected", "NE"); 31 | 32 | $smarty->display('index.tpl'); 33 | ?> 34 | -------------------------------------------------------------------------------- /lib/smarty/demo/plugins/resource.extendsall.php: -------------------------------------------------------------------------------- 1 | smarty->getTemplateDir() as $key => $directory) { 27 | try { 28 | $s = Smarty_Resource::source(null, $source->smarty, '[' . $key . ']' . $source->name ); 29 | if (!$s->exists) { 30 | continue; 31 | } 32 | $sources[$s->uid] = $s; 33 | $uid .= $s->filepath; 34 | } 35 | catch (SmartyException $e) {} 36 | } 37 | 38 | if (!$sources) { 39 | $source->exists = false; 40 | $source->template = $_template; 41 | return; 42 | } 43 | 44 | $sources = array_reverse($sources, true); 45 | reset($sources); 46 | $s = current($sources); 47 | 48 | $source->components = $sources; 49 | $source->filepath = $s->filepath; 50 | $source->uid = sha1($uid); 51 | $source->exists = $exists; 52 | if ($_template && $_template->smarty->compile_check) { 53 | $source->timestamp = $s->timestamp; 54 | } 55 | // need the template at getContent() 56 | $source->template = $_template; 57 | } 58 | } 59 | 60 | ?> -------------------------------------------------------------------------------- /lib/smarty/demo/templates/footer.tpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /lib/smarty/demo/templates/header.tpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | {$title} - {$Name} 4 | 5 | 6 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifier.regex_replace.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: regex_replace
14 | * Purpose: regular expression search/replace 15 | * 16 | * @link http://smarty.php.net/manual/en/language.modifier.regex.replace.php 17 | * regex_replace (Smarty online manual) 18 | * @author Monte Ohrt 19 | * @param string $string input string 20 | * @param string|array $search regular expression(s) to search for 21 | * @param string|array $replace string(s) that should be replaced 22 | * @return string 23 | */ 24 | function smarty_modifier_regex_replace($string, $search, $replace) 25 | { 26 | if(is_array($search)) { 27 | foreach($search as $idx => $s) { 28 | $search[$idx] = _smarty_regex_replace_check($s); 29 | } 30 | } else { 31 | $search = _smarty_regex_replace_check($search); 32 | } 33 | return preg_replace($search, $replace, $string); 34 | } 35 | 36 | /** 37 | * @param string $search string(s) that should be replaced 38 | * @return string 39 | * @ignore 40 | */ 41 | function _smarty_regex_replace_check($search) 42 | { 43 | // null-byte injection detection 44 | // anything behind the first null-byte is ignored 45 | if (($pos = strpos($search,"\0")) !== false) { 46 | $search = substr($search,0,$pos); 47 | } 48 | // remove eval-modifier from $search 49 | if (preg_match('!([a-zA-Z\s]+)$!s', $search, $match) && (strpos($match[1], 'e') !== false)) { 50 | $search = substr($search, 0, -strlen($match[1])) . preg_replace('![e\s]+!', '', $match[1]); 51 | } 52 | return $search; 53 | } 54 | 55 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifier.replace.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: replace
13 | * Purpose: simple search/replace 14 | * 15 | * @link http://smarty.php.net/manual/en/language.modifier.replace.php replace (Smarty online manual) 16 | * @author Monte Ohrt 17 | * @author Uwe Tews 18 | * @param string $string input string 19 | * @param string $search text to search for 20 | * @param string $replace replacement text 21 | * @return string 22 | */ 23 | function smarty_modifier_replace($string, $search, $replace) 24 | { 25 | if (Smarty::$_MBSTRING) { 26 | require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php'); 27 | return smarty_mb_str_replace($search, $replace, $string); 28 | } 29 | 30 | return str_replace($search, $replace, $string); 31 | } 32 | 33 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifier.spacify.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: spacify
13 | * Purpose: add spaces between characters in a string 14 | * 15 | * @link http://smarty.php.net/manual/en/language.modifier.spacify.php spacify (Smarty online manual) 16 | * @author Monte Ohrt 17 | * @param string $string input string 18 | * @param string $spacify_char string to insert between characters. 19 | * @return string 20 | */ 21 | function smarty_modifier_spacify($string, $spacify_char = ' ') 22 | { 23 | // well… what about charsets besides latin and UTF-8? 24 | return implode($spacify_char, preg_split('//' . Smarty::$_UTF8_MODIFIER, $string, -1, PREG_SPLIT_NO_EMPTY)); 25 | } 26 | 27 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifiercompiler.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 | * 19 | * @link http://smarty.php.net/manual/en/language.modifier.cat.php cat 20 | * (Smarty online manual) 21 | * @author Uwe Tews 22 | * @param array $params parameters 23 | * @return string with compiled code 24 | */ 25 | function smarty_modifiercompiler_cat($params, $compiler) 26 | { 27 | return '('.implode(').(', $params).')'; 28 | } 29 | 30 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifiercompiler.count_characters.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: count_characteres
14 | * Purpose: count the number of characters in a text 15 | * 16 | * @link http://www.smarty.net/manual/en/language.modifier.count.characters.php count_characters (Smarty online manual) 17 | * @author Uwe Tews 18 | * @param array $params parameters 19 | * @return string with compiled code 20 | */ 21 | function smarty_modifiercompiler_count_characters($params, $compiler) 22 | { 23 | if (!isset($params[1]) || $params[1] != 'true') { 24 | return 'preg_match_all(\'/[^\s]/' . Smarty::$_UTF8_MODIFIER . '\',' . $params[0] . ', $tmp)'; 25 | } 26 | if (Smarty::$_MBSTRING) { 27 | return 'mb_strlen(' . $params[0] . ', \'' . addslashes(Smarty::$_CHARSET) . '\')'; 28 | } 29 | // no MBString fallback 30 | return 'strlen(' . $params[0] . ')'; 31 | } 32 | 33 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifiercompiler.count_paragraphs.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: count_paragraphs
14 | * Purpose: count the number of paragraphs in a text 15 | * 16 | * @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php 17 | * count_paragraphs (Smarty online manual) 18 | * @author Uwe Tews 19 | * @param array $params parameters 20 | * @return string with compiled code 21 | */ 22 | function smarty_modifiercompiler_count_paragraphs($params, $compiler) 23 | { 24 | // count \r or \n characters 25 | return '(preg_match_all(\'#[\r\n]+#\', ' . $params[0] . ', $tmp)+1)'; 26 | } 27 | 28 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifiercompiler.count_sentences.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: count_sentences 14 | * Purpose: count the number of sentences in a text 15 | * 16 | * @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php 17 | * count_sentences (Smarty online manual) 18 | * @author Uwe Tews 19 | * @param array $params parameters 20 | * @return string with compiled code 21 | */ 22 | function smarty_modifiercompiler_count_sentences($params, $compiler) 23 | { 24 | // find periods, question marks, exclamation marks with a word before but not after. 25 | return 'preg_match_all("#\w[\.\?\!](\W|$)#S' . Smarty::$_UTF8_MODIFIER . '", ' . $params[0] . ', $tmp)'; 26 | } 27 | 28 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifiercompiler.count_words.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: count_words
14 | * Purpose: count the number of words in a text 15 | * 16 | * @link http://www.smarty.net/manual/en/language.modifier.count.words.php count_words (Smarty online manual) 17 | * @author Uwe Tews 18 | * @param array $params parameters 19 | * @return string with compiled code 20 | */ 21 | function smarty_modifiercompiler_count_words($params, $compiler) 22 | { 23 | if (Smarty::$_MBSTRING) { 24 | // return 'preg_match_all(\'#[\w\pL]+#' . Smarty::$_UTF8_MODIFIER . '\', ' . $params[0] . ', $tmp)'; 25 | // expression taken from http://de.php.net/manual/en/function.str-word-count.php#85592 26 | return 'preg_match_all(\'/\p{L}[\p{L}\p{Mn}\p{Pd}\\\'\x{2019}]*/' . Smarty::$_UTF8_MODIFIER . '\', ' . $params[0] . ', $tmp)'; 27 | } 28 | // no MBString fallback 29 | return 'str_word_count(' . $params[0] . ')'; 30 | } 31 | 32 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifiercompiler.default.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: default
14 | * Purpose: designate default value for empty variables 15 | * 16 | * @link http://www.smarty.net/manual/en/language.modifier.default.php default (Smarty online manual) 17 | * @author Uwe Tews 18 | * @param array $params parameters 19 | * @return string with compiled code 20 | */ 21 | function smarty_modifiercompiler_default ($params, $compiler) 22 | { 23 | $output = $params[0]; 24 | if (!isset($params[1])) { 25 | $params[1] = "''"; 26 | } 27 | 28 | array_shift($params); 29 | foreach ($params as $param) { 30 | $output = '(($tmp = @' . $output . ')===null||$tmp===\'\' ? ' . $param . ' : $tmp)'; 31 | } 32 | return $output; 33 | } 34 | 35 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifiercompiler.from_charset.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: from_charset
14 | * Purpose: convert character encoding from $charset to internal encoding 15 | * 16 | * @author Rodney Rehm 17 | * @param array $params parameters 18 | * @return string with compiled code 19 | */ 20 | function smarty_modifiercompiler_from_charset($params, $compiler) 21 | { 22 | if (!Smarty::$_MBSTRING) { 23 | // FIXME: (rodneyrehm) shouldn't this throw an error? 24 | return $params[0]; 25 | } 26 | 27 | if (!isset($params[1])) { 28 | $params[1] = '"ISO-8859-1"'; 29 | } 30 | 31 | return 'mb_convert_encoding(' . $params[0] . ', "' . addslashes(Smarty::$_CHARSET) . '", ' . $params[1] . ')'; 32 | } 33 | 34 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifiercompiler.indent.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: indent
13 | * Purpose: indent lines of text 14 | * 15 | * @link http://www.smarty.net/manual/en/language.modifier.indent.php indent (Smarty online manual) 16 | * @author Uwe Tews 17 | * @param array $params parameters 18 | * @return string with compiled code 19 | */ 20 | 21 | function smarty_modifiercompiler_indent($params, $compiler) 22 | { 23 | if (!isset($params[1])) { 24 | $params[1] = 4; 25 | } 26 | if (!isset($params[2])) { 27 | $params[2] = "' '"; 28 | } 29 | return 'preg_replace(\'!^!m\',str_repeat(' . $params[2] . ',' . $params[1] . '),' . $params[0] . ')'; 30 | } 31 | 32 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifiercompiler.lower.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: lower
13 | * Purpose: convert string to lowercase 14 | * 15 | * @link http://www.smarty.net/manual/en/language.modifier.lower.php lower (Smarty online manual) 16 | * @author Monte Ohrt 17 | * @author Uwe Tews 18 | * @param array $params parameters 19 | * @return string with compiled code 20 | */ 21 | 22 | function smarty_modifiercompiler_lower($params, $compiler) 23 | { 24 | if (Smarty::$_MBSTRING) { 25 | return 'mb_strtolower(' . $params[0] . ', \'' . addslashes(Smarty::$_CHARSET) . '\')' ; 26 | } 27 | // no MBString fallback 28 | return 'strtolower(' . $params[0] . ')'; 29 | } 30 | 31 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifiercompiler.noprint.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: noprint
14 | * Purpose: return an empty string 15 | * 16 | * @author Uwe Tews 17 | * @param array $params parameters 18 | * @return string with compiled code 19 | */ 20 | function smarty_modifiercompiler_noprint($params, $compiler) 21 | { 22 | return "''"; 23 | } 24 | 25 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifiercompiler.string_format.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: string_format
14 | * Purpose: format strings via sprintf 15 | * 16 | * @link http://www.smarty.net/manual/en/language.modifier.string.format.php string_format (Smarty online manual) 17 | * @author Uwe Tews 18 | * @param array $params parameters 19 | * @return string with compiled code 20 | */ 21 | function smarty_modifiercompiler_string_format($params, $compiler) 22 | { 23 | return 'sprintf(' . $params[1] . ',' . $params[0] . ')'; 24 | } 25 | 26 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifiercompiler.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 | * 19 | * @link http://www.smarty.net/manual/en/language.modifier.strip.php strip (Smarty online manual) 20 | * @author Uwe Tews 21 | * @param array $params parameters 22 | * @return string with compiled code 23 | */ 24 | 25 | function smarty_modifiercompiler_strip($params, $compiler) 26 | { 27 | if (!isset($params[1])) { 28 | $params[1] = "' '"; 29 | } 30 | return "preg_replace('!\s+!" . Smarty::$_UTF8_MODIFIER . "', {$params[1]},{$params[0]})"; 31 | } 32 | 33 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifiercompiler.strip_tags.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: strip_tags
14 | * Purpose: strip html tags from text 15 | * 16 | * @link http://www.smarty.net/manual/en/language.modifier.strip.tags.php strip_tags (Smarty online manual) 17 | * @author Uwe Tews 18 | * @param array $params parameters 19 | * @return string with compiled code 20 | */ 21 | function smarty_modifiercompiler_strip_tags($params, $compiler) 22 | { 23 | if (!isset($params[1])) { 24 | $params[1] = true; 25 | } 26 | if ($params[1] === true) { 27 | return "preg_replace('!<[^>]*?>!', ' ', {$params[0]})"; 28 | } else { 29 | return 'strip_tags(' . $params[0] . ')'; 30 | } 31 | } 32 | 33 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifiercompiler.to_charset.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: to_charset
14 | * Purpose: convert character encoding from internal encoding to $charset 15 | * 16 | * @author Rodney Rehm 17 | * @param array $params parameters 18 | * @return string with compiled code 19 | */ 20 | function smarty_modifiercompiler_to_charset($params, $compiler) 21 | { 22 | if (!Smarty::$_MBSTRING) { 23 | // FIXME: (rodneyrehm) shouldn't this throw an error? 24 | return $params[0]; 25 | } 26 | 27 | if (!isset($params[1])) { 28 | $params[1] = '"ISO-8859-1"'; 29 | } 30 | 31 | return 'mb_convert_encoding(' . $params[0] . ', ' . $params[1] . ', "' . addslashes(Smarty::$_CHARSET) . '")'; 32 | } 33 | 34 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifiercompiler.unescape.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: unescape
14 | * Purpose: unescape html entities 15 | * 16 | * @author Rodney Rehm 17 | * @param array $params parameters 18 | * @return string with compiled code 19 | */ 20 | function smarty_modifiercompiler_unescape($params, $compiler) 21 | { 22 | if (!isset($params[1])) { 23 | $params[1] = 'html'; 24 | } 25 | if (!isset($params[2])) { 26 | $params[2] = '\'' . addslashes(Smarty::$_CHARSET) . '\''; 27 | } else { 28 | $params[2] = "'" . $params[2] . "'"; 29 | } 30 | 31 | switch (trim($params[1], '"\'')) { 32 | case 'entity': 33 | case 'htmlall': 34 | if (Smarty::$_MBSTRING) { 35 | return 'mb_convert_encoding(' . $params[0] . ', ' . $params[2] . ', \'HTML-ENTITIES\')'; 36 | } 37 | 38 | return 'html_entity_decode(' . $params[0] . ', ENT_NOQUOTES, ' . $params[2] . ')'; 39 | 40 | case 'html': 41 | return 'htmlspecialchars_decode(' . $params[0] . ', ENT_QUOTES)'; 42 | 43 | case 'url': 44 | return 'rawurldecode(' . $params[0] . ')'; 45 | 46 | default: 47 | return $params[0]; 48 | } 49 | } 50 | 51 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifiercompiler.upper.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: lower
14 | * Purpose: convert string to uppercase 15 | * 16 | * @link http://smarty.php.net/manual/en/language.modifier.upper.php lower (Smarty online manual) 17 | * @author Uwe Tews 18 | * @param array $params parameters 19 | * @return string with compiled code 20 | */ 21 | function smarty_modifiercompiler_upper($params, $compiler) 22 | { 23 | if (Smarty::$_MBSTRING) { 24 | return 'mb_strtoupper(' . $params[0] . ', \'' . addslashes(Smarty::$_CHARSET) . '\')' ; 25 | } 26 | // no MBString fallback 27 | return 'strtoupper(' . $params[0] . ')'; 28 | } 29 | 30 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/modifiercompiler.wordwrap.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: wordwrap
14 | * Purpose: wrap a string of text at a given length 15 | * 16 | * @link http://smarty.php.net/manual/en/language.modifier.wordwrap.php wordwrap (Smarty online manual) 17 | * @author Uwe Tews 18 | * @param array $params parameters 19 | * @return string with compiled code 20 | */ 21 | function smarty_modifiercompiler_wordwrap($params, $compiler) 22 | { 23 | if (!isset($params[1])) { 24 | $params[1] = 80; 25 | } 26 | if (!isset($params[2])) { 27 | $params[2] = '"\n"'; 28 | } 29 | if (!isset($params[3])) { 30 | $params[3] = 'false'; 31 | } 32 | $function = 'wordwrap'; 33 | if (Smarty::$_MBSTRING) { 34 | if ($compiler->tag_nocache | $compiler->nocache) { 35 | $compiler->template->required_plugins['nocache']['wordwrap']['modifier']['file'] = SMARTY_PLUGINS_DIR .'shared.mb_wordwrap.php'; 36 | $compiler->template->required_plugins['nocache']['wordwrap']['modifier']['function'] = 'smarty_mb_wordwrap'; 37 | } else { 38 | $compiler->template->required_plugins['compiled']['wordwrap']['modifier']['file'] = SMARTY_PLUGINS_DIR .'shared.mb_wordwrap.php'; 39 | $compiler->template->required_plugins['compiled']['wordwrap']['modifier']['function'] = 'smarty_mb_wordwrap'; 40 | } 41 | $function = 'smarty_mb_wordwrap'; 42 | } 43 | return $function . '(' . $params[0] . ',' . $params[1] . ',' . $params[2] . ',' . $params[3] . ')'; 44 | } 45 | 46 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/shared.escape_special_chars.php: -------------------------------------------------------------------------------- 1 | =')) { 10 | /** 11 | * escape_special_chars common function 12 | * 13 | * Function: smarty_function_escape_special_chars
14 | * Purpose: used by other smarty functions to escape 15 | * special chars except for already escaped ones 16 | * 17 | * @author Monte Ohrt 18 | * @param string $string text that should by escaped 19 | * @return string 20 | */ 21 | function smarty_function_escape_special_chars($string) 22 | { 23 | if (!is_array($string)) { 24 | $string = htmlspecialchars($string, ENT_COMPAT, Smarty::$_CHARSET, false); 25 | } 26 | return $string; 27 | } 28 | } else { 29 | /** 30 | * escape_special_chars common function 31 | * 32 | * Function: smarty_function_escape_special_chars
33 | * Purpose: used by other smarty functions to escape 34 | * special chars except for already escaped ones 35 | * 36 | * @author Monte Ohrt 37 | * @param string $string text that should by escaped 38 | * @return string 39 | */ 40 | function smarty_function_escape_special_chars($string) 41 | { 42 | if (!is_array($string)) { 43 | $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string); 44 | $string = htmlspecialchars($string); 45 | $string = str_replace(array('%%%SMARTY_START%%%', '%%%SMARTY_END%%%'), array('&', ';'), $string); 46 | } 47 | return $string; 48 | } 49 | } 50 | 51 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/shared.literal_compiler_param.php: -------------------------------------------------------------------------------- 1 | 11 | * Purpose: used by other smarty functions to make a timestamp from a string. 12 | * 13 | * @author Monte Ohrt 14 | * @param DateTime|int|string $string date object, timestamp or string that can be converted using strtotime() 15 | * @return int 16 | */ 17 | function smarty_make_timestamp($string) 18 | { 19 | if (empty($string)) { 20 | // use "now": 21 | return time(); 22 | } elseif ($string instanceof DateTime) { 23 | return $string->getTimestamp(); 24 | } elseif (strlen($string) == 14 && ctype_digit($string)) { 25 | // it is mysql timestamp format of YYYYMMDDHHMMSS? 26 | return mktime(substr($string, 8, 2),substr($string, 10, 2),substr($string, 12, 2), 27 | substr($string, 4, 2),substr($string, 6, 2),substr($string, 0, 4)); 28 | } elseif (is_numeric($string)) { 29 | // it is a numeric string, we handle it as timestamp 30 | return (int) $string; 31 | } else { 32 | // strtotime should handle it 33 | $time = strtotime($string); 34 | if ($time == -1 || $time === false) { 35 | // strtotime() was not able to parse $string, use "now": 36 | return time(); 37 | } 38 | return $time; 39 | } 40 | } 41 | 42 | ?> 43 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/shared.mb_str_replace.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/shared.mb_unicode.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/smarty/libs/plugins/variablefilter.htmlspecialchars.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/smarty/libs/sysplugins/smarty_internal_compile_append.php: -------------------------------------------------------------------------------- 1 | required_attributes = array('var', 'value'); 32 | $this->shorttag_order = array('var', 'value'); 33 | $this->optional_attributes = array('scope', 'index'); 34 | // check and get attributes 35 | $_attr = $this->getAttributes($compiler, $args); 36 | // map to compile assign attributes 37 | if (isset($_attr['index'])) { 38 | $_params['smarty_internal_index'] = '[' . $_attr['index'] . ']'; 39 | unset($_attr['index']); 40 | } else { 41 | $_params['smarty_internal_index'] = '[]'; 42 | } 43 | $_new_attr = array(); 44 | foreach ($_attr as $key => $value) { 45 | $_new_attr[] = array($key => $value); 46 | } 47 | // call compile assign 48 | return parent::compile($_new_attr, $compiler, $_params); 49 | } 50 | 51 | } 52 | 53 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/sysplugins/smarty_internal_compile_block.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/lib/smarty/libs/sysplugins/smarty_internal_compile_block.php -------------------------------------------------------------------------------- /lib/smarty/libs/sysplugins/smarty_internal_compile_debug.php: -------------------------------------------------------------------------------- 1 | getAttributes($compiler, $args); 32 | 33 | // compile always as nocache 34 | $compiler->tag_nocache = true; 35 | 36 | // display debug template 37 | $_output = "smarty->loadPlugin('Smarty_Internal_Debug'); Smarty_Internal_Debug::display_debug(\$_smarty_tpl); ?>"; 38 | return $_output; 39 | } 40 | 41 | } 42 | 43 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/sysplugins/smarty_internal_compile_ldelim.php: -------------------------------------------------------------------------------- 1 | getAttributes($compiler, $args); 31 | if ($_attr['nocache'] === true) { 32 | $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno); 33 | } 34 | // this tag does not return compiled code 35 | $compiler->has_code = true; 36 | return $compiler->smarty->left_delimiter; 37 | } 38 | 39 | } 40 | 41 | ?> 42 | -------------------------------------------------------------------------------- /lib/smarty/libs/sysplugins/smarty_internal_compile_rdelim.php: -------------------------------------------------------------------------------- 1 | getAttributes($compiler, $args); 31 | if ($_attr['nocache'] === true) { 32 | $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno); 33 | } 34 | // this tag does not return compiled code 35 | $compiler->has_code = true; 36 | return $compiler->smarty->right_delimiter; 37 | } 38 | 39 | } 40 | 41 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/sysplugins/smarty_internal_get_include_path.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/smarty/libs/sysplugins/smarty_internal_nocache_insert.php: -------------------------------------------------------------------------------- 1 | assign('{$_assign}' , {$_function} (" . var_export($_attr, true) . ",\$_smarty_tpl), true);?>"; 41 | } else { 42 | $_output .= "echo {$_function}(" . var_export($_attr, true) . ",\$_smarty_tpl);?>"; 43 | } 44 | $_tpl = $_template; 45 | while ($_tpl->parent instanceof Smarty_Internal_Template) { 46 | $_tpl = $_tpl->parent; 47 | } 48 | return "/*%%SmartyNocache:{$_tpl->properties['nocache_hash']}%%*/" . $_output . "/*/%%SmartyNocache:{$_tpl->properties['nocache_hash']}%%*/"; 49 | } 50 | 51 | } 52 | 53 | ?> 54 | -------------------------------------------------------------------------------- /lib/smarty/libs/sysplugins/smarty_resource_recompiled.php: -------------------------------------------------------------------------------- 1 | filepath = false; 30 | $compiled->timestamp = false; 31 | $compiled->exists = false; 32 | } 33 | 34 | } 35 | 36 | ?> -------------------------------------------------------------------------------- /lib/smarty/libs/sysplugins/smarty_resource_uncompiled.php: -------------------------------------------------------------------------------- 1 | filepath = false; 38 | $compiled->timestamp = false; 39 | $compiled->exists = false; 40 | } 41 | 42 | } 43 | 44 | ?> -------------------------------------------------------------------------------- /locale/.gitignore: -------------------------------------------------------------------------------- 1 | *.mo 2 | zz_Debug 3 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | chmod -R g+w templates_c 4 | chmod -R g+w cache 5 | 6 | if [ ! -f "config/gitphp.conf.php" ]; then 7 | cp config/gitphp.conf.php.example config/gitphp.conf.php 8 | fi 9 | 10 | if [ ! -f "config/projects.conf.php" ]; then 11 | cp config/projects.conf.php.example config/projects.conf.php 12 | fi 13 | 14 | chgrp -R www-data * 15 | -------------------------------------------------------------------------------- /templates/.gitignore: -------------------------------------------------------------------------------- 1 | hometext.tpl 2 | -------------------------------------------------------------------------------- /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 | {geturl fullurl=true project=$project} 15 | {if $log->GetHead()} 16 | {$log->GetHead()->GetCommitterEpoch()|date_format:"%Y-%m-%dT%H:%M:%S+00:00"} 17 | {/if} 18 | 19 | {foreach from=$log item=logitem} 20 | 21 | {geturl fullurl=true project=$project action=commit hash=$logitem} 22 | {$logitem->GetTitle()|escape:'html'} 23 | 24 | {$logitem->GetAuthorName()|escape:'html'} 25 | 26 | {$logitem->GetCommitterEpoch()|date_format:"%Y-%m-%dT%H:%M:%S+00:00"} 27 | {$logitem->GetCommitterEpoch()|date_format:"%Y-%m-%dT%H:%M:%S+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($gitexe) item=diffline} 39 |
  • {$diffline->GetToFile()|htmlspecialchars}
  • 40 | {/foreach} 41 |
42 |
43 |
44 |
45 | {/foreach} 46 | 47 |
48 | -------------------------------------------------------------------------------- /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 | {if $filediff->IsBinary()} 2 | {t 1=$filediff->GetFromLabel($file) 2=$filediff->GetToLabel($file)}Binary files %1 and %2 differ{/t} 3 | {else} 4 | {$filediff->GetDiff($file, false)} 5 | {/if} 6 | -------------------------------------------------------------------------------- /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 | {$blob->GetData()} 2 | -------------------------------------------------------------------------------- /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"} {date('O')} 10 | {if !$file}{* single commit diff *} 11 | {assign var=tag value=$commit->GetContainingTag()} 12 | {if $tag} 13 | X-Git-Tag: {$tag->GetName()} 14 | {/if} 15 | X-Git-Url: {geturl escape=false fullurl=true project=$project action=commitdiff hash=$commit} 16 | Subject: {foreach from=$commit->GetComment() item=line} 17 | {$line} 18 | {/foreach} 19 | {else}{* file filter against two revisions *} 20 | X-Git-Url: {geturl escape=false fullurl=true project=$project action=commitdiff hash=$commit file=$file} 21 | Subject: [PATCH] git diff {$treediff->GetFromHash()}..{$treediff->GetToHash()} -- {$file} 22 | {/if} 23 | --- 24 | 25 | {foreach from=$treediff item=filediff} 26 | {if !$filediff->IsBinary()} 27 | {$filediff->GetDiff()} 28 | {/if} 29 | {/foreach} 30 | -------------------------------------------------------------------------------- /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 |
12 | 13 | {t}committer{/t}: {$commit->GetCommitter()} ({$commit->GetCommitterEpoch()|date_format:"%Y-%m-%d %H:%M:%S"}) 14 | 15 |

16 | {foreach from=$commit->GetComment() item=line} 17 | {if strstr(trim($line),'-by: ') || strstr(trim($line),'Cc: ')} 18 | {$line|escape} 19 | {elseif strncasecmp(trim($line),'Change-Id:',10) == 0} 20 | {$line|escape} 21 | {else} 22 | {$line|escape} 23 | {/if} 24 |
25 | {/foreach} 26 |
27 | -------------------------------------------------------------------------------- /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 |
 9 | {foreach from=$diff item=diffline}
10 | {if substr($diffline,0,1)=="+"}
11 | {$diffline|escape:'html'}
12 | {elseif substr($diffline,0,1)=="-"}
13 | {$diffline|escape:'html'}
14 | {elseif substr($diffline,0,1)=="@"}
15 | {$diffline|escape:'html'}
16 | {else}
17 | {$diffline|escape:'html'}
18 | {/if}
19 | {/foreach}
20 | 
21 | -------------------------------------------------------------------------------- /templates/graph.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * Graph selection template 3 | * 4 | * @author Christopher Han 5 | * @copyright Copyright (c) 2012 Christopher Han 6 | * @package GitPHP 7 | * @subpackage Template 8 | *} 9 | {extends file='projectbase.tpl'} 10 | 11 | {block name=javascriptpaths} 12 | GitPHPJSPaths.d3 = "ext/d3.v2.min" 13 | {if $graphtype=='languagedist' && file_exists('js/languagedist.min.js')} 14 | GitPHPJSPaths.languagedist = "languagedist.min"; 15 | {elseif $graphtype=='commitactivity' && file_exists('js/commitactivity.min.js')} 16 | GitPHPJSPaths.commitactivity = "commitactivity.min"; 17 | {/if} 18 | {/block} 19 | 20 | {block name=javascriptmodules} 21 | {if $graphtype} 22 | GitPHPJSModules = ['{$graphtype}']; 23 | {else} 24 | GitPHPJSModules = ['common']; 25 | {/if} 26 | {/block} 27 | 28 | {block name=main} 29 | 30 | 46 | 47 | {include file='title.tpl'} 48 | 49 |
50 |
51 | 52 | {/block} 53 | -------------------------------------------------------------------------------- /templates/graphdata.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * Raw graph data template 3 | * 4 | * @author Christopher Han 5 | * @copyright Copyright (c) 2012 Christopher Han 6 | * @package GitPHP 7 | * @subpackage Template 8 | *} 9 | {$data} 10 | -------------------------------------------------------------------------------- /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 | 19 | 21 | 22 | {/foreach} 23 | {if $hasmoreheads} 24 | 25 | {if $source == 'summary'} 26 | 27 | {else} 28 | 29 | {/if} 30 | 31 | 32 | {/if} 33 |
{agestring age=$headcommit->GetAge()}{$head->GetName()}
{t}next{/t}
34 | 35 | -------------------------------------------------------------------------------- /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 | {extends file='projectbase.tpl'} 9 | 10 | {block name=links append} 11 | {if $page > 0} 12 | 13 | {/if} 14 | {if $hasmoreheads} 15 | 16 | {/if} 17 | {/block} 18 | 19 | {block name=main} 20 | 21 | {* Nav *} 22 | 43 | 44 | {include file='title.tpl' target='summary'} 45 | 46 | {include file='headlist.tpl'} 47 | 48 | {/block} 49 | -------------------------------------------------------------------------------- /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 | {extends file='main.tpl'} 9 | 10 | {block name=main} 11 | 12 |
{$message|escape}
13 | 14 | {/block} 15 | -------------------------------------------------------------------------------- /templates/nav.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * Nav 3 | * 4 | * Nav links template fragment 5 | * 6 | * @author Christopher Han 7 | * @copyright Copyright (c) 2010 Christopher Han 8 | * @package GitPHP 9 | * @subpackage Template 10 | *} 11 | 12 | {if $current=='summary'} 13 | {t}summary{/t} 14 | {else} 15 | {t}summary{/t} 16 | {/if} 17 | | 18 | {if $current=='shortlog' || !$commit} 19 | {t}shortlog{/t} 20 | {else} 21 | {t}shortlog{/t} 22 | {/if} 23 | | 24 | {if $current=='log' || !$commit} 25 | {t}log{/t} 26 | {else} 27 | {t}log{/t} 28 | {/if} 29 | | 30 | {if $current=='commit' || !$commit} 31 | {t}commit{/t} 32 | {else} 33 | {t}commit{/t} 34 | {/if} 35 | | 36 | {if $current=='commitdiff' || !$commit} 37 | {t}commitdiff{/t} 38 | {else} 39 | {t}commitdiff{/t} 40 | {/if} 41 | | 42 | {if $current=='tree' || !$commit} 43 | {t}tree{/t} 44 | {else} 45 | {t}tree{/t} 46 | {/if} 47 | {if $enablegraphs} 48 | | 49 | {if $current=='graph' || !$commit} 50 | {t}graph{/t} 51 | {else} 52 | {t}graph{/t} 53 | {/if} 54 | {/if} 55 | -------------------------------------------------------------------------------- /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 | {assign var=pathobjectcommit value=$pathobject->GetCommit()} 14 | {assign var=pathobjecttree value=$pathobjectcommit->GetTree()} 15 | [{$project->GetProject()}] / 16 | {foreach from=$pathobject->GetPathTree() item=pathtreepiece} 17 | {$pathtreepiece->GetName()|escape} / 18 | {/foreach} 19 | {if $pathobject instanceof GitPHP_Blob} 20 | {if $target == 'blobplain'} 21 | {$pathobject->GetName()|escape} 22 | {elseif $target == 'blob'} 23 | {$pathobject->GetName()|escape} 24 | {else} 25 | {$pathobject->GetName()|escape} 26 | {/if} 27 | {elseif $pathobject->GetName()} 28 | {if $target == 'tree'} 29 | {$pathobject->GetName()|escape} / 30 | {else} 31 | {$pathobject->GetName()|escape} / 32 | {/if} 33 | {/if} 34 | {else} 35 |   36 | {/if} 37 |
38 | -------------------------------------------------------------------------------- /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 | {extends file='projectbase.tpl'} 9 | 10 | {block name=main} 11 | 12 | 16 | 17 | {include file='title.tpl'} 18 | 19 | {* Project brief *} 20 | 21 | 22 | 23 | {if $head} 24 | 25 | {/if} 26 | {if $project->GetCloneUrl()} 27 | 28 | {/if} 29 | {if $project->GetPushUrl()} 30 | 31 | {/if} 32 | {if $project->GetWebsite()} 33 | 34 | {/if} 35 |
{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"} {date('O')}
{t}clone url{/t}{$project->GetCloneUrl()}
{t}push url{/t}{$project->GetPushUrl()}
{t}website{/t}{$project->GetWebsite()}
36 | 37 | {if !$head} 38 | {include file='title.tpl' target='shortlog' disablelink=true} 39 | {else} 40 | {include file='title.tpl' target='shortlog'} 41 | {/if} 42 | 43 | {include file='shortloglist.tpl' source='summary'} 44 | 45 | {if $taglist} 46 | 47 | {include file='title.tpl' target='tags'} 48 | 49 | {include file='taglist.tpl' source='summary'} 50 | 51 | {/if} 52 | 53 | {if $headlist} 54 | 55 | {include file='title.tpl' target='heads'} 56 | 57 | {include file='headlist.tpl' source='summary'} 58 | 59 | {/if} 60 | 61 | {if $remotelist} 62 | 63 | {include file='title.tpl' target='remotes'} 64 | 65 | {include file='remotelist.tpl' source='summary'} 66 | 67 | {/if} 68 | 69 | {/block} 70 | -------------------------------------------------------------------------------- /templates/projectindex.tpl: -------------------------------------------------------------------------------- 1 | {foreach from=$projectlist item=proj} 2 | {$proj->GetProject()} 3 | {/foreach} 4 | -------------------------------------------------------------------------------- /templates/projectmessage.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * projectmessage.tpl 3 | * gitphp: A PHP git repository browser 4 | * Component: Project-specific arning/error message template 5 | * 6 | * Copyright (C) 2012 Christopher Han 7 | *} 8 | {extends file='projectbase.tpl'} 9 | 10 | {block name=main} 11 | 12 | 16 | 17 | {include file='title.tpl' target='summary'} 18 | 19 |
{$message|escape}
20 | 21 | {/block} 22 | -------------------------------------------------------------------------------- /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 | {foreach from=$commit->GetRemoteHeads() item=commithead} 19 | 20 | {$commithead->GetName()} 21 | 22 | {/foreach} 23 | {foreach from=$commit->GetTags() item=committag} 24 | 25 | LightTag()}class="tagTip"{/if}>{$committag->GetName()} 26 | 27 | {/foreach} 28 | 29 | -------------------------------------------------------------------------------- /templates/remotelist.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * Remote Branch list 3 | * 4 | * Remote list template fragment 5 | * 6 | * @author Tanguy Pruvot 7 | * @author Christopher Han 8 | * @copyright Copyright (c) 2010 Christopher Han 9 | * @packge GitPHP 10 | * @subpackage Template 11 | *} 12 | 13 | 14 | {* Loop and display each head *} 15 | {foreach from=$remotelist item=head name=heads} 16 | {assign var=headcommit value=$head->GetCommit()} 17 | 18 | 19 | 20 | 21 | 22 | {/foreach} 23 | {if $hasmoreremotes} 24 | 25 | {if $source == 'summary'} 26 | 27 | {else} 28 | 29 | {/if} 30 | 31 | 32 | {/if} 33 |
{agestring age=$headcommit->GetAge()}{$head->GetName()}
{t}next{/t}
34 | 35 | -------------------------------------------------------------------------------- /templates/remotes.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * remotes.tpl 3 | * gitphp: A PHP git repository browser 4 | * Component: Remote Head view template 5 | *} 6 | {extends file='projectbase.tpl'} 7 | 8 | {block name=links append} 9 | {if $page > 0} 10 | 11 | {/if} 12 | {if $hasmoreheads} 13 | 14 | {/if} 15 | {/block} 16 | 17 | {block name=main} 18 | 19 | {* Nav *} 20 | 41 | 42 | {include file='title.tpl' target='summary'} 43 | 44 | {include file='remotelist.tpl'} 45 | 46 | {/block} 47 | -------------------------------------------------------------------------------- /templates/rss.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * rss.tpl 3 | * GitPHP: A PHP git repository browser 4 | * Component: RSS template 5 | * 6 | * Copyright (C) 2012 Christopher Han 7 | *} 8 | 9 | 10 | 11 | {$project->GetProject()} 12 | {geturl fullurl=true project=$project} 13 | 14 | {$project->GetProject()} log 15 | en 16 | 17 | {**}{foreach from=$log item=logitem} 18 | 19 | {$logitem->GetCommitterEpoch()|date_format:"%d %b %Y, %R"} - {$logitem->GetTitle()|escape:'html'} 20 | {$logitem->GetAuthorEmail()|escape:'html'} ({$logitem->GetAuthorName()|escape:'html'}) 21 | {$logitem->GetCommitterEpoch()|date_format:"%a, %d %b %Y %H:%M:%S"} {date('O')} 22 | {geturl fullurl=true project=$project action=commit hash=$logitem} 23 | {geturl fullurl=true project=$project action=commit hash=$logitem} 24 | {foreach from=$logitem->GetComment() item=line}{$line|escape:'html'}<br/>{/foreach} 25 | 26 | DiffToParent($gitexe) item=diffline} 28 | {$diffline->GetToFile()}
29 | {/foreach} 30 | ]]> 31 |
32 |
33 | {**}{/foreach} 34 | 35 |
36 |
37 | -------------------------------------------------------------------------------- /templates/snapshot.tpl: -------------------------------------------------------------------------------- 1 | {$archive} 2 | -------------------------------------------------------------------------------- /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 | {extends file='projectbase.tpl'} 9 | 10 | {block name=main} 11 | 12 | {* Nav *} 13 | 17 | 18 | {include file='title.tpl' target='summary'} 19 | 20 | {* Display tags *} 21 | 22 | {include file='taglist.tpl'} 23 | 24 | {/block} 25 | -------------------------------------------------------------------------------- /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 | {if strncasecmp(trim($line),'-----BEGIN PGP',14) == 0} 17 | 18 | {/if} 19 |
{$line} 20 | {if strncasecmp(trim($line),'-----END PGP',12) == 0} 21 |
22 | {/if} 23 | {/foreach} 24 |
25 | -------------------------------------------------------------------------------- /templates/title.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * Title 3 | * 4 | * Title template 5 | * 6 | * @author Christopher Han 7 | * @copyright Copyright (c) 2010 Christopher Han 8 | * @package GitPHP 9 | * @subpackage Template 10 | *} 11 | 12 |
13 | {if $titlecommit} 14 | {if $target == 'commitdiff'} 15 | {$titlecommit->GetTitle()|escape} 16 | {elseif $target == 'tree'} 17 | {$titlecommit->GetTitle()|escape} 18 | {elseif $target == 'summary'} 19 | {if $branch} 20 | {t}repo branch{/t}: {$branch} 21 | {/if} 22 |   23 | {else} 24 | {$titlecommit->GetTitle()|escape} 25 | {/if} 26 | {include file='refbadges.tpl' commit=$titlecommit} 27 | 28 | {time()|date_format:"%a, %d %b %Y %H:%M"} {date('T')} 29 | 30 | {else} 31 | {if $target == 'shortlog'} 32 | {if $disablelink} 33 | {t}shortlog{/t} 34 | {else} 35 | {t}shortlog{/t} 36 | {/if} 37 | {elseif $target == 'tags'} 38 | {if $disablelink} 39 | {t}tags{/t} 40 | {else} 41 | {t}tags{/t} 42 | {/if} 43 | {elseif $target == 'heads'} 44 | {if $disablelink} 45 | {t}heads{/t} 46 | {else} 47 | {t}heads{/t} 48 | {/if} 49 | {elseif $target == 'remotes'} 50 | {if $disablelink} 51 | {t}heads{/t} 52 | {else} 53 | {t}remote heads{/t} 54 | {/if} 55 | {else} 56 |   57 | {/if} 58 | {/if} 59 |
60 | -------------------------------------------------------------------------------- /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 | {extends file='projectbase.tpl'} 9 | 10 | {block name=javascriptpaths} 11 | {if file_exists('js/tree.min.js')} 12 | GitPHPJSPaths.tree = "tree.min"; 13 | {/if} 14 | {/block} 15 | {block name=javascriptmodules} 16 | GitPHPJSModules = ['tree']; 17 | {/block} 18 | 19 | {block name=main} 20 | 21 | {* Nav *} 22 | 26 | 27 | {include file='title.tpl' titlecommit=$commit} 28 | 29 | {include file='path.tpl' pathobject=$tree target='tree'} 30 | 31 |
32 | {* List files *} 33 | 34 | {include file='treelist.tpl'} 35 |
36 |
37 | 38 | {/block} 39 | -------------------------------------------------------------------------------- /templates/treelist.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * Tree list 3 | * 4 | * Tree filelist template fragment 5 | * 6 | * @author Christopher Han 7 | * @copyright Copyright (c) 2010 Christopher Han 8 | * @package GitPHP 9 | * @subpackage Template 10 | *} 11 | 12 | {foreach from=$tree->GetContents() item=treeitem} 13 | 14 | {$treeitem->GetModeString()} 15 | {if $treeitem instanceof GitPHP_Blob} 16 | {$treeitem->GetSize()} 17 | 18 | 19 | {$treeitem->GetName()} 20 | 21 | 22 | {t}blob{/t} 23 | | 24 | {t}history{/t} 25 | | 26 | {t}plain{/t} 27 | 28 | {elseif $treeitem instanceof GitPHP_Tree} 29 | 30 | 31 | 32 | {$treeitem->GetName()} 33 | 34 | 35 | {t}tree{/t} 36 | | 37 | {t}history{/t} 38 | | 39 | {t}snapshot{/t} 40 | 41 | {/if} 42 | 43 | {/foreach} 44 | -------------------------------------------------------------------------------- /templates_c/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | -------------------------------------------------------------------------------- /test/ConfigTest.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Test 9 | */ 10 | class GitPHP_ConfigTest extends PHPUnit_Framework_TestCase 11 | { 12 | protected $config; 13 | 14 | protected function setUp() 15 | { 16 | $this->config = new GitPHP_Config(); 17 | } 18 | 19 | public function testDefaults() 20 | { 21 | $this->assertTrue($this->config->HasKey('locale')); 22 | $this->assertEquals('en_US', $this->config->GetValue('locale')); 23 | } 24 | 25 | public function testGetAndSet() 26 | { 27 | $this->assertFalse($this->config->HasKey('testkey')); 28 | $this->config->SetValue('testkey', 'testvalue'); 29 | $this->assertTrue($this->config->HasKey('testkey')); 30 | $this->assertEquals('testvalue', $this->config->GetValue('testkey')); 31 | $this->config->SetValue('testkey', null); 32 | $this->assertFalse($this->config->HasKey('testkey')); 33 | $this->assertNull($this->config->GetValue('testkey')); 34 | } 35 | 36 | public function testClear() 37 | { 38 | $this->config->SetValue('testkey2', 'testvalue'); 39 | $this->assertTrue($this->config->HasKey('testkey2')); 40 | $this->config->ClearConfig(); 41 | $this->assertFalse($this->config->HasKey('testkey2')); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /test/bootstrap.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Test\Git 9 | */ 10 | 11 | include_once('../include/helpers.php'); 12 | 13 | class GitPHP_GitObjectTest extends PHPUnit_Framework_TestCase 14 | { 15 | public function testHash() 16 | { 17 | $object = $this->getMockForAbstractClass('GitPHP_GitObject', array($this->getMockBuilder('GitPHP_Project')->disableOriginalConstructor()->getMock(), '1234567890abcdef1234567890ABCDEF12345678')); 18 | $this->assertEquals('1234567890abcdef1234567890ABCDEF12345678', $object->GetHash()); 19 | } 20 | 21 | public function testInvalidHash() 22 | { 23 | $this->setExpectedException('GitPHP_InvalidHashException'); 24 | 25 | $object = $this->getMockForAbstractClass('GitPHP_GitObject', array($this->getMockBuilder('GitPHP_Project')->disableOriginalConstructor()->getMock(), 'invalidhash')); 26 | } 27 | 28 | public function testAbbreviateHash() 29 | { 30 | $projectmock = $this->getMockBuilder('GitPHP_Project')->disableOriginalConstructor()->getMock(); 31 | $projectmock->expects($this->once())->method('AbbreviateHash')->with($this->equalTo('1234567890abcdef1234567890ABCDEF12345678'))->will($this->returnValue('12345678')); 32 | 33 | $object = $this->getMockForAbstractClass('GitPHP_GitObject', array($projectmock, '1234567890abcdef1234567890ABCDEF12345678')); 34 | 35 | $this->assertEquals('12345678', $object->GetHash(true)); 36 | $this->assertEquals('12345678', $object->GetHash(true)); //cached 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /test/git/blob/BlobLoad_GitTest.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Git\Test\Blob 9 | */ 10 | class GitPHP_BlobLoad_GitTest extends PHPUnit_Framework_TestCase 11 | { 12 | public function testLoad() 13 | { 14 | $projectmock = $this->getMockBuilder('GitPHP_Project')->disableOriginalConstructor()->getMock(); 15 | $projectmock->expects($this->any())->method('GetPath')->will($this->returnValue(GITPHP_TEST_PROJECTROOT . '/testrepo.git')); 16 | $exemock = $this->getMock('GitPHP_GitExe'); 17 | $exemock->expects($this->once())->method('Execute')->with($this->equalTo(GITPHP_TEST_PROJECTROOT . '/testrepo.git'), $this->equalTo('cat-file'))->will($this->returnValue("blob line 1\nblob line 2")); 18 | 19 | $blobmock = $this->getMockBuilder('GitPHP_Blob')->disableOriginalConstructor()->getMock(); 20 | $blobmock->expects($this->any())->method('GetProject')->will($this->returnValue($projectmock)); 21 | $blobmock->expects($this->any())->method('GetHash')->will($this->returnValue('1234567890abcdef1234567890ABCDEF12345678')); 22 | 23 | $strategy = new GitPHP_BlobLoad_Git($exemock); 24 | $this->assertEquals("blob line 1\nblob line 2", $strategy->Load($blobmock)); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/git/blob/BlobLoad_RawTest.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Copyright (c) 2012 Christopher Han 7 | * @package GitPHP 8 | * @subpackage Git\Test\Blob 9 | */ 10 | class GitPHP_BlobLoad_RawTest extends PHPUnit_Framework_TestCase 11 | { 12 | public function testLoad() 13 | { 14 | $blobmock = $this->getMockBuilder('GitPHP_Blob')->disableOriginalConstructor()->getMock(); 15 | $blobmock->expects($this->any())->method('GetHash')->will($this->returnValue('1234567890abcdef1234567890ABCDEF12345678')); 16 | $loadermock = $this->getMockBuilder('GitPHP_GitObjectLoader')->disableOriginalConstructor()->getMock(); 17 | $loadermock->expects($this->once())->method('GetObject')->with($this->equalTo('1234567890abcdef1234567890ABCDEF12345678'))->will($this->returnValue("blob line 1\nblob line 2")); 18 | $exemock = $this->getMock('GitPHP_GitExe'); 19 | 20 | $strategy = new GitPHP_BlobLoad_Raw($loadermock, $exemock); 21 | $this->assertEquals("blob line 1\nblob line 2", $strategy->Load($blobmock)); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /test/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /test/resources/externalrepo.git/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/master 2 | -------------------------------------------------------------------------------- /test/resources/testdir/.hiddentestfile: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /test/resources/testdir/testdir2/testdir4/testfile4.txt: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /test/resources/testdir/testdir2/testfile2.txt: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /test/resources/testdir/testdir3/testfile3.txt: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /test/resources/testdir/testfile1.txt: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /test/resources/testprojectroot/category/subrepo.git/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/master 2 | -------------------------------------------------------------------------------- /test/resources/testprojectroot/testrepo.git/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/master 2 | -------------------------------------------------------------------------------- /test/resources/testprojectroot/testrepo.git/description: -------------------------------------------------------------------------------- 1 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris tempus commodo libero, ut molestie est molestie vel. Proin molestie sodales elit bibendum aliquam. Vestibulum venenatis purus convallis tortor sodales vel scelerisque justo bibendum. Pellentesque egestas, sapien eu pulvinar suscipit, erat nisi mollis sapien, a lacinia urna lectus nec lectus. Fusce ornare diam a quam faucibus auctor aliquet nunc tincidunt. Sed massa tellus, feugiat eu iaculis id, blandit eget nisi. In suscipit commodo erat, et blandit nisl lacinia non. Sed quis tortor nisl. Phasellus egestas sapien nec elit tempor a tempor lectus tincidunt. 2 | -------------------------------------------------------------------------------- /test/resources/testprojectroot/testrepoexported.git/HEAD: -------------------------------------------------------------------------------- 1 | 1234567890abcdef1234567890ABCDEF12345678 2 | -------------------------------------------------------------------------------- /test/resources/testprojectroot/testrepoexported.git/git-daemon-export-ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpruvot/GitPHP/8d5347f2cad0f4f901dfe26c7025a2390df1e133/test/resources/testprojectroot/testrepoexported.git/git-daemon-export-ok -------------------------------------------------------------------------------- /util/jsheader.js: -------------------------------------------------------------------------------- 1 | /* 2 | * GitPHP 3 | * 4 | * @author Christopher Han 5 | * @copyright Copyright (c) 2012 Christopher Han 6 | * @package GitPHP 7 | * @subpackage Javascript 8 | */ 9 | -------------------------------------------------------------------------------- /util/msgfmt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # msgfmt.sh 4 | # 5 | # Recompiles binary MO files for all languages 6 | # 7 | # @author Christopher Han 8 | # @copyright Copyright (c) 2010 Christopher Han 9 | # @package GitPHP 10 | # @package util 11 | # 12 | 13 | LOCALEDIR="locale" 14 | BUNDLE="gitphp" 15 | 16 | for i in "$LOCALEDIR"/*; do 17 | if [ -d "$i" ]; then 18 | if [ -e "${i}/${BUNDLE}.po" ]; then 19 | echo "Building ${i}..." 20 | rm -f "${i}/${BUNDLE}.mo" 21 | msgfmt -v -o "${i}/${BUNDLE}.mo" "${i}/${BUNDLE}.po" 22 | fi 23 | fi 24 | done 25 | -------------------------------------------------------------------------------- /util/pack.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # pack.sh 4 | # 5 | # pack tarballs for release 6 | # 7 | # @author Christopher Han 8 | # @copyright Copyright (c) 2010 Christopher Han 9 | # @package GitPHP 10 | # @package util 11 | # 12 | 13 | STAGEDIR="staging" 14 | PKGDIR="gitphp" 15 | 16 | # Prepare the staging directory 17 | rm -Rf "${STAGEDIR}" 18 | mkdir -p "${STAGEDIR}" 19 | 20 | # Get a working snapshot of the HEAD 21 | git archive --format=tar --prefix=${PKGDIR}/ HEAD | tar -C "${STAGEDIR}" -xvf - 22 | 23 | # Get the version 24 | cd "${STAGEDIR}" 25 | VERSION="`cat ${PKGDIR}/include/version.php | grep '^\$gitphp_version = ' | cut -d '\"' -f 2`" 26 | 27 | if [ -z "${VERSION}" ]; then 28 | echo "Could not determine version" 29 | exit 1 30 | fi 31 | 32 | # Make the snapshot versioned 33 | PKGVERDIR="${PKGDIR}-${VERSION}" 34 | mv -v "${PKGDIR}" "${PKGVERDIR}" 35 | cd "${PKGVERDIR}" 36 | 37 | # Remove the gitignore files 38 | find . -iname '.gitignore' -exec rm {} ';' 39 | 40 | # Build the translations 41 | ./util/msgfmt.sh 42 | 43 | # Minify javascript 44 | ./util/minify.sh 45 | 46 | # Remove requirejs compressor after we've used it, no need to redistribute it 47 | rm -Rf lib/requirejs 48 | rm -Rf lib/closure 49 | rm -Rf lib/rhino 50 | 51 | # Remove the utility scripts 52 | rm -rf ./util 53 | 54 | # Remove test classes 55 | rm -rf ./test 56 | 57 | cd .. 58 | 59 | # Roll the tarballs 60 | rm -f ${PKGVERDIR}.zip 61 | rm -f ${PKGVERDIR}.tar.bz2 62 | rm -f ${PKGVERDIR}.tar.gz 63 | 64 | zip -r9 ${PKGVERDIR}.zip ${PKGVERDIR} 65 | tar -cf ${PKGVERDIR}.tar ${PKGVERDIR}/ 66 | bzip2 -kv9 ${PKGVERDIR}.tar 67 | gzip -v9 ${PKGVERDIR}.tar 68 | 69 | # Remove the working copy 70 | rm -rf ${PKGVERDIR} 71 | -------------------------------------------------------------------------------- /util/phpdoc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | GitPHP 4 | 5 | doc/code 6 | 7 | 8 | doc/code 9 | 10 | 11 | index.php 12 | include 13 | block.t.php 14 | 15 | 16 | -------------------------------------------------------------------------------- /util/xgettext.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # xgettext.sh 4 | # 5 | # extracts strings from various sources 6 | # into one pot file 7 | # 8 | # @author Christopher Han 9 | # @copyright Copyright (c) 2010 Christopher Han 10 | # @package GitPHP 11 | # @package util 12 | # 13 | 14 | VER="`cat include/version.php | grep '^\$gitphp_version = ' | cut -d '\"' -f 2`" 15 | DIR="locale" 16 | COPYRIGHT="Christopher Han" 17 | EMAIL="xiphux@gmail.com" 18 | PKGNAME="GitPHP" 19 | BUNDLE="gitphp" 20 | FILE="gitphp.pot" 21 | 22 | # Extract from templates 23 | lib/smarty-gettext/tsmarty2c.php templates > smarty.c 24 | xgettext -d ${BUNDLE} -o "${FILE}" -p ${DIR} -j --package-name="${PKGNAME}" --package-version="${VER}" --msgid-bugs-address="${EMAIL}" --copyright-holder="${COPYRIGHT}" --add-comments --no-location --from-code=utf-8 smarty.c 25 | rm smarty.c 26 | 27 | # Extract from include directory 28 | find include -iname '*.php' -type f | xgettext -k__ -k__n -ktranslate -kngettext -d ${BUNDLE} -o "${FILE}" -p ${DIR} -L PHP -j --package-name="${PKGNAME}" --package-version="${VER}" --msgid-bugs-address="${EMAIL}" --copyright-holder="${COPYRIGHT}" --from-code=utf-8 -f - 29 | 30 | # Extract from index 31 | xgettext -k__ -k__n -ktranslate -kngettext -d ${BUNDLE} -o "${FILE}" -p ${DIR} -L PHP -j --package-name="${PKGNAME}" --package-version="${VER}" --msgid-bugs-address="${EMAIL}" --copyright-holder="${COPYRIGHT}" --from-code=utf-8 index.php 32 | 33 | # File references from smarty-gettext show up as code comments, 34 | # convert them back to file references 35 | sed -e 's/^#\./#:/' -i "${DIR}/${FILE}" 36 | --------------------------------------------------------------------------------