This document provides an overview of the Phalcon PHP framework. It discusses how Phalcon works as a C extension for high performance, how it compares to other PHP frameworks in terms of performance, and how to install, configure and create projects with Phalcon. Key aspects covered include Phalcon being written in C for optimized performance, its loose coupling allowing use of individual components, and its integrated ORM for database interactions.
Php phalcon - Another approach to develop website - Techcamp Saigon 2014Minh Quang Trần
Building website with Phalcon Framework, that is fastest framework. I write my PhalconExt Module help to develop website easier. This is my talk in TechCamp Saigon 2014 (23/3) at RMIT University Vietnam
An Introduction to Websphere sMash for PHP Programmersjphl
IBM® WebSphere® sMash is an agile Web application platform for developing and running modern Web applications. It introduces a simple environment for creating, assembling and running applications based on popular Web technologies.
This presentation was delivered at the Dutch PHP Conference 2009. It shows how the PHP support in sMash can be used to easily integrate with Java assets.
For more information, see http://projectzero.org
Php Dependency Management with Composer ZendCon 2016Clark Everetts
A deep-dive for beginners into Composer, the dependency manager for PHP. Learn how Composer helps you obtain the components your applications depend upon, installs them into your project, and controls their update to newer versions.
Php phalcon - Another approach to develop website - Techcamp Saigon 2014Minh Quang Trần
Building website with Phalcon Framework, that is fastest framework. I write my PhalconExt Module help to develop website easier. This is my talk in TechCamp Saigon 2014 (23/3) at RMIT University Vietnam
An Introduction to Websphere sMash for PHP Programmersjphl
IBM® WebSphere® sMash is an agile Web application platform for developing and running modern Web applications. It introduces a simple environment for creating, assembling and running applications based on popular Web technologies.
This presentation was delivered at the Dutch PHP Conference 2009. It shows how the PHP support in sMash can be used to easily integrate with Java assets.
For more information, see http://projectzero.org
Php Dependency Management with Composer ZendCon 2016Clark Everetts
A deep-dive for beginners into Composer, the dependency manager for PHP. Learn how Composer helps you obtain the components your applications depend upon, installs them into your project, and controls their update to newer versions.
Laravel is a great framework to use for web applications but what if you need to do more? What if you need to process data that would take longer than an HTTP request would allow?
Come learn how to harness the power of the console in your Laravel applications to do various tasks such as caching data from 3rd party APIs, expire old content from S3 or other data store, and batch process huge data sets without users having to wait for results. You can even automate tasks such as backing up your remote databases before you run migrations with artisan commands.
We'll cover creating basic artisan console commands, adding options and passing input, setting up cron jobs and scheduling our console commands to run at specific times, and how you can utilize 3rd party APIs to create fun automated message processing for social media networks.
All the Laravel things: up and running to making $$Joe Ferguson
Laravel 5 has established itself as one of the best PHP rapid application development frameworks. Come learn about all the tools in the Laravel ecosystem designed to save you time and prevent you from writing the boring cruft you have to write for every application. We'll cover getting started with local development, building a basic application, and deploying to production. We'll review how Laravel easily handles vagrant, testing, oauth login services, billing and subscriptions services through Laravel Spark, and deploying your application with services such as Laravel Envoyer and Forge to manage your servers.
The Joomlatools Platform is a modern Joomla distribution that helps you get started with the best development tools and project structure.
Much of the philosophy behind the platform is inspired by the Twelve-Factor App methodology.
We have achieved gesture recognition for implementing functionality like Turning On-Off, Increasing and decreasing the temperature for Air-conditioner and Turning On-Off for Television. In This blog talks about the complete step by step guide to setup OpenCV and JavaCV on Raspberry Pi.
Laravel is a great framework to use for web applications but what if you need to do more? Come learn how to harness the power of the console in your Laravel applications to do various tasks such as caching data from 3rd party APIs, Expire old content from S3 or other data store, and batch process huge data sets without users having to wait for results. You can even automate tasks such as backing up your remote databases before you run migrations with artisan commands.
php[world] 2015 Laravel 5.1: From Homestead to the CloudJoe Ferguson
With the recent release of Laravel Forge, Envoyer, and Homestead, it has never been easier to go from nothing to something with an easy-to-use PHP framework. This talk will cover creating a basic Laravel application using the Laravel-specific Vagrant box Homestead, connecting to a server (Linode, Rackspace, Digital Ocean), and deploying the application via Forge. The talk will also cover tips and tricks on customizing Homestead to fit your custom needs, as well as how to use Forge & Envoyer to deploy new versions of our application.
So You Just Inherited a $Legacy Application… NomadPHP July 2016Joe Ferguson
You were just handed the keys to a new repo. Your first glance over the code base causes the fearful “LEGACY” word to ring in your head. HAVE NO FEAR! I’ll share the techniques I’ve learned after working on several legacy codebases to help update that old code to the current PHP generation. We’ll cover triaging the old code base, writing tests to make sure you don’t break anything, and how to modernize your old code base!
A soup to nuts presentation on using Composer and repository servers to manage and leverage shared code libraries for personal projects to the largest enterprise.
Laravel is a great framework to use for web applications but what if you need to do more? What if you need to process data that would take longer than an HTTP request would allow?
Come learn how to harness the power of the console in your Laravel applications to do various tasks such as caching data from 3rd party APIs, expire old content from S3 or other data store, and batch process huge data sets without users having to wait for results. You can even automate tasks such as backing up your remote databases before you run migrations with artisan commands.
We'll cover creating basic artisan console commands, adding options and passing input, setting up cron jobs and scheduling our console commands to run at specific times, and how you can utilize 3rd party APIs to create fun automated message processing for social media networks.
All the Laravel things: up and running to making $$Joe Ferguson
Laravel 5 has established itself as one of the best PHP rapid application development frameworks. Come learn about all the tools in the Laravel ecosystem designed to save you time and prevent you from writing the boring cruft you have to write for every application. We'll cover getting started with local development, building a basic application, and deploying to production. We'll review how Laravel easily handles vagrant, testing, oauth login services, billing and subscriptions services through Laravel Spark, and deploying your application with services such as Laravel Envoyer and Forge to manage your servers.
The Joomlatools Platform is a modern Joomla distribution that helps you get started with the best development tools and project structure.
Much of the philosophy behind the platform is inspired by the Twelve-Factor App methodology.
We have achieved gesture recognition for implementing functionality like Turning On-Off, Increasing and decreasing the temperature for Air-conditioner and Turning On-Off for Television. In This blog talks about the complete step by step guide to setup OpenCV and JavaCV on Raspberry Pi.
Laravel is a great framework to use for web applications but what if you need to do more? Come learn how to harness the power of the console in your Laravel applications to do various tasks such as caching data from 3rd party APIs, Expire old content from S3 or other data store, and batch process huge data sets without users having to wait for results. You can even automate tasks such as backing up your remote databases before you run migrations with artisan commands.
php[world] 2015 Laravel 5.1: From Homestead to the CloudJoe Ferguson
With the recent release of Laravel Forge, Envoyer, and Homestead, it has never been easier to go from nothing to something with an easy-to-use PHP framework. This talk will cover creating a basic Laravel application using the Laravel-specific Vagrant box Homestead, connecting to a server (Linode, Rackspace, Digital Ocean), and deploying the application via Forge. The talk will also cover tips and tricks on customizing Homestead to fit your custom needs, as well as how to use Forge & Envoyer to deploy new versions of our application.
So You Just Inherited a $Legacy Application… NomadPHP July 2016Joe Ferguson
You were just handed the keys to a new repo. Your first glance over the code base causes the fearful “LEGACY” word to ring in your head. HAVE NO FEAR! I’ll share the techniques I’ve learned after working on several legacy codebases to help update that old code to the current PHP generation. We’ll cover triaging the old code base, writing tests to make sure you don’t break anything, and how to modernize your old code base!
A soup to nuts presentation on using Composer and repository servers to manage and leverage shared code libraries for personal projects to the largest enterprise.
Step-by-Step Introduction to Apache Flink Slim Baltagi
This a talk that I gave at the 2nd Apache Flink meetup in Washington DC Area hosted and sponsored by Capital One on November 19, 2015. You will quickly learn in step-by-step way:
How to setup and configure your Apache Flink environment?
How to use Apache Flink tools?
3. How to run the examples in the Apache Flink bundle?
4. How to set up your IDE (IntelliJ IDEA or Eclipse) for Apache Flink?
5. How to write your Apache Flink program in an IDE?
PHP Conference 2020 - A eterna luta: compatibilidade retroativa vs. dívida té...Jackson F. de A. Mafra
Vamos abordar primeiro a logística de manutenção de um projeto com alto débito técnico como o WordPress.
Em seguida, examinará o que isso significa para projetos que dependem do WordPress.
Finalmente, ele irá percorrer algumas maneiras potenciais de mudar para um processo mais equilibrado, com uma análise mais detalhada de como o
WordPress finalmente conseguiu escapar de seu requisito do PHP 5.2.
O GitLab é um gerenciador de repositórios baseado em Git. Suas ferramentas incluem um wiki, um gerenciador de tarefas e um pipeline de CI/CD, etc. O GitLab é similar ao GitHub, porém, por ser open source, pode ser armazenado em infraestrutura própria, além da versão em nuvem do mesmo, podendo ter repositórios públicos e privados.
GitLab Runner, o GitLab permite que você use o Runner, que é um projeto open source que é usado para executar os jobs e enviar os resultados de volta para o GitLab. Ou seja, ele nos permite buildar sem a necessidade de nenhuma instalação externa.
Veremos uma introdução de como tudo isso funciona.
Discutiremos a possibilidade de usar o WordPress como um servidor para alimentar conteúdo para aplicativos móveis e armazenar as informações geradas pelos usuários destes.
Para isso, ferramentas disponíveis no ecossistema serão analisadas, ambas oferecidas pelo CMS (API REST, autenticação, banco de dados ...) e geradas pela comunidade ou por nós mesmos (plugins).
Serão estudados quais pontos essenciais dos quais um MBaaS (Mobile Backend como Serviço) deve cobrir WordPress e serão ponderados as ocasiões em que usá-lo com relação a outras soluções do mercado mais comum.
O titulo é click bait mas a talk não. Todo mundo que se encanta pelo WordPress, e quer começar a desenvolver, principalmente se vem de outras linguagens, fica na dúvida; posso usar namespaces? Autoload? Usar WordPress Coding Standards ou PSRs?
Quando usar um Plugin e quando fazer meu código? O que é do tema e o que é do Plugin?
Precisamos de um barco maior introdução ao dimensionamento de aplicaçõesJackson F. de A. Mafra
Em um momento ou outro, todo desenvolvedor se depara com o mesmo problema - seu aplicativo começa a ficar mais lento, começa a cair e não está disponível.
Muitas vezes, isso se resume a muitos usuários, muitos dados armazenados - em outras palavras, um problema de escala.
Analisando uma gama de opções, desde escalonamento horizontal e vertical até cache, fragmentação e otimização, veremos abordagens de escalonamento que podem ser usadas em novas aplicações e também algumas que podem ser adaptadas retroativamente a aplicações existentes.
Hangout Tempo Real Eventos - ChatOps (ChatBots e DevOps) - Como bots podem ...Jackson F. de A. Mafra
Se formos resumir, podemos dizer que é “conversation-driven development”. Usando um bot com plugins e scripts, os times podem automatizar tarefas e colaborar, jogando fora os procedimentos repetitivos e economizando tempo.
Hangout Tempo Real Eventos - Android - Os primeiros passos do desenvolviment...Jackson F. de A. Mafra
Vamos conhecer como iniciar o caminho a ser percorrido para que você adentre o mundo da plataforma que está disponível em centenas de milhões de dispositivos móveis em mais de 190 países, e, num breve futuro, alcance o grau de profissionalismo para aproveitar grandes oportunidades de mercado.
O JavaScript, durante muito tempo, não foi uma linguagem respeitada. Era considerada uma linguagem de amadores e, por de fato ser utilizada por muitos programadores inexperientes, gerava códigos mal-escritos. O JS mudou e moldou a web, deu muito mais poder aos desenvolvedores, e se estabeleceu permanentemente como a linguagem de scripts para a web.Hoje, o JavaScript se reinventou mais uma vez, e mais uma vez, está entregando nas mãos dos desenvolvedores o poder de mudar o desenvolvimento. Vamos conhecer como iniciar o caminho a ser percorrido para que você adentre o mundo da plataforma que está disponível em centenas de milhões de aplicações, e, num breve futuro, alcance o grau de profissionalismo para aproveitar grandes oportunidades de mercado
O JavaScript se reinventou mais uma vez, e mais uma vez, está entregando nas mãos dos desenvolvedores o poder de mudar o desenvolvimento. Uma das tecnologias favoritas no mundo Open Source é o Node.js, já usada em vários projetos.
Vamos conhecer como iniciar o caminho a ser percorrido para que você adentre o mundo da plataforma que está disponível em centenas de milhões de aplicações, e, num breve futuro, alcance o grau de profissionalismo para aproveitar grandes oportunidades de mercado.
Chatops é a habilidade de interagir com a minha infraestrutura através de uma interface de texto. Mantendo um contexto linear com meus colegas de trabalho.
_ Chatops não é só executar comandos via chat, é sobre colaboração._
Quando a gente tem o primeiro contato com a expressão “chatbots”, pode ser levado a imaginar que sejam robôs que ficam conversando. Ou robôs chatos, quem sabe. Para os que vão um pouco mais fundo, pode vir a ideia de que se trata de uma plataforma de atendimento online protagonizada por um robô. Chatbots são sistemas de inteligência artificial utilizados para interagir com humanos em um número de tarefas e de possibilidades que, no momento, temos apenas uma vaga ideia de sua potencial variedade futura. Esses sistemas respondem a demandas, prestam orientações, esclarecem dúvidas, transmitem informações e conhecimento, fazem tarefas operacionais e transacionais, controlam processos e agilizam interações. Eles poderão também, por exemplo, substituir muitos dos aplicativos hoje existentes, já que são especialistas em soluções digitais específicas e online. Se você comprar online falando com eles, isso quer dizer que eles poderão também ser uma solução para todas as transações de e-commerce? Sim. Porque veja bem, eles podem procurar o produto que você deseja, encontrar e mostrar para você, que vai dizer se gosta ou não e, se gostar, você poderá dar um ok para que ele conclua a compra, acione seu cartão de crédito e, pronto, transação efetuada
http://conexaokinghost.com.br/
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
3. A thanks to
For encourage and believe in the
passage of knowledge.
(And to release me from work to be here.) ”
4. Why?
• Use of frameworks has become mandatory in
professional development with PHP
• They offer a philosophy and organized structures to
easily maintain projects writing less code and making
work more fun
5. How PHP works?
1. PHP have dynamic and weak typing discipline
2. PHP is interpreted (not compiled)
3. Every time a script is loaded, should be interpreted
by PHP
4. If a bytecode cache (like APC) isn’t used, syntax
checking is performed every time
6. How traditional php frameworks works?
1. Many files with classes and functions are read at every request made.
Disk reading is expensive in terms of performance
2. Modern frameworks use lazy loading technique (autoload) for load and
execute only code needed
3. Continuous loading/interpreting could be expensive and impact your
application performance
4. When you use a framework most of the code remain the same across
development. Why load and interpret it every time?
7. How a PHP C extension works?
1. C extensions are loaded together with PHP one time, on the web server
dispatch process
2. Classes and functions provided by the extension are ready to use for
any application
3. The code isn’t interpreted because it is compiled to a specific platform
and processor
8. What is Phalcon?
Phalcon is an open source, full stack framework for PHP 5
written as a C-extension, optimized for high performance.
You don’t need to learn or use the C language, since the
functionality is exposed as PHP classes ready for you to
use. Phalcon also is loosely coupled, allowing you to use
its objects as glue components based on the needs of your
application.
9. How Phalcon works?
1. Components are loosely coupled. You may use the components you
want without depending on a full stack
2. Low-level optimizations provide the lowest overhead for MVC-based
applications
3. Interact with databases with maximum performance by using a C-language
ORM for PHP
4. Phalcon is directly engaged with PHP, so it can directly access internal
structures optimizing execution as well
11. Compare how Phalcon is faster than other
frameworks
Traditional Frameworks Phalcon
Interpretation of hundreds
or thousands of PHP lines
on each request
YES NO
Load dozens of files in
each request
YES NO
Checking the existence of
functions, methods,
classes, constants at each
request
YES NO
Low-level optimizations
gaining microseconds for
each request
NO YES
21. Installation
To use phalcon on Windows you can download a DLL library. Edit your
php.ini file and then append at the end:
extension=php_phalcon.dll
Restart your webserver.
22. Requirements
Prerequisite packages are:
PHP >= 5.3 development resources
GCC compiler (Linux/Solaris)
Git (if not already installed in your system - unless you download the
package from GitHub and upload it on your server via FTP/SFTP)
23. Requirements
Prerequisite packages are:
PHP >= 5.3 development resources
GCC compiler (Linux/Solaris)
Git (if not already installed in your system - unless you download the
package from GitHub and upload it on your server via FTP/SFTP)
24. Requirements
Specific packages for common platforms:
#Ubuntu
sudo apt-get install php5-dev libpcre3-dev gcc make php5-mysql
#Suse
sudo yast -i gcc make autoconf2.13 php5-devel php5-pear php5-mysql
#CentOS/RedHat/Fedora
sudo yum install php-devel pcre-devel gcc make
#Solaris
pkg install gcc-45 php-53 apache-php53
25. Compilation
git clone --depth=1 git://github.com/phalcon/cphalcon.git
cd cphalcon/build
sudo ./install
26. Configure
Add extension to your php configuration:
#Suse: Add this line in your php.ini
extension=phalcon.so
#Centos/RedHat/Fedora: Add a file called phalcon.ini in /etc/php.d/ with this content:
extension=phalcon.so
#Ubuntu/Debian: Add a file called 30-phalcon.ini in /etc/php.d/ with this content:
extension=phalcon.so
#Debian with php5-fpm: Add a file called 30-phalcon.ini in /etc/php5/fpm/conf.d/30-phalcon.ini with this content:
extension=phalcon.so
Restart the webserver.
27. Configure
Phalcon automatically detects your architecture, however, you can force the compilation for a specific architecture:
cd cphalon/build
sudo ./install 32bits
sudo ./install 64bits
sudo ./install safe
28. Mac OS X
On a Mac OS X system you can compile and install the extension from the source code:
Requirements
Prerequisite packages are:
PHP >= 5.3 development resources
XCode
#brew
brew tap homebrew/homebrew-php
brew install php53-phalcon
brew install php54-phalcon
brew install php55-phalcon
brew install php56-phalcon
#MacPorts
sudo port install php53-phalcon
sudo port install php54-phalcon
sudo port install php55-phalcon
sudo port install php56-phalcon
29. Installation on XAMPP
XAMPP is an easy to install Apache distribution containing MySQL, PHP
and Perl. Once you download XAMPP, all you have to do is extract it and
start using it. Below are detailed instructions on how to install Phalcon on
XAMPP for Windows. Using the latest XAMPP version is highly
recommended.
30. Installation on XAMPP
XAMPP is always releasing 32 bit versions of Apache and PHP. You will
need to download the x86 version of Phalcon for Windows from the
download section.
After downloading the Phalcon library you will have a zip file like the one
shown below:
32. Installation on XAMPP
Copy the file php_phalcon.dll to the PHP extensions. If you have installed
XAMPP in the c:xampp folder, the extension needs to be in
c:xamppphpext
33. Installation on XAMPP
Edit the php.ini file, it is located at C:xamppphpphp.ini. It can be edited with
Notepad or a similar program. We recommend Notepad++ to avoid issues with line
endings. Append at the end of the file: extension=php_phalcon.dll and save it.
34. Installation on XAMPP
Restart the Apache Web Server from the XAMPP Control Center. This will load the
new PHP configuration.
35. Installation on XAMPP
Open your browser to navigate to
http://localhost. The XAMPP welcome
page will appear. Click on the link
phpinfo().
phpinfo() will output a significant
amount of information on screen about
the current state of PHP. Scroll down
to check if the phalcon extension has
been loaded correctly.
If you can see the phalcon version in
the phpinfo() output, congrats!, You
are now flying with Phalcon.
36. Creating a project
File structure
Phalcon does not impose a particular file structure for application
development. Due to the fact that it is loosely coupled, you can
implement Phalcon powered applications with a file structure you are
most comfortable using.
37. Creating a project
For the purposes of this tutorial and as a starting point, we suggest the
following structure:
tutorial/
app/
controllers/
models/
views/
public/
css/
img/
js/
39. Bootstrap
<?php
try {
//Register an autoloader
$loader = new PhalconLoader();
$loader->registerDirs(array(
'../app/controllers/',
'../app/models/'
))->register();
//Create a DI
$di = new PhalconDIFactoryDefault();
//Setup the view component
$di->set('view', function(){
$view = new PhalconMvcView();
$view->setViewsDir('../app/views/');
return $view;
});
//Setup a base URI so that all generated URIs
include the "tutorial" folder
$di->set('url', function(){
$url = new PhalconMvcUrl();
$url->setBaseUri('/tutorial/');
return $url;
});
//Handle the request
$application = new
PhalconMvcApplication($di);
echo $application->handle()->getContent();
} catch(PhalconException $e) {
echo "PhalconException: ", $e->getMessage();
}
40. Creating a Controller
By default Phalcon will look for a controller named “Index”. It is the starting point when no controller or action has been passed in
the request. The index controller (app/controllers/IndexController.php) looks like:
<?php
class IndexController extends PhalconMvcController
{
public function indexAction()
{
echo "<h1>Hello!</h1>";
}
}
41. Creating a Controller
Sending output to a view
Sending output to the screen from the controller is at times necessary but not desirable as most purists in the MVC community will
attest. Everything must be passed to the view that is responsible for outputting data on screen. Phalcon will look for a view with the
same name as the last executed action inside a directory named as the last executed controller. In our case
(app/views/index/index.phtml):
<?php echo "<h1>Hello!</h1>";
Our controller (app/controllers/IndexController.php) now has an empty action definition:
<?php
class IndexController extends PhalconMvcController
{
public function indexAction()
{
}
}
42. Creating a Model
Phalcon brings the first ORM for PHP entirely written in C-language. Instead of increasing the complexity of development, it
simplifies it.
Before creating our first model, we need to create a database table outside of Phalcon to map it to. A simple table to store
registered users can be defined like this:
CREATE TABLE `users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(70) NOT NULL,
`email` varchar(70) NOT NULL,
PRIMARY KEY (`id`)
);
43. Creating a Model
A model should be located in the app/models directory (app/models/Users.php). The model maps to the “users” table:
<?php
class Users extends PhalconMvcModel
{
}
44. Setting a Database Connection
In order to be able to use a database connection and subsequently access data through our models, we need to specify it in our
bootstrap process. A database connection is just another service that our application has that can be used for several
components:
45. Setting a Database Connection
<?php
try {
//Register an autoloader
$loader = new PhalconLoader();
$loader->registerDirs(array(
'../app/controllers/',
'../app/models/'
))->register();
//Create a DI
$di = new PhalconDIFactoryDefault();
/
/Setup the database service
$di->set('db', function(){
return new
PhalconDbAdapterPdoMysql(array(
"host" => "localhost",
"username" => "root",
"password" => "secret",
"dbname" => "test_db"
));
});
//Setup the view component
$di->set('view', function(){
$view = new PhalconMvcView();
$view->setViewsDir('../app/views/');
return $view;
});
//Setup a base URI so that all generated URIs
include the "tutorial" folder
$di->set('url', function(){
$url = new PhalconMvcUrl();
$url->setBaseUri('/tutorial/');
return $url;
});
//Handle the request
$application = new
PhalconMvcApplication($di);
echo $application->handle()->getContent();
} catch(Exception $e) {
echo "PhalconException: ", $e->getMessage();
}
46. Volt: Template Engine
Volt is an ultra-fast and designer friendly templating language written in C for
PHP. It provides you a set of helpers to write views in an easy way. Volt is
highly integrated with other components of Phalcon, just as you can use it as a
stand-alone component in your applications.
48. Volt: Template Engine
Volt views are compiled to pure PHP code, so basically they save the effort of writing PHP code
manually:
{# app/views/products/show.volt #}{% block last_products %}{% for product in products %}
* Name: {{ product.name|e }}
{% if product.status == "Active" %}
Price: {{ product.price + product.taxes/100 }}
{% endif %}{% endfor %}{% endblock %}