[03-Dec-2019 16:08:08] WARNING: [pool www] child 15777 said into stderr: "NOTICE: PHP message: PHP Fatal error: Uncaught RuntimeException: "
[03-Dec-2019 16:08:08] WARNING: [pool www] child 15777 said into stderr: "In ContainerBuilder.php line 1023:"
[03-Dec-2019 16:08:08] WARNING: [pool www] child 15777 said into stderr: " "
[03-Dec-2019 16:08:08] WARNING: [pool www] child 15777 said into stderr: " You have requested a non-existent service "mail". "
[03-Dec-2019 16...
There is a data
column in oro_message_queue_job
which can be used to log the output of cron job.
vendor\oro\platform\src\Oro\Component\MessageQueue\Job\JobRunner.php
In private function callbackResult($runCallback, $job)
, it does the callback to execute the cron:
$jobRunner = $this->getJobRunnerForChildJob($job->getRootJob());
try {
$result = call_user_func($runCallback, $jobRunner, $job);
So it passed 2 parameters to the anonymous function. The $job
param is the entity for the table `oro_messag...
There is no config to register a cron job in OroPlatform. There are 2 steps to add a cron job:
oro_cron_schedule
The added class can be run as a command in CLI when it is defined as a Service.
src\Stars\Bundle\LoggerEventBundle\Command\InsertActionDataCommand.php
<?php
namespace Stars\Bundle\LoggerEventBundle\Command;
use Oro\Bundle\CronBundle\Command\CronCommandInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\...
A service is a discrete unit of functionality:
Put simply, a service is any PHP object that performs some sort of global task.
You don't have to do anything special to make a service: simply write a PHP class with some code that accomplishes a specific task.
In Symfony...
There are 3 ways to create a DBAL connection to access another database:
/** @var \Doctrine\Bundle\DoctrineBundle\ConnectionFactory $connectionFactory */
$connectionFactory = $this->getContainer()->get('doctrine.dbal.connection_factory');
$connection = $connectionFactory->createConnection([
'pdo' => new \PDO(
"mysql:host=$hostname;dbname=$dbname",
$username,
$password)
]);
$connection->executeQuery('SELECT * FROM your_table');
/**
...
I wanted to increase the length of name for MySQL table from 30 to 64 as I encountered this error:
[kiat@reporting misoro]$ sudo -u nginx php bin/console oro:migration:load --force
Process migrations...
Oro\Bundle\EntityExtendBundle\Migration\LoadEntityConfigStateMigration
Stars\Bundle\LoggerEventBundle\Migraions\Schema\v1_0\StarsLoggerEventBundle
ERROR: Max table name length is 30. Please correct "sc_stars_logger_event_action_data" table
in "Stars\Bundle\LoggerEventBundle\Migraions\Schema\v1_0\StarsLoggerEventBundle" migration
`...
Every PHP object that you want to save in the database using Doctrine is called an "Entity". Each entity must have a unique identifier.
The entity class resides in the Entity directory in the bundle's root. In VS Code, install PHP Setters & Getters
to generate the setter and getter code.
src\Stars\Bundle\LoggerEventBundle\Entity\ActionData.php
:
<?php
namespace Stars\Bundle\LoggerEventB...
After we have our bundle, we can add a controller with just 2 files.
Add file src\DbugBundle\Controller\DbugController.php
<?php
namespace DbugBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Response;
/**
* @Route("/dbug")
*/
class DbugController
{
/**
* @Route("/phpinfo", name="dbug_phpinfo")
*/
public function phpinfoAction(): Response
{
ob_start();
phpinfo();
$html = ob_get...
Note I'm on Centos with Nginx web server. Open the crontab file in vi editor on behalf of the nginx user:
[kiat@reporting misoro]$ sudo -u nginx crontab -e
no crontab for nginx - using an empty one
crontab: installing new crontab
That will launch the vi editor.
Press Insert key.
Paste:
*/1 * * * * php /usr/share/nginx/html/misoro/bin/console oro:cron --env=prod > /dev/null
Notes:
Reference the official install guide.
We are using Symfony Framework v. 3.4 LTS in Oro Applications v.3.x.
[kiat@reporting /]$ sudo netstat -tulpn | grep :80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 55851/httpd
Port 80 is used by Apache (as user httpd).
[kiat@reporting /]$ sudo...
In the Creating a Simple CRUD cookbook, it uses REST API to delete entities. However, the description isn't enough to properly implement the delete operation.
However, there are examples on how to do it in the \vendor\oro\platform
codebase. Reference vendor\oro\platform\src\Oro\Bundle\OrganizationBundle\
on coding for REST API. The files of inter...
Here's my attempt to follow the official OroPlatform guide on creating a simple CRUD.
Starting from a fresh instance of Oro Platform ver 3.1.3, follow the manual steps in Create A Bundle.
Create the file src\InventoryBundle\Entity\Vehicle.php
<?php
namespace InventoryBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="vehicle")
*/...
Actually, there are more than 2 ways to download the source codes. But the common ways are
-application
kiat@win10 MINGW64 /d/Work/wamp64/www/oro/crm-application (master)
$ composer inst...
Errors encountered while following the developer guide to create a simple CRUD.
Attempted to load class "InventoryBundle" from namespace "InventoryBundle".
Did you forget a "use" statement for another namespace?
Add the bundle definition file: src\InventoryBundle\InventoryBundle.php
<?php
namespace InventoryBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class InventoryBundle extends Bundle
{
}
Steps to create a menu item:
navigation:
menu_config:
items:
scicom_tab:
label: Scicom
uri: '#'
extras:
position: 300
scicom_tab_link:
label: Scicom Hello
route: scicom_link
tree:
application_menu:
children:
scicom_tab:
children...
Official OroPlatform guide on installation and setup.
All OroPlatform-based applications have unique features that facilitate smooth development routine, like autoregistration of bundles and configuration files, for example.
However, these features assume that all application code is organized in bundles. For this reason, you have to create your own bundle for your custom code in order to perform...