Search Results

Search found 129 results on 6 pages for 'fayer'.

Page 2/6 | < Previous Page | 1 2 3 4 5 6  | Next Page >

  • Api/plugins for open source libraries?

    - by fayer
    whenever i use a open source library eg. Doctrine i always ending up coding a class (so called Facade) to use the Doctrine library. so next time i want to create a user i just type: $fields = array('name' => 'peter', 'email' => '[email protected]'); Doctrine_Facade::create_entity($entity, $fields); then it creates an entity with the provided information. so i guess, all coders will create their own "Facade". i wonder how usual it is with open source Facades to download and interact with the open source libraries? is this rare cause i haven't seen any of these. in some frameworks i have seen them called plugins, eg. plugins for twitter api or facebook api. so whenever you download a library, should you search for plugins/facades on the net, or is it better to just try coding your own? i just thought it would be great for everyone not to reinvent the wheel. thanks.

    Read the article

  • php vs bash for CLI scripting?

    - by fayer
    i have never used PHP with CLI, but i have seen scripts run with php code. i was wondering, why should we use bash, when php is so popular and is able to run in CLI. what are the pros and cons with each one? should i use php for all CLI scripting in the future?

    Read the article

  • strategy for observer pattern?

    - by fayer
    I want to use observer pattern for a logging system. We have got logObservers and logObservables. The class that will have to log something will implement iLogObservable and include these methods: private $logObservers = array(); public function addLogObserver($logObserver) { $this->logObservers[] = $logObserver; } public function removeLogObserver($logObserver) { $this->logObservers[] = $logObserver; } public function write($type, $message) { foreach($this->logObservers as $logObserver) { $logObserver->log($level, $message); ; } } Then I noticed, that a lot of classes that will use logging will have these methods and I have to copy paste. So isn't it better to have these methods in a class I call LogObservable or just Log and then use strategy (instantiate this class inside all classes that will have to log). When I change the methods in Log, all logObservables will be affected. However, I have not seen anyone use observer pattern with strategy pattern yet, but it seems to be very efficient and remove the duplications. What do you think?

    Read the article

  • UML diagram for application architecture?

    - by fayer
    i'm trying to map my whole application in a UML diagram and i wonder what diagram type i should use. im not doing this in class level, rather from a bird eye's perspective. single application object (patterns: singleton)(examples: CodeIgniter application) that composes multiple module objects (patterns: singleton, facades)(examples: guestbook, addressbook) that compose multiple low level stand alone objects (examples: mysql mapper, doctrine mapper) that compose various 3rd and in-house libraries (examples: doctrine, solr, xml-parser) what UML diagram is suited for this kind of overview presentation? thanks

    Read the article

  • speed up the speed of a sql query to mysql?

    - by fayer
    in my mysql database i've got the geonames database, containing all countries, states and cities. i am using this to create a cascading menu so the user could select where he is from: country - state - county - city. but the main problem is that the query will search through all the 7 millions rows in that table each time i want to get the list of children rows, and that is taking a while 10-15 seconds. i wonder how i could speed this up: caching? table views? reorganizing table structure somehow? and most important, how do i do these things? are there good tutorials you could link to me? i appreciate all help and feedback discussing smart ways of handling this issue!

    Read the article

  • help with selecting nodes with xpath

    - by fayer
    my xml structure looks like this: <entity id="1000070"> <name>apple</name> <type>category</type> <entities> <entity id="7002870"> <name>mac</name> <type>category</type> <entities> <entity id="7002907"> <name>leopard</name> <type>sub-category</type> <entities> <entity id="7024080"> <name>safari</name> <type>subject</type> </entity> <entity id="7024701"> <name>finder</name> <type>subject</type> </entity> </entities> </entity> </entities> </entity> <entity id="7024080"> <name>iphone</name> <type>category</type> <entities> <entity id="7024080"> <name>3g</name> <type>sub-category</type> </entity> <entity id="7024701"> <name>3gs</name> <type>sub-category</type> </entity> </entities> </entity> <entity id="7024080"> <name>ipad</name> <type>category</type> </entity> </entities> </entity> currently i have selected all entities with type node that is not category. $xmlDocument-removeNodes("//entity[not(type='category')]") i wonder how i could select all nodes that dont contain type=category OR type=sub-category. i have tried with: $xmlDocument->removeNodes("//entity[not(type='category')] | //entity[not(type='sub-category')]") but it doesnt work!

    Read the article

  • problem with Doctrine i18n in Symfony

    - by fayer
    i have table data i want to internationalize. i added this code in my schema.yml: I18n: fields: [name] and another table with a suffix "_translation" was created. the problem is that this table's id column is not auto-incremented. so when adding fixture data there will be a problem. i wonder if there is a way to make this column auto-incremented, or else i have to manually correct this for a lot of tables everytime i want to add fixture data. thanks.

    Read the article

  • Ruby-on-Rails equivalent to ORM Designer for Symfony?

    - by fayer
    In Symfony i just have to create models with ORM Designer and export it to symfony as a schema.yml and then use a symfony command to create tables, models and forms. I wonder if there is an equivalent to the RoR so that you dont have to create models manually by hand? It saves a lot of time using GUI for this kind of tasks and it is less error-prone. thanks

    Read the article

  • unknown exception error in php

    - by fayer
    i wanna catch all exceptions thrown in a script and then check if they have a error code 23000. if they don't i want to rethrow the exception. here is my code: function myException($exception) { /*** If it is a Doctrine Connection Mysql Duplication Exception ***/ if(get_class($exception) === 'Doctrine_Connection_Mysql_Exception' && $exception->getCode() === 23000) { echo "Duplicate entry"; } else { throw $exception; } } set_exception_handler('myException'); $contact = new Contact(); $contact->email = 'peter'; $contact->save(); but i get this error message and i dont know what it means: Fatal error: Exception thrown without a stack frame in Unknown on line 0 i want to be able to rethrow the original error message if it has not the error code 23000. even when i deleted the check errorcode i still get the same message: function myException($exception) { throw $exception; } set_exception_handler('myException'); $contact = new Contact(); $contact->email = 'peter'; $contact->save(); how could i solve this? thanks

    Read the article

  • what persistence layer (xml or mysql) should i use for this xml data?

    - by fayer
    i wonder how i could store a xml structure in a persistence layer. cause the relational data looks like: <entity id="1000070"> <name>apple</name> <entities> <entity id="7002870"> <name>mac</name> <entities> <entity id="7002907"> <name>leopard</name> <entities> <entity id="7024080"> <name>safari</name> </entity> <entity id="7024701"> <name>finder</name> </entity> </entities> </entity> </entities> </entity> <entity id="7024080"> <name>iphone</name> <entities> <entity id="7024080"> <name>3g</name> </entity> <entity id="7024701"> <name>3gs</name> </entity> </entities> </entity> <entity id="7024080"> <name>ipad</name> </entity> </entities> </entity> as you can see, it has no static structure but a dynamical one. mac got 2 descendant levels while iphone got 1 and ipad got 0. i wonder how i could store this data the best way? what are my options. cause it seems impossible to store it in a mysql database due to this dynamical structure. is the only way to store it as a xml file then? is the speed of getting information (xpath/xquery/simplexml) from a xml file worse or greater than from mysql? what are the pros and cons? do i have other options? is storing information in xml files, suited for a lot of users accessing it at the same time? would be great with feedbacks!! thanks! EDIT: now i noticed that i could use something called xml database to store xml data. could someone shed a light on this issue? cause apparently its not as simple as just store data in a xml file?

    Read the article

  • tutorials/books to create a plugin/module/library?

    - by fayer
    i wonder if there are tutorials/books explaining how you create a library/plugin/module for other to implement? libraries/frameworks like solr, doctrine, codeigniter etc. cause it seems that they follow the same pattern. having one "bootstrap" file to load configurations, other classes and so on. i aim to understand the basics, so i can create a such library. cause at the moment i want to code an address book that other can use. just include a bootstrap file and they are ready to use my classes (like Doctrine). recommendations of sources to learn these things of stuff? you experienced guys, how did you learn it? thanks.

    Read the article

  • will php/apache ever support multi threading?

    - by fayer
    i mainly focus on the web, i think i will never create desktop applications. so i think it's better for me to focus on typical web languages like php. i know an advantage java has over php is multi threading though. will php ever support this feature in the future? thanks

    Read the article

  • doctrine query() params?

    - by fayer
    i created a Doctrine_Query and executes it but i wanna know what params i can pass to it. $q = Doctrine_Query::create() ->select('cl.id, cl.name') ->from('ContactList cl'); $contactLists = $q->execute($params, $hydrationMode); from the api documentation: execute($params = array(), $hydrationMode = null) where do they tell me about the params? and also hydration mode. seems like i cannot find anything in the documentations. would be great if they had a reference for everything. thanks

    Read the article

  • selenium vs phpunit/lime?

    - by fayer
    i have seen the power of selenium and that it can give you the tests in different languages. so the question is, why should i use phpunit or lime (for symfony) when a solution like selenium is available? isn't it time-consuming to write all the tests by hand, when you can just use selenium? thanks.

    Read the article

  • restaurant menu card tutorial for drupal?

    - by fayer
    im new on drupal and want to make a menu for a restaurant showing all the dishes with photos, prices and descriptions in categories (japanese food, chinese food etc). i wonder if there are some great tutorials or modules for this? i cant find any on the web. thanks you

    Read the article

< Previous Page | 1 2 3 4 5 6  | Next Page >