Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaapiii committed Nov 6, 2019
2 parents 634437e + c05a55e commit c877942
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 26 deletions.
27 changes: 6 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,26 @@
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/86a71f44-22ed-46e6-9fc7-d7d3ca79815e/mini.png)](https://insight.sensiolabs.com/projects/86a71f44-22ed-46e6-9fc7-d7d3ca79815e)

Concrete5 package for v8 - Adds beberlei/DoctrineExtensions to concrete5 (work in progress)
Concrete5 package for v8 - Adds beberlei/DoctrineExtensions to concrete5
======

Installation
------------------

### Install the package manually

1. Download the zip and copy the folder **concrete5_doctrine_dql_extensions-xxx** to {root}/packages
2. Rename the folder to **concrete5_doctrine_dql_extensions**
2. Use [Composer](https://getcomposer.org/) to install the third party dependencies

composer install

4. Install the package in concrete5
5. Navigate to **System & Settings -> Doctrine DQL Extensions** to see the available DQL functions. You can now use the most common MySQL functions in your DQL queries and in the QueryBuilder.

#### Attention:
If you decide to install the package manually, you should install all packages which depend on its functionality, after you first installed this package. The reason is, that concrete5 loads the active packages in the same order they were installed.

### Install the package with the projects composer.json file

1. Add the following line to the 'require' section of the concrete5 composer.json file
1. Run the following command from the installation {root} folder to get the latest version


"kaapiii/concrete5_doctrine_dql_extensions": "^1.1"
composer require kaapiii/concrete5_doctrine_dql_extensions


2. Run the following command from the installation {root} folder
2. Add the following line to the 'require' section of the concrete5 composer.json file


'composer install'
"kaapiii/concrete5_doctrine_dql_extensions": "^1.1"

3. Install the package
4. Navigate to **System & Settings -> Doctrine DQL Extensions** to see the available DQL functions. You can now use the most common MySQL functions in your DQL queries and in the QueryBuilder.

#### Note:
With this installation method, the installation order of the packages doesn't matter. All third party dependencies are installed in {root}/concrete/vendor and therefore loaded before the packages are initiated.
![screenshot](https://user-images.githubusercontent.com/995643/68252188-23a49500-0025-11ea-8a64-fb6329970608.png)
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
},
"require": {
"composer/installers": "~1.0",
"beberlei/DoctrineExtensions": "1.1.9"
"beberlei/doctrineextensions": "1.1.9"
}
}
8 changes: 4 additions & 4 deletions controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
namespace Concrete\Package\Concrete5DoctrineDqlExtensions;

use Concrete\Core\Support\Facade\Log;
use Doctrine\Common\EventManager;
use Concrete\Core\Package\Package;
use Concrete\Core\Page\Single as PageSingle;
use Symfony\Component\Yaml\Yaml;
use Symfony\Component\Yaml\Exception\ParseException;

Expand All @@ -13,7 +14,7 @@
* @author Markus Liechti <markus@liechti.io>
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
class Controller extends \Concrete\Core\Package\Package
class Controller extends Package
{
protected $pkgHandle = 'concrete5_doctrine_dql_extensions';
protected $appVersionRequired = '8.0.0';
Expand All @@ -32,7 +33,7 @@ public function getPackageName()
public function install()
{
$pkg = parent::install();
\Concrete\Core\Page\Single::add('/dashboard/system/doctrine_dql_extensions',$pkg);
PageSingle::add('/dashboard/system/doctrine_dql_extensions',$pkg);
}

public function on_start()
Expand All @@ -51,7 +52,6 @@ public function on_start()
}catch(\Doctrine\ORM\ORMException $e){
Log::addAlert('While adding Doctrine DQL extensions to the EntityManager configuration something went wrong: '. $e);
}

}


Expand Down

0 comments on commit c877942

Please sign in to comment.