├── .codecov.yml ├── .editorconfig ├── .github ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── release-phar.yml │ └── tests.yml ├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE.txt ├── Makefile ├── README.md ├── bootstrap ├── autoload.php └── phpstan.php ├── box.json ├── codeception.yml ├── composer.json ├── composer.lock ├── docker-compose.yml ├── docker ├── mysql │ └── my.cnf ├── nginx │ ├── conf.d │ │ └── default.conf │ ├── fastcgi-php.conf │ └── fastcgi.conf └── php │ ├── Dockerfile │ └── mods │ ├── phalcon.ini │ └── psr.ini ├── dummy └── .gitignore ├── phalcon ├── phalcon-completion.bash ├── phalcon.bat ├── phalcon.sh ├── phpcs.xml.dist ├── phpstan.neon ├── psalm.xml ├── resources ├── admin-lte │ ├── css │ │ └── adminlte.min.css │ ├── js │ │ └── adminlte.min.js │ └── plugins │ │ ├── bootstrap │ │ └── js │ │ │ ├── bootstrap.bundle.js │ │ │ ├── bootstrap.bundle.js.map │ │ │ ├── bootstrap.bundle.min.js │ │ │ ├── bootstrap.bundle.min.js.map │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.js.map │ │ │ ├── bootstrap.min.js │ │ │ └── bootstrap.min.js.map │ │ ├── fontawesome-free │ │ ├── css │ │ │ ├── all.css │ │ │ ├── all.min.css │ │ │ ├── brands.css │ │ │ ├── brands.min.css │ │ │ ├── fontawesome.css │ │ │ ├── fontawesome.min.css │ │ │ ├── regular.css │ │ │ ├── regular.min.css │ │ │ ├── solid.css │ │ │ ├── solid.min.css │ │ │ ├── svg-with-js.css │ │ │ ├── svg-with-js.min.css │ │ │ ├── v4-shims.css │ │ │ └── v4-shims.min.css │ │ └── webfonts │ │ │ ├── fa-brands-400.eot │ │ │ ├── fa-brands-400.svg │ │ │ ├── fa-brands-400.ttf │ │ │ ├── fa-brands-400.woff │ │ │ ├── fa-brands-400.woff2 │ │ │ ├── fa-regular-400.eot │ │ │ ├── fa-regular-400.svg │ │ │ ├── fa-regular-400.ttf │ │ │ ├── fa-regular-400.woff │ │ │ ├── fa-regular-400.woff2 │ │ │ ├── fa-solid-900.eot │ │ │ ├── fa-solid-900.svg │ │ │ ├── fa-solid-900.ttf │ │ │ ├── fa-solid-900.woff │ │ │ └── fa-solid-900.woff2 │ │ ├── jquery-ui │ │ ├── AUTHORS.txt │ │ ├── LICENSE.txt │ │ ├── external │ │ │ └── jquery │ │ │ │ └── jquery.js │ │ ├── images │ │ │ ├── ui-icons_444444_256x240.png │ │ │ ├── ui-icons_555555_256x240.png │ │ │ ├── ui-icons_777620_256x240.png │ │ │ ├── ui-icons_777777_256x240.png │ │ │ ├── ui-icons_cc0000_256x240.png │ │ │ └── ui-icons_ffffff_256x240.png │ │ ├── jquery-ui.css │ │ ├── jquery-ui.js │ │ ├── jquery-ui.min.css │ │ ├── jquery-ui.min.js │ │ ├── jquery-ui.structure.css │ │ ├── jquery-ui.structure.min.css │ │ ├── jquery-ui.theme.css │ │ └── jquery-ui.theme.min.css │ │ ├── jquery │ │ ├── core.js │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ ├── jquery.min.map │ │ ├── jquery.slim.js │ │ ├── jquery.slim.min.js │ │ └── jquery.slim.min.map │ │ └── overlayScrollbars │ │ ├── css │ │ ├── OverlayScrollbars.css │ │ └── OverlayScrollbars.min.css │ │ └── js │ │ ├── OverlayScrollbars.js │ │ ├── OverlayScrollbars.min.js │ │ ├── jquery.overlayScrollbars.js │ │ └── jquery.overlayScrollbars.min.js ├── codemirror │ ├── LICENSE │ ├── README.md │ ├── addon │ │ ├── comment │ │ │ ├── comment.js │ │ │ └── continuecomment.js │ │ ├── dialog │ │ │ ├── dialog.css │ │ │ └── dialog.js │ │ ├── display │ │ │ ├── fullscreen.css │ │ │ ├── fullscreen.js │ │ │ ├── panel.js │ │ │ ├── placeholder.js │ │ │ └── rulers.js │ │ ├── edit │ │ │ ├── closebrackets.js │ │ │ ├── closetag.js │ │ │ ├── continuelist.js │ │ │ ├── matchbrackets.js │ │ │ ├── matchtags.js │ │ │ └── trailingspace.js │ │ ├── fold │ │ │ ├── brace-fold.js │ │ │ ├── comment-fold.js │ │ │ ├── foldcode.js │ │ │ ├── foldgutter.css │ │ │ ├── foldgutter.js │ │ │ ├── indent-fold.js │ │ │ ├── markdown-fold.js │ │ │ └── xml-fold.js │ │ ├── hint │ │ │ ├── anyword-hint.js │ │ │ ├── css-hint.js │ │ │ ├── html-hint.js │ │ │ ├── javascript-hint.js │ │ │ ├── show-hint.css │ │ │ ├── show-hint.js │ │ │ ├── sql-hint.js │ │ │ └── xml-hint.js │ │ ├── lint │ │ │ ├── coffeescript-lint.js │ │ │ ├── css-lint.js │ │ │ ├── javascript-lint.js │ │ │ ├── json-lint.js │ │ │ ├── lint.css │ │ │ ├── lint.js │ │ │ └── yaml-lint.js │ │ ├── merge │ │ │ ├── merge.css │ │ │ └── merge.js │ │ ├── mode │ │ │ ├── loadmode.js │ │ │ ├── multiplex.js │ │ │ ├── multiplex_test.js │ │ │ ├── overlay.js │ │ │ └── simple.js │ │ ├── runmode │ │ │ ├── colorize.js │ │ │ ├── runmode-standalone.js │ │ │ ├── runmode.js │ │ │ └── runmode.node.js │ │ ├── scroll │ │ │ ├── annotatescrollbar.js │ │ │ ├── scrollpastend.js │ │ │ ├── simplescrollbars.css │ │ │ └── simplescrollbars.js │ │ ├── search │ │ │ ├── match-highlighter.js │ │ │ ├── matchesonscrollbar.css │ │ │ ├── matchesonscrollbar.js │ │ │ ├── search.js │ │ │ └── searchcursor.js │ │ ├── selection │ │ │ ├── active-line.js │ │ │ ├── mark-selection.js │ │ │ └── selection-pointer.js │ │ ├── tern │ │ │ ├── tern.css │ │ │ ├── tern.js │ │ │ └── worker.js │ │ └── wrap │ │ │ └── hardwrap.js │ ├── keymap │ │ ├── emacs.js │ │ ├── sublime.js │ │ └── vim.js │ ├── lib │ │ ├── codemirror.css │ │ ├── codemirror.js │ │ ├── codephalcon.css │ │ └── codephalcon.js │ ├── mode │ │ ├── apl │ │ │ ├── apl.js │ │ │ └── index.html │ │ ├── asciiarmor │ │ │ ├── asciiarmor.js │ │ │ └── index.html │ │ ├── asn.1 │ │ │ ├── asn.1.js │ │ │ └── index.html │ │ ├── asterisk │ │ │ ├── asterisk.js │ │ │ └── index.html │ │ ├── clike │ │ │ ├── clike.js │ │ │ ├── index.html │ │ │ └── scala.html │ │ ├── clojure │ │ │ ├── clojure.js │ │ │ └── index.html │ │ ├── cmake │ │ │ ├── cmake.js │ │ │ └── index.html │ │ ├── cobol │ │ │ ├── cobol.js │ │ │ └── index.html │ │ ├── coffeescript │ │ │ ├── coffeescript.js │ │ │ └── index.html │ │ ├── commonlisp │ │ │ ├── commonlisp.js │ │ │ └── index.html │ │ ├── css │ │ │ ├── css.js │ │ │ ├── index.html │ │ │ ├── less.html │ │ │ ├── less_test.js │ │ │ ├── scss.html │ │ │ ├── scss_test.js │ │ │ └── test.js │ │ ├── cypher │ │ │ ├── cypher.js │ │ │ └── index.html │ │ ├── d │ │ │ ├── d.js │ │ │ └── index.html │ │ ├── dart │ │ │ ├── dart.js │ │ │ └── index.html │ │ ├── diff │ │ │ ├── diff.js │ │ │ └── index.html │ │ ├── django │ │ │ ├── django.js │ │ │ └── index.html │ │ ├── dockerfile │ │ │ ├── dockerfile.js │ │ │ └── index.html │ │ ├── dtd │ │ │ ├── dtd.js │ │ │ └── index.html │ │ ├── dylan │ │ │ ├── dylan.js │ │ │ └── index.html │ │ ├── ebnf │ │ │ ├── ebnf.js │ │ │ └── index.html │ │ ├── ecl │ │ │ ├── ecl.js │ │ │ └── index.html │ │ ├── eiffel │ │ │ ├── eiffel.js │ │ │ └── index.html │ │ ├── erlang │ │ │ ├── erlang.js │ │ │ └── index.html │ │ ├── forth │ │ │ ├── forth.js │ │ │ └── index.html │ │ ├── fortran │ │ │ ├── fortran.js │ │ │ └── index.html │ │ ├── gas │ │ │ ├── gas.js │ │ │ └── index.html │ │ ├── gfm │ │ │ ├── gfm.js │ │ │ ├── index.html │ │ │ └── test.js │ │ ├── gherkin │ │ │ ├── gherkin.js │ │ │ └── index.html │ │ ├── go │ │ │ ├── go.js │ │ │ └── index.html │ │ ├── groovy │ │ │ ├── groovy.js │ │ │ └── index.html │ │ ├── haml │ │ │ ├── haml.js │ │ │ ├── index.html │ │ │ └── test.js │ │ ├── handlebars │ │ │ ├── handlebars.js │ │ │ └── index.html │ │ ├── haskell │ │ │ ├── haskell.js │ │ │ └── index.html │ │ ├── haxe │ │ │ ├── haxe.js │ │ │ └── index.html │ │ ├── htmlembedded │ │ │ ├── htmlembedded.js │ │ │ └── index.html │ │ ├── htmlmixed │ │ │ ├── htmlmixed.js │ │ │ └── index.html │ │ ├── http │ │ │ ├── http.js │ │ │ └── index.html │ │ ├── idl │ │ │ ├── idl.js │ │ │ └── index.html │ │ ├── jade │ │ │ ├── index.html │ │ │ └── jade.js │ │ ├── javascript │ │ │ ├── index.html │ │ │ ├── javascript.js │ │ │ ├── json-ld.html │ │ │ ├── test.js │ │ │ └── typescript.html │ │ ├── jinja2 │ │ │ ├── index.html │ │ │ └── jinja2.js │ │ ├── julia │ │ │ ├── index.html │ │ │ └── julia.js │ │ ├── kotlin │ │ │ ├── index.html │ │ │ └── kotlin.js │ │ ├── livescript │ │ │ ├── index.html │ │ │ └── livescript.js │ │ ├── lua │ │ │ ├── index.html │ │ │ └── lua.js │ │ ├── markdown │ │ │ ├── index.html │ │ │ ├── markdown.js │ │ │ └── test.js │ │ ├── mirc │ │ │ ├── index.html │ │ │ └── mirc.js │ │ ├── mllike │ │ │ ├── index.html │ │ │ └── mllike.js │ │ ├── modelica │ │ │ ├── index.html │ │ │ └── modelica.js │ │ ├── mumps │ │ │ ├── index.html │ │ │ └── mumps.js │ │ ├── nginx │ │ │ ├── index.html │ │ │ └── nginx.js │ │ ├── ntriples │ │ │ ├── index.html │ │ │ └── ntriples.js │ │ ├── octave │ │ │ ├── index.html │ │ │ └── octave.js │ │ ├── pascal │ │ │ ├── index.html │ │ │ └── pascal.js │ │ ├── pegjs │ │ │ ├── index.html │ │ │ └── pegjs.js │ │ ├── perl │ │ │ ├── index.html │ │ │ └── perl.js │ │ ├── php │ │ │ ├── index.html │ │ │ ├── php.js │ │ │ └── test.js │ │ ├── pig │ │ │ ├── index.html │ │ │ └── pig.js │ │ ├── properties │ │ │ ├── index.html │ │ │ └── properties.js │ │ ├── puppet │ │ │ ├── index.html │ │ │ └── puppet.js │ │ ├── python │ │ │ ├── index.html │ │ │ └── python.js │ │ ├── q │ │ │ ├── index.html │ │ │ └── q.js │ │ ├── r │ │ │ ├── index.html │ │ │ └── r.js │ │ ├── rpm │ │ │ ├── changes │ │ │ │ └── index.html │ │ │ ├── index.html │ │ │ └── rpm.js │ │ ├── rst │ │ │ ├── index.html │ │ │ └── rst.js │ │ ├── ruby │ │ │ ├── index.html │ │ │ ├── ruby.js │ │ │ └── test.js │ │ ├── rust │ │ │ ├── index.html │ │ │ └── rust.js │ │ ├── sass │ │ │ ├── index.html │ │ │ └── sass.js │ │ ├── scheme │ │ │ ├── index.html │ │ │ └── scheme.js │ │ ├── shell │ │ │ ├── index.html │ │ │ ├── shell.js │ │ │ └── test.js │ │ ├── sieve │ │ │ ├── index.html │ │ │ └── sieve.js │ │ ├── slim │ │ │ ├── index.html │ │ │ ├── slim.js │ │ │ └── test.js │ │ ├── smalltalk │ │ │ ├── index.html │ │ │ └── smalltalk.js │ │ ├── smarty │ │ │ ├── index.html │ │ │ └── smarty.js │ │ ├── solr │ │ │ ├── index.html │ │ │ └── solr.js │ │ ├── soy │ │ │ ├── index.html │ │ │ └── soy.js │ │ ├── sparql │ │ │ ├── index.html │ │ │ └── sparql.js │ │ ├── spreadsheet │ │ │ ├── index.html │ │ │ └── spreadsheet.js │ │ ├── sql │ │ │ ├── index.html │ │ │ └── sql.js │ │ ├── stex │ │ │ ├── index.html │ │ │ ├── stex.js │ │ │ └── test.js │ │ ├── stylus │ │ │ ├── index.html │ │ │ └── stylus.js │ │ ├── tcl │ │ │ ├── index.html │ │ │ └── tcl.js │ │ ├── textile │ │ │ ├── index.html │ │ │ ├── test.js │ │ │ └── textile.js │ │ ├── tiddlywiki │ │ │ ├── index.html │ │ │ ├── tiddlywiki.css │ │ │ └── tiddlywiki.js │ │ ├── tiki │ │ │ ├── index.html │ │ │ ├── tiki.css │ │ │ └── tiki.js │ │ ├── toml │ │ │ ├── index.html │ │ │ └── toml.js │ │ ├── tornado │ │ │ ├── index.html │ │ │ └── tornado.js │ │ ├── troff │ │ │ ├── index.html │ │ │ └── troff.js │ │ ├── ttcn-cfg │ │ │ ├── index.html │ │ │ └── ttcn-cfg.js │ │ ├── ttcn │ │ │ ├── index.html │ │ │ └── ttcn.js │ │ ├── turtle │ │ │ ├── index.html │ │ │ └── turtle.js │ │ ├── vb │ │ │ ├── index.html │ │ │ └── vb.js │ │ ├── vbscript │ │ │ ├── index.html │ │ │ └── vbscript.js │ │ ├── velocity │ │ │ ├── index.html │ │ │ └── velocity.js │ │ ├── verilog │ │ │ ├── index.html │ │ │ ├── test.js │ │ │ └── verilog.js │ │ ├── xml │ │ │ ├── index.html │ │ │ ├── test.js │ │ │ └── xml.js │ │ ├── xquery │ │ │ ├── index.html │ │ │ ├── test.js │ │ │ └── xquery.js │ │ ├── yaml │ │ │ ├── index.html │ │ │ └── yaml.js │ │ └── z80 │ │ │ ├── index.html │ │ │ └── z80.js │ └── theme │ │ ├── 3024-day.css │ │ ├── 3024-night.css │ │ ├── ambiance-mobile.css │ │ ├── ambiance.css │ │ ├── base16-dark.css │ │ ├── base16-light.css │ │ ├── blackboard.css │ │ ├── cobalt.css │ │ ├── colorforth.css │ │ ├── eclipse.css │ │ ├── elegant.css │ │ ├── erlang-dark.css │ │ ├── lesser-dark.css │ │ ├── liquibyte.css │ │ ├── mbo.css │ │ ├── mdn-like.css │ │ ├── midnight.css │ │ ├── monokai.css │ │ ├── neat.css │ │ ├── neo.css │ │ ├── night.css │ │ ├── paraiso-dark.css │ │ ├── paraiso-light.css │ │ ├── pastel-on-dark.css │ │ ├── rubyblue.css │ │ ├── solarized.css │ │ ├── the-matrix.css │ │ ├── tomorrow-night-bright.css │ │ ├── tomorrow-night-eighties.css │ │ ├── ttcn.css │ │ ├── twilight.css │ │ ├── vibrant-ink.css │ │ ├── xq-dark.css │ │ ├── xq-light.css │ │ └── zenburn.css └── js │ └── webtools.js ├── src ├── Access │ ├── Manager.php │ ├── Policy │ │ └── Ip.php │ └── PolicyInterface.php ├── Bootstrap.php ├── Builder │ ├── Component │ │ ├── AbstractComponent.php │ │ ├── AllModels.php │ │ ├── Controller.php │ │ ├── Model.php │ │ ├── Module.php │ │ ├── Project.php │ │ └── Scaffold.php │ ├── Exception │ │ └── BuilderException.php │ ├── Path.php │ └── Project │ │ ├── Cli.php │ │ ├── Micro.php │ │ ├── Modules.php │ │ ├── ProjectAware.php │ │ ├── ProjectBuilder.php │ │ └── Simple.php ├── Commands │ ├── Builtin │ │ ├── AllModels.php │ │ ├── Console.php │ │ ├── Controller.php │ │ ├── Enumerate.php │ │ ├── Info.php │ │ ├── Migration.php │ │ ├── Model.php │ │ ├── Module.php │ │ ├── Project.php │ │ ├── Scaffold.php │ │ ├── Serve.php │ │ └── Webtools.php │ ├── Command.php │ ├── CommandsException.php │ ├── CommandsInterface.php │ ├── CommandsListener.php │ ├── DotPhalconMissingException.php │ └── ISelfHealingException.php ├── Error │ ├── AppError.php │ └── ErrorHandler.php ├── Exception │ ├── InvalidArgumentException.php │ ├── InvalidParameterException.php │ ├── ProviderException.php │ ├── ReadOnlyParameterException.php │ ├── RuntimeException.php │ └── WriteFileException.php ├── FactoryOptions.php ├── Generator │ └── Snippet.php ├── Mvc │ ├── Controller │ │ ├── Base.php │ │ └── CodemirrorTrait.php │ ├── Dispatcher │ │ └── ErrorHandler.php │ └── View │ │ ├── Engine │ │ └── Volt │ │ │ └── Extension │ │ │ └── Php.php │ │ └── NotFoundListener.php ├── Options │ └── OptionsAware.php ├── Providers │ ├── AccessManagerProvider.php │ ├── AnnotationsProvider.php │ ├── AssetsProvider.php │ ├── AssetsResourceProvider.php │ ├── ConfigProvider.php │ ├── DataCacheProvider.php │ ├── DatabaseProvider.php │ ├── DbUtilsProvider.php │ ├── DispatcherProvider.php │ ├── EventsManagerProvider.php │ ├── FileSystemProvider.php │ ├── FlashSessionProvider.php │ ├── LoggerProvider.php │ ├── ModelsCacheProvider.php │ ├── RegistryProvider.php │ ├── RouterProvider.php │ ├── SessionProvider.php │ ├── SystemInfoProvider.php │ ├── TagProvider.php │ ├── UrlProvider.php │ ├── ViewCacheProvider.php │ ├── ViewProvider.php │ └── VoltProvider.php ├── Resources │ └── AssetsResource.php ├── Scanners │ └── Config.php ├── Script.php ├── Script │ ├── Color.php │ └── ScriptException.php ├── Utils.php ├── Utils │ ├── DbUtils.php │ ├── FsUtils.php │ └── SystemInfo.php ├── Validation │ └── Validator │ │ └── Namespaces.php ├── Version.php └── Web │ ├── Tools.php │ └── Tools │ ├── Controllers │ ├── ControllersController.php │ ├── ErrorController.php │ ├── IndexController.php │ ├── MigrationsController.php │ ├── ModelsController.php │ ├── ScaffoldController.php │ └── SystemInfoController.php │ └── Views │ ├── controllers │ ├── edit.volt │ ├── generate.volt │ ├── index.volt │ └── view.volt │ ├── error │ ├── route400.volt │ ├── route403.volt │ ├── route404.volt │ └── route500.volt │ ├── index │ └── index.volt │ ├── layouts │ ├── base.volt │ ├── error.volt │ └── webtools.volt │ ├── migrations │ ├── generate.volt │ ├── index.volt │ └── run.volt │ ├── models │ ├── edit.volt │ ├── generate.volt │ ├── index.volt │ └── view.volt │ ├── partials │ ├── content.volt │ ├── content_header.volt │ ├── custom_css.volt │ ├── error.volt │ ├── footer.volt │ ├── header.volt │ ├── inputs.volt │ └── sidebar.volt │ ├── scaffold │ └── generate.volt │ └── system_info │ └── index.volt ├── templates ├── .htrouter.php ├── module │ ├── Module.php │ ├── config.ini │ ├── config.json │ ├── config.php │ ├── config.yaml │ └── variables.json ├── project │ ├── cli │ │ ├── MainTask.php │ │ ├── VersionTask.php │ │ ├── bootstrap.php │ │ ├── config.ini │ │ ├── config.php │ │ ├── launcher │ │ ├── launcher.bat │ │ ├── loader.php │ │ └── services.php │ ├── micro │ │ ├── app.php │ │ ├── config.ini │ │ ├── config.php │ │ ├── htaccess │ │ ├── index.php │ │ ├── loader.php │ │ ├── services.php │ │ ├── variables.json │ │ └── views │ │ │ ├── 404.phtml │ │ │ ├── 404.volt │ │ │ ├── index.phtml │ │ │ └── index.volt │ ├── modules │ │ ├── ControllerBase.php │ │ ├── MainTask.php │ │ ├── Module_cli.php │ │ ├── Module_web.php │ │ ├── VersionTask.php │ │ ├── bootstrap_cli.php │ │ ├── bootstrap_web.php │ │ ├── config.ini │ │ ├── config.php │ │ ├── htaccess │ │ ├── index.php │ │ ├── launcher │ │ ├── launcher.bat │ │ ├── loader.php │ │ ├── routes.php │ │ ├── services.php │ │ ├── services_cli.php │ │ ├── services_web.php │ │ ├── variables.json │ │ └── views │ │ │ ├── index.phtml │ │ │ ├── index.volt │ │ │ └── index │ │ │ ├── index.phtml │ │ │ └── index.volt │ └── simple │ │ ├── ControllerBase.php │ │ ├── config.ini │ │ ├── config.php │ │ ├── htaccess │ │ ├── index.php │ │ ├── loader.php │ │ ├── router.php │ │ ├── services.php │ │ ├── variables.json │ │ └── views │ │ ├── index.phtml │ │ ├── index.volt │ │ └── index │ │ ├── index.phtml │ │ └── index.volt ├── scaffold │ └── no-forms │ │ ├── Controller.php │ │ └── views │ │ ├── edit.phtml │ │ ├── edit.volt │ │ ├── index.phtml │ │ ├── index.volt │ │ ├── new.phtml │ │ ├── new.volt │ │ ├── search.phtml │ │ └── search.volt └── webtools.config.php ├── tests ├── .env.test ├── _bootstrap.php ├── _ci │ ├── setup_dbs.sh │ └── setup_dbs_github.sh ├── _data │ ├── .gitkeep │ ├── acceptance │ │ ├── mysql │ │ │ └── config.php │ │ └── pgsql │ │ │ └── config.php │ ├── console │ │ ├── .phalcon │ │ │ └── .gitignore │ │ └── app │ │ │ ├── controllers │ │ │ └── .gitkeep │ │ │ ├── models │ │ │ └── files │ │ │ │ ├── TestModel.php │ │ │ │ ├── TestModel2.php │ │ │ │ ├── TestModel3.php │ │ │ │ ├── TestModel5.php │ │ │ │ └── Testmodel4.php │ │ │ ├── mysql │ │ │ └── config.php │ │ │ ├── postgresql │ │ │ └── config.php │ │ │ ├── projects │ │ │ └── .gitignore │ │ │ └── views │ │ │ └── .gitkeep │ ├── fixtures │ │ └── Traits │ │ │ └── DiTrait.php │ └── schemas │ │ ├── mysql │ │ └── dump.sql │ │ └── postgresql │ │ └── dump.sql ├── _envs │ ├── mysql.yml │ └── pgsql.yml ├── _output │ └── .gitignore ├── _support │ ├── AcceptanceTester.php │ ├── ConsoleTester.php │ ├── FunctionalTester.php │ ├── Helper │ │ ├── Acceptance.php │ │ ├── Console.php │ │ ├── Functional.php │ │ └── Unit.php │ ├── Module │ │ └── UnitTest.php │ ├── UnitTester.php │ ├── _generated │ │ └── .gitignore │ └── helpers.php ├── acceptance.suite.yml ├── acceptance │ └── Web │ │ ├── Template │ │ ├── ScaffoldPhtmlCest.php │ │ └── ScaffoldVoltCest.php │ │ └── Tools │ │ └── Controllers │ │ ├── ControllersControllerCest.php │ │ ├── ErrorControllerCest.php │ │ ├── IndexControllerCest.php │ │ ├── MigrationsControllerCest.php │ │ ├── ModelsControllerCest.php │ │ ├── ScaffoldControllerCest.php │ │ └── SystemInfoControllerCest.php ├── console.suite.yml ├── console │ ├── GenerateMultyModelsCept.php │ ├── GenerateProjectCept.php │ ├── GenerateScaffoldCept.php │ ├── GenerateSingleModelCept.php │ └── _bootstrap.php ├── functional.suite.yml ├── functional │ ├── Commands │ │ └── Builtin │ │ │ └── ServeTest.php │ └── _bootstrap.php ├── shim.php ├── unit.suite.yml └── unit │ ├── Access │ ├── ManagerTest.php │ └── Policy │ │ └── IpTest.php │ ├── BootstrapTest.php │ ├── Builder │ ├── Component │ │ ├── AllModelsTest.php │ │ ├── ControllerTest.php │ │ ├── ModelTest.php │ │ ├── ModuleTest.php │ │ ├── ProjectTest.php │ │ └── ScaffoldTest.php │ └── Project │ │ ├── CliTest.php │ │ ├── MicroTest.php │ │ ├── ModulesTest.php │ │ └── SimpleTest.php │ ├── Generator │ └── SnippetTest.php │ ├── Providers │ ├── AccessManagerProviderTest.php │ ├── AnnotationsProviderTest.php │ ├── AssetsProviderTest.php │ ├── AssetsResourceProviderTest.php │ ├── ConfigProviderTest.php │ ├── DataCacheProviderTest.php │ ├── DatabaseProviderTest.php │ ├── DbUtilsProviderTest.php │ ├── DispatcherProviderTest.php │ ├── EventsManagerProviderTest.php │ ├── FileSystemProviderTest.php │ ├── FlashSessionProviderTest.php │ ├── LoggerProviderTest.php │ ├── ModelsCacheProviderTest.php │ ├── RegistryProviderTest.php │ ├── RouterProviderTest.php │ ├── SessionProviderTest.php │ ├── SystemInfoProviderTest.php │ ├── TagProviderTest.php │ ├── UrlProviderTest.php │ ├── ViewCacheProviderTest.php │ ├── ViewProviderTest.php │ └── VoltProviderTest.php │ ├── UtilsTest.php │ └── _bootstrap.php └── webtools.php /.codecov.yml: -------------------------------------------------------------------------------- 1 | codecov: 2 | notify: 3 | require_ci_to_pass: yes 4 | 5 | coverage: 6 | precision: 2 7 | round: down 8 | range: "65...90" 9 | 10 | status: 11 | project: 12 | default: 13 | # Allow the coverage to drop by threshold %, and posting a success status. 14 | threshold: 0.5 15 | patch: 16 | default: 17 | # trial operation 18 | target: 0% 19 | changes: no 20 | 21 | comment: 22 | layout: "header, diff" 23 | behavior: default 24 | require_changes: no 25 | 26 | ignore: 27 | - ".git" 28 | - "*.yml" 29 | - "*.json" 30 | - "*.md" 31 | - "*.dist" 32 | - "*.txt" 33 | - "*.bat" 34 | # ignore folders and all its contents 35 | - ".ci/.*" 36 | - ".github/.*" 37 | - ".phalcon/.*" 38 | - "ide/.*" 39 | - "bootstrap/.*" 40 | - "resources/.*" 41 | - "templates/.*" 42 | - "tests/.*" 43 | - "vendor/.*" 44 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | [*] 7 | charset = utf-8 8 | indent_style = space 9 | indent_size = 4 10 | end_of_line = lf 11 | insert_final_newline = true 12 | trim_trailing_whitespace = true 13 | 14 | [*.md] 15 | trim_trailing_whitespace = false 16 | 17 | [*.sh] 18 | indent_style = tab 19 | 20 | [*.yml] 21 | indent_size = 2 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | > Questions should go to https://forum.phalcon.io 2 | > Documentation issues should go to https://github.com/phalcon/docs/issues 3 | 4 | ### Expected and Actual Behavior 5 | 6 | > **Describe what you are trying to achieve and what goes wrong.** 7 | 8 | > Provide output if related 9 | 10 | ```php 11 | // paste output here 12 | ``` 13 | > Provide minimal script to reproduce the issue 14 | 15 | ```php 16 | // paste code 17 | ``` 18 | 19 | ### Details 20 | 21 | * System info and versions (if possible): (`phalcon info`) 22 | * Phalcon Framework version: (`php --ri phalcon`) 23 | * PHP Version: (`php -v`) 24 | * Operating System: 25 | * Server: Nginx | Apache | Other 26 | * Other related info (Database, table schema): 27 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Hello! 2 | 3 | * Type: bug fix | new feature | code quality | documentation 4 | * Link to issue: 5 | 6 | **In raising this pull request, I confirm the following (please check boxes):** 7 | 8 | - [ ] I have read and understood the [Contributing Guidelines][:contrib:] 9 | - [ ] I have checked that another pull request for this purpose does not exist 10 | - [ ] I wrote some tests for this PR 11 | 12 | Small description of change: 13 | 14 | Thanks 15 | 16 | [:contrib:]: https://github.com/phalcon/phalcon-devtools/blob/master/CONTRIBUTING.md 17 | -------------------------------------------------------------------------------- /.github/workflows/release-phar.yml: -------------------------------------------------------------------------------- 1 | on: 2 | release: 3 | types: 4 | - created 5 | 6 | name: Append phalcon.phar to release 7 | 8 | jobs: 9 | build: 10 | name: Compile and upload Phar 11 | runs-on: ubuntu-18.04 12 | steps: 13 | - name: Checkout code 14 | uses: actions/checkout@v2 15 | 16 | - name: Set PHP 7.2 17 | uses: shivammathur/setup-php@v2 18 | with: 19 | php-version: '7.2' 20 | extensions: phalcon-4.0.5 21 | 22 | - name: Compile phalcon.phar 23 | run: | 24 | composer install 25 | wget https://github.com/box-project/box/releases/download/3.9.1/box.phar 26 | php box.phar compile 27 | 28 | - name: Check existence of compiled .phar 29 | run: test -e phalcon.phar && exit 0 || exit 10 30 | 31 | - name: Upload to Release 32 | uses: actions/upload-release-asset@v1 33 | env: 34 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 35 | with: 36 | upload_url: ${{ github.event.release.upload_url }} 37 | asset_path: ./phalcon.phar 38 | asset_name: phalcon.phar 39 | asset_content_type: application/octet-stream 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Please do not use this ignore file to define platform specific files. 2 | # 3 | # For these purposes create a global .gitignore file, which is a list of rules 4 | # for ignoring files in every Git repository on your computer. 5 | # 6 | # https://help.github.com/articles/ignoring-files/#create-a-global-gitignore 7 | 8 | /vendor 9 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | New BSD License 2 | 3 | Copyright (c) 2011-2017, Phalcon Framework Team 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | * Neither the name of the Phalcon nor the 14 | names of its contributors may be used to endorse or promote products 15 | derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL PHALCON FRAMEWORK TEAM BE LIABLE FOR ANY 21 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: build composer-install 2 | 3 | build: 4 | @docker-compose build 5 | @docker-compose up -d 6 | composer-install: 7 | @docker-compose exec -T service_php composer install 8 | clean: 9 | @docker-compose down 10 | @docker system prune -af 11 | @docker volume prune -f 12 | 13 | help: 14 | @docker-compose exec -T service_php phalcon --help 15 | create-dummy: 16 | @docker-compose exec -T service_php phalcon create-project dummy --enable-webtools --force 17 | -------------------------------------------------------------------------------- /bootstrap/phpstan.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view 9 | * the LICENSE file that was distributed with this source code. 10 | */ 11 | 12 | include dirname(dirname(__FILE__)) . '/bootstrap/autoload.php'; 13 | include dirname(dirname(__FILE__)) . '/templates/webtools.config.php'; 14 | -------------------------------------------------------------------------------- /box.json: -------------------------------------------------------------------------------- 1 | { 2 | "force-autodiscovery": true, 3 | "directories": [ 4 | "bootstrap", 5 | "resources", 6 | "src", 7 | "templates" 8 | ], 9 | "files": [ 10 | "webtools.php", 11 | "LICENSE.txt" 12 | ], 13 | "finder": [ 14 | { 15 | "in": "resources", 16 | "name": "*.*" 17 | }, 18 | { 19 | "in": "src", 20 | "name": "*.*" 21 | }, 22 | { 23 | "in": "templates", 24 | "ignoreDotFiles": false, 25 | "name": [ 26 | "*.*", 27 | ".htrouter.php" 28 | ] 29 | } 30 | ], 31 | "git-version": "git_tag", 32 | "compression": "GZ", 33 | "compactors": [ 34 | "KevinGH\\Box\\Compactor\\Php" 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /codeception.yml: -------------------------------------------------------------------------------- 1 | paths: 2 | tests: tests 3 | output: tests/_output 4 | data: tests/_data 5 | support: tests/_support 6 | envs: tests/_envs 7 | bootstrap: _bootstrap.php 8 | settings: 9 | colors: true 10 | # Tests (especially functional) can take a lot of memory 11 | # We set a high limit for them by default. 12 | memory_limit: 1024M 13 | actor_suffix: Tester 14 | extensions: 15 | enabled: 16 | - Codeception\Extension\RunFailed 17 | coverage: 18 | enabled: true 19 | include: 20 | - src/* 21 | # Get params from .env file 22 | params: 23 | - tests/.env.test 24 | -------------------------------------------------------------------------------- /docker/mysql/my.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" 3 | max_connections = 500 4 | max_allowed_packet = 32mb 5 | skip-host-cache 6 | skip-name-resolve 7 | -------------------------------------------------------------------------------- /docker/nginx/conf.d/default.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | listen [::]:80; 4 | 5 | root /app/dummy/public/; 6 | index index.php index.html index.htm; 7 | 8 | client_max_body_size 128M; 9 | 10 | location / { 11 | try_files $uri $uri/ /index.php?_url=$uri&$args; 12 | } 13 | 14 | location /webtools { 15 | try_files $uri $uri/ /webtools.php?_url=$uri&$args; 16 | } 17 | 18 | location ~ \.php$ { 19 | fastcgi_pass service_php:8000; 20 | include fastcgi-php.conf; 21 | 22 | fastcgi_buffers 16 32k; 23 | fastcgi_buffer_size 32k; 24 | 25 | fastcgi_connect_timeout 600; 26 | fastcgi_send_timeout 600; 27 | fastcgi_read_timeout 600; 28 | } 29 | 30 | location ~ /\.(ht|svn|git) { 31 | deny all; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /docker/nginx/fastcgi-php.conf: -------------------------------------------------------------------------------- 1 | # regex to split $uri to $fastcgi_script_name and $fastcgi_path 2 | fastcgi_split_path_info ^(.+?\.php)(/.*)$; 3 | 4 | # Check that the PHP script exists before passing it 5 | try_files $uri /index.php =404; 6 | 7 | # Bypass the fact that try_files resets $fastcgi_path_info 8 | # see: http://trac.nginx.org/nginx/ticket/321 9 | set $path_info $fastcgi_path_info; 10 | fastcgi_param PATH_INFO $path_info; 11 | 12 | fastcgi_index index.php; 13 | include fastcgi.conf; 14 | -------------------------------------------------------------------------------- /docker/nginx/fastcgi.conf: -------------------------------------------------------------------------------- 1 | 2 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 3 | fastcgi_param QUERY_STRING $query_string; 4 | fastcgi_param REQUEST_METHOD $request_method; 5 | fastcgi_param CONTENT_TYPE $content_type; 6 | fastcgi_param CONTENT_LENGTH $content_length; 7 | 8 | fastcgi_param SCRIPT_NAME $fastcgi_script_name; 9 | fastcgi_param REQUEST_URI $request_uri; 10 | fastcgi_param DOCUMENT_URI $document_uri; 11 | fastcgi_param DOCUMENT_ROOT $document_root; 12 | fastcgi_param SERVER_PROTOCOL $server_protocol; 13 | fastcgi_param REQUEST_SCHEME $scheme; 14 | fastcgi_param HTTPS $https if_not_empty; 15 | 16 | fastcgi_param GATEWAY_INTERFACE CGI/1.1; 17 | fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; 18 | 19 | fastcgi_param REMOTE_ADDR $remote_addr; 20 | fastcgi_param REMOTE_PORT $remote_port; 21 | fastcgi_param SERVER_ADDR $server_addr; 22 | fastcgi_param SERVER_PORT $server_port; 23 | fastcgi_param SERVER_NAME $server_name; 24 | 25 | # PHP only, required if PHP was built with --enable-force-cgi-redirect 26 | fastcgi_param REDIRECT_STATUS 200; 27 | -------------------------------------------------------------------------------- /docker/php/mods/phalcon.ini: -------------------------------------------------------------------------------- 1 | ; configuration for phalcon module 2 | ; priority=50 3 | extension=phalcon.so 4 | -------------------------------------------------------------------------------- /docker/php/mods/psr.ini: -------------------------------------------------------------------------------- 1 | ; configuration for psr module 2 | ; priority=20 3 | extension=psr.so 4 | -------------------------------------------------------------------------------- /dummy/.gitignore: -------------------------------------------------------------------------------- 1 | # Please do not use this ignore file to define platform specific files. 2 | # 3 | # For these purposes create a global .gitignore file, which is a list of rules 4 | # for ignoring files in every Git repository on your computer. 5 | # 6 | # https://help.github.com/articles/ignoring-files/#create-a-global-gitignore 7 | 8 | * 9 | !.gitignore 10 | -------------------------------------------------------------------------------- /phalcon-completion.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # This file is part of the Phalcon Framework. 4 | # 5 | # (c) Phalcon Team 6 | # 7 | # For the full copyright and license information, please view the 8 | # LICENSE.txt file that was distributed with this source code. 9 | 10 | _phalcon() 11 | { 12 | local cur prev 13 | _get_comp_words_by_ref -n = cur prev 14 | 15 | commands="commands list enumerate controller create-controller model \ 16 | create-model all-models create-all-models project create-project scaffold \ 17 | create-scaffold migration create-migration webtools create-webtools" 18 | 19 | case "$prev" in 20 | project|create-project) 21 | COMPREPLY=($(compgen -W "--name --webtools --directory --type --template-path --use-config-ini --trace --help --namespace" -- "$cur")) 22 | return 0 23 | ;; 24 | esac 25 | 26 | COMPREPLY=($(compgen -W "$commands" -- "$cur")) 27 | 28 | } && 29 | complete -F _phalcon phalcon 30 | -------------------------------------------------------------------------------- /phalcon.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | set PTOOLSPATH=%~dp0 4 | php %PTOOLSPATH%phalcon %* 5 | -------------------------------------------------------------------------------- /phpcs.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | Phalcon Coding Standards 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 29 | src 30 | 31 | src/Generator/ 32 | 33 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /phpstan.neon: -------------------------------------------------------------------------------- 1 | parameters: 2 | bootstrap: %rootDir%/../../../bootstrap/phpstan.php 3 | 4 | excludes_analyse: 5 | - %rootDir%/../../../src/Generator/* 6 | - %rootDir%/../../../src/Commands/DotPhalconMissingException.php 7 | - %rootDir%/../../../src/Mvc/Dispatcher/ErrorHandler.php 8 | ignoreErrors: 9 | - '#Strict comparison using === between#' 10 | - '#Result of && is always true#' 11 | - '#Result of \|\| is always true#' 12 | - '#Parameter \#1 \$adapter of class Phalcon\\Cache constructor expects#' 13 | - '#Parameter \#1 \$eventsManager of method Phalcon#' 14 | - '#Parameter \#1 \$exception_handler of function set_exception_handler expects#' 15 | - '#Parameter \#1 \$function of function register_shutdown_function expects callable\(\)#' 16 | - '#Call to an undefined method [a-zA-Z0-9\\_]+::getShared\(\)#' 17 | reportUnmatchedIgnoredErrors: false 18 | -------------------------------------------------------------------------------- /psalm.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /resources/admin-lte/plugins/fontawesome-free/css/brands.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome Free 5.11.2 by @fontawesome - https://fontawesome.com 3 | * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) 4 | */ 5 | @font-face { 6 | font-family: 'Font Awesome 5 Brands'; 7 | font-style: normal; 8 | font-weight: normal; 9 | font-display: auto; 10 | src: url("../webfonts/fa-brands-400.eot"); 11 | src: url("../webfonts/fa-brands-400.eot?#iefix") format("embedded-opentype"), url("../webfonts/fa-brands-400.woff2") format("woff2"), url("../webfonts/fa-brands-400.woff") format("woff"), url("../webfonts/fa-brands-400.ttf") format("truetype"), url("../webfonts/fa-brands-400.svg#fontawesome") format("svg"); } 12 | 13 | .fab { 14 | font-family: 'Font Awesome 5 Brands'; } 15 | -------------------------------------------------------------------------------- /resources/admin-lte/plugins/fontawesome-free/css/brands.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome Free 5.11.2 by @fontawesome - https://fontawesome.com 3 | * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) 4 | */ 5 | @font-face{font-family:"Font Awesome 5 Brands";font-style:normal;font-weight:normal;font-display:auto;src:url(../webfonts/fa-brands-400.eot);src:url(../webfonts/fa-brands-400.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.woff) format("woff"),url(../webfonts/fa-brands-400.ttf) format("truetype"),url(../webfonts/fa-brands-400.svg#fontawesome) format("svg")}.fab{font-family:"Font Awesome 5 Brands"} -------------------------------------------------------------------------------- /resources/admin-lte/plugins/fontawesome-free/css/regular.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome Free 5.11.2 by @fontawesome - https://fontawesome.com 3 | * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) 4 | */ 5 | @font-face { 6 | font-family: 'Font Awesome 5 Free'; 7 | font-style: normal; 8 | font-weight: 400; 9 | font-display: auto; 10 | src: url("../webfonts/fa-regular-400.eot"); 11 | src: url("../webfonts/fa-regular-400.eot?#iefix") format("embedded-opentype"), url("../webfonts/fa-regular-400.woff2") format("woff2"), url("../webfonts/fa-regular-400.woff") format("woff"), url("../webfonts/fa-regular-400.ttf") format("truetype"), url("../webfonts/fa-regular-400.svg#fontawesome") format("svg"); } 12 | 13 | .far { 14 | font-family: 'Font Awesome 5 Free'; 15 | font-weight: 400; } 16 | -------------------------------------------------------------------------------- /resources/admin-lte/plugins/fontawesome-free/css/regular.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome Free 5.11.2 by @fontawesome - https://fontawesome.com 3 | * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) 4 | */ 5 | @font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:400;font-display:auto;src:url(../webfonts/fa-regular-400.eot);src:url(../webfonts/fa-regular-400.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.woff) format("woff"),url(../webfonts/fa-regular-400.ttf) format("truetype"),url(../webfonts/fa-regular-400.svg#fontawesome) format("svg")}.far{font-family:"Font Awesome 5 Free";font-weight:400} -------------------------------------------------------------------------------- /resources/admin-lte/plugins/fontawesome-free/css/solid.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome Free 5.11.2 by @fontawesome - https://fontawesome.com 3 | * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) 4 | */ 5 | @font-face { 6 | font-family: 'Font Awesome 5 Free'; 7 | font-style: normal; 8 | font-weight: 900; 9 | font-display: auto; 10 | src: url("../webfonts/fa-solid-900.eot"); 11 | src: url("../webfonts/fa-solid-900.eot?#iefix") format("embedded-opentype"), url("../webfonts/fa-solid-900.woff2") format("woff2"), url("../webfonts/fa-solid-900.woff") format("woff"), url("../webfonts/fa-solid-900.ttf") format("truetype"), url("../webfonts/fa-solid-900.svg#fontawesome") format("svg"); } 12 | 13 | .fa, 14 | .fas { 15 | font-family: 'Font Awesome 5 Free'; 16 | font-weight: 900; } 17 | -------------------------------------------------------------------------------- /resources/admin-lte/plugins/fontawesome-free/css/solid.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome Free 5.11.2 by @fontawesome - https://fontawesome.com 3 | * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) 4 | */ 5 | @font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:900;font-display:auto;src:url(../webfonts/fa-solid-900.eot);src:url(../webfonts/fa-solid-900.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.woff) format("woff"),url(../webfonts/fa-solid-900.ttf) format("truetype"),url(../webfonts/fa-solid-900.svg#fontawesome) format("svg")}.fa,.fas{font-family:"Font Awesome 5 Free";font-weight:900} -------------------------------------------------------------------------------- /resources/admin-lte/plugins/fontawesome-free/webfonts/fa-brands-400.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/phalcon-devtools/e3f1aeb6614b095afae854dc5b1b9a99ae886174/resources/admin-lte/plugins/fontawesome-free/webfonts/fa-brands-400.eot -------------------------------------------------------------------------------- /resources/admin-lte/plugins/fontawesome-free/webfonts/fa-brands-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/phalcon-devtools/e3f1aeb6614b095afae854dc5b1b9a99ae886174/resources/admin-lte/plugins/fontawesome-free/webfonts/fa-brands-400.ttf -------------------------------------------------------------------------------- /resources/admin-lte/plugins/fontawesome-free/webfonts/fa-brands-400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/phalcon-devtools/e3f1aeb6614b095afae854dc5b1b9a99ae886174/resources/admin-lte/plugins/fontawesome-free/webfonts/fa-brands-400.woff -------------------------------------------------------------------------------- /resources/admin-lte/plugins/fontawesome-free/webfonts/fa-brands-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/phalcon-devtools/e3f1aeb6614b095afae854dc5b1b9a99ae886174/resources/admin-lte/plugins/fontawesome-free/webfonts/fa-brands-400.woff2 -------------------------------------------------------------------------------- /resources/admin-lte/plugins/fontawesome-free/webfonts/fa-regular-400.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/phalcon-devtools/e3f1aeb6614b095afae854dc5b1b9a99ae886174/resources/admin-lte/plugins/fontawesome-free/webfonts/fa-regular-400.eot -------------------------------------------------------------------------------- /resources/admin-lte/plugins/fontawesome-free/webfonts/fa-regular-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/phalcon-devtools/e3f1aeb6614b095afae854dc5b1b9a99ae886174/resources/admin-lte/plugins/fontawesome-free/webfonts/fa-regular-400.ttf -------------------------------------------------------------------------------- /resources/admin-lte/plugins/fontawesome-free/webfonts/fa-regular-400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/phalcon-devtools/e3f1aeb6614b095afae854dc5b1b9a99ae886174/resources/admin-lte/plugins/fontawesome-free/webfonts/fa-regular-400.woff -------------------------------------------------------------------------------- /resources/admin-lte/plugins/fontawesome-free/webfonts/fa-regular-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/phalcon-devtools/e3f1aeb6614b095afae854dc5b1b9a99ae886174/resources/admin-lte/plugins/fontawesome-free/webfonts/fa-regular-400.woff2 -------------------------------------------------------------------------------- /resources/admin-lte/plugins/fontawesome-free/webfonts/fa-solid-900.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/phalcon-devtools/e3f1aeb6614b095afae854dc5b1b9a99ae886174/resources/admin-lte/plugins/fontawesome-free/webfonts/fa-solid-900.eot -------------------------------------------------------------------------------- /resources/admin-lte/plugins/fontawesome-free/webfonts/fa-solid-900.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/phalcon-devtools/e3f1aeb6614b095afae854dc5b1b9a99ae886174/resources/admin-lte/plugins/fontawesome-free/webfonts/fa-solid-900.ttf -------------------------------------------------------------------------------- /resources/admin-lte/plugins/fontawesome-free/webfonts/fa-solid-900.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/phalcon-devtools/e3f1aeb6614b095afae854dc5b1b9a99ae886174/resources/admin-lte/plugins/fontawesome-free/webfonts/fa-solid-900.woff -------------------------------------------------------------------------------- /resources/admin-lte/plugins/fontawesome-free/webfonts/fa-solid-900.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/phalcon-devtools/e3f1aeb6614b095afae854dc5b1b9a99ae886174/resources/admin-lte/plugins/fontawesome-free/webfonts/fa-solid-900.woff2 -------------------------------------------------------------------------------- /resources/admin-lte/plugins/jquery-ui/images/ui-icons_444444_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/phalcon-devtools/e3f1aeb6614b095afae854dc5b1b9a99ae886174/resources/admin-lte/plugins/jquery-ui/images/ui-icons_444444_256x240.png -------------------------------------------------------------------------------- /resources/admin-lte/plugins/jquery-ui/images/ui-icons_555555_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/phalcon-devtools/e3f1aeb6614b095afae854dc5b1b9a99ae886174/resources/admin-lte/plugins/jquery-ui/images/ui-icons_555555_256x240.png -------------------------------------------------------------------------------- /resources/admin-lte/plugins/jquery-ui/images/ui-icons_777620_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/phalcon-devtools/e3f1aeb6614b095afae854dc5b1b9a99ae886174/resources/admin-lte/plugins/jquery-ui/images/ui-icons_777620_256x240.png -------------------------------------------------------------------------------- /resources/admin-lte/plugins/jquery-ui/images/ui-icons_777777_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/phalcon-devtools/e3f1aeb6614b095afae854dc5b1b9a99ae886174/resources/admin-lte/plugins/jquery-ui/images/ui-icons_777777_256x240.png -------------------------------------------------------------------------------- /resources/admin-lte/plugins/jquery-ui/images/ui-icons_cc0000_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/phalcon-devtools/e3f1aeb6614b095afae854dc5b1b9a99ae886174/resources/admin-lte/plugins/jquery-ui/images/ui-icons_cc0000_256x240.png -------------------------------------------------------------------------------- /resources/admin-lte/plugins/jquery-ui/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/phalcon-devtools/e3f1aeb6614b095afae854dc5b1b9a99ae886174/resources/admin-lte/plugins/jquery-ui/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /resources/codemirror/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2014 by Marijn Haverbeke and others 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /resources/codemirror/README.md: -------------------------------------------------------------------------------- 1 | # CodeMirror 2 | [![Build Status](https://api.travis-ci.org/codemirror/CodeMirror.svg)](https://travis-ci.org/codemirror/CodeMirror) 3 | [![NPM version](https://img.shields.io/npm/v/codemirror.svg)](https://www.npmjs.com/package/codemirror) 4 | [Funding status: ![maintainer happiness](https://marijnhaverbeke.nl/fund/status_s.png?again)](https://marijnhaverbeke.nl/fund/) 5 | 6 | CodeMirror is a JavaScript component that provides a code editor in 7 | the browser. When a mode is available for the language you are coding 8 | in, it will color your code, and optionally help with indentation. 9 | 10 | The project page is http://codemirror.net 11 | The manual is at http://codemirror.net/doc/manual.html 12 | The contributing guidelines are in [CONTRIBUTING.md](https://github.com/codemirror/CodeMirror/blob/master/CONTRIBUTING.md) 13 | -------------------------------------------------------------------------------- /resources/codemirror/addon/dialog/dialog.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-dialog { 2 | position: absolute; 3 | left: 0; right: 0; 4 | background: inherit; 5 | z-index: 15; 6 | padding: .1em .8em; 7 | overflow: hidden; 8 | color: inherit; 9 | } 10 | 11 | .CodeMirror-dialog-top { 12 | border-bottom: 1px solid #eee; 13 | top: 0; 14 | } 15 | 16 | .CodeMirror-dialog-bottom { 17 | border-top: 1px solid #eee; 18 | bottom: 0; 19 | } 20 | 21 | .CodeMirror-dialog input { 22 | border: none; 23 | outline: none; 24 | background: transparent; 25 | width: 20em; 26 | color: inherit; 27 | font-family: monospace; 28 | } 29 | 30 | .CodeMirror-dialog button { 31 | font-size: 70%; 32 | } 33 | -------------------------------------------------------------------------------- /resources/codemirror/addon/display/fullscreen.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-fullscreen { 2 | position: fixed; 3 | top: 0; left: 0; right: 0; bottom: 0; 4 | height: auto; 5 | z-index: 9; 6 | } 7 | -------------------------------------------------------------------------------- /resources/codemirror/addon/edit/trailingspace.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | CodeMirror.defineOption("showTrailingSpace", false, function(cm, val, prev) { 13 | if (prev == CodeMirror.Init) prev = false; 14 | if (prev && !val) 15 | cm.removeOverlay("trailingspace"); 16 | else if (!prev && val) 17 | cm.addOverlay({ 18 | token: function(stream) { 19 | for (var l = stream.string.length, i = l; i && /\s/.test(stream.string.charAt(i - 1)); --i) {} 20 | if (i > stream.pos) { stream.pos = i; return null; } 21 | stream.pos = l; 22 | return "trailingspace"; 23 | }, 24 | name: "trailingspace" 25 | }); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /resources/codemirror/addon/fold/foldgutter.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-foldmarker { 2 | color: blue; 3 | text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px; 4 | font-family: arial; 5 | line-height: .3; 6 | cursor: pointer; 7 | } 8 | .CodeMirror-foldgutter { 9 | width: .7em; 10 | } 11 | .CodeMirror-foldgutter-open, 12 | .CodeMirror-foldgutter-folded { 13 | cursor: pointer; 14 | } 15 | .CodeMirror-foldgutter-open:after { 16 | content: "\25BE"; 17 | } 18 | .CodeMirror-foldgutter-folded:after { 19 | content: "\25B8"; 20 | } 21 | -------------------------------------------------------------------------------- /resources/codemirror/addon/hint/show-hint.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-hints { 2 | position: absolute; 3 | z-index: 10; 4 | overflow: hidden; 5 | list-style: none; 6 | 7 | margin: 0; 8 | padding: 2px; 9 | 10 | -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 11 | -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 12 | box-shadow: 2px 3px 5px rgba(0,0,0,.2); 13 | border-radius: 3px; 14 | border: 1px solid silver; 15 | 16 | background: white; 17 | font-size: 90%; 18 | font-family: monospace; 19 | 20 | max-height: 20em; 21 | overflow-y: auto; 22 | } 23 | 24 | .CodeMirror-hint { 25 | margin: 0; 26 | padding: 0 4px; 27 | border-radius: 2px; 28 | max-width: 19em; 29 | overflow: hidden; 30 | white-space: pre; 31 | color: black; 32 | cursor: pointer; 33 | } 34 | 35 | li.CodeMirror-hint-active { 36 | background: #08f; 37 | color: white; 38 | } 39 | -------------------------------------------------------------------------------- /resources/codemirror/addon/lint/coffeescript-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | // Depends on coffeelint.js from http://www.coffeelint.org/js/coffeelint.js 5 | 6 | // declare global: coffeelint 7 | 8 | (function(mod) { 9 | if (typeof exports == "object" && typeof module == "object") // CommonJS 10 | mod(require("../../lib/codemirror")); 11 | else if (typeof define == "function" && define.amd) // AMD 12 | define(["../../lib/codemirror"], mod); 13 | else // Plain browser env 14 | mod(CodeMirror); 15 | })(function(CodeMirror) { 16 | "use strict"; 17 | 18 | CodeMirror.registerHelper("lint", "coffeescript", function(text) { 19 | var found = []; 20 | var parseError = function(err) { 21 | var loc = err.lineNumber; 22 | found.push({from: CodeMirror.Pos(loc-1, 0), 23 | to: CodeMirror.Pos(loc, 0), 24 | severity: err.level, 25 | message: err.message}); 26 | }; 27 | try { 28 | var res = coffeelint.lint(text); 29 | for(var i = 0; i < res.length; i++) { 30 | parseError(res[i]); 31 | } 32 | } catch(e) { 33 | found.push({from: CodeMirror.Pos(e.location.first_line, 0), 34 | to: CodeMirror.Pos(e.location.last_line, e.location.last_column), 35 | severity: 'error', 36 | message: e.message}); 37 | } 38 | return found; 39 | }); 40 | 41 | }); 42 | -------------------------------------------------------------------------------- /resources/codemirror/addon/lint/css-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | // Depends on csslint.js from https://github.com/stubbornella/csslint 5 | 6 | // declare global: CSSLint 7 | 8 | (function(mod) { 9 | if (typeof exports == "object" && typeof module == "object") // CommonJS 10 | mod(require("../../lib/codemirror")); 11 | else if (typeof define == "function" && define.amd) // AMD 12 | define(["../../lib/codemirror"], mod); 13 | else // Plain browser env 14 | mod(CodeMirror); 15 | })(function(CodeMirror) { 16 | "use strict"; 17 | 18 | CodeMirror.registerHelper("lint", "css", function(text) { 19 | var found = []; 20 | if (!window.CSSLint) return found; 21 | var results = CSSLint.verify(text), messages = results.messages, message = null; 22 | for ( var i = 0; i < messages.length; i++) { 23 | message = messages[i]; 24 | var startLine = message.line -1, endLine = message.line -1, startCol = message.col -1, endCol = message.col; 25 | found.push({ 26 | from: CodeMirror.Pos(startLine, startCol), 27 | to: CodeMirror.Pos(endLine, endCol), 28 | message: message.message, 29 | severity : message.type 30 | }); 31 | } 32 | return found; 33 | }); 34 | 35 | }); 36 | -------------------------------------------------------------------------------- /resources/codemirror/addon/lint/json-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | // Depends on jsonlint.js from https://github.com/zaach/jsonlint 5 | 6 | // declare global: jsonlint 7 | 8 | (function(mod) { 9 | if (typeof exports == "object" && typeof module == "object") // CommonJS 10 | mod(require("../../lib/codemirror")); 11 | else if (typeof define == "function" && define.amd) // AMD 12 | define(["../../lib/codemirror"], mod); 13 | else // Plain browser env 14 | mod(CodeMirror); 15 | })(function(CodeMirror) { 16 | "use strict"; 17 | 18 | CodeMirror.registerHelper("lint", "json", function(text) { 19 | var found = []; 20 | jsonlint.parseError = function(str, hash) { 21 | var loc = hash.loc; 22 | found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column), 23 | to: CodeMirror.Pos(loc.last_line - 1, loc.last_column), 24 | message: str}); 25 | }; 26 | try { jsonlint.parse(text); } 27 | catch(e) {} 28 | return found; 29 | }); 30 | 31 | }); 32 | -------------------------------------------------------------------------------- /resources/codemirror/addon/lint/yaml-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | // Depends on js-yaml.js from https://github.com/nodeca/js-yaml 15 | 16 | // declare global: jsyaml 17 | 18 | CodeMirror.registerHelper("lint", "yaml", function(text) { 19 | var found = []; 20 | try { jsyaml.load(text); } 21 | catch(e) { 22 | var loc = e.mark; 23 | found.push({ from: CodeMirror.Pos(loc.line, loc.column), to: CodeMirror.Pos(loc.line, loc.column), message: e.message }); 24 | } 25 | return found; 26 | }); 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /resources/codemirror/addon/mode/multiplex_test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function() { 5 | CodeMirror.defineMode("markdown_with_stex", function(){ 6 | var inner = CodeMirror.getMode({}, "stex"); 7 | var outer = CodeMirror.getMode({}, "markdown"); 8 | 9 | var innerOptions = { 10 | open: '$', 11 | close: '$', 12 | mode: inner, 13 | delimStyle: 'delim', 14 | innerStyle: 'inner' 15 | }; 16 | 17 | return CodeMirror.multiplexingMode(outer, innerOptions); 18 | }); 19 | 20 | var mode = CodeMirror.getMode({}, "markdown_with_stex"); 21 | 22 | function MT(name) { 23 | test.mode( 24 | name, 25 | mode, 26 | Array.prototype.slice.call(arguments, 1), 27 | 'multiplexing'); 28 | } 29 | 30 | MT( 31 | "stexInsideMarkdown", 32 | "[strong **Equation:**] [delim $][inner&tag \\pi][delim $]"); 33 | })(); 34 | -------------------------------------------------------------------------------- /resources/codemirror/addon/runmode/colorize.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror"), require("./runmode")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror", "./runmode"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | var isBlock = /^(p|li|div|h\\d|pre|blockquote|td)$/; 15 | 16 | function textContent(node, out) { 17 | if (node.nodeType == 3) return out.push(node.nodeValue); 18 | for (var ch = node.firstChild; ch; ch = ch.nextSibling) { 19 | textContent(ch, out); 20 | if (isBlock.test(node.nodeType)) out.push("\n"); 21 | } 22 | } 23 | 24 | CodeMirror.colorize = function(collection, defaultMode) { 25 | if (!collection) collection = document.body.getElementsByTagName("pre"); 26 | 27 | for (var i = 0; i < collection.length; ++i) { 28 | var node = collection[i]; 29 | var mode = node.getAttribute("data-lang") || defaultMode; 30 | if (!mode) continue; 31 | 32 | var text = []; 33 | textContent(node, text); 34 | node.innerHTML = ""; 35 | CodeMirror.runMode(text.join(""), mode, node); 36 | 37 | node.className += " cm-s-default"; 38 | } 39 | }; 40 | }); 41 | -------------------------------------------------------------------------------- /resources/codemirror/addon/search/matchesonscrollbar.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-search-match { 2 | background: gold; 3 | border-top: 1px solid orange; 4 | border-bottom: 1px solid orange; 5 | -moz-box-sizing: border-box; 6 | box-sizing: border-box; 7 | opacity: .5; 8 | } 9 | -------------------------------------------------------------------------------- /resources/codemirror/addon/tern/worker.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | // declare global: tern, server 5 | 6 | var server; 7 | 8 | this.onmessage = function(e) { 9 | var data = e.data; 10 | switch (data.type) { 11 | case "init": return startServer(data.defs, data.plugins, data.scripts); 12 | case "add": return server.addFile(data.name, data.text); 13 | case "del": return server.delFile(data.name); 14 | case "req": return server.request(data.body, function(err, reqData) { 15 | postMessage({id: data.id, body: reqData, err: err && String(err)}); 16 | }); 17 | case "getFile": 18 | var c = pending[data.id]; 19 | delete pending[data.id]; 20 | return c(data.err, data.text); 21 | default: throw new Error("Unknown message type: " + data.type); 22 | } 23 | }; 24 | 25 | var nextId = 0, pending = {}; 26 | function getFile(file, c) { 27 | postMessage({type: "getFile", name: file, id: ++nextId}); 28 | pending[nextId] = c; 29 | } 30 | 31 | function startServer(defs, plugins, scripts) { 32 | if (scripts) importScripts.apply(null, scripts); 33 | 34 | server = new tern.Server({ 35 | getFile: getFile, 36 | async: true, 37 | defs: defs, 38 | plugins: plugins 39 | }); 40 | } 41 | 42 | var console = { 43 | log: function(v) { postMessage({type: "debug", message: v}); } 44 | }; 45 | -------------------------------------------------------------------------------- /resources/codemirror/lib/codephalcon.css: -------------------------------------------------------------------------------- 1 | .CodeMirror { 2 | font-family: "Consolas", "Lucida Console", monospace; 3 | border: 1px solid black; 4 | font-size:13px; 5 | height: auto; 6 | } 7 | 8 | .CodeMirror-scroll { 9 | height: auto; 10 | overflow-y: hidden!important; 11 | overflow-x: auto; 12 | width: 100%; 13 | } 14 | -------------------------------------------------------------------------------- /resources/codemirror/lib/codephalcon.js: -------------------------------------------------------------------------------- 1 | var editor, currentHandle = null, currentLine; 2 | 3 | window.onload = function () { 4 | try { 5 | editor = CodeMirror.fromTextArea(document.getElementById("code"), { 6 | lineNumbers: true, 7 | matchBrackets: true, 8 | mode: "application/x-httpd-php", 9 | indentUnit: 4, 10 | indentWithTabs: true, 11 | enterMode: "keep", 12 | tabMode: "shift", 13 | theme: 'ambiance', 14 | styleActiveLine: true, 15 | onCursorActivity: function () { 16 | var line = editor.getCursor().line, handle = editor.getLineHandle(line); 17 | if (handle == currentHandle && line == currentLine) return; 18 | if (currentHandle) { 19 | editor.setLineClass(currentHandle, null, null); 20 | editor.clearMarker(currentHandle); 21 | } 22 | currentHandle = handle; 23 | currentLine = line; 24 | editor.setLineClass(currentHandle, null, "activeline"); 25 | editor.setMarker(currentHandle, String(line + 1)); 26 | } 27 | }); 28 | } 29 | catch (e) { 30 | alert(e.stack) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /resources/codemirror/mode/asciiarmor/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: ASCII Armor (PGP) mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

ASCII Armor (PGP) mode

27 |
36 | 37 | 42 | 43 |

MIME types 44 | defined: application/pgp, application/pgp-keys, application/pgp-signature

45 | 46 |
47 | -------------------------------------------------------------------------------- /resources/codemirror/mode/diff/diff.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | CodeMirror.defineMode("diff", function() { 15 | 16 | var TOKEN_NAMES = { 17 | '+': 'positive', 18 | '-': 'negative', 19 | '@': 'meta' 20 | }; 21 | 22 | return { 23 | token: function(stream) { 24 | var tw_pos = stream.string.search(/[\t ]+?$/); 25 | 26 | if (!stream.sol() || tw_pos === 0) { 27 | stream.skipToEnd(); 28 | return ("error " + ( 29 | TOKEN_NAMES[stream.string.charAt(0)] || '')).replace(/ $/, ''); 30 | } 31 | 32 | var token_name = TOKEN_NAMES[stream.peek()] || stream.skipToEnd(); 33 | 34 | if (tw_pos === -1) { 35 | stream.skipToEnd(); 36 | } else { 37 | stream.pos = tw_pos; 38 | } 39 | 40 | return token_name; 41 | } 42 | }; 43 | }); 44 | 45 | CodeMirror.defineMIME("text/x-diff", "diff"); 46 | 47 | }); 48 | -------------------------------------------------------------------------------- /resources/codemirror/mode/ecl/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: ECL mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

ECL mode

27 |
45 | 48 | 49 |

Based on CodeMirror's clike mode. For more information see HPCC Systems web site.

50 |

MIME types defined: text/x-ecl.

51 | 52 |
53 | -------------------------------------------------------------------------------- /resources/codemirror/mode/htmlembedded/htmlembedded.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), 7 | require("../../addon/mode/multiplex")); 8 | else if (typeof define == "function" && define.amd) // AMD 9 | define(["../../lib/codemirror", "../htmlmixed/htmlmixed", 10 | "../../addon/mode/multiplex"], mod); 11 | else // Plain browser env 12 | mod(CodeMirror); 13 | })(function(CodeMirror) { 14 | "use strict"; 15 | 16 | CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { 17 | return CodeMirror.multiplexingMode(CodeMirror.getMode(config, "htmlmixed"), { 18 | open: parserConfig.open || parserConfig.scriptStartRegex || "<%", 19 | close: parserConfig.close || parserConfig.scriptEndRegex || "%>", 20 | mode: CodeMirror.getMode(config, parserConfig.scriptingModeSpec) 21 | }); 22 | }, "htmlmixed"); 23 | 24 | CodeMirror.defineMIME("application/x-ejs", {name: "htmlembedded", scriptingModeSpec:"javascript"}); 25 | CodeMirror.defineMIME("application/x-aspx", {name: "htmlembedded", scriptingModeSpec:"text/x-csharp"}); 26 | CodeMirror.defineMIME("application/x-jsp", {name: "htmlembedded", scriptingModeSpec:"text/x-java"}); 27 | CodeMirror.defineMIME("application/x-erb", {name: "htmlembedded", scriptingModeSpec:"ruby"}); 28 | }); 29 | -------------------------------------------------------------------------------- /resources/codemirror/mode/http/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: HTTP mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

HTTP mode

27 | 28 | 29 |
39 | 40 | 43 | 44 |

MIME types defined: message/http.

45 |
46 | -------------------------------------------------------------------------------- /resources/codemirror/mode/ntriples/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: NTriples mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 28 | 29 |
30 |

NTriples mode

31 |
32 | 39 |
40 | 41 | 44 |

MIME types defined: text/n-triples.

45 |
46 | -------------------------------------------------------------------------------- /resources/codemirror/mode/ruby/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({indentUnit: 2}, "ruby"); 6 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } 7 | 8 | MT("divide_equal_operator", 9 | "[variable bar] [operator /=] [variable foo]"); 10 | 11 | MT("divide_equal_operator_no_spacing", 12 | "[variable foo][operator /=][number 42]"); 13 | 14 | })(); 15 | -------------------------------------------------------------------------------- /resources/codemirror/mode/rust/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Rust mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Rust mode

27 | 28 | 29 |
52 | 53 | 58 | 59 |

MIME types defined: text/x-rustsrc.

60 |
61 | -------------------------------------------------------------------------------- /resources/codemirror/mode/solr/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Solr mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 20 | 33 | 34 |
35 |

Solr mode

36 | 37 |
38 | 47 |
48 | 49 | 55 | 56 |

MIME types defined: text/x-solr.

57 |
58 | -------------------------------------------------------------------------------- /resources/codemirror/mode/spreadsheet/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Spreadsheet mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 |
27 |

Spreadsheet mode

28 |
29 | 30 | 37 | 38 |

MIME types defined: text/x-spreadsheet.

39 | 40 |

The Spreadsheet Mode

41 |

Created by Robert Plummer

42 |
43 | -------------------------------------------------------------------------------- /resources/codemirror/mode/tiddlywiki/tiddlywiki.css: -------------------------------------------------------------------------------- 1 | span.cm-underlined { 2 | text-decoration: underline; 3 | } 4 | span.cm-strikethrough { 5 | text-decoration: line-through; 6 | } 7 | span.cm-brace { 8 | color: #170; 9 | font-weight: bold; 10 | } 11 | span.cm-table { 12 | color: blue; 13 | font-weight: bold; 14 | } 15 | -------------------------------------------------------------------------------- /resources/codemirror/mode/tiki/tiki.css: -------------------------------------------------------------------------------- 1 | .cm-tw-syntaxerror { 2 | color: #FFF; 3 | background-color: #900; 4 | } 5 | 6 | .cm-tw-deleted { 7 | text-decoration: line-through; 8 | } 9 | 10 | .cm-tw-header5 { 11 | font-weight: bold; 12 | } 13 | .cm-tw-listitem:first-child { /*Added first child to fix duplicate padding when highlighting*/ 14 | padding-left: 10px; 15 | } 16 | 17 | .cm-tw-box { 18 | border-top-width: 0px ! important; 19 | border-style: solid; 20 | border-width: 1px; 21 | border-color: inherit; 22 | } 23 | 24 | .cm-tw-underline { 25 | text-decoration: underline; 26 | } -------------------------------------------------------------------------------- /resources/codemirror/mode/z80/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Z80 assembly mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Z80 assembly mode

27 | 28 | 29 |
45 | 46 | 51 | 52 |

MIME types defined: text/x-z80, text/x-ez80.

53 |
54 | -------------------------------------------------------------------------------- /resources/codemirror/theme/ambiance-mobile.css: -------------------------------------------------------------------------------- 1 | .cm-s-ambiance.CodeMirror { 2 | -webkit-box-shadow: none; 3 | -moz-box-shadow: none; 4 | box-shadow: none; 5 | } 6 | -------------------------------------------------------------------------------- /resources/codemirror/theme/cobalt.css: -------------------------------------------------------------------------------- 1 | .cm-s-cobalt.CodeMirror { background: #002240; color: white; } 2 | .cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; } 3 | .cm-s-cobalt.CodeMirror ::selection { background: rgba(179, 101, 57, .99); } 4 | .cm-s-cobalt.CodeMirror ::-moz-selection { background: rgba(179, 101, 57, .99); } 5 | .cm-s-cobalt .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } 6 | .cm-s-cobalt .CodeMirror-guttermarker { color: #ffee80; } 7 | .cm-s-cobalt .CodeMirror-guttermarker-subtle { color: #d0d0d0; } 8 | .cm-s-cobalt .CodeMirror-linenumber { color: #d0d0d0; } 9 | .cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white !important; } 10 | 11 | .cm-s-cobalt span.cm-comment { color: #08f; } 12 | .cm-s-cobalt span.cm-atom { color: #845dc4; } 13 | .cm-s-cobalt span.cm-number, .cm-s-cobalt span.cm-attribute { color: #ff80e1; } 14 | .cm-s-cobalt span.cm-keyword { color: #ffee80; } 15 | .cm-s-cobalt span.cm-string { color: #3ad900; } 16 | .cm-s-cobalt span.cm-meta { color: #ff9d00; } 17 | .cm-s-cobalt span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #9effff; } 18 | .cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def { color: white; } 19 | .cm-s-cobalt span.cm-bracket { color: #d8d8d8; } 20 | .cm-s-cobalt span.cm-builtin, .cm-s-cobalt span.cm-special { color: #ff9e59; } 21 | .cm-s-cobalt span.cm-link { color: #845dc4; } 22 | .cm-s-cobalt span.cm-error { color: #9d1e15; } 23 | 24 | .cm-s-cobalt .CodeMirror-activeline-background {background: #002D57 !important;} 25 | .cm-s-cobalt .CodeMirror-matchingbracket {outline:1px solid grey;color:white !important} 26 | -------------------------------------------------------------------------------- /resources/codemirror/theme/eclipse.css: -------------------------------------------------------------------------------- 1 | .cm-s-eclipse span.cm-meta {color: #FF1717;} 2 | .cm-s-eclipse span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; } 3 | .cm-s-eclipse span.cm-atom {color: #219;} 4 | .cm-s-eclipse span.cm-number {color: #164;} 5 | .cm-s-eclipse span.cm-def {color: #00f;} 6 | .cm-s-eclipse span.cm-variable {color: black;} 7 | .cm-s-eclipse span.cm-variable-2 {color: #0000C0;} 8 | .cm-s-eclipse span.cm-variable-3 {color: #0000C0;} 9 | .cm-s-eclipse span.cm-property {color: black;} 10 | .cm-s-eclipse span.cm-operator {color: black;} 11 | .cm-s-eclipse span.cm-comment {color: #3F7F5F;} 12 | .cm-s-eclipse span.cm-string {color: #2A00FF;} 13 | .cm-s-eclipse span.cm-string-2 {color: #f50;} 14 | .cm-s-eclipse span.cm-qualifier {color: #555;} 15 | .cm-s-eclipse span.cm-builtin {color: #30a;} 16 | .cm-s-eclipse span.cm-bracket {color: #cc7;} 17 | .cm-s-eclipse span.cm-tag {color: #170;} 18 | .cm-s-eclipse span.cm-attribute {color: #00c;} 19 | .cm-s-eclipse span.cm-link {color: #219;} 20 | .cm-s-eclipse span.cm-error {color: #f00;} 21 | 22 | .cm-s-eclipse .CodeMirror-activeline-background {background: #e8f2ff !important;} 23 | .cm-s-eclipse .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;} 24 | -------------------------------------------------------------------------------- /resources/codemirror/theme/elegant.css: -------------------------------------------------------------------------------- 1 | .cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom {color: #762;} 2 | .cm-s-elegant span.cm-comment {color: #262; font-style: italic; line-height: 1em;} 3 | .cm-s-elegant span.cm-meta {color: #555; font-style: italic; line-height: 1em;} 4 | .cm-s-elegant span.cm-variable {color: black;} 5 | .cm-s-elegant span.cm-variable-2 {color: #b11;} 6 | .cm-s-elegant span.cm-qualifier {color: #555;} 7 | .cm-s-elegant span.cm-keyword {color: #730;} 8 | .cm-s-elegant span.cm-builtin {color: #30a;} 9 | .cm-s-elegant span.cm-link {color: #762;} 10 | .cm-s-elegant span.cm-error {background-color: #fdd;} 11 | 12 | .cm-s-elegant .CodeMirror-activeline-background {background: #e8f2ff !important;} 13 | .cm-s-elegant .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;} 14 | -------------------------------------------------------------------------------- /resources/codemirror/theme/neat.css: -------------------------------------------------------------------------------- 1 | .cm-s-neat span.cm-comment { color: #a86; } 2 | .cm-s-neat span.cm-keyword { line-height: 1em; font-weight: bold; color: blue; } 3 | .cm-s-neat span.cm-string { color: #a22; } 4 | .cm-s-neat span.cm-builtin { line-height: 1em; font-weight: bold; color: #077; } 5 | .cm-s-neat span.cm-special { line-height: 1em; font-weight: bold; color: #0aa; } 6 | .cm-s-neat span.cm-variable { color: black; } 7 | .cm-s-neat span.cm-number, .cm-s-neat span.cm-atom { color: #3a3; } 8 | .cm-s-neat span.cm-meta {color: #555;} 9 | .cm-s-neat span.cm-link { color: #3a3; } 10 | 11 | .cm-s-neat .CodeMirror-activeline-background {background: #e8f2ff !important;} 12 | .cm-s-neat .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;} 13 | -------------------------------------------------------------------------------- /resources/codemirror/theme/neo.css: -------------------------------------------------------------------------------- 1 | /* neo theme for codemirror */ 2 | 3 | /* Color scheme */ 4 | 5 | .cm-s-neo.CodeMirror { 6 | background-color:#ffffff; 7 | color:#2e383c; 8 | line-height:1.4375; 9 | } 10 | .cm-s-neo .cm-comment {color:#75787b} 11 | .cm-s-neo .cm-keyword, .cm-s-neo .cm-property {color:#1d75b3} 12 | .cm-s-neo .cm-atom,.cm-s-neo .cm-number {color:#75438a} 13 | .cm-s-neo .cm-node,.cm-s-neo .cm-tag {color:#9c3328} 14 | .cm-s-neo .cm-string {color:#b35e14} 15 | .cm-s-neo .cm-variable,.cm-s-neo .cm-qualifier {color:#047d65} 16 | 17 | 18 | /* Editor styling */ 19 | 20 | .cm-s-neo pre { 21 | padding:0; 22 | } 23 | 24 | .cm-s-neo .CodeMirror-gutters { 25 | border:none; 26 | border-right:10px solid transparent; 27 | background-color:transparent; 28 | } 29 | 30 | .cm-s-neo .CodeMirror-linenumber { 31 | padding:0; 32 | color:#e0e2e5; 33 | } 34 | 35 | .cm-s-neo .CodeMirror-guttermarker { color: #1d75b3; } 36 | .cm-s-neo .CodeMirror-guttermarker-subtle { color: #e0e2e5; } 37 | 38 | .cm-s-neo div.CodeMirror-cursor { 39 | width: auto; 40 | border: 0; 41 | background: rgba(155,157,162,0.37); 42 | z-index: 1; 43 | } 44 | -------------------------------------------------------------------------------- /resources/js/webtools.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | const currentUri = "/" + location.pathname.substr(1); 3 | const currentAnchor = $("a[href='" + currentUri + "']"); 4 | 5 | currentAnchor.addClass("active"); 6 | currentAnchor.parents(".has-treeview").addClass("menu-open"); 7 | }); 8 | -------------------------------------------------------------------------------- /src/Access/PolicyInterface.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Access; 14 | 15 | interface PolicyInterface 16 | { 17 | /** 18 | * Checks whether a user is allowed to access an resource. 19 | * 20 | * @param string $resourceName Resource name. 21 | * @param array $data Data. [Optional] 22 | * @return bool 23 | */ 24 | public function isAllowedAccess(string $resourceName, array $data = null): bool; 25 | } 26 | -------------------------------------------------------------------------------- /src/Builder/Exception/BuilderException.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Builder\Exception; 14 | 15 | use Phalcon\Exception; 16 | 17 | /** 18 | * Exception Builder made 19 | */ 20 | class BuilderException extends Exception 21 | { 22 | } 23 | -------------------------------------------------------------------------------- /src/Builder/Project/ProjectAware.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Builder\Project; 14 | 15 | use Phalcon\Config; 16 | 17 | /** 18 | * @property Config $options 19 | * @method static generateFile(string $fromFile, string $toFile, string $name = '') 20 | */ 21 | trait ProjectAware 22 | { 23 | /** 24 | * Create .htrouter.php file 25 | * 26 | * @param string $templatePath 27 | * @param string $projectPath 28 | * 29 | * @return $this 30 | */ 31 | protected function createHtrouterFile($projectPath = null, $templatePath = null) 32 | { 33 | if (!$projectPath) { 34 | $projectPath = $this->options->get('projectPath'); 35 | } 36 | 37 | if (!$templatePath) { 38 | $templatePath = $this->options->get('templatePath'); 39 | } 40 | 41 | $fromFile = rtrim($templatePath, '\\/') . DIRECTORY_SEPARATOR . '.htrouter.php'; 42 | $toFile = $projectPath . '.htrouter.php'; 43 | 44 | $this->generateFile($fromFile, $toFile); 45 | 46 | return $this; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Commands/CommandsException.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Commands; 14 | 15 | use Phalcon\Exception; 16 | 17 | /** 18 | * Commands Exception 19 | */ 20 | class CommandsException extends Exception 21 | { 22 | } 23 | -------------------------------------------------------------------------------- /src/Commands/ISelfHealingException.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Commands; 14 | 15 | interface ISelfHealingException 16 | { 17 | public function promptResolution(); 18 | public function resolve(); 19 | } 20 | -------------------------------------------------------------------------------- /src/Exception/InvalidArgumentException.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Exception; 14 | 15 | class InvalidArgumentException extends \InvalidArgumentException 16 | { 17 | } 18 | -------------------------------------------------------------------------------- /src/Exception/InvalidParameterException.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Exception; 14 | 15 | class InvalidParameterException extends \InvalidArgumentException 16 | { 17 | } 18 | -------------------------------------------------------------------------------- /src/Exception/ProviderException.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Exception; 14 | 15 | use Phalcon\Exception; 16 | 17 | class ProviderException extends Exception 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Exception/ReadOnlyParameterException.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Exception; 14 | 15 | class ReadOnlyParameterException extends \InvalidArgumentException 16 | { 17 | } 18 | -------------------------------------------------------------------------------- /src/Exception/RuntimeException.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Exception; 14 | 15 | class RuntimeException extends \RuntimeException 16 | { 17 | } 18 | -------------------------------------------------------------------------------- /src/Exception/WriteFileException.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Exception; 14 | 15 | class WriteFileException extends \RuntimeException 16 | { 17 | } 18 | -------------------------------------------------------------------------------- /src/Mvc/View/Engine/Volt/Extension/Php.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Mvc\View\Engine\Volt\Extension; 14 | 15 | /** 16 | * Allows to use any PHP function in Volt. 17 | */ 18 | class Php 19 | { 20 | /** 21 | * Tries to compile native PHP function. 22 | * 23 | * Invoked before any attempt to compile a function call in any template. 24 | * 25 | * @param string $name 26 | * @param mixed $arguments 27 | * 28 | * @return null|string 29 | */ 30 | public function compileFunction($name, $arguments = null) 31 | { 32 | if (function_exists($name)) { 33 | if (func_num_args() > 1) { 34 | $arguments = array_slice(func_get_args(), 1); 35 | return $name . '(' . $arguments[0] . ')'; 36 | } 37 | 38 | return $name . '()'; 39 | } 40 | 41 | return null; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Mvc/View/NotFoundListener.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Mvc\View; 14 | 15 | use Exception; 16 | use Phalcon\Di\Injectable; 17 | use Phalcon\Events\Event; 18 | use Phalcon\Mvc\ViewInterface; 19 | use Psr\Log\LoggerInterface; 20 | 21 | /** 22 | * @property LoggerInterface $logger 23 | */ 24 | class NotFoundListener extends Injectable 25 | { 26 | /** 27 | * Notify about not found views. 28 | * 29 | * @param Event $event 30 | * @param ViewInterface $view 31 | * @param mixed $viewEnginePath 32 | * 33 | * @throws Exception 34 | */ 35 | public function notFoundView(Event $event, ViewInterface $view, $viewEnginePath) 36 | { 37 | if ($viewEnginePath && !is_array($viewEnginePath)) { 38 | $viewEnginePath = [$viewEnginePath]; 39 | } 40 | 41 | $message = sprintf( 42 | 'View was not found in any of the views directory. Active render paths: [%s]', 43 | ($viewEnginePath ? join(', ', $viewEnginePath) : gettype($viewEnginePath)) 44 | ); 45 | 46 | $this->logger->error($message); 47 | 48 | throw new Exception($message); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Providers/AccessManagerProvider.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Providers; 14 | 15 | use Phalcon\DevTools\Access\Manager as AccessManager; 16 | use Phalcon\DevTools\Access\Policy\Ip as IpPolicy; 17 | use Phalcon\Di\DiInterface; 18 | use Phalcon\Di\ServiceProviderInterface; 19 | 20 | class AccessManagerProvider implements ServiceProviderInterface 21 | { 22 | /** 23 | * @var string 24 | */ 25 | protected $providerName = 'access'; 26 | 27 | /** 28 | * Registers a service provider. 29 | * 30 | * @param DiInterface $di 31 | */ 32 | public function register(DiInterface $di): void 33 | { 34 | $ptoolsIp = $di->getShared('application')->getPtoolsIp(); 35 | 36 | $di->setShared($this->providerName, function () use ($ptoolsIp) { 37 | $policy = new IpPolicy($ptoolsIp); 38 | 39 | return new AccessManager($policy); 40 | }); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/Providers/AnnotationsProvider.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Providers; 14 | 15 | use Phalcon\Annotations\Adapter\Memory as AnnotationsMemory; 16 | use Phalcon\Di\DiInterface; 17 | use Phalcon\Di\ServiceProviderInterface; 18 | 19 | class AnnotationsProvider implements ServiceProviderInterface 20 | { 21 | /** 22 | * @var string 23 | */ 24 | protected $providerName = 'annotations'; 25 | 26 | /** 27 | * Registers a service provider. 28 | * 29 | * @param DiInterface $di 30 | */ 31 | public function register(DiInterface $di): void 32 | { 33 | $di->setShared($this->providerName, function () { 34 | return new AnnotationsMemory(); 35 | }); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Providers/AssetsProvider.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Providers; 14 | 15 | use Phalcon\Assets\Manager as AssetsManager; 16 | use Phalcon\Di\DiInterface; 17 | use Phalcon\Di\ServiceProviderInterface; 18 | 19 | class AssetsProvider implements ServiceProviderInterface 20 | { 21 | /** 22 | * @var string 23 | */ 24 | protected $providerName = 'assets'; 25 | 26 | /** 27 | * Registers a service provider. 28 | * 29 | * @param DiInterface $di 30 | */ 31 | public function register(DiInterface $di): void 32 | { 33 | $di->setShared($this->providerName, function () { 34 | return new AssetsManager(); 35 | }); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Providers/AssetsResourceProvider.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Providers; 14 | 15 | use Phalcon\DevTools\Resources\AssetsResource; 16 | use Phalcon\Di\DiInterface; 17 | use Phalcon\Di\ServiceProviderInterface; 18 | 19 | class AssetsResourceProvider implements ServiceProviderInterface 20 | { 21 | /** 22 | * @var string 23 | */ 24 | protected $providerName = 'resource'; 25 | 26 | /** 27 | * Registers a service provider. 28 | * 29 | * @param DiInterface $di 30 | */ 31 | public function register(DiInterface $di): void 32 | { 33 | $di->setShared($this->providerName, function () { 34 | return new AssetsResource(); 35 | }); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Providers/ConfigProvider.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Providers; 14 | 15 | use Phalcon\Config; 16 | use Phalcon\DevTools\Scanners\Config as ConfigScanner; 17 | use Phalcon\Di\DiInterface; 18 | use Phalcon\Di\ServiceProviderInterface; 19 | 20 | class ConfigProvider implements ServiceProviderInterface 21 | { 22 | /** 23 | * @var string 24 | */ 25 | protected $providerName = 'config'; 26 | 27 | /** 28 | * Registers a service provider. 29 | * 30 | * @param DiInterface $di 31 | */ 32 | public function register(DiInterface $di): void 33 | { 34 | $basePath = $di->getShared('application')->getBasePath(); 35 | $di->setShared($this->providerName, function () use ($basePath) { 36 | $scanner = new ConfigScanner($basePath); 37 | $config = $scanner->load('config'); 38 | 39 | if (ENV_PRODUCTION !== APPLICATION_ENV) { 40 | $override = $scanner->scan(APPLICATION_ENV); 41 | if ($override instanceof Config) { 42 | $config->merge($override); 43 | } 44 | } 45 | return $config; 46 | }); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Providers/DataCacheProvider.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Providers; 14 | 15 | use Phalcon\Cache; 16 | use Phalcon\Cache\AdapterFactory; 17 | use Phalcon\Di\DiInterface; 18 | use Phalcon\Di\ServiceProviderInterface; 19 | use Phalcon\Storage\SerializerFactory; 20 | 21 | class DataCacheProvider implements ServiceProviderInterface 22 | { 23 | /** 24 | * @var string 25 | */ 26 | protected $providerName = 'dataCache'; 27 | 28 | /** 29 | * Registers a service provider. 30 | * 31 | * @param DiInterface $di 32 | */ 33 | public function register(DiInterface $di): void 34 | { 35 | $instanceName = 'stream'; 36 | 37 | $di->setShared($this->providerName, function () use ($instanceName) { 38 | $serializerFactory = new SerializerFactory(); 39 | $adapterFactory = new AdapterFactory($serializerFactory); 40 | $adapter = $adapterFactory->newInstance($instanceName); 41 | 42 | return new Cache($adapter); 43 | }); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Providers/DbUtilsProvider.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Providers; 14 | 15 | use Phalcon\DevTools\Utils\DbUtils; 16 | use Phalcon\Di\DiInterface; 17 | use Phalcon\Di\ServiceProviderInterface; 18 | 19 | class DbUtilsProvider implements ServiceProviderInterface 20 | { 21 | /** 22 | * @var string 23 | */ 24 | protected $providerName = 'dbUtils'; 25 | 26 | /** 27 | * Registers a service provider. 28 | * 29 | * @param DiInterface $di 30 | */ 31 | public function register(DiInterface $di): void 32 | { 33 | $di->setShared($this->providerName, function () { 34 | return new DbUtils(); 35 | }); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Providers/EventsManagerProvider.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Providers; 14 | 15 | use Phalcon\Di\DiInterface; 16 | use Phalcon\Di\ServiceProviderInterface; 17 | use Phalcon\Events\Manager as EventsManager; 18 | 19 | class EventsManagerProvider implements ServiceProviderInterface 20 | { 21 | /** 22 | * @var string 23 | */ 24 | protected $providerName = 'eventsManager'; 25 | 26 | /** 27 | * Registers a service provider. 28 | * 29 | * @param DiInterface $di 30 | */ 31 | public function register(DiInterface $di): void 32 | { 33 | $di->setShared($this->providerName, function () { 34 | $em = new EventsManager(); 35 | $em->enablePriorities(true); 36 | 37 | return $em; 38 | }); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Providers/FileSystemProvider.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Providers; 14 | 15 | use Phalcon\DevTools\Utils\FsUtils; 16 | use Phalcon\Di\DiInterface; 17 | use Phalcon\Di\ServiceProviderInterface; 18 | 19 | class FileSystemProvider implements ServiceProviderInterface 20 | { 21 | /** 22 | * @var string 23 | */ 24 | protected $providerName = 'fs'; 25 | 26 | /** 27 | * Registers a service provider. 28 | * 29 | * @param DiInterface $di 30 | */ 31 | public function register(DiInterface $di): void 32 | { 33 | $di->setShared($this->providerName, function () { 34 | return new FsUtils(); 35 | }); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Providers/FlashSessionProvider.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Providers; 14 | 15 | use Phalcon\Di\DiInterface; 16 | use Phalcon\Di\ServiceProviderInterface; 17 | use Phalcon\Escaper; 18 | use Phalcon\Flash\Session as FlashSession; 19 | 20 | class FlashSessionProvider implements ServiceProviderInterface 21 | { 22 | /** 23 | * @var string 24 | */ 25 | protected $providerName = 'flashSession'; 26 | 27 | /** 28 | * Registers a service provider. 29 | * 30 | * @param DiInterface $di 31 | */ 32 | public function register(DiInterface $di): void 33 | { 34 | $cssClasses = [ 35 | 'error' => 'alert alert-danger fade show', 36 | 'success' => 'alert alert-success fade show', 37 | 'notice' => 'alert alert-info fade show', 38 | 'warning' => 'alert alert-warning fade show', 39 | ]; 40 | 41 | $di->setShared($this->providerName, function () use ($cssClasses) { 42 | /** @var DiInterface $this */ 43 | $session = $this->getShared('session'); 44 | 45 | $flash = new FlashSession(new Escaper(), $session); 46 | $flash->setAutoescape(false); 47 | $flash->setCssClasses($cssClasses); 48 | 49 | return $flash; 50 | }); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Providers/ModelsCacheProvider.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Providers; 14 | 15 | use Phalcon\Cache; 16 | use Phalcon\Cache\AdapterFactory; 17 | use Phalcon\Di\DiInterface; 18 | use Phalcon\Di\ServiceProviderInterface; 19 | use Phalcon\Storage\SerializerFactory; 20 | 21 | class ModelsCacheProvider implements ServiceProviderInterface 22 | { 23 | /** 24 | * @var string 25 | */ 26 | protected $providerName = 'modelsCache'; 27 | 28 | /** 29 | * Registers a service provider. 30 | * 31 | * @param DiInterface $di 32 | */ 33 | public function register(DiInterface $di): void 34 | { 35 | $instanceName = 'stream'; 36 | 37 | $di->setShared($this->providerName, function () use ($instanceName) { 38 | $serializerFactory = new SerializerFactory(); 39 | $adapterFactory = new AdapterFactory($serializerFactory); 40 | $adapter = $adapterFactory->newInstance($instanceName); 41 | 42 | return new Cache($adapter); 43 | }); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Providers/SessionProvider.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Providers; 14 | 15 | use Phalcon\Di\DiInterface; 16 | use Phalcon\Di\ServiceProviderInterface; 17 | use Phalcon\Session\Adapter\Stream as SessionStream; 18 | use Phalcon\Session\Manager; 19 | 20 | class SessionProvider implements ServiceProviderInterface 21 | { 22 | /** 23 | * @var string 24 | */ 25 | protected $providerName = 'session'; 26 | 27 | /** 28 | * Registers a service provider. 29 | * 30 | * @param DiInterface $di 31 | */ 32 | public function register(DiInterface $di): void 33 | { 34 | $di->setShared($this->providerName, function () { 35 | $files = new SessionStream([ 36 | 'savePath' => sys_get_temp_dir(), 37 | ]); 38 | 39 | $session = new Manager(); 40 | $session->setAdapter($files); 41 | $session->start(); 42 | 43 | return $session; 44 | }); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Providers/SystemInfoProvider.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Providers; 14 | 15 | use Phalcon\DevTools\Utils\SystemInfo; 16 | use Phalcon\Di\DiInterface; 17 | use Phalcon\Di\ServiceProviderInterface; 18 | 19 | class SystemInfoProvider implements ServiceProviderInterface 20 | { 21 | /** 22 | * @var string 23 | */ 24 | protected $providerName = 'info'; 25 | 26 | /** 27 | * Registers a service provider. 28 | * 29 | * @param DiInterface $di 30 | */ 31 | public function register(DiInterface $di): void 32 | { 33 | $di->setShared($this->providerName, function () { 34 | return new SystemInfo(); 35 | }); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Providers/TagProvider.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Providers; 14 | 15 | use Phalcon\Di\DiInterface; 16 | use Phalcon\Di\ServiceProviderInterface; 17 | use Phalcon\Tag; 18 | 19 | class TagProvider implements ServiceProviderInterface 20 | { 21 | /** 22 | * @var string 23 | */ 24 | protected $providerName = 'tag'; 25 | 26 | /** 27 | * Registers a service provider. 28 | * 29 | * @param DiInterface $di 30 | */ 31 | public function register(DiInterface $di): void 32 | { 33 | $di->setShared($this->providerName, function () { 34 | $tag = new Tag(); 35 | 36 | $tag->setDocType(Tag::HTML5); 37 | $tag->setTitleSeparator(' :: '); 38 | $tag->setTitle('Phalcon WebTools'); 39 | 40 | return $tag; 41 | }); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Providers/ViewCacheProvider.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Providers; 14 | 15 | use Phalcon\Cache; 16 | use Phalcon\Cache\AdapterFactory; 17 | use Phalcon\Di\DiInterface; 18 | use Phalcon\Di\ServiceProviderInterface; 19 | use Phalcon\Storage\SerializerFactory; 20 | 21 | class ViewCacheProvider implements ServiceProviderInterface 22 | { 23 | /** 24 | * @var string 25 | */ 26 | protected $providerName = 'viewCache'; 27 | 28 | /** 29 | * Registers a service provider. 30 | * 31 | * @param DiInterface $di 32 | */ 33 | public function register(DiInterface $di): void 34 | { 35 | $instanceName = 'stream'; 36 | 37 | $di->set($this->providerName, function () use ($instanceName) { 38 | $serializerFactory = new SerializerFactory(); 39 | $adapterFactory = new AdapterFactory($serializerFactory); 40 | $adapter = $adapterFactory->newInstance($instanceName); 41 | 42 | return new Cache($adapter); 43 | }); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Resources/AssetsResource.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Resources; 14 | 15 | use Phalcon\DevTools\Utils\FsUtils; 16 | use Phalcon\Di\Injectable; 17 | 18 | /** 19 | * @property FsUtils $fs 20 | */ 21 | class AssetsResource extends Injectable 22 | { 23 | /** 24 | * Returns assets resource path. 25 | * 26 | * @param string $path 27 | * @return string 28 | */ 29 | public function path(string $path): string 30 | { 31 | return PTOOLSPATH . DIRECTORY_SEPARATOR . 'resources' . DIRECTORY_SEPARATOR . $this->fs->normalize($path); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Script/ScriptException.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Script; 14 | 15 | use Phalcon\Exception as PhalconException; 16 | 17 | class ScriptException extends PhalconException 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Version.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools; 14 | 15 | use Phalcon\Version as PhVersion; 16 | 17 | /** 18 | * This class allows to get the installed version of the Developer Tools 19 | */ 20 | class Version extends PhVersion 21 | { 22 | /** 23 | * {@inheritdoc} 24 | * 25 | * @return array 26 | */ 27 | // phpcs:disable 28 | protected static function _getVersion(): array 29 | { 30 | return [4, 1, 0, 0, 0]; 31 | } 32 | // phpcs:enable 33 | } 34 | -------------------------------------------------------------------------------- /src/Web/Tools/Controllers/IndexController.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Web\Tools\Controllers; 14 | 15 | use Phalcon\DevTools\Mvc\Controller\Base; 16 | 17 | class IndexController extends Base 18 | { 19 | /** 20 | * Initialize controller 21 | */ 22 | public function initialize() 23 | { 24 | $this->view->setVar('page_title', 'Dashboard'); 25 | } 26 | 27 | /** 28 | * @Get("/", name="dashboard") 29 | */ 30 | public function indexAction(): void 31 | { 32 | // Nothing here 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Web/Tools/Controllers/SystemInfoController.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * For the full copyright and license information, please view 10 | * the LICENSE file that was distributed with this source code. 11 | */ 12 | 13 | namespace Phalcon\DevTools\Web\Tools\Controllers; 14 | 15 | use Phalcon\DevTools\Mvc\Controller\Base; 16 | 17 | class SystemInfoController extends Base 18 | { 19 | /** 20 | * Initialize controller 21 | */ 22 | public function initialize() 23 | { 24 | $this->view->setVar('page_title', 'System Info'); 25 | } 26 | 27 | /** 28 | * @Get("/info", name="info-index") 29 | */ 30 | public function indexAction() 31 | { 32 | $this->view->setVars([ 33 | 'page_subtitle' => 'General information about the application', 34 | 'info' => $this->info, 35 | ]); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Web/Tools/Views/controllers/edit.volt: -------------------------------------------------------------------------------- 1 | {{ flashSession.output() }} 2 | 3 |
4 |
5 |
6 |
7 |

8 | {{ controller_name }} - [{{ controller_path }}] 9 |

10 |
11 |
12 |
13 |
14 | {{ text_area("code", "cols": 50, "rows": 25, "class": "form-control") }} 15 | {{ hidden_field("path") }} 16 |
17 | 18 |
19 | {{ submit_button("Save", "class": "btn btn-success pull-right") }} 20 |
21 |
22 |
23 |
24 |
25 | 26 | {{ assets.outputJs('codemirror') }} 27 | -------------------------------------------------------------------------------- /src/Web/Tools/Views/controllers/view.volt: -------------------------------------------------------------------------------- 1 | {{ flashSession.output() }} 2 | 3 |
4 |
5 |
6 |
7 |

{{ controller_name }} - [{{ controller_path }}]

8 |
9 |
10 |
11 |
12 | {{ text_area("code", "cols": 50, "rows": 25, "class": "form-control") }} 13 |
14 |
15 |
16 |
17 |
18 |
19 | 20 | {{ assets.outputJs('codemirror') }} 21 | -------------------------------------------------------------------------------- /src/Web/Tools/Views/error/route400.volt: -------------------------------------------------------------------------------- 1 | {% include 'partials/error' with ['code': code, 'head_message': head_message, 'message': message] %} 2 | -------------------------------------------------------------------------------- /src/Web/Tools/Views/error/route403.volt: -------------------------------------------------------------------------------- 1 | {% include 'partials/error' with ['code': code, 'head_message': head_message, 'message': message] %} 2 | -------------------------------------------------------------------------------- /src/Web/Tools/Views/error/route404.volt: -------------------------------------------------------------------------------- 1 | {% include 'partials/error' with ['code': code, 'head_message': head_message, 'message': message] %} 2 | -------------------------------------------------------------------------------- /src/Web/Tools/Views/error/route500.volt: -------------------------------------------------------------------------------- 1 | {% include 'partials/error' with ['code': code, 'head_message': head_message, 'message': message] %} 2 | -------------------------------------------------------------------------------- /src/Web/Tools/Views/index/index.volt: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |

Welcome to WebTools

6 |
7 | 8 |
9 | This application allows you to use 10 | {{ link_to(phalcon_url, "Phalcon", false, "target": "_blank") -}}  11 | {{- link_to(devtools_url, "Developer Tools", false, "target": "_blank") }} using a web interface. 12 |
13 |
14 |
15 |
16 | -------------------------------------------------------------------------------- /src/Web/Tools/Views/layouts/base.volt: -------------------------------------------------------------------------------- 1 | {{ get_doctype() }} 2 | 3 | 4 | 5 | 6 | {{ get_title() }} 7 | 8 | 9 | 10 | {{ stylesheet_link("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css", false) }} 11 | 12 | {{ assets.outputCss('main_css') }} 13 | {% block head_custom %}{% endblock %} 14 | 15 | 16 | {%- block body_start -%} 17 | 18 | {%- endblock -%} 19 | 20 |
21 | {% block header %}{% endblock %} 22 | {% block sidebar %}{% endblock %} 23 | 24 | {%- block wrapper_start -%} 25 |
26 | {%- endblock -%} 27 | 28 | {% block content %}{% endblock %} 29 | 30 | {%- block wrapper_end -%} 31 |
32 |
33 | {%- endblock -%} 34 | 35 | {% block footer %}{% endblock %} 36 |
37 | 38 | {% block footer_js %}{% endblock %} 39 | 40 | {%- block body_end -%} 41 | 42 | {%- endblock -%} 43 | 44 | -------------------------------------------------------------------------------- /src/Web/Tools/Views/layouts/error.volt: -------------------------------------------------------------------------------- 1 | {% extends "layouts/base.volt" %} 2 | 3 | {% block head_icons %} 4 | {%- endblock -%} 5 | 6 | {%- block body_start -%} 7 | 8 | {%- endblock -%} 9 | 10 | {%- block wrapper_start -%} 11 |
12 | {%- endblock -%} 13 | 14 | {% block content %} 15 | {{ content() }} 16 | {% endblock %} 17 | 18 | {%- block wrapper_end -%} 19 |
20 | {% endblock %} 21 | -------------------------------------------------------------------------------- /src/Web/Tools/Views/layouts/webtools.volt: -------------------------------------------------------------------------------- 1 | {% extends "layouts/base.volt" %} 2 | 3 | {% block header %} 4 | {% include 'partials/header.volt' %} 5 | {% endblock %} 6 | 7 | {% block head_custom %} 8 | {% include 'partials/custom_css.volt' %} 9 | {% endblock %} 10 | 11 | {% block sidebar %} 12 | {% include 'partials/sidebar.volt' %} 13 | {% endblock %} 14 | 15 | {% block content %} 16 | {% include 'partials/content_header.volt' %} 17 | {% include 'partials/content.volt' %} 18 | {% endblock %} 19 | 20 | {% block footer %} 21 | {% include 'partials/footer.volt' %} 22 | {% endblock %} 23 | 24 | {% block footer_js %} 25 | {{ assets.outputJs('footer') }} 26 | {% endblock %} 27 | -------------------------------------------------------------------------------- /src/Web/Tools/Views/models/edit.volt: -------------------------------------------------------------------------------- 1 | {{ flashSession.output() }} 2 | 3 |
4 |
5 |
6 |
7 |

{{ model_name }} - [{{ model_path }}]

8 |
9 |
10 |
11 |
12 | {{ text_area("code", "cols": 50, "rows": 25, "class": "form-control") }} 13 | {{ hidden_field("path") }} 14 |
15 | 16 |
17 | {{ submit_button("Save", "class": "btn btn-success pull-right") }} 18 |
19 |
20 |
21 |
22 |
23 | 24 | {{ assets.outputJs('codemirror') }} 25 | -------------------------------------------------------------------------------- /src/Web/Tools/Views/models/view.volt: -------------------------------------------------------------------------------- 1 | {{ flashSession.output() }} 2 | 3 |
4 |
5 |
6 |
7 |

{{ model_name }} - [{{ model_path }}]

8 |
9 |
10 |
11 |
12 | {{ text_area("code", "cols": 50, "rows": 25, "class": "form-control") }} 13 |
14 |
15 |
16 |
17 |
18 |
19 | 20 | {{ assets.outputJs('codemirror') }} 21 | -------------------------------------------------------------------------------- /src/Web/Tools/Views/partials/content.volt: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{ content() }} 4 |
5 |
6 | -------------------------------------------------------------------------------- /src/Web/Tools/Views/partials/content_header.volt: -------------------------------------------------------------------------------- 1 |
2 |
3 | {%- if page_title is defined and page_title is not empty -%} 4 |

5 | {{- page_title }}  6 | 7 | {%- if page_subtitle is defined and page_subtitle is not empty -%} 8 | {{ page_subtitle -}} 9 | {%- endif -%} 10 |

11 | {%- endif -%} 12 |
13 |
14 | -------------------------------------------------------------------------------- /src/Web/Tools/Views/partials/custom_css.volt: -------------------------------------------------------------------------------- 1 | {%- if custom_css is defined and custom_css is true -%} 2 | {{- assets.outputCss('custom_css') -}} 3 | {%- endif -%} 4 | -------------------------------------------------------------------------------- /src/Web/Tools/Views/partials/error.volt: -------------------------------------------------------------------------------- 1 | 4 | 5 |
6 |

{{ head_message }}

7 | 8 |

{{ message }}

9 |
10 | -------------------------------------------------------------------------------- /src/Web/Tools/Views/partials/footer.volt: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 10 |
11 |
12 |
13 | -------------------------------------------------------------------------------- /src/Web/Tools/Views/partials/header.volt: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /src/Web/Tools/Views/partials/inputs.volt: -------------------------------------------------------------------------------- 1 | {%- macro input(name, placeholder = "") %} 2 | {% return text_field(name, "class": "form-control", "id": name, "placeholder": placeholder) %} 3 | {%- endmacro %} 4 | 5 | {%- macro input_disabled(name) %} 6 | {% return text_field(name, "class": "form-control disabled", "id": name, "disabled": "disabled") %} 7 | {%- endmacro %} 8 | -------------------------------------------------------------------------------- /templates/.htrouter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view 9 | * the LICENSE file that was distributed with this source code. 10 | */ 11 | 12 | $uri = urldecode(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)); 13 | 14 | if ($uri !== '/' && file_exists(__DIR__ . '/public' . $uri)) { 15 | return false; 16 | } 17 | 18 | $_GET['_url'] = $_SERVER['REQUEST_URI']; 19 | 20 | require_once __DIR__ . '/public/index.php'; 21 | -------------------------------------------------------------------------------- /templates/module/config.ini: -------------------------------------------------------------------------------- 1 | [application] 2 | controllersDir = @@name@@/controllers/ 3 | modelsDir = @@name@@/models/ 4 | viewsDir = @@name@@/views/ 5 | -------------------------------------------------------------------------------- /templates/module/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "application": { 3 | "controllersDir": "@@name@@/controllers/", 4 | "modelsDir": "@@name@@/models/", 5 | "viewsDir": "@@name@@/views/" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /templates/module/config.php: -------------------------------------------------------------------------------- 1 | [ 5 | 'controllersDir' => __DIR__ . '/../controllers/', 6 | 'modelsDir' => __DIR__ . '/../models/', 7 | 'viewsDir' => __DIR__ . '/../views/', 8 | ] 9 | ]; 10 | -------------------------------------------------------------------------------- /templates/module/config.yaml: -------------------------------------------------------------------------------- 1 | application: 2 | controllersDir: !local /controllers/ 3 | modelsDir: !local /models/ 4 | viewsDir: !local /views/ 5 | -------------------------------------------------------------------------------- /templates/module/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "config-type": { 3 | "php": { 4 | "configLoader": "new Config(include __DIR__ . '/config/config.php')", 5 | "iniConfigImport": "use Phalcon\\Config;", 6 | "configName": "__DIR__ . '/config/config.php'", 7 | "useConfig": "" 8 | }, 9 | "ini": { 10 | "configLoader": "new Ini(__DIR__ . '/config/config.ini')", 11 | "iniConfigImport": "use Phalcon\\Config\\Adapter\\Ini;", 12 | "configName": "__DIR__ . '/config/config.ini'", 13 | "useConfig": "use Phalcon\\Config;" 14 | }, 15 | "yaml": { 16 | "configLoader": "new Yaml(__DIR__ . '/config/config.yaml', array('!local' => function($value) { return __DIR__ . $value; }))", 17 | "iniConfigImport": "use Phalcon\\Config\\Adapter\\Yaml;", 18 | "configName": "__DIR__ . '/config/config.yaml'", 19 | "useConfig": "use Phalcon\\Config;" 20 | }, 21 | "json": { 22 | "configLoader": "new Json(__DIR__ . '/config/config.json')", 23 | "iniConfigImport": "use Phalcon\\Config\\Adapter\\Json;", 24 | "configName": "__DIR__ . '/config/config.json'", 25 | "useConfig": "use Phalcon\\Config;" 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /templates/project/cli/MainTask.php: -------------------------------------------------------------------------------- 1 | getDI()->get('config'); 9 | 10 | echo $config['version']; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /templates/project/cli/config.ini: -------------------------------------------------------------------------------- 1 | ; If printNewLine is true, then we print a new line at the end of each execution 2 | ; 3 | ; If we dont print a new line, 4 | ; then the next command prompt will be placed directly on the left of the output 5 | ; and it is less readable. 6 | ; 7 | ; You can disable this behaviour if the output of your application needs to don't have a new line at end 8 | printNewLine = true 9 | 10 | version = 1.0 11 | -------------------------------------------------------------------------------- /templates/project/cli/config.php: -------------------------------------------------------------------------------- 1 | [ 5 | 'adapter' => 'Mysql', 6 | 'host' => 'localhost', 7 | 'username' => 'root', 8 | 'password' => '', 9 | 'dbname' => '@@name@@', 10 | 'charset' => 'utf8', 11 | ], 12 | 'version' => '1.0', 13 | 14 | /** 15 | * if true, then we print a new line at the end of each execution 16 | * 17 | * If we dont print a new line, 18 | * then the next command prompt will be placed directly on the left of the output 19 | * and it is less readable. 20 | * 21 | * You can disable this behaviour if the output of your application needs to don't have a new line at end 22 | */ 23 | 'printNewLine' => true 24 | ]); 25 | -------------------------------------------------------------------------------- /templates/project/cli/launcher: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | registerDirs([ 5 | APP_PATH . '/tasks', 6 | APP_PATH . '/models' 7 | ]); 8 | $loader->register(); 9 | -------------------------------------------------------------------------------- /templates/project/cli/services.php: -------------------------------------------------------------------------------- 1 | setShared('config', function () { 8 | return include APP_PATH . '/config/config.php'; 9 | }); 10 | 11 | /** 12 | * Database connection is created based in the parameters defined in the configuration file 13 | */ 14 | $di->setShared('db', function () { 15 | $config = $this->getConfig(); 16 | 17 | $class = 'Phalcon\Db\Adapter\Pdo\\' . $config->database->adapter; 18 | 19 | $params = [ 20 | 'host' => $config->database->host, 21 | 'username' => $config->database->username, 22 | 'password' => $config->database->password, 23 | 'dbname' => $config->database->dbname, 24 | 'charset' => $config->database->charset 25 | ]; 26 | 27 | if ($config->database->adapter == 'Postgresql') { 28 | unset($params['charset']); 29 | } 30 | 31 | return new $class($params); 32 | }); 33 | 34 | -------------------------------------------------------------------------------- /templates/project/micro/app.php: -------------------------------------------------------------------------------- 1 | get('/', function () { 12 | echo $this['view']->render('index'); 13 | }); 14 | 15 | /** 16 | * Not found handler 17 | */ 18 | $app->notFound(function () use($app) { 19 | $app->response->setStatusCode(404, "Not Found")->sendHeaders(); 20 | echo $app['view']->render('404'); 21 | }); 22 | -------------------------------------------------------------------------------- /templates/project/micro/config.ini: -------------------------------------------------------------------------------- 1 | [database] 2 | adapter = Mysql 3 | host = localhost 4 | username = root 5 | password = secret 6 | dbname = test 7 | 8 | [application] 9 | modelsDir = ../app/models/ 10 | migrationsDir = ../app/migrations/ 11 | viewsDir = ../app/views/ 12 | baseUri = / 13 | -------------------------------------------------------------------------------- /templates/project/micro/config.php: -------------------------------------------------------------------------------- 1 | [ 12 | 'adapter' => 'Mysql', 13 | 'host' => 'localhost', 14 | 'username' => 'root', 15 | 'password' => '', 16 | 'dbname' => 'test', 17 | 'charset' => 'utf8', 18 | ], 19 | 20 | 'application' => [ 21 | 'modelsDir' => APP_PATH . '/models/', 22 | 'migrationsDir' => APP_PATH . '/migrations/', 23 | 'viewsDir' => APP_PATH . '/views/', 24 | 'baseUri' => '/', 25 | ] 26 | ]); 27 | -------------------------------------------------------------------------------- /templates/project/micro/htaccess: -------------------------------------------------------------------------------- 1 | AddDefaultCharset UTF-8 2 | 3 | 4 | RewriteEngine On 5 | RewriteCond %{REQUEST_FILENAME} !-f 6 | RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L] 7 | -------------------------------------------------------------------------------- /templates/project/micro/index.php: -------------------------------------------------------------------------------- 1 | getConfig(); 28 | 29 | /** 30 | * Include Autoloader 31 | */ 32 | include APP_PATH . '/config/loader.php'; 33 | 34 | /** 35 | * Starting the application 36 | * Assign service locator to the application 37 | */ 38 | $app = new Micro($di); 39 | 40 | /** 41 | * Include Application 42 | */ 43 | include APP_PATH . '/app.php'; 44 | 45 | /** 46 | * Handle the request 47 | */ 48 | $app->handle($_SERVER['REQUEST_URI']); 49 | } catch (\Exception $e) { 50 | echo $e->getMessage() . '
'; 51 | echo '
' . $e->getTraceAsString() . '
'; 52 | } 53 | -------------------------------------------------------------------------------- /templates/project/micro/loader.php: -------------------------------------------------------------------------------- 1 | registerDirs( 9 | [ 10 | $config->application->modelsDir 11 | ] 12 | )->register(); 13 | -------------------------------------------------------------------------------- /templates/project/micro/services.php: -------------------------------------------------------------------------------- 1 | setShared('config', function () { 11 | return @@configLoader@@; 12 | }); 13 | 14 | /** 15 | * Sets the view component 16 | */ 17 | $di->setShared('view', function () { 18 | $config = $this->getConfig(); 19 | 20 | $view = new View(); 21 | $view->setViewsDir($config->application->viewsDir); 22 | return $view; 23 | }); 24 | 25 | /** 26 | * The URL component is used to generate all kind of urls in the application 27 | */ 28 | $di->setShared('url', function () { 29 | $config = $this->getConfig(); 30 | 31 | $url = new UrlResolver(); 32 | $url->setBaseUri($config->application->baseUri); 33 | return $url; 34 | }); 35 | 36 | /** 37 | * Database connection is created based in the parameters defined in the configuration file 38 | */ 39 | $di->setShared('db', function () { 40 | $config = $this->getConfig(); 41 | 42 | $class = 'Phalcon\Db\Adapter\Pdo\\' . $config->database->adapter; 43 | $params = [ 44 | 'host' => $config->database->host, 45 | 'username' => $config->database->username, 46 | 'password' => $config->database->password, 47 | 'dbname' => $config->database->dbname, 48 | 'charset' => $config->database->charset 49 | ]; 50 | 51 | if ($config->database->adapter == 'Postgresql') { 52 | unset($params['charset']); 53 | } 54 | 55 | $connection = new $class($params); 56 | 57 | return $connection; 58 | }); 59 | -------------------------------------------------------------------------------- /templates/project/micro/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "useConfigIni": { 3 | "true": { 4 | "configLoader": "new \\Phalcon\\Config\\Adapter\\Ini(APP_PATH . \"/config/config.ini\")" 5 | }, 6 | "false": { 7 | "configLoader": "include APP_PATH . \"/config/config.php\"" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /templates/project/micro/views/404.phtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Phalcon PHP Framework 8 | 9 | 10 |
11 |

Not found :(

12 | This page is located in views/404.phtml 13 |
14 | 15 | 16 | -------------------------------------------------------------------------------- /templates/project/micro/views/404.volt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Phalcon PHP Framework 8 | 9 | 10 |
11 |

Not found :(

12 | This page is located in views/404.volt 13 |
14 | 15 | 16 | -------------------------------------------------------------------------------- /templates/project/modules/ControllerBase.php: -------------------------------------------------------------------------------- 1 | registerNamespaces([ 22 | '@@namespace@@\Modules\Cli\Tasks' => __DIR__ . '/tasks/', 23 | ]); 24 | 25 | $loader->register(); 26 | } 27 | 28 | /** 29 | * Registers services related to the module 30 | * 31 | * @param DiInterface $di 32 | */ 33 | public function registerServices(DiInterface $di) 34 | { 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /templates/project/modules/Module_web.php: -------------------------------------------------------------------------------- 1 | registerNamespaces([ 24 | '@@namespace@@\Modules\Frontend\Controllers' => __DIR__ . '/controllers/', 25 | '@@namespace@@\Modules\Frontend\Models' => __DIR__ . '/models/', 26 | ]); 27 | 28 | $loader->register(); 29 | } 30 | 31 | /** 32 | * Registers services related to the module 33 | * 34 | * @param DiInterface $di 35 | */ 36 | public function registerServices(DiInterface $di) 37 | { 38 | /** 39 | * Setting up the view component 40 | */ 41 | $di->set('view', function () { 42 | $view = new View(); 43 | $view->setDI($this); 44 | $view->setViewsDir(__DIR__ . '/views/'); 45 | 46 | $view->registerEngines([ 47 | '.volt' => 'voltShared', 48 | '.phtml' => PhpEngine::class 49 | ]); 50 | 51 | return $view; 52 | }); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /templates/project/modules/VersionTask.php: -------------------------------------------------------------------------------- 1 | getDI()->get('config'); 11 | 12 | echo $config['version']; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /templates/project/modules/config.ini: -------------------------------------------------------------------------------- 1 | [database] 2 | adapter = Mysql 3 | host = localhost 4 | username = root 5 | password = secret 6 | dbname = @@name@@ 7 | 8 | [application] 9 | appDir = ../apps/ 10 | controllersDir = ../apps/frontend/controllers/ 11 | modelsDir = ../apps/frontend/models/ 12 | migrationsDir = ../apps/migrations/ 13 | cacheDir = ../../cache/ 14 | viewsDir = ../apps/frontend/views/ 15 | baseUri = / 16 | -------------------------------------------------------------------------------- /templates/project/modules/config.php: -------------------------------------------------------------------------------- 1 | '1.0', 11 | 12 | 'database' => [ 13 | 'adapter' => 'Mysql', 14 | 'host' => 'localhost', 15 | 'username' => 'root', 16 | 'password' => '', 17 | 'dbname' => '@@name@@', 18 | 'charset' => 'utf8', 19 | ], 20 | 21 | 'application' => [ 22 | 'appDir' => APP_PATH . '/', 23 | 'modelsDir' => APP_PATH . '/common/models/', 24 | 'migrationsDir' => APP_PATH . '/migrations/', 25 | 'cacheDir' => BASE_PATH . '/cache/', 26 | 'baseUri' => '/', 27 | ], 28 | 29 | /** 30 | * if true, then we print a new line at the end of each CLI execution 31 | * 32 | * If we dont print a new line, 33 | * then the next command prompt will be placed directly on the left of the output 34 | * and it is less readable. 35 | * 36 | * You can disable this behaviour if the output of your application needs to don't have a new line at end 37 | */ 38 | 'printNewLine' => true 39 | ]); 40 | -------------------------------------------------------------------------------- /templates/project/modules/htaccess: -------------------------------------------------------------------------------- 1 | AddDefaultCharset UTF-8 2 | 3 | 4 | RewriteEngine On 5 | RewriteCond %{REQUEST_FILENAME} !-d 6 | RewriteCond %{REQUEST_FILENAME} !-f 7 | RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L] 8 | -------------------------------------------------------------------------------- /templates/project/modules/index.php: -------------------------------------------------------------------------------- 1 | registerNamespaces([ 11 | '@@namespace@@\Models' => APP_PATH . '/common/models/', 12 | '@@namespace@@' => APP_PATH . '/common/library/', 13 | ]); 14 | 15 | /** 16 | * Register module classes 17 | */ 18 | $loader->registerClasses([ 19 | '@@namespace@@\Modules\Frontend\Module' => APP_PATH . '/modules/frontend/Module.php', 20 | '@@namespace@@\Modules\Cli\Module' => APP_PATH . '/modules/cli/Module.php' 21 | ]); 22 | 23 | $loader->register(); 24 | -------------------------------------------------------------------------------- /templates/project/modules/routes.php: -------------------------------------------------------------------------------- 1 | getRouter(); 4 | 5 | foreach ($application->getModules() as $key => $module) { 6 | $namespace = preg_replace('/Module$/', 'Controllers', $module['className']); 7 | 8 | $router->add('/'.$key.'/:params', [ 9 | 'namespace' => $namespace, 10 | 'module' => $key, 11 | 'controller' => 'index', 12 | 'action' => 'index', 13 | 'params' => 1 14 | ])->setName($key); 15 | 16 | $router->add('/'.$key.'/:controller/:params', [ 17 | 'namespace' => $namespace, 18 | 'module' => $key, 19 | 'controller' => 1, 20 | 'action' => 'index', 21 | 'params' => 2 22 | ]); 23 | 24 | $router->add('/'.$key.'/:controller/:action/:params', [ 25 | 'namespace' => $namespace, 26 | 'module' => $key, 27 | 'controller' => 1, 28 | 'action' => 2, 29 | 'params' => 3 30 | ]); 31 | } 32 | -------------------------------------------------------------------------------- /templates/project/modules/services_cli.php: -------------------------------------------------------------------------------- 1 | setShared('dispatcher', function() { 10 | $dispatcher = new Dispatcher(); 11 | $dispatcher->setDefaultNamespace('@@namespace@@\Modules\Cli\Tasks'); 12 | return $dispatcher; 13 | }); 14 | -------------------------------------------------------------------------------- /templates/project/modules/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "useConfigIni": { 3 | "true": { 4 | "configLoader": "new Ini(APP_PATH . \"/config/config.ini\")", 5 | "iniConfigImport": "use Phalcon\\Config\\Adapter\\Ini;" 6 | }, 7 | "false": { 8 | "configLoader": "include APP_PATH . \"/config/config.php\"", 9 | "iniConfigImport": "" 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /templates/project/modules/views/index.phtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Phalcon PHP Framework 9 | 10 | 11 | 12 | 13 |
14 | getContent(); ?> 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /templates/project/modules/views/index.volt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Phalcon PHP Framework 9 | 10 | 11 | 12 | 13 |
14 | {{ content() }} 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /templates/project/modules/views/index/index.phtml: -------------------------------------------------------------------------------- 1 | 4 | 5 |

You're now flying with Phalcon. Great things are about to happen!

6 | 7 |

This page is located at views/index/index.phtml

8 | -------------------------------------------------------------------------------- /templates/project/modules/views/index/index.volt: -------------------------------------------------------------------------------- 1 | 4 | 5 |

You're now flying with Phalcon. Great things are about to happen!

6 | 7 |

This page is located at views/index/index.volt

8 | -------------------------------------------------------------------------------- /templates/project/simple/ControllerBase.php: -------------------------------------------------------------------------------- 1 | [ 12 | 'adapter' => 'Mysql', 13 | 'host' => 'localhost', 14 | 'username' => 'root', 15 | 'password' => '', 16 | 'dbname' => 'test', 17 | 'charset' => 'utf8', 18 | ], 19 | 'application' => [ 20 | 'appDir' => APP_PATH . '/', 21 | 'controllersDir' => APP_PATH . '/controllers/', 22 | 'modelsDir' => APP_PATH . '/models/', 23 | 'migrationsDir' => APP_PATH . '/migrations/', 24 | 'viewsDir' => APP_PATH . '/views/', 25 | 'pluginsDir' => APP_PATH . '/plugins/', 26 | 'libraryDir' => APP_PATH . '/library/', 27 | 'cacheDir' => BASE_PATH . '/cache/', 28 | 'baseUri' => '/', 29 | ] 30 | ]); 31 | -------------------------------------------------------------------------------- /templates/project/simple/htaccess: -------------------------------------------------------------------------------- 1 | AddDefaultCharset UTF-8 2 | 3 | 4 | RewriteEngine On 5 | RewriteCond %{REQUEST_FILENAME} !-d 6 | RewriteCond %{REQUEST_FILENAME} !-f 7 | RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L] 8 | -------------------------------------------------------------------------------- /templates/project/simple/index.php: -------------------------------------------------------------------------------- 1 | getConfig(); 32 | 33 | /** 34 | * Include Autoloader 35 | */ 36 | include APP_PATH . '/config/loader.php'; 37 | 38 | /** 39 | * Handle the request 40 | */ 41 | $application = new \Phalcon\Mvc\Application($di); 42 | 43 | echo $application->handle($_SERVER['REQUEST_URI'])->getContent(); 44 | } catch (\Exception $e) { 45 | echo $e->getMessage() . '
'; 46 | echo '
' . $e->getTraceAsString() . '
'; 47 | } 48 | -------------------------------------------------------------------------------- /templates/project/simple/loader.php: -------------------------------------------------------------------------------- 1 | registerDirs( 9 | [ 10 | $config->application->controllersDir, 11 | $config->application->modelsDir 12 | ] 13 | )->register(); 14 | -------------------------------------------------------------------------------- /templates/project/simple/router.php: -------------------------------------------------------------------------------- 1 | getRouter(); 4 | 5 | // Define your routes here 6 | 7 | $router->handle($_SERVER['REQUEST_URI']); 8 | -------------------------------------------------------------------------------- /templates/project/simple/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "useConfigIni": { 3 | "true": { 4 | "configLoader": "new \\Phalcon\\Config\\Adapter\\Ini(APP_PATH . \"/config/config.ini\")" 5 | }, 6 | "false": { 7 | "configLoader": "include APP_PATH . \"/config/config.php\"" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /templates/project/simple/views/index.phtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Phalcon PHP Framework 9 | 10 | 11 | 12 | 13 |
14 | getContent(); ?> 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /templates/project/simple/views/index.volt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Phalcon PHP Framework 9 | 10 | 11 | 12 | 13 |
14 | {{ content() }} 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /templates/project/simple/views/index/index.phtml: -------------------------------------------------------------------------------- 1 | 4 | 5 |

You're now flying with Phalcon. Great things are about to happen!

6 | 7 |

This page is located at views/index/index.phtml

8 | -------------------------------------------------------------------------------- /templates/project/simple/views/index/index.volt: -------------------------------------------------------------------------------- 1 | 4 | 5 |

You're now flying with Phalcon. Great things are about to happen!

6 | 7 |

This page is located at views/index/index.volt

8 | -------------------------------------------------------------------------------- /templates/scaffold/no-forms/views/edit.phtml: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 | 13 |
14 | 15 | 18 | 19 | getContent(); ?> 20 | 21 |
22 | $captureFields$ 23 | tag->hiddenField("id") ?> 24 | 25 |
26 |
27 | tag->submitButton(["Save", "class" => "btn btn-default"]) ?> 28 |
29 |
30 |
31 | -------------------------------------------------------------------------------- /templates/scaffold/no-forms/views/edit.volt: -------------------------------------------------------------------------------- 1 |
2 | 7 |
8 | 9 | 12 | 13 | {{ content() }} 14 | 15 |
16 | $captureFields$ 17 | {{ hidden_field("id") }} 18 | 19 |
20 |
21 | {{ submit_button('Send', 'class': 'btn btn-default') }} 22 |
23 |
24 |
25 | -------------------------------------------------------------------------------- /templates/scaffold/no-forms/views/index.phtml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 11 | 12 | getContent() ?> 13 | 14 | flash->output() ?> 15 | 16 |
17 | $captureFields$ 18 |
19 |
20 | tag->submitButton(["Search", "class" => "btn btn-default"]) ?> 21 |
22 |
23 |
24 | -------------------------------------------------------------------------------- /templates/scaffold/no-forms/views/index.volt: -------------------------------------------------------------------------------- 1 | 5 | 6 | {{ content() }} 7 | 8 | {{ flash.output() }} 9 | 10 |
11 | $captureFields$ 12 |
13 |
14 | {{ submit_button('Search', 'class': 'btn btn-default') }} 15 |
16 |
17 |
18 | -------------------------------------------------------------------------------- /templates/scaffold/no-forms/views/new.phtml: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 | 13 |
14 | 15 | 18 | 19 | getContent(); ?> 20 | 21 |
22 | $captureFields$ 23 |
24 |
25 | tag->submitButton(["Save", "class" => "btn btn-default"]) ?> 26 |
27 |
28 |
29 | -------------------------------------------------------------------------------- /templates/scaffold/no-forms/views/new.volt: -------------------------------------------------------------------------------- 1 |
2 | 7 |
8 | 9 | 12 | 13 | {{ content() }} 14 | 15 |
16 | $captureFields$ 17 |
18 |
19 | {{ submit_button('Save', 'class': 'btn btn-default') }} 20 |
21 |
22 |
23 | -------------------------------------------------------------------------------- /tests/.env.test: -------------------------------------------------------------------------------- 1 | CODECEPTION_URL=127.0.0.1 2 | CODECEPTION_PORT=8000 3 | 4 | MYSQL_DB_PASSWORD='' 5 | MYSQL_DB_PORT=3306 6 | POSTGRES_DB_PORT=5432 7 | -------------------------------------------------------------------------------- /tests/_ci/setup_dbs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # This file is part of the Phalcon Framework. 4 | # 5 | # (c) Phalcon Team 6 | # 7 | # For the full copyright and license information, please view the 8 | # LICENSE.txt file that was distributed with this source code. 9 | 10 | CURRENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 11 | TRAVIS_BUILD_DIR="${TRAVIS_BUILD_DIR:-$(dirname $(dirname $CURRENT_DIR))}" 12 | 13 | echo -e "Create PostgreSQL database..." 14 | psql -c 'create database devtools;' -U postgres 15 | psql -U postgres devtools -q -f "${TRAVIS_BUILD_DIR}/tests/_data/schemas/postgresql/dump.sql" 16 | echo -e "Done\n" 17 | 18 | echo -e "Create MySQL database..." 19 | mysql -u root -e "CREATE DATABASE IF NOT EXISTS devtools charset=utf8 collate=utf8_general_ci;" 20 | cat "${TRAVIS_BUILD_DIR}/tests/_data/schemas/mysql/dump.sql" | mysql -u root devtools 21 | echo -e "Done\n" 22 | 23 | wait 24 | -------------------------------------------------------------------------------- /tests/_ci/setup_dbs_github.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # This file is part of the Phalcon Framework. 4 | # 5 | # (c) Phalcon Team 6 | # 7 | # For the full copyright and license information, please view the 8 | # LICENSE.txt file that was distributed with this source code. 9 | 10 | CURRENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 11 | BUILD_DIR="${BUILD_DIR:-"$( dirname "$( dirname "$CURRENT_DIR" ) ")"}" 12 | echo -e "Create PostgreSQL database..." 13 | psql -U postgres devtools -p "$POSTGRES_DB_PORT" -h localhost -q -f "${BUILD_DIR}/tests/_data/schemas/postgresql/dump.sql" 14 | echo -e "Done\n" 15 | 16 | echo -e "Create MySQL database..." 17 | cat "${BUILD_DIR}/tests/_data/schemas/mysql/dump.sql" | mysql --host=127.0.0.1 --user=root --password=root --port="$MYSQL_DB_PORT" --database devtools 18 | 19 | echo -e "Check database created" 20 | mysql --host=127.0.0.1 --user=root --password=root --port="$MYSQL_DB_PORT" -e 'show databases;' 21 | echo -e "Done\n" 22 | 23 | wait 24 | -------------------------------------------------------------------------------- /tests/_data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/phalcon-devtools/e3f1aeb6614b095afae854dc5b1b9a99ae886174/tests/_data/.gitkeep -------------------------------------------------------------------------------- /tests/_data/acceptance/mysql/config.php: -------------------------------------------------------------------------------- 1 | [ 13 | 'adapter' => 'Mysql', 14 | 'host' => '127.0.0.1', 15 | 'username' => 'root', 16 | 'password' => getenv('MYSQL_DB_PASSWORD'), 17 | 'dbname' => 'devtools', 18 | 'port' => getenv('MYSQL_DB_PORT'), 19 | 'charset' => 'utf8' 20 | ], 21 | 'application' => [ 22 | 'appDir' => APP_PATH . '/', 23 | 'controllersDir' => APP_PATH . '/controllers/', 24 | 'modelsDir' => APP_PATH . '/models/', 25 | 'migrationsDir' => APP_PATH . '/migrations/', 26 | 'viewsDir' => APP_PATH . '/views/', 27 | 'pluginsDir' => APP_PATH . '/plugins/', 28 | 'libraryDir' => APP_PATH . '/library/', 29 | 'cacheDir' => BASE_PATH . '/cache/', 30 | 'baseUri' => '/', 31 | ] 32 | ]); 33 | -------------------------------------------------------------------------------- /tests/_data/acceptance/pgsql/config.php: -------------------------------------------------------------------------------- 1 | [ 12 | 'adapter' => 'Postgresql', 13 | 'host' => 'localhost', 14 | 'username' => 'postgres', 15 | 'password' => '', 16 | 'dbname' => 'devtools', 17 | 'port' => getenv('POSTGRES_DB_PORT'), 18 | ], 19 | 'application' => [ 20 | 'appDir' => APP_PATH . '/', 21 | 'controllersDir' => APP_PATH . '/controllers/', 22 | 'modelsDir' => APP_PATH . '/models/', 23 | 'migrationsDir' => APP_PATH . '/migrations/', 24 | 'viewsDir' => APP_PATH . '/views/', 25 | 'pluginsDir' => APP_PATH . '/plugins/', 26 | 'libraryDir' => APP_PATH . '/library/', 27 | 'cacheDir' => BASE_PATH . '/cache/', 28 | 'baseUri' => '/', 29 | ] 30 | ]); 31 | -------------------------------------------------------------------------------- /tests/_data/console/.phalcon/.gitignore: -------------------------------------------------------------------------------- 1 | !.gitignore 2 | -------------------------------------------------------------------------------- /tests/_data/console/app/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/phalcon-devtools/e3f1aeb6614b095afae854dc5b1b9a99ae886174/tests/_data/console/app/controllers/.gitkeep -------------------------------------------------------------------------------- /tests/_data/console/app/models/files/TestModel2.php: -------------------------------------------------------------------------------- 1 | setSchema("devtools"); 28 | $this->setSource("test-model2"); 29 | } 30 | 31 | /** 32 | * Allows to query a set of records that match the specified conditions 33 | * 34 | * @param mixed $parameters 35 | * @return TestModel2[]|TestModel2|\Phalcon\Mvc\Model\ResultSetInterface 36 | */ 37 | public static function find($parameters = null): \Phalcon\Mvc\Model\ResultsetInterface 38 | { 39 | return parent::find($parameters); 40 | } 41 | 42 | /** 43 | * Allows to query the first record that match the specified conditions 44 | * 45 | * @param mixed $parameters 46 | * @return TestModel2|\Phalcon\Mvc\Model\ResultInterface|\Phalcon\Mvc\ModelInterface|null 47 | */ 48 | public static function findFirst($parameters = null): ?\Phalcon\Mvc\ModelInterface 49 | { 50 | return parent::findFirst($parameters); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /tests/_data/console/app/models/files/TestModel3.php: -------------------------------------------------------------------------------- 1 | setSchema("devtools"); 28 | $this->setSource("test_model3"); 29 | } 30 | 31 | /** 32 | * Allows to query a set of records that match the specified conditions 33 | * 34 | * @param mixed $parameters 35 | * @return TestModel3[]|TestModel3|\Phalcon\Mvc\Model\ResultSetInterface 36 | */ 37 | public static function find($parameters = null): \Phalcon\Mvc\Model\ResultsetInterface 38 | { 39 | return parent::find($parameters); 40 | } 41 | 42 | /** 43 | * Allows to query the first record that match the specified conditions 44 | * 45 | * @param mixed $parameters 46 | * @return TestModel3|\Phalcon\Mvc\Model\ResultInterface|\Phalcon\Mvc\ModelInterface|null 47 | */ 48 | public static function findFirst($parameters = null): ?\Phalcon\Mvc\ModelInterface 49 | { 50 | return parent::findFirst($parameters); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /tests/_data/console/app/models/files/TestModel5.php: -------------------------------------------------------------------------------- 1 | setSource("TestModel5"); 28 | } 29 | 30 | /** 31 | * Allows to query a set of records that match the specified conditions 32 | * 33 | * @param mixed $parameters 34 | * @return TestModel5[]|TestModel5|\Phalcon\Mvc\Model\ResultSetInterface 35 | */ 36 | public static function find($parameters = null): \Phalcon\Mvc\Model\ResultsetInterface 37 | { 38 | return parent::find($parameters); 39 | } 40 | 41 | /** 42 | * Allows to query the first record that match the specified conditions 43 | * 44 | * @param mixed $parameters 45 | * @return TestModel5|\Phalcon\Mvc\Model\ResultInterface|\Phalcon\Mvc\ModelInterface|null 46 | */ 47 | public static function findFirst($parameters = null): ?\Phalcon\Mvc\ModelInterface 48 | { 49 | return parent::findFirst($parameters); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /tests/_data/console/app/models/files/Testmodel4.php: -------------------------------------------------------------------------------- 1 | setSchema("devtools"); 28 | $this->setSource("Testmodel4"); 29 | } 30 | 31 | /** 32 | * Allows to query a set of records that match the specified conditions 33 | * 34 | * @param mixed $parameters 35 | * @return Testmodel4[]|Testmodel4|\Phalcon\Mvc\Model\ResultSetInterface 36 | */ 37 | public static function find($parameters = null): \Phalcon\Mvc\Model\ResultsetInterface 38 | { 39 | return parent::find($parameters); 40 | } 41 | 42 | /** 43 | * Allows to query the first record that match the specified conditions 44 | * 45 | * @param mixed $parameters 46 | * @return Testmodel4|\Phalcon\Mvc\Model\ResultInterface|\Phalcon\Mvc\ModelInterface|null 47 | */ 48 | public static function findFirst($parameters = null): ?\Phalcon\Mvc\ModelInterface 49 | { 50 | return parent::findFirst($parameters); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /tests/_data/console/app/mysql/config.php: -------------------------------------------------------------------------------- 1 | [ 8 | 'adapter' => 'Mysql', 9 | 'host' => '127.0.0.1', 10 | 'username' => 'root', 11 | 'password' => env('MYSQL_DB_PASSWORD'), 12 | 'dbname' => 'devtools', 13 | 'port' => env('MYSQL_DB_PORT') 14 | ], 15 | 'logger' => [ 16 | 'path' => tests_path('_output/logs/console/mysql/'), 17 | 'format' => '%date% [%type%] %message%', 18 | 'date' => 'D j H:i:s', 19 | 'logLevel' => Logger::DEBUG, 20 | 'filename' => 'tests.log', 21 | ], 22 | 'application' => [ 23 | 'controllersDir' => app_path() . '/controllers/', 24 | 'modelsDir' => app_path() . '/models/', 25 | 'viewsDir' => app_path() . '/views/', 26 | ], 27 | ]); 28 | -------------------------------------------------------------------------------- /tests/_data/console/app/postgresql/config.php: -------------------------------------------------------------------------------- 1 | [ 8 | 'adapter' => 'Postgresql', 9 | 'host' => env('TEST_DB_POSTGRESQL_HOST', '127.0.0.1'), 10 | 'username' => env('TEST_DB_POSTGRESQL_USER', 'postgres'), 11 | 'password' => env('TEST_DB_POSTGRESQL_PASSWD', ''), 12 | 'dbname' => env('TEST_DB_POSTGRESQL_NAME', 'devtools'), 13 | 'schema' => env('TEST_DB_POSTGRESQL_SCHEMA', 'public') 14 | ], 15 | 'logger' => [ 16 | 'path' => tests_path('_output/logs/console/postgresql/'), 17 | 'format' => '%date% [%type%] %message%', 18 | 'date' => 'D j H:i:s', 19 | 'logLevel' => Logger::DEBUG, 20 | 'filename' => 'tests.log', 21 | ] 22 | ]); 23 | -------------------------------------------------------------------------------- /tests/_data/console/app/projects/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/_data/console/app/views/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/phalcon-devtools/e3f1aeb6614b095afae854dc5b1b9a99ae886174/tests/_data/console/app/views/.gitkeep -------------------------------------------------------------------------------- /tests/_envs/mysql.yml: -------------------------------------------------------------------------------- 1 | # `postgres` environment config goes here 2 | modules: 3 | enabled: 4 | # - Db: 5 | # dsn: 'mysql:host=%MYSQL_TEST_DB_HOST%;port=%MYSQL_TEST_DB_PORT%' 6 | # user: '%MYSQL_TEST_DB_USER%' 7 | # password: '%MYSQL_TEST_DB_PASSWORD%' 8 | # cleanup: true 9 | # reconnect: true 10 | # waitlock: 10 11 | # initial_queries: 12 | # - "SET NAMES utf8;" 13 | # - "CREATE DATABASE IF NOT EXISTS `%MYSQL_TEST_DB_DATABASE%`" 14 | # - "SET GLOBAL sql_mode='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'" 15 | # - "SET FOREIGN_KEY_CHECKS=1" 16 | # - "SET GLOBAL FOREIGN_KEY_CHECKS=1" 17 | # - "USE `%MYSQL_TEST_DB_DATABASE%`" 18 | # dump: tests/_data/schemas/mysql/dump.sql 19 | -------------------------------------------------------------------------------- /tests/_envs/pgsql.yml: -------------------------------------------------------------------------------- 1 | # `postgres` environment config goes here 2 | modules: 3 | enabled: 4 | # - Db: 5 | # dsn: 'pgsql:host=%POSTGRES_TEST_DB_HOST%;dbname=%POSTGRES_TEST_DB_DATABASE%;port=%POSTGRES_TEST_DB_PORT%' 6 | # user: '%POSTGRES_TEST_DB_USER%' 7 | # password: '%POSTGRES_TEST_DB_PASSWORD%' 8 | # cleanup: true 9 | # reconnect: true 10 | # waitlock: 10 11 | # dump: tests/_data/schemas/postgresql/dump.sql 12 | -------------------------------------------------------------------------------- /tests/_output/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /tests/_support/AcceptanceTester.php: -------------------------------------------------------------------------------- 1 | projectPath = tests_path('_data/acceptance/' . $this->projectName); 23 | } 24 | 25 | public function _before(TestInterface $test) 26 | { 27 | $driver = $test->getMetadata()->getCurrent('env'); 28 | if (!empty($driver)) { 29 | $this->driver = $driver; 30 | } 31 | 32 | if (true === in_array($driver, ['mysql', 'pgsql'])) { 33 | 34 | $codeceptionDataFile = PATH_DATA . 'acceptance' . 35 | DIRECTORY_SEPARATOR . $driver . 36 | DIRECTORY_SEPARATOR . 'config.php'; 37 | 38 | $targetWebtoolFile = PROJECT_PATH . 'webtools' . 39 | DIRECTORY_SEPARATOR . 'app' . 40 | DIRECTORY_SEPARATOR . 'config' . 41 | DIRECTORY_SEPARATOR . 'config.php'; 42 | 43 | copy($codeceptionDataFile, $targetWebtoolFile); 44 | } 45 | 46 | parent::_before($test); 47 | 48 | //shell_exec('phalcon project --directory=' . $this->projectPath); 49 | } 50 | 51 | public function _after(TestInterface $test) 52 | { 53 | parent::_after($test); 54 | 55 | //shell_exec('rm -rf ' . $this->projectPath); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /tests/_support/Helper/Console.php: -------------------------------------------------------------------------------- 1 | 16 | * @author Nikolaos Dimopoulos 17 | * @package Phalcon\Test\Module 18 | * 19 | * The contents of this file are subject to the New BSD License that is 20 | * bundled with this package in the file LICENSE.txt 21 | * 22 | * If you did not receive a copy of the license and are unable to obtain it 23 | * through the world-wide-web, please send an email to license@phalcon.io 24 | * so that we can send you a copy immediately. 25 | */ 26 | class UnitTest extends Unit 27 | { 28 | use Specify; 29 | 30 | /** 31 | * UnitTester Object 32 | * @var UnitTester 33 | */ 34 | protected $tester; 35 | } 36 | -------------------------------------------------------------------------------- /tests/_support/UnitTester.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view 9 | * the LICENSE file that was distributed with this source code. 10 | */ 11 | 12 | if (!function_exists('app_path')) { 13 | /** 14 | * Get the application path. 15 | * 16 | * @param string $path 17 | * @return string 18 | */ 19 | function app_path($path = '') 20 | { 21 | $returnPath = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_data'. DIRECTORY_SEPARATOR; 22 | $returnPath .= 'console' . DIRECTORY_SEPARATOR . 'app' . ($path ? DIRECTORY_SEPARATOR . $path : $path); 23 | 24 | return $returnPath; 25 | } 26 | } 27 | 28 | if (!function_exists('tests_path')) { 29 | /** 30 | * Get the tests path. 31 | * 32 | * @param string $path 33 | * @return string 34 | */ 35 | function tests_path($path = '') 36 | { 37 | return dirname(__DIR__) . DIRECTORY_SEPARATOR . ($path ? DIRECTORY_SEPARATOR . $path : $path); 38 | } 39 | } 40 | 41 | if (!function_exists('env')) { 42 | function env($key, $default = null) 43 | { 44 | if (defined($key)) { 45 | return constant($key); 46 | } 47 | 48 | return getenv($key) ?: $default; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /tests/acceptance.suite.yml: -------------------------------------------------------------------------------- 1 | # Codeception Test Suite Configuration 2 | # 3 | # Suite for acceptance tests. 4 | # Perform tests in browser using the WebDriver or PhpBrowser. 5 | # If you need both WebDriver and PHPBrowser tests - create a separate suite. 6 | 7 | actor: AcceptanceTester 8 | modules: 9 | enabled: 10 | - PhpBrowser: 11 | url: 'http://%CODECEPTION_URL%:%CODECEPTION_PORT%' 12 | curl: 13 | CURLOPT_RETURNTRANSFER: true 14 | - \Helper\Acceptance 15 | - Filesystem 16 | step_decorators: ~ 17 | -------------------------------------------------------------------------------- /tests/acceptance/Web/Tools/Controllers/ErrorControllerCest.php: -------------------------------------------------------------------------------- 1 | skip('Deprecated approach'); 18 | 19 | $I->amOnPage('/webtools.php/404'); 20 | $I->see('404'); 21 | $I->see('Not Found'); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tests/acceptance/Web/Tools/Controllers/IndexControllerCest.php: -------------------------------------------------------------------------------- 1 | amOnPage('/webtools.php/'); 18 | $I->see('Dashboard'); 19 | $I->see('Welcome to WebTools'); 20 | 21 | $I->amOnPage('/webtools.php'); 22 | $I->see('Dashboard'); 23 | $I->see('Welcome to WebTools'); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/acceptance/Web/Tools/Controllers/SystemInfoControllerCest.php: -------------------------------------------------------------------------------- 1 | amOnPage('/webtools.php/info'); 18 | $I->see('System Info'); 19 | $I->see('General information about the application'); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/console.suite.yml: -------------------------------------------------------------------------------- 1 | # Codeception Test Suite Configuration 2 | 3 | # suite for console tests. 4 | # RUN `build` COMMAND AFTER ADDING/REMOVING MODULES. 5 | 6 | class_name: ConsoleTester 7 | modules: 8 | enabled: 9 | - Helper\Console 10 | - Filesystem 11 | - Asserts 12 | - Cli 13 | Phalcon: 14 | bootstrap: 'tests/_bootstrap.php' 15 | -------------------------------------------------------------------------------- /tests/console/_bootstrap.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view 9 | * the LICENSE file that was distributed with this source code. 10 | */ 11 | 12 | if (!function_exists('env')) { 13 | function env($key, $default = null) 14 | { 15 | if (defined($key)) { 16 | return constant($key); 17 | } 18 | 19 | return getenv($key) ?: $default; 20 | } 21 | } 22 | 23 | /** 24 | * @param string $path 25 | */ 26 | if (!function_exists('remove_dir')) { 27 | function remove_dir(string $path): void 28 | { 29 | $directoryIterator = new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS); 30 | $iterator = new \RecursiveIteratorIterator($directoryIterator, \RecursiveIteratorIterator::CHILD_FIRST); 31 | foreach ($iterator as $file) { 32 | if ($file->getFileName() === '.gitignore') { 33 | continue; 34 | } 35 | 36 | $realPath = $file->getRealPath(); 37 | $file->isDir() ? rmdir($realPath) : unlink($realPath); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /tests/unit.suite.yml: -------------------------------------------------------------------------------- 1 | # Codeception Test Suite Configuration 2 | # 3 | # Suite for unit or integration tests. 4 | 5 | actor: UnitTester 6 | modules: 7 | # enabled modules and helpers 8 | enabled: 9 | - Asserts 10 | - \Helper\Unit 11 | config: 12 | Db: 13 | dsn: "%TEST_DB_MYSQL_HOST%" 14 | user: "%TEST_DB_MYSQL_USER%" 15 | password: "%TEST_DB_MYSQL_PASSWD%" 16 | dump: tests/_data/schemas/mysql/dump.sql 17 | populate: false 18 | cleanup: false 19 | -------------------------------------------------------------------------------- /tests/unit/Access/ManagerTest.php: -------------------------------------------------------------------------------- 1 | createMock(Manager::class); 15 | 16 | $this->assertInstanceOf(Injectable::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Access/Policy/IpTest.php: -------------------------------------------------------------------------------- 1 | getMethod('checkIp'); 34 | $checkIpMethod->setAccessible(true); 35 | 36 | $ipClass = new Ip($ip); 37 | 38 | $this->assertSame($expected, $checkIpMethod->invokeArgs($ipClass, [$allowedIp])); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /tests/unit/BootstrapTest.php: -------------------------------------------------------------------------------- 1 | createPartialMock(Bootstrap::class, ['getCurrentUri']); 15 | 16 | $this->assertIsString($class->getCurrentUri()); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Builder/Component/AllModelsTest.php: -------------------------------------------------------------------------------- 1 | createMock(AllModels::class); 15 | 16 | $this->assertInstanceOf(AbstractComponent::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Builder/Component/ControllerTest.php: -------------------------------------------------------------------------------- 1 | createMock(Controller::class); 15 | 16 | $this->assertInstanceOf(AbstractComponent::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Builder/Component/ModelTest.php: -------------------------------------------------------------------------------- 1 | createMock(Model::class); 15 | 16 | $this->assertInstanceOf(AbstractComponent::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Builder/Component/ModuleTest.php: -------------------------------------------------------------------------------- 1 | createMock(Module::class); 15 | 16 | $this->assertInstanceOf(AbstractComponent::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Builder/Component/ProjectTest.php: -------------------------------------------------------------------------------- 1 | createMock(Project::class); 15 | 16 | $this->assertInstanceOf(AbstractComponent::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Builder/Component/ScaffoldTest.php: -------------------------------------------------------------------------------- 1 | createMock(Scaffold::class); 15 | 16 | $this->assertInstanceOf(AbstractComponent::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Builder/Project/CliTest.php: -------------------------------------------------------------------------------- 1 | createMock(Cli::class); 15 | 16 | $this->assertInstanceOf(ProjectBuilder::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Builder/Project/MicroTest.php: -------------------------------------------------------------------------------- 1 | createMock(Micro::class); 15 | 16 | $this->assertInstanceOf(ProjectBuilder::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Builder/Project/ModulesTest.php: -------------------------------------------------------------------------------- 1 | createMock(Modules::class); 15 | 16 | $this->assertInstanceOf(ProjectBuilder::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Builder/Project/SimpleTest.php: -------------------------------------------------------------------------------- 1 | createMock(Simple::class); 15 | 16 | $this->assertInstanceOf(ProjectBuilder::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Generator/SnippetTest.php: -------------------------------------------------------------------------------- 1 | snippet = new Snippet(); 22 | } 23 | 24 | public function testGetClass(): void 25 | { 26 | $expected = << 'Test', 40 | ]); 41 | 42 | $classString = $this->snippet->getClass( 43 | 'namespace Test\DevTools;' . PHP_EOL . PHP_EOL, 44 | '', 45 | '', 46 | '', 47 | $options, 48 | 'BaseClass', 49 | '' 50 | ); 51 | 52 | $this->assertSame($expected, $classString); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /tests/unit/Providers/AccessManagerProviderTest.php: -------------------------------------------------------------------------------- 1 | createMock(AccessManagerProvider::class); 15 | 16 | $this->assertInstanceOf(ServiceProviderInterface::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Providers/AnnotationsProviderTest.php: -------------------------------------------------------------------------------- 1 | createMock(AnnotationsProvider::class); 15 | 16 | $this->assertInstanceOf(ServiceProviderInterface::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Providers/AssetsProviderTest.php: -------------------------------------------------------------------------------- 1 | createMock(AssetsProvider::class); 15 | 16 | $this->assertInstanceOf(ServiceProviderInterface::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Providers/AssetsResourceProviderTest.php: -------------------------------------------------------------------------------- 1 | createMock(AssetsResourceProvider::class); 15 | 16 | $this->assertInstanceOf(ServiceProviderInterface::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Providers/ConfigProviderTest.php: -------------------------------------------------------------------------------- 1 | createMock(ConfigProvider::class); 15 | 16 | $this->assertInstanceOf(ServiceProviderInterface::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Providers/DataCacheProviderTest.php: -------------------------------------------------------------------------------- 1 | createMock(DataCacheProvider::class); 15 | 16 | $this->assertInstanceOf(ServiceProviderInterface::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Providers/DatabaseProviderTest.php: -------------------------------------------------------------------------------- 1 | createMock(DatabaseProvider::class); 15 | 16 | $this->assertInstanceOf(ServiceProviderInterface::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Providers/DbUtilsProviderTest.php: -------------------------------------------------------------------------------- 1 | createMock(DbUtilsProvider::class); 15 | 16 | $this->assertInstanceOf(ServiceProviderInterface::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Providers/DispatcherProviderTest.php: -------------------------------------------------------------------------------- 1 | createMock(DispatcherProvider::class); 15 | 16 | $this->assertInstanceOf(ServiceProviderInterface::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Providers/EventsManagerProviderTest.php: -------------------------------------------------------------------------------- 1 | createMock(EventsManagerProvider::class); 15 | 16 | $this->assertInstanceOf(ServiceProviderInterface::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Providers/FileSystemProviderTest.php: -------------------------------------------------------------------------------- 1 | createMock(FlashSessionProvider::class); 15 | 16 | $this->assertInstanceOf(ServiceProviderInterface::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Providers/FlashSessionProviderTest.php: -------------------------------------------------------------------------------- 1 | createMock(FlashSessionProvider::class); 15 | 16 | $this->assertInstanceOf(ServiceProviderInterface::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Providers/LoggerProviderTest.php: -------------------------------------------------------------------------------- 1 | createMock(LoggerProvider::class); 15 | 16 | $this->assertInstanceOf(ServiceProviderInterface::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Providers/ModelsCacheProviderTest.php: -------------------------------------------------------------------------------- 1 | createMock(ModelsCacheProvider::class); 15 | 16 | $this->assertInstanceOf(ServiceProviderInterface::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Providers/RegistryProviderTest.php: -------------------------------------------------------------------------------- 1 | createMock(RegistryProvider::class); 15 | 16 | $this->assertInstanceOf(ServiceProviderInterface::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Providers/RouterProviderTest.php: -------------------------------------------------------------------------------- 1 | createMock(RouterProvider::class); 15 | 16 | $this->assertInstanceOf(ServiceProviderInterface::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Providers/SessionProviderTest.php: -------------------------------------------------------------------------------- 1 | createMock(SessionProvider::class); 15 | 16 | $this->assertInstanceOf(ServiceProviderInterface::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Providers/SystemInfoProviderTest.php: -------------------------------------------------------------------------------- 1 | createMock(SystemInfoProvider::class); 15 | 16 | $this->assertInstanceOf(ServiceProviderInterface::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Providers/TagProviderTest.php: -------------------------------------------------------------------------------- 1 | createMock(TagProvider::class); 15 | 16 | $this->assertInstanceOf(ServiceProviderInterface::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Providers/UrlProviderTest.php: -------------------------------------------------------------------------------- 1 | createMock(UrlProvider::class); 15 | 16 | $this->assertInstanceOf(ServiceProviderInterface::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Providers/ViewCacheProviderTest.php: -------------------------------------------------------------------------------- 1 | createMock(ViewCacheProvider::class); 15 | 16 | $this->assertInstanceOf(ServiceProviderInterface::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Providers/ViewProviderTest.php: -------------------------------------------------------------------------------- 1 | createMock(ViewProvider::class); 15 | 16 | $this->assertInstanceOf(ServiceProviderInterface::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/Providers/VoltProviderTest.php: -------------------------------------------------------------------------------- 1 | createMock(VoltProvider::class); 15 | 16 | $this->assertInstanceOf(ServiceProviderInterface::class, $class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/unit/_bootstrap.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view 9 | * the LICENSE file that was distributed with this source code. 10 | */ 11 | 12 | use Phalcon\DevTools\Bootstrap; 13 | 14 | /** 15 | * @psalm-suppress MissingFile 16 | */ 17 | include 'webtools.config.php'; 18 | include PTOOLSPATH . '/bootstrap/autoload.php'; 19 | 20 | /** 21 | * @psalm-suppress UndefinedConstant 22 | */ 23 | $bootstrap = new Bootstrap([ 24 | 'ptools_path' => PTOOLSPATH, 25 | 'ptools_ip' => PTOOLS_IP, 26 | 'base_path' => BASE_PATH, 27 | ]); 28 | 29 | if (APPLICATION_ENV === ENV_TESTING) { 30 | return $bootstrap->run(); 31 | } else { 32 | echo $bootstrap->run(); 33 | } 34 | --------------------------------------------------------------------------------