-
Posts
303 -
Joined
-
Last visited
About valan
- Birthday 12/13/1973
Profile Information
-
Gender
Male
-
Location
Russia, Moscow
Recent Profile Visitors
7,897 profile views
valan's Achievements
-
After 10 years of PW development it looks like a break-through!? @MarkE thank you! I'll consider using PW again in my next prj.
-
@MarkE thank you for the module. One of the reasons why I decided to switch to another framework few years ago was lack of such migration tool. You give a good reason to consider PW in my development again)
-
From the PW side the install option is missing) I've created one for my own purposes and happy to share with the community: https://bitbucket.org/valieand/pw Someone who has more time and competence can fork and polish it in order to add to official install options.
-
Thank you to all replied. Unfortunately all suggested options require either extra tools (like ddev) and/or time to read, follow X instructions one-by-one, etc. I still think that PW should has official install option that 1) enables ready-to-serve PW in one-line command, e.g. smth like "git clone ... & docker-compose -up d" 2) has Nginx, PHP-FPM and MySql under the hood. From marketing perspective it should be the best option to engage newcomers with no extra time to dive deeper in the very beginning. @ryan what do you think?)
-
I'm looking for PW install option in docker. This option is missing at PW site "install" section. Could community recommend a non-official repo with docker-compose that builds container with latest versions of PW, nginx, php, mysql?
-
How to setup Composer and use external libraries in ProcessWire
valan replied to MoritzLost's topic in Tutorials
How to use both vendor libs and PW api in command line scripts? Assuming script is located here: prj/console/myscript.php -
Also, how to "require" non-PW vendor classes in PW module?
-
valan started following Merge selectors , non-PW vendor classes and PW , Some PHP framework + Processwire as CMS and 1 other
-
How to load and use non-PW vendor classes installed with help of composer? Would it be enough to add "use namespace\class;" in the beginning of file? Also, is there any difference for doing that in PW module and template file?
-
Hi! Thank you for responses. It's clear how to access PW from external PHP script. What's not clear yet is what would be a right setup in my case. As far as I understand, first, PW should be included in vendor directory via "composer require processwire/processwire"; second, it should be installed (e.g. direct some subdomain like pw.mydomain.com to index.php). Correct?
-
I'd like to use ProcessWire CMS capabilities in existing project which runs on popular PHP framework (Yii2). Specifically, I'd like to handle requests in Yii and call PW if necessary, plus create/modify pages in ProcessWire admin. Is it possible? If yes - how to setup such combination?
-
@BitPoet thank you for link. Haven't heard about this setting, as well as about FileCompiler=? Checked. Doesn't help. As far as I understand, because PHP compiler already declared class earlier. Looks like in my case Order_Status.class.php should not be required_once as soon as it has been compiled somewhere before + class is in use already. Or (I guess) Order_Status.class.php should never be compiled. But this scenario looks ugly to me as there are a lot of files that I need to prevent from compilation...).
-
I'm trying to upgrade PW from 2.8 to 3.0 and get: Compile Error: Cannot declare class Order\Order_Status, because the name is already in use (line 6 of /path-to-file/Order_Status.class.php) File Order_Status.class.php: <?php namespace Order; require_once('SomeClass.php'); class Order_Status { // ... } ?> File where compiler breaks Master_Order.class.php: <?php namespace MM\User\Master; require_once('/path-to-file/Order_Status.class.php'); use Order\Order_Status; class Master_Order { // ... } I've checked FileCompiler cache and discovered that: Order_Status.class.php is compiled as expected (e.g. there is 'SomeClass.php' wrapped by file compiler) Master_Order.class.php is uncompiled as required_once('/path-to-file/Order_Status.class.php') is not wrapped Most probably conflict appears as a result of Order_Status.class.php compilation and its usage at early stage (this class is used both in modules and in template files). So my question is - how to fix compiler error in this case?
-
@arjen thanks! Checked with different selector types = exactly what I need! Just minor fix - adding $selector2 needs to be done through new Selectors($selector2).
-
@AndZyk thanks. Yes, there are associative and regular arrays used for selectors. It is exactly a reason of the question - how to merge them and get one: $selector1 = 'template=basic-page|product'; $selector2 = [ 'title|body%=' => $sanitizer->text($input->get('q')), ]; $selector3 = [ ['categories', '=', $input->get('categories'), 'int'], ['sort', '-created'] ] $selector = mergeSelectors($selector1, $selector2, $selector3); // <- I need this kind of method $results = $pages->find($selector);
-
How to merge selectors of different types (string, array, array of arrays, Selectors) and get $selector with some of these types (to pass it to $pages->find($selector))?