├── .github └── workflows │ └── deploy-documents.yml ├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── docs ├── acl.md ├── annotations.md ├── api │ ├── index.md │ ├── phalcon_acl.md │ ├── phalcon_annotations.md │ ├── phalcon_application.md │ ├── phalcon_assets.md │ ├── phalcon_autoload.md │ ├── phalcon_cache.md │ ├── phalcon_cli.md │ ├── phalcon_config.md │ ├── phalcon_datamapper.md │ ├── phalcon_db.md │ ├── phalcon_di.md │ ├── phalcon_dispatcher.md │ ├── phalcon_domain.md │ ├── phalcon_encryption.md │ ├── phalcon_events.md │ ├── phalcon_factory.md │ ├── phalcon_filter.md │ ├── phalcon_flash.md │ ├── phalcon_forms.md │ ├── phalcon_html.md │ ├── phalcon_http.md │ ├── phalcon_image.md │ ├── phalcon_logger.md │ ├── phalcon_messages.md │ ├── phalcon_mvc.md │ ├── phalcon_paginator.md │ ├── phalcon_session.md │ ├── phalcon_storage.md │ ├── phalcon_support.md │ ├── phalcon_tag.md │ └── phalcon_translate.md ├── application-cli.md ├── application-micro.md ├── application.md ├── assets.md ├── assets │ └── images │ │ ├── apple-touch-icon.png │ │ ├── content │ │ ├── devtools-linux-1.png │ │ ├── devtools-linux-2.png │ │ ├── devtools-mac-1.png │ │ ├── devtools-mac-2.png │ │ ├── devtools-usage-01.png │ │ ├── devtools-usage-02.png │ │ ├── devtools-usage-03.png │ │ ├── devtools-usage-04.png │ │ ├── devtools-usage-05.png │ │ ├── devtools-usage-11.png │ │ ├── devtools-windows-1.png │ │ ├── devtools-windows-2.png │ │ ├── devtools-windows-3.png │ │ ├── devtools-windows-4.png │ │ ├── devtools-windows-5.png │ │ ├── devtools-windows-6.png │ │ ├── devtools-windows-7.png │ │ ├── devtools-windows-8.png │ │ ├── devtools-windows-9.png │ │ ├── filter-sql.png │ │ ├── models-relationships-erd-1.png │ │ ├── performance-chrome-1.jpg │ │ ├── performance-firefox-1.jpg │ │ ├── performance-speed-tracer.jpg │ │ ├── performance-xhprof-1.jpg │ │ ├── performance-xhprof-2.jpg │ │ ├── performance-yslow-1.jpg │ │ ├── phpinfo-api.png │ │ ├── tutorial-basic-1.png │ │ ├── tutorial-basic-2.png │ │ ├── tutorial-basic-3.png │ │ ├── tutorial-basic-4.png │ │ ├── tutorial-basic-5.png │ │ ├── tutorial-basic-6.png │ │ ├── tutorial-invo-1.png │ │ ├── tutorial-invo-2.png │ │ ├── tutorial-vokuro-1.png │ │ ├── tutorial-vokuro-2.png │ │ ├── tutorial-vokuro-3.png │ │ ├── tutorial-vokuro-4.png │ │ ├── v4 │ │ │ ├── devtools-store-dirstructure.png │ │ │ └── devtools-store-localhost.png │ │ ├── views-layout.png │ │ ├── views-volt.png │ │ ├── webserver-architecture.png │ │ ├── webserver-cherokee-1.jpg │ │ ├── webserver-cherokee-2.jpg │ │ ├── webserver-cherokee-3.jpg │ │ ├── webserver-cherokee-4.jpg │ │ ├── webserver-cherokee-5.jpg │ │ ├── webserver-cherokee-6.jpg │ │ ├── webserver-cherokee-7.jpg │ │ ├── webserver-cherokee-8.jpg │ │ ├── webserver-cherokee-9.jpg │ │ ├── webserver-extracted-dlls.png │ │ ├── webserver-wamp-apache-phalcon-php-ini.png │ │ ├── webserver-wamp-manager.png │ │ ├── webserver-wamp-phalcon-php-ini.png │ │ ├── webserver-wamp-phalcon-psr-ext-folder.png │ │ ├── webserver-wamp-phalcon.png │ │ ├── webserver-xampp-phalcon-php-ini.png │ │ ├── webserver-xampp-phalcon-psr-ext-folder.png │ │ ├── webserver-xampp-phpinfo-phalcon.png │ │ ├── webserver-xampp-phpinfo.png │ │ ├── webserver-zip-icon.png │ │ └── xdebug-1.jpg │ │ ├── document-status-stable-success.svg │ │ ├── document-status-under-review-red.svg │ │ ├── edit_pencil.svg │ │ ├── favicon.ico │ │ ├── icons │ │ ├── advantages-community-icon.png │ │ ├── advantages-community-icon.svg │ │ ├── advantages-developer-icon.png │ │ ├── advantages-developer-icon.svg │ │ ├── advantages-help-icon.png │ │ ├── advantages-help-icon.svg │ │ ├── arrow-right-icon.png │ │ ├── arrow-right-icon.svg │ │ ├── divider-topic-icon.png │ │ ├── explore-topic-icon.png │ │ ├── github-icon.png │ │ ├── github-icon.svg │ │ ├── i-letter-image.png │ │ ├── message-icon.png │ │ ├── message-icon.svg │ │ ├── serch-icon.png │ │ ├── serch-icon.svg │ │ ├── social │ │ │ ├── discord-logo.png │ │ │ ├── facebook-logo.png │ │ │ ├── gab-logo.png │ │ │ ├── mewe-logo.jpg │ │ │ ├── slack-logo.png │ │ │ ├── stack-overflow-logo.png │ │ │ └── twitter-logo.png │ │ ├── topic-categories-icon.png │ │ ├── topic-category-small-icon.png │ │ ├── topic-category-small-icon.svg │ │ ├── topic-head-icon.png │ │ ├── topic-head-icon.svg │ │ ├── topic-item-icon.svg │ │ ├── topic-message-icon.png │ │ └── topic-message-icon.svg │ │ ├── implements-psr--0-blue.svg │ │ ├── implements-psr--11-blue.svg │ │ ├── implements-psr--13-blue.svg │ │ ├── implements-psr--14-blue.svg │ │ ├── implements-psr--15-blue.svg │ │ ├── implements-psr--16-blue.svg │ │ ├── implements-psr--17-blue.svg │ │ ├── implements-psr--18-blue.svg │ │ ├── implements-psr--2-blue.svg │ │ ├── implements-psr--3-blue.svg │ │ ├── implements-psr--4-blue.svg │ │ ├── implements-psr--6-blue.svg │ │ ├── implements-psr--7-blue.svg │ │ ├── level-advanced.svg │ │ ├── level-beginner.svg │ │ ├── level-intermediate.svg │ │ ├── status-changes-required-red.svg │ │ ├── status-docs.svg │ │ ├── status-no-changes-blue.svg │ │ ├── version-3.4.svg │ │ ├── version-4.0.svg │ │ ├── version-4.1.svg │ │ └── version-5.0.svg ├── autoload.md ├── cache.md ├── coding-standard.md ├── config.md ├── contributions.md ├── controllers.md ├── datamapper.md ├── db-layer.md ├── db-migrations.md ├── db-models-behaviors.md ├── db-models-cache.md ├── db-models-events.md ├── db-models-metadata.md ├── db-models-relationships.md ├── db-models-transactions.md ├── db-models-validation.md ├── db-models.md ├── db-odm.md ├── db-pagination.md ├── db-phql.md ├── devtools.md ├── di.md ├── dispatcher.md ├── domain.md ├── encryption-crypt.md ├── encryption-security-jwt.md ├── encryption-security.md ├── environments-devilbox.md ├── environments-nanobox.md ├── events.md ├── filter-filter.md ├── filter-validation.md ├── flash.md ├── forms.md ├── generating-backtrace.md ├── html-attributes.md ├── html-breadcrumbs.md ├── html-escaper.md ├── html-link.md ├── html-tagfactory.md ├── html.md ├── http-factories.md ├── http-request.md ├── http-response.md ├── http-server-request.md ├── http-stream.md ├── http-uploaded-file.md ├── http-uri.md ├── i18n.md ├── image.md ├── installation.md ├── introduction.md ├── logger.md ├── mvc-url.md ├── mvc.md ├── namespaces.md ├── new-feature-request-list.md ├── new-feature-request.md ├── new-pull-request.md ├── performance.md ├── queue.md ├── reproducible-tests.md ├── request.md ├── response.md ├── routing.md ├── session.md ├── sponsors.md ├── static-analysis.md ├── storage.md ├── support-collection.md ├── support-debug.md ├── support-helper.md ├── support-registry.md ├── support-version.md ├── tag.md ├── testing-environment.md ├── translate.md ├── tutorial-basic.md ├── tutorial-invo.md ├── tutorial-rest.md ├── tutorial-vokuro.md ├── unit-testing.md ├── upgrade.md ├── use-case.md ├── views.md ├── volt.md └── webserver-setup.md ├── mkdocs.yml └── requirements.txt /.github/workflows/deploy-documents.yml: -------------------------------------------------------------------------------- 1 | name: Deploy Documents 2 | 3 | env: 4 | PYTHON_VERSION: "3.9" 5 | 6 | on: 7 | push: 8 | branches: 9 | # Branch to base "dev" website on. Set in siteversion.py also. 10 | - master 11 | # Release branches have names like 0.8.x, 0.9.x, ... 12 | - "[0-9]+.[0-9]+.x" 13 | create: 14 | 15 | jobs: 16 | pre-publish: 17 | runs-on: ubuntu-latest 18 | outputs: 19 | result: ${{ steps.determination.outputs.result }} 20 | steps: 21 | - name: Determine if documentation should be published on this workflow run 22 | id: determination 23 | run: | 24 | RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" 25 | if [[ "${{ github.event_name }}" == "push" || ( "${{ github.event_name }}" == "create" && "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX ) ]]; then 26 | RESULT="true" 27 | else 28 | RESULT="true" 29 | fi 30 | 31 | echo "result=$RESULT" >> $GITHUB_OUTPUT 32 | 33 | publish: 34 | runs-on: ubuntu-latest 35 | needs: pre-publish 36 | if: needs.publish-determination.outputs.result == 'true' 37 | 38 | steps: 39 | - name: Checkout repository 40 | uses: actions/checkout@v4 41 | 42 | - name: Install Python 43 | uses: actions/setup-python@v5 44 | with: 45 | python-version: ${{ env.PYTHON_VERSION }} 46 | 47 | - name: Install Requirements 48 | run: | 49 | python -m pip install --upgrade pip 50 | python -m pip install -r requirements.txt 51 | 52 | - name: Create all generated documentation content 53 | run: mkdocs build 54 | 55 | - name: Determine versioning parameters 56 | id: determine-versioning 57 | run: echo "data={"version":"5.4.0", "alias"="latest"}" >> $GITHUB_OUTPUT 58 | 59 | - name: Deploy 60 | if: fromJson(steps.determine-versioning.outputs.data).version != null 61 | run: | 62 | # Publishing implies creating a git commit on the gh-pages branch, we let @ArduinoBot own these commits. 63 | git config --global user.email "deploy@phalcon.io" 64 | git config --global user.name "Phalcon Team Deploy Bot" 65 | git fetch --no-tags --prune --depth=1 origin +refs/heads/production:refs/remotes/origin/production 66 | poetry run mike deploy \ 67 | --update-aliases \ 68 | --push \ 69 | --remote origin \ 70 | ${{ fromJson(steps.determine-versioning.outputs.data).version }} \ 71 | ${{ fromJson(steps.determine-versioning.outputs.data).alias }} 72 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | site/ 2 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3 2 | LABEL authors="team@phalcon.io" 3 | 4 | WORKDIR /usr/src/app 5 | 6 | COPY requirements.txt ./ 7 | RUN pip install --no-cache-dir -r requirements.txt 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Phalcon Team and contributors 2 | https://phalcon.io 3 | 4 | MIT License 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | Phalcon 3 |

4 | 5 | Official [Phalcon][0] documentation website. 6 | 7 | ## Documentation 8 | * Official documentation is [located here][1] 9 | 10 | ## Community 11 | * Follow us on [GitHub][3], [Facebook][4], [Twitter][5] or [Gab.ai][6] 12 | * Get Phalcon support on [Discord][7] and [Official Discussions][8] 13 | 14 | ## Contributing 15 | 16 | This work is an open source, community-driven project. See [CONTRIBUTING.md][9] 17 | for details about contributions to this repository. 18 | 19 | 20 | ## Sponsors 21 | 22 | Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/phalcon#sponsor)] 23 | 24 | 25 | 26 | 27 | 28 | ## Backers 29 | 30 | Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/phalcon#backer)] 31 | 32 | 33 | 34 | 35 | 36 | 37 | ## License 38 | 39 | This work licensed under the New BSD License. See the [LICENSE][10] file for more information. 40 | 41 | [0]: https://phalcon.io 42 | [1]: https://docs.phalcon.io 43 | [3]: https://github.com/phalcon/cphalcon 44 | [4]: https://phalcon.io/fb 45 | [5]: https://phalcon.io/t 46 | [6]: https://phalcon.io/gab 47 | [7]: https://phalcon.io/discord 48 | [8]: https://phalcon.io/discussions 49 | [9]: https://github.com/phalcon/cphalcon/blob/master/CONTRIBUTING.md 50 | [10]: https://github.com/phalcon/cphalcon/blob/master/LICENSE.txt 51 | -------------------------------------------------------------------------------- /docs/api/index.md: -------------------------------------------------------------------------------- 1 | # API Index 2 | - - - 3 | 4 | - [Phalcon Acl](phalcon_acl.md) 5 | - [Phalcon Annotations](phalcon_annotations.md) 6 | - [Phalcon Application](phalcon_application.md) 7 | - [Phalcon Assets](phalcon_assets.md) 8 | - [Phalcon Autoload](phalcon_autoload.md) 9 | - [Phalcon Cache](phalcon_cache.md) 10 | - [Phalcon Cli](phalcon_cli.md) 11 | - [Phalcon Config](phalcon_config.md) 12 | - [Phalcon Datamapper](phalcon_datamapper.md) 13 | - [Phalcon Db](phalcon_db.md) 14 | - [Phalcon Di](phalcon_di.md) 15 | - [Phalcon Dispatcher](phalcon_dispatcher.md) 16 | - [Phalcon Domain](phalcon_domain.md) 17 | - [Phalcon Encryption](phalcon_encryption.md) 18 | - [Phalcon Events](phalcon_events.md) 19 | - [Phalcon Factory](phalcon_factory.md) 20 | - [Phalcon Filter](phalcon_filter.md) 21 | - [Phalcon Flash](phalcon_flash.md) 22 | - [Phalcon Forms](phalcon_forms.md) 23 | - [Phalcon Html](phalcon_html.md) 24 | - [Phalcon Http](phalcon_http.md) 25 | - [Phalcon Image](phalcon_image.md) 26 | - [Phalcon Logger](phalcon_logger.md) 27 | - [Phalcon Messages](phalcon_messages.md) 28 | - [Phalcon Mvc](phalcon_mvc.md) 29 | - [Phalcon Paginator](phalcon_paginator.md) 30 | - [Phalcon Session](phalcon_session.md) 31 | - [Phalcon Storage](phalcon_storage.md) 32 | - [Phalcon Support](phalcon_support.md) 33 | - [Phalcon Tag](phalcon_tag.md) 34 | - [Phalcon Translate](phalcon_translate.md) 35 | -------------------------------------------------------------------------------- /docs/api/phalcon_application.md: -------------------------------------------------------------------------------- 1 | 2 | * [Phalcon\Application\AbstractApplication](#application-abstractapplication) 3 | * [Phalcon\Application\Exception](#application-exception) 4 | 5 |

Abstract Class Phalcon\Application\AbstractApplication

6 | 7 | [Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Application/AbstractApplication.zep) 8 | 9 | | Namespace | Phalcon\Application | 10 | | Uses | Phalcon\Di\DiInterface, Phalcon\Di\Injectable, Phalcon\Events\EventsAwareInterface, Phalcon\Events\ManagerInterface | 11 | | Extends | Injectable | 12 | | Implements | EventsAwareInterface | 13 | 14 | Base class for Phalcon\Cli\Console and Phalcon\Mvc\Application. 15 | 16 | 17 | ## Properties 18 | ```php 19 | /** 20 | * @var DiInterface|null 21 | */ 22 | protected container; 23 | 24 | /** 25 | * @var string 26 | */ 27 | protected defaultModule = ""; 28 | 29 | /** 30 | * @var ManagerInterface|null 31 | */ 32 | protected eventsManager; 33 | 34 | /** 35 | * @var array 36 | */ 37 | protected modules; 38 | 39 | ``` 40 | 41 | ## Methods 42 | 43 | ```php 44 | public function __construct( DiInterface $container = null ); 45 | ``` 46 | Phalcon\AbstractApplication constructor 47 | 48 | 49 | ```php 50 | public function getDefaultModule(): string; 51 | ``` 52 | Returns the default module name 53 | 54 | 55 | ```php 56 | public function getEventsManager(): ManagerInterface | null; 57 | ``` 58 | Returns the internal event manager 59 | 60 | 61 | ```php 62 | public function getModule( string $name ): array | object; 63 | ``` 64 | Gets the module definition registered in the application via module name 65 | 66 | 67 | ```php 68 | public function getModules(): array; 69 | ``` 70 | Return the modules registered in the application 71 | 72 | 73 | ```php 74 | public function registerModules( array $modules, bool $merge = bool ): AbstractApplication; 75 | ``` 76 | Register an array of modules present in the application 77 | 78 | ```php 79 | $this->registerModules( 80 | [ 81 | "frontend" => [ 82 | "className" => \Multiple\Frontend\Module::class, 83 | "path" => "../apps/frontend/Module.php", 84 | ], 85 | "backend" => [ 86 | "className" => \Multiple\Backend\Module::class, 87 | "path" => "../apps/backend/Module.php", 88 | ], 89 | ] 90 | ); 91 | ``` 92 | 93 | 94 | ```php 95 | public function setDefaultModule( string $defaultModule ): AbstractApplication; 96 | ``` 97 | Sets the module name to be used if the router doesn't return a valid module 98 | 99 | 100 | ```php 101 | public function setEventsManager( ManagerInterface $eventsManager ): void; 102 | ``` 103 | Sets the events manager 104 | 105 | 106 | 107 | 108 |

Class Phalcon\Application\Exception

109 | 110 | [Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Application/Exception.zep) 111 | 112 | | Namespace | Phalcon\Application | 113 | | Extends | \Exception | 114 | 115 | Exceptions thrown in Phalcon\Application class will use this class 116 | -------------------------------------------------------------------------------- /docs/api/phalcon_autoload.md: -------------------------------------------------------------------------------- 1 | 2 | * [Phalcon\Autoload\Exception](#autoload-exception) 3 | * [Phalcon\Autoload\Loader](#autoload-loader) 4 | 5 |

Class Phalcon\Autoload\Exception

6 | 7 | [Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Autoload/Exception.zep) 8 | 9 | | Namespace | Phalcon\Autoload | 10 | | Extends | \Exception | 11 | 12 | Exceptions thrown in Phalcon\Autoload will use this class 13 | 14 | 15 | 16 |

Class Phalcon\Autoload\Loader

17 | 18 | [Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Autoload/Loader.zep) 19 | 20 | | Namespace | Phalcon\Autoload | 21 | | Uses | Phalcon\Events\AbstractEventsAware | 22 | | Extends | AbstractEventsAware | 23 | 24 | The Phalcon Autoloader provides an easy way to automatically load classes 25 | (namespaced or not) as well as files. It also features extension loading, 26 | allowing the user to autoload files with different extensions than .php. 27 | 28 | 29 | ## Properties 30 | ```php 31 | /** 32 | * @var string|null 33 | */ 34 | protected checkedPath; 35 | 36 | /** 37 | * @var array 38 | */ 39 | protected classes; 40 | 41 | /** 42 | * @var array 43 | */ 44 | protected debug; 45 | 46 | /** 47 | * @var array 48 | */ 49 | protected directories; 50 | 51 | /** 52 | * @var array 53 | */ 54 | protected extensions; 55 | 56 | /** 57 | * @var string|callable 58 | */ 59 | protected fileCheckingCallback = is_file; 60 | 61 | /** 62 | * @var array 63 | */ 64 | protected files; 65 | 66 | /** 67 | * @var string|null 68 | */ 69 | protected foundPath; 70 | 71 | /** 72 | * @var bool 73 | */ 74 | protected isDebug = false; 75 | 76 | /** 77 | * @var bool 78 | */ 79 | protected isRegistered = false; 80 | 81 | /** 82 | * @var array 83 | */ 84 | protected namespaces; 85 | 86 | ``` 87 | 88 | ## Methods 89 | 90 | ```php 91 | public function __construct( bool $isDebug = bool ); 92 | ``` 93 | Loader constructor. 94 | 95 | 96 | ```php 97 | public function addClass( string $name, string $file ): Loader; 98 | ``` 99 | Adds a class to the internal collection for the mapping 100 | 101 | 102 | ```php 103 | public function addDirectory( string $directory ): Loader; 104 | ``` 105 | Adds a directory for the loaded files 106 | 107 | 108 | ```php 109 | public function addExtension( string $extension ): Loader; 110 | ``` 111 | Adds an extension for the loaded files 112 | 113 | 114 | ```php 115 | public function addFile( string $file ): Loader; 116 | ``` 117 | Adds a file to be added to the loader 118 | 119 | 120 | ```php 121 | public function addNamespace( string $name, mixed $directories, bool $prepend = bool ): Loader; 122 | ``` 123 | 124 | 125 | 126 | ```php 127 | public function autoload( string $className ): bool; 128 | ``` 129 | Autoloads the registered classes 130 | 131 | 132 | ```php 133 | public function getCheckedPath(): string | null; 134 | ``` 135 | Get the path the loader is checking for a path 136 | 137 | 138 | ```php 139 | public function getClasses(): array; 140 | ``` 141 | Returns the class-map currently registered in the autoloader 142 | 143 | 144 | ```php 145 | public function getDebug(): array; 146 | ``` 147 | Returns debug information collected 148 | 149 | 150 | ```php 151 | public function getDirectories(): array; 152 | ``` 153 | Returns the directories currently registered in the autoloader 154 | 155 | 156 | ```php 157 | public function getExtensions(): array; 158 | ``` 159 | Returns the file extensions registered in the loader 160 | 161 | 162 | ```php 163 | public function getFiles(): array; 164 | ``` 165 | Returns the files currently registered in the autoloader 166 | 167 | 168 | ```php 169 | public function getFoundPath(): string | null; 170 | ``` 171 | Get the path when a class was found 172 | 173 | 174 | ```php 175 | public function getNamespaces(): array; 176 | ``` 177 | Returns the namespaces currently registered in the autoloader 178 | 179 | 180 | ```php 181 | public function isRegistered(): bool; 182 | ``` 183 | returns isRegister 184 | 185 | 186 | ```php 187 | public function loadFiles(): void; 188 | ``` 189 | Checks if a file exists and then adds the file by doing virtual require 190 | 191 | 192 | ```php 193 | public function register( bool $prepend = bool ): Loader; 194 | ``` 195 | Register the autoload method 196 | 197 | 198 | ```php 199 | public function setClasses( array $classes, bool $merge = bool ): Loader; 200 | ``` 201 | Register classes and their locations 202 | 203 | 204 | ```php 205 | public function setDirectories( array $directories, bool $merge = bool ): Loader; 206 | ``` 207 | Register directories in which "not found" classes could be found 208 | 209 | 210 | ```php 211 | public function setExtensions( array $extensions, bool $merge = bool ): Loader; 212 | ``` 213 | Sets an array of file extensions that the loader must try in each attempt 214 | to locate the file 215 | 216 | 217 | ```php 218 | public function setFileCheckingCallback( mixed $method = null ): Loader; 219 | ``` 220 | Sets the file check callback. 221 | 222 | ```php 223 | // Default behavior. 224 | $loader->setFileCheckingCallback("is_file"); 225 | 226 | // Faster than `is_file()`, but implies some issues if 227 | // the file is removed from the filesystem. 228 | $loader->setFileCheckingCallback("stream_resolve_include_path"); 229 | 230 | // Do not check file existence. 231 | $loader->setFileCheckingCallback(null); 232 | ``` 233 | 234 | 235 | ```php 236 | public function setFiles( array $files, bool $merge = bool ): Loader; 237 | ``` 238 | Registers files that are "non-classes" hence need a "require". This is 239 | very useful for including files that only have functions 240 | 241 | 242 | ```php 243 | public function setNamespaces( array $namespaces, bool $merge = bool ): Loader; 244 | ``` 245 | Register namespaces and their related directories 246 | 247 | 248 | ```php 249 | public function unregister(): Loader; 250 | ``` 251 | Unregister the autoload method 252 | 253 | 254 | ```php 255 | protected function requireFile( string $file ): bool; 256 | ``` 257 | If the file exists, require it and return true; false otherwise 258 | -------------------------------------------------------------------------------- /docs/api/phalcon_domain.md: -------------------------------------------------------------------------------- 1 | 2 | * [Phalcon\Domain\Payload\Payload](#domain-payload-payload) 3 | * [Phalcon\Domain\Payload\PayloadFactory](#domain-payload-payloadfactory) 4 | * [Phalcon\Domain\Payload\PayloadInterface](#domain-payload-payloadinterface) 5 | * [Phalcon\Domain\Payload\ReadableInterface](#domain-payload-readableinterface) 6 | * [Phalcon\Domain\Payload\Status](#domain-payload-status) 7 | * [Phalcon\Domain\Payload\WriteableInterface](#domain-payload-writeableinterface) 8 | 9 |

Class Phalcon\Domain\Payload\Payload

10 | 11 | [Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Domain/Payload/Payload.zep) 12 | 13 | | Namespace | Phalcon\Domain\Payload | 14 | | Uses | Throwable | 15 | | Implements | PayloadInterface | 16 | 17 | Holds the payload 18 | 19 | 20 | ## Properties 21 | ```php 22 | /** 23 | * Exception if any 24 | * 25 | * @var Throwable|null 26 | */ 27 | protected exception; 28 | 29 | /** 30 | * Extra information 31 | * 32 | * @var mixed 33 | */ 34 | protected extras; 35 | 36 | /** 37 | * Input 38 | * 39 | * @var mixed 40 | */ 41 | protected input; 42 | 43 | /** 44 | * Messages 45 | * 46 | * @var mixed 47 | */ 48 | protected messages; 49 | 50 | /** 51 | * Status 52 | * 53 | * @var mixed 54 | */ 55 | protected status; 56 | 57 | /** 58 | * Output 59 | * 60 | * @var mixed 61 | */ 62 | protected output; 63 | 64 | ``` 65 | 66 | ## Methods 67 | 68 | ```php 69 | public function getException(): Throwable | null; 70 | ``` 71 | Gets the potential exception thrown in the domain layer 72 | 73 | 74 | ```php 75 | public function getExtras(): mixed; 76 | ``` 77 | Extra information 78 | 79 | 80 | ```php 81 | public function getInput(): mixed; 82 | ``` 83 | Input 84 | 85 | 86 | ```php 87 | public function getMessages(): mixed; 88 | ``` 89 | Messages 90 | 91 | 92 | ```php 93 | public function getOutput(): mixed; 94 | ``` 95 | Output 96 | 97 | 98 | ```php 99 | public function getStatus(): mixed; 100 | ``` 101 | Status 102 | 103 | 104 | ```php 105 | public function setException( Throwable $exception ): PayloadInterface; 106 | ``` 107 | Sets an exception thrown in the domain 108 | 109 | 110 | ```php 111 | public function setExtras( mixed $extras ): PayloadInterface; 112 | ``` 113 | Sets arbitrary extra domain information. 114 | 115 | 116 | ```php 117 | public function setInput( mixed $input ): PayloadInterface; 118 | ``` 119 | Sets the domain input. 120 | 121 | 122 | ```php 123 | public function setMessages( mixed $messages ): PayloadInterface; 124 | ``` 125 | Sets the domain messages. 126 | 127 | 128 | ```php 129 | public function setOutput( mixed $output ): PayloadInterface; 130 | ``` 131 | Sets the domain output. 132 | 133 | 134 | ```php 135 | public function setStatus( mixed $status ): PayloadInterface; 136 | ``` 137 | Sets the payload status. 138 | 139 | 140 | 141 | 142 |

Class Phalcon\Domain\Payload\PayloadFactory

143 | 144 | [Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Domain/Payload/PayloadFactory.zep) 145 | 146 | | Namespace | Phalcon\Domain\Payload | 147 | 148 | Factory to create payload objects 149 | 150 | 151 | ## Methods 152 | 153 | ```php 154 | public function newInstance(): PayloadInterface; 155 | ``` 156 | Instantiate a new object 157 | 158 | 159 | 160 | 161 |

Interface Phalcon\Domain\Payload\PayloadInterface

162 | 163 | [Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Domain/Payload/PayloadInterface.zep) 164 | 165 | | Namespace | Phalcon\Domain\Payload | 166 | | Extends | ReadableInterface | 167 | 168 | This interface is used for consumers 169 | 170 | 171 | 172 |

Interface Phalcon\Domain\Payload\ReadableInterface

173 | 174 | [Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Domain/Payload/ReadableInterface.zep) 175 | 176 | | Namespace | Phalcon\Domain\Payload | 177 | | Uses | Throwable | 178 | 179 | This interface is used for consumers (read only) 180 | 181 | 182 | ## Methods 183 | 184 | ```php 185 | public function getException(): Throwable | null; 186 | ``` 187 | Gets the potential exception thrown in the domain layer 188 | 189 | 190 | ```php 191 | public function getExtras(): mixed; 192 | ``` 193 | Gets arbitrary extra values produced by the domain layer. 194 | 195 | 196 | ```php 197 | public function getInput(): mixed; 198 | ``` 199 | Gets the input received by the domain layer. 200 | 201 | 202 | ```php 203 | public function getMessages(): mixed; 204 | ``` 205 | Gets the messages produced by the domain layer. 206 | 207 | 208 | ```php 209 | public function getOutput(): mixed; 210 | ``` 211 | Gets the output produced from the domain layer. 212 | 213 | 214 | ```php 215 | public function getStatus(): mixed; 216 | ``` 217 | Gets the status of this payload. 218 | 219 | 220 | 221 | 222 |

Class Phalcon\Domain\Payload\Status

223 | 224 | [Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Domain/Payload/Status.zep) 225 | 226 | | Namespace | Phalcon\Domain\Payload | 227 | 228 | Holds the status codes for the payload 229 | 230 | 231 | ## Constants 232 | ```php 233 | const ACCEPTED = ACCEPTED; 234 | const AUTHENTICATED = AUTHENTICATED; 235 | const AUTHORIZED = AUTHORIZED; 236 | const CREATED = CREATED; 237 | const DELETED = DELETED; 238 | const ERROR = ERROR; 239 | const FAILURE = FAILURE; 240 | const FOUND = FOUND; 241 | const NOT_ACCEPTED = NOT_ACCEPTED; 242 | const NOT_AUTHENTICATED = NOT_AUTHENTICATED; 243 | const NOT_AUTHORIZED = NOT_AUTHORIZED; 244 | const NOT_CREATED = NOT_CREATED; 245 | const NOT_DELETED = NOT_DELETED; 246 | const NOT_FOUND = NOT_FOUND; 247 | const NOT_UPDATED = NOT_UPDATED; 248 | const NOT_VALID = NOT_VALID; 249 | const PROCESSING = PROCESSING; 250 | const SUCCESS = SUCCESS; 251 | const UPDATED = UPDATED; 252 | const VALID = VALID; 253 | ``` 254 | 255 | ## Methods 256 | 257 | ```php 258 | final private function __construct(); 259 | ``` 260 | Instantiation not allowed. 261 | 262 | 263 | 264 | 265 |

Interface Phalcon\Domain\Payload\WriteableInterface

266 | 267 | [Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Domain/Payload/WriteableInterface.zep) 268 | 269 | | Namespace | Phalcon\Domain\Payload | 270 | | Uses | Throwable | 271 | 272 | This interface is used for consumers (write) 273 | 274 | 275 | ## Methods 276 | 277 | ```php 278 | public function setException( Throwable $exception ): PayloadInterface; 279 | ``` 280 | Sets an exception produced by the domain layer. 281 | 282 | 283 | ```php 284 | public function setExtras( mixed $extras ): PayloadInterface; 285 | ``` 286 | Sets arbitrary extra values produced by the domain layer. 287 | 288 | 289 | ```php 290 | public function setInput( mixed $input ): PayloadInterface; 291 | ``` 292 | Sets the input received by the domain layer. 293 | 294 | 295 | ```php 296 | public function setMessages( mixed $messages ): PayloadInterface; 297 | ``` 298 | Sets the messages produced by the domain layer. 299 | 300 | 301 | ```php 302 | public function setOutput( mixed $output ): PayloadInterface; 303 | ``` 304 | Sets the output produced from the domain layer. 305 | 306 | 307 | ```php 308 | public function setStatus( mixed $status ): PayloadInterface; 309 | ``` 310 | Sets the status of this payload. 311 | -------------------------------------------------------------------------------- /docs/api/phalcon_factory.md: -------------------------------------------------------------------------------- 1 | 2 | * [Phalcon\Factory\AbstractConfigFactory](#factory-abstractconfigfactory) 3 | * [Phalcon\Factory\AbstractFactory](#factory-abstractfactory) 4 | * [Phalcon\Factory\Exception](#factory-exception) 5 | 6 |

Abstract Class Phalcon\Factory\AbstractConfigFactory

7 | 8 | [Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Factory/AbstractConfigFactory.zep) 9 | 10 | | Namespace | Phalcon\Factory | 11 | | Uses | Phalcon\Config\ConfigInterface | 12 | 13 | This file is part of the Phalcon Framework. 14 | 15 | (c) Phalcon Team 16 | 17 | For the full copyright and license information, please view the LICENSE.txt 18 | file that was distributed with this source code. 19 | 20 | 21 | ## Methods 22 | 23 | ```php 24 | protected function checkConfig( mixed $config ): array; 25 | ``` 26 | Checks the config if it is a valid object 27 | 28 | 29 | ```php 30 | protected function checkConfigElement( array $config, string $element ): array; 31 | ``` 32 | Checks if the config has "adapter" 33 | 34 | 35 | ```php 36 | protected function getException( string $message ): \Exception; 37 | ``` 38 | Returns the exception object for the child class 39 | 40 | 41 | ```php 42 | protected function getExceptionClass(): string; 43 | ``` 44 | 45 | 46 | 47 | 48 | 49 |

Abstract Class Phalcon\Factory\AbstractFactory

50 | 51 | [Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Factory/AbstractFactory.zep) 52 | 53 | | Namespace | Phalcon\Factory | 54 | | Uses | Phalcon\Config\ConfigInterface | 55 | | Extends | AbstractConfigFactory | 56 | 57 | This file is part of the Phalcon Framework. 58 | 59 | (c) Phalcon Team 60 | 61 | For the full copyright and license information, please view the LICENSE.txt 62 | file that was distributed with this source code. 63 | 64 | 65 | ## Properties 66 | ```php 67 | /** 68 | * @var array 69 | */ 70 | protected mapper; 71 | 72 | /** 73 | * @var array 74 | */ 75 | protected services; 76 | 77 | ``` 78 | 79 | ## Methods 80 | 81 | ```php 82 | protected function getService( string $name ): mixed; 83 | ``` 84 | Checks if a service exists and throws an exception 85 | 86 | 87 | ```php 88 | abstract protected function getServices(): array; 89 | ``` 90 | Returns the adapters for the factory 91 | 92 | 93 | ```php 94 | protected function init( array $services = [] ): void; 95 | ``` 96 | Initialize services/add new services 97 | 98 | 99 | 100 | 101 |

Class Phalcon\Factory\Exception

102 | 103 | [Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Factory/Exception.zep) 104 | 105 | | Namespace | Phalcon\Factory | 106 | | Extends | \Exception | 107 | 108 | This file is part of the Phalcon Framework. 109 | 110 | (c) Phalcon Team 111 | 112 | For the full copyright and license information, please view the LICENSE.txt 113 | file that was distributed with this source code. 114 | -------------------------------------------------------------------------------- /docs/api/phalcon_flash.md: -------------------------------------------------------------------------------- 1 | 2 | * [Phalcon\Flash\AbstractFlash](#flash-abstractflash) 3 | * [Phalcon\Flash\Direct](#flash-direct) 4 | * [Phalcon\Flash\Exception](#flash-exception) 5 | * [Phalcon\Flash\FlashInterface](#flash-flashinterface) 6 | * [Phalcon\Flash\Session](#flash-session) 7 | 8 |

Abstract Class Phalcon\Flash\AbstractFlash

9 | 10 | [Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Flash/AbstractFlash.zep) 11 | 12 | | Namespace | Phalcon\Flash | 13 | | Uses | Phalcon\Di\Di, Phalcon\Di\DiInterface, Phalcon\Di\AbstractInjectionAware, Phalcon\Html\Escaper\EscaperInterface, Phalcon\Session\ManagerInterface, Phalcon\Support\Helper\Str\Interpolate | 14 | | Extends | AbstractInjectionAware | 15 | | Implements | FlashInterface | 16 | 17 | Shows HTML notifications related to different circumstances. Classes can be 18 | stylized using CSS 19 | 20 | ```php 21 | $flash->success("The record was successfully deleted"); 22 | $flash->error("Cannot open the file"); 23 | ``` 24 | 25 | Class AbstractFlash 26 | 27 | @package Phalcon\Flash 28 | 29 | 30 | ## Properties 31 | ```php 32 | /** 33 | * @var bool 34 | */ 35 | protected autoescape = true; 36 | 37 | /** 38 | * @var bool 39 | */ 40 | protected automaticHtml = true; 41 | 42 | /** 43 | * @var array 44 | */ 45 | protected cssClasses; 46 | 47 | /** 48 | * @var array 49 | */ 50 | protected cssIconClasses; 51 | 52 | /** 53 | * @var string 54 | */ 55 | protected customTemplate = ; 56 | 57 | /** 58 | * @var EscaperInterface | null 59 | */ 60 | protected escaperService; 61 | 62 | /** 63 | * @var bool 64 | */ 65 | protected implicitFlush = true; 66 | 67 | /** 68 | * @var Interpolate 69 | */ 70 | protected interpolator; 71 | 72 | /** 73 | * @var array 74 | */ 75 | protected messages; 76 | 77 | /** 78 | * @var SessionInterface|null 79 | */ 80 | protected sessionService; 81 | 82 | ``` 83 | 84 | ## Methods 85 | 86 | ```php 87 | public function __construct( EscaperInterface $escaper = null, SessionInterface $session = null ); 88 | ``` 89 | AbstractFlash constructor. 90 | 91 | 92 | ```php 93 | public function clear(): void; 94 | ``` 95 | Clears accumulated messages when implicit flush is disabled 96 | 97 | 98 | ```php 99 | public function error( string $message ): string | null; 100 | ``` 101 | Shows a HTML error message 102 | 103 | ```php 104 | $flash->error("This is an error"); 105 | ``` 106 | 107 | 108 | ```php 109 | public function getAutoescape(): bool; 110 | ``` 111 | 112 | 113 | 114 | ```php 115 | public function getAutomaticHtml(): bool; 116 | ``` 117 | 118 | 119 | 120 | ```php 121 | public function getCssClasses(): array; 122 | ``` 123 | 124 | 125 | 126 | ```php 127 | public function getCssIconClasses(): array; 128 | ``` 129 | 130 | 131 | 132 | ```php 133 | public function getCustomTemplate(): string; 134 | ``` 135 | 136 | 137 | 138 | ```php 139 | public function getEscaperService(): EscaperInterface; 140 | ``` 141 | Returns the Escaper Service 142 | 143 | 144 | ```php 145 | public function notice( string $message ): string | null; 146 | ``` 147 | Shows a HTML notice/information message 148 | 149 | ```php 150 | $flash->notice("This is an information"); 151 | ``` 152 | 153 | 154 | ```php 155 | public function outputMessage( string $type, mixed $message ): string | null; 156 | ``` 157 | Outputs a message formatting it with HTML 158 | 159 | ```php 160 | $flash->outputMessage("error", $message); 161 | ``` 162 | 163 | 164 | ```php 165 | public function setAutoescape( bool $autoescape ): AbstractFlash; 166 | ``` 167 | Set the autoescape mode in generated HTML 168 | 169 | 170 | ```php 171 | public function setAutomaticHtml( bool $automaticHtml ): AbstractFlash; 172 | ``` 173 | Set if the output must be implicitly formatted with HTML 174 | 175 | 176 | ```php 177 | public function setCssClasses( array $cssClasses ): AbstractFlash; 178 | ``` 179 | Set an array with CSS classes to format the messages 180 | 181 | 182 | ```php 183 | public function setCssIconClasses( array $cssIconClasses ): AbstractFlash; 184 | ``` 185 | Set an array with CSS classes to format the icon messages 186 | 187 | 188 | ```php 189 | public function setCustomTemplate( string $customTemplate ): AbstractFlash; 190 | ``` 191 | Set a custom template for showing the messages 192 | 193 | 194 | ```php 195 | public function setEscaperService( EscaperInterface $escaperService ): AbstractFlash; 196 | ``` 197 | Sets the Escaper Service 198 | 199 | 200 | ```php 201 | public function setImplicitFlush( bool $implicitFlush ): AbstractFlash; 202 | ``` 203 | Set whether the output must be implicitly flushed to the output or 204 | returned as string 205 | 206 | 207 | ```php 208 | public function success( string $message ): string | null; 209 | ``` 210 | Shows a HTML success message 211 | 212 | ```php 213 | $flash->success("The process was finished successfully"); 214 | ``` 215 | 216 | 217 | ```php 218 | public function warning( string $message ): string | null; 219 | ``` 220 | Shows a HTML warning message 221 | 222 | ```php 223 | $flash->warning("Hey, this is important"); 224 | ``` 225 | 226 | 227 | 228 | 229 |

Class Phalcon\Flash\Direct

230 | 231 | [Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Flash/Direct.zep) 232 | 233 | | Namespace | Phalcon\Flash | 234 | | Extends | AbstractFlash | 235 | 236 | Class Direct 237 | 238 | @package Phalcon\Flash 239 | 240 | 241 | ## Methods 242 | 243 | ```php 244 | public function message( string $type, mixed $message ): string | null; 245 | ``` 246 | Outputs a message 247 | 248 | 249 | ```php 250 | public function output( bool $remove = bool ): void; 251 | ``` 252 | Prints the messages accumulated in the flasher 253 | 254 | 255 | 256 | 257 |

Class Phalcon\Flash\Exception

258 | 259 | [Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Flash/Exception.zep) 260 | 261 | | Namespace | Phalcon\Flash | 262 | | Extends | \Exception | 263 | 264 | Exceptions thrown in Phalcon\Flash classes will use this class 265 | 266 | 267 | 268 |

Interface Phalcon\Flash\FlashInterface

269 | 270 | [Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Flash/FlashInterface.zep) 271 | 272 | | Namespace | Phalcon\Flash | 273 | 274 | Interface FlashInterface 275 | 276 | @package Phalcon\Flash 277 | 278 | 279 | ## Methods 280 | 281 | ```php 282 | public function error( string $message ): string | null; 283 | ``` 284 | Shows a HTML error message 285 | 286 | 287 | ```php 288 | public function message( string $type, string $message ): string | null; 289 | ``` 290 | Outputs a message 291 | 292 | 293 | ```php 294 | public function notice( string $message ): string | null; 295 | ``` 296 | Shows a HTML notice/information message 297 | 298 | 299 | ```php 300 | public function success( string $message ): string | null; 301 | ``` 302 | Shows a HTML success message 303 | 304 | 305 | ```php 306 | public function warning( string $message ): string | null; 307 | ``` 308 | Shows a HTML warning message 309 | 310 | 311 | 312 | 313 |

Class Phalcon\Flash\Session

314 | 315 | [Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Flash/Session.zep) 316 | 317 | | Namespace | Phalcon\Flash | 318 | | Uses | Phalcon\Session\ManagerInterface | 319 | | Extends | AbstractFlash | 320 | 321 | This is an implementation of the Phalcon\Flash\FlashInterface that 322 | temporarily stores the messages in session, then messages can be printed in 323 | the next request. 324 | 325 | Class Session 326 | 327 | @package Phalcon\Flash 328 | 329 | 330 | ## Constants 331 | ```php 332 | const SESSION_KEY = _flashMessages; 333 | ``` 334 | 335 | ## Methods 336 | 337 | ```php 338 | public function clear(): void; 339 | ``` 340 | Clear messages in the session messenger 341 | 342 | @throws Exception 343 | 344 | 345 | ```php 346 | public function getMessages( mixed $type = null, bool $remove = bool ): array; 347 | ``` 348 | Returns the messages in the session flasher 349 | 350 | 351 | ```php 352 | public function getSessionService(): ManagerInterface; 353 | ``` 354 | Returns the Session Service 355 | 356 | 357 | ```php 358 | public function has( string $type = null ): bool; 359 | ``` 360 | Checks whether there are messages 361 | 362 | 363 | ```php 364 | public function message( string $type, mixed $message ): string | null; 365 | ``` 366 | Adds a message to the session flasher 367 | 368 | 369 | ```php 370 | public function output( bool $remove = bool ): void; 371 | ``` 372 | Prints the messages in the session flasher 373 | 374 | 375 | ```php 376 | protected function getSessionMessages( bool $remove, string $type = null ): array; 377 | ``` 378 | Returns the messages stored in session 379 | 380 | 381 | ```php 382 | protected function setSessionMessages( array $messages ): array; 383 | ``` 384 | Stores the messages in session 385 | -------------------------------------------------------------------------------- /docs/api/phalcon_messages.md: -------------------------------------------------------------------------------- 1 | 2 | * [Phalcon\Messages\Exception](#messages-exception) 3 | * [Phalcon\Messages\Message](#messages-message) 4 | * [Phalcon\Messages\MessageInterface](#messages-messageinterface) 5 | * [Phalcon\Messages\Messages](#messages-messages) 6 | 7 |

Class Phalcon\Messages\Exception

8 | 9 | [Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Messages/Exception.zep) 10 | 11 | | Namespace | Phalcon\Messages | 12 | | Extends | \Exception | 13 | 14 | Exceptions thrown in Phalcon\Messages\* classes will use this class 15 | 16 | 17 | 18 |

Class Phalcon\Messages\Message

19 | 20 | [Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Messages/Message.zep) 21 | 22 | | Namespace | Phalcon\Messages | 23 | | Uses | JsonSerializable | 24 | | Implements | MessageInterface, JsonSerializable | 25 | 26 | Phalcon\Messages\Message 27 | 28 | Stores a message from various components 29 | 30 | 31 | ## Properties 32 | ```php 33 | /** 34 | * @var int 35 | */ 36 | protected code; 37 | 38 | /** 39 | * @var string 40 | */ 41 | protected field; 42 | 43 | /** 44 | * @var string 45 | */ 46 | protected message; 47 | 48 | /** 49 | * @var string 50 | */ 51 | protected type; 52 | 53 | /** 54 | * @var array 55 | */ 56 | protected metaData; 57 | 58 | ``` 59 | 60 | ## Methods 61 | 62 | ```php 63 | public function __construct( string $message, mixed $field = string, string $type = string, int $code = int, array $metaData = [] ); 64 | ``` 65 | Phalcon\Messages\Message constructor 66 | 67 | 68 | ```php 69 | public function __toString(): string; 70 | ``` 71 | Magic __toString method returns verbose message 72 | 73 | 74 | ```php 75 | public function getCode(): int; 76 | ``` 77 | 78 | 79 | 80 | ```php 81 | public function getField(): string; 82 | ``` 83 | 84 | 85 | 86 | ```php 87 | public function getMessage(): string; 88 | ``` 89 | 90 | 91 | 92 | ```php 93 | public function getMetaData(): array; 94 | ``` 95 | 96 | 97 | 98 | ```php 99 | public function getType(): string; 100 | ``` 101 | 102 | 103 | 104 | ```php 105 | public function jsonSerialize(): array; 106 | ``` 107 | Serializes the object for json_encode 108 | 109 | 110 | ```php 111 | public function setCode( int $code ): MessageInterface; 112 | ``` 113 | Sets code for the message 114 | 115 | 116 | ```php 117 | public function setField( mixed $field ): MessageInterface; 118 | ``` 119 | Sets field name related to message 120 | 121 | 122 | ```php 123 | public function setMessage( string $message ): MessageInterface; 124 | ``` 125 | Sets verbose message 126 | 127 | 128 | ```php 129 | public function setMetaData( array $metaData ): MessageInterface; 130 | ``` 131 | Sets message metadata 132 | 133 | 134 | ```php 135 | public function setType( string $type ): MessageInterface; 136 | ``` 137 | Sets message type 138 | 139 | 140 | 141 | 142 |

Interface Phalcon\Messages\MessageInterface

143 | 144 | [Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Messages/MessageInterface.zep) 145 | 146 | | Namespace | Phalcon\Messages | 147 | 148 | Phalcon\Messages\MessageInterface 149 | 150 | Interface for Phalcon\Messages\MessageInterface 151 | 152 | 153 | ## Methods 154 | 155 | ```php 156 | public function __toString(): string; 157 | ``` 158 | Magic __toString method returns verbose message 159 | 160 | 161 | ```php 162 | public function getCode(); 163 | ``` 164 | Returns the message code related to this message 165 | 166 | 167 | ```php 168 | public function getField(); 169 | ``` 170 | Returns field name related to message 171 | 172 | 173 | ```php 174 | public function getMessage(): string; 175 | ``` 176 | Returns verbose message 177 | 178 | 179 | ```php 180 | public function getMetaData(): array; 181 | ``` 182 | Returns message metadata 183 | 184 | 185 | ```php 186 | public function getType(): string; 187 | ``` 188 | Returns message type 189 | 190 | 191 | ```php 192 | public function setCode( int $code ): MessageInterface; 193 | ``` 194 | Sets code for the message 195 | 196 | 197 | ```php 198 | public function setField( string $field ): MessageInterface; 199 | ``` 200 | Sets field name related to message 201 | 202 | 203 | ```php 204 | public function setMessage( string $message ): MessageInterface; 205 | ``` 206 | Sets verbose message 207 | 208 | 209 | ```php 210 | public function setMetaData( array $metaData ): MessageInterface; 211 | ``` 212 | Sets message metadata 213 | 214 | 215 | ```php 216 | public function setType( string $type ): MessageInterface; 217 | ``` 218 | Sets message type 219 | 220 | 221 | 222 | 223 |

Class Phalcon\Messages\Messages

224 | 225 | [Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/Messages/Messages.zep) 226 | 227 | | Namespace | Phalcon\Messages | 228 | | Uses | ArrayAccess, Countable, Iterator, JsonSerializable | 229 | | Implements | ArrayAccess, Countable, Iterator, JsonSerializable | 230 | 231 | Represents a collection of messages 232 | 233 | 234 | ## Properties 235 | ```php 236 | /** 237 | * @var int 238 | */ 239 | protected position = 0; 240 | 241 | /** 242 | * @var array 243 | */ 244 | protected messages; 245 | 246 | ``` 247 | 248 | ## Methods 249 | 250 | ```php 251 | public function __construct( array $messages = [] ); 252 | ``` 253 | Phalcon\Messages\Messages constructor 254 | 255 | 256 | ```php 257 | public function appendMessage( MessageInterface $message ); 258 | ``` 259 | Appends a message to the collection 260 | 261 | ```php 262 | $messages->appendMessage( 263 | new \Phalcon\Messages\Message("This is a message") 264 | ); 265 | ``` 266 | 267 | 268 | ```php 269 | public function appendMessages( mixed $messages ); 270 | ``` 271 | Appends an array of messages to the collection 272 | 273 | ```php 274 | $messages->appendMessages($messagesArray); 275 | ``` 276 | 277 | 278 | ```php 279 | public function count(): int; 280 | ``` 281 | Returns the number of messages in the list 282 | 283 | 284 | ```php 285 | public function current(): MessageInterface; 286 | ``` 287 | Returns the current message in the iterator 288 | 289 | 290 | ```php 291 | public function filter( string $fieldName ): array; 292 | ``` 293 | Filters the message collection by field name 294 | 295 | 296 | ```php 297 | public function jsonSerialize(): array; 298 | ``` 299 | Returns serialised message objects as array for json_encode. Calls 300 | jsonSerialize on each object if present 301 | 302 | ```php 303 | $data = $messages->jsonSerialize(); 304 | echo json_encode($data); 305 | ``` 306 | 307 | 308 | ```php 309 | public function key(): int; 310 | ``` 311 | Returns the current position/key in the iterator 312 | 313 | 314 | ```php 315 | public function next(): void; 316 | ``` 317 | Moves the internal iteration pointer to the next position 318 | 319 | 320 | ```php 321 | public function offsetExists( mixed $index ): bool; 322 | ``` 323 | Checks if an index exists 324 | 325 | ```php 326 | var_dump( 327 | isset($message["database"]) 328 | ); 329 | ``` 330 | 331 | 332 | ```php 333 | public function offsetGet( mixed $index ): mixed; 334 | ``` 335 | Gets an attribute a message using the array syntax 336 | 337 | ```php 338 | print_r( 339 | $messages[0] 340 | ); 341 | ``` 342 | 343 | 344 | ```php 345 | public function offsetSet( mixed $index, mixed $message ): void; 346 | ``` 347 | Sets an attribute using the array-syntax 348 | 349 | ```php 350 | $messages[0] = new \Phalcon\Messages\Message("This is a message"); 351 | ``` 352 | 353 | 354 | ```php 355 | public function offsetUnset( mixed $index ): void; 356 | ``` 357 | Removes a message from the list 358 | 359 | ```php 360 | unset($message["database"]); 361 | ``` 362 | 363 | 364 | ```php 365 | public function rewind(): void; 366 | ``` 367 | Rewinds the internal iterator 368 | 369 | 370 | ```php 371 | public function valid(): bool; 372 | ``` 373 | Check if the current message in the iterator is valid 374 | -------------------------------------------------------------------------------- /docs/assets/images/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/apple-touch-icon.png -------------------------------------------------------------------------------- /docs/assets/images/content/devtools-linux-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/devtools-linux-1.png -------------------------------------------------------------------------------- /docs/assets/images/content/devtools-linux-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/devtools-linux-2.png -------------------------------------------------------------------------------- /docs/assets/images/content/devtools-mac-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/devtools-mac-1.png -------------------------------------------------------------------------------- /docs/assets/images/content/devtools-mac-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/devtools-mac-2.png -------------------------------------------------------------------------------- /docs/assets/images/content/devtools-usage-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/devtools-usage-01.png -------------------------------------------------------------------------------- /docs/assets/images/content/devtools-usage-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/devtools-usage-02.png -------------------------------------------------------------------------------- /docs/assets/images/content/devtools-usage-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/devtools-usage-03.png -------------------------------------------------------------------------------- /docs/assets/images/content/devtools-usage-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/devtools-usage-04.png -------------------------------------------------------------------------------- /docs/assets/images/content/devtools-usage-05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/devtools-usage-05.png -------------------------------------------------------------------------------- /docs/assets/images/content/devtools-usage-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/devtools-usage-11.png -------------------------------------------------------------------------------- /docs/assets/images/content/devtools-windows-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/devtools-windows-1.png -------------------------------------------------------------------------------- /docs/assets/images/content/devtools-windows-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/devtools-windows-2.png -------------------------------------------------------------------------------- /docs/assets/images/content/devtools-windows-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/devtools-windows-3.png -------------------------------------------------------------------------------- /docs/assets/images/content/devtools-windows-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/devtools-windows-4.png -------------------------------------------------------------------------------- /docs/assets/images/content/devtools-windows-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/devtools-windows-5.png -------------------------------------------------------------------------------- /docs/assets/images/content/devtools-windows-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/devtools-windows-6.png -------------------------------------------------------------------------------- /docs/assets/images/content/devtools-windows-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/devtools-windows-7.png -------------------------------------------------------------------------------- /docs/assets/images/content/devtools-windows-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/devtools-windows-8.png -------------------------------------------------------------------------------- /docs/assets/images/content/devtools-windows-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/devtools-windows-9.png -------------------------------------------------------------------------------- /docs/assets/images/content/filter-sql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/filter-sql.png -------------------------------------------------------------------------------- /docs/assets/images/content/models-relationships-erd-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/models-relationships-erd-1.png -------------------------------------------------------------------------------- /docs/assets/images/content/performance-chrome-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/performance-chrome-1.jpg -------------------------------------------------------------------------------- /docs/assets/images/content/performance-firefox-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/performance-firefox-1.jpg -------------------------------------------------------------------------------- /docs/assets/images/content/performance-speed-tracer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/performance-speed-tracer.jpg -------------------------------------------------------------------------------- /docs/assets/images/content/performance-xhprof-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/performance-xhprof-1.jpg -------------------------------------------------------------------------------- /docs/assets/images/content/performance-xhprof-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/performance-xhprof-2.jpg -------------------------------------------------------------------------------- /docs/assets/images/content/performance-yslow-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/performance-yslow-1.jpg -------------------------------------------------------------------------------- /docs/assets/images/content/phpinfo-api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/phpinfo-api.png -------------------------------------------------------------------------------- /docs/assets/images/content/tutorial-basic-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/tutorial-basic-1.png -------------------------------------------------------------------------------- /docs/assets/images/content/tutorial-basic-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/tutorial-basic-2.png -------------------------------------------------------------------------------- /docs/assets/images/content/tutorial-basic-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/tutorial-basic-3.png -------------------------------------------------------------------------------- /docs/assets/images/content/tutorial-basic-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/tutorial-basic-4.png -------------------------------------------------------------------------------- /docs/assets/images/content/tutorial-basic-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/tutorial-basic-5.png -------------------------------------------------------------------------------- /docs/assets/images/content/tutorial-basic-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/tutorial-basic-6.png -------------------------------------------------------------------------------- /docs/assets/images/content/tutorial-invo-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/tutorial-invo-1.png -------------------------------------------------------------------------------- /docs/assets/images/content/tutorial-invo-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/tutorial-invo-2.png -------------------------------------------------------------------------------- /docs/assets/images/content/tutorial-vokuro-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/tutorial-vokuro-1.png -------------------------------------------------------------------------------- /docs/assets/images/content/tutorial-vokuro-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/tutorial-vokuro-2.png -------------------------------------------------------------------------------- /docs/assets/images/content/tutorial-vokuro-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/tutorial-vokuro-3.png -------------------------------------------------------------------------------- /docs/assets/images/content/tutorial-vokuro-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/tutorial-vokuro-4.png -------------------------------------------------------------------------------- /docs/assets/images/content/v4/devtools-store-dirstructure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/v4/devtools-store-dirstructure.png -------------------------------------------------------------------------------- /docs/assets/images/content/v4/devtools-store-localhost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/v4/devtools-store-localhost.png -------------------------------------------------------------------------------- /docs/assets/images/content/views-layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/views-layout.png -------------------------------------------------------------------------------- /docs/assets/images/content/views-volt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/views-volt.png -------------------------------------------------------------------------------- /docs/assets/images/content/webserver-architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/webserver-architecture.png -------------------------------------------------------------------------------- /docs/assets/images/content/webserver-cherokee-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/webserver-cherokee-1.jpg -------------------------------------------------------------------------------- /docs/assets/images/content/webserver-cherokee-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/webserver-cherokee-2.jpg -------------------------------------------------------------------------------- /docs/assets/images/content/webserver-cherokee-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/webserver-cherokee-3.jpg -------------------------------------------------------------------------------- /docs/assets/images/content/webserver-cherokee-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/webserver-cherokee-4.jpg -------------------------------------------------------------------------------- /docs/assets/images/content/webserver-cherokee-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/webserver-cherokee-5.jpg -------------------------------------------------------------------------------- /docs/assets/images/content/webserver-cherokee-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/webserver-cherokee-6.jpg -------------------------------------------------------------------------------- /docs/assets/images/content/webserver-cherokee-7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/webserver-cherokee-7.jpg -------------------------------------------------------------------------------- /docs/assets/images/content/webserver-cherokee-8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/webserver-cherokee-8.jpg -------------------------------------------------------------------------------- /docs/assets/images/content/webserver-cherokee-9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/webserver-cherokee-9.jpg -------------------------------------------------------------------------------- /docs/assets/images/content/webserver-extracted-dlls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/webserver-extracted-dlls.png -------------------------------------------------------------------------------- /docs/assets/images/content/webserver-wamp-apache-phalcon-php-ini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/webserver-wamp-apache-phalcon-php-ini.png -------------------------------------------------------------------------------- /docs/assets/images/content/webserver-wamp-manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/webserver-wamp-manager.png -------------------------------------------------------------------------------- /docs/assets/images/content/webserver-wamp-phalcon-php-ini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/webserver-wamp-phalcon-php-ini.png -------------------------------------------------------------------------------- /docs/assets/images/content/webserver-wamp-phalcon-psr-ext-folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/webserver-wamp-phalcon-psr-ext-folder.png -------------------------------------------------------------------------------- /docs/assets/images/content/webserver-wamp-phalcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/webserver-wamp-phalcon.png -------------------------------------------------------------------------------- /docs/assets/images/content/webserver-xampp-phalcon-php-ini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/webserver-xampp-phalcon-php-ini.png -------------------------------------------------------------------------------- /docs/assets/images/content/webserver-xampp-phalcon-psr-ext-folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/webserver-xampp-phalcon-psr-ext-folder.png -------------------------------------------------------------------------------- /docs/assets/images/content/webserver-xampp-phpinfo-phalcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/webserver-xampp-phpinfo-phalcon.png -------------------------------------------------------------------------------- /docs/assets/images/content/webserver-xampp-phpinfo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/webserver-xampp-phpinfo.png -------------------------------------------------------------------------------- /docs/assets/images/content/webserver-zip-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/webserver-zip-icon.png -------------------------------------------------------------------------------- /docs/assets/images/content/xdebug-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/content/xdebug-1.jpg -------------------------------------------------------------------------------- /docs/assets/images/document-status-stable-success.svg: -------------------------------------------------------------------------------- 1 | DOCUMENT STATUSSTABLE -------------------------------------------------------------------------------- /docs/assets/images/document-status-under-review-red.svg: -------------------------------------------------------------------------------- 1 | DOCUMENT STATUSUNDER REVIEW -------------------------------------------------------------------------------- /docs/assets/images/edit_pencil.svg: -------------------------------------------------------------------------------- 1 | a -------------------------------------------------------------------------------- /docs/assets/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/favicon.ico -------------------------------------------------------------------------------- /docs/assets/images/icons/advantages-community-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/icons/advantages-community-icon.png -------------------------------------------------------------------------------- /docs/assets/images/icons/advantages-community-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/assets/images/icons/advantages-developer-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/icons/advantages-developer-icon.png -------------------------------------------------------------------------------- /docs/assets/images/icons/advantages-developer-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/assets/images/icons/advantages-help-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/icons/advantages-help-icon.png -------------------------------------------------------------------------------- /docs/assets/images/icons/advantages-help-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/assets/images/icons/arrow-right-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/icons/arrow-right-icon.png -------------------------------------------------------------------------------- /docs/assets/images/icons/arrow-right-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/assets/images/icons/divider-topic-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/icons/divider-topic-icon.png -------------------------------------------------------------------------------- /docs/assets/images/icons/explore-topic-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/icons/explore-topic-icon.png -------------------------------------------------------------------------------- /docs/assets/images/icons/github-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/icons/github-icon.png -------------------------------------------------------------------------------- /docs/assets/images/icons/github-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/assets/images/icons/i-letter-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/icons/i-letter-image.png -------------------------------------------------------------------------------- /docs/assets/images/icons/message-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/icons/message-icon.png -------------------------------------------------------------------------------- /docs/assets/images/icons/message-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/assets/images/icons/serch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/icons/serch-icon.png -------------------------------------------------------------------------------- /docs/assets/images/icons/serch-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/assets/images/icons/social/discord-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/icons/social/discord-logo.png -------------------------------------------------------------------------------- /docs/assets/images/icons/social/facebook-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/icons/social/facebook-logo.png -------------------------------------------------------------------------------- /docs/assets/images/icons/social/gab-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/icons/social/gab-logo.png -------------------------------------------------------------------------------- /docs/assets/images/icons/social/mewe-logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/icons/social/mewe-logo.jpg -------------------------------------------------------------------------------- /docs/assets/images/icons/social/slack-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/icons/social/slack-logo.png -------------------------------------------------------------------------------- /docs/assets/images/icons/social/stack-overflow-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/icons/social/stack-overflow-logo.png -------------------------------------------------------------------------------- /docs/assets/images/icons/social/twitter-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/icons/social/twitter-logo.png -------------------------------------------------------------------------------- /docs/assets/images/icons/topic-categories-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/icons/topic-categories-icon.png -------------------------------------------------------------------------------- /docs/assets/images/icons/topic-category-small-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/icons/topic-category-small-icon.png -------------------------------------------------------------------------------- /docs/assets/images/icons/topic-category-small-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/assets/images/icons/topic-head-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/icons/topic-head-icon.png -------------------------------------------------------------------------------- /docs/assets/images/icons/topic-head-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/assets/images/icons/topic-item-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/assets/images/icons/topic-message-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalcon/documentation/d9b4f6c37502efa09c046653d9c5ccdae540f04b/docs/assets/images/icons/topic-message-icon.png -------------------------------------------------------------------------------- /docs/assets/images/icons/topic-message-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/assets/images/implements-psr--0-blue.svg: -------------------------------------------------------------------------------- 1 | ImplementsImplementsPSR-0PSR-0 -------------------------------------------------------------------------------- /docs/assets/images/implements-psr--11-blue.svg: -------------------------------------------------------------------------------- 1 | ImplementsImplementsPSR-11PSR-11 -------------------------------------------------------------------------------- /docs/assets/images/implements-psr--13-blue.svg: -------------------------------------------------------------------------------- 1 | ImplementsImplementsPSR-13PSR-13 -------------------------------------------------------------------------------- /docs/assets/images/implements-psr--14-blue.svg: -------------------------------------------------------------------------------- 1 | ImplementsImplementsPSR-14PSR-14 -------------------------------------------------------------------------------- /docs/assets/images/implements-psr--15-blue.svg: -------------------------------------------------------------------------------- 1 | ImplementsImplementsPSR-15PSR-15 -------------------------------------------------------------------------------- /docs/assets/images/implements-psr--16-blue.svg: -------------------------------------------------------------------------------- 1 | ImplementsImplementsPSR-16PSR-16 -------------------------------------------------------------------------------- /docs/assets/images/implements-psr--17-blue.svg: -------------------------------------------------------------------------------- 1 | ImplementsImplementsPSR-17PSR-17 -------------------------------------------------------------------------------- /docs/assets/images/implements-psr--18-blue.svg: -------------------------------------------------------------------------------- 1 | ImplementsImplementsPSR-18PSR-18 -------------------------------------------------------------------------------- /docs/assets/images/implements-psr--2-blue.svg: -------------------------------------------------------------------------------- 1 | ImplementsImplementsPSR-2PSR-2 -------------------------------------------------------------------------------- /docs/assets/images/implements-psr--3-blue.svg: -------------------------------------------------------------------------------- 1 | ImplementsImplementsPSR-3PSR-3 -------------------------------------------------------------------------------- /docs/assets/images/implements-psr--4-blue.svg: -------------------------------------------------------------------------------- 1 | ImplementsImplementsPSR-4PSR-4 -------------------------------------------------------------------------------- /docs/assets/images/implements-psr--6-blue.svg: -------------------------------------------------------------------------------- 1 | ImplementsImplementsPSR-6PSR-6 -------------------------------------------------------------------------------- /docs/assets/images/implements-psr--7-blue.svg: -------------------------------------------------------------------------------- 1 | ImplementsImplementsPSR-7PSR-7 -------------------------------------------------------------------------------- /docs/assets/images/level-advanced.svg: -------------------------------------------------------------------------------- 1 | LEVELADVANCED -------------------------------------------------------------------------------- /docs/assets/images/level-beginner.svg: -------------------------------------------------------------------------------- 1 | LEVELBEGINNER -------------------------------------------------------------------------------- /docs/assets/images/level-intermediate.svg: -------------------------------------------------------------------------------- 1 | LEVELINTERMEDIATE -------------------------------------------------------------------------------- /docs/assets/images/status-changes-required-red.svg: -------------------------------------------------------------------------------- 1 | STATUS: CHANGES REQUIREDSTATUSCHANGES REQUIRED -------------------------------------------------------------------------------- /docs/assets/images/status-docs.svg: -------------------------------------------------------------------------------- 1 | DOCSDOCS -------------------------------------------------------------------------------- /docs/assets/images/status-no-changes-blue.svg: -------------------------------------------------------------------------------- 1 | STATUS: NO CHANGESSTATUSNO CHANGES -------------------------------------------------------------------------------- /docs/assets/images/version-3.4.svg: -------------------------------------------------------------------------------- 1 | VERSION3.4 -------------------------------------------------------------------------------- /docs/assets/images/version-4.0.svg: -------------------------------------------------------------------------------- 1 | VERSION4.0 -------------------------------------------------------------------------------- /docs/assets/images/version-4.1.svg: -------------------------------------------------------------------------------- 1 | VERSION: 4.1VERSION4.1 -------------------------------------------------------------------------------- /docs/assets/images/version-5.0.svg: -------------------------------------------------------------------------------- 1 | VERSION: 5.0VERSION5.0 -------------------------------------------------------------------------------- /docs/coding-standard.md: -------------------------------------------------------------------------------- 1 | # Phalcon Coding Standard 2 | - - - 3 | 4 | Last update: 2019-07-04 5 | 6 | Phalcon is written in [Zephir][zephir], a language that the Phalcon Team invented and is actively developing. Therefore, there are no established coding standards that developers can follow, should they wish to. 7 | 8 | In this document we outline the coding standard that Phalcon is using for editing Zephir files. The coding standard is a variant of [PSR-12][psr-12] developed by [PHP-FIG][php-fig] 9 | 10 | ## Files 11 | * Files must use only UTF-8 without BOM. 12 | - File names must be named StudlyCaps. 13 | - All files must use the Unix LF (linefeed) line ending. 14 | - All files must end with a single blank line. 15 | - Folders are also named StudlyCaps and the folder/sub-folder tree follows the namespace of the class. 16 | 17 | ```php 18 | phalcon/Acl/Adapter/Memory.zep 19 | ``` 20 | 21 | ```php 22 | namespace Phalcon\Acl\Adapter; 23 | 24 | use Phalcon\Acl\Adapter; 25 | 26 | class Memory extends Adapter 27 | { 28 | 29 | } 30 | ``` 31 | 32 | - Code must use 4 spaces for indenting, not tabs. 33 | - Lines should be 80 characters or fewer. The hard limit on line length is 120 characters. 34 | - There must be one blank line after the namespace declaration, and there must be one blank line after the block of use declarations. 35 | - There must not be trailing whitespace at the end of non-blank lines. 36 | - Blank lines may be added to improve readability and to indicate related blocks of code. 37 | - There must not be more than one statement per line. 38 | 39 | ## Classes 40 | - Class names must be declared in StudlyCaps. 41 | - Opening braces for classes must go on the next line, and closing braces must go on the next line after the body. 42 | - Abstract classes must be prefixed by `Abstract` 43 | - Interfaces must be suffixed by `Interface` 44 | 45 | ### Constants 46 | - Class constants must be declared in all upper case with underscore separators. 47 | - Class constants must appear at the top of the class. 48 | - Class constants must be sorted alphabetically by constant name. 49 | 50 | ```php 51 | namespace Phalcon\Acl; 52 | 53 | class Enum 54 | { 55 | const ALLOW = 1; 56 | const DENY = 0; 57 | } 58 | ``` 59 | 60 | ### Properties 61 | - Class properties must be declared in camelCase. 62 | - Class properties must be sorted alphabetically based on name. 63 | - Whenever possible, properties must have a default value. 64 | - Whenever possible, properties must have a docblock that defines their type with the `@var` declaration. 65 | - Properties must not be prefixed with underscore `_`. The only exception is if the property name is a reserved keyword such as `default`, `namespace` etc. 66 | 67 | ```php 68 | namespace Phalcon\Acl\Adapter; 69 | 70 | use Phalcon\Acl\Adapter; 71 | 72 | class Memory extends Adapter 73 | { 74 | /** 75 | * @var string | null 76 | */ 77 | protected activeKey = "" { get }; 78 | } 79 | ``` 80 | 81 | ### Methods 82 | - Method names must be declared in camelCase. 83 | - Methods must be sorted alphabetically and based on their visibility. The order is `public`, `protected` and `private`. `__construct` if defined must be at the top of the class. 84 | - Method names must not be prefixed with underscore `_`. 85 | - All methods must have a return type. If the method does not return anything it should be marked `void` 86 | - Opening braces for methods must go on the next line, and closing braces must go on the next line after the body. 87 | - Visibility must be declared on all properties and methods; `abstract` and `final` must be declared before the visibility; `static` must be declared after the visibility. 88 | 89 | ```php 90 | abstract public function getElement() -> var; 91 | 92 | final public function getElement() -> var; 93 | 94 | public static function getElement() -> var; 95 | ``` 96 | 97 | - Control structure keywords must have one space after them; method and function calls must not. 98 | - Opening braces for control structures must go on the same line, and closing braces must go on the next line after the body. 99 | - Control structures such as `if` must not have parentheses around the conditional, unless it is a complex one. 100 | 101 | ```php 102 | if typeof variable === "array" { 103 | 104 | } 105 | ``` 106 | 107 | ### Method Arguments 108 | - In the argument list, there must not be a space before each comma, and there must be one space after each comma. 109 | - Each method must have its type declared before it 110 | - Method arguments with default values must go at the end of the argument list. 111 | 112 | ```php 113 | public function setElement(string! name, var value) -> void; 114 | ``` 115 | 116 | - Argument lists MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list must be on the next line, and there must be only one argument per line. 117 | 118 | ### PHP Files 119 | PHP files such as tests must follow [PSR-12][psr-12]. 120 | 121 | 122 | [php-fig]: https://www.php-fig.org/ 123 | [psr-12]: https://www.php-fig.org/psr/psr-12/ 124 | [zephir]: https://zephir-lang.com 125 | -------------------------------------------------------------------------------- /docs/contributions.md: -------------------------------------------------------------------------------- 1 | # Contributions 2 | - - - 3 | 4 | # Contributing to Phalcon 5 | Phalcon is an open source project and relies heavily on volunteer efforts and contributions. We welcome contributions from everyone! 6 | 7 | Please take a few moments to review this document to understand the contribution process and make it as efficient as possible for all. By following these guidelines, we can have faster resolution of issues, better communication, and we can all move the project forward! 8 | 9 | The Phalcon source code (along with documentation, websites etc.) is stored in [GitHub][github]. You can browse our repositories in our [organization page][phalcon-org]. 10 | 11 | If you wish to contribute to Phalcon, you can do so by issuing a [GitHub pull request][github-pr]. 12 | 13 | When you create a pull request, we have a handy template to help you describe what is the scope of the pull request. It is very important and helpful to the community that you add tests to your pull request. Each pull request will be reviewed by a core contributor (someone with permissions to merge pull requests). Based on the type and content of the pull request, it could be: 14 | 15 | * merged immediately or 16 | * put on hold, where the reviewer requires changes (styling, tests etc.) 17 | * put on hold, if discussion is necessary (community, core team etc.) 18 | * rejected 19 | 20 | !!! warning "NOTE" 21 | 22 | If your pull request is a new feature, it is best to discuss with the core team first, to ensure that it will align with the evolution of the framework. 23 | 24 | !!! danger "NOTE" 25 | 26 | Please make sure that the target branch that you send your pull request is correct and that you have already rebased your code. Pull requests to the **master** branch are not allowed 27 | 28 | ## Documentation 29 | If programming in Zephir seems daunting, there are plenty of areas that you can contribute. You can always check the documentation for any typographic or context errors. You could also enhance the documentation with more examples in the respective pages. 30 | 31 | All you have to do is go to our [docs-apps][phalcon-docs-apps] repository, fork it, make the changes and send us a pull request. 32 | 33 | ## Translations 34 | We have removed the translations from v5.5.x onward. There was not that much traffic from the community to help with translating the documentation to different languages. 35 | 36 | ## Questions and Support 37 | 38 | !!! danger "NOTE" 39 | 40 | We only accept bug reports, new feature requests and pull requests in GitHub. For questions regarding the usage of the framework or support requests please visit the [official discussions page][phalcon-discussions] or our [Discord][phalcon-discord] server. 41 | 42 | ## Bug Report Checklist 43 | - Make sure you are using the latest released version of Phalcon before creating an issue in GitHub. 44 | - Only bugs found in the latest released version of Phalcon will be addressed. 45 | - We have a handy template when creating an issue to help you provide as much information for the core team to reproduce and address. Being able to reproduce a bug significantly reduces the time to find the cause and fix it. Scripts of even failing tests are more than appreciated. Please check how to create the [reproducible tests][tests] page for more information. 46 | - As part of your report, please include additional information such as the OS, PHP version, Phalcon version, web server, memory etc. 47 | - If you're submitting a [Segmentation Fault][segfault] error, we require a backtrace. Please check the [Generating a Backtrace](#generating-a-backtrace) section for more information. 48 | 49 | ### Generating a Backtrace 50 | Sometimes due to [Segmentation Fault][segfault] error, Phalcon could crash some of your web server processes. In order to help us find the cause of this segmentation fault, we will need the crash backtrace. 51 | 52 | Please check the following links for instructions on how to generate the backtrace: 53 | 54 | * [Generating a gdb backtrace][gdb] 55 | * [Generating a backtrace, with a compiler, on Win32][gdb-w32] 56 | * [Debugging Symbols][symbols] 57 | * [Building PHP][building-php] 58 | 59 | ## Pull Request Checklist 60 | - Pull requests to the `master` branch are not accepted. Please fork the repository and create your branch from the necessary "source" branch, for instance `4.0.x` and if need be rebase your branch before submitting your pull request. If there are collisions, we will ask you to rebase your branch again. 61 | - Add tests to your pull request or adjust existing ones. This is very important since it helps justify your pull request. Please check our [testing][env] page for more information on how to set up a test environment and how to write tests. 62 | - Since Phalcon is written in [Zephir][zephir], please do not submit commits that modify the C generated files directly 63 | - Phalcon follows a specific coding style. Please install the `editorconfig` plugin in your favorite IDE to take advantage of the supplied `.editorconfig` file that comes with this repository and not to have to worry about coding standards. All tests (PHP code), follow the [PSR-12][psr-12] standard 64 | - Remove any change to `ext/kernel`, `*.zep.c` and `*.zep.h` files before submitting the pull request 65 | - More information [here][pr]. 66 | 67 | Before submitting **new functionality**, please open a [NFR][nfr] as a new issue on GitHub to discuss the impact of including the functionality or changes in the core extension. Once the functionality is approved, make sure your PR contains the following: 68 | 69 | - An update to the `CHANGELOG.md` 70 | - Unit Tests 71 | - Documentation or Usage Examples 72 | 73 | ## Getting Support 74 | If you have any questions about how to use Phalcon, please see the [support page][support]. 75 | 76 | ## Requesting Features 77 | If you have any changes or new features in mind, please fill an [NFR][nfr]. 78 | 79 | Thanks! 80 | 81 | 82 | <3 Phalcon Team 83 | 84 | [github]: https://github.com 85 | [phalcon-org]: https://github.com/phalcon 86 | [github-pr]: https://help.github.com/articles/using-pull-requests/ 87 | [phalcon-docs-app]: https://github.com/phalcon/docs-app 88 | [phalcon-discussions]: https://phalcon.io/discussions 89 | [phalcon-discord]: https://phalcon.io/discord 90 | [tests]: reproducible-tests.md 91 | [segfault]: https://en.wikipedia.org/wiki/Segmentation_fault 92 | [gdb]: https://bugs.php.net/bugs-generating-backtrace.php 93 | [gdb-w32]: https://bugs.php.net/bugs-generating-backtrace-win32.php 94 | [symbols]: https://github.com/oerdnj/deb.sury.org/wiki/Debugging-symbols 95 | [building-php]: https://www.phpinternalsbook.com/build_system/building_php.html 96 | [env]: testing-environment.md 97 | [zephir]: https://zephir-lang.com 98 | [psr-12]: https://www.php-fig.org/psr/ 99 | [pr]: new-pull-request.md 100 | [nfr]: new-feature-request.md 101 | [support]: https://phalcon.io/support 102 | -------------------------------------------------------------------------------- /docs/datamapper.md: -------------------------------------------------------------------------------- 1 | # Data Mapper 2 | - - - 3 | 4 | !!! info "NOTE" 5 | 6 | These components have been heavily influenced by [Aura PHP][auraphp] and [Atlas PHP][atlasphp] 7 | 8 | ## Overview 9 | 10 | The Data Mapper pattern as described by [Martin Fowler][datamapper] in [Patterns of Enterprise Application Architecture][eaa] is: 11 | 12 | !!! info "NOTE" 13 | 14 | A layer of Mappers that moves data between objects and a database while keeping them independent of each other and the mapper itself. 15 | 16 | The `Phalcon\DataMapper` namespace contains components to help with accessing your data source, with the [Data Mapper][pattern]. 17 | 18 | ## PDO 19 | 20 | ### Connection 21 | 22 | One of the components required by this implementation is a PDO connector. The [Phalcon\DataMapper\Pdo\Connection][datamapper-pdo-connection] offers a wrapper to PHP's PDO implementation, making it easier to maintain connections. 23 | 24 | **Connecting to a source** 25 | 26 | ### Connection - Decorated 27 | ### ConnectionLocator 28 | 29 | ### Profiler 30 | ## Query 31 | ### Factory 32 | ### Delete 33 | ### Insert 34 | ### Select 35 | ### Update 36 | 37 | [auraphp]: https://github.com/auraphp 38 | [atlasphp]: https://github.com/atlasphp 39 | [datamapper]: https://martinfowler.com/eaaCatalog/dataMapper.html 40 | [datamapper-pdo-connection]: api/phalcon_datamapper.md#datamapper-pdo-connection 41 | [datamapper-pdo-connection-abstractconnection]: api/phalcon_datamapper.md#datamapper-pdo-connection-abstractconnection 42 | [datamapper-pdo-connection-connectioninterface]: api/phalcon_datamapper.md#datamapper-pdo-connection-connectioninterface 43 | [datamapper-pdo-connection-decorated]: api/phalcon_datamapper.md#datamapper-pdo-connection-decorated 44 | [datamapper-pdo-connection-pdointerface]: api/phalcon_datamapper.md#datamapper-pdo-connection-pdointerface 45 | [datamapper-pdo-connectionlocator]: api/phalcon_datamapper.md#datamapper-pdo-connectionlocator 46 | [datamapper-pdo-connectionlocatorinterface]: api/phalcon_datamapper.md#datamapper-pdo-connectionlocatorinterface 47 | [datamapper-pdo-exception-cannotdisconnect]: api/phalcon_datamapper.md#datamapper-pdo-exception-cannotdisconnect 48 | [datamapper-pdo-exception-connectionnotfound]: api/phalcon_datamapper.md#datamapper-pdo-exception-connectionnotfound 49 | [datamapper-pdo-exception-exception]: api/phalcon_datamapper.md#datamapper-pdo-exception-exception 50 | [datamapper-pdo-profiler-memorylogger]: api/phalcon_datamapper.md#datamapper-pdo-profiler-memorylogger 51 | [datamapper-pdo-profiler-profiler]: api/phalcon_datamapper.md#datamapper-pdo-profiler-profiler 52 | [datamapper-pdo-profiler-profilerinterface]: api/phalcon_datamapper.md#datamapper-pdo-profiler-profilerinterface 53 | [datamapper-query-abstractconditions]: api/phalcon_datamapper.md#datamapper-query-abstractconditions 54 | [datamapper-query-abstractquery]: api/phalcon_datamapper.md#datamapper-query-abstractquery 55 | [datamapper-query-bind]: api/phalcon_datamapper.md#datamapper-query-bind 56 | [datamapper-query-delete]: api/phalcon_datamapper.md#datamapper-query-delete 57 | [datamapper-query-insert]: api/phalcon_datamapper.md#datamapper-query-insert 58 | [datamapper-query-queryfactory]: api/phalcon_datamapper.md#datamapper-query-queryfactory 59 | [datamapper-query-select]: api/phalcon_datamapper.md#datamapper-query-select 60 | [datamapper-query-update]: api/phalcon_datamapper.md#datamapper-query-update 61 | [eaa]: https://martinfowler.com/books/eaa.html 62 | -------------------------------------------------------------------------------- /docs/db-migrations.md: -------------------------------------------------------------------------------- 1 | # Database Migrations 2 | - - - 3 | 4 | !!! info "NOTE" 5 | 6 | Phalcon migrations have been removed from DevTools and moved to a separate repository. 7 | 8 | ## Package git repository 9 | 10 | https://github.com/phalcon/migrations 11 | 12 | ## Requirements 13 | 14 | * PHP >= 7.5 15 | * Phalcon >= 5.0.0 16 | 17 | ## Installing via Composer 18 | 19 | ``` 20 | composer require --dev phalcon/migrations 21 | ``` 22 | 23 | ## Quick start 24 | 25 | What you need for quick start: 26 | 27 | * Configuration file in root of your project (you can also pass them as parameters inside CLI environment) 28 | * Create database tables structure 29 | * Execute command to generate migrations 30 | 31 | After that you can execute that migrations (run) in another environment to create same DB structure. 32 | 33 | ### Create configuration file 34 | 35 | ```php 36 | [ 42 | 'adapter' => 'mysql', 43 | 'host' => '127.0.0.1', 44 | 'username' => 'root', 45 | 'password' => '', 46 | 'dbname' => 'db-name', 47 | 'charset' => 'utf8', 48 | ], 49 | 'application' => [ 50 | 'logInDb' => true, 51 | 'migrationsDir' => 'db/migrations', 52 | // true - TIMESTAMP, false - versions 53 | 'migrationsTsBased' => true, 54 | 'exportDataFromTables' => [ 55 | // Tables names 56 | ], 57 | ], 58 | ]); 59 | ``` 60 | 61 | !!! info "NOTE" 62 | 63 | If `exportDataFromTables` is set, data will be exported with every migration 64 | 65 | ### Generate migrations 66 | 67 | **Basic generation** 68 | 69 | ``` 70 | vendor/bin/phalcon-migrations generate 71 | ``` 72 | 73 | **Generate specific table and export data from it 74 | 75 | ``` 76 | vendor/bin/phalcon-migrations generate \ 77 | --config=migrations.php \ 78 | --table=users \ 79 | --exportDataFromTables=users \ 80 | --data=oncreate 81 | ``` 82 | 83 | ### Run migrations 84 | 85 | ``` 86 | vendor/bin/phalcon-migrations run 87 | ``` 88 | 89 | ### List existing migrations 90 | 91 | ``` 92 | vendor/bin/phalcon-migrations list 93 | ``` 94 | 95 | ## Usage example 96 | 97 | **Run migrations from specific migrations directory** 98 | 99 | ```php 100 | [ 107 | __DIR__ . '/migrations', 108 | ], 109 | 'config' => [ 110 | 'database' => [ 111 | 'adapter' => 'Mysql', 112 | 'host' => 'phalcon-db-mysql', 113 | 'username' => 'root', 114 | 'password' => 'root', 115 | 'dbname' => 'vokuro', 116 | ], 117 | ] 118 | ]); 119 | ``` 120 | 121 | ## Migration methods 122 | 123 | Each migration is a separate class that works as an entity for specific database table. 124 | Inside each class there are different methods that can occur during migration running. 125 | 126 | Each migration file (and class) can implement specific methods, that will be executed based on the operation requested. 127 | There are no restrictions on the logic encapsulated in each method. 128 | 129 | The tables below show the Migration Class methods. They are stored by order of execution, earliest to latest. 130 | 131 | **Running to up** 132 | 133 | | Method name | Description | 134 | |--------------------|----------------------------------------------------| 135 | | `morph` | Morph table structure | 136 | | `afterCreateTable` | Make something immediately after table was created | 137 | | `up` | Table is created and ready to work with | 138 | | `afterUp` | Extra method to work for some specific cases | 139 | 140 | 141 | **Running to down** 142 | 143 | | Method name | Description | 144 | |-------------|--------------------------------------------------------------------------------------------------------------------| 145 | | `down` | Normally you put here table drop or data truncation | 146 | | `aferDown` | Extra method to work after all was cleaned up | 147 | | `morph` | (**from previous migration**) As the migration was moved backward, there need to be all returned to previous state | 148 | 149 | ## CLI Arguments and options 150 | 151 | **Arguments** 152 | 153 | | Argument | Description | 154 | |------------|-------------------------------| 155 | | `generate` | Generate a Migration | 156 | | `run` | Run a Migration | 157 | | `list` | List all available migrations | 158 | 159 | **Options** 160 | 161 | | Action | Description | 162 | |----------------------------|------------------------------------------------------------------------------------------| 163 | | `--config=s` | Configuration file | 164 | | `--migrations=s` | Migrations directory. Use comma separated string to specify multiple directories | 165 | | `--directory=s` | Directory where the project was created | 166 | | `--table=s` | Table to migrate. Table name or table prefix with asterisk. Default: all | 167 | | `--version=s` | Version to migrate | 168 | | `--descr=s` | Migration description (used for timestamp based migration) | 169 | | `--data=s` | Export data ['always' or 'oncreate'] (Data is imported during migration run) | 170 | | `--exportDataFromTables=s` | Export data from specific tables, use comma separated string | 171 | | `--force` | Forces to overwrite existing migrations | 172 | | `--ts-based` | Timestamp based migration version | 173 | | `--log-in-db` | Keep migrations log in the database table rather then in file | 174 | | `--dry` | Attempt requested operation without making changes to system (Generating only) | 175 | | `--verbose` | Output of debugging information during operation (Running only) | 176 | | `--no-auto-increment` | Disable auto increment (Generating only) | 177 | | `--skip-ref-schema` | Skip referencedSchema inside generated migration (Generating only) | 178 | | `--skip-foreign-checks` | Wrap `SET FOREIGN_KEY_CHECKS` query before and after execution of a query (Running only) | 179 | | `--help` | Shows this help | 180 | 181 | ## Timestamp based migrations 182 | 183 | Using this approach is useful when more than one developer is participating in the database structure management. 184 | Use `'migrationsTsBased' => true` in config file or `--ts-based` option in CLI environment. 185 | Also, you need to specify suffix `descr`, which could be anything you want, for example: semantic version. 186 | 187 | Current command 188 | ``` 189 | vendor/bin/phalcon-migrations generate --ts-based --descr=1.0.0 190 | ``` 191 | 192 | Will produce folder name with such names 193 | 194 | ```sh 195 | * 1582539287636860_1.0.0 196 | * 1682539471102635_1.0.0 197 | * 1782539471102635_1.0.0 198 | ``` 199 | 200 | Migrations will be executed from oldest to newest. 201 | 202 | !!! info "NOTE" 203 | 204 | Whenever migrations are run, the application scans all available migrations and their status irrespective of their "age". If one or more were not executed in a previous run, they will be executed in the next run. 205 | -------------------------------------------------------------------------------- /docs/db-models-validation.md: -------------------------------------------------------------------------------- 1 | # Model Validation 2 | - - - 3 | 4 | ## Overview 5 | [Phalcon\Mvc\Model][mvc-model] provides several events to validate data and implement business rules. 6 | 7 | ```php 8 | add( 23 | 'cst_email', 24 | new Uniqueness( 25 | [ 26 | 'message' => 'The customer email must be unique', 27 | ] 28 | ) 29 | ); 30 | 31 | return $this->validate($validator); 32 | } 33 | } 34 | ``` 35 | 36 | ## Data Integrity 37 | Data integrity is essential in every application. You can implement validators in your models to introduce another layer of validation so that you can ensure that data is stored in your database that enforce your business rules. 38 | 39 | The special `validation` event allows us to call built-in validators on the record. Phalcon exposes additional built-in validators that can be used at this stage of validation. All validators available are under the [Phalcon\Validation][filter-validation] namespace. 40 | 41 | ```php 42 | add( 58 | 'inv_status_flag', 59 | new InclusionIn( 60 | [ 61 | 'domain' => [ 62 | 'Paid', 63 | 'Unpaid', 64 | ], 65 | 'message' => 'The invoice must be ' . 66 | 'either paid or unpaid', 67 | ] 68 | ) 69 | ); 70 | 71 | $validator->add( 72 | 'inv_number', 73 | new Uniqueness( 74 | [ 75 | 'message' => 'The invoice number must be unique', 76 | ] 77 | ) 78 | ); 79 | 80 | return $this->validate($validator); 81 | } 82 | } 83 | ``` 84 | 85 | The above example performs a validation using the built-in validator [Phalcon\Filter\Validation\Validator\InclusionIn][validation-validator-inclusionin]. It checks the value of the field `inv_status_flag` in a domain list. If the value is not included in the method then the validator will fail and return `false`. 86 | 87 | !!! warning "NOTE" 88 | 89 | For more information on validators, see the [Validation documentation][filter-validation] 90 | 91 | ## Messages 92 | [Phalcon\Mvc\Model][mvc-model] utilizes the [Phalcon\Messages\Messages][messages-messages] collection to store any validation messages that have been generated during the validation process. 93 | 94 | Each message is an instance of [Phalcon\Messages\Message][messages-message] and the set of messages generated can be retrieved with the `getMessages()` method. Each message provides additional information such as the field name that generated the message or the message type: 95 | 96 | ```php 97 | save()) { 100 | $messages = $invoice->getMessages(); 101 | 102 | foreach ($messages as $message) { 103 | echo 'Message: ', $message->getMessage(); 104 | echo 'Field: ', $message->getField(); 105 | echo 'Type: ', $message->getType(); 106 | } 107 | } 108 | ``` 109 | 110 | [Phalcon\Mvc\Model][mvc-model] can generate the following types of validation messages: 111 | 112 | | Type | Generated when | 113 | |------------------------|------------------------------------------------------------------------------------------------------------------------| 114 | | `ConstraintViolation` | A field, part of a virtual foreign key, is trying to insert/update a value that does not exist in the referenced model | 115 | | `InvalidCreateAttempt` | Trying to create a record that already exists | 116 | | `InvalidUpdateAttempt` | Trying to update a record that does not exist | 117 | | `InvalidValue` | A validator failed because of an invalid value | 118 | | `PresenceOf` | A field with a non `null` attribute on the database is trying to insert/update a `null` value | 119 | 120 | The `getMessages()` method can be overridden in a model to replace/translate the default messages generated automatically by the ORM: 121 | 122 | ```php 123 | getType()) { 137 | case 'InvalidCreateAttempt': 138 | $messages[] = 'The record cannot be created ' 139 | . 'because it already exists'; 140 | break; 141 | 142 | case 'InvalidUpdateAttempt': 143 | $messages[] = "The record cannot be updated ' 144 | . 'because it doesn't exist"; 145 | break; 146 | 147 | case 'PresenceOf': 148 | $messages[] = 'The field ' 149 | . $message->getField() 150 | . ' is mandatory'; 151 | break; 152 | } 153 | } 154 | 155 | return $messages; 156 | } 157 | } 158 | ``` 159 | 160 | ## Failed Events 161 | Additional events are available when the data validation process finds any inconsistencies: 162 | 163 | | Operation | Name | Explanation | 164 | |--------------------------|---------------------|------------------------------------------------------------------------| 165 | | Insert or Update | `notSaved` | Triggered when the `INSERT` or `UPDATE` operation fails for any reason | 166 | | Insert, Delete or Update | `onValidationFails` | Triggered when any data manipulation operation fails | 167 | 168 | 169 | ## Custom 170 | The [validation][filter-validation] document explains in detail how you can create your own validators. You can use such validators and reuse them among several models. A validator also can be as simple as: 171 | 172 | ```php 173 | inv_type_flag) { 185 | $message = new Message( 186 | 'Unpaid invoices are not allowed', 187 | 'inv_type_flag', 188 | 'UnpaidInvoiceType' 189 | ); 190 | 191 | $this->appendMessage($message); 192 | 193 | return false; 194 | } 195 | 196 | return true; 197 | } 198 | } 199 | ``` 200 | 201 | [mvc-model]: api/phalcon_mvc.md#mvc-model 202 | [mvc-model-validationfailed]: api/phalcon_mvc.md#mvc-model-validationfailed 203 | [validation-validator-inclusionin]: api/phalcon_filter.md#filter-validation-validator-inclusionin 204 | [messages-message]: api/phalcon_messages.md#messages-message 205 | [messages-messages]: api/phalcon_messages.md#messages-messages 206 | [filter-validation]: filter-validation.md 207 | -------------------------------------------------------------------------------- /docs/db-odm.md: -------------------------------------------------------------------------------- 1 | # Object Document Mapper 2 | - - - 3 | 4 | !!! warning "NOTE" 5 | 6 | The Object Document Mapper functionality has been **temporarily** removed for v4.0+. 7 | 8 | The existing implementation was using a PHP MongoDB driver that has been deprecated for years. As such, work is underway to re-introduce the Object Document Mapper in Phalcon, using the latest MongoDB PHP driver. 9 | 10 | We expect this functionality to be reintroduced a future Phalcon release. 11 | -------------------------------------------------------------------------------- /docs/domain.md: -------------------------------------------------------------------------------- 1 | # Domain 2 | - - - 3 | 4 | !!! warning "NOTE" 5 | 6 | In future versions of Phalcon, this component will be reworked to follow the [Payload Interop][payload-interop] interface. 7 | 8 | The domain component incorporates components that are used for the implementation of the [Action Domain Responder][adr] ([ADR][adr-jones]) pattern and can also be used when implementing [Domain Driven Design][ddd]. 9 | 10 | ## Payload 11 | The [Action Domain Responder][adr] requires a data transfer mechanism between the three layers to serve your application. The [Phalcon\Domain\Payload][payload-payload] is a data transfer object that is used to send data between the three layers of the pattern. 12 | 13 | ```php 14 | newInstance(); 48 | ?> 49 | ``` 50 | 51 | ## Interfaces 52 | There are three interfaces that you can take advantage of if you wish to extend the object. 53 | 54 | | Interface | Description | 55 | |---------------------|--------------------------------------| 56 | | `ReadableInterface` | contains only read methods | 57 | | `WritableInterface` | contains only write methods | 58 | | `PayloadInterface` | contains both read and write methods | 59 | 60 | ## Status Values 61 | The [Phalcon\Domain\Payload\Status][payload-status] class contains several constants to help with the domain status of your Payload objects. You can always extend the class and introduce your own domain statuses, depending on the needs of your application. 62 | 63 | * `ACCEPTED` 64 | * `AUTHENTICATED` 65 | * `AUTHORIZED` 66 | * `CREATED` 67 | * `DELETED` 68 | * `ERROR` 69 | * `FAILURE` 70 | * `FOUND` 71 | * `NOT_ACCEPTED` 72 | * `NOT_AUTHENTICATED` 73 | * `NOT_AUTHORIZED` 74 | * `NOT_CREATED` 75 | * `NOT_DELETED` 76 | * `NOT_FOUND` 77 | * `NOT_UPDATED` 78 | * `NOT_VALID` 79 | * `PROCESSING` 80 | * `SUCCESS` 81 | * `UPDATED` 82 | * `VALID` 83 | 84 | These statuses can be used at the display/view layer of your application to process domain objects retrieved via `Payload::getOutput()`. 85 | 86 | ## Example 87 | ```php 88 | newInstance(); 101 | 102 | $report = Reports::find( 103 | [ 104 | 'conditions' => 'reportId = :reportId:', 105 | 'bind' => [ 106 | 'reportId' => $reportId, 107 | ], 108 | ] 109 | ); 110 | 111 | if (false === $report) { 112 | $payload 113 | ->setStatus(Status::NOT_FOUND) 114 | ->setInput(func_get_args()) 115 | ; 116 | } else { 117 | $payload 118 | ->setStatus(Status::FOUND) 119 | ->setOutput($report) 120 | ; 121 | } 122 | 123 | return $payload; 124 | } 125 | } 126 | ``` 127 | 128 | ## Links 129 | 130 | * [Action Domain Responder][adr] 131 | * [Clarifications to a review of Action Domain Responder][adr-clarifications] 132 | * [Payload Interop][payload-interop] 133 | 134 | 135 | [adr]: https://en.wikipedia.org/wiki/Action%E2%80%93domain%E2%80%93responder 136 | [adr-jones]: https://pmjones.io/adr/ 137 | [adr-clarifications]: https://paul-m-jones.com/post/2018/12/19/clarifications-to-a-review-of-action-domain-responder/ 138 | [ddd]: https://en.wikipedia.org/wiki/Domain-driven_design 139 | [payload-interop]: https://github.com/payload-interop/payload-interop 140 | [payload-payload]: api/phalcon_domain.md#domain-payload-payload 141 | [payload-payloadfactory]: api/phalcon_domain.md#domain-payload-payloadfactory 142 | [payload-payloadinterface]: api/phalcon_domain.md#domain-payload-payloadinterface 143 | [payload-readableinterface]: api/phalcon_domain.md#domain-payload-readableinterface 144 | [payload-status]: api/phalcon_domain.md#domain-payload-status 145 | [payload-writeableinterface]: api/phalcon_domain.md#domain-payload-writeableinterface 146 | -------------------------------------------------------------------------------- /docs/environments-devilbox.md: -------------------------------------------------------------------------------- 1 | # Environments 2 | - - - 3 | 4 | ## Overview 5 | 6 | [Devilbox][devilbox] is a modern and highly customizable dockerized PHP stack supporting full LAMP and MEAN and running on all major platforms. The main goal is to easily switch and combine any version required for local development. It supports an unlimited number of projects for which vhosts, SSL certificates and DNS records are created automatically. Reverse proxies per project are supported to ensure listening server such as NodeJS can also be reached. Email catch-all and popular development tools will be at your service as well. Configuration is not necessary, as everything is already pre-setup. 7 | 8 | Furthermore, the Devilbox provides an identical and reproducible development environment for different host operating systems. 9 | 10 | This example will use `phalcon` to install Phalcon from within the Devilbox PHP container. After completing the steps listed below, you will have a working Phalcon setup ready to be served via http and https. 11 | 12 | 13 | ## Configuration 14 | 15 | The following configuration will be used: 16 | 17 | | Setting | Value | 18 | |-----------------------|---------------------------------------------------| 19 | | Project name | `my-phalcon` | 20 | | VirtualHost directory | `/shared/httpd/my-phalcon` | 21 | | Database | n.a. | 22 | | `TLD_SUFFIX` | loc | 23 | | Project URL | `http://my-phalcon.loc`, `https://my-phalcon.loc` | 24 | 25 | 26 | !!! info "NOTE" 27 | 28 | * Inside the Devilbox PHP container, projects are always in `/shared/httpd/`. 29 | * On your host operating system, projects are by default in `./data/www/` inside the Devilbox git directory. This path can be changed via `HOST_PATH_HTTPD_DATADIR`. 30 | 31 | ## Activation 32 | 33 | Your environment will be ready in six simple steps: 34 | 35 | - Enter the PHP container 36 | - Create a new VirtualHost directory 37 | - Install Phalcon 38 | - Symlink webroot directory 39 | - Setup DNS record 40 | - Visit `http://my-phalcon.loc` in your browser 41 | - (Nginx) Create custom vhost config file 42 | 43 | 44 | ### Enter the PHP Container 45 | 46 | All the work will be performed inside the PHP container since it offers all the necessary tools. Navigate to the Devilbox git directory and execute `./shell.sh` (or `shell.bat` on Windows) to enter the running PHP container. 47 | 48 | ```bash 49 | host> ./shell.sh 50 | ``` 51 | 52 | ### Create New Vhost Directory 53 | 54 | The vhost directory defines the name under which your project will be available. (`.TLD_SUFFIX` will be the final URL ). 55 | 56 | ```bash 57 | devilbox@php-8.0 in /shared/httpd $ mkdir my-phalcon 58 | ``` 59 | 60 | ### Install Phalcon 61 | 62 | Navigate into your newly created vhost directory and install Phalcon with `phalcon` cli. 63 | 64 | ```bash 65 | devilbox@php-8.0 in /shared/httpd $ cd my-phalcon 66 | devilbox@php-8.0 in /shared/httpd/my-phalcon $ phalcon project phalconphp 67 | ``` 68 | 69 | The directory structure looks like this after the installation: 70 | 71 | ```bash 72 | devilbox@php-8.0 in /shared/httpd/my-phalcon $ tree -L 1 73 | . 74 | └── phalconphp 75 | 76 | 1 directory, 0 files 77 | ``` 78 | 79 | ### Symlink Webroot 80 | 81 | Symlinking the actual webroot directory to `htdocs` is important. The web server expects every project's document root to be in `/htdocs/`. This is the path where it will serve the files. This is also the path where the entry point of your application (usually `index.php`) needs to reside. 82 | 83 | Some frameworks however, store files and content in nested directories of unknown levels. It is therefore impossible to set this as a pre-set for the environment. You will therefore have to manually set a symlink back to the expected path that your framework requires. 84 | 85 | ```bash 86 | devilbox@php-8.0 in /shared/httpd/my-phalcon $ ln -s phalconphp/public/ htdocs 87 | ``` 88 | 89 | The directory structure looks like this after the installation: 90 | 91 | ```bash 92 | devilbox@php-8.0 in /shared/httpd/my-phalcon $ tree -L 1 93 | . 94 | ├── phalconphp 95 | └── htdocs -> phalconphp/public 96 | 97 | 2 directories, 0 files 98 | ``` 99 | 100 | As you can see in the above listing, the `htdocs` folder that is required by the web server is now pointing to the entry point of your framework. 101 | 102 | !!! warning "NOTE" 103 | 104 | When using **Docker Toolbox**, you need to **explicitly allow** the usage of **symlinks**. 105 | 106 | ### DNS Record 107 | 108 | If you **have** Auto DNS configured already, you can skip this section, because DNS entries will be available automatically by the bundled DNS server. 109 | 110 | If you **do not have** Auto DNS configured, you will need to add the following line to your host operating system `/etc/hosts` file (or `C:\Windows\System32\drivers\etc` on Windows): 111 | 112 | ```bash 113 | 127.0.0.1 my-phalcon.loc 114 | ``` 115 | 116 | ### Open your Browser 117 | 118 | Open your browser and navigate to `http://my-phalcon.loc` or `https://my-phalcon.loc` 119 | 120 | 121 | ### Create Custom Vhost Config File (Nginx Only) 122 | 123 | By default routes will not work if using Nginx. To fix this, you will need to create a custom vhost configuration. 124 | 125 | In your project folder, you will need to create a folder called `.devilbox` unless you changed `HTTPD_TEMPLATE_DIR` in your `.env` 126 | 127 | Copy the default nginx config from `./cfg/vhost-gen/nginx.yml-example-vhost` to `./data/www/my-project/.devilbox/nginx.yml` 128 | 129 | Carefully edit the nginx.yml file and change: 130 | 131 | `try_files $uri $uri/ /index.php$is_args$args;` 132 | 133 | to 134 | 135 | `try_files $uri $uri/ /index.php?_url=$uri&$args;` 136 | 137 | and 138 | 139 | `location ~ \.php?$ {` 140 | 141 | to 142 | 143 | `location ~ [^/]\.php(/|$) {` 144 | 145 | Save the file as `nginx.yml` and ensure not to use any tabs in the file or devilbox will not use the custom configuration. You can use `yamllint nginx.yml` whilst inside the Devilbox shell to check the file before restarting devilbox. 146 | 147 | ## References 148 | - [Devilbox.com][devilbox] 149 | - [Devilbox Documentation][devilbox-documentation] 150 | - [HOST_PATH_HTTPD_DATADIR][host-path-httpd-datadir] 151 | - [Enter the PHP container][enter-container] 152 | - [Work inside the PHP container][work-in-container] 153 | - [Available tools][available-tools] 154 | - [TLD_SUFFIX][tld-suffix] 155 | - [Docker Toolbox and Symlinks][docker-toolbox-symlinks] 156 | - [Add project hosts entry on MacOS][hosts-mac] 157 | - [Add project hosts entry on Windows][hosts-windows] 158 | - [Setup Auto DNS][auto-dns] 159 | 160 | [devilbox]: https://devilbox.org 161 | [devilbox-documentation]: https://devilbox.readthedocs.io/en/latest/examples/setup-phalcon.html 162 | [host-path-httpd-datadir]: https://devilbox.readthedocs.io/en/latest/configuration-files/env-file.html#env-httpd-datadir 163 | [enter-container]: https://devilbox.readthedocs.io/en/latest/getting-started/enter-the-php-container.html#enter-the-php-container 164 | [work-in-container]: https://devilbox.readthedocs.io/en/latest/intermediate/work-inside-the-php-container.html#work-inside-the-php-container 165 | [available-tools]: https://devilbox.readthedocs.io/en/latest/readings/available-tools.html#available-tools 166 | [tld-suffix]: https://devilbox.readthedocs.io/en/latest/configuration-files/env-file.html#env-tld-suffix 167 | [docker-toolbox-symlinks]: https://devilbox.readthedocs.io/en/latest/howto/docker-toolbox/docker-toolbox-and-the-devilbox.html#howto-docker-toolbox-and-the-devilbox-windows-symlinks 168 | [hosts-mac]: https://devilbox.readthedocs.io/en/latest/howto/dns/add-project-dns-entry-on-mac.html#howto-add-project-hosts-entry-on-mac 169 | [hosts-windows]: https://devilbox.readthedocs.io/en/latest/howto/dns/add-project-dns-entry-on-win.html#howto-add-project-hosts-entry-on-win 170 | [auto-dns]: https://devilbox.readthedocs.io/en/latest/intermediate/setup-auto-dns.html#setup-auto-dns 171 | -------------------------------------------------------------------------------- /docs/environments-nanobox.md: -------------------------------------------------------------------------------- 1 | # Environments 2 | - - - 3 | 4 | !!! info "NOTE" 5 | 6 | [Nanobox][nanobox] has been discontinued. 7 | 8 | [nanobox]: https://nanobox.io 9 | -------------------------------------------------------------------------------- /docs/generating-backtrace.md: -------------------------------------------------------------------------------- 1 | # Generating a Backtrace 2 | - - - 3 | 4 | Phalcon is compiled into a C extension loaded on your web server. Because of that, bugs lead to segmentation faults, causing Phalcon to crash some of your web server processes. 5 | 6 | For debugging these segmentation faults a stacktrace is required. Creating a stack trace requires a special build of php and some steps need to be done to generate a trace that allows the Phalcon team to debug this behavior. 7 | 8 | Please follow this guide to understand how to generate the backtrace. 9 | 10 | [https://bugs.php.net/bugs-generating-backtrace.php](https://bugs.php.net/bugs-generating-backtrace.php) 11 | 12 | [https://bugs.php.net/bugs-generating-backtrace-win32.php](https://bugs.php.net/bugs-generating-backtrace-win32.php) 13 | -------------------------------------------------------------------------------- /docs/html-attributes.md: -------------------------------------------------------------------------------- 1 | # HTML Components 2 | - - - 3 | 4 | ## Overview 5 | The [Phalcon\Html\Attributes][html-attributes] is a wrapper of [Phalcon\Support\Collection][support-collection]. It also contains two more methods `render()` and `__toString()`. `render()` uses [Phalcon\Html\TagFactory][html-tagfactory] internally to render the attributes that an HTML element has. These HTML attributes are defined in the object itself. 6 | 7 | The component can be used on its own if you want to collect HTML attributes in an object and then _render_ them (return them as a string) in a `key=value` format. 8 | 9 | This component is used internally by [Phalcon\Forms\Form][forms] to store the attributes of form elements. 10 | 11 | [html-attributes]: api/phalcon_html.md#html-attributes 12 | [html-attributes-attributesinterface]: api/phalcon_html.md#html-attributes-attributesinterface 13 | [html-attributes-renderinterface]: api/phalcon_html.md#html-attributes-renderinterface 14 | [html-tagfactory]: api/phalcon_html.md#html-tagfactory 15 | [support-collection]: support-collection.md 16 | [forms]: forms.md 17 | -------------------------------------------------------------------------------- /docs/html-breadcrumbs.md: -------------------------------------------------------------------------------- 1 | # HTML Components 2 | - - - 3 | 4 | ## Overview 5 | A common piece of HTML that is present in many web applications is the breadcrumbs. These are links separated by a space or by the `/` character usually, that represent the tree structure of an application. The purpose is to give users another easy visual way to navigate throughout the application. 6 | 7 | An example is an application that has an `admin` module, an `invoices` area and a `view invoice` page. Usually, you would select the `admin` module, then from the links you will choose `invoices` (list) and then clicking on one of the invoices in the list, you can view it. To represent this tree like structure, the breadcrumbs displayed could be: 8 | 9 | ```php 10 | Home / Admin / Invoices / Viewing Invoice [1234] 11 | ``` 12 | Each of the words above (apart from the last one) are links to the respective pages. This way the user can quickly navigate back to a different area without having to click the back button or use another menu. 13 | 14 | [Phalcon\Html\Breadcrumbs][html-breadcrumbs] offers functionality to add text and URLs. The resulting HTML when calling `render()` will have each breadcrumb enclosed in `
` tags, while the whole string is enclosed in `
` tags. 15 | 16 | ### Methods 17 | ```php 18 | public function add( 19 | string $label, 20 | string $link = "" 21 | ): Breadcrumbs 22 | ``` 23 | Adds a new crumb. 24 | 25 | In the example below, add a crumb with a link and then add a crumb without a link (normally the last one) 26 | 27 | ```php 28 | $breadcrumbs 29 | ->add("Home", "/") 30 | ->add("Users") 31 | ; 32 | ``` 33 | 34 | ```php 35 | public function clear(): void 36 | ``` 37 | Clears the crumbs 38 | 39 | ```php 40 | $breadcrumbs->clear() 41 | ``` 42 | 43 | ```php 44 | public function getSeparator(): string 45 | ``` 46 | Returns the separator used for the breadcrumbs 47 | 48 | ```php 49 | public function remove(string $link): void 50 | ``` 51 | Removes crumb by url. 52 | 53 | In the example below remove a crumb by URL and also remove a crumb without an url (last link) 54 | 55 | ```php 56 | $breadcrumbs->remove("/admin/user/create"); 57 | $breadcrumbs->remove(); 58 | ``` 59 | 60 | ```php 61 | public function render(): string 62 | ``` 63 | Renders and outputs breadcrumbs HTML. The template used is: 64 | 65 | ```html 66 |
67 |
Text
/ 68 |
Text
/ 69 |
Text
70 |
71 | ``` 72 | The last set crumb will not have a link and will only have its text displayed. Each crumb is wrapped in `
` tags. The whole collection is wrapped in `
` tags. You can use them in conjunction with CSS to format the crumbs on screen according to the needs of your application. 73 | 74 | ```php 75 | echo $breadcrumbs->render(); 76 | ``` 77 | 78 | ```php 79 | public function setSeparator(string $separator) 80 | ``` 81 | The default separator between the crumbs is `/`. You can set a different one if you wish using this method. 82 | 83 | ```php 84 | $breadcrumbs->setSeparator('-'); 85 | ``` 86 | 87 | ```php 88 | public function toArray(): array 89 | ``` 90 | Returns the internal breadcrumbs array 91 | 92 | [html-breadcrumbs]: api/phalcon_html.md#html-breadcrumbs 93 | [html-exception]: api/phalcon_html.md#html-exception 94 | [html-tagfactory]: api/phalcon_html.md#html-tagfactory 95 | -------------------------------------------------------------------------------- /docs/html-link.md: -------------------------------------------------------------------------------- 1 | # HTML Link 2 | - - - 3 | 4 | ## Overview 5 | [Phalcon\Html\Link\EvolvableLink][html-link-evolvablelink], [Phalcon\Html\Link\EvolvableLinkProvider][html-link-evolvablelinkprovider], [Phalcon\Html\Link\Link][html-link-link] and [Phalcon\Html\Link\LinkProvider][html-link-linkprovider] are classes that implement the interfaces based on [PSR-13][psr-13], but with much stricter types 6 | 7 | !!! info "NOTE" 8 | 9 | This component does not generate any HTML links. It just stores the links. You will need to create your own serializers that will parse these objects and generate the necessary output. The [Phalcon\Html\Link\Serializer\Header][html-link-serializer-header] serializer is available for you to use. 10 | 11 | ### Operations 12 | The `Phalcon\Html\Link\*` components implement methods that are inline with [PSR-13][psr-13], but do not implement the particular interface. A package that implements [PSR-13][psr-13] is available, that uses the `Phalcon\Html\Link\*` components. The package is located [here][proxy-psr13]. To use it, you will need to have Phalcon installed and then using composer you can install the proxy package. 13 | 14 | ```sh 15 | composer require phalcon/proxy-psr13 16 | ``` 17 | 18 | Using the proxy classes allows you to follow [PSR-13][psr-13] and use it with any other package that needs that interface. 19 | 20 | ## Link 21 | The [Phalcon\Html\Link\Link][html-link-link] is used to create a link and assign attributes to it upon construction. 22 | 23 | ```php 24 | true, 31 | 'two' => 123, 32 | 'three' => 'four', 33 | 'five' => [ 34 | 'six', 35 | 'seven', 36 | ], 37 | ]; 38 | 39 | $link = new Link('payment', $href, $attributes); 40 | ``` 41 | 42 | ## LinkProvider 43 | The [Phalcon\Html\Link\LinkProvider][html-link-linkprovider] is used as a container of [Phalcon\Html\Link\Link][html-link-link] objects. You can add them in the provider and then access them as a whole or retrieve them by `rel`. 44 | 45 | ```php 46 | getLinksByRel('cite-as') 60 | ); 61 | 62 | // [ 63 | // Link('cite-as', 'https://test.phalcon.ld'), 64 | // ] 65 | ``` 66 | 67 | ## EvolvableLink 68 | Link objects are immutable. However, there is a need to manipulate them based on your application needs. The [Phalcon\Html\Link\EvolvableLink][html-link-evolvablelink] is available, allowing you to manipulate the link. 69 | 70 | ```php 71 | true]; 77 | 78 | $link = new EvolvableLink('payment', $href, $attributes); 79 | 80 | $newInstance = $link->withAttribute('two', 'three'); 81 | 82 | var_dump( 83 | $newInstance->getAttributes() 84 | ); 85 | 86 | // [ 87 | // 'one' => true, 88 | // 'two' => 'three', 89 | // ]; 90 | ``` 91 | 92 | ## EvolvableLinkProvider 93 | The [Phalcon\Html\Link\LinkProvider][html-link-linkprovider] is used as a container of [Phalcon\Html\Link\EvolvableLink][html-link-evolvablelink] objects. You can add them in the provider and then access them as a whole or retrieve them by `rel`. 94 | 95 | ```php 96 | getLinksByRel('cite-as') 110 | ); 111 | 112 | // [ 113 | // Link('cite-as', 'https://test.phalcon.ld'), 114 | // ] 115 | ``` 116 | 117 | ## Serializers 118 | ### Header 119 | You can use a serializer to parse the `Phalcon\Html\Link\*` objects and create the necessary headers. Phalcon comes with the [Phalcon\Html\Link\Serializer\Header][html-link-serializer-header] serializer, to help with the task of serializing links for the headers: 120 | 121 | ```php 122 | serialize([$link]); 132 | // ; rel="prefetch"'; 133 | 134 | 135 | $links = [ 136 | (new EvolvableLink('preload', '/1')) 137 | ->withAttribute('as', 'image') 138 | ->withAttribute('nopush', true), 139 | (new EvolvableLink('alternate', '/2')) 140 | ->withRel('next') 141 | ->withAttribute('hreflang', ['en', 'es']) 142 | ]; 143 | 144 | echo $serializer->serialize([$link]); 145 | // ; rel="preload"; as="image"; nopush, 146 | // ; rel="alternate next"; hreflang="en"; hreflang="es" 147 | ; 148 | ``` 149 | 150 | ### Custom 151 | You can create your own serializers for relevant links by extending the [Phalcon\Html\Link\Serializer\SerializerInterface][html-link-serializer-serializerinterface] 152 | 153 | ```php 154 | format([4560]); 53 | 54 | // USD$ 4,560.5 55 | $formatter = new MessageFormatter('en_US', 'USD$ {0, number}'); 56 | echo $formatter->format([4560.50]); 57 | 58 | // ARS$ 1.250,25 59 | $formatter = new MessageFormatter('es_AR', 'ARS$ {0, number}'); 60 | echo $formatter->format([1250.25]); 61 | ``` 62 | 63 | Message formatting using time and date patterns: 64 | 65 | ```php 66 | format($values); 77 | 78 | // 'À 15:53:01 le 19 avr. 2015, il y avait une perturbation sur la planète 7.' 79 | $pattern = 'À {1, time} le {1, date}, il y avait une perturbation sur la planète {0, number}.'; 80 | $formatter = new MessageFormatter('fr_FR', $pattern); 81 | echo $formatter->format($values); 82 | ``` 83 | 84 | ## Locale-Sensitive Comparison 85 | The [Collator][collator] class provides string comparison capability with support for appropriate locale-sensitive sort orderings. Check the examples below on the usage of this class: 86 | 87 | ```php 88 | setStrength(Collator::PRIMARY); 97 | 98 | var_dump( 99 | $collator->compare('una canción', 'una cancion') 100 | ); 101 | 102 | // Returns that the strings are not equal 103 | $collator->setStrength(Collator::DEFAULT_VALUE); 104 | 105 | var_dump( 106 | $collator->compare('una canción', 'una cancion') 107 | ); 108 | ``` 109 | 110 | ## Transliteration 111 | [Transliterator][transliterator] provides transliteration of strings: 112 | 113 | ```php 114 | transliterate($string); // garconetudiantoulecole 123 | ``` 124 | 125 | [intl]: https://pecl.php.net/package/intl 126 | [intl-manual]: https://www.php.net/manual/en/intro.intl.php 127 | [intl-book]: https://www.php.net/manual/en/book.intl.php 128 | [messageformatter]: https://www.php.net/manual/en/class.messageformatter.php 129 | [collator]: https://www.php.net/manual/en/class.collator.php 130 | [transliterator]: https://www.php.net/manual/en/class.transliterator.php 131 | -------------------------------------------------------------------------------- /docs/introduction.md: -------------------------------------------------------------------------------- 1 | 2 | # Phalcon Framework: A PHP framework built as an extension for PHP 3 | 4 | **A full-stack PHP framework delivered as a C-extension** 5 | 6 | [![Phalcon](https://github.com/phalcon/cphalcon/actions/workflows/main.yml/badge.svg?branch=5.0.x)](https://github.com/phalcon/cphalcon/actions/workflows/main.yml) 7 | 8 | ## Mission :rocket: 9 | 10 | Our mission is to empower developers with an advanced, feature-rich tool: Phalcon. This framework is designed to facilitate the development of powerful applications with minimal server resource consumption and optimal performance. 11 | 12 | ## What is Phalcon :question: 13 | 14 | Phalcon is an open-source full-stack framework for PHP, distinguished by its unique architecture written as a C-extension. This means that it is implemented in C and directly integrated into PHP for enhanced performance. 15 | 16 | Its innovative architecture ensures that the framework is always memory-resident, providing functionality on demand without the overhead of file stats and reads typical in traditional PHP frameworks. 17 | 18 | ## Usage :memo: 19 | 20 | Phalcon is designed to be developer-friendly, and you don't need to be familiar with the C language to utilize its power. The framework's interface is exposed as PHP classes under the `Phalcon` namespace, making it accessible and easy to use. 21 | 22 | Phalcon is loosely coupled, allowing developers to use only the objects that they need as glue components based in the needs of their applications. 23 | 24 | !!! info "NOTE" 25 | 26 | The translation of the documentation is driven by enthusiasts and contributors. We invite and appreciate your participation in the translation effort. Contribute new translations or corrections via [GitHub][github_docs] for English or [Crowdin][crowdin] for other languages. 27 | 28 | You can check our [GitHub][github] project for the code and browse through these documents for usage and functionality. 29 | 30 | Since this is a community driven project, you can share your thoughts and requests for functionality you need by issuing a [New Feature Request][new-feature-request] and if you wish vote in GitHub for [existing NFRs][new-feature-request-list]. 31 | 32 | Feel free to connect with us using our social media accounts: 33 | 34 |
35 | 36 | - :octicons-discussion-closed-16:{ .lg .middle } __Chat - QA__ 37 | 38 | --- 39 | 40 | [:octicons-chevron-right-12: Discord Chat][discord] 41 | 42 | [:octicons-chevron-right-12: Discussions][discussions] 43 | 44 | - :octicons-question-16:{ .lg .middle } __Support__ 45 | 46 | --- 47 | 48 | [:octicons-chevron-right-12: GitHub Sponsors - Support Us][github_sponsors] 49 | 50 | [:octicons-chevron-right-12: OpenCollective - Support Us][opencollective_sponsors] 51 | 52 | - :octicons-megaphone-16:{ .lg .middle } __Social Media__ 53 | 54 | --- 55 | 56 | [:octicons-chevron-right-12: Telegram][telegram] 57 | 58 | [:octicons-chevron-right-12: Gab][gab] 59 | 60 | [:octicons-chevron-right-12: MeWe][mewe] 61 | 62 | [:octicons-chevron-right-12: Reddit][reddit] 63 | 64 | [:octicons-chevron-right-12: Facebook][fb] 65 | 66 | [:octicons-chevron-right-12: Twitter][t] 67 | 68 | 69 | - :octicons-video-16:{ .lg .middle } __Videos__ 70 | 71 | --- 72 | 73 | [:octicons-chevron-right-12: BitChute][bitchute] 74 | 75 | [:octicons-chevron-right-12: LBRY][lbry] 76 | 77 | [:octicons-chevron-right-12: YouTube][youtube] 78 | 79 |
80 | 81 | 82 | [github]: https://github.com/phalcon/cphalcon 83 | [github_docs]: https://github.com/phalcon/docs 84 | [new-feature-request]: new-feature-request.md 85 | [new-feature-request-list]: new-feature-request-list.md 86 | [discord]: https://phalcon.io/discord 87 | [discussions]: https://phalcon.io/discussions 88 | [github_sponsors]: https://github.com/sponsors/phalcon 89 | [opencollective_sponsors]: https://phalcon.io/fund 90 | [telegram]: https://phalcon.io/telegram 91 | [gab]: https://phalcon.io/gab 92 | [mewe]: https://phalcon.io/mewe 93 | [reddit]: https://phalcon.io/reddit 94 | [fb]: https://phalcon.io/fb 95 | [t]: https://phalcon.io/t 96 | 97 | 98 | - :octicons-video-16:{ .lg .middle } __Videos__ 99 | 100 | --- 101 | 102 | [:octicons-chevron-right-12: BitChute](https://phalcon.io/bitchute) 103 | 104 | [:octicons-chevron-right-12: LBRY](https://phalcon.io/lbry) 105 | 106 | [:octicons-chevron-right-12: YouTube](https://phalcon.io/youtube) 107 | -------------------------------------------------------------------------------- /docs/mvc.md: -------------------------------------------------------------------------------- 1 | # MVC - Model View Controller 2 | - - - 3 | 4 | ## Overview 5 | Model View Controller ([MVC][wiki-mvc]) is a software architectural pattern, which divides the application logic into three interconnected elements, separating internal representations of information of the application. 6 | 7 | Phalcon offers the object-oriented classes, necessary to implement the Model View Controller in your application. This design pattern is widely used by other web frameworks and desktop applications. 8 | 9 | MVC benefits include: 10 | 11 | * Isolation of business logic from the user interface and the database layer 12 | * Making it clear where different types of code belong for easier maintenance 13 | 14 | If you decide to use MVC, every request to your application resources will be managed by the MVC architecture. Phalcon classes are written in Zephir, which is translated to C, offering a high performance implementation of the MVC pattern in PHP applications. 15 | 16 | ## Models 17 | A model represents the information (data) of the application and the rules to manipulate that data. Models are primarily used for managing the rules of interaction with a corresponding database table. In most cases, each table in your database will correspond to one model in your application. The bulk of your application's business logic will be concentrated in the models. [more...][db-models] 18 | 19 | ## Views 20 | Views represent the user interface of your application. Views are often HTML files with embedded PHP code that perform tasks related solely to the presentation of the data. Views handle the job of providing data to the web browser or other tool that is used to make requests from your application. [more...][views] 21 | 22 | ## Controllers 23 | The controllers provide the _flow_ between models and views. Controllers are responsible for processing the incoming requests from the web browser, interrogating the models for data, and passing that data on to the views for presentation. [more...][controllers] 24 | 25 | [wiki-mvc]: https://en.wikipedia.org/wiki/Model–view–controller 26 | [db-models]: db-models.md 27 | [views]: views.md 28 | [controllers]: controllers.md 29 | -------------------------------------------------------------------------------- /docs/namespaces.md: -------------------------------------------------------------------------------- 1 | # Namespaces 2 | - - - 3 | 4 | ## Overview 5 | [Namespaces][namespaces] can be used to avoid class name collisions. This means that if you have two controllers in an application with the same name, a namespace can be used help PHP understand that they are two different classes. Namespaces are also useful when creating bundles or modules. 6 | 7 | ## Activation 8 | If you decided to use namespaces for your application, you will need to instruct your autoloader on where your namespaces reside. This is the most common way to distinguish between namespaces in your application. If you chose to use the [Phalcon\Autoload\Loader][autoload] component, then you will need to register your namespaces accordingly: 9 | 10 | ```php 11 | registerNamespaces( 14 | [ 15 | 'MyApp\Admin\Controllers' => '/app/web/admin/controllers/', 16 | 'MyApp\Admin\Models' => '/app/web/admin/models/', 17 | ] 18 | ); 19 | ``` 20 | 21 | You can also specify the namespace when defining your routes, using the [Router][routing] component: 22 | 23 | ```php 24 | add( 27 | '/admin/invoices/list', 28 | [ 29 | 'namespace' => 'MyApp\Admin', 30 | 'controller' => 'Invoices', 31 | 'action' => 'list', 32 | ] 33 | ); 34 | ``` 35 | 36 | or passing it as part of the route as a parameter 37 | 38 | ```php 39 | add( 42 | '/:namespace/invoices/list', 43 | [ 44 | 'namespace' => 1, 45 | 'controller' => 'Invoices', 46 | 'action' => 'list', 47 | ] 48 | ); 49 | ``` 50 | 51 | Finally, if you are only working with the same namespace for every controller, you can define a default namespace in your [Dispatcher][dispatcher]. Doing so, you will not need to specify the full class in the router path: 52 | 53 | ```php 54 | set( 59 | 'dispatcher', 60 | function () { 61 | $dispatcher = new Dispatcher(); 62 | 63 | $dispatcher->setDefaultNamespace( 64 | 'MyApp\Admin\Controllers' 65 | ); 66 | 67 | return $dispatcher; 68 | } 69 | ); 70 | ``` 71 | 72 | ## Controllers 73 | The following example shows how to implement a controller that uses namespaces: 74 | 75 | ```php 76 | hasMany( 126 | 'inv_cst_id', 127 | Customers::class, 128 | 'cst_id', 129 | [ 130 | 'alias' => 'customers', 131 | ] 132 | ); 133 | } 134 | } 135 | ``` 136 | 137 | In PHQL you must write the statements including namespaces: 138 | 139 | ```php 140 | '/tmp', 28 | ] 29 | ); 30 | 31 | $session->setHandler($adapter); 32 | 33 | $session->start(); 34 | 35 | return $session; 36 | }; 37 | 38 | $container['cookies'] = function() { 39 | $cookies = new Cookies(); 40 | 41 | $cookies->useEncryption(false); 42 | 43 | return $cookies; 44 | }; 45 | 46 | class SomeClass extends Injectable 47 | { 48 | public function someMethod() 49 | { 50 | $cookies = $this->getDI()->getCookies(); 51 | 52 | $cookies->set( 53 | 'mycookie', 54 | 'test', 55 | time() + 3600, 56 | '/' 57 | ); 58 | } 59 | } 60 | 61 | $class = new MyClass(); 62 | 63 | $class->setDI($container); 64 | 65 | $class->someMethod(); 66 | 67 | $container['cookies']->send(); 68 | 69 | var_dump($_SESSION); 70 | var_dump($_COOKIE); 71 | ``` 72 | 73 | ### Database 74 | 75 | !!! info "NOTE" 76 | 77 | Remember to include the register information for your `db` service, i.e. adapter, connection parameters etc. 78 | 79 | ```php 80 | setShared( 88 | 'db', 89 | function () { 90 | return new Mysql( 91 | [ 92 | 'host' => '127.0.0.1', 93 | 'username' => 'root', 94 | 'password' => '', 95 | 'dbname' => 'test', 96 | 'charset' => 'utf8', 97 | ] 98 | ); 99 | } 100 | ); 101 | 102 | $result = $container['db']->query('SELECT * FROM customers'); 103 | ``` 104 | 105 | ### Single/Multi-Module Applications 106 | 107 | !!! info "NOTE" 108 | 109 | Remember to add to the script how you are creating the `Phalcon\Mvc\Application` instance and how you register your modules 110 | 111 | ```php 112 | setDI($container); 124 | 125 | // register modules if any 126 | 127 | $response = $application->handle( 128 | $_SERVER["REQUEST_URI"] 129 | ); 130 | 131 | echo $response->getContent(); 132 | ``` 133 | 134 | Include models and controllers as part of the test: 135 | 136 | ```php 137 | setDI($container); 151 | 152 | class IndexController extends Controller 153 | { 154 | public function indexAction() { 155 | /* your content here */ 156 | } 157 | } 158 | 159 | class Users extends Model 160 | { 161 | } 162 | 163 | $response = $application->handle( 164 | $_SERVER["REQUEST_URI"] 165 | ); 166 | 167 | echo $response->getContent(); 168 | ``` 169 | 170 | ### Micro Application 171 | For micro applications, you can use the skeleton script below: 172 | 173 | ```php 174 | handle( 188 | $_SERVER["REQUEST_URI"] 189 | ); 190 | ``` 191 | 192 | ### ORM 193 | 194 | !!! info "NOTE" 195 | 196 | You can provide your own database schema or even better, use any of the existing schemas in our testing suite (located in `tests/_data/assets/db/schemas/` in the repository). 197 | 198 | ```php 199 | 'localhost', 213 | 'username' => 'root', 214 | 'password' => '', 215 | 'dbname' => 'test', 216 | ] 217 | ); 218 | 219 | $connection->setEventsManager($eventsManager); 220 | 221 | $eventsManager->attach( 222 | 'db:beforeQuery', 223 | function ($event, $connection) { 224 | echo $connection->getSqlStatement(), '
' . PHP_EOL; 225 | } 226 | ); 227 | 228 | $container['db'] = $connection; 229 | $container['modelsManager'] = new ModelsManager(); 230 | $container['modelsMetadata'] = new ModelsMetadata(); 231 | 232 | if (true !== $connection->tableExists('user', 'test')) { 233 | $connection->execute( 234 | 'CREATE TABLE user ( 235 | id integer primary key auto_increment, 236 | email varchar(120) not null 237 | )' 238 | ); 239 | } 240 | 241 | class User extends Model 242 | { 243 | public $id; 244 | 245 | public $email; 246 | 247 | public static function createNewUserReturnId() 248 | { 249 | $newUser = new User(); 250 | 251 | $newUser->email = 'test'; 252 | 253 | if (false === $newUser->save()) { 254 | return false; 255 | } 256 | 257 | return $newUser->id; 258 | } 259 | } 260 | 261 | echo User::createNewUserReturnId(); 262 | ``` 263 | 264 | [issues]: https://github.com/phalcon/cphalcon/issues 265 | [gist]: https://gist.github.com/ 266 | -------------------------------------------------------------------------------- /docs/sponsors.md: -------------------------------------------------------------------------------- 1 | # Becoming a Sponsor 2 | 3 | For those that wish to sponsor our work and further the development of Phalcon, we offer various sponsorship options that will fit any budget. Sponsoring our work allows us to devote more time to the project, offer faster responses to bugs and features and ensure the project's stability. 4 | 5 | # Sponsors and Supporters 6 | 7 | {% include sponsors.html %} 8 | -------------------------------------------------------------------------------- /docs/static-analysis.md: -------------------------------------------------------------------------------- 1 | # Static Analysis 2 | - - - 3 | 4 | ## Overview 5 | 6 | Using a static analysis tool in your project can dramatically increase your code quality and highlight potential bugs before they are exposed. 7 | 8 | ## Integrating Psalm with Phalcon 9 | 10 | ```bash 11 | composer require --dev vimeo/psalm 12 | ``` 13 | 14 | or by manually adding it to `composer.json`: 15 | 16 | ```json 17 | { 18 | "require-dev": { 19 | "vimeo/psalm": "^4.7" 20 | } 21 | } 22 | ``` 23 | 24 | ### Phalcon IDE Stubs 25 | 26 | Phalcon provides a stub library that provides support for most IDEs. Psalm requires these stubs in order to properly analyze the codebase. These files exist in the [Phalcon IDE Stubs](https://github.com/phalcon/ide-stubs) repository. 27 | 28 | You can use the IDE Stubs library by adding it as a dependency: 29 | 30 | ```bash 31 | composer require --dev phalcon/ide-stubs:^v5.0 32 | ``` 33 | 34 | or by manually adding it to `composer.json`: 35 | 36 | ```json 37 | { 38 | "require-dev": { 39 | "phalcon/ide-stubs": ",^v5.0" 40 | } 41 | } 42 | ``` 43 | 44 | ## Initializing Psalm 45 | 46 | Run the command `vendor/bin/psalm --init` in the root of your project to initialize Psalm. Psalm will create a default project configuration file called `psalm.xml` at the root of your project. 47 | 48 | ### Sample Configuration with Phalcon Stubs 49 | 50 | The configuration file below serves as a good base to use in your project. Replace the contents in `psalm.xml` with the contents below and update any parameters applicable to your project settings. 51 | 52 | If you find that you need to stub additional Phalcon components, add them to the stub section of the configuration with the full path to their location in the `ide-stubs` package. 53 | 54 | ```xml 55 | 56 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | ``` 96 | 97 | ### Running Psalm 98 | 99 | When you execute `vendor/bin/psalm` in your command-line, you will a get similar output depending on your errors: 100 | 101 | ```bash 102 | Scanning files... 103 | Analyzing files... 104 | 105 | ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 60 / 95 (63%) 106 | ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 107 | ------------------------------ 108 | No errors found! 109 | ------------------------------ 110 | 111 | Checks took 0.80 seconds and used 214.993MB of memory 112 | Psalm was able to infer types for 92.9630% of the codebase 113 | ``` 114 | 115 | Fix your errors, and re-run Psalm! 116 | 117 | ## Resources 118 | - [Psalm Documentation](https://psalm.dev/docs/) 119 | - [Static Analysis with Psalm PHP](https://www.twilio.com/blog/static-analysis-with-psalm-php) 120 | - [What Is Static Code Analysis?](https://www.perforce.com/blog/sca/what-static-analysis) 121 | -------------------------------------------------------------------------------- /docs/support-version.md: -------------------------------------------------------------------------------- 1 | # Version Component 2 | - - - 3 | 4 | ## Overview 5 | [Phalcon\Support\Version][version] is a small but handy class, that returns the current version of Phalcon installed in your system. 6 | 7 | 8 | ## Constants 9 | 10 | | Name | Value | Description | 11 | |--------------------------|:-------:|----------------------------------------| 12 | | `VERSION_MAJOR` | 0 | The major version | 13 | | `VERSION_MEDIUM` | 1 | The medium version | 14 | | `VERSION_MINOR` | 2 | The minor version | 15 | | `VERSION_SPECIAL` | 3 | The special version (alpha, beta etc.) | 16 | | `VERSION_SPECIAL_NUMBER` | 4 | The special version number | 17 | 18 | ## Methods 19 | 20 | ```php 21 | protected function getVersion(): array 22 | ``` 23 | Return an array with each version part as an element. 24 | 25 | ```php 26 | getVersion); 33 | // 5.0.0RC4 34 | // [5, 0, 0, 3, 4] 35 | ``` 36 | 37 | ```php 38 | protected function get(): string 39 | ``` 40 | Return the version 41 | 42 | ```php 43 | get(); 50 | // 5.0.0RC4 51 | ``` 52 | 53 | ```php 54 | protected function getId(): string 55 | ``` 56 | Return the version as a number string 57 | 58 | ```php 59 | getId(); 66 | // 5000034 67 | ``` 68 | 69 | [version]: api/phalcon_support.md#support-version 70 | -------------------------------------------------------------------------------- /docs/unit-testing.md: -------------------------------------------------------------------------------- 1 | # Unit Testing 2 | - - - 3 | 4 | ## Overview 5 | 6 | Writing proper tests can assist in writing better software. If you set up proper test cases you can eliminate most functional bugs and better maintain your software. 7 | 8 | ## Integrating PHPUnit with Phalcon 9 | 10 | ```bash 11 | composer require --dev phpunit/phpunit:^9.0 12 | ``` 13 | 14 | or by manually adding it to `composer.json`: 15 | 16 | ```json 17 | { 18 | "require-dev": { 19 | "phpunit/phpunit": "^9.0" 20 | } 21 | } 22 | ``` 23 | 24 | Once PHPUnit is installed, create a directory called `tests` in project root directory with a subdirectory called `Unit`: 25 | 26 | ``` 27 | app/ 28 | src/ 29 | public/ 30 | tests/Unit/ 31 | ``` 32 | 33 | ### Configure Test Namespace 34 | 35 | In order to autoload our test directory, we must add our test namespace to composer. Add the below to composer and modify it to fit your needs. 36 | 37 | ```json 38 | { 39 | "autoload-dev": { 40 | "psr-4": { 41 | "Tests\\": "tests" 42 | } 43 | } 44 | } 45 | ``` 46 | 47 | Now, create a `phpunit.xml` file as follows: 48 | 49 | ### The `phpunit.xml` file 50 | 51 | Modify the `phpunit.xml` below to fit your needs and save it in your project root directory. This will run any tests under the `tests/Unit` directory. 52 | 53 | ```xml 54 | 55 | 56 | 65 | 66 | 67 | ./tests/Unit 68 | 69 | 70 | ``` 71 | 72 | ### Phalcon Incubator Test 73 | 74 | Phalcon provides a test library that provides few abstract classes you can use to bootstrap the Unit Tests themselves. These files exist in [Phalcon Incubator Test](https://github.com/phalcon/incubator-test) repository. 75 | 76 | You can use the Incubator test library by adding it as a dependency: 77 | 78 | ```bash 79 | composer require --dev phalcon/incubator-test:^v1.0.0-alpha.1 80 | ``` 81 | 82 | or by manually adding it to `composer.json`: 83 | 84 | ```json 85 | { 86 | "require-dev": { 87 | "phalcon/incubator-test": "^v1.0.0-alpha.1" 88 | } 89 | } 90 | ``` 91 | 92 | ## Creating a Unit Test 93 | 94 | It is always wise to autoload your classes using namespaces. The configuration below assumes that you are using PSR-4 to autoload your project classes via a composer configuration. Doing so, the autoloader will make sure the proper files are loaded so all you need to do is create the files and phpunit will run the tests for you. 95 | 96 | This example does not contain a config file, as most cases you should be mocking your dependencies. If you happen to need one, you can add to the `DI` in the `AbstractUnitTest`. 97 | 98 | ### Abstract Unit Test 99 | First create a base Unit Test called `AbstractUnitTest.php` in your `tests/Unit` directory: 100 | 101 | ```php 102 | loaded = true; 127 | } 128 | 129 | public function __destruct() 130 | { 131 | if (!$this->loaded) { 132 | throw new IncompleteTestError( 133 | "Please run parent::setUp()." 134 | ); 135 | } 136 | } 137 | } 138 | ``` 139 | 140 | ### Your First Test 141 | 142 | Create the test below and save it in your `tests/Unit` directory. 143 | 144 | ```php 145 | assertEquals( 156 | "roman", 157 | "roman", 158 | "This will pass" 159 | ); 160 | 161 | $this->assertEquals( 162 | "hope", 163 | "ava", 164 | "This will fail" 165 | ); 166 | } 167 | } 168 | ``` 169 | 170 | If you need to overload the `setUp` method, it is important you call the parent or Phalcon will not properly initialize. 171 | 172 | ```php 173 | protected function setUp(): void 174 | { 175 | parent::setUp(); 176 | 177 | //... 178 | } 179 | ```` 180 | 181 | ### Running Unit Tests 182 | 183 | When you execute `vendor/bin/phpunit` in your command-line, you will get the following output: 184 | 185 | ```bash 186 | $ phpunit 187 | PHPUnit 9.5.23 by Sebastian Bergmann and contributors. 188 | 189 | Runtime: PHP 8.1.8 with Xdebug 3.1.5 190 | Configuration: /var/www//phpunit.xml 191 | 192 | Time: 3 ms, Memory: 3.25Mb 193 | 194 | There was 1 failure: 195 | 196 | 1) Test\Unit\UnitTest::testTestCase 197 | This will fail 198 | Failed asserting that two strings are equal. 199 | --- Expected 200 | +++ Actual 201 | @@ @@ 202 | -'hope' 203 | +'ava' 204 | 205 | /var/www/tests/Unit/UnitTest.php:25 206 | 207 | FAILURES! 208 | Tests: 1, Assertions: 2, Failures: 1. 209 | ``` 210 | 211 | ## Resources 212 | - [PHPUnit Documentation](https://phpunit.de/documentation.html) 213 | - [Getting Started with TDD in PHP](https://www.sitepoint.com/re-introducing-phpunit-getting-started-tdd-php/) 214 | - [Writing Great Unit Tests](https://blog.stevensanderson.com/2009/08/24/writing-great-unit-tests-best-and-worst-practises/) 215 | - [What Is Mocking In PHP Unit Testing](https://www.clariontech.com/blog/what-is-mocking-in-php-unit-testing) 216 | -------------------------------------------------------------------------------- /docs/use-case.md: -------------------------------------------------------------------------------- 1 | # Use Case 2 | 3 | Throughout this documentation we are going to assume that we are building an accounting application. 4 | 5 | ## Requirements 6 | - MVC application using [Phalcon\Mvc\Application][application] 7 | - Store data in a database (MariaDB/MySQL) 8 | - Offer a UI for users to work 9 | - Login page 10 | - Administration area 11 | - Cache management 12 | - Permissions 13 | - Products CRUD 14 | - Users CRUD 15 | - Accounting department area 16 | - Invoices 17 | - Customers 18 | - Payments 19 | - Customer portal area 20 | - Invoices (view) 21 | - Payment 22 | - Reports 23 | 24 | ## Groups - User Roles 25 | 26 | | Group | Description | 27 | |----------------|----------------------------------------------------| 28 | | Guests | Users that are not logged in, visitors to the site | 29 | | Customers | Users that have purchased products | 30 | | Accounting | Users of the accounting department | 31 | | Managers | Accounting department managers | 32 | | Administrators | Full access to the whole application | 33 | 34 | ## Endpoints 35 | 36 | | Endpoint | Description | 37 | |-----------------------------------|--------------------------------------------------------------| 38 | | `/login` | Path `/session/login`. Presents the login screen | 39 | | `/logout` | Path `/session/logout`. Logs user out, redirects to `/login` | 40 | | `/portal/invoices/list` | List invoices for the currently logged in customer | 41 | | `/portal/invoices/view/{0-9}` | View invoice for the currently logged in customer | 42 | | `/portal/invoices/pay/{0-9}` | Pay invoice (payment gateway) | 43 | | `/portal/reports/list` | List available reports for the logged in customer | 44 | | `/portal/reports/view/{0-9}` | View report for this customer | 45 | | `/accounting/invoices/add` | Add new invoice | 46 | | `/accounting/invoices/edit/{0-9}` | Edit an invoice | 47 | | `/accounting/invoices/view/{0-9}` | View an invoice | 48 | | `/accounting/invoices/list` | List all invoices | 49 | | `/accounting/invoices/void/{0-9}` | Void an invoice | 50 | | `/admin/cache/view` | View all cache items | 51 | | `/admin/cache/delete/{0-9}` | Delete a cache item | 52 | | `/admin/cache/void` | Void the whole cache | 53 | | `/admin/permissions/list` | Show the current permissions | 54 | | `/admin/permissions/add` | Add a new permission | 55 | | `/admin/permissions/edit/{0-9}` | Edit a permission | 56 | | `/admin/products/list` | List all products | 57 | | `/admin/products/add` | Add a product | 58 | | `/admin/products/edit/{0-9}` | Edit a product | 59 | | `/admin/products/delete/{0-9}` | Delete a product | 60 | | `/admin/products/view/{0-9}` | View a product | 61 | | `/admin/users/list` | List all users | 62 | | `/admin/users/add` | Add a user | 63 | | `/admin/users/edit/{0-9}` | Edit a user | 64 | | `/admin/users/delete/{0-9}` | Delete a user | 65 | | `/admin/users/view/{0-9}` | View a user | 66 | 67 | [application]: application.md 68 | -------------------------------------------------------------------------------- /mkdocs.yml: -------------------------------------------------------------------------------- 1 | 2 | # Project information 3 | site_name: Phalcon Documentation 4 | site_url: https://docs.phalcon.io 5 | site_author: Phalcon Team 6 | site_description: >- 7 | Phalcon Framework. A full-stack PHP framework delivered as a PHP extension, 8 | offering lower resource consumption and high performance. 9 | 10 | # Repository 11 | repo_name: phalcon/docs 12 | repo_url: https://github.com/phalcon/docs 13 | 14 | # Copyright 15 | copyright: Copyright © 2012 - present Phalcon Team 16 | 17 | # Configuration 18 | theme: 19 | name: material 20 | # custom_dir: material/overrides 21 | features: 22 | - announce.dismiss 23 | - content.action.edit 24 | - content.action.view 25 | - content.code.annotate 26 | - content.code.copy 27 | - content.code.select 28 | # - content.tabs.link 29 | - content.tooltips 30 | # - header.autohide 31 | # - navigation.expand 32 | - navigation.footer 33 | - navigation.indexes 34 | - navigation.instant 35 | - navigation.instant.progress 36 | # - navigation.prune 37 | - navigation.sections 38 | - navigation.tabs 39 | - navigation.tabs.sticky 40 | - navigation.top 41 | - navigation.tracking 42 | - search.highlight 43 | - search.share 44 | - search.suggest 45 | - toc.follow 46 | # - toc.integrate 47 | palette: 48 | - media: "(prefers-color-scheme)" 49 | toggle: 50 | icon: material/link 51 | name: Switch to light mode 52 | - media: "(prefers-color-scheme: light)" 53 | scheme: default 54 | primary: teal 55 | accent: teal 56 | toggle: 57 | icon: material/toggle-switch 58 | name: Switch to dark mode 59 | - media: "(prefers-color-scheme: dark)" 60 | scheme: slate 61 | primary: black 62 | accent: teal 63 | toggle: 64 | icon: material/toggle-switch-off 65 | name: Switch to system preference 66 | font: 67 | text: Titillium Web 68 | code: Source Code Pro 69 | favicon: assets/images/favicon.ico 70 | logo: https://assets.phalcon.io/phalcon/images/svg/phalcon-logo-white-105x40.svg 71 | 72 | # Plugins 73 | plugins: 74 | - search: 75 | separator: '[\s\u200b\-_,:!=\[\]()"`/]+|\.(?!\d)|&[lg]t;|(?!\b)(?=[A-Z][a-z])' 76 | - minify: 77 | minify_html: true 78 | - redirects: 79 | redirect_maps: 80 | 'index.md': 'introduction.md' 81 | 'loader.md': 'autoload.md' 82 | 'collection.md': 'support-collection.md' 83 | 'helper.md': 'support-helper.md' 84 | 'registry.md': 'support-registry.md' 85 | 'version.md': 'support-version.md' 86 | 87 | # Hooks 88 | #hooks: 89 | # - material/overrides/hooks/shortcodes.py 90 | # - material/overrides/hooks/translations.py 91 | 92 | # Additional configuration 93 | extra: 94 | version: 95 | default: 5.4.0 96 | provider: mike 97 | annotate: 98 | json: [ .s2 ] 99 | social: 100 | - icon: fontawesome/brands/github 101 | link: https://github.com/phalcon 102 | - icon: fontawesome/brands/twitter 103 | link: https://twitter.com/phalconphp 104 | 105 | # Extensions 106 | markdown_extensions: 107 | - admonition 108 | - attr_list 109 | - footnotes 110 | - md_in_html 111 | - pymdownx.inlinehilite 112 | - pymdownx.snippets 113 | - pymdownx.extra 114 | - pymdownx.tabbed 115 | - pymdownx.emoji: 116 | emoji_index: !!python/name:material.extensions.emoji.twemoji 117 | emoji_generator: !!python/name:material.extensions.emoji.to_svg 118 | - pymdownx.superfences: 119 | custom_fences: 120 | - name: mermaid 121 | class: mermaid 122 | format: !!python/name:pymdownx.superfences.fence_code_format 123 | 124 | - pymdownx.highlight: 125 | anchor_linenums: true 126 | extend_pygments_lang: 127 | - name: php 128 | lang: php 129 | options: 130 | startinline: true 131 | - toc: 132 | permalink: true 133 | 134 | # Page tree 135 | nav: 136 | - Home: 137 | - Introduction: introduction.md 138 | - Changelog: 139 | - Current Version: https://github.com/phalcon/cphalcon/blob/5.0.x/CHANGELOG-5.0.md 140 | - How to upgrade: upgrade.md 141 | - Contributing: 142 | - Contributions: contributions.md 143 | - Asking a question: https://phalcon.io/discussions 144 | - Requesting a change: new-feature-request.md 145 | - Issuing a Pull Request: new-pull-request.md 146 | - Guides: 147 | - Backtrace Generation: generating-backtrace.md 148 | - Reproducible Tests: reproducible-tests.md 149 | - Testing environment: testing-environment.md 150 | - Sponsoring: sponsors.md 151 | - Getting Started: 152 | - Installation: installation.md 153 | - Webserver Setup: webserver-setup.md 154 | - Environments: 155 | - Devilbox: environments-devilbox.md 156 | - Nanobox: environments-nanobox.md 157 | - Development Tools: 158 | - Devtools: devtools.md 159 | - Debug: support-debug.md 160 | - Migrations: db-migrations.md 161 | - Unit Testing: unit-testing.md 162 | - Tutorials: 163 | - Basic: tutorial-basic.md 164 | - Invo: tutorial-invo.md 165 | - REST: tutorial-rest.md 166 | - Vokuro: tutorial-vokuro.md 167 | - Use case: use-case.md 168 | - Performance: performance.md 169 | - Core: 170 | - Application: application.md 171 | - Micro: application-micro.md 172 | - CLI: application-cli.md 173 | - DI Container: di.md 174 | - MVC: mvc.md 175 | - Namespaces: namespaces.md 176 | - API Index: api/index.md 177 | - Database: 178 | - Layer: db-layer.md 179 | - PHQL: db-phql.md 180 | - ODM: db-odm.md 181 | - Models: db-models.md 182 | - Behaviors: db-models-behaviors.md 183 | - Cache: db-models-cache.md 184 | - Events: db-models-events.md 185 | - Metadata: db-models-metadata.md 186 | - Relationships: db-models-relationships.md 187 | - Transactions: db-models-transactions.md 188 | - Validators: db-models-validation.md 189 | - Pagination: db-pagination.md 190 | - Migrations: db-migrations.md 191 | - Front End: 192 | - Assets: assets.md 193 | - Flash Messenger: flash.md 194 | - Forms: forms.md 195 | - Image: image.md 196 | - HTML: 197 | - Attributes: html-attributes.md 198 | - Breadcrumbs: html-breadcrumbs.md 199 | - Escaper: html-escaper.md 200 | - Link: html-link.md 201 | - Tag Factory: html-tagfactory.md 202 | - Tag (legacy): tag.md 203 | - View: views.md 204 | - Volt: volt.md 205 | - Business Logic: 206 | - Access Control Lists: acl.md 207 | - Annotations: annotations.md 208 | - Controllers: controllers.md 209 | - Dispatcher: dispatcher.md 210 | - Event Manager: events.md 211 | - Filters: filter-filter.md 212 | - Routing: routing.md 213 | - Sessions: session.md 214 | - Url: mvc-url.md 215 | - Validation: filter-validation.md 216 | - Services: 217 | - Cache: cache.md 218 | - Config: config.md 219 | - Escaper: html-escaper.md 220 | - HTTP: 221 | - Cookies: response.md#cookies 222 | - Request: request.md 223 | - Response: response.md 224 | - Loader: autoload.md 225 | - Logger: logger.md 226 | - i18n: 227 | - Internationalization: i18n.md 228 | - Translate: translate.md 229 | - Queue: queue.md 230 | - Security: 231 | - Cryptography: encryption-crypt.md 232 | - Security: encryption-security.md 233 | - JWT: encryption-security-jwt.md 234 | - Storage: storage.md 235 | - Utility: 236 | - Collection: support-collection.md 237 | - Domain: domain.md 238 | - Helper: support-helper.md 239 | - Registry: support-registry.md 240 | - Version: support-version.md 241 | - Discussions: https://github.com/orgs/phalcon/discussions 242 | - Discussions(v6): https://github.com/phalcon/phalcon/discussions 243 | - Blog: https://blog.phalcon.io/ -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | mkdocs 2 | mkdocs-material 3 | mkdocs-material-extensions 4 | mkdocs-minify-plugin 5 | mkdocs-redirects 6 | mike 7 | --------------------------------------------------------------------------------