-
Posts
126 -
Joined
-
Last visited
Posts posted by Hari KT
-
-
Piwik is awesome to track. I have installed piwik 1.0 and did something before for a project.
For the current project I am also trying 2.0, which is far better. I can see various use cases with it.
One of the good thing is you can call the piwik api, get the image or json and plot or change accordingly on our system.
Update : If you don't have a server to manage or install piwik then will be good to go with google analytics. And in 2.0 installation, I didn't have any trouble also.
- 3
-
I recently came accross http://www.rubyrep.org/ .
Seems an interesting one.
Development of an open-source solution for asynchronous, master-master replication of relational databases that is ridiculously easy to use database independent
Currently supports PostgreSQL and MySQL.
- 1
-
Thank you for the fast response. You guys rocks!
-
Thanks @Soma, that was what I ended up and then the first question comes, "I have removed the global title, but it needs the url always entered.".
Seems like I want to set a datetime string format for the url.
Thank you for all the support every one have showed. Marking as solved.
- 1
-
That works for order, but I need the date time for saved on a particular day. Saved yesterday , saved today.
-
Hi Soma, Martjin,
Let me make the question more clear with the examples you mentioned.
We have Categories->Products ( x1, x2, x3, x4, x5, x6 )
Let us assume the user saves products in the order x4, x1 .
Now in the user template we have a field with user_product which is multi page array whose template is product. So when the user save the first one we need to track the time when the product is added.
$user->user_product->add($product1); // May be id or page object // Now we need to know when the product1 is added
That means we need an extra field for the user to know at what time the product is saved, else we will not be able to keep track of the order in which the user has saved.
-
ok. So I will move with adding Page field in user template.
Sorry I missed to write one more problem, I need to sort it based on the priority ?
and also store the date and time of the product when saved.
Thank you cstevensjr, Martijn Geerts
- 2
-
@Martijn Geerts Thank you.
What I was wondering is whether that will give you a pain when upgrading to new ProcessWire, when you are editing root templates.
-
Hi Guys,
I am looking for the best way what you feel when doing this. Basically the idea is to save the history of a user.
Consider we have a bunch of products, and categories. And the user needs a way to save a product and check it for later use. Consider the same as you follow a topic in the PW forum.
I was thinking to add a page which have 2 fields
1 ) user_id which is of type Page which is linked to the user template of PW
2 ) product_id which is also a Page which I have built from another template
I have removed the global title, but it needs the url always entered.
$page = new Page(); $page->template = 'product-history-user'; $page->parent_id = 'parent-id'; $page->name = 'something'; $page->history_user_id = $user->id; $page->user_history_product_id = 'id-of-product'; $page->save();
I also have some more stuffs that needs similar logic. Interested to hear your thoughts to make this better.
Update :
One more problem I missed to write is, I need to sort it based on the priority, that is why I opted the way.
or is there a way we can store the date and time of the product when saved?
Thanks
-
I am also getting an error when I need to do a cronjob say around 16000 pages.
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
I want to check when a db connection failed whether the connection can be automatically connected again.
-
Hi Guys,
I have a $field->type instanceof FieldtypePage .
I want to know the template of the FieldtypePage .
I have tried
$template = $this->pages->get($field->parent_id)->template;
I am getting a different template than the one I really need.
$fieldpage = new Page(); // $fieldpage->template = $name; // Is there something like without assigning template name I can save a page ? // $fieldpage->template_id = $template_id $fieldpage->title = 'title'; $fieldpage->body = 'body'; $fieldpage->parent_id = $field->parent_id; $fieldpage->save();
-
Hi,
I have send a PR to https://github.com/ryancramerdesign/ProcessExportProfile/pull/3 .
If you have a private repo or you find a repo which has no composer.json , you can send a PR. And for the current time you can do like below
{ "minimum-stability": "dev", "repositories": [ { "type": "package", "package": { "name": "ryancramerdesign/process-export-profile", "version": "1.0.0", "source": { "url": "https://github.com/ryancramerdesign/ProcessExportProfile", "type": "git", "reference": "master" }, "type": "pw-module", "require": { "hari/pw-module": "dev-master" } } } ], "require": { "ryancramerdesign/process-export-profile": "1.0.0" } }
and now you need composer.phar . Hope you have downloaded composer else please get from http://getcomposer.org/download/ and run
php composer.phar update
It will install the ProcessExportProfile module in site/modules/ProcessExportProfile . When you created a patch for the module, you can change the settings in composer.json , so you get that patch also until Ryan merged it or can switch between branches. See http://getcomposer.org/doc/05-repositories.md#loading-a-package-from-a-vcs-repository
Thank you.
- 3
-
@pwired I am seeing better use for composer. May be it is different for different people. As a person who have been using composer for quite some time, I like the idea, and how it works! .
-
Hi guys,
so I am a huge fan of composer. PW is missing one of the good parts of composer. So here is a new installer to install the modules of PW via composer.
If you have created a module for PW, what you need to do is add a composer.json file in your github repo and add it to packagist. An example composer.json is
{ "name": "vendor/package-name", "type": "pw-module", "description": "Your module what it does", "keywords": [ "keywords", "comma", "seprated"], "homepage": "https://github.com/harikt/Assets", "license": "BSD-2-Clause", "authors": [ { "name": "Assets Contributors", "homepage": "https://github.com/harikt/Assets/contributors" } ], "require": { "php": ">=5.3.0", "hari/pw-module": "dev-master" } }
Note the minimum requirement is PHP 5.3 for composer is 5.3 .
An example of a module that works with this is https://github.com/harikt/Assets ( Move the index.php to any where ) You are welcome to read the post at http://harikt.com/blog/2013/11/08/assets-for-processwire/
Installing modules
How do you install the PW modules and the 3rd party dependencies ?
Assuming you are in the PW folder.
First download composer from http://getcomposer.org/download/.
Hope you have composer.phar now.
php composer.phar require vendor/package-name
Will install if the vendor/package-name is of type "pw-module" and you have added the "hari/pw-module" in require section.
{ "name": "vendor/package-name", // more stuffs "type": "pw-module", "require": { "php": ">=5.3.0", "hari/pw-module": "dev-master" } }
to `site/modules/PackageName` .
php composer.phar require hari/assets
Try the above and see where it is installed.
Please add a composer.json if you are a module maintainer, for there is more things we can do with composer .
- 4
-
Hi guys,
I am really new to here and I would have missed many posts. I have read there is a thought to look at composer and also switching to PDO .
I am happy to help in the PW development. But I am not sure where we are at present. I would like to add a module so people can still install in site/modules folder.
Though in composer world people don't like that, let me know how you are going to download the modules ?
Is it inside `vendor` or is it inside `site/modules` as the current PW is doing ? I am happy to contribute a module for PW to support composer usage. ( Happy to hear your thoughts for if you already started then I don't need to re-invent anything here )
If composer a small recommendation about the PDO and usage :
I have a bit of background in aura, so you should really have a look at https://github.com/auraphp/Aura.Sql/tree/develop-2 . The ExtendedPdo is lazy loaded https://github.com/auraphp/Aura.Sql/tree/develop-2#lazy-connection .
Also the IN ( usage is also simple https://github.com/auraphp/Aura.Sql/tree/develop-2#array-quoting
-
@mindplay.dk
Thank you for the comments. Is your module available some where, so I can have a look ?
I noticed one gist. Or is there something else ?
-
Hi I was just wondering what you guys think about this
https://github.com/ryancramerdesign/ProcessWire/pull/273
And you can use a tool like dbv or something similar .. Thoughts ?
-
So here is my first module for ProcessWire if someone is interested in this http://modules.processwire.com/modules/assets/
-
So here is my first module for ProcessWire http://modules.processwire.com/modules/assets/
I am interested to hear your critics / thoughts . Feedback welcome.
- 2
-
@pwired sorry.
I was just trying to ping the ideas I have when dealing with composer. It was not trying to move to any framework.
Thank you.
-
Yey, nice time to get involved in ProcessWire. I have been looking at Processwire for a recent project. It is really nice from a user perspective hiding all the complex functionalities. Amazing work guys. I don't say you move to use this or that ( Though I am more inclined towards Aura ).
Composer is really a nice tool, and when we go with composer and you install it is always good to keep the files in vendor folder itself. Some of the things in my mind are
1. Flexibility to move the index.php to outside the main folder. So only index.php is the only file lies there.
else vendor folder will be visible to the public . May be readmes and all .
2. When working on aura v1 , we installed the packages in the package folder itself. But that is a hard way to manage. So we started with http://github.com/auraphp/Aura.Includer/
So it will be nice to have something like adding a certain configuration file in the module of PW which helps to recognise the file is processwires and which needs to be loaded via same ?
Also does the 2.4 development is finished ? There is PSR-4 also coming, which reduces the size of the namespace stuffs.
\ProcessWire\Event\Manager => src/Manager.php ( PSR-4 ) than the previous one /src/ProcessWire/Event/Manager.php
I am looking forward to contribute to PW aslo please choose PSR-2 also. It is all about future and how we all PHP community work ( For I contribute to Aura, Symfony, Zend etc life is easy ) .
Thanks
- 1
-
Thanks @Wanze .
So to make it clear, what I am doing is moving the index.php to a seprate folder.
Say
site wire web index.php
So the problem we are going to face is none of the images, js, css cannot be accessed.
A good example is call for http://processwire.localhost/site/templates/styles/main.css will result in 404 , for the only entry point is index.php . I can create symbolic links, but I thought of making a module . So my goal is to create a module which can check whether the request is for a certain type ( css, image, js ) and return the content according to the type. (I have already created the same.)
About the usage of $_SERVER seems a bad idea to me as I mentioned earlier. If some ( 3rd party module ) replaces the content, hard to deal.
For those who don't know me, I have a bit of background in aura project ( and some other open-source projects ) and you can see the how the $_SERVER is accessed. Once you set, even if someone resets the superglobals the object value never changes.
Let me show you an example from aura v2
<?php use Aura\Web\WebFactory; $web_factory = new WebFactory($GLOBALS); $request = $web_factory->newRequest(); echo " Request uri is " . $request->server->get('REQUEST_URI'); $_SERVER['REQUEST_URI'] = 'oye I am changing'; echo $_SERVER['REQUEST_URI'] . PHP_EOL; echo $request_uri = $request->server->get('REQUEST_URI', '');
If you have tried the above example you will understand what I mean. ( I am not promoting aura here, my goal is to make PW things better and secure. I am also going to search for the thread composer and how it is utilized )
If anyone is interested have a look into the links below
https://github.com/auraphp/Aura.Web/blob/develop-2/README-REQUEST.md#superglobals
https://github.com/auraphp/Aura.Web/blob/develop-2/src/Request.php#L162
https://github.com/auraphp/Aura.Web/blob/develop-2/src/Request/Globals.php#L99
https://github.com/auraphp/Aura.Web/blob/develop-2/src/Request/Values.php#L36
Thank you.
-
Thank you @Michael.
No I wasn't looking how I can iterate through the server variables. According to what I learned using global values inside the class seems not a good way, so was wondering whether the post values, what sort of REQUEST_METHOD is already called is available via some objects which is called in bootstrap.
You can have a test to the code below to see what I mean
var_dump($_SERVER); // see how the o/p differs $_SERVER = array(); var_dump($_SERVER);
That becomes a hell to all if someone set like this in a module.
-
Thank you. I found the correct hook, that solves the first part. Like
public function init() { $this->addHookAfter('ProcessPageView::pageNotFound', $this, 'someMethod'); }
Now looking for the second part . About the $_SERVER usage.
Thank you.
Inline editing
in Wishlist & Roadmap
Posted
Hi Guys,
I don't know whether this topic is already discussed or not. I was wondering whether PW already have thought of having an inline editing tool.
What am I talking can be seen from demo http://demo.createphp.org/
http://createjs.org/
https://github.com/flack/createphp